mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 13:29:14 +02:00
* Small adaptions to use the ATT parser a little bit more.
This commit is contained in:
parent
dbeb47f3bc
commit
9fcc870caf
@ -123,6 +123,7 @@ procedure st1(stack_size:longint);[public,alias: 'STACKCHECK'];
|
|||||||
begin
|
begin
|
||||||
{ called when trying to get local stack }
|
{ called when trying to get local stack }
|
||||||
{ if the compiler directive $S is set }
|
{ if the compiler directive $S is set }
|
||||||
|
{$ASMMODE DIRECT}
|
||||||
asm
|
asm
|
||||||
movl stack_size,%ebx
|
movl stack_size,%ebx
|
||||||
movl %esp,%eax
|
movl %esp,%eax
|
||||||
@ -130,23 +131,24 @@ begin
|
|||||||
{$ifdef SYSTEMDEBUG}
|
{$ifdef SYSTEMDEBUG}
|
||||||
movl U_SYSOS2_LOWESTSTACK,%ebx
|
movl U_SYSOS2_LOWESTSTACK,%ebx
|
||||||
cmpl %eax,%ebx
|
cmpl %eax,%ebx
|
||||||
jb .Lis_not_lowest
|
jb Lis_not_lowest
|
||||||
movl %eax,U_SYSOS2_LOWESTSTACK
|
movl %eax,U_SYSOS2_LOWESTSTACK
|
||||||
.Lis_not_lowest:
|
Lis_not_lowest:
|
||||||
{$endif SYSTEMDEBUG}
|
{$endif SYSTEMDEBUG}
|
||||||
cmpb $2,U_SYSOS2_OS_MODE
|
cmpb $2,U_SYSOS2_OS_MODE
|
||||||
jne .Lrunning_in_dos
|
jne Lrunning_in_dos
|
||||||
movl U_SYSOS2_STACKBOTTOM,%ebx
|
movl U_SYSOS2_STACKBOTTOM,%ebx
|
||||||
jmp .Lrunning_in_os2
|
jmp Lrunning_in_os2
|
||||||
.Lrunning_in_dos:
|
Lrunning_in_dos:
|
||||||
movl __heap_brk,%ebx
|
movl __heap_brk,%ebx
|
||||||
.Lrunning_in_os2:
|
Lrunning_in_os2:
|
||||||
cmpl %eax,%ebx
|
cmpl %eax,%ebx
|
||||||
jae .Lshort_on_stack
|
jae Lshort_on_stack
|
||||||
leave
|
leave
|
||||||
ret $4
|
ret $4
|
||||||
.Lshort_on_stack:
|
Lshort_on_stack:
|
||||||
end ['EAX','EBX'];
|
end ['EAX','EBX'];
|
||||||
|
{$ASMMODE ATT}
|
||||||
{ this needs a local variable }
|
{ this needs a local variable }
|
||||||
{ so the function called itself !! }
|
{ so the function called itself !! }
|
||||||
{ Writeln('low in stack ');}
|
{ Writeln('low in stack ');}
|
||||||
@ -170,28 +172,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function paramcount:longint;
|
|
||||||
|
|
||||||
begin
|
{$asmmode direct}
|
||||||
asm
|
function paramcount:longint;assembler;
|
||||||
|
|
||||||
|
asm
|
||||||
movl _argc,%eax
|
movl _argc,%eax
|
||||||
decl %eax
|
decl %eax
|
||||||
leave
|
end ['EAX'];
|
||||||
ret
|
|
||||||
end ['EAX'];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function paramstr(l:longint):string;
|
function paramstr(l:longint):string;
|
||||||
|
|
||||||
function args:pointer;
|
function args:pointer;assembler;
|
||||||
|
|
||||||
begin
|
|
||||||
asm
|
asm
|
||||||
movl _argv,%eax
|
movl _argv,%eax
|
||||||
leave
|
|
||||||
ret
|
|
||||||
end ['EAX'];
|
end ['EAX'];
|
||||||
end;
|
|
||||||
|
|
||||||
var p:^Pchar;
|
var p:^Pchar;
|
||||||
|
|
||||||
@ -204,6 +200,8 @@ begin
|
|||||||
else paramstr:='';
|
else paramstr:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$asmmode att}
|
||||||
|
|
||||||
procedure randomize;
|
procedure randomize;
|
||||||
|
|
||||||
var hl:longint;
|
var hl:longint;
|
||||||
@ -239,15 +237,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function getheapstart:pointer;
|
{$ASMMODE direct}
|
||||||
|
function getheapstart:pointer;assembler;
|
||||||
|
|
||||||
begin
|
asm
|
||||||
asm
|
|
||||||
movl __heap_base,%eax
|
movl __heap_base,%eax
|
||||||
leave
|
end ['EAX'];
|
||||||
ret
|
{$ASMMODE att}
|
||||||
end ['EAX'];
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$i heap.inc}
|
{$i heap.inc}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user