2 TITLE DEBERR
.ASM
- DEBUGGER DISK ERROR HANDLER
4 ;******************* START OF SPECIFICATIONS *****************************
6 ; MODULE NAME:DEBERR.SAL
8 ; DESCRIPTIVE NAME: DISK ERROR HANDLER
10 ; FUNCTION: THIS ROUTINE IS A CATCHALL ERROR HANDLER. IT PRIMARILY
13 ; ENTRY POINT: ANY CALLED ROUTINE
21 ; INTERNAL REFERENCES:
24 ; EXTERNAL REFERENCES:
26 ; NOTES: THIS MODULE SHOULD BE PROCESSED WITH THE SALUT PRE-PROCESSOR
28 ; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+DEBCONST+
33 ; AN000 VERSION DOS 4.0 - MESSAGE RETRIEVER IMPLEMENTED. DMS:6/17/87
36 ; COPYRIGHT: "MS DOS DEBUG Utility"
37 ; "Version 4.00 (C) Copyright 1988 Microsoft"
38 ; "Licensed Material - Property of Microsoft "
40 ;******************** END OF SPECIFICATIONS ******************************
44 %
OUT COMPONENT
=DEBUG
, MODULE
=DEBERR
56 CODE SEGMENT PUBLIC BYTE
59 CONST
SEGMENT PUBLIC BYTE
62 EXTRN dr1_ptr
:word,dr2_ptr
:word,dr3_ptr
:word,dr4_ptr
:word ;ac000
68 DATA SEGMENT PUBLIC BYTE
72 DG GROUP
CODE,CONST
,CSTACK
,DATA
74 CODE SEGMENT PUBLIC BYTE
75 ASSUME
CS:DG
,DS:DG
,ES:DG
,SS:DG
78 PUBLIC DRVERR
, TRAPPARITY
, RELEASEPARITY
, NMIINT
, NMIINTEND
84 PUSH DX ; save location of new offset
85 MOV DX,OFFSET DG
:NMIINT
; DS:DX has new interrupt vector
86 CALL SWAPINT
; diddle interrupts
89 MOV WORD PTR [NMIPTR
],BX ; save old offset
90 MOV WORD PTR [NMIPTR
+2],ES ; save old segment
91 POP DX ; get old regs back
92 POP ES ; restore old values
96 MOV BYTE PTR [PARITYFLAG
],0 ; no interrupts detected yet!
101 MOV AX,(GET_INTERRUPT_VECTOR
SHL 8) + 2
102 INT 21H
; Get old NMI Vector
103 MOV AX,(SET_INTERRUPT_VECTOR
SHL 8) + 2
104 INT 21h
; let OS set new vector
115 LDS DX,DWORD PTR [NMIPtr
] ; get old vector
116 CALL SwapInt
; diddle back to original
121 MOV [PARITYFLAG
],0 ; no interrupts possible!
128 IN AL,0A0H ; get status register
129 OR AL,1 ; was there parity check?
130 POP AX ; get old AX back
131 JZ NMICHAIN
; no, go chain interrupt
132 OUT 0A2H,AL ; reset NMI detector
133 MOV CS:[PARITYFLAG
],1 ; signal detection
136 JMP DWORD PTR CS:[NMIPTR
] ; chain the vectors
137 NMIPTR
DD ?
; where old NMI gets stashed
143 or al,al ;ac000;see if drive specified
144 ; $if nz ;an000;drive specified
146 add byte ptr drvlet
,firstdrv
;ac000;determine drive letter
147 cmp byte ptr rdflg
,write
;ac000;see if it is read/write
148 ; $if z ;an000;it is write
150 mov dx,offset dg
:dr2_ptr
;an000;message
151 ; $else ;an000;it is read
154 mov dx,offset dg
:dr1_ptr
;an000;message
157 ; $else ;an000;write protect error
160 add byte ptr drvlet
,firstdrv
;ac000;determine drive letter
161 cmp byte ptr rdflg
,write
;ac000;see if it is read/write
162 ; $if z ;an000;it is write
164 mov dx,offset dg
:dr4_ptr
;an000;message
165 ; $else ;an000;it is read
168 mov dx,offset dg
:dr3_ptr
;an000;message
174 ; CLEAN OUT THE DISK...