]> wirehaze git hosting - MS-DOS.git/blob - v2.0/source/RECMES.ASM

wirehaze git hosting

Fixed minor spelling error in README.txt
[MS-DOS.git] / v2.0 / source / RECMES.ASM
1 TITLE RECOVER Messages
2 FALSE EQU 0
3 TRUE EQU NOT FALSE
4
5
6 bdos equ 21h
7 boot equ 20h
8 aread equ 25h
9 awrite equ 26h
10
11
12 .xlist
13 .xcref
14 INCLUDE DOSSYM.ASM
15 ;The DOST: prefix is a DEC TOPS/20 directory prefix. Remove it for
16 ; assembly in MS-DOS assembly environments using MASM. The DOSSYM.ASM
17 ; file must exist though, it is included with OEM distribution.
18 .cref
19 .list
20
21 code segment public
22 code ends
23
24 const segment public byte
25 const ends
26
27 data segment public byte
28 EXTRN filsiz:WORD
29 data ends
30
31
32 dg group code,const,data
33
34 cr equ 0dh
35 lf equ 0ah
36
37 code segment public byte
38 assume cs:dg,ds:dg,es:dg,ss:dg
39
40 EXTRN PCRLF:NEAR,PRINT:NEAR,INT_23:NEAR,CONVERT:NEAR
41 PUBLIC dskwrt,dskrd,DSKERR,report
42
43 hecode db 0
44
45 dskwrt: push ax
46 push bx
47 push cx
48 push dx
49 int awrite
50 mov [hecode],al
51 inc sp
52 inc sp ;clean up stack
53 pop dx
54 pop cx
55 pop bx
56 pop ax
57 jnc pret
58 mov si,offset dg: writing
59 call dskerr
60 jz dskwrt
61 clc
62 pret: ret
63
64 dskrd: push ax
65 push bx
66 push cx
67 push dx
68 int aread
69 mov [hecode],al
70 inc sp
71 inc sp ;clean up stack
72 pop dx
73 pop cx
74 pop bx
75 pop ax
76 jnc pret
77 mov si,offset dg: reading
78 call dskerr
79 jz dskrd
80 clc
81 ret
82
83 DSKERR:
84 PUSH AX
85 PUSH BX
86 PUSH CX
87 PUSH DX
88 PUSH DI
89 PUSH ES
90 CALL PCRLF
91 MOV AL,[HECODE]
92 CMP AL,12
93 JBE HAVCOD
94 MOV AL,12
95 HAVCOD:
96 XOR AH,AH
97 MOV DI,AX
98 SHL DI,1
99 MOV DX,WORD PTR [DI+MESBAS] ; Get pointer to error message
100 CALL PRINT ; Print error type
101 MOV DX,OFFSET DG:ERRMES
102 CALL PRINT
103 MOV DX,SI
104 CALL PRINT
105 MOV DX,OFFSET DG:DRVMES
106 CALL PRINT
107 ASK:
108 MOV DX,OFFSET DG:REQUEST
109 CALL PRINT
110 MOV AX,(STD_CON_INPUT_FLUSH SHL 8)+STD_CON_INPUT
111 INT 21H ; Get response
112 PUSH AX
113 CALL PCRLF
114 POP AX
115 OR AL,20H ; Convert to lower case
116 CMP AL,"i" ; Ignore?
117 JZ EEXITNZ
118 CMP AL,"r" ; Retry?
119 JZ EEXIT
120 CMP AL,"a" ; Abort?
121 JNZ ASK
122 JMP INT_23
123
124 EEXITNZ:
125 OR AL,AL ; Resets zero flag
126 EEXIT:
127 POP ES
128 POP DI
129 POP DX
130 POP CX
131 POP BX
132 POP AX
133 RET
134
135 ;******************************************
136 ; Prints the XXX of YYY bytes recovered message.
137 ; The XXX value is a dword at di+16 on entry.
138 ; The YYY value is a dword (declared as a word) at filsiz.
139 ; Note:
140 ; If it is desired to print a message before the first number,
141 ; point at the message with DX and call PRINT.
142
143 report:
144 mov si,[di+16] ;Get the XXX value
145 mov di,[di+18]
146 mov bx,offset dg: ofmsg
147 call convert ;Print "XXX of " (DI:SI followed by message
148 ; pointed to by BX)
149 mov si,filsiz ;Get the YYY value
150 mov di,filsiz+2
151 mov bx,offset dg: endmsg
152 call convert ;Print "YYY bytes recovered CR LF"
153 ret
154
155 code ends
156
157 const segment public byte
158
159 PUBLIC BADVER,askmsg,drvlet,DRVLET1,dirmsg,recmsg_pre
160 PUBLIC crlf,drverr,baddrv,opnerr,recmsg_post
161
162 MESBAS DW OFFSET DG:ERR0
163 DW OFFSET DG:ERR1
164 DW OFFSET DG:ERR2
165 DW OFFSET DG:ERR3
166 DW OFFSET DG:ERR4
167 DW OFFSET DG:ERR5
168 DW OFFSET DG:ERR6
169 DW OFFSET DG:ERR7
170 DW OFFSET DG:ERR8
171 DW OFFSET DG:ERR9
172 DW OFFSET DG:ERR10
173 DW OFFSET DG:ERR11
174 DW OFFSET DG:ERR12
175
176 READING DB "read$"
177 WRITING DB "writ$"
178 ERRMES DB " error $"
179 DRVMES DB "ing drive "
180 DRVLET1 DB "A",13,10,"$"
181 REQUEST DB "Abort, Retry, Ignore? $"
182
183 ERR0 DB "Write protect$"
184 ERR1 DB "Bad unit$"
185 ERR2 DB "Not ready$"
186 ERR3 DB "Bad command$"
187 ERR4 DB "Data$"
188 ERR5 DB "Bad call format$"
189 ERR6 DB "Seek$"
190 ERR7 DB "Non-DOS disk$"
191 ERR8 DB "Sector not found$"
192 ERR9 DB "No paper$"
193 ERR10 DB "Write fault$"
194 ERR11 DB "Read fault$"
195 ERR12 DB "Disk$"
196
197 ;-----------------------------------------------------------------------;
198
199 BADVER DB "Incorrect DOS version"
200 crlf db cr,lf,'$'
201 askmsg db cr,lf,'Press any key to begin recovery of the'
202 db cr,lf,'file(s) on drive '
203 drvlet db 'A: ',cr,lf,cr,lf,'$'
204 dirmsg db cr,lf,'Warning - directory full',cr,lf,'$'
205
206 ;"recmsg_pre<number of files recovered>recmsg_post"
207 recmsg_post db ' file(s) recovered',cr,lf
208 recmsg_pre db '$'
209
210 ofmsg db ' of $'
211 endmsg db ' bytes recovered',13,10,"$"
212
213 drverr db 'Invalid number of parameters$'
214 baddrv db 'Invalid drive or file name$'
215 opnerr db 'File not found$'
216
217
218 const ends
219 end
220