Title game1a: set interrupt vector
public setup_int
.model small
.code

setup_int proc
;saves old vector and sets up new vector
;input: AL = interrupt number
;        DI = address of buffer for old vector
;        SI = address of buffer cotaining new vector

;save old interrupt vector
        mov ah,35h              ;function 35h, get vector
        int 21h                 ;ES:BX = vector
        mov [di],bx             ;save offset
        mov [di+2],es           ;save segment

;setup new vector
        mov dx,[si]             ;DX has offset
        push ds                 ;save DS
        mov ds,[si+2]           ;DS has segment number
        mov ah,25h              ;function 25h, set vector
        int 21h                 ;
        pop ds                  ;restore DS
	ret

setup_int endp

end
