summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/COMMAND/UINIT.ASM
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/COMMAND/UINIT.ASM
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/CMD/COMMAND/UINIT.ASM')
-rw-r--r--v4.0/src/CMD/COMMAND/UINIT.ASM270
1 files changed, 270 insertions, 0 deletions
diff --git a/v4.0/src/CMD/COMMAND/UINIT.ASM b/v4.0/src/CMD/COMMAND/UINIT.ASM
new file mode 100644
index 0000000..8f3498b
--- /dev/null
+++ b/v4.0/src/CMD/COMMAND/UINIT.ASM
@@ -0,0 +1,270 @@
1 page 80,132
2; SCCSID = @(#)uinit.asm 4.5 85/12/04
3; SCCSID = @(#)uinit.asm 4.5 85/12/04
4TITLE COMMAND Initialization messages
5
6.XCREF
7.XLIST
8include comsw.asm
9include comseg.asm
10include ifequ.asm
11.LIST
12.CREF
13
14addr macro sym,name
15 public name
16 ifidn <name>,<>
17
18 dw offset resgroup:sym
19 else
20
21name dw offset resgroup:sym
22 endif
23 endm
24
25
26ENVIRONMENT SEGMENT PUBLIC PARA ;AC000;
27 EXTRN ECOMSPEC:BYTE
28ENVIRONMENT ENDS
29
30TRANCODE SEGMENT PUBLIC BYTE ;AC000;
31 extrn Printf_init:FAR
32 extrn Triage_Init:FAR
33 extrn append_parse:FAR ;AN054;
34TranCode ENDS
35
36INIT SEGMENT PUBLIC PARA ;AC000;
37
38
39 public icondev
40 public BADCSPFL
41 public COMSPECT
42 public AUTOBAT
43 public fslash
44 public bslash
45 public space
46 public PRDATTM
47 public INITADD
48 public print_add
49 public CHUCKENV
50 public scswitch
51 public ucasea
52 public ECOMLOC
53 public equalsign
54 public lcasea
55 public lcasez
56 public comspstring
57 public EnvSiz
58 public EnvMax
59 public initend
60 public trnsize
61 public resetenv ;AC000;
62 public ext_msg ;AC000;
63 public num_positionals
64 public internat_info
65 public parsemes_ptr
66
67 PUBLIC triage_add
68 PUBLIC oldenv
69 PUBLIC usedenv
70 PUBLIC KAUTOBAT ;AN000; 3/3/KK
71 public eswitch ;AN018;
72 public dswitch ;AN018;
73 public init_parse ;AN054;
74 public old_parse_ptr ;AN057;
75 PUBLIC pars_msg_off ;AN060;
76 PUBLIC pars_msg_seg ;AN060;
77
78include resmsg.equ ;AC000;
79
80
81ICONDEV LABEL BYTE
82 DB "/DEV/"
83 DB "CON",0,0,0,0,0,0 ; Room for 8 char device
84BADCSPFL DB 0
85COMSPECT DB "/COMMAND.COM",0,0
86AUTOBAT DB 0,":\AUTOEXEC.BAT",0,0DH ;AC027;
87KAUTOBAT DB 0,":\KAUTOEXE.BAT",0,0DH ;AC027; 3/3/KK
88
89PRDATTM DB -1 ;Init not to prompt for date time
90INITADD DD ?
91print_add LABEL DWORD
92 DW OFFSET TranGroup:Printf_INIT
93 DW 0
94triage_add LABEL DWORD
95 DW OFFSET TranGroup:Triage_Init
96 DW 0
97CHUCKENV DB 0
98;eg ECOMLOC DW OFFSET ENVIRONMENT:ECOMSPEC-10H
99ECOMLOC DW OFFSET ENVIRONMENT:ECOMSPEC ;eg
100
101COMSPSTRING DB "COMSPEC="
102equalsign db "="
103lcasea db "a"
104lcasez db "z"
105fslash db "/"
106bslash db "\"
107space db " "
108scswitch db "C" ; Single command
109ucasea db "A"
110
111EnvSiz DW 0 ; size user wants to allocate
112EnvMax DW 0 ; maximum size allowed.
113oldenv DW 0 ; envirseg at initialization
114usedenv DW 0 ; amount of envirseg used
115PARS_MSG_OFF DW 0 ;AN060; SAVED PARSE ERROR MESSAGE OFFSET
116PARS_MSG_SEG DW 0 ;AN060; SAVED PARSE ERROR MESSAGE SEGMENT
117
118;Do not separate the following two words. Used to call transient PARSE routine
119
120init_parse label dword ;AN054;
121init_p DW TRANGROUP:APPEND_PARSE ;AN054;
122initend DW 0 ;eg segment address of end of init
123
124;End of data that shouldn't be separated.
125
126trnsize DW 0 ;eg size of transient in paragraphs
127resetenv DB 0 ;eg set if we need to setblck env at endinit
128ext_msg DB 0 ;AN000; set if /MSG switch entered
129eswitch db 0 ;AN018; set if /e was entered
130dswitch db 0 ;AN018; set if /d was entered
131parsemes_ptr dw 0 ;AN000; word to store parse error number
132
133;
134; PARSE BLOCK FOR COMMAND
135;
136PUBLIC PARSE_COMMAND ;AN000;
137PUBLIC COMND1_OUTPUT ;AN000;
138PUBLIC COMND1_TYPE ;AN000;
139PUBLIC COMND1_CODE ;AN000;
140PUBLIC COMND1_SYN ;AN000;
141PUBLIC COMND1_ADDR ;AN000;
142PUBLIC COMMAND_F_SYN ;AN000;
143PUBLIC COMMAND_P_SYN ;AN000;
144PUBLIC COMMAND_C_SYN ;AN000;
145PUBLIC COMMAND_D_SYN ;AN000;
146PUBLIC COMMAND_E_SYN ;AN000;
147PUBLIC COMMAND_M_SYN ;AN000;
148
149;
150; The following parse control block is used for COMMAND. This block is
151; used for parsing during initialization. The sytax for COMMAND is:
152; COMMAND [d:][path][/P][/F][/D][/E:xxxxx][/MSG][/C executable]
153; Anything on the command line after the /C switch will be passed to the
154; executable command, so if /C is used, it must be specified last. The
155; /MSG switch can only be specified if the /P switch is specified.
156;
157
158ENVBIG EQU 32768 ;AN000; maximum environment size
159ENVSML EQU 160 ;AN000; minimum environment size
160
161INTERNAT_INFO LABEL BYTE ;AN000; used for country info after parsing is completed
162PARSE_COMMAND LABEL BYTE ;AN000;
163 DW RESGROUP:COMMAND_PARMS ;AN000;
164 DB 0 ;AN000; no extra delimiter
165
166COMMAND_PARMS LABEL BYTE ;AN000;
167 DB 0,1 ;AN000; 1 positional parm
168 DW RESGROUP:COMMAND_FILE ;AN000;
169 DB 6 ;AN000; 6 switches
170 DW RESGROUP:COMMAND_SWITCH1 ;AN000;
171 DW RESGROUP:COMMAND_SWITCH2 ;AN000;
172 DW RESGROUP:COMMAND_SWITCH3 ;AN000;
173 DW RESGROUP:COMMAND_SWITCH4 ;AN000;
174 DW RESGROUP:COMMAND_SWITCH5 ;AN000;
175 DW RESGROUP:COMMAND_SWITCH6 ;AN000;
176 DB 0 ;AN000; no keywords
177
178COMMAND_FILE LABEL BYTE ;AN000;
179 DW 0201H ;AN000; filespec - optional
180 DW 1 ;AN000; capitalize - file table
181 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
182 DW RESGROUP:NO_VAL ;AN000;
183 DB 0 ;AN000; no keywords
184
185COMMAND_SWITCH1 LABEL BYTE ;AN000;
186 DW 0 ;AN000; no match flags
187 DW 2 ;AN000; capitalize by char table
188 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
189 DW RESGROUP:NO_VAL ;AN000;
190 DB 1 ;AN000; 1 keyword
191COMMAND_P_SYN DB "/P",0 ;AN000; /P switch
192
193COMMAND_SWITCH2 LABEL BYTE ;AN000;
194 DW 0 ;AN000; no match flags
195 DW 2 ;AN000; capitalize by char table
196 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
197 DW RESGROUP:NO_VAL ;AN000;
198 DB 1 ;AN000; 1 keyword
199COMMAND_F_SYN DB "/F",0 ;AN000; /F switch
200
201COMMAND_SWITCH3 LABEL BYTE ;AN000;
202 DW 0 ;AN000; no match flags
203 DW 2 ;AN000; capitalize by char table
204 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
205 DW RESGROUP:NO_VAL ;AN000;
206 DB 1 ;AN000; 1 keyword
207COMMAND_D_SYN DB "/D",0 ;AN000; /D switch
208
209COMMAND_SWITCH4 LABEL BYTE ;AN000;
210 DW 8000H ;AN000; numeric value - required
211 DW 0 ;AN000; no function flags
212 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
213 DW RESGROUP:COMMAND_E_VAL ;AN000; pointer to value list
214 DB 1 ;AN000; 1 keyword
215COMMAND_E_SYN DB "/E",0 ;AN000; /E switch
216
217COMMAND_E_VAL LABEL BYTE ;AN000;
218 DB 1 ;AN000;
219 DB 1 ;AN000; 1 range
220 DB 1 ;AN000; returned if result
221 DD ENVSML,ENVBIG ;AN000; minimum & maximum value
222 DB 0 ;AN000; no numeric values
223 DB 0 ;AN000; no string values
224
225COMMAND_SWITCH5 LABEL BYTE ;AN000;
226 DW 0 ;AN000; no match flags
227 DW 2 ;AN000; capitalize by char table
228 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
229 DW RESGROUP:NO_VAL ;AN000;
230 DB 1 ;AN000; 1 keyword
231COMMAND_C_SYN DB "/C",0 ;AN000; /C switch
232
233COMMAND_SWITCH6 LABEL BYTE ;AN000;
234 DW 0 ;AN000; no match flags
235 DW 2 ;AN000; capitalize by char table
236 DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
237 DW RESGROUP:NO_VAL ;AN000;
238 DB 1 ;AN000; 1 keyword
239COMMAND_M_SYN DB "/MSG",0 ;AN000; /MSG switch
240
241COMND1_OUTPUT LABEL BYTE ;AN000;
242COMND1_TYPE DB 0 ;AN000; type
243COMND1_CODE DB 0 ;AN000; return value
244COMND1_SYN DW 0 ;AN000; synonym pointer
245COMND1_ADDR DD 0 ;AN000; numeric value / address
246 ; of string value
247
248NO_VAL DB 0 ;AN000; no values
249num_positionals DW 0 ;AN000; counter for positionals
250old_parse_ptr DW 0 ;AN057; SI position before calling parser
251
252.xlist
253.xcref
254
255INCLUDE SYSMSG.INC ;AN000; get message services routine
256
257.list
258.cref
259
260ASSUME DS:RESGROUP,ES:RESGROUP,CS:RESGROUP
261
262MSG_UTILNAME <COMMAND> ;AN000; define utility name
263
264MSG_SERVICES <COMR,COMMAND.CLB> ;AN000; include initialization messages
265
266include msgdcl.inc
267
268INIT ENDS
269
270 END