]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/COMMAND/RDATA.ASM
2 ; SCCSID = @(#)rdata.asm 4.2 85/09/22
3 ; SCCSID = @(#)rdata.asm 4.2 85/09/22
4 TITLE COMMAND Resident
DATA
14 ; Equates for initialization (from COMEQU)
16 initInit equ
01h ; initialization in progress
17 initSpecial equ
02h ; in initialization time/date routine
18 initCtrlC equ
04h ; already in ^C handler
22 CODERES
SEGMENT PUBLIC BYTE ;AC000;
34 TRANCODE
SEGMENT PUBLIC BYTE ;AC000;
38 ; Data for resident portion
40 DATARES
SEGMENT PUBLIC BYTE
48 PUBLIC append_flag
;AN020;
49 PUBLIC append_state
;AN020;
50 PUBLIC BADFAT_BLOCK
;AC000;
51 PUBLIC BADFAT_OP_SEG
;AC000;
52 PUBLIC BADFAT_SUBST
;AC000;
55 PUBLIC call_batch_flag
63 PUBLIC COMPRMT1_BLOCK
;AC000;
64 PUBLIC COMPRMT1_SEG
;AC000;
65 PUBLIC COMPRMT1_SEG2
;AC000;
66 PUBLIC COMPRMT1_SUBST
;AC000;
68 PUBLIC crit_msg_off
;AC000;
69 PUBLIC crit_msg_seg
;AC000;
70 PUBLIC critical_msg_start
;AC000;
76 PUBLIC dbcs_vector_addr
;AN000;
77 PUBLIC DEVE_OP_OFF
;AC000;
78 PUBLIC DEVE_OP_SEG
;AC000;
79 PUBLIC DEVE_OP_SEG2
;AC000;
80 PUBLIC DEVEMES_BLOCK
;AC000;
81 PUBLIC DEVEMES_SUBST
;AC000;
82 PUBLIC DEVENAM
;AC000;
83 PUBLIC DISP_CLASS
;AN000;
85 PUBLIC DRVNUM_BLOCK
;AC000;
86 PUBLIC DRVNUM_OP_OFF
;AC000;
87 PUBLIC DRVNUM_OP_SEG
;AC000;
88 PUBLIC DRVNUM_OP_SEG2
;AC000;
89 PUBLIC DRVNUM_SUBST
;AC000;
92 PUBLIC ERR15_OP_SEG
;AC000;
93 PUBLIC ERR15_OP_SEG2
;AC000;
94 PUBLIC ERR15_OP_SEG3
;AC000;
95 PUBLIC ERR15MES_BLOCK
;AC000;
96 PUBLIC ERR15MES_SUBST
;AC000;
100 PUBLIC EXECEMES_BLOCK
;AC000;
101 PUBLIC EXECEMES_SUBST
;AC000;
102 PUBLIC EXECEMES_OFF
;AC000;
103 PUBLIC EXECEMES_SEG
;AC000;
105 PUBLIC extended_msg_start
;AN000;
106 PUBLIC extmsgend
;AN000;
107 PUBLIC fail_char
;AC000;
111 PUBLIC fucase_addr
;AN000;
123 ;AD054; PUBLIC MESBAS ;AC000;
131 PUBLIC NUMBER_SUBST
;AN000;
136 ;AD060; PUBLIC pars_msg_off ;AN000;
137 ;AD060; PUBLIC pars_msg_seg ;AN000;
138 PUBLIC parse_msg_start
;AN000;
152 PUBLIC resmsgend
;AN000;
158 PUBLIC rsrc_xa_seg
;AN030;
171 PUBLIC VOLSER
;AN000;
174 ;AD054;MESBAS DW 19 ;AC000; error_write_protect
175 ;AD054; DW 20 ;AC000; error_bad_unit
176 ;AD054; DW 21 ;AC000; error_not_ready
177 ;AD054; DW 22 ;AC000; error_bad_command
178 ;AD054; DW 23 ;AC000; error_CRC
179 ;AD054; DW 24 ;AC000; error_bad_length
180 ;AD054; DW 25 ;AC000; error_Seek
181 ;AD054; DW 26 ;AC000; error_not_DOS_disk
182 ;AD054; DW 27 ;AC000; error_sector_not_found
183 ;AD054; DW 28 ;AC000; error_out_of_paper
184 ;AD054; DW 29 ;AC000; error_write_fault
185 ;AD054; DW 30 ;AC000; error_read_fault
186 ;AD054; DW 31 ;AC000; error_gen_failure
187 ;AD054; DW 32 ;AC000; error_sharing_violation
188 ;AD054; DW 33 ;AC000; error_lock_violation
189 ;AD054; DW 34 ;AC000; error_wrong_disk
190 ;AD054; DW 35 ;AC000; error_FCB_unavailable
191 ;AD054; DW 36 ;AC000; error_sharing_buffer_exceeded
192 ;AD054; DW 37 ;AC000; error_code_page_mismatch
193 ;AD054; DW 38 ;AC026; error_out_of_input
194 ;AD054; DW 39 ;AN026; error_insufficient_disk_space
200 DW OFFSET ResGroup
:NEWLIN
;"0"
201 DW OFFSET ResGroup
:COM$1
;"1"
202 DW OFFSET ResGroup
:ERR3
;"2"
203 DW OFFSET ResGroup
:ALLOC$3
;"3"
204 DW OFFSET ResGroup
:FILE$4
;"4"
205 DW OFFSET ResGroup
:RROR$5
;"5"
206 DW OFFSET ResGroup
:CAN$6
;"6"
207 DW OFFSET ResGroup
:EMORY$7
;"7"
208 DW OFFSET ResGroup
:BAT$8
;"8"
209 DW OFFSET ResGroup
:INS$9
;"9"
211 ERR0
DB "Write protec","t"+80h
212 ERR1
DB "Bad uni","t"+80h
213 ERR2
DB "Not read","y"+80h
214 ERR3
DB "Bad command"," "+80h
215 ERR4
DB "Dat","a"+80h
216 ERR5
DB "Bad call forma","t"+80h
217 ERR6
DB "See","k"+80h
218 ERR7
DB "Non-DOS dis","k"+80h
219 ERR8
DB "Sector not foun","d"+80h
220 ERR9
DB "No pape","r"+80h
221 ERR10
DB "Write faul","t"+80h
222 ERR11
DB "Read faul","t"+80h
223 ERR12
DB "General Failur","e"+80h
224 ERR13
DB "Sharing Violatio","n"+80h
225 ERR14
DB "Lock Violatio","n"+80h
226 ERR15
DB "Invalid Disk Chang","e"+80h
227 ERR16
DB "FCB unavailabl","e"+80h
228 ERR17
DB "Sharing buffer exceede","d"+80h
230 ;--- Extra message for error 15
231 Err15Mes db "Please Insert disk "
238 IOTYP
DB "writin","g"+80h
242 DEVEMES
DB " device "
244 DB 13,10,"$" ;Must be $ terminated
245 COM$1
DB " COMMAN","D"+80h
246 ALLOC$3
DB " allocation"," "+80h
247 FILE$4
DB " file"," "+80h
248 RROR$5
DB "rror"," "+80h
249 CAN$6
DB "Cannot"," "+80h
250 EMORY$7
DB "emor","y"+80h
251 BAT$8
DB " batc","h"+80h
252 INS$9
DB "Inser","t"+80h
256 BADFAT
DB "0File 3table bad",","+80h
257 COMBAD
DB "0Invalid1.COM","0"+80h
258 comprmt1
DB "9 disk with"," "+80h
259 comprmt2
DB " in drive "
261 PROMPT
DB "0and strike any key when ready","0"+80h
262 ENDBATMES
DB "0Terminate8 job (Y/N)?"," "+80h
263 EXECEMES
DB "EXEC failure","0"+80h
264 EXEBAD
DB "E5in EXE4","0"+80h
265 TOOBIG
DB "Program too big to fit in m7","0"+80h
266 NOHANDMES
DB "0No free4handle","s"+80h
267 BMEMMES
DB "0M73e","5"+80h
268 HALTMES
DB "06load1, system halte","d"+80h
269 FRETMES
DB "06start1, exiting","0"+80h
270 RBADNAM
DB "2or4name","0"+80h
271 AccDen
DB "Access Denied","0"+80h
272 Patricide
DB 13,10,"Top level process aborted, cannot continue."," "+80h
278 parm_block_size EQU
11 ;AN000; size of message subst block
279 blank EQU
" " ;AN000; blank character
281 DISP_CLASS
DB -1 ;AN000; utility message class
282 NUMBER_SUBST
DB 0 ;AN000; number of message substitutions - def 0
285 DRVNUM_SUBST db 2 ;AN000; number of subst
286 DRVNUM_BLOCK db parm_block_size
;AN000;size of sublist
288 DRVNUM_OP_OFF dw 0 ;AN000;offset of arg
289 DRVNUM_OP_SEG dw 0 ;AN000;segment of arg
290 db 1 ;AN000;first subst
291 db Char_field_ASCIIZ
;AN000;character string
292 db 128 ;AN000;maximum width
293 db 0 ;AN000;minimum width
294 db blank
;AN000;pad character
295 db parm_block_size
;AN000;size of sublist
297 dw OFFSET RESGROUP
:DRVLET
;AN000;offset of arg
298 DRVNUM_OP_SEG2 dw 0 ;AN000;segment of arg
299 db 2 ;AN000;second subst
300 db Char_field_Char
;AN000;one character
301 db 1 ;AN000;maximum width
302 db 1 ;AN000;minimum width
303 db blank
;AN000;pad character
307 DEVEMES_SUBST db 2 ;AN000; number of subst
308 DEVEMES_BLOCK db parm_block_size
;AN000;size of sublist
310 DEVE_OP_OFF dw 0 ;AN000;offset of arg
311 DEVE_OP_SEG dw 0 ;AN000;segment of arg
312 db 1 ;AN000;first subst
313 db Char_field_ASCIIZ
;AN000;character string
314 db 128 ;AN000;maximum width
315 db 0 ;AN000;minimum width
316 db blank
;AN000;pad character
317 db parm_block_size
;AN000;size of sublist
319 dw OFFSET RESGROUP
:DEVENAM
;AN000;offset of arg
320 DEVE_OP_SEG2 dw 0 ;AN000;segment of arg
321 db 2 ;AN000;second subst
322 db Char_field_ASCIIZ
;AN000;character string
323 db 8 ;AN019;maximum width
324 db 8 ;AN019;minimum width
325 db blank
;AN000;pad character
329 ;--- Extra message for error 15
330 ERR15MES_SUBST db 3 ;AN000; number of subst
331 ERR15MES_BLOCK db parm_block_size
;AN000;size of sublist
333 dw OFFSET RESGROUP
:VOLNAME
;AN000;offset of arg
334 ERR15_OP_SEG dw 0 ;AN000;segment of arg
335 db 1 ;AN000;first subst
336 db Char_field_ASCIIZ
;AN000;character string
337 db 12 ;AN000;maximum width
338 db 12 ;AN000;minimum width
339 db blank
;AN000;pad character
340 db parm_block_size
;AN000;size of sublist
342 dw OFFSET RESGROUP
:VOLSER
+2;AN000;offset of arg
343 ERR15_OP_SEG2 dw 0 ;AN000;segment of arg
344 db 2 ;AN000;second subst
345 db right_align
+Bin_Hex_Word
;AN000;long binary to decimal
346 db 4 ;AN000;maximum width
347 db 4 ;AN000;minimum width
348 db "0" ;AN000;pad character
349 db parm_block_size
;AN000;size of sublist
351 dw OFFSET RESGROUP
:VOLSER
;AN000;offset of arg
352 ERR15_OP_SEG3 dw 0 ;AN000;segment of arg
353 db 3 ;AN000;third subst
354 db right_align
+Bin_Hex_Word
;AN000;long binary to decimal
355 db 4 ;AN000;maximum width
356 db 4 ;AN000;minimum width
357 db "0" ;AN000;pad character
359 ;************************************
360 ;* DO NOT SEPARATE VOLNAME & VOLSER *
361 ;************************************
363 VolName
DB 11 dup(?
) ;*
367 ;************************************
372 BADFAT_SUBST db 1 ;AN000; number of subst
373 BADFAT_BLOCK db parm_block_size
;AN000;size of sublist
375 dw OFFSET RESGROUP
:DRVLET
;AN000;offset of arg
376 BADFAT_OP_SEG dw 0 ;AN000;segment of arg
377 db 1 ;AN000;first subst
378 db Char_field_Char
;AN000;one character
379 db 1 ;AN000;maximum width
380 db 1 ;AN000;minimum width
381 db blank
;AN000;pad character
384 COMPRMT1_SUBST db 2 ;AN000; number of subst
385 COMPRMT1_BLOCK db parm_block_size
;AN000;size of sublist
387 COMSPEC_PRINT dw ?
;AN000;offset of arg
388 COMPRMT1_SEG dw 0 ;AN000;segment of arg
389 db 1 ;AN000;first subst
390 db Char_field_ASCIIZ
;AN000;character string
391 db 64 ;AN000;maximum width
392 db 0 ;AN000;minimum width
393 db blank
;AN000;pad character
394 db parm_block_size
;AN000;size of sublist
396 dw OFFSET RESGROUP
:CPDRV
;AN000;offset of arg
397 COMPRMT1_SEG2 dw 0 ;AN000;segment of arg
398 db 2 ;AN000;second subst
399 db Char_field_Char
;AN000;one character
400 db 1 ;AN000;maximum width
401 db 1 ;AN000;minimum width
402 db blank
;AN000;pad character
406 ; Exec error messages
408 EXECEMES_SUBST db 1 ;AN000; number of subst
409 EXECEMES_BLOCK db parm_block_size
;AN000;size of sublist
411 EXECEMES_OFF dw 0 ;AN000;offset of arg
412 EXECEMES_SEG dw 0 ;AN000;segment of arg
413 db 1 ;AN000;first subst
414 db Char_field_ASCIIZ
;AN000;character string
415 db 64 ;AN000;maximum width
416 db 0 ;AN000;minimum width
417 db blank
;AN000;pad character
420 ; These characters MUST remain in order
429 ; End of characters that MUST remain in order
433 RemMsg
DD ?
;Pointer to message in error 15
434 ErrType
DB ?
; Error message style, 0=old, 1=new
436 INT_2E_RET
DD ?
; Magic command executer return address
443 BATCH
DW 0 ; Assume no batch mode initially
446 TRANS
DW OFFSET TRANGROUP
:COMMAND
449 TrnMvFlg
DB 0 ; Indicate if transient portion has been moved
451 In_Batch
DB 0 ; Indicate if we are in Batch processing mode.
452 Batch_Abort
DB 0 ; Indicate if user wants to abort from batch mode.
454 COMDRV
DB ?
; DRIVE SPEC TO LOAD AUTOEXEC AND COMMAND
457 EXTCOM
DB 1 ; For init, pretend just did an external
459 CRIT_ERR_INFO
DB ?
;G hold critical error flags for R,I,F
460 rsrc_xa_seg
DW -1 ;AN030; holds segment of xa copy buffer
463 ; The echo flag needs to be pushed and popped around pipes and batch files.
464 ; We implement this as a bit queue that is shr/shl for push and pop.
466 ECHOFLAG
DB 00000001B ; low bit TRUE => echo commands
467 SUPPRESS
DB 1 ; used for echo, 1=echo line
470 PERMCOM
DB 0 ; TRUE => permanent command
471 SINGLECOM
DW 0 ; TRUE => single command version
473 fFail
DB 0 ; TRUE => FAIL all INT 24s
474 IFFLAG
DB 0 ; TRUE => If statement in progress
476 FORFLAG
DB 0 ; TRUE => FOR statement in progress
479 NEST
DW 0 ; NESTED BATCH FILE COUNTER
480 CALL_FLAG
DB 0 ; NO CALL (BATCH COMMAND) IN PROGRESS
482 NEXT_BATCH
DW 0 ; ADDRESS OF NEXT BATCH SEGMENT
483 NULLFLAG
DB 0 ; FLAG IF NO COMMAND ON COMMAND LINE
484 COM_XLAT_ADDR
DB 5 DUP (0) ;G BUFFER FOR TRANSLATE TABLE ADDRESS
485 FUCASE_ADDR
DB 5 DUP (0) ;AN000; BUFFER FOR FILE UCASE ADDRESS
486 CRIT_MSG_OFF
DW 0 ;AN000; SAVED CRITICAL ERROR MESSAGE OFFSET
487 CRIT_MSG_SEG
DW 0 ;AN000; SAVED CRITICAL ERROR MESSAGE SEGMENT
488 ;AD060; PARS_MSG_OFF DW 0 ;AN000; SAVED PARSE ERROR MESSAGE OFFSET
489 ;AD060; PARS_MSG_SEG DW 0 ;AN000; SAVED PARSE ERROR MESSAGE SEGMENT
490 Dbcs_vector_addr
DW 0 ;AN000; DBCS vector offset
491 DW 0 ;AN000; DBCS vector segment
492 APPEND_STATE
DW 0 ;AN020; current state of append (if flag = -1)
493 APPEND_FLAG
DB 0 ;AN020; set if APPEND state valid
496 RE_OUTSTR
DB 64+3+13 DUP (?
)
499 ; We flag the state of COMMAND in order to correctly handle the ^Cs at
500 ; various times. Here is the breakdown:
502 ; initINIT We are in the init code.
503 ; initSpecial We are in the date/time prompt
504 ; initCtrlC We are handling a ^C already.
506 ; If we get a ^C in the initialization but not in the date/time prompt, we
507 ; ignore the ^C. This is so the system calls work on nested commands.
509 ; If we are in the date/time prompt at initialization, we stuff the user's
510 ; input buffer with a CR to pretend an empty response.
512 ; If we are already handling a ^C, we set the carry bit and return to the user
513 ; (ourselves). We can then detect the carry set and properly retry the
519 ;These two bytes refed as a word
523 ;--- 2.x data for piping
525 ; All the "_" are substituted later, the one before the : is substituted
526 ; by the current drive, and the others by the CreateTemp call with the
527 ; unique file name. Note that the first 0 is the first char of the pipe
530 ;--- Order dependant, do not change
540 PIPESTR
DB 129 DUP(?
)
541 INPIPEPTR
DW OFFSET ResGroup
:PIPE1
542 OUTPIPEPTR
DW OFFSET ResGroup
:PIPE2
544 EXEC_BLOCK
LABEL BYTE ; The data block for EXEC calls
547 DW 80H
; Point at unformatted parameters
556 TRANVARS
LABEL BYTE ; Variables passed to transient
557 DW OFFSET ResGroup
:THEADFIX
558 MYSEG
DW 0 ; Put our own segment here
559 LTPA
DW 0 ; WILL STORE TPA SEGMENT HERE
562 DW OFFSET ResGroup
:EXT_EXEC
564 DW OFFSET ResGroup
:TREMCHECK
567 RES_TPA
DW 0 ; Original TPA (not rounded to 64K)
568 TranVarEnd
LABEL BYTE
572 RESMSGEND
DW 0 ;AN000;; holds offset of msg end (end of resident)
577 INCLUDE SYSMSG
.INC ;AN000; include message services
582 ASSUME
DS:RESGROUP
,ES:RESGROUP
,CS:RESGROUP
584 MSG_UTILNAME
<COMMAND
> ;AN000; define utility name
586 ;AD054; MSG_SERVICES <COMR,MSGDATA,COMMAND.CLA,COMMAND.CL3,COMMAND.CL4> ;AN000; get message services data and resident messages
587 MSG_SERVICES
<COMR
,MSGDATA
,COMMAND
.CLA
> ;AN054; get message services data and resident messages
590 CRITICAL_MSG_START
LABEL BYTE ;AN000; start of critical error messages
592 MSG_SERVICES
<COMR
,COMMAND
.CLD> ;AN000; get critical error messages
594 DATARESEND
LABEL BYTE ;AC060; end of resident portion if /msg not used
596 PARSE_MSG_START
LABEL BYTE ;AN000; start of parse error messages
598 MSG_SERVICES
<COMR
,COMMAND
.CLC> ;AN000; get parse error messages
600 ;AD060; DATARESEND LABEL BYTE ; end of resident portion if /msg not used
602 EXTENDED_MSG_START
LABEL BYTE ;AN000; start of extended error messages
604 MSG_SERVICES
<COMR
,COMMAND
.CLE
> ;AN000; get extended error messages
606 EXTMSGEND
LABEL BYTE ;AN000; end of extended error messages