diff options
Diffstat (limited to 'v4.0/src/CMD/DEBUG/DEBERR.ASM')
| -rw-r--r-- | v4.0/src/CMD/DEBUG/DEBERR.ASM | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/v4.0/src/CMD/DEBUG/DEBERR.ASM b/v4.0/src/CMD/DEBUG/DEBERR.ASM new file mode 100644 index 0000000..3c59cf0 --- /dev/null +++ b/v4.0/src/CMD/DEBUG/DEBERR.ASM | |||
| @@ -0,0 +1,183 @@ | |||
| 1 | PAGE 80,132 ; | ||
| 2 | TITLE DEBERR.ASM - DEBUGGER DISK ERROR HANDLER | ||
| 3 | |||
| 4 | ;******************* START OF SPECIFICATIONS ***************************** | ||
| 5 | ; | ||
| 6 | ; MODULE NAME:DEBERR.SAL | ||
| 7 | ; | ||
| 8 | ; DESCRIPTIVE NAME: DISK ERROR HANDLER | ||
| 9 | ; | ||
| 10 | ; FUNCTION: THIS ROUTINE IS A CATCHALL ERROR HANDLER. IT PRIMARILY | ||
| 11 | ; HANDLES DISK ERROR. | ||
| 12 | ; | ||
| 13 | ; ENTRY POINT: ANY CALLED ROUTINE | ||
| 14 | ; | ||
| 15 | ; INPUT: NA | ||
| 16 | ; | ||
| 17 | ; EXIT-NORMAL: NA | ||
| 18 | ; | ||
| 19 | ; EXIT-ERROR: NA | ||
| 20 | ; | ||
| 21 | ; INTERNAL REFERENCES: | ||
| 22 | ; | ||
| 23 | ; | ||
| 24 | ; EXTERNAL REFERENCES: | ||
| 25 | ; | ||
| 26 | ; NOTES: THIS MODULE SHOULD BE PROCESSED WITH THE SALUT PRE-PROCESSOR | ||
| 27 | ; WITH OPTIONS "PR". | ||
| 28 | ; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+DEBCONST+ | ||
| 29 | ; DEBDATA+DEBMES | ||
| 30 | ; | ||
| 31 | ; REVISION HISTORY: | ||
| 32 | ; | ||
| 33 | ; AN000 VERSION DOS 4.0 - MESSAGE RETRIEVER IMPLEMENTED. DMS:6/17/87 | ||
| 34 | ; | ||
| 35 | ; | ||
| 36 | ; COPYRIGHT: "MS DOS DEBUG Utility" | ||
| 37 | ; "Version 4.00 (C) Copyright 1988 Microsoft" | ||
| 38 | ; "Licensed Material - Property of Microsoft " | ||
| 39 | ; | ||
| 40 | ;******************** END OF SPECIFICATIONS ****************************** | ||
| 41 | |||
| 42 | |||
| 43 | IF1 | ||
| 44 | %OUT COMPONENT=DEBUG, MODULE=DEBERR | ||
| 45 | ENDIF | ||
| 46 | .XLIST | ||
| 47 | .XCREF | ||
| 48 | INCLUDE DOSSYM.INC | ||
| 49 | .CREF | ||
| 50 | .LIST | ||
| 51 | |||
| 52 | INCLUDE DEBEQU.ASM | ||
| 53 | |||
| 54 | FIRSTDRV EQU "A" | ||
| 55 | |||
| 56 | CODE SEGMENT PUBLIC BYTE | ||
| 57 | CODE ENDS | ||
| 58 | |||
| 59 | CONST SEGMENT PUBLIC BYTE | ||
| 60 | EXTRN RDFLG:BYTE | ||
| 61 | EXTRN DRVLET:BYTE | ||
| 62 | EXTRN dr1_ptr:word,dr2_ptr:word,dr3_ptr:word,dr4_ptr:word ;ac000 | ||
| 63 | CONST ENDS | ||
| 64 | |||
| 65 | CSTACK SEGMENT STACK | ||
| 66 | CSTACK ENDS | ||
| 67 | |||
| 68 | DATA SEGMENT PUBLIC BYTE | ||
| 69 | EXTRN PARITYFLAG:BYTE | ||
| 70 | DATA ENDS | ||
| 71 | |||
| 72 | DG GROUP CODE,CONST,CSTACK,DATA | ||
| 73 | |||
| 74 | CODE SEGMENT PUBLIC BYTE | ||
| 75 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 76 | |||
| 77 | EXTRN RESTART:NEAR | ||
| 78 | PUBLIC DRVERR, TRAPPARITY, RELEASEPARITY, NMIINT, NMIINTEND | ||
| 79 | |||
| 80 | TRAPPARITY: | ||
| 81 | IF IBMJAPAN | ||
| 82 | PUSH BX | ||
| 83 | PUSH ES | ||
| 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 | ||
| 87 | ASSUME ES:NOTHING | ||
| 88 | |||
| 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 | ||
| 93 | ASSUME ES:DG | ||
| 94 | |||
| 95 | POP BX | ||
| 96 | MOV BYTE PTR [PARITYFLAG],0 ; no interrupts detected yet! | ||
| 97 | RET | ||
| 98 | |||
| 99 | SWAPINT: | ||
| 100 | PUSH AX | ||
| 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 | ||
| 105 | POP AX | ||
| 106 | ENDIF | ||
| 107 | RET | ||
| 108 | |||
| 109 | RELEASEPARITY: | ||
| 110 | IF IBMJAPAN | ||
| 111 | PUSH DX | ||
| 112 | PUSH DS | ||
| 113 | PUSH BX | ||
| 114 | PUSH ES | ||
| 115 | LDS DX,DWORD PTR [NMIPtr] ; get old vector | ||
| 116 | CALL SwapInt ; diddle back to original | ||
| 117 | POP ES | ||
| 118 | POP BX | ||
| 119 | POP DS | ||
| 120 | POP DX | ||
| 121 | MOV [PARITYFLAG],0 ; no interrupts possible! | ||
| 122 | ENDIF | ||
| 123 | RET | ||
| 124 | |||
| 125 | NMIInt: | ||
| 126 | IF IBMJAPAN | ||
| 127 | PUSH AX ; save AX | ||
| 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 | ||
| 134 | IRET | ||
| 135 | NMICHAIN: | ||
| 136 | JMP DWORD PTR CS:[NMIPTR] ; chain the vectors | ||
| 137 | NMIPTR DD ? ; where old NMI gets stashed | ||
| 138 | ENDIF | ||
| 139 | NMIINTEND: | ||
| 140 | |||
| 141 | DRVERR: | ||
| 142 | |||
| 143 | or al,al ;ac000;see if drive specified | ||
| 144 | ; $if nz ;an000;drive specified | ||
| 145 | JZ $$IF1 | ||
| 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 | ||
| 149 | JNZ $$IF2 | ||
| 150 | mov dx,offset dg:dr2_ptr ;an000;message | ||
| 151 | ; $else ;an000;it is read | ||
| 152 | JMP SHORT $$EN2 | ||
| 153 | $$IF2: | ||
| 154 | mov dx,offset dg:dr1_ptr ;an000;message | ||
| 155 | ; $endif ;an000; | ||
| 156 | $$EN2: | ||
| 157 | ; $else ;an000;write protect error | ||
| 158 | JMP SHORT $$EN1 | ||
| 159 | $$IF1: | ||
| 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 | ||
| 163 | JNZ $$IF6 | ||
| 164 | mov dx,offset dg:dr4_ptr ;an000;message | ||
| 165 | ; $else ;an000;it is read | ||
| 166 | JMP SHORT $$EN6 | ||
| 167 | $$IF6: | ||
| 168 | mov dx,offset dg:dr3_ptr ;an000;message | ||
| 169 | ; $endif ;an000; | ||
| 170 | $$EN6: | ||
| 171 | ; $endif ;an000; | ||
| 172 | $$EN1: | ||
| 173 | |||
| 174 | ; CLEAN OUT THE DISK... | ||
| 175 | MOV AH,DISK_RESET | ||
| 176 | INT 21H | ||
| 177 | |||
| 178 | JMP RESTART | ||
| 179 | CODEEND: | ||
| 180 | |||
| 181 | CODE ENDS | ||
| 182 | END | ||
| 183 | \ No newline at end of file | ||