User manual
Appendix D Register-Level Programming
PC-DIO-96/PnP User Manual D-30
©
National Instruments Corporation
_TEXT segment word public 'CODE'
assume cs:_TEXT, ss:_TEXT, ds:_DATA
; install_isr
;
; bp reg at [bp+0]
; ret addr ofs at [bp+2]
; ret addr seg at [bp+4]
; level at [bp+6]
; isr_block ofs at [bp+8]
; isr_block seg at [bp+10]
;
_install_isr proc far
cli
push bp
mov bp,sp
push ax
push bx
push cx
push dx
push ds
push es
mov ax,seg _DATA
mov ds,ax
; save the pointer for the isr_block structure--used in isr_handler
mov ax,[bp+8] ; Get ofs into ax
mov word ptr isrb_addr[0],ax ; Save address in variable
mov ax,[bp+10] ; Get seg into ax
mov word ptr isrb_addr[2],ax ; Save address in variable
; set interrupt vector--save the current vector before writing out new one
mov ax,[bp+6] ; Get interrupt level
cmp al,7 ; Check to see if it belongs to master
ja short slave ; or slave interrupt chip
add al,008h ; Offset for master vector list
jmp short setvec ; Go set the vector