Make getint and setint reuse cs segment
This commit is contained in:
parent
4a92c4bc1e
commit
c1c012c5fc
@ -94,44 +94,31 @@ sftab: dw sferr, sferr, sferr, sferr
|
||||
dw sferr, sferr, sferr, sferr
|
||||
dw sferr, sferr, sferr, sferr
|
||||
|
||||
; IN al number
|
||||
; OUT bx al * 4
|
||||
times4: push ax
|
||||
xor ah, ah
|
||||
add al, al
|
||||
add al, al
|
||||
mov bx, ax
|
||||
pop ax
|
||||
ret
|
||||
|
||||
; DOS 2+ - GET INTERRUPT VECTOR
|
||||
; IN al interrupt number
|
||||
; OUT es:bx current interrupt handler
|
||||
getint: push ds
|
||||
; DS=0
|
||||
xor bx, bx
|
||||
mov ds, bx
|
||||
getint: xor bx, bx
|
||||
; BX=AL*4
|
||||
call times4
|
||||
les bx, [bx]
|
||||
pop ds
|
||||
mov bl, al
|
||||
add bl, bl
|
||||
add bl, bl
|
||||
; load vector into ES:BX
|
||||
les bx, [cs:bx]
|
||||
ret
|
||||
|
||||
; DOS 25h: Set interrupt vector
|
||||
; IN al interrupt number
|
||||
; ds:dx entry point
|
||||
setint: push es
|
||||
push bx
|
||||
; ES=0
|
||||
setint: push bx
|
||||
xor bx, bx
|
||||
mov es, bx
|
||||
; BX=AL*4
|
||||
call times4
|
||||
mov [es:bx], dx
|
||||
mov ax, ds
|
||||
mov [es:bx+2], ds
|
||||
mov bl, al
|
||||
add bl, bl
|
||||
add bl, bl
|
||||
; save DS:DX into vector
|
||||
mov [cs:bx], dx
|
||||
mov [cs:bx+2], ds
|
||||
pop bx
|
||||
pop es
|
||||
ret
|
||||
|
||||
bpb: times bpb_len db 0
|
||||
|
Loading…
Reference in New Issue
Block a user