git-svn-id: branches/i8086@24037 -
@@ -8202,6 +8202,7 @@ rtl/morphos/videodata.inc svneol=native#text/plain
rtl/msdos/Makefile svneol=native#text/plain
rtl/msdos/Makefile.fpc svneol=native#text/plain
rtl/msdos/prt0.asm svneol=native#text/plain
+rtl/msdos/registers.inc svneol=native#text/plain
rtl/msdos/sysdir.inc svneol=native#text/plain
rtl/msdos/sysfile.inc svneol=native#text/plain
rtl/msdos/sysheap.inc svneol=native#text/plain
@@ -14,6 +14,68 @@
mov es, ax
jmp PASCALMAIN
+ global FPC_INTR
+FPC_INTR:
+ mov byte [cs:int_number], al
+ push es
+ push di
+ push bx
+ push cx
+ push si
+ push ds
+ mov si, dx
+ mov ax, word [si + 16]
+ mov es, ax
+ mov ax, word [si + 18] ; flags
+ push ax
+ mov ax, word [si + 14] ; ds
+ 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
+ popf
+ db 0CDh ; opcode of INT xx
+int_number:
+ db 255
+ pushf
+ push bp
+ mov bp, sp
+ mov si, word [ss:bp + 8]
+ mov ds, si
+ mov si, word [ss:bp + 10]
+ 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
+ mov word [si + 10], ax
+ mov word [si + 14], ax
+ mov word [si + 18], ax
+ pop si
+ pop cx
+ pop bx
+ pop di
+ pop es
+ ret
segment stack stack class=stack
resb 4096
stacktop:
@@ -0,0 +1,9 @@
+{ Registers record used by Intr and MsDos. This include file is shared between
+ the system unit and the dos unit. }
+type
+ Registers = packed record
+ case Integer of
+ 0: (AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags: Word);
+ 1: (AL, AH, BL, BH, CL, CH, DL, DH: Byte);
+ end;
@@ -65,6 +65,15 @@ implementation
{$I system.inc}
+{$I registers.inc}
+procedure Intr(IntNo: Byte; var Regs: Registers); external name 'FPC_INTR';
+procedure MsDos(var Regs: Registers);
+begin
+ Intr($21, Regs);
+end;
procedure DebugWrite(const S: string);
begin
asm