beautypg.com

National Instruments PC-DIO-96 User Manual

Page 65

background image

Chapter 4

Register-Level Programming

© National Instruments Corporation

4-27

PC-DIO-96 User Manual

mov cx,int_mask ; Get the old mask value
in al,maskm ; Get current master mask
jmp $+2 ; Delay--wait for data transfer
or al,cl ; OR in old mask value
out maskm,al ; Send out new setting
jmp $+2 ; Delay--wait for data transfer
in al,masks ; Get current slave mask
jmp $+2 ; Delay--wait for data transfer
or al,ch ; OR in old mask value
out masks,al ; Send out new setting
jmp $+2 ; Delay--wait for data transfer
mov al,vect_num ; al holds interrupt level
mov ah,25h
lds dx,int_addr ; ds:dx points to new handler
int 21h ; Install the old vector

; restore saved registers

ri_exit:
pop es
pop ds
pop dx
pop cx
pop bx
pop ax
sti
ret
_remove_isr endp

; isr_handler
;

_isr_handler proc far
cli
push ax
push ds

; service interrupt

; Your code here...
; if this was not your interrupt, jump to 'ih_0'
; if this was your interrupt, service it as appropriate;
; the pointer for the data structure 'isr_block' is stored
; at _DATA:isrb_addr; to access the structure, use the
; following steps:
;
; mov ax,seg _DATA
; mov ds,ax
; lds si,isrb_addr
;
; you need not use ds:si, but be sure to save any
; registers you use...