]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/COMMAND/TSPC.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / CMD / COMMAND / TSPC.ASM
1 page 80,132
2 ; SCCSID = @(#)tspc.asm 4.1 85/09/22
3 ; SCCSID = @(#)tspc.asm 4.1 85/09/22
4 TITLE COMMAND Transient Uninitialized DATA
5
6 INCLUDE comsw.asm
7 .xlist
8 .xcref
9 INCLUDE DOSSYM.INC
10 INCLUDE comequ.asm
11 INCLUDE comseg.asm
12 INCLUDE EA.inc ;AN030;
13 .list
14 .cref
15
16 ; Uninitialized transient data
17 TRANSPACE SEGMENT PUBLIC BYTE
18
19 PUBLIC ALLSWITCH
20 PUBLIC append_exec ;AN041;
21 PUBLIC arg
22 PUBLIC argbufptr
23 PUBLIC ARGC
24 PUBLIC ARG1S
25 PUBLIC ARG2S
26 PUBLIC ARGTS
27 PUBLIC arg_buf
28 PUBLIC ASCII
29 PUBLIC BatBuf
30 PUBLIC BatBufEnd
31 PUBLIC BatBufPos
32 PUBLIC BATHAND
33 PUBLIC BINARY
34 PUBLIC BITS
35 PUBLIC BWDBUF
36 PUBLIC BYTCNT
37 PUBLIC bytes_free
38 PUBLIC CFLAG
39 PUBLIC CHARBUF
40 PUBLIC CHKDRV
41 PUBLIC COM
42 PUBLIC COMBUF
43 PUBLIC comma
44 PUBLIC comptr
45 PUBLIC comspec_flag
46 PUBLIC COMSW
47 PUBLIC CONCAT
48 PUBLIC concat_xa ;AN000;
49 PUBLIC copy_Num
50 PUBLIC CPDATE
51 PUBLIC CPTIME
52 PUBLIC cpyflag
53 PUBLIC CURDRV
54 PUBLIC DATE_DAY ;AN000;
55 PUBLIC DATE_MONTH ;AN000;
56 PUBLIC DATE_OUTPUT ;AN000;
57 PUBLIC DATE_TYPE ;AN000;
58 PUBLIC DATE_YEAR ;AN000;
59 PUBLIC DEST
60 PUBLIC DESTBUF
61 PUBLIC DestClosed
62 PUBLIC DESTDIR
63 PUBLIC DESTFCB
64 PUBLIC DESTFCB2
65 PUBLIC DESTHAND
66 PUBLIC DESTINFO
67 PUBLIC DESTISDEV
68 PUBLIC DESTISDIR
69 PUBLIC DESTNAME
70 PUBLIC DESTSIZ
71 PUBLIC DESTSWITCH
72 PUBLIC DESTTAIL
73 PUBLIC DESTVARS
74 PUBLIC DIRBUF
75 PUBLIC DIRCHAR
76 PUBLIC dirflag ;AN015;
77 PUBLIC Dir_Num
78 PUBLIC display_ioctl ;AN000;
79 PUBLIC display_mode ;AN000;
80 PUBLIC display_width ;AN000;
81 PUBLIC DRIVE_NUMBER ;AN000;
82 PUBLIC DRIVE_OUTPUT ;AN000;
83 PUBLIC DRIVE_TYPE ;AN000;
84 PUBLIC DRIVE_VALUE ;AN000;
85 PUBLIC ELCNT
86 PUBLIC ELPOS
87 PUBLIC EXECPATH
88 PUBLIC EXEC_ADDR
89 PUBLIC EXEFCB
90 PUBLIC expand_star
91 PUBLIC ext_entered ;AN005;
92 PUBLIC ext_open_off ;AN000;
93 PUBLIC ext_open_parms ;AN000;
94 PUBLIC ext_open_seg ;AN000;
95 PUBLIC FBUF
96 PUBLIC FILECNT
97 PUBLIC file_size_high
98 PUBLIC file_size_low
99 PUBLIC FILTYP
100 PUBLIC FIRSTDEST
101 PUBLIC FRSTSRCH
102 PUBLIC FULLSCR
103 PUBLIC GOTOLEN
104 PUBLIC HEADCALL
105 PUBLIC ID
106 PUBLIC IDLEN
107 PUBLIC IFNOTFLAG
108 PUBLIC if_not_count
109 PUBLIC INEXACT
110 PUBLIC INTERNATVARS
111 PUBLIC KPARSE
112 PUBLIC last_arg
113 PUBLIC LINCNT
114 PUBLIC LINLEN
115 PUBLIC linperpag ;AN000;
116 PUBLIC major_ver_num
117 PUBLIC MELCOPY
118 PUBLIC MELSTART
119 PUBLIC minor_ver_num
120 PUBLIC msg_flag ;AN022;
121 PUBLIC msg_numb ;AN022;
122 PUBLIC NOWRITE
123 PUBLIC NXTADD
124 PUBLIC objcnt
125 PUBLIC one_char_val
126 PUBLIC PARM1
127 PUBLIC PARM2
128 PUBLIC parse_last ;AN018;
129 PUBLIC PARSE1_ADDR ;AN000;
130 PUBLIC PARSE1_CODE ;AN000;
131 PUBLIC PARSE1_OUTPUT ;AN000;
132 PUBLIC PARSE1_SYN ;AN000;
133 PUBLIC PARSE1_TYPE ;AN000;
134 PUBLIC PATHCNT
135 PUBLIC pathinfo
136 PUBLIC PATHPOS
137 PUBLIC PATHSW
138 PUBLIC PLUS
139 PUBLIC plus_comma
140 PUBLIC print_err_flag ;AN000;
141 PUBLIC psep_char
142 PUBLIC RCH_ADDR
143 PUBLIC RDEOF
144 PUBLIC RE_INSTR
145 PUBLIC RESSEG
146 PUBLIC SCANBUF
147 PUBLIC SDIRBUF
148 PUBLIC search_best
149 PUBLIC search_best_buf
150 PUBLIC search_curdir_buf
151 PUBLIC search_error
152 PUBLIC SKPDEL
153 PUBLIC SOURCE
154 PUBLIC SPECDRV
155 PUBLIC SRCBUF
156 PUBLIC SRCHAND
157 PUBLIC SRCINFO
158 PUBLIC SRCISDEV
159 PUBLIC SRCISDIR
160 PUBLIC SRCPT
161 PUBLIC SRCSIZ
162 PUBLIC SRCTAIL
163 PUBLIC SRCVARS
164 PUBLIC srcxname
165 PUBLIC src_xa_seg ;AN000;
166 PUBLIC src_xa_size ;AN000;
167 PUBLIC STACK
168 PUBLIC STARTEL
169 PUBLIC string_ptr_2
170 ;AD061; PUBLIC string_ptr_2_sb ;AN000;
171 PUBLIC subst_buffer ;AN061;
172 PUBLIC SWITCHAR
173 PUBLIC system_cpage
174 PUBLIC TERMREAD
175 PUBLIC TIME_FRACTION ;AN000;
176 PUBLIC TIME_HOUR ;AN000;
177 PUBLIC TIME_MINUTES ;AN000;
178 PUBLIC TIME_OUTPUT ;AN000;
179 PUBLIC TIME_SECONDS ;AN000;
180 PUBLIC TIME_TYPE ;AN000;
181 PUBLIC TPA
182 PUBLIC tpbuf
183 PUBLIC TRANSPACEEND
184 PUBLIC TRAN_TPA
185 PUBLIC trgxname
186 PUBLIC UCOMBUF
187 PUBLIC USERDIR1
188 PUBLIC vol_drv
189 PUBLIC vol_ioctl_buf ;AC030;
190 PUBLIC vol_serial ;AC030;
191 PUBLIC vol_label ;AC030;
192 PUBLIC WRITTEN
193 PUBLIC xa_cp_length ;AN030;
194 PUBLIC xa_cp_out ;AN030;
195 PUBLIC xa_list_attr ;AN030;
196 PUBLIC zflag
197
198 IF IBM
199 PUBLIC ROM_CALL
200 PUBLIC ROM_CS
201 PUBLIC ROM_IP
202 ENDIF
203
204
205 ORG 0
206 ZERO = $
207 SRCXNAME DB DIRSTRLEN + 20 DUP (?) ;g buffer for name translate
208 TRGXNAME DB DIRSTRLEN + 20 DUP (?) ;g buffer for name translate
209 UCOMBUF DB COMBUFLEN+3 DUP(?) ; Raw console buffer
210 COMBUF DB COMBUFLEN+3 DUP(?) ; Cooked console buffer
211 USERDIR1 DB DIRSTRLEN+3 DUP(?) ; Storage for users current directory
212 EXECPATH DB COMBUFLEN+3 DUP(?) ; Path for external command
213 RE_INSTR DB DIRSTRLEN+3+13 DUP (?) ; path for input to redirection
214
215 ; Variables passed up from resident
216 HEADCALL LABEL DWORD
217 DW ?
218 RESSEG DW ?
219 TPA DW ?
220 SWITCHAR DB ?
221 DIRCHAR DB ?
222 EXEC_ADDR DD ?
223 RCH_ADDR DD ?
224 fTest DW ?
225 TRAN_TPA DW ?
226
227 CHKDRV DB ?
228 RDEOF LABEL BYTE ; Misc flags
229 IFNOTFLAG LABEL BYTE
230 FILTYP DB ?
231 CURDRV DB ?
232 concat_xa db 0 ;AN000; flag for XA on file concatenations
233 CONCAT LABEL BYTE
234 PARM1 DB ?
235 ARGC LABEL BYTE
236 PARM2 DB ?
237 COMSW DW ? ; Switches between command and 1st arg
238 ARG1S DW ? ; Switches between 1st and 2nd arg
239 DESTSWITCH LABEL WORD
240 ARG2S DW ? ; Switches after 2nd arg
241 ALLSWITCH LABEL WORD
242 ARGTS DW ? ; ALL switches except for COMSW
243 CFLAG DB ?
244 DESTCLOSED LABEL BYTE
245 SPECDRV DB ?
246 BYTCNT DW ? ; Size of buffer between RES and TRANS
247 NXTADD DW ?
248 FRSTSRCH DB ?
249 LINCNT DB ?
250 LINLEN DB ?
251 FILECNT DW ?
252 CHARBUF DB 80 DUP (?) ;line byte character buffer for xenix write
253 DESTFCB2 LABEL BYTE
254 IDLEN DB ?
255 ID DB 8 DUP(?)
256 COM DB 3 DUP(?)
257 DEST DB 37 DUP(?)
258 DESTNAME DB 11 DUP(?)
259 DESTFCB LABEL BYTE
260 DESTDIR DB DIRSTRLEN DUP(?) ; Directory for PATH searches
261 GOTOLEN LABEL WORD
262 BWDBUF LABEL BYTE
263 EXEFCB LABEL WORD
264 DIRBUF DB DIRSTRLEN+3 DUP(?)
265 SDIRBUF DB 12 DUP(?)
266 BITS DW ?
267 PATHCNT DW ?
268 PATHPOS DW ?
269 PATHSW DW ?
270 FULLSCR DW ?
271 comma db 0 ;g flag set if +,, occurs
272 plus_comma db 0 ;g flag set if +,, occurs
273 dirflag db 0 ;AN015; set when pathcrunch called from DIR
274 parse_last dw 0 ;AN018; used to hold parsing position
275
276 system_cpage DW 0 ;AC001; used for CHCP variable
277 src_XA_size DW 0 ;AN000; size of extended attributes
278 src_XA_seg DW 0 ;AN000; segment of extended attributes
279
280 ext_open_parms label byte ;AN000; extended open parameter list
281 ;emg340 ext_open_off dw offset trangroup:srcbuf ;AN000; offset of file name
282 ext_open_off dw ? ;AN030; offset of extended attributes
283 ext_open_seg dw ? ;AN000; segment of extended attributes
284 dw 0 ;AN000; no additional parameters
285
286 XA_cp_out label byte ;AN030; list for one extended attribute
287 DW 1 ;AN030; count of entries
288 DB EAISBINARY ;AN030; ea_type
289 DW EASYSTEM ;AN030; ea_flags
290 DB ? ;AN030; ea_rc
291 DB 2 ;AN030; ea_namelen
292 DW 2 ;AN030; ea_valuelen
293 DB "CP" ;AN030; ea_name
294 xa_list_attr DW 0 ;AC030; code page
295 xa_cp_length DW $-XA_cp_out ;AN030; length of buffer
296
297
298
299 arg_buf db 128 dup (?)
300 file_size_low dw ? ;AC000;
301 file_size_high dw ? ;AC000;
302 string_ptr_2 dw ?
303 ;AD061;string_ptr_2_sb dw ?
304 copy_Num dw ?
305 cpyflag db ?
306 Dir_Num DW ?
307 bytes_free dw ?
308 dw ?
309 major_ver_num dw ?
310 minor_ver_num dw ?
311 one_char_val db ?,0
312 vol_drv db ?
313
314 IF IBM
315 ROM_CALL DB ? ; flag for rom function
316 ROM_IP DW ?
317 ROM_CS DW ?
318 ENDIF
319
320 DESTVARS LABEL BYTE
321 DESTISDIR DB ?
322 DESTSIZ DB ?
323 DESTTAIL DW ?
324 DESTINFO DB ?
325 DESTBUF DB DIRSTRLEN + 20 DUP (?)
326
327 DESTHAND DW ?
328 DESTISDEV DB ?
329 FIRSTDEST DB ?
330 MELCOPY DB ?
331 MELSTART DW ?
332
333 SRCVARS LABEL BYTE
334 SRCISDIR DB ?
335 SRCSIZ DB ?
336 SRCTAIL DW ?
337 SRCINFO DB ?
338 SRCBUF DB DIRSTRLEN + 20 DUP (?)
339
340 SRCHAND DW ?
341 SRCISDEV DB ?
342
343 SCANBUF DB DIRSTRLEN + 20 DUP (?)
344
345 SRCPT DW ?
346 INEXACT DB ?
347 NOWRITE DB ?
348 BINARY DB ?
349 WRITTEN DW ?
350 TERMREAD DB ?
351 ASCII DB ?
352 PLUS DB ?
353 objcnt db ? ; Used in copy
354 CPDATE DW ?
355 CPTIME DW ?
356 BATHAND DW ? ; Batch handle
357 STARTEL DW ?
358 ELCNT DB ?
359 ELPOS DB ?
360 SKPDEL DB ?
361 SOURCE DB 11 DUP(?)
362
363 ext_entered db 0 ;AN005;
364
365 display_ioctl db 0 ;AN000; info level
366 db 0 ;AN000; reserved
367 dw crt_ioctl_ln ;AN000; length of data
368 dw ? ;AN000; control flags
369 display_mode db ? ;AN000; display mode, colors
370 db 0 ;AN000; reserved
371 dw ? ;AN023; colors
372 dw ? ;AN000; display width (PELS)
373 dw ? ;AN000; display length (PELS)
374 display_width dw ? ;AN000; display width
375 linperpag dw linesperpage ;AN000; display length (default to linesperpage)
376
377 vol_ioctl_buf label byte ;AN000; buffer for ioctl volume label/serial call
378 dw 0 ;AN000; info level
379 vol_serial dd 0 ;AN000; volume serial number
380 vol_label db 11 dup (" ") ;AN000; volume label - init to blanks
381 db 8 dup (" ") ;AN000; file system type
382
383 expand_star db ?
384 comspec_flag db ?
385 msg_flag db ? ;AN022; flag set if non-utility message issued
386 msg_numb dw 0 ;AN022; set with extended error message issued
387 append_exec db 0 ;AN041; set if internal append executed
388 print_err_flag dw 0 ;AN000; flag set if error during sysdispmsg
389 subst_buffer db parm_block_size*2 dup (0);AN061;
390
391 ;;;; IF KANJI 3/3/KK
392 KPARSE DB ?
393 ;;;; ENDIF 3/3/KK
394
395 ; Data declarations taken out of parse.asm
396
397 arg arg_unit <> ; pointers, arg count, string buffer
398 argbufptr DW ? ; index for argv[].argpointer
399 tpbuf DB 128 DUP (?) ; temporary buffer
400 LAST_ARG DW ? ; point at which to accumulate switch info
401 comptr dw ? ; ptr into combuf
402
403 ; Data declarations taken out of path.asm
404 fbuf find_buf <> ; dma buffer for findfirst/findnext
405 pathinfo DW 3 DUP (?) ; ES, SI(old), and SI(new) of user path
406 psep_char DB ? ; '/' or '\'
407 search_best DB (?) ; best code, best filename so far
408 fname_max_len equ 13
409 search_best_buf DB fname_max_len DUP (?)
410 search_curdir_buf DB 64 DUP (?) ; a place for CurDir info, if successful
411 search_error DW (?) ; address of error message to be printed
412
413 ; Data declarations taken out of tbatch.asm
414 if_not_count DW ?
415
416 zflag db ? ; Used by typefil to indicate ^Z's
417
418 DW 80H DUP(0) ; Init to 0 to make sure the linker is not fooled
419 STACK LABEL WORD
420
421 INTERNATVARS internat_block <>
422 DB (internat_block_max - ($ - INTERNATVARS)) DUP (?)
423
424 BatBufPos DW ? ; integer position in buffer of next byte
425 BatBuf DB BatLen DUP (?)
426 BatBufEnd DW ?
427
428 ; *****************************************************
429 ; EMG 4.00
430 ; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00
431 ; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE
432 ; *****************************************************
433 ;
434 ; COMMON PARSE OUTPUT BLOCKS
435 ;
436
437
438 ;
439 ; Common output blocks for PARSE number, complex, or string values.
440 ;
441
442 PARSE1_OUTPUT LABEL BYTE ;AN000;
443 PARSE1_TYPE DB 0 ;AN000; type
444 PARSE1_CODE DB 0 ;AN000; return value
445 PARSE1_SYN DW 0 ;AN000; es offset of synonym
446 PARSE1_ADDR DD 0 ;AN000; numeric value / address
447 ; of string value
448
449 ;
450 ; Common output block for PARSE date strings.
451 ;
452
453 DATE_OUTPUT LABEL BYTE ;AN000;
454 DATE_TYPE DB 0 ;AN000; type
455 DB 0 ;AN000; return value
456 DW 0 ;AN000; es offset of synonym
457 DATE_YEAR DW 0 ;AN000; year
458 DATE_MONTH DB 0 ;AN000; month
459 DATE_DAY DB 0 ;AN000; day
460
461 ;
462 ; Common output block for PARSE time strings.
463 ;
464
465 TIME_OUTPUT LABEL BYTE ;AN000;
466 TIME_TYPE DB 0 ;AN000; type
467 DB 0 ;AN000; return value
468 DW 0 ;AN000; es offset of synonym
469 TIME_HOUR DB 0 ;AN000; hour
470 TIME_MINUTES DB 0 ;AN000; minutes
471 TIME_SECONDS DB 0 ;AN000; seconds
472 TIME_FRACTION DB 0 ;AN000; hundredths
473
474 ;
475 ; Common output block for PARSE drive specifier (one based drive number).
476 ;
477
478 DRIVE_OUTPUT LABEL BYTE ;AN000;
479 DRIVE_TYPE DB 0 ;AN000; type
480 DRIVE_VALUE DB 0 ;AN000; return value
481 DW 0 ;AN000; es offset of synonym
482 DRIVE_NUMBER DB 0 ;AN000; drive number
483 DB 0,0,0 ;AN000; reserved
484
485 TRANSPACEEND LABEL BYTE
486
487 TRANSPACE ENDS
488 END