* added $define FPC_SYSTEM_HAS_... for use with generic.inc

This commit is contained in:
pierre 1999-05-31 22:03:37 +00:00
parent 9a21e0d1e2
commit 13b4e5f347

View File

@ -22,6 +22,8 @@
Move / Fill Move / Fill
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_MOVE}
procedure Move(var source;var dest;count:longint); procedure Move(var source;var dest;count:longint);
begin begin
asm asm
@ -90,6 +92,8 @@ begin
end; end;
{$define FPC_SYSTEM_HAS_FILLCHAR}
Procedure FillChar(var x;count:longint;value:byte); Procedure FillChar(var x;count:longint;value:byte);
begin begin
asm asm
@ -124,6 +128,8 @@ begin
end; end;
{$define FPC_SYSTEM_HAS_FILLWORD}
procedure fillword(var x;count : longint;value : word); procedure fillword(var x;count : longint;value : word);
begin begin
asm asm
@ -151,6 +157,8 @@ end;
Object Helpers Object Helpers
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_FPC_HELP_CONSTRUCTOR}
procedure int_help_constructor;assembler; [public,alias:'FPC_HELP_CONSTRUCTOR']; procedure int_help_constructor;assembler; [public,alias:'FPC_HELP_CONSTRUCTOR'];
asm asm
{ Entry without preamble, since we need the ESP of the constructor { Entry without preamble, since we need the ESP of the constructor
@ -218,6 +226,8 @@ asm
end; end;
{$define FPC_SYSTEM_HAS_FPC_HELP_DESTRUCTOR}
procedure int_help_destructor;assembler;[public,alias:'FPC_HELP_DESTRUCTOR']; procedure int_help_destructor;assembler;[public,alias:'FPC_HELP_DESTRUCTOR'];
asm asm
{ Stack (relative to %ebp): { Stack (relative to %ebp):
@ -258,6 +268,8 @@ end;
{$asmmode DIRECT} {$asmmode DIRECT}
{$endif} {$endif}
{$define FPC_SYSTEM_HAS_FPC_NEW_CLASS}
procedure int_new_class;assembler;[public,alias:'FPC_NEW_CLASS']; procedure int_new_class;assembler;[public,alias:'FPC_NEW_CLASS'];
asm asm
{ to be sure in the future, we save also edit } { to be sure in the future, we save also edit }
@ -288,6 +300,8 @@ asm
end; end;
{$define FPC_SYSTEM_HAS_FPC_DISPOSE_CLASS}
procedure int_dispose_class;assembler;[public,alias:'FPC_DISPOSE_CLASS']; procedure int_dispose_class;assembler;[public,alias:'FPC_DISPOSE_CLASS'];
asm asm
{ to be sure in the future, we save also edit } { to be sure in the future, we save also edit }
@ -321,6 +335,9 @@ end;
{ checks for a correct vmt pointer } { checks for a correct vmt pointer }
{$define FPC_SYSTEM_HAS_FPC_CHECK_OBJECT}
{$ifdef SYSTEMDEBUG} {$ifdef SYSTEMDEBUG}
{ we want the stack for debugging !! PM } { we want the stack for debugging !! PM }
procedure int_check_object(obj : pointer);[public,alias:'FPC_CHECK_OBJECT']; procedure int_check_object(obj : pointer);[public,alias:'FPC_CHECK_OBJECT'];
@ -363,6 +380,8 @@ end;
{ deeper check to see if the current object is } { deeper check to see if the current object is }
{ really related to the true } { really related to the true }
{$define FPC_SYSTEM_HAS_FPC_CHECK_OBJECT_EXT}
procedure int_check_object_ext;assembler;[public,alias:'FPC_CHECK_OBJECT_EXT']; procedure int_check_object_ext;assembler;[public,alias:'FPC_CHECK_OBJECT_EXT'];
asm asm
pushl %ebp pushl %ebp
@ -406,6 +425,8 @@ end;
String String
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_FPC_SHORTSTR_COPY}
procedure int_strcopy(len:longint;sstr,dstr:pointer);[public,alias:'FPC_SHORTSTR_COPY']; procedure int_strcopy(len:longint;sstr,dstr:pointer);[public,alias:'FPC_SHORTSTR_COPY'];
{ {
this procedure must save all modified registers except EDI and ESI !!! this procedure must save all modified registers except EDI and ESI !!!
@ -447,6 +468,7 @@ begin
end ['ESI','EDI']; end ['ESI','EDI'];
end; end;
{$define FPC_SYSTEM_HAS_FPC_SHORTSTR_CONCAT}
procedure int_strconcat(s1,s2:pointer);[public,alias:'FPC_SHORTSTR_CONCAT']; procedure int_strconcat(s1,s2:pointer);[public,alias:'FPC_SHORTSTR_CONCAT'];
begin begin
@ -486,6 +508,7 @@ begin
end ['EBX','ECX','EAX','ESI','EDI']; end ['EBX','ECX','EAX','ESI','EDI'];
end; end;
{$define FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
procedure int_strcmp(dstr,sstr:pointer);[public,alias:'FPC_SHORTSTR_COMPARE']; procedure int_strcmp(dstr,sstr:pointer);[public,alias:'FPC_SHORTSTR_COMPARE'];
begin begin
@ -535,6 +558,7 @@ begin
end ['EDX','ECX','EBX','EAX','ESI','EDI']; end ['EDX','ECX','EBX','EAX','ESI','EDI'];
end; end;
{$define FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
function strpas(p:pchar):string;[public,alias:'FPC_PCHAR_TO_SHORTSTR']; function strpas(p:pchar):string;[public,alias:'FPC_PCHAR_TO_SHORTSTR'];
begin begin
@ -585,6 +609,7 @@ begin
end ['ECX','EAX','ESI','EDI']; end ['ECX','EAX','ESI','EDI'];
end; end;
{$define FPC_SYSTEM_HAS_STRLEN}
function strlen(p:pchar):longint;assembler; function strlen(p:pchar):longint;assembler;
asm asm
@ -603,11 +628,14 @@ end ['EDI','ECX','EAX'];
Caller/StackFrame Helpers Caller/StackFrame Helpers
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_GET_FRAME}
function get_frame:longint;assembler; function get_frame:longint;assembler;
asm asm
movl %ebp,%eax movl %ebp,%eax
end ['EAX']; end ['EAX'];
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
function get_caller_addr(framebp:longint):longint;assembler; function get_caller_addr(framebp:longint):longint;assembler;
asm asm
@ -618,6 +646,7 @@ asm
.Lg_a_null: .Lg_a_null:
end ['EAX']; end ['EAX'];
{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
function get_caller_frame(framebp:longint):longint;assembler; function get_caller_frame(framebp:longint):longint;assembler;
asm asm
@ -633,6 +662,8 @@ end ['EAX'];
Math Math
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_ABS_LONGINT}
function abs(l:longint):longint;assembler;[internconst:in_const_abs]; function abs(l:longint):longint;assembler;[internconst:in_const_abs];
asm asm
movl l,%eax movl l,%eax
@ -642,6 +673,7 @@ asm
.LMABS1: .LMABS1:
end ['EAX']; end ['EAX'];
{$define FPC_SYSTEM_HAS_ODD_LONGINT}
function odd(l:longint):boolean;assembler;[internconst:in_const_odd]; function odd(l:longint):boolean;assembler;[internconst:in_const_odd];
asm asm
@ -650,6 +682,7 @@ asm
setnz %al setnz %al
end ['EAX']; end ['EAX'];
{$define FPC_SYSTEM_HAS_SQR_LONGINT}
function sqr(l:longint):longint;assembler;[internconst:in_const_sqr]; function sqr(l:longint):longint;assembler;[internconst:in_const_sqr];
asm asm
@ -658,6 +691,8 @@ asm
end ['EAX']; end ['EAX'];
{$define FPC_SYSTEM_HAS_SPTR}
Function Sptr : Longint;assembler; Function Sptr : Longint;assembler;
asm asm
movl %esp,%eax movl %esp,%eax
@ -668,6 +703,8 @@ end;
Str() Str()
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_INT_STR_LONGINT}
procedure int_str(l : longint;var s : string); procedure int_str(l : longint;var s : string);
var var
buffer : array[0..11] of byte; buffer : array[0..11] of byte;
@ -708,6 +745,7 @@ begin
end; end;
end; end;
{$define FPC_SYSTEM_HAS_INT_STR_CARDINAL}
procedure int_str(c : cardinal;var s : string); procedure int_str(c : cardinal;var s : string);
var var
@ -743,6 +781,8 @@ end;
Bounds Check Bounds Check
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_FPC_BOUNDCHECK}
{$ifdef SYSTEMDEBUG} {$ifdef SYSTEMDEBUG}
{ we want the stack for debugging !! PM } { we want the stack for debugging !! PM }
procedure int_boundcheck;[public,alias: 'FPC_BOUNDCHECK']; procedure int_boundcheck;[public,alias: 'FPC_BOUNDCHECK'];
@ -773,6 +813,7 @@ end;
{**************************************************************************** {****************************************************************************
IoCheck IoCheck
****************************************************************************} ****************************************************************************}
{$define FPC_SYSTEM_HAS_FPC_IOCHECK}
procedure int_iocheck(addr : longint);[public,alias:'FPC_IOCHECK']; procedure int_iocheck(addr : longint);[public,alias:'FPC_IOCHECK'];
var var
@ -796,7 +837,10 @@ end;
{ {
$Log$ $Log$
Revision 1.46 1999-05-31 12:49:19 peter Revision 1.47 1999-05-31 22:03:37 pierre
* added $define FPC_SYSTEM_HAS_... for use with generic.inc
Revision 1.46 1999/05/31 12:49:19 peter
* smaller sptr function * smaller sptr function
Revision 1.45 1999/04/22 10:52:40 peter Revision 1.45 1999/04/22 10:52:40 peter