Subversion Repositories SvarDOS

Rev

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

Rev 463 Rev 465
Line 67... Line 67...
67
; exec an application preset (by SvarCOM) in the ExecParamRec
67
; exec an application preset (by SvarCOM) in the ExecParamRec
68
mov ax, 0x4B00         ; DOS 2+ - load & execute program
68
mov ax, 0x4B00         ; DOS 2+ - load & execute program
69
mov dx, EXECPROG       ; DS:DX  - ASCIZ program name (preset at PSP[already)
69
mov dx, EXECPROG       ; DS:DX  - ASCIZ program name (preset at PSP[already)
70
mov bx, EXEC_PARAM_REC ; ES:BX  - parameter block pointer
70
mov bx, EXEC_PARAM_REC ; ES:BX  - parameter block pointer
71
int 0x21
71
int 0x21
72
mov [EXECPROG], byte 0 ; make sure to spawn command.com after app exits
72
mov [cs:EXECPROG], byte 0 ; do not run app again (+DS might have been changed)
73
 
73
 
74
jmp short skipsig      ; enforce valid ds/ss/etc (can be lost after int 21,4b)
74
jmp short skipsig      ; enforce valid ds/ss/etc (can be lost after int 21,4b)
75
 
75
 
76
EXEC_COMMAND_COM:
76
EXEC_COMMAND_COM:
77
 
77
 
Line 100... Line 100...
100
USEDEFAULTCOMSPEC:
100
USEDEFAULTCOMSPEC:
101
 
101
 
102
; prepare the exec param block
102
; prepare the exec param block
103
mov ax, [PSP_ENVSEG]
103
mov ax, [PSP_ENVSEG]
104
mov [EXEC_PARAM_REC], ax
104
mov [EXEC_PARAM_REC], ax
105
mov ax, CMDTAIL
-
 
106
mov [EXEC_PARAM_REC+2], ax
105
mov [EXEC_PARAM_REC+2], word CMDTAIL
107
mov [EXEC_PARAM_REC+4], cs
106
mov [EXEC_PARAM_REC+4], cs
108
 
107
 
109
; execute command.com
108
; execute command.com
110
mov ax, 0x4B00         ; DOS 2+ - load & execute program
109
mov ax, 0x4B00         ; DOS 2+ - load & execute program
111
push es                ;
110
push es                ;
Line 138... Line 137...
138
 
137
 
139
; back to program start
138
; back to program start
140
jmp skipsig
139
jmp skipsig
141
 
140
 
142
; command.com tail arguments, in PSP format: length byte followed by args and
141
; command.com tail arguments, in PSP format: length byte followed by args and
143
; terminated with \r)
142
; terminated with \r) - a single 0x0A byte is passed so SvarCOM knows it is
-
 
143
; called as respawn (as opposed to being invoked as a normal application)
-
 
144
; this allows multiple copies of SvarCOM to stack upon each other.
144
CMDTAIL db 0x00, 0x0D
145
CMDTAIL db 0x01, 0x0A, 0x0D
145
 
146
 
146
ERRLOAD db "ERR x, FAILED TO LOAD COMMAND.COM", 13, 10, '$'
147
ERRLOAD db "ERR x, FAILED TO LOAD COMMAND.COM", 13, 10, '$'
147
 
148
 
148
; DOS int 21h functions that I use require at least 32 bytes of stack, here I
149
; DOS int 21h functions that I use require at least 32 bytes of stack, here I
149
; allocate 64 bytes to be sure
150
; allocate 64 bytes to be sure