IBM AT 5170 Technical Reference page 37

Table of Contents

Advertisement

Unlinking Code Example
PUSH
DS
PUSH
ES
CLI
Disable interrupts
HOV
AX,350FH
DOS get interrupt vector
INT
Z1H
ES:BX points to first of chain
HOV
CX,ES
Pickup segment part of interrupt vector
""
Are we the first handler in the chain?
HOV
AX,eS
Get code seq into comparable register
CHP
BX,OFFSET ENTRY
Interrupt vector in low memory
pointing to your handler's offset?
JNE
UNCHAIN_A
No, branch
CHP
AX,ex
vector pointing to your
handler's segment?
JNE
UNCHAIN_A
No, branch
Set interrupt vector in low memory to point to the handler
pointed to
by
your pointer
PUSH
DS
MOV
DX,WORD PTR CS:FPTR
HOV
DS,WORD PTR CS FPTRIZI
MOV
AX,2S0PH
; DOS set interrupt vector
INT
Z1H
POP
DS
JMP
UNCHAIN_X
UNCHAIN_A:
ex
=
FPTR offset, ES
FPTR segment, ex
=
es
CHP
ES:IBX+61,QBQZH
Is handler using the appropriate
conventions (is SIGNATURE present in
the interrupt chaining structure)?
JNE
exception
No, invoke error exception handler
LDS
SI,ES:[BX+2]
Get FPTR's segment and offset
CHP
SI,OFFSET ENTRY
Is this forward pointer pointing to
your handler's offset?
JNE
UNCHAIN_B
No, branch
HOV
eX,DS
Move to compare
CHP
AX,CX
Is this forward pointer pointing to
your handler's segment?
JNE
No, branch
Located your handler in the chain
MOV
AX,WORD PTR CS:FPTR
Get your FPTR's offset
HOV
ES: I BX+ZI ,AX
Replace offset of FPTR of handler
that points to you
MOV
AX,WORD PTR eS:FPTRI2]
; Get your FPTR's segment
MOV
ES:[BX+4I,AX
Replace segment of FPTR of handler
that points to you
HOV
AL,eS:FLAGS
Get your flags
AND
AL,FIRST
Isolate FIRST flag
OR
ES: IBX
+ 61,AL
Set your first flag into prior routine
UNCHAIN_B: MOV
BX,SI
Move new offset to BX
PUSH
OS
PUSH
ES
JHP
UNCHAIN_A
Examine next handler in chain
UNCHAIN_X: STI
Enable interrupts
POP
ES
POP
DS
System Board
1-21

Advertisement

Table of Contents
loading

Table of Contents