Subversion Repositories SvarDOS

Rev

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

Rev 465 Rev 490
Line 17... Line 17...
17
 
17
 
18
                 ; offset
18
                 ; offset
19
SIG1 dw 0x1983   ;  +0
19
SIG1 dw 0x1983   ;  +0
20
SIG2 dw 0x1985   ;  +2
20
SIG2 dw 0x1985   ;  +2
21
SIG3 dw 0x2017   ;  +4
21
SIG3 dw 0x2017   ;  +4
22
SIG4 dw 0x2019   ;  +6
22
SIG4 dw 0x2019   ;  +6  this acts also as a guardval to detect stack overflows
23
 
23
 
-
 
24
; DOS int 21h functions that I use require at least 40 bytes of stack under
-
 
25
; DOS-C (FreeDOS) kernel, so here I reserve 64 bytes juste to be sure
-
 
26
STACKBUF db "XXX  SVARCOM RMOD BY MATEUSZ VISTE  XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
24
FFU_UNUSED dw 0  ;  +8
27
STACKPTR dw 0
25
 
28
 
26
; exit code of last application
29
; exit code of last application
27
LEXCODE  dw 0    ; +0Ah
30
LEXCODE  dw 0    ; +4Ah
28
 
31
 
29
; offset of the COMSPEC variable in the environment block, 0 means "use
32
; offset of the COMSPEC variable in the environment block, 0 means "use
30
; boot drive". this value is patched by the transient part of COMMAND.COM
33
; boot drive". this value is patched by the transient part of COMMAND.COM
31
COMSPECPTR dw 0  ; +0Ch
34
COMSPECPTR dw 0  ; +4Ch
32
 
35
 
33
; fallback COMSPEC string used if no COMPSEC is present in the environment
36
; fallback COMSPEC string used if no COMPSEC is present in the environment
34
; drive. drive is patched by the transient part of COMMAND.COM
37
; drive. drive is patched by the transient part of COMMAND.COM
35
COMSPECBOOT db "@:\COMMAND.COM", 0 ; +0Eh
38
COMSPECBOOT db "@:\COMMAND.COM", 0 ; +4Eh
36
 
39
 
37
; ExecParamRec used by INT 21h, AX=4b00 (load and execute program), 14 bytes:
40
; ExecParamRec used by INT 21h, AX=4b00 (load and execute program), 14 bytes:
38
;  offset  size  content
41
;  offset  size  content
39
;     +0     2   segment of environment for child (0 = current)
42
;     +0     2   segment of environment for child (0 = current)
40
;     +2     4   address of command line to place at PSP:0080
43
;     +2     4   address of command line to place at PSP:0080
41
;     +6     4   address of an FCB to be placed at PSP:005c
44
;     +6     4   address of an FCB to be placed at PSP:005c
42
;    +0Ah    4   address of an FCB to be placed at PSP:006c
45
;    +0Ah    4   address of an FCB to be placed at PSP:006c
43
EXEC_PARAM_REC db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0   ; +1Dh
46
EXEC_PARAM_REC db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0   ; +5Dh
44
 
47
 
45
; Program to execute, preset by SvarCOM (128 bytes, ASCIIZ)  ; +2Bh
48
; Program to execute, preset by SvarCOM (128 bytes, ASCIIZ)  ; +6Bh
46
EXECPROG dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
49
EXECPROG dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
47
 
50
 
48
skipsig:         ; +ABh
51
skipsig:         ; +EBh
49
 
52
 
50
; set up CS=DS=SS and point SP to my private stack buffer
53
; set up CS=DS=SS and point SP to my private stack buffer
51
mov ax, cs
54
mov ax, cs
52
mov ds, ax
55
mov ds, ax
53
mov es, ax
56
mov es, ax
Line 143... Line 146...
143
; called as respawn (as opposed to being invoked as a normal application)
146
; called as respawn (as opposed to being invoked as a normal application)
144
; this allows multiple copies of SvarCOM to stack upon each other.
147
; this allows multiple copies of SvarCOM to stack upon each other.
145
CMDTAIL db 0x01, 0x0A, 0x0D
148
CMDTAIL db 0x01, 0x0A, 0x0D
146
 
149
 
147
ERRLOAD db "ERR x, FAILED TO LOAD COMMAND.COM", 13, 10, '$'
150
ERRLOAD db "ERR x, FAILED TO LOAD COMMAND.COM", 13, 10, '$'
148
 
-
 
149
; DOS int 21h functions that I use require at least 32 bytes of stack, here I
-
 
150
; allocate 64 bytes to be sure
-
 
151
STACKBUF db "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
-
 
152
STACKPTR db "xx"
-