mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 20:09:18 +02:00
* register calling updates
This commit is contained in:
parent
e7c99a0e41
commit
0d3948fc5f
@ -1100,7 +1100,7 @@ End;
|
|||||||
mov es:[di], al
|
mov es:[di], al
|
||||||
end;
|
end;
|
||||||
{$else fpc}
|
{$else fpc}
|
||||||
assembler;
|
assembler;stdcall;
|
||||||
asm
|
asm
|
||||||
push edi
|
push edi
|
||||||
push ebx
|
push ebx
|
||||||
@ -1152,7 +1152,7 @@ End;
|
|||||||
mov @Result,ax
|
mov @Result,ax
|
||||||
end;
|
end;
|
||||||
{$else fpc}
|
{$else fpc}
|
||||||
assembler;
|
assembler;stdcall;
|
||||||
asm
|
asm
|
||||||
push edi
|
push edi
|
||||||
push ebx
|
push ebx
|
||||||
@ -1190,7 +1190,7 @@ End;
|
|||||||
end;
|
end;
|
||||||
{$else asmgraph}
|
{$else asmgraph}
|
||||||
{ note: still needs or/and/notput support !!!!! (JM) }
|
{ note: still needs or/and/notput support !!!!! (JM) }
|
||||||
assembler;
|
assembler;stdcall;
|
||||||
asm
|
asm
|
||||||
{$ifndef fpc}
|
{$ifndef fpc}
|
||||||
mov es, [SegA000]
|
mov es, [SegA000]
|
||||||
@ -1394,7 +1394,7 @@ const CrtAddress: word = 0;
|
|||||||
procedure SetVisualX(page: word); {$ifndef fpc}far;{$endif fpc}
|
procedure SetVisualX(page: word); {$ifndef fpc}far;{$endif fpc}
|
||||||
{ 4 page supPort... }
|
{ 4 page supPort... }
|
||||||
|
|
||||||
Procedure SetVisibleStart(AOffset: word); Assembler;
|
Procedure SetVisibleStart(AOffset: word); Assembler;stdcall;
|
||||||
(* Select where the left corner of the screen will be *)
|
(* Select where the left corner of the screen will be *)
|
||||||
{ By Matt Pritchard }
|
{ By Matt Pritchard }
|
||||||
asm
|
asm
|
||||||
@ -1545,7 +1545,7 @@ const CrtAddress: word = 0;
|
|||||||
end;
|
end;
|
||||||
{$else asmgraph}
|
{$else asmgraph}
|
||||||
{ note: still needs or/and/notput support !!!!! (JM) }
|
{ note: still needs or/and/notput support !!!!! (JM) }
|
||||||
Assembler;
|
Assembler;stdcall;
|
||||||
asm
|
asm
|
||||||
mov di,[Y] ; (* DI = Y coordinate *)
|
mov di,[Y] ; (* DI = Y coordinate *)
|
||||||
(* Multiply by 80 start *)
|
(* Multiply by 80 start *)
|
||||||
@ -2746,7 +2746,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.10 2003-10-03 21:46:25 peter
|
Revision 1.11 2003-12-04 21:42:07 peter
|
||||||
|
* register calling updates
|
||||||
|
|
||||||
|
Revision 1.10 2003/10/03 21:46:25 peter
|
||||||
* stdcall fixes
|
* stdcall fixes
|
||||||
|
|
||||||
Revision 1.9 2002/09/07 16:01:18 peter
|
Revision 1.9 2002/09/07 16:01:18 peter
|
||||||
|
@ -20,6 +20,7 @@ unit ports;
|
|||||||
{ this unit uses classes so
|
{ this unit uses classes so
|
||||||
ObjFpc mode is required PM }
|
ObjFpc mode is required PM }
|
||||||
{$Mode ObjFpc}
|
{$Mode ObjFpc}
|
||||||
|
{$Calling StdCall}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -103,7 +104,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2002-09-07 16:01:18 peter
|
Revision 1.4 2003-12-04 21:42:07 peter
|
||||||
|
* register calling updates
|
||||||
|
|
||||||
|
Revision 1.3 2002/09/07 16:01:18 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -589,29 +589,78 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
function strcopy(dest,source : pchar) : pchar;assembler;
|
function strcopy(dest,source : pchar) : pchar;assembler;
|
||||||
|
var
|
||||||
|
saveeax,saveesi,saveedi : longint;
|
||||||
asm
|
asm
|
||||||
pushl %esi
|
movl %edi,saveedi
|
||||||
pushl %edi
|
movl %esi,saveesi
|
||||||
cld
|
{$ifdef REGCALL}
|
||||||
movl 12(%ebp),%edi
|
movl %eax,saveeax
|
||||||
movl $0xffffffff,%ecx
|
movl %edx,%edi
|
||||||
xorb %al,%al
|
{$else}
|
||||||
repne
|
movl source,%edi
|
||||||
scasb
|
{$endif}
|
||||||
not %ecx
|
testl %edi,%edi
|
||||||
movl 8(%ebp),%edi
|
jz .LStrCopyDone
|
||||||
movl 12(%ebp),%esi
|
leal 3(%edi),%ecx
|
||||||
movl %ecx,%eax
|
andl $-4,%ecx
|
||||||
shrl $2,%ecx
|
movl %edi,%esi
|
||||||
rep
|
subl %edi,%ecx
|
||||||
movsl
|
{$ifdef REGCALL}
|
||||||
movl %eax,%ecx
|
movl %eax,%edi
|
||||||
andl $3,%ecx
|
{$else}
|
||||||
rep
|
movl dest,%edi
|
||||||
movsb
|
{$endif}
|
||||||
movl 8(%ebp),%eax
|
jz .LStrCopyAligned
|
||||||
popl %edi
|
.LStrCopyAlignLoop:
|
||||||
popl %esi
|
movb (%esi),%al
|
||||||
|
incl %edi
|
||||||
|
incl %esi
|
||||||
|
testb %al,%al
|
||||||
|
movb %al,-1(%edi)
|
||||||
|
jz .LStrCopyDone
|
||||||
|
decl %ecx
|
||||||
|
jnz .LStrCopyAlignLoop
|
||||||
|
.balign 16
|
||||||
|
.LStrCopyAligned:
|
||||||
|
movl (%esi),%eax
|
||||||
|
movl %eax,%edx
|
||||||
|
leal 0x0fefefeff(%eax),%ecx
|
||||||
|
notl %edx
|
||||||
|
addl $4,%esi
|
||||||
|
andl %edx,%ecx
|
||||||
|
andl $0x080808080,%ecx
|
||||||
|
jnz .LStrCopyEndFound
|
||||||
|
movl %eax,(%edi)
|
||||||
|
addl $4,%edi
|
||||||
|
jmp .LStrCopyAligned
|
||||||
|
.LStrCopyEndFound:
|
||||||
|
testl $0x0ff,%eax
|
||||||
|
jz .LStrCopyByte
|
||||||
|
testl $0x0ff00,%eax
|
||||||
|
jz .LStrCopyWord
|
||||||
|
testl $0x0ff0000,%eax
|
||||||
|
jz .LStrCopy3Bytes
|
||||||
|
movl %eax,(%edi)
|
||||||
|
jmp .LStrCopyDone
|
||||||
|
.LStrCopy3Bytes:
|
||||||
|
xorb %dl,%dl
|
||||||
|
movw %ax,(%edi)
|
||||||
|
movb %dl,2(%edi)
|
||||||
|
jmp .LStrCopyDone
|
||||||
|
.LStrCopyWord:
|
||||||
|
movw %ax,(%edi)
|
||||||
|
jmp .LStrCopyDone
|
||||||
|
.LStrCopyByte:
|
||||||
|
movb %al,(%edi)
|
||||||
|
.LStrCopyDone:
|
||||||
|
{$ifdef REGCALL}
|
||||||
|
movl saveeax,%eax
|
||||||
|
{$else}
|
||||||
|
movl dest,%eax
|
||||||
|
{$endif}
|
||||||
|
movl saveedi,%edi
|
||||||
|
movl saveesi,%esi
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1513,7 +1562,10 @@ Begin
|
|||||||
End.
|
End.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.28 2003-11-03 09:42:27 marco
|
Revision 1.29 2003-12-04 21:42:07 peter
|
||||||
|
* register calling updates
|
||||||
|
|
||||||
|
Revision 1.28 2003/11/03 09:42:27 marco
|
||||||
* Peter's Cardinal<->Longint fixes patch
|
* Peter's Cardinal<->Longint fixes patch
|
||||||
|
|
||||||
Revision 1.27 2003/10/16 15:43:13 peter
|
Revision 1.27 2003/10/16 15:43:13 peter
|
||||||
|
@ -25,9 +25,7 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl __RESULT,%edi
|
movl __RESULT,%edi
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl l,%eax
|
movl l,%eax
|
||||||
{$endif}
|
|
||||||
stosl
|
stosl
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
movl $7,%ecx
|
movl $7,%ecx
|
||||||
@ -77,16 +75,10 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
movl $8,%ecx
|
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
|
||||||
movl %edx,%esi
|
|
||||||
movzbl %cl,%edx
|
|
||||||
{$else}
|
|
||||||
movl source,%esi
|
movl source,%esi
|
||||||
movzbl b,%edx
|
|
||||||
movl __RESULT,%edi
|
movl __RESULT,%edi
|
||||||
{$endif}
|
movzbl b,%edx
|
||||||
|
movl $8,%ecx
|
||||||
rep
|
rep
|
||||||
movsl
|
movsl
|
||||||
leal -32(%edi),%eax
|
leal -32(%edi),%eax
|
||||||
@ -692,7 +684,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 2003-12-03 23:06:35 peter
|
Revision 1.16 2003-12-04 21:42:07 peter
|
||||||
|
* register calling updates
|
||||||
|
|
||||||
|
Revision 1.15 2003/12/03 23:06:35 peter
|
||||||
* more fixes
|
* more fixes
|
||||||
|
|
||||||
Revision 1.14 2003/12/03 22:46:54 peter
|
Revision 1.14 2003/12/03 22:46:54 peter
|
||||||
|
@ -26,7 +26,11 @@ asm
|
|||||||
movl %edi,20(%eax)
|
movl %edi,20(%eax)
|
||||||
movl (%ebp),%edi
|
movl (%ebp),%edi
|
||||||
movl %edi,12(%eax)
|
movl %edi,12(%eax)
|
||||||
|
{$ifdef REGCALL}
|
||||||
|
leal 8(%ebp),%edi
|
||||||
|
{$else}
|
||||||
leal 12(%ebp),%edi
|
leal 12(%ebp),%edi
|
||||||
|
{$endif}
|
||||||
movl %edi,16(%eax)
|
movl %edi,16(%eax)
|
||||||
movl 8(%eax),%edi
|
movl 8(%eax),%edi
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
@ -54,7 +58,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2003-11-11 21:08:17 peter
|
Revision 1.5 2003-12-04 21:42:07 peter
|
||||||
|
* register calling updates
|
||||||
|
|
||||||
|
Revision 1.4 2003/11/11 21:08:17 peter
|
||||||
* REGCALL define added
|
* REGCALL define added
|
||||||
|
|
||||||
Revision 1.3 2002/09/07 16:01:19 peter
|
Revision 1.3 2002/09/07 16:01:19 peter
|
||||||
|
@ -244,7 +244,7 @@ begin
|
|||||||
{$ifdef VER1_0}
|
{$ifdef VER1_0}
|
||||||
Raise E at longint(Address){$ifdef ENHANCEDRAISE},longint(Frame){$endif};
|
Raise E at longint(Address){$ifdef ENHANCEDRAISE},longint(Frame){$endif};
|
||||||
{$else VER1_0}
|
{$else VER1_0}
|
||||||
Raise E at Address{$ifdef ENHANCEDRAISE},Frame){$endif};
|
Raise E at Address,Frame;
|
||||||
{$endif VER1_0}
|
{$endif VER1_0}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ end;
|
|||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Initialization/Finalization/exit code
|
Initialization/Finalization/exit code
|
||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
Type
|
Type
|
||||||
PPRecord = ^TPRecord;
|
PPRecord = ^TPRecord;
|
||||||
TPRecord = Record
|
TPRecord = Record
|
||||||
@ -397,7 +397,7 @@ Const
|
|||||||
|
|
||||||
procedure AddTerminateProc(TermProc: TTerminateProc);
|
procedure AddTerminateProc(TermProc: TTerminateProc);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
TPR : PPRecord;
|
TPR : PPRecord;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -406,8 +406,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
NextFunc:=TPList;
|
NextFunc:=TPList;
|
||||||
Func:=TermProc;
|
Func:=TermProc;
|
||||||
end;
|
end;
|
||||||
TPList:=TPR;
|
TPList:=TPR;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CallTerminateProcs: Boolean;
|
function CallTerminateProcs: Boolean;
|
||||||
@ -422,7 +422,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Result:=TPR^.Func();
|
Result:=TPR^.Func();
|
||||||
TPR:=TPR^.NextFunc;
|
TPR:=TPR^.NextFunc;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ begin{asm}
|
|||||||
// !!!!!!! depends on ABI !!!!!!!!
|
// !!!!!!! depends on ABI !!!!!!!!
|
||||||
end;
|
end;
|
||||||
{$define FPC_SYSTEM_HAS_SPTR}
|
{$define FPC_SYSTEM_HAS_SPTR}
|
||||||
function Sptr:Longint;{assembler;}
|
function Sptr:Pointer;{assembler;}
|
||||||
begin{asm}
|
begin{asm}
|
||||||
{$warning FIX ME!}
|
{$warning FIX ME!}
|
||||||
end;
|
end;
|
||||||
@ -31,7 +31,10 @@ begin{asm}
|
|||||||
end;
|
end;
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2003-03-17 14:30:11 peter
|
Revision 1.4 2003-12-04 21:42:07 peter
|
||||||
|
* register calling updates
|
||||||
|
|
||||||
|
Revision 1.3 2003/03/17 14:30:11 peter
|
||||||
* changed address parameter/return values to pointer instead
|
* changed address parameter/return values to pointer instead
|
||||||
of longint
|
of longint
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user