* use __stklen

This commit is contained in:
peter 2004-11-01 14:52:02 +00:00
parent 698bdc9926
commit 78ff575ee4

View File

@ -1,34 +1,34 @@
{ Old file: tbs0227.pp } { Old file: tbs0227.pp }
{ external var does strange things when declared in localsymtable OK 0.99.11 (PFV) } { external var does strange things when declared in localsymtable OK 0.99.11 (PFV) }
function getheapsize:longint;assembler; function getstacksize:longint;assembler;
var var
heapsize : longint;external name 'HEAPSIZE'; stacksize : ptrint;external name '__stklen';
// sbrk : longint;external name '___sbrk'; // sbrk : longint;external name '___sbrk';
asm asm
{$ifdef CPUI386} {$ifdef CPUI386}
movl HEAPSIZE,%eax movl stacksize,%eax
end ['EAX']; end ['EAX'];
{$endif CPUI386} {$endif CPUI386}
{$ifdef CPUX86_64} {$ifdef CPUX86_64}
movl HEAPSIZE,%eax movl stacksize,%eax
end ['EAX']; end ['EAX'];
{$endif CPUX86_64} {$endif CPUX86_64}
{$ifdef CPU68K} {$ifdef CPU68K}
move.l HEAPSIZE,d0 move.l stacksize,d0
end ['D0']; end ['D0'];
{$endif CPU68K} {$endif CPU68K}
{$ifdef cpupowerpc} {$ifdef cpupowerpc}
lis r3, heapsize@ha lis r3, stacksize@ha
lwz r3, heapsize@l(r3) lwz r3, stacksize@l(r3)
end; end;
{$endif cpupowerpc} {$endif cpupowerpc}
{$ifdef cpusparc} {$ifdef cpusparc}
sethi %hi(heapsize),%i0 sethi %hi(stacksize),%i0
or %i0,%lo(heapsize),%i0 or %i0,%lo(stacksize),%i0
end; end;
{$endif cpusparc} {$endif cpusparc}
begin begin
writeln(getheapsize); writeln(getstacksize);
end. end.