Make getint and setint reuse cs segment

This commit is contained in:
Nero 2020-04-18 23:44:16 +02:00
parent 4a92c4bc1e
commit c1c012c5fc
1 changed files with 13 additions and 26 deletions

View File

@ -94,44 +94,31 @@ sftab: dw sferr, sferr, sferr, sferr
dw sferr, sferr, sferr, sferr 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 ; DOS 2+ - GET INTERRUPT VECTOR
; IN al interrupt number ; IN al interrupt number
; OUT es:bx current interrupt handler ; OUT es:bx current interrupt handler
getint: push ds getint: xor bx, bx
; DS=0
xor bx, bx
mov ds, bx
; BX=AL*4 ; BX=AL*4
call times4 mov bl, al
les bx, [bx] add bl, bl
pop ds add bl, bl
; load vector into ES:BX
les bx, [cs:bx]
ret ret
; DOS 25h: Set interrupt vector ; DOS 25h: Set interrupt vector
; IN al interrupt number ; IN al interrupt number
; ds:dx entry point ; ds:dx entry point
setint: push es setint: push bx
push bx
; ES=0
xor bx, bx xor bx, bx
mov es, bx
; BX=AL*4 ; BX=AL*4
call times4 mov bl, al
mov [es:bx], dx add bl, bl
mov ax, ds add bl, bl
mov [es:bx+2], ds ; save DS:DX into vector
mov [cs:bx], dx
mov [cs:bx+2], ds
pop bx pop bx
pop es
ret ret
bpb: times bpb_len db 0 bpb: times bpb_len db 0