mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 01:18:57 +02:00
* ___SYSCALL changed to uppercase.
This commit is contained in:
parent
3ffd393399
commit
b7f23a6e8c
@ -43,6 +43,8 @@ unit dos;
|
||||
|
||||
{$I os.inc}
|
||||
|
||||
{$I386_DIRECT}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
@ -312,7 +314,7 @@ unit dos;
|
||||
movw (%ebx),%bx
|
||||
{ get date }
|
||||
movw $0x5700,%ax
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
shll $16,%edx
|
||||
movw %cx,%dx
|
||||
movl time,%ebx
|
||||
@ -348,7 +350,7 @@ unit dos;
|
||||
shldl $16,%ecx,%edx
|
||||
{ set date }
|
||||
movw $0x5701,%ax
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
xorb %ah,%ah
|
||||
movw %ax,U_DOS_DOSERROR
|
||||
end;
|
||||
@ -381,7 +383,7 @@ unit dos;
|
||||
movb %al,int86_vec
|
||||
|
||||
movl 10(%ebp),%eax
|
||||
; do not use first int
|
||||
{do not use first int}
|
||||
addl $2,%eax
|
||||
|
||||
movl 4(%eax),%ebx
|
||||
@ -398,25 +400,25 @@ unit dos;
|
||||
pushl %ebp
|
||||
pushl %eax
|
||||
movl %esp,%ebp
|
||||
; calc EBP new
|
||||
{calc EBP new}
|
||||
addl $12,%ebp
|
||||
movl 10(%ebp),%eax
|
||||
; do not use first int
|
||||
{do not use first int}
|
||||
addl $2,%eax
|
||||
|
||||
popl (%eax)
|
||||
movl %ebx,4(%eax)
|
||||
movl %ecx,8(%eax)
|
||||
movl %edx,12(%eax)
|
||||
; restore EBP
|
||||
{restore EBP}
|
||||
popl %edx
|
||||
movl %edx,16(%eax)
|
||||
movl %esi,20(%eax)
|
||||
movl %edi,24(%eax)
|
||||
; ignore ES and DS
|
||||
{ignore ES and DS}
|
||||
popl %ebx /* flags */
|
||||
movl %ebx,32(%eax)
|
||||
; FS and GS too
|
||||
{FS and GS too}
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -566,7 +568,7 @@ unit dos;
|
||||
asm
|
||||
movl esadr,%edx
|
||||
mov $0x7f06,%ax
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
jnc exprg1
|
||||
movl %eax,U_DOS_DOSERROR
|
||||
xorl %eax,%eax
|
||||
@ -605,7 +607,7 @@ unit dos;
|
||||
{Returns DOS version in DOS and OS/2 version in OS/2}
|
||||
asm
|
||||
movb $0x30,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
leave
|
||||
ret
|
||||
end;
|
||||
@ -637,7 +639,7 @@ unit dos;
|
||||
{$ELSE}
|
||||
asm
|
||||
movb $0x2a,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
xorb %ah,%ah
|
||||
movl 20(%ebp),%edi
|
||||
stosw
|
||||
@ -676,7 +678,7 @@ unit dos;
|
||||
movb 10(%ebp),%dh
|
||||
movb 12(%ebp),%dl
|
||||
movb $0x2b,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
xorb %ah,%ah
|
||||
movw %ax,U_DOS_DOSERROR
|
||||
end;
|
||||
@ -709,7 +711,7 @@ unit dos;
|
||||
{$ELSE}
|
||||
asm
|
||||
movb $0x2c,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
xorb %ah,%ah
|
||||
movl 20(%ebp),%edi
|
||||
movb %dl,%al
|
||||
@ -750,7 +752,7 @@ unit dos;
|
||||
movb 12(%ebp),%dh
|
||||
movb 14(%ebp),%dl
|
||||
movb $0x2d,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
xorb %ah,%ah
|
||||
movw %ax,U_DOS_DOSERROR
|
||||
end;
|
||||
@ -774,7 +776,7 @@ unit dos;
|
||||
signal handling instead.}
|
||||
asm
|
||||
movw $0x3300,%ax
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
movl 8(%ebp),%eax
|
||||
movb %dl,(%eax)
|
||||
end;
|
||||
@ -798,7 +800,7 @@ unit dos;
|
||||
asm
|
||||
movb 8(%ebp),%dl
|
||||
movl $0x3301,%ax
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -819,7 +821,7 @@ unit dos;
|
||||
{! Do not use in OS/2.}
|
||||
asm
|
||||
movb $0x54,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
movl 8(%ebp),%edi
|
||||
stosb
|
||||
end;
|
||||
@ -842,7 +844,7 @@ unit dos;
|
||||
asm
|
||||
movb 8(%ebp),%al
|
||||
movl $0x2e,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -879,7 +881,7 @@ unit dos;
|
||||
asm
|
||||
movb 8(%ebp),%dl
|
||||
movb $0x36,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
cmpw $-1,%ax
|
||||
je LDISKFREE1
|
||||
mulw %cx
|
||||
@ -937,7 +939,7 @@ unit dos;
|
||||
asm
|
||||
movb 8(%ebp),%dl
|
||||
movb $0x36,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
movw %dx,%bx
|
||||
cmpw $-1,%ax
|
||||
je LDISKSIZE1
|
||||
@ -1031,7 +1033,7 @@ unit dos;
|
||||
{No need to set DTA in EMX. Just give a pointer in ESI.}
|
||||
movl 18(%ebp),%esi
|
||||
movb $0x4e,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
jnc LFF
|
||||
movw %ax,U_DOS_DOSERROR
|
||||
LFF:
|
||||
@ -1070,7 +1072,7 @@ unit dos;
|
||||
asm
|
||||
movl 12(%ebp),%esi
|
||||
movb $0x4f,%ah
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
jnc LFN
|
||||
movw %ax,U_DOS_DOSERROR
|
||||
LFN:
|
||||
@ -1306,7 +1308,7 @@ unit dos;
|
||||
asm
|
||||
movw $0x4300,%ax
|
||||
leal n,%edx
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
movl attr,%ebx
|
||||
movw %cx,(%ebx)
|
||||
end;
|
||||
@ -1335,7 +1337,7 @@ unit dos;
|
||||
movw $0x4301,%ax
|
||||
leal n,%edx
|
||||
movw attr,%cx
|
||||
call ___syscall
|
||||
call ___SYSCALL
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
@ -66,7 +66,7 @@ UNIT Objects;
|
||||
{$IFDEF OS2} { OS2 platform }
|
||||
{$DEFINE ADV_OS} { Set as advanced }
|
||||
{$IFNDEF FPK}
|
||||
{$DEFINE BPOS2} { Define BPOS2 }
|
||||
{$DEFINE BPOS2} { Define BPOS2 }
|
||||
{$ENDIF FPK}
|
||||
{$UNDEF NotOS2} { This is OS2 compiler }
|
||||
{$UNDEF USE_BGI} { Can't use BGI }
|
||||
@ -1750,7 +1750,7 @@ BEGIN
|
||||
XOR %CX, %CX;
|
||||
MOVW Mode, %AX; { Mode to open file }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Open/create the file }
|
||||
INT $0x21; { Open/create the file }
|
||||
POPL %EBP;
|
||||
JNC EXIT1;
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { Hold error }
|
||||
@ -1766,10 +1766,10 @@ ASSEMBLER;
|
||||
ASM
|
||||
XOR AX, AX; { Dos error cleared }
|
||||
MOV DosStreamError, AX;
|
||||
MOV AX, Mode; { Mode to open file }
|
||||
MOV AX, Mode; { Mode to open file }
|
||||
PUSH DS;
|
||||
LDS DX, FileName; { Filename to open }
|
||||
XOR CX, CX;
|
||||
XOR CX, CX;
|
||||
INT $21; { Open/create file }
|
||||
POP DS;
|
||||
JNC @@Exit1; { Check for error }
|
||||
@ -1795,7 +1795,7 @@ BEGIN
|
||||
End;
|
||||
stOpenWrite: Begin { Open file for write }
|
||||
Attr := $0; { Any attributes }
|
||||
OpenFlags := 1; { Open flags }
|
||||
OpenFlags := 1; { Open flags }
|
||||
OpenMode := FmOutput; { Output file }
|
||||
End;
|
||||
stOpen: Begin { Open file read/write }
|
||||
@ -1809,24 +1809,24 @@ BEGIN
|
||||
{$ELSE} { Other OS2 compilers }
|
||||
DosStreamError := DosOpen(@FileName[0], Handle,
|
||||
{$ENDIF}
|
||||
ActionTaken, 0, Attr, OpenFlags, OpenMode, Nil); { Open the file }
|
||||
ActionTaken, 0, Attr, OpenFlags, OpenMode, Nil); { Open the file }
|
||||
If (DosStreamError=0) Then DosFileOpen := Handle { Successful open }
|
||||
Else DosFileOpen := 0; { Fail so return zero }
|
||||
Else DosFileOpen := 0; { Fail so return zero }
|
||||
END;
|
||||
{$ELSE FPK}
|
||||
BEGIN
|
||||
ASM
|
||||
XOR %AX, %AX; { Clear error }
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR;
|
||||
MOVL Filename, %EDX; { Filename to open }
|
||||
XOR %CX, %CX;
|
||||
MOVW Mode, %AX; { Mode to open file }
|
||||
CALL ___syscall; { Open/create the file }
|
||||
JNC EXIT1;
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { Hold error }
|
||||
XOR %AX, %AX; { Open failed }
|
||||
XOR %AX, %AX; { Clear error }
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR;
|
||||
MOVL Filename, %EDX; { Filename to open }
|
||||
XOR %CX, %CX;
|
||||
MOVW Mode, %AX; { Mode to open file }
|
||||
CALL ___SYSCALL; { Open/create the file }
|
||||
JNC EXIT1;
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { Hold error }
|
||||
XOR %AX, %AX; { Open failed }
|
||||
EXIT1:
|
||||
MOV %AX, U_OBJECTS_TRANSFERHANDLE; { Hold opened handle }
|
||||
MOV %AX, U_OBJECTS_TRANSFERHANDLE; { Hold opened handle }
|
||||
END;
|
||||
DosFileOpen := TransferHandle; { Return handle }
|
||||
END;
|
||||
@ -1848,38 +1848,38 @@ End;
|
||||
{$IFNDEF OS2}
|
||||
BEGIN
|
||||
ASM
|
||||
MOVL BufferArea, %EDX; { Buffer for data }
|
||||
MOVL BufferLength, %CX; { Bytes to read }
|
||||
MOVB $0x3F, %AH;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Read from file }
|
||||
POPL %EBP;
|
||||
JC EXIT2; { Check for error }
|
||||
MOVL BytesMoved, %EDI;
|
||||
MOVZWL %AX, %EAX;
|
||||
MOVL %EAX, (%EDI); { Update bytes moved }
|
||||
XOR %EAX, %EAX; { Clear register }
|
||||
MOVL BufferArea, %EDX; { Buffer for data }
|
||||
MOVL BufferLength, %CX; { Bytes to read }
|
||||
MOVB $0x3F, %AH;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Read from file }
|
||||
POPL %EBP;
|
||||
JC EXIT2; { Check for error }
|
||||
MOVL BytesMoved, %EDI;
|
||||
MOVZWL %AX, %EAX;
|
||||
MOVL %EAX, (%EDI); { Update bytes moved }
|
||||
XOR %EAX, %EAX; { Clear register }
|
||||
EXIT2:
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
END;
|
||||
DosRead := DosStreamError; { Return any error }
|
||||
END;
|
||||
{$ELSE OS2}
|
||||
BEGIN
|
||||
ASM
|
||||
MOVL BufferArea, %EDX; { Buffer for data }
|
||||
MOVL BufferLength, %CX; { Bytes to read }
|
||||
MOVB $0x3F, %AH;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
CALL ___syscall; { Read from file }
|
||||
JC EXIT2; { Check for error }
|
||||
MOVL BytesMoved, %EDI;
|
||||
MOVZWL %AX, %EAX;
|
||||
MOVL %EAX, (%EDI); { Update bytes moved }
|
||||
XOR %EAX, %EAX; { Clear register }
|
||||
MOVL BufferArea, %EDX; { Buffer for data }
|
||||
MOVL BufferLength, %CX; { Bytes to read }
|
||||
MOVB $0x3F, %AH;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
CALL ___SYSCALL; { Read from file }
|
||||
JC EXIT2; { Check for error }
|
||||
MOVL BytesMoved, %EDI;
|
||||
MOVZWL %AX, %EAX;
|
||||
MOVL %EAX, (%EDI); { Update bytes moved }
|
||||
XOR %EAX, %EAX; { Clear register }
|
||||
EXIT2:
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
END;
|
||||
DosRead := DosStreamError; { Return any error }
|
||||
END;
|
||||
@ -1888,19 +1888,19 @@ END;
|
||||
{$ELSE} { Other compilers }
|
||||
ASSEMBLER;
|
||||
ASM
|
||||
PUSH DS;
|
||||
LDS DX, BufferArea; { Data dest buffer }
|
||||
MOV CX, BufferLength;
|
||||
MOV BX, Handle; { Load file handle }
|
||||
MOV AH, $0x3F;
|
||||
INT $0x21; { Read from file }
|
||||
POP DS;
|
||||
JC @@Exit2; { Check for error }
|
||||
LES DI, BytesMoved;
|
||||
MOV ES:[DI], AX; { Update bytes moved }
|
||||
XOR AX, AX;
|
||||
PUSH DS;
|
||||
LDS DX, BufferArea; { Data dest buffer }
|
||||
MOV CX, BufferLength;
|
||||
MOV BX, Handle; { Load file handle }
|
||||
MOV AH, $0x3F;
|
||||
INT $0x21; { Read from file }
|
||||
POP DS;
|
||||
JC @@Exit2; { Check for error }
|
||||
LES DI, BytesMoved;
|
||||
MOV ES:[DI], AX; { Update bytes moved }
|
||||
XOR AX, AX;
|
||||
@@Exit2:
|
||||
MOV DosStreamError, AX; { DOS error returned }
|
||||
MOV DosStreamError, AX; { DOS error returned }
|
||||
END;
|
||||
{$ENDIF}
|
||||
|
||||
@ -1919,20 +1919,20 @@ End;
|
||||
{$ELSE not GO32V2}
|
||||
BEGIN
|
||||
ASM
|
||||
MOVL BufferArea, %EDX; { Buffer with data }
|
||||
MOVL BufferLength, %CX; { Bytes to write }
|
||||
MOVB $0x40, %AH;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Write to file }
|
||||
POPL %EBP;
|
||||
JC EXIT3; { Check for error }
|
||||
MOVL BytesMoved, %EDI;
|
||||
MOVZWL %AX, %EAX;
|
||||
MOVL %EAX, (%EDI); { Update bytes moved }
|
||||
XOR %EAX, %EAX;
|
||||
MOVL BufferArea, %EDX; { Buffer with data }
|
||||
MOVL BufferLength, %CX; { Bytes to write }
|
||||
MOVB $0x40, %AH;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Write to file }
|
||||
POPL %EBP;
|
||||
JC EXIT3; { Check for error }
|
||||
MOVL BytesMoved, %EDI;
|
||||
MOVZWL %AX, %EAX;
|
||||
MOVL %EAX, (%EDI); { Update bytes moved }
|
||||
XOR %EAX, %EAX;
|
||||
EXIT3:
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
MOV %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
END;
|
||||
DosWrite := DosStreamError; { Return any error }
|
||||
END;
|
||||
@ -1940,15 +1940,15 @@ END;
|
||||
{$ELSE} { Other compilers }
|
||||
ASSEMBLER;
|
||||
ASM
|
||||
PUSH DS;
|
||||
LDS DX, BufferArea; { Data source buffer }
|
||||
MOV CX, BufferLength;
|
||||
MOV BX, Handle; { Load file handle }
|
||||
MOV AH, $40;
|
||||
INT $21; { Write to file }
|
||||
POP DS;
|
||||
JC @@Exit3; { Check for error }
|
||||
LES DI, BytesMoved;
|
||||
PUSH DS;
|
||||
LDS DX, BufferArea; { Data source buffer }
|
||||
MOV CX, BufferLength;
|
||||
MOV BX, Handle; { Load file handle }
|
||||
MOV AH, $40;
|
||||
INT $21; { Write to file }
|
||||
POP DS;
|
||||
JC @@Exit3; { Check for error }
|
||||
LES DI, BytesMoved;
|
||||
MOV ES:[DI], AX; { Update bytes moved }
|
||||
XOR AX, AX;
|
||||
@@Exit3:
|
||||
@ -1965,48 +1965,48 @@ VAR NewPos: LongInt): Word;
|
||||
{$IFNDEF OS2}
|
||||
BEGIN
|
||||
ASM
|
||||
MOVW MoveType, %AX; { Load move type }
|
||||
MOVB $0x42, %AH;
|
||||
MOVW POS, %DX; { Load file position }
|
||||
MOVL POS, %ECX;
|
||||
SHRL $16,%ECX;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Position the file }
|
||||
POPL %EBP;
|
||||
JC EXIT4;
|
||||
MOVL NewPos, %EDI; { New position address }
|
||||
MOVW %AX, %BX;
|
||||
MOVW %DX, %AX;
|
||||
SHLL $0x10, %EAX; { Roll to high part }
|
||||
MOVW %BX, %AX;
|
||||
MOVL %EAX, (%EDI); { Update new position }
|
||||
XOR %EAX, %EAX;
|
||||
MOVW MoveType, %AX; { Load move type }
|
||||
MOVB $0x42, %AH;
|
||||
MOVW POS, %DX; { Load file position }
|
||||
MOVL POS, %ECX;
|
||||
SHRL $16,%ECX;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Position the file }
|
||||
POPL %EBP;
|
||||
JC EXIT4;
|
||||
MOVL NewPos, %EDI; { New position address }
|
||||
MOVW %AX, %BX;
|
||||
MOVW %DX, %AX;
|
||||
SHLL $0x10, %EAX; { Roll to high part }
|
||||
MOVW %BX, %AX;
|
||||
MOVL %EAX, (%EDI); { Update new position }
|
||||
XOR %EAX, %EAX;
|
||||
EXIT4:
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
END;
|
||||
DosSetFilePtr := DosStreamError; { Return any error }
|
||||
END;
|
||||
{$ELSE OS2}
|
||||
BEGIN
|
||||
ASM
|
||||
MOVW MoveType, %AX; { Load move type }
|
||||
MOVB $0x42, %AH;
|
||||
MOVW POS, %DX; { Load file position }
|
||||
MOVL POS, %ECX;
|
||||
SHRL $16,%ECX;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
CALL ___syscall; { Position the file }
|
||||
JC EXIT4;
|
||||
MOVL NewPos, %EDI; { New position address }
|
||||
MOVW %AX, %BX;
|
||||
MOVW %DX, %AX;
|
||||
SHLL $0x10, %EAX; { Roll to high part }
|
||||
MOVW %BX, %AX;
|
||||
MOVL %EAX, (%EDI); { Update new position }
|
||||
XOR %EAX, %EAX;
|
||||
MOVW MoveType, %AX; { Load move type }
|
||||
MOVB $0x42, %AH;
|
||||
MOVW POS, %DX; { Load file position }
|
||||
MOVL POS, %ECX;
|
||||
SHRL $16,%ECX;
|
||||
MOVW Handle, %BX; { Load file handle }
|
||||
CALL ___SYSCALL; { Position the file }
|
||||
JC EXIT4;
|
||||
MOVL NewPos, %EDI; { New position address }
|
||||
MOVW %AX, %BX;
|
||||
MOVW %DX, %AX;
|
||||
SHLL $0x10, %EAX; { Roll to high part }
|
||||
MOVW %BX, %AX;
|
||||
MOVL %EAX, (%EDI); { Update new position }
|
||||
XOR %EAX, %EAX;
|
||||
EXIT4:
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
END;
|
||||
DosSetFilePtr := DosStreamError; { Return any error }
|
||||
END;
|
||||
@ -2014,16 +2014,16 @@ END;
|
||||
{$ELSE} { Other compilers }
|
||||
ASSEMBLER;
|
||||
ASM
|
||||
MOV AX, MoveType; { Load move type }
|
||||
MOV AH, $42;
|
||||
MOV DX, Pos.Word[0]; { Load file position }
|
||||
MOV CX, Pos.Word[2];
|
||||
MOV BX, Handle; { Load file handle }
|
||||
INT $21; { Position the file }
|
||||
JC @@Exit4;
|
||||
LES DI, NewPos; { New position address }
|
||||
MOV ES:[DI], AX;
|
||||
MOV ES:[DI+2], DX; { Update new position }
|
||||
MOV AX, MoveType; { Load move type }
|
||||
MOV AH, $42;
|
||||
MOV DX, Pos.Word[0]; { Load file position }
|
||||
MOV CX, Pos.Word[2];
|
||||
MOV BX, Handle; { Load file handle }
|
||||
INT $21; { Position the file }
|
||||
JC @@Exit4;
|
||||
LES DI, NewPos; { New position address }
|
||||
MOV ES:[DI], AX;
|
||||
MOV ES:[DI+2], DX; { Update new position }
|
||||
XOR AX, AX;
|
||||
@@Exit4:
|
||||
MOV DosStreamError, AX; { DOS error returned }
|
||||
@ -2038,28 +2038,28 @@ PROCEDURE DosClose (Handle: Word);
|
||||
{$IFNDEF OS2}
|
||||
BEGIN
|
||||
ASM
|
||||
XOR %AX, %AX;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error cleared }
|
||||
MOVB $0x3E, %AH;
|
||||
MOVW Handle, %BX; { DOS file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Close the file }
|
||||
POPL %EBP;
|
||||
JNC EXIT5;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
XOR %AX, %AX;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error cleared }
|
||||
MOVB $0x3E, %AH;
|
||||
MOVW Handle, %BX; { DOS file handle }
|
||||
PUSHL %EBP;
|
||||
INT $0x21; { Close the file }
|
||||
POPL %EBP;
|
||||
JNC EXIT5;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
EXIT5:
|
||||
END;
|
||||
END;
|
||||
{$ELSE OS2}
|
||||
BEGIN
|
||||
ASM
|
||||
XOR %AX, %AX;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error cleared }
|
||||
MOVB $0x3E, %AH;
|
||||
MOVW Handle, %BX; { DOS file handle }
|
||||
CALL ___syscall; { Close the file }
|
||||
JNC EXIT5;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
XOR %AX, %AX;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error cleared }
|
||||
MOVB $0x3E, %AH;
|
||||
MOVW Handle, %BX; { DOS file handle }
|
||||
CALL ___SYSCALL; { Close the file }
|
||||
JNC EXIT5;
|
||||
MOVW %AX, U_OBJECTS_DOSSTREAMERROR; { DOS error returned }
|
||||
EXIT5:
|
||||
END;
|
||||
END;
|
||||
@ -2067,13 +2067,13 @@ END;
|
||||
{$ELSE} { Other compilers }
|
||||
ASSEMBLER;
|
||||
ASM
|
||||
XOR AX, AX; { DOS error cleared }
|
||||
MOV DosStreamError, AX;
|
||||
MOV BX, Handle; { DOS file handle }
|
||||
MOV AH, $3E;
|
||||
INT $21; { Close the file }
|
||||
JNC @@Exit5;
|
||||
MOV DosStreamError, AX; { DOS error returned }
|
||||
XOR AX, AX; { DOS error cleared }
|
||||
MOV DosStreamError, AX;
|
||||
MOV BX, Handle; { DOS file handle }
|
||||
MOV AH, $3E;
|
||||
INT $21; { Close the file }
|
||||
JNC @@Exit5;
|
||||
MOV DosStreamError, AX; { DOS error returned }
|
||||
@@Exit5:
|
||||
END;
|
||||
{$ENDIF}
|
||||
|
@ -1,73 +1,73 @@
|
||||
/ prt0.s (emx+fpk) -- Made from crt0.s,
|
||||
/ Copyright (c) 1990-1994 by Eberhard Mattes.
|
||||
/ Changed for FPK-Pascal in 1997 Dani‰l Mantione.
|
||||
/ This code is _not_ under the Library GNU Public
|
||||
/ License, because the original is not. See copying.emx
|
||||
/ for details. You should have received it with this
|
||||
/ product, write the author if you haven't.
|
||||
/ This code is _not_ under the Library GNU Public
|
||||
/ License, because the original is not. See copying.emx
|
||||
/ for details. You should have received it with this
|
||||
/ product, write the author if you haven't.
|
||||
|
||||
.globl __text
|
||||
.globl ___syscall
|
||||
.globl __data
|
||||
.globl __heap_base
|
||||
.globl __heap_brk
|
||||
.globl __heap_end
|
||||
.globl __init
|
||||
.globl __text
|
||||
.globl ___SYSCALL
|
||||
.globl __data
|
||||
.globl __heap_base
|
||||
.globl __heap_brk
|
||||
.globl __heap_end
|
||||
.globl __init
|
||||
|
||||
.text
|
||||
.text
|
||||
|
||||
__text:
|
||||
push $__data
|
||||
call __dos_init
|
||||
jmp __init
|
||||
push $__data
|
||||
call __dos_init
|
||||
jmp __init
|
||||
|
||||
___syscall:
|
||||
call __dos_syscall
|
||||
ret
|
||||
___SYSCALL:
|
||||
call __dos_syscall
|
||||
ret
|
||||
|
||||
.space 6, 0x90
|
||||
.space 6, 0x90
|
||||
|
||||
__init: cld
|
||||
call __entry1
|
||||
call __entry1
|
||||
|
||||
call _main
|
||||
movb $0x4c,%ah
|
||||
call ___syscall
|
||||
call _main
|
||||
movb $0x4c,%ah
|
||||
call ___SYSCALL
|
||||
2: jmp 2b
|
||||
|
||||
.data
|
||||
.data
|
||||
|
||||
/ The data segment starts with a table containing the start and end
|
||||
/ addresses of the text, data and bss segments
|
||||
|
||||
__data:
|
||||
.long __text
|
||||
.long __etext
|
||||
.long __data
|
||||
.long __edata
|
||||
.long __edata
|
||||
.long __end
|
||||
.long __text
|
||||
.long __etext
|
||||
.long __data
|
||||
.long __edata
|
||||
.long __edata
|
||||
.long __end
|
||||
__heap_base:
|
||||
.long 0
|
||||
.long 0
|
||||
__heap_end:
|
||||
.long 0
|
||||
.long 0
|
||||
__heap_brk:
|
||||
.long 0
|
||||
.long 0
|
||||
.long __os2dll
|
||||
.long 0
|
||||
.long 0
|
||||
.long 0x02000000
|
||||
.long 0
|
||||
.long 0
|
||||
.byte 0
|
||||
.space 63, 0
|
||||
.long 0
|
||||
.long 0
|
||||
.long __os2dll
|
||||
.long 0
|
||||
.long 0
|
||||
.long 0x02000000
|
||||
.long 0
|
||||
.long 0
|
||||
.byte 0
|
||||
.space 63, 0
|
||||
|
||||
/ Don't touch this. It's EMX vodoo. In short, this causes the __os2dll symbol
|
||||
/ point to table of DLL data that the linker includes in the executable.
|
||||
|
||||
.stabs "__os2dll", 21, 0, 0, 0xffffffff
|
||||
.stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff
|
||||
.stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff
|
||||
.stabs "___crtinit1__", 21, 0, 0, 0xffffffff
|
||||
.stabs "___crtexit1__", 21, 0, 0, 0xffffffff
|
||||
.stabs "__os2dll", 21, 0, 0, 0xffffffff
|
||||
.stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff
|
||||
.stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff
|
||||
.stabs "___crtinit1__", 21, 0, 0, 0xffffffff
|
||||
.stabs "___crtexit1__", 21, 0, 0, 0xffffffff
|
||||
|
Loading…
Reference in New Issue
Block a user