mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 21:30:35 +02:00
* stdcall fixes
This commit is contained in:
parent
73876b7490
commit
d97075a245
@ -143,8 +143,6 @@ implementation
|
||||
uses
|
||||
strings;
|
||||
|
||||
{$ASMMODE ATT}
|
||||
|
||||
{******************************************************************************
|
||||
--- Dos Interrupt ---
|
||||
******************************************************************************}
|
||||
@ -1049,7 +1047,10 @@ End;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.15 2002-09-07 16:01:18 peter
|
||||
Revision 1.16 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.15 2002/09/07 16:01:18 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
}
|
||||
|
@ -283,6 +283,7 @@ const
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl $0x202,%eax
|
||||
movb e,%bl
|
||||
int $0x31
|
||||
@ -292,6 +293,7 @@ const
|
||||
movl intaddr,%eax
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -299,6 +301,7 @@ const
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw d,%bx
|
||||
movl $6,%eax
|
||||
int $0x31
|
||||
@ -307,6 +310,7 @@ const
|
||||
shll $16,%ecx
|
||||
orl %ecx,%eax
|
||||
movl %eax,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -327,6 +331,7 @@ const
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl intaddr,%eax
|
||||
movw (%eax),%dx
|
||||
movw 4(%eax),%cx
|
||||
@ -336,6 +341,7 @@ const
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -343,6 +349,7 @@ const
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movb vector,%bl
|
||||
movl $0x200,%eax
|
||||
int $0x31
|
||||
@ -353,6 +360,7 @@ const
|
||||
movzwl %dx,%edx
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -374,6 +382,8 @@ const
|
||||
function get_rm_callback(pm_func : pointer;const reg : trealregs;var rmcb : tseginfo) : boolean;
|
||||
begin
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl pm_func,%esi
|
||||
movl reg,%edi
|
||||
pushw %es
|
||||
@ -393,6 +403,8 @@ const
|
||||
movzwl %dx,%edx
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -400,6 +412,9 @@ const
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl $0x600,%eax
|
||||
movl linearaddr,%ecx
|
||||
movl %ecx,%ebx
|
||||
@ -411,6 +426,9 @@ const
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1115,6 +1133,7 @@ var
|
||||
res : longint;
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl flag,%ebx
|
||||
movl $0xe01,%eax
|
||||
int $0x31
|
||||
@ -1122,6 +1141,7 @@ begin
|
||||
xorl %eax,%eax
|
||||
.L_coproc_error:
|
||||
movl %eax,res
|
||||
popl %ebx
|
||||
end;
|
||||
dpmi_set_coprocessor_emulation:=res;
|
||||
end;
|
||||
@ -1157,9 +1177,11 @@ begin
|
||||
begin
|
||||
psp_sel:=stub_info^.psp_selector;
|
||||
asm
|
||||
pushl %ebx
|
||||
movw psp_sel,%bx
|
||||
movb $0x50,%ah
|
||||
int $0x21
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1537,7 +1559,10 @@ end;
|
||||
{$endif IN_SYSTEM}
|
||||
{
|
||||
$Log$
|
||||
Revision 1.13 2003-03-19 15:57:16 peter
|
||||
Revision 1.14 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.13 2003/03/19 15:57:16 peter
|
||||
* fix compile with 1.0.x
|
||||
|
||||
Revision 1.12 2003/03/18 08:48:41 michael
|
||||
|
@ -242,6 +242,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl bytes,%ebx
|
||||
addl $0xf,%ebx // round up
|
||||
shrl $0x4,%ebx // convert to Paragraphs
|
||||
@ -256,6 +257,7 @@ interface
|
||||
movw %dx,%ax // return Selector in lo(Result)
|
||||
.LDos_end:
|
||||
movl %eax,__result
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -279,6 +281,8 @@ interface
|
||||
asm
|
||||
{ save all used registers to avoid crash under NTVDM }
|
||||
{ when spawning a 32-bit DPMI application }
|
||||
pushl %edi
|
||||
pushl %ebx
|
||||
pushw %fs
|
||||
movw intnr,%bx
|
||||
xorl %ecx,%ecx
|
||||
@ -289,6 +293,8 @@ interface
|
||||
popw %fs
|
||||
setnc %al
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
popl %edi
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -296,6 +302,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %edi
|
||||
movl ofs,%edi
|
||||
movl count,%ecx
|
||||
movb c,%dl
|
||||
@ -319,13 +326,15 @@ interface
|
||||
rep
|
||||
stosb
|
||||
popw %es
|
||||
end ['EAX','ECX','EDX','EDI'];
|
||||
popl %edi
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure seg_fillword(seg : word;ofs : longint;count : longint;w : word);
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %edi
|
||||
movl ofs,%edi
|
||||
movl count,%ecx
|
||||
movw w,%dx
|
||||
@ -347,7 +356,8 @@ interface
|
||||
rep
|
||||
stosw
|
||||
popw %es
|
||||
end ['EAX','ECX','EDX','EDI'];
|
||||
popl %edi
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure seg_move(sseg : word;source : longint;dseg : word;dest : longint;count : longint);
|
||||
@ -357,6 +367,8 @@ interface
|
||||
exit;
|
||||
if (sseg<>dseg) or ((sseg=dseg) and (source>dest)) then
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushw %es
|
||||
pushw %ds
|
||||
cld
|
||||
@ -377,10 +389,14 @@ interface
|
||||
movsb
|
||||
popw %ds
|
||||
popw %es
|
||||
end ['ESI','EDI','ECX','EAX']
|
||||
popl %edi
|
||||
popl %esi
|
||||
end ['ECX','EAX']
|
||||
else if (source<dest) then
|
||||
{ copy backward for overlapping }
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushw %es
|
||||
pushw %ds
|
||||
std
|
||||
@ -415,6 +431,8 @@ interface
|
||||
cld
|
||||
popw %ds
|
||||
popw %es
|
||||
popl %edi
|
||||
popl %esi
|
||||
end ['ESI','EDI','ECX'];
|
||||
end;
|
||||
|
||||
@ -502,6 +520,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl intaddr,%eax
|
||||
movl (%eax),%edx
|
||||
movw 4(%eax),%cx
|
||||
@ -511,6 +530,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -518,6 +538,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl intaddr,%eax
|
||||
movw (%eax),%dx
|
||||
movw 4(%eax),%cx
|
||||
@ -527,6 +548,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -534,6 +556,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl intaddr,%eax
|
||||
movl (%eax),%edx
|
||||
movw 4(%eax),%cx
|
||||
@ -543,6 +566,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -550,6 +574,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl intaddr,%eax
|
||||
movl (%eax),%edx
|
||||
movw 4(%eax),%cx
|
||||
@ -559,6 +584,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -566,6 +592,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl $0x210,%eax
|
||||
movb e,%bl
|
||||
int $0x31
|
||||
@ -575,6 +602,7 @@ interface
|
||||
movl intaddr,%eax
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -582,6 +610,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl $0x202,%eax
|
||||
movb e,%bl
|
||||
int $0x31
|
||||
@ -591,6 +620,7 @@ interface
|
||||
movl intaddr,%eax
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -598,6 +628,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movb vector,%bl
|
||||
movl $0x204,%eax
|
||||
int $0x31
|
||||
@ -607,6 +638,7 @@ interface
|
||||
movl intaddr,%eax
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -614,6 +646,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movb vector,%bl
|
||||
movl $0x200,%eax
|
||||
int $0x31
|
||||
@ -624,6 +657,7 @@ interface
|
||||
movzwl %dx,%edx
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -651,6 +685,8 @@ interface
|
||||
function get_rm_callback(pm_func : pointer;const reg : trealregs;var rmcb : tseginfo) : boolean;
|
||||
begin
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl pm_func,%esi
|
||||
movl reg,%edi
|
||||
pushw %es
|
||||
@ -670,6 +706,8 @@ interface
|
||||
movzwl %dx,%edx
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -688,12 +726,14 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw d,%bx
|
||||
movl $1,%eax
|
||||
int $0x31
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -701,10 +741,12 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw seg,%bx
|
||||
movl $2,%eax
|
||||
int $0x31
|
||||
movw %ax,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -722,6 +764,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw d,%bx
|
||||
movl $6,%eax
|
||||
int $0x31
|
||||
@ -730,17 +773,20 @@ interface
|
||||
shll $16,%ecx
|
||||
orl %ecx,%eax
|
||||
movl %eax,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
function get_page_size:longint;
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl $0x604,%eax
|
||||
int $0x31
|
||||
shll $16,%ebx
|
||||
movw %cx,%bx
|
||||
movl %ebx,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -754,6 +800,8 @@ interface
|
||||
linearaddr:=linearaddr-pageofs;
|
||||
size:=size+pageofs;
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
movl $0x504,%eax
|
||||
movl linearaddr,%ebx
|
||||
movl size,%ecx
|
||||
@ -766,6 +814,8 @@ interface
|
||||
movl blockhandle,%eax
|
||||
movl %esi,(%eax)
|
||||
movl %ebx,pageofs
|
||||
popl %esi
|
||||
popl %ebx
|
||||
end;
|
||||
if pageofs<>linearaddr then
|
||||
request_linear_region:=false;
|
||||
@ -774,6 +824,8 @@ interface
|
||||
function allocate_memory_block(size:longint):longint;
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
movl $0x501,%eax
|
||||
movl size,%ecx
|
||||
movl %ecx,%ebx
|
||||
@ -789,12 +841,15 @@ interface
|
||||
shll $16,%esi
|
||||
movw %di,%si
|
||||
movl %ebx,__RESULT
|
||||
popl %esi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
function free_memory_block(blockhandle : longint) : boolean;
|
||||
begin
|
||||
asm
|
||||
pushl %esi
|
||||
movl blockhandle,%esi
|
||||
movl %esi,%edi
|
||||
shll $16,%esi
|
||||
@ -803,6 +858,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %esi
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -810,6 +866,9 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl $0x600,%eax
|
||||
movl linearaddr,%ecx
|
||||
movl %ecx,%ebx
|
||||
@ -821,6 +880,9 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -852,6 +914,9 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl $0x601,%eax
|
||||
movl linearaddr,%ecx
|
||||
movl %ecx,%ebx
|
||||
@ -863,6 +928,9 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -892,6 +960,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw d,%bx
|
||||
leal s,%eax
|
||||
movw (%eax),%dx
|
||||
@ -901,6 +970,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -908,6 +978,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw d,%bx
|
||||
movw w,%cx
|
||||
movl $9,%eax
|
||||
@ -915,6 +986,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movw %ax,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -922,6 +994,7 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw d,%bx
|
||||
leal s,%eax
|
||||
movw (%eax),%dx
|
||||
@ -931,6 +1004,7 @@ interface
|
||||
pushf
|
||||
call test_int31
|
||||
movb %al,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -963,12 +1037,14 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movw seg,%bx
|
||||
movl $0xa,%eax
|
||||
int $0x31
|
||||
pushf
|
||||
call test_int31
|
||||
movw %ax,__RESULT
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -976,12 +1052,14 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %edi
|
||||
movl meminfo,%edi
|
||||
movl $0x500,%eax
|
||||
int $0x31
|
||||
pushf
|
||||
movb %al,__RESULT
|
||||
call test_int31
|
||||
popl %edi
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -989,6 +1067,9 @@ interface
|
||||
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl phys_addr,%ebx
|
||||
movl %ebx,%ecx
|
||||
shrl $16,%ebx
|
||||
@ -1002,6 +1083,9 @@ interface
|
||||
shll $16,%ebx
|
||||
movw %cx,%bx
|
||||
movl %ebx,__RESULT
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1030,6 +1114,9 @@ interface
|
||||
function map_device_in_memory_block(handle,offset,pagecount,device:longint):boolean;
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl device,%edx
|
||||
movl handle,%esi
|
||||
movl offset,%ebx
|
||||
@ -1040,6 +1127,9 @@ interface
|
||||
setnc %al
|
||||
movb %al,__RESULT
|
||||
call test_int31
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1097,7 +1187,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 2002-09-07 16:01:18 peter
|
||||
Revision 1.7 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.6 2002/09/07 16:01:18 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.5 2002/09/07 12:31:16 carl
|
||||
|
@ -146,6 +146,8 @@ const
|
||||
|
||||
begin
|
||||
asm
|
||||
push edi
|
||||
push esi
|
||||
push es
|
||||
push ds
|
||||
cld
|
||||
@ -159,6 +161,8 @@ const
|
||||
rep movsb
|
||||
pop ds
|
||||
pop es
|
||||
pop esi
|
||||
pop edi
|
||||
end ['ESI','EDI','ECX','EAX']
|
||||
end;
|
||||
|
||||
@ -237,6 +241,8 @@ const
|
||||
PortW[$3ce] := $0001; { Index 01 : Disable ops on all four planes. }
|
||||
{$else asmgraph}
|
||||
asm
|
||||
push ebx
|
||||
push edi
|
||||
{$ifndef fpc}
|
||||
mov es, [SegA000]
|
||||
{$endif fpc}
|
||||
@ -308,6 +314,8 @@ const
|
||||
{ restore enable set/reset register }
|
||||
mov ax,0001h
|
||||
out dx,ax
|
||||
pop edi
|
||||
pop ebx
|
||||
{$endif fpc}
|
||||
end;
|
||||
{$endif asmgraph}
|
||||
@ -338,6 +346,9 @@ const
|
||||
{$else asmgraph}
|
||||
asm
|
||||
{$ifndef fpc}
|
||||
push esi
|
||||
push edi
|
||||
push ebx
|
||||
mov ax, [X] { Get X address }
|
||||
push ax
|
||||
shr ax, 3
|
||||
@ -466,6 +477,9 @@ const
|
||||
mov al,ah { 16-bit pixel in AX }
|
||||
xor ah,ah
|
||||
mov @Result, ax
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
{$endif fpc}
|
||||
end;
|
||||
{$endif asmgraph}
|
||||
@ -647,6 +661,9 @@ End;
|
||||
{$else asmgraph}
|
||||
{ note: still needs xor/or/and/notput support !!!!! (JM) }
|
||||
asm
|
||||
push esi
|
||||
push edi
|
||||
push ebx
|
||||
{$ifndef fpc}
|
||||
mov es, [SegA000]
|
||||
{ enable the set / reset function and load the color }
|
||||
@ -734,6 +751,9 @@ End;
|
||||
{ restore enable set/reset register }
|
||||
mov ax,0001h
|
||||
out dx,ax
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
{$endif fpc}
|
||||
end;
|
||||
{$endif asmgraph}
|
||||
@ -1082,6 +1102,8 @@ End;
|
||||
{$else fpc}
|
||||
assembler;
|
||||
asm
|
||||
push edi
|
||||
push ebx
|
||||
movsx edi, x
|
||||
movsx ebx, y
|
||||
cmp clippixels, 0
|
||||
@ -1105,6 +1127,8 @@ End;
|
||||
add edi, ebx
|
||||
mov fs:[edi+ebx*4+$a0000], al
|
||||
@putpix320done:
|
||||
pop ebx
|
||||
pop edi
|
||||
{$endif fpc}
|
||||
end;
|
||||
|
||||
@ -1130,6 +1154,8 @@ End;
|
||||
{$else fpc}
|
||||
assembler;
|
||||
asm
|
||||
push edi
|
||||
push ebx
|
||||
movsx edi, x
|
||||
movsx ebx, y
|
||||
movsx ecx, StartYViewPort
|
||||
@ -1140,6 +1166,8 @@ End;
|
||||
shl ebx, 6
|
||||
add edi, ebx
|
||||
movzx ax, byte ptr fs:[edi+ebx*4+$a0000]
|
||||
pop ebx
|
||||
pop edi
|
||||
{$endif fpc}
|
||||
end;
|
||||
|
||||
@ -1181,6 +1209,8 @@ End;
|
||||
@MovMode:
|
||||
mov es:[di], al
|
||||
{$else fpc}
|
||||
push edi
|
||||
push ebx
|
||||
movzx edi, x
|
||||
movzx ebx, y
|
||||
{ add edi, [VideoOfs] no multiple pages in 320*200*256 }
|
||||
@ -1192,6 +1222,8 @@ End;
|
||||
xor al, fs:[edi+ebx*4+$a0000]
|
||||
@MovMode:
|
||||
mov fs:[edi+ebx*4+$a0000], al
|
||||
pop ebx
|
||||
pop edi
|
||||
{$endif fpc}
|
||||
end;
|
||||
{$endif asmgraph}
|
||||
@ -1258,6 +1290,7 @@ const CrtAddress: word = 0;
|
||||
CLD
|
||||
REP STOSW
|
||||
{$else fpc}
|
||||
push edi
|
||||
push es
|
||||
push fs
|
||||
mov edi, $a0000
|
||||
@ -1267,6 +1300,7 @@ const CrtAddress: word = 0;
|
||||
cld
|
||||
rep stosd
|
||||
pop es
|
||||
pop edi
|
||||
{$EndIf fpc}
|
||||
MOV DX,CRTAddress {address the underline-location-register at }
|
||||
MOV AL,14h {the CRT-controller Port, read out the according }
|
||||
@ -1326,6 +1360,8 @@ const CrtAddress: word = 0;
|
||||
xor ah, ah
|
||||
mov @Result, ax
|
||||
{$else fpc}
|
||||
push edi
|
||||
push ebx
|
||||
movzx edi,[Y] ; (* DI = Y coordinate *)
|
||||
(* Multiply by 80 start *)
|
||||
mov ebx, edi
|
||||
@ -1348,6 +1384,8 @@ const CrtAddress: word = 0;
|
||||
(* End selection of plane *)
|
||||
mov ax, fs:[edi+$a0000]
|
||||
mov @Result, ax
|
||||
pop ebx
|
||||
pop edi
|
||||
{$endif fpc}
|
||||
end;
|
||||
{$endif asmgraph}
|
||||
@ -2708,7 +2746,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.9 2002-09-07 16:01:18 peter
|
||||
Revision 1.10 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.9 2002/09/07 16:01:18 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ procedure unlockmouse;
|
||||
{$ASMMODE ATT}
|
||||
procedure MouseInt;assembler;
|
||||
asm
|
||||
pushl %edi
|
||||
pushl %ebx
|
||||
movb %bl,mousebuttons
|
||||
movw %cx,mousewherex
|
||||
movw %dx,mousewherey
|
||||
@ -156,6 +158,8 @@ asm
|
||||
movl %edi,PendingMouseTail
|
||||
incb PendingMouseEvents
|
||||
.Lmouse_exit:
|
||||
popl %ebx
|
||||
popl %edi
|
||||
end;
|
||||
|
||||
|
||||
@ -303,6 +307,8 @@ var
|
||||
error : word;
|
||||
begin
|
||||
ASM
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
LEAL ACTIONREGS, %EDI; { Addr of actionregs }
|
||||
LEAL MOUSE_TRAP, %ESI; { Procedure address }
|
||||
CMPB $0, UnderNT
|
||||
@ -330,6 +336,8 @@ begin
|
||||
MOVW $0, %AX; { Force error to zero }
|
||||
.L_exit:
|
||||
MOVW %AX, ERROR; { Return error state }
|
||||
popl %esi
|
||||
popl %edi
|
||||
END;
|
||||
Allocate_mouse_bridge:=error=0;
|
||||
end;
|
||||
@ -534,6 +542,7 @@ end;
|
||||
|
||||
function SysDetectMouse:byte;assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
movl $0x200,%eax
|
||||
movl $0x33,%ebx
|
||||
int $0x31
|
||||
@ -548,6 +557,7 @@ asm
|
||||
jz .Lno_mouse
|
||||
movl %ebx,%eax
|
||||
.Lno_mouse:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
|
||||
@ -645,6 +655,7 @@ end;
|
||||
|
||||
function SysGetMouseButtons:word;assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
cmpb $1,MousePresent
|
||||
jne .LGetMouseButtonsError
|
||||
movl $3,%eax
|
||||
@ -652,9 +663,11 @@ asm
|
||||
int $0x33
|
||||
popl %ebp
|
||||
movw %bx,%ax
|
||||
ret
|
||||
jmp .Lexit
|
||||
.LGetMouseButtonsError:
|
||||
xorl %eax,%eax
|
||||
.Lexit:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
|
||||
@ -775,7 +788,10 @@ Begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.7 2002-09-07 16:01:18 peter
|
||||
Revision 1.8 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.7 2002/09/07 16:01:18 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.6 2002/05/09 08:42:24 carl
|
||||
|
@ -103,6 +103,7 @@ Var
|
||||
|
||||
Implementation
|
||||
|
||||
{$calling oldfpccall}
|
||||
{$asmmode ATT}
|
||||
|
||||
Function InitMouse: Boolean;
|
||||
@ -358,7 +359,10 @@ Begin
|
||||
End.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.4 2002-09-07 21:30:00 carl
|
||||
Revision 1.5 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.4 2002/09/07 21:30:00 carl
|
||||
- removed mousecheck define
|
||||
|
||||
Revision 1.3 2002/09/07 16:01:18 peter
|
||||
|
@ -239,6 +239,8 @@ begin
|
||||
exit;
|
||||
if (sseg<>dseg) or ((sseg=dseg) and (source>dest)) then
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushw %es
|
||||
pushw %ds
|
||||
cld
|
||||
@ -259,10 +261,14 @@ begin
|
||||
movsb
|
||||
popw %ds
|
||||
popw %es
|
||||
end ['ESI','EDI','ECX','EAX']
|
||||
popl %edi
|
||||
popl %esi
|
||||
end
|
||||
else if (source<dest) then
|
||||
{ copy backward for overlapping }
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushw %es
|
||||
pushw %ds
|
||||
std
|
||||
@ -297,7 +303,9 @@ begin
|
||||
cld
|
||||
popw %ds
|
||||
popw %es
|
||||
end ['ESI','EDI','ECX'];
|
||||
popl %edi
|
||||
popl %esi
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -578,9 +586,10 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function strcopy(dest,source : pchar) : pchar;
|
||||
begin
|
||||
asm
|
||||
function strcopy(dest,source : pchar) : pchar;assembler;
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
cld
|
||||
movl 12(%ebp),%edi
|
||||
movl $0xffffffff,%ecx
|
||||
@ -599,9 +608,8 @@ begin
|
||||
rep
|
||||
movsb
|
||||
movl 8(%ebp),%eax
|
||||
leave
|
||||
ret $8
|
||||
end;
|
||||
popl %edi
|
||||
popl %esi
|
||||
end;
|
||||
|
||||
|
||||
@ -673,11 +681,15 @@ begin
|
||||
regs.realsp:=0;
|
||||
regs.realss:=0;
|
||||
asm
|
||||
pushl %ebx
|
||||
pushl %edi
|
||||
movw intnr,%bx
|
||||
xorl %ecx,%ecx
|
||||
movl regs,%edi
|
||||
movw $0x300,%ax
|
||||
int $0x31
|
||||
popl %edi
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -685,12 +697,14 @@ end;
|
||||
procedure set_pm_interrupt(vector : byte;const intaddr : tseginfo);
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movl intaddr,%eax
|
||||
movl (%eax),%edx
|
||||
movw 4(%eax),%cx
|
||||
movl $0x205,%eax
|
||||
movb vector,%bl
|
||||
int $0x31
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -698,12 +712,14 @@ end;
|
||||
procedure get_pm_interrupt(vector : byte;var intaddr : tseginfo);
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movb vector,%bl
|
||||
movl $0x204,%eax
|
||||
int $0x31
|
||||
movl intaddr,%eax
|
||||
movl %edx,(%eax)
|
||||
movw %cx,4(%eax)
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1495,7 +1511,10 @@ Begin
|
||||
End.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.25 2003-09-29 18:39:59 hajny
|
||||
Revision 1.26 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.25 2003/09/29 18:39:59 hajny
|
||||
* append fix applied to GO32v2, OS/2 and EMX
|
||||
|
||||
Revision 1.24 2003/09/27 11:52:35 peter
|
||||
|
@ -199,6 +199,8 @@ begin
|
||||
if not force then
|
||||
begin
|
||||
asm
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl VideoBuf,%esi
|
||||
movl OldVideoBuf,%edi
|
||||
movl VideoBufSize,%ecx
|
||||
@ -206,6 +208,8 @@ begin
|
||||
repe
|
||||
cmpsl
|
||||
setne force
|
||||
popl %edi
|
||||
popl %esi
|
||||
end;
|
||||
end;
|
||||
if Force then
|
||||
@ -318,7 +322,10 @@ initialization
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 2002-09-07 16:01:19 peter
|
||||
Revision 1.7 2003-10-03 21:46:25 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.6 2002/09/07 16:01:19 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ begin
|
||||
stosb {Store an extra 0 to finish. (AL is now 0).}
|
||||
incl %edx
|
||||
// movw %dx,ES.SizeEnv {Store environment size.}
|
||||
end;
|
||||
end ['eax','ebx','ecx','edx','esi','edi'];
|
||||
|
||||
//Not clear how to use
|
||||
exec:=DosExecPgm(ObjName, Longint(runflags), Args, Env, Res, Path);
|
||||
@ -567,7 +567,7 @@ begin
|
||||
pop eax
|
||||
mov P, edi { place pointer to variable contents in P }
|
||||
@End:
|
||||
end;
|
||||
end ['eax','ebx','ecx','edx','esi','edi'];
|
||||
GetEnvPChar := P;
|
||||
end;
|
||||
{$ASMMODE ATT}
|
||||
@ -703,7 +703,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.26 2003-09-24 08:59:16 yuri
|
||||
Revision 1.27 2003-10-03 21:46:41 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.26 2003/09/24 08:59:16 yuri
|
||||
* Prepared for native target (emx code replaced)
|
||||
|
||||
Revision 1.25 2003/02/20 17:37:00 hajny
|
||||
|
@ -521,12 +521,14 @@ begin
|
||||
((os_MODE = osOS2) and (h > 2)) then
|
||||
begin
|
||||
asm
|
||||
pushl %ebx
|
||||
movb $0x3e,%ah
|
||||
movl h,%ebx
|
||||
call syscall
|
||||
jnc .Lnoerror { error code? }
|
||||
movw %ax, InOutRes { yes, then set InOutRes }
|
||||
.Lnoerror:
|
||||
popl %ebx
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -551,6 +553,7 @@ begin
|
||||
allowslash(p1);
|
||||
allowslash(p2);
|
||||
asm
|
||||
pushl %edi
|
||||
movl P1, %edx
|
||||
movl P2, %edi
|
||||
movb $0x56,%ah
|
||||
@ -558,11 +561,13 @@ begin
|
||||
jnc .LRENAME1
|
||||
movw %ax,inoutres;
|
||||
.LRENAME1:
|
||||
popl %edi
|
||||
end;
|
||||
end;
|
||||
|
||||
function do_read(h,addr,len:longint):longint; assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
movl len,%ecx
|
||||
movl addr,%edx
|
||||
movl h,%ebx
|
||||
@ -572,10 +577,12 @@ asm
|
||||
movw %ax,inoutres;
|
||||
xorl %eax,%eax
|
||||
.LDOSREAD1:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
function do_write(h,addr,len:longint) : longint; assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
xorl %eax,%eax
|
||||
cmpl $0,len { 0 bytes to write is undefined behavior }
|
||||
jz .LDOSWRITE1
|
||||
@ -587,10 +594,12 @@ asm
|
||||
jnc .LDOSWRITE1
|
||||
movw %ax,inoutres;
|
||||
.LDOSWRITE1:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
function do_filepos(handle:longint): longint; assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
movw $0x4201,%ax
|
||||
movl handle,%ebx
|
||||
xorl %edx,%edx
|
||||
@ -599,10 +608,12 @@ asm
|
||||
movw %ax,inoutres;
|
||||
xorl %eax,%eax
|
||||
.LDOSFILEPOS:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
procedure do_seek(handle,pos:longint); assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
movw $0x4200,%ax
|
||||
movl handle,%ebx
|
||||
movl pos,%edx
|
||||
@ -610,10 +621,12 @@ asm
|
||||
jnc .LDOSSEEK1
|
||||
movw %ax,inoutres;
|
||||
.LDOSSEEK1:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
function do_seekend(handle:longint):longint; assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
movw $0x4202,%ax
|
||||
movl handle,%ebx
|
||||
xorl %edx,%edx
|
||||
@ -622,6 +635,7 @@ asm
|
||||
movw %ax,inoutres;
|
||||
xorl %eax,%eax
|
||||
.Lset_at_end1:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
function do_filesize(handle:longint):longint;
|
||||
@ -636,6 +650,7 @@ end;
|
||||
|
||||
procedure do_truncate(handle,pos:longint); assembler;
|
||||
asm
|
||||
pushl %ebx
|
||||
(* DOS function 40h isn't safe for this according to EMX documentation *)
|
||||
movl $0x7F25,%eax
|
||||
movl Handle,%ebx
|
||||
@ -653,6 +668,7 @@ asm
|
||||
.LTruncate1:
|
||||
movw %ax,inoutres;
|
||||
.LTruncate2:
|
||||
popl %ebx
|
||||
end;
|
||||
|
||||
const
|
||||
@ -681,12 +697,14 @@ begin
|
||||
Inc (FileHandleCount, 10);
|
||||
Err := 0;
|
||||
asm
|
||||
pushl %ebx
|
||||
movl $0x6700, %eax
|
||||
movl FileHandleCount, %ebx
|
||||
call syscall
|
||||
jnc .LIncFHandles
|
||||
movw %ax, Err
|
||||
.LIncFHandles:
|
||||
popl %ebx
|
||||
end;
|
||||
if Err <> 0 then
|
||||
begin
|
||||
@ -808,6 +826,7 @@ begin
|
||||
else
|
||||
*)
|
||||
asm
|
||||
pushl %ebx
|
||||
mov ebx, Handle
|
||||
mov eax, 4400h
|
||||
call syscall
|
||||
@ -817,6 +836,7 @@ asm
|
||||
jnz @IsDevEnd
|
||||
dec eax { nope, so result is zero }
|
||||
@IsDevEnd:
|
||||
popl %ebx
|
||||
end;
|
||||
{$ASMMODE ATT}
|
||||
|
||||
@ -994,7 +1014,7 @@ begin
|
||||
jz @LCHDIR
|
||||
mov InOutRes, 15
|
||||
@LCHDIR:
|
||||
end;
|
||||
end ['eax','edx','esi'];
|
||||
if (Length (S) > 2) and (InOutRes <> 0) then
|
||||
{ Under EMX 0.9d DOS this routine may sometime }
|
||||
{ fail or crash the system. }
|
||||
@ -1031,7 +1051,7 @@ begin
|
||||
jnc .LGetDir
|
||||
movw %ax, InOutRes
|
||||
.LGetDir:
|
||||
end;
|
||||
end [ 'eax','edx','esi'];
|
||||
{ Now Dir should be filled with directory in ASCIIZ, }
|
||||
{ starting from dir[4] }
|
||||
dir[0]:=#3;
|
||||
@ -1203,7 +1223,7 @@ begin
|
||||
@Stop:
|
||||
inc eax
|
||||
mov EnvSize, eax
|
||||
end;
|
||||
end ['eax','ecx','edx','esi','edi'];
|
||||
Environment := GetMem (EnvSize);
|
||||
asm
|
||||
cld
|
||||
@ -1226,7 +1246,7 @@ begin
|
||||
jmp @L2
|
||||
@Stop2:
|
||||
stosb
|
||||
end;
|
||||
end ['eax','ecx','edx','esi','edi'];
|
||||
end;
|
||||
|
||||
|
||||
@ -1289,6 +1309,7 @@ begin
|
||||
{Determine the operating system we are running on.}
|
||||
{$ASMMODE INTEL}
|
||||
asm
|
||||
push ebx
|
||||
mov os_mode, 0
|
||||
mov eax, 7F0Ah
|
||||
call syscall
|
||||
@ -1298,7 +1319,6 @@ begin
|
||||
jz @noRSX
|
||||
mov os_mode, 2
|
||||
@noRSX:
|
||||
|
||||
{Enable the brk area by initializing it with the initial heap size.}
|
||||
|
||||
mov eax, 7F01h
|
||||
@ -1326,6 +1346,7 @@ begin
|
||||
mov edx, 8
|
||||
call syscall
|
||||
{$ENDIF CONTHEAP}
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
{ in OS/2 this will always be nil, but in DOS mode }
|
||||
@ -1335,6 +1356,7 @@ begin
|
||||
read-access to the first meg. of memory.}
|
||||
if os_mode in [osDOS,osDPMI] then
|
||||
asm
|
||||
push ebx
|
||||
mov eax, 7F13h
|
||||
xor ebx, ebx
|
||||
mov ecx, 0FFFh
|
||||
@ -1343,6 +1365,7 @@ begin
|
||||
jc @endmem
|
||||
mov first_meg, eax
|
||||
@endmem:
|
||||
pop ebx
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -1403,7 +1426,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.35 2003-10-01 18:42:49 yuri
|
||||
Revision 1.36 2003-10-03 21:46:41 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.35 2003/10/01 18:42:49 yuri
|
||||
* Unclosed comment
|
||||
|
||||
Revision 1.34 2003/09/29 18:39:59 hajny
|
||||
|
@ -296,6 +296,7 @@ end;
|
||||
function FileRead (Handle: longint; var Buffer; Count: longint): longint;
|
||||
assembler;
|
||||
asm
|
||||
push ebx
|
||||
mov eax, 3F00h
|
||||
mov ebx, Handle
|
||||
mov ecx, Count
|
||||
@ -304,12 +305,14 @@ asm
|
||||
jnc @FReadEnd
|
||||
mov eax, -1
|
||||
@FReadEnd:
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
|
||||
function FileWrite (Handle: longint; const Buffer; Count: longint): longint;
|
||||
assembler;
|
||||
asm
|
||||
push ebx
|
||||
mov eax, 4000h
|
||||
mov ebx, Handle
|
||||
mov ecx, Count
|
||||
@ -318,11 +321,13 @@ asm
|
||||
jnc @FWriteEnd
|
||||
mov eax, -1
|
||||
@FWriteEnd:
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
|
||||
function FileSeek (Handle, FOffset, Origin: longint): longint; assembler;
|
||||
asm
|
||||
push ebx
|
||||
mov eax, Origin
|
||||
mov ah, 42h
|
||||
mov ebx, Handle
|
||||
@ -331,6 +336,7 @@ asm
|
||||
jnc @FSeekEnd
|
||||
mov eax, -1
|
||||
@FSeekEnd:
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
Function FileSeek (Handle : Longint; FOffset,Origin : Int64) : Int64;
|
||||
@ -343,15 +349,18 @@ procedure FileClose (Handle: longint);
|
||||
begin
|
||||
if (Handle > 4) or ((os_mode = osOS2) and (Handle > 2)) then
|
||||
asm
|
||||
push ebx
|
||||
mov eax, 3E00h
|
||||
mov ebx, Handle
|
||||
call syscall
|
||||
pop ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function FileTruncate (Handle, Size: longint): boolean; assembler;
|
||||
asm
|
||||
push ebx
|
||||
mov eax, 7F25h
|
||||
mov ebx, Handle
|
||||
mov edx, Size
|
||||
@ -365,6 +374,7 @@ asm
|
||||
jnc @FTruncEnd
|
||||
dec eax
|
||||
@FTruncEnd:
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
|
||||
@ -533,6 +543,7 @@ end;
|
||||
|
||||
function FileGetDate (Handle: longint): longint; assembler;
|
||||
asm
|
||||
push ebx
|
||||
mov ax, 5700h
|
||||
mov ebx, Handle
|
||||
call syscall
|
||||
@ -541,6 +552,7 @@ asm
|
||||
mov ax, dx
|
||||
shld eax, ecx, 16
|
||||
@FGetDateEnd:
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
|
||||
@ -572,6 +584,7 @@ begin
|
||||
end
|
||||
else
|
||||
asm
|
||||
push ebx
|
||||
mov ax, 5701h
|
||||
mov ebx, Handle
|
||||
mov cx, word ptr [Age]
|
||||
@ -581,6 +594,7 @@ begin
|
||||
mov eax, -1
|
||||
@FSetDateEnd:
|
||||
mov [ebp - 4], eax
|
||||
pop ebx
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -679,6 +693,7 @@ begin
|
||||
FN2 := NewName + #0;
|
||||
{$ENDIF}
|
||||
asm
|
||||
push edi
|
||||
mov ax, 5600h
|
||||
{$IFOPT H+}
|
||||
mov edx, OldName
|
||||
@ -696,6 +711,7 @@ asm
|
||||
@FRenameEnd:
|
||||
{$IFOPT H-}
|
||||
mov [ebp - 4], eax
|
||||
pop edi
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -716,6 +732,7 @@ begin
|
||||
if (os_mode = osDOS) or (os_mode = osDPMI) then
|
||||
{Function 36 is not supported in OS/2.}
|
||||
asm
|
||||
pushl %ebx
|
||||
movb Drive,%dl
|
||||
movb $0x36,%ah
|
||||
call syscall
|
||||
@ -727,10 +744,11 @@ begin
|
||||
movw %ax,%dx
|
||||
movl $0,%eax
|
||||
xchgl %edx,%eax
|
||||
leave
|
||||
ret
|
||||
jmp .LDISKFREE2
|
||||
.LDISKFREE1:
|
||||
cltd
|
||||
.LDISKFREE2:
|
||||
popl %ebx
|
||||
leave
|
||||
ret
|
||||
end
|
||||
@ -755,6 +773,7 @@ begin
|
||||
if (os_mode = osDOS) or (os_mode = osDPMI) then
|
||||
{Function 36 is not supported in OS/2.}
|
||||
asm
|
||||
pushl %ebx
|
||||
movb Drive,%dl
|
||||
movb $0x36,%ah
|
||||
call syscall
|
||||
@ -767,10 +786,11 @@ begin
|
||||
movw %ax,%dx
|
||||
movl $0,%eax
|
||||
xchgl %edx,%eax
|
||||
leave
|
||||
ret
|
||||
.LDISKSIZE1:
|
||||
jmp .LDISKSIZE2
|
||||
.LDISKSIZE1:
|
||||
cltd
|
||||
.LDISKSIZE2:
|
||||
popl %ebx
|
||||
leave
|
||||
ret
|
||||
end
|
||||
@ -856,6 +876,7 @@ end;
|
||||
|
||||
procedure GetLocalTime (var SystemTime: TSystemTime); assembler;
|
||||
asm
|
||||
push edi
|
||||
(* Expects the default record alignment (word)!!! *)
|
||||
mov ah, 2Ah
|
||||
call syscall
|
||||
@ -881,6 +902,7 @@ asm
|
||||
shl eax, 16
|
||||
mov al, dh
|
||||
stosd
|
||||
pop edi
|
||||
end;
|
||||
{$asmmode default}
|
||||
|
||||
@ -987,7 +1009,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.29 2003-06-06 23:34:40 hajny
|
||||
Revision 1.30 2003-10-03 21:46:41 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.29 2003/06/06 23:34:40 hajny
|
||||
* better fix for bug 2518
|
||||
|
||||
Revision 1.28 2003/06/06 23:31:17 hajny
|
||||
|
@ -78,7 +78,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
Var
|
||||
Var
|
||||
SysVideoBuf : PVideoBuf;
|
||||
|
||||
procedure SysInitVideo;
|
||||
@ -206,7 +206,7 @@ begin
|
||||
if (OrigScreenSize <> 0) and (OrigScreen <> nil) then
|
||||
begin
|
||||
ScrSize := 0;
|
||||
if (VioGetBuf (PScr, PWord (@ScrSize)^, 0) = 0) and
|
||||
if (VioGetBuf (PScr, PWord (@ScrSize)^, 0) = 0) and
|
||||
(ScrSize = OrigScreenSize) then
|
||||
begin
|
||||
PScr := SelToFlat (TFarPtr (PScr));
|
||||
@ -277,7 +277,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
Const
|
||||
Const
|
||||
SysVideoModeCount = 6;
|
||||
SysVMD : Array[0..SysVideoModeCount-1] of TVideoMode = (
|
||||
(Col: 40; Row: 25; Color: True),
|
||||
@ -315,7 +315,7 @@ begin
|
||||
(Mode.Color=SysVMD[i].Color) then
|
||||
SysSetVideoMode:=True
|
||||
else
|
||||
Dec(I);
|
||||
Dec(I);
|
||||
If SysSetVideoMode then
|
||||
begin
|
||||
SysVideoModeSelector(Mode);
|
||||
@ -324,7 +324,7 @@ begin
|
||||
ScreenColor:=SysVMD[I].Color;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Function SysGetVideoModeData (Index : Word; Var Data : TVideoMode) : boolean;
|
||||
|
||||
begin
|
||||
@ -357,6 +357,8 @@ begin
|
||||
if not (Force) then
|
||||
asm
|
||||
cld
|
||||
push esi
|
||||
push edi
|
||||
mov esi, VideoBuf
|
||||
mov edi, OldVideoBuf
|
||||
mov eax, VideoBufSize
|
||||
@ -391,6 +393,8 @@ begin
|
||||
shl ecx, 1
|
||||
mov CLen, ecx
|
||||
@no_update:
|
||||
pop edi
|
||||
pop esi
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -464,7 +468,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.7 2002-09-07 16:01:25 peter
|
||||
Revision 1.8 2003-10-03 21:46:41 peter
|
||||
* stdcall fixes
|
||||
|
||||
Revision 1.7 2002/09/07 16:01:25 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user