home *** CD-ROM | disk | FTP | other *** search
- ; pcoint86.asm
- ;
- ; 12/13/88 by Ted
- ;
- ; Dos/Bios interrupt function.
- ;
- ; Copyright (c) 1988, 1989 Oakland Group Inc.
- ; ALL RIGHTS RESERVED
- ;
- ;------------------------REVISION HISTORY--------------------------------------;
- ;------------------------------------------------------------------------------;
- include PCDECL.MAC
-
- regstruc struc
- rax dw 0
- rbx dw 0
- rcx dw 0
- rdx dw 0
- res dw 0
- rds dw 0
- rsi dw 0
- rdi dw 0
- regstruc ends
-
- PSEG
- ;------------------------------------------------------------------------------;
- ; unsigned _oakint86(unsigned intno, regstruc *regs, boolean esin);
- ; Puts the values from regstruc into the registers and executes the specified
- ; interrupt. Fills the structure up again with the outgoing register values.
- ; NOTE: Ignores es and ds unless esin is TRUE, in which case es is used as input
- ; and es and ds are returned in the regs structure.
-
- pubproc DIGPRIV _oakint86 <intno, regs, dptr, esin>
- push bp
- mov bp,sp
- pushm <ds, es, si, di>
-
- mov ax,[bp].intno ;get interrupt #
- mov bx, offset do_int
- mov cs:[bx+1], al ;poke it into do_int function
-
- mov bx,[bp].regs ;get source registers
- IF FAR_DATA
- mov ds, [bp].regs+2 ;get regs segment
- ELSE
- mov [bp].intno, ds ; intno is already in ax; save ds in intno
- ENDIF
-
- mov si, [bx].rsi
- mov di, [bx].rdi
- mov dx, [bx].rdx
- mov cx, [bx].rcx
- cmp word ptr [bp].esin, 0
- je noes
- mov es, [bx].res
- noes:
- ;; mov ax, [bx].rds
- ;; push ax
- mov ax, [bx].rax
- mov bx, [bx].rbx
- ;; pop ds
-
- push bp
- call near ptr do_int
- pop bp
-
- pushf
- push ds
- push bx
- mov bx,[bp].regs ;get source registers
- IF FAR_DATA
- mov ds, [bp].regs+2 ;get regs segment
- ELSE
- mov ds, [bp].intno
- ENDIF
- pop [bx].rbx
- pop [bx].rds
- mov [bx].rax, ax
- mov [bx].res, es
- pop ax ; get flags into ax for return
-
- mov [bx].rcx, cx
- mov [bx].rdx, dx
- mov [bx].rdi, di
- mov [bx].rsi, si
-
- popm <di, si, es, ds>
- pop bp
- ret
- endproc _oakint86
-
- do_int proc near
- int 10h
- ret
- do_int endp
- ; ---------------------------------------------------------------- ;
- ENDPS
- end
- ; ---------------------------------------------------------------- ;
-