|
@@ -22,6 +22,18 @@
|
|
%fatal "Memory model not defined."
|
|
%fatal "Memory model not defined."
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%ifdef __FAR_CODE__
|
|
|
|
+ extra_param_offset equ 2
|
|
|
|
+%else
|
|
|
|
+ extra_param_offset equ 0
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+%ifdef __FAR_DATA__
|
|
|
|
+ extra_data_offset equ 2
|
|
|
|
+%else
|
|
|
|
+ extra_data_offset equ 0
|
|
|
|
+%endif
|
|
|
|
+
|
|
cpu 8086
|
|
cpu 8086
|
|
segment _TEXT use16 class=CODE align=1
|
|
segment _TEXT use16 class=CODE align=1
|
|
|
|
|
|
@@ -113,6 +125,100 @@ error:
|
|
int 21h
|
|
int 21h
|
|
|
|
|
|
|
|
|
|
|
|
+ global FPC_MSDOS_CARRY
|
|
|
|
+FPC_MSDOS_CARRY:
|
|
|
|
+ stc
|
|
|
|
+ global FPC_MSDOS
|
|
|
|
+FPC_MSDOS:
|
|
|
|
+ mov al, 21h ; not ax, because only the low byte is used
|
|
|
|
+ pop dx
|
|
|
|
+%ifdef __FAR_CODE__
|
|
|
|
+ pop bx
|
|
|
|
+%endif
|
|
|
|
+ pop cx
|
|
|
|
+%ifdef __FAR_DATA__
|
|
|
|
+ pop si
|
|
|
|
+%endif
|
|
|
|
+ push ax
|
|
|
|
+%ifdef __FAR_DATA__
|
|
|
|
+ push si
|
|
|
|
+%endif
|
|
|
|
+ push cx
|
|
|
|
+%ifdef __FAR_CODE__
|
|
|
|
+ push bx
|
|
|
|
+%endif
|
|
|
|
+ push dx
|
|
|
|
+; global FPC_INTR
|
|
|
|
+;FPC_INTR:
|
|
|
|
+%ifdef __FAR_CODE__
|
|
|
|
+ inc bp
|
|
|
|
+%endif
|
|
|
|
+ push bp
|
|
|
|
+ mov bp, sp
|
|
|
|
+ mov al, byte [bp + 6 + extra_param_offset + extra_data_offset]
|
|
|
|
+; mov byte [cs:int_number], al
|
|
|
|
+ mov si, [bp + 4 + extra_param_offset]
|
|
|
|
+ push ds
|
|
|
|
+%ifdef __FAR_DATA__
|
|
|
|
+ mov ax, [bp + 6 + extra_param_offset]
|
|
|
|
+ mov ds, ax
|
|
|
|
+%endif
|
|
|
|
+ mov ax, word [si + 16]
|
|
|
|
+ mov es, ax
|
|
|
|
+ mov ax, word [si + 14] ; ds
|
|
|
|
+ push ax
|
|
|
|
+ mov ax, word [si]
|
|
|
|
+ mov bx, word [si + 2]
|
|
|
|
+ mov cx, word [si + 4]
|
|
|
|
+ mov dx, word [si + 6]
|
|
|
|
+ mov bp, word [si + 8]
|
|
|
|
+ mov di, word [si + 12]
|
|
|
|
+ mov si, word [si + 10]
|
|
|
|
+
|
|
|
|
+ pop ds
|
|
|
|
+; db 0CDh ; opcode of INT xx
|
|
|
|
+;int_number:
|
|
|
|
+; db 255
|
|
|
|
+ int 21h
|
|
|
|
+
|
|
|
|
+ pushf
|
|
|
|
+ push ds
|
|
|
|
+ push si
|
|
|
|
+ push bp
|
|
|
|
+ mov bp, sp
|
|
|
|
+%ifdef __FAR_DATA__
|
|
|
|
+ mov si, [bp + 16 + extra_param_offset]
|
|
|
|
+%else
|
|
|
|
+ mov si, word [bp + 8]
|
|
|
|
+%endif
|
|
|
|
+ mov ds, si
|
|
|
|
+ mov si, word [bp + 14 + extra_param_offset]
|
|
|
|
+ mov word [si], ax
|
|
|
|
+ mov word [si + 2], bx
|
|
|
|
+ mov word [si + 4], cx
|
|
|
|
+ mov word [si + 6], dx
|
|
|
|
+ mov word [si + 12], di
|
|
|
|
+ mov ax, es
|
|
|
|
+ mov word [si + 16], ax
|
|
|
|
+ pop ax
|
|
|
|
+ mov word [si + 8], ax
|
|
|
|
+ pop ax
|
|
|
|
+ mov word [si + 10], ax
|
|
|
|
+ pop ax
|
|
|
|
+ mov word [si + 14], ax
|
|
|
|
+ pop ax
|
|
|
|
+ mov word [si + 18], ax
|
|
|
|
+
|
|
|
|
+ pop ds
|
|
|
|
+ pop bp
|
|
|
|
+%ifdef __FAR_CODE__
|
|
|
|
+ dec bp
|
|
|
|
+ retf 4 + extra_data_offset
|
|
|
|
+%else
|
|
|
|
+ ret 4 + extra_data_offset
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+
|
|
segment _DATA use16 class=DATA align=2
|
|
segment _DATA use16 class=DATA align=2
|
|
; the first 16 bytes of the automatic data segment are reserved.
|
|
; the first 16 bytes of the automatic data segment are reserved.
|
|
; they are filled by the InitTask function with these values
|
|
; they are filled by the InitTask function with these values
|