Subversion Repositories SvarDOS

Rev

Rev 1881 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1881 Rev 1986
Line 194... Line 194...
194
 
194
 
195
; preset the default COMSPEC pointer to ES:DX (ES is already set to DS)
195
; preset the default COMSPEC pointer to ES:DX (ES is already set to DS)
196
mov dx, COMSPECBOOT
196
mov dx, COMSPECBOOT
197
 
197
 
198
; do I have a valid COMSPEC?
198
; do I have a valid COMSPEC?
199
or [COMSPECPTR], word 0
199
test [COMSPECPTR], word 0xffff
200
jz USEDEFAULTCOMSPEC
200
jz USEDEFAULTCOMSPEC
201
; set ES:DX to actual COMSPEC (in env segment)
201
; set ES:DX to actual COMSPEC (in env segment)
202
mov es, [PSP_ENVSEG]
202
mov es, [PSP_ENVSEG]
203
mov dx, [COMSPECPTR]
203
mov dx, [COMSPECPTR]
204
USEDEFAULTCOMSPEC:
204
USEDEFAULTCOMSPEC:
Line 207... Line 207...
207
mov ax, [PSP_ENVSEG]
207
mov ax, [PSP_ENVSEG]
208
mov [EXEC_PARAM_REC], ax
208
mov [EXEC_PARAM_REC], ax
209
mov [EXEC_PARAM_REC+2], word CMDTAIL
209
mov [EXEC_PARAM_REC+2], word CMDTAIL
210
mov [EXEC_PARAM_REC+4], cs
210
mov [EXEC_PARAM_REC+4], cs
211
 
211
 
-
 
212
mov si, dx             ; preset si to command in case I will display it in the
-
 
213
                       ; err message (DX might be destroyed by int 21h,AH=4Bh)
-
 
214
 
212
; execute command.com
215
; execute command.com
213
mov ax, 0x4B00         ; DOS 2+ - load & execute program
216
mov ax, 0x4B00         ; DOS 2+ - load & execute program
214
push es                ;
217
push es                ;
215
pop ds                 ;
218
pop ds                 ;
216
;mov dx, COMSPEC       ; DS:DX  - ASCIZ program name (preset already)
219
;mov dx, COMSPEC       ; DS:DX  - ASCIZ program name (preset already)
Line 224... Line 227...
224
 
227
 
225
; save error code into cl
228
; save error code into cl
226
mov cl, al
229
mov cl, al
227
 
230
 
228
; display program name (in DS:DX), but first replace its nul terminator by a $
231
; display program name (in DS:DX), but first replace its nul terminator by a $
229
mov si, dx
232
;mov si, dx           ; done already before the exec attempt
230
PARSENEXTBYTE:
233
PARSENEXTBYTE:
231
lodsb ; load byte at DS:SI into AL and inc SI (direction flag is clear already)
234
lodsb ; load byte at DS:SI into AL and inc SI (direction flag is clear already)
232
test al, al  ; is zero yet?
235
test al, al  ; is zero yet?
233
jnz PARSENEXTBYTE
236
jnz PARSENEXTBYTE
234
mov [si], byte '$'   ; replace the nul terminator by a $ and display it
237
mov [si], byte '$'   ; replace the nul terminator by a $ and display it
Line 454... Line 457...
454
;          50H (set PSP address)
457
;          50H (set PSP address)
455
;          51H and 62H (query PSP address)
458
;          51H and 62H (query PSP address)
456
;          59H (get extended error information)
459
;          59H (get extended error information)
457
;
460
;
458
; =============================================================================
461
; =============================================================================
459
HANDLER_24H:    ; +46Ch
462
HANDLER_24H:    ; +46Dh
460
 
463
 
461
; save registers so I can restore them later. AX does not require saving.
464
; save registers so I can restore them later. AX does not require saving.
462
; Microsoft documentation says:
465
; Microsoft documentation says:
463
;  "When it is desired to ignore an error, the same registers must be preserved
466
;  "When it is desired to ignore an error, the same registers must be preserved
464
;   as when it is desired to retry the operation (SS,SP,DS,BX,CX,DX)."
467
;   as when it is desired to retry the operation (SS,SP,DS,BX,CX,DX)."