* saveregister is now working and used for assert and iocheck (which has

been moved to system.inc because it's now system independent)
This commit is contained in:
peter 1999-08-05 23:45:09 +00:00
parent e7fd9b1dd8
commit c5faa84f92
4 changed files with 53 additions and 12 deletions

View File

@ -2693,6 +2693,12 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
exprasmlist^.insert(new(pai386,op_reg(A_PUSH,S_L,R_EDI)));
end;
{ for the save all registers we can simply use a pusha,popa which
push edi,esi,ebp,esp(ignored),ebx,edx,ecx,eax }
if (po_saveregisters in aktprocsym^.definition^.procoptions) then
begin
exprasmlist^.insert(new(pai386,op_none(A_PUSHA,S_L)));
end;
{ omit stack frame ? }
if not inlined then
@ -3067,6 +3073,13 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
}
end;
{ for the save all registers we can simply use a pusha,popa which
push edi,esi,ebp,esp(ignored),ebx,edx,ecx,eax }
if (po_saveregisters in aktprocsym^.definition^.procoptions) then
begin
exprasmlist^.concat(new(pai386,op_none(A_POPA,S_L)));
end;
if not(nostackframe) and not inlined then
exprasmlist^.concat(new(pai386,op_none(A_LEAVE,S_NO)));
{ parameters are limited to 65535 bytes because }
@ -3163,7 +3176,11 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
end.
{
$Log$
Revision 1.26 1999-08-05 14:58:04 florian
Revision 1.27 1999-08-05 23:45:09 peter
* saveregister is now working and used for assert and iocheck (which has
been moved to system.inc because it's now system independent)
Revision 1.26 1999/08/05 14:58:04 florian
* some fixes for the floating point registers
* more things for the new code generator

View File

@ -991,6 +991,7 @@ begin
{ Temporary defines, until things settle down }
def_symbol('INT64');
def_symbol('HASRESOURCESTRINGS');
def_symbol('HASSAVEREGISTERS');
{ some stuff for TP compatibility }
{$ifdef i386}
@ -1160,7 +1161,11 @@ end;
end.
{
$Log$
Revision 1.9 1999-08-04 13:02:46 jonas
Revision 1.10 1999-08-05 23:45:10 peter
* saveregister is now working and used for assert and iocheck (which has
been moved to system.inc because it's now system independent)
Revision 1.9 1999/08/04 13:02:46 jonas
* all tokens now start with an underscore
* PowerPC compiles!!

View File

@ -795,6 +795,8 @@ end;
{$endif def SYSTEMDEBUG}
{$ifndef HASSAVEREGISTERS}
{****************************************************************************
IoCheck
****************************************************************************}
@ -818,11 +820,15 @@ begin
end;
end;
{$endif not HASSAVEREGISTERS}
{
$Log$
Revision 1.49 1999-07-06 10:53:52 peter
Revision 1.50 1999-08-05 23:45:12 peter
* saveregister is now working and used for assert and iocheck (which has
been moved to system.inc because it's now system independent)
Revision 1.49 1999/07/06 10:53:52 peter
* removed temp defines
Revision 1.48 1999/07/03 09:03:47 florian

View File

@ -311,6 +311,21 @@ begin
end;
{$ifdef HASSAVEREGISTERS}
procedure int_iocheck(addr : longint);[saveregisters,public,alias:'FPC_IOCHECK'];
var
l : longint;
begin
if InOutRes<>0 then
begin
l:=InOutRes;
InOutRes:=0;
HandleErrorFrame(l,get_frame);
end;
end;
{$endif}
Function IOResult:Word;
Begin
IOResult:=InOutRes;
@ -531,20 +546,14 @@ begin
end;
Procedure int_assert(Const Msg,FName:string;LineNo,ErrorAddr:Longint); [Public,Alias : 'FPC_ASSERT'];
Procedure int_assert(Const Msg,FName:string;LineNo,ErrorAddr:Longint); [{$ifdef HASSAVEREGISTERS}SaveRegisters,{$endif}Public,Alias : 'FPC_ASSERT'];
type
TAssertErrorProc=procedure(const msg,fname:string;lineno,erroraddr:longint);
begin
asm
pushal
end;
if AssertErrorProc<>nil then
TAssertErrorProc(AssertErrorProc)(Msg,FName,LineNo,ErrorAddr)
else
HandleError(227);
asm
popal
end;
end;
@ -573,7 +582,11 @@ end;
{
$Log$
Revision 1.65 1999-07-28 12:58:22 peter
Revision 1.66 1999-08-05 23:45:14 peter
* saveregister is now working and used for assert and iocheck (which has
been moved to system.inc because it's now system independent)
Revision 1.65 1999/07/28 12:58:22 peter
* fixed assert() to push/pop registers
Revision 1.64 1999/07/05 20:04:27 peter