mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 00:39:34 +02:00
* win32 regcall patches
This commit is contained in:
parent
06b0430c9f
commit
6b6741b41c
@ -188,10 +188,14 @@ end;
|
||||
{$define FPC_UNIT_HAS_STRCOMP}
|
||||
function strcomp(str1,str2 : pchar) : longint;assembler;
|
||||
var
|
||||
saveesi,saveedi : longint;
|
||||
saveeax,saveedx,saveesi,saveedi : longint;
|
||||
asm
|
||||
movl %edi,saveedi
|
||||
movl %esi,saveesi
|
||||
{$ifdef REGCALL}
|
||||
movl %eax,saveeax
|
||||
movl %edx,saveedx
|
||||
{$endif}
|
||||
movl str2,%edi
|
||||
movl $0xffffffff,%ecx
|
||||
cld
|
||||
@ -199,8 +203,13 @@ asm
|
||||
repne
|
||||
scasb
|
||||
not %ecx
|
||||
{$ifdef REGCALL}
|
||||
movl saveedx,%edi
|
||||
movl saveeax,%esi
|
||||
{$else}
|
||||
movl str2,%edi
|
||||
movl str1,%esi
|
||||
{$endif}
|
||||
repe
|
||||
cmpsb
|
||||
movb -1(%esi),%al
|
||||
@ -215,10 +224,15 @@ end;
|
||||
{$define FPC_UNIT_HAS_STRLCOMP}
|
||||
function strlcomp(str1,str2 : pchar;l : longint) : longint;assembler;
|
||||
var
|
||||
saveesi,saveedi : longint;
|
||||
saveeax,saveedx,saveecx,saveesi,saveedi : longint;
|
||||
asm
|
||||
movl %edi,saveedi
|
||||
movl %esi,saveesi
|
||||
{$ifdef REGCALL}
|
||||
movl %eax,saveeax
|
||||
movl %edx,saveedx
|
||||
movl %ecx,saveecx
|
||||
{$endif}
|
||||
movl str2,%edi
|
||||
movl $0xffffffff,%ecx
|
||||
cld
|
||||
@ -226,12 +240,17 @@ asm
|
||||
repne
|
||||
scasb
|
||||
not %ecx
|
||||
cmpl l,%ecx
|
||||
cmpl saveecx,%ecx
|
||||
jl .LSTRLCOMP1
|
||||
movl l,%ecx
|
||||
movl saveecx,%ecx
|
||||
.LSTRLCOMP1:
|
||||
{$ifdef REGCALL}
|
||||
movl saveedx,%edi
|
||||
movl saveeax,%esi
|
||||
{$else}
|
||||
movl str2,%edi
|
||||
movl str1,%esi
|
||||
{$endif}
|
||||
repe
|
||||
cmpsb
|
||||
movb -1(%esi),%al
|
||||
@ -246,10 +265,14 @@ end;
|
||||
{$define FPC_UNIT_HAS_STRICOMP}
|
||||
function stricomp(str1,str2 : pchar) : longint;assembler;
|
||||
var
|
||||
saveesi,saveedi : longint;
|
||||
saveeax,saveedx,saveesi,saveedi : longint;
|
||||
asm
|
||||
movl %edi,saveedi
|
||||
movl %esi,saveesi
|
||||
{$ifdef REGCALL}
|
||||
movl %eax,saveeax
|
||||
movl %edx,saveedx
|
||||
{$endif}
|
||||
movl str2,%edi
|
||||
movl $0xffffffff,%ecx
|
||||
cld
|
||||
@ -257,8 +280,13 @@ asm
|
||||
repne
|
||||
scasb
|
||||
not %ecx
|
||||
{$ifdef REGCALL}
|
||||
movl saveedx,%edi
|
||||
movl saveeax,%esi
|
||||
{$else}
|
||||
movl str2,%edi
|
||||
movl str1,%esi
|
||||
{$endif}
|
||||
.LSTRICOMP2:
|
||||
repe
|
||||
cmpsb
|
||||
@ -289,10 +317,15 @@ end;
|
||||
{$define FPC_UNIT_HAS_STRLICOMP}
|
||||
function strlicomp(str1,str2 : pchar;l : longint) : longint;assembler;
|
||||
var
|
||||
saveesi,saveedi : longint;
|
||||
saveeax,saveedx,saveecx,saveesi,saveedi : longint;
|
||||
asm
|
||||
movl %edi,saveedi
|
||||
movl %esi,saveesi
|
||||
{$ifdef REGCALL}
|
||||
movl %eax,saveeax
|
||||
movl %edx,saveedx
|
||||
movl %ecx,saveecx
|
||||
{$endif}
|
||||
movl str2,%edi
|
||||
movl $0xffffffff,%ecx
|
||||
cld
|
||||
@ -300,12 +333,17 @@ asm
|
||||
repne
|
||||
scasb
|
||||
not %ecx
|
||||
cmpl l,%ecx
|
||||
cmpl saveecx,%ecx
|
||||
jl .LSTRLICOMP5
|
||||
movl l,%ecx
|
||||
movl saveecx,%ecx
|
||||
.LSTRLICOMP5:
|
||||
{$ifdef REGCALL}
|
||||
movl saveedx,%edi
|
||||
movl saveeax,%esi
|
||||
{$else}
|
||||
movl str2,%edi
|
||||
movl str1,%esi
|
||||
{$endif}
|
||||
.LSTRLICOMP2:
|
||||
repe
|
||||
cmpsb
|
||||
@ -561,7 +599,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.11 2003-11-23 16:50:49 peter
|
||||
Revision 1.12 2003-12-17 21:56:33 peter
|
||||
* win32 regcall patches
|
||||
|
||||
Revision 1.11 2003/11/23 16:50:49 peter
|
||||
* register calling updates
|
||||
|
||||
Revision 1.10 2003/11/11 21:08:17 peter
|
||||
|
@ -605,7 +605,7 @@ end;
|
||||
stdcall;external 'kernel32' name 'GetCurrentDirectoryA';
|
||||
|
||||
type
|
||||
TDirFnType=function(name:pointer):longbool;
|
||||
TDirFnType=function(name:pointer):longbool;stdcall;
|
||||
|
||||
procedure dirfn(afunc : TDirFnType;const s:string);
|
||||
var
|
||||
@ -621,7 +621,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function CreateDirectoryTrunc(name:pointer):longbool;
|
||||
function CreateDirectoryTrunc(name:pointer):longbool;stdcall;
|
||||
begin
|
||||
CreateDirectoryTrunc:=CreateDirectory(name,nil);
|
||||
end;
|
||||
@ -1258,6 +1258,13 @@ begin
|
||||
end;
|
||||
{ build a fake stack }
|
||||
asm
|
||||
{$ifdef REGCALL}
|
||||
movl ebp,%ecx
|
||||
movl eip,%edx
|
||||
movl error,%eax
|
||||
pushl eip
|
||||
movl ebp,%ebp // Change frame pointer
|
||||
{$else}
|
||||
movl ebp,%eax
|
||||
pushl %eax
|
||||
movl eip,%eax
|
||||
@ -1267,6 +1274,7 @@ begin
|
||||
movl eip,%eax
|
||||
pushl %eax
|
||||
movl ebp,%ebp // Change frame pointer
|
||||
{$endif}
|
||||
|
||||
{$ifdef SYSTEMEXCEPTIONDEBUG}
|
||||
jmpl DebugHandleErrorAddrFrame
|
||||
@ -1540,7 +1548,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.50 2003-12-04 20:52:41 peter
|
||||
Revision 1.51 2003-12-17 21:56:33 peter
|
||||
* win32 regcall patches
|
||||
|
||||
Revision 1.50 2003/12/04 20:52:41 peter
|
||||
* stdcall for CreateFile
|
||||
|
||||
Revision 1.49 2003/11/24 23:08:37 michael
|
||||
|
Loading…
Reference in New Issue
Block a user