sinclairql: initial heap allocation code, and minor system unit bits

git-svn-id: trunk@47351 -
This commit is contained in:
Károly Balogh 2020-11-08 20:50:32 +00:00
parent b90d6e1114
commit d5596ef21d
3 changed files with 23 additions and 1 deletions

View File

@ -18,12 +18,15 @@
****************************************************************************} ****************************************************************************}
function SysOSAlloc(size: ptruint): pointer; function SysOSAlloc(size: ptruint): pointer;
begin begin
Result:=mt_alchp(size, nil, -1);
end; end;
{$define HAS_SYSOSFREE} {$define HAS_SYSOSFREE}
procedure SysOSFree(p: pointer; size: ptruint); procedure SysOSFree(p: pointer; size: ptruint);
begin begin
mt_rechp(p);
end; end;

View File

@ -15,6 +15,8 @@
**********************************************************************} **********************************************************************}
{$i qdos.inc}
procedure Error2InOutRes(errno: longint); procedure Error2InOutRes(errno: longint);
begin begin
end; end;

View File

@ -122,8 +122,12 @@ var
{***************************************************************************** {*****************************************************************************
System Dependent Exit code System Dependent Exit code
*****************************************************************************} *****************************************************************************}
procedure haltproc(e:longint); external name '_haltproc';
procedure system_exit; procedure system_exit;
begin begin
haltproc(exitcode);
end; end;
{***************************************************************************** {*****************************************************************************
@ -146,6 +150,19 @@ begin
CheckInitialStkLen := StkLen; CheckInitialStkLen := StkLen;
end; end;
procedure PrintStr(const s: shortstring);
begin
io_sstrg($00010001,-1,@s[1],ord(s[0]));
end;
procedure PrintStr2(const s: shortstring);
var
i: smallint;
begin
for i:=1 to ord(s[0]) do
io_sbyte($00010001,-1,s[i]);
end;
begin begin
StackLength := CheckInitialStkLen (InitialStkLen); StackLength := CheckInitialStkLen (InitialStkLen);
@ -160,7 +177,7 @@ begin
InitUnicodeStringManager; InitUnicodeStringManager;
{$endif FPC_HAS_FEATURE_UNICODESTRINGS} {$endif FPC_HAS_FEATURE_UNICODESTRINGS}
{ Setup stdin, stdout and stderr } { Setup stdin, stdout and stderr }
SysInitStdIO; (* SysInitStdIO;*)
{ Reset IO Error } { Reset IO Error }
InOutRes:=0; InOutRes:=0;
{ Setup command line arguments } { Setup command line arguments }