Interrupt Service Procedures
K
A
DAK
67
The two device ISP roots are illustrated below. Each of the ISP roots calls the InterruptHandler deviceih passing it a pointer to a unique, public, device dependent datastructure (dcbA or dcbB). Note that most common C compilers add leading underscoresto function and variable names declared in C.Your application must install the pointers to ISP roots DVCROOT1 and DVCROOT2 into theprocessor Interrupt Vector Table prior to enabling interrupt generation by thecorresponding devices.
EXTRN AAINT:FAR ;AMX interrupt entry
EXTRN AAINX:FAR ;AMX interrupt exit
;EXTERN _dcbA:DWORD ;Device control block A
EXTERN _dcbB:DWORD ;Device control block B
EXTERN _deviceih:FAR ;Shared Interrupt Handler
;
;
DVC_CODE SEGMENT BYTE 'CODE'
;ASSUME CS:DVC_CODE,DS:NOTHING
;PUBLIC DVCROOT1 ;ISP root for device #1
PUBLIC DVCROOT2 ;ISP root for device #2
;
DVCWB1: DD _dcbA ;A(device control block A)
DVCWB2: DD _dcbB ;A(device control block B)
;
DVCROOT1 PROC FAR ;device ISP root #1
CALL AAINT ;let AMX know
LDS SI,CS:DVCWB1 ;DS:SI = A(work block #1)
JMP SHORT DVCCMN
;
DVCROOT2 LABEL FAR ;device ISP root #1
CALL AAINT ;let AMX know
LDS SI,CS:DVCWB2 ;DS:SI = A(work block #2)
DVCCMN: PUSH DS
PUSH SI
CALL _deviceih ;common Interrupt Handler
ADD SP,4 ;remove parameter
CALL AAINX ;let AMX know
IRET
;
DVC_CODE ENDS ;end of code segment