Fixed source, restored asm dos call functions for header file compatibility
This commit is contained in:
@@ -80,7 +80,8 @@ EXTSYM GUINetTextk2
|
|||||||
|
|
||||||
|
|
||||||
SECTION .data
|
SECTION .data
|
||||||
;NEWSYM OSPort, db 0 ; 0 = DOS (C), 1 = DOS (ASM), 2 = Linux, 3 = Win95
|
NEWSYM OSPort, db 0 ; 0 = DOS (C), 1 = DOS (ASM), 2 = Linux, 3 = Win95
|
||||||
|
NEWSYM TextFile, db 0
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
||||||
NEWSYM StartUp
|
NEWSYM StartUp
|
||||||
@@ -249,8 +250,13 @@ NEWSYM MMXCheck
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
NEWSYM Open_File
|
NEWSYM Open_File
|
||||||
|
mov ax,3D00h
|
||||||
|
int 21h
|
||||||
|
; return ax = file handle, carry = error
|
||||||
|
ret
|
||||||
pushad
|
pushad
|
||||||
mov dword[ZOpenMode],0
|
mov dword[ZOpenMode],0
|
||||||
|
mov byte[TextFile],1
|
||||||
mov dword[ZOpenFileName],edx
|
mov dword[ZOpenFileName],edx
|
||||||
call ZOpenFile
|
call ZOpenFile
|
||||||
cmp eax,0FFFFFFFFh
|
cmp eax,0FFFFFFFFh
|
||||||
@@ -271,12 +277,12 @@ NEWSYM Open_File
|
|||||||
popad
|
popad
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
mov ax,3D00h
|
|
||||||
|
NEWSYM Open_File_Write
|
||||||
|
mov ax,3D01h
|
||||||
int 21h
|
int 21h
|
||||||
; return ax = file handle, carry = error
|
; return ax = file handle, carry = error
|
||||||
ret
|
ret
|
||||||
|
|
||||||
NEWSYM Open_File_Write
|
|
||||||
pushad
|
pushad
|
||||||
mov dword[ZOpenMode],2
|
mov dword[ZOpenMode],2
|
||||||
mov dword[ZOpenFileName],edx
|
mov dword[ZOpenFileName],edx
|
||||||
@@ -299,12 +305,13 @@ NEWSYM Open_File_Write
|
|||||||
popad
|
popad
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
mov ax,3D01h
|
|
||||||
int 21h
|
|
||||||
; return ax = file handle, carry = error
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM Create_File
|
NEWSYM Create_File
|
||||||
|
mov ah,3Ch
|
||||||
|
mov cx,0
|
||||||
|
int 21h
|
||||||
|
; return ax = file handle
|
||||||
|
ret
|
||||||
pushad
|
pushad
|
||||||
mov dword[ZOpenMode],1
|
mov dword[ZOpenMode],1
|
||||||
mov dword[ZOpenFileName],edx
|
mov dword[ZOpenFileName],edx
|
||||||
@@ -320,13 +327,11 @@ NEWSYM Create_File
|
|||||||
popad
|
popad
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
mov ah,3Ch
|
|
||||||
mov cx,0
|
|
||||||
int 21h
|
|
||||||
; return ax = file handle
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM Write_File
|
NEWSYM Write_File
|
||||||
|
mov ah,40h
|
||||||
|
int 21h
|
||||||
|
ret
|
||||||
mov dword[ZFileWriteHandle],0
|
mov dword[ZFileWriteHandle],0
|
||||||
mov [ZFileWriteHandle],bx
|
mov [ZFileWriteHandle],bx
|
||||||
mov [ZFileWriteSize],ecx
|
mov [ZFileWriteSize],ecx
|
||||||
@@ -344,11 +349,11 @@ NEWSYM Write_File
|
|||||||
mov eax,0
|
mov eax,0
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
mov ah,40h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM Read_File
|
NEWSYM Read_File
|
||||||
|
mov ah,3Fh
|
||||||
|
int 21h
|
||||||
|
ret
|
||||||
mov dword[ZFileReadHandle],0
|
mov dword[ZFileReadHandle],0
|
||||||
mov [ZFileReadHandle],bx
|
mov [ZFileReadHandle],bx
|
||||||
mov [ZFileReadSize],ecx
|
mov [ZFileReadSize],ecx
|
||||||
@@ -360,9 +365,6 @@ NEWSYM Read_File
|
|||||||
mov eax,[TempVarSeek]
|
mov eax,[TempVarSeek]
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
mov ah,3Fh
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM Delete_File
|
NEWSYM Delete_File
|
||||||
mov [ZFileDelFName],edx
|
mov [ZFileDelFName],edx
|
||||||
@@ -375,6 +377,9 @@ NEWSYM Delete_File
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
NEWSYM Close_File
|
NEWSYM Close_File
|
||||||
|
mov ah,3Eh
|
||||||
|
int 21h
|
||||||
|
ret
|
||||||
mov dword[ZCloseFileHandle],0
|
mov dword[ZCloseFileHandle],0
|
||||||
mov [ZCloseFileHandle],bx
|
mov [ZCloseFileHandle],bx
|
||||||
pushad
|
pushad
|
||||||
@@ -382,11 +387,12 @@ NEWSYM Close_File
|
|||||||
popad
|
popad
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
mov ah,3Eh
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM File_Seek
|
NEWSYM File_Seek
|
||||||
|
; seek to cx:dx from 0 position, return carry as error
|
||||||
|
mov ax,4200h
|
||||||
|
int 21h
|
||||||
|
ret
|
||||||
mov word[ZFileSeekPos+2],cx
|
mov word[ZFileSeekPos+2],cx
|
||||||
mov word[ZFileSeekPos],dx
|
mov word[ZFileSeekPos],dx
|
||||||
mov dword[ZFileSeekMode],0
|
mov dword[ZFileSeekMode],0
|
||||||
@@ -399,12 +405,12 @@ NEWSYM File_Seek
|
|||||||
mov dx,cx
|
mov dx,cx
|
||||||
clc
|
clc
|
||||||
ret
|
ret
|
||||||
; seek to cx:dx from 0 position, return carry as error
|
|
||||||
mov ax,4200h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM File_Seek_End
|
NEWSYM File_Seek_End
|
||||||
|
; seek to cx:dx from end position, and return file location in dx:ax
|
||||||
|
mov ax,4202h
|
||||||
|
int 21h
|
||||||
|
ret
|
||||||
mov word[ZFileSeekPos+2],cx
|
mov word[ZFileSeekPos+2],cx
|
||||||
mov word[ZFileSeekPos],dx
|
mov word[ZFileSeekPos],dx
|
||||||
mov dword[ZFileSeekHandle],0
|
mov dword[ZFileSeekHandle],0
|
||||||
@@ -420,10 +426,6 @@ NEWSYM File_Seek_End
|
|||||||
mov ax,[TempVarSeek]
|
mov ax,[TempVarSeek]
|
||||||
mov dx,[TempVarSeek+2]
|
mov dx,[TempVarSeek+2]
|
||||||
ret
|
ret
|
||||||
; seek to cx:dx from end position, and return file location in dx:ax
|
|
||||||
mov ax,4202h
|
|
||||||
int 21h
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM Get_Time
|
NEWSYM Get_Time
|
||||||
pushad
|
pushad
|
||||||
|
|||||||
Reference in New Issue
Block a user