|
@@ -232,6 +232,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl bytes,%ebx
|
|
|
addl $0xf,%ebx // round up
|
|
|
shrl $0x4,%ebx // convert to Paragraphs
|
|
@@ -246,6 +247,7 @@ interface
|
|
|
movw %dx,%ax // return Selector in lo(Result)
|
|
|
.LDos_end:
|
|
|
movl %eax,__result
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -267,6 +269,8 @@ interface
|
|
|
regs.realsp:=0;
|
|
|
regs.realss:=0;
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
+ pushl %edi
|
|
|
{ save all used registers to avoid crash under NTVDM }
|
|
|
{ when spawning a 32-bit DPMI application }
|
|
|
pushw %fs
|
|
@@ -279,6 +283,8 @@ interface
|
|
|
popw %fs
|
|
|
setnc %al
|
|
|
movb %al,__RESULT
|
|
|
+ popl %edi
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -286,6 +292,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %edi
|
|
|
movl ofs,%edi
|
|
|
movl count,%ecx
|
|
|
movb c,%dl
|
|
@@ -309,13 +316,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
|
|
@@ -337,7 +346,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);
|
|
@@ -347,6 +357,8 @@ interface
|
|
|
exit;
|
|
|
if (sseg<>dseg) or ((sseg=dseg) and (source>dest)) then
|
|
|
asm
|
|
|
+ pushl %edi
|
|
|
+ pushl %esi
|
|
|
pushw %es
|
|
|
pushw %ds
|
|
|
cld
|
|
@@ -367,10 +379,14 @@ interface
|
|
|
movsb
|
|
|
popw %ds
|
|
|
popw %es
|
|
|
- end ['ESI','EDI','ECX','EAX']
|
|
|
+ popl %esi
|
|
|
+ popl %edi
|
|
|
+ end
|
|
|
else if (source<dest) then
|
|
|
{ copy backward for overlapping }
|
|
|
asm
|
|
|
+ pushl %edi
|
|
|
+ pushl %esi
|
|
|
pushw %es
|
|
|
pushw %ds
|
|
|
std
|
|
@@ -405,7 +421,9 @@ interface
|
|
|
cld
|
|
|
popw %ds
|
|
|
popw %es
|
|
|
- end ['ESI','EDI','ECX'];
|
|
|
+ popl %esi
|
|
|
+ popl %edi
|
|
|
+ end;
|
|
|
end;
|
|
|
|
|
|
procedure outportb(port : word;data : byte);
|
|
@@ -492,6 +510,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl intaddr,%eax
|
|
|
movl (%eax),%edx
|
|
|
movw 4(%eax),%cx
|
|
@@ -501,6 +520,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -508,6 +528,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl intaddr,%eax
|
|
|
movw (%eax),%dx
|
|
|
movw 4(%eax),%cx
|
|
@@ -517,6 +538,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -524,6 +546,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl intaddr,%eax
|
|
|
movl (%eax),%edx
|
|
|
movw 4(%eax),%cx
|
|
@@ -533,6 +556,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -540,6 +564,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl intaddr,%eax
|
|
|
movl (%eax),%edx
|
|
|
movw 4(%eax),%cx
|
|
@@ -549,6 +574,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -556,6 +582,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl $0x210,%eax
|
|
|
movb e,%bl
|
|
|
int $0x31
|
|
@@ -565,6 +592,7 @@ interface
|
|
|
movl intaddr,%eax
|
|
|
movl %edx,(%eax)
|
|
|
movw %cx,4(%eax)
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -572,6 +600,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movl $0x202,%eax
|
|
|
movb e,%bl
|
|
|
int $0x31
|
|
@@ -581,6 +610,7 @@ interface
|
|
|
movl intaddr,%eax
|
|
|
movl %edx,(%eax)
|
|
|
movw %cx,4(%eax)
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -588,6 +618,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movb vector,%bl
|
|
|
movl $0x204,%eax
|
|
|
int $0x31
|
|
@@ -597,6 +628,7 @@ interface
|
|
|
movl intaddr,%eax
|
|
|
movl %edx,(%eax)
|
|
|
movw %cx,4(%eax)
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -604,6 +636,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movb vector,%bl
|
|
|
movl $0x200,%eax
|
|
|
int $0x31
|
|
@@ -614,6 +647,7 @@ interface
|
|
|
movzwl %dx,%edx
|
|
|
movl %edx,(%eax)
|
|
|
movw %cx,4(%eax)
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -637,11 +671,13 @@ interface
|
|
|
|
|
|
//!!!! var
|
|
|
//!!!! ___v2prt0_ds_alias : word; external name '___v2prt0_ds_alias';
|
|
|
- var ___v2prt0_ds_alias : word;
|
|
|
+ var ___v2prt0_ds_alias : word;
|
|
|
|
|
|
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
|
|
@@ -661,6 +697,8 @@ interface
|
|
|
movzwl %dx,%edx
|
|
|
movl %edx,(%eax)
|
|
|
movw %cx,4(%eax)
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -679,12 +717,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;
|
|
|
|
|
@@ -692,10 +732,12 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movw seg,%bx
|
|
|
movl $2,%eax
|
|
|
int $0x31
|
|
|
movw %ax,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -713,6 +755,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movw d,%bx
|
|
|
movl $6,%eax
|
|
|
int $0x31
|
|
@@ -721,17 +764,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;
|
|
|
|
|
@@ -745,6 +791,8 @@ interface
|
|
|
linearaddr:=linearaddr-pageofs;
|
|
|
size:=size+pageofs;
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %ebx
|
|
|
movl $0x504,%eax
|
|
|
movl linearaddr,%ebx
|
|
|
movl size,%ecx
|
|
@@ -757,6 +805,8 @@ interface
|
|
|
movl blockhandle,%eax
|
|
|
movl %esi,(%eax)
|
|
|
movl %ebx,pageofs
|
|
|
+ popl %ebx
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
if pageofs<>linearaddr then
|
|
|
request_linear_region:=false;
|
|
@@ -765,6 +815,9 @@ interface
|
|
|
function allocate_memory_block(size:longint):longint;
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %edi
|
|
|
+ pushl %ebx
|
|
|
movl $0x501,%eax
|
|
|
movl size,%ecx
|
|
|
movl %ecx,%ebx
|
|
@@ -780,12 +833,17 @@ interface
|
|
|
shll $16,%esi
|
|
|
movw %di,%si
|
|
|
movl %ebx,__RESULT
|
|
|
+ popl %ebx
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function free_memory_block(blockhandle : longint) : boolean;
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %edi
|
|
|
movl blockhandle,%esi
|
|
|
movl %esi,%edi
|
|
|
shll $16,%esi
|
|
@@ -794,6 +852,8 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -801,6 +861,9 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %edi
|
|
|
+ pushl %ebx
|
|
|
movl $0x600,%eax
|
|
|
movl linearaddr,%ecx
|
|
|
movl %ecx,%ebx
|
|
@@ -812,6 +875,9 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -843,6 +909,9 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %edi
|
|
|
+ pushl %ebx
|
|
|
movl $0x601,%eax
|
|
|
movl linearaddr,%ecx
|
|
|
movl %ecx,%ebx
|
|
@@ -854,6 +923,9 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -883,6 +955,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movw d,%bx
|
|
|
leal s,%eax
|
|
|
movw (%eax),%dx
|
|
@@ -892,6 +965,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -899,6 +973,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movw d,%bx
|
|
|
movw w,%cx
|
|
|
movl $9,%eax
|
|
@@ -906,6 +981,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movw %ax,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -913,6 +989,7 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %ebx
|
|
|
movw d,%bx
|
|
|
leal s,%eax
|
|
|
movw (%eax),%dx
|
|
@@ -922,6 +999,7 @@ interface
|
|
|
pushf
|
|
|
call test_int31
|
|
|
movb %al,__RESULT
|
|
|
+ popl %ebx
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -954,12 +1032,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;
|
|
|
|
|
@@ -967,12 +1047,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;
|
|
|
|
|
@@ -980,6 +1062,9 @@ interface
|
|
|
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %edi
|
|
|
+ pushl %ebx
|
|
|
movl phys_addr,%ebx
|
|
|
movl %ebx,%ecx
|
|
|
shrl $16,%ebx
|
|
@@ -993,6 +1078,9 @@ interface
|
|
|
shll $16,%ebx
|
|
|
movw %cx,%bx
|
|
|
movl %ebx,__RESULT
|
|
|
+ popl %ebx
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1022,6 +1110,9 @@ interface
|
|
|
function map_device_in_memory_block(handle,offset,pagecount,device:longint):boolean;
|
|
|
begin
|
|
|
asm
|
|
|
+ pushl %esi
|
|
|
+ pushl %edi
|
|
|
+ pushl %ebx
|
|
|
movl device,%edx
|
|
|
movl handle,%esi
|
|
|
movl offset,%ebx
|
|
@@ -1032,6 +1123,9 @@ interface
|
|
|
setnc %al
|
|
|
movb %al,__RESULT
|
|
|
call test_int31
|
|
|
+ popl %ebx
|
|
|
+ popl %edi
|
|
|
+ popl %esi
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1062,7 +1156,10 @@ end.
|
|
|
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.2 2003-09-07 22:29:26 hajny
|
|
|
+ Revision 1.3 2003-10-03 21:59:28 peter
|
|
|
+ * stdcall fixes
|
|
|
+
|
|
|
+ Revision 1.2 2003/09/07 22:29:26 hajny
|
|
|
* syswat renamed to system, CVS log added
|
|
|
|
|
|
|