Subversion Repositories SvarDOS

Rev

Rev 1849 | Rev 1853 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1849 Rev 1851
Line 215... Line 215...
215
int 0x21
215
int 0x21
216
 
216
 
217
; if all went well, jump back to start
217
; if all went well, jump back to start
218
jnc skipsig
218
jnc skipsig
219
 
219
 
-
 
220
; save error code into cl
-
 
221
mov cl, al
-
 
222
 
-
 
223
; display program name (in DS:DX), but first replace its nul terminator by a $
-
 
224
mov si, dx
-
 
225
PARSENEXTBYTE:
-
 
226
lodsb ; load byte at DS:SI into AL and inc SI (direction flag is clear already)
-
 
227
test al, al  ; is zero yet?
-
 
228
jnz PARSENEXTBYTE
-
 
229
mov [si], byte '$'   ; replace the nul terminator by a $ and display it
-
 
230
mov ah, 0x09
-
 
231
int 0x21
-
 
232
mov [si], byte 0     ; revert the nul terminator back to its place
-
 
233
 
220
; restore DS=CS
234
; restore DS=CS
221
mov bx, cs
235
mov bx, cs
222
mov ds, bx
236
mov ds, bx
223
 
237
 
224
; update error string so it contains the error number
238
; update error string so it contains the error number
225
add al, '0'
239
mov al, '0'
-
 
240
add al, cl    ; the exec error code
226
mov [ERRLOAD + 4], al
241
mov [ERRLOAD + 6], al
227
 
242
 
228
; display error message
243
; display error message
229
mov ah, 0x09
244
mov ah, 0x09
230
mov dx, ERRLOAD
245
mov dx, ERRLOAD
231
int 0x21
246
int 0x21
Line 241... Line 256...
241
; terminated with \r) - a single 0x0A byte is passed so SvarCOM knows it is
256
; terminated with \r) - a single 0x0A byte is passed so SvarCOM knows it is
242
; called as respawn (as opposed to being invoked as a normal application)
257
; called as respawn (as opposed to being invoked as a normal application)
243
; this allows multiple copies of SvarCOM to stack upon each other.
258
; this allows multiple copies of SvarCOM to stack upon each other.
244
CMDTAIL db 0x01, 0x0A, 0x0D
259
CMDTAIL db 0x01, 0x0A, 0x0D
245
 
260
 
246
ERRLOAD db "ERR x, FAILED TO LOAD COMMAND.COM", 13, 10, '$'
261
ERRLOAD db ": ERR x, LOAD FAILED", 0x0A, 0x0D, '$'
247
 
262
 
248
; variables used to revert stdin/stdout to their initial state
263
; variables used to revert stdin/stdout to their initial state
249
OLD_STDOUT dw 0xffff
264
OLD_STDOUT dw 0xffff
250
OLD_STDIN  dw 0xffff
265
OLD_STDIN  dw 0xffff
251
 
266