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