diff --git a/retrodos5/command/COMMAND.COM b/retrodos5/command/COMMAND.COM index c319f586..12579cc6 100644 Binary files a/retrodos5/command/COMMAND.COM and b/retrodos5/command/COMMAND.COM differ diff --git a/retrodos5/command/COMMAND7.COM b/retrodos5/command/COMMAND7.COM index c319f586..12579cc6 100644 Binary files a/retrodos5/command/COMMAND7.COM and b/retrodos5/command/COMMAND7.COM differ diff --git a/retrodos5/command/R5.IMG b/retrodos5/command/R5.IMG index 61f7a8d2..7bfdc720 100644 Binary files a/retrodos5/command/R5.IMG and b/retrodos5/command/R5.IMG differ diff --git a/retrodos5/command/command7.s b/retrodos5/command/command7.s index a661937a..b6e4888e 100644 --- a/retrodos5/command/command7.s +++ b/retrodos5/command/command7.s @@ -1,7 +1,7 @@ ; **************************************************************************** ; COMMAND.COM (PCDOS 7.1 Command Interpreter) - RETRO DOS v5.0 by ERDOGAN TAN ; ---------------------------------------------------------------------------- -; Last Update: 14/08/2024 +; Last Update: 15/08/2024 ; ---------------------------------------------------------------------------- ; Beginning: 18/07/2024 (v7.1) - ((Previous: 19/06/2023 COMMAND.COM v6.22)) ; ---------------------------------------------------------------------------- @@ -2176,7 +2176,7 @@ EndInit: push es ; save segments ; 18/07/2024 - PCDOS 7.1 COMMAND.COM (ds=cs=RESGROUP) ;push cs - ;pop ds + ;pop ds ;assume ds:RESGROUP ; M004; Save size of transient here before INIT segment is deallocated @@ -2374,7 +2374,10 @@ adjust_env: ; 21/01/2023 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0398h cmp byte [AllocedEnv],0 ; flag - old environment segment - jne short no_free + ; !!!! ; 15/08/2024 + ;jne short no_free ; MSDOS 5.0 COMMAND.COM - RESGROUP:039Dh + ; PCDOS 7.1 COMMAND.COM - RESGROUP:04C0h + je short no_free ; MSDOS 6.22 COMMAND.COM - RESGROUP:0467h mov es,bp mov ah,49h @@ -2467,7 +2470,7 @@ no_free: ;mov InitFlag,FALSE ; indicate INIT is done ; 09/01/2023 - mov byte [InitFlag],0 + mov byte [InitFlag],0 pop es pop ds @@ -2480,7 +2483,7 @@ no_free: nomem_err: ;We call the error routine which will never return. It will either exit -;with an error ( if not the first COMMAND ) or just hang after an error +;with an error ( if not the first COMMAND ) or just hang after an error ;message ( if first COMMAND ) jmp Alloc_error @@ -8807,7 +8810,7 @@ load_low: ;mov bx,ExtMsgEnd ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM -%if 0 ; PCDOS 7.1 COMMAND.COM +%if 0 ; PCDOS 7.1 COMMAND.COM ; 29/01/2023 cmp di,ExtMsgEnd @@ -9541,7 +9544,7 @@ cXMMexit: ; 19/06/2023 ;db "19/6/2023 ETAN" ; 31/07/2024 - db "14/8/2024 ETAN" ; 14/08/2024 + db "15/8/2024 ETAN" ; 15/08/2024 db 0 ; 30/01/2023 @@ -9597,7 +9600,7 @@ HEADERPTR: ; PCDOS 7.1 COMMAND.COM - RESGROUP:2200h ICONDEV: db '/DEV/' - db 'CON',0,0,0,0,0,0 ; Room for 8 char device + db 'CON',0,0,0,0,0,0 ; Room for 8 char device BADCSPFL: db 0 COMSPECT: @@ -10158,7 +10161,7 @@ HelpMsgs: Reloc_Table: ; 23/07/2024 ; PCDOS 7.1 COMMAND.COM CODERES addresses dw MsgInt2fHandler - RCODE_START ; 7B2h (RESGROUP:7B2h+X) * - dw Int_2e - RCODE_START ; 170h (RESGROUP:170h+X) * + dw Int_2e - RCODE_START ; 170h (RESGROUP:170h+X) * dw ContC - RCODE_START ; 02Eh (RESGROUP:02Eh+X) * dw DSKERR - RCODE_START ; 495h (RESGROUP:495h+X) * dw Exec_Ret - RCODE_START ; 022h (RESGROUP:022h+X) * @@ -10213,7 +10216,7 @@ coderes_end equ $ ;db "Retro DOS v3.0 COMMAND.COM by Erdogan Tan [2018]" ; 30/01/2023 db 0 -;db "Retro DOS v4.0 COMMAND.COM by Erdogan Tan [2023]" +;db "Retro DOS v4.0 COMMAND.COM by Erdogan Tan [2023]" ; 07/06/2023 ;db "Retro DOS v4.2 COMMAND.COM by Erdogan Tan [2023]" ; 21/07/2024 @@ -20028,7 +20031,7 @@ cr_exit: retn -; --------------------------------------------------------------------------- +; --------------------------------------------------------------------------- ;*** Div32 - 32 bit divide for computing ratios ; @@ -20145,7 +20148,7 @@ gdf_testEOF: cmp ax,0FF0h ; valid entry? ;jb short gdf_success cmc ; cf = 1 <--> cf = 0 - jnc short gdf_ret + jnc short gdf_ret or ah,0F0h ; caller expects 16 bit special values ;jmp short gdf_success @@ -20337,7 +20340,7 @@ ReadCVFile: cmp ax,cx ; read it all? ;je short rcf_ret ; yes, CY clear - ; 08/06/2023 + ; 08/06/2023 ; ax < cx ;stc ; end-of-file? rcf_ret: @@ -20441,11 +20444,11 @@ erase_scan: cmp byte [si+1],':' ;AC000; drive specified? jne short erase_drive_ok ;AC000; no - continue - ;cmp byte [si+2],END_OF_LINE_OUT + ;cmp byte [si+2],END_OF_LINE_OUT cmp byte [si+2],0 ;AC000; was only drive entered? jne short erase_drive_ok ;AC000; no - continue - mov ax,ERROR_FILE_NOT_FOUND ; 2 + mov ax,ERROR_FILE_NOT_FOUND ; 2 ;AN022; get message number in control block jmp short extend_setup ;AC000; exit @@ -36117,7 +36120,7 @@ SYSLOADMSG: ; -------------------------- ; MSDOS 5.0 COMMAND.COM - TRANGROUP5192h - ;$M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes + ;$M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes call $M_CLS_3 ; Get addressibility to class F mov [$M_RT+$M_RES_ADDRS.$M_CLASS_ADDRS],di ;mov [$M_RT+44],di @@ -36231,7 +36234,7 @@ SYSGETMSG: ;pop ds ;;AN000;; jmp short $MEN32 $MIF32: - push cs ;;AN000;; + push cs ;;AN000;; ;pop ds ;;AN000;; $MEN32: ; 07/04/2023 @@ -43551,7 +43554,7 @@ screen_f_1: ;db 10 ;AN000;maximum width ;db 10 ;AN000;minimum width screen_f_2: - db 14 ; MSDOS 6.22 COMMAND.COM + db 14 ; MSDOS 6.22 COMMAND.COM db 14 db blank ; 20h ;AN000;pad character @@ -43624,7 +43627,7 @@ dmes_ptr: ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM space_4_ptr : - dw 1105 + dw 1105 db no_subst ; 0 ; destructive back space @@ -43753,7 +43756,7 @@ screen_f_4: ;db 10 ; minimum width screen_f_5: db 14 ; MSDOS 6.22 COMMAND.COM - db 14 + db 14 db blank ; 20h ; pad character %else ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM @@ -43874,17 +43877,17 @@ dosrev_ptr: ; "DOS is in ROM" DosRom_Ptr: dw 1091 - db no_subst ; 0 + db no_subst ; 0 ; "DOS is in HMA" DosHma_Ptr: dw 1092 - db no_subst ; 0 + db no_subst ; 0 ; "DOS is in low memory" DosLow_Ptr: dw 1093 - db no_subst ; 0 + db no_subst ; 0 ; "Cannot Loadhigh batch file" ;M016 NoExecBat_Ptr: @@ -43915,17 +43918,17 @@ NoCntry_Ptr: ; "LoadHigh: Invalid argument" LhInvArg_Ptr: dw 1097 - db no_subst ; 0 + db no_subst ; 0 ; "Required parameter missing" ReqParmMiss: dw 1098 - db no_subst ; 0 + db no_subst ; 0 ; "Unrecognized switch" LhInvSwt_Ptr: dw 1099 - db no_subst ; 0 + db no_subst ; 0 ; "A bad UMB number has been specified" LhBadUMB_Ptr: @@ -44798,7 +44801,7 @@ Dir_Sw_Ptrs: ; list of ptrs to switch synonyms %if 0 ; 18/06/2023 ; MSDOS 6.0 COMMAND.COM ; * - dw DIR_SW_NEG_C ; * + dw DIR_SW_NEG_C ; * Dir_Sw_Ptrs_2: dw DIR_SW_C ; * ; MSDOS 5.0 COMMAND.COM @@ -44947,7 +44950,7 @@ sCVFRoot: ; 06/08/2024 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9C3Eh REXX_EXE: - db 'REXX.EXE',0 + db 'REXX.EXE',0 %endif ; ---------------------------------------------------------------------------- @@ -45068,7 +45071,7 @@ $P_err_flag: ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9F2Fh ; 13/08/2024 - ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9D23h + ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9D23h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -45185,30 +45188,30 @@ USERDIR1: times DIRSTRLEN+3 db 0 ; 70 ; Storage for users current directory EXECPATH: times COMBUFLEN+3 db 0 ; 131 ; Path for external command RE_INSTR: times DIRSTRLEN+16 db 0 ; 83 ; path for input to redirection -; Variables passed up from resident ; in the Resident portion: (initial values) +; Variables passed up from resident ; in the Resident portion: (initial values) HEADCALL: dw 0 ; TRANVARS (dw THEADFIX) -RESSEG: dw 0 ; MYSEG (dw 0) -TPA: dw 0 ; LTPA (dw 0) +RESSEG: dw 0 ; MYSEG (dw 0) +TPA: dw 0 ; LTPA (dw 0) SWITCHAR: db 0 ; RSWITCHAR (db '-') DIRCHAR: db 0 ; RDIRCHAR (db '/') EXEC_ADDR: - dd 0 ; (dw EXT_EXEC) - ; MYSEG1 (dw 0) + dd 0 ; (dw EXT_EXEC) + ; MYSEG1 (dw 0) RCH_ADDR: - dd 0 ; (dw TREMCHECK) + dd 0 ; (dw TREMCHECK) ; MYSEG2 (dw 0) ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM ; PCDOS 7.1 COMMAND.COM %if 0 - dw 0 ; RESTEST (dw 0) + dw 0 ; RESTEST (dw 0) %endif TRAN_TPA: - dw 0 ; RES_TPA (dw 0) + dw 0 ; RES_TPA (dw 0) CHKDRV: db 0 IFNOTFLAG: @@ -45220,13 +45223,13 @@ Concat: db 0 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM %if 1 notzerofile: - db 0 ; (if 1, destination file size is not zero) + db 0 ; (if 1, destination file size is not zero) %endif PARM2: ArgC: db 0 COMSW: dw 0 ; Switches between command and 1st arg ARG1S: dw 0 ; Switches between 1st and 2nd arg -ARG2S: ; Switches after 2nd arg +ARG2S: ; Switches after 2nd arg DestSwitch: dw 0 ARGTS: @@ -45301,15 +45304,15 @@ FileSizTotal: ccluUsed: dw 0 ; count of DOS clusters used ccluUsedDir: - dw 0 + dw 0 ccluUsedTotal: - dw 0 + dw 0 csecUsed: dd 0 ; count of comp sectors used csecUsedDir: - dd 0 + dd 0 csecUsedTotal: - dd 0 + dd 0 ; Note: keep FileCntTotal through csecUsedTotal together! @@ -45352,7 +45355,7 @@ CHARBUF: DESTFCB2: IDLEN: db 0 ID: times 8 db 0 -COM: times 3 db 0 +COM: times 3 db 0 DEST: times 37 db 0 DESTNAME: times 11 db 0 @@ -45367,7 +45370,7 @@ DIRBUF: times DIRSTRLEN+3 db 0 ; 70 DIRBUF_ATTRIB1 equ DIRBUF+19 ; byte ; INT 21h AH=11h (8+DIR_ENTRY struc) DIRBUF_ATTRIB2 equ DIRBUF+21 ; byte ; INT 21h AH=4Eh (FIND_BUF struc) DIRBUF_FTIME equ DIRBUF+30 ; word -DIRBUF_FDATE equ DIRBUF+32 ; word +DIRBUF_FDATE equ DIRBUF+32 ; word DIRBUF_FSIZ_L equ DIRBUF+36 ; word DIRBUF_FSIZ_H equ DIRBUF+38 ; word @@ -45376,7 +45379,7 @@ DIRBUF_FSIZ_H equ DIRBUF+38 ; word ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0A584h SDIRBUF: - times 12 db 0 + times 12 db 0 _Bits: dw 0 PathCnt: @@ -45401,15 +45404,15 @@ system_cpage: ; 03/08/2024 - PCDOS 7.1 COMMAND.COM %if 0 Arg_Buf: - times 128 db 0 + times 128 db 0 %endif File_Size_Low: - dw 0 + dw 0 File_Size_High: - dw 0 + dw 0 string_ptr_2: - dw 0 + dw 0 Copy_num: dw 0 cpyflag: @@ -45536,7 +45539,7 @@ ELPOS: db 0 ; MSDOS 5.0 SKPDEL: ; 18/06/2023 - db 0 ; MSDOS 6.22 (& MSDOS 5.0) + db 0 ; MSDOS 6.22 (& MSDOS 5.0) SOURCE: times 11 db 0 ext_entered: @@ -45583,7 +45586,7 @@ subst_buffer: times parm_block_size*2 db 0 ; times 22 db 0 ;AN061; ; 15/04/2023 -KPARSE: db 0 ; 3/3/KK +KPARSE: db 0 ; 3/3/KK ; Data declarations taken out of parse.asm @@ -45616,7 +45619,7 @@ ARGV0_ARGSW_WORD: ARGV0_OCOMPTR: dw 0 ARGV1_ARGPOINTER: - dw 0 ; ARGV[1] + dw 0 ; ARGV[1] times 5 db 0 ARGV1_ARGSW_WORD: dw 0 @@ -45740,7 +45743,7 @@ DECIMAL_SEP: DATE_SEP: db 0,0 ; Date separator 2 bytes TIME_SEP: - db 0,0 ; Time separator 2 bytes + db 0,0 ; Time separator 2 bytes BIT_FIELD: db 0 ; Bit values ; Bit 0 = 0 if currency symbol first @@ -45756,7 +45759,7 @@ MAP_CALL: ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED ; in pieces. DATA_SEP: - db 0,0 ; Data list separator character + db 0,0 ; Data list separator character times 8 db 0 @@ -45780,7 +45783,7 @@ CountryPtr: dd 0 OldCtrlCHandler: - dd 0 ; previous int 23 vector + dd 0 ; previous int 23 vector BATLEN equ 32 diff --git a/retrodos5/command/command7.txt b/retrodos5/command/command7.txt index 79c4c6cd..80fb6c19 100644 --- a/retrodos5/command/command7.txt +++ b/retrodos5/command/command7.txt @@ -1,7 +1,7 @@ 1 ; **************************************************************************** 2 ; COMMAND.COM (PCDOS 7.1 Command Interpreter) - RETRO DOS v5.0 by ERDOGAN TAN 3 ; ---------------------------------------------------------------------------- - 4 ; Last Update: 14/08/2024 + 4 ; Last Update: 15/08/2024 5 ; ---------------------------------------------------------------------------- 6 ; Beginning: 18/07/2024 (v7.1) - ((Previous: 19/06/2023 COMMAND.COM v6.22)) 7 ; ---------------------------------------------------------------------------- @@ -2185,7 +2185,7 @@ 2176 00000316 06 push es ; save segments 2177 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM (ds=cs=RESGROUP) 2178 ;push cs - 2179 ;pop ds + 2179 ;pop ds 2180 ;assume ds:RESGROUP 2181 2182 ; M004; Save size of transient here before INIT segment is deallocated @@ -2383,44793 +2383,44796 @@ 2374 ; 21/01/2023 2375 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0398h 2376 000003AC 803E[5420]00 cmp byte [AllocedEnv],0 ; flag - old environment segment - 2377 000003B1 7506 jne short no_free - 2378 - 2379 000003B3 8EC5 mov es,bp - 2380 000003B5 B449 mov ah,49h - 2381 ;mov ah,DEALLOC - 2382 000003B7 CD21 int 21h ; Free it - 2383 no_free: - 2384 - 2385 ; M004; Start of changes - 2386 - 2387 ; Move the transient now. We will allocate the biggest block available - 2388 ; now and move the transient to the top of the block. We will then - 2389 ; deallocate this block. When the resident starts executing, it will - 2390 ; hopefully allocate this block again and find the transient intact. - 2391 - 2392 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2393 ; PCDOS 7.1 COMMAND.COM - 2394 %if 1 - 2395 000003B9 31DB xor bx,bx ; low memory first fit - 2396 000003BB B80158 mov ax,5801h - 2397 000003BE CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 2398 ; AL = function code: set allocation strategy - 2399 000003C0 31DB xor bx,bx ; remove UMBs from DOS memory chain - 2400 000003C2 B80358 mov ax,5803h ; set UMB link state - 2401 000003C5 CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 2402 ; AL = function code: (DOS 5beta) set UMB link state - 2403 %endif - 2404 000003C7 C606[9102]01 mov byte [TrnMvFlg],1 ; Indicate that transient has been moved - 2405 000003CC 06 push es - 2406 ;;mov si,offset ResGroup:TranStart - 2407 ; 09/01/2023 - 2408 ;;mov si,2320h ; MSDOS 5.0 COMMAND.COM RESGROUP:03ABh - 2409 ; 05/06/2023 - 2410 ;mov si,26E0h ; MSDOS 6.22 COMMAND.COM RESGROUP:0475h - 2411 ; 19/07/2024 - 2412 ;mov si,2890h ; PCDOS 7.1 COMMAND.COM RESGROUP:04DDh - 2413 000003CD BED027 mov si,TRANSTART ; (End of the resident portion) - 2414 ;mov di,0 - 2415 000003D0 31FF xor di,di ; 0 - 2416 ;;mov cx,offset TranGroup:TranSpaceEnd ; size to move - 2417 ;mov cx,98C5h - 2418 ; 05/06/2023 - MSDOS 6.22 COMMAND.COM RESGROUP:047Bh - 2419 ;mov cx,0AF95h ; TRANSIENT portion size - 2420 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 2421 ;mov cx,0AA9Ah - 2422 000003D2 B90BA6 mov cx,TRANSPACEEND - 2423 - 2424 ; Find the largest block available - 2425 - 2426 000003D5 BBFFFF mov bx,0FFFFh - 2427 000003D8 B448 mov ah,48h - 2428 ;mov ah,ALLOC - 2429 000003DA CD21 int 21h - 2430 - 2431 ; dx = size of transient saved previously - 2432 - 2433 000003DC 39D3 cmp bx,dx ; enough memory? - 2434 000003DE 722B jb short nomem_err ; not enough memory for transient + 2377 ; !!!! ; 15/08/2024 + 2378 ;jne short no_free ; MSDOS 5.0 COMMAND.COM - RESGROUP:039Dh + 2379 ; PCDOS 7.1 COMMAND.COM - RESGROUP:04C0h + 2380 000003B1 7406 je short no_free ; MSDOS 6.22 COMMAND.COM - RESGROUP:0467h + 2381 + 2382 000003B3 8EC5 mov es,bp + 2383 000003B5 B449 mov ah,49h + 2384 ;mov ah,DEALLOC + 2385 000003B7 CD21 int 21h ; Free it + 2386 no_free: + 2387 + 2388 ; M004; Start of changes + 2389 + 2390 ; Move the transient now. We will allocate the biggest block available + 2391 ; now and move the transient to the top of the block. We will then + 2392 ; deallocate this block. When the resident starts executing, it will + 2393 ; hopefully allocate this block again and find the transient intact. + 2394 + 2395 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2396 ; PCDOS 7.1 COMMAND.COM + 2397 %if 1 + 2398 000003B9 31DB xor bx,bx ; low memory first fit + 2399 000003BB B80158 mov ax,5801h + 2400 000003BE CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 2401 ; AL = function code: set allocation strategy + 2402 000003C0 31DB xor bx,bx ; remove UMBs from DOS memory chain + 2403 000003C2 B80358 mov ax,5803h ; set UMB link state + 2404 000003C5 CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 2405 ; AL = function code: (DOS 5beta) set UMB link state + 2406 %endif + 2407 000003C7 C606[9102]01 mov byte [TrnMvFlg],1 ; Indicate that transient has been moved + 2408 000003CC 06 push es + 2409 ;;mov si,offset ResGroup:TranStart + 2410 ; 09/01/2023 + 2411 ;;mov si,2320h ; MSDOS 5.0 COMMAND.COM RESGROUP:03ABh + 2412 ; 05/06/2023 + 2413 ;mov si,26E0h ; MSDOS 6.22 COMMAND.COM RESGROUP:0475h + 2414 ; 19/07/2024 + 2415 ;mov si,2890h ; PCDOS 7.1 COMMAND.COM RESGROUP:04DDh + 2416 000003CD BED027 mov si,TRANSTART ; (End of the resident portion) + 2417 ;mov di,0 + 2418 000003D0 31FF xor di,di ; 0 + 2419 ;;mov cx,offset TranGroup:TranSpaceEnd ; size to move + 2420 ;mov cx,98C5h + 2421 ; 05/06/2023 - MSDOS 6.22 COMMAND.COM RESGROUP:047Bh + 2422 ;mov cx,0AF95h ; TRANSIENT portion size + 2423 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 2424 ;mov cx,0AA9Ah + 2425 000003D2 B90BA6 mov cx,TRANSPACEEND + 2426 + 2427 ; Find the largest block available + 2428 + 2429 000003D5 BBFFFF mov bx,0FFFFh + 2430 000003D8 B448 mov ah,48h + 2431 ;mov ah,ALLOC + 2432 000003DA CD21 int 21h + 2433 + 2434 ; dx = size of transient saved previously 2435 - 2436 000003E0 B448 mov ah,48h - 2437 ;mov ah,ALLOC - 2438 000003E2 CD21 int 21h ; get the largest block - 2439 000003E4 7225 jc short nomem_err ; something is really screwed up - 2440 - 2441 000003E6 50 push ax ; save memory address - 2442 000003E7 01D8 add ax,bx ; ax = top of my memory block - 2443 000003E9 29D0 sub ax,dx ; less size of transient - 2444 000003EB A3[8F02] mov [TrnSeg],ax ; save transient segment - 2445 000003EE 8EC0 mov es,ax ; - 2446 000003F0 58 pop ax ; restore our seg addr - 2447 - 2448 ; Everything is set for a move. We need to move in the reverse direction to - 2449 ; make sure we dont overwrite ourselves while copying + 2436 000003DC 39D3 cmp bx,dx ; enough memory? + 2437 000003DE 722B jb short nomem_err ; not enough memory for transient + 2438 + 2439 000003E0 B448 mov ah,48h + 2440 ;mov ah,ALLOC + 2441 000003E2 CD21 int 21h ; get the largest block + 2442 000003E4 7225 jc short nomem_err ; something is really screwed up + 2443 + 2444 000003E6 50 push ax ; save memory address + 2445 000003E7 01D8 add ax,bx ; ax = top of my memory block + 2446 000003E9 29D0 sub ax,dx ; less size of transient + 2447 000003EB A3[8F02] mov [TrnSeg],ax ; save transient segment + 2448 000003EE 8EC0 mov es,ax ; + 2449 000003F0 58 pop ax ; restore our seg addr 2450 - 2451 000003F1 01CE add si,cx - 2452 000003F3 4E dec si - 2453 000003F4 01CF add di,cx - 2454 000003F6 4F dec di - 2455 000003F7 FD std - 2456 000003F8 F3A4 rep movsb - 2457 000003FA FC cld - 2458 - 2459 ; Now we have to free up this block so that resident can get hold of it - 2460 - 2461 000003FB 8EC0 mov es,ax - 2462 000003FD B449 mov ah,49h - 2463 ;mov ah,DEALLOC - 2464 000003FF CD21 int 21h ; release the memory block - 2465 - 2466 ; M004; End of changes - 2467 - 2468 ;mov InitFlag,FALSE ; indicate INIT is done - 2469 ; 09/01/2023 - 2470 00000401 C606[1203]00 mov byte [InitFlag],0 - 2471 - 2472 00000406 07 pop es - 2473 00000407 1F pop ds - 2474 ;assume ds:nothing - 2475 - 2476 ; Bugbug: did we need to save & restore seg reg's during EndInit? - 2477 - 2478 00000408 E9D5FC jmp LodCom_Trap ; allocate transient - 2479 - 2480 nomem_err: - 2481 - 2482 ;We call the error routine which will never return. It will either exit - 2483 ;with an error ( if not the first COMMAND ) or just hang after an error - 2484 ;message ( if first COMMAND ) - 2485 - 2486 0000040B E9B21B jmp Alloc_error - 2487 - 2488 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2489 ; --------------------------------------- - 2490 ; PCDOS 7.1 COMMAND.COM - RESGROUP:0520h - 2491 %if 1 - 2492 COMMAND_HIGH: - 2493 0000040E 00 db 0 ; load high status of COMMAND.COM (/H switch) - 2494 %endif - 2495 ; --------------------------------------- - 2496 - 2497 ;EndCodeInit: ; label byte ; M004 - 2498 - 2499 ; 16/04/2023 - 2500 EndCodeInit equ $ + 2451 ; Everything is set for a move. We need to move in the reverse direction to + 2452 ; make sure we dont overwrite ourselves while copying + 2453 + 2454 000003F1 01CE add si,cx + 2455 000003F3 4E dec si + 2456 000003F4 01CF add di,cx + 2457 000003F6 4F dec di + 2458 000003F7 FD std + 2459 000003F8 F3A4 rep movsb + 2460 000003FA FC cld + 2461 + 2462 ; Now we have to free up this block so that resident can get hold of it + 2463 + 2464 000003FB 8EC0 mov es,ax + 2465 000003FD B449 mov ah,49h + 2466 ;mov ah,DEALLOC + 2467 000003FF CD21 int 21h ; release the memory block + 2468 + 2469 ; M004; End of changes + 2470 + 2471 ;mov InitFlag,FALSE ; indicate INIT is done + 2472 ; 09/01/2023 + 2473 00000401 C606[1203]00 mov byte [InitFlag],0 + 2474 + 2475 00000406 07 pop es + 2476 00000407 1F pop ds + 2477 ;assume ds:nothing + 2478 + 2479 ; Bugbug: did we need to save & restore seg reg's during EndInit? + 2480 + 2481 00000408 E9D5FC jmp LodCom_Trap ; allocate transient + 2482 + 2483 nomem_err: + 2484 + 2485 ;We call the error routine which will never return. It will either exit + 2486 ;with an error ( if not the first COMMAND ) or just hang after an error + 2487 ;message ( if first COMMAND ) + 2488 + 2489 0000040B E9B21B jmp Alloc_error + 2490 + 2491 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2492 ; --------------------------------------- + 2493 ; PCDOS 7.1 COMMAND.COM - RESGROUP:0520h + 2494 %if 1 + 2495 COMMAND_HIGH: + 2496 0000040E 00 db 0 ; load high status of COMMAND.COM (/H switch) + 2497 %endif + 2498 ; --------------------------------------- + 2499 + 2500 ;EndCodeInit: ; label byte ; M004 2501 - 2502 ;; M004; Check if the EndInit code will fit into the Pipe buffers above. - 2503 ;; M004; If not, we signal an assembly error - 2504 ; - 2505 ;IF2 - 2506 ; IF ($ GT EndPipe) - 2507 ; .err - 2508 ; %out "ENDINIT CODE TOO BIG" - 2509 ; ENDIF - 2510 ;ENDIF - 2511 - 2512 ;; M004; Set the origin back to what it was at the end of the buffers - 2513 ;; - 2514 ; ORG EndPipe ; M004 - 2515 - 2516 ; 09/01/2023 - 2517 ; MSDOS 5.0 COMMAND.COM - CODERES:03EDh - 2518 ; 05/06/2023 - 2519 ; MSDOS 6.22 COMMAND.COM - CODERES:04B7h - 2520 ; times 84 db 0 ; db (EndPipe-EndCodeInit) dup(0) - 2521 - 2522 ; 16/04/2023 - 2523 FillBytes equ EndPipe - EndCodeInit + 2502 ; 16/04/2023 + 2503 EndCodeInit equ $ + 2504 + 2505 ;; M004; Check if the EndInit code will fit into the Pipe buffers above. + 2506 ;; M004; If not, we signal an assembly error + 2507 ; + 2508 ;IF2 + 2509 ; IF ($ GT EndPipe) + 2510 ; .err + 2511 ; %out "ENDINIT CODE TOO BIG" + 2512 ; ENDIF + 2513 ;ENDIF + 2514 + 2515 ;; M004; Set the origin back to what it was at the end of the buffers + 2516 ;; + 2517 ; ORG EndPipe ; M004 + 2518 + 2519 ; 09/01/2023 + 2520 ; MSDOS 5.0 COMMAND.COM - CODERES:03EDh + 2521 ; 05/06/2023 + 2522 ; MSDOS 6.22 COMMAND.COM - CODERES:04B7h + 2523 ; times 84 db 0 ; db (EndPipe-EndCodeInit) dup(0) 2524 - 2525 ;%if EndCodeInit0 - 2528 ;times EndPipe - EndCodeInit db 0 - 2529 0000040F 00 times FillBytes db 0 - 2530 %endif - 2531 - 2532 ; 09/01/2023 - Retrodos v4.0 (& v4.1) - 2533 ; MSDOS 5.0 COMMAND.COM - CODERES:0441h ; EndInit+289 + 2525 ; 16/04/2023 + 2526 FillBytes equ EndPipe - EndCodeInit + 2527 + 2528 ;%if EndCodeInit0 + 2531 ;times EndPipe - EndCodeInit db 0 + 2532 0000040F 00 times FillBytes db 0 + 2533 %endif 2534 - 2535 ; 05/06/2023 - Retrodos v4.2 - 2536 ; MSDOS 6.22 COMMAND.COM - CODERES:050Bh ; EndInit+289 + 2535 ; 09/01/2023 - Retrodos v4.0 (& v4.1) + 2536 ; MSDOS 5.0 COMMAND.COM - CODERES:0441h ; EndInit+289 2537 - 2538 ; 19/07/2024 - Retrodos v5.0 COMMAND.COM - 2539 ; PCDOS 7.1 COMMAND.COM - CODERES:053Fh ; EndInit+289 + 2538 ; 05/06/2023 - Retrodos v4.2 + 2539 ; MSDOS 6.22 COMMAND.COM - CODERES:050Bh ; EndInit+289 2540 - 2541 ;InPipePtr dw offset DATARES:Pipe1 ; 320h - 2542 ;OutPipePtr dw offset DATARES:Pipe2 ; 36Fh + 2541 ; 19/07/2024 - Retrodos v5.0 COMMAND.COM + 2542 ; PCDOS 7.1 COMMAND.COM - CODERES:053Fh ; EndInit+289 2543 - 2544 00000436 [1503] InPipePtr: dw Pipe1 ;; 320h for MSDOS 5.0 COMMAND.COM - 2545 ; 3EAh for MSDOS 6.22 COMMAND.COM - 2546 ; 19/07/2024 ; 41Eh for PCDOS 7.1 COMMAND.COM - 2547 00000438 [6403] OutPipePtr: dw Pipe2 ;; 36Fh for MSDOS 5.0 COMMAND.COM - 2548 ; 439h for MSDOS 6.22 COMMAND.COM - 2549 ; 19/07/2024 ; 46Dh for PCDOS 7.1 COMMAND.COM - 2550 - 2551 Exec_Block: ; label byte ; the data block for exec calls - 2552 0000043A 0000 EnvirSeg: dw 0 - 2553 Com_Ptr: ; label dword - 2554 0000043C 8000 dw 80h ; point at unformatted parameters - 2555 0000043E 0000 dw 0 - 2556 Com_Fcb1: ; label dword - 2557 00000440 5C00 dw 5Ch - 2558 00000442 0000 dw 0 - 2559 Com_Fcb2: ; label dword - 2560 00000444 6C00 dw 6Ch - 2561 00000446 0000 dw 0 - 2562 - 2563 ; variables passed to transient - 2564 TranVars: ; label byte - 2565 ;dw offset DATARES:HeadFix_Trap - 2566 00000448 [F400] dw HeadFix_Trap - 2567 0000044A 0000 MySeg: dw 0 ; put our own segment here - 2568 0000044C 0000 LTpa: dw 0 ; will store tpa segment here - 2569 0000044E 2F RSwitChar: db "/" - 2570 0000044F 5C RDirChar: db "\" - 2571 ;dw offset DATARES:Issue_Exec_Call - 2572 00000450 [E701] dw Issue_Exec_Call - 2573 00000452 0000 MySeg1: dw 0 - 2574 ;dw offset DATARES:RemCheck_Trap - 2575 00000454 [CC00] dw RemCheck_Trap - 2576 00000456 0000 MySeg2: dw 0 - 2577 - 2578 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2579 ; PCDOS 7.1 COMMAND.COM - 2580 %if 0 - 2581 ResTest: dw 0 - 2582 %endif - 2583 - 2584 ; PCDOS 7.1 COMMAND.COM - RESGROUP:0561h - 2585 - 2586 00000458 0000 Res_Tpa: dw 0 ; original tpa (not rounded to 64k) - 2587 - 2588 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 2589 0000045A 0000 Y_Flag: dw 0 + 2544 ;InPipePtr dw offset DATARES:Pipe1 ; 320h + 2545 ;OutPipePtr dw offset DATARES:Pipe2 ; 36Fh + 2546 + 2547 00000436 [1503] InPipePtr: dw Pipe1 ;; 320h for MSDOS 5.0 COMMAND.COM + 2548 ; 3EAh for MSDOS 6.22 COMMAND.COM + 2549 ; 19/07/2024 ; 41Eh for PCDOS 7.1 COMMAND.COM + 2550 00000438 [6403] OutPipePtr: dw Pipe2 ;; 36Fh for MSDOS 5.0 COMMAND.COM + 2551 ; 439h for MSDOS 6.22 COMMAND.COM + 2552 ; 19/07/2024 ; 46Dh for PCDOS 7.1 COMMAND.COM + 2553 + 2554 Exec_Block: ; label byte ; the data block for exec calls + 2555 0000043A 0000 EnvirSeg: dw 0 + 2556 Com_Ptr: ; label dword + 2557 0000043C 8000 dw 80h ; point at unformatted parameters + 2558 0000043E 0000 dw 0 + 2559 Com_Fcb1: ; label dword + 2560 00000440 5C00 dw 5Ch + 2561 00000442 0000 dw 0 + 2562 Com_Fcb2: ; label dword + 2563 00000444 6C00 dw 6Ch + 2564 00000446 0000 dw 0 + 2565 + 2566 ; variables passed to transient + 2567 TranVars: ; label byte + 2568 ;dw offset DATARES:HeadFix_Trap + 2569 00000448 [F400] dw HeadFix_Trap + 2570 0000044A 0000 MySeg: dw 0 ; put our own segment here + 2571 0000044C 0000 LTpa: dw 0 ; will store tpa segment here + 2572 0000044E 2F RSwitChar: db "/" + 2573 0000044F 5C RDirChar: db "\" + 2574 ;dw offset DATARES:Issue_Exec_Call + 2575 00000450 [E701] dw Issue_Exec_Call + 2576 00000452 0000 MySeg1: dw 0 + 2577 ;dw offset DATARES:RemCheck_Trap + 2578 00000454 [CC00] dw RemCheck_Trap + 2579 00000456 0000 MySeg2: dw 0 + 2580 + 2581 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2582 ; PCDOS 7.1 COMMAND.COM + 2583 %if 0 + 2584 ResTest: dw 0 + 2585 %endif + 2586 + 2587 ; PCDOS 7.1 COMMAND.COM - RESGROUP:0561h + 2588 + 2589 00000458 0000 Res_Tpa: dw 0 ; original tpa (not rounded to 64k) 2590 - 2591 TranVarEnd: ; label byte - 2592 - 2593 0000045C 0000 OldErrNo: dw 0 - 2594 - 2595 ;* NOTE: MsgBuffer and SafePathBuffer use the same memory. - 2596 ; MsgBuffer is only used while a command is being executed. - 2597 ; SafePathBuffer is no longer needed, since it is used for - 2598 ; unsuccessful program launches. - 2599 - 2600 MsgBuffer: ; label byte ; buffer for messages from disk - 2601 SafePathBuffer: ; label byte ; resident pathname for EXEC - 2602 ;Bugbug: Why so big a buffer? - 2603 ;db 64+3+13 dup (0) ; path + 'd:\' 'file.ext' + null - 2604 0000045E 00 times 64+3+13 db 0 - 2605 - 2606 LENMSGORPATHBUF equ $ - MsgBuffer - 2607 - 2608 000004AE 00000000 Int2fHandler: dd 0 ; address of next int 2f handler - 2609 000004B2 0000 ResMsgEnd: dw 0 ; holds offset of msg end (end of resident) + 2591 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 2592 0000045A 0000 Y_Flag: dw 0 + 2593 + 2594 TranVarEnd: ; label byte + 2595 + 2596 0000045C 0000 OldErrNo: dw 0 + 2597 + 2598 ;* NOTE: MsgBuffer and SafePathBuffer use the same memory. + 2599 ; MsgBuffer is only used while a command is being executed. + 2600 ; SafePathBuffer is no longer needed, since it is used for + 2601 ; unsuccessful program launches. + 2602 + 2603 MsgBuffer: ; label byte ; buffer for messages from disk + 2604 SafePathBuffer: ; label byte ; resident pathname for EXEC + 2605 ;Bugbug: Why so big a buffer? + 2606 ;db 64+3+13 dup (0) ; path + 'd:\' 'file.ext' + null + 2607 0000045E 00 times 64+3+13 db 0 + 2608 + 2609 LENMSGORPATHBUF equ $ - MsgBuffer 2610 - 2611 ;SR; - 2612 ; The three vars below have been added for a pure COMMAND.COM + 2611 000004AE 00000000 Int2fHandler: dd 0 ; address of next int 2f handler + 2612 000004B2 0000 ResMsgEnd: dw 0 ; holds offset of msg end (end of resident) 2613 - 2614 000004B4 0000 ResSize: dw 0 - 2615 - 2616 ;SR; - 2617 ; Moved the stack here from the code segment - 2618 ; - 2619 ; bugbug: Why this odd stack size? And what should stack size be? - 2620 - 2621 ;db (80h - 3) dup (?) - 2622 ;align 2 - 2623 ;times 124 db 0 - 2624 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - RESGROUP:05BFh - 2625 000004B6 00 times 120 db 0 - 2626 - 2627 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2628 align 2 - 2629 - 2630 ; MSDOS 5.0 COMMAND.COM - RESGROUP:053Eh (offset RStack) - 2631 ; 05/06/2023 - 2632 ; MSDOS 6.22 COMMAND.COM - RESGROUP:060Ah (offset RStack) - 2633 ; 19/07/2024 - 2634 ; PCDOS 7.1 COMMAND.COM - RESGROUP:0637h (offset RStack) - 2635 - 2636 RStack: ; label word - 2637 0000052E 0000 OldDS: dw 0 ; keeps old ds value when jumping to - 2638 ; resident code segments - 2639 ;LoadHiFlg db 0 ; Flag set to 1 if UMB loading enabled ; M003 - 2640 - 2641 ; include highvar.inc ; Add variables for 6.0 loadhigh functionality - 2642 ; ------------------------------- + 2614 ;SR; + 2615 ; The three vars below have been added for a pure COMMAND.COM + 2616 + 2617 000004B4 0000 ResSize: dw 0 + 2618 + 2619 ;SR; + 2620 ; Moved the stack here from the code segment + 2621 ; + 2622 ; bugbug: Why this odd stack size? And what should stack size be? + 2623 + 2624 ;db (80h - 3) dup (?) + 2625 ;align 2 + 2626 ;times 124 db 0 + 2627 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - RESGROUP:05BFh + 2628 000004B6 00 times 120 db 0 + 2629 + 2630 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2631 align 2 + 2632 + 2633 ; MSDOS 5.0 COMMAND.COM - RESGROUP:053Eh (offset RStack) + 2634 ; 05/06/2023 + 2635 ; MSDOS 6.22 COMMAND.COM - RESGROUP:060Ah (offset RStack) + 2636 ; 19/07/2024 + 2637 ; PCDOS 7.1 COMMAND.COM - RESGROUP:0637h (offset RStack) + 2638 + 2639 RStack: ; label word + 2640 0000052E 0000 OldDS: dw 0 ; keeps old ds value when jumping to + 2641 ; resident code segments + 2642 ;LoadHiFlg db 0 ; Flag set to 1 if UMB loading enabled ; M003 2643 - 2644 ; fInHigh - Is set to 1 during HideUMBs(), and back to zero in UnHideUMBs(). - 2645 ; fUmbTiny - Is set to 1 if the user has specified /S on the command line. - 2646 ; SegLoad - Segment address for first UMB specified; set automatically. - 2647 ; UmbLoad - The load UMB number; for example, this is 3 if the user has - 2648 ; given a command-line like "/L:3,500;4" - 2649 ; UmbUsed - An array of characters, each of which is 1 iff the UMB - 2650 ; matching its index number was specified on the command-line; - 2651 ; for example, after "/L:3,500;4;7", UmbUsed[3], [4] and [7] - 2652 ; will be set to 1. All others will be set to 0. - 2653 ; UmbSize - An array of words, each of which is interpereted as a size - 2654 ; specified by the user for a UMB (in the above example, all - 2655 ; elements would be zero save UmbSize[3], which would be 500. - 2656 ; fm_umb - Set to the old UMB link-state (0x80 or 0x00) - 2657 ; fm_strat - Set to the old memory-allocation strategy (0$00000???) - 2658 ; fm_argc - Number of arguments received by ParseVar() (see ParseVar() - 2659 ; for details). - 2660 - 2661 ; - MSDOS 6.0 COMMAND.COM - - 2662 ;; To keep track of which UMBs were specified on the DH/LH command lines, and - 2663 ;; to keep track of the minimum sizes given for each, there're two arrays kept - 2664 ;; in { IO.SYS: sysinitseg / COMMAND.COM: DATARES }... each is MAXUMB elements - 2665 ;; big. 16 should be around 14 too many for most users, so there's no expected - 2666 ;; space problem (it's just such a nice round number, eh?). - 2667 - 2668 ; 05/06/2023 - 2669 MAXUMB equ 16 + 2644 ; include highvar.inc ; Add variables for 6.0 loadhigh functionality + 2645 ; ------------------------------- + 2646 + 2647 ; fInHigh - Is set to 1 during HideUMBs(), and back to zero in UnHideUMBs(). + 2648 ; fUmbTiny - Is set to 1 if the user has specified /S on the command line. + 2649 ; SegLoad - Segment address for first UMB specified; set automatically. + 2650 ; UmbLoad - The load UMB number; for example, this is 3 if the user has + 2651 ; given a command-line like "/L:3,500;4" + 2652 ; UmbUsed - An array of characters, each of which is 1 iff the UMB + 2653 ; matching its index number was specified on the command-line; + 2654 ; for example, after "/L:3,500;4;7", UmbUsed[3], [4] and [7] + 2655 ; will be set to 1. All others will be set to 0. + 2656 ; UmbSize - An array of words, each of which is interpereted as a size + 2657 ; specified by the user for a UMB (in the above example, all + 2658 ; elements would be zero save UmbSize[3], which would be 500. + 2659 ; fm_umb - Set to the old UMB link-state (0x80 or 0x00) + 2660 ; fm_strat - Set to the old memory-allocation strategy (0$00000???) + 2661 ; fm_argc - Number of arguments received by ParseVar() (see ParseVar() + 2662 ; for details). + 2663 + 2664 ; - MSDOS 6.0 COMMAND.COM - + 2665 ;; To keep track of which UMBs were specified on the DH/LH command lines, and + 2666 ;; to keep track of the minimum sizes given for each, there're two arrays kept + 2667 ;; in { IO.SYS: sysinitseg / COMMAND.COM: DATARES }... each is MAXUMB elements + 2668 ;; big. 16 should be around 14 too many for most users, so there's no expected + 2669 ;; space problem (it's just such a nice round number, eh?). 2670 - 2671 ; 10/01/2023 - Retro DOS v4.0 COMMAND.COM - 2672 ; MSDOS 5.0 COMMAND.COM RESGROUP:0540h (DATARES:0540h) + 2671 ; 05/06/2023 + 2672 MAXUMB equ 16 2673 - 2674 00000530 00 fInHigh: db 0 - 2675 - 2676 ; MSDOS 6.0 COMMAND.COM - 2677 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 2678 ; MSDOS 6.22 COMMAND.COM RESGROUP:060Dh (DATARES:060Dh) - 2679 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2680 ; PCDOS 7.1 COMMAND.COM - RESGROUP:063Ah (DATARES:063Ah) - 2681 - 2682 00000531 00 fUmbTiny: db 0 - 2683 00000532 0000 SegLoad: dw 0 - 2684 00000534 00 UmbLoad: db 0 - 2685 - 2686 ; 19/07/2024 - 2687 ; PCDOS 7.1 COMMAND.COM - 2688 %if 0 - 2689 UmbUsed: times MAXUMB db 0 ; db MAXUMB dup (?) - 2690 UmbSize: times MAXUMB dw 0 ; dw MAXUMB dup (?) - 2691 %else - 2692 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2693 UmbUsed equ MsgBuffer ; 16 bytes - 2694 UmbSize equ UmbUsed+MAXUMB ; UmbUsed+16; 16 words - 2695 %endif - 2696 - 2697 00000535 00 fm_umb: db 0 - 2698 00000536 00 fm_strat: db 0 - 2699 00000537 00 fm_argc: db 0 - 2700 - 2701 ; UmbLoad is set to UNSPECIFED, below, until /L:umb is read; at which point - 2702 ; UmbLoad is set to the UMB number given. + 2674 ; 10/01/2023 - Retro DOS v4.0 COMMAND.COM + 2675 ; MSDOS 5.0 COMMAND.COM RESGROUP:0540h (DATARES:0540h) + 2676 + 2677 00000530 00 fInHigh: db 0 + 2678 + 2679 ; MSDOS 6.0 COMMAND.COM + 2680 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 2681 ; MSDOS 6.22 COMMAND.COM RESGROUP:060Dh (DATARES:060Dh) + 2682 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2683 ; PCDOS 7.1 COMMAND.COM - RESGROUP:063Ah (DATARES:063Ah) + 2684 + 2685 00000531 00 fUmbTiny: db 0 + 2686 00000532 0000 SegLoad: dw 0 + 2687 00000534 00 UmbLoad: db 0 + 2688 + 2689 ; 19/07/2024 + 2690 ; PCDOS 7.1 COMMAND.COM + 2691 %if 0 + 2692 UmbUsed: times MAXUMB db 0 ; db MAXUMB dup (?) + 2693 UmbSize: times MAXUMB dw 0 ; dw MAXUMB dup (?) + 2694 %else + 2695 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2696 UmbUsed equ MsgBuffer ; 16 bytes + 2697 UmbSize equ UmbUsed+MAXUMB ; UmbUsed+16; 16 words + 2698 %endif + 2699 + 2700 00000535 00 fm_umb: db 0 + 2701 00000536 00 fm_strat: db 0 + 2702 00000537 00 fm_argc: db 0 2703 - 2704 ;*** MESSAGES - 2705 ; and other translatable text + 2704 ; UmbLoad is set to UNSPECIFED, below, until /L:umb is read; at which point + 2705 ; UmbLoad is set to the UMB number given. 2706 - 2707 ; include comrmsg.inc ; M00 - 2708 ; ------------------------------ + 2707 ;*** MESSAGES + 2708 ; and other translatable text 2709 - 2710 ; 10/01/2023 - Retro DOS v4.0 COMMAND.COM - 2711 ; MSDOS 5.0 COMMAND.COM RESGROUP:0541h (DATARES:0541h) + 2710 ; include comrmsg.inc ; M00 + 2711 ; ------------------------------ 2712 - 2713 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 2714 ; MSDOS 6.22 COMMAND.COM RESGROUP:0644h (DATARES:0644h) + 2713 ; 10/01/2023 - Retro DOS v4.0 COMMAND.COM + 2714 ; MSDOS 5.0 COMMAND.COM RESGROUP:0541h (DATARES:0541h) 2715 - 2716 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 2717 ; PCDOS 7.1 COMMAND.COM RESGROUP:0641h (DATARES:0641h) + 2716 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 2717 ; MSDOS 6.22 COMMAND.COM RESGROUP:0644h (DATARES:0644h) 2718 - 2719 00000538 41 ABORT_CHAR: db 'A' - 2720 00000539 52 RETRY_CHAR: db 'R' - 2721 0000053A 49 IGNORE_CHAR: db 'I' - 2722 0000053B 46 FAIL_CHAR: db 'F' - 2723 0000053C 59 YES_CHAR: db 'Y' - 2724 0000053D 4E NO_CHAR: db 'N' - 2725 0000053E 05 REQ_ABORT: db 5 - 2726 0000053F 41626F7274 db 'Abort' - 2727 00000544 07 REQ_RETRY: db 7 - 2728 00000545 2C205265747279 db ', Retry' - 2729 0000054C 08 REQ_IGNORE: db 8 - 2730 0000054D 2C2049676E6F7265 db ', Ignore' - 2731 00000555 06 REQ_FAIL: db 6 - 2732 00000556 2C204661696C db ', Fail' - 2733 0000055C 01 REQ_END: db 1 - 2734 0000055D 3F db '?' - 2735 0000055E 08 MREAD: db 8 - 2736 0000055F 72656164696E6700 db 'reading', 0 - 2737 00000567 08 MWRITE: db 8 - 2738 00000568 77726974696E6700 db 'writing', 0 - 2739 00000570 0E MDRIVE: db 14 - 2740 00000571 202531206472697665- db ' %1 drive %2',0Dh,0Ah - 2740 0000057A 2025320D0A - 2741 0000057F 0F MDEVICE: db 15 - 2742 00000580 202531206465766963- db ' %1 device %2',0Dh,0Ah - 2742 00000589 652025320D0A - 2743 0000058F 26 MVOLSERIAL: db 38 - 2744 00000590 506C6561736520696E- db 'Please insert volume %1 serial %2-%3',0Dh,0Ah - 2744 00000599 7365727420766F6C75- - 2744 000005A2 6D6520253120736572- - 2744 000005AB 69616C2025322D2533- - 2744 000005B4 0D0A - 2745 000005B6 25 BADFATMSG: db 37 - 2746 000005B7 46696C6520616C6C6F- db 'File allocation table bad, drive %1',0Dh,0Ah - 2746 000005C0 636174696F6E207461- - 2746 000005C9 626C65206261642C20- - 2746 000005D2 64726976652025310D- - 2746 000005DB 0A - 2747 000005DC 15 COMBAD: db 21 - 2748 000005DD 496E76616C69642043- db 'Invalid COMMAND.COM',0Dh,0Ah - 2748 000005E6 4F4D4D414E442E434F- - 2748 000005EF 4D0D0A - 2749 000005F2 21 PUTBACKMSG: db 33 - 2750 000005F3 496E73657274206469- db 'Insert disk with %1 in drive %2',0Dh,0Ah - 2750 000005FC 736B20776974682025- - 2750 00000605 3120696E2064726976- - 2750 0000060E 652025320D0A - 2751 00000614 21 PROMPT: db 33 - 2752 00000615 507265737320616E79- db 'Press any key to continue . . .',0Dh,0Ah - 2752 0000061E 206B657920746F2063- - 2752 00000627 6F6E74696E7565202E- - 2752 00000630 202E202E0D0A - 2753 00000636 1C ENDBATMES: db 28 - 2754 00000637 0D0A db 0Dh,0Ah - 2755 00000639 5465726D696E617465- db 'Terminate batch job (Y/N)?' - 2755 00000642 206261746368206A6F- - 2755 0000064B 622028592F4E293F - 2756 00000653 13 EXECEMES: db 19 - 2757 00000654 43616E6E6F74206578- db 'Cannot execute %1',0Dh,0Ah - 2757 0000065D 65637574652025310D- - 2757 00000666 0A - 2758 00000667 13 EXEBAD: db 19 - 2759 00000668 4572726F7220696E20- db 'Error in EXE file',0Dh,0Ah - 2759 00000671 4558452066696C650D- - 2759 0000067A 0A - 2760 0000067B 22 TOOBIG: db 34 - 2761 0000067C 50726F6772616D2074- db 'Program too big to fit in memory',0Dh,0Ah - 2761 00000685 6F6F2062696720746F- - 2761 0000068E 2066697420696E206D- - 2761 00000697 656D6F72790D0A - 2762 0000069E 16 NOHANDMES: db 22 - 2763 0000069F 0D0A db 0Dh,0Ah - 2764 000006A1 4E6F20667265652066- db 'No free file handles' - 2764 000006AA 696C652068616E646C- - 2764 000006B3 6573 - 2765 000006B5 1A RBADNAM: db 26 - 2766 000006B6 42616420436F6D6D61- db 'Bad Command or file name',0Dh,0Ah - 2766 000006BF 6E64206F722066696C- - 2766 000006C8 65206E616D650D0A - 2767 ACCDENIED: ; 14/01/2023 - 2768 ; 10/01/2023 - 2769 ACCDEN: ;db 14 - 2770 ;db 'Access denied ' - 2771 ; 19/07/2024 - PCDOS 7.1 - 2772 000006D0 0D db 13 - 2773 000006D1 416363657373206465- db 'Access denied' - 2773 000006DA 6E696564 - 2774 000006DE 19 BMEMMES: db 25 - 2775 000006DF 0D0A4D656D6F727920- db 0Dh,0Ah,'Memory allocation error' - 2775 000006E8 616C6C6F636174696F- - 2775 000006F1 6E206572726F72 - 2776 000006F8 26 HALTMES: db 38 - 2777 000006F9 0D0A db 0Dh,0Ah - 2778 000006FB 43616E6E6F74206C6F- db 'Cannot load COMMAND, system halted',0Dh,0Ah - 2778 00000704 616420434F4D4D414E- - 2778 0000070D 442C2073797374656D- - 2778 00000716 2068616C7465640D0A - 2779 0000071F 21 FRETMES: db 33 - 2780 00000720 0D0A db 0Dh,0Ah, - 2781 00000722 43616E6E6F74207374- db 'Cannot start COMMAND, exiting',0Dh,0Ah - 2781 0000072B 61727420434F4D4D41- - 2781 00000734 4E442C206578697469- - 2781 0000073D 6E670D0A - 2782 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 2783 %if 0 - 2784 ;%if 1 ; 20/07/2024 - Retro DOS v5.1 COMMAND.COM - 2785 PATRICIDE: db 46 - 2786 db 0Dh,0Ah - 2787 db 'Top level process aborted, cannot continue' - 2788 db 0Dh,0Ah - 2789 %endif - 2790 00000741 02 NEWLINE: db 2 - 2791 00000742 0D0A db 0Dh, 0Ah - 2792 - 2793 ; 10/01/2023 - 2794 ;; MSDOS 5.0 COMMAND.COM RESGROUP:077Dh - 2795 ; 05/06/2023 - 2796 ; MSDOS 6.22 COMMAND.COM RESGROUP:0880h - 2797 - 2798 ; 19/07/2024 - 2799 ; PCDOS 7.1 COMMAND.COM RESGROUP:0832h + 2719 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 2720 ; PCDOS 7.1 COMMAND.COM RESGROUP:0641h (DATARES:0641h) + 2721 + 2722 00000538 41 ABORT_CHAR: db 'A' + 2723 00000539 52 RETRY_CHAR: db 'R' + 2724 0000053A 49 IGNORE_CHAR: db 'I' + 2725 0000053B 46 FAIL_CHAR: db 'F' + 2726 0000053C 59 YES_CHAR: db 'Y' + 2727 0000053D 4E NO_CHAR: db 'N' + 2728 0000053E 05 REQ_ABORT: db 5 + 2729 0000053F 41626F7274 db 'Abort' + 2730 00000544 07 REQ_RETRY: db 7 + 2731 00000545 2C205265747279 db ', Retry' + 2732 0000054C 08 REQ_IGNORE: db 8 + 2733 0000054D 2C2049676E6F7265 db ', Ignore' + 2734 00000555 06 REQ_FAIL: db 6 + 2735 00000556 2C204661696C db ', Fail' + 2736 0000055C 01 REQ_END: db 1 + 2737 0000055D 3F db '?' + 2738 0000055E 08 MREAD: db 8 + 2739 0000055F 72656164696E6700 db 'reading', 0 + 2740 00000567 08 MWRITE: db 8 + 2741 00000568 77726974696E6700 db 'writing', 0 + 2742 00000570 0E MDRIVE: db 14 + 2743 00000571 202531206472697665- db ' %1 drive %2',0Dh,0Ah + 2743 0000057A 2025320D0A + 2744 0000057F 0F MDEVICE: db 15 + 2745 00000580 202531206465766963- db ' %1 device %2',0Dh,0Ah + 2745 00000589 652025320D0A + 2746 0000058F 26 MVOLSERIAL: db 38 + 2747 00000590 506C6561736520696E- db 'Please insert volume %1 serial %2-%3',0Dh,0Ah + 2747 00000599 7365727420766F6C75- + 2747 000005A2 6D6520253120736572- + 2747 000005AB 69616C2025322D2533- + 2747 000005B4 0D0A + 2748 000005B6 25 BADFATMSG: db 37 + 2749 000005B7 46696C6520616C6C6F- db 'File allocation table bad, drive %1',0Dh,0Ah + 2749 000005C0 636174696F6E207461- + 2749 000005C9 626C65206261642C20- + 2749 000005D2 64726976652025310D- + 2749 000005DB 0A + 2750 000005DC 15 COMBAD: db 21 + 2751 000005DD 496E76616C69642043- db 'Invalid COMMAND.COM',0Dh,0Ah + 2751 000005E6 4F4D4D414E442E434F- + 2751 000005EF 4D0D0A + 2752 000005F2 21 PUTBACKMSG: db 33 + 2753 000005F3 496E73657274206469- db 'Insert disk with %1 in drive %2',0Dh,0Ah + 2753 000005FC 736B20776974682025- + 2753 00000605 3120696E2064726976- + 2753 0000060E 652025320D0A + 2754 00000614 21 PROMPT: db 33 + 2755 00000615 507265737320616E79- db 'Press any key to continue . . .',0Dh,0Ah + 2755 0000061E 206B657920746F2063- + 2755 00000627 6F6E74696E7565202E- + 2755 00000630 202E202E0D0A + 2756 00000636 1C ENDBATMES: db 28 + 2757 00000637 0D0A db 0Dh,0Ah + 2758 00000639 5465726D696E617465- db 'Terminate batch job (Y/N)?' + 2758 00000642 206261746368206A6F- + 2758 0000064B 622028592F4E293F + 2759 00000653 13 EXECEMES: db 19 + 2760 00000654 43616E6E6F74206578- db 'Cannot execute %1',0Dh,0Ah + 2760 0000065D 65637574652025310D- + 2760 00000666 0A + 2761 00000667 13 EXEBAD: db 19 + 2762 00000668 4572726F7220696E20- db 'Error in EXE file',0Dh,0Ah + 2762 00000671 4558452066696C650D- + 2762 0000067A 0A + 2763 0000067B 22 TOOBIG: db 34 + 2764 0000067C 50726F6772616D2074- db 'Program too big to fit in memory',0Dh,0Ah + 2764 00000685 6F6F2062696720746F- + 2764 0000068E 2066697420696E206D- + 2764 00000697 656D6F72790D0A + 2765 0000069E 16 NOHANDMES: db 22 + 2766 0000069F 0D0A db 0Dh,0Ah + 2767 000006A1 4E6F20667265652066- db 'No free file handles' + 2767 000006AA 696C652068616E646C- + 2767 000006B3 6573 + 2768 000006B5 1A RBADNAM: db 26 + 2769 000006B6 42616420436F6D6D61- db 'Bad Command or file name',0Dh,0Ah + 2769 000006BF 6E64206F722066696C- + 2769 000006C8 65206E616D650D0A + 2770 ACCDENIED: ; 14/01/2023 + 2771 ; 10/01/2023 + 2772 ACCDEN: ;db 14 + 2773 ;db 'Access denied ' + 2774 ; 19/07/2024 - PCDOS 7.1 + 2775 000006D0 0D db 13 + 2776 000006D1 416363657373206465- db 'Access denied' + 2776 000006DA 6E696564 + 2777 000006DE 19 BMEMMES: db 25 + 2778 000006DF 0D0A4D656D6F727920- db 0Dh,0Ah,'Memory allocation error' + 2778 000006E8 616C6C6F636174696F- + 2778 000006F1 6E206572726F72 + 2779 000006F8 26 HALTMES: db 38 + 2780 000006F9 0D0A db 0Dh,0Ah + 2781 000006FB 43616E6E6F74206C6F- db 'Cannot load COMMAND, system halted',0Dh,0Ah + 2781 00000704 616420434F4D4D414E- + 2781 0000070D 442C2073797374656D- + 2781 00000716 2068616C7465640D0A + 2782 0000071F 21 FRETMES: db 33 + 2783 00000720 0D0A db 0Dh,0Ah, + 2784 00000722 43616E6E6F74207374- db 'Cannot start COMMAND, exiting',0Dh,0Ah + 2784 0000072B 61727420434F4D4D41- + 2784 00000734 4E442C206578697469- + 2784 0000073D 6E670D0A + 2785 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 2786 %if 0 + 2787 ;%if 1 ; 20/07/2024 - Retro DOS v5.1 COMMAND.COM + 2788 PATRICIDE: db 46 + 2789 db 0Dh,0Ah + 2790 db 'Top level process aborted, cannot continue' + 2791 db 0Dh,0Ah + 2792 %endif + 2793 00000741 02 NEWLINE: db 2 + 2794 00000742 0D0A db 0Dh, 0Ah + 2795 + 2796 ; 10/01/2023 + 2797 ;; MSDOS 5.0 COMMAND.COM RESGROUP:077Dh + 2798 ; 05/06/2023 + 2799 ; MSDOS 6.22 COMMAND.COM RESGROUP:0880h 2800 - 2801 00000744 [280C] MsgPtrLists: dw EXTMSGPTRS ; extended error messages - 2802 00000746 0100 dw 1 - 2803 00000748 [E309] dw PARSMSGPTRS ; parse error messages - 2804 0000074A 0100 dw 1 - 2805 0000074C [280C] dw EXTMSGPTRS ; critical error messages - 2806 0000074E 0100 dw 1 - 2807 00000750 0000 dw 0 ; File system error messages - 2808 00000752 0000 dw 0 ; are not supported. - 2809 00000754 [EA00] dw MsgRetrv_Trap ; disk retriever routine - 2810 00000756 0000 MySeg3: dw 0 ; segment of retriever routine - 2811 - 2812 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0791h - 2813 ; 05/06/2023 - 2814 ; MSDOS 6.22 COMMAND.COM RESGROUP:0894h - 2815 - 2816 ; 19/07/2024 - 2817 ; PCDOS 7.1 COMMAND.COM RESGROUP:0846h + 2801 ; 19/07/2024 + 2802 ; PCDOS 7.1 COMMAND.COM RESGROUP:0832h + 2803 + 2804 00000744 [280C] MsgPtrLists: dw EXTMSGPTRS ; extended error messages + 2805 00000746 0100 dw 1 + 2806 00000748 [E309] dw PARSMSGPTRS ; parse error messages + 2807 0000074A 0100 dw 1 + 2808 0000074C [280C] dw EXTMSGPTRS ; critical error messages + 2809 0000074E 0100 dw 1 + 2810 00000750 0000 dw 0 ; File system error messages + 2811 00000752 0000 dw 0 ; are not supported. + 2812 00000754 [EA00] dw MsgRetrv_Trap ; disk retriever routine + 2813 00000756 0000 MySeg3: dw 0 ; segment of retriever routine + 2814 + 2815 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0791h + 2816 ; 05/06/2023 + 2817 ; MSDOS 6.22 COMMAND.COM RESGROUP:0894h 2818 - 2819 00000758 13 CRMSG0: db 19 - 2820 00000759 57726974652070726F- db 'Write protect error' - 2820 00000762 74656374206572726F- - 2820 0000076B 72 - 2821 0000076C 0C CRMSG1: db 12 - 2822 0000076D 496E76616C69642075- db 'Invalid unit' - 2822 00000776 6E6974 - 2823 00000779 09 CRMSG2: db 9 - 2824 0000077A 4E6F74207265616479 db 'Not ready' - 2825 00000783 16 CRMSG3: db 22 - 2826 00000784 496E76616C69642064- db 'Invalid device request' - 2826 0000078D 657669636520726571- - 2826 00000796 75657374 - 2827 0000079A 0A CRMSG4: db 10 - 2828 0000079B 44617461206572726F- db 'Data error' - 2828 000007A4 72 - 2829 000007A5 21 CRMSG5: db 33 - 2830 000007A6 496E76616C69642064- db 'Invalid device request parameters' - 2830 000007AF 657669636520726571- - 2830 000007B8 756573742070617261- - 2830 000007C1 6D6574657273 - 2831 000007C7 0A CRMSG6: db 10 - 2832 000007C8 5365656B206572726F- db 'Seek error' - 2832 000007D1 72 - 2833 000007D2 12 CRMSG7: db 18 - 2834 000007D3 496E76616C6964206D- db 'Invalid media type' - 2834 000007DC 656469612074797065 - 2835 000007E5 10 CRMSG8: db 16 - 2836 000007E6 536563746F72206E6F- db 'Sector not found' - 2836 000007EF 7420666F756E64 - 2837 000007F6 1A CRMSG9: db 26 - 2838 000007F7 5072696E746572206F- db 'Printer out of paper error' - 2838 00000800 7574206F6620706170- - 2838 00000809 6572206572726F72 - 2839 00000811 11 CRMSG10: db 17 - 2840 00000812 577269746520666175- db 'Write fault error' - 2840 0000081B 6C74206572726F72 - 2841 00000823 10 CRMSG11: db 16 - 2842 00000824 52656164206661756C- db 'Read fault error' - 2842 0000082D 74206572726F72 - 2843 00000834 0F CRMSG12: db 15 - 2844 00000835 47656E6572616C2066- db 'General failure' - 2844 0000083E 61696C757265 - 2845 00000844 11 CRMSG13: db 17 - 2846 00000845 53686172696E672076- db 'Sharing violation' - 2846 0000084E 696F6C6174696F6E - 2847 00000856 0E CRMSG14: db 14 - 2848 00000857 4C6F636B2076696F6C- db 'Lock violation' - 2848 00000860 6174696F6E - 2849 00000865 13 CRMSG15: db 19 - 2850 00000866 496E76616C69642064- db 'Invalid disk change' - 2850 0000086F 69736B206368616E67- - 2850 00000878 65 - 2851 00000879 0F CRMSG16: db 15 - 2852 0000087A 46434220756E617661- db 'FCB unavailable' - 2852 00000883 696C61626C65 - 2853 00000889 19 CRMSG17: db 25 - 2854 0000088A 53797374656D207265- db 'System resource exhausted' - 2854 00000893 736F75726365206578- - 2854 0000089C 68617573746564 - 2855 000008A3 12 CRMSG18: db 18 - 2856 000008A4 436F64652070616765- db 'Code page mismatch' - 2856 000008AD 206D69736D61746368 - 2857 000008B6 0C CRMSG19: db 12 - 2858 000008B7 4F7574206F6620696E- db 'Out of input' - 2858 000008C0 707574 - 2859 000008C3 17 CRMSG20: db 23 - 2860 000008C4 496E73756666696369- db 'Insufficient disk space' - 2860 000008CD 656E74206469736B20- - 2860 000008D6 7370616365 - 2861 - 2862 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0914h - 2863 ; 05/06/2023 - 2864 ; MSDOS 6.22 COMMAND.COM RESGROUP:0A17h - 2865 - 2866 ; 19/07/2024 - 2867 ; PCDOS 7.1 COMMAND.COM RESGROUP:09C9h + 2819 ; 19/07/2024 + 2820 ; PCDOS 7.1 COMMAND.COM RESGROUP:0846h + 2821 + 2822 00000758 13 CRMSG0: db 19 + 2823 00000759 57726974652070726F- db 'Write protect error' + 2823 00000762 74656374206572726F- + 2823 0000076B 72 + 2824 0000076C 0C CRMSG1: db 12 + 2825 0000076D 496E76616C69642075- db 'Invalid unit' + 2825 00000776 6E6974 + 2826 00000779 09 CRMSG2: db 9 + 2827 0000077A 4E6F74207265616479 db 'Not ready' + 2828 00000783 16 CRMSG3: db 22 + 2829 00000784 496E76616C69642064- db 'Invalid device request' + 2829 0000078D 657669636520726571- + 2829 00000796 75657374 + 2830 0000079A 0A CRMSG4: db 10 + 2831 0000079B 44617461206572726F- db 'Data error' + 2831 000007A4 72 + 2832 000007A5 21 CRMSG5: db 33 + 2833 000007A6 496E76616C69642064- db 'Invalid device request parameters' + 2833 000007AF 657669636520726571- + 2833 000007B8 756573742070617261- + 2833 000007C1 6D6574657273 + 2834 000007C7 0A CRMSG6: db 10 + 2835 000007C8 5365656B206572726F- db 'Seek error' + 2835 000007D1 72 + 2836 000007D2 12 CRMSG7: db 18 + 2837 000007D3 496E76616C6964206D- db 'Invalid media type' + 2837 000007DC 656469612074797065 + 2838 000007E5 10 CRMSG8: db 16 + 2839 000007E6 536563746F72206E6F- db 'Sector not found' + 2839 000007EF 7420666F756E64 + 2840 000007F6 1A CRMSG9: db 26 + 2841 000007F7 5072696E746572206F- db 'Printer out of paper error' + 2841 00000800 7574206F6620706170- + 2841 00000809 6572206572726F72 + 2842 00000811 11 CRMSG10: db 17 + 2843 00000812 577269746520666175- db 'Write fault error' + 2843 0000081B 6C74206572726F72 + 2844 00000823 10 CRMSG11: db 16 + 2845 00000824 52656164206661756C- db 'Read fault error' + 2845 0000082D 74206572726F72 + 2846 00000834 0F CRMSG12: db 15 + 2847 00000835 47656E6572616C2066- db 'General failure' + 2847 0000083E 61696C757265 + 2848 00000844 11 CRMSG13: db 17 + 2849 00000845 53686172696E672076- db 'Sharing violation' + 2849 0000084E 696F6C6174696F6E + 2850 00000856 0E CRMSG14: db 14 + 2851 00000857 4C6F636B2076696F6C- db 'Lock violation' + 2851 00000860 6174696F6E + 2852 00000865 13 CRMSG15: db 19 + 2853 00000866 496E76616C69642064- db 'Invalid disk change' + 2853 0000086F 69736B206368616E67- + 2853 00000878 65 + 2854 00000879 0F CRMSG16: db 15 + 2855 0000087A 46434220756E617661- db 'FCB unavailable' + 2855 00000883 696C61626C65 + 2856 00000889 19 CRMSG17: db 25 + 2857 0000088A 53797374656D207265- db 'System resource exhausted' + 2857 00000893 736F75726365206578- + 2857 0000089C 68617573746564 + 2858 000008A3 12 CRMSG18: db 18 + 2859 000008A4 436F64652070616765- db 'Code page mismatch' + 2859 000008AD 206D69736D61746368 + 2860 000008B6 0C CRMSG19: db 12 + 2861 000008B7 4F7574206F6620696E- db 'Out of input' + 2861 000008C0 707574 + 2862 000008C3 17 CRMSG20: db 23 + 2863 000008C4 496E73756666696369- db 'Insufficient disk space' + 2863 000008CD 656E74206469736B20- + 2863 000008D6 7370616365 + 2864 + 2865 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0914h + 2866 ; 05/06/2023 + 2867 ; MSDOS 6.22 COMMAND.COM RESGROUP:0A17h 2868 - 2869 000008DB [5807] CRITMSGPTRS: dw CRMSG0 - 2870 000008DD [6C07] dw CRMSG1 - 2871 000008DF [7907] dw CRMSG2 - 2872 000008E1 [8307] dw CRMSG3 - 2873 000008E3 [9A07] dw CRMSG4 - 2874 000008E5 [A507] dw CRMSG5 - 2875 000008E7 [C707] dw CRMSG6 - 2876 000008E9 [D207] dw CRMSG7 - 2877 000008EB [E507] dw CRMSG8 - 2878 000008ED [F607] dw CRMSG9 - 2879 000008EF [1108] dw CRMSG10 - 2880 000008F1 [2308] dw CRMSG11 - 2881 000008F3 [3408] dw CRMSG12 - 2882 000008F5 [4408] dw CRMSG13 - 2883 000008F7 [5608] dw CRMSG14 - 2884 000008F9 [6508] dw CRMSG15 - 2885 000008FB [7908] dw CRMSG16 - 2886 000008FD [8908] dw CRMSG17 - 2887 000008FF [A308] dw CRMSG18 - 2888 00000901 [B608] dw CRMSG19 - 2889 00000903 [C308] dw CRMSG20 - 2890 - 2891 ; 14/01/2023 - 2892 ;DataresEnd: ;; MSDOS 5.0 COMMAND.COM - DATARES:093Eh (RESGROUP:093Eh) - 2893 ; 05/06/2023 - 2894 DataresEnd: ; MSDOS 6.22 COMMAND.COM - DATARES:0A41h (RESGROUP:0A41h) - 2895 - 2896 00000905 13 PAERRMSG0: db 19 - 2897 00000906 546F6F206D616E7920- db 'Too many parameters' - 2897 0000090F 706172616D65746572- - 2897 00000918 73 - 2898 00000919 1A PAERRMSG1: db 26 - 2899 0000091A 526571756972656420- db 'Required parameter missing' - 2899 00000923 706172616D65746572- - 2899 0000092C 206D697373696E67 - 2900 00000934 0E PAERRMSG2: db 14 - 2901 00000935 496E76616C69642073- db 'Invalid switch' - 2901 0000093E 7769746368 - 2902 00000943 0F PAERRMSG3: db 15 - 2903 00000944 496E76616C6964206B- db 'Invalid keyword' - 2903 0000094D 6579776F7264 - 2904 00000953 01 PAERRMSG4: db 1 - 2905 00000954 20 db 20h - 2906 00000955 24 PAERRMSG5: db 36 - 2907 00000956 506172616D65746572- db 'Parameter value not in allowed range' - 2907 0000095F 2076616C7565206E6F- - 2907 00000968 7420696E20616C6C6F- - 2907 00000971 7765642072616E6765 - 2908 PAERRMSG6: ; 10/01/2023 - 2909 0000097A 1B PAERRMSG7: db 27 - 2910 0000097B 506172616D65746572- db 'Parameter value not allowed' - 2910 00000984 2076616C7565206E6F- - 2910 0000098D 7420616C6C6F776564 - 2911 ;PAERRMSG7: db 27 - 2912 ; db 'Parameter value not allowed' - 2913 00000996 1C PAERRMSG8: db 28 - 2914 00000997 506172616D65746572- db 'Parameter format not correct' - 2914 000009A0 20666F726D6174206E- - 2914 000009A9 6F7420636F72726563- - 2914 000009B2 74 - 2915 000009B3 11 PAERRMSG9: db 17 - 2916 000009B4 496E76616C69642070- db 'Invalid parameter' - 2916 000009BD 6172616D65746572 - 2917 000009C5 1D PAERRMSG10: db 29 - 2918 000009C6 496E76616C69642070- db 'Invalid parameter combination' - 2918 000009CF 6172616D6574657220- - 2918 000009D8 636F6D62696E617469- - 2918 000009E1 6F6E - 2919 - 2920 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0A38h - 2921 ; 05/06/2023 - 2922 ; MSDOS 6.22 COMMAND.COM RESGROUP:0B3Bh - 2923 - 2924 ; 19/07/2024 - 2925 ; PCDOS 7.1 COMMAND.COM RESGROUP:0AD1h + 2869 ; 19/07/2024 + 2870 ; PCDOS 7.1 COMMAND.COM RESGROUP:09C9h + 2871 + 2872 000008DB [5807] CRITMSGPTRS: dw CRMSG0 + 2873 000008DD [6C07] dw CRMSG1 + 2874 000008DF [7907] dw CRMSG2 + 2875 000008E1 [8307] dw CRMSG3 + 2876 000008E3 [9A07] dw CRMSG4 + 2877 000008E5 [A507] dw CRMSG5 + 2878 000008E7 [C707] dw CRMSG6 + 2879 000008E9 [D207] dw CRMSG7 + 2880 000008EB [E507] dw CRMSG8 + 2881 000008ED [F607] dw CRMSG9 + 2882 000008EF [1108] dw CRMSG10 + 2883 000008F1 [2308] dw CRMSG11 + 2884 000008F3 [3408] dw CRMSG12 + 2885 000008F5 [4408] dw CRMSG13 + 2886 000008F7 [5608] dw CRMSG14 + 2887 000008F9 [6508] dw CRMSG15 + 2888 000008FB [7908] dw CRMSG16 + 2889 000008FD [8908] dw CRMSG17 + 2890 000008FF [A308] dw CRMSG18 + 2891 00000901 [B608] dw CRMSG19 + 2892 00000903 [C308] dw CRMSG20 + 2893 + 2894 ; 14/01/2023 + 2895 ;DataresEnd: ;; MSDOS 5.0 COMMAND.COM - DATARES:093Eh (RESGROUP:093Eh) + 2896 ; 05/06/2023 + 2897 DataresEnd: ; MSDOS 6.22 COMMAND.COM - DATARES:0A41h (RESGROUP:0A41h) + 2898 + 2899 00000905 13 PAERRMSG0: db 19 + 2900 00000906 546F6F206D616E7920- db 'Too many parameters' + 2900 0000090F 706172616D65746572- + 2900 00000918 73 + 2901 00000919 1A PAERRMSG1: db 26 + 2902 0000091A 526571756972656420- db 'Required parameter missing' + 2902 00000923 706172616D65746572- + 2902 0000092C 206D697373696E67 + 2903 00000934 0E PAERRMSG2: db 14 + 2904 00000935 496E76616C69642073- db 'Invalid switch' + 2904 0000093E 7769746368 + 2905 00000943 0F PAERRMSG3: db 15 + 2906 00000944 496E76616C6964206B- db 'Invalid keyword' + 2906 0000094D 6579776F7264 + 2907 00000953 01 PAERRMSG4: db 1 + 2908 00000954 20 db 20h + 2909 00000955 24 PAERRMSG5: db 36 + 2910 00000956 506172616D65746572- db 'Parameter value not in allowed range' + 2910 0000095F 2076616C7565206E6F- + 2910 00000968 7420696E20616C6C6F- + 2910 00000971 7765642072616E6765 + 2911 PAERRMSG6: ; 10/01/2023 + 2912 0000097A 1B PAERRMSG7: db 27 + 2913 0000097B 506172616D65746572- db 'Parameter value not allowed' + 2913 00000984 2076616C7565206E6F- + 2913 0000098D 7420616C6C6F776564 + 2914 ;PAERRMSG7: db 27 + 2915 ; db 'Parameter value not allowed' + 2916 00000996 1C PAERRMSG8: db 28 + 2917 00000997 506172616D65746572- db 'Parameter format not correct' + 2917 000009A0 20666F726D6174206E- + 2917 000009A9 6F7420636F72726563- + 2917 000009B2 74 + 2918 000009B3 11 PAERRMSG9: db 17 + 2919 000009B4 496E76616C69642070- db 'Invalid parameter' + 2919 000009BD 6172616D65746572 + 2920 000009C5 1D PAERRMSG10: db 29 + 2921 000009C6 496E76616C69642070- db 'Invalid parameter combination' + 2921 000009CF 6172616D6574657220- + 2921 000009D8 636F6D62696E617469- + 2921 000009E1 6F6E + 2922 + 2923 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0A38h + 2924 ; 05/06/2023 + 2925 ; MSDOS 6.22 COMMAND.COM RESGROUP:0B3Bh 2926 - 2927 000009E3 [0509] PARSMSGPTRS: dw PAERRMSG0 - 2928 000009E5 [1909] dw PAERRMSG1 - 2929 000009E7 [3409] dw PAERRMSG2 - 2930 000009E9 [4309] dw PAERRMSG3 - 2931 000009EB [5309] dw PAERRMSG4 - 2932 000009ED [5509] dw PAERRMSG5 - 2933 000009EF [7A09] dw PAERRMSG6 - 2934 000009F1 [7A09] dw PAERRMSG7 - 2935 000009F3 [9609] dw PAERRMSG8 - 2936 000009F5 [B309] dw PAERRMSG9 - 2937 000009F7 [C509] dw PAERRMSG10 - 2938 ; 21/04/2023 - 2939 NUMPARSMSGS equ ($-PARSMSGPTRS)>>1 ; 14/01/2023 - 2940 - 2941 000009F9 10 INVLFUNCT: db 16 - 2942 000009FA 496E76616C69642066- db 'Invalid function' - 2942 00000A03 756E6374696F6E - 2943 00000A0A 0E FNOTFOUND: db 14 - 2944 00000A0B 46696C65206E6F7420- db 'File not found' - 2944 00000A14 666F756E64 - 2945 00000A19 0E PNOTFOUND: db 14 - 2946 00000A1A 50617468206E6F7420- db 'Path not found' - 2946 00000A23 666F756E64 - 2947 00000A28 13 TOOMANYOF: db 19 - 2948 00000A29 546F6F206D616E7920- db 'Too many open files' - 2948 00000A32 6F70656E2066696C65- - 2948 00000A3B 73 - 2949 ; 14/01/2023 - 2950 ;ACCDEN: ; 10/01/2023 - 2951 ;ACCDENIED: db 14 - 2952 ; db 'Access denied ' - 2953 00000A3C 0E INVHANDLE: db 14 - 2954 00000A3D 496E76616C69642068- db 'Invalid handle' - 2954 00000A46 616E646C65 - 2955 00000A4B 1F MEMCBDEST: db 31 - 2956 00000A4C 4D656D6F727920636F- db 'Memory control blocks destroyed' - 2956 00000A55 6E74726F6C20626C6F- - 2956 00000A5E 636B73206465737472- - 2956 00000A67 6F796564 - 2957 00000A6B 13 INSUFFMEM: db 19 - 2958 00000A6C 496E73756666696369- db 'Insufficient memory' - 2958 00000A75 656E74206D656D6F72- - 2958 00000A7E 79 - 2959 00000A7F 1C INVMEMBLA: db 28 - 2960 00000A80 496E76616C6964206D- db 'Invalid memory block address' - 2960 00000A89 656D6F727920626C6F- - 2960 00000A92 636B20616464726573- - 2960 00000A9B 73 - 2961 00000A9C 13 INVENVIRO: db 19 - 2962 00000A9D 496E76616C69642045- db 'Invalid Environment' - 2962 00000AA6 6E7669726F6E6D656E- - 2962 00000AAF 74 - 2963 00000AB0 0E INVFORMAT: db 14 - 2964 00000AB1 496E76616C69642066- db 'Invalid format' - 2964 00000ABA 6F726D6174 - 2965 00000ABF 1A INVFNPARM: db 26 - 2966 00000AC0 496E76616C69642066- db 'Invalid function parameter' - 2966 00000AC9 756E6374696F6E2070- - 2966 00000AD2 6172616D65746572 - 2967 00000ADA 0C INVLDDATA: db 12 - 2968 00000ADB 496E76616C69642064- db 'Invalid data' - 2968 00000AE4 617461 - 2969 00000AE7 1B INVDRVSPC: db 27 - 2970 00000AE8 496E76616C69642064- db 'Invalid drive specification' - 2970 00000AF1 726976652073706563- - 2970 00000AFA 696669636174696F6E - 2971 00000B03 23 ATRCURDIR: db 35 - 2972 00000B04 417474656D70742074- db 'Attempt to remove current directory' - 2972 00000B0D 6F2072656D6F766520- - 2972 00000B16 63757272656E742064- - 2972 00000B1F 69726563746F7279 - 2973 00000B27 0F NOTSAMDEV: db 15 - 2974 00000B28 4E6F742073616D6520- db 'Not same device' - 2974 00000B31 646576696365 - 2975 00000B37 0D NOMOREFIL: db 13 - 2976 00000B38 4E6F206D6F72652066- db 'No more files' - 2976 00000B41 696C6573 - 2977 00000B45 0B FILEXISTS: db 11 - 2978 00000B46 46696C652065786973- db 'File exists' - 2978 00000B4F 7473 - 2979 00000B51 1B CANTMKDIR: db 27 - 2980 00000B52 43616E6E6F74206D61- db 'Cannot make directory entry' - 2980 00000B5B 6B6520646972656374- - 2980 00000B64 6F727920656E747279 - 2981 00000B6D 0E FAILINT24: db 14 - 2982 00000B6E 4661696C206F6E2049- db 'Fail on INT 24' - 2982 00000B77 4E54203234 - 2983 00000B7C 15 TOOMANYRD: db 21 - 2984 00000B7D 546F6F206D616E7920- db 'Too many redirections' - 2984 00000B86 726564697265637469- - 2984 00000B8F 6F6E73 - 2985 00000B92 15 DUPLREDIR: db 21 - 2986 00000B93 4475706C6963617465- db 'Duplicate redirection' - 2986 00000B9C 207265646972656374- - 2986 00000BA5 696F6E - 2987 00000BA8 10 INVPASSWD: db 16 - 2988 00000BA9 496E76616C69642070- db 'Invalid password' - 2988 00000BB2 617373776F7264 - 2989 00000BB9 11 INVLDPARM: db 17 - 2990 00000BBA 496E76616C69642070- db 'Invalid parameter' - 2990 00000BC3 6172616D65746572 - 2991 00000BCB 12 NETDATFAU: db 18 - 2992 00000BCC 4E6574776F726B2064- db 'Network data fault' - 2992 00000BD5 617461206661756C74 - 2993 00000BDE 21 FNOSUPNET: db 33 - 2994 00000BDF 46756E6374696F6E20- db 'Function not supported by network' - 2994 00000BE8 6E6F7420737570706F- - 2994 00000BF1 72746564206279206E- - 2994 00000BFA 6574776F726B - 2995 00000C00 27 RSCNOTINS: db 39 - 2996 00000C01 526571756972656420- db 'Required system component not installed' - 2996 00000C0A 73797374656D20636F- - 2996 00000C13 6D706F6E656E74206E- - 2996 00000C1C 6F7420696E7374616C- - 2996 00000C25 6C6564 - 2997 - 2998 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0C8Ch - 2999 ; 05/06/2023 - 3000 ; MSDOS 6.22 COMMAND.COM RESGROUP:0D8Fh - 3001 - 3002 ; 19/07/2024 - 3003 ; PCDOS 7.1 COMMAND.COM RESGROUP:0D24h + 2927 ; 19/07/2024 + 2928 ; PCDOS 7.1 COMMAND.COM RESGROUP:0AD1h + 2929 + 2930 000009E3 [0509] PARSMSGPTRS: dw PAERRMSG0 + 2931 000009E5 [1909] dw PAERRMSG1 + 2932 000009E7 [3409] dw PAERRMSG2 + 2933 000009E9 [4309] dw PAERRMSG3 + 2934 000009EB [5309] dw PAERRMSG4 + 2935 000009ED [5509] dw PAERRMSG5 + 2936 000009EF [7A09] dw PAERRMSG6 + 2937 000009F1 [7A09] dw PAERRMSG7 + 2938 000009F3 [9609] dw PAERRMSG8 + 2939 000009F5 [B309] dw PAERRMSG9 + 2940 000009F7 [C509] dw PAERRMSG10 + 2941 ; 21/04/2023 + 2942 NUMPARSMSGS equ ($-PARSMSGPTRS)>>1 ; 14/01/2023 + 2943 + 2944 000009F9 10 INVLFUNCT: db 16 + 2945 000009FA 496E76616C69642066- db 'Invalid function' + 2945 00000A03 756E6374696F6E + 2946 00000A0A 0E FNOTFOUND: db 14 + 2947 00000A0B 46696C65206E6F7420- db 'File not found' + 2947 00000A14 666F756E64 + 2948 00000A19 0E PNOTFOUND: db 14 + 2949 00000A1A 50617468206E6F7420- db 'Path not found' + 2949 00000A23 666F756E64 + 2950 00000A28 13 TOOMANYOF: db 19 + 2951 00000A29 546F6F206D616E7920- db 'Too many open files' + 2951 00000A32 6F70656E2066696C65- + 2951 00000A3B 73 + 2952 ; 14/01/2023 + 2953 ;ACCDEN: ; 10/01/2023 + 2954 ;ACCDENIED: db 14 + 2955 ; db 'Access denied ' + 2956 00000A3C 0E INVHANDLE: db 14 + 2957 00000A3D 496E76616C69642068- db 'Invalid handle' + 2957 00000A46 616E646C65 + 2958 00000A4B 1F MEMCBDEST: db 31 + 2959 00000A4C 4D656D6F727920636F- db 'Memory control blocks destroyed' + 2959 00000A55 6E74726F6C20626C6F- + 2959 00000A5E 636B73206465737472- + 2959 00000A67 6F796564 + 2960 00000A6B 13 INSUFFMEM: db 19 + 2961 00000A6C 496E73756666696369- db 'Insufficient memory' + 2961 00000A75 656E74206D656D6F72- + 2961 00000A7E 79 + 2962 00000A7F 1C INVMEMBLA: db 28 + 2963 00000A80 496E76616C6964206D- db 'Invalid memory block address' + 2963 00000A89 656D6F727920626C6F- + 2963 00000A92 636B20616464726573- + 2963 00000A9B 73 + 2964 00000A9C 13 INVENVIRO: db 19 + 2965 00000A9D 496E76616C69642045- db 'Invalid Environment' + 2965 00000AA6 6E7669726F6E6D656E- + 2965 00000AAF 74 + 2966 00000AB0 0E INVFORMAT: db 14 + 2967 00000AB1 496E76616C69642066- db 'Invalid format' + 2967 00000ABA 6F726D6174 + 2968 00000ABF 1A INVFNPARM: db 26 + 2969 00000AC0 496E76616C69642066- db 'Invalid function parameter' + 2969 00000AC9 756E6374696F6E2070- + 2969 00000AD2 6172616D65746572 + 2970 00000ADA 0C INVLDDATA: db 12 + 2971 00000ADB 496E76616C69642064- db 'Invalid data' + 2971 00000AE4 617461 + 2972 00000AE7 1B INVDRVSPC: db 27 + 2973 00000AE8 496E76616C69642064- db 'Invalid drive specification' + 2973 00000AF1 726976652073706563- + 2973 00000AFA 696669636174696F6E + 2974 00000B03 23 ATRCURDIR: db 35 + 2975 00000B04 417474656D70742074- db 'Attempt to remove current directory' + 2975 00000B0D 6F2072656D6F766520- + 2975 00000B16 63757272656E742064- + 2975 00000B1F 69726563746F7279 + 2976 00000B27 0F NOTSAMDEV: db 15 + 2977 00000B28 4E6F742073616D6520- db 'Not same device' + 2977 00000B31 646576696365 + 2978 00000B37 0D NOMOREFIL: db 13 + 2979 00000B38 4E6F206D6F72652066- db 'No more files' + 2979 00000B41 696C6573 + 2980 00000B45 0B FILEXISTS: db 11 + 2981 00000B46 46696C652065786973- db 'File exists' + 2981 00000B4F 7473 + 2982 00000B51 1B CANTMKDIR: db 27 + 2983 00000B52 43616E6E6F74206D61- db 'Cannot make directory entry' + 2983 00000B5B 6B6520646972656374- + 2983 00000B64 6F727920656E747279 + 2984 00000B6D 0E FAILINT24: db 14 + 2985 00000B6E 4661696C206F6E2049- db 'Fail on INT 24' + 2985 00000B77 4E54203234 + 2986 00000B7C 15 TOOMANYRD: db 21 + 2987 00000B7D 546F6F206D616E7920- db 'Too many redirections' + 2987 00000B86 726564697265637469- + 2987 00000B8F 6F6E73 + 2988 00000B92 15 DUPLREDIR: db 21 + 2989 00000B93 4475706C6963617465- db 'Duplicate redirection' + 2989 00000B9C 207265646972656374- + 2989 00000BA5 696F6E + 2990 00000BA8 10 INVPASSWD: db 16 + 2991 00000BA9 496E76616C69642070- db 'Invalid password' + 2991 00000BB2 617373776F7264 + 2992 00000BB9 11 INVLDPARM: db 17 + 2993 00000BBA 496E76616C69642070- db 'Invalid parameter' + 2993 00000BC3 6172616D65746572 + 2994 00000BCB 12 NETDATFAU: db 18 + 2995 00000BCC 4E6574776F726B2064- db 'Network data fault' + 2995 00000BD5 617461206661756C74 + 2996 00000BDE 21 FNOSUPNET: db 33 + 2997 00000BDF 46756E6374696F6E20- db 'Function not supported by network' + 2997 00000BE8 6E6F7420737570706F- + 2997 00000BF1 72746564206279206E- + 2997 00000BFA 6574776F726B + 2998 00000C00 27 RSCNOTINS: db 39 + 2999 00000C01 526571756972656420- db 'Required system component not installed' + 2999 00000C0A 73797374656D20636F- + 2999 00000C13 6D706F6E656E74206E- + 2999 00000C1C 6F7420696E7374616C- + 2999 00000C25 6C6564 + 3000 + 3001 ;; MSDOS 5.0 COMMAND.COM RESGROUP:0C8Ch + 3002 ; 05/06/2023 + 3003 ; MSDOS 6.22 COMMAND.COM RESGROUP:0D8Fh 3004 - 3005 00000C28 [F909] EXTMSGPTRS: dw INVLFUNCT - 3006 00000C2A [0A0A] dw FNOTFOUND - 3007 00000C2C [190A] dw PNOTFOUND - 3008 00000C2E [280A] dw TOOMANYOF - 3009 00000C30 [D006] dw ACCDENIED - 3010 00000C32 [3C0A] dw INVHANDLE - 3011 00000C34 [4B0A] dw MEMCBDEST - 3012 00000C36 [6B0A] dw INSUFFMEM - 3013 00000C38 [7F0A] dw INVMEMBLA - 3014 00000C3A [9C0A] dw INVENVIRO - 3015 00000C3C [B00A] dw INVFORMAT - 3016 00000C3E [BF0A] dw INVFNPARM - 3017 00000C40 [DA0A] dw INVLDDATA - 3018 00000C42 0000 dw 0 - 3019 00000C44 [E70A] dw INVDRVSPC - 3020 00000C46 [030B] dw ATRCURDIR - 3021 00000C48 [270B] dw NOTSAMDEV - 3022 00000C4A [370B] dw NOMOREFIL - 3023 00000C4C [5807] dw CRMSG0 - 3024 00000C4E [6C07] dw CRMSG1 - 3025 00000C50 [7907] dw CRMSG2 - 3026 00000C52 [8307] dw CRMSG3 - 3027 00000C54 [9A07] dw CRMSG4 - 3028 00000C56 [A507] dw CRMSG5 - 3029 00000C58 [C707] dw CRMSG6 - 3030 00000C5A [D207] dw CRMSG7 - 3031 00000C5C [E507] dw CRMSG8 - 3032 00000C5E [F607] dw CRMSG9 - 3033 00000C60 [1108] dw CRMSG10 - 3034 00000C62 [2308] dw CRMSG11 - 3035 00000C64 [3408] dw CRMSG12 - 3036 00000C66 [4408] dw CRMSG13 - 3037 00000C68 [5608] dw CRMSG14 - 3038 00000C6A [6508] dw CRMSG15 - 3039 00000C6C [7908] dw CRMSG16 - 3040 00000C6E [8908] dw CRMSG17 - 3041 00000C70 [A308] dw CRMSG18 - 3042 00000C72 [B608] dw CRMSG19 - 3043 00000C74 [C308] dw CRMSG20 - 3044 00000C76 0000 times 40 dw 0 ; db 80 dup(0) - 3045 00000CC6 [450B] dw FILEXISTS - 3046 00000CC8 0000 dw 0 - 3047 00000CCA [510B] dw CANTMKDIR - 3048 00000CCC [6D0B] dw FAILINT24 - 3049 00000CCE [7C0B] dw TOOMANYRD - 3050 00000CD0 [920B] dw DUPLREDIR - 3051 00000CD2 [A80B] dw INVPASSWD - 3052 00000CD4 [B90B] dw INVLDPARM - 3053 00000CD6 [CB0B] dw NETDATFAU - 3054 00000CD8 [DE0B] dw FNOSUPNET - 3055 00000CDA [000C] dw RSCNOTINS - 3056 ; ---------------------------------------------------------------------------- - 3057 ; 17/04/2023 - 3058 ExtMsgEnd: - 3059 - 3060 ; 21/04/2023 - 3061 NUMEXTMSGS equ ($-EXTMSGPTRS)>>1 ; 14/01/2023 + 3005 ; 19/07/2024 + 3006 ; PCDOS 7.1 COMMAND.COM RESGROUP:0D24h + 3007 + 3008 00000C28 [F909] EXTMSGPTRS: dw INVLFUNCT + 3009 00000C2A [0A0A] dw FNOTFOUND + 3010 00000C2C [190A] dw PNOTFOUND + 3011 00000C2E [280A] dw TOOMANYOF + 3012 00000C30 [D006] dw ACCDENIED + 3013 00000C32 [3C0A] dw INVHANDLE + 3014 00000C34 [4B0A] dw MEMCBDEST + 3015 00000C36 [6B0A] dw INSUFFMEM + 3016 00000C38 [7F0A] dw INVMEMBLA + 3017 00000C3A [9C0A] dw INVENVIRO + 3018 00000C3C [B00A] dw INVFORMAT + 3019 00000C3E [BF0A] dw INVFNPARM + 3020 00000C40 [DA0A] dw INVLDDATA + 3021 00000C42 0000 dw 0 + 3022 00000C44 [E70A] dw INVDRVSPC + 3023 00000C46 [030B] dw ATRCURDIR + 3024 00000C48 [270B] dw NOTSAMDEV + 3025 00000C4A [370B] dw NOMOREFIL + 3026 00000C4C [5807] dw CRMSG0 + 3027 00000C4E [6C07] dw CRMSG1 + 3028 00000C50 [7907] dw CRMSG2 + 3029 00000C52 [8307] dw CRMSG3 + 3030 00000C54 [9A07] dw CRMSG4 + 3031 00000C56 [A507] dw CRMSG5 + 3032 00000C58 [C707] dw CRMSG6 + 3033 00000C5A [D207] dw CRMSG7 + 3034 00000C5C [E507] dw CRMSG8 + 3035 00000C5E [F607] dw CRMSG9 + 3036 00000C60 [1108] dw CRMSG10 + 3037 00000C62 [2308] dw CRMSG11 + 3038 00000C64 [3408] dw CRMSG12 + 3039 00000C66 [4408] dw CRMSG13 + 3040 00000C68 [5608] dw CRMSG14 + 3041 00000C6A [6508] dw CRMSG15 + 3042 00000C6C [7908] dw CRMSG16 + 3043 00000C6E [8908] dw CRMSG17 + 3044 00000C70 [A308] dw CRMSG18 + 3045 00000C72 [B608] dw CRMSG19 + 3046 00000C74 [C308] dw CRMSG20 + 3047 00000C76 0000 times 40 dw 0 ; db 80 dup(0) + 3048 00000CC6 [450B] dw FILEXISTS + 3049 00000CC8 0000 dw 0 + 3050 00000CCA [510B] dw CANTMKDIR + 3051 00000CCC [6D0B] dw FAILINT24 + 3052 00000CCE [7C0B] dw TOOMANYRD + 3053 00000CD0 [920B] dw DUPLREDIR + 3054 00000CD2 [A80B] dw INVPASSWD + 3055 00000CD4 [B90B] dw INVLDPARM + 3056 00000CD6 [CB0B] dw NETDATFAU + 3057 00000CD8 [DE0B] dw FNOSUPNET + 3058 00000CDA [000C] dw RSCNOTINS + 3059 ; ---------------------------------------------------------------------------- + 3060 ; 17/04/2023 + 3061 ExtMsgEnd: 3062 - 3063 ; ---------------------------------------------------------------------------- - 3064 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 3065 %if 1 ; 20/07/2024 - 3066 00000CDC 2E PATRICIDE: db 46 - 3067 00000CDD 0D0A db 0Dh,0Ah - 3068 00000CDF 546F70206C6576656C- db 'Top level process aborted, cannot continue' - 3068 00000CE8 2070726F6365737320- - 3068 00000CF1 61626F727465642C20- - 3068 00000CFA 63616E6E6F7420636F- - 3068 00000D03 6E74696E7565 - 3069 00000D09 0D0A db 0Dh,0Ah - 3070 %endif - 3071 - 3072 ; ---------------------------------------------------------------------------- - 3073 - 3074 ; 20/04/2023 - 3075 - 3076 00000D0B 90 align 16 - 3077 - 3078 ; ---------------------------------------------------------------------------- - 3079 - 3080 ; 10/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 3081 ;; MSDOS 5.0 COMMAND.COM - RESGROUP:0D40h (CODERES:0000h) - 3082 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 3083 ; MSDOS 6.22 COMMAND.COM - RESGROUP:0E50h (CODERES:0000h) - 3084 - 3085 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 3086 ; PCDOS 7.1 COMMAND.COM RESGROUP:0E10h (CODERES:0000h) + 3063 ; 21/04/2023 + 3064 NUMEXTMSGS equ ($-EXTMSGPTRS)>>1 ; 14/01/2023 + 3065 + 3066 ; ---------------------------------------------------------------------------- + 3067 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 3068 %if 1 ; 20/07/2024 + 3069 00000CDC 2E PATRICIDE: db 46 + 3070 00000CDD 0D0A db 0Dh,0Ah + 3071 00000CDF 546F70206C6576656C- db 'Top level process aborted, cannot continue' + 3071 00000CE8 2070726F6365737320- + 3071 00000CF1 61626F727465642C20- + 3071 00000CFA 63616E6E6F7420636F- + 3071 00000D03 6E74696E7565 + 3072 00000D09 0D0A db 0Dh,0Ah + 3073 %endif + 3074 + 3075 ; ---------------------------------------------------------------------------- + 3076 + 3077 ; 20/04/2023 + 3078 + 3079 00000D0B 90 align 16 + 3080 + 3081 ; ---------------------------------------------------------------------------- + 3082 + 3083 ; 10/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 3084 ;; MSDOS 5.0 COMMAND.COM - RESGROUP:0D40h (CODERES:0000h) + 3085 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 3086 ; MSDOS 6.22 COMMAND.COM - RESGROUP:0E50h (CODERES:0000h) 3087 - 3088 ; ---------------------------------------------------------------------------- - 3089 ; SEGMENT - CODERES - 3090 ; ---------------------------------------------------------------------------- - 3091 - 3092 ; 11/01/2023 - 3093 RCODE_START: + 3088 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 3089 ; PCDOS 7.1 COMMAND.COM RESGROUP:0E10h (CODERES:0000h) + 3090 + 3091 ; ---------------------------------------------------------------------------- + 3092 ; SEGMENT - CODERES + 3093 ; ---------------------------------------------------------------------------- 3094 - 3095 ; ---------------------------------------------------------------------------- - 3096 ;*** EXEC error handling - 3097 ; - 3098 ; COMMAND has issued an EXEC system call and it has returned an error. - 3099 ; We examine the error code and select an appropriate message. - 3100 ; -------------------------- - 3101 ; Bugbug: optimize reg usage in following code? Careful of DX! - 3102 ; Condense the error scan? - 3103 ; RBADNAM is checked by transient, no need here? - 3104 ; Move below Ext_Exec. - 3105 ; ---------------------------------------------------------------------------- - 3106 - 3107 Exec_Err: - 3108 ;SR; - 3109 ; ds,es are setup when the transient jumps to Ext_Exec. So segment regs are - 3110 ; in order here - 3111 - 3112 ; Bugbug: can we use byte compares here? - 3113 ; Might be able to use byte msg#s, too. + 3095 ; 11/01/2023 + 3096 RCODE_START: + 3097 + 3098 ; ---------------------------------------------------------------------------- + 3099 ;*** EXEC error handling + 3100 ; + 3101 ; COMMAND has issued an EXEC system call and it has returned an error. + 3102 ; We examine the error code and select an appropriate message. + 3103 ; -------------------------- + 3104 ; Bugbug: optimize reg usage in following code? Careful of DX! + 3105 ; Condense the error scan? + 3106 ; RBADNAM is checked by transient, no need here? + 3107 ; Move below Ext_Exec. + 3108 ; ---------------------------------------------------------------------------- + 3109 + 3110 Exec_Err: + 3111 ;SR; + 3112 ; ds,es are setup when the transient jumps to Ext_Exec. So segment regs are + 3113 ; in order here 3114 - 3115 ; Store errors in a 3 or 4 byte table. Msg #s in another. - 3116 ; Speed not high priority here. + 3115 ; Bugbug: can we use byte compares here? + 3116 ; Might be able to use byte msg#s, too. 3117 - 3118 ; Move this to transient. - 3119 - 3120 ; 10/01/2023 - 3121 - 3122 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 3123 ;if 0 ; PCDOS 7.1 COMMAND.COM doesn't use 'RBADNAM' error msg here - 3124 %if 1 ; Retro DOS v5.0 COMMAND.COM (and MSDOS 6.22 COMMAND.COM) - 3125 ;mov bx,RBADNAM ; offset DATARES:RBadNam - 3126 00000D10 BA[B506] mov dx,RBADNAM - 3127 00000D13 3C02 cmp al,ERROR_FILE_NOT_FOUND ; 2 - 3128 00000D15 741B je short GotExecEMes ; bad command - 3129 %endif - 3130 ;mov bx,TOOBIG ; offset DATARES:TooBig - 3131 00000D17 BA[7B06] mov dx,TOOBIG - 3132 00000D1A 3C08 cmp al,ERROR_NOT_ENOUGH_MEMORY ; 8 - 3133 00000D1C 7414 je short GotExecEMes ; file not found - 3134 ;mov bx,EXEBAD ; offset DATARES:ExeBad - 3135 00000D1E BA[6706] mov dx,EXEBAD - 3136 00000D21 3C0B cmp al,ERROR_BAD_FORMAT ; 11 ; 0Bh - 3137 00000D23 740D je short GotExecEMes ; bad exe file - 3138 ;mov bx,ACCDEN ; offset DATARES:AccDen - 3139 00000D25 BA[D006] mov dx,ACCDEN - 3140 00000D28 3C05 cmp al,ERROR_ACCESS_DENIED ; 5 - 3141 00000D2A 7406 je short GotExecEMes ; access denied - 3142 - 3143 Default_Message: - 3144 ;mov bx,EXECEMES ; offset DATARES:ExecEMes - 3145 00000D2C BA[5306] mov dx,EXECEMES - 3146 ; default message - 3147 00000D2F BE[3002] mov si,ExecErrSubst ; offset DATARES:ExecErrSubst - 3148 ; get address of subst block - 3149 GotExecEMes: - 3150 ;mov dx,bx ; DX = ptr to msg - 3151 00000D32 E8A606 call RPrint ; invoke RPrint - 3152 00000D35 EB09 jmp short NoExec - 3153 - 3154 ; ---------------------------------------------------------------------------- - 3155 ;*** EXEC call - 3156 ; - 3157 ; The transient has set up everything for an EXEC system call. - 3158 ; For cleanliness, we issue the EXEC here in the resident - 3159 ; so that we may be able to recover cleanly upon success. - 3160 ; - 3161 ; CS,DS,ES,SS = DATARES seg addr - 3162 ; ---------------------------------------------------------------------------- - 3163 - 3164 Ext_Exec: - 3165 ;SR; - 3166 ; The words put on the stack by the stub will be popped off when we finally - 3167 ;jump to LodCom (by LodCom). - 3168 - 3169 ; 10/01/2023 - 3170 ;int 21h ; do the exec - 3171 ; 10/01/2023 - MSDOS 5.0 COMMAND.COM - RESGROUP:0D69h (CODERES:0029h) - 3172 Exec_Ret: - 3173 00000D37 72D7 jc short Exec_Err ; exec failed - 3174 - 3175 ; The exec has completed. Retrieve the exit code. - 3176 - 3177 Exec_Wait: - 3178 00000D39 B44D mov ah,4Dh - 3179 ;mov ah,WAITPROCESS ; 4Dh ; get errorlevel - 3180 00000D3B CD21 int 21h ; get the return code - 3181 ;mov [cs:RetCode],ax - 3182 ; 11/01/2023 - 3183 00000D3D A3[9A02] mov [RetCode],ax - 3184 - 3185 ; See if we can reload the transient. The external command - 3186 ; may have overwritten part of the transient. + 3118 ; Store errors in a 3 or 4 byte table. Msg #s in another. + 3119 ; Speed not high priority here. + 3120 + 3121 ; Move this to transient. + 3122 + 3123 ; 10/01/2023 + 3124 + 3125 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 3126 ;if 0 ; PCDOS 7.1 COMMAND.COM doesn't use 'RBADNAM' error msg here + 3127 %if 1 ; Retro DOS v5.0 COMMAND.COM (and MSDOS 6.22 COMMAND.COM) + 3128 ;mov bx,RBADNAM ; offset DATARES:RBadNam + 3129 00000D10 BA[B506] mov dx,RBADNAM + 3130 00000D13 3C02 cmp al,ERROR_FILE_NOT_FOUND ; 2 + 3131 00000D15 741B je short GotExecEMes ; bad command + 3132 %endif + 3133 ;mov bx,TOOBIG ; offset DATARES:TooBig + 3134 00000D17 BA[7B06] mov dx,TOOBIG + 3135 00000D1A 3C08 cmp al,ERROR_NOT_ENOUGH_MEMORY ; 8 + 3136 00000D1C 7414 je short GotExecEMes ; file not found + 3137 ;mov bx,EXEBAD ; offset DATARES:ExeBad + 3138 00000D1E BA[6706] mov dx,EXEBAD + 3139 00000D21 3C0B cmp al,ERROR_BAD_FORMAT ; 11 ; 0Bh + 3140 00000D23 740D je short GotExecEMes ; bad exe file + 3141 ;mov bx,ACCDEN ; offset DATARES:AccDen + 3142 00000D25 BA[D006] mov dx,ACCDEN + 3143 00000D28 3C05 cmp al,ERROR_ACCESS_DENIED ; 5 + 3144 00000D2A 7406 je short GotExecEMes ; access denied + 3145 + 3146 Default_Message: + 3147 ;mov bx,EXECEMES ; offset DATARES:ExecEMes + 3148 00000D2C BA[5306] mov dx,EXECEMES + 3149 ; default message + 3150 00000D2F BE[3002] mov si,ExecErrSubst ; offset DATARES:ExecErrSubst + 3151 ; get address of subst block + 3152 GotExecEMes: + 3153 ;mov dx,bx ; DX = ptr to msg + 3154 00000D32 E8A606 call RPrint ; invoke RPrint + 3155 00000D35 EB09 jmp short NoExec + 3156 + 3157 ; ---------------------------------------------------------------------------- + 3158 ;*** EXEC call + 3159 ; + 3160 ; The transient has set up everything for an EXEC system call. + 3161 ; For cleanliness, we issue the EXEC here in the resident + 3162 ; so that we may be able to recover cleanly upon success. + 3163 ; + 3164 ; CS,DS,ES,SS = DATARES seg addr + 3165 ; ---------------------------------------------------------------------------- + 3166 + 3167 Ext_Exec: + 3168 ;SR; + 3169 ; The words put on the stack by the stub will be popped off when we finally + 3170 ;jump to LodCom (by LodCom). + 3171 + 3172 ; 10/01/2023 + 3173 ;int 21h ; do the exec + 3174 ; 10/01/2023 - MSDOS 5.0 COMMAND.COM - RESGROUP:0D69h (CODERES:0029h) + 3175 Exec_Ret: + 3176 00000D37 72D7 jc short Exec_Err ; exec failed + 3177 + 3178 ; The exec has completed. Retrieve the exit code. + 3179 + 3180 Exec_Wait: + 3181 00000D39 B44D mov ah,4Dh + 3182 ;mov ah,WAITPROCESS ; 4Dh ; get errorlevel + 3183 00000D3B CD21 int 21h ; get the return code + 3184 ;mov [cs:RetCode],ax + 3185 ; 11/01/2023 + 3186 00000D3D A3[9A02] mov [RetCode],ax 3187 - 3188 NoExec: - 3189 ;SR; - 3190 ; ds = es = ss = DATARES when we jump to LodCom - 3191 ; - 3192 00000D40 E97A01 jmp LodCom - 3193 - 3194 ; ---------------------------------------------------------------------------- - 3195 ;*** Int 23 (ctrl-c) handler - 3196 ; - 3197 ; This is the default system INT 23 handler. All processes - 3198 ; (including COMMAND) get it by default. There are some - 3199 ; games that are played: We ignore ^C during most of the - 3200 ; INIT code. This is because we may perform an ALLOC and - 3201 ; diddle the header! Also, if we are prompting for date/time - 3202 ; in the init code, we are to treat ^C as empty responses. - 3203 ; --------------------------- - 3204 ; Bugbug: put init ctrl-c handling in init module. - 3205 ; ---------------------------------------------------------------------------- - 3206 - 3207 ;SR; - 3208 ;The stub has pushed the previous ds and DATARES onto the stack. We get - 3209 ;both these values off the stack now - 3210 ; - 3211 ;ContC proc far - 3212 - 3213 ; assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING - 3214 - 3215 ; 11/01/2023 - Retro DOS v5.40 COMMAND.COM - 3216 ; MSDOS 5.0 COMMAND.COM RESGROUP:0D75h (CODERES:0035h) - 3217 ContC: - 3218 00000D43 1F pop ds ; ds = DATARES - 3219 ; assume ds:DATARES - 3220 ;; pop word [OldDS] ; OldDS = old ds - 3221 - 3222 00000D44 F606[1203]01 test byte [InitFlag],INITINIT ; 1 - 3223 ;test byte [cs:INITFLAG],INITINIT ; 1 ; in initialization? - 3224 00000D49 740D jz short NotAtInit ; no - 3225 00000D4B F606[1203]02 test byte [InitFlag],INITSPECIAL ; 2 - 3226 ;test byte [cs:INITFLAG],INITSPECIAL ; 2 ; doing special stuff? - 3227 00000D50 7404 jz short CmdIret ; no, ignore ^C - 3228 00000D52 1F pop ds ; restore before jumping; M021 - 3229 ;jmp RESGROUP:Init_ContC_SpecialCase ; Yes, go handle it - 3230 00000D53 E9E90F jmp init_contc_specialcase - 3231 CmdIret: - 3232 ;SR; - 3233 ; Restore ds to its previous value - 3234 ; - 3235 - 3236 ;; mov ds,[OLdDS] ; - 3237 00000D56 1F pop ds - 3238 00000D57 CF iret ; yes, ignore the ^C - 3239 - 3240 NotAtInit: - 3241 00000D58 F606[1203]04 test byte [InitFlag],INITCTRLC ; 4 - 3242 ;test byte [cs:INITFLAG],INITCTRLC ; 4 ; are we already in a ^C? - 3243 00000D5D 7411 jz short NotInit ; nope too. - 3244 - 3245 ;* We are interrupting ourselves in this ^C handler. We need - 3246 ; to set carry and return to the user sans flags only if the - 3247 ; system call was a 1-12 one. Otherwise, we ignore the ^C. - 3248 - 3249 ;cmp ah,1 - 3250 ;jb short CmdIret - 3251 ; 19/07/2024 - 3252 00000D5F 84E4 test ah,ah - 3253 00000D61 74F3 jz short CmdIret - 3254 - 3255 00000D63 80FC0C cmp ah,12 - 3256 00000D66 77EE ja short CmdIret + 3188 ; See if we can reload the transient. The external command + 3189 ; may have overwritten part of the transient. + 3190 + 3191 NoExec: + 3192 ;SR; + 3193 ; ds = es = ss = DATARES when we jump to LodCom + 3194 ; + 3195 00000D40 E97A01 jmp LodCom + 3196 + 3197 ; ---------------------------------------------------------------------------- + 3198 ;*** Int 23 (ctrl-c) handler + 3199 ; + 3200 ; This is the default system INT 23 handler. All processes + 3201 ; (including COMMAND) get it by default. There are some + 3202 ; games that are played: We ignore ^C during most of the + 3203 ; INIT code. This is because we may perform an ALLOC and + 3204 ; diddle the header! Also, if we are prompting for date/time + 3205 ; in the init code, we are to treat ^C as empty responses. + 3206 ; --------------------------- + 3207 ; Bugbug: put init ctrl-c handling in init module. + 3208 ; ---------------------------------------------------------------------------- + 3209 + 3210 ;SR; + 3211 ;The stub has pushed the previous ds and DATARES onto the stack. We get + 3212 ;both these values off the stack now + 3213 ; + 3214 ;ContC proc far + 3215 + 3216 ; assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING + 3217 + 3218 ; 11/01/2023 - Retro DOS v5.40 COMMAND.COM + 3219 ; MSDOS 5.0 COMMAND.COM RESGROUP:0D75h (CODERES:0035h) + 3220 ContC: + 3221 00000D43 1F pop ds ; ds = DATARES + 3222 ; assume ds:DATARES + 3223 ;; pop word [OldDS] ; OldDS = old ds + 3224 + 3225 00000D44 F606[1203]01 test byte [InitFlag],INITINIT ; 1 + 3226 ;test byte [cs:INITFLAG],INITINIT ; 1 ; in initialization? + 3227 00000D49 740D jz short NotAtInit ; no + 3228 00000D4B F606[1203]02 test byte [InitFlag],INITSPECIAL ; 2 + 3229 ;test byte [cs:INITFLAG],INITSPECIAL ; 2 ; doing special stuff? + 3230 00000D50 7404 jz short CmdIret ; no, ignore ^C + 3231 00000D52 1F pop ds ; restore before jumping; M021 + 3232 ;jmp RESGROUP:Init_ContC_SpecialCase ; Yes, go handle it + 3233 00000D53 E9E90F jmp init_contc_specialcase + 3234 CmdIret: + 3235 ;SR; + 3236 ; Restore ds to its previous value + 3237 ; + 3238 + 3239 ;; mov ds,[OLdDS] ; + 3240 00000D56 1F pop ds + 3241 00000D57 CF iret ; yes, ignore the ^C + 3242 + 3243 NotAtInit: + 3244 00000D58 F606[1203]04 test byte [InitFlag],INITCTRLC ; 4 + 3245 ;test byte [cs:INITFLAG],INITCTRLC ; 4 ; are we already in a ^C? + 3246 00000D5D 7411 jz short NotInit ; nope too. + 3247 + 3248 ;* We are interrupting ourselves in this ^C handler. We need + 3249 ; to set carry and return to the user sans flags only if the + 3250 ; system call was a 1-12 one. Otherwise, we ignore the ^C. + 3251 + 3252 ;cmp ah,1 + 3253 ;jb short CmdIret + 3254 ; 19/07/2024 + 3255 00000D5F 84E4 test ah,ah + 3256 00000D61 74F3 jz short CmdIret 3257 - 3258 00000D68 1F pop ds ;restore ds to old value - 3259 00000D69 83C406 add sp,6 ; remove int frame - 3260 00000D6C F9 stc - 3261 - 3262 ;; mov ds,[OldDS] ;restore ds to its old value - 3263 00000D6D CA0200 retf 2 ; remove those flags... + 3258 00000D63 80FC0C cmp ah,12 + 3259 00000D66 77EE ja short CmdIret + 3260 + 3261 00000D68 1F pop ds ;restore ds to old value + 3262 00000D69 83C406 add sp,6 ; remove int frame + 3263 00000D6C F9 stc 3264 - 3265 NotInit: - 3266 - 3267 ;* We have now received a ^C for some process (maybe ourselves - 3268 ; but not at INIT). - 3269 ; - 3270 ; Note that we are running on the user's stack!!! Bad news if - 3271 ; any of the system calls below go and issue another INT - 3272 ; 24... Massive stack overflow! Another bad point is that - 3273 ; SavHand will save an already saved handle, thus losing a - 3274 ; possible redirection... - 3275 ; - 3276 ; All we need to do is set the flag to indicate nested ^C. - 3277 ; The above code will correctly flag the ^C diring the - 3278 ; message output and prompting while ignoring the ^C the rest - 3279 ; of the time. - 3280 ; - 3281 ; Clean up: flush disk. If we are in the middle of a batch - 3282 ; file, we ask if he wants to terminate it. If he does, then - 3283 ; we turn off all internal flags and let the DOS abort. - 3284 - 3285 00000D70 800E[1203]04 or byte [InitFlag],INITCTRLC ; 4 - 3286 ;or byte [cs:INITFLAG],INITCTRLC ; 4 ; nested ^c is on - 3287 00000D75 FB sti - 3288 - 3289 ; push cs ; el yucko! change the user's ds!! - 3290 ; pop ds + 3265 ;; mov ds,[OldDS] ;restore ds to its old value + 3266 00000D6D CA0200 retf 2 ; remove those flags... + 3267 + 3268 NotInit: + 3269 + 3270 ;* We have now received a ^C for some process (maybe ourselves + 3271 ; but not at INIT). + 3272 ; + 3273 ; Note that we are running on the user's stack!!! Bad news if + 3274 ; any of the system calls below go and issue another INT + 3275 ; 24... Massive stack overflow! Another bad point is that + 3276 ; SavHand will save an already saved handle, thus losing a + 3277 ; possible redirection... + 3278 ; + 3279 ; All we need to do is set the flag to indicate nested ^C. + 3280 ; The above code will correctly flag the ^C diring the + 3281 ; message output and prompting while ignoring the ^C the rest + 3282 ; of the time. + 3283 ; + 3284 ; Clean up: flush disk. If we are in the middle of a batch + 3285 ; file, we ask if he wants to terminate it. If he does, then + 3286 ; we turn off all internal flags and let the DOS abort. + 3287 + 3288 00000D70 800E[1203]04 or byte [InitFlag],INITCTRLC ; 4 + 3289 ;or byte [cs:INITFLAG],INITCTRLC ; 4 ; nested ^c is on + 3290 00000D75 FB sti 3291 - 3292 ; assume ds:RESGROUP - 3293 - 3294 00000D76 58 pop ax ; discard the old ds value - 3295 - 3296 00000D77 A1[A502] mov ax,[SingleCom] - 3297 00000D7A 09C0 or ax,ax - 3298 00000D7C 7506 jnz short NoReset - 3299 00000D7E 50 push ax - 3300 00000D7F B40D mov ah,DISK_RESET ; 0Dh - 3301 00000D81 CD21 int 21h ; reset disks in case files were open - 3302 00000D83 58 pop ax - 3303 - 3304 NoReset: - 3305 - 3306 ; In the generalized version of FOR, PIPE and BATCH, we would - 3307 ; walk the entire active list and free each segment. Here, - 3308 ; we just free the single batch segment. - 3309 - 3310 00000D84 F706[4902]FFFF test word [Batch],-1 ; 0FFFFh - 3311 00000D8A 7452 jz short ContCTerm - 3312 00000D8C 09C0 or ax,ax - 3313 00000D8E 754E jnz short ContCTerm - 3314 00000D90 E89402 call SavHand - 3315 00000D93 E8D903 call AskEnd ; ask if user wants to end batch - 3316 - 3317 ; If the carry flag is clear, we do NOT free up the batch file - 3318 - 3319 00000D96 7340 jnc short ContBatch - 3320 00000D98 8A0E[9D02] mov cl,[EchoFlag] ; get current echo flag - 3321 00000D9C 53 push bx - 3322 - 3323 ClearBatch: - 3324 00000D9D 8E06[4902] mov es,[Batch] ; get batch segment - 3325 ;mov di,20h - 3326 00000DA1 8B3E2000 mov di,[BATCHSEGMENT.BatFile] ; get offset of batch file name - 3327 ; MSDOS 5.0 & MSDOS 6.0 (ES:5) - 3328 ;mov bx,es:BatForPtr ; get old FOR segment - 3329 00000DA5 268B1E0500 mov bx,[es:BATCHSEGMENT.BatForPtr] ; [es:5] - 3330 ; MSDOS 3.3 ([ES:4]) - 3331 ;mov bx,[es:BATCHSEGMENT.BatForPtr] ; [es:4] ; get old FOR segment - 3332 ; - 3333 ; 19/07/2024 - 3334 ;cmp bx,0 ; is a FOR in progress - 3335 ;je short No_Bat_For ; no - don't deallocate - 3336 00000DAA 85DB test bx,bx - 3337 00000DAC 7408 jz short No_Bat_For - 3338 - 3339 00000DAE 06 push es ; - 3340 00000DAF 8EC3 mov es,bx ; yes - free it up... - 3341 00000DB1 B449 mov ah,49h - 3342 ;mov ah,DEALLOC ; 49h ; - 3343 00000DB3 CD21 int 21h ; - 3344 00000DB5 07 pop es ; restore to batch segment - 3345 - 3346 No_Bat_For: - 3347 ;mov cl,[es:1] - 3348 00000DB6 268A0E0100 mov cl,[es:BATCHSEGMENT.BatEchoFlag] ; get old echo flag - 3349 ;mov bx,[es:3] - 3350 00000DBB 268B1E0300 mov bx,[es:BATCHSEGMENT.BatLast] ; get old batch segment - 3351 00000DC0 B449 mov ah,49h - 3352 ;mov ah,DEALLOC ; 49h ; free it up... - 3353 00000DC2 CD21 int 21h - 3354 00000DC4 891E[4902] mov [Batch],bx ; get ready to deallocate next batch - 3355 00000DC8 FF0E[AE02] dec word [Nest] ; is there another batch file? - 3356 00000DCC 75CF jnz short ClearBatch ; keep going until no batch file - 3357 - 3358 ; We are terminating a batch file; restore the echo status - 3359 - 3360 ;Shell_Bat_Cont: ; continue batch for SHELL - 3361 00000DCE 5B pop bx - 3362 00000DCF 880E[9D02] mov [EchoFlag],cl ; reset echo status - 3363 ; 29/05/2018 - 3364 00000DD3 C606[1303]00 mov byte [PipeFlag],0 ; turn off pipeflag - 3365 - 3366 ContBatch: - 3367 00000DD8 E8FD05 call crlf ; print out crlf before returning - 3368 00000DDB E87302 call RestHand - 3369 - 3370 ; Yes, we are terminating. Turn off flags and allow the DOS to abort. - 3371 - 3372 ContCTerm: - 3373 00000DDE 31C0 xor ax,ax ; indicate no read - 3374 00000DE0 89C5 mov bp,ax - 3375 - 3376 ; The following resetting of the state flags is good for the - 3377 ; generalized batch processing. + 3292 ; push cs ; el yucko! change the user's ds!! + 3293 ; pop ds + 3294 + 3295 ; assume ds:RESGROUP + 3296 + 3297 00000D76 58 pop ax ; discard the old ds value + 3298 + 3299 00000D77 A1[A502] mov ax,[SingleCom] + 3300 00000D7A 09C0 or ax,ax + 3301 00000D7C 7506 jnz short NoReset + 3302 00000D7E 50 push ax + 3303 00000D7F B40D mov ah,DISK_RESET ; 0Dh + 3304 00000D81 CD21 int 21h ; reset disks in case files were open + 3305 00000D83 58 pop ax + 3306 + 3307 NoReset: + 3308 + 3309 ; In the generalized version of FOR, PIPE and BATCH, we would + 3310 ; walk the entire active list and free each segment. Here, + 3311 ; we just free the single batch segment. + 3312 + 3313 00000D84 F706[4902]FFFF test word [Batch],-1 ; 0FFFFh + 3314 00000D8A 7452 jz short ContCTerm + 3315 00000D8C 09C0 or ax,ax + 3316 00000D8E 754E jnz short ContCTerm + 3317 00000D90 E89402 call SavHand + 3318 00000D93 E8D903 call AskEnd ; ask if user wants to end batch + 3319 + 3320 ; If the carry flag is clear, we do NOT free up the batch file + 3321 + 3322 00000D96 7340 jnc short ContBatch + 3323 00000D98 8A0E[9D02] mov cl,[EchoFlag] ; get current echo flag + 3324 00000D9C 53 push bx + 3325 + 3326 ClearBatch: + 3327 00000D9D 8E06[4902] mov es,[Batch] ; get batch segment + 3328 ;mov di,20h + 3329 00000DA1 8B3E2000 mov di,[BATCHSEGMENT.BatFile] ; get offset of batch file name + 3330 ; MSDOS 5.0 & MSDOS 6.0 (ES:5) + 3331 ;mov bx,es:BatForPtr ; get old FOR segment + 3332 00000DA5 268B1E0500 mov bx,[es:BATCHSEGMENT.BatForPtr] ; [es:5] + 3333 ; MSDOS 3.3 ([ES:4]) + 3334 ;mov bx,[es:BATCHSEGMENT.BatForPtr] ; [es:4] ; get old FOR segment + 3335 ; + 3336 ; 19/07/2024 + 3337 ;cmp bx,0 ; is a FOR in progress + 3338 ;je short No_Bat_For ; no - don't deallocate + 3339 00000DAA 85DB test bx,bx + 3340 00000DAC 7408 jz short No_Bat_For + 3341 + 3342 00000DAE 06 push es ; + 3343 00000DAF 8EC3 mov es,bx ; yes - free it up... + 3344 00000DB1 B449 mov ah,49h + 3345 ;mov ah,DEALLOC ; 49h ; + 3346 00000DB3 CD21 int 21h ; + 3347 00000DB5 07 pop es ; restore to batch segment + 3348 + 3349 No_Bat_For: + 3350 ;mov cl,[es:1] + 3351 00000DB6 268A0E0100 mov cl,[es:BATCHSEGMENT.BatEchoFlag] ; get old echo flag + 3352 ;mov bx,[es:3] + 3353 00000DBB 268B1E0300 mov bx,[es:BATCHSEGMENT.BatLast] ; get old batch segment + 3354 00000DC0 B449 mov ah,49h + 3355 ;mov ah,DEALLOC ; 49h ; free it up... + 3356 00000DC2 CD21 int 21h + 3357 00000DC4 891E[4902] mov [Batch],bx ; get ready to deallocate next batch + 3358 00000DC8 FF0E[AE02] dec word [Nest] ; is there another batch file? + 3359 00000DCC 75CF jnz short ClearBatch ; keep going until no batch file + 3360 + 3361 ; We are terminating a batch file; restore the echo status + 3362 + 3363 ;Shell_Bat_Cont: ; continue batch for SHELL + 3364 00000DCE 5B pop bx + 3365 00000DCF 880E[9D02] mov [EchoFlag],cl ; reset echo status + 3366 ; 29/05/2018 + 3367 00000DD3 C606[1303]00 mov byte [PipeFlag],0 ; turn off pipeflag + 3368 + 3369 ContBatch: + 3370 00000DD8 E8FD05 call crlf ; print out crlf before returning + 3371 00000DDB E87302 call RestHand + 3372 + 3373 ; Yes, we are terminating. Turn off flags and allow the DOS to abort. + 3374 + 3375 ContCTerm: + 3376 00000DDE 31C0 xor ax,ax ; indicate no read + 3377 00000DE0 89C5 mov bp,ax 3378 - 3379 00000DE2 A2[AA02] mov [IfFlag],al ; turn off iffing - 3380 00000DE5 A2[AB02] mov [ForFlag],al ; turn off for processing - 3381 00000DE8 E81C00 call ResPipeOff - 3382 00000DEB 3906[A502] cmp [SingleCom],ax ; see if we need to set SingleCom - 3383 00000DEF 7406 jz short NoSetSing - 3384 00000DF1 C706[A502]FFFF mov word [SingleCom],-1 ; cause termination on - 3385 ; pipe, batch, for - 3386 NoSetSing: - 3387 - 3388 ; If we are doing an internal command, go through the reload process. - 3389 ; If we are doing an external, let DOS abort the process. - 3390 ; In both cases, we are now done with the ^C processing. - 3391 - 3392 00000DF7 8026[1203]FB and byte [InitFlag],~INITCTRLC ; 0FBh - 3393 00000DFC 3806[9902] cmp [ExtCom],al - 3394 00000E00 7503 jnz short DoDAb ; internal ^c - 3395 00000E02 E94701 jmp LodCom1 - 3396 DoDAb: - 3397 00000E05 F9 stc ; tell dos to abort - 3398 - 3399 ;SR; - 3400 ;We dont need to restore ds here because we are forcing DOS to do an abort - 3401 ;by setting carry and leaving flags on the stack - 3402 - 3403 00000E06 CB retf ; Leave flags on stack - 3404 - 3405 ;ContC endp - 3406 - 3407 ;SR; - 3408 ;ds = DATARES on entry. This routine is called from DskErr and LodCom1 and - 3409 ;both have ds = DATARES - 3410 - 3411 ; 11/01/2023 - 3412 ResPipeOff: - 3413 00000E07 50 push ax - 3414 00000E08 31C0 xor ax,ax - 3415 ;xchg al,[cs:PIPEFLAG] - 3416 00000E0A 8606[1303] xchg al,[PipeFlag] - 3417 00000E0E 08C0 or al,al - 3418 00000E10 7404 jz short NoPipePop - 3419 ;shr byte [cs:ECHOFLAG],1 - 3420 00000E12 D02E[9D02] shr byte [EchoFlag],1 - 3421 NoPipePop: - 3422 00000E16 58 pop ax - 3423 00000E17 C3 retn - 3424 - 3425 ;CODERES ends - 3426 - 3427 ;============================================================================= - 3428 ; COMMAND2.ASM, MSDOS 6.0, 1991 - 3429 ;============================================================================= - 3430 ; 21/09/2018 - Retro DOS v3.0 - 3431 - 3432 ; title COMMAND2 - resident code for COMMAND.COM part II - 3433 ; name COMMAND2 + 3379 ; The following resetting of the state flags is good for the + 3380 ; generalized batch processing. + 3381 + 3382 00000DE2 A2[AA02] mov [IfFlag],al ; turn off iffing + 3383 00000DE5 A2[AB02] mov [ForFlag],al ; turn off for processing + 3384 00000DE8 E81C00 call ResPipeOff + 3385 00000DEB 3906[A502] cmp [SingleCom],ax ; see if we need to set SingleCom + 3386 00000DEF 7406 jz short NoSetSing + 3387 00000DF1 C706[A502]FFFF mov word [SingleCom],-1 ; cause termination on + 3388 ; pipe, batch, for + 3389 NoSetSing: + 3390 + 3391 ; If we are doing an internal command, go through the reload process. + 3392 ; If we are doing an external, let DOS abort the process. + 3393 ; In both cases, we are now done with the ^C processing. + 3394 + 3395 00000DF7 8026[1203]FB and byte [InitFlag],~INITCTRLC ; 0FBh + 3396 00000DFC 3806[9902] cmp [ExtCom],al + 3397 00000E00 7503 jnz short DoDAb ; internal ^c + 3398 00000E02 E94701 jmp LodCom1 + 3399 DoDAb: + 3400 00000E05 F9 stc ; tell dos to abort + 3401 + 3402 ;SR; + 3403 ;We dont need to restore ds here because we are forcing DOS to do an abort + 3404 ;by setting carry and leaving flags on the stack + 3405 + 3406 00000E06 CB retf ; Leave flags on stack + 3407 + 3408 ;ContC endp + 3409 + 3410 ;SR; + 3411 ;ds = DATARES on entry. This routine is called from DskErr and LodCom1 and + 3412 ;both have ds = DATARES + 3413 + 3414 ; 11/01/2023 + 3415 ResPipeOff: + 3416 00000E07 50 push ax + 3417 00000E08 31C0 xor ax,ax + 3418 ;xchg al,[cs:PIPEFLAG] + 3419 00000E0A 8606[1303] xchg al,[PipeFlag] + 3420 00000E0E 08C0 or al,al + 3421 00000E10 7404 jz short NoPipePop + 3422 ;shr byte [cs:ECHOFLAG],1 + 3423 00000E12 D02E[9D02] shr byte [EchoFlag],1 + 3424 NoPipePop: + 3425 00000E16 58 pop ax + 3426 00000E17 C3 retn + 3427 + 3428 ;CODERES ends + 3429 + 3430 ;============================================================================= + 3431 ; COMMAND2.ASM, MSDOS 6.0, 1991 + 3432 ;============================================================================= + 3433 ; 21/09/2018 - Retro DOS v3.0 3434 - 3435 ;/* - 3436 ; * Microsoft Confidential - 3437 ; * Copyright (C) Microsoft Corporation 1991 - 3438 ; * All Rights Reserved. - 3439 ; */ - 3440 - 3441 ; - 3442 ; Revision History - 3443 ; ================ + 3435 ; title COMMAND2 - resident code for COMMAND.COM part II + 3436 ; name COMMAND2 + 3437 + 3438 ;/* + 3439 ; * Microsoft Confidential + 3440 ; * Copyright (C) Microsoft Corporation 1991 + 3441 ; * All Rights Reserved. + 3442 ; */ + 3443 3444 ; - 3445 ; M038 SR 11/5/90 Changed stuff for Novell RPL. These guys cannot - 3446 ; reserve memory by changing int 12h and then give it - 3447 ; back to DOS by changing arenas in autoexec.bat. - 3448 ; This makes command.com reload transient and this - 3449 ; cannot be done at this stage. - 3450 ; - 3451 - 3452 ;CODERES segment public byte - 3453 - 3454 ;* If we cannot allocate enough memory for the transient or there - 3455 ; was some other allocation error, we display a message and - 3456 ; then die. - 3457 - 3458 ;SR; - 3459 ; We will have to make sure that at this entry point and at FatalC, - 3460 ;ds = DATARES. All jumps to these points are made from only within this file - 3461 ;and so we should be able to do this - 3462 - 3463 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 3464 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0E4Bh (CODERES:010Bh) + 3445 ; Revision History + 3446 ; ================ + 3447 ; + 3448 ; M038 SR 11/5/90 Changed stuff for Novell RPL. These guys cannot + 3449 ; reserve memory by changing int 12h and then give it + 3450 ; back to DOS by changing arenas in autoexec.bat. + 3451 ; This makes command.com reload transient and this + 3452 ; cannot be done at this stage. + 3453 ; + 3454 + 3455 ;CODERES segment public byte + 3456 + 3457 ;* If we cannot allocate enough memory for the transient or there + 3458 ; was some other allocation error, we display a message and + 3459 ; then die. + 3460 + 3461 ;SR; + 3462 ; We will have to make sure that at this entry point and at FatalC, + 3463 ;ds = DATARES. All jumps to these points are made from only within this file + 3464 ;and so we should be able to do this 3465 - 3466 ;assume ds:DATARES - 3467 BadMemErr: - 3468 00000E18 BA[DE06] mov dx,BMEMMES ; DX = ptr to msg - 3469 FatalC: - 3470 ; 12/01/2023 - 3471 ;; push cs - 3472 ;; pop ds - 3473 ;; assume ds:ResGroup - 3474 ; invoke RPrint - 3475 - 3476 ; 12/01/2023 - 3477 ; MSDOS 5.0 (& MSDOS 6.0-6.22) - 3478 00000E1B E8BD05 call RPrint - 3479 - 3480 ; MSDOS 3.3 - 3481 ;call RDISPMSG + 3466 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 3467 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0E4Bh (CODERES:010Bh) + 3468 + 3469 ;assume ds:DATARES + 3470 BadMemErr: + 3471 00000E18 BA[DE06] mov dx,BMEMMES ; DX = ptr to msg + 3472 FatalC: + 3473 ; 12/01/2023 + 3474 ;; push cs + 3475 ;; pop ds + 3476 ;; assume ds:ResGroup + 3477 ; invoke RPrint + 3478 + 3479 ; 12/01/2023 + 3480 ; MSDOS 5.0 (& MSDOS 6.0-6.22) + 3481 00000E1B E8BD05 call RPrint 3482 - 3483 ; If this is NOT a permanent (top-level) COMMAND, then we exit; - 3484 ; we can't do anything else! + 3483 ; MSDOS 3.3 + 3484 ;call RDISPMSG 3485 - 3486 00000E1E 803E[A202]00 cmp byte [PermCom],0 - 3487 00000E23 7410 je short FatalRet + 3486 ; If this is NOT a permanent (top-level) COMMAND, then we exit; + 3487 ; we can't do anything else! 3488 - 3489 ; We are a permanent command. If we are in the process of the - 3490 ; magic interrupt (Singlecom) then exit too. + 3489 00000E1E 803E[A202]00 cmp byte [PermCom],0 + 3490 00000E23 7410 je short FatalRet 3491 - 3492 00000E25 833E[A502]00 cmp word [SingleCom],0 ; if PermCom and SingleCom - 3493 00000E2A 7509 jne short FatalRet ; must take int_2e exit + 3492 ; We are a permanent command. If we are in the process of the + 3493 ; magic interrupt (Singlecom) then exit too. 3494 - 3495 ; Permanent command. We can't do ANYthing except halt. - 3496 - 3497 00000E2C BA[F806] mov dx,HALTMES ; DX = ptr to msg - 3498 ;invoke RPrint - 3499 ; 12/01/2023 - 3500 ; MSDOS 5.0 (& MSDOS 6.0-6.22) - 3501 00000E2F E8A905 call RPrint - 3502 ; MSDOS 3.3 - 3503 ;call RDISPMSG - 3504 00000E32 FB sti - 3505 Stall: - 3506 00000E33 EBFE jmp short Stall ; crash the system nicely - 3507 - 3508 FatalRet: - 3509 00000E35 BA[1F07] mov dx,FRETMES ; DX = ptr to msg - 3510 ;call RDISPMSG - 3511 ; 12/01/2023 - 3512 00000E38 E8A005 call RPrint - 3513 FatalRet2: - 3514 00000E3B 803E[A202]00 cmp byte [PermCom],0 ; if we get here and PermCom, - 3515 00000E40 7519 jne short Ret_2e ; must be int_2e - 3516 - 3517 ; Bugbug: this is where we'd want to unhook int 2F, *if* we - 3518 ; were a non-permanent COMMAND that had hooked it! (Just in - 3519 ; case we decide to do that.) - 3520 - 3521 00000E42 A1[3E02] mov ax,[Parent] - 3522 ;mov [16h],ax - 3523 00000E45 A31600 mov [PDB.PARENT_PID],ax ; mov [cs:16h],ax - 3524 00000E48 A1[4002] mov ax,[OldTerm] - 3525 ;mov [0Ah],ax - 3526 00000E4B A30A00 mov [PDB.EXIT],ax ; mov [cs:0Ah],ax - 3527 00000E4E A1[4202] mov ax,[OldTerm+2] - 3528 ;mov [0Ch],ax - 3529 00000E51 A30C00 mov [PDB.EXIT+2],ax ; mov [cs:0Ch],ax - 3530 ;mov ax,4C00h - 3531 ;;mov ax,(EXIT<<8) ; 4C00h ; return to lower level - 3532 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 3533 00000E54 B44C mov ah,4Ch ; EXIT - 3534 00000E56 A0[9A02] mov al,[RetCode] - 3535 00000E59 CD21 int 21h - 3536 Ret_2e: - 3537 ;SR; - 3538 ; We will ensure that ds = DATARES for all entries to this place - 3539 ; - 3540 - 3541 ;; push cs - 3542 ;; pop ds - 3543 ;; assume ds:resgroup,es:nothing,ss:nothing - 3544 - 3545 ; assume ds:DATARES - 3546 - 3547 ;PUSH CS - 3548 ;POP DS + 3495 00000E25 833E[A502]00 cmp word [SingleCom],0 ; if PermCom and SingleCom + 3496 00000E2A 7509 jne short FatalRet ; must take int_2e exit + 3497 + 3498 ; Permanent command. We can't do ANYthing except halt. + 3499 + 3500 00000E2C BA[F806] mov dx,HALTMES ; DX = ptr to msg + 3501 ;invoke RPrint + 3502 ; 12/01/2023 + 3503 ; MSDOS 5.0 (& MSDOS 6.0-6.22) + 3504 00000E2F E8A905 call RPrint + 3505 ; MSDOS 3.3 + 3506 ;call RDISPMSG + 3507 00000E32 FB sti + 3508 Stall: + 3509 00000E33 EBFE jmp short Stall ; crash the system nicely + 3510 + 3511 FatalRet: + 3512 00000E35 BA[1F07] mov dx,FRETMES ; DX = ptr to msg + 3513 ;call RDISPMSG + 3514 ; 12/01/2023 + 3515 00000E38 E8A005 call RPrint + 3516 FatalRet2: + 3517 00000E3B 803E[A202]00 cmp byte [PermCom],0 ; if we get here and PermCom, + 3518 00000E40 7519 jne short Ret_2e ; must be int_2e + 3519 + 3520 ; Bugbug: this is where we'd want to unhook int 2F, *if* we + 3521 ; were a non-permanent COMMAND that had hooked it! (Just in + 3522 ; case we decide to do that.) + 3523 + 3524 00000E42 A1[3E02] mov ax,[Parent] + 3525 ;mov [16h],ax + 3526 00000E45 A31600 mov [PDB.PARENT_PID],ax ; mov [cs:16h],ax + 3527 00000E48 A1[4002] mov ax,[OldTerm] + 3528 ;mov [0Ah],ax + 3529 00000E4B A30A00 mov [PDB.EXIT],ax ; mov [cs:0Ah],ax + 3530 00000E4E A1[4202] mov ax,[OldTerm+2] + 3531 ;mov [0Ch],ax + 3532 00000E51 A30C00 mov [PDB.EXIT+2],ax ; mov [cs:0Ch],ax + 3533 ;mov ax,4C00h + 3534 ;;mov ax,(EXIT<<8) ; 4C00h ; return to lower level + 3535 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 3536 00000E54 B44C mov ah,4Ch ; EXIT + 3537 00000E56 A0[9A02] mov al,[RetCode] + 3538 00000E59 CD21 int 21h + 3539 Ret_2e: + 3540 ;SR; + 3541 ; We will ensure that ds = DATARES for all entries to this place + 3542 ; + 3543 + 3544 ;; push cs + 3545 ;; pop ds + 3546 ;; assume ds:resgroup,es:nothing,ss:nothing + 3547 + 3548 ; assume ds:DATARES 3549 - 3550 00000E5B C706[A502]0000 mov word [SingleCom],0 ; turn off SingleCom - 3551 00000E61 8E06[5804] mov es,[Res_Tpa] - 3552 ;mov ah,49h ; 12/01/2023 - 3553 00000E65 B449 mov ah,DEALLOC - 3554 00000E67 CD21 int 21h ; free up space used by transient - 3555 00000E69 8B1E[3C02] mov bx,[Save_Pdb] - 3556 00000E6D B450 mov ah,50h - 3557 ;mov ah,SET_CURRENT_PDB ; 50h - 3558 00000E6F CD21 int 21h ; current process is user - 3559 00000E71 A1[9A02] mov ax,[RetCode] - 3560 00000E74 803E[9902]00 cmp byte [ExtCom],0 - 3561 00000E79 7502 jne short GotECode - 3562 00000E7B 31C0 xor ax,ax ; internals always return 0 - 3563 GotECode: - 3564 00000E7D C606[9902]01 mov byte [ExtCom],1 ; force external - 3565 - 3566 ;SR; This is actually returning to the caller. However, the old code had - 3567 ;ds = RESGROUP so I guess we can keep ds = DATARES for us. - 3568 ;Yes, int 2eh can corrupt all registers so we are ok. - 3569 - 3570 ; 12/01/2023 - 3571 00000E82 FF2E[3802] jmp far [Int_2e_Ret] ; "iret" + 3550 ;PUSH CS + 3551 ;POP DS + 3552 + 3553 00000E5B C706[A502]0000 mov word [SingleCom],0 ; turn off SingleCom + 3554 00000E61 8E06[5804] mov es,[Res_Tpa] + 3555 ;mov ah,49h ; 12/01/2023 + 3556 00000E65 B449 mov ah,DEALLOC + 3557 00000E67 CD21 int 21h ; free up space used by transient + 3558 00000E69 8B1E[3C02] mov bx,[Save_Pdb] + 3559 00000E6D B450 mov ah,50h + 3560 ;mov ah,SET_CURRENT_PDB ; 50h + 3561 00000E6F CD21 int 21h ; current process is user + 3562 00000E71 A1[9A02] mov ax,[RetCode] + 3563 00000E74 803E[9902]00 cmp byte [ExtCom],0 + 3564 00000E79 7502 jne short GotECode + 3565 00000E7B 31C0 xor ax,ax ; internals always return 0 + 3566 GotECode: + 3567 00000E7D C606[9902]01 mov byte [ExtCom],1 ; force external + 3568 + 3569 ;SR; This is actually returning to the caller. However, the old code had + 3570 ;ds = RESGROUP so I guess we can keep ds = DATARES for us. + 3571 ;Yes, int 2eh can corrupt all registers so we are ok. 3572 - 3573 ;*** Int_2e, magic command executer - 3574 - 3575 Int_2e: - 3576 ;assume ds:NOTHING,es:NOTHING,ss:NOTHING - 3577 ;SR; - 3578 ;We are going to come here from the stub with the old ds and DATARES value - 3579 ;pushed on the stack in that order. Pick up this stuff off the stack - 3580 - 3581 ; 12/01/2023 - Retro DOS v4.0 COMMAND.COM - 3582 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0EB7h (CODERES:0177h) + 3573 ; 12/01/2023 + 3574 00000E82 FF2E[3802] jmp far [Int_2e_Ret] ; "iret" + 3575 + 3576 ;*** Int_2e, magic command executer + 3577 + 3578 Int_2e: + 3579 ;assume ds:NOTHING,es:NOTHING,ss:NOTHING + 3580 ;SR; + 3581 ;We are going to come here from the stub with the old ds and DATARES value + 3582 ;pushed on the stack in that order. Pick up this stuff off the stack 3583 - 3584 00000E86 1F pop ds ; ds = DATARES - 3585 ;assume ds:DATARES - 3586 00000E87 58 pop ax - 3587 ; ;pop ds:OldDS ; Save old value of ds - 3588 - 3589 ;pop word [cs:Int_2e_Ret] - 3590 ;pop word [cs:Int_2e_Ret+2] ; store return address - 3591 ;pop ax ; chuck flags - 3592 00000E88 8F06[3802] pop word [Int_2e_Ret] - 3593 00000E8C 8F06[3A02] pop word [Int_2e_Ret+2] - 3594 - 3595 00000E90 83C402 add sp,2 - 3596 - 3597 ;; push cs - 3598 ;; pop es + 3584 ; 12/01/2023 - Retro DOS v4.0 COMMAND.COM + 3585 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0EB7h (CODERES:0177h) + 3586 + 3587 00000E86 1F pop ds ; ds = DATARES + 3588 ;assume ds:DATARES + 3589 00000E87 58 pop ax + 3590 ; ;pop ds:OldDS ; Save old value of ds + 3591 + 3592 ;pop word [cs:Int_2e_Ret] + 3593 ;pop word [cs:Int_2e_Ret+2] ; store return address + 3594 ;pop ax ; chuck flags + 3595 00000E88 8F06[3802] pop word [Int_2e_Ret] + 3596 00000E8C 8F06[3A02] pop word [Int_2e_Ret+2] + 3597 + 3598 00000E90 83C402 add sp,2 3599 - 3600 00000E93 1E push ds - 3601 00000E94 07 pop es ; es = DATARES - 3602 ; ;mov ds,OldDS - 3603 00000E95 8ED8 mov ds,ax - 3604 ;assume ds:nothing ; ds = old value - 3605 - 3606 00000E97 BF8000 mov di,80h - 3607 00000E9A B94000 mov cx,64 - 3608 ; Bugbug: cld - 3609 00000E9D F3A5 rep movsw - 3610 00000E9F B451 mov ah,51h - 3611 ;mov ah,GET_CURRENT_PDB ; 51h - 3612 00000EA1 CD21 int 21h ; get user's header - 3613 ; 12/01/2023 - 3614 00000EA3 26891E[3C02] mov [es:Save_Pdb],bx - 3615 ;mov [cs:Save_Pdb],bx - 3616 00000EA8 B450 mov ah,50h - 3617 ;mov ah,SET_CURRENT_PDB ; 50h - 3618 - 3619 ;; mov bx,cs - 3620 ;SR; - 3621 ;Set ds = DATARES because BadMemErr expects this - 3622 - 3623 ; 12/01/2023 - 3624 00000EAA 06 push es - 3625 00000EAB 1F pop ds - 3626 ;assume ds:DATARES - 3627 - 3628 00000EAC 8CDB mov bx,ds ; es = our PSP now - 3629 ;mov bx,cs + 3600 ;; push cs + 3601 ;; pop es + 3602 + 3603 00000E93 1E push ds + 3604 00000E94 07 pop es ; es = DATARES + 3605 ; ;mov ds,OldDS + 3606 00000E95 8ED8 mov ds,ax + 3607 ;assume ds:nothing ; ds = old value + 3608 + 3609 00000E97 BF8000 mov di,80h + 3610 00000E9A B94000 mov cx,64 + 3611 ; Bugbug: cld + 3612 00000E9D F3A5 rep movsw + 3613 00000E9F B451 mov ah,51h + 3614 ;mov ah,GET_CURRENT_PDB ; 51h + 3615 00000EA1 CD21 int 21h ; get user's header + 3616 ; 12/01/2023 + 3617 00000EA3 26891E[3C02] mov [es:Save_Pdb],bx + 3618 ;mov [cs:Save_Pdb],bx + 3619 00000EA8 B450 mov ah,50h + 3620 ;mov ah,SET_CURRENT_PDB ; 50h + 3621 + 3622 ;; mov bx,cs + 3623 ;SR; + 3624 ;Set ds = DATARES because BadMemErr expects this + 3625 + 3626 ; 12/01/2023 + 3627 00000EAA 06 push es + 3628 00000EAB 1F pop ds + 3629 ;assume ds:DATARES 3630 - 3631 00000EAE CD21 int 21h ; current process is me - 3632 ;mov word [cs:SingleCom],81h - 3633 ;mov byte [cs:ExtCom],1 ; make sure this case forced - 3634 ; 12/01/2023 - 3635 00000EB0 C706[A502]8100 mov word [SingleCom],81h - 3636 00000EB6 C606[9902]01 mov byte [ExtCom],1 ; make sure this case forced - 3637 - 3638 ;SR; - 3639 ;We can enter LodCom directly after a command shell is terminated or we - 3640 ;can fall thru from above. When we enter directly from the stub, the stack - 3641 ;has the old ds value and the data seg value on the stack, so that ds can - 3642 ;be properly set. To fake this, we push dummy values here. - 3643 - 3644 ; 12/01/2023 - 3645 00000EBB 1E push ds ; old value of ds - 3646 00000EBC 1E push ds ; data seg value, ds = DATARES - 3647 LodCom: ; termination handler - 3648 00000EBD 1F pop ds ; ds = DATARES - 3649 ;assume ds:DATARES - 3650 00000EBE 83C402 add sp,2 - 3651 ; ;pop OldDS ; store old ds - 3652 ;cmp ExtCom,0 - 3653 00000EC1 803E[9902]00 cmp byte [ExtCom],0 - 3654 ;cmp byte [cs:ExtCom],0 - 3655 ;jne short @f ; internal cmd - memory allocated - 3656 ; 16/04/2023 - 3657 00000EC6 7503 jne short LodCom0 ; 24/09/2018 - 3658 00000EC8 E98100 jmp LodCom1 - 3659 ;je short LodCom1 ; 25/09/2018 - 3660 ;@@: - 3661 LodCom0: ; 24/09/2018 - 3662 00000ECB BBFFFF mov bx,0FFFFh - 3663 00000ECE B448 mov ah,48h ; 12/01/2023 - 3664 ;mov ah,ALLOC ; 48h - 3665 00000ED0 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 3666 ; BX = number of 16-byte paragraphs desired - 3667 00000ED2 E80A00 call SetSize - 3668 00000ED5 83C020 add ax,20h - 3669 00000ED8 39C3 cmp bx,ax - 3670 00000EDA 730B jnb short MemOk ; > 512 byte buffer - good enough - 3671 BadMemErrJ: - 3672 00000EDC E939FF jmp BadMemErr ; not enough memory - 3673 - 3674 ;*** SetSize - get transient size in paragraphs - 3675 - 3676 SetSize: - 3677 ; 12/01/2023 - 3678 ;;;mov ax,offset TRANGROUP:TranSpaceEnd + 15 - 3679 ;;mov ax,98D4h ; MSDOS 5.0 COMMAND.COM - 3680 ; 05/06/2023 - 3681 ;mov ax,0AFA4h ; MSDOS 6.22 COMMAND.COM - 3682 00000EDF B81AA6 mov ax,TRANSPACEEND+15 ; mov AX,4D6Bh ; MSDOS 3.3 - 3683 00000EE2 B104 mov cl,4 - 3684 00000EE4 D3E8 shr ax,cl - 3685 00000EE6 C3 retn - 3686 - 3687 MemOk: - 3688 ;assume ds:DATARES ;we have set ds = DATARES + 3631 00000EAC 8CDB mov bx,ds ; es = our PSP now + 3632 ;mov bx,cs + 3633 + 3634 00000EAE CD21 int 21h ; current process is me + 3635 ;mov word [cs:SingleCom],81h + 3636 ;mov byte [cs:ExtCom],1 ; make sure this case forced + 3637 ; 12/01/2023 + 3638 00000EB0 C706[A502]8100 mov word [SingleCom],81h + 3639 00000EB6 C606[9902]01 mov byte [ExtCom],1 ; make sure this case forced + 3640 + 3641 ;SR; + 3642 ;We can enter LodCom directly after a command shell is terminated or we + 3643 ;can fall thru from above. When we enter directly from the stub, the stack + 3644 ;has the old ds value and the data seg value on the stack, so that ds can + 3645 ;be properly set. To fake this, we push dummy values here. + 3646 + 3647 ; 12/01/2023 + 3648 00000EBB 1E push ds ; old value of ds + 3649 00000EBC 1E push ds ; data seg value, ds = DATARES + 3650 LodCom: ; termination handler + 3651 00000EBD 1F pop ds ; ds = DATARES + 3652 ;assume ds:DATARES + 3653 00000EBE 83C402 add sp,2 + 3654 ; ;pop OldDS ; store old ds + 3655 ;cmp ExtCom,0 + 3656 00000EC1 803E[9902]00 cmp byte [ExtCom],0 + 3657 ;cmp byte [cs:ExtCom],0 + 3658 ;jne short @f ; internal cmd - memory allocated + 3659 ; 16/04/2023 + 3660 00000EC6 7503 jne short LodCom0 ; 24/09/2018 + 3661 00000EC8 E98100 jmp LodCom1 + 3662 ;je short LodCom1 ; 25/09/2018 + 3663 ;@@: + 3664 LodCom0: ; 24/09/2018 + 3665 00000ECB BBFFFF mov bx,0FFFFh + 3666 00000ECE B448 mov ah,48h ; 12/01/2023 + 3667 ;mov ah,ALLOC ; 48h + 3668 00000ED0 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 3669 ; BX = number of 16-byte paragraphs desired + 3670 00000ED2 E80A00 call SetSize + 3671 00000ED5 83C020 add ax,20h + 3672 00000ED8 39C3 cmp bx,ax + 3673 00000EDA 730B jnb short MemOk ; > 512 byte buffer - good enough + 3674 BadMemErrJ: + 3675 00000EDC E939FF jmp BadMemErr ; not enough memory + 3676 + 3677 ;*** SetSize - get transient size in paragraphs + 3678 + 3679 SetSize: + 3680 ; 12/01/2023 + 3681 ;;;mov ax,offset TRANGROUP:TranSpaceEnd + 15 + 3682 ;;mov ax,98D4h ; MSDOS 5.0 COMMAND.COM + 3683 ; 05/06/2023 + 3684 ;mov ax,0AFA4h ; MSDOS 6.22 COMMAND.COM + 3685 00000EDF B81AA6 mov ax,TRANSPACEEND+15 ; mov AX,4D6Bh ; MSDOS 3.3 + 3686 00000EE2 B104 mov cl,4 + 3687 00000EE4 D3E8 shr ax,cl + 3688 00000EE6 C3 retn 3689 - 3690 00000EE7 B448 mov ah,48h - 3691 ;mov ah,ALLOC ; 48h - 3692 00000EE9 CD21 int 21h - 3693 00000EEB 72EF jc short BadMemErrJ ; memory arenas probably trashed - 3694 ;mov byte [cs:ExtCom],0 - 3695 ;mov [cs:Res_Tpa],ax - 3696 ; 12/01/2023 - 3697 00000EED C606[9902]00 mov byte [ExtCom],0 ; flag not to alloc again - 3698 00000EF2 A3[5804] mov [Res_Tpa],ax ; save current tpa segment - 3699 - 3700 00000EF5 2500F0 and ax,0F000h - 3701 00000EF8 050010 add ax,1000h ; round up to next 64k boundary - 3702 00000EFB 7212 jc short Bad_Tpa ; memory wrap if carry set - 3703 - 3704 ; Make sure that new boundary is within allocated range - 3705 - 3706 ;mov dx,[cs:Res_Tpa] - 3707 ; 12/01/2023 - 3708 00000EFD 8B16[5804] mov dx,[Res_Tpa] - 3709 00000F01 01DA add dx,bx ; compute maximum address - 3710 00000F03 39C2 cmp dx,ax ; is 64k address out of range? - 3711 00000F05 7608 jbe short Bad_Tpa - 3712 - 3713 ; Must have 64K of usable space. - 3714 - 3715 00000F07 29C2 sub dx,ax ; compute the usable space - 3716 00000F09 81FA0010 cmp dx,1000h ; is space >= 64k ? - 3717 00000F0D 7303 jae short LTpaSet - 3718 Bad_Tpa: - 3719 ;mov ax,[cs:Res_Tpa] - 3720 ; 12/01/2023 - 3721 00000F0F A1[5804] mov ax,[Res_Tpa] - 3722 LTpaSet: - 3723 ;mov [cs:LTPA],ax - 3724 ;mov ax,[cs:Res_Tpa] - 3725 ; 12/01/2023 - 3726 00000F12 A3[4C04] mov [LTpa],ax ; usable tpa is 64k buffer aligned - 3727 00000F15 A1[5804] mov ax,[Res_Tpa] ; actual tpa is buffer allocated - 3728 00000F18 01C3 add bx,ax - 3729 ;mov [cs:MemSiz],bx - 3730 00000F1A 891E[9502] mov [MemSiz],bx - 3731 00000F1E E8BEFF call SetSize - 3732 00000F21 29C3 sub bx,ax - 3733 - 3734 ; MSDOS 6.0 - 3735 - 3736 ;M038; Start of changes - 3737 ;Changes for Novell RPL. These guys reserve memory for themselves by - 3738 ;reducing int 12h size and add this memory to the system at autoexec time by - 3739 ;running a program that changes arenas. This changes the largest block that - 3740 ;command.com gets and so changes the transient segment. So, command.com does - 3741 ;a checksum at the wrong address and thinks that the transient is destroyed - 3742 ;and tries to reload it. At this point, no Comspec is defined and so the - 3743 ;reload fails, hanging the system. To get around this we just copy the - 3744 ;transient from the previous address to the new address(if changed) and - 3745 ;then let command.com do the checksum. So, if the transient area is not - 3746 ;corrupted, there will not be any reload. In Novell's case, the transient - 3747 ;is not really corrupted and so this should work. - 3748 - 3749 ; 12/01/2023 - 3750 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0F5Ah (CODERES:021Ah) + 3690 MemOk: + 3691 ;assume ds:DATARES ;we have set ds = DATARES + 3692 + 3693 00000EE7 B448 mov ah,48h + 3694 ;mov ah,ALLOC ; 48h + 3695 00000EE9 CD21 int 21h + 3696 00000EEB 72EF jc short BadMemErrJ ; memory arenas probably trashed + 3697 ;mov byte [cs:ExtCom],0 + 3698 ;mov [cs:Res_Tpa],ax + 3699 ; 12/01/2023 + 3700 00000EED C606[9902]00 mov byte [ExtCom],0 ; flag not to alloc again + 3701 00000EF2 A3[5804] mov [Res_Tpa],ax ; save current tpa segment + 3702 + 3703 00000EF5 2500F0 and ax,0F000h + 3704 00000EF8 050010 add ax,1000h ; round up to next 64k boundary + 3705 00000EFB 7212 jc short Bad_Tpa ; memory wrap if carry set + 3706 + 3707 ; Make sure that new boundary is within allocated range + 3708 + 3709 ;mov dx,[cs:Res_Tpa] + 3710 ; 12/01/2023 + 3711 00000EFD 8B16[5804] mov dx,[Res_Tpa] + 3712 00000F01 01DA add dx,bx ; compute maximum address + 3713 00000F03 39C2 cmp dx,ax ; is 64k address out of range? + 3714 00000F05 7608 jbe short Bad_Tpa + 3715 + 3716 ; Must have 64K of usable space. + 3717 + 3718 00000F07 29C2 sub dx,ax ; compute the usable space + 3719 00000F09 81FA0010 cmp dx,1000h ; is space >= 64k ? + 3720 00000F0D 7303 jae short LTpaSet + 3721 Bad_Tpa: + 3722 ;mov ax,[cs:Res_Tpa] + 3723 ; 12/01/2023 + 3724 00000F0F A1[5804] mov ax,[Res_Tpa] + 3725 LTpaSet: + 3726 ;mov [cs:LTPA],ax + 3727 ;mov ax,[cs:Res_Tpa] + 3728 ; 12/01/2023 + 3729 00000F12 A3[4C04] mov [LTpa],ax ; usable tpa is 64k buffer aligned + 3730 00000F15 A1[5804] mov ax,[Res_Tpa] ; actual tpa is buffer allocated + 3731 00000F18 01C3 add bx,ax + 3732 ;mov [cs:MemSiz],bx + 3733 00000F1A 891E[9502] mov [MemSiz],bx + 3734 00000F1E E8BEFF call SetSize + 3735 00000F21 29C3 sub bx,ax + 3736 + 3737 ; MSDOS 6.0 + 3738 + 3739 ;M038; Start of changes + 3740 ;Changes for Novell RPL. These guys reserve memory for themselves by + 3741 ;reducing int 12h size and add this memory to the system at autoexec time by + 3742 ;running a program that changes arenas. This changes the largest block that + 3743 ;command.com gets and so changes the transient segment. So, command.com does + 3744 ;a checksum at the wrong address and thinks that the transient is destroyed + 3745 ;and tries to reload it. At this point, no Comspec is defined and so the + 3746 ;reload fails, hanging the system. To get around this we just copy the + 3747 ;transient from the previous address to the new address(if changed) and + 3748 ;then let command.com do the checksum. So, if the transient area is not + 3749 ;corrupted, there will not be any reload. In Novell's case, the transient + 3750 ;is not really corrupted and so this should work. 3751 - 3752 00000F23 3B1E[8F02] cmp bx,[TrnSeg] ; Segment still the same? - 3753 00000F27 7423 je short LodCom1 ; yes, dont copy + 3752 ; 12/01/2023 + 3753 ; MSDOS 5.0 COMMAND.COM - RESGROUP:0F5Ah (CODERES:021Ah) 3754 - 3755 ;Check if the new segment is above or below the current move. If the new - 3756 ;segment is above (i.e new block is larger than previous block), then we - 3757 ;have to move in the reverse direction - 3758 - 3759 ;;mov cx,98C5h - 3760 ; 05/06/2023 - 3761 ; MSDOS 6.22 COMMAND.COM - RESGROUP:106Ah (CODERES:021Ah) - 3762 ;mov cx,0AF95h - 3763 ;;mov cx,0AA9Ah ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 3764 00000F29 B90BA6 mov cx,TRANSPACEEND ; cx = length to move - 3765 00000F2C 7707 ja short mov_down ; new seg > old seg, reverse move - 3766 00000F2E 31F6 xor si,si ; normal move - 3767 00000F30 89F7 mov di,si - 3768 00000F32 FC cld - 3769 00000F33 EB06 jmp short copy_trans - 3770 mov_down: - 3771 00000F35 89CE mov si,cx ; reverse move, start from end - 3772 00000F37 4E dec si - 3773 00000F38 89F7 mov di,si - 3774 00000F3A FD std - 3775 copy_trans: - 3776 00000F3B 1E push ds - 3777 00000F3C 06 push es - 3778 00000F3D 8EC3 mov es,bx ; dest segment - 3779 00000F3F 8E1E[8F02] mov ds,[TrnSeg] ; source segment - 3780 ;assume ds:nothing - 3781 - 3782 00000F43 F3A4 rep movsb ; copy transient - 3783 00000F45 FC cld - 3784 00000F46 07 pop es - 3785 00000F47 1F pop ds - 3786 ;assume ds:DATARES - 3787 - 3788 ;M038; End of changes - 3789 - 3790 ;mov [cs:TrnSeg],bx ; new location of transient - 3791 ; 12/01/2023 - 3792 00000F48 891E[8F02] mov [TrnSeg],bx - 3793 - 3794 LodCom1: - 3795 ;; mov ax,cs - 3796 ;; mov ss,ax - 3797 ;SR; At this point ds = DATARES which is where the stack is located - 3798 - 3799 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 3800 ; MSDOS 5.0 (& MSDOS 6.0-6.22) - 3801 00000F4C 8CD8 mov ax,ds - 3802 00000F4E 8ED0 mov ss,ax - 3803 ;assume ss:DATARES - 3804 ;;;mov sp,offset DATARES:RStack - 3805 ;;mov sp,53Eh - 3806 ; 05/06/2023 - 3807 ;;mov sp,60Ah ; MSDOS 6.22 COMMAND.COM - 3808 ;mov sp,637h ; PCDOS 7.1 COMMAND.COM ; 19/07/2024 - 3809 00000F50 BC[2E05] mov sp,RStack - 3810 - 3811 ;; mov ds,ax - 3812 - 3813 ;assume ds:DATARES - 3814 - 3815 ; MSDOS 3.3 - 3816 ;mov ax,cs - 3817 ;mov ss,ax - 3818 ;mov sp,RSTACK - 3819 ;mov ds,ax - 3820 - 3821 00000F53 E88500 call HeadFix ; close files, restore stdin, stdout - 3822 00000F56 31ED xor bp,bp ; flag command ok - 3823 00000F58 B8FFFF mov ax,-1 - 3824 00000F5B 8706[A702] xchg ax,[VerVal] - 3825 00000F5F 83F8FF cmp ax,-1 - 3826 00000F62 7404 je short NoSetVer - 3827 00000F64 B42E mov ah,2Eh - 3828 ;mov ah,SET_VERIFY_ON_WRITE ; 2Eh ; AL has correct value - 3829 00000F66 CD21 int 21h ; DOS - SET VERIFY FLAG - 3830 ; DL = 00h, AL = 01h VERIFY on / 00h VERIFY off - 3831 NoSetVer: - 3832 00000F68 833E[A502]FF cmp word [SingleCom],-1 - 3833 00000F6D 7503 jne short NoSng - 3834 00000F6F E9C9FE jmp FatalRet2 ; we have finished the single command - 3835 NoSng: - 3836 00000F72 E88101 call ChkSum ; check the transient - 3837 ;cmp dx,[Sum] - 3838 ;je short HavCom ; transient ok - 3839 - 3840 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 3841 %if 0 - 3842 ; 12/01/2023 - 3843 jz short HavCom - 3844 - 3845 %else ; PCDOS 7.1 COMMAND.COM - 3846 00000F75 7505 jnz short Bogus_Com - 3847 00000F77 E8A701 call chk_transient - 3848 00000F7A 7417 jz short HavCom - 3849 %endif - 3850 - 3851 Bogus_Com: - 3852 00000F7C C606[4802]01 mov byte [Loading],1 ; flag DskErr routine - 3853 00000F81 E82801 call LoadCom - 3854 ChkSame: - 3855 00000F84 E86F01 call ChkSum - 3856 ;cmp dx,[Sum] - 3857 ;je short HavCom ; same command - 3858 - 3859 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 3860 %if 0 - 3861 ; 12/01/2023 - 3862 jz short HavCom - 3863 - 3864 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 3865 %else ; PCDOS 7.1 COMMAND.COM - 3866 00000F87 7505 jnz short Also_Bogus - 3867 00000F89 E89501 call chk_transient - 3868 00000F8C 7405 jz short HavCom - 3869 %endif - 3870 Also_Bogus: - 3871 00000F8E E85D01 call WrongCom - 3872 00000F91 EBF1 jmp short ChkSame - 3873 - 3874 ; 12/01/2023 - 3875 ;HavCom: - 3876 ; ; 25/09/2018 - 3877 ; mov ax,(CHAR_OPER*256) ; 3700h - 3878 ; int 21h ; DOS - 2+ internal - GET SWITCHAR/AVAILDEV - 3879 ; ; Return: AL = FFh unsupported subfunction - 3880 ; ; DL = current switch character - 3881 ; mov [RSWITCHAR],dl - 3882 ; cmp dl,'/' - 3883 ; jnz short USESLASH - 3884 ; ;mov cl,'\' - 3885 ; ;mov [RDIRCHAR],cl - 3886 ; mov byte [RDIRCHAR],'\' - 3887 ;USESLASH: - 3888 - 3889 HavCom: - 3890 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 3891 00000F93 C606[4802]00 mov byte [Loading],0 ; flag to DskErr - 3892 ;;;mov si,offset DATARES:TranVars - 3893 ;;mov si,453h ; MSDOS 5.0 COMMAND.COM - 3894 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 3895 ;mov si,51Dh ; MSDOS 6.22 COMMAND.COM - 3896 ; 19/07/2024 - 3897 ;mov si,551h ; PCDOS 7.1 COMMAND.COM - 3898 00000F98 BE[4804] mov si,TranVars - 3899 ;;;mov di,offset TRANGROUP:HeadCall - 3900 ;;mov di,8D75h ; MSDOS 5.0 COMMAND.COM - 3901 ; 05/06/2023 - 3902 ;mov di,0A303h ; MSDOS 6.22 COMMAND.COM - 3903 ; 19/07/2024 - 3904 ;mov di,0A082h ; PCDOS 7.1 COMMAND.COM - 3905 00000F9B BF[F39B] mov di,HEADCALL - 3906 00000F9E 8E06[8F02] mov es,[TrnSeg] - 3907 00000FA2 FC cld - 3908 ;;;mov cx,467h ; MSDOS 5.0 COMMAND.COM - 3909 ;;mov cx,533h ; MSDOS 6.22 COMMAND.COM - 3910 ;mov cx,565h ; PCDOS 7.1 COMMAND.COM - 3911 00000FA3 B9[5C04] mov cx,TranVarEnd - 3912 00000FA6 29F1 sub cx,si - 3913 00000FA8 F3A4 rep movsb ; transfer info to transient - 3914 00000FAA A1[9502] mov ax,[MemSiz] - 3915 00000FAD A30200 mov [PDB.BLOCK_LEN],ax ; mov [ds:2],ax ; adjust my own header - 3916 - 3917 ;*** TJmp - jump-off to transient - 3918 ; - 3919 ; Public label so debugger can find this spot. - 3920 - 3921 TJmp: ; 12/01/2023 - 3922 00000FB0 FF2E[8D02] jmp far [Trans] ; jmp dword ptr Trans + 3755 00000F23 3B1E[8F02] cmp bx,[TrnSeg] ; Segment still the same? + 3756 00000F27 7423 je short LodCom1 ; yes, dont copy + 3757 + 3758 ;Check if the new segment is above or below the current move. If the new + 3759 ;segment is above (i.e new block is larger than previous block), then we + 3760 ;have to move in the reverse direction + 3761 + 3762 ;;mov cx,98C5h + 3763 ; 05/06/2023 + 3764 ; MSDOS 6.22 COMMAND.COM - RESGROUP:106Ah (CODERES:021Ah) + 3765 ;mov cx,0AF95h + 3766 ;;mov cx,0AA9Ah ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 3767 00000F29 B90BA6 mov cx,TRANSPACEEND ; cx = length to move + 3768 00000F2C 7707 ja short mov_down ; new seg > old seg, reverse move + 3769 00000F2E 31F6 xor si,si ; normal move + 3770 00000F30 89F7 mov di,si + 3771 00000F32 FC cld + 3772 00000F33 EB06 jmp short copy_trans + 3773 mov_down: + 3774 00000F35 89CE mov si,cx ; reverse move, start from end + 3775 00000F37 4E dec si + 3776 00000F38 89F7 mov di,si + 3777 00000F3A FD std + 3778 copy_trans: + 3779 00000F3B 1E push ds + 3780 00000F3C 06 push es + 3781 00000F3D 8EC3 mov es,bx ; dest segment + 3782 00000F3F 8E1E[8F02] mov ds,[TrnSeg] ; source segment + 3783 ;assume ds:nothing + 3784 + 3785 00000F43 F3A4 rep movsb ; copy transient + 3786 00000F45 FC cld + 3787 00000F46 07 pop es + 3788 00000F47 1F pop ds + 3789 ;assume ds:DATARES + 3790 + 3791 ;M038; End of changes + 3792 + 3793 ;mov [cs:TrnSeg],bx ; new location of transient + 3794 ; 12/01/2023 + 3795 00000F48 891E[8F02] mov [TrnSeg],bx + 3796 + 3797 LodCom1: + 3798 ;; mov ax,cs + 3799 ;; mov ss,ax + 3800 ;SR; At this point ds = DATARES which is where the stack is located + 3801 + 3802 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 3803 ; MSDOS 5.0 (& MSDOS 6.0-6.22) + 3804 00000F4C 8CD8 mov ax,ds + 3805 00000F4E 8ED0 mov ss,ax + 3806 ;assume ss:DATARES + 3807 ;;;mov sp,offset DATARES:RStack + 3808 ;;mov sp,53Eh + 3809 ; 05/06/2023 + 3810 ;;mov sp,60Ah ; MSDOS 6.22 COMMAND.COM + 3811 ;mov sp,637h ; PCDOS 7.1 COMMAND.COM ; 19/07/2024 + 3812 00000F50 BC[2E05] mov sp,RStack + 3813 + 3814 ;; mov ds,ax + 3815 + 3816 ;assume ds:DATARES + 3817 + 3818 ; MSDOS 3.3 + 3819 ;mov ax,cs + 3820 ;mov ss,ax + 3821 ;mov sp,RSTACK + 3822 ;mov ds,ax + 3823 + 3824 00000F53 E88500 call HeadFix ; close files, restore stdin, stdout + 3825 00000F56 31ED xor bp,bp ; flag command ok + 3826 00000F58 B8FFFF mov ax,-1 + 3827 00000F5B 8706[A702] xchg ax,[VerVal] + 3828 00000F5F 83F8FF cmp ax,-1 + 3829 00000F62 7404 je short NoSetVer + 3830 00000F64 B42E mov ah,2Eh + 3831 ;mov ah,SET_VERIFY_ON_WRITE ; 2Eh ; AL has correct value + 3832 00000F66 CD21 int 21h ; DOS - SET VERIFY FLAG + 3833 ; DL = 00h, AL = 01h VERIFY on / 00h VERIFY off + 3834 NoSetVer: + 3835 00000F68 833E[A502]FF cmp word [SingleCom],-1 + 3836 00000F6D 7503 jne short NoSng + 3837 00000F6F E9C9FE jmp FatalRet2 ; we have finished the single command + 3838 NoSng: + 3839 00000F72 E88101 call ChkSum ; check the transient + 3840 ;cmp dx,[Sum] + 3841 ;je short HavCom ; transient ok + 3842 + 3843 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 3844 %if 0 + 3845 ; 12/01/2023 + 3846 jz short HavCom + 3847 + 3848 %else ; PCDOS 7.1 COMMAND.COM + 3849 00000F75 7505 jnz short Bogus_Com + 3850 00000F77 E8A701 call chk_transient + 3851 00000F7A 7417 jz short HavCom + 3852 %endif + 3853 + 3854 Bogus_Com: + 3855 00000F7C C606[4802]01 mov byte [Loading],1 ; flag DskErr routine + 3856 00000F81 E82801 call LoadCom + 3857 ChkSame: + 3858 00000F84 E86F01 call ChkSum + 3859 ;cmp dx,[Sum] + 3860 ;je short HavCom ; same command + 3861 + 3862 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 3863 %if 0 + 3864 ; 12/01/2023 + 3865 jz short HavCom + 3866 + 3867 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 3868 %else ; PCDOS 7.1 COMMAND.COM + 3869 00000F87 7505 jnz short Also_Bogus + 3870 00000F89 E89501 call chk_transient + 3871 00000F8C 7405 jz short HavCom + 3872 %endif + 3873 Also_Bogus: + 3874 00000F8E E85D01 call WrongCom + 3875 00000F91 EBF1 jmp short ChkSame + 3876 + 3877 ; 12/01/2023 + 3878 ;HavCom: + 3879 ; ; 25/09/2018 + 3880 ; mov ax,(CHAR_OPER*256) ; 3700h + 3881 ; int 21h ; DOS - 2+ internal - GET SWITCHAR/AVAILDEV + 3882 ; ; Return: AL = FFh unsupported subfunction + 3883 ; ; DL = current switch character + 3884 ; mov [RSWITCHAR],dl + 3885 ; cmp dl,'/' + 3886 ; jnz short USESLASH + 3887 ; ;mov cl,'\' + 3888 ; ;mov [RDIRCHAR],cl + 3889 ; mov byte [RDIRCHAR],'\' + 3890 ;USESLASH: + 3891 + 3892 HavCom: + 3893 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 3894 00000F93 C606[4802]00 mov byte [Loading],0 ; flag to DskErr + 3895 ;;;mov si,offset DATARES:TranVars + 3896 ;;mov si,453h ; MSDOS 5.0 COMMAND.COM + 3897 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 3898 ;mov si,51Dh ; MSDOS 6.22 COMMAND.COM + 3899 ; 19/07/2024 + 3900 ;mov si,551h ; PCDOS 7.1 COMMAND.COM + 3901 00000F98 BE[4804] mov si,TranVars + 3902 ;;;mov di,offset TRANGROUP:HeadCall + 3903 ;;mov di,8D75h ; MSDOS 5.0 COMMAND.COM + 3904 ; 05/06/2023 + 3905 ;mov di,0A303h ; MSDOS 6.22 COMMAND.COM + 3906 ; 19/07/2024 + 3907 ;mov di,0A082h ; PCDOS 7.1 COMMAND.COM + 3908 00000F9B BF[F39B] mov di,HEADCALL + 3909 00000F9E 8E06[8F02] mov es,[TrnSeg] + 3910 00000FA2 FC cld + 3911 ;;;mov cx,467h ; MSDOS 5.0 COMMAND.COM + 3912 ;;mov cx,533h ; MSDOS 6.22 COMMAND.COM + 3913 ;mov cx,565h ; PCDOS 7.1 COMMAND.COM + 3914 00000FA3 B9[5C04] mov cx,TranVarEnd + 3915 00000FA6 29F1 sub cx,si + 3916 00000FA8 F3A4 rep movsb ; transfer info to transient + 3917 00000FAA A1[9502] mov ax,[MemSiz] + 3918 00000FAD A30200 mov [PDB.BLOCK_LEN],ax ; mov [ds:2],ax ; adjust my own header + 3919 + 3920 ;*** TJmp - jump-off to transient + 3921 ; + 3922 ; Public label so debugger can find this spot. 3923 - 3924 ;*** TRemCheck - far version of RemCheck for transient - 3925 - 3926 TRemCheck: - 3927 ; 12/01/2023 - 3928 00000FB4 1F pop ds ; ds = DATARES - 3929 00000FB5 83C402 add sp,2 ; discard old value of ds - 3930 - 3931 00000FB8 E80100 call RemCheck - 3932 00000FBB CB retf + 3924 TJmp: ; 12/01/2023 + 3925 00000FB0 FF2E[8D02] jmp far [Trans] ; jmp dword ptr Trans + 3926 + 3927 ;*** TRemCheck - far version of RemCheck for transient + 3928 + 3929 TRemCheck: + 3930 ; 12/01/2023 + 3931 00000FB4 1F pop ds ; ds = DATARES + 3932 00000FB5 83C402 add sp,2 ; discard old value of ds 3933 - 3934 ;*** RemCheck - 3935 ; - 3936 ; ENTRY AL = drive (0=default, 1=A, ...) - 3937 ; - 3938 ; EXIT ZR set if removeable media - 3939 ; ZR clear if fixed media + 3934 00000FB8 E80100 call RemCheck + 3935 00000FBB CB retf + 3936 + 3937 ;*** RemCheck + 3938 ; + 3939 ; ENTRY AL = drive (0=default, 1=A, ...) 3940 ; - 3941 ; USED none - 3942 - 3943 ; 12/01/2023 - 3944 RemCheck: - 3945 00000FBC 50 push ax - 3946 00000FBD 53 push bx - 3947 00000FBE 89C3 mov bx,ax - 3948 00000FC0 B80844 mov ax,4408h - 3949 ;mov ax,(IOCTL<<8)+8 ; 4408h - 3950 00000FC3 CD21 int 21h ; DOS - 2+ - IOCTL - - 3951 00000FC5 7304 jnc short rcCont - 3952 - 3953 ; If an error occurred, assume the media is non-removable. - 3954 ; AX contains the non-zero error code from the int 21, so - 3955 ; 'or ax,ax; sets non-zero. This behavior makes network drives - 3956 ; appear to be non-removable. - 3957 - 3958 00000FC7 09C0 or ax,ax - 3959 00000FC9 EB05 jmp short ResRegs - 3960 rcCont: - 3961 00000FCB 83E001 and ax,1 - 3962 00000FCE F7D0 not ax - 3963 ResRegs: - 3964 00000FD0 5B pop bx - 3965 00000FD1 58 pop ax - 3966 00000FD2 C3 retn - 3967 - 3968 ;*** THeadFix - 3969 ; - 3970 ; Far version of HeadFix, called from transient. - 3971 - 3972 THeadFix: - 3973 ; 12/01/2023 - 3974 00000FD3 1F pop ds ; ds = DATARES - 3975 00000FD4 83C402 add sp,2 ; discard old ds value on stack - 3976 - 3977 00000FD7 E80100 call HeadFix - 3978 00000FDA CB retf + 3941 ; EXIT ZR set if removeable media + 3942 ; ZR clear if fixed media + 3943 ; + 3944 ; USED none + 3945 + 3946 ; 12/01/2023 + 3947 RemCheck: + 3948 00000FBC 50 push ax + 3949 00000FBD 53 push bx + 3950 00000FBE 89C3 mov bx,ax + 3951 00000FC0 B80844 mov ax,4408h + 3952 ;mov ax,(IOCTL<<8)+8 ; 4408h + 3953 00000FC3 CD21 int 21h ; DOS - 2+ - IOCTL - + 3954 00000FC5 7304 jnc short rcCont + 3955 + 3956 ; If an error occurred, assume the media is non-removable. + 3957 ; AX contains the non-zero error code from the int 21, so + 3958 ; 'or ax,ax; sets non-zero. This behavior makes network drives + 3959 ; appear to be non-removable. + 3960 + 3961 00000FC7 09C0 or ax,ax + 3962 00000FC9 EB05 jmp short ResRegs + 3963 rcCont: + 3964 00000FCB 83E001 and ax,1 + 3965 00000FCE F7D0 not ax + 3966 ResRegs: + 3967 00000FD0 5B pop bx + 3968 00000FD1 58 pop ax + 3969 00000FD2 C3 retn + 3970 + 3971 ;*** THeadFix + 3972 ; + 3973 ; Far version of HeadFix, called from transient. + 3974 + 3975 THeadFix: + 3976 ; 12/01/2023 + 3977 00000FD3 1F pop ds ; ds = DATARES + 3978 00000FD4 83C402 add sp,2 ; discard old ds value on stack 3979 - 3980 ;*** HeadFix - 3981 - 3982 ; 12/01/2023 - 3983 HeadFix: - 3984 00000FDB E85001 call SetVect ; set vectors to our values - 3985 - 3986 ; Clean up header - 3987 - 3988 ; Bugbug: optimize: - 3989 ; mov word ptr ds:Pdb_Jfn_Table,cx instead of separate bytes + 3980 00000FD7 E80100 call HeadFix + 3981 00000FDA CB retf + 3982 + 3983 ;*** HeadFix + 3984 + 3985 ; 12/01/2023 + 3986 HeadFix: + 3987 00000FDB E85001 call SetVect ; set vectors to our values + 3988 + 3989 ; Clean up header 3990 - 3991 00000FDE 31DB xor bx,bx ; BX = handle = 0 - 3992 00000FE0 8B0E[9F02] mov cx,[Io_Save] ; CX = original stdin, stdout - 3993 ;mov dx,[18h] - 3994 00000FE4 8B161800 mov dx,[PDB.JFN_TABLE] ; DX = current stdin, stdout - 3995 00000FE8 38D1 cmp cl,dl - 3996 00000FEA 7407 je short Chk1 ; stdin matches - 3997 - 3998 ; 19/07/2024 - Retro DOS v5 COMMAND.COM - 3999 %if 0 ; PCDOS 7.1 COMMAND.COM - 4000 mov ah,3Eh - 4001 ;mov ah,CLOSE ; 3Eh - 4002 int 21h ; close stdin - 4003 %else - 4004 ;mov ah,3Eh - 4005 ;call int21h - 4006 ; 19/07/2024 - 4007 00000FEC E86E01 call int21h_close - 4008 %endif - 4009 ;mov [18h],cl - 4010 00000FEF 880E1800 mov [PDB.JFN_TABLE],cl ; restore stdin - 4011 Chk1: - 4012 00000FF3 43 inc bx ; BX = handle = 1 - 4013 00000FF4 38F5 cmp ch,dh - 4014 00000FF6 7407 je short ChkOtherHand ; stdout matches - 4015 - 4016 ; 19/07/2024 - Retro DOS v5 COMMAND.COM - 4017 %if 0 ; PCDOS 7.1 COMMAND.COM - 4018 mov ah,3Eh - 4019 ;mov ah,CLOSE ; 3Eh - 4020 int 21h ; close stdout - 4021 %else - 4022 ;mov ah,3Eh - 4023 ;call int21h - 4024 ; 19/07/2024 - 4025 00000FF8 E86201 call int21h_close - 4026 %endif - 4027 ;mov [19h],ch - 4028 00000FFB 882E1900 mov [PDB.JFN_TABLE+1],ch ; restore stdout - 4029 ChkOtherHand: - 4030 00000FFF 83C304 add bx,4 ; skip handles 2,3,4 - 4031 00001002 B90F00 mov cx,FILPERPROC-5 ; 15 ; CX = # handles to close - 4032 ; (handles 0-4 already done) - 4033 CloseLoop: - 4034 ; 19/07/2024 - Retro DOS v5 COMMAND.COM - 4035 %if 0 ; PCDOS 7.1 COMMAND.COM - 4036 mov ah,3Eh - 4037 ;mov ah,CLOSE ; 3Eh - 4038 int 21h ; close file - 4039 %else - 4040 ;cmp byte [bx+18h],0FFh - 4041 00001005 807F18FF cmp byte [bx+PDB.JFN_TABLE],0FFh - 4042 00001009 7403 je short CloseLoopNxt - 4043 - 4044 ;mov ah,3Eh - 4045 ;call int21h - 4046 ; 19/07/2024 - 4047 0000100B E84F01 call int21h_close - 4048 CloseLoopNxt: - 4049 %endif - 4050 0000100E 43 inc bx ; BX = next handle - 4051 0000100F E2F4 loop CloseLoop - 4052 - 4053 ; MSDOS 6.0 - 4054 ; Bugbug: since this is for transient code, move it there - 4055 - 4056 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4057 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:103Dh) - 4058 ; 19/07/2024 - 4059 ; (PCDOS 7.1 COMMAND.COM - RESGROUP:1119h) - 4060 - 4061 ; M012: remove this CS -> DS. Must've been missed during - 4062 ; purification. - 4063 ;; push ds ; save data segment - 4064 ;; push cs ; get local segment into DS - 4065 ;; pop ds ; - 4066 00001011 803E[C002]FF cmp byte [Append_Flag],-1 ; do we need to reset APPEND? - 4067 00001016 750E jne short Append_Fix_End ; no - just exit - 4068 00001018 B807B7 mov ax,0B707h - 4069 ;mov ax,AppendSetState ; set the state of Append - 4070 0000101B 8B1E[BE02] mov bx,[Append_State] ; back to the original state - 4071 0000101F CD2F int 2Fh ; - 4072 00001021 C606[C002]00 mov byte [Append_Flag],0 ; set append flag to invalid - 4073 Append_Fix_End: ; - 4074 ;; pop ds ; get data segment back - 4075 00001026 C3 retn - 4076 - 4077 ; MSDOS 3.3 - 4078 ;retn + 3991 ; Bugbug: optimize: + 3992 ; mov word ptr ds:Pdb_Jfn_Table,cx instead of separate bytes + 3993 + 3994 00000FDE 31DB xor bx,bx ; BX = handle = 0 + 3995 00000FE0 8B0E[9F02] mov cx,[Io_Save] ; CX = original stdin, stdout + 3996 ;mov dx,[18h] + 3997 00000FE4 8B161800 mov dx,[PDB.JFN_TABLE] ; DX = current stdin, stdout + 3998 00000FE8 38D1 cmp cl,dl + 3999 00000FEA 7407 je short Chk1 ; stdin matches + 4000 + 4001 ; 19/07/2024 - Retro DOS v5 COMMAND.COM + 4002 %if 0 ; PCDOS 7.1 COMMAND.COM + 4003 mov ah,3Eh + 4004 ;mov ah,CLOSE ; 3Eh + 4005 int 21h ; close stdin + 4006 %else + 4007 ;mov ah,3Eh + 4008 ;call int21h + 4009 ; 19/07/2024 + 4010 00000FEC E86E01 call int21h_close + 4011 %endif + 4012 ;mov [18h],cl + 4013 00000FEF 880E1800 mov [PDB.JFN_TABLE],cl ; restore stdin + 4014 Chk1: + 4015 00000FF3 43 inc bx ; BX = handle = 1 + 4016 00000FF4 38F5 cmp ch,dh + 4017 00000FF6 7407 je short ChkOtherHand ; stdout matches + 4018 + 4019 ; 19/07/2024 - Retro DOS v5 COMMAND.COM + 4020 %if 0 ; PCDOS 7.1 COMMAND.COM + 4021 mov ah,3Eh + 4022 ;mov ah,CLOSE ; 3Eh + 4023 int 21h ; close stdout + 4024 %else + 4025 ;mov ah,3Eh + 4026 ;call int21h + 4027 ; 19/07/2024 + 4028 00000FF8 E86201 call int21h_close + 4029 %endif + 4030 ;mov [19h],ch + 4031 00000FFB 882E1900 mov [PDB.JFN_TABLE+1],ch ; restore stdout + 4032 ChkOtherHand: + 4033 00000FFF 83C304 add bx,4 ; skip handles 2,3,4 + 4034 00001002 B90F00 mov cx,FILPERPROC-5 ; 15 ; CX = # handles to close + 4035 ; (handles 0-4 already done) + 4036 CloseLoop: + 4037 ; 19/07/2024 - Retro DOS v5 COMMAND.COM + 4038 %if 0 ; PCDOS 7.1 COMMAND.COM + 4039 mov ah,3Eh + 4040 ;mov ah,CLOSE ; 3Eh + 4041 int 21h ; close file + 4042 %else + 4043 ;cmp byte [bx+18h],0FFh + 4044 00001005 807F18FF cmp byte [bx+PDB.JFN_TABLE],0FFh + 4045 00001009 7403 je short CloseLoopNxt + 4046 + 4047 ;mov ah,3Eh + 4048 ;call int21h + 4049 ; 19/07/2024 + 4050 0000100B E84F01 call int21h_close + 4051 CloseLoopNxt: + 4052 %endif + 4053 0000100E 43 inc bx ; BX = next handle + 4054 0000100F E2F4 loop CloseLoop + 4055 + 4056 ; MSDOS 6.0 + 4057 ; Bugbug: since this is for transient code, move it there + 4058 + 4059 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4060 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:103Dh) + 4061 ; 19/07/2024 + 4062 ; (PCDOS 7.1 COMMAND.COM - RESGROUP:1119h) + 4063 + 4064 ; M012: remove this CS -> DS. Must've been missed during + 4065 ; purification. + 4066 ;; push ds ; save data segment + 4067 ;; push cs ; get local segment into DS + 4068 ;; pop ds ; + 4069 00001011 803E[C002]FF cmp byte [Append_Flag],-1 ; do we need to reset APPEND? + 4070 00001016 750E jne short Append_Fix_End ; no - just exit + 4071 00001018 B807B7 mov ax,0B707h + 4072 ;mov ax,AppendSetState ; set the state of Append + 4073 0000101B 8B1E[BE02] mov bx,[Append_State] ; back to the original state + 4074 0000101F CD2F int 2Fh ; + 4075 00001021 C606[C002]00 mov byte [Append_Flag],0 ; set append flag to invalid + 4076 Append_Fix_End: ; + 4077 ;; pop ds ; get data segment back + 4078 00001026 C3 retn 4079 - 4080 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4081 ; PCDOS 7.1 COMMAND.COM - RESGROUP:112Fh + 4080 ; MSDOS 3.3 + 4081 ;retn 4082 - 4083 ;*** SavHand - save current program's stdin/out & set to our stderr - 4084 ; - 4085 ; ENTRY nothing - 4086 ; - 4087 ; EXIT nothing - 4088 ; - 4089 ; USED flags - 4090 ; - 4091 ; EFFECTS - 4092 ; Handle01 = current program's stdin,stdout JFN entries - 4093 ; current program's stdin,stdout set to our stderr - 4094 ; - 4095 - 4096 ;SR; - 4097 ; Changed ds = DATARES. We need it to access our JFN_Table - 4098 ; Called from ContC ( ds = DATARES ) and DskErr ( ds = DATARES ). - 4099 - 4100 SavHand: - 4101 ;assume ds:DATARES,es:NOTHING,ss:NOTHING + 4083 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4084 ; PCDOS 7.1 COMMAND.COM - RESGROUP:112Fh + 4085 + 4086 ;*** SavHand - save current program's stdin/out & set to our stderr + 4087 ; + 4088 ; ENTRY nothing + 4089 ; + 4090 ; EXIT nothing + 4091 ; + 4092 ; USED flags + 4093 ; + 4094 ; EFFECTS + 4095 ; Handle01 = current program's stdin,stdout JFN entries + 4096 ; current program's stdin,stdout set to our stderr + 4097 ; + 4098 + 4099 ;SR; + 4100 ; Changed ds = DATARES. We need it to access our JFN_Table + 4101 ; Called from ContC ( ds = DATARES ) and DskErr ( ds = DATARES ). 4102 - 4103 ; 12/01/2023 - 4104 ;push ds ; MSDOS 3.3 + 4103 SavHand: + 4104 ;assume ds:DATARES,es:NOTHING,ss:NOTHING 4105 - 4106 00001027 53 push bx ;preserve registers - 4107 00001028 50 push ax - 4108 ; 12/01/2023 - 4109 00001029 06 push es - 4110 0000102A 1E push ds ; save DATARES value - 4111 - 4112 0000102B B451 mov ah,51h - 4113 ;mov ah,GET_CURRENT_PDB ; 51h + 4106 ; 12/01/2023 + 4107 ;push ds ; MSDOS 3.3 + 4108 + 4109 00001027 53 push bx ;preserve registers + 4110 00001028 50 push ax + 4111 ; 12/01/2023 + 4112 00001029 06 push es + 4113 0000102A 1E push ds ; save DATARES value 4114 - 4115 ; 19/07/2024 - Retro DOS v5 COMMAND.COM - 4116 %if 0 ; PCDOS 7.1 COMMAND.COM - 4117 int 21h ; BX = user's header seg addr - 4118 %else - 4119 0000102D E82F01 call int21h - 4120 %endif - 4121 00001030 8EDB mov ds,bx ; DS = user's header seg addr - 4122 ;lds bx,[34h] - 4123 00001032 C51E3400 lds bx,[PDB.JFN_Pointer] ; DS:BX = ptr to JFN table - 4124 00001036 8B07 mov ax,[bx] ; AX = stdin,stdout JFN's - 4125 ; 12/01/2023 - 4126 00001038 07 pop es ; es = DATARES - 4127 00001039 06 push es ; save it back on stack - 4128 0000103A 26A3[4602] mov [es:Handle01],ax ; save user's stdin, stdout - 4129 ;mov [cs:HANDLE01],ax - 4130 - 4131 ;SR; - 4132 ; Use es to address Handle01 & our JFN_Table + 4115 0000102B B451 mov ah,51h + 4116 ;mov ah,GET_CURRENT_PDB ; 51h + 4117 + 4118 ; 19/07/2024 - Retro DOS v5 COMMAND.COM + 4119 %if 0 ; PCDOS 7.1 COMMAND.COM + 4120 int 21h ; BX = user's header seg addr + 4121 %else + 4122 0000102D E82F01 call int21h + 4123 %endif + 4124 00001030 8EDB mov ds,bx ; DS = user's header seg addr + 4125 ;lds bx,[34h] + 4126 00001032 C51E3400 lds bx,[PDB.JFN_Pointer] ; DS:BX = ptr to JFN table + 4127 00001036 8B07 mov ax,[bx] ; AX = stdin,stdout JFN's + 4128 ; 12/01/2023 + 4129 00001038 07 pop es ; es = DATARES + 4130 00001039 06 push es ; save it back on stack + 4131 0000103A 26A3[4602] mov [es:Handle01],ax ; save user's stdin, stdout + 4132 ;mov [cs:HANDLE01],ax 4133 - 4134 ; 12/01/2023 - 4135 ;mov al,[es:1Ah] - 4136 0000103E 26A01A00 mov al,[es:PDB.JFN_TABLE+2] ; AL = COMMAND stderr - 4137 ;mov al,[cs:PDB.JFN_TABLE+2] ; mov al,[cs:1Ah] - 4138 00001042 88C4 mov ah,al ; AH = COMMAND stderr - 4139 00001044 8907 mov [bx],ax ; set user's stdin/out to our stderr - 4140 ; 12/01/2023 - 4141 00001046 1F pop ds ; restore registers - 4142 00001047 07 pop es - 4143 00001048 58 pop ax - 4144 00001049 5B pop bx - 4145 ;pop ds ; MSDOS 3.3 - 4146 0000104A C3 retn - 4147 - 4148 ;assume ds:DATARES - 4149 GetComDsk2: - 4150 0000104B E81F00 call GetComDsk - 4151 0000104E E9FBFE jmp LodCom1 ; memory already allocated - 4152 - 4153 RestHand: - 4154 00001051 1E push ds - 4155 00001052 53 push bx ; restore stdin, stdout to user - 4156 00001053 50 push ax - 4157 ; 12/01/2023 - 4158 00001054 B451 mov ah,51h - 4159 ;mov ah,GET_CURRENT_PDB ; 51h - 4160 00001056 CD21 int 21h ; point to user's header - 4161 00001058 A1[4602] mov ax,[Handle01] - 4162 0000105B 8EDB mov ds,bx - 4163 ;assume ds:NOTHING - 4164 ;lds bx,[34h] - 4165 0000105D C51E3400 lds bx,[PDB.JFN_Pointer] ; DS:BX = ptr to jfn table - 4166 00001061 8907 mov [bx],ax ; stuff his old 0 and 1 - 4167 00001063 58 pop ax - 4168 00001064 5B pop bx - 4169 00001065 1F pop ds - 4170 00001066 C3 retn - 4171 - 4172 ;assume ds:DATARES,ss:DATARES - 4173 Hopeless: - 4174 00001067 BA[DC05] mov dx,COMBAD - 4175 0000106A E9AEFD jmp FatalC - 4176 - 4177 GetComDsk: - 4178 0000106D A0[9402] mov al,[ComDrv] - 4179 00001070 E849FF call RemCheck - 4180 00001073 75F2 jnz short Hopeless ; non-removable media - 4181 GetComDsk3: - 4182 00001075 81FA[DC05] cmp dx,COMBAD ; cmp dx,offset DATARES:ComBad - 4183 00001079 7503 jne short GetComDsk4 - 4184 ;;mov dx,offset DATARES:ComBad ; DX = ptr to msg - 4185 ; 12/01/2023 - 4186 ;;mov dx,COMBAD ; (MSDOS 5.0 COMMAND.COM - RESGROUP:10A6h) - 4187 ; 05/06/2023 - 4188 ;mov dx,COMBAD ; (MSDOS 6.22 COMMAND.COM - RESGROUP:11B6h) - 4189 ;invoke RPrint ; say COMMAND is invalid - 4190 0000107B E85D03 call RPrint - 4191 ;call RDISPMSG - 4192 - 4193 GetComDsk4: - 4194 - 4195 ; Bugbug: there's always a drive here? No need to check? - 4196 - 4197 0000107E 803E[2F02]00 cmp byte [PutBackDrv],0 ; is there a drive in the comspec? - 4198 00001083 750A jne short Users_Drive ; yes - use it - 4199 00001085 B419 mov ah,19h - 4200 ;mov ah,GET_DEFAULT_DRIVE ; 19h ; use default drive - 4201 - 4202 ; 19/07/2024 - Retro DOS v5 COMMAND.COM - 4203 %if 0 ; PCDOS 7.1 COMMAND.COM - 4204 int 21h ; BX = user's header seg addr - 4205 %else - 4206 00001087 E8D500 call int21h - 4207 %endif - 4208 0000108A 0441 add al,"A" ; convert to ascii - 4209 0000108C A2[2F02] mov [PutBackDrv],al ; put in message to print out - 4210 - 4211 Users_Drive: - 4212 ; 12/01/2023 - 4213 ; MSDOS 6.0 - 4214 0000108F BA[F205] mov dx,PUTBACKMSG ; prompt for diskette - 4215 ;mov si,offset DATARES:PutBackSubst - 4216 ;invoke RPrint - 4217 00001092 BE[2902] mov si,PutBackSubst ; containing COMMAND - 4218 00001095 E84303 call RPrint - 4219 ;mov dx,offset DATARES:Prompt - 4220 ;invoke RPrint - 4221 00001098 BA[1406] mov dx,PROMPT ; "Press any key" - 4222 0000109B E83D03 call RPrint - 4223 - 4224 ; MSDOS 3.3 - 4225 ;mov dx,PUTBACKMSG ; prompt for diskette - 4226 ;call RDISPMSG - 4227 ;mov dx,[PUTBACKSUBSTPTR] - 4228 ;mov si,[COMSPEC_END] - 4229 ;mov byte [si+1],'$' - 4230 ;call RDISPMSG - 4231 ;mov byte [si+1],0 - 4232 ;mov dx,PROMPT + 4134 ;SR; + 4135 ; Use es to address Handle01 & our JFN_Table + 4136 + 4137 ; 12/01/2023 + 4138 ;mov al,[es:1Ah] + 4139 0000103E 26A01A00 mov al,[es:PDB.JFN_TABLE+2] ; AL = COMMAND stderr + 4140 ;mov al,[cs:PDB.JFN_TABLE+2] ; mov al,[cs:1Ah] + 4141 00001042 88C4 mov ah,al ; AH = COMMAND stderr + 4142 00001044 8907 mov [bx],ax ; set user's stdin/out to our stderr + 4143 ; 12/01/2023 + 4144 00001046 1F pop ds ; restore registers + 4145 00001047 07 pop es + 4146 00001048 58 pop ax + 4147 00001049 5B pop bx + 4148 ;pop ds ; MSDOS 3.3 + 4149 0000104A C3 retn + 4150 + 4151 ;assume ds:DATARES + 4152 GetComDsk2: + 4153 0000104B E81F00 call GetComDsk + 4154 0000104E E9FBFE jmp LodCom1 ; memory already allocated + 4155 + 4156 RestHand: + 4157 00001051 1E push ds + 4158 00001052 53 push bx ; restore stdin, stdout to user + 4159 00001053 50 push ax + 4160 ; 12/01/2023 + 4161 00001054 B451 mov ah,51h + 4162 ;mov ah,GET_CURRENT_PDB ; 51h + 4163 00001056 CD21 int 21h ; point to user's header + 4164 00001058 A1[4602] mov ax,[Handle01] + 4165 0000105B 8EDB mov ds,bx + 4166 ;assume ds:NOTHING + 4167 ;lds bx,[34h] + 4168 0000105D C51E3400 lds bx,[PDB.JFN_Pointer] ; DS:BX = ptr to jfn table + 4169 00001061 8907 mov [bx],ax ; stuff his old 0 and 1 + 4170 00001063 58 pop ax + 4171 00001064 5B pop bx + 4172 00001065 1F pop ds + 4173 00001066 C3 retn + 4174 + 4175 ;assume ds:DATARES,ss:DATARES + 4176 Hopeless: + 4177 00001067 BA[DC05] mov dx,COMBAD + 4178 0000106A E9AEFD jmp FatalC + 4179 + 4180 GetComDsk: + 4181 0000106D A0[9402] mov al,[ComDrv] + 4182 00001070 E849FF call RemCheck + 4183 00001073 75F2 jnz short Hopeless ; non-removable media + 4184 GetComDsk3: + 4185 00001075 81FA[DC05] cmp dx,COMBAD ; cmp dx,offset DATARES:ComBad + 4186 00001079 7503 jne short GetComDsk4 + 4187 ;;mov dx,offset DATARES:ComBad ; DX = ptr to msg + 4188 ; 12/01/2023 + 4189 ;;mov dx,COMBAD ; (MSDOS 5.0 COMMAND.COM - RESGROUP:10A6h) + 4190 ; 05/06/2023 + 4191 ;mov dx,COMBAD ; (MSDOS 6.22 COMMAND.COM - RESGROUP:11B6h) + 4192 ;invoke RPrint ; say COMMAND is invalid + 4193 0000107B E85D03 call RPrint + 4194 ;call RDISPMSG + 4195 + 4196 GetComDsk4: + 4197 + 4198 ; Bugbug: there's always a drive here? No need to check? + 4199 + 4200 0000107E 803E[2F02]00 cmp byte [PutBackDrv],0 ; is there a drive in the comspec? + 4201 00001083 750A jne short Users_Drive ; yes - use it + 4202 00001085 B419 mov ah,19h + 4203 ;mov ah,GET_DEFAULT_DRIVE ; 19h ; use default drive + 4204 + 4205 ; 19/07/2024 - Retro DOS v5 COMMAND.COM + 4206 %if 0 ; PCDOS 7.1 COMMAND.COM + 4207 int 21h ; BX = user's header seg addr + 4208 %else + 4209 00001087 E8D500 call int21h + 4210 %endif + 4211 0000108A 0441 add al,"A" ; convert to ascii + 4212 0000108C A2[2F02] mov [PutBackDrv],al ; put in message to print out + 4213 + 4214 Users_Drive: + 4215 ; 12/01/2023 + 4216 ; MSDOS 6.0 + 4217 0000108F BA[F205] mov dx,PUTBACKMSG ; prompt for diskette + 4218 ;mov si,offset DATARES:PutBackSubst + 4219 ;invoke RPrint + 4220 00001092 BE[2902] mov si,PutBackSubst ; containing COMMAND + 4221 00001095 E84303 call RPrint + 4222 ;mov dx,offset DATARES:Prompt + 4223 ;invoke RPrint + 4224 00001098 BA[1406] mov dx,PROMPT ; "Press any key" + 4225 0000109B E83D03 call RPrint + 4226 + 4227 ; MSDOS 3.3 + 4228 ;mov dx,PUTBACKMSG ; prompt for diskette + 4229 ;call RDISPMSG + 4230 ;mov dx,[PUTBACKSUBSTPTR] + 4231 ;mov si,[COMSPEC_END] + 4232 ;mov byte [si+1],'$' 4233 ;call RDISPMSG - 4234 - 4235 ;call GetRawFlushedByte - 4236 ;retn - 4237 ; 12/01/2023 - 4238 ;jmp short GetRawFlushedByte - 4239 - 4240 ;*** GetRawFlushedByte - flush world and get raw input - 4241 - 4242 GetRawFlushedByte: - 4243 ; 12/01/2023 - 4244 0000109E B8070C mov ax,0C07h - 4245 ;mov ax,(STD_CON_INPUT_FLUSH<<8) | RAW_CON_INPUT ; 0C07h - 4246 000010A1 CD21 int 21h ; get char without testing or echo - 4247 000010A3 B8000C mov ax,0C00h - 4248 ;mov ax,(STD_CON_INPUT_FLUSH<<8) + 0 ; 0C00h - 4249 000010A6 CD21 int 21h - 4250 - 4251 ; Bugbug: get rid of this return and the following retz. - 4252 - 4253 LoadCom_retn: - 4254 000010A8 C3 retn + 4234 ;mov byte [si+1],0 + 4235 ;mov dx,PROMPT + 4236 ;call RDISPMSG + 4237 + 4238 ;call GetRawFlushedByte + 4239 ;retn + 4240 ; 12/01/2023 + 4241 ;jmp short GetRawFlushedByte + 4242 + 4243 ;*** GetRawFlushedByte - flush world and get raw input + 4244 + 4245 GetRawFlushedByte: + 4246 ; 12/01/2023 + 4247 0000109E B8070C mov ax,0C07h + 4248 ;mov ax,(STD_CON_INPUT_FLUSH<<8) | RAW_CON_INPUT ; 0C07h + 4249 000010A1 CD21 int 21h ; get char without testing or echo + 4250 000010A3 B8000C mov ax,0C00h + 4251 ;mov ax,(STD_CON_INPUT_FLUSH<<8) + 0 ; 0C00h + 4252 000010A6 CD21 int 21h + 4253 + 4254 ; Bugbug: get rid of this return and the following retz. 4255 - 4256 ; 21/04/2023 - 4257 TryDoOpen: - 4258 000010A9 E8C1FF call GetComDsk - 4259 ;jmp short LoadCom - 4260 - 4261 ;*** LoadCom - load in transient - 4262 - 4263 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4264 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:10DAh - CODERES:039Ah) + 4256 LoadCom_retn: + 4257 000010A8 C3 retn + 4258 + 4259 ; 21/04/2023 + 4260 TryDoOpen: + 4261 000010A9 E8C1FF call GetComDsk + 4262 ;jmp short LoadCom + 4263 + 4264 ;*** LoadCom - load in transient 4265 - 4266 LoadCom: - 4267 ;assume ds:DATARES - 4268 - 4269 000010AC 45 inc bp ; flag command read - 4270 - 4271 000010AD BA[4B02] mov dx,ComSpec - 4272 000010B0 B8003D mov ax,3D00h - 4273 ;mov ax,OPEN<<8 ; 3D00h - 4274 000010B3 CD21 int 21h ; open command.com - 4275 000010B5 730B jnc short ReadCom - 4276 ;cmp ax,4 - 4277 000010B7 83F804 cmp ax,ERROR_TOO_MANY_OPEN_FILES - 4278 000010BA 75ED jnz short TryDoOpen - 4279 000010BC BA[9E06] mov dx,NOHANDMES - 4280 000010BF E959FD jmp FatalC ; will never find a handle - 4281 - 4282 ; 21/04/2023 - 4283 ;TryDoOpen: - 4284 ;call GetComDsk - 4285 ;jmp short LoadCom - 4286 - 4287 ReadCom: - 4288 000010C2 89C3 mov bx,ax ; BX = handle - 4289 ;mov dx,offset RESGROUP:TranStart - 4290 ; 05/06/2023 - 4291 ;mov dx,26E0h ; MSDOS 6.22 COMMAND.COM - 4292 ; 19/07/2024 - 4293 ;mov dx,2980h ; PCDOS 7.1 COMMAND.COM - 4294 000010C4 BAD027 mov dx,TRANSTART - 4295 000010C7 31C9 xor cx,cx ; CX:DX = seek loc - 4296 000010C9 B80042 mov ax,4200h - 4297 ;mov ax,LSEEK<<8 ; 4200h - 4298 000010CC CD21 int 21h - 4299 000010CE 7210 jc short WrongCom1 - 4300 ; 12/01/2023 - 4301 ;;mov cx,offset TRANGROUP:TranSpaceEnd - 100h - 4302 ;mov cx,97C5h ; MSDOS 5.0 COMMAND.COM - 4303 ; 05/06/2023 - 4304 ;mov cx,0AE95h ; MSDOS 6.22 COMMAND.COM - 4305 ; 19/07/2024 - 4306 ;mov cx,0A99Ah ; PCDOS 7.1 COMMAND.COM - 4307 000010D0 B90BA5 mov cx,TRANSPACEEND-100h ; 4C5Ch (for original MSDOS 3.3!) - 4308 000010D3 1E push ds - 4309 000010D4 8E1E[8F02] mov ds,[TrnSeg] - 4310 ;assume ds:NOTHING - 4311 000010D8 BA0001 mov dx,100h - 4312 000010DB B43F mov ah,3Fh - 4313 ;mov ah,READ ; 3Fh - 4314 000010DD CD21 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE - 4315 ; BX = file handle, CX = number of bytes to read - 4316 ; DS:DX -> buffer - 4317 000010DF 1F pop ds - 4318 ;assume ds:DATARES - 4319 WrongCom1: - 4320 000010E0 9C pushf - 4321 000010E1 50 push ax - 4322 000010E2 B43E mov ah,3Eh - 4323 ;mov ah,CLOSE ; 3Eh - 4324 000010E4 CD21 int 21h ; close command.com - 4325 000010E6 58 pop ax - 4326 000010E7 9D popf - 4327 000010E8 7204 jc short WrongCom ; error on read - 4328 000010EA 39C8 cmp ax,cx - 4329 ;retz ; size matched - 4330 000010EC 74BA jz short LoadCom_retn - 4331 WrongCom: - 4332 000010EE BA[DC05] mov dx,COMBAD - 4333 000010F1 E879FF call GetComDsk - 4334 000010F4 EBB6 jmp short LoadCom ; try again - 4335 - 4336 ;*** ChkSum - compute transient checksum - 4337 - 4338 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4339 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1129h - 4340 - 4341 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 4342 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1239h - 4343 - 4344 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4345 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1207h - 4346 ChkSum: - 4347 000010F6 1E push ds - 4348 000010F7 8E1E[8F02] mov ds,[TrnSeg] - 4349 000010FB BE0001 mov si,100h - 4350 ;;;mov cx,offset TRANGROUP:TranDataEnd - 100h - 4351 ;;mov cx,87C2h ; MSDOS 5.0 - 4352 ; 05/06/2023 - 4353 ;mov cx,9D53h ; MSDOS 6.22 - 4354 ; 19/07/2024 - 4355 ;mov cx,9B47h ; PCDOS 7.1 COMMAND.COM - 4356 000010FE B9[B896] mov cx,TRANDATAEND-100h ; 3E44h (for original MSDOS 3.3!) - 4357 Check_Sum: - 4358 00001101 FC cld - 4359 00001102 D1E9 shr cx,1 - 4360 00001104 31D2 xor dx,dx - 4361 - 4362 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4363 %if 1 ; PCDOS 7.1 COMMAND.COM - 4364 00001106 C606[D58F]FF mov byte [msg_disp_class],0FFh - 4365 0000110B 8916[D78F] mov [extend_buf_ptr],dx ; 0 - 4366 0000110F 8816[D98F] mov [extend_buf_sub],dl ; 0 - 4367 %endif - 4368 - 4369 Chk: - 4370 00001113 AD lodsw - 4371 00001114 01C2 add dx,ax - 4372 00001116 83D200 adc dx,0 - 4373 00001119 E2F8 loop Chk - 4374 - 4375 ; 04/05/2023 - 4376 0000111B 1F pop ds + 4266 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4267 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:10DAh - CODERES:039Ah) + 4268 + 4269 LoadCom: + 4270 ;assume ds:DATARES + 4271 + 4272 000010AC 45 inc bp ; flag command read + 4273 + 4274 000010AD BA[4B02] mov dx,ComSpec + 4275 000010B0 B8003D mov ax,3D00h + 4276 ;mov ax,OPEN<<8 ; 3D00h + 4277 000010B3 CD21 int 21h ; open command.com + 4278 000010B5 730B jnc short ReadCom + 4279 ;cmp ax,4 + 4280 000010B7 83F804 cmp ax,ERROR_TOO_MANY_OPEN_FILES + 4281 000010BA 75ED jnz short TryDoOpen + 4282 000010BC BA[9E06] mov dx,NOHANDMES + 4283 000010BF E959FD jmp FatalC ; will never find a handle + 4284 + 4285 ; 21/04/2023 + 4286 ;TryDoOpen: + 4287 ;call GetComDsk + 4288 ;jmp short LoadCom + 4289 + 4290 ReadCom: + 4291 000010C2 89C3 mov bx,ax ; BX = handle + 4292 ;mov dx,offset RESGROUP:TranStart + 4293 ; 05/06/2023 + 4294 ;mov dx,26E0h ; MSDOS 6.22 COMMAND.COM + 4295 ; 19/07/2024 + 4296 ;mov dx,2980h ; PCDOS 7.1 COMMAND.COM + 4297 000010C4 BAD027 mov dx,TRANSTART + 4298 000010C7 31C9 xor cx,cx ; CX:DX = seek loc + 4299 000010C9 B80042 mov ax,4200h + 4300 ;mov ax,LSEEK<<8 ; 4200h + 4301 000010CC CD21 int 21h + 4302 000010CE 7210 jc short WrongCom1 + 4303 ; 12/01/2023 + 4304 ;;mov cx,offset TRANGROUP:TranSpaceEnd - 100h + 4305 ;mov cx,97C5h ; MSDOS 5.0 COMMAND.COM + 4306 ; 05/06/2023 + 4307 ;mov cx,0AE95h ; MSDOS 6.22 COMMAND.COM + 4308 ; 19/07/2024 + 4309 ;mov cx,0A99Ah ; PCDOS 7.1 COMMAND.COM + 4310 000010D0 B90BA5 mov cx,TRANSPACEEND-100h ; 4C5Ch (for original MSDOS 3.3!) + 4311 000010D3 1E push ds + 4312 000010D4 8E1E[8F02] mov ds,[TrnSeg] + 4313 ;assume ds:NOTHING + 4314 000010D8 BA0001 mov dx,100h + 4315 000010DB B43F mov ah,3Fh + 4316 ;mov ah,READ ; 3Fh + 4317 000010DD CD21 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE + 4318 ; BX = file handle, CX = number of bytes to read + 4319 ; DS:DX -> buffer + 4320 000010DF 1F pop ds + 4321 ;assume ds:DATARES + 4322 WrongCom1: + 4323 000010E0 9C pushf + 4324 000010E1 50 push ax + 4325 000010E2 B43E mov ah,3Eh + 4326 ;mov ah,CLOSE ; 3Eh + 4327 000010E4 CD21 int 21h ; close command.com + 4328 000010E6 58 pop ax + 4329 000010E7 9D popf + 4330 000010E8 7204 jc short WrongCom ; error on read + 4331 000010EA 39C8 cmp ax,cx + 4332 ;retz ; size matched + 4333 000010EC 74BA jz short LoadCom_retn + 4334 WrongCom: + 4335 000010EE BA[DC05] mov dx,COMBAD + 4336 000010F1 E879FF call GetComDsk + 4337 000010F4 EBB6 jmp short LoadCom ; try again + 4338 + 4339 ;*** ChkSum - compute transient checksum + 4340 + 4341 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4342 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1129h + 4343 + 4344 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 4345 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1239h + 4346 + 4347 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4348 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1207h + 4349 ChkSum: + 4350 000010F6 1E push ds + 4351 000010F7 8E1E[8F02] mov ds,[TrnSeg] + 4352 000010FB BE0001 mov si,100h + 4353 ;;;mov cx,offset TRANGROUP:TranDataEnd - 100h + 4354 ;;mov cx,87C2h ; MSDOS 5.0 + 4355 ; 05/06/2023 + 4356 ;mov cx,9D53h ; MSDOS 6.22 + 4357 ; 19/07/2024 + 4358 ;mov cx,9B47h ; PCDOS 7.1 COMMAND.COM + 4359 000010FE B9[B896] mov cx,TRANDATAEND-100h ; 3E44h (for original MSDOS 3.3!) + 4360 Check_Sum: + 4361 00001101 FC cld + 4362 00001102 D1E9 shr cx,1 + 4363 00001104 31D2 xor dx,dx + 4364 + 4365 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4366 %if 1 ; PCDOS 7.1 COMMAND.COM + 4367 00001106 C606[D58F]FF mov byte [msg_disp_class],0FFh + 4368 0000110B 8916[D78F] mov [extend_buf_ptr],dx ; 0 + 4369 0000110F 8816[D98F] mov [extend_buf_sub],dl ; 0 + 4370 %endif + 4371 + 4372 Chk: + 4373 00001113 AD lodsw + 4374 00001114 01C2 add dx,ax + 4375 00001116 83D200 adc dx,0 + 4376 00001119 E2F8 loop Chk 4377 - 4378 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4379 0000111C 3B16[9702] cmp dx,[Sum] + 4378 ; 04/05/2023 + 4379 0000111B 1F pop ds 4380 - 4381 ;pop ds ; 04/05/2023 - 4382 00001120 C3 retn + 4381 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4382 0000111C 3B16[9702] cmp dx,[Sum] 4383 - 4384 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4385 ; --------------------------------------- - 4386 ; PCDOS 7.1 COMMAND.COM - RESGROUP:122Eh - 4387 %if 1 - 4388 chk_transient: ; check transient portion is valid or not - 4389 00001121 1E push ds - 4390 00001122 8E1E[8F02] mov ds,[TrnSeg] - 4391 00001126 813E[0401]9090 cmp word [TCOMMAND],9090h ; nop, nop - 4392 0000112C 1F pop ds - 4393 0000112D C3 retn - 4394 %endif - 4395 ; --------------------------------------- - 4396 - 4397 ;*** SetVect - set interrupt vectors - 4398 - 4399 SetVect: - 4400 - 4401 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4402 ; PCDOS 7.1 COMMAND.COM - 4403 %if 0 - 4404 ;mov dx,offset DATARES:LodCom_Trap - 4405 ; 12/01/2023 - 4406 mov dx,LodCom_Trap - 4407 ;mov dx,LODCOM ; MSDOS 3.3 - 4408 mov [PDB.EXIT],dx ; mov ds:0Ah,dx - 4409 mov [PDB.EXIT+2],ds ; mov ds:0Ch,ds - 4410 - 4411 mov ax,2522h - 4412 ;mov ax,(SET_INTERRUPT_VECTOR<<8) | 22h ; 2522h - 4413 int 21h - 4414 ;mov dx,offset DATARES:Ctrlc_Trap - 4415 mov dx,Ctrlc_Trap - 4416 ;mov dx,CONTC ; MSDOS 3.3 - 4417 inc al ; 23h - 4418 int 21h - 4419 ;mov dx,offset DATARES:CritErr_Trap - 4420 mov dx,CritErr_Trap - 4421 ;mov dx,CRITERR ; MSDOS 3.3 - 4422 inc al ; 24h - 4423 int 21h - 4424 retn - 4425 %else - 4426 ; PCDOS 7.1 COMMAND.COM - 4427 ;mov dx,LodCom_Trap - 4428 ;mov [PDB.EXIT],dx ; mov ds:0Ah,dx - 4429 ;mov [PDB.EXIT+2],ds ; mov ds:0Ch,ds - 4430 - 4431 ;push es - 4432 ;push bx - 4433 ;xor bx,bx - 4434 ;mov es,bx - 4435 ;mov bl,88h ; INT 22h vector - 4436 ;cli - 4437 ;mov [es:bx],dx - 4438 ;mov [es:bx+2],ds - 4439 ;mov dx,Ctrlc_Trap - 4440 ;mov bl,8Ch ; INT 23h vector - 4441 ;mov [es:bx],dx - 4442 ;mov [es:bx+2],ds - 4443 ;mov dx,CritErr_Trap - 4444 ;mov bl,90h ; INT 24h vector - 4445 ;mov [es:bx],dx - 4446 ;mov [es:bx+2],ds - 4447 ;sti - 4448 ;pop bx - 4449 ;pop es - 4450 ;retn - 4451 - 4452 ; 19/07/2024 - 4453 ; Retro DOS v5.0 COMMAND.COM + 4384 ;pop ds ; 04/05/2023 + 4385 00001120 C3 retn + 4386 + 4387 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4388 ; --------------------------------------- + 4389 ; PCDOS 7.1 COMMAND.COM - RESGROUP:122Eh + 4390 %if 1 + 4391 chk_transient: ; check transient portion is valid or not + 4392 00001121 1E push ds + 4393 00001122 8E1E[8F02] mov ds,[TrnSeg] + 4394 00001126 813E[0401]9090 cmp word [TCOMMAND],9090h ; nop, nop + 4395 0000112C 1F pop ds + 4396 0000112D C3 retn + 4397 %endif + 4398 ; --------------------------------------- + 4399 + 4400 ;*** SetVect - set interrupt vectors + 4401 + 4402 SetVect: + 4403 + 4404 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4405 ; PCDOS 7.1 COMMAND.COM + 4406 %if 0 + 4407 ;mov dx,offset DATARES:LodCom_Trap + 4408 ; 12/01/2023 + 4409 mov dx,LodCom_Trap + 4410 ;mov dx,LODCOM ; MSDOS 3.3 + 4411 mov [PDB.EXIT],dx ; mov ds:0Ah,dx + 4412 mov [PDB.EXIT+2],ds ; mov ds:0Ch,ds + 4413 + 4414 mov ax,2522h + 4415 ;mov ax,(SET_INTERRUPT_VECTOR<<8) | 22h ; 2522h + 4416 int 21h + 4417 ;mov dx,offset DATARES:Ctrlc_Trap + 4418 mov dx,Ctrlc_Trap + 4419 ;mov dx,CONTC ; MSDOS 3.3 + 4420 inc al ; 23h + 4421 int 21h + 4422 ;mov dx,offset DATARES:CritErr_Trap + 4423 mov dx,CritErr_Trap + 4424 ;mov dx,CRITERR ; MSDOS 3.3 + 4425 inc al ; 24h + 4426 int 21h + 4427 retn + 4428 %else + 4429 ; PCDOS 7.1 COMMAND.COM + 4430 ;mov dx,LodCom_Trap + 4431 ;mov [PDB.EXIT],dx ; mov ds:0Ah,dx + 4432 ;mov [PDB.EXIT+2],ds ; mov ds:0Ch,ds + 4433 + 4434 ;push es + 4435 ;push bx + 4436 ;xor bx,bx + 4437 ;mov es,bx + 4438 ;mov bl,88h ; INT 22h vector + 4439 ;cli + 4440 ;mov [es:bx],dx + 4441 ;mov [es:bx+2],ds + 4442 ;mov dx,Ctrlc_Trap + 4443 ;mov bl,8Ch ; INT 23h vector + 4444 ;mov [es:bx],dx + 4445 ;mov [es:bx+2],ds + 4446 ;mov dx,CritErr_Trap + 4447 ;mov bl,90h ; INT 24h vector + 4448 ;mov [es:bx],dx + 4449 ;mov [es:bx+2],ds + 4450 ;sti + 4451 ;pop bx + 4452 ;pop es + 4453 ;retn 4454 - 4455 0000112E 06 push es - 4456 ;push di - 4457 0000112F 31FF xor di,di - 4458 00001131 8EC7 mov es,di - 4459 00001133 BF8800 mov di,88h - 4460 00001136 1E push ds - 4461 00001137 1E push ds - 4462 00001138 1E push ds - 4463 00001139 B8[E000] mov ax,LodCom_Trap - 4464 0000113C A30A00 mov [PDB.EXIT],ax ; mov ds:0Ah,ax - 4465 0000113F 8C1E0C00 mov [PDB.EXIT+2],ds ; mov ds:0Ch,ds - 4466 00001143 FA cli - 4467 00001144 AB stosw - 4468 00001145 58 pop ax ; segment (ds) - 4469 00001146 AB stosw - 4470 00001147 B8[AC00] mov ax,Ctrlc_Trap - 4471 0000114A AB stosw - 4472 0000114B 58 pop ax ; segment (ds) - 4473 0000114C AB stosw - 4474 0000114D B8[B700] mov ax,CritErr_Trap - 4475 00001150 AB stosw - 4476 00001151 58 pop ax ; segment (ds) - 4477 00001152 AB stosw - 4478 00001153 FB sti - 4479 ;pop di - 4480 00001154 07 pop es - 4481 00001155 C3 retn - 4482 %endif - 4483 - 4484 ; ---------------------- - 4485 ; MSDOS 6.0 - 4486 ;;SR; - 4487 ;We have this to take care of the extra values pushed on the stack by - 4488 ;the stub before jumping to LodCom1. We set up ds here and then jump to - 4489 ;Lodcom1 - 4490 - 4491 ;public TrnLodCom1 - 4492 ; 12/01/2023 - 4493 TrnLodCom1: - 4494 00001156 1F pop ds ; ds = DATARES - 4495 00001157 83C402 add sp,2 - 4496 ; pop ds:OldDS - 4497 0000115A E9EFFD jmp LodCom1 - 4498 ; ---------------------- - 4499 - 4500 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4501 ; --------------------------------------- - 4502 %if 1 ; PCDOS 7.1 COMMAND.COM - 4503 int21h_close: - 4504 0000115D B43E mov ah,3Eh ; CLOSE file - 4505 int21h: - 4506 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1272h - 4507 0000115F 06 push es - 4508 00001160 53 push bx - 4509 00001161 31DB xor bx,bx - 4510 00001163 8EC3 mov es,bx ; 0 - 4511 00001165 5B pop bx - 4512 00001166 9C pushf ; Int 21h simulation (ES=0) - 4513 00001167 FA cli - 4514 ;call dword ptr es:84h - 4515 00001168 26FF1E8400 call far [es:84h] ; INT 21h handler - 4516 0000116D 07 pop es - 4517 0000116E C3 retn - 4518 %endif - 4519 ; --------------------------------------- - 4520 - 4521 ;============================================================================= - 4522 ; RUCODE.ASM, MSDOS 6.0, 1991 - 4523 ;============================================================================= - 4524 ; 22/09/2018 - Retro DOS v3.0 - 4525 - 4526 ; title Localizable code for resident COMMAND - 4527 - 4528 ;assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING - 4529 - 4530 ; ---------------------------------------------------------------------------- - 4531 ;*** AskEnd - ask user to confirm batch file termination - 4532 ; - 4533 ; Confirm with user before freeing batch ... - 4534 ; - 4535 ; ENTRY nothing - 4536 ; - 4537 ; EXIT CY = set if batch termination is confirmed - 4538 ; - 4539 ; CY = clear if batch should continue - 4540 ; - 4541 ; USED AX,DX,... - 4542 ; - 4543 ; Bugbug: move this to transient, copy to batch segment. - 4544 ; Bugbug: or move it to command1 1st. + 4455 ; 19/07/2024 + 4456 ; Retro DOS v5.0 COMMAND.COM + 4457 + 4458 0000112E 06 push es + 4459 ;push di + 4460 0000112F 31FF xor di,di + 4461 00001131 8EC7 mov es,di + 4462 00001133 BF8800 mov di,88h + 4463 00001136 1E push ds + 4464 00001137 1E push ds + 4465 00001138 1E push ds + 4466 00001139 B8[E000] mov ax,LodCom_Trap + 4467 0000113C A30A00 mov [PDB.EXIT],ax ; mov ds:0Ah,ax + 4468 0000113F 8C1E0C00 mov [PDB.EXIT+2],ds ; mov ds:0Ch,ds + 4469 00001143 FA cli + 4470 00001144 AB stosw + 4471 00001145 58 pop ax ; segment (ds) + 4472 00001146 AB stosw + 4473 00001147 B8[AC00] mov ax,Ctrlc_Trap + 4474 0000114A AB stosw + 4475 0000114B 58 pop ax ; segment (ds) + 4476 0000114C AB stosw + 4477 0000114D B8[B700] mov ax,CritErr_Trap + 4478 00001150 AB stosw + 4479 00001151 58 pop ax ; segment (ds) + 4480 00001152 AB stosw + 4481 00001153 FB sti + 4482 ;pop di + 4483 00001154 07 pop es + 4484 00001155 C3 retn + 4485 %endif + 4486 + 4487 ; ---------------------- + 4488 ; MSDOS 6.0 + 4489 ;;SR; + 4490 ;We have this to take care of the extra values pushed on the stack by + 4491 ;the stub before jumping to LodCom1. We set up ds here and then jump to + 4492 ;Lodcom1 + 4493 + 4494 ;public TrnLodCom1 + 4495 ; 12/01/2023 + 4496 TrnLodCom1: + 4497 00001156 1F pop ds ; ds = DATARES + 4498 00001157 83C402 add sp,2 + 4499 ; pop ds:OldDS + 4500 0000115A E9EFFD jmp LodCom1 + 4501 ; ---------------------- + 4502 + 4503 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4504 ; --------------------------------------- + 4505 %if 1 ; PCDOS 7.1 COMMAND.COM + 4506 int21h_close: + 4507 0000115D B43E mov ah,3Eh ; CLOSE file + 4508 int21h: + 4509 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1272h + 4510 0000115F 06 push es + 4511 00001160 53 push bx + 4512 00001161 31DB xor bx,bx + 4513 00001163 8EC3 mov es,bx ; 0 + 4514 00001165 5B pop bx + 4515 00001166 9C pushf ; Int 21h simulation (ES=0) + 4516 00001167 FA cli + 4517 ;call dword ptr es:84h + 4518 00001168 26FF1E8400 call far [es:84h] ; INT 21h handler + 4519 0000116D 07 pop es + 4520 0000116E C3 retn + 4521 %endif + 4522 ; --------------------------------------- + 4523 + 4524 ;============================================================================= + 4525 ; RUCODE.ASM, MSDOS 6.0, 1991 + 4526 ;============================================================================= + 4527 ; 22/09/2018 - Retro DOS v3.0 + 4528 + 4529 ; title Localizable code for resident COMMAND + 4530 + 4531 ;assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING + 4532 + 4533 ; ---------------------------------------------------------------------------- + 4534 ;*** AskEnd - ask user to confirm batch file termination + 4535 ; + 4536 ; Confirm with user before freeing batch ... + 4537 ; + 4538 ; ENTRY nothing + 4539 ; + 4540 ; EXIT CY = set if batch termination is confirmed + 4541 ; + 4542 ; CY = clear if batch should continue + 4543 ; + 4544 ; USED AX,DX,... 4545 ; - 4546 ; Bugbug: No_Char and Yes_Char should be constants. - 4547 ; ---------------------------------------------------------------------------- - 4548 - 4549 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4550 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1169h (CODERES:0429h) + 4546 ; Bugbug: move this to transient, copy to batch segment. + 4547 ; Bugbug: or move it to command1 1st. + 4548 ; + 4549 ; Bugbug: No_Char and Yes_Char should be constants. + 4550 ; ---------------------------------------------------------------------------- 4551 - 4552 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 4553 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1279h (CODERES:0429h) + 4552 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4553 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1169h (CODERES:0429h) 4554 - 4555 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4556 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1289h - 4557 AskEnd: - 4558 ;assume ds:DATARES - 4559 - 4560 0000116F BA[3606] mov dx,ENDBATMES ; DX = message # - 4561 00001172 E86602 call RPrint - 4562 ;call RDISPMSG ; MSDOS 3.3 - 4563 00001175 B8010C mov ax,0C01h - 4564 ;mov ax,(STD_CON_INPUT_FLUSH<<8) + STD_CON_INPUT ;0C01h - 4565 00001178 CD21 int 21h ; DOS - CLEAR KEYBOARD BUFFER - 4566 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. - 4567 0000117A E8F702 call CharToUpper ; change to upper case - 4568 0000117D 3A06[3D05] cmp al,[NO_CHAR] - 4569 00001181 7407 je short aeRet ; answer is no (CY is clear) - 4570 00001183 3A06[3C05] cmp al,[YES_CHAR] - 4571 00001187 75E6 jne short AskEnd ; invalid response, try again - 4572 00001189 F9 stc ; answer is yes - 4573 aeRet: - 4574 0000118A C3 retn - 4575 - 4576 ; ---------------------------------------------------------------------------- - 4577 ;*** DskErr - critical error handler - 4578 ; - 4579 ; Default critical error handler unless user intercepts int 24h. - 4580 ; - 4581 ; ENTRY int 24h - 4582 ; - 4583 ; EXIT - 4584 ; - 4585 ; USED - 4586 ; - 4587 ; EFFECTS - 4588 ; ---------------------------------------------------------------------------- - 4589 - 4590 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4591 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1185h (CODERES:0445h) + 4555 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 4556 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1279h (CODERES:0429h) + 4557 + 4558 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4559 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1289h + 4560 AskEnd: + 4561 ;assume ds:DATARES + 4562 + 4563 0000116F BA[3606] mov dx,ENDBATMES ; DX = message # + 4564 00001172 E86602 call RPrint + 4565 ;call RDISPMSG ; MSDOS 3.3 + 4566 00001175 B8010C mov ax,0C01h + 4567 ;mov ax,(STD_CON_INPUT_FLUSH<<8) + STD_CON_INPUT ;0C01h + 4568 00001178 CD21 int 21h ; DOS - CLEAR KEYBOARD BUFFER + 4569 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. + 4570 0000117A E8F702 call CharToUpper ; change to upper case + 4571 0000117D 3A06[3D05] cmp al,[NO_CHAR] + 4572 00001181 7407 je short aeRet ; answer is no (CY is clear) + 4573 00001183 3A06[3C05] cmp al,[YES_CHAR] + 4574 00001187 75E6 jne short AskEnd ; invalid response, try again + 4575 00001189 F9 stc ; answer is yes + 4576 aeRet: + 4577 0000118A C3 retn + 4578 + 4579 ; ---------------------------------------------------------------------------- + 4580 ;*** DskErr - critical error handler + 4581 ; + 4582 ; Default critical error handler unless user intercepts int 24h. + 4583 ; + 4584 ; ENTRY int 24h + 4585 ; + 4586 ; EXIT + 4587 ; + 4588 ; USED + 4589 ; + 4590 ; EFFECTS + 4591 ; ---------------------------------------------------------------------------- 4592 - 4593 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM - 4594 ; PCDOS 7.1 COMMAND.COM - RESGROUP:12A5h + 4593 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4594 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1185h (CODERES:0445h) 4595 - 4596 ;SR; - 4597 ;The stub is going to push the old ds value and the resident data segment - 4598 ;onto the stack in that order. Get it off the stack - 4599 - 4600 ;DskErr proc far - 4601 DSKERR: - 4602 ;assume ds:NOTHING,es:NOTHING,ss:NOTHING - 4603 ; 12/01/2023 - 4604 0000118B 1F pop ds ; ds = DATARES - 4605 ;assume ds:DATARES - 4606 0000118C 8F06[2E05] pop word [OldDS] ; save old ds value - 4607 - 4608 ;CRITERR: ; MSDOS 3.3 - 4609 00001190 FB sti - 4610 ; 12/01/2023 - 4611 ;push ds ; 25/09/2018 - 4612 00001191 06 push es - 4613 00001192 56 push si - 4614 00001193 51 push cx - 4615 00001194 57 push di - 4616 00001195 51 push cx - 4617 00001196 50 push ax - 4618 - 4619 00001197 1E push ds ;save our data segment - 4620 ;push cs ; 25/09/2018 - 4621 00001198 07 pop es ;es = DATARES - 4622 - 4623 00001199 8EDD mov ds,bp - 4624 ;assume ds:nothing + 4596 ; 19/07/2024 - Retro DOS v5.0 COMMAND.COM + 4597 ; PCDOS 7.1 COMMAND.COM - RESGROUP:12A5h + 4598 + 4599 ;SR; + 4600 ;The stub is going to push the old ds value and the resident data segment + 4601 ;onto the stack in that order. Get it off the stack + 4602 + 4603 ;DskErr proc far + 4604 DSKERR: + 4605 ;assume ds:NOTHING,es:NOTHING,ss:NOTHING + 4606 ; 12/01/2023 + 4607 0000118B 1F pop ds ; ds = DATARES + 4608 ;assume ds:DATARES + 4609 0000118C 8F06[2E05] pop word [OldDS] ; save old ds value + 4610 + 4611 ;CRITERR: ; MSDOS 3.3 + 4612 00001190 FB sti + 4613 ; 12/01/2023 + 4614 ;push ds ; 25/09/2018 + 4615 00001191 06 push es + 4616 00001192 56 push si + 4617 00001193 51 push cx + 4618 00001194 57 push di + 4619 00001195 51 push cx + 4620 00001196 50 push ax + 4621 + 4622 00001197 1E push ds ;save our data segment + 4623 ;push cs ; 25/09/2018 + 4624 00001198 07 pop es ;es = DATARES 4625 - 4626 ;mov ax,[si].SDEVATT - 4627 0000119B 8B4404 mov ax,[si+SYSDEV.ATT] ; mov ax,[si+4] - 4628 0000119E 268826[2502] mov [es:CDevAt],ah - 4629 - 4630 ;push cs - 4631 ;pop es + 4626 00001199 8EDD mov ds,bp + 4627 ;assume ds:nothing + 4628 + 4629 ;mov ax,[si].SDEVATT + 4630 0000119B 8B4404 mov ax,[si+SYSDEV.ATT] ; mov ax,[si+4] + 4631 0000119E 268826[2502] mov [es:CDevAt],ah 4632 - 4633 000011A3 BF[1802] mov di,DevName - 4634 000011A6 B90800 mov cx,8 - 4635 ;add si,SDEVNAME ; add si,10 - 4636 000011A9 83C60A add si,SYSDEV.NAME ; save device name (even for block device) - 4637 - 4638 000011AC FC cld - 4639 000011AD F3A4 rep movsb - 4640 000011AF 58 pop ax - 4641 000011B0 59 pop cx - 4642 000011B1 5F pop di - 4643 - 4644 ; Stack still contains DS and ES. - 4645 - 4646 ;SR; - 4647 ;We need ds = DATARES for SavHand + 4633 ;push cs + 4634 ;pop es + 4635 + 4636 000011A3 BF[1802] mov di,DevName + 4637 000011A6 B90800 mov cx,8 + 4638 ;add si,SDEVNAME ; add si,10 + 4639 000011A9 83C60A add si,SYSDEV.NAME ; save device name (even for block device) + 4640 + 4641 000011AC FC cld + 4642 000011AD F3A4 rep movsb + 4643 000011AF 58 pop ax + 4644 000011B0 59 pop cx + 4645 000011B1 5F pop di + 4646 + 4647 ; Stack still contains DS and ES. 4648 - 4649 ;12/01/2023 - 4650 000011B2 06 push es - 4651 000011B3 1F pop ds - 4652 ;assume ds:DATARES - 4653 - 4654 ;invoke SavHand ; save user's stdin/out, set to our stderr - 4655 000011B4 E870FE call SavHand + 4649 ;SR; + 4650 ;We need ds = DATARES for SavHand + 4651 + 4652 ;12/01/2023 + 4653 000011B2 06 push es + 4654 000011B3 1F pop ds + 4655 ;assume ds:DATARES 4656 - 4657 ; 12/01/2023 - 4658 ; 25/09/2018 - 4659 ;;push cs - 4660 ;push es - 4661 ;pop ds ; set up local data segment - 4662 ;assume ds:resgroup - 4663 - 4664 000011B7 52 push dx - 4665 000011B8 E81D02 call crlf - 4666 000011BB 5A pop dx - 4667 - 4668 ; Bugbug: rename Crit_Err_Info to CritErrAH? - 4669 - 4670 000011BC 8826[9C02] mov [Crit_Err_Info],ah ; save critical error flags - 4671 - 4672 ; Compute and save ASCII drive letter (nonsense for char devices) - 4673 - 4674 000011C0 0441 add al,'A' - 4675 000011C2 A2[0502] mov [DrvLet],al + 4657 ;invoke SavHand ; save user's stdin/out, set to our stderr + 4658 000011B4 E870FE call SavHand + 4659 + 4660 ; 12/01/2023 + 4661 ; 25/09/2018 + 4662 ;;push cs + 4663 ;push es + 4664 ;pop ds ; set up local data segment + 4665 ;assume ds:resgroup + 4666 + 4667 000011B7 52 push dx + 4668 000011B8 E81D02 call crlf + 4669 000011BB 5A pop dx + 4670 + 4671 ; Bugbug: rename Crit_Err_Info to CritErrAH? + 4672 + 4673 000011BC 8826[9C02] mov [Crit_Err_Info],ah ; save critical error flags + 4674 + 4675 ; Compute and save ASCII drive letter (nonsense for char devices) 4676 - 4677 ; Bugbug: These labels are awful. Change, especially 'NoHardE'. - 4678 - 4679 000011C5 F6C480 test ah,80h - 4680 000011C8 740A jz short NoHardE ; it's a disk-device error - 4681 000011CA F606[2502]80 test byte [CDevAt],DEVTYP>>8 ; 80h - 4682 000011CF 7503 jnz short NoHardE ; it's a character device - 4683 000011D1 E9F701 jmp FatErr ; it's a FAT error - 4684 - 4685 NoHardE: - 4686 000011D4 BE[5E05] mov si,MREAD ; SI = "read" msg # - 4687 000011D7 F6C401 test ah,1 - 4688 000011DA 7403 jz short SavMes ; it's a read error - 4689 000011DC BE[6705] mov si,MWRITE ; SI = "write" msg # - 4690 SavMes: - 4691 000011DF 893E[5C04] mov [OldErrNo],di ; save critical error code - 4692 - 4693 ; Bugbug: don't need to save/restore all here? - 4694 - 4695 000011E3 06 push es - 4696 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 4697 ;push ds ; GetExtendedError likes to STOMP - 4698 ; 12/01/2023 - 4699 ; (all registers are changed -in dos service- except bp) * - 4700 ;push bp - 4701 ; 19/07/2024 - 4702 ;push si - 4703 ;push dx - 4704 000011E4 51 push cx - 4705 000011E5 53 push bx - 4706 ; 05/06/2023 - 4707 000011E6 B459 mov ah,59h ; * - 4708 ;mov ah,GetExtendedError ; 59h ; get extended error info - 4709 000011E8 CD21 int 21h - 4710 000011EA 5B pop bx - 4711 000011EB 59 pop cx - 4712 ; 19/07/2024 - 4713 ;pop dx - 4714 ;pop si - 4715 ; 12/01/2023 - 4716 ;pop bp - 4717 ; 19/07/2024 - 4718 ;pop ds - 4719 000011EC 893E[3302] mov [NeedVol],di ; save possible ptr to volume label - 4720 000011F0 8C06[3502] mov [NeedVol+2],es - 4721 000011F4 07 pop es - 4722 - 4723 ; Bugbug: AX has extended error code, so no need to zero AH? - 4724 - 4725 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM - 4726 ;xor ah,ah - 4727 000011F5 89C7 mov di,ax ; DI = error code - 4728 - 4729 ; Bugbug: somewhat obsolete documentation? - 4730 ; - 4731 ; DI is now the correct error code. Classify things to see what we are - 4732 ; allowed to report. We convert DI into a 0-based index into a message table. - 4733 ; This presumes that the int 24 errors (oldstyle) and new errors (sharing and - 4734 ; the like) are contiguous. - 4735 - 4736 ; Bugbug: simplify following code by cmp'ing instead of sub'ing. - 4737 ; Check use of ErrCd_24, though. + 4677 000011C0 0441 add al,'A' + 4678 000011C2 A2[0502] mov [DrvLet],al + 4679 + 4680 ; Bugbug: These labels are awful. Change, especially 'NoHardE'. + 4681 + 4682 000011C5 F6C480 test ah,80h + 4683 000011C8 740A jz short NoHardE ; it's a disk-device error + 4684 000011CA F606[2502]80 test byte [CDevAt],DEVTYP>>8 ; 80h + 4685 000011CF 7503 jnz short NoHardE ; it's a character device + 4686 000011D1 E9F701 jmp FatErr ; it's a FAT error + 4687 + 4688 NoHardE: + 4689 000011D4 BE[5E05] mov si,MREAD ; SI = "read" msg # + 4690 000011D7 F6C401 test ah,1 + 4691 000011DA 7403 jz short SavMes ; it's a read error + 4692 000011DC BE[6705] mov si,MWRITE ; SI = "write" msg # + 4693 SavMes: + 4694 000011DF 893E[5C04] mov [OldErrNo],di ; save critical error code + 4695 + 4696 ; Bugbug: don't need to save/restore all here? + 4697 + 4698 000011E3 06 push es + 4699 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 4700 ;push ds ; GetExtendedError likes to STOMP + 4701 ; 12/01/2023 + 4702 ; (all registers are changed -in dos service- except bp) * + 4703 ;push bp + 4704 ; 19/07/2024 + 4705 ;push si + 4706 ;push dx + 4707 000011E4 51 push cx + 4708 000011E5 53 push bx + 4709 ; 05/06/2023 + 4710 000011E6 B459 mov ah,59h ; * + 4711 ;mov ah,GetExtendedError ; 59h ; get extended error info + 4712 000011E8 CD21 int 21h + 4713 000011EA 5B pop bx + 4714 000011EB 59 pop cx + 4715 ; 19/07/2024 + 4716 ;pop dx + 4717 ;pop si + 4718 ; 12/01/2023 + 4719 ;pop bp + 4720 ; 19/07/2024 + 4721 ;pop ds + 4722 000011EC 893E[3302] mov [NeedVol],di ; save possible ptr to volume label + 4723 000011F0 8C06[3502] mov [NeedVol+2],es + 4724 000011F4 07 pop es + 4725 + 4726 ; Bugbug: AX has extended error code, so no need to zero AH? + 4727 + 4728 ; 19/07/2024 - PCDOS 7.1 COMMAND.COM + 4729 ;xor ah,ah + 4730 000011F5 89C7 mov di,ax ; DI = error code + 4731 + 4732 ; Bugbug: somewhat obsolete documentation? + 4733 ; + 4734 ; DI is now the correct error code. Classify things to see what we are + 4735 ; allowed to report. We convert DI into a 0-based index into a message table. + 4736 ; This presumes that the int 24 errors (oldstyle) and new errors (sharing and + 4737 ; the like) are contiguous. 4738 - 4739 000011F7 83EF13 sub di,ERROR_WRITE_PROTECT ; 13h - 4740 000011FA 7303 jae short HavCod + 4739 ; Bugbug: simplify following code by cmp'ing instead of sub'ing. + 4740 ; Check use of ErrCd_24, though. 4741 - 4742 ; Bugbug: wouldn't it be better to display the original error msg, - 4743 ; even though it's not a critical error? + 4742 000011F7 83EF13 sub di,ERROR_WRITE_PROTECT ; 13h + 4743 000011FA 7303 jae short HavCod 4744 - 4745 000011FC BF0C00 mov di,ERROR_GEN_FAILURE - ERROR_WRITE_PROTECT ; mov di,0Ch - 4746 - 4747 ; DI now has the mapped error code. Old style errors are: - 4748 ; FOOBAR ing drive ZZ. - 4749 ; New style errors are: - 4750 ; FOOBAR - 4751 ; We need to figure out which the particular error belongs to. - 4752 - 4753 HavCod: - 4754 000011FF C606[3702]00 mov byte [ErrType],0 ; assume old style - 4755 00001204 83FF10 cmp di,ERROR_FCB_UNAVAILABLE - ERROR_WRITE_PROTECT ; cmp di,10h - 4756 00001207 7405 je short SetStyle - 4757 00001209 83FF11 cmp di,ERROR_SHARING_BUFFER_EXCEEDED - ERROR_WRITE_PROTECT ; cmp di,11h - 4758 0000120C 7504 jne short GotStyle - 4759 - 4760 SetStyle: - 4761 ; Bugbug: use INC - 4762 ;mov byte [ErrType],1 ; must be new type - 4763 0000120E FE06[3702] inc byte [ErrType] ; Retro DOS v3.0 COMMAND.COM - 22/09/2018 - 4764 - 4765 GotStyle: - 4766 00001212 893E[4402] mov [ErrCd_24],di - 4767 ; 12/01/2023 - 4768 ; 25/09/2018 - 4769 ; MSDOS 6.0 - 4770 00001216 83FF14 cmp di,ERROR_HANDLE_DISK_FULL - ERROR_WRITE_PROTECT ; cmp di,14h - 4771 ; MSDOS 3.3 - 4772 ;cmp di,ERROR_SHARING_BUFFER_EXCEEDED - ERROR_WRITE_PROTECT ; cmp di,11h - 4773 - 4774 ; If the error message is unknown - 4775 00001219 7641 jbe short NormalError ; redirector, continue. Otherwise, + 4745 ; Bugbug: wouldn't it be better to display the original error msg, + 4746 ; even though it's not a critical error? + 4747 + 4748 000011FC BF0C00 mov di,ERROR_GEN_FAILURE - ERROR_WRITE_PROTECT ; mov di,0Ch + 4749 + 4750 ; DI now has the mapped error code. Old style errors are: + 4751 ; FOOBAR ing drive ZZ. + 4752 ; New style errors are: + 4753 ; FOOBAR + 4754 ; We need to figure out which the particular error belongs to. + 4755 + 4756 HavCod: + 4757 000011FF C606[3702]00 mov byte [ErrType],0 ; assume old style + 4758 00001204 83FF10 cmp di,ERROR_FCB_UNAVAILABLE - ERROR_WRITE_PROTECT ; cmp di,10h + 4759 00001207 7405 je short SetStyle + 4760 00001209 83FF11 cmp di,ERROR_SHARING_BUFFER_EXCEEDED - ERROR_WRITE_PROTECT ; cmp di,11h + 4761 0000120C 7504 jne short GotStyle + 4762 + 4763 SetStyle: + 4764 ; Bugbug: use INC + 4765 ;mov byte [ErrType],1 ; must be new type + 4766 0000120E FE06[3702] inc byte [ErrType] ; Retro DOS v3.0 COMMAND.COM - 22/09/2018 + 4767 + 4768 GotStyle: + 4769 00001212 893E[4402] mov [ErrCd_24],di + 4770 ; 12/01/2023 + 4771 ; 25/09/2018 + 4772 ; MSDOS 6.0 + 4773 00001216 83FF14 cmp di,ERROR_HANDLE_DISK_FULL - ERROR_WRITE_PROTECT ; cmp di,14h + 4774 ; MSDOS 3.3 + 4775 ;cmp di,ERROR_SHARING_BUFFER_EXCEEDED - ERROR_WRITE_PROTECT ; cmp di,11h 4776 - 4777 ; We do not know how to handle this error. Ask IFSFUNC if she knows - 4778 ; how to handle things + 4777 ; If the error message is unknown + 4778 00001219 7641 jbe short NormalError ; redirector, continue. Otherwise, 4779 - 4780 ;input to IFSFUNC: AL=1 - 4781 ; BX=extended error number - 4782 ; - 4783 ;output from IFSFUNC: AL=error type (0 or 1) - 4784 ; 0= error (read/writ)ing (drive/device) xxx - 4785 ; Abort, Retry, Ignore - 4786 ; 1= - 4787 ; Abort, Retry, Ignore - 4788 ; ES:DI=pointer to message text - 4789 ; carry set=>no message - 4790 - 4791 0000121B 89C7 mov di,ax ; retrieve correct extended error... - 4792 0000121D B80005 mov ax,0500h ; is the redir there? - 4793 00001220 CD2F int 2Fh ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - INSTALLATION CHECK - 4794 ; Return: AL = 00h not installed, OK to install - 4795 ; 01h not installed, can't install - 4796 ; FFh installed - 4797 00001222 3CFF cmp al,0FFh - 4798 00001224 7529 jne short NoHandler ; no, go to NoHandler - 4799 - 4800 ; 12/01/2023 - 4801 ; MSDOS 6.0 - 4802 00001226 53 push bx - 4803 00001227 89FB mov bx,di ; get ErrType and ptr to error msg - 4804 00001229 B80105 mov ax,0501h - 4805 0000122C CD2F int 2Fh ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - - 4806 0000122E 5B pop bx - 4807 0000122F 721E jc short NoHandler - 4808 - 4809 ; MSDOS 3.3 - 4810 ;mov ax,di - 4811 ;mov ah,5 - 4812 ;int 2Fh ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - - 4813 ;jc short NOHANDLER - 4814 - 4815 ; Bugbug: need to record error type? - 4816 - 4817 00001231 A2[3702] mov [ErrType],al - 4818 - 4819 00001234 1E push ds - 4820 00001235 06 push es - 4821 00001236 1F pop ds - 4822 00001237 89FA mov dx,di - 4823 00001239 B9FFFF mov cx,-1 ; find end of msg - 4824 0000123C 30C0 xor al,al - 4825 - 4826 0000123E FC cld - 4827 0000123F F2AE repnz scasb + 4780 ; We do not know how to handle this error. Ask IFSFUNC if she knows + 4781 ; how to handle things + 4782 + 4783 ;input to IFSFUNC: AL=1 + 4784 ; BX=extended error number + 4785 ; + 4786 ;output from IFSFUNC: AL=error type (0 or 1) + 4787 ; 0= error (read/writ)ing (drive/device) xxx + 4788 ; Abort, Retry, Ignore + 4789 ; 1= + 4790 ; Abort, Retry, Ignore + 4791 ; ES:DI=pointer to message text + 4792 ; carry set=>no message + 4793 + 4794 0000121B 89C7 mov di,ax ; retrieve correct extended error... + 4795 0000121D B80005 mov ax,0500h ; is the redir there? + 4796 00001220 CD2F int 2Fh ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - INSTALLATION CHECK + 4797 ; Return: AL = 00h not installed, OK to install + 4798 ; 01h not installed, can't install + 4799 ; FFh installed + 4800 00001222 3CFF cmp al,0FFh + 4801 00001224 7529 jne short NoHandler ; no, go to NoHandler + 4802 + 4803 ; 12/01/2023 + 4804 ; MSDOS 6.0 + 4805 00001226 53 push bx + 4806 00001227 89FB mov bx,di ; get ErrType and ptr to error msg + 4807 00001229 B80105 mov ax,0501h + 4808 0000122C CD2F int 2Fh ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - + 4809 0000122E 5B pop bx + 4810 0000122F 721E jc short NoHandler + 4811 + 4812 ; MSDOS 3.3 + 4813 ;mov ax,di + 4814 ;mov ah,5 + 4815 ;int 2Fh ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - + 4816 ;jc short NOHANDLER + 4817 + 4818 ; Bugbug: need to record error type? + 4819 + 4820 00001231 A2[3702] mov [ErrType],al + 4821 + 4822 00001234 1E push ds + 4823 00001235 06 push es + 4824 00001236 1F pop ds + 4825 00001237 89FA mov dx,di + 4826 00001239 B9FFFF mov cx,-1 ; find end of msg + 4827 0000123C 30C0 xor al,al 4828 - 4829 ; Bugbug: we can do better than this. - 4830 - 4831 ;mov byte [di-1],'$' - 4832 ; 19/07/2024 - 4833 00001241 4F dec di - 4834 00001242 C60524 mov byte [di],'$' - 4835 - 4836 ;CALL RDISPMSG ; MSDOS 3.3 - 4837 - 4838 00001245 B409 mov ah,STD_CON_STRING_OUTPUT ; 9 ; print the message - 4839 00001247 CD21 int 21h - 4840 - 4841 ;mov byte [di-1],0 ; restore terminal byte - 4842 ; 19/07/2024 - 4843 00001249 C60500 mov byte [di],0 - 4844 - 4845 0000124C 1F pop ds ; clean up and continue - 4846 0000124D EB15 jmp short CheckErrType + 4829 0000123E FC cld + 4830 0000123F F2AE repnz scasb + 4831 + 4832 ; Bugbug: we can do better than this. + 4833 + 4834 ;mov byte [di-1],'$' + 4835 ; 19/07/2024 + 4836 00001241 4F dec di + 4837 00001242 C60524 mov byte [di],'$' + 4838 + 4839 ;CALL RDISPMSG ; MSDOS 3.3 + 4840 + 4841 00001245 B409 mov ah,STD_CON_STRING_OUTPUT ; 9 ; print the message + 4842 00001247 CD21 int 21h + 4843 + 4844 ;mov byte [di-1],0 ; restore terminal byte + 4845 ; 19/07/2024 + 4846 00001249 C60500 mov byte [di],0 4847 - 4848 ;* Redir isn't available or doesn't recognize the error. - 4849 ; Restore regs to unextended error. + 4848 0000124C 1F pop ds ; clean up and continue + 4849 0000124D EB15 jmp short CheckErrType 4850 - 4851 NoHandler: - 4852 0000124F C606[3702]00 mov byte [ErrType],0 - 4853 ; Bugbug: won't this break, since we add error_write_protect back in? - 4854 00001254 8B3E[5C04] mov di,[OldErrNo] - 4855 00001258 893E[4402] mov [ErrCd_24],di - 4856 - 4857 NormalError: - 4858 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4859 ; MSDOS 6.0 - 4860 0000125C 83C713 add di,ERROR_WRITE_PROTECT - 4861 0000125F 87FA xchg di,dx ; may need dx later - 4862 00001261 E89001 call RPrintCrit ; print error type - 4863 - 4864 ; MSDOS 3.3 - 4865 ;shl di,1 - 4866 ;mov di,[CRMSGTBL+di] - 4867 ;xchg di,dx - 4868 ;call RDISPMSG - 4869 - 4870 CheckErrType: - 4871 00001264 803E[3702]00 cmp byte [ErrType],0 ; Check error style... - 4872 00001269 7405 je short ContOld - 4873 0000126B E86A01 call crlf ; if new style then done printing - 4874 0000126E EB31 jmp short Ask - 4875 - 4876 ContOld: - 4877 ; 12/01/2023 - 4878 ; MSDOS 6.0 - 4879 00001270 46 inc si ; DS:SI = ptr to asciiz string - 4880 - 4881 ; Bugbug: combine some of the following two sections? - 4882 - 4883 ; 12/01/2023 - 4884 00001271 F606[2502]80 test byte [CDevAt],DEVTYP>>8 ; 80h - 4885 ;test byte [CDevAt],DEVTYP shr 8 ; 80h - 4886 00001276 740F jz short BlkErr - 4887 ;;mov dx,offset DATARES:CharDevErr ; DX = ptr to device message - 4888 ;mov dx,ChardevErr - 4889 00001278 BA[7F05] mov dx,MDEVICE - 4890 ;mov [CharDevErrRw.SubstPtr],si ; point to read/write string - 4891 0000127B 8936[0702] mov [CharDevErrRw],si - 4892 ;mov si,offset DATARES:CharDevErrSubst; SI = ptr to subst block - 4893 0000127F BE[0602] mov si,CharDevErrSubst - 4894 - 4895 00001282 E85601 call RPrint ; print the message - 4896 00001285 EB1A jmp short Ask ; don't ralph on command + 4851 ;* Redir isn't available or doesn't recognize the error. + 4852 ; Restore regs to unextended error. + 4853 + 4854 NoHandler: + 4855 0000124F C606[3702]00 mov byte [ErrType],0 + 4856 ; Bugbug: won't this break, since we add error_write_protect back in? + 4857 00001254 8B3E[5C04] mov di,[OldErrNo] + 4858 00001258 893E[4402] mov [ErrCd_24],di + 4859 + 4860 NormalError: + 4861 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4862 ; MSDOS 6.0 + 4863 0000125C 83C713 add di,ERROR_WRITE_PROTECT + 4864 0000125F 87FA xchg di,dx ; may need dx later + 4865 00001261 E89001 call RPrintCrit ; print error type + 4866 + 4867 ; MSDOS 3.3 + 4868 ;shl di,1 + 4869 ;mov di,[CRMSGTBL+di] + 4870 ;xchg di,dx + 4871 ;call RDISPMSG + 4872 + 4873 CheckErrType: + 4874 00001264 803E[3702]00 cmp byte [ErrType],0 ; Check error style... + 4875 00001269 7405 je short ContOld + 4876 0000126B E86A01 call crlf ; if new style then done printing + 4877 0000126E EB31 jmp short Ask + 4878 + 4879 ContOld: + 4880 ; 12/01/2023 + 4881 ; MSDOS 6.0 + 4882 00001270 46 inc si ; DS:SI = ptr to asciiz string + 4883 + 4884 ; Bugbug: combine some of the following two sections? + 4885 + 4886 ; 12/01/2023 + 4887 00001271 F606[2502]80 test byte [CDevAt],DEVTYP>>8 ; 80h + 4888 ;test byte [CDevAt],DEVTYP shr 8 ; 80h + 4889 00001276 740F jz short BlkErr + 4890 ;;mov dx,offset DATARES:CharDevErr ; DX = ptr to device message + 4891 ;mov dx,ChardevErr + 4892 00001278 BA[7F05] mov dx,MDEVICE + 4893 ;mov [CharDevErrRw.SubstPtr],si ; point to read/write string + 4894 0000127B 8936[0702] mov [CharDevErrRw],si + 4895 ;mov si,offset DATARES:CharDevErrSubst; SI = ptr to subst block + 4896 0000127F BE[0602] mov si,CharDevErrSubst 4897 - 4898 ; 12/01/2023 - 4899 ; MSDOS 3.3 - 4900 ;mov dx,ERRMES - 4901 ;call RDISPMSG - 4902 ;mov dx,si - 4903 ;call RDISPMSG - 4904 ; - 4905 ;test byte [CDevAt],80h - 4906 ;jz short BLKERR - 4907 ;mov dx,CHARDEVERR ; " device " - 4908 ;mov ah,STD_CON_STRING_OUTPUT ; 9 - 4909 ;int 21h ; DOS - PRINT STRING - 4910 ; ; DS:DX -> string terminated by "$" - 4911 ;jmp short ASK - 4912 - 4913 BlkErr: - 4914 ; 12/01/2023 - 4915 ; MSDOS 6.0 - 4916 ;;mov dx,offset DATARES:BlkDevErr ; DX = error msg # - 4917 ;mov dx,BlkDevErr - 4918 00001287 BA[7005] mov dx,MDRIVE - 4919 ;mov [BlkDevErrRw.SubstPtr],si ; "reading","writing" ptr - 4920 0000128A 8936[0002] mov [BlkDevErrRw],si - 4921 ;mov si,offset DATARES:BlkDevErrSubst ; SI = ptr to subst block - 4922 0000128E BE[FF01] mov si,BlkDevErrSubst - 4923 00001291 E84701 call RPrint - 4924 - 4925 ; MSDOS 3.3 - 4926 ;mov dx,BLKDEVERR - 4927 ;call RDISPMSG - 4928 - 4929 00001294 803E[4802]00 cmp byte [Loading],0 - 4930 00001299 7406 jz short Ask - 4931 0000129B E8B3FD call RestHand - 4932 0000129E E9AAFD jmp GetComDsk2 ; if error loading COMMAND, re-prompt - 4933 Ask: - 4934 000012A1 833E[4402]0F cmp word [ErrCd_24],15 ; error 15 has an extra message - 4935 000012A6 751E jne short Not15 ; not error 15 - 4936 - 4937 ;* For error 15, tell the user which volume/serial # are needed. - 4938 - 4939 000012A8 51 push cx - 4940 - 4941 ; Bugbug: does this push/pop need to be done? - 4942 - 4943 000012A9 1E push ds - 4944 000012AA 07 pop es - 4945 000012AB C536[3302] lds si,[NeedVol] - 4946 ;assume ds:NOTHING - 4947 000012AF 57 push di - 4948 000012B0 BF[1502] mov di,VolName - 4949 ; 12/01/2023 - 4950 ; MSDOS 6.0 - 4951 000012B3 B91000 mov cx,16 ; copy volume name & serial # - 4952 ; MSDOS 3.3 - 4953 ;mov cx,11 ; copy volume name - 4954 000012B6 FC cld - 4955 000012B7 F3A4 rep movsb - 4956 000012B9 5F pop di - 4957 000012BA 06 push es - 4958 000012BB 1F pop ds - 4959 000012BC 59 pop cx - 4960 ;assume ds:DATARES - 4961 ; 12/01/2023 - 4962 ; MSDOS 6.0 - 4963 ;mov dx,offset DATARES:NeedVolMsg ; DX = ptr to msg - 4964 ;mov si,offset DATARES:NeedVolSubst ; DS:SI = ptr to subst block - 4965 ;mov dx,NeedVolMsg - 4966 000012BD BA[8F05] mov dx,MVOLSERIAL - 4967 000012C0 BE[0C02] mov si,NeedVolSubst - 4968 000012C3 E81501 call RPrint - 4969 - 4970 ; MSDOS 3.3 - 4971 ;mov dx,NEEDVOLMSG - 4972 ;mov ah,STD_CON_STRING_OUTPUT ; 9 - 4973 ;int 21h ; DOS - PRINT STRING - 4974 ; ; DS:DX -> string terminated by "$" - 4975 Not15: - 4976 ;* Print abort, retry, ignore, fail message. - 4977 ; Print only options that are valid. - 4978 - 4979 ; Bugbug: sizzle this. - 4980 - 4981 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 4982 000012C6 BA[3E05] mov dx,REQ_ABORT - 4983 000012C9 E80F01 call RPrint - 4984 ;call RDISPMSG - 4985 000012CC F606[9C02]10 test byte [Crit_Err_Info],RETRY_ALLOWED ; 10h - 4986 000012D1 7406 jz short Try_Ignore - 4987 000012D3 BA[4405] mov dx,REQ_RETRY - 4988 000012D6 E80201 call RPrint - 4989 ;call RDISPMSG - 4990 Try_Ignore: - 4991 000012D9 F606[9C02]20 test byte [Crit_Err_Info],IGNORE_ALLOWED ; 20h - 4992 000012DE 7406 jz short Try_Fail - 4993 000012E0 BA[4C05] mov dx,REQ_IGNORE - 4994 000012E3 E8F500 call RPrint - 4995 ;call RDISPMSG - 4996 Try_Fail: - 4997 000012E6 F606[9C02]08 test byte [Crit_Err_Info],FAIL_ALLOWED ; 08h - 4998 000012EB 7406 jz short Term_Question - 4999 000012ED BA[5505] mov dx,REQ_FAIL - 5000 000012F0 E8E800 call RPrint - 5001 ;call RDISPMSG - 5002 Term_Question: - 5003 000012F3 BA[5C05] mov dx,REQ_END - 5004 000012F6 E8E200 call RPrint - 5005 ;call RDISPMSG - 5006 - 5007 ; If the /f switch was given, we fail all requests. - 5008 - 5009 000012F9 F606[A902]FF test byte [fFail],-1 - 5010 000012FE 741B jz short DoPrompt - 5011 00001300 B403 mov ah,3 ; signal fail - 5012 00001302 E9B700 jmp EExit - 5013 - 5014 ; 16/04/2023 - 5015 Abort_Process: - 5016 00001305 F606[1203]01 test byte [InitFlag],INITINIT ; 1 ; COMMAND init interrupted? - 5017 0000130A 746C jz short AbortCont ; no, handle it normally - 5018 0000130C 803E[A202]00 cmp byte [PermCom],0 ; are we top level process? - 5019 00001311 745A jz short JustExit ; yes, just exit - 5020 - 5021 00001313 BA[DC0C] mov dx,PATRICIDE ; no, load ptr to error msg - 5022 ; 12/01/2023 - 5023 00001316 E8C200 call RPrint ; print it - 5024 ;call RDISPMSG - 5025 DeadInTheWater: - 5026 00001319 EBFE jmp short DeadInTheWater ; loop until the user reboots - 5027 - 5028 DoPrompt: - 5029 ; 12/01/2023 - 5030 0000131B B8010C mov ax,0C01h - 5031 ;mov ax,(STD_CON_INPUT_FLUSH<<8) + STD_CON_INPUT ; 0C01h - 5032 0000131E CD21 int 21h ; get response - 5033 - 5034 ; 21/07/2024 - PCDOS 7.1 COMMAND.COM - 5035 %if 1 - 5036 ;ifdef DBCS - 5037 ;invoke TestKanjR ; 3/3/KK - 5038 00001320 E85A01 call ITestKanj - 5039 00001323 740A jz short NotKanj ; 3/3/KK - 5040 - 5041 ;mov ax,(STD_CON_INPUT shl 8) ; eat the 2nd byte of ECS code 3/3/KK - 5042 00001325 B80001 mov ax,0100h - 5043 00001328 CD21 int 21h ; 3/3/KK - 5044 0000132A E8AB00 call crlf ; 3/3/KK - 5045 ;jmp short Ask ; 3/3/KK - 5046 ; 22/07/2024 - 5047 0000132D EB3B jmp short AskJ - 5048 NotKanj: - 5049 ;endif - 5050 %endif - 5051 0000132F E8A600 call crlf - 5052 00001332 E83F01 call CharToUpper ; convert to upper case - 5053 00001335 B400 mov ah,0 ; return code for ignore - 5054 00001337 F606[9C02]20 test byte [Crit_Err_Info],IGNORE_ALLOWED ; 20h ; is ignore allowed? - 5055 0000133C 7406 jz short User_Retry - 5056 0000133E 3A06[3A05] cmp al,[IGNORE_CHAR] ; ignore? - 5057 ;jz short EExitJ - 5058 ; 16/04/2023 - 5059 00001342 7478 jz short EExit - 5060 - 5061 ; Bugbug: optimize following code. - 5062 - 5063 User_Retry: - 5064 00001344 FEC4 inc ah ; return code for retry - 5065 00001346 F606[9C02]10 test byte [Crit_Err_Info],RETRY_ALLOWED ; 10h ; is retry allowed? - 5066 0000134B 7406 jz short User_Abort - 5067 0000134D 3A06[3905] cmp al,[RETRY_CHAR] ; retry? - 5068 ;jz short EExitJ - 5069 ; 16/04/2023 - 5070 00001351 7469 jz short EExit - 5071 User_Abort: - 5072 00001353 FEC4 inc ah ; return code for abort - 5073 ; (abort always allowed) - 5074 00001355 3A06[3805] cmp al,[ABORT_CHAR] ; abort? - 5075 00001359 74AA jz short Abort_Process ; exit user program - 5076 0000135B FEC4 inc ah ; return code for fail - 5077 0000135D F606[9C02]08 test byte [Crit_Err_Info],FAIL_ALLOWED ; 08h ; is fail allowed? - 5078 00001362 7406 jz short AskJ - 5079 00001364 3A06[3B05] cmp al,[FAIL_CHAR] ; fail? - 5080 ;jz short EExitJ - 5081 ; 16/04/2023 - 5082 00001368 7452 jz short EExit - 5083 AskJ: - 5084 0000136A E934FF jmp Ask - 5085 - 5086 ; 12/01/2023 - 5087 ;EExitJ: - 5088 ;jmp short EExit - 5089 - 5090 JustExit: - 5091 ;assume ds:DATARES - 5092 ; 12/01/2023 - 5093 0000136D A1[3E02] mov ax,[Parent] ; load real parent pid - 5094 ;mov [16h],ax - 5095 00001370 A31600 mov [PDB.PARENT_PID],ax ; put it back where it belongs - 5096 00001373 B8FF4C mov ax,4CFFh - 5097 ;mov ax,(EXIT<<8) | 255 ; 4CFFh - 5098 00001376 CD21 int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT) - 5099 ; AL = exit code - 5100 AbortCont: - 5101 00001378 F606[9202]FF test byte [In_Batch],-1 ; Are we accessing a batch file? - 5102 0000137D 7405 jz short Not_Batch_Abort - 5103 0000137F C606[9302]01 mov byte [Batch_Abort],1 ; set flag for abort - 5104 - 5105 Not_Batch_Abort: - 5106 00001384 8A16[1303] mov dl,[PipeFlag] - 5107 00001388 E87CFA call ResPipeOff - 5108 0000138B 08D2 or dl,dl - 5109 0000138D 740D je short CheckForA - 5110 0000138F 833E[A502]00 cmp word [SingleCom],0 - 5111 00001394 7406 je short CheckForA - 5112 00001396 C706[A502]FFFF mov word [SingleCom],-1 ; make sure SingleCom exits - 5113 - 5114 CheckForA: - 5115 0000139C 833E[4402]00 cmp word [ErrCd_24],0 ; write protect? - 5116 000013A1 7407 je short abortfor - 5117 000013A3 833E[4402]02 cmp word [ErrCd_24],2 ; drive not ready? - 5118 000013A8 7512 jne short EExit ; don't abort the FOR - 5119 - 5120 abortfor: - 5121 000013AA C606[AB02]00 mov byte [ForFlag],0 ; abort a FOR in progress - 5122 000013AF 833E[A502]00 cmp word [SingleCom],0 - 5123 000013B4 7406 je short EExit - 5124 000013B6 C706[A502]FFFF mov word [SingleCom],-1 ; make sure SingleCom exits - 5125 - 5126 EExit: - 5127 000013BC 88E0 mov al,ah - 5128 000013BE 89FA mov dx,di - 5129 RestHd: - 5130 000013C0 E88EFC call RestHand - 5131 000013C3 59 pop cx - 5132 000013C4 5E pop si ; restore registers - 5133 000013C5 07 pop es - 5134 - 5135 ; 12/01/2023 - 5136 ; MSDOS 6.0 - 5137 ;; pop ds - 5138 ;SR; - 5139 ;ds has to be got from the variable we saved it in - 5140 - 5141 000013C6 8E1E[2E05] mov ds,[OldDS] ; restore old value of ds - 5142 - 5143 ; pop ds - 5144 ; assume ds:nothing + 4898 00001282 E85601 call RPrint ; print the message + 4899 00001285 EB1A jmp short Ask ; don't ralph on command + 4900 + 4901 ; 12/01/2023 + 4902 ; MSDOS 3.3 + 4903 ;mov dx,ERRMES + 4904 ;call RDISPMSG + 4905 ;mov dx,si + 4906 ;call RDISPMSG + 4907 ; + 4908 ;test byte [CDevAt],80h + 4909 ;jz short BLKERR + 4910 ;mov dx,CHARDEVERR ; " device " + 4911 ;mov ah,STD_CON_STRING_OUTPUT ; 9 + 4912 ;int 21h ; DOS - PRINT STRING + 4913 ; ; DS:DX -> string terminated by "$" + 4914 ;jmp short ASK + 4915 + 4916 BlkErr: + 4917 ; 12/01/2023 + 4918 ; MSDOS 6.0 + 4919 ;;mov dx,offset DATARES:BlkDevErr ; DX = error msg # + 4920 ;mov dx,BlkDevErr + 4921 00001287 BA[7005] mov dx,MDRIVE + 4922 ;mov [BlkDevErrRw.SubstPtr],si ; "reading","writing" ptr + 4923 0000128A 8936[0002] mov [BlkDevErrRw],si + 4924 ;mov si,offset DATARES:BlkDevErrSubst ; SI = ptr to subst block + 4925 0000128E BE[FF01] mov si,BlkDevErrSubst + 4926 00001291 E84701 call RPrint + 4927 + 4928 ; MSDOS 3.3 + 4929 ;mov dx,BLKDEVERR + 4930 ;call RDISPMSG + 4931 + 4932 00001294 803E[4802]00 cmp byte [Loading],0 + 4933 00001299 7406 jz short Ask + 4934 0000129B E8B3FD call RestHand + 4935 0000129E E9AAFD jmp GetComDsk2 ; if error loading COMMAND, re-prompt + 4936 Ask: + 4937 000012A1 833E[4402]0F cmp word [ErrCd_24],15 ; error 15 has an extra message + 4938 000012A6 751E jne short Not15 ; not error 15 + 4939 + 4940 ;* For error 15, tell the user which volume/serial # are needed. + 4941 + 4942 000012A8 51 push cx + 4943 + 4944 ; Bugbug: does this push/pop need to be done? + 4945 + 4946 000012A9 1E push ds + 4947 000012AA 07 pop es + 4948 000012AB C536[3302] lds si,[NeedVol] + 4949 ;assume ds:NOTHING + 4950 000012AF 57 push di + 4951 000012B0 BF[1502] mov di,VolName + 4952 ; 12/01/2023 + 4953 ; MSDOS 6.0 + 4954 000012B3 B91000 mov cx,16 ; copy volume name & serial # + 4955 ; MSDOS 3.3 + 4956 ;mov cx,11 ; copy volume name + 4957 000012B6 FC cld + 4958 000012B7 F3A4 rep movsb + 4959 000012B9 5F pop di + 4960 000012BA 06 push es + 4961 000012BB 1F pop ds + 4962 000012BC 59 pop cx + 4963 ;assume ds:DATARES + 4964 ; 12/01/2023 + 4965 ; MSDOS 6.0 + 4966 ;mov dx,offset DATARES:NeedVolMsg ; DX = ptr to msg + 4967 ;mov si,offset DATARES:NeedVolSubst ; DS:SI = ptr to subst block + 4968 ;mov dx,NeedVolMsg + 4969 000012BD BA[8F05] mov dx,MVOLSERIAL + 4970 000012C0 BE[0C02] mov si,NeedVolSubst + 4971 000012C3 E81501 call RPrint + 4972 + 4973 ; MSDOS 3.3 + 4974 ;mov dx,NEEDVOLMSG + 4975 ;mov ah,STD_CON_STRING_OUTPUT ; 9 + 4976 ;int 21h ; DOS - PRINT STRING + 4977 ; ; DS:DX -> string terminated by "$" + 4978 Not15: + 4979 ;* Print abort, retry, ignore, fail message. + 4980 ; Print only options that are valid. + 4981 + 4982 ; Bugbug: sizzle this. + 4983 + 4984 ; 12/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 4985 000012C6 BA[3E05] mov dx,REQ_ABORT + 4986 000012C9 E80F01 call RPrint + 4987 ;call RDISPMSG + 4988 000012CC F606[9C02]10 test byte [Crit_Err_Info],RETRY_ALLOWED ; 10h + 4989 000012D1 7406 jz short Try_Ignore + 4990 000012D3 BA[4405] mov dx,REQ_RETRY + 4991 000012D6 E80201 call RPrint + 4992 ;call RDISPMSG + 4993 Try_Ignore: + 4994 000012D9 F606[9C02]20 test byte [Crit_Err_Info],IGNORE_ALLOWED ; 20h + 4995 000012DE 7406 jz short Try_Fail + 4996 000012E0 BA[4C05] mov dx,REQ_IGNORE + 4997 000012E3 E8F500 call RPrint + 4998 ;call RDISPMSG + 4999 Try_Fail: + 5000 000012E6 F606[9C02]08 test byte [Crit_Err_Info],FAIL_ALLOWED ; 08h + 5001 000012EB 7406 jz short Term_Question + 5002 000012ED BA[5505] mov dx,REQ_FAIL + 5003 000012F0 E8E800 call RPrint + 5004 ;call RDISPMSG + 5005 Term_Question: + 5006 000012F3 BA[5C05] mov dx,REQ_END + 5007 000012F6 E8E200 call RPrint + 5008 ;call RDISPMSG + 5009 + 5010 ; If the /f switch was given, we fail all requests. + 5011 + 5012 000012F9 F606[A902]FF test byte [fFail],-1 + 5013 000012FE 741B jz short DoPrompt + 5014 00001300 B403 mov ah,3 ; signal fail + 5015 00001302 E9B700 jmp EExit + 5016 + 5017 ; 16/04/2023 + 5018 Abort_Process: + 5019 00001305 F606[1203]01 test byte [InitFlag],INITINIT ; 1 ; COMMAND init interrupted? + 5020 0000130A 746C jz short AbortCont ; no, handle it normally + 5021 0000130C 803E[A202]00 cmp byte [PermCom],0 ; are we top level process? + 5022 00001311 745A jz short JustExit ; yes, just exit + 5023 + 5024 00001313 BA[DC0C] mov dx,PATRICIDE ; no, load ptr to error msg + 5025 ; 12/01/2023 + 5026 00001316 E8C200 call RPrint ; print it + 5027 ;call RDISPMSG + 5028 DeadInTheWater: + 5029 00001319 EBFE jmp short DeadInTheWater ; loop until the user reboots + 5030 + 5031 DoPrompt: + 5032 ; 12/01/2023 + 5033 0000131B B8010C mov ax,0C01h + 5034 ;mov ax,(STD_CON_INPUT_FLUSH<<8) + STD_CON_INPUT ; 0C01h + 5035 0000131E CD21 int 21h ; get response + 5036 + 5037 ; 21/07/2024 - PCDOS 7.1 COMMAND.COM + 5038 %if 1 + 5039 ;ifdef DBCS + 5040 ;invoke TestKanjR ; 3/3/KK + 5041 00001320 E85A01 call ITestKanj + 5042 00001323 740A jz short NotKanj ; 3/3/KK + 5043 + 5044 ;mov ax,(STD_CON_INPUT shl 8) ; eat the 2nd byte of ECS code 3/3/KK + 5045 00001325 B80001 mov ax,0100h + 5046 00001328 CD21 int 21h ; 3/3/KK + 5047 0000132A E8AB00 call crlf ; 3/3/KK + 5048 ;jmp short Ask ; 3/3/KK + 5049 ; 22/07/2024 + 5050 0000132D EB3B jmp short AskJ + 5051 NotKanj: + 5052 ;endif + 5053 %endif + 5054 0000132F E8A600 call crlf + 5055 00001332 E83F01 call CharToUpper ; convert to upper case + 5056 00001335 B400 mov ah,0 ; return code for ignore + 5057 00001337 F606[9C02]20 test byte [Crit_Err_Info],IGNORE_ALLOWED ; 20h ; is ignore allowed? + 5058 0000133C 7406 jz short User_Retry + 5059 0000133E 3A06[3A05] cmp al,[IGNORE_CHAR] ; ignore? + 5060 ;jz short EExitJ + 5061 ; 16/04/2023 + 5062 00001342 7478 jz short EExit + 5063 + 5064 ; Bugbug: optimize following code. + 5065 + 5066 User_Retry: + 5067 00001344 FEC4 inc ah ; return code for retry + 5068 00001346 F606[9C02]10 test byte [Crit_Err_Info],RETRY_ALLOWED ; 10h ; is retry allowed? + 5069 0000134B 7406 jz short User_Abort + 5070 0000134D 3A06[3905] cmp al,[RETRY_CHAR] ; retry? + 5071 ;jz short EExitJ + 5072 ; 16/04/2023 + 5073 00001351 7469 jz short EExit + 5074 User_Abort: + 5075 00001353 FEC4 inc ah ; return code for abort + 5076 ; (abort always allowed) + 5077 00001355 3A06[3805] cmp al,[ABORT_CHAR] ; abort? + 5078 00001359 74AA jz short Abort_Process ; exit user program + 5079 0000135B FEC4 inc ah ; return code for fail + 5080 0000135D F606[9C02]08 test byte [Crit_Err_Info],FAIL_ALLOWED ; 08h ; is fail allowed? + 5081 00001362 7406 jz short AskJ + 5082 00001364 3A06[3B05] cmp al,[FAIL_CHAR] ; fail? + 5083 ;jz short EExitJ + 5084 ; 16/04/2023 + 5085 00001368 7452 jz short EExit + 5086 AskJ: + 5087 0000136A E934FF jmp Ask + 5088 + 5089 ; 12/01/2023 + 5090 ;EExitJ: + 5091 ;jmp short EExit + 5092 + 5093 JustExit: + 5094 ;assume ds:DATARES + 5095 ; 12/01/2023 + 5096 0000136D A1[3E02] mov ax,[Parent] ; load real parent pid + 5097 ;mov [16h],ax + 5098 00001370 A31600 mov [PDB.PARENT_PID],ax ; put it back where it belongs + 5099 00001373 B8FF4C mov ax,4CFFh + 5100 ;mov ax,(EXIT<<8) | 255 ; 4CFFh + 5101 00001376 CD21 int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT) + 5102 ; AL = exit code + 5103 AbortCont: + 5104 00001378 F606[9202]FF test byte [In_Batch],-1 ; Are we accessing a batch file? + 5105 0000137D 7405 jz short Not_Batch_Abort + 5106 0000137F C606[9302]01 mov byte [Batch_Abort],1 ; set flag for abort + 5107 + 5108 Not_Batch_Abort: + 5109 00001384 8A16[1303] mov dl,[PipeFlag] + 5110 00001388 E87CFA call ResPipeOff + 5111 0000138B 08D2 or dl,dl + 5112 0000138D 740D je short CheckForA + 5113 0000138F 833E[A502]00 cmp word [SingleCom],0 + 5114 00001394 7406 je short CheckForA + 5115 00001396 C706[A502]FFFF mov word [SingleCom],-1 ; make sure SingleCom exits + 5116 + 5117 CheckForA: + 5118 0000139C 833E[4402]00 cmp word [ErrCd_24],0 ; write protect? + 5119 000013A1 7407 je short abortfor + 5120 000013A3 833E[4402]02 cmp word [ErrCd_24],2 ; drive not ready? + 5121 000013A8 7512 jne short EExit ; don't abort the FOR + 5122 + 5123 abortfor: + 5124 000013AA C606[AB02]00 mov byte [ForFlag],0 ; abort a FOR in progress + 5125 000013AF 833E[A502]00 cmp word [SingleCom],0 + 5126 000013B4 7406 je short EExit + 5127 000013B6 C706[A502]FFFF mov word [SingleCom],-1 ; make sure SingleCom exits + 5128 + 5129 EExit: + 5130 000013BC 88E0 mov al,ah + 5131 000013BE 89FA mov dx,di + 5132 RestHd: + 5133 000013C0 E88EFC call RestHand + 5134 000013C3 59 pop cx + 5135 000013C4 5E pop si ; restore registers + 5136 000013C5 07 pop es + 5137 + 5138 ; 12/01/2023 + 5139 ; MSDOS 6.0 + 5140 ;; pop ds + 5141 ;SR; + 5142 ;ds has to be got from the variable we saved it in + 5143 + 5144 000013C6 8E1E[2E05] mov ds,[OldDS] ; restore old value of ds 5145 - 5146 ; MSDOS 3.3 - 5147 ;pop ds + 5146 ; pop ds + 5147 ; assume ds:nothing 5148 - 5149 000013CA CF iret - 5150 - 5151 FatErr: - 5152 ; 12/01/2023 - 5153 ; MSDOS 6.0 - 5154 ;mov dx,offset DATARES:BadFatMsg - 5155 ;mov si,offset DATARES:BadFatSubst - 5156 000013CB BA[B605] mov dx,BADFATMSG - 5157 000013CE BE[2602] mov si,BadFatSubst - 5158 000013D1 E80700 call RPrint - 5159 - 5160 ; MSDOS 3.3 - 5161 ;mov dx,BADFATMSG - 5162 ;call RDISPMSG - 5163 ;mov dx,BLKDEVERR - 5164 ;call RDISPMSG - 5165 - 5166 000013D4 B002 mov al,2 ; abort - 5167 000013D6 EBE8 jmp short RestHd + 5149 ; MSDOS 3.3 + 5150 ;pop ds + 5151 + 5152 000013CA CF iret + 5153 + 5154 FatErr: + 5155 ; 12/01/2023 + 5156 ; MSDOS 6.0 + 5157 ;mov dx,offset DATARES:BadFatMsg + 5158 ;mov si,offset DATARES:BadFatSubst + 5159 000013CB BA[B605] mov dx,BADFATMSG + 5160 000013CE BE[2602] mov si,BadFatSubst + 5161 000013D1 E80700 call RPrint + 5162 + 5163 ; MSDOS 3.3 + 5164 ;mov dx,BADFATMSG + 5165 ;call RDISPMSG + 5166 ;mov dx,BLKDEVERR + 5167 ;call RDISPMSG 5168 - 5169 ;DskErr endp - 5170 - 5171 ; MSDOS 6.0 - 5172 ; ---------------------------------------------------------------------------- - 5173 ;*** RPrint - print message - 5174 ;*** Crlf - display cr/lf - 5175 ; - 5176 ; ENTRY DS:DX = ptr to count byte, followed by message text - 5177 ; DS:SI = ptr to 1st substitution block for this msg, if any - 5178 ; variable fields related to substitution blocks are set - 5179 ; - 5180 ; EXIT nothing - 5181 ; - 5182 ; USED flags - 5183 ; - 5184 ; EFFECTS - 5185 ; Message is displayed on stdout. + 5169 000013D4 B002 mov al,2 ; abort + 5170 000013D6 EBE8 jmp short RestHd + 5171 + 5172 ;DskErr endp + 5173 + 5174 ; MSDOS 6.0 + 5175 ; ---------------------------------------------------------------------------- + 5176 ;*** RPrint - print message + 5177 ;*** Crlf - display cr/lf + 5178 ; + 5179 ; ENTRY DS:DX = ptr to count byte, followed by message text + 5180 ; DS:SI = ptr to 1st substitution block for this msg, if any + 5181 ; variable fields related to substitution blocks are set + 5182 ; + 5183 ; EXIT nothing + 5184 ; + 5185 ; USED flags 5186 ; - 5187 ; NOTE - 5188 ; Number of substitutions (%1, %2,...) in message text must not - 5189 ; be greater than number of substition blocks present. - 5190 ; ---------------------------------------------------------------------------- - 5191 - 5192 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5193 ; MSDOS 5.0 COMMAND.COM - RESGROUP:13D1h (CODERES:0691h) + 5187 ; EFFECTS + 5188 ; Message is displayed on stdout. + 5189 ; + 5190 ; NOTE + 5191 ; Number of substitutions (%1, %2,...) in message text must not + 5192 ; be greater than number of substition blocks present. + 5193 ; ---------------------------------------------------------------------------- 5194 - 5195 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM - 5196 ; PCDOS 7.1 COMMAND.COM - RESGROUP:14F6h - 5197 crlf: - 5198 ;mov dx,offset DATARES:Newlin ; cheap newline - 5199 ; 14/01/2023 - 5200 000013D8 BA[4107] mov dx,NEWLINE - 5201 - 5202 ;RPrint proc - 5203 ; - 5204 ; assume ds:DATARES,ss:DATARES - 5205 ; - 5206 ; 14/01/2023 - 5207 RPrint: - 5208 - 5209 ; Bugbug: do we need to save all reg's? - 5210 - 5211 000013DB 56 push si ; preserve registers - 5212 000013DC 50 push ax - 5213 000013DD 53 push bx - 5214 000013DE 51 push cx - 5215 000013DF 52 push dx - 5216 - 5217 000013E0 89F3 mov bx,si ; DS:BX = ptr to subst block - 5218 000013E2 89D6 mov si,dx ; DS:SI = ptr to count byte - 5219 000013E4 AC lodsb ; AL = message length - 5220 ; DS:SI = ptr to message text - 5221 000013E5 31C9 xor cx,cx - 5222 000013E7 88C1 mov cl,al ; CX = message length - 5223 000013E9 E303 jcxz rpRet - 5224 - 5225 000013EB E81900 call RDispMsg - 5226 - 5227 000013EE 5A rpRet: pop dx - 5228 000013EF 59 pop cx - 5229 000013F0 5B pop bx - 5230 000013F1 58 pop ax - 5231 000013F2 5E pop si - 5232 000013F3 C3 retn - 5233 - 5234 ;RPrint endp - 5235 - 5236 ; 14/01/2023 - 5237 ; ; MSDOS 3.3 - 5238 ;CRLF: - 5239 ; mov dx,NEWLIN - 5240 ; - 5241 ;RDISPMSG: ; Display message/text - 5242 ; ; DS:DX = ($ terminated) Message/Text address - 5243 ; push ax - 5244 ; mov ah,STD_CON_STRING_OUTPUT ; 9 - 5245 ; clc - 5246 ; int 21h ; DOS - PRINT STRING - 5247 ; ; DS:DX -> string terminated by "$" - 5248 ; pop ax - 5249 ; retn - 5250 - 5251 - 5252 ; MSDOS 6.0 - 5253 ; ---------------------------------------------------------------------------- - 5254 ;*** RPrintCrit - print critical error message - 5255 ; - 5256 ; ENTRY DX = extended error # (19-39) - 5257 ; - 5258 ; EXIT nothing - 5259 ; - 5260 ; USED flags - 5261 ; - 5262 ; EFFECTS - 5263 ; Message is displayed on stdout - 5264 ; ---------------------------------------------------------------------------- - 5265 - 5266 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5267 - 5268 ;RPrintCrit proc - 5269 ; assume ds:DATARES,ss:DATARES + 5195 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5196 ; MSDOS 5.0 COMMAND.COM - RESGROUP:13D1h (CODERES:0691h) + 5197 + 5198 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM + 5199 ; PCDOS 7.1 COMMAND.COM - RESGROUP:14F6h + 5200 crlf: + 5201 ;mov dx,offset DATARES:Newlin ; cheap newline + 5202 ; 14/01/2023 + 5203 000013D8 BA[4107] mov dx,NEWLINE + 5204 + 5205 ;RPrint proc + 5206 ; + 5207 ; assume ds:DATARES,ss:DATARES + 5208 ; + 5209 ; 14/01/2023 + 5210 RPrint: + 5211 + 5212 ; Bugbug: do we need to save all reg's? + 5213 + 5214 000013DB 56 push si ; preserve registers + 5215 000013DC 50 push ax + 5216 000013DD 53 push bx + 5217 000013DE 51 push cx + 5218 000013DF 52 push dx + 5219 + 5220 000013E0 89F3 mov bx,si ; DS:BX = ptr to subst block + 5221 000013E2 89D6 mov si,dx ; DS:SI = ptr to count byte + 5222 000013E4 AC lodsb ; AL = message length + 5223 ; DS:SI = ptr to message text + 5224 000013E5 31C9 xor cx,cx + 5225 000013E7 88C1 mov cl,al ; CX = message length + 5226 000013E9 E303 jcxz rpRet + 5227 + 5228 000013EB E81900 call RDispMsg + 5229 + 5230 000013EE 5A rpRet: pop dx + 5231 000013EF 59 pop cx + 5232 000013F0 5B pop bx + 5233 000013F1 58 pop ax + 5234 000013F2 5E pop si + 5235 000013F3 C3 retn + 5236 + 5237 ;RPrint endp + 5238 + 5239 ; 14/01/2023 + 5240 ; ; MSDOS 3.3 + 5241 ;CRLF: + 5242 ; mov dx,NEWLIN + 5243 ; + 5244 ;RDISPMSG: ; Display message/text + 5245 ; ; DS:DX = ($ terminated) Message/Text address + 5246 ; push ax + 5247 ; mov ah,STD_CON_STRING_OUTPUT ; 9 + 5248 ; clc + 5249 ; int 21h ; DOS - PRINT STRING + 5250 ; ; DS:DX -> string terminated by "$" + 5251 ; pop ax + 5252 ; retn + 5253 + 5254 + 5255 ; MSDOS 6.0 + 5256 ; ---------------------------------------------------------------------------- + 5257 ;*** RPrintCrit - print critical error message + 5258 ; + 5259 ; ENTRY DX = extended error # (19-39) + 5260 ; + 5261 ; EXIT nothing + 5262 ; + 5263 ; USED flags + 5264 ; + 5265 ; EFFECTS + 5266 ; Message is displayed on stdout + 5267 ; ---------------------------------------------------------------------------- + 5268 + 5269 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 5270 - 5271 ; 14/01/2023 - 5272 RPrintCrit: - 5273 000013F4 52 push dx ; preserve DX - 5274 000013F5 87DA xchg bx,dx ; BX = extended error # - 5275 ; DX = saved BX - 5276 000013F7 83EB13 sub bx,19 ; BX = critical error index, from 0 - 5277 000013FA D1E3 shl bx,1 ; BX = offset in word table - 5278 000013FC 8B9F[DB08] mov bx,[bx+CRITMSGPTRS] ; BX = ptr to error msg - 5279 00001400 87DA xchg bx,dx ; DX = ptr to error msg - 5280 ; BX = restored - 5281 00001402 E8D6FF call RPrint ; print the message - 5282 00001405 5A pop dx ; restore DX - 5283 00001406 C3 retn - 5284 - 5285 ;RPrintCrit endp - 5286 - 5287 ; ---------------------------------------------------------------------------- - 5288 ;*** RDispMsg - display message - 5289 ; - 5290 ; Display message, with substitutions, for RPrint. - 5291 ; - 5292 ; ENTRY DS:SI = ptr to message text - 5293 ; CX = message length - 5294 ; DS:BX = ptr to substitution block, if any - 5295 ; - 5296 ; EXIT nothing - 5297 ; - 5298 ; USED AX,CX,DX,SI - 5299 ; ---------------------------------------------------------------------------- - 5300 - 5301 ;RDispMsg proc - 5302 ; assume ds:DATARES,ss:DATARES + 5271 ;RPrintCrit proc + 5272 ; assume ds:DATARES,ss:DATARES + 5273 + 5274 ; 14/01/2023 + 5275 RPrintCrit: + 5276 000013F4 52 push dx ; preserve DX + 5277 000013F5 87DA xchg bx,dx ; BX = extended error # + 5278 ; DX = saved BX + 5279 000013F7 83EB13 sub bx,19 ; BX = critical error index, from 0 + 5280 000013FA D1E3 shl bx,1 ; BX = offset in word table + 5281 000013FC 8B9F[DB08] mov bx,[bx+CRITMSGPTRS] ; BX = ptr to error msg + 5282 00001400 87DA xchg bx,dx ; DX = ptr to error msg + 5283 ; BX = restored + 5284 00001402 E8D6FF call RPrint ; print the message + 5285 00001405 5A pop dx ; restore DX + 5286 00001406 C3 retn + 5287 + 5288 ;RPrintCrit endp + 5289 + 5290 ; ---------------------------------------------------------------------------- + 5291 ;*** RDispMsg - display message + 5292 ; + 5293 ; Display message, with substitutions, for RPrint. + 5294 ; + 5295 ; ENTRY DS:SI = ptr to message text + 5296 ; CX = message length + 5297 ; DS:BX = ptr to substitution block, if any + 5298 ; + 5299 ; EXIT nothing + 5300 ; + 5301 ; USED AX,CX,DX,SI + 5302 ; ---------------------------------------------------------------------------- 5303 - 5304 RDispMsg: - 5305 ; 14/01/2023 - 5306 rdNextChar: - 5307 00001407 AC lodsb ; AL = next char - 5308 00001408 3C25 cmp al,'%' - 5309 0000140A 7511 jne short rdOutChar ; not a substitution - 5310 0000140C 8A14 mov dl,[si] ; DL = possible '1' - '9' - 5311 0000140E 80EA31 sub dl,'1' ; DL = 0 - 8 = '1' - '9' - 5312 00001411 80FA09 cmp dl,9 - 5313 00001414 7307 jae short rdOutChar ; not a substitution - 5314 - 5315 ;* A substitution code %1 - %9 has been encountered. - 5316 ; DL = 0-8, indicating %1-%9 - 5317 ; DS:BX = ptr to substitution block - 5318 - 5319 00001416 E80D00 call SubstMsg ; display the substitution - 5320 00001419 46 inc si ; SI = ptr past %n - 5321 0000141A 49 dec cx ; count extra character in %n - 5322 0000141B EB06 jmp short rdCharDone - 5323 - 5324 ;* Normal character output. - 5325 - 5326 rdOutChar: - 5327 0000141D 88C2 mov dl,al ; DL = char - 5328 0000141F B402 mov ah,2 ; AH = DOS Character Output code - 5329 00001421 CD21 int 21h ; call DOS - 5330 rdCharDone: - 5331 00001423 E2E2 loop rdNextChar - 5332 00001425 C3 retn - 5333 - 5334 ;RDispMsg endp - 5335 - 5336 ; ---------------------------------------------------------------------------- - 5337 ;*** SubstMsg - display message substitution - 5338 ; - 5339 ; Display a substitution string within a message. - 5340 ; Substitution can be a char, an ASCIIZ string, or - 5341 ; a word to be displayed as hex digits. - 5342 ; - 5343 ; ENTRY DL = substitution index 0-8 (for codes %1-%9) - 5344 ; DS:BX = ptr to substitution block + 5304 ;RDispMsg proc + 5305 ; assume ds:DATARES,ss:DATARES + 5306 + 5307 RDispMsg: + 5308 ; 14/01/2023 + 5309 rdNextChar: + 5310 00001407 AC lodsb ; AL = next char + 5311 00001408 3C25 cmp al,'%' + 5312 0000140A 7511 jne short rdOutChar ; not a substitution + 5313 0000140C 8A14 mov dl,[si] ; DL = possible '1' - '9' + 5314 0000140E 80EA31 sub dl,'1' ; DL = 0 - 8 = '1' - '9' + 5315 00001411 80FA09 cmp dl,9 + 5316 00001414 7307 jae short rdOutChar ; not a substitution + 5317 + 5318 ;* A substitution code %1 - %9 has been encountered. + 5319 ; DL = 0-8, indicating %1-%9 + 5320 ; DS:BX = ptr to substitution block + 5321 + 5322 00001416 E80D00 call SubstMsg ; display the substitution + 5323 00001419 46 inc si ; SI = ptr past %n + 5324 0000141A 49 dec cx ; count extra character in %n + 5325 0000141B EB06 jmp short rdCharDone + 5326 + 5327 ;* Normal character output. + 5328 + 5329 rdOutChar: + 5330 0000141D 88C2 mov dl,al ; DL = char + 5331 0000141F B402 mov ah,2 ; AH = DOS Character Output code + 5332 00001421 CD21 int 21h ; call DOS + 5333 rdCharDone: + 5334 00001423 E2E2 loop rdNextChar + 5335 00001425 C3 retn + 5336 + 5337 ;RDispMsg endp + 5338 + 5339 ; ---------------------------------------------------------------------------- + 5340 ;*** SubstMsg - display message substitution + 5341 ; + 5342 ; Display a substitution string within a message. + 5343 ; Substitution can be a char, an ASCIIZ string, or + 5344 ; a word to be displayed as hex digits. 5345 ; - 5346 ; EXIT nothing - 5347 ; - 5348 ; USED AX,DX - 5349 ; ---------------------------------------------------------------------------- - 5350 - 5351 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5352 - 5353 ;SubstMsg proc - 5354 ; assume ds:DATARES,ss:DATARES - 5355 - 5356 ; 14/01/2023 - 5357 SubstMsg: - 5358 00001426 53 push bx ; preserve BX - 5359 00001427 51 push cx ; preserve CX - 5360 - 5361 ;mov al,size SUBST ; AL = size of substitution block - 5362 00001428 B003 mov al,3 - 5363 0000142A F6E2 mul dl ; AX = offset of desired subst block - 5364 0000142C 01C3 add bx,ax ; DS:BX = ptr to desired subst block - 5365 - 5366 ;mov al,[bx].SubstType ; AX = substitution type flag - 5367 0000142E 8A07 mov al,[bx] - 5368 ;mov bx,[bx].SubstPtr ; BX = ptr to char, str, or hex value - 5369 00001430 8B5F01 mov bx,[bx+1] - 5370 - 5371 ; AL = 1, 2, or 3 for char, string, or hex type - 5372 - 5373 00001433 FEC8 dec al - 5374 00001435 7428 jz short smChar - 5375 00001437 FEC8 dec al - 5376 00001439 742C jz short smStr - 5377 - 5378 ;* Hex number substitution. - 5379 - 5380 ;mov ax,ds:[bx] ; AX = word value - 5381 0000143B 8B07 mov ax,[bx] - 5382 0000143D B90400 mov cx,4 ; CX = # digits to display - 5383 smDigit: - 5384 00001440 D1C0 rol ax,1 - 5385 00001442 D1C0 rol ax,1 - 5386 00001444 D1C0 rol ax,1 - 5387 00001446 D1C0 rol ax,1 ; AL<3:0> = next digit - 5388 - 5389 00001448 50 push ax ; save other digits - 5390 00001449 240F and al,0Fh ; AL = binary digit - 5391 0000144B 0430 add al,'0' ; AL = ascii digit if 0-9 - 5392 0000144D 3C39 cmp al,'9' - 5393 0000144F 7602 jbe short smDigit09 ; it's 0-9 - 5394 ;add al,7 - 5395 00001451 0407 add al,('A' - '0') - 10 ; AL = ascii digit A-F - 5396 smDigit09: - 5397 00001453 88C2 mov dl,al ; DL = ascii digit - 5398 00001455 B402 mov ah,2 - 5399 00001457 CD21 int 21h ; output the ascii digit - 5400 00001459 58 pop ax ; restore all digits - 5401 - 5402 0000145A E2E4 loop smDigit - 5403 ;jmp short smRet - 5404 ; 14/01/2023 - 5405 smRet: - 5406 0000145C 59 pop cx - 5407 0000145D 5B pop bx - 5408 0000145E C3 retn - 5409 - 5410 ;* Char substitution. - 5411 - 5412 smChar: - 5413 ;mov dl,ds:[bx] ; DL = char to output - 5414 0000145F 8A17 mov dl,[bx] - 5415 00001461 B402 mov ah,2 - 5416 00001463 CD21 int 21h - 5417 00001465 EBF5 jmp short smRet - 5418 - 5419 ;* String substitution. - 5420 - 5421 smStr: - 5422 ;mov dl,ds:[bx] ; DL = next char - 5423 00001467 8A17 mov dl,[bx] - 5424 00001469 08D2 or dl,dl - 5425 0000146B 74EF jz short smRet ; null char - we're done - 5426 0000146D B402 mov ah,2 - 5427 0000146F CD21 int 21h ; display char - 5428 00001471 43 inc bx ; DS:BX = ptr to next char - 5429 00001472 EBF3 jmp short smStr - 5430 - 5431 ;smRet: pop cx - 5432 ; pop bx - 5433 ; retn - 5434 - 5435 ;SubstMsg endp - 5436 - 5437 ; MSDOS 6.0 - 5438 ; ---------------------------------------------------------------------------- - 5439 ;*** CharToUpper - convert character to uppercase - 5440 ; - 5441 ; ENTRY AL = char - 5442 ; - 5443 ; EXIT AL = uppercase char - 5444 ; - 5445 ; USED AX - 5446 ; ---------------------------------------------------------------------------- - 5447 - 5448 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5449 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 5346 ; ENTRY DL = substitution index 0-8 (for codes %1-%9) + 5347 ; DS:BX = ptr to substitution block + 5348 ; + 5349 ; EXIT nothing + 5350 ; + 5351 ; USED AX,DX + 5352 ; ---------------------------------------------------------------------------- + 5353 + 5354 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5355 + 5356 ;SubstMsg proc + 5357 ; assume ds:DATARES,ss:DATARES + 5358 + 5359 ; 14/01/2023 + 5360 SubstMsg: + 5361 00001426 53 push bx ; preserve BX + 5362 00001427 51 push cx ; preserve CX + 5363 + 5364 ;mov al,size SUBST ; AL = size of substitution block + 5365 00001428 B003 mov al,3 + 5366 0000142A F6E2 mul dl ; AX = offset of desired subst block + 5367 0000142C 01C3 add bx,ax ; DS:BX = ptr to desired subst block + 5368 + 5369 ;mov al,[bx].SubstType ; AX = substitution type flag + 5370 0000142E 8A07 mov al,[bx] + 5371 ;mov bx,[bx].SubstPtr ; BX = ptr to char, str, or hex value + 5372 00001430 8B5F01 mov bx,[bx+1] + 5373 + 5374 ; AL = 1, 2, or 3 for char, string, or hex type + 5375 + 5376 00001433 FEC8 dec al + 5377 00001435 7428 jz short smChar + 5378 00001437 FEC8 dec al + 5379 00001439 742C jz short smStr + 5380 + 5381 ;* Hex number substitution. + 5382 + 5383 ;mov ax,ds:[bx] ; AX = word value + 5384 0000143B 8B07 mov ax,[bx] + 5385 0000143D B90400 mov cx,4 ; CX = # digits to display + 5386 smDigit: + 5387 00001440 D1C0 rol ax,1 + 5388 00001442 D1C0 rol ax,1 + 5389 00001444 D1C0 rol ax,1 + 5390 00001446 D1C0 rol ax,1 ; AL<3:0> = next digit + 5391 + 5392 00001448 50 push ax ; save other digits + 5393 00001449 240F and al,0Fh ; AL = binary digit + 5394 0000144B 0430 add al,'0' ; AL = ascii digit if 0-9 + 5395 0000144D 3C39 cmp al,'9' + 5396 0000144F 7602 jbe short smDigit09 ; it's 0-9 + 5397 ;add al,7 + 5398 00001451 0407 add al,('A' - '0') - 10 ; AL = ascii digit A-F + 5399 smDigit09: + 5400 00001453 88C2 mov dl,al ; DL = ascii digit + 5401 00001455 B402 mov ah,2 + 5402 00001457 CD21 int 21h ; output the ascii digit + 5403 00001459 58 pop ax ; restore all digits + 5404 + 5405 0000145A E2E4 loop smDigit + 5406 ;jmp short smRet + 5407 ; 14/01/2023 + 5408 smRet: + 5409 0000145C 59 pop cx + 5410 0000145D 5B pop bx + 5411 0000145E C3 retn + 5412 + 5413 ;* Char substitution. + 5414 + 5415 smChar: + 5416 ;mov dl,ds:[bx] ; DL = char to output + 5417 0000145F 8A17 mov dl,[bx] + 5418 00001461 B402 mov ah,2 + 5419 00001463 CD21 int 21h + 5420 00001465 EBF5 jmp short smRet + 5421 + 5422 ;* String substitution. + 5423 + 5424 smStr: + 5425 ;mov dl,ds:[bx] ; DL = next char + 5426 00001467 8A17 mov dl,[bx] + 5427 00001469 08D2 or dl,dl + 5428 0000146B 74EF jz short smRet ; null char - we're done + 5429 0000146D B402 mov ah,2 + 5430 0000146F CD21 int 21h ; display char + 5431 00001471 43 inc bx ; DS:BX = ptr to next char + 5432 00001472 EBF3 jmp short smStr + 5433 + 5434 ;smRet: pop cx + 5435 ; pop bx + 5436 ; retn + 5437 + 5438 ;SubstMsg endp + 5439 + 5440 ; MSDOS 6.0 + 5441 ; ---------------------------------------------------------------------------- + 5442 ;*** CharToUpper - convert character to uppercase + 5443 ; + 5444 ; ENTRY AL = char + 5445 ; + 5446 ; EXIT AL = uppercase char + 5447 ; + 5448 ; USED AX + 5449 ; ---------------------------------------------------------------------------- 5450 - 5451 ;CharToUpper proc - 5452 ; assume ds:DATARES - 5453 CharToUpper: - 5454 00001474 50 push ax ; put char on stack as arg to int 2F - 5455 00001475 B81312 mov ax,1213h ; AX = DOS int 2F 'Convert Char to Uppercase' - 5456 00001478 CD2F int 2Fh - 5457 0000147A 44 inc sp ; throw away old char on stack - 5458 0000147B 44 inc sp - 5459 0000147C C3 retn - 5460 - 5461 ;CharToUpper endp - 5462 - 5463 ; 14/01/2023 - 5464 ; ; MSDOS 3.3 - 5465 ;CHARTOUPPER: - 5466 ; cmp al,80h - 5467 ; jb short CHARTOUPPER1 - 5468 ; sub al,80h - 5469 ; push ds - 5470 ; push bx - 5471 ; lds bx,[UPPERCASETBL] - 5472 ; add bx,2 - 5473 ; xlat - 5474 ; pop bx - 5475 ; pop ds - 5476 ; jmp short CHARTOUPPER_RETN - 5477 ;CHARTOUPPER1: - 5478 ; cmp al,'a' - 5479 ; jb short CHARTOUPPER_RETN - 5480 ; cmp al,'z' - 5481 ; ja short CHARTOUPPER_RETN - 5482 ; sub al,20h - 5483 ;CHARTOUPPER_RETN: - 5484 ; retn - 5485 - 5486 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM - 5487 ; ---------------------------------------------------------------------------- - 5488 ; PCDOS 7.1 COMMAND.COM - RESGROUP:159Dh - 5489 - 5490 ;ifdef DBCS - 5491 %if 1 + 5451 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5452 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 5453 + 5454 ;CharToUpper proc + 5455 ; assume ds:DATARES + 5456 CharToUpper: + 5457 00001474 50 push ax ; put char on stack as arg to int 2F + 5458 00001475 B81312 mov ax,1213h ; AX = DOS int 2F 'Convert Char to Uppercase' + 5459 00001478 CD2F int 2Fh + 5460 0000147A 44 inc sp ; throw away old char on stack + 5461 0000147B 44 inc sp + 5462 0000147C C3 retn + 5463 + 5464 ;CharToUpper endp + 5465 + 5466 ; 14/01/2023 + 5467 ; ; MSDOS 3.3 + 5468 ;CHARTOUPPER: + 5469 ; cmp al,80h + 5470 ; jb short CHARTOUPPER1 + 5471 ; sub al,80h + 5472 ; push ds + 5473 ; push bx + 5474 ; lds bx,[UPPERCASETBL] + 5475 ; add bx,2 + 5476 ; xlat + 5477 ; pop bx + 5478 ; pop ds + 5479 ; jmp short CHARTOUPPER_RETN + 5480 ;CHARTOUPPER1: + 5481 ; cmp al,'a' + 5482 ; jb short CHARTOUPPER_RETN + 5483 ; cmp al,'z' + 5484 ; ja short CHARTOUPPER_RETN + 5485 ; sub al,20h + 5486 ;CHARTOUPPER_RETN: + 5487 ; retn + 5488 + 5489 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM + 5490 ; ---------------------------------------------------------------------------- + 5491 ; PCDOS 7.1 COMMAND.COM - RESGROUP:159Dh 5492 - 5493 ;*** ITestKanj - DBCS lead byte check - 5494 - 5495 ITestKanj: - 5496 TestKanjR: ; 3/3/KK - 5497 0000147D 1E push ds - 5498 0000147E 56 push si - 5499 0000147F 50 push ax - 5500 00001480 C536[BA02] lds si,[Dbcs_Vector_Addr] - 5501 ktLop: - 5502 00001484 833C00 cmp word [si],0 ; end of Lead Byte Table - 5503 00001487 740C je short NotLead - 5504 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM - 5505 ;pop ax - 5506 ;push ax - 5507 00001489 3A04 cmp al,[si] - 5508 0000148B 7208 jb short NotLead - 5509 0000148D 46 inc si - 5510 0000148E 3A04 cmp al,[si] - 5511 00001490 7607 jbe short IsLead - 5512 00001492 46 inc si - 5513 00001493 EBEF jmp short ktLop ; try another range - 5514 NotLead: - 5515 00001495 31C0 xor ax,ax ; set zero - 5516 00001497 EB03 jmp short ktRet - 5517 IsLead: - 5518 00001499 31C0 xor ax,ax ; reset zero - 5519 0000149B 40 inc ax - 5520 ktRet: - 5521 0000149C 58 pop ax - 5522 0000149D 5E pop si - 5523 0000149E 1F pop ds - 5524 0000149F C3 retn - 5525 - 5526 %endif - 5527 ;endif + 5493 ;ifdef DBCS + 5494 %if 1 + 5495 + 5496 ;*** ITestKanj - DBCS lead byte check + 5497 + 5498 ITestKanj: + 5499 TestKanjR: ; 3/3/KK + 5500 0000147D 1E push ds + 5501 0000147E 56 push si + 5502 0000147F 50 push ax + 5503 00001480 C536[BA02] lds si,[Dbcs_Vector_Addr] + 5504 ktLop: + 5505 00001484 833C00 cmp word [si],0 ; end of Lead Byte Table + 5506 00001487 740C je short NotLead + 5507 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM + 5508 ;pop ax + 5509 ;push ax + 5510 00001489 3A04 cmp al,[si] + 5511 0000148B 7208 jb short NotLead + 5512 0000148D 46 inc si + 5513 0000148E 3A04 cmp al,[si] + 5514 00001490 7607 jbe short IsLead + 5515 00001492 46 inc si + 5516 00001493 EBEF jmp short ktLop ; try another range + 5517 NotLead: + 5518 00001495 31C0 xor ax,ax ; set zero + 5519 00001497 EB03 jmp short ktRet + 5520 IsLead: + 5521 00001499 31C0 xor ax,ax ; reset zero + 5522 0000149B 40 inc ax + 5523 ktRet: + 5524 0000149C 58 pop ax + 5525 0000149D 5E pop si + 5526 0000149E 1F pop ds + 5527 0000149F C3 retn 5528 - 5529 ; ---------------------------------------------------------------------------- - 5530 - 5531 ;public EndCode - 5532 ;EndCode label byte + 5529 %endif + 5530 ;endif + 5531 + 5532 ; ---------------------------------------------------------------------------- 5533 - 5534 ; MSDOS 6.0 - 5535 ; ---------------------------------------------------------------------------- - 5536 ;*** MsgInt2fHandler - int 2f handler for message retrieval - 5537 ; - 5538 ; ENTRY If we handle it - - 5539 ; AX = ((MULTDOS shl 8) or MESSAGE_2F) = 122Eh - 5540 ; DL = operation = - 5541 ; 0 = get extended error messages - 5542 ; 1 = set extended error messages - 5543 ; 2 = get parse error messages - 5544 ; 3 = set parse error messages - 5545 ; 4 = get critical error messages - 5546 ; 5 = set critical error messages - 5547 ; 6 = get file system error messages - 5548 ; 7 = set file system error messages - 5549 ; 8 = get disk retriever routine - 5550 ; 9 = set disk retriever routine - 5551 ; ES:DI = address for 'set' operations - 5552 ; - 5553 ; EXIT ES:DI = ptr to list of message ptrs, for 'get' operations - 5554 ; - 5555 ; NOTE - 5556 ; This handler replaces the one that used to reside in DOS. - 5557 ; 'Set' operations are ignored. - 5558 ; 'File system error messages' are not supported. - 5559 ; ---------------------------------------------------------------------------- - 5560 - 5561 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5562 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1478h (CODERES:0738h) + 5534 ;public EndCode + 5535 ;EndCode label byte + 5536 + 5537 ; MSDOS 6.0 + 5538 ; ---------------------------------------------------------------------------- + 5539 ;*** MsgInt2fHandler - int 2f handler for message retrieval + 5540 ; + 5541 ; ENTRY If we handle it - + 5542 ; AX = ((MULTDOS shl 8) or MESSAGE_2F) = 122Eh + 5543 ; DL = operation = + 5544 ; 0 = get extended error messages + 5545 ; 1 = set extended error messages + 5546 ; 2 = get parse error messages + 5547 ; 3 = set parse error messages + 5548 ; 4 = get critical error messages + 5549 ; 5 = set critical error messages + 5550 ; 6 = get file system error messages + 5551 ; 7 = set file system error messages + 5552 ; 8 = get disk retriever routine + 5553 ; 9 = set disk retriever routine + 5554 ; ES:DI = address for 'set' operations + 5555 ; + 5556 ; EXIT ES:DI = ptr to list of message ptrs, for 'get' operations + 5557 ; + 5558 ; NOTE + 5559 ; This handler replaces the one that used to reside in DOS. + 5560 ; 'Set' operations are ignored. + 5561 ; 'File system error messages' are not supported. + 5562 ; ---------------------------------------------------------------------------- 5563 - 5564 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 5565 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1588h (CODERES:0738h) + 5564 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5565 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1478h (CODERES:0738h) 5566 - 5567 ;SR; - 5568 ;At the int 2fh entry point we push the old ds value and the resident data - 5569 ;segment address. Get them off the stack - 5570 - 5571 ;MsgInt2fHandler proc far - 5572 ; assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING + 5567 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 5568 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1588h (CODERES:0738h) + 5569 + 5570 ;SR; + 5571 ;At the int 2fh entry point we push the old ds value and the resident data + 5572 ;segment address. Get them off the stack 5573 - 5574 ; 14/01/2023 - 5575 MsgInt2fHandler: - 5576 000014A0 1F pop ds ; ds = DATARES - 5577 ;assume ds:DATARES - 5578 ; pop word [OldDS] ; save old value of ds - 5579 - 5580 000014A1 3D2E12 cmp ax,122Eh - 5581 ;cmp ax,(MULTDOS<<8)|MESSAGE_2F - 5582 ;;cmp ax,(MULTDOS shl 8) or MESSAGE_2F - 5583 000014A4 742A je short miOurs ; it's ours - 5584 - 5585 ;ifndef ROMDOS - 5586 ;cmp ax,5500h - 5587 000014A6 3D0055 cmp ax,GET_COMMAND_STATE ; is it first COMMAND query? - 5588 ;else - 5589 ; cmp ax,GET_ROMCOMMAND_STATE ; is it first ROM COMMAND query? - 5590 ;endif ;ROMDOS - 5591 000014A9 741C je short fcOurs - 5592 - 5593 ;SR; - 5594 ;We cannot do a far jump any more because cs cannot be used. Push the cs:ip - 5595 ;onto the stack and do a far return to jump to the next 2fh handler. - 5596 ;Our old ds is on the stack. We need to restore it but we cannot lose the - 5597 ;current value of ds as it points at the data segment. So we do some kinky - 5598 ;stack manipulations. - 5599 - 5600 000014AB 50 push ax - 5601 000014AC 50 push ax ; create 2 words on stack for retf + 5574 ;MsgInt2fHandler proc far + 5575 ; assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING + 5576 + 5577 ; 14/01/2023 + 5578 MsgInt2fHandler: + 5579 000014A0 1F pop ds ; ds = DATARES + 5580 ;assume ds:DATARES + 5581 ; pop word [OldDS] ; save old value of ds + 5582 + 5583 000014A1 3D2E12 cmp ax,122Eh + 5584 ;cmp ax,(MULTDOS<<8)|MESSAGE_2F + 5585 ;;cmp ax,(MULTDOS shl 8) or MESSAGE_2F + 5586 000014A4 742A je short miOurs ; it's ours + 5587 + 5588 ;ifndef ROMDOS + 5589 ;cmp ax,5500h + 5590 000014A6 3D0055 cmp ax,GET_COMMAND_STATE ; is it first COMMAND query? + 5591 ;else + 5592 ; cmp ax,GET_ROMCOMMAND_STATE ; is it first ROM COMMAND query? + 5593 ;endif ;ROMDOS + 5594 000014A9 741C je short fcOurs + 5595 + 5596 ;SR; + 5597 ;We cannot do a far jump any more because cs cannot be used. Push the cs:ip + 5598 ;onto the stack and do a far return to jump to the next 2fh handler. + 5599 ;Our old ds is on the stack. We need to restore it but we cannot lose the + 5600 ;current value of ds as it points at the data segment. So we do some kinky + 5601 ;stack manipulations. 5602 - 5603 000014AD 55 push bp - 5604 000014AE 50 push ax + 5603 000014AB 50 push ax + 5604 000014AC 50 push ax ; create 2 words on stack for retf 5605 - 5606 000014AF 89E5 mov bp,sp ; bp can be used to address stack - 5607 - 5608 ;Swap the old ds value with the second dummy word on the stack. Now, we can - 5609 ;do a 'pop ds' at the end to restore our ds + 5606 000014AD 55 push bp + 5607 000014AE 50 push ax + 5608 + 5609 000014AF 89E5 mov bp,sp ; bp can be used to address stack 5610 - 5611 000014B1 8B4608 mov ax,[bp+8] ; ax = old ds value - 5612 000014B4 894604 mov [bp+4],ax - 5613 - 5614 ;mov ax,word ptr ds:Int2fHandler+2 - 5615 000014B7 A1[B004] mov ax,[Int2fHandler+2] - 5616 000014BA 894608 mov [bp+8],ax ; put segment address - 5617 ;mov ax,word ptr ds:Int2fHandler - 5618 000014BD A1[AE04] mov ax,[Int2fHandler] - 5619 000014C0 894606 mov [bp+6],ax ; put offset address - 5620 - 5621 000014C3 58 pop ax - 5622 000014C4 5D pop bp - 5623 000014C5 1F pop ds - 5624 - 5625 000014C6 CB retf ; chain on to next handler - 5626 - 5627 ;; jmp Int2fHandler ; hand off to next 2f handler - 5628 - 5629 fcOurs: - 5630 - 5631 ;We have to clear ax, and return in ds:si a pointer to the stub jump table - 5632 - 5633 000014C7 58 pop ax ; discard ds currently on stack - 5634 000014C8 1E push ds ; store our data segment + 5611 ;Swap the old ds value with the second dummy word on the stack. Now, we can + 5612 ;do a 'pop ds' at the end to restore our ds + 5613 + 5614 000014B1 8B4608 mov ax,[bp+8] ; ax = old ds value + 5615 000014B4 894604 mov [bp+4],ax + 5616 + 5617 ;mov ax,word ptr ds:Int2fHandler+2 + 5618 000014B7 A1[B004] mov ax,[Int2fHandler+2] + 5619 000014BA 894608 mov [bp+8],ax ; put segment address + 5620 ;mov ax,word ptr ds:Int2fHandler + 5621 000014BD A1[AE04] mov ax,[Int2fHandler] + 5622 000014C0 894606 mov [bp+6],ax ; put offset address + 5623 + 5624 000014C3 58 pop ax + 5625 000014C4 5D pop bp + 5626 000014C5 1F pop ds + 5627 + 5628 000014C6 CB retf ; chain on to next handler + 5629 + 5630 ;; jmp Int2fHandler ; hand off to next 2f handler + 5631 + 5632 fcOurs: + 5633 + 5634 ;We have to clear ax, and return in ds:si a pointer to the stub jump table 5635 - 5636 ;mov si,offset DATARES:Int2f_Entry ; start of table - 5637 000014C9 BE[6600] mov si,Int2f_Entry + 5636 000014C7 58 pop ax ; discard ds currently on stack + 5637 000014C8 1E push ds ; store our data segment 5638 - 5639 000014CC 31C0 xor ax,ax ; indicate COMMAND present - 5640 000014CE EB11 jmp short miRet ; return to caller + 5639 ;mov si,offset DATARES:Int2f_Entry ; start of table + 5640 000014C9 BE[6600] mov si,Int2f_Entry 5641 - 5642 miOurs: - 5643 000014D0 F6C201 test dl,1 - 5644 000014D3 750C jnz short miRet ; ignore 'set' operations - 5645 - 5646 000014D5 53 push bx ; preserve BX - 5647 000014D6 89D3 mov bx,dx - 5648 000014D8 30FF xor bh,bh ; BX = index in word table - 5649 000014DA D1E3 shl bx,1 ; BX = index in dword table - 5650 ;les di,MsgPtrLists[bx] ; ES:DI = ptr to msg ptr list - 5651 000014DC C4BF[4407] les di,[bx+MsgPtrLists] - 5652 000014E0 5B pop bx ; restore BX - 5653 miRet: - 5654 ; mov ds,[OldDS] ; restore ds - 5655 000014E1 1F pop ds - 5656 ;assume ds:nothing - 5657 - 5658 000014E2 CF iret - 5659 - 5660 ;MsgInt2fHandler endp - 5661 - 5662 ; MSDOS 6.0 - 5663 ; ---------------------------------------------------------------------------- - 5664 ;*** MsgRetriever - message retrieval routine for utilities - 5665 ; - 5666 ; Address of this routine is passed to utility programs via - 5667 ; message services int 2f. We try to find the desired message - 5668 ; in memory or in our disk image. - 5669 ; - 5670 ; ENTRY AX = message # - 5671 ; DI = offset in RESGROUP of msg ptr list - 5672 ; ComSpec = asciiz pathname to our disk image - 5673 ; - 5674 ; EXIT CY clear for success - 5675 ; ES:DI = ptr to count byte, followed by message text + 5642 000014CC 31C0 xor ax,ax ; indicate COMMAND present + 5643 000014CE EB11 jmp short miRet ; return to caller + 5644 + 5645 miOurs: + 5646 000014D0 F6C201 test dl,1 + 5647 000014D3 750C jnz short miRet ; ignore 'set' operations + 5648 + 5649 000014D5 53 push bx ; preserve BX + 5650 000014D6 89D3 mov bx,dx + 5651 000014D8 30FF xor bh,bh ; BX = index in word table + 5652 000014DA D1E3 shl bx,1 ; BX = index in dword table + 5653 ;les di,MsgPtrLists[bx] ; ES:DI = ptr to msg ptr list + 5654 000014DC C4BF[4407] les di,[bx+MsgPtrLists] + 5655 000014E0 5B pop bx ; restore BX + 5656 miRet: + 5657 ; mov ds,[OldDS] ; restore ds + 5658 000014E1 1F pop ds + 5659 ;assume ds:nothing + 5660 + 5661 000014E2 CF iret + 5662 + 5663 ;MsgInt2fHandler endp + 5664 + 5665 ; MSDOS 6.0 + 5666 ; ---------------------------------------------------------------------------- + 5667 ;*** MsgRetriever - message retrieval routine for utilities + 5668 ; + 5669 ; Address of this routine is passed to utility programs via + 5670 ; message services int 2f. We try to find the desired message + 5671 ; in memory or in our disk image. + 5672 ; + 5673 ; ENTRY AX = message # + 5674 ; DI = offset in RESGROUP of msg ptr list + 5675 ; ComSpec = asciiz pathname to our disk image 5676 ; - 5677 ; CY set for failure - 5678 ; ES,DI undefined + 5677 ; EXIT CY clear for success + 5678 ; ES:DI = ptr to count byte, followed by message text 5679 ; - 5680 ; USED flags - 5681 ; - 5682 ; NOTE - 5683 ; The message # in AX is used to compute an offset into - 5684 ; the message ptr list pointed to by DI. The lists must - 5685 ; start with message # 1 and proceed through consecutive - 5686 ; message #'s. - 5687 ; - 5688 ; It is assumed that the msg ptr list is either ParsMsgPtrs or - 5689 ; ExtMsgPtrs. We use NUMPARSEMSGS and NUMEXTMSGS to check for - 5690 ; valid message #. ;M033 - 5691 ; - 5692 ; List positions with no corresponding message text are - 5693 ; indicated by null pointers, which this routine detects. - 5694 ; ---------------------------------------------------------------------------- - 5695 - 5696 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5697 - 5698 ;SR; This routine will be called directly by the utilities. So, we have - 5699 ; trap for it in the stub. The stub pushes the old value of ds and the - 5700 ; DATARES value on the stack. We get them off the stack to setup ds here - 5701 - 5702 ;MsgRetriever proc far - 5703 ; assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING + 5680 ; CY set for failure + 5681 ; ES,DI undefined + 5682 ; + 5683 ; USED flags + 5684 ; + 5685 ; NOTE + 5686 ; The message # in AX is used to compute an offset into + 5687 ; the message ptr list pointed to by DI. The lists must + 5688 ; start with message # 1 and proceed through consecutive + 5689 ; message #'s. + 5690 ; + 5691 ; It is assumed that the msg ptr list is either ParsMsgPtrs or + 5692 ; ExtMsgPtrs. We use NUMPARSEMSGS and NUMEXTMSGS to check for + 5693 ; valid message #. ;M033 + 5694 ; + 5695 ; List positions with no corresponding message text are + 5696 ; indicated by null pointers, which this routine detects. + 5697 ; ---------------------------------------------------------------------------- + 5698 + 5699 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5700 + 5701 ;SR; This routine will be called directly by the utilities. So, we have + 5702 ; trap for it in the stub. The stub pushes the old value of ds and the + 5703 ; DATARES value on the stack. We get them off the stack to setup ds here 5704 - 5705 ; 14/01/2023 - 5706 MsgRetriever: - 5707 000014E3 1F pop ds ; ds = DATARES - 5708 ;assume ds:DATARES - 5709 ; pop word [OldDS] ; save old ds - 5710 - 5711 000014E4 50 push ax ; preserve registers - 5712 000014E5 53 push bx - 5713 000014E6 51 push cx - 5714 000014E7 52 push dx - 5715 000014E8 56 push si - 5716 - 5717 ;; push ds - 5718 ;; push cs - 5719 ;; pop ds ; DS = DATARES seg addr - 5720 ;; assume ds:RESGROUP + 5705 ;MsgRetriever proc far + 5706 ; assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING + 5707 + 5708 ; 14/01/2023 + 5709 MsgRetriever: + 5710 000014E3 1F pop ds ; ds = DATARES + 5711 ;assume ds:DATARES + 5712 ; pop word [OldDS] ; save old ds + 5713 + 5714 000014E4 50 push ax ; preserve registers + 5715 000014E5 53 push bx + 5716 000014E6 51 push cx + 5717 000014E7 52 push dx + 5718 000014E8 56 push si + 5719 + 5720 ;; push ds 5721 ;; push cs - 5722 - 5723 000014E9 1E push ds ; get es from ds - 5724 000014EA 07 pop es ; ES = DATARES seg addr + 5722 ;; pop ds ; DS = DATARES seg addr + 5723 ;; assume ds:RESGROUP + 5724 ;; push cs 5725 - 5726 ; Begin modification M033. - 5727 - 5728 ; Make sure msg # is valid. - 5729 ; Assume msg ptr list is either ParsMsgPtrs or ExtMsgPtrs. + 5726 000014E9 1E push ds ; get es from ds + 5727 000014EA 07 pop es ; ES = DATARES seg addr + 5728 + 5729 ; Begin modification M033. 5730 - 5731 ;mov bx,11 - 5732 000014EB BB0B00 mov bx,NUMPARSMSGS ; BX = # parse error msgs in list - 5733 ;cmp di,offset DATARES:ParsMsgPtrs - 5734 000014EE 81FF[E309] cmp di,PARSMSGPTRS - 5735 000014F2 7403 je short chkmsgnum ; it's ParsMsgPtrs - 5736 ;mov bx,90 - 5737 000014F4 BB5A00 mov bx,NUMEXTMSGS ; BX = # extended error msgs in list - 5738 chkmsgnum: - 5739 000014F7 39C3 cmp bx,ax - 5740 000014F9 725A jc short mrRet ; msg # too high, return carry - 5741 - 5742 ; Msg # is valid. - 5743 - 5744 ; End modification M033. - 5745 - 5746 000014FB 48 dec ax - 5747 000014FC D1E0 shl ax,1 ; AX = offset into msg ptr list - 5748 000014FE 01C7 add di,ax ; DI = ptr to msg ptr - 5749 - 5750 00001500 81FF[B204] cmp di,ResMsgEnd - 5751 00001504 7247 jb short mrInMem ; ptr (and message) in memory + 5731 ; Make sure msg # is valid. + 5732 ; Assume msg ptr list is either ParsMsgPtrs or ExtMsgPtrs. + 5733 + 5734 ;mov bx,11 + 5735 000014EB BB0B00 mov bx,NUMPARSMSGS ; BX = # parse error msgs in list + 5736 ;cmp di,offset DATARES:ParsMsgPtrs + 5737 000014EE 81FF[E309] cmp di,PARSMSGPTRS + 5738 000014F2 7403 je short chkmsgnum ; it's ParsMsgPtrs + 5739 ;mov bx,90 + 5740 000014F4 BB5A00 mov bx,NUMEXTMSGS ; BX = # extended error msgs in list + 5741 chkmsgnum: + 5742 000014F7 39C3 cmp bx,ax + 5743 000014F9 725A jc short mrRet ; msg # too high, return carry + 5744 + 5745 ; Msg # is valid. + 5746 + 5747 ; End modification M033. + 5748 + 5749 000014FB 48 dec ax + 5750 000014FC D1E0 shl ax,1 ; AX = offset into msg ptr list + 5751 000014FE 01C7 add di,ax ; DI = ptr to msg ptr 5752 - 5753 ;* Retrieve message from disk (or ROM) image. - 5754 ; Read once to get the ptr to the message, then again for the message. + 5753 00001500 81FF[B204] cmp di,ResMsgEnd + 5754 00001504 7247 jb short mrInMem ; ptr (and message) in memory 5755 - 5756 ;ifndef ROMDOS - 5757 ; 14/01/2023 - 5758 ;mov si,offset DATARES:ComSpec ; DS:SI = ptr to pathname - 5759 00001506 BE[4B02] mov si,ComSpec - 5760 00001509 BA0100 mov dx,1 ; EXT_EXISTS_OPEN ; DX = 'open existing file' - 5761 0000150C BB0020 mov bx,2000h ; INT_24_ERROR ; BX = 'fail on crit error' - 5762 0000150F B8006C mov ax,6C00h - 5763 ;mov ax,ExtOpen shl 8 ; AX = 'Extended Open File' - 5764 00001512 CD21 int 21h ; call DOS - 5765 00001514 723F jc short mrRet ; return failure - 5766 - 5767 00001516 89C3 mov bx,ax ; BX = file handle - 5768 00001518 89FA mov dx,di ; DX = ptr to msg ptr - 5769 0000151A 31F6 xor si,si ; SI = read count - 5770 mrRead: - 5771 0000151C 81EA0001 sub dx,100h ; DX = LSW of file offset - 5772 00001520 31C9 xor cx,cx ; CX = MSW of file offset - 5773 00001522 B80042 mov ax,4200h - 5774 ;mov ax,LSEEK shl 8 ; AX = 'Set File Pointer' - 5775 00001525 CD21 int 21h ; call DOS - 5776 00001527 721A jc short mrCloseFile ; handle error - 5777 - 5778 ;mov dx,offset DATARES:MsgBuffer ; DS:DX = input buffer - 5779 00001529 BA[5E04] mov dx,MsgBuffer - 5780 0000152C B94000 mov cx,64 ; CX = # bytes to read - 5781 0000152F B43F mov ah,3Fh - 5782 ;mov ah,READ ; AH = 'Read File' - 5783 00001531 CD21 int 21h ; call DOS - 5784 00001533 720E jc short mrCloseFile ; handle error - 5785 - 5786 00001535 09F6 or si,si ; (CY cleared) - 5787 00001537 750A jnz short mrCloseFile ; 2nd time thru - we're done - 5788 00001539 46 inc si ; mark one read done - 5789 0000153A 8B16[5E04] mov dx,[MsgBuffer] ; DX = ptr to message - 5790 0000153E 09D2 or dx,dx - 5791 00001540 75DA jnz short mrRead ; go read the message - 5792 00001542 F9 stc ; null ptr found- no msg - 5793 - 5794 mrCloseFile: - 5795 00001543 9C pushf ; save success/failure (CY) - 5796 00001544 B43E mov ah,3Eh - 5797 ;mov ah,CLOSE ; AH = 'Close File' - 5798 00001546 CD21 int 21h ; call DOS - 5799 ; Bugbug: should we avoid this popf? - 5800 00001548 9D popf ; CY = success/failure - 5801 00001549 89D7 mov di,dx ; ES:DI = ptr to msg, if successful - 5802 0000154B EB08 jmp short mrRet ; we're done - 5803 - 5804 ;else ;ROMDOS - 5805 ; - 5806 ;; DI = ptr to msg ptr - 5807 ; - 5808 ; mov si,di ; SI = ptr to msg ptr - 5809 ; sub si,100h ; SI = offset into image of msg ptr - 5810 ; mov cx,2 ; CX = # bytes to copy from image - 5811 ; - 5812 ;; ASSUME ES:NOTHING is still in effect. - 5813 ; - 5814 ; push ds - 5815 ; pop es ; ES = DATARES seg addr - 5816 ; mov di,offset DATARES:MsgBuffer ; ES:DI = ptr to buffer - 5817 ; invoke LoadFromROM ; copy msg ptr from ROM - 5818 ; mov si,word ptr MsgBuffer ; SI = ptr to message - 5819 ; or si,si - 5820 ; jz mrNoMsg ; null ptr- no message text - 5821 ; - 5822 ; sub si,100h ; SI = offset into image of msg - 5823 ; mov cx,64 ; CX = # bytes to copy from image - 5824 ; mov di,offset DATARES:MsgBuffer - 5825 ; invoke LoadFromROM - 5826 ; clc ; success - 5827 ; mov di,offset DATARES:MsgBuffer ; ES:DI = ptr to msg - 5828 ; jmp short mrRet - 5829 ; - 5830 ;mrNoMsg: - 5831 ; stc - 5832 ; jmp short mrRet - 5833 ; - 5834 ;;; mov ax,COMMAND_SEG-10h ; AX = seg addr of COMMAND image - 5835 ;;; mov es,ax ; ES:DI = ptr to msg ptr in image - 5836 ; assume es:NOTHING - 5837 ; - 5838 ;endif ;ROMDOS - 5839 - 5840 ;* Message ptr is in memory. - 5841 ; If ptr is in memory, assume message is in memory (/msg). + 5756 ;* Retrieve message from disk (or ROM) image. + 5757 ; Read once to get the ptr to the message, then again for the message. + 5758 + 5759 ;ifndef ROMDOS + 5760 ; 14/01/2023 + 5761 ;mov si,offset DATARES:ComSpec ; DS:SI = ptr to pathname + 5762 00001506 BE[4B02] mov si,ComSpec + 5763 00001509 BA0100 mov dx,1 ; EXT_EXISTS_OPEN ; DX = 'open existing file' + 5764 0000150C BB0020 mov bx,2000h ; INT_24_ERROR ; BX = 'fail on crit error' + 5765 0000150F B8006C mov ax,6C00h + 5766 ;mov ax,ExtOpen shl 8 ; AX = 'Extended Open File' + 5767 00001512 CD21 int 21h ; call DOS + 5768 00001514 723F jc short mrRet ; return failure + 5769 + 5770 00001516 89C3 mov bx,ax ; BX = file handle + 5771 00001518 89FA mov dx,di ; DX = ptr to msg ptr + 5772 0000151A 31F6 xor si,si ; SI = read count + 5773 mrRead: + 5774 0000151C 81EA0001 sub dx,100h ; DX = LSW of file offset + 5775 00001520 31C9 xor cx,cx ; CX = MSW of file offset + 5776 00001522 B80042 mov ax,4200h + 5777 ;mov ax,LSEEK shl 8 ; AX = 'Set File Pointer' + 5778 00001525 CD21 int 21h ; call DOS + 5779 00001527 721A jc short mrCloseFile ; handle error + 5780 + 5781 ;mov dx,offset DATARES:MsgBuffer ; DS:DX = input buffer + 5782 00001529 BA[5E04] mov dx,MsgBuffer + 5783 0000152C B94000 mov cx,64 ; CX = # bytes to read + 5784 0000152F B43F mov ah,3Fh + 5785 ;mov ah,READ ; AH = 'Read File' + 5786 00001531 CD21 int 21h ; call DOS + 5787 00001533 720E jc short mrCloseFile ; handle error + 5788 + 5789 00001535 09F6 or si,si ; (CY cleared) + 5790 00001537 750A jnz short mrCloseFile ; 2nd time thru - we're done + 5791 00001539 46 inc si ; mark one read done + 5792 0000153A 8B16[5E04] mov dx,[MsgBuffer] ; DX = ptr to message + 5793 0000153E 09D2 or dx,dx + 5794 00001540 75DA jnz short mrRead ; go read the message + 5795 00001542 F9 stc ; null ptr found- no msg + 5796 + 5797 mrCloseFile: + 5798 00001543 9C pushf ; save success/failure (CY) + 5799 00001544 B43E mov ah,3Eh + 5800 ;mov ah,CLOSE ; AH = 'Close File' + 5801 00001546 CD21 int 21h ; call DOS + 5802 ; Bugbug: should we avoid this popf? + 5803 00001548 9D popf ; CY = success/failure + 5804 00001549 89D7 mov di,dx ; ES:DI = ptr to msg, if successful + 5805 0000154B EB08 jmp short mrRet ; we're done + 5806 + 5807 ;else ;ROMDOS + 5808 ; + 5809 ;; DI = ptr to msg ptr + 5810 ; + 5811 ; mov si,di ; SI = ptr to msg ptr + 5812 ; sub si,100h ; SI = offset into image of msg ptr + 5813 ; mov cx,2 ; CX = # bytes to copy from image + 5814 ; + 5815 ;; ASSUME ES:NOTHING is still in effect. + 5816 ; + 5817 ; push ds + 5818 ; pop es ; ES = DATARES seg addr + 5819 ; mov di,offset DATARES:MsgBuffer ; ES:DI = ptr to buffer + 5820 ; invoke LoadFromROM ; copy msg ptr from ROM + 5821 ; mov si,word ptr MsgBuffer ; SI = ptr to message + 5822 ; or si,si + 5823 ; jz mrNoMsg ; null ptr- no message text + 5824 ; + 5825 ; sub si,100h ; SI = offset into image of msg + 5826 ; mov cx,64 ; CX = # bytes to copy from image + 5827 ; mov di,offset DATARES:MsgBuffer + 5828 ; invoke LoadFromROM + 5829 ; clc ; success + 5830 ; mov di,offset DATARES:MsgBuffer ; ES:DI = ptr to msg + 5831 ; jmp short mrRet + 5832 ; + 5833 ;mrNoMsg: + 5834 ; stc + 5835 ; jmp short mrRet + 5836 ; + 5837 ;;; mov ax,COMMAND_SEG-10h ; AX = seg addr of COMMAND image + 5838 ;;; mov es,ax ; ES:DI = ptr to msg ptr in image + 5839 ; assume es:NOTHING + 5840 ; + 5841 ;endif ;ROMDOS 5842 - 5843 mrInMem: - 5844 ; 14/01/2023 - 5845 0000154D 268B3D mov di,[es:di] ; ES:DI = ptr to msg - 5846 00001550 09FF or di,di ; (CY cleared) - 5847 00001552 7501 jnz short mrRet ; found message - 5848 00001554 F9 stc ; null ptr found - no message - 5849 mrRet: - 5850 00001555 5E pop si ; restore all registers - 5851 00001556 5A pop dx - 5852 00001557 59 pop cx - 5853 00001558 5B pop bx - 5854 00001559 58 pop ax - 5855 - 5856 ; mov ds,[OldDS] ; restore ds - 5857 0000155A 1F pop ds - 5858 ;assume ds:nothing - 5859 - 5860 0000155B CB retf ; 21/04/2023 - 5861 - 5862 ;MsgRetriever endp - 5863 - 5864 ; M003; Start of changes for UMB support - 5865 - 5866 ; ---------------------------------------------------------------------------- - 5867 ;*** Lh_OffUnlink -- Restore allocation strat and link state - 5868 ; - 5869 ; ENTRY al = Saved alloc strat and link state - 5870 ; b0 = 1 if alloc strat to restore is HighFirst - 5871 ; b1 = 1 if link state to restore is Linked - 5872 ; - 5873 ; EXIT None - 5874 ; - 5875 ; USED ax, bx, cx - 5876 ; ---------------------------------------------------------------------------- - 5877 - 5878 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5879 - 5880 ;public Lh_OffUnlink - 5881 Lh_OffUnlink: ; proc far - 5882 ; 14/01/2023 - 5883 0000155C 88C5 mov ch,al - 5884 0000155E 88C1 mov cl,al - 5885 ;;mov ax,(ALLOCOPER shl 8) OR 0 - 5886 ;mov ax,(ALLOCOPER<<8) - 5887 00001560 B80058 mov ax,5800h - 5888 00001563 CD21 int 21h - 5889 00001565 89C3 mov bx,ax - 5890 00001567 D0C9 ror cl,1 ; b7 = HighFirst bit - 5891 00001569 80E180 and cl,80h ; mask off b6-b0 - 5892 0000156C 80E37F and bl,7fh ; mask off HighFirst bit - 5893 0000156F 08CB or bl,cl ; set HighFirst bit state - 5894 ;;mov ax,(ALLOCOPER shl 8) OR 1 - 5895 ;mov ax,(ALLOCOPER<<8)|1 - 5896 00001571 B80158 mov ax,5801h - 5897 00001574 CD21 int 21h ; set alloc strat - 5898 - 5899 00001576 88EB mov bl,ch - 5900 00001578 D0EB shr bl,1 - 5901 0000157A 30FF xor bh,bh ; bx = linkstate - 5902 ;mov ax,(ALLOCOPER shl 8) OR 3 - 5903 ;mov ax,(ALLOCOPER<<8)|3 - 5904 0000157C B80358 mov ax,5803h - 5905 0000157F CD21 int 21h ; set linkstate - 5906 - 5907 00001581 CB retf - 5908 - 5909 ;Lh_OffUnlink endp - 5910 - 5911 ; M003; End of changes for UMB support - 5912 ;public EndCode - 5913 ; 14/01/2023 - 5914 ;EndCode: ; label byte - 5915 ; 06/06/2023 - 5916 ; 16/04/2023 - 5917 ; 14/08/2024 - 5918 ;EndCode equ ($-StartCode)+100h - 5919 - 5920 ; 06/06/2023 - 5921 ;EndCode equ $-StartCode + 5843 ;* Message ptr is in memory. + 5844 ; If ptr is in memory, assume message is in memory (/msg). + 5845 + 5846 mrInMem: + 5847 ; 14/01/2023 + 5848 0000154D 268B3D mov di,[es:di] ; ES:DI = ptr to msg + 5849 00001550 09FF or di,di ; (CY cleared) + 5850 00001552 7501 jnz short mrRet ; found message + 5851 00001554 F9 stc ; null ptr found - no message + 5852 mrRet: + 5853 00001555 5E pop si ; restore all registers + 5854 00001556 5A pop dx + 5855 00001557 59 pop cx + 5856 00001558 5B pop bx + 5857 00001559 58 pop ax + 5858 + 5859 ; mov ds,[OldDS] ; restore ds + 5860 0000155A 1F pop ds + 5861 ;assume ds:nothing + 5862 + 5863 0000155B CB retf ; 21/04/2023 + 5864 + 5865 ;MsgRetriever endp + 5866 + 5867 ; M003; Start of changes for UMB support + 5868 + 5869 ; ---------------------------------------------------------------------------- + 5870 ;*** Lh_OffUnlink -- Restore allocation strat and link state + 5871 ; + 5872 ; ENTRY al = Saved alloc strat and link state + 5873 ; b0 = 1 if alloc strat to restore is HighFirst + 5874 ; b1 = 1 if link state to restore is Linked + 5875 ; + 5876 ; EXIT None + 5877 ; + 5878 ; USED ax, bx, cx + 5879 ; ---------------------------------------------------------------------------- + 5880 + 5881 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5882 + 5883 ;public Lh_OffUnlink + 5884 Lh_OffUnlink: ; proc far + 5885 ; 14/01/2023 + 5886 0000155C 88C5 mov ch,al + 5887 0000155E 88C1 mov cl,al + 5888 ;;mov ax,(ALLOCOPER shl 8) OR 0 + 5889 ;mov ax,(ALLOCOPER<<8) + 5890 00001560 B80058 mov ax,5800h + 5891 00001563 CD21 int 21h + 5892 00001565 89C3 mov bx,ax + 5893 00001567 D0C9 ror cl,1 ; b7 = HighFirst bit + 5894 00001569 80E180 and cl,80h ; mask off b6-b0 + 5895 0000156C 80E37F and bl,7fh ; mask off HighFirst bit + 5896 0000156F 08CB or bl,cl ; set HighFirst bit state + 5897 ;;mov ax,(ALLOCOPER shl 8) OR 1 + 5898 ;mov ax,(ALLOCOPER<<8)|1 + 5899 00001571 B80158 mov ax,5801h + 5900 00001574 CD21 int 21h ; set alloc strat + 5901 + 5902 00001576 88EB mov bl,ch + 5903 00001578 D0EB shr bl,1 + 5904 0000157A 30FF xor bh,bh ; bx = linkstate + 5905 ;mov ax,(ALLOCOPER shl 8) OR 3 + 5906 ;mov ax,(ALLOCOPER<<8)|3 + 5907 0000157C B80358 mov ax,5803h + 5908 0000157F CD21 int 21h ; set linkstate + 5909 + 5910 00001581 CB retf + 5911 + 5912 ;Lh_OffUnlink endp + 5913 + 5914 ; M003; End of changes for UMB support + 5915 ;public EndCode + 5916 ; 14/01/2023 + 5917 ;EndCode: ; label byte + 5918 ; 06/06/2023 + 5919 ; 16/04/2023 + 5920 ; 14/08/2024 + 5921 ;EndCode equ ($-StartCode)+100h 5922 - 5923 ; 14/08/2024 - 5924 EndCode: - 5925 ENDCODE equ ($-StartCode)+100h - 5926 - 5927 ;CODERES ends - 5928 ; end + 5923 ; 06/06/2023 + 5924 ;EndCode equ $-StartCode + 5925 + 5926 ; 14/08/2024 + 5927 EndCode: + 5928 ENDCODE equ ($-StartCode)+100h 5929 - 5930 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5931 - 5932 ;times (((EndCode+15)>>4)<<4)-EndCode db 0 - 5933 ; 14/08/2024 - 5934 00001582 00 times (((ENDCODE+15)>>4)<<4)-ENDCODE db 0 - 5935 - 5936 ;align 16 - 5937 - 5938 ;============================================================================= - 5939 ; INIT.ASM, MSDOS 6.0 (COMMAND.COM), 1991 - 5940 ;============================================================================= - 5941 ; 22/09/2018 - Retro DOS v3.0 ('command3.s') - 5942 - 5943 ; INIT.ASM (MSDOS 2.11 COMMAND.COM, Retro DOS v2.0, 30/04/2018) - 5944 - 5945 ;TITLE COMMAND Initialization - 5946 - 5947 ;ENVIRONSIZ EQU 0A0H ; Must agree with values in ENVIRONMENT segment - 5948 ;ENVIRONSIZ2 EQU 092H - 5949 ;MAX_COMSPEC EQU ENVIRONSIZ2 ; = 146 ; 22/09/2018 - 5950 - 5951 ; UINIT.ASM, MSDOS 6.0, 1991 - 5952 ; 23/09/2018 - 5953 ENVBIG EQU 32768 ;AN000; maximum environment size - 5954 ; 14/01/2023 - 5955 ;ENVSML EQU 160 ;AN000; minimum environment size - 5956 - 5957 ; ---------------------------------------------------------------------------- - 5958 - 5959 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 5960 - 5961 ; 06/06/2023 - 5962 ; (MSDOS 5.0 COMMAND.COM -initial- Environment Structure size) - 5963 ;ENVIRONSIZ equ 160 - 5964 - 5965 ENVSML equ 256 ; minimum environment size - 5966 ;MAX_COMSPEC equ ENVIRONSIZ - Env_ComSpec - 5967 MAX_COMSPEC equ 146 - 5968 ECOMSPEC equ 14 - 5969 - 5970 ; 14/01/2023 - 5971 TAB_CHAR equ 09h - 5972 SPACE_CHAR equ 20h - 5973 - 5974 ; 06/06/2023 - 5975 ; (MSDOS 6.22 COMMAND.COM -initial- Environment Structure size) - 5976 ;ENVIRONSIZ equ 180 ; SIZE Environment - 5977 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 5978 ; (PCDOS 7.1 COMMAND.COM -initial- Environment Structure size) - 5979 ENVIRONSIZ equ 166 ; SIZE Environment - 5980 - 5981 ;---------------------------------------------------- - 5982 ; MSDOS 6.0 - ENVDATA.ASM - 1991 - 5983 ;---------------------------------------------------- - 5984 ;Environment Struc ; Default COMMAND environment - 5985 ; - 5986 ;Env_PathString db "path=" - 5987 ;Env_PathSpec db "c:\msdos" - 5988 ; db 0 - 5989 ;Env_PrmptString db "prompt=" - 5990 ;Env_PrmptSpec db "$p$g" + 5930 ;CODERES ends + 5931 ; end + 5932 + 5933 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5934 + 5935 ;times (((EndCode+15)>>4)<<4)-EndCode db 0 + 5936 ; 14/08/2024 + 5937 00001582 00 times (((ENDCODE+15)>>4)<<4)-ENDCODE db 0 + 5938 + 5939 ;align 16 + 5940 + 5941 ;============================================================================= + 5942 ; INIT.ASM, MSDOS 6.0 (COMMAND.COM), 1991 + 5943 ;============================================================================= + 5944 ; 22/09/2018 - Retro DOS v3.0 ('command3.s') + 5945 + 5946 ; INIT.ASM (MSDOS 2.11 COMMAND.COM, Retro DOS v2.0, 30/04/2018) + 5947 + 5948 ;TITLE COMMAND Initialization + 5949 + 5950 ;ENVIRONSIZ EQU 0A0H ; Must agree with values in ENVIRONMENT segment + 5951 ;ENVIRONSIZ2 EQU 092H + 5952 ;MAX_COMSPEC EQU ENVIRONSIZ2 ; = 146 ; 22/09/2018 + 5953 + 5954 ; UINIT.ASM, MSDOS 6.0, 1991 + 5955 ; 23/09/2018 + 5956 ENVBIG EQU 32768 ;AN000; maximum environment size + 5957 ; 14/01/2023 + 5958 ;ENVSML EQU 160 ;AN000; minimum environment size + 5959 + 5960 ; ---------------------------------------------------------------------------- + 5961 + 5962 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 5963 + 5964 ; 06/06/2023 + 5965 ; (MSDOS 5.0 COMMAND.COM -initial- Environment Structure size) + 5966 ;ENVIRONSIZ equ 160 + 5967 + 5968 ENVSML equ 256 ; minimum environment size + 5969 ;MAX_COMSPEC equ ENVIRONSIZ - Env_ComSpec + 5970 MAX_COMSPEC equ 146 + 5971 ECOMSPEC equ 14 + 5972 + 5973 ; 14/01/2023 + 5974 TAB_CHAR equ 09h + 5975 SPACE_CHAR equ 20h + 5976 + 5977 ; 06/06/2023 + 5978 ; (MSDOS 6.22 COMMAND.COM -initial- Environment Structure size) + 5979 ;ENVIRONSIZ equ 180 ; SIZE Environment + 5980 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 5981 ; (PCDOS 7.1 COMMAND.COM -initial- Environment Structure size) + 5982 ENVIRONSIZ equ 166 ; SIZE Environment + 5983 + 5984 ;---------------------------------------------------- + 5985 ; MSDOS 6.0 - ENVDATA.ASM - 1991 + 5986 ;---------------------------------------------------- + 5987 ;Environment Struc ; Default COMMAND environment + 5988 ; + 5989 ;Env_PathString db "path=" + 5990 ;Env_PathSpec db "c:\msdos" 5991 ; db 0 - 5992 ;Env_ComString db "comspec=" - 5993 ;Env_ComSpec db "\command.com" - 5994 ; db 134 dup (0) - 5995 ; - 5996 ;Environment ends - 5997 ;---------------------------------------------------- - 5998 - 5999 ;----------------------------------------------------------------------------- - 6000 - 6001 ;----------------------------------------------------------------------------- - 6002 ; START OF INIT PORTION - 6003 ; This code is deallocated after initialization. + 5992 ;Env_PrmptString db "prompt=" + 5993 ;Env_PrmptSpec db "$p$g" + 5994 ; db 0 + 5995 ;Env_ComString db "comspec=" + 5996 ;Env_ComSpec db "\command.com" + 5997 ; db 134 dup (0) + 5998 ; + 5999 ;Environment ends + 6000 ;---------------------------------------------------- + 6001 + 6002 ;----------------------------------------------------------------------------- + 6003 6004 ;----------------------------------------------------------------------------- - 6005 - 6006 ;INIT SEGMENT PUBLIC PARA - 6007 - 6008 ; EXTRN HEADER:BYTE - 6009 ; EXTRN BADCOMLKMES:BYTE + 6005 ; START OF INIT PORTION + 6006 ; This code is deallocated after initialization. + 6007 ;----------------------------------------------------------------------------- + 6008 + 6009 ;INIT SEGMENT PUBLIC PARA 6010 - 6011 ; PUBLIC CONPROC - 6012 - 6013 ;ASSUME CS:RESGROUP,DS:RESGROUP,ES:RESGROUP,SS:RESGROUP - 6014 - 6015 ;ORG 0 - 6016 ;ZERO = $ - 6017 ; 23/09/2018 - 6018 ZERO equ $ ; Offset 0E30h for original MSDOS 3.3 COMMAND.COM - 6019 - 6020 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 6021 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1560h (CODERES:0820h) + 6011 ; EXTRN HEADER:BYTE + 6012 ; EXTRN BADCOMLKMES:BYTE + 6013 + 6014 ; PUBLIC CONPROC + 6015 + 6016 ;ASSUME CS:RESGROUP,DS:RESGROUP,ES:RESGROUP,SS:RESGROUP + 6017 + 6018 ;ORG 0 + 6019 ;ZERO = $ + 6020 ; 23/09/2018 + 6021 ZERO equ $ ; Offset 0E30h for original MSDOS 3.3 COMMAND.COM 6022 - 6023 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 6024 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1670h (CODERES:0820h) - 6025 ConProc: - 6026 ;mov sp,offset ResGroup:RStack ; must be first instruction - 6027 00001590 BC[2E05] mov sp,RStack - 6028 - 6029 ; We need to set the PSP to us right at start because Carousel needs - 6030 ; to be lied to and it does not set PSP when it transfers control to - 6031 ; us after loading us as an overlay. By setting PSP, we ensure that - 6032 ; command.com is also not lied to. - 6033 - 6034 ; 14/01/2023 - 6035 ; MSDOS 6.0 - 6036 00001593 B450 mov ah,50h - 6037 ;mov ah,SET_CURRENT_PDB - 6038 00001595 8CC3 mov bx,es - 6039 00001597 CD21 int 21h - 6040 - 6041 ; 14/01/2023 - 6042 ;mov ah,30h - 6043 ;;mov ax,GET_VERSION<<8 ; 3000h - 6044 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 6045 00001599 B80030 mov ax,3000h - 6046 0000159C CD21 int 21h - 6047 ;;;cmp ax,EXPECTED_VERSION ; 1E03h - 6048 ;;cmp ax,5 - 6049 ;cmp ax,EXPECTED_VERSION ; 0005h - 6050 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 6051 0000159E 3D070A cmp ax,EXPECTED_VERSION ; 1606h - 6052 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM - 6053 ;cmp ax,0A07h - 6054 000015A1 7411 je short okdos ; DOS version is ok - 6055 - 6056 000015A3 BA[6321] mov dx,BADVERMSG ; DX = ptr to msg - 6057 000015A6 E832FE call RPrint + 6023 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 6024 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1560h (CODERES:0820h) + 6025 + 6026 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 6027 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1670h (CODERES:0820h) + 6028 ConProc: + 6029 ;mov sp,offset ResGroup:RStack ; must be first instruction + 6030 00001590 BC[2E05] mov sp,RStack + 6031 + 6032 ; We need to set the PSP to us right at start because Carousel needs + 6033 ; to be lied to and it does not set PSP when it transfers control to + 6034 ; us after loading us as an overlay. By setting PSP, we ensure that + 6035 ; command.com is also not lied to. + 6036 + 6037 ; 14/01/2023 + 6038 ; MSDOS 6.0 + 6039 00001593 B450 mov ah,50h + 6040 ;mov ah,SET_CURRENT_PDB + 6041 00001595 8CC3 mov bx,es + 6042 00001597 CD21 int 21h + 6043 + 6044 ; 14/01/2023 + 6045 ;mov ah,30h + 6046 ;;mov ax,GET_VERSION<<8 ; 3000h + 6047 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 6048 00001599 B80030 mov ax,3000h + 6049 0000159C CD21 int 21h + 6050 ;;;cmp ax,EXPECTED_VERSION ; 1E03h + 6051 ;;cmp ax,5 + 6052 ;cmp ax,EXPECTED_VERSION ; 0005h + 6053 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 6054 0000159E 3D070A cmp ax,EXPECTED_VERSION ; 1606h + 6055 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM + 6056 ;cmp ax,0A07h + 6057 000015A1 7411 je short okdos ; DOS version is ok 6058 - 6059 ; MSDOS 3.3 - 6060 ;mov ah,STD_CON_STRING_OUTPUT ; 9 - 6061 ;int 21h ; DOS - PRINT STRING - 6062 ; DS:DX -> string terminated by "$" - 6063 000015A9 8CC0 mov ax,es - 6064 000015AB 2639061600 cmp [es:PDB.PARENT_PID],ax - 6065 ;cmp [es:16h],ax ; if COMMAND is own parent, - 6066 Here: - 6067 000015B0 74FE jz short Here ; loop forever - 6068 - 6069 000015B2 CD20 int 20h ; otherwise, exit - 6070 okdos: - 6071 ; 23/09/2018 - 6072 - 6073 ; Calculate and save the end of the INIT segment (which is also - 6074 ; the beginning of TRANGROUP). + 6059 000015A3 BA[6321] mov dx,BADVERMSG ; DX = ptr to msg + 6060 000015A6 E832FE call RPrint + 6061 + 6062 ; MSDOS 3.3 + 6063 ;mov ah,STD_CON_STRING_OUTPUT ; 9 + 6064 ;int 21h ; DOS - PRINT STRING + 6065 ; DS:DX -> string terminated by "$" + 6066 000015A9 8CC0 mov ax,es + 6067 000015AB 2639061600 cmp [es:PDB.PARENT_PID],ax + 6068 ;cmp [es:16h],ax ; if COMMAND is own parent, + 6069 Here: + 6070 000015B0 74FE jz short Here ; loop forever + 6071 + 6072 000015B2 CD20 int 20h ; otherwise, exit + 6073 okdos: + 6074 ; 23/09/2018 6075 - 6076 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 6077 ; MSDOS 3.3 - 6078 ;mov ah,65h - 6079 ;mov al,2 - 6080 ;mov dx,-1 - 6081 ;mov bx,-1 - 6082 ;mov cx,5 - 6083 ;mov di,UCASE_ADDR - 6084 ;int 21h ; AH = 65h : GET EXTENDED COUNTRY INFORMATION (DOS 3.3+) - 6085 ; ; AL = 02h : Get pointer to character translation table - 6086 ; ; BX = code page (-1 = current global code page) - 6087 ; ; DX = country ID (-1 = current country) - 6088 ; ; CX = amount of data to return - 6089 ;; ES:DI = pointer to output buffer - 6090 ;; Buffer offset : - 6091 ;; 00h - byte, country Id - 6092 ;; 01h - dword, pointer to uppercase table - 6093 - 6094 ; 14/01/2023 - 6095 ; MSDOS 6.0 (& MSDOS 3.3) - 6096 ;mov dx,232Fh ; MSDOS 5.0 COMMAND.COM - 6097 ; 06/06/2023 - 6098 ;mov dx,26EFh ; MSDOS 6.22 COMMAND.COM - 6099 ; 18/07/2024 - 6100 ;mov dx,289Fh ; PCDOS 7.1 COMMAND.COM - 6101 000015B4 BADF27 mov dx,TRANSTART+15 ; get end of init code - 6102 ; 27/09/2018 - 6103 ;mov dx,TRANSTART ; (paragraph aligned address) - 6104 000015B7 B104 mov cl,4 ; change to paragraphs - 6105 000015B9 D3EA shr dx,cl ; - 6106 000015BB 8CC8 mov ax,cs ; get current segment - 6107 000015BD 01D0 add ax,dx ; calculate segment of end of init - 6108 000015BF A3[9020] mov [initend],ax ; save this - 6109 - 6110 ; 14/01/2023 - 6111 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1591h + 6076 ; Calculate and save the end of the INIT segment (which is also + 6077 ; the beginning of TRANGROUP). + 6078 + 6079 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 6080 ; MSDOS 3.3 + 6081 ;mov ah,65h + 6082 ;mov al,2 + 6083 ;mov dx,-1 + 6084 ;mov bx,-1 + 6085 ;mov cx,5 + 6086 ;mov di,UCASE_ADDR + 6087 ;int 21h ; AH = 65h : GET EXTENDED COUNTRY INFORMATION (DOS 3.3+) + 6088 ; ; AL = 02h : Get pointer to character translation table + 6089 ; ; BX = code page (-1 = current global code page) + 6090 ; ; DX = country ID (-1 = current country) + 6091 ; ; CX = amount of data to return + 6092 ;; ES:DI = pointer to output buffer + 6093 ;; Buffer offset : + 6094 ;; 00h - byte, country Id + 6095 ;; 01h - dword, pointer to uppercase table + 6096 + 6097 ; 14/01/2023 + 6098 ; MSDOS 6.0 (& MSDOS 3.3) + 6099 ;mov dx,232Fh ; MSDOS 5.0 COMMAND.COM + 6100 ; 06/06/2023 + 6101 ;mov dx,26EFh ; MSDOS 6.22 COMMAND.COM + 6102 ; 18/07/2024 + 6103 ;mov dx,289Fh ; PCDOS 7.1 COMMAND.COM + 6104 000015B4 BADF27 mov dx,TRANSTART+15 ; get end of init code + 6105 ; 27/09/2018 + 6106 ;mov dx,TRANSTART ; (paragraph aligned address) + 6107 000015B7 B104 mov cl,4 ; change to paragraphs + 6108 000015B9 D3EA shr dx,cl ; + 6109 000015BB 8CC8 mov ax,cs ; get current segment + 6110 000015BD 01D0 add ax,dx ; calculate segment of end of init + 6111 000015BF A3[9020] mov [initend],ax ; save this 6112 - 6113 ; Check for /? on the command line. If found, display help text and exit. - 6114 ; NOTE: this routine may terminate the program, never returning. + 6113 ; 14/01/2023 + 6114 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1591h 6115 - 6116 000015C2 E8EA07 call CheckHelp - 6117 - 6118 ; We have to patch the segment values for the various interrupt entry points. - 6119 ; This is because we need to have the default addresses of the handlers in our - 6120 ; stub before the relocation is done. These values will then be changed once - 6121 ; the resident is relocated - 6122 - 6123 000015C5 E8160A call patch_segs - 6124 - 6125 ; Turn APPEND off during initialization processing - 6126 - 6127 ; 14/01/2023 - 6128 000015C8 B800B7 mov ax,0B700h - 6129 ;mov ax,APPENDINSTALL ; see if append installed - 6130 000015CB CD2F int 2Fh ; - 6131 ;cmp al,0 ; append installed? - 6132 000015CD 08C0 or al,al - 6133 000015CF 7418 jz short set_msg_addr ; no - continue - 6134 - 6135 000015D1 B802B7 mov ax,0B702h - 6136 ;mov ax,APPENDDOS ; see if append DOS version right - 6137 000015D4 CD2F int 2Fh ; - 6138 ;cmp ax,-1 ; append version correct? - 6139 ;jne short set_msg_addr ; no - continue - 6140 000015D6 40 inc ax ; -1 -> 0 - 6141 000015D7 7510 jnz short set_msg_addr - 6142 - 6143 000015D9 B806B7 mov ax,0B706h - 6144 ;mov ax,APPENDGETSTATE ; Get the state of Append - 6145 000015DC CD2F int 2Fh ; - 6146 000015DE 891E[BE02] mov [Append_State],bx ; save append state - 6147 - 6148 000015E2 31DB xor bx,bx ; clear out state - 6149 000015E4 B807B7 mov ax,0B707h - 6150 ;mov ax,APPENDSETSTATE ; Set the state of Append - 6151 000015E7 CD2F int 2Fh ; set everything off - 6152 - 6153 set_msg_addr: - 6154 ; 14/01/2023 - 6155 ;;mov di,offset resgroup:DataresEnd ; get address of resident end - 6156 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:15BAh) - 6157 ;mov di,093Eh ; mov di,PAERRMSG0 ; MSDOS 5.0 COMMAND.COM - 6158 ; 06/06/2023 - 6159 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:16CBh) - 6160 ;mov di,0A41h ; mov di,PAERRMSG0 ; MSDOS 6.22 COMMAND.COM - 6161 ; 18/07/2024 - 6162 ;mov di,9F3h ; mov di,PAERRMSG0 ; PCDOS 7.1 COMMAND.COM - 6163 000015E9 BF[0509] mov di,DataresEnd - 6164 000015EC 893E[B204] mov [ResMsgEnd],di ; save it - 6165 - 6166 000015F0 E8FD09 call get_XMMAddr ; get XMM call address - 6167 - 6168 ; Check if this is the first instance of command.com. If not, we just exit - 6169 ; this routine without moving any code. - 6170 ; After the int 2fh, ds:si points at the resident jump table in the previous - 6171 ; stub. We just have to copy this over - 6172 - 6173 ;ifndef ROMDOS - 6174 000015F3 B80055 mov ax,5500h - 6175 ;mov ax,GET_COMMAND_STATE - 6176 ;else - 6177 ; mov ax,GET_ROMCOMMAND_STATE - 6178 ;endif ; ROMDOS - 6179 - 6180 000015F6 CD2F int 2Fh ; (Int 2Fh/AX=5500h - DOS 5+ - COMMAND.COM INTERFACE) - 6181 ;assume ds:nothing + 6116 ; Check for /? on the command line. If found, display help text and exit. + 6117 ; NOTE: this routine may terminate the program, never returning. + 6118 + 6119 000015C2 E8EA07 call CheckHelp + 6120 + 6121 ; We have to patch the segment values for the various interrupt entry points. + 6122 ; This is because we need to have the default addresses of the handlers in our + 6123 ; stub before the relocation is done. These values will then be changed once + 6124 ; the resident is relocated + 6125 + 6126 000015C5 E8160A call patch_segs + 6127 + 6128 ; Turn APPEND off during initialization processing + 6129 + 6130 ; 14/01/2023 + 6131 000015C8 B800B7 mov ax,0B700h + 6132 ;mov ax,APPENDINSTALL ; see if append installed + 6133 000015CB CD2F int 2Fh ; + 6134 ;cmp al,0 ; append installed? + 6135 000015CD 08C0 or al,al + 6136 000015CF 7418 jz short set_msg_addr ; no - continue + 6137 + 6138 000015D1 B802B7 mov ax,0B702h + 6139 ;mov ax,APPENDDOS ; see if append DOS version right + 6140 000015D4 CD2F int 2Fh ; + 6141 ;cmp ax,-1 ; append version correct? + 6142 ;jne short set_msg_addr ; no - continue + 6143 000015D6 40 inc ax ; -1 -> 0 + 6144 000015D7 7510 jnz short set_msg_addr + 6145 + 6146 000015D9 B806B7 mov ax,0B706h + 6147 ;mov ax,APPENDGETSTATE ; Get the state of Append + 6148 000015DC CD2F int 2Fh ; + 6149 000015DE 891E[BE02] mov [Append_State],bx ; save append state + 6150 + 6151 000015E2 31DB xor bx,bx ; clear out state + 6152 000015E4 B807B7 mov ax,0B707h + 6153 ;mov ax,APPENDSETSTATE ; Set the state of Append + 6154 000015E7 CD2F int 2Fh ; set everything off + 6155 + 6156 set_msg_addr: + 6157 ; 14/01/2023 + 6158 ;;mov di,offset resgroup:DataresEnd ; get address of resident end + 6159 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:15BAh) + 6160 ;mov di,093Eh ; mov di,PAERRMSG0 ; MSDOS 5.0 COMMAND.COM + 6161 ; 06/06/2023 + 6162 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:16CBh) + 6163 ;mov di,0A41h ; mov di,PAERRMSG0 ; MSDOS 6.22 COMMAND.COM + 6164 ; 18/07/2024 + 6165 ;mov di,9F3h ; mov di,PAERRMSG0 ; PCDOS 7.1 COMMAND.COM + 6166 000015E9 BF[0509] mov di,DataresEnd + 6167 000015EC 893E[B204] mov [ResMsgEnd],di ; save it + 6168 + 6169 000015F0 E8FD09 call get_XMMAddr ; get XMM call address + 6170 + 6171 ; Check if this is the first instance of command.com. If not, we just exit + 6172 ; this routine without moving any code. + 6173 ; After the int 2fh, ds:si points at the resident jump table in the previous + 6174 ; stub. We just have to copy this over + 6175 + 6176 ;ifndef ROMDOS + 6177 000015F3 B80055 mov ax,5500h + 6178 ;mov ax,GET_COMMAND_STATE + 6179 ;else + 6180 ; mov ax,GET_ROMCOMMAND_STATE + 6181 ;endif ; ROMDOS 6182 - 6183 ; 03/05/2023 - 6184 ; Return: - 6185 ; AX = 0000h if an instance of COMMAND.COM is already running - 6186 ; DS:SI -> entry point table - 6187 - 6188 ; (si = offset Int2f_Entry) ; (('MsgInt2fHandler:', 'fcOurs:')) - 6189 - 6190 000015F8 09C0 or ax,ax - 6191 000015FA 750C jnz short first_com ; this is the first instance + 6183 000015F6 CD2F int 2Fh ; (Int 2Fh/AX=5500h - DOS 5+ - COMMAND.COM INTERFACE) + 6184 ;assume ds:nothing + 6185 + 6186 ; 03/05/2023 + 6187 ; Return: + 6188 ; AX = 0000h if an instance of COMMAND.COM is already running + 6189 ; DS:SI -> entry point table + 6190 + 6191 ; (si = offset Int2f_Entry) ; (('MsgInt2fHandler:', 'fcOurs:')) 6192 - 6193 ; 14/01/2023 - 6194 000015FC 268936[9526] mov [es:ResJmpTable],si ; save old stub jump table - 6195 00001601 268C1E[9726] mov [es:ResJmpTable+2],ds - 6196 00001606 EB06 jmp short init_cntry - 6197 - 6198 first_com: - 6199 00001608 26C606[9926]01 mov byte [es:FirstCom],1 ; indicate first command.com + 6193 000015F8 09C0 or ax,ax + 6194 000015FA 750C jnz short first_com ; this is the first instance + 6195 + 6196 ; 14/01/2023 + 6197 000015FC 268936[9526] mov [es:ResJmpTable],si ; save old stub jump table + 6198 00001601 268C1E[9726] mov [es:ResJmpTable+2],ds + 6199 00001606 EB06 jmp short init_cntry 6200 - 6201 init_cntry: - 6202 ; 14/01/2023 - 6203 0000160E 06 push es - 6204 0000160F 1F pop ds - 6205 ;assume ds:RESGROUP - 6206 - 6207 00001610 B465 mov ah,65h - 6208 ;mov ah,GETEXTCNTRY ; get extended country info - 6209 00001612 B004 mov al,4 ; get file ucase table - 6210 00001614 BAFFFF mov dx,-1 ; - 6211 ;mov bx,-1 ; - 6212 00001617 89D3 mov bx,dx - 6213 00001619 B90500 mov cx,5 ; number of bytes we want - 6214 ;mov di,offset resgroup:FUCase_Addr ; buffer for address - 6215 0000161C BF[B502] mov di,FUCase_Addr - 6216 0000161F CD21 int 21h - 6217 ; DOS - 4.x internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION - 6218 ; AL = function - - 6219 - 6220 ; Bugbug: conditionalize dbcs_vector stuff? - 6221 - 6222 00001621 1E push ds ; - 6223 00001622 B80063 mov ax,6300h - 6224 ;mov ax,(ECS_CALL shl 8) or GETLEADBTBL ; - 6225 00001625 CD21 int 21h ; - 6226 ; DOS - 3.2+ only - GET DOUBLE BYTE CHARACTER SET LEAD TABLE - 6227 - 6228 00001627 8CDB mov bx,ds ; get segment to bx - 6229 00001629 1F pop ds ; - 6230 0000162A 8936[BA02] mov [Dbcs_Vector_Addr],si ; save address of - 6231 0000162E 891E[BC02] mov [Dbcs_Vector_Addr+2],bx ; dbcs vector - 6232 - 6233 ;mov ax,[16h] - 6234 00001632 A11600 mov ax,[PDB.PARENT_PID] - 6235 ; mov ax,ds:16h ; Init PARENT so we can exit - 6236 00001635 A3[3E02] mov [Parent],ax ; correctly. - 6237 00001638 A10A00 mov ax,[PDB.EXIT] ; mov ax,ds:0Ah - 6238 0000163B A3[4002] mov [OldTerm],ax - 6239 0000163E A10C00 mov ax,[PDB.EXIT+2] ; mov ax,ds:0Ch - 6240 00001641 A3[4202] mov [OldTerm+2],ax - 6241 - 6242 ; 14/01/2023 - 6243 ;;;mov ax,offset ResGroup:EndCode + 15 - 6244 ;;mov ax,1569h ; MSDOS 5.0 COMMAND.COM - 6245 ; 06/06/2023 - 6246 ;mov ax,1679h ; MSDOS 6.22 COMMAND.COM - 6247 ; 18/07/2024 - 6248 ;mov ax,16B3h ; PCDOS 7.1 COMMAND.COM - 6249 - 6250 ;mov ax,EndCode+15 - 6251 ;;mov ax,INITSTART+15 ; 24/09/2018 - 6252 ; 14/01/2023 - 6253 ;mov cl,4 ; ax = size of resident part of - 6254 ;shr ax,cl ; command in paragraphs. Add - 6255 ;mov cx,cs ; this to CS and you get the - 6256 ;add ax,cx ; segment of the TPA. - 6257 - 6258 00001644 8CC8 mov ax,cs - 6259 ; 14/08/2024 - 6260 EndCodeParag equ (ENDCODE+15)>>4 - 6261 ;add ax,(EndCode+15)>>4 - 6262 00001646 056901 add ax,EndCodeParag - 6263 - 6264 00001649 A3[5804] mov [Res_Tpa],ax ; Temporarily save the TPA segment - 6265 0000164C 2500F0 and ax,0F000h - 6266 0000164F 050010 add ax,1000h ; Round up to next 64K boundary - 6267 00001652 7303 jnc short TpaSet ; Memory wrap if carry set - 6268 00001654 A1[5804] mov ax,[Res_Tpa] - 6269 TpaSet: - 6270 00001657 A3[4C04] mov [LTpa],ax ; Good enough for the moment - 6271 ;mov ax,[2] - 6272 0000165A A10200 mov ax,[PDB.BLOCK_LEN] ; ax = # of paras given to command - 6273 - 6274 0000165D 8C1E[5204] mov [MySeg1],ds ; These 3 variables are used as part of - 6275 00001661 8C1E[5604] mov [MySeg2],ds ; 3 long ptrs that the transient will - 6276 00001665 8C1E[4A04] mov [MySeg],ds ; use to call resident routines. - 6277 ; 19/04/2023 - 6278 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1641h - 6279 00001669 8C1E[5607] mov [MySeg3],ds ; segment of msg retriever routine - 6280 - 6281 0000166D A3[9502] mov [MemSiz],ax ; Needed for execing other programs - 6282 - 6283 ; 14/01/2023 - Retro DOS v4.0 COMMAND.COM - 6284 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1648h + 6201 first_com: + 6202 00001608 26C606[9926]01 mov byte [es:FirstCom],1 ; indicate first command.com + 6203 + 6204 init_cntry: + 6205 ; 14/01/2023 + 6206 0000160E 06 push es + 6207 0000160F 1F pop ds + 6208 ;assume ds:RESGROUP + 6209 + 6210 00001610 B465 mov ah,65h + 6211 ;mov ah,GETEXTCNTRY ; get extended country info + 6212 00001612 B004 mov al,4 ; get file ucase table + 6213 00001614 BAFFFF mov dx,-1 ; + 6214 ;mov bx,-1 ; + 6215 00001617 89D3 mov bx,dx + 6216 00001619 B90500 mov cx,5 ; number of bytes we want + 6217 ;mov di,offset resgroup:FUCase_Addr ; buffer for address + 6218 0000161C BF[B502] mov di,FUCase_Addr + 6219 0000161F CD21 int 21h + 6220 ; DOS - 4.x internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION + 6221 ; AL = function - + 6222 + 6223 ; Bugbug: conditionalize dbcs_vector stuff? + 6224 + 6225 00001621 1E push ds ; + 6226 00001622 B80063 mov ax,6300h + 6227 ;mov ax,(ECS_CALL shl 8) or GETLEADBTBL ; + 6228 00001625 CD21 int 21h ; + 6229 ; DOS - 3.2+ only - GET DOUBLE BYTE CHARACTER SET LEAD TABLE + 6230 + 6231 00001627 8CDB mov bx,ds ; get segment to bx + 6232 00001629 1F pop ds ; + 6233 0000162A 8936[BA02] mov [Dbcs_Vector_Addr],si ; save address of + 6234 0000162E 891E[BC02] mov [Dbcs_Vector_Addr+2],bx ; dbcs vector + 6235 + 6236 ;mov ax,[16h] + 6237 00001632 A11600 mov ax,[PDB.PARENT_PID] + 6238 ; mov ax,ds:16h ; Init PARENT so we can exit + 6239 00001635 A3[3E02] mov [Parent],ax ; correctly. + 6240 00001638 A10A00 mov ax,[PDB.EXIT] ; mov ax,ds:0Ah + 6241 0000163B A3[4002] mov [OldTerm],ax + 6242 0000163E A10C00 mov ax,[PDB.EXIT+2] ; mov ax,ds:0Ch + 6243 00001641 A3[4202] mov [OldTerm+2],ax + 6244 + 6245 ; 14/01/2023 + 6246 ;;;mov ax,offset ResGroup:EndCode + 15 + 6247 ;;mov ax,1569h ; MSDOS 5.0 COMMAND.COM + 6248 ; 06/06/2023 + 6249 ;mov ax,1679h ; MSDOS 6.22 COMMAND.COM + 6250 ; 18/07/2024 + 6251 ;mov ax,16B3h ; PCDOS 7.1 COMMAND.COM + 6252 + 6253 ;mov ax,EndCode+15 + 6254 ;;mov ax,INITSTART+15 ; 24/09/2018 + 6255 ; 14/01/2023 + 6256 ;mov cl,4 ; ax = size of resident part of + 6257 ;shr ax,cl ; command in paragraphs. Add + 6258 ;mov cx,cs ; this to CS and you get the + 6259 ;add ax,cx ; segment of the TPA. + 6260 + 6261 00001644 8CC8 mov ax,cs + 6262 ; 14/08/2024 + 6263 EndCodeParag equ (ENDCODE+15)>>4 + 6264 ;add ax,(EndCode+15)>>4 + 6265 00001646 056901 add ax,EndCodeParag + 6266 + 6267 00001649 A3[5804] mov [Res_Tpa],ax ; Temporarily save the TPA segment + 6268 0000164C 2500F0 and ax,0F000h + 6269 0000164F 050010 add ax,1000h ; Round up to next 64K boundary + 6270 00001652 7303 jnc short TpaSet ; Memory wrap if carry set + 6271 00001654 A1[5804] mov ax,[Res_Tpa] + 6272 TpaSet: + 6273 00001657 A3[4C04] mov [LTpa],ax ; Good enough for the moment + 6274 ;mov ax,[2] + 6275 0000165A A10200 mov ax,[PDB.BLOCK_LEN] ; ax = # of paras given to command + 6276 + 6277 0000165D 8C1E[5204] mov [MySeg1],ds ; These 3 variables are used as part of + 6278 00001661 8C1E[5604] mov [MySeg2],ds ; 3 long ptrs that the transient will + 6279 00001665 8C1E[4A04] mov [MySeg],ds ; use to call resident routines. + 6280 ; 19/04/2023 + 6281 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1641h + 6282 00001669 8C1E[5607] mov [MySeg3],ds ; segment of msg retriever routine + 6283 + 6284 0000166D A3[9502] mov [MemSiz],ax ; Needed for execing other programs 6285 - 6286 ; First reallocate the COMMAND size to its memory image - 6287 - 6288 00001670 50 push ax - 6289 ;;;mov bx,2320h ; MSDOS 5.0 COMMAND.COM - 6290 ;;mov bx,offset RESGROUP:TranStart ; - 6291 ;mov bx,TRANSTART - 6292 ;;add bx,98C5h ; MSDOS 5.0 COMMAND.COM - 6293 ;add bx,offset TRANGROUP:TranSpaceEnd; - 6294 ;add bx,15 ; * ; round up the size - 6295 ; 06/06/2023 - 6296 ;mov bx,26E0h ; MSDOS 6.22 COMMAND.COM ; mov bx,offset RESGROUP:TranStart - 6297 ;add bx,0AF95h ; MSDOS 6.22 COMMAND.COM ; add bx,offset TRANGROUP:TranSpaceEnd - 6298 ;add bx,15 ; * ; round up the size - 6299 - 6300 ; 03/05/2023 - 6301 ;mov bx,TRANSTART+15 ; * ; 14/01/2023 - 6302 ;add bx,TRANSPACEEND - 6303 ; 06/06/2023 - 6304 ;mov bx,TRANSTART+TRANSPACEEND+15 - 6305 ;mov cl,4 ; - 6306 ;shr bx,cl ; size of command.com - 6307 00001671 BBDE0C mov bx,(TRANSTART+TRANSPACEEND+15)>>4 - 6308 - 6309 00001674 B44A mov ah,4Ah - 6310 ;mov ah,SETBLOCK ; free all memory above pgm - 6311 00001676 CD21 int 21h ; - 6312 00001678 58 pop ax ; - 6313 - 6314 ; Compute maximum size of environment - 6315 - 6316 ;;mov word [ENVMAX],69 ; = (160/16)+(973/16)-1 ; (11EEh-0E30h+0Fh/10h) = 3Ch - 6317 ;mov word [ENVMAX],((ENVIRONSIZ+15)/16) + ((ENVMAXIMUM-ZERO+15)/16) - 1 - 6318 ; 14/01/2023 - Retro DOS v4.0 COMMAND.COM - 6319 ;mov word [EnvMax],81 ; 10+72-1 ; MSDOS 5.0 COMMAND.COM - 6320 ;mov word [EndMax],90 ; 12+79-1 ; MSDOS 6.22 COMMAND.COM - 6321 ; 22/07/2024 - 6322 ;mov word [EndMax],95 ; - 6323 00001679 C706[8420]5800 mov word [EnvMax],((ENVIRONSIZ+15)/16) + ((EnvMaximum-ZERO+15)/16) - 1 - 6324 ; MSDOS 6.22 ; 12+(((1B53h-1670h)+15)/16)-1 = 90 - 6325 ; PCDOS 7.1 ; ((166+15+)/16)+(1BF5h-16B0h+15)/16)-1 = 95 - 6326 ; - 6327 ; Compute minimum size of environment - 6328 ; - 6329 ;;mov word [EnvSiz],10 ; = 160/16 ; MSDOS 3.3 COMMAND.COM - 6330 ;mov word [EnvSiz],16 ; = 256/16 ; MSDOS 5.0 COMMAND.COM - 6331 0000167F C706[8220]1000 mov word [EnvSiz],ENVSML/16 ; 256/16 - 6332 - 6333 ;;;mov dx,offset TranGroup:Transpaceend + 15 ; dx = size of transient - 6334 ;;mov dx,98D4h ; MSDOS 5.0 COMMAND.COM - 6335 ; 06/06/2023 - 6336 ;;mov dx,0AFA4h ; MSDOS 6.22 COMMAND.COM - 6337 ;mov dx,TRANSPACEEND+15 ; 4D5Ch+0Fh (for MSDOS 3.3 COMMAND.COM) - 6338 ; 22/07/2024 - 6339 ;mov dx,0AAA9h ; PCDOS 7.1 COMMAND.COM (0AA9Ah+0Fh) - 6340 ;mov cl,4 ; in paragraphs. - 6341 ;shr dx,cl - 6342 00001685 BA610A mov dx,(TRANSPACEEND+15)>>4 - 6343 - 6344 00001688 8916[9220] mov [TrnSize],dx ; save size of transient in paragraphs - 6345 - 6346 0000168C 29D0 sub ax,dx ; max seg addr - # para's needed for transient - 6347 0000168E A3[8F02] mov [TrnSeg],ax ; = seg addr to load the transient at. - 6348 ;mov ax,[2Ch] - 6349 00001691 A12C00 mov ax,[PDB.ENVIRON] ; ax = environment segment - 6350 - 6351 ; 14/01/2023 - 6352 ; MSDOS 6.0 - 6353 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 6354 00001694 A3[3A04] mov [EnvirSeg],ax - 6355 - 6356 ; 21/01/2023 - 6357 00001697 09C0 or ax,ax ; if there is no environment segment, - 6358 00001699 7407 jz short buildenv ; make one - 6359 - 6360 ; 21/01/2023 - 6361 ; MSDOS 3.3 & MSDOS 5.0 - 6362 ;;inc byte [CHUCKENV] - 6363 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 6364 ;inc byte [AllocedEnv] ; Flag - old environment segment - 6365 - 6366 ; MSDOS 3.3 & MSDOS 5.0 - 6367 ; 06/06/2023 - 6368 ;jmp short environpassed - 6369 - 6370 ; MSDOS 6.0 - 6371 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 6372 0000169B 803E[9926]00 cmp byte [FirstCom],0 ; if this is the first command.com, - 6373 000016A0 7403 je short environpassed ; do a merge job (make sure COMSPEC exists) - 6374 - 6375 ; MSDOS 6.0 - 6376 - 6377 ; We allocate a buffer here just large enough to hold the 'PATH=' and - 6378 ; the COMSPEC. After parsing, we will allocate an environment of the right - 6379 ; size and free this buffer. We need this buffer because we no longer have an - 6380 ; ENVIRONMENT segment but need a place to store the COMSPEC which can be - 6381 ; given on the command line before we know the environment size. This routine - 6382 ; will not return in case of an allocation error. It will either exit or hang - 6383 ; depending on whether or not this is the first COMMAND.COM or not. - 6384 - 6385 ; 14/01/2023 - 6386 buildenv: - 6387 000016A2 E8E607 call alloc_env ; try to allocate buffer - 6388 environpassed: - 6389 ; 14/01/2023 - MSDOS 5.0 COMMAND.COM - 6390 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 6391 ;mov [EnvirSeg],ax - 6392 ; - 6393 000016A5 8EC0 mov es,ax ; and it load into es. - 6394 ;assume es:nothing - 6395 - 6396 gottheenvir: - 6397 - 6398 ; Initialize the command drive - 6399 - 6400 ; 14/01/2023 - 6401 ; MSDOS 3.3 & MSDOS 6.0 - 6402 000016A7 B419 mov ah,19h - 6403 ;mov ah,GET_DEFAULT_DRIVE ; 19h - 6404 000016A9 CD21 int 21h - 6405 000016AB FEC0 inc al - 6406 000016AD A2[9402] mov [ComDrv],al - 6407 - 6408 ;mov al,byte ptr ds:[FCB] ; al = default drive number for command - 6409 000016B0 A05C00 mov al,[FCB] ; [5Ch] - 6410 000016B3 08C0 or al,al - 6411 000016B5 7433 jz short nocomdrv ; no drive specified - 6412 - 6413 000016B7 B43A mov ah,':' - 6414 000016B9 A2[9402] mov [ComDrv],al - 6415 000016BC 0440 add al,40h ; convert number to uppercase character - 6416 - 6417 000016BE FD std - 6418 - 6419 ; MSDOS 6.0 - 6420 ; 06/06/2023 - 6421 ; MSDOS 6.22 - COMMAND.COM - RESGROUP:17B7h - 6422 000016BF 803E[5420]00 cmp byte [AllocedEnv],0 ; if a new environment is being built, - 6423 000016C4 7420 je short notwidenv ; move the default comspec string in it - 6424 ; 14/01/2023 - 6425 ; MSDOS 5.0 COMMAND.COM - 6426 000016C6 8B3E[6B20] mov di,[ComspOffset] - 6427 000016CA 26807D013A cmp byte [es:di+1],':' ; drive specifier already exist? - 6428 000016CF 7415 je short notwidenv ; yes, must have been inherited that way - 6429 - 6430 ; 06/06/2023 - 6431 ; MSDOS 3.3 - 6432 ;;cmp byte [CHUCKENV],0 - 6433 ;;jne short NOTWIDENV - 6434 ; 21/01/2021 - 6435 ; MSDOS 5.0 - COMMAND.COM - RESGROUP:16A5h - 6436 ;cmp byte [AllocedEnv],0 - 6437 ;ja short notwidenv - 6438 - 6439 000016D1 1E push ds ; 2 bytes to make room for a drivespec. - 6440 000016D2 06 push es ; the drivespec is in ax and is copied - 6441 000016D3 1F pop ds ; on to the front of the string. - 6442 - 6443 ; 06/06/2023 - 6444 %if 0 - 6445 ; 21/01/2023 - 6446 ; 14/01/2023 - 6447 ; MSDOS 5.0 COMMAND.COM - 6448 ; MSDOS 3.3 - 6449 ; 23/09/2018 - 6450 ; 30/04/2018 - 6451 ;mov di,159 - 6452 ;;MOV DI,OFFSET ENVIRONMENT:ECOMSPEC+ENVIRONSIZ2-1-10H - 6453 ;mov di,(ECOMSPEC-ENVIRONMENT)+ENVIRONSIZ2-1 ; mov di,9Fh - 6454 mov di,ENVIRONSIZ-1 ; 21/01/2023 - 6455 ;mov si,157 - 6456 ;;MOV SI,OFFSET ENVIRONMENT:ECOMSPEC+ENVIRONSIZ2-3-10H - 6457 ;mov si,(ECOMSPEC-ENVIRONMENT)+ENVIRONSIZ2-3 ; mov si,9Dh - 6458 mov si,ENVIRONSIZ-3 ; 21/01/2023 - 6459 ;MOV CX,ENVIRONSIZ2-2 ; mov cx,90h - 6460 mov cx,MAX_COMSPEC-2 ; 144 - 6461 %endif - 6462 ; MSDOS 6.0 - 6463 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - RESGROUP:17CCh - 6464 000016D4 8DB58F00 lea si,[di+MAX_COMSPEC-3] ; lea si,[di+143] - 6465 000016D8 8DBD9100 lea di,[di+MAX_COMSPEC-1] ; lea di,[di+145] - 6466 - 6467 000016DC B99000 mov cx,MAX_COMSPEC-2 ; 144 - 6468 - 6469 000016DF F3A4 rep movsb - 6470 000016E1 1F pop ds + 6286 ; 14/01/2023 - Retro DOS v4.0 COMMAND.COM + 6287 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1648h + 6288 + 6289 ; First reallocate the COMMAND size to its memory image + 6290 + 6291 00001670 50 push ax + 6292 ;;;mov bx,2320h ; MSDOS 5.0 COMMAND.COM + 6293 ;;mov bx,offset RESGROUP:TranStart ; + 6294 ;mov bx,TRANSTART + 6295 ;;add bx,98C5h ; MSDOS 5.0 COMMAND.COM + 6296 ;add bx,offset TRANGROUP:TranSpaceEnd; + 6297 ;add bx,15 ; * ; round up the size + 6298 ; 06/06/2023 + 6299 ;mov bx,26E0h ; MSDOS 6.22 COMMAND.COM ; mov bx,offset RESGROUP:TranStart + 6300 ;add bx,0AF95h ; MSDOS 6.22 COMMAND.COM ; add bx,offset TRANGROUP:TranSpaceEnd + 6301 ;add bx,15 ; * ; round up the size + 6302 + 6303 ; 03/05/2023 + 6304 ;mov bx,TRANSTART+15 ; * ; 14/01/2023 + 6305 ;add bx,TRANSPACEEND + 6306 ; 06/06/2023 + 6307 ;mov bx,TRANSTART+TRANSPACEEND+15 + 6308 ;mov cl,4 ; + 6309 ;shr bx,cl ; size of command.com + 6310 00001671 BBDE0C mov bx,(TRANSTART+TRANSPACEEND+15)>>4 + 6311 + 6312 00001674 B44A mov ah,4Ah + 6313 ;mov ah,SETBLOCK ; free all memory above pgm + 6314 00001676 CD21 int 21h ; + 6315 00001678 58 pop ax ; + 6316 + 6317 ; Compute maximum size of environment + 6318 + 6319 ;;mov word [ENVMAX],69 ; = (160/16)+(973/16)-1 ; (11EEh-0E30h+0Fh/10h) = 3Ch + 6320 ;mov word [ENVMAX],((ENVIRONSIZ+15)/16) + ((ENVMAXIMUM-ZERO+15)/16) - 1 + 6321 ; 14/01/2023 - Retro DOS v4.0 COMMAND.COM + 6322 ;mov word [EnvMax],81 ; 10+72-1 ; MSDOS 5.0 COMMAND.COM + 6323 ;mov word [EndMax],90 ; 12+79-1 ; MSDOS 6.22 COMMAND.COM + 6324 ; 22/07/2024 + 6325 ;mov word [EndMax],95 ; + 6326 00001679 C706[8420]5800 mov word [EnvMax],((ENVIRONSIZ+15)/16) + ((EnvMaximum-ZERO+15)/16) - 1 + 6327 ; MSDOS 6.22 ; 12+(((1B53h-1670h)+15)/16)-1 = 90 + 6328 ; PCDOS 7.1 ; ((166+15+)/16)+(1BF5h-16B0h+15)/16)-1 = 95 + 6329 ; + 6330 ; Compute minimum size of environment + 6331 ; + 6332 ;;mov word [EnvSiz],10 ; = 160/16 ; MSDOS 3.3 COMMAND.COM + 6333 ;mov word [EnvSiz],16 ; = 256/16 ; MSDOS 5.0 COMMAND.COM + 6334 0000167F C706[8220]1000 mov word [EnvSiz],ENVSML/16 ; 256/16 + 6335 + 6336 ;;;mov dx,offset TranGroup:Transpaceend + 15 ; dx = size of transient + 6337 ;;mov dx,98D4h ; MSDOS 5.0 COMMAND.COM + 6338 ; 06/06/2023 + 6339 ;;mov dx,0AFA4h ; MSDOS 6.22 COMMAND.COM + 6340 ;mov dx,TRANSPACEEND+15 ; 4D5Ch+0Fh (for MSDOS 3.3 COMMAND.COM) + 6341 ; 22/07/2024 + 6342 ;mov dx,0AAA9h ; PCDOS 7.1 COMMAND.COM (0AA9Ah+0Fh) + 6343 ;mov cl,4 ; in paragraphs. + 6344 ;shr dx,cl + 6345 00001685 BA610A mov dx,(TRANSPACEEND+15)>>4 + 6346 + 6347 00001688 8916[9220] mov [TrnSize],dx ; save size of transient in paragraphs + 6348 + 6349 0000168C 29D0 sub ax,dx ; max seg addr - # para's needed for transient + 6350 0000168E A3[8F02] mov [TrnSeg],ax ; = seg addr to load the transient at. + 6351 ;mov ax,[2Ch] + 6352 00001691 A12C00 mov ax,[PDB.ENVIRON] ; ax = environment segment + 6353 + 6354 ; 14/01/2023 + 6355 ; MSDOS 6.0 + 6356 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 6357 00001694 A3[3A04] mov [EnvirSeg],ax + 6358 + 6359 ; 21/01/2023 + 6360 00001697 09C0 or ax,ax ; if there is no environment segment, + 6361 00001699 7407 jz short buildenv ; make one + 6362 + 6363 ; 21/01/2023 + 6364 ; MSDOS 3.3 & MSDOS 5.0 + 6365 ;;inc byte [CHUCKENV] + 6366 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 6367 ;inc byte [AllocedEnv] ; Flag - old environment segment + 6368 + 6369 ; MSDOS 3.3 & MSDOS 5.0 + 6370 ; 06/06/2023 + 6371 ;jmp short environpassed + 6372 + 6373 ; MSDOS 6.0 + 6374 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 6375 0000169B 803E[9926]00 cmp byte [FirstCom],0 ; if this is the first command.com, + 6376 000016A0 7403 je short environpassed ; do a merge job (make sure COMSPEC exists) + 6377 + 6378 ; MSDOS 6.0 + 6379 + 6380 ; We allocate a buffer here just large enough to hold the 'PATH=' and + 6381 ; the COMSPEC. After parsing, we will allocate an environment of the right + 6382 ; size and free this buffer. We need this buffer because we no longer have an + 6383 ; ENVIRONMENT segment but need a place to store the COMSPEC which can be + 6384 ; given on the command line before we know the environment size. This routine + 6385 ; will not return in case of an allocation error. It will either exit or hang + 6386 ; depending on whether or not this is the first COMMAND.COM or not. + 6387 + 6388 ; 14/01/2023 + 6389 buildenv: + 6390 000016A2 E8E607 call alloc_env ; try to allocate buffer + 6391 environpassed: + 6392 ; 14/01/2023 - MSDOS 5.0 COMMAND.COM + 6393 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 6394 ;mov [EnvirSeg],ax + 6395 ; + 6396 000016A5 8EC0 mov es,ax ; and it load into es. + 6397 ;assume es:nothing + 6398 + 6399 gottheenvir: + 6400 + 6401 ; Initialize the command drive + 6402 + 6403 ; 14/01/2023 + 6404 ; MSDOS 3.3 & MSDOS 6.0 + 6405 000016A7 B419 mov ah,19h + 6406 ;mov ah,GET_DEFAULT_DRIVE ; 19h + 6407 000016A9 CD21 int 21h + 6408 000016AB FEC0 inc al + 6409 000016AD A2[9402] mov [ComDrv],al + 6410 + 6411 ;mov al,byte ptr ds:[FCB] ; al = default drive number for command + 6412 000016B0 A05C00 mov al,[FCB] ; [5Ch] + 6413 000016B3 08C0 or al,al + 6414 000016B5 7433 jz short nocomdrv ; no drive specified + 6415 + 6416 000016B7 B43A mov ah,':' + 6417 000016B9 A2[9402] mov [ComDrv],al + 6418 000016BC 0440 add al,40h ; convert number to uppercase character + 6419 + 6420 000016BE FD std + 6421 + 6422 ; MSDOS 6.0 + 6423 ; 06/06/2023 + 6424 ; MSDOS 6.22 - COMMAND.COM - RESGROUP:17B7h + 6425 000016BF 803E[5420]00 cmp byte [AllocedEnv],0 ; if a new environment is being built, + 6426 000016C4 7420 je short notwidenv ; move the default comspec string in it + 6427 ; 14/01/2023 + 6428 ; MSDOS 5.0 COMMAND.COM + 6429 000016C6 8B3E[6B20] mov di,[ComspOffset] + 6430 000016CA 26807D013A cmp byte [es:di+1],':' ; drive specifier already exist? + 6431 000016CF 7415 je short notwidenv ; yes, must have been inherited that way + 6432 + 6433 ; 06/06/2023 + 6434 ; MSDOS 3.3 + 6435 ;;cmp byte [CHUCKENV],0 + 6436 ;;jne short NOTWIDENV + 6437 ; 21/01/2021 + 6438 ; MSDOS 5.0 - COMMAND.COM - RESGROUP:16A5h + 6439 ;cmp byte [AllocedEnv],0 + 6440 ;ja short notwidenv + 6441 + 6442 000016D1 1E push ds ; 2 bytes to make room for a drivespec. + 6443 000016D2 06 push es ; the drivespec is in ax and is copied + 6444 000016D3 1F pop ds ; on to the front of the string. + 6445 + 6446 ; 06/06/2023 + 6447 %if 0 + 6448 ; 21/01/2023 + 6449 ; 14/01/2023 + 6450 ; MSDOS 5.0 COMMAND.COM + 6451 ; MSDOS 3.3 + 6452 ; 23/09/2018 + 6453 ; 30/04/2018 + 6454 ;mov di,159 + 6455 ;;MOV DI,OFFSET ENVIRONMENT:ECOMSPEC+ENVIRONSIZ2-1-10H + 6456 ;mov di,(ECOMSPEC-ENVIRONMENT)+ENVIRONSIZ2-1 ; mov di,9Fh + 6457 mov di,ENVIRONSIZ-1 ; 21/01/2023 + 6458 ;mov si,157 + 6459 ;;MOV SI,OFFSET ENVIRONMENT:ECOMSPEC+ENVIRONSIZ2-3-10H + 6460 ;mov si,(ECOMSPEC-ENVIRONMENT)+ENVIRONSIZ2-3 ; mov si,9Dh + 6461 mov si,ENVIRONSIZ-3 ; 21/01/2023 + 6462 ;MOV CX,ENVIRONSIZ2-2 ; mov cx,90h + 6463 mov cx,MAX_COMSPEC-2 ; 144 + 6464 %endif + 6465 ; MSDOS 6.0 + 6466 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - RESGROUP:17CCh + 6467 000016D4 8DB58F00 lea si,[di+MAX_COMSPEC-3] ; lea si,[di+143] + 6468 000016D8 8DBD9100 lea di,[di+MAX_COMSPEC-1] ; lea di,[di+145] + 6469 + 6470 000016DC B99000 mov cx,MAX_COMSPEC-2 ; 144 6471 - 6472 ; MSDOS 6.0 - 6473 ; 06/06/2023 - 6474 000016E2 268945FF mov [es:di-1],ax - 6475 - 6476 ; MSDOS 3.3 - 6477 ;mov [es:0Eh],ax - 6478 ;;;MOV WORD PTR ES:[ECOMSPEC-10H],AX - 6479 ;;MOV [es:(ECOMSPEC-ENVIRONMENT)],ax ; mov [es:0Eh],ax - 6480 ; 14/01/2023 - 6481 ; 06/06/2023 - 6482 ;mov [es:ECOMSPEC],ax ; mov [es:0Eh],ax - 6483 - 6484 ; MSDOS 3.3 & MSDOS 6.0 - 6485 notwidenv: - 6486 000016E6 FC cld - 6487 000016E7 A3[3620] mov [AUTOBAT],ax ; db 0,":\AUTOEXEC.BAT" - 6488 - 6489 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 6490 %if 0 - 6491 ; 14/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM - 6492 ; (MSDOS 5.0 COMMAND.COM RESGROUP:16C3h) - 6493 ; 06/06/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM - 6494 mov [KAUTOBAT],ax ; db 0,":\AUTOEXEC.BAT" - 6495 %endif - 6496 - 6497 nocomdrv: - 6498 000016EA E841FA call SetVect ; Set the vectors + 6472 000016DF F3A4 rep movsb + 6473 000016E1 1F pop ds + 6474 + 6475 ; MSDOS 6.0 + 6476 ; 06/06/2023 + 6477 000016E2 268945FF mov [es:di-1],ax + 6478 + 6479 ; MSDOS 3.3 + 6480 ;mov [es:0Eh],ax + 6481 ;;;MOV WORD PTR ES:[ECOMSPEC-10H],AX + 6482 ;;MOV [es:(ECOMSPEC-ENVIRONMENT)],ax ; mov [es:0Eh],ax + 6483 ; 14/01/2023 + 6484 ; 06/06/2023 + 6485 ;mov [es:ECOMSPEC],ax ; mov [es:0Eh],ax + 6486 + 6487 ; MSDOS 3.3 & MSDOS 6.0 + 6488 notwidenv: + 6489 000016E6 FC cld + 6490 000016E7 A3[3620] mov [AUTOBAT],ax ; db 0,":\AUTOEXEC.BAT" + 6491 + 6492 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 6493 %if 0 + 6494 ; 14/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM + 6495 ; (MSDOS 5.0 COMMAND.COM RESGROUP:16C3h) + 6496 ; 06/06/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM + 6497 mov [KAUTOBAT],ax ; db 0,":\AUTOEXEC.BAT" + 6498 %endif 6499 - 6500 ; parsing starts here - 6501 - 6502 ; 14/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM - 6503 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:16C9h - CODERES:0989h) - 6504 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 6505 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:17E8h - CODERES:0998h) - 6506 ; MSDOS 6.0 - 6507 000016ED 0E push cs - 6508 000016EE 0E push cs - 6509 000016EF 1F pop ds - 6510 000016F0 07 pop es - 6511 ;assume ds:ResGroup,es:ResGroup - 6512 - 6513 000016F1 BE8000 mov si,80h ; get command line - 6514 000016F4 AC lodsb ; get length of line - 6515 000016F5 89F7 mov di,si ; get line position in di - 6516 000016F7 30E4 xor ah,ah ; ax = length of command line - 6517 - 6518 ; insure that the command line correctly ends with a cr - 6519 - 6520 000016F9 01C7 add di,ax ; go to end of command line - 6521 000016FB C6050D mov byte [di],0Dh ; insert a carriage return - 6522 000016FE 31C9 xor cx,cx ; clear cx - 6523 00001700 890E[5F21] mov [num_positionals],cx ; initialize positionals - 6524 - 6525 ; Scan the command line looking for the parameters - 6526 - 6527 Parse_command_line: - 6528 ;mov di,offset ResGroup:Parse_Command; Get address of parse_command - 6529 00001704 BF[9920] mov di,PARSE_COMMAND - 6530 00001707 8B0E[5F21] mov cx,[num_positionals] ; Get number of positionals - 6531 0000170B 31D2 xor dx,dx ; clear dx - 6532 0000170D 8936[6121] mov [old_parse_ptr],si ; save position before calling parser - 6533 ;call dword ptr Init_Parse - 6534 00001711 FF1E[8E20] call far [Init_Parse] ; call parser - 6535 00001715 890E[5F21] mov [num_positionals],cx ; Save number of positionals - 6536 ; 29/01/2023 - 6537 ;;cmp ax,END_OF_LINE ; 0FFFFh ; -1 ; are we at end of line? - 6538 ;cmp ax,-1 - 6539 ;jne short t1 - 6540 ; 10/06/2023 - 6541 00001719 40 inc ax ; cmp ax,-1 - 6542 0000171A 7503 jnz short t1 ; 0FFFFh -> 0 - 6543 ; ax = 0 - 6544 0000171C E99502 jmp ArgsDone ; yes - exit - 6545 t1: - 6546 ;;cmp ax,RESULT_NO_ERROR ; 0 ; did an error occur - 6547 ;;cmp ax,0 - 6548 ;and ax,ax - 6549 ; 10/06/2023 - 6550 0000171F 48 dec ax ; cmp ax,0 - 6551 00001720 7468 jz short parse_cont ; 1 -> 0 ; no - continue - 6552 - 6553 ; Before issuing error message - make sure switch is not /C - 6554 - 6555 parse_line_error: - 6556 ; 14/01/2023 - 6557 ;push si ; save line position - 6558 ;push ax ; save error number - 6559 ;cmp ax,3 - 6560 00001722 83F803 cmp ax,BadSwt_Ptr ; 3 ; Was error invalid switch? - 6561 ;jnz short parse_line_error_disp ; No - just issue message - 6562 00001725 7538 jne short parse_line_error_disp2 - 6563 00001727 56 push si ; ** ; save line position - 6564 00001728 50 push ax ; * ; save error number - 6565 00001729 89F7 mov di,si ; Get terminating pointer in DI - 6566 0000172B 8B36[6121] mov si,[old_parse_ptr] ; Get starting pointer in SI - 6567 - 6568 init_chk_delim: - 6569 0000172F 39FE cmp si,di ; at end of parsed parameter? - 6570 00001731 742A je short parse_line_error_disp ; Yes - just display message - 6571 00001733 AC lodsb ; - 6572 00001734 3C20 cmp al,20h ; ' ' ; 16/04/2023 - 6573 ;cmp al,space_chr ; 14/01/2023 - 6574 ;;cmp al,[space] ; Skip blank spaces - 6575 00001736 74F7 je short init_chk_delim ; - 6576 ;cmp al,9 - 6577 00001738 3C09 cmp al,tab_chr ; 9 ; Skip tab characters - 6578 0000173A 74F3 je short init_chk_delim ; - 6579 - 6580 0000173C 3A06[4E04] cmp al,[RSwitChar] ; '/' ; Switch? - 6581 00001740 751B jne short parse_line_error_disp ; No - just issue message - 6582 00001742 AC lodsb ; Get the char after the switch - 6583 - 6584 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 6585 ;ifdef DBCS - 6586 %if 1 - 6587 00001743 E837FD call ITestKanj ; Is it DBCS? - 6588 00001746 7515 jnz short parse_line_error_disp ; Yes - can't be /C or /K - 6589 %endif - 6590 ;endif - 6591 00001748 E8D505 call iupconv ; upper case it - 6592 - 6593 ;cmp al,[scswitch] ; 'C' ; it is /C? - 6594 ;jne short check_k_too ; MSDOS 6.0 ; - 6595 ; 16/04/2023 - 6596 0000174B 3C43 cmp al,'C' ; scswitch - 6597 ;jne short parse_line_error_disp ; MSDOS 5.0 COMMAND.COM - 6598 ; 06/06/2023 - 6599 ; MSDOS 6.22 COMMAND.COM - 6600 0000174D 7505 jne short check_k_too - 6601 0000174F 5A pop dx ; * ; even up stack - 6602 00001750 5A pop dx ; ** ; even up stack - 6603 00001751 E9D100 jmp SetSSwitch ; Yes - go set COMMAND /C - 6604 - 6605 ; MSDOS 6.0 - 6606 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 6607 check_k_too: - 6608 ;cmp al,[skswitch] ; 'K' ; it is /K? - 6609 ;jne short parse_line_error_disp ; - 6610 ; 06/06/2023 - 6611 00001754 3C4B cmp al,'K' - 6612 00001756 7505 jne short parse_line_error_disp - 6613 00001758 5A pop dx ; * ; even up stack - 6614 00001759 5A pop dx ; ** ; even up stack - 6615 0000175A E9C100 jmp SetKSwitch ; Yes - go set COMMAND /K - 6616 - 6617 parse_line_error_disp: - 6618 ; 14/01/2023 - 6619 0000175D 58 pop ax ; * ; restore error number - 6620 0000175E 5E pop si ; ** ; restore line position - 6621 parse_line_error_disp2: - 6622 0000175F 89C2 mov dx,ax ; get message number - 6623 00001761 E84C05 call RPrintParse - 6624 00001764 E871FC call crlf - 6625 00001767 EB9B jmp short Parse_command_line ; continue parsing - 6626 - 6627 ; 22/07/2024 - 6628 - 6629 ;CHECKDSWITCH: - 6630 ;;cmp al,'d' - 6631 ;cmp al,[letter_d] - 6632 ;jnz short CHECKCSWITCH - 6633 - 6634 ; 16/04/2023 - 6635 %if 1 - 6636 SetMSwitch: - 6637 ;cmp byte [ext_msg],1 - 6638 00001769 803E[9420]01 cmp byte [ext_msg],SET_EXTENDED_MSG ; has /MSG switch been set? - 6639 ; 16/04/2023 - 6640 ;jnz short setMswitchok ; no - set it - 6641 ;;mov ax,1 - 6642 ;mov ax,MoreArgs_Ptr ; set up too many arguments - 6643 ;jmp parse_line_error ; go issue error message - 6644 ; 16/04/2023 - 6645 0000176E 747C je short parse_line_error_j - 6646 setMswitchok: - 6647 ;mov byte [ext_msg],1 - 6648 00001770 C606[9420]01 mov byte [ext_msg],SET_EXTENDED_MSG ; set /MSG switch - 6649 ; 06/06/2023 - 6650 00001775 EB8D jmp short Parse_command_line ; keep parsing - 6651 %endif - 6652 - 6653 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 6654 - 6655 SetDSwitch: - 6656 - 6657 ; Flag no date/time prompting. - 6658 - 6659 ; MSDOS 6.0 - 6660 00001777 803E[9620]00 cmp byte [dswitch],0 ; has /D switch been set? - 6661 ; 16/04/2023 - 6662 ;jz short setdateok ; no - set it - 6663 ;;mov ax,1 - 6664 ;mov ax,MoreArgs_Ptr ; set up too many arguments - 6665 ;jmp parse_line_error ; go issue error message - 6666 ; 16/04/2023 - 6667 0000177C 756E jnz short parse_line_error_j - 6668 setdateok: - 6669 0000177E FE06[9620] inc byte [dswitch] ; indicate /D entered - 6670 - 6671 ; MSDOS 3.3 & MSDOS 6.0 - 6672 00001782 C606[4720]01 mov byte [PRDATTM],1 ; User explicitly says no date time - 6673 ; MSDOS 3.3 - 6674 ;jmp short CHKARG - 6675 ; MSDOS 6.0 - 6676 00001787 E97AFF jmp Parse_command_line ; continue parsing - 6677 - 6678 parse_cont: - 6679 ; 15/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM - 6680 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:173Ch - CODERES:09FCh) - 6681 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 6682 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:1869h - CODERES:0A19h) - 6683 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 6684 ; PCDOS 7.1 COMMAND.COM - RESGROUP:18AEh - 6685 - 6686 ; MSDOS 6.0 - 6687 - 6688 ; See if a switch was entered - 6689 ; - 6690 ; Bugbug: See if Comnd1_Syn can be moved into a reg. before the compare - 6691 - 6692 0000178A 813E[5821][D820] cmp word [COMND1_SYN],COMMAND_F_SYN ; was /F entered? - 6693 00001790 7460 je short SetFSwitch ; yes go set fail switch - 6694 00001792 813E[5821][CC20] cmp word [COMND1_SYN],COMMAND_P_SYN ; was /P entered? - 6695 00001798 744B je short SetPSwitch ; yes go set up PERMCOM - 6696 0000179A 813E[5821][E420] cmp word [COMND1_SYN],COMMAND_D_SYN ; was /D entered? - 6697 000017A0 74D5 je short SetDSwitch ; yes go set date switch - 6698 000017A2 813E[5821][0921] cmp word [COMND1_SYN],COMMAND_C_SYN ; was /C entered? - 6699 000017A8 747B je short SetSSwitch ; yes go set up SINGLECOM - 6700 ; 06/06/2023 - 6701 ; MSDOS 6.0 only! - 6702 000017AA 813E[5821][2F21] cmp word [COMND1_SYN],COMMAND_K_SYN ; was /K entered? - 6703 000017B0 746C je short SetKSwitch ; yes go set up SINGLECOM - 6704 ; - 6705 000017B2 813E[5821][F020] cmp word [COMND1_SYN],COMMAND_E_SYN ; was /E entered? - 6706 000017B8 747C je short SetESwitch ; yes go set up environment - 6707 - 6708 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 6709 ; PCDOS 7.1 COMMAND.COM - 6710 %if 1 - 6711 000017BA 813E[5821][3B21] cmp word [COMND1_SYN],COMMAND_Y_SYN ; was /Y entered? - 6712 ;je short SetYSwitch ; yes (step switch) - 6713 ; 22/07/2024 - 6714 000017C0 7508 jne short parse_cont_@ - 6715 - 6716 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19C3h - 6717 SetYSwitch: - 6718 000017C2 800E[5A04]10 or byte [Y_Flag], 10h - 6719 000017C7 E93AFF jmp Parse_command_line - 6720 - 6721 parse_cont_@: - 6722 %endif - 6723 000017CA 813E[5821][1521] cmp word [COMND1_SYN],COMMAND_M_SYN ; was /MSG entered? - 6724 ;je short SetMSwitchjmp ; yes go set up message flag - 6725 ; 15/01/2023 - 6726 000017D0 7497 je short SetMSwitch - 6727 - 6728 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 6729 ; PCDOS 7.1 COMMAND.COM - RESGROUP:18FDh - 6730 %if 1 - 6731 000017D2 813E[5821][4721] cmp word [COMND1_SYN],COMMAND_H_SYN ; was /H entered? - 6732 000017D8 747A je short SetHSwitch ; yes (load into UMB switch) - 6733 000017DA 813E[5821][5321] cmp word [COMND1_SYN],COMMAND_O_SYN ; was /O entered? - 6734 000017E0 747F je short SetOSwitch ; yes (disable overwrite prompt) - 6735 %endif - 6736 000017E2 E99800 jmp ChkOtherArgs ; Must be something else - 6737 - 6738 ; MSDOS 6.0 - 6739 ;SetMSwitchjmp: - 6740 ;jmp SetMSwitch - 6741 - 6742 ; 22/07/2024 - 6743 %if 1 - 6744 SetPSwitch: - 6745 - 6746 ; We have a permanent COMMAND switch /P. Flag this and stash the - 6747 ; termination address. + 6500 nocomdrv: + 6501 000016EA E841FA call SetVect ; Set the vectors + 6502 + 6503 ; parsing starts here + 6504 + 6505 ; 14/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM + 6506 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:16C9h - CODERES:0989h) + 6507 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 6508 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:17E8h - CODERES:0998h) + 6509 ; MSDOS 6.0 + 6510 000016ED 0E push cs + 6511 000016EE 0E push cs + 6512 000016EF 1F pop ds + 6513 000016F0 07 pop es + 6514 ;assume ds:ResGroup,es:ResGroup + 6515 + 6516 000016F1 BE8000 mov si,80h ; get command line + 6517 000016F4 AC lodsb ; get length of line + 6518 000016F5 89F7 mov di,si ; get line position in di + 6519 000016F7 30E4 xor ah,ah ; ax = length of command line + 6520 + 6521 ; insure that the command line correctly ends with a cr + 6522 + 6523 000016F9 01C7 add di,ax ; go to end of command line + 6524 000016FB C6050D mov byte [di],0Dh ; insert a carriage return + 6525 000016FE 31C9 xor cx,cx ; clear cx + 6526 00001700 890E[5F21] mov [num_positionals],cx ; initialize positionals + 6527 + 6528 ; Scan the command line looking for the parameters + 6529 + 6530 Parse_command_line: + 6531 ;mov di,offset ResGroup:Parse_Command; Get address of parse_command + 6532 00001704 BF[9920] mov di,PARSE_COMMAND + 6533 00001707 8B0E[5F21] mov cx,[num_positionals] ; Get number of positionals + 6534 0000170B 31D2 xor dx,dx ; clear dx + 6535 0000170D 8936[6121] mov [old_parse_ptr],si ; save position before calling parser + 6536 ;call dword ptr Init_Parse + 6537 00001711 FF1E[8E20] call far [Init_Parse] ; call parser + 6538 00001715 890E[5F21] mov [num_positionals],cx ; Save number of positionals + 6539 ; 29/01/2023 + 6540 ;;cmp ax,END_OF_LINE ; 0FFFFh ; -1 ; are we at end of line? + 6541 ;cmp ax,-1 + 6542 ;jne short t1 + 6543 ; 10/06/2023 + 6544 00001719 40 inc ax ; cmp ax,-1 + 6545 0000171A 7503 jnz short t1 ; 0FFFFh -> 0 + 6546 ; ax = 0 + 6547 0000171C E99502 jmp ArgsDone ; yes - exit + 6548 t1: + 6549 ;;cmp ax,RESULT_NO_ERROR ; 0 ; did an error occur + 6550 ;;cmp ax,0 + 6551 ;and ax,ax + 6552 ; 10/06/2023 + 6553 0000171F 48 dec ax ; cmp ax,0 + 6554 00001720 7468 jz short parse_cont ; 1 -> 0 ; no - continue + 6555 + 6556 ; Before issuing error message - make sure switch is not /C + 6557 + 6558 parse_line_error: + 6559 ; 14/01/2023 + 6560 ;push si ; save line position + 6561 ;push ax ; save error number + 6562 ;cmp ax,3 + 6563 00001722 83F803 cmp ax,BadSwt_Ptr ; 3 ; Was error invalid switch? + 6564 ;jnz short parse_line_error_disp ; No - just issue message + 6565 00001725 7538 jne short parse_line_error_disp2 + 6566 00001727 56 push si ; ** ; save line position + 6567 00001728 50 push ax ; * ; save error number + 6568 00001729 89F7 mov di,si ; Get terminating pointer in DI + 6569 0000172B 8B36[6121] mov si,[old_parse_ptr] ; Get starting pointer in SI + 6570 + 6571 init_chk_delim: + 6572 0000172F 39FE cmp si,di ; at end of parsed parameter? + 6573 00001731 742A je short parse_line_error_disp ; Yes - just display message + 6574 00001733 AC lodsb ; + 6575 00001734 3C20 cmp al,20h ; ' ' ; 16/04/2023 + 6576 ;cmp al,space_chr ; 14/01/2023 + 6577 ;;cmp al,[space] ; Skip blank spaces + 6578 00001736 74F7 je short init_chk_delim ; + 6579 ;cmp al,9 + 6580 00001738 3C09 cmp al,tab_chr ; 9 ; Skip tab characters + 6581 0000173A 74F3 je short init_chk_delim ; + 6582 + 6583 0000173C 3A06[4E04] cmp al,[RSwitChar] ; '/' ; Switch? + 6584 00001740 751B jne short parse_line_error_disp ; No - just issue message + 6585 00001742 AC lodsb ; Get the char after the switch + 6586 + 6587 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 6588 ;ifdef DBCS + 6589 %if 1 + 6590 00001743 E837FD call ITestKanj ; Is it DBCS? + 6591 00001746 7515 jnz short parse_line_error_disp ; Yes - can't be /C or /K + 6592 %endif + 6593 ;endif + 6594 00001748 E8D505 call iupconv ; upper case it + 6595 + 6596 ;cmp al,[scswitch] ; 'C' ; it is /C? + 6597 ;jne short check_k_too ; MSDOS 6.0 ; + 6598 ; 16/04/2023 + 6599 0000174B 3C43 cmp al,'C' ; scswitch + 6600 ;jne short parse_line_error_disp ; MSDOS 5.0 COMMAND.COM + 6601 ; 06/06/2023 + 6602 ; MSDOS 6.22 COMMAND.COM + 6603 0000174D 7505 jne short check_k_too + 6604 0000174F 5A pop dx ; * ; even up stack + 6605 00001750 5A pop dx ; ** ; even up stack + 6606 00001751 E9D100 jmp SetSSwitch ; Yes - go set COMMAND /C + 6607 + 6608 ; MSDOS 6.0 + 6609 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 6610 check_k_too: + 6611 ;cmp al,[skswitch] ; 'K' ; it is /K? + 6612 ;jne short parse_line_error_disp ; + 6613 ; 06/06/2023 + 6614 00001754 3C4B cmp al,'K' + 6615 00001756 7505 jne short parse_line_error_disp + 6616 00001758 5A pop dx ; * ; even up stack + 6617 00001759 5A pop dx ; ** ; even up stack + 6618 0000175A E9C100 jmp SetKSwitch ; Yes - go set COMMAND /K + 6619 + 6620 parse_line_error_disp: + 6621 ; 14/01/2023 + 6622 0000175D 58 pop ax ; * ; restore error number + 6623 0000175E 5E pop si ; ** ; restore line position + 6624 parse_line_error_disp2: + 6625 0000175F 89C2 mov dx,ax ; get message number + 6626 00001761 E84C05 call RPrintParse + 6627 00001764 E871FC call crlf + 6628 00001767 EB9B jmp short Parse_command_line ; continue parsing + 6629 + 6630 ; 22/07/2024 + 6631 + 6632 ;CHECKDSWITCH: + 6633 ;;cmp al,'d' + 6634 ;cmp al,[letter_d] + 6635 ;jnz short CHECKCSWITCH + 6636 + 6637 ; 16/04/2023 + 6638 %if 1 + 6639 SetMSwitch: + 6640 ;cmp byte [ext_msg],1 + 6641 00001769 803E[9420]01 cmp byte [ext_msg],SET_EXTENDED_MSG ; has /MSG switch been set? + 6642 ; 16/04/2023 + 6643 ;jnz short setMswitchok ; no - set it + 6644 ;;mov ax,1 + 6645 ;mov ax,MoreArgs_Ptr ; set up too many arguments + 6646 ;jmp parse_line_error ; go issue error message + 6647 ; 16/04/2023 + 6648 0000176E 747C je short parse_line_error_j + 6649 setMswitchok: + 6650 ;mov byte [ext_msg],1 + 6651 00001770 C606[9420]01 mov byte [ext_msg],SET_EXTENDED_MSG ; set /MSG switch + 6652 ; 06/06/2023 + 6653 00001775 EB8D jmp short Parse_command_line ; keep parsing + 6654 %endif + 6655 + 6656 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 6657 + 6658 SetDSwitch: + 6659 + 6660 ; Flag no date/time prompting. + 6661 + 6662 ; MSDOS 6.0 + 6663 00001777 803E[9620]00 cmp byte [dswitch],0 ; has /D switch been set? + 6664 ; 16/04/2023 + 6665 ;jz short setdateok ; no - set it + 6666 ;;mov ax,1 + 6667 ;mov ax,MoreArgs_Ptr ; set up too many arguments + 6668 ;jmp parse_line_error ; go issue error message + 6669 ; 16/04/2023 + 6670 0000177C 756E jnz short parse_line_error_j + 6671 setdateok: + 6672 0000177E FE06[9620] inc byte [dswitch] ; indicate /D entered + 6673 + 6674 ; MSDOS 3.3 & MSDOS 6.0 + 6675 00001782 C606[4720]01 mov byte [PRDATTM],1 ; User explicitly says no date time + 6676 ; MSDOS 3.3 + 6677 ;jmp short CHKARG + 6678 ; MSDOS 6.0 + 6679 00001787 E97AFF jmp Parse_command_line ; continue parsing + 6680 + 6681 parse_cont: + 6682 ; 15/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM + 6683 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:173Ch - CODERES:09FCh) + 6684 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 6685 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:1869h - CODERES:0A19h) + 6686 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 6687 ; PCDOS 7.1 COMMAND.COM - RESGROUP:18AEh + 6688 + 6689 ; MSDOS 6.0 + 6690 + 6691 ; See if a switch was entered + 6692 ; + 6693 ; Bugbug: See if Comnd1_Syn can be moved into a reg. before the compare + 6694 + 6695 0000178A 813E[5821][D820] cmp word [COMND1_SYN],COMMAND_F_SYN ; was /F entered? + 6696 00001790 7460 je short SetFSwitch ; yes go set fail switch + 6697 00001792 813E[5821][CC20] cmp word [COMND1_SYN],COMMAND_P_SYN ; was /P entered? + 6698 00001798 744B je short SetPSwitch ; yes go set up PERMCOM + 6699 0000179A 813E[5821][E420] cmp word [COMND1_SYN],COMMAND_D_SYN ; was /D entered? + 6700 000017A0 74D5 je short SetDSwitch ; yes go set date switch + 6701 000017A2 813E[5821][0921] cmp word [COMND1_SYN],COMMAND_C_SYN ; was /C entered? + 6702 000017A8 747B je short SetSSwitch ; yes go set up SINGLECOM + 6703 ; 06/06/2023 + 6704 ; MSDOS 6.0 only! + 6705 000017AA 813E[5821][2F21] cmp word [COMND1_SYN],COMMAND_K_SYN ; was /K entered? + 6706 000017B0 746C je short SetKSwitch ; yes go set up SINGLECOM + 6707 ; + 6708 000017B2 813E[5821][F020] cmp word [COMND1_SYN],COMMAND_E_SYN ; was /E entered? + 6709 000017B8 747C je short SetESwitch ; yes go set up environment + 6710 + 6711 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 6712 ; PCDOS 7.1 COMMAND.COM + 6713 %if 1 + 6714 000017BA 813E[5821][3B21] cmp word [COMND1_SYN],COMMAND_Y_SYN ; was /Y entered? + 6715 ;je short SetYSwitch ; yes (step switch) + 6716 ; 22/07/2024 + 6717 000017C0 7508 jne short parse_cont_@ + 6718 + 6719 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19C3h + 6720 SetYSwitch: + 6721 000017C2 800E[5A04]10 or byte [Y_Flag], 10h + 6722 000017C7 E93AFF jmp Parse_command_line + 6723 + 6724 parse_cont_@: + 6725 %endif + 6726 000017CA 813E[5821][1521] cmp word [COMND1_SYN],COMMAND_M_SYN ; was /MSG entered? + 6727 ;je short SetMSwitchjmp ; yes go set up message flag + 6728 ; 15/01/2023 + 6729 000017D0 7497 je short SetMSwitch + 6730 + 6731 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 6732 ; PCDOS 7.1 COMMAND.COM - RESGROUP:18FDh + 6733 %if 1 + 6734 000017D2 813E[5821][4721] cmp word [COMND1_SYN],COMMAND_H_SYN ; was /H entered? + 6735 000017D8 747A je short SetHSwitch ; yes (load into UMB switch) + 6736 000017DA 813E[5821][5321] cmp word [COMND1_SYN],COMMAND_O_SYN ; was /O entered? + 6737 000017E0 747F je short SetOSwitch ; yes (disable overwrite prompt) + 6738 %endif + 6739 000017E2 E99800 jmp ChkOtherArgs ; Must be something else + 6740 + 6741 ; MSDOS 6.0 + 6742 ;SetMSwitchjmp: + 6743 ;jmp SetMSwitch + 6744 + 6745 ; 22/07/2024 + 6746 %if 1 + 6747 SetPSwitch: 6748 - 6749 ; MSDOS 6.0 - 6750 000017E5 803E[A202]00 cmp byte [PermCom],0 ; has /p switch been set? - 6751 000017EA 7415 jz short permcomok ; no - set it - 6752 ; 16/04/2023 - 6753 parse_line_error_j: - 6754 ;mov ax,1 - 6755 000017EC B80100 mov ax,MoreArgs_Ptr ; set up too many arguments - 6756 000017EF E930FF jmp parse_line_error ; go issue error - 6757 %endif - 6758 - 6759 ; MSDOS 6.0 - 6760 SetFSwitch: - 6761 000017F2 803E[A902]FF cmp byte [fFail],-1 ; has fail switch been set? - 6762 ; 16/04/2023 - 6763 ;jne short failok ; no - set it - 6764 ;;mov ax,1 - 6765 ;mov ax,MoreArgs_Ptr ; set up too many arguments - 6766 ;jmp parse_line_error ; go issue error - 6767 ; 16/04/2023 - 6768 000017F7 74F3 je short parse_line_error_j - 6769 - 6770 ; MSDOS 3.3 & MSDOS 6.0 - 6771 failok: - 6772 000017F9 C606[A902]FF mov byte [fFail],-1 ; fail all INT 24s. - 6773 ; MSDOS 3.3 - 6774 ;jmp short CHKARG - 6775 ; MSDOS 6.0 - 6776 000017FE E903FF jmp Parse_command_line - 6777 - 6778 ;CHECKPSWITCH: - 6779 ;;cmp al,'p' ; Permanent COMMAND switch - 6780 ;cmp al,[letter_p] - 6781 ;jnz short CHECKDSWITCH - 6782 - 6783 ; 22/07/2024 - 6784 %if 0 - 6785 SetPSwitch: - 6786 - 6787 ; We have a permanent COMMAND switch /P. Flag this and stash the - 6788 ; termination address. + 6749 ; We have a permanent COMMAND switch /P. Flag this and stash the + 6750 ; termination address. + 6751 + 6752 ; MSDOS 6.0 + 6753 000017E5 803E[A202]00 cmp byte [PermCom],0 ; has /p switch been set? + 6754 000017EA 7415 jz short permcomok ; no - set it + 6755 ; 16/04/2023 + 6756 parse_line_error_j: + 6757 ;mov ax,1 + 6758 000017EC B80100 mov ax,MoreArgs_Ptr ; set up too many arguments + 6759 000017EF E930FF jmp parse_line_error ; go issue error + 6760 %endif + 6761 + 6762 ; MSDOS 6.0 + 6763 SetFSwitch: + 6764 000017F2 803E[A902]FF cmp byte [fFail],-1 ; has fail switch been set? + 6765 ; 16/04/2023 + 6766 ;jne short failok ; no - set it + 6767 ;;mov ax,1 + 6768 ;mov ax,MoreArgs_Ptr ; set up too many arguments + 6769 ;jmp parse_line_error ; go issue error + 6770 ; 16/04/2023 + 6771 000017F7 74F3 je short parse_line_error_j + 6772 + 6773 ; MSDOS 3.3 & MSDOS 6.0 + 6774 failok: + 6775 000017F9 C606[A902]FF mov byte [fFail],-1 ; fail all INT 24s. + 6776 ; MSDOS 3.3 + 6777 ;jmp short CHKARG + 6778 ; MSDOS 6.0 + 6779 000017FE E903FF jmp Parse_command_line + 6780 + 6781 ;CHECKPSWITCH: + 6782 ;;cmp al,'p' ; Permanent COMMAND switch + 6783 ;cmp al,[letter_p] + 6784 ;jnz short CHECKDSWITCH + 6785 + 6786 ; 22/07/2024 + 6787 %if 0 + 6788 SetPSwitch: 6789 - 6790 ; MSDOS 6.0 - 6791 cmp byte [PermCom],0 ; has /p switch been set? - 6792 jz short permcomok ; no - set it - 6793 ; 16/04/2023 - 6794 parse_line_error_j: - 6795 ;mov ax,1 - 6796 mov ax,MoreArgs_Ptr ; set up too many arguments - 6797 jmp parse_line_error ; go issue error - 6798 %endif - 6799 - 6800 permcomok: - 6801 ; MSDOS 3.3 & MSDOS 6.0 - 6802 00001801 FE06[A202] inc byte [PermCom] - 6803 ;mov word [OLDTERM],LODCOM - 6804 00001805 C706[4002][E000] mov word [OldTerm],LodCom_Trap - 6805 ;mov [OLDTERM+2],ds - 6806 0000180B 8C1E[4202] mov [OldTerm+2],ds - 6807 - 6808 ; make sure that we display the date and time. if the flag was not - 6809 ; initialized, set it to indicate yes, do prompt. + 6790 ; We have a permanent COMMAND switch /P. Flag this and stash the + 6791 ; termination address. + 6792 + 6793 ; MSDOS 6.0 + 6794 cmp byte [PermCom],0 ; has /p switch been set? + 6795 jz short permcomok ; no - set it + 6796 ; 16/04/2023 + 6797 parse_line_error_j: + 6798 ;mov ax,1 + 6799 mov ax,MoreArgs_Ptr ; set up too many arguments + 6800 jmp parse_line_error ; go issue error + 6801 %endif + 6802 + 6803 permcomok: + 6804 ; MSDOS 3.3 & MSDOS 6.0 + 6805 00001801 FE06[A202] inc byte [PermCom] + 6806 ;mov word [OLDTERM],LODCOM + 6807 00001805 C706[4002][E000] mov word [OldTerm],LodCom_Trap + 6808 ;mov [OLDTERM+2],ds + 6809 0000180B 8C1E[4202] mov [OldTerm+2],ds 6810 - 6811 ; MSDOS 3.3 - 6812 ;cmp byte [PRDATTM],-1 - 6813 ;jnz short CHKARG - 6814 ;mov byte [PRDATTM],0 - 6815 ;jmp short CHKARG - 6816 - 6817 ; MSDOS 6.0 - 6818 0000180F 803E[4720]FF cmp byte [PRDATTM],-1 - 6819 00001814 7505 jne short Parse_command_line_jmp - 6820 00001816 C606[4720]00 mov byte [PRDATTM],0 - 6821 Parse_command_line_jmp: - 6822 0000181B E9E6FE jmp Parse_command_line ; keep parsing - 6823 - 6824 ;COMRETURNSJ: - 6825 ; ; MSDOS 3.3 - 6826 ; JMP ARGSDONE - 6827 - 6828 ; 15/01/2023 - 6829 ; MSDOS 6.0 - 6830 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 6831 SetKSwitch: - 6832 0000181E C606[A302]00 mov byte [SemiPermCom],0 - 6833 00001823 EB05 jmp short SetSorKSwitch - 6834 - 6835 ;CHECKCSWITCH: - 6836 ;;cmp al,'c' - 6837 ;cmp al,[letter_c] - 6838 ;jnz short CHECKESWITCH - 6839 - 6840 SetSSwitch: - 6841 ;SETCSWITCH: + 6811 ; make sure that we display the date and time. if the flag was not + 6812 ; initialized, set it to indicate yes, do prompt. + 6813 + 6814 ; MSDOS 3.3 + 6815 ;cmp byte [PRDATTM],-1 + 6816 ;jnz short CHKARG + 6817 ;mov byte [PRDATTM],0 + 6818 ;jmp short CHKARG + 6819 + 6820 ; MSDOS 6.0 + 6821 0000180F 803E[4720]FF cmp byte [PRDATTM],-1 + 6822 00001814 7505 jne short Parse_command_line_jmp + 6823 00001816 C606[4720]00 mov byte [PRDATTM],0 + 6824 Parse_command_line_jmp: + 6825 0000181B E9E6FE jmp Parse_command_line ; keep parsing + 6826 + 6827 ;COMRETURNSJ: + 6828 ; ; MSDOS 3.3 + 6829 ; JMP ARGSDONE + 6830 + 6831 ; 15/01/2023 + 6832 ; MSDOS 6.0 + 6833 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 6834 SetKSwitch: + 6835 0000181E C606[A302]00 mov byte [SemiPermCom],0 + 6836 00001823 EB05 jmp short SetSorKSwitch + 6837 + 6838 ;CHECKCSWITCH: + 6839 ;;cmp al,'c' + 6840 ;cmp al,[letter_c] + 6841 ;jnz short CHECKESWITCH 6842 - 6843 ; Set up pointer to command line, flag no date/time and turn off SingleCom. - 6844 - 6845 00001825 C606[A202]00 mov byte [PermCom],0 ; A SingleCom must not be a PermCom - 6846 SetSorKSwitch: ; 06/06/2023 - 6847 0000182A 8936[A502] mov [SingleCom],si ; Point to the rest of the command line - 6848 0000182E C606[4720]01 mov byte [PRDATTM],1 ; no date or time either, explicit - 6849 ;COMRETURNSJ: ; 24/09/2018 - 6850 00001833 E97E01 jmp ArgsDone - 6851 - 6852 ;CHECKESWITCH: - 6853 ;cmp al,'e' - 6854 ;jnz short CHKARG - 6855 - 6856 ; Look for environment-size setting switch - 6857 - 6858 ; The environment size is represented in decimal bytes and is - 6859 ; converted into paragraphs (rounded up to the next paragraph). + 6843 SetSSwitch: + 6844 ;SETCSWITCH: + 6845 + 6846 ; Set up pointer to command line, flag no date/time and turn off SingleCom. + 6847 + 6848 00001825 C606[A202]00 mov byte [PermCom],0 ; A SingleCom must not be a PermCom + 6849 SetSorKSwitch: ; 06/06/2023 + 6850 0000182A 8936[A502] mov [SingleCom],si ; Point to the rest of the command line + 6851 0000182E C606[4720]01 mov byte [PRDATTM],1 ; no date or time either, explicit + 6852 ;COMRETURNSJ: ; 24/09/2018 + 6853 00001833 E97E01 jmp ArgsDone + 6854 + 6855 ;CHECKESWITCH: + 6856 ;cmp al,'e' + 6857 ;jnz short CHKARG + 6858 + 6859 ; Look for environment-size setting switch 6860 - 6861 SetESwitch: - 6862 ; MSDOS 6.0 - 6863 00001836 803E[9520]00 cmp byte [eswitch],0 ; has environment size switch been set? - 6864 ; 16/04/2023 - 6865 ;jz short eswitchok ; no - set it - 6866 ;;mov ax,1 - 6867 ;mov ax,MoreArgs_Ptr ; set up too many arguments - 6868 ;jmp parse_line_error ; go issue error message - 6869 ; 16/04/2023 - 6870 0000183B 75AF jnz short parse_line_error_j - 6871 eswitchok: - 6872 0000183D FE06[9520] inc byte [eswitch] ; indicate /E entered - 6873 - 6874 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 6875 ; 15/01/2023 - Retro DOS v4.1 (& v4.1) - MSDOS 5.0 COMMAND.COM - 6876 ; MSDOS 6.0 - 6877 ;mov di,offset ResGroup:Comnd1_Addr ; get number returned - 6878 00001841 BF[5A21] mov di,COMND1_ADDR - 6879 00001844 8B1D mov bx,[di] ; into bx - 6880 - 6881 00001846 83C30F add bx,0Fh ; Round up to next paragraph - 6882 00001849 B104 mov cl,4 ; convert to pargraphs - 6883 0000184B D3EB shr bx,cl ; by right 4 - 6884 - 6885 0000184D 891E[8220] mov [EnvSiz],bx ; EnvSiz is in paragraphs - 6886 00001851 E9B0FE jmp Parse_command_line ; continue parsing command line + 6861 ; The environment size is represented in decimal bytes and is + 6862 ; converted into paragraphs (rounded up to the next paragraph). + 6863 + 6864 SetESwitch: + 6865 ; MSDOS 6.0 + 6866 00001836 803E[9520]00 cmp byte [eswitch],0 ; has environment size switch been set? + 6867 ; 16/04/2023 + 6868 ;jz short eswitchok ; no - set it + 6869 ;;mov ax,1 + 6870 ;mov ax,MoreArgs_Ptr ; set up too many arguments + 6871 ;jmp parse_line_error ; go issue error message + 6872 ; 16/04/2023 + 6873 0000183B 75AF jnz short parse_line_error_j + 6874 eswitchok: + 6875 0000183D FE06[9520] inc byte [eswitch] ; indicate /E entered + 6876 + 6877 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 6878 ; 15/01/2023 - Retro DOS v4.1 (& v4.1) - MSDOS 5.0 COMMAND.COM + 6879 ; MSDOS 6.0 + 6880 ;mov di,offset ResGroup:Comnd1_Addr ; get number returned + 6881 00001841 BF[5A21] mov di,COMND1_ADDR + 6882 00001844 8B1D mov bx,[di] ; into bx + 6883 + 6884 00001846 83C30F add bx,0Fh ; Round up to next paragraph + 6885 00001849 B104 mov cl,4 ; convert to pargraphs + 6886 0000184B D3EB shr bx,cl ; by right 4 6887 - 6888 ; 16/04/2023 - 6889 %if 0 - 6890 SetMSwitch: - 6891 ;cmp byte [ext_msg],1 - 6892 cmp byte [ext_msg],SET_EXTENDED_MSG ; has /MSG switch been set? - 6893 jnz short setMswitchok ; no - set it - 6894 ;mov ax,1 - 6895 mov ax,MoreArgs_Ptr ; set up too many arguments - 6896 jmp parse_line_error ; go issue error message - 6897 setMswitchok: - 6898 ;mov byte [ext_msg],1 - 6899 mov byte [ext_msg],SET_EXTENDED_MSG ; set /MSG switch - 6900 jmp Parse_command_line ; keep parsing - 6901 %endif - 6902 - 6903 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 6904 %if 1 - 6905 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1913h - 6906 SetHSwitch: - 6907 ;jmp short load_to_hma_umb ; load COMMAND.COM into HMA/UMB - 6908 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19CBh - 6909 load_to_hma_umb: - 6910 ;cmp byte [520h],0 - 6911 00001854 803E[0E04]00 cmp byte [COMMAND_HIGH],0 - 6912 00001859 741B jz short set_command_high_flag - 6913 parse_line_error_j2: ; 22/07/2024 - 6914 0000185B B80100 mov ax,1 ; too many parameters - 6915 0000185E E9C1FE jmp parse_line_error - 6916 - 6917 ;set_command_high_flag: - 6918 ; inc byte [COMMAND_HIGH] - 6919 ; jmp Parse_command_line - 6920 - 6921 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1916h - 6922 SetOSwitch: - 6923 ;jmp short disable_overwrite_msg - 6924 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19DFh - 6925 disable_overwrite_msg: - 6926 00001861 803E[FA01]63 cmp byte [cox_location],'c' ; "cox" - 6927 ;jz short change_cox_to_VCB - 6928 ;mov ax, 1 ; MoreArgs_Ptr - 6929 ;jmp parse_line_error - 6930 ; 22/07/2024 - 6931 00001866 75F3 jnz short parse_line_error_j2 - 6932 change_cox_to_VCB: - 6933 00001868 C606[FA01]56 mov byte [cox_location],56h ; 'V' ; "VCB" - 6934 0000186D C706[FB01]4342 mov word [cox_location+1],4243h ; 'CB' - 6935 00001873 E98EFE jmp Parse_command_line - 6936 - 6937 set_command_high_flag: - 6938 00001876 FE06[0E04] inc byte [COMMAND_HIGH] - 6939 0000187A E987FE jmp Parse_command_line - 6940 %endif - 6941 - 6942 ;ArgsDoneJ: - 6943 ;jmp ArgsDone + 6888 0000184D 891E[8220] mov [EnvSiz],bx ; EnvSiz is in paragraphs + 6889 00001851 E9B0FE jmp Parse_command_line ; continue parsing command line + 6890 + 6891 ; 16/04/2023 + 6892 %if 0 + 6893 SetMSwitch: + 6894 ;cmp byte [ext_msg],1 + 6895 cmp byte [ext_msg],SET_EXTENDED_MSG ; has /MSG switch been set? + 6896 jnz short setMswitchok ; no - set it + 6897 ;mov ax,1 + 6898 mov ax,MoreArgs_Ptr ; set up too many arguments + 6899 jmp parse_line_error ; go issue error message + 6900 setMswitchok: + 6901 ;mov byte [ext_msg],1 + 6902 mov byte [ext_msg],SET_EXTENDED_MSG ; set /MSG switch + 6903 jmp Parse_command_line ; keep parsing + 6904 %endif + 6905 + 6906 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 6907 %if 1 + 6908 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1913h + 6909 SetHSwitch: + 6910 ;jmp short load_to_hma_umb ; load COMMAND.COM into HMA/UMB + 6911 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19CBh + 6912 load_to_hma_umb: + 6913 ;cmp byte [520h],0 + 6914 00001854 803E[0E04]00 cmp byte [COMMAND_HIGH],0 + 6915 00001859 741B jz short set_command_high_flag + 6916 parse_line_error_j2: ; 22/07/2024 + 6917 0000185B B80100 mov ax,1 ; too many parameters + 6918 0000185E E9C1FE jmp parse_line_error + 6919 + 6920 ;set_command_high_flag: + 6921 ; inc byte [COMMAND_HIGH] + 6922 ; jmp Parse_command_line + 6923 + 6924 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1916h + 6925 SetOSwitch: + 6926 ;jmp short disable_overwrite_msg + 6927 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19DFh + 6928 disable_overwrite_msg: + 6929 00001861 803E[FA01]63 cmp byte [cox_location],'c' ; "cox" + 6930 ;jz short change_cox_to_VCB + 6931 ;mov ax, 1 ; MoreArgs_Ptr + 6932 ;jmp parse_line_error + 6933 ; 22/07/2024 + 6934 00001866 75F3 jnz short parse_line_error_j2 + 6935 change_cox_to_VCB: + 6936 00001868 C606[FA01]56 mov byte [cox_location],56h ; 'V' ; "VCB" + 6937 0000186D C706[FB01]4342 mov word [cox_location+1],4243h ; 'CB' + 6938 00001873 E98EFE jmp Parse_command_line + 6939 + 6940 set_command_high_flag: + 6941 00001876 FE06[0E04] inc byte [COMMAND_HIGH] + 6942 0000187A E987FE jmp Parse_command_line + 6943 %endif 6944 - 6945 ; 15/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM - 6946 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:181Dh - CODERES:0ADDh) + 6945 ;ArgsDoneJ: + 6946 ;jmp ArgsDone 6947 - 6948 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 6949 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:196Dh - CODERES:0B1Dh) + 6948 ; 15/01/2023 - Retro DOS v4.0 (& V4.1) COMMAND.COM + 6949 ; (MSDOS 5.0 COMMAND.COM - RESGROUP:181Dh - CODERES:0ADDh) 6950 - 6951 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 6952 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19FAh + 6951 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 6952 ; (MSDOS 6.22 COMMAND.COM - RESGROUP:196Dh - CODERES:0B1Dh) 6953 - 6954 ChkOtherArgs: - 6955 - 6956 ; We have a non-switch character here. - 6957 - 6958 ; MSDOS 6.0 - 6959 0000187D 1E push ds ; **** ; - 6960 0000187E 56 push si ; *** ; save place in command line - 6961 0000187F C536[5A21] lds si,[COMND1_ADDR] ; get address of filespec - 6962 ;assume ds:nothing ; - 6963 - 6964 00001883 89F2 mov dx,si ; put in dx also - 6965 00001885 B8023D mov ax,3D02h - 6966 ;mov ax,(OPEN shl 8) or 2 ; Read and write - 6967 00001888 CD21 int 21h - 6968 0000188A 7260 jc short ChkSrchSpec ; Wasn't a file - 6969 0000188C 89C3 mov bx,ax - 6970 0000188E B80044 mov ax,4400h - 6971 ;mov ax,IOCTL shl 8 - 6972 00001891 CD21 int 21h - 6973 00001893 F6C280 test dl,80h - 6974 00001896 7506 jnz short IsaDevice - 6975 BadSetCon: - 6976 00001898 B43E mov ah,3Eh - 6977 ;mov ah,CLOSE ; Close initial handle, wasn't a device - 6978 0000189A CD21 int 21h - 6979 0000189C EB4E jmp short ChkSrchSpec - 6980 - 6981 ; 15/01/2023 - 6982 IsaDevice: - 6983 ; MSDOS 3.3 & MSDOS 6.0 - 6984 0000189E 30F6 xor dh,dh - 6985 000018A0 80CA03 or dl,3 ; Make sure has CON attributes - 6986 ;mov ax,(IOCTL shl 8) or 1 - 6987 000018A3 B80144 mov ax,(IOCTL*256)|1 ; 4401h - 6988 000018A6 CD21 int 21h - 6989 ; - 6990 ; 15/01/2023 - 6991 000018A8 72EE jc short BadSetCon ; MSDOS 6.0 (& 5.0) - 6992 ; 25/09/2018 - 6993 ;pop dx ; * - 6994 ;pop dx ; ** - 6995 ; - 6996 ;jc short BADSETCON ; MSDOS 6.0 ; Can't set attributes - quit - 6997 - 6998 000018AA 89DA mov dx,bx ; Save new handle - 6999 - 7000 ; MSDOS 6.0 - 7001 000018AC 26803E[9A26]01 cmp byte [es:DevFlag],1 - 7002 000018B2 742A jz short DevErr - 7003 - 7004 ; MSDOS 3.3 - 7005 ;pop bx ; * ; Throw away saved SI - 7006 ;pop bx ; ** ; Throw away saved CX - 7007 - 7008 ; MSDOS 3.3 & MSDOS 6.0 - 7009 000018B4 51 push cx ; ** - 7010 000018B5 B90300 mov cx,3 - 7011 000018B8 31DB xor bx,bx - 7012 - 7013 ; 15/01/2023 - 7014 rcclloop: - 7015 000018BA B43E mov ah,3Eh - 7016 ;mov ah,CLOSE ; 3Eh - 7017 000018BC CD21 int 21h - 7018 000018BE 43 inc bx - 7019 000018BF E2F9 loop rcclloop - 7020 - 7021 000018C1 89D3 mov bx,dx ; New device handle - 7022 000018C3 B445 mov ah,45h - 7023 ;mov ah,XDUP ; 45h - 7024 000018C5 CD21 int 21h ; Dup to 0 - 7025 000018C7 B445 mov ah,45h - 7026 ;mov ah,XDUP - 7027 000018C9 CD21 int 21h ; Dup to 1 - 7028 000018CB B445 mov ah,45h + 6954 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 6955 ; PCDOS 7.1 COMMAND.COM - RESGROUP:19FAh + 6956 + 6957 ChkOtherArgs: + 6958 + 6959 ; We have a non-switch character here. + 6960 + 6961 ; MSDOS 6.0 + 6962 0000187D 1E push ds ; **** ; + 6963 0000187E 56 push si ; *** ; save place in command line + 6964 0000187F C536[5A21] lds si,[COMND1_ADDR] ; get address of filespec + 6965 ;assume ds:nothing ; + 6966 + 6967 00001883 89F2 mov dx,si ; put in dx also + 6968 00001885 B8023D mov ax,3D02h + 6969 ;mov ax,(OPEN shl 8) or 2 ; Read and write + 6970 00001888 CD21 int 21h + 6971 0000188A 7260 jc short ChkSrchSpec ; Wasn't a file + 6972 0000188C 89C3 mov bx,ax + 6973 0000188E B80044 mov ax,4400h + 6974 ;mov ax,IOCTL shl 8 + 6975 00001891 CD21 int 21h + 6976 00001893 F6C280 test dl,80h + 6977 00001896 7506 jnz short IsaDevice + 6978 BadSetCon: + 6979 00001898 B43E mov ah,3Eh + 6980 ;mov ah,CLOSE ; Close initial handle, wasn't a device + 6981 0000189A CD21 int 21h + 6982 0000189C EB4E jmp short ChkSrchSpec + 6983 + 6984 ; 15/01/2023 + 6985 IsaDevice: + 6986 ; MSDOS 3.3 & MSDOS 6.0 + 6987 0000189E 30F6 xor dh,dh + 6988 000018A0 80CA03 or dl,3 ; Make sure has CON attributes + 6989 ;mov ax,(IOCTL shl 8) or 1 + 6990 000018A3 B80144 mov ax,(IOCTL*256)|1 ; 4401h + 6991 000018A6 CD21 int 21h + 6992 ; + 6993 ; 15/01/2023 + 6994 000018A8 72EE jc short BadSetCon ; MSDOS 6.0 (& 5.0) + 6995 ; 25/09/2018 + 6996 ;pop dx ; * + 6997 ;pop dx ; ** + 6998 ; + 6999 ;jc short BADSETCON ; MSDOS 6.0 ; Can't set attributes - quit + 7000 + 7001 000018AA 89DA mov dx,bx ; Save new handle + 7002 + 7003 ; MSDOS 6.0 + 7004 000018AC 26803E[9A26]01 cmp byte [es:DevFlag],1 + 7005 000018B2 742A jz short DevErr + 7006 + 7007 ; MSDOS 3.3 + 7008 ;pop bx ; * ; Throw away saved SI + 7009 ;pop bx ; ** ; Throw away saved CX + 7010 + 7011 ; MSDOS 3.3 & MSDOS 6.0 + 7012 000018B4 51 push cx ; ** + 7013 000018B5 B90300 mov cx,3 + 7014 000018B8 31DB xor bx,bx + 7015 + 7016 ; 15/01/2023 + 7017 rcclloop: + 7018 000018BA B43E mov ah,3Eh + 7019 ;mov ah,CLOSE ; 3Eh + 7020 000018BC CD21 int 21h + 7021 000018BE 43 inc bx + 7022 000018BF E2F9 loop rcclloop + 7023 + 7024 000018C1 89D3 mov bx,dx ; New device handle + 7025 000018C3 B445 mov ah,45h + 7026 ;mov ah,XDUP ; 45h + 7027 000018C5 CD21 int 21h ; Dup to 0 + 7028 000018C7 B445 mov ah,45h 7029 ;mov ah,XDUP - 7030 000018CD CD21 int 21h ; Dup to 2 - 7031 000018CF B43E mov ah,3Eh - 7032 ;mov ah,CLOSE - 7033 000018D1 CD21 int 21h ; Close initial handle - 7034 - 7035 000018D3 59 pop cx ; ** - 7036 - 7037 ; MSDOS 6.0 - 7038 000018D4 5E pop si ; *** ; restore position of command line - 7039 000018D5 1F pop ds ; **** ; - 7040 - 7041 ; Register the fact that we already have redirected the output - 7042 ; and can not do it again + 7030 000018C9 CD21 int 21h ; Dup to 1 + 7031 000018CB B445 mov ah,45h + 7032 ;mov ah,XDUP + 7033 000018CD CD21 int 21h ; Dup to 2 + 7034 000018CF B43E mov ah,3Eh + 7035 ;mov ah,CLOSE + 7036 000018D1 CD21 int 21h ; Close initial handle + 7037 + 7038 000018D3 59 pop cx ; ** + 7039 + 7040 ; MSDOS 6.0 + 7041 000018D4 5E pop si ; *** ; restore position of command line + 7042 000018D5 1F pop ds ; **** ; 7043 - 7044 000018D6 26FE06[9A26] inc byte [es:DevFlag] - 7045 000018DB E926FE jmp Parse_command_line ; continue parsing + 7044 ; Register the fact that we already have redirected the output + 7045 ; and can not do it again 7046 - 7047 ; MSDOS 3.3 - 7048 ;jcxz ARGSDONEJ2 - 7049 ;jmp CHKARG - 7050 - 7051 ; MSDOS 6.0 - 7052 DevErr: - 7053 000018DE 5E pop si ; *** - 7054 000018DF 1F pop ds ; **** - 7055 000018E0 BA0100 mov dx,1 - 7056 000018E3 E8CA03 call RPrintParse ; "Too many parameters" - 7057 000018E6 E8EFFA call crlf - 7058 000018E9 E918FE jmp Parse_command_line - 7059 - 7060 ChkSrchSpec: ; Not a device, so must be directory spec - 7061 ; MSDOS 6.0 - 7062 000018EC 26803E[9B26]01 cmp byte [es:PathFlag],1 ; already set COMSPEC? - 7063 000018F2 74EA jz short DevErr ; yes, error - 7064 - 7065 000018F4 26FE06[9B26] inc byte [es:PathFlag] ; mark that we have a path - 7066 - 7067 ; We have to override the passed environment. Allocate a buffer for use now. - 7068 ; This buffer will later be replaced by a proper environment + 7047 000018D6 26FE06[9A26] inc byte [es:DevFlag] + 7048 000018DB E926FE jmp Parse_command_line ; continue parsing + 7049 + 7050 ; MSDOS 3.3 + 7051 ;jcxz ARGSDONEJ2 + 7052 ;jmp CHKARG + 7053 + 7054 ; MSDOS 6.0 + 7055 DevErr: + 7056 000018DE 5E pop si ; *** + 7057 000018DF 1F pop ds ; **** + 7058 000018E0 BA0100 mov dx,1 + 7059 000018E3 E8CA03 call RPrintParse ; "Too many parameters" + 7060 000018E6 E8EFFA call crlf + 7061 000018E9 E918FE jmp Parse_command_line + 7062 + 7063 ChkSrchSpec: ; Not a device, so must be directory spec + 7064 ; MSDOS 6.0 + 7065 000018EC 26803E[9B26]01 cmp byte [es:PathFlag],1 ; already set COMSPEC? + 7066 000018F2 74EA jz short DevErr ; yes, error + 7067 + 7068 000018F4 26FE06[9B26] inc byte [es:PathFlag] ; mark that we have a path 7069 - 7070 ; 15/01/2023 - Retro DOS v4.0 COMMAND.COM - 7071 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1899h - 7072 ; 06/06/2023 - 7073 ;mov ax,[ss:EnvirSeg] - 7074 - 7075 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 7076 ; MSDOS 6.22 COMMAND.COM - RESGROUP:19E9h - 7077 ; - 7078 ; MSDOS 6.0 - 7079 000018F9 E88F05 call alloc_env ; environment buffer - 7080 - 7081 ; 06/06/2023 - 7082 %if 0 - 7083 ; 15/01/2023 - 7084 ; MSDOS 5.0 - 7085 cmp byte [ss:AllocedEnv],1 - 7086 mov byte [ss:AllocedEnv],0 - 7087 jne short env_alloced - 7088 call alloc_env - 7089 mov [ss:EnvirSeg],ax - 7090 %endif - 7091 - 7092 env_alloced: - 7093 ; MSDOS 5.0 & MSDOS 6.0 - 7094 000018FC 8EC0 mov es,ax - 7095 ;assume es:nothing - 7096 000018FE 56 push si ; ** ; remember location of file - 7097 000018FF 31C9 xor cx,cx ; clear cx for counting - 7098 - 7099 ; 15/01/2023 - 7100 countloop: - 7101 00001901 AC lodsb ; get a character - 7102 00001902 41 inc cx ; increment counter - 7103 ;;cmp al,0 - 7104 ;cmp al,END_OF_LINE_OUT ; are we at end of line? - 7105 ;jne short countloop ; no - keep counting - 7106 00001903 08C0 or al,al - 7107 00001905 75FA jnz short countloop - 7108 ; 06/03/2023 - 7109 ; al = 0 ; (*) - 7110 - 7111 ;;;;mov al,[Space] - 7112 ;;;mov al,[ss:Space] ; 15/01/2023 - MSDOS 5.0 COMMAND.COM - 7113 ;;mov al,space_chr ; Retro DOS v4.0 (& v4.1) COMMAND.COM - 7114 ; 16/04/2023 - 7115 ;mov al,20h ; ' ' - 7116 00001907 4E dec si ; move back one - 7117 ;mov [si],al ; put a space at end of line - 7118 00001908 C60420 mov byte [si],20h ; ' ' ; space_chr - 7119 - 7120 ; We now know how long the new pathspec for command.com is. Time to - 7121 ; figure out how long the current COMSPEC setting is, and then to move - 7122 ; all the environment data up, throwing that COMSPEC setting away, and - 7123 ; preparing to append the new COMSPEC. ComspOffset (the offset of - 7124 ; where the filespec exists in the environment) is updated as well. - 7125 - 7126 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 7127 ; MSDOS 6.22 COMMAND.COM - RESGROUP:19FEh + 7070 ; We have to override the passed environment. Allocate a buffer for use now. + 7071 ; This buffer will later be replaced by a proper environment + 7072 + 7073 ; 15/01/2023 - Retro DOS v4.0 COMMAND.COM + 7074 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1899h + 7075 ; 06/06/2023 + 7076 ;mov ax,[ss:EnvirSeg] + 7077 + 7078 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 7079 ; MSDOS 6.22 COMMAND.COM - RESGROUP:19E9h + 7080 ; + 7081 ; MSDOS 6.0 + 7082 000018F9 E88F05 call alloc_env ; environment buffer + 7083 + 7084 ; 06/06/2023 + 7085 %if 0 + 7086 ; 15/01/2023 + 7087 ; MSDOS 5.0 + 7088 cmp byte [ss:AllocedEnv],1 + 7089 mov byte [ss:AllocedEnv],0 + 7090 jne short env_alloced + 7091 call alloc_env + 7092 mov [ss:EnvirSeg],ax + 7093 %endif + 7094 + 7095 env_alloced: + 7096 ; MSDOS 5.0 & MSDOS 6.0 + 7097 000018FC 8EC0 mov es,ax + 7098 ;assume es:nothing + 7099 000018FE 56 push si ; ** ; remember location of file + 7100 000018FF 31C9 xor cx,cx ; clear cx for counting + 7101 + 7102 ; 15/01/2023 + 7103 countloop: + 7104 00001901 AC lodsb ; get a character + 7105 00001902 41 inc cx ; increment counter + 7106 ;;cmp al,0 + 7107 ;cmp al,END_OF_LINE_OUT ; are we at end of line? + 7108 ;jne short countloop ; no - keep counting + 7109 00001903 08C0 or al,al + 7110 00001905 75FA jnz short countloop + 7111 ; 06/03/2023 + 7112 ; al = 0 ; (*) + 7113 + 7114 ;;;;mov al,[Space] + 7115 ;;;mov al,[ss:Space] ; 15/01/2023 - MSDOS 5.0 COMMAND.COM + 7116 ;;mov al,space_chr ; Retro DOS v4.0 (& v4.1) COMMAND.COM + 7117 ; 16/04/2023 + 7118 ;mov al,20h ; ' ' + 7119 00001907 4E dec si ; move back one + 7120 ;mov [si],al ; put a space at end of line + 7121 00001908 C60420 mov byte [si],20h ; ' ' ; space_chr + 7122 + 7123 ; We now know how long the new pathspec for command.com is. Time to + 7124 ; figure out how long the current COMSPEC setting is, and then to move + 7125 ; all the environment data up, throwing that COMSPEC setting away, and + 7126 ; preparing to append the new COMSPEC. ComspOffset (the offset of + 7127 ; where the filespec exists in the environment) is updated as well. 7128 - 7129 ; MSDOS 6.0 - 7130 0000190B 51 push cx ; * ; - 7131 0000190C B90080 mov cx,ENVBIG ; 32768 ; - 7132 0000190F 368B3E[6B20] mov di,[ss:ComspOffset] ; get location of COMSPEC - 7133 ;mov al,0 ; - 7134 ; 06/06/2023 - 7135 ; al = 0 ; (*) - 7136 00001914 F2AE repne scasb ; find the end of COMSPEC - 7137 00001916 89FE mov si,di ; - 7138 comp_endenv: ; - 7139 00001918 AE scasb ; end of env? - 7140 00001919 7404 je short got_endenv ; yes - 7141 0000191B F2AE repne scasb ; - 7142 0000191D EBF9 jmp short comp_endenv ; - 7143 got_endenv: ; - 7144 0000191F 89F9 mov cx,di ; - 7145 00001921 29F1 sub cx,si ; - 7146 00001923 368B3E[6B20] mov di,[ss:ComspOffset] ; - 7147 00001928 83EF08 sub di,ComspStrLen ; sub di,8 ; - 7148 0000192B 1E push ds ; + ; - 7149 0000192C 06 push es ; - 7150 0000192D 1F pop ds ; - 7151 0000192E F3A4 rep movsb ; - 7152 00001930 4F dec di ; copy in new COMSPEC= - 7153 00001931 0E push cs ; - 7154 00001932 1F pop ds ; - 7155 ;assume ds:RESGROUP ; - 7156 ;mov si,offset RESGROUP:ComspString ; - 7157 00001933 BE[6D20] mov si,ComspString ; "COMSPEC=\COMMAND.COM" - 7158 ;mov cx,ComspStrLen ; mov cx,8 ; - 7159 00001936 B108 mov cl,ComspStrLen ; mov cl,8 - 7160 00001938 F3A4 rep movsb ; - 7161 0000193A 893E[6B20] mov [ComspOffset],di ; - 7162 0000193E 1F pop ds ; + ; - 7163 ;assume ds:nothing ; - 7164 0000193F 59 pop cx ; * ; - 7165 ; - 7166 00001940 5E pop si ; ** ; get new comspec location back - 7167 - 7168 ;; MSDOS 3.3 COMMAND.COM - 7169 ;;mov byte [CHUCKENV],0 ; If search specified -- no inheritance - 7170 ;;mov ax,PATHSTRING ; "PATH=" ; Figure environment pointer - 7171 ;;mov cl,4 - 7172 ;;shr ax,cl - 7173 ;;mov dx,ds - 7174 ;;add ax,dx - 7175 ;;mov [ENVIRSEG],ax - 7176 ;;mov es,ax - 7177 ;;;mov al,' ' - 7178 ;;mov al,[SPACE_CHR] - 7179 ;;mov [si-1],al - 7180 ;;pop si ; ** ; Remember location - 7181 ;;pop cx ; * ; and count - 7182 ;;;mov di,[ECOMLOC] - 7183 ;;mov di,[COMSPOFFSET] - 7184 - 7185 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 7186 ;; 15/01/2023 - 7187 ;; MSDOS 5.0 COMMAND.COM - 7188 ;pop si ; ** - 7189 ;;mov di,14 - 7190 ;mov di,ECOMSPEC ; mov di,0Eh - 7191 - 7192 ComtrLoop: - 7193 ; MSDOS 3.3 & MSDOS 6.0 - 7194 00001941 AC lodsb - 7195 00001942 49 dec cx - 7196 ;;;;cmp al,' ' - 7197 ;;;cmp al,[space_chr] - 7198 ;;cmp al,[ss:Space] ; MSDOS 5.0 COMMAND.COM - 7199 ;cmp al,space_chr ; Retro DOS v4.0 (& v4.1) COMMAND.COM - 7200 ; 16/04/2023 - 7201 00001943 3C20 cmp al,20h ; ' ' ; space_chr - 7202 00001945 7416 je short SetComsr - 7203 ; MSDOS 3.3 - 7204 ;cmp al,9 - 7205 ;je short SetComsr - 7206 ; MSDOS 3.3 & MSDOS 6.0 - 7207 00001947 AA stosb - 7208 - 7209 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 7210 %if 1 - 7211 ;ifdef DBCS - 7212 00001948 30E4 xor ah,ah - 7213 ;endif - 7214 %endif - 7215 0000194A E311 jcxz SetComsr - 7216 - 7217 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 7218 %if 1 - 7219 ;ifdef DBCS - 7220 0000194C 1E push ds ; Make sure we have - 7221 0000194D 0E push cs ; local DS for - 7222 0000194E 1F pop ds ; ItestKanj - 7223 0000194F E82BFB call ITestKanj - 7224 00001952 1F pop ds ; restore parser ds - 7225 00001953 74EC jz short ComtrLoop - 7226 00001955 49 dec cx - 7227 00001956 A4 movsb - 7228 00001957 FEC4 inc ah - 7229 00001959 E302 jcxz SetComsr - 7230 ;endif - 7231 %endif - 7232 0000195B EBE4 jmp short ComtrLoop - 7233 - 7234 SetComsr: - 7235 ; 15/01/2023 - 7236 ; MSDOS 6.0 - 7237 0000195D 51 push cx ; ** - 7238 0000195E 0E push cs ; Get local segment - 7239 0000195F 1F pop ds ; - 7240 ;assume ds:ResGroup ; - 7241 00001960 1E push ds ; * - 7242 ;mov si,offset ResGroup:ComSpect - 7243 00001961 BE[2820] mov si,COMSPECT ; "\COMMAND.COM" - 7244 00001964 B90E00 mov cx,14 - 7245 00001967 268A45FF mov al,[es:di-1] - 7246 - 7247 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 7248 %if 1 - 7249 ;ifdef DBCS - 7250 0000196B 08E4 or ah,ah - 7251 0000196D 7508 jnz short iNotRoot ; Last char was KANJI second byte, might be '\' - 7252 ;endif - 7253 %endif - 7254 0000196F 3A06[4F04] cmp al,[RDirChar] - 7255 00001973 7502 jne short iNotRoot - 7256 00001975 46 inc si ; Don't make a double / - 7257 00001976 49 dec cx - 7258 - 7259 ; MSDOS 3.37 - 7260 ;push si - 7261 ;push cx - 7262 ;push ds - 7263 ;mov si,COMSPECT ; "/COMMAND.COM" - 7264 ;mov cx,14 - 7265 ;mov al,[es:di-1] - 7266 ;call PATHCHRCMPR - 7267 ;jnz short INOTROOT - 7268 ;inc si ; Don't make a double / - 7269 ;dec cx - 7270 - 7271 iNotRoot: - 7272 ; MSDOS 3.3 & MSDOS 6.0 - 7273 00001977 F3A4 rep movsb - 7274 - 7275 ;;mov dx,[ECOMLOC] ; Now lets make sure its good! - 7276 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 7277 ; MSDOS 6.0 - 7278 00001979 8B16[6B20] mov dx,[ComspOffset] ; [COMSPOFFSET] - 7279 ; 15/01/2023 - 7280 ;;mov dx,14 - 7281 ;mov dx,ECOMSPEC ; mov dx,0Eh ; MSDOS 5.0 COMMAND.COM - 7282 - 7283 0000197D 06 push es - 7284 0000197E 1F pop ds - 7285 ;;mov ax,OPEN shl 8 - 7286 ;mov ax,OPEN*256 ; 3D00h - 7287 0000197F B8003D mov ax,3D00h ; 15/01/2023 - 7288 00001982 CD21 int 21h ; Open COMMAND.COM - 7289 00001984 1F pop ds ; * - 7290 00001985 720E jc short SetComsrBad ; No COMMAND.COM here - 7291 00001987 89C3 mov bx,ax ; Handle - 7292 00001989 B43E mov ah,3Eh ; 15/01/2023 - 7293 ;mov ah,CLOSE ; 3Eh - 7294 0000198B CD21 int 21h ; Close COMMAND.COM - 7295 SetComsrRet: - 7296 ; 15/01/2023 - 7297 0000198D 59 pop cx ; ** - 7298 0000198E 5E pop si ; *** - 7299 - 7300 ; MSDOS 6.0 - 7301 0000198F 1F pop ds ; **** ; - 7302 ;assume ds:ResGroup ; - 7303 ; - 7304 00001990 0E push cs ; Make sure local ES is - 7305 00001991 07 pop es ; restored - 7306 00001992 E96FFD jmp Parse_command_line ; continue parsing command line - 7307 - 7308 ; MSDOS 3.3 - 7309 ;ARGSDONEJ2: - 7310 ;jcxz ARGSDONE - 7311 ;jmp CHKARG - 7312 - 7313 ; 16/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 7314 SetComsrBad: - 7315 ; MSDOS 3.3 & MSDOS 6.0 - 7316 ;mov dx,offset ResGroup:BadComlkMsg ; dx = ptr to msg - 7317 00001995 BA[FB21] mov dx,BADCOMLKMES - 7318 - 7319 ; Note: we're about to make a near call to TriageError, which - 7320 ; lives in a different segment and group. Some linkers will - 7321 ; generate a warning like "Possible fix-up overflow". We're - 7322 ; ok, though, because we all fit in 64 KB and, at init time, - 7323 ; we're still all together. - 7324 - 7325 ; 16/01/2023 - 7326 ;TRIAGEERROR equ TRANSTART+TriageError - 7327 ;(MSDOS 5.0 COMMAND.COM, 2320h+2D92h) - 7328 - 7329 ; 06/06/2023 - 7330 TRIAGEERROR equ TRANSTART+TriageError - 7331 ;(MSDOS 6.22 COMMAND.COM, 26E0h+333Ch) - 7332 - 7333 ;;;call 50B2h ; MSDOS 5.0 COMMAND.COM - 7334 ;;call 5A1Ch ; MSDOS 6.22 COMMAND.COM - 7335 ; 18/07/2024 - 7336 ;call 5A6Ch ; PCDOS 7.1 COMMAND.COM - 7337 00001998 E8(7D58) call TRIAGEERROR ; TRIAGEERROR procedure is at offset 354Eh - 7338 ; in original MSDOS 3.3 COMMAND.COM - 7339 - 7340 ; TriageError procedure is at offset 50B2h - 7341 ; in original MSDOS 5.0 COMMAND.COM - 7342 0000199B 83F841 cmp ax,65 - 7343 0000199E 7503 jne short doprt - 7344 ;mov dx,offset ResGroup:BadComaccMsg ; dx = ptr to msg - 7345 000019A0 BA[2422] mov dx,BADCOMACCMSG - 7346 doprt: - 7347 000019A3 E835FA call RPrint - 7348 ;mov si,offset ResGroup:ComSpect - 7349 000019A6 BE[2820] mov si,COMSPECT ; "\COMMAND.COM" - 7350 ;;mov di,[ECOMLOC] - 7351 ; 06/06/2023 - 7352 000019A9 8B3E[6B20] mov di,[ComspOffset] ; MSDOS 6.22 COMMAND.COM - 7353 ; 16/01/2023 - 7354 ;mov di,ECOMSPEC ; mov di,0Eh ; MSDOS 5.0 COMMAND.COM - 7355 000019AD B90E00 mov cx,14 - 7356 000019B0 F3A4 rep movsb ; get my default back - 7357 - 7358 000019B2 EBD9 jmp short SetComsrRet - 7359 - 7360 ; 16/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 7361 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1927h (CODERES:0BE7h) + 7129 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 7130 ; MSDOS 6.22 COMMAND.COM - RESGROUP:19FEh + 7131 + 7132 ; MSDOS 6.0 + 7133 0000190B 51 push cx ; * ; + 7134 0000190C B90080 mov cx,ENVBIG ; 32768 ; + 7135 0000190F 368B3E[6B20] mov di,[ss:ComspOffset] ; get location of COMSPEC + 7136 ;mov al,0 ; + 7137 ; 06/06/2023 + 7138 ; al = 0 ; (*) + 7139 00001914 F2AE repne scasb ; find the end of COMSPEC + 7140 00001916 89FE mov si,di ; + 7141 comp_endenv: ; + 7142 00001918 AE scasb ; end of env? + 7143 00001919 7404 je short got_endenv ; yes + 7144 0000191B F2AE repne scasb ; + 7145 0000191D EBF9 jmp short comp_endenv ; + 7146 got_endenv: ; + 7147 0000191F 89F9 mov cx,di ; + 7148 00001921 29F1 sub cx,si ; + 7149 00001923 368B3E[6B20] mov di,[ss:ComspOffset] ; + 7150 00001928 83EF08 sub di,ComspStrLen ; sub di,8 ; + 7151 0000192B 1E push ds ; + ; + 7152 0000192C 06 push es ; + 7153 0000192D 1F pop ds ; + 7154 0000192E F3A4 rep movsb ; + 7155 00001930 4F dec di ; copy in new COMSPEC= + 7156 00001931 0E push cs ; + 7157 00001932 1F pop ds ; + 7158 ;assume ds:RESGROUP ; + 7159 ;mov si,offset RESGROUP:ComspString ; + 7160 00001933 BE[6D20] mov si,ComspString ; "COMSPEC=\COMMAND.COM" + 7161 ;mov cx,ComspStrLen ; mov cx,8 ; + 7162 00001936 B108 mov cl,ComspStrLen ; mov cl,8 + 7163 00001938 F3A4 rep movsb ; + 7164 0000193A 893E[6B20] mov [ComspOffset],di ; + 7165 0000193E 1F pop ds ; + ; + 7166 ;assume ds:nothing ; + 7167 0000193F 59 pop cx ; * ; + 7168 ; + 7169 00001940 5E pop si ; ** ; get new comspec location back + 7170 + 7171 ;; MSDOS 3.3 COMMAND.COM + 7172 ;;mov byte [CHUCKENV],0 ; If search specified -- no inheritance + 7173 ;;mov ax,PATHSTRING ; "PATH=" ; Figure environment pointer + 7174 ;;mov cl,4 + 7175 ;;shr ax,cl + 7176 ;;mov dx,ds + 7177 ;;add ax,dx + 7178 ;;mov [ENVIRSEG],ax + 7179 ;;mov es,ax + 7180 ;;;mov al,' ' + 7181 ;;mov al,[SPACE_CHR] + 7182 ;;mov [si-1],al + 7183 ;;pop si ; ** ; Remember location + 7184 ;;pop cx ; * ; and count + 7185 ;;;mov di,[ECOMLOC] + 7186 ;;mov di,[COMSPOFFSET] + 7187 + 7188 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 7189 ;; 15/01/2023 + 7190 ;; MSDOS 5.0 COMMAND.COM + 7191 ;pop si ; ** + 7192 ;;mov di,14 + 7193 ;mov di,ECOMSPEC ; mov di,0Eh + 7194 + 7195 ComtrLoop: + 7196 ; MSDOS 3.3 & MSDOS 6.0 + 7197 00001941 AC lodsb + 7198 00001942 49 dec cx + 7199 ;;;;cmp al,' ' + 7200 ;;;cmp al,[space_chr] + 7201 ;;cmp al,[ss:Space] ; MSDOS 5.0 COMMAND.COM + 7202 ;cmp al,space_chr ; Retro DOS v4.0 (& v4.1) COMMAND.COM + 7203 ; 16/04/2023 + 7204 00001943 3C20 cmp al,20h ; ' ' ; space_chr + 7205 00001945 7416 je short SetComsr + 7206 ; MSDOS 3.3 + 7207 ;cmp al,9 + 7208 ;je short SetComsr + 7209 ; MSDOS 3.3 & MSDOS 6.0 + 7210 00001947 AA stosb + 7211 + 7212 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 7213 %if 1 + 7214 ;ifdef DBCS + 7215 00001948 30E4 xor ah,ah + 7216 ;endif + 7217 %endif + 7218 0000194A E311 jcxz SetComsr + 7219 + 7220 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 7221 %if 1 + 7222 ;ifdef DBCS + 7223 0000194C 1E push ds ; Make sure we have + 7224 0000194D 0E push cs ; local DS for + 7225 0000194E 1F pop ds ; ItestKanj + 7226 0000194F E82BFB call ITestKanj + 7227 00001952 1F pop ds ; restore parser ds + 7228 00001953 74EC jz short ComtrLoop + 7229 00001955 49 dec cx + 7230 00001956 A4 movsb + 7231 00001957 FEC4 inc ah + 7232 00001959 E302 jcxz SetComsr + 7233 ;endif + 7234 %endif + 7235 0000195B EBE4 jmp short ComtrLoop + 7236 + 7237 SetComsr: + 7238 ; 15/01/2023 + 7239 ; MSDOS 6.0 + 7240 0000195D 51 push cx ; ** + 7241 0000195E 0E push cs ; Get local segment + 7242 0000195F 1F pop ds ; + 7243 ;assume ds:ResGroup ; + 7244 00001960 1E push ds ; * + 7245 ;mov si,offset ResGroup:ComSpect + 7246 00001961 BE[2820] mov si,COMSPECT ; "\COMMAND.COM" + 7247 00001964 B90E00 mov cx,14 + 7248 00001967 268A45FF mov al,[es:di-1] + 7249 + 7250 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 7251 %if 1 + 7252 ;ifdef DBCS + 7253 0000196B 08E4 or ah,ah + 7254 0000196D 7508 jnz short iNotRoot ; Last char was KANJI second byte, might be '\' + 7255 ;endif + 7256 %endif + 7257 0000196F 3A06[4F04] cmp al,[RDirChar] + 7258 00001973 7502 jne short iNotRoot + 7259 00001975 46 inc si ; Don't make a double / + 7260 00001976 49 dec cx + 7261 + 7262 ; MSDOS 3.37 + 7263 ;push si + 7264 ;push cx + 7265 ;push ds + 7266 ;mov si,COMSPECT ; "/COMMAND.COM" + 7267 ;mov cx,14 + 7268 ;mov al,[es:di-1] + 7269 ;call PATHCHRCMPR + 7270 ;jnz short INOTROOT + 7271 ;inc si ; Don't make a double / + 7272 ;dec cx + 7273 + 7274 iNotRoot: + 7275 ; MSDOS 3.3 & MSDOS 6.0 + 7276 00001977 F3A4 rep movsb + 7277 + 7278 ;;mov dx,[ECOMLOC] ; Now lets make sure its good! + 7279 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 7280 ; MSDOS 6.0 + 7281 00001979 8B16[6B20] mov dx,[ComspOffset] ; [COMSPOFFSET] + 7282 ; 15/01/2023 + 7283 ;;mov dx,14 + 7284 ;mov dx,ECOMSPEC ; mov dx,0Eh ; MSDOS 5.0 COMMAND.COM + 7285 + 7286 0000197D 06 push es + 7287 0000197E 1F pop ds + 7288 ;;mov ax,OPEN shl 8 + 7289 ;mov ax,OPEN*256 ; 3D00h + 7290 0000197F B8003D mov ax,3D00h ; 15/01/2023 + 7291 00001982 CD21 int 21h ; Open COMMAND.COM + 7292 00001984 1F pop ds ; * + 7293 00001985 720E jc short SetComsrBad ; No COMMAND.COM here + 7294 00001987 89C3 mov bx,ax ; Handle + 7295 00001989 B43E mov ah,3Eh ; 15/01/2023 + 7296 ;mov ah,CLOSE ; 3Eh + 7297 0000198B CD21 int 21h ; Close COMMAND.COM + 7298 SetComsrRet: + 7299 ; 15/01/2023 + 7300 0000198D 59 pop cx ; ** + 7301 0000198E 5E pop si ; *** + 7302 + 7303 ; MSDOS 6.0 + 7304 0000198F 1F pop ds ; **** ; + 7305 ;assume ds:ResGroup ; + 7306 ; + 7307 00001990 0E push cs ; Make sure local ES is + 7308 00001991 07 pop es ; restored + 7309 00001992 E96FFD jmp Parse_command_line ; continue parsing command line + 7310 + 7311 ; MSDOS 3.3 + 7312 ;ARGSDONEJ2: + 7313 ;jcxz ARGSDONE + 7314 ;jmp CHKARG + 7315 + 7316 ; 16/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 7317 SetComsrBad: + 7318 ; MSDOS 3.3 & MSDOS 6.0 + 7319 ;mov dx,offset ResGroup:BadComlkMsg ; dx = ptr to msg + 7320 00001995 BA[FB21] mov dx,BADCOMLKMES + 7321 + 7322 ; Note: we're about to make a near call to TriageError, which + 7323 ; lives in a different segment and group. Some linkers will + 7324 ; generate a warning like "Possible fix-up overflow". We're + 7325 ; ok, though, because we all fit in 64 KB and, at init time, + 7326 ; we're still all together. + 7327 + 7328 ; 16/01/2023 + 7329 ;TRIAGEERROR equ TRANSTART+TriageError + 7330 ;(MSDOS 5.0 COMMAND.COM, 2320h+2D92h) + 7331 + 7332 ; 06/06/2023 + 7333 TRIAGEERROR equ TRANSTART+TriageError + 7334 ;(MSDOS 6.22 COMMAND.COM, 26E0h+333Ch) + 7335 + 7336 ;;;call 50B2h ; MSDOS 5.0 COMMAND.COM + 7337 ;;call 5A1Ch ; MSDOS 6.22 COMMAND.COM + 7338 ; 18/07/2024 + 7339 ;call 5A6Ch ; PCDOS 7.1 COMMAND.COM + 7340 00001998 E8(7D58) call TRIAGEERROR ; TRIAGEERROR procedure is at offset 354Eh + 7341 ; in original MSDOS 3.3 COMMAND.COM + 7342 + 7343 ; TriageError procedure is at offset 50B2h + 7344 ; in original MSDOS 5.0 COMMAND.COM + 7345 0000199B 83F841 cmp ax,65 + 7346 0000199E 7503 jne short doprt + 7347 ;mov dx,offset ResGroup:BadComaccMsg ; dx = ptr to msg + 7348 000019A0 BA[2422] mov dx,BADCOMACCMSG + 7349 doprt: + 7350 000019A3 E835FA call RPrint + 7351 ;mov si,offset ResGroup:ComSpect + 7352 000019A6 BE[2820] mov si,COMSPECT ; "\COMMAND.COM" + 7353 ;;mov di,[ECOMLOC] + 7354 ; 06/06/2023 + 7355 000019A9 8B3E[6B20] mov di,[ComspOffset] ; MSDOS 6.22 COMMAND.COM + 7356 ; 16/01/2023 + 7357 ;mov di,ECOMSPEC ; mov di,0Eh ; MSDOS 5.0 COMMAND.COM + 7358 000019AD B90E00 mov cx,14 + 7359 000019B0 F3A4 rep movsb ; get my default back + 7360 + 7361 000019B2 EBD9 jmp short SetComsrRet 7362 - 7363 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 7364 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1A99h (CODERES:0C49h) - 7365 ArgsDone: - 7366 ; MSDOS 6.0 - 7367 000019B4 8E06[3A04] mov es,[EnvirSeg] ; get environment back - 7368 ;assume es:nothing ; - 7369 - 7370 ; MSDOS 3.3 & MSDOS 6.0 - 7371 000019B8 803E[A202]00 cmp byte [PermCom],0 - 7372 000019BD 742E jz short ComReturns - 7373 - 7374 000019BF 06 push es ; Save environment pointer - 7375 000019C0 B450 mov ah,50h - 7376 ;mov ah,SET_CURRENT_PDB ; 50h - 7377 000019C2 8CDB mov bx,ds - 7378 000019C4 8EC3 mov es,bx - 7379 000019C6 CD21 int 21h ; current process is me - 7380 000019C8 BF0A00 mov di,PDB.EXIT ; mov di,0Ah ; Diddle the addresses in my header - 7381 ;;mov ax,offset RESGROUP:LODCOM - 7382 ;mov ax,LODCOM - 7383 ; 16/01/2023 - 7384 000019CB B8[E000] mov ax,LodCom_Trap - 7385 000019CE AB stosw - 7386 000019CF 8CD8 mov ax,ds - 7387 000019D1 AB stosw - 7388 ;;mov ax,offset RESGROUP:CONTC - 7389 ;mov ax,CONTC - 7390 ; 16/01/2023 - 7391 000019D2 B8[AC00] mov ax,Ctrlc_Trap - 7392 000019D5 AB stosw - 7393 000019D6 8CD8 mov ax,ds - 7394 000019D8 AB stosw - 7395 ;;mov ax,offset DATARES:CritErr_Trap ; MSDOS 6.0 - 7396 ;mov ax,CRITERR - 7397 ; 16/01/2023 - 7398 000019D9 B8[B700] mov ax,CritErr_Trap - 7399 000019DC AB stosw - 7400 000019DD 8CD8 mov ax,ds - 7401 000019DF AB stosw - 7402 ;;mov word ptr ds:16h,ds - 7403 ;mov word ptr ds:[Pdb_Parent_Pid],ds ; Parent is me forever - 7404 000019E0 8C1E1600 mov [PDB.PARENT_PID],ds - 7405 ;;mov dx,offset RESGROUP:Int_2e - 7406 ;mov dx,Int_2e - 7407 ; 16/01/2023 - 7408 000019E4 BA[A100] mov dx,Int2e_Trap - 7409 000019E7 B82E25 mov ax,252Eh - 7410 ;;mov ax,(SET_INTERRUPT_VECTOR SHL 8) OR 2Eh - 7411 ;mov ax,(SET_INTERRUPT_VECTOR*256) | 2Eh ; 252Eh - 7412 000019EA CD21 int 21h ; DOS - SET INTERRUPT VECTOR - 7413 ; AL = interrupt number - 7414 ; DS:DX = new vector to be used for specified interrupt - 7415 000019EC 07 pop es ; Remember environment - 7416 - 7417 ComReturns: - 7418 ;mov ax,word ptr ds:Pdb_Parent_Pid - 7419 000019ED A11600 mov ax,[PDB.PARENT_PID] ; mov ax,ds:16h - 7420 ; 16/01/2023 - 7421 000019F0 A3[3E02] mov [Parent],ax ; Save parent - 7422 ;mov word ptr ds:Pdb_Parent_Pid,ds ; Parent is me - 7423 000019F3 8C1E1600 mov [PDB.PARENT_PID],ds ; mov word ptr ds:16h,ds - 7424 ;mov ax,word ptr ds:PDB_Jfn_Table - 7425 000019F7 A11800 mov ax,[PDB.JFN_TABLE] ; mov ax,ds:18h - 7426 000019FA A3[9F02] mov [Io_Save],ax ; Get the default stdin and out - 7427 000019FD 8C1E[3E04] mov [Com_Ptr+2],ds ; Set all these to resident - 7428 00001A01 8C1E[4204] mov [Com_Fcb1+2],ds - 7429 00001A05 8C1E[4604] mov [Com_Fcb2+2],ds - 7430 ;mov di,offset ResGroup:ComSpec - 7431 00001A09 BF[4B02] mov di,ComSpec - 7432 - 7433 ;;mov si,[ECOMLOC] - 7434 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM - 7435 00001A0C 8B36[6B20] mov si,[ComspOffset] - 7436 ; 16/01/2023 - MSDOS 5.0 COMMAND.COM - 7437 ;mov si,ECOMSPEC ; mov si,0Eh - 7438 - 7439 00001A10 803E[5420]00 cmp byte [AllocedEnv],0 ; MSDOS 6.0 - 7440 ;cmp byte [CHUCKENV],0 ; MSDOS 3.3 - 7441 - 7442 00001A15 8CD8 mov ax,ds ; Xchg es,ds - 7443 00001A17 06 push es - 7444 00001A18 1F pop ds - 7445 00001A19 8EC0 mov es,ax - 7446 - 7447 ; 06/06/2023 - 7448 00001A1B 7517 jne short CopyComsp ; MSDOS 6.0 - 7449 ; 16/01/2023 - 7450 ;je short CopyComsp ; MSDOS 5.0 - 7451 ;;je short COPYCOMSP ; MSDOS 3.3 ; All set up for copy - 7452 - 7453 00001A1D 0E push cs - 7454 00001A1E 1F pop ds + 7363 ; 16/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 7364 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1927h (CODERES:0BE7h) + 7365 + 7366 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 7367 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1A99h (CODERES:0C49h) + 7368 ArgsDone: + 7369 ; MSDOS 6.0 + 7370 000019B4 8E06[3A04] mov es,[EnvirSeg] ; get environment back + 7371 ;assume es:nothing ; + 7372 + 7373 ; MSDOS 3.3 & MSDOS 6.0 + 7374 000019B8 803E[A202]00 cmp byte [PermCom],0 + 7375 000019BD 742E jz short ComReturns + 7376 + 7377 000019BF 06 push es ; Save environment pointer + 7378 000019C0 B450 mov ah,50h + 7379 ;mov ah,SET_CURRENT_PDB ; 50h + 7380 000019C2 8CDB mov bx,ds + 7381 000019C4 8EC3 mov es,bx + 7382 000019C6 CD21 int 21h ; current process is me + 7383 000019C8 BF0A00 mov di,PDB.EXIT ; mov di,0Ah ; Diddle the addresses in my header + 7384 ;;mov ax,offset RESGROUP:LODCOM + 7385 ;mov ax,LODCOM + 7386 ; 16/01/2023 + 7387 000019CB B8[E000] mov ax,LodCom_Trap + 7388 000019CE AB stosw + 7389 000019CF 8CD8 mov ax,ds + 7390 000019D1 AB stosw + 7391 ;;mov ax,offset RESGROUP:CONTC + 7392 ;mov ax,CONTC + 7393 ; 16/01/2023 + 7394 000019D2 B8[AC00] mov ax,Ctrlc_Trap + 7395 000019D5 AB stosw + 7396 000019D6 8CD8 mov ax,ds + 7397 000019D8 AB stosw + 7398 ;;mov ax,offset DATARES:CritErr_Trap ; MSDOS 6.0 + 7399 ;mov ax,CRITERR + 7400 ; 16/01/2023 + 7401 000019D9 B8[B700] mov ax,CritErr_Trap + 7402 000019DC AB stosw + 7403 000019DD 8CD8 mov ax,ds + 7404 000019DF AB stosw + 7405 ;;mov word ptr ds:16h,ds + 7406 ;mov word ptr ds:[Pdb_Parent_Pid],ds ; Parent is me forever + 7407 000019E0 8C1E1600 mov [PDB.PARENT_PID],ds + 7408 ;;mov dx,offset RESGROUP:Int_2e + 7409 ;mov dx,Int_2e + 7410 ; 16/01/2023 + 7411 000019E4 BA[A100] mov dx,Int2e_Trap + 7412 000019E7 B82E25 mov ax,252Eh + 7413 ;;mov ax,(SET_INTERRUPT_VECTOR SHL 8) OR 2Eh + 7414 ;mov ax,(SET_INTERRUPT_VECTOR*256) | 2Eh ; 252Eh + 7415 000019EA CD21 int 21h ; DOS - SET INTERRUPT VECTOR + 7416 ; AL = interrupt number + 7417 ; DS:DX = new vector to be used for specified interrupt + 7418 000019EC 07 pop es ; Remember environment + 7419 + 7420 ComReturns: + 7421 ;mov ax,word ptr ds:Pdb_Parent_Pid + 7422 000019ED A11600 mov ax,[PDB.PARENT_PID] ; mov ax,ds:16h + 7423 ; 16/01/2023 + 7424 000019F0 A3[3E02] mov [Parent],ax ; Save parent + 7425 ;mov word ptr ds:Pdb_Parent_Pid,ds ; Parent is me + 7426 000019F3 8C1E1600 mov [PDB.PARENT_PID],ds ; mov word ptr ds:16h,ds + 7427 ;mov ax,word ptr ds:PDB_Jfn_Table + 7428 000019F7 A11800 mov ax,[PDB.JFN_TABLE] ; mov ax,ds:18h + 7429 000019FA A3[9F02] mov [Io_Save],ax ; Get the default stdin and out + 7430 000019FD 8C1E[3E04] mov [Com_Ptr+2],ds ; Set all these to resident + 7431 00001A01 8C1E[4204] mov [Com_Fcb1+2],ds + 7432 00001A05 8C1E[4604] mov [Com_Fcb2+2],ds + 7433 ;mov di,offset ResGroup:ComSpec + 7434 00001A09 BF[4B02] mov di,ComSpec + 7435 + 7436 ;;mov si,[ECOMLOC] + 7437 ; 06/06/2023 - MSDOS 6.22 COMMAND.COM + 7438 00001A0C 8B36[6B20] mov si,[ComspOffset] + 7439 ; 16/01/2023 - MSDOS 5.0 COMMAND.COM + 7440 ;mov si,ECOMSPEC ; mov si,0Eh + 7441 + 7442 00001A10 803E[5420]00 cmp byte [AllocedEnv],0 ; MSDOS 6.0 + 7443 ;cmp byte [CHUCKENV],0 ; MSDOS 3.3 + 7444 + 7445 00001A15 8CD8 mov ax,ds ; Xchg es,ds + 7446 00001A17 06 push es + 7447 00001A18 1F pop ds + 7448 00001A19 8EC0 mov es,ax + 7449 + 7450 ; 06/06/2023 + 7451 00001A1B 7517 jne short CopyComsp ; MSDOS 6.0 + 7452 ; 16/01/2023 + 7453 ;je short CopyComsp ; MSDOS 5.0 + 7454 ;;je short COPYCOMSP ; MSDOS 3.3 ; All set up for copy 7455 - 7456 ;mov si,offset ResGroup:ComspString - 7457 00001A1F BE[6D20] mov si,ComspString ; "COMSPEC=\COMMAND.COM" - 7458 00001A22 06 push es - 7459 00001A23 57 push di - 7460 00001A24 E89A02 call IfindE - 7461 00001A27 89FE mov si,di - 7462 00001A29 06 push es - 7463 00001A2A 1F pop ds - 7464 00001A2B 5F pop di - 7465 00001A2C 07 pop es - 7466 00001A2D 7305 jnc short CopyComsp - 7467 - 7468 ; 06/06/2023 - 7469 ; MSDOS 6.0 - 7470 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1B04h - 7471 ComSpecNofnd: - 7472 ;;mov si,offset ResGroup:ComspString - 7473 ;mov si,ComspString ; "COMSPEC=\COMMAND.COM" - 7474 ;add si,ComspStrLen ; add si,8 - 7475 00001A2F BE[7520] mov si,ComspString+ComspStrLen - 7476 - 7477 ;; 21/01/2023 - 7478 ;; MSDOS 5.0 COMMAND.COM - RESGROUP:19A1h - 7479 ;;mov si,0Eh - 7480 ;mov si,ECOMSPEC - 7481 - 7482 00001A32 0E push cs - 7483 00001A33 1F pop ds - 7484 - 7485 ; 21/01/2023 - 7486 ;COMSPECNOFND: - 7487 ; MSDOS 3.3 - 7488 ;;mov si,[es:ECOMLOC] - 7489 ;mov si,[es:COMSPOFFSET] - 7490 ;;add si,offset RESGROUP:PATHSTRING - 7491 ;add si,PATHSTRING ; "PATH=" - 7492 ;push cs - 7493 ;pop ds - 7494 - 7495 CopyComsp: - 7496 ; 21/01/2023 - 7497 ;COPYCOMSP: - 7498 ; MSDOS 3.3 & MSDOS 6.0 - 7499 ;;mov es:PutBackComSpec.SubstPtr,di - 7500 ;mov [es:PUTBACKSUBSTPTR],di ; Save ptr to beginning of comspec path - 7501 00001A34 26893E[2A02] mov [es:PutBackComSpec],di - 7502 00001A39 807C013A cmp byte [si+1],':' ; Is there a drive specifier in comspec - 7503 00001A3D 7506 jne short CopyComspLoop ; If not, do not skip over first 2 bytes - 7504 ;;add es:PutBackComSpec.SubstPtr,2 - 7505 ;add word [es:PUTBACKSUBSTPTR],2 - 7506 00001A3F 268306[2A02]02 add word [es:PutBackComSpec],2 - 7507 CopyComspLoop: - 7508 00001A45 AC lodsb - 7509 00001A46 AA stosb - 7510 00001A47 08C0 or al,al - 7511 00001A49 75FA jnz short CopyComspLoop - 7512 - 7513 00001A4B 26893E[8B02] mov [es:ComSpec_End],di ; Save ptr to end of comspec path - 7514 00001A50 26FF0E[8B02] dec word [es:ComSpec_End] - 7515 00001A55 268A26[9402] mov ah,[es:ComDrv] - 7516 00001A5A 80C440 add ah,'A'-1 ; 40h - 7517 00001A5D 268826[2F02] mov [es:PutBackDrv],ah ; save drive letter - 7518 - 7519 ; 21/01/2023 - Retrro DOS v4.0 (& v4.1) COMMAND.COM - 7520 - 7521 ; MSDOS 6.0 - 7522 00001A62 E8E702 call setup_for_messages ; set up parse and extended error messages - 7523 - 7524 ; The routine below sets up the exact resident size of COMMAND. If this is not - 7525 ; the first COMMAND, then the resident code is not duplicated and the resident - 7526 ; size is just the data. If we are the first COMMAND, it checks if we are to - 7527 ; be loaded into HIMEM. If not, then the resident size includes the code and - 7528 ; the data otherwise it is just the data. - 7529 - 7530 00001A65 E88603 call Setup_res_end ; put resident size in ResSize - 7531 - 7532 00001A68 0E push cs - 7533 00001A69 1F pop ds - 7534 ;assume ds:RESGROUP - 7535 - 7536 ;Public EnvMaximum - 7537 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 7538 EnvMaximum: ; MSDOS 5.0 COMMAND.COM - RESGROUP:19DCh - 7539 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM - 7540 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1B53h - 7541 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 7542 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1B53h - 7543 - 7544 ; 21/01/2023 - 7545 ; MSDOS 6.0 - 7546 ;;mov si,offset RESGROUP:TranStart - 7547 ;;mov si,2320h ; MSDOS 5.0 COMMAND.COM - 7548 ; 06/06/2023 - 7549 ;;mov si,26E0h ; MSDOS 6.22 COMMAND.COM - 7550 ;mov si,TRANSTART - 7551 ;add si,100h - 7552 ; 23/04/2023 - 7553 00001A6A BED028 mov si,TRANSTART+100h - 7554 - 7555 ;;mov cx,offset TRANGROUP:TranDataEnd - 100H - 7556 ;;mov cx,87C2h ; MSDOS 5.0 COMMAND.COM - 7557 ; 06/06/2023 - 7558 ;;mov cx,9D53h ; MSDOS 6.22 COMMAND.COM - 7559 ; 18/07/2024 - 7560 ;mov cx,9B47h ; PCDOS 7.1 COMMAND.COM - 7561 00001A6D B9[B896] mov cx,TRANDATAEND-100h - 7562 - 7563 00001A70 FC cld - 7564 00001A71 D1E9 shr cx,1 - 7565 00001A73 31D2 xor dx,dx - 7566 Ichksum: - 7567 00001A75 AD lodsw - 7568 00001A76 01C2 add dx,ax - 7569 00001A78 83D200 adc dx,0 - 7570 00001A7B E2F8 loop Ichksum - 7571 - 7572 00001A7D 8916[9702] mov [Sum],dx ; store checksum - 7573 - 7574 00001A81 803E[4720]00 cmp byte [PRDATTM],0 - 7575 00001A86 750C jne short NoBatchSeg ; don't do autoexec or date time - 7576 - 7577 ; Allocate batch segment for d:/autoexec.bat + no arguments - 7578 - 7579 ;mov bx,((SIZE BatchSegment) + 15 + 1 + 0fh)/16 - 7580 ; 21/01/2023 - 7581 ;mov bx,4 - 7582 00001A88 BB0400 mov bx,((BATCHSEGMENT.SIZE)+16+0Fh)/16 ; (33+16+15)/16 - 7583 00001A8B B448 mov ah,48h - 7584 ;mov ah,ALLOC ; - 7585 00001A8D CD21 int 21h ; - 7586 00001A8F 7203 jc short NoBatchSeg ; didn't allocate - pretend no batch - 7587 00001A91 A3[4902] mov [Batch],ax ; save batch segment - 7588 - 7589 NoBatchSeg: - 7590 ; 21/01/2023 - 7591 ; MSDOS 6.0 (& MSDOS 5.0) - 7592 00001A94 8B1E[3A04] mov bx,[EnvirSeg] ; get old environment segment - 7593 00001A98 891E[8620] mov [OldEnv],bx ; save it - 7594 00001A9C C706[8820]0000 mov word [UsedEnv],0 ; initialize env size counter - 7595 00001AA2 8EDB mov ds,bx - 7596 ;assume ds:nothing - 7597 - 7598 00001AA4 31F6 xor si,si - 7599 00001AA6 89F7 mov di,si - 7600 - 7601 ; This is the maximum allowed size for the environment - 7602 - 7603 ; 21/01/2023 - 7604 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1A1Eh - 7605 ;mov bx,4096 - 1 ; 0FFFh ; max. allowed env. size - 7606 ;;mov [ss:EnvMax],bx - 7607 ;shl bx,1 - 7608 ;shl bx,1 - 7609 ;shl bx,1 + 7456 00001A1D 0E push cs + 7457 00001A1E 1F pop ds + 7458 + 7459 ;mov si,offset ResGroup:ComspString + 7460 00001A1F BE[6D20] mov si,ComspString ; "COMSPEC=\COMMAND.COM" + 7461 00001A22 06 push es + 7462 00001A23 57 push di + 7463 00001A24 E89A02 call IfindE + 7464 00001A27 89FE mov si,di + 7465 00001A29 06 push es + 7466 00001A2A 1F pop ds + 7467 00001A2B 5F pop di + 7468 00001A2C 07 pop es + 7469 00001A2D 7305 jnc short CopyComsp + 7470 + 7471 ; 06/06/2023 + 7472 ; MSDOS 6.0 + 7473 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1B04h + 7474 ComSpecNofnd: + 7475 ;;mov si,offset ResGroup:ComspString + 7476 ;mov si,ComspString ; "COMSPEC=\COMMAND.COM" + 7477 ;add si,ComspStrLen ; add si,8 + 7478 00001A2F BE[7520] mov si,ComspString+ComspStrLen + 7479 + 7480 ;; 21/01/2023 + 7481 ;; MSDOS 5.0 COMMAND.COM - RESGROUP:19A1h + 7482 ;;mov si,0Eh + 7483 ;mov si,ECOMSPEC + 7484 + 7485 00001A32 0E push cs + 7486 00001A33 1F pop ds + 7487 + 7488 ; 21/01/2023 + 7489 ;COMSPECNOFND: + 7490 ; MSDOS 3.3 + 7491 ;;mov si,[es:ECOMLOC] + 7492 ;mov si,[es:COMSPOFFSET] + 7493 ;;add si,offset RESGROUP:PATHSTRING + 7494 ;add si,PATHSTRING ; "PATH=" + 7495 ;push cs + 7496 ;pop ds + 7497 + 7498 CopyComsp: + 7499 ; 21/01/2023 + 7500 ;COPYCOMSP: + 7501 ; MSDOS 3.3 & MSDOS 6.0 + 7502 ;;mov es:PutBackComSpec.SubstPtr,di + 7503 ;mov [es:PUTBACKSUBSTPTR],di ; Save ptr to beginning of comspec path + 7504 00001A34 26893E[2A02] mov [es:PutBackComSpec],di + 7505 00001A39 807C013A cmp byte [si+1],':' ; Is there a drive specifier in comspec + 7506 00001A3D 7506 jne short CopyComspLoop ; If not, do not skip over first 2 bytes + 7507 ;;add es:PutBackComSpec.SubstPtr,2 + 7508 ;add word [es:PUTBACKSUBSTPTR],2 + 7509 00001A3F 268306[2A02]02 add word [es:PutBackComSpec],2 + 7510 CopyComspLoop: + 7511 00001A45 AC lodsb + 7512 00001A46 AA stosb + 7513 00001A47 08C0 or al,al + 7514 00001A49 75FA jnz short CopyComspLoop + 7515 + 7516 00001A4B 26893E[8B02] mov [es:ComSpec_End],di ; Save ptr to end of comspec path + 7517 00001A50 26FF0E[8B02] dec word [es:ComSpec_End] + 7518 00001A55 268A26[9402] mov ah,[es:ComDrv] + 7519 00001A5A 80C440 add ah,'A'-1 ; 40h + 7520 00001A5D 268826[2F02] mov [es:PutBackDrv],ah ; save drive letter + 7521 + 7522 ; 21/01/2023 - Retrro DOS v4.0 (& v4.1) COMMAND.COM + 7523 + 7524 ; MSDOS 6.0 + 7525 00001A62 E8E702 call setup_for_messages ; set up parse and extended error messages + 7526 + 7527 ; The routine below sets up the exact resident size of COMMAND. If this is not + 7528 ; the first COMMAND, then the resident code is not duplicated and the resident + 7529 ; size is just the data. If we are the first COMMAND, it checks if we are to + 7530 ; be loaded into HIMEM. If not, then the resident size includes the code and + 7531 ; the data otherwise it is just the data. + 7532 + 7533 00001A65 E88603 call Setup_res_end ; put resident size in ResSize + 7534 + 7535 00001A68 0E push cs + 7536 00001A69 1F pop ds + 7537 ;assume ds:RESGROUP + 7538 + 7539 ;Public EnvMaximum + 7540 ; 14/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 7541 EnvMaximum: ; MSDOS 5.0 COMMAND.COM - RESGROUP:19DCh + 7542 ; 06/06/2023 - Retro DOS v4.2 COMMAND.COM + 7543 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1B53h + 7544 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 7545 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1B53h + 7546 + 7547 ; 21/01/2023 + 7548 ; MSDOS 6.0 + 7549 ;;mov si,offset RESGROUP:TranStart + 7550 ;;mov si,2320h ; MSDOS 5.0 COMMAND.COM + 7551 ; 06/06/2023 + 7552 ;;mov si,26E0h ; MSDOS 6.22 COMMAND.COM + 7553 ;mov si,TRANSTART + 7554 ;add si,100h + 7555 ; 23/04/2023 + 7556 00001A6A BED028 mov si,TRANSTART+100h + 7557 + 7558 ;;mov cx,offset TRANGROUP:TranDataEnd - 100H + 7559 ;;mov cx,87C2h ; MSDOS 5.0 COMMAND.COM + 7560 ; 06/06/2023 + 7561 ;;mov cx,9D53h ; MSDOS 6.22 COMMAND.COM + 7562 ; 18/07/2024 + 7563 ;mov cx,9B47h ; PCDOS 7.1 COMMAND.COM + 7564 00001A6D B9[B896] mov cx,TRANDATAEND-100h + 7565 + 7566 00001A70 FC cld + 7567 00001A71 D1E9 shr cx,1 + 7568 00001A73 31D2 xor dx,dx + 7569 Ichksum: + 7570 00001A75 AD lodsw + 7571 00001A76 01C2 add dx,ax + 7572 00001A78 83D200 adc dx,0 + 7573 00001A7B E2F8 loop Ichksum + 7574 + 7575 00001A7D 8916[9702] mov [Sum],dx ; store checksum + 7576 + 7577 00001A81 803E[4720]00 cmp byte [PRDATTM],0 + 7578 00001A86 750C jne short NoBatchSeg ; don't do autoexec or date time + 7579 + 7580 ; Allocate batch segment for d:/autoexec.bat + no arguments + 7581 + 7582 ;mov bx,((SIZE BatchSegment) + 15 + 1 + 0fh)/16 + 7583 ; 21/01/2023 + 7584 ;mov bx,4 + 7585 00001A88 BB0400 mov bx,((BATCHSEGMENT.SIZE)+16+0Fh)/16 ; (33+16+15)/16 + 7586 00001A8B B448 mov ah,48h + 7587 ;mov ah,ALLOC ; + 7588 00001A8D CD21 int 21h ; + 7589 00001A8F 7203 jc short NoBatchSeg ; didn't allocate - pretend no batch + 7590 00001A91 A3[4902] mov [Batch],ax ; save batch segment + 7591 + 7592 NoBatchSeg: + 7593 ; 21/01/2023 + 7594 ; MSDOS 6.0 (& MSDOS 5.0) + 7595 00001A94 8B1E[3A04] mov bx,[EnvirSeg] ; get old environment segment + 7596 00001A98 891E[8620] mov [OldEnv],bx ; save it + 7597 00001A9C C706[8820]0000 mov word [UsedEnv],0 ; initialize env size counter + 7598 00001AA2 8EDB mov ds,bx + 7599 ;assume ds:nothing + 7600 + 7601 00001AA4 31F6 xor si,si + 7602 00001AA6 89F7 mov di,si + 7603 + 7604 ; This is the maximum allowed size for the environment + 7605 + 7606 ; 21/01/2023 + 7607 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1A1Eh + 7608 ;mov bx,4096 - 1 ; 0FFFh ; max. allowed env. size + 7609 ;;mov [ss:EnvMax],bx 7610 ;shl bx,1 - 7611 00001AA8 BBF0FF mov bx,(4096-1)<<4 ; mov bx,0FFF0h - 7612 00001AAB 36891E[8420] mov [ss:EnvMax], bx ; convert envmax to bytes - 7613 00001AB0 4B dec bx ; dec by one to leave room for double 0 - 7614 00001AB1 31D2 xor dx,dx ; use dx to indicate that there was - 7615 ; no environment size error. - 7616 ;public NxtStr - 7617 NxtStr: - 7618 00001AB3 E8E101 call GetStrLen ; get the size of the current env string - 7619 - 7620 ;Bugbug: Can use ss here to address UsedEnv - 7621 - 7622 00001AB6 1E push ds ; get addressability to environment - 7623 00001AB7 0E push cs ; counter - 7624 00001AB8 1F pop ds ; - 7625 ;assume ds:ResGroup - 7626 00001AB9 010E[8820] add [UsedEnv],cx ; add the string length to env size - 7627 00001ABD 1F pop ds ; - 7628 ;assume ds:nothing - 7629 - 7630 00001ABE 83F901 cmp cx,1 ; end of environment was encountered. - 7631 00001AC1 7405 je short EnvExit - 7632 00001AC3 29CB sub bx,cx - 7633 ;jae short OkCpyStr ; can't fit in all of enviroment. - 7634 ; 21/01/2023 - 7635 00001AC5 73EC jae short NxtStr - 7636 00001AC7 42 inc dx ; out of env space msg must be displayed - 7637 ;jmp short EnvExit - 7638 - 7639 ;OkCpyStr: - 7640 ;jmp short NxtStr + 7611 ;shl bx,1 + 7612 ;shl bx,1 + 7613 ;shl bx,1 + 7614 00001AA8 BBF0FF mov bx,(4096-1)<<4 ; mov bx,0FFF0h + 7615 00001AAB 36891E[8420] mov [ss:EnvMax], bx ; convert envmax to bytes + 7616 00001AB0 4B dec bx ; dec by one to leave room for double 0 + 7617 00001AB1 31D2 xor dx,dx ; use dx to indicate that there was + 7618 ; no environment size error. + 7619 ;public NxtStr + 7620 NxtStr: + 7621 00001AB3 E8E101 call GetStrLen ; get the size of the current env string + 7622 + 7623 ;Bugbug: Can use ss here to address UsedEnv + 7624 + 7625 00001AB6 1E push ds ; get addressability to environment + 7626 00001AB7 0E push cs ; counter + 7627 00001AB8 1F pop ds ; + 7628 ;assume ds:ResGroup + 7629 00001AB9 010E[8820] add [UsedEnv],cx ; add the string length to env size + 7630 00001ABD 1F pop ds ; + 7631 ;assume ds:nothing + 7632 + 7633 00001ABE 83F901 cmp cx,1 ; end of environment was encountered. + 7634 00001AC1 7405 je short EnvExit + 7635 00001AC3 29CB sub bx,cx + 7636 ;jae short OkCpyStr ; can't fit in all of enviroment. + 7637 ; 21/01/2023 + 7638 00001AC5 73EC jae short NxtStr + 7639 00001AC7 42 inc dx ; out of env space msg must be displayed + 7640 ;jmp short EnvExit 7641 - 7642 EnvExit: - 7643 00001AC8 0E push cs - 7644 00001AC9 1F pop ds - 7645 ;assume ds:ResGroup - 7646 00001ACA 09D2 or dx,dx ; dx will be non-zero if error - 7647 00001ACC 7406 jz short EnvNoErr - 7648 ;mov dx,offset ResGroup:OutEnvMsg ; dx = ptr to msg - 7649 00001ACE BA[7B21] mov dx,OUTENVMSG - 7650 00001AD1 E807F9 call RPrint - 7651 EnvNoErr: - 7652 00001AD4 A1[8220] mov ax,[EnvSiz] ; env size previously set - 7653 00001AD7 B104 mov cl,4 - 7654 00001AD9 D3E0 shl ax,cl ; get size in bytes - 7655 00001ADB 3B06[8820] cmp ax,[UsedEnv] ; is it a new env? - 7656 00001ADF 7706 ja short st_envsize ; yes, store the size - 7657 00001AE1 A1[8820] mov ax,[UsedEnv] - 7658 00001AE4 83C00F add ax,15 ; round up - 7659 st_envsize: - 7660 00001AE7 D3E8 shr ax,cl - 7661 00001AE9 A3[8220] mov [EnvSiz],ax ; store env size needed(paras) - 7662 - 7663 ;if MSVER - 7664 ;cmp SingleCom,0 - 7665 ;jnz nophead ; don't print header if SingleCom - 7666 ;mov dx,offset ResGroup:CopyrightMsg ; dx = ptr to msg - 7667 ;call RPrint - 7668 ;nophead: - 7669 ;endif - 7670 ; 21/01/2023 - 7671 - 7672 ; MSDOS 3.3 & 6.0 - 7673 00001AEC 833E[4902]00 cmp word [Batch],0 ; did we set up a batch segment? - 7674 00001AF1 7503 jnz short DoDate ; yes - go initialize it - 7675 00001AF3 E99300 jmp NoDttm ; don't do autoexec or date time - 7676 - 7677 DoDate: - 7678 - 7679 ; allocate batch segment for d:/autoexec.bat + no arguments - 7680 - 7681 00001AF6 A1[4902] mov ax,[Batch] ; get batch segment - 7682 00001AF9 C606[9D02]03 mov byte [EchoFlag],3 ; set batch echo - 7683 00001AFE C706[AE02]0100 mov word [Nest],1 ; set nest flag to 1 batch - 7684 00001B04 8EC0 mov es,ax - 7685 - 7686 ; initialize the segment - 7687 - 7688 00001B06 31FF xor di,di - 7689 ;;mov al,0 - 7690 ;mov al,BATCHTYPE ; 0 - 7691 ; 06/06/2023 - 7692 00001B08 31C0 xor ax,ax - 7693 00001B0A AA stosb - 7694 ;mov al,1 ; initialize echo for batch exit - 7695 ;inc al - 7696 ; 22/07/2024 - 7697 00001B0B 40 inc ax - 7698 00001B0C AA stosb - 7699 - 7700 ; Hosebag! This guy does not use the struct fields to init the BatchSegment - 7701 - 7702 ;xor ax,ax ; initialize to zero - 7703 ; 06/06/2023 - 7704 ;dec al ; ax = 0 - 7705 ; 22/07/2024 - 7706 00001B0D 48 dec ax - 7707 - 7708 ; 21/01/2023 - 7709 00001B0E AA stosb ; MSDOS 6.0 ; clear out BatchEOF + 7642 ;OkCpyStr: + 7643 ;jmp short NxtStr + 7644 + 7645 EnvExit: + 7646 00001AC8 0E push cs + 7647 00001AC9 1F pop ds + 7648 ;assume ds:ResGroup + 7649 00001ACA 09D2 or dx,dx ; dx will be non-zero if error + 7650 00001ACC 7406 jz short EnvNoErr + 7651 ;mov dx,offset ResGroup:OutEnvMsg ; dx = ptr to msg + 7652 00001ACE BA[7B21] mov dx,OUTENVMSG + 7653 00001AD1 E807F9 call RPrint + 7654 EnvNoErr: + 7655 00001AD4 A1[8220] mov ax,[EnvSiz] ; env size previously set + 7656 00001AD7 B104 mov cl,4 + 7657 00001AD9 D3E0 shl ax,cl ; get size in bytes + 7658 00001ADB 3B06[8820] cmp ax,[UsedEnv] ; is it a new env? + 7659 00001ADF 7706 ja short st_envsize ; yes, store the size + 7660 00001AE1 A1[8820] mov ax,[UsedEnv] + 7661 00001AE4 83C00F add ax,15 ; round up + 7662 st_envsize: + 7663 00001AE7 D3E8 shr ax,cl + 7664 00001AE9 A3[8220] mov [EnvSiz],ax ; store env size needed(paras) + 7665 + 7666 ;if MSVER + 7667 ;cmp SingleCom,0 + 7668 ;jnz nophead ; don't print header if SingleCom + 7669 ;mov dx,offset ResGroup:CopyrightMsg ; dx = ptr to msg + 7670 ;call RPrint + 7671 ;nophead: + 7672 ;endif + 7673 ; 21/01/2023 + 7674 + 7675 ; MSDOS 3.3 & 6.0 + 7676 00001AEC 833E[4902]00 cmp word [Batch],0 ; did we set up a batch segment? + 7677 00001AF1 7503 jnz short DoDate ; yes - go initialize it + 7678 00001AF3 E99300 jmp NoDttm ; don't do autoexec or date time + 7679 + 7680 DoDate: + 7681 + 7682 ; allocate batch segment for d:/autoexec.bat + no arguments + 7683 + 7684 00001AF6 A1[4902] mov ax,[Batch] ; get batch segment + 7685 00001AF9 C606[9D02]03 mov byte [EchoFlag],3 ; set batch echo + 7686 00001AFE C706[AE02]0100 mov word [Nest],1 ; set nest flag to 1 batch + 7687 00001B04 8EC0 mov es,ax + 7688 + 7689 ; initialize the segment + 7690 + 7691 00001B06 31FF xor di,di + 7692 ;;mov al,0 + 7693 ;mov al,BATCHTYPE ; 0 + 7694 ; 06/06/2023 + 7695 00001B08 31C0 xor ax,ax + 7696 00001B0A AA stosb + 7697 ;mov al,1 ; initialize echo for batch exit + 7698 ;inc al + 7699 ; 22/07/2024 + 7700 00001B0B 40 inc ax + 7701 00001B0C AA stosb + 7702 + 7703 ; Hosebag! This guy does not use the struct fields to init the BatchSegment + 7704 + 7705 ;xor ax,ax ; initialize to zero + 7706 ; 06/06/2023 + 7707 ;dec al ; ax = 0 + 7708 ; 22/07/2024 + 7709 00001B0D 48 dec ax 7710 - 7711 00001B0F AB stosw ; batch segment of last job - batlast - 7712 00001B10 AB stosw ; segment for FOR - 7713 00001B11 AA stosb ; FOR flag - 7714 00001B12 AB stosw ; position in file - batseek - 7715 00001B13 AB stosw - 7716 - 7717 ; clean out the parameters - 7718 - 7719 ;mov ax,-1 ; initialize to no parameters - 7720 ; 06/06/2023 - 7721 00001B14 48 dec ax ; ax = -1 - 7722 - 7723 00001B15 B90A00 mov cx,10 - 7724 00001B18 F3AB rep stosw + 7711 ; 21/01/2023 + 7712 00001B0E AA stosb ; MSDOS 6.0 ; clear out BatchEOF + 7713 + 7714 00001B0F AB stosw ; batch segment of last job - batlast + 7715 00001B10 AB stosw ; segment for FOR + 7716 00001B11 AA stosb ; FOR flag + 7717 00001B12 AB stosw ; position in file - batseek + 7718 00001B13 AB stosw + 7719 + 7720 ; clean out the parameters + 7721 + 7722 ;mov ax,-1 ; initialize to no parameters + 7723 ; 06/06/2023 + 7724 00001B14 48 dec ax ; ax = -1 7725 - 7726 ; decide whether we should grab the default drive - 7727 - 7728 00001B1A 803E[3620]00 cmp byte [AUTOBAT],0 ; ":\AUTOEXEC.BAT" - 7729 00001B1F 7509 jne short NoAutSet - 7730 00001B21 B419 mov ah,19h ; 21/01/2023 - 7731 ;mov ah,GET_DEFAULT_DRIVE ; 19h - 7732 00001B23 CD21 int 21h - 7733 ;;add al,'A' - 7734 ;add al,[letter_A] ; Ucasea - 7735 ;add al,[ucasea] ; 21/01/2023 - 7736 ; 21/01/2023 - 7737 00001B25 0441 add al,'A' - 7738 00001B27 A2[3620] mov [AUTOBAT],al - 7739 - 7740 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 7741 %if 0 - 7742 ; 21/01/2023 - 7743 ; 06/06/2023 - 7744 mov [KAUTOBAT],al - 7745 %endif - 7746 - 7747 NoAutSet: - 7748 - 7749 ; copy in the batch file name (including nul) - 7750 - 7751 ;mov si,offset ResGroup:AutoBat - 7752 00001B2A BE[3620] mov si,AUTOBAT - 7753 00001B2D B90800 mov cx,8 - 7754 00001B30 F3A5 rep movsw - 7755 ; 23/04/2023 - 7756 00001B32 A4 movsb ; MSDOS 6.0 ; move in carriage return to terminate string - 7757 - 7758 ;mov dx,offset ResGroup:AutoBat - 7759 00001B33 BA[3620] mov dx,AUTOBAT ; ":\AUTOEXEC.BAT" + 7726 00001B15 B90A00 mov cx,10 + 7727 00001B18 F3AB rep stosw + 7728 + 7729 ; decide whether we should grab the default drive + 7730 + 7731 00001B1A 803E[3620]00 cmp byte [AUTOBAT],0 ; ":\AUTOEXEC.BAT" + 7732 00001B1F 7509 jne short NoAutSet + 7733 00001B21 B419 mov ah,19h ; 21/01/2023 + 7734 ;mov ah,GET_DEFAULT_DRIVE ; 19h + 7735 00001B23 CD21 int 21h + 7736 ;;add al,'A' + 7737 ;add al,[letter_A] ; Ucasea + 7738 ;add al,[ucasea] ; 21/01/2023 + 7739 ; 21/01/2023 + 7740 00001B25 0441 add al,'A' + 7741 00001B27 A2[3620] mov [AUTOBAT],al + 7742 + 7743 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 7744 %if 0 + 7745 ; 21/01/2023 + 7746 ; 06/06/2023 + 7747 mov [KAUTOBAT],al + 7748 %endif + 7749 + 7750 NoAutSet: + 7751 + 7752 ; copy in the batch file name (including nul) + 7753 + 7754 ;mov si,offset ResGroup:AutoBat + 7755 00001B2A BE[3620] mov si,AUTOBAT + 7756 00001B2D B90800 mov cx,8 + 7757 00001B30 F3A5 rep movsw + 7758 ; 23/04/2023 + 7759 00001B32 A4 movsb ; MSDOS 6.0 ; move in carriage return to terminate string 7760 - 7761 ;;mov ax,OPEN shl 8 - 7762 00001B36 B8003D mov ax,3D00h ; 21/01/2023 - 7763 ;mov ax,OPEN*256 ; 3D00h ; open for read - 7764 00001B39 CD21 int 21h ; see if autoexec.bat exists - 7765 00001B3B 7208 jc short noabat - 7766 00001B3D 89C3 mov bx,ax - 7767 00001B3F B43E mov ah,3Eh ; 21/01/2023 - 7768 ;mov ah,CLOSE ; 3Eh - 7769 00001B41 CD21 int 21h - 7770 ;jmp Drv0 ; go process autoexec - 7771 ; 22/07/2024 - 7772 00001B43 EB51 jmp short Drv0 - 7773 - 7774 noabat: - 7775 00001B45 50 push ax - 7776 00001B46 E85701 call Setup_Seg - 7777 00001B49 A3[5220] mov [triage_add+2],ax - 7778 00001B4C 58 pop ax - 7779 00001B4D FF1E[5020] call far [triage_add] ; get extended error - 7780 00001B51 83F841 cmp ax,65 ; network access denied? - 7781 ;jne short OPENERR ; no - go deallocate batch - 7782 ; 21/01/2023 - 7783 ;;je short AccDenErr - 7784 ; 22/07/2024 - 7785 00001B54 7506 jne short OpenErr - 7786 ; 06/06/2023 - 7787 ;je short AccDenErr - 7788 - 7789 ; 21/01/2023 - 7790 ;_ACCDENERROR: ; yes - put out message - 7791 ; ;mov dx,offset ResGroup:AccDen ; dx = ptr to msg - 7792 ; mov dx,ACCDENERR - 7793 ; call RPRINT - 7794 - 7795 ; 21/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 7796 - 7797 ; MSDOS 6.0 (& MSDOS 5.0) - 7798 - 7799 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 7800 ; 06/06/2023 - 7801 ; 21/01/2023 - 7802 %if 0 - 7803 - 7804 ; If AUTOEXEC.BAT is not found, then check for KAUTOEXE.BAT. Changed - 7805 ; by Ellen to check only when in Korea. The country information - 7806 ; returned will overlay the old parse data area, but we don't care - 7807 ; since we won't need the parse information or country information. - 7808 ; We only care about the country code returned in BX. - 7809 - 7810 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1AE7h - 7811 ; 06/06/2023 - 7812 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1C5Eh - 7813 - 7814 ;mov dx,offset ResGroup:Internat_Info ; set up internat vars - 7815 mov dx,INTERNAT_INFO - 7816 mov ax,3800h - 7817 ;mov ax,INTERNATIONAL<<8 - 7818 ;;mov ax,INTERNATIONAL shl 8 ; get country dependent info - 7819 int 21h ; - 7820 jc short NoKabat ; error - don't bother with it - 7821 cmp bx,52h - 7822 ;cmp bx,KOREA_COUNTRY_CODE ; are we speaking korean? - 7823 jne short OpenErr ; no, don't check for kautoexe - 7824 - 7825 ;mov di,BatFile ; 3/3/kk - 7826 mov di,20h - 7827 ;mov si,offset ResGroup:KautoBat ; another trial to do 3/3/kk - 7828 mov si,KAUTOBAT - 7829 mov cx,8 ; auto execution for the 3/3/kk - 7830 rep movsw ; non-english country 3/3/kk - 7831 movsb ; move in carraige return to terminate string - 7832 ;mov dx,offset ResGroup:KautoBat ; 3/3/kk - 7833 mov dx,KAUTOBAT - 7834 mov ax,3D00h - 7835 ;mov ax,OPEN<<8 - 7836 ;;mov ax,OPEN shl 8 ; 3/3/kk - 7837 int 21h ; see if kautoexe.bat exists 3/3/kk - 7838 jc short NoKabat ; 3/3/kk - 7839 mov bx,ax ; 3/3/kk - 7840 mov ah,3Eh - 7841 ;mov ah,CLOSE ; 3/3/kk - 7842 int 21h ; 3/3/kk - 7843 jmp short Drv0 ; 3/3/kk - 7844 - 7845 NoKabat: ; 3/3/kk - 7846 call far [triage_add] ; get extended error - 7847 cmp ax,65 ; network access denied? - 7848 jnz short OpenErr ; no - go deallocate batch - 7849 - 7850 %endif - 7851 ; 06/06/2023 - Retro DOS 4.2 COMMAND.COM - 7852 ; 21/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 7853 - 7854 AccDenErr: ; yes - put out message - 7855 ;mov dx,offset ResGroup:AccDen ; dx = ptr to msg - 7856 00001B56 BA[D006] mov dx,ACCDEN - 7857 00001B59 E87FF8 call RPrint - 7858 OpenErr: - 7859 ;OPENERR: - 7860 00001B5C 8E06[4902] mov es,[Batch] ; not found--turn off batch job - 7861 00001B60 B449 mov ah,49h - 7862 ;mov ah,DEALLOC ; 49h - 7863 00001B62 CD21 int 21h - 7864 00001B64 C706[4902]0000 mov word [Batch],0 ; after dealloc in case of ^c - 7865 00001B6A C606[9D02]01 mov byte [EchoFlag],1 - 7866 00001B6F C706[AE02]0000 mov word [Nest],0 ; indicate no batch in progress - 7867 ;DoDttm: - 7868 ;mov ax,offset TranGroup:Datinit - 7869 00001B75 B8[9C32] mov ax,DATINIT - 7870 00001B78 A3[4820] mov [INITADD],ax - 7871 - 7872 ; MSDOS 6.0 - 7873 ;;M004;;mov ax,TrnSeg - 7874 ; - 7875 ; M004; We cant use TrnSeg now because it is not initialized. We now that - 7876 ; M004; the transient starts on a para boundary at the label TranStart. - 7877 ; M004; We use TranStart to get the start of the transient segment. - 7878 - 7879 ; 21/01/2023 - 7880 ;mov ax,offset RESGROUP:TranStart ; M004 - 7881 ;;mov ax,2320h ; MSDOS 5.0 COMMAND.COM - 7882 ; 06/06/2023 - 7883 ;mov ax,26E0h ; MSDOS 6.22 COMMAND.COM - 7884 ; - 7885 ;mov ax,TRANSTART - 7886 ;mov cl,4 ; M004 - 7887 ;shr ax,cl ; get relative seg ; M004 - 7888 ; 06/06/2023 - 7889 00001B7B B87D02 mov ax,TRANSTART>>4 - 7890 - 7891 00001B7E 8CC9 mov cx,cs - 7892 00001B80 01C8 add ax,cx ; ax = transient seg ; M004 + 7761 ;mov dx,offset ResGroup:AutoBat + 7762 00001B33 BA[3620] mov dx,AUTOBAT ; ":\AUTOEXEC.BAT" + 7763 + 7764 ;;mov ax,OPEN shl 8 + 7765 00001B36 B8003D mov ax,3D00h ; 21/01/2023 + 7766 ;mov ax,OPEN*256 ; 3D00h ; open for read + 7767 00001B39 CD21 int 21h ; see if autoexec.bat exists + 7768 00001B3B 7208 jc short noabat + 7769 00001B3D 89C3 mov bx,ax + 7770 00001B3F B43E mov ah,3Eh ; 21/01/2023 + 7771 ;mov ah,CLOSE ; 3Eh + 7772 00001B41 CD21 int 21h + 7773 ;jmp Drv0 ; go process autoexec + 7774 ; 22/07/2024 + 7775 00001B43 EB51 jmp short Drv0 + 7776 + 7777 noabat: + 7778 00001B45 50 push ax + 7779 00001B46 E85701 call Setup_Seg + 7780 00001B49 A3[5220] mov [triage_add+2],ax + 7781 00001B4C 58 pop ax + 7782 00001B4D FF1E[5020] call far [triage_add] ; get extended error + 7783 00001B51 83F841 cmp ax,65 ; network access denied? + 7784 ;jne short OPENERR ; no - go deallocate batch + 7785 ; 21/01/2023 + 7786 ;;je short AccDenErr + 7787 ; 22/07/2024 + 7788 00001B54 7506 jne short OpenErr + 7789 ; 06/06/2023 + 7790 ;je short AccDenErr + 7791 + 7792 ; 21/01/2023 + 7793 ;_ACCDENERROR: ; yes - put out message + 7794 ; ;mov dx,offset ResGroup:AccDen ; dx = ptr to msg + 7795 ; mov dx,ACCDENERR + 7796 ; call RPRINT + 7797 + 7798 ; 21/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 7799 + 7800 ; MSDOS 6.0 (& MSDOS 5.0) + 7801 + 7802 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 7803 ; 06/06/2023 + 7804 ; 21/01/2023 + 7805 %if 0 + 7806 + 7807 ; If AUTOEXEC.BAT is not found, then check for KAUTOEXE.BAT. Changed + 7808 ; by Ellen to check only when in Korea. The country information + 7809 ; returned will overlay the old parse data area, but we don't care + 7810 ; since we won't need the parse information or country information. + 7811 ; We only care about the country code returned in BX. + 7812 + 7813 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1AE7h + 7814 ; 06/06/2023 + 7815 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1C5Eh + 7816 + 7817 ;mov dx,offset ResGroup:Internat_Info ; set up internat vars + 7818 mov dx,INTERNAT_INFO + 7819 mov ax,3800h + 7820 ;mov ax,INTERNATIONAL<<8 + 7821 ;;mov ax,INTERNATIONAL shl 8 ; get country dependent info + 7822 int 21h ; + 7823 jc short NoKabat ; error - don't bother with it + 7824 cmp bx,52h + 7825 ;cmp bx,KOREA_COUNTRY_CODE ; are we speaking korean? + 7826 jne short OpenErr ; no, don't check for kautoexe + 7827 + 7828 ;mov di,BatFile ; 3/3/kk + 7829 mov di,20h + 7830 ;mov si,offset ResGroup:KautoBat ; another trial to do 3/3/kk + 7831 mov si,KAUTOBAT + 7832 mov cx,8 ; auto execution for the 3/3/kk + 7833 rep movsw ; non-english country 3/3/kk + 7834 movsb ; move in carraige return to terminate string + 7835 ;mov dx,offset ResGroup:KautoBat ; 3/3/kk + 7836 mov dx,KAUTOBAT + 7837 mov ax,3D00h + 7838 ;mov ax,OPEN<<8 + 7839 ;;mov ax,OPEN shl 8 ; 3/3/kk + 7840 int 21h ; see if kautoexe.bat exists 3/3/kk + 7841 jc short NoKabat ; 3/3/kk + 7842 mov bx,ax ; 3/3/kk + 7843 mov ah,3Eh + 7844 ;mov ah,CLOSE ; 3/3/kk + 7845 int 21h ; 3/3/kk + 7846 jmp short Drv0 ; 3/3/kk + 7847 + 7848 NoKabat: ; 3/3/kk + 7849 call far [triage_add] ; get extended error + 7850 cmp ax,65 ; network access denied? + 7851 jnz short OpenErr ; no - go deallocate batch + 7852 + 7853 %endif + 7854 ; 06/06/2023 - Retro DOS 4.2 COMMAND.COM + 7855 ; 21/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 7856 + 7857 AccDenErr: ; yes - put out message + 7858 ;mov dx,offset ResGroup:AccDen ; dx = ptr to msg + 7859 00001B56 BA[D006] mov dx,ACCDEN + 7860 00001B59 E87FF8 call RPrint + 7861 OpenErr: + 7862 ;OPENERR: + 7863 00001B5C 8E06[4902] mov es,[Batch] ; not found--turn off batch job + 7864 00001B60 B449 mov ah,49h + 7865 ;mov ah,DEALLOC ; 49h + 7866 00001B62 CD21 int 21h + 7867 00001B64 C706[4902]0000 mov word [Batch],0 ; after dealloc in case of ^c + 7868 00001B6A C606[9D02]01 mov byte [EchoFlag],1 + 7869 00001B6F C706[AE02]0000 mov word [Nest],0 ; indicate no batch in progress + 7870 ;DoDttm: + 7871 ;mov ax,offset TranGroup:Datinit + 7872 00001B75 B8[9C32] mov ax,DATINIT + 7873 00001B78 A3[4820] mov [INITADD],ax + 7874 + 7875 ; MSDOS 6.0 + 7876 ;;M004;;mov ax,TrnSeg + 7877 ; + 7878 ; M004; We cant use TrnSeg now because it is not initialized. We now that + 7879 ; M004; the transient starts on a para boundary at the label TranStart. + 7880 ; M004; We use TranStart to get the start of the transient segment. + 7881 + 7882 ; 21/01/2023 + 7883 ;mov ax,offset RESGROUP:TranStart ; M004 + 7884 ;;mov ax,2320h ; MSDOS 5.0 COMMAND.COM + 7885 ; 06/06/2023 + 7886 ;mov ax,26E0h ; MSDOS 6.22 COMMAND.COM + 7887 ; + 7888 ;mov ax,TRANSTART + 7889 ;mov cl,4 ; M004 + 7890 ;shr ax,cl ; get relative seg ; M004 + 7891 ; 06/06/2023 + 7892 00001B7B B87D02 mov ax,TRANSTART>>4 7893 - 7894 ; 21/01/2023 - 7895 ; MSDOS 3.3 - 7896 ; 25/09/2018 - 7897 ;mov ax,[TrnSeg] ; COMMAND.COM (MSDOS 3.3) - Offset 1387h - 7898 - 7899 ; MSDOS 3.3 & MSDOS 6.0 - 7900 00001B82 A3[4A20] mov [INITADD+2],ax - 7901 ;call dword ptr InitAdd - 7902 00001B85 FF1E[4820] call far [INITADD] - 7903 - 7904 NoDttm: - 7905 ; MSDOS 6.0 - 7906 ; 21/01/2023 - 7907 ;Copyright: - 7908 ;public Copyright - 7909 ; Bugbug: remove Copyright label. - 7910 - 7911 ;if IBMVER - 7912 00001B89 833E[A502]00 cmp word [SingleCom],0 - 7913 00001B8E 7506 jnz short Drv0 ; don't print header if SingleCom - 7914 ;mov dx,offset ResGroup:CopyrightMsg ; dx = ptr to msg - 7915 00001B90 BA[9621] mov dx,COPYRIGHTMSG - 7916 00001B93 E845F8 call RPrint - 7917 ;endif - 7918 ; 21/01/2023 - 7919 ; MSDOS 3.3 - 7920 ;cmp word [SingleCom],0 ; don't print header if SingleCom - 7921 ;jnz short DRV0 - 7922 ;mov dx,HEADERPTR ; dx = ptr to msg - 7923 ;call RPRINT - 7924 ;DRV0: - 7925 ; MSDOS 3.3 - 7926 ;mov byte [INITFLAG],0 - 7927 ;jmp ENDINIT - 7928 - 7929 ; 21/01/2023 - 7930 ; MSDOS 6.0 - 7931 Drv0: ; Reset APPEND state - 7932 00001B96 1E push ds ; save data segment - 7933 00001B97 0E push cs ; Get local segment into DS - 7934 00001B98 1F pop ds ; - 7935 00001B99 B807B7 mov ax,0B707h ; 21/01/2023 - 7936 ;mov ax,APPENDSETSTATE ; Set the state of Append - 7937 00001B9C 8B1E[BE02] mov bx,[Append_State] ; back to the original state - 7938 00001BA0 CD2F int 2Fh ; - 7939 00001BA2 1F pop ds ; get data segment back - 7940 - 7941 ;Check FirstCom set previously to see if this is the first instance of - 7942 ;command.com. If not, we do not move command.com. Instead, we copy over the - 7943 ;jump table from the previous stub to the current stub. - 7944 - 7945 00001BA3 803E[9926]01 cmp byte [FirstCom],1 ; first command.com? - 7946 00001BA8 7431 jz short move_code ; yes, move it + 7894 00001B7E 8CC9 mov cx,cs + 7895 00001B80 01C8 add ax,cx ; ax = transient seg ; M004 + 7896 + 7897 ; 21/01/2023 + 7898 ; MSDOS 3.3 + 7899 ; 25/09/2018 + 7900 ;mov ax,[TrnSeg] ; COMMAND.COM (MSDOS 3.3) - Offset 1387h + 7901 + 7902 ; MSDOS 3.3 & MSDOS 6.0 + 7903 00001B82 A3[4A20] mov [INITADD+2],ax + 7904 ;call dword ptr InitAdd + 7905 00001B85 FF1E[4820] call far [INITADD] + 7906 + 7907 NoDttm: + 7908 ; MSDOS 6.0 + 7909 ; 21/01/2023 + 7910 ;Copyright: + 7911 ;public Copyright + 7912 ; Bugbug: remove Copyright label. + 7913 + 7914 ;if IBMVER + 7915 00001B89 833E[A502]00 cmp word [SingleCom],0 + 7916 00001B8E 7506 jnz short Drv0 ; don't print header if SingleCom + 7917 ;mov dx,offset ResGroup:CopyrightMsg ; dx = ptr to msg + 7918 00001B90 BA[9621] mov dx,COPYRIGHTMSG + 7919 00001B93 E845F8 call RPrint + 7920 ;endif + 7921 ; 21/01/2023 + 7922 ; MSDOS 3.3 + 7923 ;cmp word [SingleCom],0 ; don't print header if SingleCom + 7924 ;jnz short DRV0 + 7925 ;mov dx,HEADERPTR ; dx = ptr to msg + 7926 ;call RPRINT + 7927 ;DRV0: + 7928 ; MSDOS 3.3 + 7929 ;mov byte [INITFLAG],0 + 7930 ;jmp ENDINIT + 7931 + 7932 ; 21/01/2023 + 7933 ; MSDOS 6.0 + 7934 Drv0: ; Reset APPEND state + 7935 00001B96 1E push ds ; save data segment + 7936 00001B97 0E push cs ; Get local segment into DS + 7937 00001B98 1F pop ds ; + 7938 00001B99 B807B7 mov ax,0B707h ; 21/01/2023 + 7939 ;mov ax,APPENDSETSTATE ; Set the state of Append + 7940 00001B9C 8B1E[BE02] mov bx,[Append_State] ; back to the original state + 7941 00001BA0 CD2F int 2Fh ; + 7942 00001BA2 1F pop ds ; get data segment back + 7943 + 7944 ;Check FirstCom set previously to see if this is the first instance of + 7945 ;command.com. If not, we do not move command.com. Instead, we copy over the + 7946 ;jump table from the previous stub to the current stub. 7947 - 7948 00001BAA 06 push es - 7949 00001BAB 1E push ds + 7948 00001BA3 803E[9926]01 cmp byte [FirstCom],1 ; first command.com? + 7949 00001BA8 7431 jz short move_code ; yes, move it 7950 - 7951 00001BAC 1E push ds - 7952 00001BAD 07 pop es - 7953 ;mov di,offset DATARES:Int2f_Entry - 7954 00001BAE BF[6600] mov di,Int2f_Entry - 7955 - 7956 ;mov ds,[es:ResJmpTable+2] ; get segment address - 7957 ;mov si,[es:ResJmpTable] ; get offset address - 7958 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 7959 00001BB1 26C536[9526] lds si,[es:ResJmpTable] - 7960 - 7961 ;mov cx,11 - 7962 ;;mov cx,NUM_RELOC_ENTRIES ; number of dword ptrs - 7963 ;shl cx,1 - 7964 ;shl cx,1 ; size of table in bytes - 7965 ; 21/01/2023 - 7966 00001BB6 B92C00 mov cx,44 ; size of table in bytes - 7967 - 7968 00001BB9 FC cld - 7969 00001BBA F3A4 rep movsb ; copy the jump table + 7951 00001BAA 06 push es + 7952 00001BAB 1E push ds + 7953 + 7954 00001BAC 1E push ds + 7955 00001BAD 07 pop es + 7956 ;mov di,offset DATARES:Int2f_Entry + 7957 00001BAE BF[6600] mov di,Int2f_Entry + 7958 + 7959 ;mov ds,[es:ResJmpTable+2] ; get segment address + 7960 ;mov si,[es:ResJmpTable] ; get offset address + 7961 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 7962 00001BB1 26C536[9526] lds si,[es:ResJmpTable] + 7963 + 7964 ;mov cx,11 + 7965 ;;mov cx,NUM_RELOC_ENTRIES ; number of dword ptrs + 7966 ;shl cx,1 + 7967 ;shl cx,1 ; size of table in bytes + 7968 ; 21/01/2023 + 7969 00001BB6 B92C00 mov cx,44 ; size of table in bytes 7970 - 7971 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 7972 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1D6Ch - 7973 %if 1 - 7974 00001BBC A0[FA01] mov al,[cox_location] ; "cox" - 7975 00001BBF 26A2[FA01] mov [es:cox_location],al ; "cox" - 7976 00001BC3 A1[FB01] mov ax,[cox_location+1] - 7977 00001BC6 A3[FB01] mov [cox_location+1],ax - 7978 %endif - 7979 - 7980 ;Check if the resident code is in HMA. We assume that it is in HMA if its - 7981 ;code segment > 0f000h. If in HMA, we set the ComInHMA flag + 7971 00001BB9 FC cld + 7972 00001BBA F3A4 rep movsb ; copy the jump table + 7973 + 7974 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 7975 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1D6Ch + 7976 %if 1 + 7977 00001BBC A0[FA01] mov al,[cox_location] ; "cox" + 7978 00001BBF 26A2[FA01] mov [es:cox_location],al ; "cox" + 7979 00001BC3 A1[FB01] mov ax,[cox_location+1] + 7980 00001BC6 A3[FB01] mov [cox_location+1],ax + 7981 %endif 7982 - 7983 00001BC9 26817DFE00F0 cmp word [es:di-2],0F000h ; is resident code in HMA? - 7984 00001BCF 7206 jb short res_low ; no, dont set flag + 7983 ;Check if the resident code is in HMA. We assume that it is in HMA if its + 7984 ;code segment > 0f000h. If in HMA, we set the ComInHMA flag 7985 - 7986 00001BD1 26C606[9600]01 mov byte [es:ComInHMA],1 ; indicate code in HMA - 7987 res_low: - 7988 00001BD7 1F pop ds - 7989 00001BD8 07 pop es - 7990 00001BD9 EB03 jmp short finish_init - 7991 - 7992 ;Now, we can move the resident code to its final location, either to HIMEM - 7993 ;or to overlay the messages in the data segment if the user has not used the - 7994 ;/msg switch. - 7995 - 7996 move_code: - 7997 00001BDB E85702 call Move_res_code ; move the code + 7986 00001BC9 26817DFE00F0 cmp word [es:di-2],0F000h ; is resident code in HMA? + 7987 00001BCF 7206 jb short res_low ; no, dont set flag + 7988 + 7989 00001BD1 26C606[9600]01 mov byte [es:ComInHMA],1 ; indicate code in HMA + 7990 res_low: + 7991 00001BD7 1F pop ds + 7992 00001BD8 07 pop es + 7993 00001BD9 EB03 jmp short finish_init + 7994 + 7995 ;Now, we can move the resident code to its final location, either to HIMEM + 7996 ;or to overlay the messages in the data segment if the user has not used the + 7997 ;/msg switch. 7998 - 7999 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 8000 ; PCDOS 7.1 COMMAND.COM - 8001 %if 0 - 8002 finish_init: - 8003 ;jmp RESGROUP:EndInit ; finish initializing - 8004 jmp EndInit - 8005 %else - 8006 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1D8Fh - 8007 finish_init: - 8008 00001BDE 803E[A202]01 cmp byte [PermCom],1 - 8009 00001BE3 7523 jne short finish_init_@ - 8010 00001BE5 803E[0E04]01 cmp byte [COMMAND_HIGH],1 ; COMMAND.COM will be moved to HMA/UMB - 8011 00001BEA 751C jne short finish_init_@ - 8012 00001BEC BB4000 mov bx,40h ; high memory first fit - 8013 00001BEF B80158 mov ax,5801h ; set allocation strategy - 8014 00001BF2 CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 8015 ; AL = function code: set allocation strategy - 8016 00001BF4 BB0100 mov bx,1 ; add UMBs to DOS memory chain - 8017 00001BF7 B80358 mov ax,5803h ; set UMB link state - 8018 00001BFA CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 8019 ; AL = function code: (DOS 5beta) set UMB link state - 8020 00001BFC 720A jb short finish_init_@ - 8021 00001BFE 8B1E[B404] mov bx,[ResSize] - 8022 00001C02 B448 mov ah,48h - 8023 00001C04 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 8024 ; BX = number of 16-byte paragraphs desired - 8025 00001C06 7303 jnb short patch_segments_hma - 8026 finish_init_@: - 8027 00001C08 E90AE7 jmp EndInit - 8028 - 8029 patch_segments_hma: - 8030 ;mov [ds:0Ch],ax - 8031 00001C0B A30C00 mov [PDB.EXIT+2],ax - 8032 ;mov [ds:10h],ax - 8033 00001C0E A31000 mov [PDB.CTRL_C+2],ax - 8034 ;mov [ds:14h],ax - 8035 00001C11 A31400 mov [PDB.FATAL_ABORT+2],ax - 8036 ;mov [ds:16h],ax - 8037 00001C14 A31600 mov [PDB.PARENT_PID],ax - 8038 ;mov [ds:36h],ax - 8039 00001C17 A33600 mov [PDB.JFN_Pointer+2],ax - 8040 00001C1A A3[3E02] mov [Parent],ax - 8041 00001C1D A3[4202] mov [OldTerm+2],ax - 8042 00001C20 A3[3E04] mov [Com_Ptr+2],ax - 8043 00001C23 A3[4204] mov [Com_Fcb1+2],ax - 8044 00001C26 A3[4604] mov [Com_Fcb2+2],ax - 8045 00001C29 A3[4A04] mov [MySeg],ax - 8046 00001C2C A3[5204] mov [MySeg1],ax - 8047 00001C2F A3[5604] mov [MySeg2],ax - 8048 00001C32 A3[5607] mov [MySeg3],ax - 8049 00001C35 A3[2801] mov [int2fh_segm],ax ; [Carousel_i2f_Hook+3] ; 23/07/2024 - 8050 ;mov di,(offset Int2f_Entry+2) - 8051 00001C38 BF[6800] mov di,Int2f_Entry+2 - 8052 00001C3B 833DFF cmp word [di],0FFFFh - 8053 00001C3E 7409 jz short already_hma - 8054 00001C40 B10B mov cl,11 ; NUM_RELOC_ENTRIES - 8055 patch_entry_seg: - 8056 00001C42 8905 mov [di],ax - 8057 00001C44 83C704 add di,4 - 8058 00001C47 E2F9 loop patch_entry_seg - 8059 already_hma: - 8060 00001C49 8EC0 mov es,ax - 8061 00001C4B 31F6 xor si,si - 8062 00001C4D 31FF xor di,di - 8063 00001C4F B103 mov cl,3 ; BX = resident part size in paragraphs - 8064 ; after shifting: resident part size in words - 8065 00001C51 D3E3 shl bx,cl ; move resident part of COMMAND.COM to HMA (UMB) - 8066 00001C53 89D9 mov cx,bx ; number of words - 8067 00001C55 F3A5 rep movsw - 8068 00001C57 1E push ds - 8069 00001C58 8ED9 mov ds,cx ; 0 - 8070 ;mov [ds:0BAh],ax ; INT 2Eh segment - 8071 00001C5A A3BA00 mov [(2Eh*4)+2],ax - 8072 00001C5D 40 inc ax - 8073 ;mov [ds:0BEh],ax ; INT 2Fh segment - 8074 00001C5E A3BE00 mov [(2Fh*4)+2],ax - 8075 00001C61 1F pop ds - 8076 00001C62 8CC3 mov bx,es - 8077 00001C64 B450 mov ah,50h - 8078 00001C66 CD21 int 21h ; DOS - 2+ internal - SET PSP SEGMENT - 8079 ; BX = segment address of new PSP - 8080 00001C68 4B dec bx - 8081 00001C69 8EC3 mov es,bx ; memory arena header (segment) - 8082 00001C6B 43 inc bx ; PSP (program) address/segment - 8083 ;mov [es:1],bx - 8084 ;mov [es:ARENA.owner],bx - 8085 00001C6C 26891E0100 mov [es:arena_owner],bx - 8086 ;mov word [es:8],4F43h ; 'CO' ; [es:arena_name] - 8087 00001C71 26C7060800434F mov word [es:arena_name],4F43h - 8088 ;mov word [es:0Ah],4D4Dh ; 'MM' - 8089 00001C78 26C7060A004D4D mov word [es:arena_name+2],4D4Dh - 8090 ;mov word [es:0Ch],4E41h ; 'AN' - 8091 00001C7F 26C7060C00414E mov word [es:arena_name+4],4E41h - 8092 ;mov word [es:0Eh],44h ; 'D' - 8093 00001C86 26C7060E004400 mov word [es:arena_name+6],44h - 8094 00001C8D FE06[0E04] inc byte [COMMAND_HIGH] ; = 2 - 8095 ; Resident portion of COMMAND.COM is - 8096 ; in HMA/UMB flag (=2) - 8097 00001C91 53 push bx - 8098 ;mov ax,offset EndInit - 8099 00001C92 B8[1503] mov ax,EndInit - 8100 00001C95 50 push ax - 8101 00001C96 CB retf - 8102 %endif - 8103 - 8104 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8105 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1BA8h (CODERES:0E68h) + 7999 move_code: + 8000 00001BDB E85702 call Move_res_code ; move the code + 8001 + 8002 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 8003 ; PCDOS 7.1 COMMAND.COM + 8004 %if 0 + 8005 finish_init: + 8006 ;jmp RESGROUP:EndInit ; finish initializing + 8007 jmp EndInit + 8008 %else + 8009 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1D8Fh + 8010 finish_init: + 8011 00001BDE 803E[A202]01 cmp byte [PermCom],1 + 8012 00001BE3 7523 jne short finish_init_@ + 8013 00001BE5 803E[0E04]01 cmp byte [COMMAND_HIGH],1 ; COMMAND.COM will be moved to HMA/UMB + 8014 00001BEA 751C jne short finish_init_@ + 8015 00001BEC BB4000 mov bx,40h ; high memory first fit + 8016 00001BEF B80158 mov ax,5801h ; set allocation strategy + 8017 00001BF2 CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 8018 ; AL = function code: set allocation strategy + 8019 00001BF4 BB0100 mov bx,1 ; add UMBs to DOS memory chain + 8020 00001BF7 B80358 mov ax,5803h ; set UMB link state + 8021 00001BFA CD21 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 8022 ; AL = function code: (DOS 5beta) set UMB link state + 8023 00001BFC 720A jb short finish_init_@ + 8024 00001BFE 8B1E[B404] mov bx,[ResSize] + 8025 00001C02 B448 mov ah,48h + 8026 00001C04 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 8027 ; BX = number of 16-byte paragraphs desired + 8028 00001C06 7303 jnb short patch_segments_hma + 8029 finish_init_@: + 8030 00001C08 E90AE7 jmp EndInit + 8031 + 8032 patch_segments_hma: + 8033 ;mov [ds:0Ch],ax + 8034 00001C0B A30C00 mov [PDB.EXIT+2],ax + 8035 ;mov [ds:10h],ax + 8036 00001C0E A31000 mov [PDB.CTRL_C+2],ax + 8037 ;mov [ds:14h],ax + 8038 00001C11 A31400 mov [PDB.FATAL_ABORT+2],ax + 8039 ;mov [ds:16h],ax + 8040 00001C14 A31600 mov [PDB.PARENT_PID],ax + 8041 ;mov [ds:36h],ax + 8042 00001C17 A33600 mov [PDB.JFN_Pointer+2],ax + 8043 00001C1A A3[3E02] mov [Parent],ax + 8044 00001C1D A3[4202] mov [OldTerm+2],ax + 8045 00001C20 A3[3E04] mov [Com_Ptr+2],ax + 8046 00001C23 A3[4204] mov [Com_Fcb1+2],ax + 8047 00001C26 A3[4604] mov [Com_Fcb2+2],ax + 8048 00001C29 A3[4A04] mov [MySeg],ax + 8049 00001C2C A3[5204] mov [MySeg1],ax + 8050 00001C2F A3[5604] mov [MySeg2],ax + 8051 00001C32 A3[5607] mov [MySeg3],ax + 8052 00001C35 A3[2801] mov [int2fh_segm],ax ; [Carousel_i2f_Hook+3] ; 23/07/2024 + 8053 ;mov di,(offset Int2f_Entry+2) + 8054 00001C38 BF[6800] mov di,Int2f_Entry+2 + 8055 00001C3B 833DFF cmp word [di],0FFFFh + 8056 00001C3E 7409 jz short already_hma + 8057 00001C40 B10B mov cl,11 ; NUM_RELOC_ENTRIES + 8058 patch_entry_seg: + 8059 00001C42 8905 mov [di],ax + 8060 00001C44 83C704 add di,4 + 8061 00001C47 E2F9 loop patch_entry_seg + 8062 already_hma: + 8063 00001C49 8EC0 mov es,ax + 8064 00001C4B 31F6 xor si,si + 8065 00001C4D 31FF xor di,di + 8066 00001C4F B103 mov cl,3 ; BX = resident part size in paragraphs + 8067 ; after shifting: resident part size in words + 8068 00001C51 D3E3 shl bx,cl ; move resident part of COMMAND.COM to HMA (UMB) + 8069 00001C53 89D9 mov cx,bx ; number of words + 8070 00001C55 F3A5 rep movsw + 8071 00001C57 1E push ds + 8072 00001C58 8ED9 mov ds,cx ; 0 + 8073 ;mov [ds:0BAh],ax ; INT 2Eh segment + 8074 00001C5A A3BA00 mov [(2Eh*4)+2],ax + 8075 00001C5D 40 inc ax + 8076 ;mov [ds:0BEh],ax ; INT 2Fh segment + 8077 00001C5E A3BE00 mov [(2Fh*4)+2],ax + 8078 00001C61 1F pop ds + 8079 00001C62 8CC3 mov bx,es + 8080 00001C64 B450 mov ah,50h + 8081 00001C66 CD21 int 21h ; DOS - 2+ internal - SET PSP SEGMENT + 8082 ; BX = segment address of new PSP + 8083 00001C68 4B dec bx + 8084 00001C69 8EC3 mov es,bx ; memory arena header (segment) + 8085 00001C6B 43 inc bx ; PSP (program) address/segment + 8086 ;mov [es:1],bx + 8087 ;mov [es:ARENA.owner],bx + 8088 00001C6C 26891E0100 mov [es:arena_owner],bx + 8089 ;mov word [es:8],4F43h ; 'CO' ; [es:arena_name] + 8090 00001C71 26C7060800434F mov word [es:arena_name],4F43h + 8091 ;mov word [es:0Ah],4D4Dh ; 'MM' + 8092 00001C78 26C7060A004D4D mov word [es:arena_name+2],4D4Dh + 8093 ;mov word [es:0Ch],4E41h ; 'AN' + 8094 00001C7F 26C7060C00414E mov word [es:arena_name+4],4E41h + 8095 ;mov word [es:0Eh],44h ; 'D' + 8096 00001C86 26C7060E004400 mov word [es:arena_name+6],44h + 8097 00001C8D FE06[0E04] inc byte [COMMAND_HIGH] ; = 2 + 8098 ; Resident portion of COMMAND.COM is + 8099 ; in HMA/UMB flag (=2) + 8100 00001C91 53 push bx + 8101 ;mov ax,offset EndInit + 8102 00001C92 B8[1503] mov ax,EndInit + 8103 00001C95 50 push ax + 8104 00001C96 CB retf + 8105 %endif 8106 - 8107 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 8108 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1E48h + 8107 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8108 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1BA8h (CODERES:0E68h) 8109 - 8110 GetStrLen: - 8111 ; Get length of string pointed to by DS:SI. Length includes NULL. - 8112 ; Length is returned in CX - 8113 - 8114 ; MSDOS 3.3 & MSDOS 6.0 - 8115 00001C97 31C9 xor cx,cx - 8116 NxtChar: - 8117 00001C99 AC lodsb - 8118 00001C9A 41 inc cx - 8119 00001C9B 08C0 or al,al - 8120 00001C9D 75FA jnz short NxtChar - 8121 00001C9F C3 retn - 8122 - 8123 ; 29/01/2023 - 8124 Setup_Seg: + 8110 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 8111 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1E48h + 8112 + 8113 GetStrLen: + 8114 ; Get length of string pointed to by DS:SI. Length includes NULL. + 8115 ; Length is returned in CX + 8116 + 8117 ; MSDOS 3.3 & MSDOS 6.0 + 8118 00001C97 31C9 xor cx,cx + 8119 NxtChar: + 8120 00001C99 AC lodsb + 8121 00001C9A 41 inc cx + 8122 00001C9B 08C0 or al,al + 8123 00001C9D 75FA jnz short NxtChar + 8124 00001C9F C3 retn 8125 - 8126 ; If the transient has been loaded in TranSeg, then we need to use that - 8127 ; segment for calls to routines in the transient area. Otherwise, the current - 8128 ; code segment is used - 8129 ; Segment returned in AX. - 8130 - 8131 ; MSDOS 3.3 & MSDOS 6.0 - 8132 00001CA0 A1[8F02] mov ax,[TrnSeg] - 8133 00001CA3 803E[9102]01 cmp byte [TrnMvFlg],1 ; Has transient portion been moved - 8134 00001CA8 7405 je short setup_end - 8135 - 8136 ;06/06/2023 - 8137 %if 0 - 8138 push bx - 8139 mov bx,cs - 8140 ;mov ax,offset ResGroup:TranStart - 8141 ;mov ax,2320h ; MSDOS 5.0 COMMAND.COM - 8142 ; 06/06/2023 - 8143 ;mov ax,26E0h ; MSDOS 6.22 COMMAND.COM - 8144 ;mov ax,TRANSTART - 8145 ;shr ax,1 - 8146 ;shr ax,1 - 8147 ;shr ax,1 + 8126 ; 29/01/2023 + 8127 Setup_Seg: + 8128 + 8129 ; If the transient has been loaded in TranSeg, then we need to use that + 8130 ; segment for calls to routines in the transient area. Otherwise, the current + 8131 ; code segment is used + 8132 ; Segment returned in AX. + 8133 + 8134 ; MSDOS 3.3 & MSDOS 6.0 + 8135 00001CA0 A1[8F02] mov ax,[TrnSeg] + 8136 00001CA3 803E[9102]01 cmp byte [TrnMvFlg],1 ; Has transient portion been moved + 8137 00001CA8 7405 je short setup_end + 8138 + 8139 ;06/06/2023 + 8140 %if 0 + 8141 push bx + 8142 mov bx,cs + 8143 ;mov ax,offset ResGroup:TranStart + 8144 ;mov ax,2320h ; MSDOS 5.0 COMMAND.COM + 8145 ; 06/06/2023 + 8146 ;mov ax,26E0h ; MSDOS 6.22 COMMAND.COM + 8147 ;mov ax,TRANSTART 8148 ;shr ax,1 - 8149 ; 29/01/2023 - 8150 mov ax,TRANSTART>>4 - 8151 add ax,bx - 8152 pop bx - 8153 %endif - 8154 ; 06/06/2023 - 8155 00001CAA 8CC8 mov ax,cs - 8156 00001CAC 057D02 add ax,TRANSTART>>4 - 8157 - 8158 setup_end: - 8159 00001CAF C3 retn + 8149 ;shr ax,1 + 8150 ;shr ax,1 + 8151 ;shr ax,1 + 8152 ; 29/01/2023 + 8153 mov ax,TRANSTART>>4 + 8154 add ax,bx + 8155 pop bx + 8156 %endif + 8157 ; 06/06/2023 + 8158 00001CAA 8CC8 mov ax,cs + 8159 00001CAC 057D02 add ax,TRANSTART>>4 8160 - 8161 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8162 ;RPRINT: - 8163 ; MSDOS 3.3 - 8164 ;push ax - 8165 ;call SETUP_SEG - 8166 ;mov [PRINTADD+2], ax - 8167 ;;call dword ptr PRINTADD - 8168 ;call far [PRINTADD] - 8169 ;pop ax - 8170 ;retn - 8171 - 8172 ; 29/01/2023 - 8173 ; MSDOS 6.0 - 8174 ;*** RPrintParse - display parse error message - 8175 ; - 8176 ; ENTRY DX = parse error # - 8177 ; - 8178 ; EXIT nothing - 8179 ; - 8180 ; USED flags - 8181 ; - 8182 ; EFFECTS - 8183 ; Message is displayed on stdout. - 8184 - 8185 RPrintParse: ;proc - 8186 ;assume ds:ResGroup,ss:ResGroup + 8161 setup_end: + 8162 00001CAF C3 retn + 8163 + 8164 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8165 ;RPRINT: + 8166 ; MSDOS 3.3 + 8167 ;push ax + 8168 ;call SETUP_SEG + 8169 ;mov [PRINTADD+2], ax + 8170 ;;call dword ptr PRINTADD + 8171 ;call far [PRINTADD] + 8172 ;pop ax + 8173 ;retn + 8174 + 8175 ; 29/01/2023 + 8176 ; MSDOS 6.0 + 8177 ;*** RPrintParse - display parse error message + 8178 ; + 8179 ; ENTRY DX = parse error # + 8180 ; + 8181 ; EXIT nothing + 8182 ; + 8183 ; USED flags + 8184 ; + 8185 ; EFFECTS + 8186 ; Message is displayed on stdout. 8187 - 8188 00001CB0 52 push dx ; preserve DX - 8189 00001CB1 87DA xchg bx,dx ; bx = parse error # - 8190 ; dx = saved BX - 8191 00001CB3 4B dec bx ; bx = parse error index, from 0 - 8192 00001CB4 D1E3 shl bx,1 ; bx = offset in word table - 8193 ;mov bx,ParsMsgPtrs[bx] ; bx = ptr to error msg - 8194 00001CB6 8B9F[E309] mov bx,[bx+PARSMSGPTRS] - 8195 00001CBA 87DA xchg bx,dx ; dx = ptr to error msg - 8196 ; bx = restored - 8197 00001CBC E81CF7 call RPrint ; print the message - 8198 00001CBF 5A pop dx ; restore DX - 8199 00001CC0 C3 retn - 8200 - 8201 ;RPrintParse endp - 8202 - 8203 ; 29/01/2023 - 8204 ;PATHCHRCMPR: - 8205 ; MSDOS 3.3 - 8206 ;push dx - 8207 ;mov dl,[slash_chr] - 8208 ;;cmp byte [RSWITCHAR],'/' - 8209 ;cmp [RSWITCHAR],dl - 8210 ;je short RNOSLASHT - 8211 ;;cmp al,'/' - 8212 ;cmp al,dl - 8213 ;je short RET41 ; zf = 1 - 8214 ;RNOSLASHT: - 8215 ;;cmp al,'\' - 8216 ;cmp al,[bslash_chr] - 8217 ;RET41: - 8218 ;pop dx - 8219 ;retn - 8220 - 8221 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8222 IfindE: - 8223 ; MSDOS 3.3 & MSDOS 6.0 - 8224 00001CC1 E80300 call ifind ; find the name - 8225 ;jc short ifind2 ; carry means not found - 8226 ;jmp short Iscasb1 ; scan for = sign - 8227 ; 29/01/2023 - 8228 00001CC4 734E jnc short Iscasb1 - 8229 ifind2: - 8230 00001CC6 C3 retn - 8231 - 8232 ; 29/01/2023 - 8233 - 8234 ; on return of find1, es:di points to beginning of name - 8235 - 8236 ifind: - 8237 00001CC7 FC cld - 8238 00001CC8 E83B00 call Icount0 ; cx = length of name - 8239 00001CCB 8E06[3A04] mov es,[EnvirSeg] - 8240 00001CCF 31FF xor di,di - 8241 ifind1: - 8242 00001CD1 51 push cx - 8243 00001CD2 56 push si - 8244 00001CD3 57 push di - 8245 ifind11: - 8246 00001CD4 AC lodsb - 8247 - 8248 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM - 8249 ; PCDOS 7.1 COMMAND.COM - 8250 %if 1 - 8251 ;ifdef DBCS - 8252 00001CD5 E8A5F7 call ITestKanj - 8253 00001CD8 740F jz short _NotKanj4 - 8254 00001CDA 4E dec si - 8255 00001CDB AD lodsw - 8256 00001CDC 47 inc di - 8257 00001CDD 47 inc di - 8258 00001CDE 263B45FE cmp ax,[es:di-2] - 8259 00001CE2 7511 jne short ifind12 - 8260 00001CE4 49 dec cx - 8261 00001CE5 E2ED loop ifind11 - 8262 00001CE7 EB0C jmp short ifind12 - 8263 _NotKanj4: - 8264 ;endif - 8265 %endif - 8266 00001CE9 E83400 call iupconv - 8267 00001CEC 47 inc di - 8268 00001CED 263A45FF cmp al,[es:di-1] - 8269 00001CF1 7502 jnz short ifind12 - 8270 00001CF3 E2DF loop ifind11 - 8271 ifind12: - 8272 00001CF5 5F pop di - 8273 00001CF6 5E pop si - 8274 00001CF7 59 pop cx - 8275 00001CF8 74CC jz short ifind2 - 8276 00001CFA 51 push cx - 8277 00001CFB E81A00 call Iscasb2 ; scan for a nul - 8278 00001CFE 59 pop cx - 8279 ;cmp byte [es:di],0 - 8280 ;jnz short ifind1 - 8281 ;stc ; indicate not found - 8282 00001CFF 26803D01 cmp byte [es:di],1 - 8283 00001D03 73CC jnb short ifind1 - 8284 ; cf=1 ; indicate not found - 8285 ;ifind2: - 8286 00001D05 C3 retn - 8287 - 8288 ; 29/01/2023 - 8289 Icount0: - 8290 00001D06 1E push ds - 8291 00001D07 07 pop es - 8292 00001D08 89F7 mov di,si - 8293 - 8294 00001D0A 57 push di ; count number of chars until "=" - 8295 00001D0B E80600 call Iscasb1 - 8296 ; 25/09/2018 - 8297 ;jmp short Icountx - 8298 ;push di ; count number of chars until nul - 8299 ;call Iscasb2 - 8300 ;Icountx: - 8301 00001D0E 59 pop cx - 8302 00001D0F 29CF sub di,cx - 8303 00001D11 87F9 xchg di,cx - 8304 00001D13 C3 retn - 8305 - 8306 Iscasb1: - 8307 ; 29/01/2023 - 8308 00001D14 B03D mov al,"=" - 8309 ;mov al,[equalsign] ; [equal_sign] ; scan for an = - 8310 00001D16 EB02 jmp short Iscasbx - 8311 Iscasb2: - 8312 00001D18 30C0 xor al,al ; scan for a nul - 8313 Iscasbx: - 8314 00001D1A B90001 mov cx,256 ; 100h - 8315 00001D1D F2AE repnz scasb - 8316 00001D1F C3 retn - 8317 - 8318 ; 29/01/2023 - 8319 ;IUPCONV: - 8320 ; MSDOS 3.3 - 8321 ;;cmp al,"a" - 8322 ;cmp al,[letter_a] - 8323 ;jb short IRET22 - 8324 ;;cmp al,"z" - 8325 ;cmp al,[letter_z] - 8326 ;ja short IRET22 - 8327 ;sub al,20h ; Lower-case changed to upper-case - 8328 ;IRET22: - 8329 ;retn - 8330 - 8331 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8332 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1C32h + 8188 RPrintParse: ;proc + 8189 ;assume ds:ResGroup,ss:ResGroup + 8190 + 8191 00001CB0 52 push dx ; preserve DX + 8192 00001CB1 87DA xchg bx,dx ; bx = parse error # + 8193 ; dx = saved BX + 8194 00001CB3 4B dec bx ; bx = parse error index, from 0 + 8195 00001CB4 D1E3 shl bx,1 ; bx = offset in word table + 8196 ;mov bx,ParsMsgPtrs[bx] ; bx = ptr to error msg + 8197 00001CB6 8B9F[E309] mov bx,[bx+PARSMSGPTRS] + 8198 00001CBA 87DA xchg bx,dx ; dx = ptr to error msg + 8199 ; bx = restored + 8200 00001CBC E81CF7 call RPrint ; print the message + 8201 00001CBF 5A pop dx ; restore DX + 8202 00001CC0 C3 retn + 8203 + 8204 ;RPrintParse endp + 8205 + 8206 ; 29/01/2023 + 8207 ;PATHCHRCMPR: + 8208 ; MSDOS 3.3 + 8209 ;push dx + 8210 ;mov dl,[slash_chr] + 8211 ;;cmp byte [RSWITCHAR],'/' + 8212 ;cmp [RSWITCHAR],dl + 8213 ;je short RNOSLASHT + 8214 ;;cmp al,'/' + 8215 ;cmp al,dl + 8216 ;je short RET41 ; zf = 1 + 8217 ;RNOSLASHT: + 8218 ;;cmp al,'\' + 8219 ;cmp al,[bslash_chr] + 8220 ;RET41: + 8221 ;pop dx + 8222 ;retn + 8223 + 8224 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8225 IfindE: + 8226 ; MSDOS 3.3 & MSDOS 6.0 + 8227 00001CC1 E80300 call ifind ; find the name + 8228 ;jc short ifind2 ; carry means not found + 8229 ;jmp short Iscasb1 ; scan for = sign + 8230 ; 29/01/2023 + 8231 00001CC4 734E jnc short Iscasb1 + 8232 ifind2: + 8233 00001CC6 C3 retn + 8234 + 8235 ; 29/01/2023 + 8236 + 8237 ; on return of find1, es:di points to beginning of name + 8238 + 8239 ifind: + 8240 00001CC7 FC cld + 8241 00001CC8 E83B00 call Icount0 ; cx = length of name + 8242 00001CCB 8E06[3A04] mov es,[EnvirSeg] + 8243 00001CCF 31FF xor di,di + 8244 ifind1: + 8245 00001CD1 51 push cx + 8246 00001CD2 56 push si + 8247 00001CD3 57 push di + 8248 ifind11: + 8249 00001CD4 AC lodsb + 8250 + 8251 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM + 8252 ; PCDOS 7.1 COMMAND.COM + 8253 %if 1 + 8254 ;ifdef DBCS + 8255 00001CD5 E8A5F7 call ITestKanj + 8256 00001CD8 740F jz short _NotKanj4 + 8257 00001CDA 4E dec si + 8258 00001CDB AD lodsw + 8259 00001CDC 47 inc di + 8260 00001CDD 47 inc di + 8261 00001CDE 263B45FE cmp ax,[es:di-2] + 8262 00001CE2 7511 jne short ifind12 + 8263 00001CE4 49 dec cx + 8264 00001CE5 E2ED loop ifind11 + 8265 00001CE7 EB0C jmp short ifind12 + 8266 _NotKanj4: + 8267 ;endif + 8268 %endif + 8269 00001CE9 E83400 call iupconv + 8270 00001CEC 47 inc di + 8271 00001CED 263A45FF cmp al,[es:di-1] + 8272 00001CF1 7502 jnz short ifind12 + 8273 00001CF3 E2DF loop ifind11 + 8274 ifind12: + 8275 00001CF5 5F pop di + 8276 00001CF6 5E pop si + 8277 00001CF7 59 pop cx + 8278 00001CF8 74CC jz short ifind2 + 8279 00001CFA 51 push cx + 8280 00001CFB E81A00 call Iscasb2 ; scan for a nul + 8281 00001CFE 59 pop cx + 8282 ;cmp byte [es:di],0 + 8283 ;jnz short ifind1 + 8284 ;stc ; indicate not found + 8285 00001CFF 26803D01 cmp byte [es:di],1 + 8286 00001D03 73CC jnb short ifind1 + 8287 ; cf=1 ; indicate not found + 8288 ;ifind2: + 8289 00001D05 C3 retn + 8290 + 8291 ; 29/01/2023 + 8292 Icount0: + 8293 00001D06 1E push ds + 8294 00001D07 07 pop es + 8295 00001D08 89F7 mov di,si + 8296 + 8297 00001D0A 57 push di ; count number of chars until "=" + 8298 00001D0B E80600 call Iscasb1 + 8299 ; 25/09/2018 + 8300 ;jmp short Icountx + 8301 ;push di ; count number of chars until nul + 8302 ;call Iscasb2 + 8303 ;Icountx: + 8304 00001D0E 59 pop cx + 8305 00001D0F 29CF sub di,cx + 8306 00001D11 87F9 xchg di,cx + 8307 00001D13 C3 retn + 8308 + 8309 Iscasb1: + 8310 ; 29/01/2023 + 8311 00001D14 B03D mov al,"=" + 8312 ;mov al,[equalsign] ; [equal_sign] ; scan for an = + 8313 00001D16 EB02 jmp short Iscasbx + 8314 Iscasb2: + 8315 00001D18 30C0 xor al,al ; scan for a nul + 8316 Iscasbx: + 8317 00001D1A B90001 mov cx,256 ; 100h + 8318 00001D1D F2AE repnz scasb + 8319 00001D1F C3 retn + 8320 + 8321 ; 29/01/2023 + 8322 ;IUPCONV: + 8323 ; MSDOS 3.3 + 8324 ;;cmp al,"a" + 8325 ;cmp al,[letter_a] + 8326 ;jb short IRET22 + 8327 ;;cmp al,"z" + 8328 ;cmp al,[letter_z] + 8329 ;ja short IRET22 + 8330 ;sub al,20h ; Lower-case changed to upper-case + 8331 ;IRET22: + 8332 ;retn 8333 - 8334 ; MSDOS 6.0 - 8335 ; ***************************************************************** - 8336 ; * - 8337 ; * ROUTINE: IUPCONV (ADDED BY EMG 4.00) - 8338 ; * - 8339 ; * FUNCTION: This routine returns the upper case equivalent of - 8340 ; * the character in AL from the file upper case table - 8341 ; * in DOS if character if above ascii 128, else - 8342 ; * subtracts 20H if between "a" and "z". - 8343 ; * - 8344 ; * INPUT: DS set to resident - 8345 ; * AL char to be upper cased - 8346 ; * FUCASE_ADDR set to the file upper case table - 8347 ; * - 8348 ; * OUTPUT: AL upper cased character - 8349 ; * - 8350 ; ***************************************************************** - 8351 - 8352 iupconv: ;proc near - 8353 ;assume ds:ResGroup ; + 8334 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8335 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1C32h + 8336 + 8337 ; MSDOS 6.0 + 8338 ; ***************************************************************** + 8339 ; * + 8340 ; * ROUTINE: IUPCONV (ADDED BY EMG 4.00) + 8341 ; * + 8342 ; * FUNCTION: This routine returns the upper case equivalent of + 8343 ; * the character in AL from the file upper case table + 8344 ; * in DOS if character if above ascii 128, else + 8345 ; * subtracts 20H if between "a" and "z". + 8346 ; * + 8347 ; * INPUT: DS set to resident + 8348 ; * AL char to be upper cased + 8349 ; * FUCASE_ADDR set to the file upper case table + 8350 ; * + 8351 ; * OUTPUT: AL upper cased character + 8352 ; * + 8353 ; ***************************************************************** 8354 - 8355 00001D20 3C80 cmp al,80h ; see if char is > ascii 128 - 8356 00001D22 7210 jb short other_fucase ; no - upper case math - 8357 00001D24 2C80 sub al,80h ; only upper 128 chars in table - 8358 00001D26 1E push ds ; - 8359 00001D27 53 push bx ; - 8360 ;lds bx,dword ptr FUCase_Addr+1 ; get table address - 8361 00001D28 C51E[B602] lds bx,[FUCase_Addr+1] - 8362 00001D2C 83C302 add bx,2 ; skip over first word - 8363 ;xlat ds:byte ptr [bx] ; convert to upper case - 8364 00001D2F D7 xlat - 8365 00001D30 5B pop bx ; - 8366 00001D31 1F pop ds ; - 8367 00001D32 EB0A jmp short iupconv_end ; we finished - exit - 8368 - 8369 other_fucase: ; - 8370 ;cmp al,[lcasea] ; [letter_a] ; if between "a" and "z", - 8371 00001D34 3C61 cmp al,'a' - 8372 00001D36 7206 jb short iupconv_end ; subtract 20h to get - 8373 ;cmp al,[lcasez] ; [letter_z] ; upper case equivalent. - 8374 00001D38 3C7A cmp al,'z' - 8375 00001D3A 7702 ja short iupconv_end ; - 8376 00001D3C 2C20 sub al,20h ; Change lower-case to upper - 8377 iupconv_end: ; - 8378 00001D3E C3 retn - 8379 - 8380 ;iupConv endp - 8381 - 8382 ; 29/01/2023 - 8383 init_contc_specialcase: - 8384 ; MSDOS 3.3 & MSDOS 6.0 - 8385 ; This routine is called if control-C - 8386 00001D3F 83C406 add sp,6 ; is type during the date/time prompt - 8387 00001D42 56 push si ; at initialization time. The desired - 8388 00001D43 89D6 mov si,dx ; response is to make it look like the - 8389 00001D45 C74401000D mov word [si+1],0D00h ; user typed by "popping" the - 8390 00001D4A 5E pop si ; INT 21h stuff off the stack, putting - 8391 00001D4B CF iret ; a in the user's buffer, and - 8392 ; returning directly to the user. - 8393 ; In this case the user is TCODE. - 8394 - 8395 ; ---------------------------------------------------------------------------- - 8396 - 8397 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8398 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1C62h (CODERES:0F22h) + 8355 iupconv: ;proc near + 8356 ;assume ds:ResGroup ; + 8357 + 8358 00001D20 3C80 cmp al,80h ; see if char is > ascii 128 + 8359 00001D22 7210 jb short other_fucase ; no - upper case math + 8360 00001D24 2C80 sub al,80h ; only upper 128 chars in table + 8361 00001D26 1E push ds ; + 8362 00001D27 53 push bx ; + 8363 ;lds bx,dword ptr FUCase_Addr+1 ; get table address + 8364 00001D28 C51E[B602] lds bx,[FUCase_Addr+1] + 8365 00001D2C 83C302 add bx,2 ; skip over first word + 8366 ;xlat ds:byte ptr [bx] ; convert to upper case + 8367 00001D2F D7 xlat + 8368 00001D30 5B pop bx ; + 8369 00001D31 1F pop ds ; + 8370 00001D32 EB0A jmp short iupconv_end ; we finished - exit + 8371 + 8372 other_fucase: ; + 8373 ;cmp al,[lcasea] ; [letter_a] ; if between "a" and "z", + 8374 00001D34 3C61 cmp al,'a' + 8375 00001D36 7206 jb short iupconv_end ; subtract 20h to get + 8376 ;cmp al,[lcasez] ; [letter_z] ; upper case equivalent. + 8377 00001D38 3C7A cmp al,'z' + 8378 00001D3A 7702 ja short iupconv_end ; + 8379 00001D3C 2C20 sub al,20h ; Change lower-case to upper + 8380 iupconv_end: ; + 8381 00001D3E C3 retn + 8382 + 8383 ;iupConv endp + 8384 + 8385 ; 29/01/2023 + 8386 init_contc_specialcase: + 8387 ; MSDOS 3.3 & MSDOS 6.0 + 8388 ; This routine is called if control-C + 8389 00001D3F 83C406 add sp,6 ; is type during the date/time prompt + 8390 00001D42 56 push si ; at initialization time. The desired + 8391 00001D43 89D6 mov si,dx ; response is to make it look like the + 8392 00001D45 C74401000D mov word [si+1],0D00h ; user typed by "popping" the + 8393 00001D4A 5E pop si ; INT 21h stuff off the stack, putting + 8394 00001D4B CF iret ; a in the user's buffer, and + 8395 ; returning directly to the user. + 8396 ; In this case the user is TCODE. + 8397 + 8398 ; ---------------------------------------------------------------------------- 8399 - 8400 ; MSDOS 6.0 - 8401 ; **************************************************************** - 8402 ; * - 8403 ; * ROUTINE: Setup_for_messages - 8404 ; * - 8405 ; * FUNCTION: Sets up system for PARSE and EXTENDED ERROR - 8406 ; * messages as follows: + 8400 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8401 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1C62h (CODERES:0F22h) + 8402 + 8403 ; MSDOS 6.0 + 8404 ; **************************************************************** + 8405 ; * + 8406 ; * ROUTINE: Setup_for_messages 8407 ; * - 8408 ; * IF /P and /MSG are entered - 8409 ; * keep PARSE and EXTENDED ERRORS in memory - 8410 ; * ELSE IF /P is entered - 8411 ; * use PARSE and EXTENDED ERRORS on disk - 8412 ; * remove PARSE ERRORS from memory - 8413 ; * ELSE - 8414 ; * remove PARSE ERRORS from memory - 8415 ; * ENDIF - 8416 ; * - 8417 ; * INPUT: PERMCOM Set up with user input - 8418 ; * EXT_MSG Set up with user input - 8419 ; * System set up to retain PARSE ERRORS - 8420 ; * - 8421 ; * OUTPUT: registers unchanged - 8422 ; * - 8423 ; **************************************************************** - 8424 - 8425 setup_for_messages: ;proc near - 8426 - 8427 00001D4C 53 push bx - 8428 00001D4D 1E push ds ; save data segment - 8429 00001D4E 06 push es ; save environment segment - 8430 00001D4F 50 push ax ; - 8431 00001D50 52 push dx ; - 8432 00001D51 57 push di ; - 8433 00001D52 8CC8 mov ax,cs ; get local segment to ES and DS - 8434 00001D54 8ED8 mov ds,ax ; - 8435 00001D56 8EC0 mov es,ax ; - 8436 - 8437 00001D58 803E[A202]00 cmp byte [PermCom],0 ; was permcom set? - 8438 00001D5D 743C jz short no_permcom ; No - don't worry about messages + 8408 ; * FUNCTION: Sets up system for PARSE and EXTENDED ERROR + 8409 ; * messages as follows: + 8410 ; * + 8411 ; * IF /P and /MSG are entered + 8412 ; * keep PARSE and EXTENDED ERRORS in memory + 8413 ; * ELSE IF /P is entered + 8414 ; * use PARSE and EXTENDED ERRORS on disk + 8415 ; * remove PARSE ERRORS from memory + 8416 ; * ELSE + 8417 ; * remove PARSE ERRORS from memory + 8418 ; * ENDIF + 8419 ; * + 8420 ; * INPUT: PERMCOM Set up with user input + 8421 ; * EXT_MSG Set up with user input + 8422 ; * System set up to retain PARSE ERRORS + 8423 ; * + 8424 ; * OUTPUT: registers unchanged + 8425 ; * + 8426 ; **************************************************************** + 8427 + 8428 setup_for_messages: ;proc near + 8429 + 8430 00001D4C 53 push bx + 8431 00001D4D 1E push ds ; save data segment + 8432 00001D4E 06 push es ; save environment segment + 8433 00001D4F 50 push ax ; + 8434 00001D50 52 push dx ; + 8435 00001D51 57 push di ; + 8436 00001D52 8CC8 mov ax,cs ; get local segment to ES and DS + 8437 00001D54 8ED8 mov ds,ax ; + 8438 00001D56 8EC0 mov es,ax ; 8439 - 8440 ;* We're permanent. Install our message services int 2f handler. - 8441 - 8442 00001D5F 06 push es - 8443 ;mov ax,(GET_INTERRUPT_VECTOR shl 8) or 2Fh - 8444 00001D60 B82F35 mov ax,352Fh - 8445 00001D63 CD21 int 21h - 8446 ; DOS - 2+ - GET INTERRUPT VECTOR - 8447 ; AL = interrupt number - 8448 ; Return: ES:BX = value of interrupt vector - 8449 00001D65 891E[AE04] mov [Int2fHandler],bx - 8450 00001D69 8C06[B004] mov [Int2fHandler+2],es - 8451 00001D6D 07 pop es - 8452 - 8453 ; DS = RESGROUP seg addr - 8454 - 8455 ; M005; We will not hook int 2fh on any command.com other than the first. - 8456 ; M005; Carousel loads as a permanent command.com and when we exit Carousel, - 8457 ; M005; it just wipes our arena out. So, int 2fh is still hooked and the - 8458 ; M005; first int 2fh call after exit from Carousel (from the DOS terminate - 8459 ; M005; call) goes off into space. - 8460 - 8461 00001D6E 803E[9926]00 cmp byte [FirstCom],0 ; M005 - 8462 00001D73 7416 je short no_msg_hook ; M005 - 8463 ; - 8464 ; M005; !!!SLIMIEST CAROUSEL HACK OFF ALL!!! - 8465 ; M005; Carousel plays around with the interrupt vector tables. He saves it - 8466 ; M005; before loading a new command.com. Then, it takes hold of the current - 8467 ; M005; command.com's PSP and then looks at all interrupt vectors whose - 8468 ; M005; segment matches the command.com PSP and then updates these segments - 8469 ; M005; to the new command.com's PSP in his saved vector table. Whenever we - 8470 ; M005; we pop into his menu, he puts this saved table into the vector table. - 8471 ; M005; If we now quit, Carousel just wipes out command.com's arena and then - 8472 ; M005; issues a terminate. Unfortunately, the int 2fh vector is pointing at - 8473 ; M005; the command.com that was wiped out and so the next int 2fh call will - 8474 ; M005; bomb. To prevent Carousel from doing this clever(1**$$#) patching, we - 8475 ; M005; renormalize our int 2fh pointer so that its cs is not the same as the - 8476 ; M005; command.com PSP. Now, he does no such patching and our int 2fh vector - 8477 ; M005; remains nice and happy. The renormalized pointer points at a far - 8478 ; M005; jump to the actual int 2fh entry point. - 8479 ; - 8480 00001D75 1E push ds ; M005 - 8481 ;mov dx,offset DATARES:Carousel_i2f_Hook ; M005 - 8482 00001D76 BA[2501] mov dx,Carousel_i2f_Hook - 8483 00001D79 83EA10 sub dx,10h ; renormalize offset; M005 - 8484 00001D7C 8CD8 mov ax,ds ; M005 - 8485 00001D7E 40 inc ax ; Relocated cs ; M005 - 8486 00001D7F 8ED8 mov ds,ax ; M005 - 8487 ;mov ax,(SET_INTERRUPT_VECTOR shl 8) or 2Fh - 8488 00001D81 B82F25 mov ax,252Fh - 8489 00001D84 CD21 int 21h - 8490 ; DOS - SET INTERRUPT VECTOR - 8491 ; AL = interrupt number - 8492 ; DS:DX = new vector to be used for specified interrupt - 8493 00001D86 1F pop ds ; M005 - 8494 ;mov word ptr Carousel_i2f_Hook+3,ds ; M005 - 8495 00001D87 8C1E[2801] mov [Carousel_i2f_Hook+3],ds ; mov [int2fh_segm], ds ; 23/07/2024 - 8496 ; patch in the cs for jump - 8497 no_msg_hook: ; M005 - 8498 00001D8B 803E[9420]01 cmp byte [ext_msg],1 ; SET_EXTENDED_MSG - 8499 00001D90 7516 jne short permcom_end ; no /msg - exit - 8500 - 8501 permcom_slash_msg: ; Keep messages in memory - 8502 ;mov di,offset ResGroup:ExtMsgEnd ; get address of resident end - 8503 ;mov di,0DD8h ; PCDOS 7.1 COMMAND.COM (*) - 8504 00001D92 BF[DC0C] mov di,ExtMsgEnd ; = offset PATRICIDE ; 23/07/2024 (*) - 8505 00001D95 893E[B204] mov [ResMsgEnd],di ; save it - 8506 00001D99 EB0D jmp short permcom_end ; exit - 8507 - 8508 no_permcom: - 8509 ;cmp byte [ext_msg],SET_EXTENDED_MSG ; was /msg specified? - 8510 00001D9B 803E[9420]01 cmp byte [ext_msg],1 - 8511 00001DA0 7506 jne short permcom_end ; no - no error - 8512 ;mov dx,LessArgs_Ptr ; get message number for "Required parameter missing" - 8513 00001DA2 BA0200 mov dx,2 - 8514 00001DA5 E808FF call RPrintParse - 8515 - 8516 permcom_end: - 8517 00001DA8 5F pop di ; - 8518 00001DA9 5A pop dx ; - 8519 00001DAA 58 pop ax ; - 8520 00001DAB 07 pop es ; get environment back - 8521 00001DAC 1F pop ds ; - 8522 00001DAD 5B pop bx - 8523 - 8524 00001DAE C3 retn ; - 8525 - 8526 ;setup_for_messages endp - 8527 - 8528 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8529 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1CC5h + 8440 00001D58 803E[A202]00 cmp byte [PermCom],0 ; was permcom set? + 8441 00001D5D 743C jz short no_permcom ; No - don't worry about messages + 8442 + 8443 ;* We're permanent. Install our message services int 2f handler. + 8444 + 8445 00001D5F 06 push es + 8446 ;mov ax,(GET_INTERRUPT_VECTOR shl 8) or 2Fh + 8447 00001D60 B82F35 mov ax,352Fh + 8448 00001D63 CD21 int 21h + 8449 ; DOS - 2+ - GET INTERRUPT VECTOR + 8450 ; AL = interrupt number + 8451 ; Return: ES:BX = value of interrupt vector + 8452 00001D65 891E[AE04] mov [Int2fHandler],bx + 8453 00001D69 8C06[B004] mov [Int2fHandler+2],es + 8454 00001D6D 07 pop es + 8455 + 8456 ; DS = RESGROUP seg addr + 8457 + 8458 ; M005; We will not hook int 2fh on any command.com other than the first. + 8459 ; M005; Carousel loads as a permanent command.com and when we exit Carousel, + 8460 ; M005; it just wipes our arena out. So, int 2fh is still hooked and the + 8461 ; M005; first int 2fh call after exit from Carousel (from the DOS terminate + 8462 ; M005; call) goes off into space. + 8463 + 8464 00001D6E 803E[9926]00 cmp byte [FirstCom],0 ; M005 + 8465 00001D73 7416 je short no_msg_hook ; M005 + 8466 ; + 8467 ; M005; !!!SLIMIEST CAROUSEL HACK OFF ALL!!! + 8468 ; M005; Carousel plays around with the interrupt vector tables. He saves it + 8469 ; M005; before loading a new command.com. Then, it takes hold of the current + 8470 ; M005; command.com's PSP and then looks at all interrupt vectors whose + 8471 ; M005; segment matches the command.com PSP and then updates these segments + 8472 ; M005; to the new command.com's PSP in his saved vector table. Whenever we + 8473 ; M005; we pop into his menu, he puts this saved table into the vector table. + 8474 ; M005; If we now quit, Carousel just wipes out command.com's arena and then + 8475 ; M005; issues a terminate. Unfortunately, the int 2fh vector is pointing at + 8476 ; M005; the command.com that was wiped out and so the next int 2fh call will + 8477 ; M005; bomb. To prevent Carousel from doing this clever(1**$$#) patching, we + 8478 ; M005; renormalize our int 2fh pointer so that its cs is not the same as the + 8479 ; M005; command.com PSP. Now, he does no such patching and our int 2fh vector + 8480 ; M005; remains nice and happy. The renormalized pointer points at a far + 8481 ; M005; jump to the actual int 2fh entry point. + 8482 ; + 8483 00001D75 1E push ds ; M005 + 8484 ;mov dx,offset DATARES:Carousel_i2f_Hook ; M005 + 8485 00001D76 BA[2501] mov dx,Carousel_i2f_Hook + 8486 00001D79 83EA10 sub dx,10h ; renormalize offset; M005 + 8487 00001D7C 8CD8 mov ax,ds ; M005 + 8488 00001D7E 40 inc ax ; Relocated cs ; M005 + 8489 00001D7F 8ED8 mov ds,ax ; M005 + 8490 ;mov ax,(SET_INTERRUPT_VECTOR shl 8) or 2Fh + 8491 00001D81 B82F25 mov ax,252Fh + 8492 00001D84 CD21 int 21h + 8493 ; DOS - SET INTERRUPT VECTOR + 8494 ; AL = interrupt number + 8495 ; DS:DX = new vector to be used for specified interrupt + 8496 00001D86 1F pop ds ; M005 + 8497 ;mov word ptr Carousel_i2f_Hook+3,ds ; M005 + 8498 00001D87 8C1E[2801] mov [Carousel_i2f_Hook+3],ds ; mov [int2fh_segm], ds ; 23/07/2024 + 8499 ; patch in the cs for jump + 8500 no_msg_hook: ; M005 + 8501 00001D8B 803E[9420]01 cmp byte [ext_msg],1 ; SET_EXTENDED_MSG + 8502 00001D90 7516 jne short permcom_end ; no /msg - exit + 8503 + 8504 permcom_slash_msg: ; Keep messages in memory + 8505 ;mov di,offset ResGroup:ExtMsgEnd ; get address of resident end + 8506 ;mov di,0DD8h ; PCDOS 7.1 COMMAND.COM (*) + 8507 00001D92 BF[DC0C] mov di,ExtMsgEnd ; = offset PATRICIDE ; 23/07/2024 (*) + 8508 00001D95 893E[B204] mov [ResMsgEnd],di ; save it + 8509 00001D99 EB0D jmp short permcom_end ; exit + 8510 + 8511 no_permcom: + 8512 ;cmp byte [ext_msg],SET_EXTENDED_MSG ; was /msg specified? + 8513 00001D9B 803E[9420]01 cmp byte [ext_msg],1 + 8514 00001DA0 7506 jne short permcom_end ; no - no error + 8515 ;mov dx,LessArgs_Ptr ; get message number for "Required parameter missing" + 8516 00001DA2 BA0200 mov dx,2 + 8517 00001DA5 E808FF call RPrintParse + 8518 + 8519 permcom_end: + 8520 00001DA8 5F pop di ; + 8521 00001DA9 5A pop dx ; + 8522 00001DAA 58 pop ax ; + 8523 00001DAB 07 pop es ; get environment back + 8524 00001DAC 1F pop ds ; + 8525 00001DAD 5B pop bx + 8526 + 8527 00001DAE C3 retn ; + 8528 + 8529 ;setup_for_messages endp 8530 - 8531 ; MSDOS 6.0 - 8532 - 8533 ;*** CheckHelp - print help text and exit if /? is on command line - 8534 ; - 8535 ; ENTRY command-line tail at 81h - 8536 ; - 8537 ; EXIT return if /? not found - 8538 ; terminate if /? found + 8531 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8532 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1CC5h + 8533 + 8534 ; MSDOS 6.0 + 8535 + 8536 ;*** CheckHelp - print help text and exit if /? is on command line + 8537 ; + 8538 ; ENTRY command-line tail at 81h 8539 ; - 8540 ; USED AX,BX,CX,DX,SI,DI - 8541 ; - 8542 ; EFFECTS Help text displayed if /? found on command line - 8543 - 8544 CheckHelp: ; proc - 8545 ;assume cs:RESGROUP,ds:RESGROUP,es:RESGROUP,ss:RESGROUP + 8540 ; EXIT return if /? not found + 8541 ; terminate if /? found + 8542 ; + 8543 ; USED AX,BX,CX,DX,SI,DI + 8544 ; + 8545 ; EFFECTS Help text displayed if /? found on command line 8546 - 8547 00001DAF BE8100 mov si,81h ; DS:SI = ptr to command-line tail - 8548 ;mov di,offset RESGROUP:Parse_Command - 8549 00001DB2 BF[9920] mov di,PARSE_COMMAND - 8550 ; ES:DI = ptr to primary parse block - 8551 00001DB5 31C9 xor cx,cx ; CX = # positional param's found - 8552 00001DB7 31D2 xor dx,dx ; DX will be ptr to result buffer - 8553 chParse: - 8554 ;call dword ptr Init_Parse - 8555 00001DB9 FF1E[8E20] call far [Init_Parse] ; call system parser - 8556 - 8557 ;;cmp ax,END_OF_LINE - 8558 ;cmp ax,-1 ; 0FFFFh - 8559 ;je short chRet ; end of command line, no /? found - 8560 ;;cmp ax,RESULT_NO_ERROR - 8561 ;;cmp ax,0 - 8562 ;;je short chWhich ; valid syntax element found - 8563 ;;jmp short chParse ; go parse more - 8564 ;and ax,ax ; cmp ax,0 - 8565 ;jnz short chParse ; jne - 8566 ; 10/06/2023 - 8567 00001DBD 40 inc ax ; cmp ax,-1 - 8568 00001DBE 741B jz short chRet ; 0FFFFh -> 0 - 8569 00001DC0 48 dec ax ; cmp ax,0 - 8570 00001DC1 75F6 jnz short chParse ; 1 -> 0 - 8571 ; ax = 0 - 8572 chWhich: - 8573 ;cmp Comnd1_Syn,offset RESGROUP:Command_?_Syn - 8574 00001DC3 813E[5821][2321] cmp word [COMND1_SYN],COMMAND_?_SYN ; "/?" - 8575 00001DC9 7411 je short chHelp ; /? found - display help & exit - 8576 ;cmp Comnd1_Syn,offset RESGROUP:Command_C_Syn - 8577 00001DCB 813E[5821][0921] cmp word [COMND1_SYN],COMMAND_C_SYN ; "/C" - 8578 ; 06/06/2023 - 8579 00001DD1 7408 je short chRet ; /c found - ignore rest of line - 8580 ; 29/01/2023 - 8581 ;jne short chParse - 8582 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 8583 ; MSDOS 6.0 - 8584 ;cmp Comnd1_Syn,offset RESGROUP:Command_K_Syn - 8585 00001DD3 813E[5821][2F21] cmp word [COMND1_SYN],COMMAND_K_SYN ; "/K" - 8586 ;je short chRet ; /k found - ignore rest of line - 8587 ;jmp short chParse ; anything else - ignore, keep looking - 8588 ; 06/06/2023 - 8589 00001DD9 75DE jne short chParse - 8590 chRet: - 8591 00001DDB C3 retn - 8592 chHelp: - 8593 ;mov si,offset RESGROUP:HelpMsgs ; SI = ptr to msg ptr list - 8594 00001DDC BE[5F26] mov si,HelpMsgs - 8595 chHelpNext: - 8596 00001DDF AD lodsw ; AX = ptr to msg - 8597 00001DE0 09C0 or ax,ax - 8598 00001DE2 7407 jz short chHelpDone ; end of list - all done - 8599 00001DE4 89C2 mov dx,ax ; DX = ptr to msg - 8600 00001DE6 E8F2F5 call RPrint ; display msg - 8601 00001DE9 EBF4 jmp short chHelpNext ; go do next msg - 8602 - 8603 chHelpDone: - 8604 00001DEB CD20 int 20h ; terminate program - 8605 ;chRet: - 8606 00001DED C3 retn - 8607 - 8608 ;CheckHelp endp - 8609 - 8610 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8611 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1D03h + 8547 CheckHelp: ; proc + 8548 ;assume cs:RESGROUP,ds:RESGROUP,es:RESGROUP,ss:RESGROUP + 8549 + 8550 00001DAF BE8100 mov si,81h ; DS:SI = ptr to command-line tail + 8551 ;mov di,offset RESGROUP:Parse_Command + 8552 00001DB2 BF[9920] mov di,PARSE_COMMAND + 8553 ; ES:DI = ptr to primary parse block + 8554 00001DB5 31C9 xor cx,cx ; CX = # positional param's found + 8555 00001DB7 31D2 xor dx,dx ; DX will be ptr to result buffer + 8556 chParse: + 8557 ;call dword ptr Init_Parse + 8558 00001DB9 FF1E[8E20] call far [Init_Parse] ; call system parser + 8559 + 8560 ;;cmp ax,END_OF_LINE + 8561 ;cmp ax,-1 ; 0FFFFh + 8562 ;je short chRet ; end of command line, no /? found + 8563 ;;cmp ax,RESULT_NO_ERROR + 8564 ;;cmp ax,0 + 8565 ;;je short chWhich ; valid syntax element found + 8566 ;;jmp short chParse ; go parse more + 8567 ;and ax,ax ; cmp ax,0 + 8568 ;jnz short chParse ; jne + 8569 ; 10/06/2023 + 8570 00001DBD 40 inc ax ; cmp ax,-1 + 8571 00001DBE 741B jz short chRet ; 0FFFFh -> 0 + 8572 00001DC0 48 dec ax ; cmp ax,0 + 8573 00001DC1 75F6 jnz short chParse ; 1 -> 0 + 8574 ; ax = 0 + 8575 chWhich: + 8576 ;cmp Comnd1_Syn,offset RESGROUP:Command_?_Syn + 8577 00001DC3 813E[5821][2321] cmp word [COMND1_SYN],COMMAND_?_SYN ; "/?" + 8578 00001DC9 7411 je short chHelp ; /? found - display help & exit + 8579 ;cmp Comnd1_Syn,offset RESGROUP:Command_C_Syn + 8580 00001DCB 813E[5821][0921] cmp word [COMND1_SYN],COMMAND_C_SYN ; "/C" + 8581 ; 06/06/2023 + 8582 00001DD1 7408 je short chRet ; /c found - ignore rest of line + 8583 ; 29/01/2023 + 8584 ;jne short chParse + 8585 ; 06/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 8586 ; MSDOS 6.0 + 8587 ;cmp Comnd1_Syn,offset RESGROUP:Command_K_Syn + 8588 00001DD3 813E[5821][2F21] cmp word [COMND1_SYN],COMMAND_K_SYN ; "/K" + 8589 ;je short chRet ; /k found - ignore rest of line + 8590 ;jmp short chParse ; anything else - ignore, keep looking + 8591 ; 06/06/2023 + 8592 00001DD9 75DE jne short chParse + 8593 chRet: + 8594 00001DDB C3 retn + 8595 chHelp: + 8596 ;mov si,offset RESGROUP:HelpMsgs ; SI = ptr to msg ptr list + 8597 00001DDC BE[5F26] mov si,HelpMsgs + 8598 chHelpNext: + 8599 00001DDF AD lodsw ; AX = ptr to msg + 8600 00001DE0 09C0 or ax,ax + 8601 00001DE2 7407 jz short chHelpDone ; end of list - all done + 8602 00001DE4 89C2 mov dx,ax ; DX = ptr to msg + 8603 00001DE6 E8F2F5 call RPrint ; display msg + 8604 00001DE9 EBF4 jmp short chHelpNext ; go do next msg + 8605 + 8606 chHelpDone: + 8607 00001DEB CD20 int 20h ; terminate program + 8608 ;chRet: + 8609 00001DED C3 retn + 8610 + 8611 ;CheckHelp endp 8612 - 8613 ; MSDOS 6.0 - 8614 - 8615 ;***** Setup_res_end -- This routine determines the resident size of COMMAND. - 8616 ; - 8617 ; It determines based on 2 factors: - 8618 ; 1. Is this is the first COMMAND? - 8619 ; 2. Is COMMAND to be loaded into HIMEM? - 8620 ; The strategy works as follows: - 8621 ; - 8622 ; if (First COMMAND) - 8623 ; then if (COMMAND in HIMEM) - 8624 ; ResSize = resident_data; - 8625 ; else - 8626 ; ResSize = resident_data + resident_code; - 8627 ; else - 8628 ; ResSize = resident_data; - 8629 ; - 8630 ; Int 2fh calls have been added to determine whether or not we are the first - 8631 ; COMMAND and whether DOS is in HIMEM. + 8613 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8614 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1D03h + 8615 + 8616 ; MSDOS 6.0 + 8617 + 8618 ;***** Setup_res_end -- This routine determines the resident size of COMMAND. + 8619 ; + 8620 ; It determines based on 2 factors: + 8621 ; 1. Is this is the first COMMAND? + 8622 ; 2. Is COMMAND to be loaded into HIMEM? + 8623 ; The strategy works as follows: + 8624 ; + 8625 ; if (First COMMAND) + 8626 ; then if (COMMAND in HIMEM) + 8627 ; ResSize = resident_data; + 8628 ; else + 8629 ; ResSize = resident_data + resident_code; + 8630 ; else + 8631 ; ResSize = resident_data; 8632 ; - 8633 ; ENTRY: ResMsgEnd = resident size of data in paras - 8634 ; - 8635 ; EXIT: ResSize = resident size in low memory - 8636 ; - 8637 ; REGISTERS AFFECTED: ax,cx,dx - 8638 ; - 8639 - 8640 GET_HMA_ADDR equ 4A02h - 8641 - 8642 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 8643 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1FBFh + 8633 ; Int 2fh calls have been added to determine whether or not we are the first + 8634 ; COMMAND and whether DOS is in HIMEM. + 8635 ; + 8636 ; ENTRY: ResMsgEnd = resident size of data in paras + 8637 ; + 8638 ; EXIT: ResSize = resident size in low memory + 8639 ; + 8640 ; REGISTERS AFFECTED: ax,cx,dx + 8641 ; + 8642 + 8643 GET_HMA_ADDR equ 4A02h 8644 - 8645 Setup_res_end: ;proc near - 8646 - 8647 00001DEE 1E push ds - 8648 00001DEF 8CC8 mov ax,cs - 8649 00001DF1 8ED8 mov ds,ax ;ds = RESGROUP - 8650 ;assume ds:RESGROUP - 8651 - 8652 00001DF3 8B0E[B204] mov cx,[ResMsgEnd] ;set resident size = data - 8653 - 8654 ;ifndef ROMDOS - 8655 - 8656 ;M042 -- Begin changes - 8657 ;If messages are to be kept behind, we need to round up the messages to - 8658 ;the next para boundary. This is because we have a dummy segment between the - 8659 ;data and the resident code segment so that the code segment starts on a - 8660 ;para boundary - 8661 - 8662 ;cmp cx,offset RESGROUP:ExtMsgEnd ;messages to be resident? - 8663 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM - 8664 ;cmp cx,0DD8h - 8665 00001DF7 81F9[DC0C] cmp cx,ExtMsgEnd - 8666 00001DFB 7506 jne short calc_res ;no, continue - 8667 00001DFD 83C10F add cx,15 ;round up - 8668 00001E00 83E1F0 and cx,0FFF0h - 8669 calc_res: - 8670 - 8671 ;M042 -- End changes - 8672 - 8673 ; 18/07/2024 - 8674 ;xor ax,ax - 8675 - 8676 00001E03 803E[9926]01 cmp byte [FirstCom],1 ;is it first command.com? - 8677 ;jne short not_first ;no, do not keep code - 8678 ; 06/06/2023 - 8679 00001E08 751A jne short not_first2 - 8680 - 8681 ;We issue a version check call with al=01 to detect if DOS is in HMA. If so, - 8682 ;bit 4 of dh is set + 8645 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 8646 ; PCDOS 7.1 COMMAND.COM - RESGROUP:1FBFh + 8647 + 8648 Setup_res_end: ;proc near + 8649 + 8650 00001DEE 1E push ds + 8651 00001DEF 8CC8 mov ax,cs + 8652 00001DF1 8ED8 mov ds,ax ;ds = RESGROUP + 8653 ;assume ds:RESGROUP + 8654 + 8655 00001DF3 8B0E[B204] mov cx,[ResMsgEnd] ;set resident size = data + 8656 + 8657 ;ifndef ROMDOS + 8658 + 8659 ;M042 -- Begin changes + 8660 ;If messages are to be kept behind, we need to round up the messages to + 8661 ;the next para boundary. This is because we have a dummy segment between the + 8662 ;data and the resident code segment so that the code segment starts on a + 8663 ;para boundary + 8664 + 8665 ;cmp cx,offset RESGROUP:ExtMsgEnd ;messages to be resident? + 8666 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM + 8667 ;cmp cx,0DD8h + 8668 00001DF7 81F9[DC0C] cmp cx,ExtMsgEnd + 8669 00001DFB 7506 jne short calc_res ;no, continue + 8670 00001DFD 83C10F add cx,15 ;round up + 8671 00001E00 83E1F0 and cx,0FFF0h + 8672 calc_res: + 8673 + 8674 ;M042 -- End changes + 8675 + 8676 ; 18/07/2024 + 8677 ;xor ax,ax + 8678 + 8679 00001E03 803E[9926]01 cmp byte [FirstCom],1 ;is it first command.com? + 8680 ;jne short not_first ;no, do not keep code + 8681 ; 06/06/2023 + 8682 00001E08 751A jne short not_first2 8683 - 8684 00001E0A 53 push bx - 8685 00001E0B 51 push cx - 8686 ;mov ax,(Set_CTRL_C_Trapping shl 8) or 06h ;is DOS in HIMEM? ;M013 - 8687 00001E0C B80633 mov ax,3306h - 8688 00001E0F CD21 int 21h - 8689 ; DOS - 5+ Get TRUE Version Number - 8690 ; (BL major, BH minor, DL revision, DH flags) - 8691 00001E11 59 pop cx - 8692 - 8693 ;bugbug: remove version check after testing - 8694 - 8695 00001E12 80FB05 cmp bl,5 ;bl has true version ; M013 - 8696 00001E15 7207 jb short oldver + 8684 ;We issue a version check call with al=01 to detect if DOS is in HMA. If so, + 8685 ;bit 4 of dh is set + 8686 + 8687 00001E0A 53 push bx + 8688 00001E0B 51 push cx + 8689 ;mov ax,(Set_CTRL_C_Trapping shl 8) or 06h ;is DOS in HIMEM? ;M013 + 8690 00001E0C B80633 mov ax,3306h + 8691 00001E0F CD21 int 21h + 8692 ; DOS - 5+ Get TRUE Version Number + 8693 ; (BL major, BH minor, DL revision, DH flags) + 8694 00001E11 59 pop cx + 8695 + 8696 ;bugbug: remove version check after testing 8697 - 8698 00001E17 31C0 xor ax,ax - 8699 00001E19 80E610 and dh,10h ;is DOS in HMA ; M013 - 8700 ;pop bx - 8701 ;jnz short not_first ;DOS in HIMEM, code not - 8702 ; resident - 8703 ; 29/01/2023 - 8704 00001E1C 7503 jnz short not_first_pop - 8705 oldver: - 8706 ;mov ax,offset CODERES:EndCode ;size of code in bytes - 8707 ; 06/06/2023 - 8708 ;;mov ax,81Ah ; MSDOS 5.0 and MSDOS 6.22 COMMAND.COM - 8709 ; 06/06/2023 - 8710 ; 29/01/2023 - 8711 ;mov ax,EndCode-(RCODE_START+100h) ; 23/04/2023 - 8712 ; 03/05/2023 - 8713 00001E1E B87208 mov ax,EndCode-RCODE_START ; 06/06/2023 - 8714 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM - 8715 ;mov ax,894h ; EndCode-RCODE_START - 8716 - 8717 not_first_pop: - 8718 ; 29/01/2023 - 8719 00001E21 5B pop bx - 8720 - 8721 not_first: - 8722 - 8723 ;Note that ax = 0 (side effect of int 2fh), if the code is not to be retained - 8724 - 8725 00001E22 01C1 add cx,ax - 8726 - 8727 not_first2: ; 06/06/2023 - 8728 - 8729 ;endif ;not ROMDOS - 8730 - 8731 00001E24 83C10F add cx,15 ;round up to next para - 8732 00001E27 D1E9 shr cx,1 - 8733 00001E29 D1E9 shr cx,1 - 8734 00001E2B D1E9 shr cx,1 - 8735 00001E2D D1E9 shr cx,1 ;ax = para size of res code - 8736 00001E2F 890E[B404] mov [ResSize],cx ;store resident size - 8737 - 8738 00001E33 1F pop ds - 8739 ;assume ds:nothing - 8740 00001E34 C3 retn - 8741 - 8742 ;ifndef ROMDOS - 8743 - 8744 ;bugbug: remove this code (for version independent COMMAND) after testing - 8745 - 8746 ; 29/01/2023 - 8747 ;oldver: - 8748 ; pop bx - 8749 ; ;mov ax,offset CODERES:EndCode ;size of code in bytes - 8750 ; ;;mov ax,81Ah ; MSDOS 5.0 COMMAND.COM - 8751 ; ; 29/01/2023 - 8752 ; mov ax,EndCode-RCODE_START - 8753 ; jmp short not_first - 8754 - 8755 ;endif ;not ROMDOS - 8756 - 8757 ;setup_res_end endp - 8758 - 8759 ;ifndef ROMDOS - 8760 - 8761 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8762 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1D52h + 8698 00001E12 80FB05 cmp bl,5 ;bl has true version ; M013 + 8699 00001E15 7207 jb short oldver + 8700 + 8701 00001E17 31C0 xor ax,ax + 8702 00001E19 80E610 and dh,10h ;is DOS in HMA ; M013 + 8703 ;pop bx + 8704 ;jnz short not_first ;DOS in HIMEM, code not + 8705 ; resident + 8706 ; 29/01/2023 + 8707 00001E1C 7503 jnz short not_first_pop + 8708 oldver: + 8709 ;mov ax,offset CODERES:EndCode ;size of code in bytes + 8710 ; 06/06/2023 + 8711 ;;mov ax,81Ah ; MSDOS 5.0 and MSDOS 6.22 COMMAND.COM + 8712 ; 06/06/2023 + 8713 ; 29/01/2023 + 8714 ;mov ax,EndCode-(RCODE_START+100h) ; 23/04/2023 + 8715 ; 03/05/2023 + 8716 00001E1E B87208 mov ax,EndCode-RCODE_START ; 06/06/2023 + 8717 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM + 8718 ;mov ax,894h ; EndCode-RCODE_START + 8719 + 8720 not_first_pop: + 8721 ; 29/01/2023 + 8722 00001E21 5B pop bx + 8723 + 8724 not_first: + 8725 + 8726 ;Note that ax = 0 (side effect of int 2fh), if the code is not to be retained + 8727 + 8728 00001E22 01C1 add cx,ax + 8729 + 8730 not_first2: ; 06/06/2023 + 8731 + 8732 ;endif ;not ROMDOS + 8733 + 8734 00001E24 83C10F add cx,15 ;round up to next para + 8735 00001E27 D1E9 shr cx,1 + 8736 00001E29 D1E9 shr cx,1 + 8737 00001E2B D1E9 shr cx,1 + 8738 00001E2D D1E9 shr cx,1 ;ax = para size of res code + 8739 00001E2F 890E[B404] mov [ResSize],cx ;store resident size + 8740 + 8741 00001E33 1F pop ds + 8742 ;assume ds:nothing + 8743 00001E34 C3 retn + 8744 + 8745 ;ifndef ROMDOS + 8746 + 8747 ;bugbug: remove this code (for version independent COMMAND) after testing + 8748 + 8749 ; 29/01/2023 + 8750 ;oldver: + 8751 ; pop bx + 8752 ; ;mov ax,offset CODERES:EndCode ;size of code in bytes + 8753 ; ;;mov ax,81Ah ; MSDOS 5.0 COMMAND.COM + 8754 ; ; 29/01/2023 + 8755 ; mov ax,EndCode-RCODE_START + 8756 ; jmp short not_first + 8757 + 8758 ;endif ;not ROMDOS + 8759 + 8760 ;setup_res_end endp + 8761 + 8762 ;ifndef ROMDOS 8763 - 8764 ; MSDOS 6.0 - 8765 ;*** Move_res_code -- This routine moves the resident code to its final - 8766 ; location. We check if DOS is in HIMEM. If so, we try to load ourselves - 8767 ; in HIMEM. If we fail, then we remain low and update ResSize to reflect - 8768 ; the correct resident size. When remaining low, we have to check if we - 8769 ; need to overlay the messages part of the data segment which is determined - 8770 ; by the /msg switch. - 8771 ; - 8772 ; ENTRY: ResMsgEnd = end of resident data - 8773 ; - 8774 ; EXIT: The resident code is either up high or in its final location - 8775 ; down low. + 8764 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8765 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1D52h + 8766 + 8767 ; MSDOS 6.0 + 8768 ;*** Move_res_code -- This routine moves the resident code to its final + 8769 ; location. We check if DOS is in HIMEM. If so, we try to load ourselves + 8770 ; in HIMEM. If we fail, then we remain low and update ResSize to reflect + 8771 ; the correct resident size. When remaining low, we have to check if we + 8772 ; need to overlay the messages part of the data segment which is determined + 8773 ; by the /msg switch. + 8774 ; + 8775 ; ENTRY: ResMsgEnd = end of resident data 8776 ; - 8777 ; REGISTERS AFFECTED: ax,bx,cx,dx,si,di - 8778 - 8779 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 8780 ; PCDOS 7.1 COMMAND.COM - RESGROUP:200Eh - 8781 - 8782 Move_res_code: ;proc near - 8783 - 8784 00001E35 1E push ds - 8785 00001E36 06 push es + 8777 ; EXIT: The resident code is either up high or in its final location + 8778 ; down low. + 8779 ; + 8780 ; REGISTERS AFFECTED: ax,bx,cx,dx,si,di + 8781 + 8782 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 8783 ; PCDOS 7.1 COMMAND.COM - RESGROUP:200Eh + 8784 + 8785 Move_res_code: ;proc near 8786 - 8787 00001E37 8CC8 mov ax,cs - 8788 00001E39 8ED8 mov ds,ax - 8789 ;assume ds:RESGROUP - 8790 - 8791 ;mov ax,(Set_CTRL_C_Trapping shl 8) or 06h ; M013 - 8792 00001E3B B80633 mov ax,3306h - 8793 00001E3E CD21 int 21h ;DOS in HIMEM? - 8794 ; DOS - 5+ Get TRUE Version Number - 8795 ; (BL major, BH minor, DL revision, DH flags) - 8796 - 8797 00001E40 80E610 and dh,10h ; M013 - 8798 00001E43 7517 jnz short move_high ;yes, move code high + 8787 00001E35 1E push ds + 8788 00001E36 06 push es + 8789 + 8790 00001E37 8CC8 mov ax,cs + 8791 00001E39 8ED8 mov ds,ax + 8792 ;assume ds:RESGROUP + 8793 + 8794 ;mov ax,(Set_CTRL_C_Trapping shl 8) or 06h ; M013 + 8795 00001E3B B80633 mov ax,3306h + 8796 00001E3E CD21 int 21h ;DOS in HIMEM? + 8797 ; DOS - 5+ Get TRUE Version Number + 8798 ; (BL major, BH minor, DL revision, DH flags) 8799 - 8800 ;Check if messages have been discarded or not - 8801 - 8802 load_low: - 8803 00001E45 1E push ds - 8804 00001E46 07 pop es ;es = RESGROUP - 8805 00001E47 8B3E[B204] mov di,[ResMsgEnd] ;end offset in DATARES - 8806 ;;mov bx,offset RESGROUP:ExtMsgEnd ;end offset of messages - 8807 ;mov bx,ExtMsgEnd - 8808 - 8809 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 8810 %if 0 ; PCDOS 7.1 COMMAND.COM + 8800 00001E40 80E610 and dh,10h ; M013 + 8801 00001E43 7517 jnz short move_high ;yes, move code high + 8802 + 8803 ;Check if messages have been discarded or not + 8804 + 8805 load_low: + 8806 00001E45 1E push ds + 8807 00001E46 07 pop es ;es = RESGROUP + 8808 00001E47 8B3E[B204] mov di,[ResMsgEnd] ;end offset in DATARES + 8809 ;;mov bx,offset RESGROUP:ExtMsgEnd ;end offset of messages + 8810 ;mov bx,ExtMsgEnd 8811 - 8812 ; 29/01/2023 - 8813 cmp di,ExtMsgEnd - 8814 ;cmp di,bx ;are messages to be kept? - 8815 je short no_move ;yes, dont move code - 8816 ;%else - 8817 ; Erdogan Tan - 18/07/2024 - 8818 ;mov bx,ExtMsgEnd ; (this bx is not used after here!) - 8819 %endif - 8820 - 8821 ; 18/07/2024 - 8822 %if 0 - 8823 jmp short setup_move ;es:di points at dest. - 8824 %else - 8825 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 8826 setup_move: - 8827 ;mov si,offset RESGROUP:StartCode - 8828 ; 03/05/2023 - 8829 00001E4B BE[100D] mov si,RCODE_START ; Start addr of Resident Code (CODERES segment) - 8830 ; 0D40h for MSDOS 5.0 COMMAND.COM - 8831 ; 0E10h for PCDOS 7.1 COMMAND.COM ; 18/07/2024 - 8832 ;mov cx,offset CODERES:EndCode ;cx = bytes to move - 8833 ;mov cx,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM - 8834 ; 06/06/2023 - 8835 ;mov cx,EndCode-(RCODE_START+100h) ; 23/04/2023 - 8836 ; 03/05/2023 - 8837 00001E4E B97208 mov cx,EndCode-RCODE_START ; 06/06/2023 - 8838 ;mov cx,894h ; PCDOS 7.1 COMMAND.COM ; 18/07/2024 - 8839 - 8840 00001E51 FC cld - 8841 00001E52 57 push di ;need di for patching offset - 8842 00001E53 F3A4 rep movsb - 8843 00001E55 5F pop di - 8844 patch_up: - 8845 00001E56 E86A01 call patch_stub - 8846 00001E59 07 pop es - 8847 00001E5A 1F pop ds - 8848 ;assume ds:nothing - 8849 00001E5B C3 retn - 8850 %endif - 8851 - 8852 move_high: - 8853 - 8854 ;We have to call DOS to get the load address in HIMEM for COMMAND - 8855 ;We pass in bx the number of bytes we need + 8812 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 8813 %if 0 ; PCDOS 7.1 COMMAND.COM + 8814 + 8815 ; 29/01/2023 + 8816 cmp di,ExtMsgEnd + 8817 ;cmp di,bx ;are messages to be kept? + 8818 je short no_move ;yes, dont move code + 8819 ;%else + 8820 ; Erdogan Tan - 18/07/2024 + 8821 ;mov bx,ExtMsgEnd ; (this bx is not used after here!) + 8822 %endif + 8823 + 8824 ; 18/07/2024 + 8825 %if 0 + 8826 jmp short setup_move ;es:di points at dest. + 8827 %else + 8828 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 8829 setup_move: + 8830 ;mov si,offset RESGROUP:StartCode + 8831 ; 03/05/2023 + 8832 00001E4B BE[100D] mov si,RCODE_START ; Start addr of Resident Code (CODERES segment) + 8833 ; 0D40h for MSDOS 5.0 COMMAND.COM + 8834 ; 0E10h for PCDOS 7.1 COMMAND.COM ; 18/07/2024 + 8835 ;mov cx,offset CODERES:EndCode ;cx = bytes to move + 8836 ;mov cx,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM + 8837 ; 06/06/2023 + 8838 ;mov cx,EndCode-(RCODE_START+100h) ; 23/04/2023 + 8839 ; 03/05/2023 + 8840 00001E4E B97208 mov cx,EndCode-RCODE_START ; 06/06/2023 + 8841 ;mov cx,894h ; PCDOS 7.1 COMMAND.COM ; 18/07/2024 + 8842 + 8843 00001E51 FC cld + 8844 00001E52 57 push di ;need di for patching offset + 8845 00001E53 F3A4 rep movsb + 8846 00001E55 5F pop di + 8847 patch_up: + 8848 00001E56 E86A01 call patch_stub + 8849 00001E59 07 pop es + 8850 00001E5A 1F pop ds + 8851 ;assume ds:nothing + 8852 00001E5B C3 retn + 8853 %endif + 8854 + 8855 move_high: 8856 - 8857 ;mov bx,offset CODERES:EndCode - 8858 ; 29/01/2023 - 8859 ;;mov bx,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM - 8860 ; 06/06/2023 - 8861 ;mov bx,EndCode-(RCODE_START+100h) ; 23/04/2023 ; 06/06/2023 - 8862 ; 03/05/2023 - 8863 00001E5C BB7208 mov bx,EndCode-RCODE_START ; 06/06/2023 - 8864 ; 18/07/2024 - 8865 ;mov bx,894h ; PCDOS 7.1 COMMAND.COM - 8866 - 8867 ;M030; - 8868 ; Set di=0ffffh so that we load low in case no one answers this int 2fh + 8857 ;We have to call DOS to get the load address in HIMEM for COMMAND + 8858 ;We pass in bx the number of bytes we need + 8859 + 8860 ;mov bx,offset CODERES:EndCode + 8861 ; 29/01/2023 + 8862 ;;mov bx,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM + 8863 ; 06/06/2023 + 8864 ;mov bx,EndCode-(RCODE_START+100h) ; 23/04/2023 ; 06/06/2023 + 8865 ; 03/05/2023 + 8866 00001E5C BB7208 mov bx,EndCode-RCODE_START ; 06/06/2023 + 8867 ; 18/07/2024 + 8868 ;mov bx,894h ; PCDOS 7.1 COMMAND.COM 8869 - 8870 00001E5F BFFFFF mov di,0FFFFh ;DT - in case no-one handles - 8871 ;this ; M030 - 8872 00001E62 B8024A mov ax,GET_HMA_ADDR ; 4A02h - 8873 00001E65 CD2F int 2Fh - 8874 - 8875 ;If the offset = 0xffff, then no HMA available - 8876 - 8877 00001E67 83FFFF cmp di,0FFFFh ;HMA available? - 8878 00001E6A C606[9600]01 mov byte [ComInHMA],1 ;assume command.com in HMA - 8879 00001E6F 75DA jne short setup_move ;no error, es:di = memory - 8880 - 8881 ;mov byte [ComInHMA],0 ;could not load in HMA - 8882 ; 29/01/2023 - 8883 00001E71 FE0E[9600] dec byte [ComInHMA] ; 1 -> 0 - 8884 - 8885 ;Zero means that we do not have enough HIMEM. Remain low and update - 8886 ;ResSize to reflect this + 8870 ;M030; + 8871 ; Set di=0ffffh so that we load low in case no one answers this int 2fh + 8872 + 8873 00001E5F BFFFFF mov di,0FFFFh ;DT - in case no-one handles + 8874 ;this ; M030 + 8875 00001E62 B8024A mov ax,GET_HMA_ADDR ; 4A02h + 8876 00001E65 CD2F int 2Fh + 8877 + 8878 ;If the offset = 0xffff, then no HMA available + 8879 + 8880 00001E67 83FFFF cmp di,0FFFFh ;HMA available? + 8881 00001E6A C606[9600]01 mov byte [ComInHMA],1 ;assume command.com in HMA + 8882 00001E6F 75DA jne short setup_move ;no error, es:di = memory + 8883 + 8884 ;mov byte [ComInHMA],0 ;could not load in HMA + 8885 ; 29/01/2023 + 8886 00001E71 FE0E[9600] dec byte [ComInHMA] ; 1 -> 0 8887 - 8888 00001E75 8B0E[B204] mov cx,[ResMsgEnd] ;size of data in bytes - 8889 ;;mov ax,offset CODERES:EndCode ;size of code in bytes - 8890 ;;mov ax,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM - 8891 ;mov ax,EndCode-RCODE_START - 8892 ;add cx,ax - 8893 ; 06/06/2023 - 8894 ; 29/01/2023 - 8895 ;add cx,(EndCode-(RCODE_START+100h))+15 ; 23/04/2023 ; 06/06/2023 - 8896 ;add cx,15 ;round up to next para - 8897 ; 03/05/2023 - 8898 00001E79 81C18108 add cx,(EndCode-RCODE_START)+15 ; 06/06/2023 - 8899 00001E7D D1E9 shr cx,1 - 8900 00001E7F D1E9 shr cx,1 - 8901 00001E81 D1E9 shr cx,1 - 8902 00001E83 D1E9 shr cx,1 ;ax = para size of res code - 8903 00001E85 890E[B404] mov [ResSize],cx ;store resident size - 8904 00001E89 EBBA jmp short load_low ;let code remain low - 8905 - 8906 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 8907 %if 0 ; PCDOS 7.1 COMMAND.COM - 8908 no_move: - 8909 ; 05/05/2023 - 8910 ;mov cl,4 - 8911 add di,0Fh - 8912 and di,0FFF0h ;round it to a para offset - 8913 jmp short patch_up - 8914 - 8915 setup_move: - 8916 ;mov si,offset RESGROUP:StartCode - 8917 ; 03/05/2023 - 8918 mov si,RCODE_START ; Start addr of Resident Code (CODERES segment) - 8919 ; 0D40h for MSDOS 5.0 COMMAND.COM - 8920 ; 0E10h for PCDOS 7.1 COMMAND.COM ; 18/07/2024 - 8921 ;mov cx,offset CODERES:EndCode ;cx = bytes to move - 8922 ;mov cx,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM - 8923 ; 06/06/2023 - 8924 ;mov cx,EndCode-(RCODE_START+100h) ; 23/04/2023 - 8925 ; 03/05/2023 - 8926 mov cx,EndCode-RCODE_START ; 06/06/2023 - 8927 ;mov cx,894h ; PCDOS 7.1 COMMAND.COM ; 18/07/2024 - 8928 - 8929 cld - 8930 push di ;need di for patching offset - 8931 rep movsb - 8932 pop di - 8933 - 8934 patch_up: - 8935 call patch_stub - 8936 pop es - 8937 pop ds - 8938 ;assume ds:nothing - 8939 retn - 8940 %endif - 8941 - 8942 ;Move_res_code endp - 8943 - 8944 ;else ;ROMDOS - 8945 ; - 8946 ;;*** Move_res_code - ROMDOS version - locate ROM resident - 8947 ; - 8948 ;Move_res_code proc - 8949 ; - 8950 ; push es - 8951 ; - 8952 ; invoke FindROMRes ; ES:DI = ptr to ROM resident code - 8953 ; call patch_stub + 8888 ;Zero means that we do not have enough HIMEM. Remain low and update + 8889 ;ResSize to reflect this + 8890 + 8891 00001E75 8B0E[B204] mov cx,[ResMsgEnd] ;size of data in bytes + 8892 ;;mov ax,offset CODERES:EndCode ;size of code in bytes + 8893 ;;mov ax,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM + 8894 ;mov ax,EndCode-RCODE_START + 8895 ;add cx,ax + 8896 ; 06/06/2023 + 8897 ; 29/01/2023 + 8898 ;add cx,(EndCode-(RCODE_START+100h))+15 ; 23/04/2023 ; 06/06/2023 + 8899 ;add cx,15 ;round up to next para + 8900 ; 03/05/2023 + 8901 00001E79 81C18108 add cx,(EndCode-RCODE_START)+15 ; 06/06/2023 + 8902 00001E7D D1E9 shr cx,1 + 8903 00001E7F D1E9 shr cx,1 + 8904 00001E81 D1E9 shr cx,1 + 8905 00001E83 D1E9 shr cx,1 ;ax = para size of res code + 8906 00001E85 890E[B404] mov [ResSize],cx ;store resident size + 8907 00001E89 EBBA jmp short load_low ;let code remain low + 8908 + 8909 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 8910 %if 0 ; PCDOS 7.1 COMMAND.COM + 8911 no_move: + 8912 ; 05/05/2023 + 8913 ;mov cl,4 + 8914 add di,0Fh + 8915 and di,0FFF0h ;round it to a para offset + 8916 jmp short patch_up + 8917 + 8918 setup_move: + 8919 ;mov si,offset RESGROUP:StartCode + 8920 ; 03/05/2023 + 8921 mov si,RCODE_START ; Start addr of Resident Code (CODERES segment) + 8922 ; 0D40h for MSDOS 5.0 COMMAND.COM + 8923 ; 0E10h for PCDOS 7.1 COMMAND.COM ; 18/07/2024 + 8924 ;mov cx,offset CODERES:EndCode ;cx = bytes to move + 8925 ;mov cx,81Ah ; MSDOS 5.0 & MSDOS 6.22 COMMAND.COM + 8926 ; 06/06/2023 + 8927 ;mov cx,EndCode-(RCODE_START+100h) ; 23/04/2023 + 8928 ; 03/05/2023 + 8929 mov cx,EndCode-RCODE_START ; 06/06/2023 + 8930 ;mov cx,894h ; PCDOS 7.1 COMMAND.COM ; 18/07/2024 + 8931 + 8932 cld + 8933 push di ;need di for patching offset + 8934 rep movsb + 8935 pop di + 8936 + 8937 patch_up: + 8938 call patch_stub + 8939 pop es + 8940 pop ds + 8941 ;assume ds:nothing + 8942 retn + 8943 %endif + 8944 + 8945 ;Move_res_code endp + 8946 + 8947 ;else ;ROMDOS + 8948 ; + 8949 ;;*** Move_res_code - ROMDOS version - locate ROM resident + 8950 ; + 8951 ;Move_res_code proc + 8952 ; + 8953 ; push es 8954 ; - 8955 ; pop es - 8956 ; ret + 8955 ; invoke FindROMRes ; ES:DI = ptr to ROM resident code + 8956 ; call patch_stub 8957 ; - 8958 ;Move_res_code endp - 8959 ; - 8960 ; assume ds:NOTHING ; to match ending assume above - 8961 ; - 8962 ;endif ;ROMDOS - 8963 - 8964 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 8965 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1D52h + 8958 ; pop es + 8959 ; ret + 8960 ; + 8961 ;Move_res_code endp + 8962 ; + 8963 ; assume ds:NOTHING ; to match ending assume above + 8964 ; + 8965 ;endif ;ROMDOS 8966 - 8967 ; MSDOS 6.0 - 8968 ;*** Alloc_env -- This routine allocates the temporary environment for the - 8969 ; Init code to initialize the COMSPEC. This is not a complete environment. - 8970 ; Later on, at EndInit time, a proper sized environment is allocated and - 8971 ; the contents of this temporary environment are copied to it. This routine - 8972 ; will not be called in case a valid environment is passed to command.com - 8973 ; - 8974 ; ENTRY: FirstCom and initial EnvirSeg set - 8975 ; - 8976 ; EXIT: ax = EnvirSeg = segment of newly allocated environment segment - 8977 ; - 8978 ; REGISTERS AFFECTED: ax,bx,cx,dx - 8979 - 8980 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 8981 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1F3Fh + 8967 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 8968 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1D52h + 8969 + 8970 ; MSDOS 6.0 + 8971 ;*** Alloc_env -- This routine allocates the temporary environment for the + 8972 ; Init code to initialize the COMSPEC. This is not a complete environment. + 8973 ; Later on, at EndInit time, a proper sized environment is allocated and + 8974 ; the contents of this temporary environment are copied to it. This routine + 8975 ; will not be called in case a valid environment is passed to command.com + 8976 ; + 8977 ; ENTRY: FirstCom and initial EnvirSeg set + 8978 ; + 8979 ; EXIT: ax = EnvirSeg = segment of newly allocated environment segment + 8980 ; + 8981 ; REGISTERS AFFECTED: ax,bx,cx,dx 8982 - 8983 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 8984 ; PCDOS 7.1 COMMAND.COM - RESGROUP:206Eh + 8983 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 8984 ; MSDOS 6.22 COMMAND.COM - RESGROUP:1F3Fh 8985 - 8986 alloc_env: ;proc near - 8987 ;assume ds:nothing - 8988 - 8989 00001E8B 1E push ds - 8990 00001E8C 06 push es - 8991 00001E8D 56 push si - 8992 00001E8E 57 push di - 8993 - 8994 ; 07/06/2023 - 8995 ; 29/01/2023 - MSDOS 6.0 COMMAND.COM - 8996 ;%if 0 - 8997 %if 1 - 8998 00001E8F 16 push ss - 8999 00001E90 1F pop ds - 9000 ;assume ds:RESGROUP - 9001 - 9002 00001E91 A1[3A04] mov ax,[EnvirSeg] - 9003 - 9004 00001E94 803E[5420]00 cmp byte [AllocedEnv],0 - 9005 00001E99 7403 je short alloc_cont - 9006 00001E9B E91A01 jmp alloc_done - 9007 - 9008 alloc_cont: - 9009 00001E9E 29FF sub di,di ; default start - 9010 ;mov bx,SIZE Environment ; default size needed - 9011 ; 29/01/2023 - 9012 00001EA0 BBA600 mov bx,ENVIRONSIZ ; mov bx,180 ; 07/06/2023 - 9013 ; mov bx,166 ; 18/07/2024 ; PCDOS 7.1 - 9014 00001EA3 803E[9926]00 cmp byte [FirstCom],0 ; first COMMAND.COM? - 9015 00001EA8 7462 je short alloc_seg ; no - 9016 - 9017 ; Check EnvirSeg; if non-zero, then scan it for PATH and COMSPEC; - 9018 ; Record their respective locations and do not add the default vars. + 8986 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 8987 ; PCDOS 7.1 COMMAND.COM - RESGROUP:206Eh + 8988 + 8989 alloc_env: ;proc near + 8990 ;assume ds:nothing + 8991 + 8992 00001E8B 1E push ds + 8993 00001E8C 06 push es + 8994 00001E8D 56 push si + 8995 00001E8E 57 push di + 8996 + 8997 ; 07/06/2023 + 8998 ; 29/01/2023 - MSDOS 6.0 COMMAND.COM + 8999 ;%if 0 + 9000 %if 1 + 9001 00001E8F 16 push ss + 9002 00001E90 1F pop ds + 9003 ;assume ds:RESGROUP + 9004 + 9005 00001E91 A1[3A04] mov ax,[EnvirSeg] + 9006 + 9007 00001E94 803E[5420]00 cmp byte [AllocedEnv],0 + 9008 00001E99 7403 je short alloc_cont + 9009 00001E9B E91A01 jmp alloc_done + 9010 + 9011 alloc_cont: + 9012 00001E9E 29FF sub di,di ; default start + 9013 ;mov bx,SIZE Environment ; default size needed + 9014 ; 29/01/2023 + 9015 00001EA0 BBA600 mov bx,ENVIRONSIZ ; mov bx,180 ; 07/06/2023 + 9016 ; mov bx,166 ; 18/07/2024 ; PCDOS 7.1 + 9017 00001EA3 803E[9926]00 cmp byte [FirstCom],0 ; first COMMAND.COM? + 9018 00001EA8 7462 je short alloc_seg ; no 9019 - 9020 00001EAA 09C0 or ax,ax - 9021 00001EAC 745A jz short alloc_new ; no previous environment + 9020 ; Check EnvirSeg; if non-zero, then scan it for PATH and COMSPEC; + 9021 ; Record their respective locations and do not add the default vars. 9022 - 9023 00001EAE 8EC0 mov es,ax - 9024 ;assume es:nothing + 9023 00001EAA 09C0 or ax,ax + 9024 00001EAC 745A jz short alloc_new ; no previous environment 9025 - 9026 _find_path: - 9027 00001EB0 B000 mov al,0 - 9028 00001EB2 29FF sub di,di - 9029 comp_path: - 9030 00001EB4 AE scasb ; end of env? - 9031 00001EB5 7417 je short _find_prompt ; yes - 9032 ;je short find_comspec ; 18/07/2024 ; PCDOS 7.1 COMMAND.COM - 9033 00001EB7 4F dec di - 9034 00001EB8 B90500 mov cx,PathStrLen ; mov cx,5 ; "PATH=" - 9035 ;mov si,offset RESGROUP:PathString - 9036 00001EBB BE[5520] mov si,PathString ; "PATH=" - 9037 00001EBE F3A6 repe cmpsb - 9038 00001EC0 7407 je short got_path - 9039 00001EC2 B90001 mov cx,256 - 9040 00001EC5 F2AE repne scasb ; find next NULL - 9041 00001EC7 EBEB jmp short comp_path - 9042 - 9043 got_path: - 9044 00001EC9 C606[5520]00 mov byte [PathString],0 ; don't add it + 9026 00001EAE 8EC0 mov es,ax + 9027 ;assume es:nothing + 9028 + 9029 _find_path: + 9030 00001EB0 B000 mov al,0 + 9031 00001EB2 29FF sub di,di + 9032 comp_path: + 9033 00001EB4 AE scasb ; end of env? + 9034 00001EB5 7417 je short _find_prompt ; yes + 9035 ;je short find_comspec ; 18/07/2024 ; PCDOS 7.1 COMMAND.COM + 9036 00001EB7 4F dec di + 9037 00001EB8 B90500 mov cx,PathStrLen ; mov cx,5 ; "PATH=" + 9038 ;mov si,offset RESGROUP:PathString + 9039 00001EBB BE[5520] mov si,PathString ; "PATH=" + 9040 00001EBE F3A6 repe cmpsb + 9041 00001EC0 7407 je short got_path + 9042 00001EC2 B90001 mov cx,256 + 9043 00001EC5 F2AE repne scasb ; find next NULL + 9044 00001EC7 EBEB jmp short comp_path 9045 - 9046 _find_prompt: - 9047 - 9048 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 9049 ;%if 0 ; PCDOS 7.1 COMMAND.COM - 9050 ; sub di,di - 9051 ;comp_prompt: - 9052 ; scasb ; end of env? - 9053 ; je short find_comspec ; yes - 9054 ; dec di - 9055 ; mov cx,PrmptStrLen2 ; mov cx,7 - 9056 ; ;mov si,offset RESGROUP:PrmptString - 9057 ; mov si,PrmptString ; "PROMPT=$P$G" - 9058 ; repe cmpsb - 9059 ; je short got_prompt - 9060 ; mov cx,256 - 9061 ; repne scasb ; find next NULL - 9062 ; jmp short comp_prompt - 9063 ; - 9064 ;got_prompt: - 9065 ; mov byte [PrmptString],0 ; don't add it - 9066 ;%endif - 9067 - 9068 find_comspec: - 9069 00001ECE 29FF sub di,di - 9070 comp_comspec: - 9071 00001ED0 AE scasb ; end of env? - 9072 00001ED1 7423 je short got_envend ; yes - 9073 00001ED3 4F dec di - 9074 00001ED4 B90800 mov cx,ComspStrLen ; mov cx,8 - 9075 ;mov si,offset RESGROUP:ComspString - 9076 00001ED7 BE[6D20] mov si,ComspString ; "COMSPEC=\COMMAND.COM" - 9077 00001EDA F3A6 repe cmpsb - 9078 00001EDC 7407 je short got_comspec - 9079 00001EDE B90001 mov cx,256 - 9080 00001EE1 F2AE repne scasb ; find next NULL - 9081 00001EE3 EBEB jmp short comp_comspec - 9082 - 9083 got_comspec: - 9084 00001EE5 893E[6B20] mov [ComspOffset],di + 9046 got_path: + 9047 00001EC9 C606[5520]00 mov byte [PathString],0 ; don't add it + 9048 + 9049 _find_prompt: + 9050 + 9051 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 9052 ;%if 0 ; PCDOS 7.1 COMMAND.COM + 9053 ; sub di,di + 9054 ;comp_prompt: + 9055 ; scasb ; end of env? + 9056 ; je short find_comspec ; yes + 9057 ; dec di + 9058 ; mov cx,PrmptStrLen2 ; mov cx,7 + 9059 ; ;mov si,offset RESGROUP:PrmptString + 9060 ; mov si,PrmptString ; "PROMPT=$P$G" + 9061 ; repe cmpsb + 9062 ; je short got_prompt + 9063 ; mov cx,256 + 9064 ; repne scasb ; find next NULL + 9065 ; jmp short comp_prompt + 9066 ; + 9067 ;got_prompt: + 9068 ; mov byte [PrmptString],0 ; don't add it + 9069 ;%endif + 9070 + 9071 find_comspec: + 9072 00001ECE 29FF sub di,di + 9073 comp_comspec: + 9074 00001ED0 AE scasb ; end of env? + 9075 00001ED1 7423 je short got_envend ; yes + 9076 00001ED3 4F dec di + 9077 00001ED4 B90800 mov cx,ComspStrLen ; mov cx,8 + 9078 ;mov si,offset RESGROUP:ComspString + 9079 00001ED7 BE[6D20] mov si,ComspString ; "COMSPEC=\COMMAND.COM" + 9080 00001EDA F3A6 repe cmpsb + 9081 00001EDC 7407 je short got_comspec + 9082 00001EDE B90001 mov cx,256 + 9083 00001EE1 F2AE repne scasb ; find next NULL + 9084 00001EE3 EBEB jmp short comp_comspec 9085 - 9086 find_envend: - 9087 00001EE9 29FF sub di,di - 9088 00001EEB B90080 mov cx,ENVBIG ; 32768 ; max env size - 9089 comp_envend: - 9090 00001EEE 49 dec cx ; - 9091 00001EEF AE scasb ; end of env? - 9092 00001EF0 7404 je short got_envend ; yes - 9093 00001EF2 F2AE repne scasb - 9094 00001EF4 EBF8 jmp short comp_envend - 9095 - 9096 got_envend: - 9097 00001EF6 4F dec di - 9098 ; 07/06/2023 - 9099 00001EF7 8D9DA600 lea bx,[di+ENVIRONSIZ] ; add room for the basics - 9100 ; 18/07/2024 - 9101 ;lea bx,[di+166] ; PCDOS 7.1 COMMAND.COM - ENVIRONSIZ = 166 - 9102 - 9103 ; We want to fall through to alloc_new and set up default - 9104 ; path and prompt ONLY IF this is the first process; in all other - 9105 ; cases, we assume it is a bad idea to try editing the user's environment - 9106 - 9107 00001EFB 1E push ds - 9108 ;mov ds,ds:[PDB_Parent_Pid] - 9109 00001EFC 8E1E1600 mov ds,[PDB.PARENT_PID] - 9110 ;cmp ds:[PDB_Parent_Pid],0 ; is parent's parent pid field 0? - 9111 00001F00 833E160000 cmp word [PDB.PARENT_PID],0 - 9112 00001F05 1F pop ds - 9113 00001F06 7504 jne short alloc_seg ; no, we're not the first process - 9114 ; so don't muck with the env. - 9115 alloc_new: - 9116 00001F08 FE06[5420] inc byte [AllocedEnv] ; note we have virgin env. - 9117 - 9118 alloc_seg: - 9119 - 9120 ; Allocate default environment size - 9121 - 9122 00001F0C 89D9 mov cx,bx ; save byte-granular size in CX - 9123 00001F0E 83C30F add bx,15 - 9124 00001F11 D1EB shr bx,1 - 9125 00001F13 D1EB shr bx,1 - 9126 00001F15 D1EB shr bx,1 - 9127 00001F17 D1EB shr bx,1 ; BX = # paras - 9128 00001F19 B448 mov ah,ALLOC ; 48h - 9129 00001F1B CD21 int 21h - 9130 00001F1D 7303 jnc short init_ok - 9131 00001F1F E99B00 jmp init_nomem ; insufficient memory, error - 9132 - 9133 ; If a previous environment existed (ie, DI != 0), then copy it into - 9134 ; the new buffer + 9086 got_comspec: + 9087 00001EE5 893E[6B20] mov [ComspOffset],di + 9088 + 9089 find_envend: + 9090 00001EE9 29FF sub di,di + 9091 00001EEB B90080 mov cx,ENVBIG ; 32768 ; max env size + 9092 comp_envend: + 9093 00001EEE 49 dec cx ; + 9094 00001EEF AE scasb ; end of env? + 9095 00001EF0 7404 je short got_envend ; yes + 9096 00001EF2 F2AE repne scasb + 9097 00001EF4 EBF8 jmp short comp_envend + 9098 + 9099 got_envend: + 9100 00001EF6 4F dec di + 9101 ; 07/06/2023 + 9102 00001EF7 8D9DA600 lea bx,[di+ENVIRONSIZ] ; add room for the basics + 9103 ; 18/07/2024 + 9104 ;lea bx,[di+166] ; PCDOS 7.1 COMMAND.COM - ENVIRONSIZ = 166 + 9105 + 9106 ; We want to fall through to alloc_new and set up default + 9107 ; path and prompt ONLY IF this is the first process; in all other + 9108 ; cases, we assume it is a bad idea to try editing the user's environment + 9109 + 9110 00001EFB 1E push ds + 9111 ;mov ds,ds:[PDB_Parent_Pid] + 9112 00001EFC 8E1E1600 mov ds,[PDB.PARENT_PID] + 9113 ;cmp ds:[PDB_Parent_Pid],0 ; is parent's parent pid field 0? + 9114 00001F00 833E160000 cmp word [PDB.PARENT_PID],0 + 9115 00001F05 1F pop ds + 9116 00001F06 7504 jne short alloc_seg ; no, we're not the first process + 9117 ; so don't muck with the env. + 9118 alloc_new: + 9119 00001F08 FE06[5420] inc byte [AllocedEnv] ; note we have virgin env. + 9120 + 9121 alloc_seg: + 9122 + 9123 ; Allocate default environment size + 9124 + 9125 00001F0C 89D9 mov cx,bx ; save byte-granular size in CX + 9126 00001F0E 83C30F add bx,15 + 9127 00001F11 D1EB shr bx,1 + 9128 00001F13 D1EB shr bx,1 + 9129 00001F15 D1EB shr bx,1 + 9130 00001F17 D1EB shr bx,1 ; BX = # paras + 9131 00001F19 B448 mov ah,ALLOC ; 48h + 9132 00001F1B CD21 int 21h + 9133 00001F1D 7303 jnc short init_ok + 9134 00001F1F E99B00 jmp init_nomem ; insufficient memory, error 9135 - 9136 init_ok: - 9137 00001F22 8EC0 mov es,ax - 9138 ;assume es:nothing ; es = temp env segment - 9139 - 9140 00001F24 09FF or di,di - 9141 00001F26 7412 jz short copy_path + 9136 ; If a previous environment existed (ie, DI != 0), then copy it into + 9137 ; the new buffer + 9138 + 9139 init_ok: + 9140 00001F22 8EC0 mov es,ax + 9141 ;assume es:nothing ; es = temp env segment 9142 - 9143 00001F28 51 push cx - 9144 00001F29 1E push ds - 9145 00001F2A 8E1E[3A04] mov ds,[EnvirSeg] - 9146 ;assume ds:nothing - 9147 00001F2E 29F6 sub si,si - 9148 00001F30 89F9 mov cx,di - 9149 00001F32 29FF sub di,di - 9150 00001F34 F3A4 rep movsb - 9151 00001F36 1F pop ds - 9152 ;assume ds:RESGROUP - 9153 00001F37 59 pop cx - 9154 00001F38 29F9 sub cx,di - 9155 - 9156 copy_path: - 9157 - 9158 ; First clear out (the rest of) the buffer - 9159 - 9160 00001F3A 57 push di - 9161 00001F3B 29C0 sub ax,ax - 9162 00001F3D F3AA rep stosb - 9163 00001F3F 5F pop di - 9164 - 9165 ; Initialize the path string (PATH=) first - 9166 - 9167 ;mov si,offset RESGROUP:PathString ; DS:SI -> "PATH=\0" - 9168 00001F40 BE[5520] mov si,PathString - 9169 00001F43 3804 cmp byte [si],al ; add it? - 9170 00001F45 744D je short init_prompt ; no - 9171 ;;mov cx,PathStrLen+1 ; - 9172 ;mov cx,6 ; db "PATH=",0 - 9173 ; 14/08/2024 - 9174 00001F47 B106 mov cl,6 - 9175 00001F49 F3A4 rep movsb ; - 9176 00001F4B 3806[5420] cmp [AllocedEnv],al ; virgin env? - 9177 00001F4F 7443 je short init_prompt ; no - 9178 - 9179 ; Establish a more reasonable default for the PATH - 9180 - 9181 ;mov ah,GET_DEFAULT_DRIVE - 9182 00001F51 B419 mov ah,19h - 9183 00001F53 CD21 int 21h - 9184 00001F55 0441 add al,'A' ; convert to letter - 9185 00001F57 A2[5B20] mov [DefPathString],al ; - 9186 00001F5A A2[6220] mov [DefPath2String],al ; now our default paths are complete - 9187 - 9188 00001F5D B200 mov dl,0 ; get dir for default drive - 9189 00001F5F 1E push ds ; - 9190 00001F60 06 push es ; - 9191 00001F61 1F pop ds ; - 9192 00001F62 C6055C mov byte [di],'\' ; - 9193 00001F65 8D7501 lea si,[di+1] ; set DS:SI -> available space - 9194 ;mov ah,Current_Dir ; - 9195 00001F68 B447 mov ah,47h - 9196 00001F6A CD21 int 21h ; - 9197 00001F6C 1F pop ds ; - 9198 - 9199 ;mov cx,9 ; db "C:\MSDOS",0 - 9200 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM - 9201 ;;mov cx,7 ; db "C:\DOS",0 - 9202 ;mov cx,DefPathStrLen+1 ; 7 - 9203 ; 14/08/2024 ; ch = 0 - 9204 00001F6D B107 mov cl,DefPathStrLen+1 ; 7 - 9205 - 9206 ;mov dx,offset RESGROUP:DefPathString - 9207 00001F6F BA[5B20] mov dx,DefPathString ; "C:\MSDOS" - 9208 ; 18/07/2024 ; "C:\DOS" for PCDOS 7.1 COMMAND.COM - 9209 00001F72 89D6 mov si,dx ; - 9210 ;mov ah,CHDir ; - 9211 00001F74 B43B mov ah,3Bh - 9212 00001F76 CD21 int 21h ; - 9213 00001F78 730D jnc short init_setpath ; DefPathString exists! - 9214 - 9215 ;mov cx,7 ; db "C:\DOS",0 - 9216 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM - 9217 ;;mov cx,9 ; db "C:\MSDOS",0 - 9218 ;mov cx,DefPath2StrLen+1 ; 9 - 9219 ; 14/08/2024 ; ch = 0 - 9220 00001F7A B109 mov cl,DefPath2StrLen+1 ; 9 - 9221 - 9222 ;mov dx,offset RESGROUP:DefPath2String - 9223 00001F7C BA[6220] mov dx,DefPath2String ; "C:\DOS" - 9224 ; 18/07/2024 ; "C:\MSDOS" for PCDOS 7.1 COMMAND.COM - 9225 00001F7F 89D6 mov si,dx ; - 9226 ;mov ah,CHDir ; - 9227 00001F81 B43B mov ah,3Bh - 9228 00001F83 CD21 int 21h ; - 9229 00001F85 720D jc short init_prompt ; DefPath2String doesn't exist - 9230 - 9231 init_setpath: - 9232 00001F87 89FA mov dx,di ; success - 9233 00001F89 1E push ds ; so restore prev dir - 9234 00001F8A 06 push es ; - 9235 00001F8B 1F pop ds ; DS:DX -> prev dir - 9236 ;mov ah,CHDir ; - 9237 00001F8C B43B mov ah,3Bh - 9238 00001F8E CD21 int 21h ; - 9239 00001F90 1F pop ds ; - 9240 - 9241 00001F91 4F dec di ; then copy in DefPathString - 9242 00001F92 F3A4 rep movsb ; DS:SI -> "C:\\DOS\0" + 9143 00001F24 09FF or di,di + 9144 00001F26 7412 jz short copy_path + 9145 + 9146 00001F28 51 push cx + 9147 00001F29 1E push ds + 9148 00001F2A 8E1E[3A04] mov ds,[EnvirSeg] + 9149 ;assume ds:nothing + 9150 00001F2E 29F6 sub si,si + 9151 00001F30 89F9 mov cx,di + 9152 00001F32 29FF sub di,di + 9153 00001F34 F3A4 rep movsb + 9154 00001F36 1F pop ds + 9155 ;assume ds:RESGROUP + 9156 00001F37 59 pop cx + 9157 00001F38 29F9 sub cx,di + 9158 + 9159 copy_path: + 9160 + 9161 ; First clear out (the rest of) the buffer + 9162 + 9163 00001F3A 57 push di + 9164 00001F3B 29C0 sub ax,ax + 9165 00001F3D F3AA rep stosb + 9166 00001F3F 5F pop di + 9167 + 9168 ; Initialize the path string (PATH=) first + 9169 + 9170 ;mov si,offset RESGROUP:PathString ; DS:SI -> "PATH=\0" + 9171 00001F40 BE[5520] mov si,PathString + 9172 00001F43 3804 cmp byte [si],al ; add it? + 9173 00001F45 744D je short init_prompt ; no + 9174 ;;mov cx,PathStrLen+1 ; + 9175 ;mov cx,6 ; db "PATH=",0 + 9176 ; 14/08/2024 + 9177 00001F47 B106 mov cl,6 + 9178 00001F49 F3A4 rep movsb ; + 9179 00001F4B 3806[5420] cmp [AllocedEnv],al ; virgin env? + 9180 00001F4F 7443 je short init_prompt ; no + 9181 + 9182 ; Establish a more reasonable default for the PATH + 9183 + 9184 ;mov ah,GET_DEFAULT_DRIVE + 9185 00001F51 B419 mov ah,19h + 9186 00001F53 CD21 int 21h + 9187 00001F55 0441 add al,'A' ; convert to letter + 9188 00001F57 A2[5B20] mov [DefPathString],al ; + 9189 00001F5A A2[6220] mov [DefPath2String],al ; now our default paths are complete + 9190 + 9191 00001F5D B200 mov dl,0 ; get dir for default drive + 9192 00001F5F 1E push ds ; + 9193 00001F60 06 push es ; + 9194 00001F61 1F pop ds ; + 9195 00001F62 C6055C mov byte [di],'\' ; + 9196 00001F65 8D7501 lea si,[di+1] ; set DS:SI -> available space + 9197 ;mov ah,Current_Dir ; + 9198 00001F68 B447 mov ah,47h + 9199 00001F6A CD21 int 21h ; + 9200 00001F6C 1F pop ds ; + 9201 + 9202 ;mov cx,9 ; db "C:\MSDOS",0 + 9203 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM + 9204 ;;mov cx,7 ; db "C:\DOS",0 + 9205 ;mov cx,DefPathStrLen+1 ; 7 + 9206 ; 14/08/2024 ; ch = 0 + 9207 00001F6D B107 mov cl,DefPathStrLen+1 ; 7 + 9208 + 9209 ;mov dx,offset RESGROUP:DefPathString + 9210 00001F6F BA[5B20] mov dx,DefPathString ; "C:\MSDOS" + 9211 ; 18/07/2024 ; "C:\DOS" for PCDOS 7.1 COMMAND.COM + 9212 00001F72 89D6 mov si,dx ; + 9213 ;mov ah,CHDir ; + 9214 00001F74 B43B mov ah,3Bh + 9215 00001F76 CD21 int 21h ; + 9216 00001F78 730D jnc short init_setpath ; DefPathString exists! + 9217 + 9218 ;mov cx,7 ; db "C:\DOS",0 + 9219 ; 18/07/2024 - PCDOS 7.1 COMMAND.COM + 9220 ;;mov cx,9 ; db "C:\MSDOS",0 + 9221 ;mov cx,DefPath2StrLen+1 ; 9 + 9222 ; 14/08/2024 ; ch = 0 + 9223 00001F7A B109 mov cl,DefPath2StrLen+1 ; 9 + 9224 + 9225 ;mov dx,offset RESGROUP:DefPath2String + 9226 00001F7C BA[6220] mov dx,DefPath2String ; "C:\DOS" + 9227 ; 18/07/2024 ; "C:\MSDOS" for PCDOS 7.1 COMMAND.COM + 9228 00001F7F 89D6 mov si,dx ; + 9229 ;mov ah,CHDir ; + 9230 00001F81 B43B mov ah,3Bh + 9231 00001F83 CD21 int 21h ; + 9232 00001F85 720D jc short init_prompt ; DefPath2String doesn't exist + 9233 + 9234 init_setpath: + 9235 00001F87 89FA mov dx,di ; success + 9236 00001F89 1E push ds ; so restore prev dir + 9237 00001F8A 06 push es ; + 9238 00001F8B 1F pop ds ; DS:DX -> prev dir + 9239 ;mov ah,CHDir ; + 9240 00001F8C B43B mov ah,3Bh + 9241 00001F8E CD21 int 21h ; + 9242 00001F90 1F pop ds ; 9243 - 9244 ; Initialize the default prompt - 9245 - 9246 init_prompt: - 9247 ;init_compec: ; 18/07/2024 (PCDOS 7.1 COMMAND.COM - RESGROUP:217Ah) + 9244 00001F91 4F dec di ; then copy in DefPathString + 9245 00001F92 F3A4 rep movsb ; DS:SI -> "C:\\DOS\0" + 9246 + 9247 ; Initialize the default prompt 9248 - 9249 00001F94 57 push di ; - 9250 00001F95 29C0 sub ax,ax ; - 9251 ;mov cx,64 ; insure any data read in - 9252 ; 14/08/2024 - 9253 00001F97 B140 mov cl,64 ; ch = 0 - 9254 00001F99 F3AA rep stosb ; from Current_Dir is zapped - 9255 00001F9B 5F pop di ; - 9256 - 9257 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 9258 ;%if 0 ; PCDOS 7.1 COMMAND.COM - 9259 ; cmp [AllocedEnv],al ; virgin env? - 9260 ; je short init_comspec ; no - 9261 ; ;mov si,offset RESGROUP:PrmptString ; DS:SI -> "PROMPT=$P$G\0" - 9262 ; mov si,PrmptString - 9263 ; cmp [si],al ; add it? - 9264 ; je short init_comspec ; no - 9265 ; ;mov cx,PrmptStrLen+1 ; - 9266 ; mov cl,12 ; db "PROMPT=$P$G",0 - 9267 ; rep movsb ; - 9268 ;%endif - 9269 - 9270 ; Initialize the Comspec string - 9271 - 9272 init_comspec: - 9273 ; 18/07/2024 (PCDOS 7.1 COMMAND.COM - RESGROUP:2183h) + 9249 init_prompt: + 9250 ;init_compec: ; 18/07/2024 (PCDOS 7.1 COMMAND.COM - RESGROUP:217Ah) + 9251 + 9252 00001F94 57 push di ; + 9253 00001F95 29C0 sub ax,ax ; + 9254 ;mov cx,64 ; insure any data read in + 9255 ; 14/08/2024 + 9256 00001F97 B140 mov cl,64 ; ch = 0 + 9257 00001F99 F3AA rep stosb ; from Current_Dir is zapped + 9258 00001F9B 5F pop di ; + 9259 + 9260 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 9261 ;%if 0 ; PCDOS 7.1 COMMAND.COM + 9262 ; cmp [AllocedEnv],al ; virgin env? + 9263 ; je short init_comspec ; no + 9264 ; ;mov si,offset RESGROUP:PrmptString ; DS:SI -> "PROMPT=$P$G\0" + 9265 ; mov si,PrmptString + 9266 ; cmp [si],al ; add it? + 9267 ; je short init_comspec ; no + 9268 ; ;mov cx,PrmptStrLen+1 ; + 9269 ; mov cl,12 ; db "PROMPT=$P$G",0 + 9270 ; rep movsb ; + 9271 ;%endif + 9272 + 9273 ; Initialize the Comspec string 9274 - 9275 00001F9C 3906[6B20] cmp [ComspOffset],ax ; add it? - 9276 00001FA0 750D jne short init_done ; no - 9277 ;lea ax,[di+8] - 9278 00001FA2 8D4508 lea ax,[di+ComspStrLen] ; - 9279 00001FA5 A3[6B20] mov [ComspOffset],ax ; - 9280 ;mov si,offset RESGROUP:ComspString ; DS:SI -> "COMSPEC=\\COMMAND.COM\0" - 9281 00001FA8 BE[6D20] mov si,ComspString - 9282 ; 23/07/2024 - 9283 ;mov cx,ComspStrLen2+1 ; - 9284 ;;mov cx,21 ; db "COMSPEC=\COMMAND.COM",0 - 9285 ; 14/08/2024 - 9286 00001FAB B115 mov cl,ComspStrLen2+1 ; 21 - 9287 00001FAD F3A4 rep movsb ; - 9288 - 9289 init_done: - 9290 00001FAF 8CC0 mov ax,es ; return env seg in ax - 9291 00001FB1 A3[3A04] mov [EnvirSeg],ax ; save env seg - 9292 00001FB4 FE06[5420] inc byte [AllocedEnv] ; remember that *we* alloced it - 9293 %endif - 9294 - 9295 ; 07/06/2023 - 9296 ; 29/01/2023 - MSDOS 5.0 COMMAND.COM (RESGROUP:1DC4h) - 9297 ;%if 1 - 9298 %if 0 - 9299 ;mov bx,10 - 9300 mov bx,ENVIRONSIZ>>4 ; 160/16 - 9301 mov ah,48h - 9302 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 9303 ; BX = number of 16-byte paragraphs desired - 9304 jc short init_nomem - 9305 - 9306 init_ok: - 9307 mov es,ax - 9308 ;assume es:nothing ; es = temp env segment - 9309 - 9310 xor di,di - 9311 mov ax,di - 9312 ;mov cx,160 - 9313 mov cx,ENVIRONSIZ - 9314 rep stosb - 9315 - 9316 init_pathstr: - 9317 - 9318 ; Initialize the path string (PATH=) first - 9319 - 9320 push ss - 9321 pop ds + 9275 init_comspec: + 9276 ; 18/07/2024 (PCDOS 7.1 COMMAND.COM - RESGROUP:2183h) + 9277 + 9278 00001F9C 3906[6B20] cmp [ComspOffset],ax ; add it? + 9279 00001FA0 750D jne short init_done ; no + 9280 ;lea ax,[di+8] + 9281 00001FA2 8D4508 lea ax,[di+ComspStrLen] ; + 9282 00001FA5 A3[6B20] mov [ComspOffset],ax ; + 9283 ;mov si,offset RESGROUP:ComspString ; DS:SI -> "COMSPEC=\\COMMAND.COM\0" + 9284 00001FA8 BE[6D20] mov si,ComspString + 9285 ; 23/07/2024 + 9286 ;mov cx,ComspStrLen2+1 ; + 9287 ;;mov cx,21 ; db "COMSPEC=\COMMAND.COM",0 + 9288 ; 14/08/2024 + 9289 00001FAB B115 mov cl,ComspStrLen2+1 ; 21 + 9290 00001FAD F3A4 rep movsb ; + 9291 + 9292 init_done: + 9293 00001FAF 8CC0 mov ax,es ; return env seg in ax + 9294 00001FB1 A3[3A04] mov [EnvirSeg],ax ; save env seg + 9295 00001FB4 FE06[5420] inc byte [AllocedEnv] ; remember that *we* alloced it + 9296 %endif + 9297 + 9298 ; 07/06/2023 + 9299 ; 29/01/2023 - MSDOS 5.0 COMMAND.COM (RESGROUP:1DC4h) + 9300 ;%if 1 + 9301 %if 0 + 9302 ;mov bx,10 + 9303 mov bx,ENVIRONSIZ>>4 ; 160/16 + 9304 mov ah,48h + 9305 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 9306 ; BX = number of 16-byte paragraphs desired + 9307 jc short init_nomem + 9308 + 9309 init_ok: + 9310 mov es,ax + 9311 ;assume es:nothing ; es = temp env segment + 9312 + 9313 xor di,di + 9314 mov ax,di + 9315 ;mov cx,160 + 9316 mov cx,ENVIRONSIZ + 9317 rep stosb + 9318 + 9319 init_pathstr: + 9320 + 9321 ; Initialize the path string (PATH=) first 9322 - 9323 ;mov si,offset RESGROUP:PathString ; DS:SI -> "PATH=\0" - 9324 mov si,PathString - 9325 mov di,0 - 9326 init_cp_pathstr: - 9327 lodsb - 9328 stosb - 9329 or al,al - 9330 jnz short init_cp_pathstr - 9331 - 9332 ; Initialize the Comspec string - 9333 - 9334 init_comspec: - 9335 ;mov si,offset RESGROUP:ComspString ; DS:SI -> "COMSPEC=\\COMMAND.COM\0" - 9336 mov si,ComspString - 9337 ; 05/05/2023 - 9338 mov di,6 - 9339 init_cp_compstr: - 9340 lodsb - 9341 stosb - 9342 or al,al - 9343 jnz short init_cp_compstr - 9344 - 9345 init_done: - 9346 mov ax,es ; return env seg in ax - 9347 ;mov [EnvirSeg],ax ; save env seg - 9348 ;inc byte [AllocedEnv] ; remember that *we* alloced it - 9349 %endif - 9350 - 9351 ; 29/01/2023 - 9352 alloc_done: - 9353 00001FB8 5F pop di - 9354 00001FB9 5E pop si - 9355 00001FBA 07 pop es - 9356 00001FBB 1F pop ds - 9357 ;assume ds:nothing - 9358 00001FBC C3 retn - 9359 - 9360 ; 29/01/2023 - 9361 init_nomem: + 9323 push ss + 9324 pop ds + 9325 + 9326 ;mov si,offset RESGROUP:PathString ; DS:SI -> "PATH=\0" + 9327 mov si,PathString + 9328 mov di,0 + 9329 init_cp_pathstr: + 9330 lodsb + 9331 stosb + 9332 or al,al + 9333 jnz short init_cp_pathstr + 9334 + 9335 ; Initialize the Comspec string + 9336 + 9337 init_comspec: + 9338 ;mov si,offset RESGROUP:ComspString ; DS:SI -> "COMSPEC=\\COMMAND.COM\0" + 9339 mov si,ComspString + 9340 ; 05/05/2023 + 9341 mov di,6 + 9342 init_cp_compstr: + 9343 lodsb + 9344 stosb + 9345 or al,al + 9346 jnz short init_cp_compstr + 9347 + 9348 init_done: + 9349 mov ax,es ; return env seg in ax + 9350 ;mov [EnvirSeg],ax ; save env seg + 9351 ;inc byte [AllocedEnv] ; remember that *we* alloced it + 9352 %endif + 9353 + 9354 ; 29/01/2023 + 9355 alloc_done: + 9356 00001FB8 5F pop di + 9357 00001FB9 5E pop si + 9358 00001FBA 07 pop es + 9359 00001FBB 1F pop ds + 9360 ;assume ds:nothing + 9361 00001FBC C3 retn 9362 - 9363 ;We call the error routine from here. This routine never returns. It either - 9364 ;terminates COMMAND with error( if it is not the first invocation ) or hangs - 9365 ;the system ( if it is the first COMMAND.COM ). - 9366 - 9367 00001FBD E80000 call Alloc_error - 9368 - 9369 ;Alloc_env endp - 9370 - 9371 ;*** Alloc_error: This routine just jumps to the actual label where we - 9372 ; check if this is a permanent or secondary command.com and take the - 9373 ; appropriate action. - 9374 ; - 9375 ; ENTRY: ds = RESGROUP = DATARES - 9376 ; - 9377 ; EXIT: None - does not return - 9378 ; - 9379 ; REGISTERS AFFECTED: Does not matter - 9380 ; - 9381 - 9382 ;public Alloc_error - 9383 Alloc_error: ;proc near + 9363 ; 29/01/2023 + 9364 init_nomem: + 9365 + 9366 ;We call the error routine from here. This routine never returns. It either + 9367 ;terminates COMMAND with error( if it is not the first invocation ) or hangs + 9368 ;the system ( if it is the first COMMAND.COM ). + 9369 + 9370 00001FBD E80000 call Alloc_error + 9371 + 9372 ;Alloc_env endp + 9373 + 9374 ;*** Alloc_error: This routine just jumps to the actual label where we + 9375 ; check if this is a permanent or secondary command.com and take the + 9376 ; appropriate action. + 9377 ; + 9378 ; ENTRY: ds = RESGROUP = DATARES + 9379 ; + 9380 ; EXIT: None - does not return + 9381 ; + 9382 ; REGISTERS AFFECTED: Does not matter + 9383 ; 9384 - 9385 ;jmp RESGROUP:BadMemErr - 9386 ; 29/01/2023 - 9387 00001FC0 E955EE jmp BadMemErr - 9388 - 9389 ;Alloc_error endp - 9390 - 9391 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 9392 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1DFFh + 9385 ;public Alloc_error + 9386 Alloc_error: ;proc near + 9387 + 9388 ;jmp RESGROUP:BadMemErr + 9389 ; 29/01/2023 + 9390 00001FC0 E955EE jmp BadMemErr + 9391 + 9392 ;Alloc_error endp 9393 - 9394 ; MSDOS 6.0 - 9395 ;*** Patch_stub -- This routine patches in the segment and offset values in - 9396 ; the stub table of the various entry points in the resident code segment. - 9397 ; Some of them are interrupt entry points and some of them are entries from - 9398 ; the transient to the resident code segment. - 9399 ; - 9400 ; ENTRY: ds = RESGROUP - 9401 ; es:di = segment:offset of final location of resident code + 9394 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 9395 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1DFFh + 9396 + 9397 ; MSDOS 6.0 + 9398 ;*** Patch_stub -- This routine patches in the segment and offset values in + 9399 ; the stub table of the various entry points in the resident code segment. + 9400 ; Some of them are interrupt entry points and some of them are entries from + 9401 ; the transient to the resident code segment. 9402 ; - 9403 ; EXIT: All segments and offsets patched into the stub table - 9404 ; - 9405 ; REGISTERS AFFECTED: ax, bx, cx, dx, si, di - 9406 - 9407 patch_stub: ;proc near - 9408 ;assume ds:RESGROUP - 9409 - 9410 00001FC3 06 push es - 9411 - 9412 00001FC4 8CC3 mov bx,es ;bx = resident code segment - 9413 00001FC6 89FA mov dx,di - 9414 ;mov di,offset DATARES:Int2f_Entry - 9415 00001FC8 BF[6600] mov di,Int2f_Entry - 9416 ;mov si,offset RESGROUP:Reloc_Table - 9417 00001FCB BE[7F26] mov si,Reloc_Table - 9418 00001FCE 1E push ds - 9419 00001FCF 07 pop es ;es = RESGROUP = DATARES - 9420 - 9421 ;bx:dx = segment:offset of resident code segment - 9422 ;es:di = entry point table in stub - 9423 ;ds:si = offset table in INIT segment -- offsets of code entry points now - 9424 - 9425 ;mov cx,NUM_RELOC_ENTRIES ;number of entry points - 9426 00001FD0 B90B00 mov cx,11 ; MSDOS 5.0 COMMAND.COM - 9427 patchlp: - 9428 00001FD3 AD lodsw ;get current offset - 9429 00001FD4 01D0 add ax,dx ;offset it by code seg location - 9430 00001FD6 AB stosw ;store offset - 9431 00001FD7 89D8 mov ax,bx - 9432 00001FD9 AB stosw ;store segment - 9433 00001FDA E2F7 loop patchlp - 9434 - 9435 00001FDC 07 pop es - 9436 00001FDD C3 retn + 9403 ; ENTRY: ds = RESGROUP + 9404 ; es:di = segment:offset of final location of resident code + 9405 ; + 9406 ; EXIT: All segments and offsets patched into the stub table + 9407 ; + 9408 ; REGISTERS AFFECTED: ax, bx, cx, dx, si, di + 9409 + 9410 patch_stub: ;proc near + 9411 ;assume ds:RESGROUP + 9412 + 9413 00001FC3 06 push es + 9414 + 9415 00001FC4 8CC3 mov bx,es ;bx = resident code segment + 9416 00001FC6 89FA mov dx,di + 9417 ;mov di,offset DATARES:Int2f_Entry + 9418 00001FC8 BF[6600] mov di,Int2f_Entry + 9419 ;mov si,offset RESGROUP:Reloc_Table + 9420 00001FCB BE[7F26] mov si,Reloc_Table + 9421 00001FCE 1E push ds + 9422 00001FCF 07 pop es ;es = RESGROUP = DATARES + 9423 + 9424 ;bx:dx = segment:offset of resident code segment + 9425 ;es:di = entry point table in stub + 9426 ;ds:si = offset table in INIT segment -- offsets of code entry points now + 9427 + 9428 ;mov cx,NUM_RELOC_ENTRIES ;number of entry points + 9429 00001FD0 B90B00 mov cx,11 ; MSDOS 5.0 COMMAND.COM + 9430 patchlp: + 9431 00001FD3 AD lodsw ;get current offset + 9432 00001FD4 01D0 add ax,dx ;offset it by code seg location + 9433 00001FD6 AB stosw ;store offset + 9434 00001FD7 89D8 mov ax,bx + 9435 00001FD9 AB stosw ;store segment + 9436 00001FDA E2F7 loop patchlp 9437 - 9438 ;Patch_stub endp - 9439 - 9440 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 9441 - 9442 ; MSDOS 6.0 - 9443 ;*** Patch_segs -- This routine patches the segment values in the dword - 9444 ; pointers that the stub uses to jump to the actual handler. These values - 9445 ; are temporarily needed to handle these interrupts if they occur before - 9446 ; the resident is relocated to its final position and all the addresses of - 9447 ; the handlers have been updated. - 9448 ; - 9449 ; ENTRY: es = PSP segment = code segment - 9450 ; - 9451 ; EXIT: Current segment values patched into the jump table in the - 9452 ; stub. + 9438 00001FDC 07 pop es + 9439 00001FDD C3 retn + 9440 + 9441 ;Patch_stub endp + 9442 + 9443 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 9444 + 9445 ; MSDOS 6.0 + 9446 ;*** Patch_segs -- This routine patches the segment values in the dword + 9447 ; pointers that the stub uses to jump to the actual handler. These values + 9448 ; are temporarily needed to handle these interrupts if they occur before + 9449 ; the resident is relocated to its final position and all the addresses of + 9450 ; the handlers have been updated. + 9451 ; + 9452 ; ENTRY: es = PSP segment = code segment 9453 ; - 9454 ; REGISTERS AFFECTED: ax, cx, di - 9455 - 9456 patch_segs: ;proc near - 9457 - 9458 ;mov di,offset RESGROUP:Int2f_Entry - 9459 00001FDE BF[6600] mov di,Int2f_Entry - 9460 00001FE1 B90400 mov cx,4 ;we have to patch 4 handlers - 9461 00001FE4 83C702 add di,2 - 9462 00001FE7 8CC0 mov ax,es - 9463 pseglp: - 9464 00001FE9 AB stosw ;store the segment value - 9465 00001FEA 83C702 add di,2 ;skip the next offset value - 9466 00001FED E2FA loop pseglp - 9467 - 9468 00001FEF C3 retn - 9469 - 9470 ;Patch_segs endp - 9471 - 9472 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 9473 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1E2Ch + 9454 ; EXIT: Current segment values patched into the jump table in the + 9455 ; stub. + 9456 ; + 9457 ; REGISTERS AFFECTED: ax, cx, di + 9458 + 9459 patch_segs: ;proc near + 9460 + 9461 ;mov di,offset RESGROUP:Int2f_Entry + 9462 00001FDE BF[6600] mov di,Int2f_Entry + 9463 00001FE1 B90400 mov cx,4 ;we have to patch 4 handlers + 9464 00001FE4 83C702 add di,2 + 9465 00001FE7 8CC0 mov ax,es + 9466 pseglp: + 9467 00001FE9 AB stosw ;store the segment value + 9468 00001FEA 83C702 add di,2 ;skip the next offset value + 9469 00001FED E2FA loop pseglp + 9470 + 9471 00001FEF C3 retn + 9472 + 9473 ;Patch_segs endp 9474 - 9475 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 9476 ; MSDOS 6.22 COMMAND.COM - RESGROUP:20D8h + 9475 ; 29/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 9476 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1E2Ch 9477 - 9478 ; MSDOS 6.0 - 9479 ;*** get_XMMAddr -- This routine gets the call address for the XMM driver - 9480 ; by issuing the appropriate int 2fh. This is stored in a stub variable - 9481 ; and is used by the stub when we have to jump to the resident in HMA - 9482 ; - 9483 ; ENTRY: ds = RESGROUP - 9484 ; - 9485 ; EXIT: XMMCallAddr = XMM driver far call address - 9486 ; - 9487 ; REGISTERS AFFECTED: - 9488 ; - 9489 - 9490 get_XMMAddr: ;proc near - 9491 ;assume ds:RESGROUP + 9478 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9479 ; MSDOS 6.22 COMMAND.COM - RESGROUP:20D8h + 9480 + 9481 ; MSDOS 6.0 + 9482 ;*** get_XMMAddr -- This routine gets the call address for the XMM driver + 9483 ; by issuing the appropriate int 2fh. This is stored in a stub variable + 9484 ; and is used by the stub when we have to jump to the resident in HMA + 9485 ; + 9486 ; ENTRY: ds = RESGROUP + 9487 ; + 9488 ; EXIT: XMMCallAddr = XMM driver far call address + 9489 ; + 9490 ; REGISTERS AFFECTED: + 9491 ; 9492 - 9493 00001FF0 06 push es - 9494 - 9495 ;mov ax,XMM_MULTIPLEX SHL 8 + XMM_INSTALL_CHECK - 9496 00001FF1 B80043 mov ax,4300h - 9497 00001FF4 CD2F int 2Fh - 9498 ; - Multiplex - XMS - INSTALLATION CHECK - 9499 ; Return: AL = 80h XMS driver installed - 9500 ; AL <> 80h no driver - 9501 00001FF6 3C80 cmp al,80h ; Q: installed - 9502 00001FF8 750D jne short cXMMexit ; N: set error, quit - 9503 ; - 9504 ; get the XMM control functions entry point, save it, we - 9505 ; need to call it later. + 9493 get_XMMAddr: ;proc near + 9494 ;assume ds:RESGROUP + 9495 + 9496 00001FF0 06 push es + 9497 + 9498 ;mov ax,XMM_MULTIPLEX SHL 8 + XMM_INSTALL_CHECK + 9499 00001FF1 B80043 mov ax,4300h + 9500 00001FF4 CD2F int 2Fh + 9501 ; - Multiplex - XMS - INSTALLATION CHECK + 9502 ; Return: AL = 80h XMS driver installed + 9503 ; AL <> 80h no driver + 9504 00001FF6 3C80 cmp al,80h ; Q: installed + 9505 00001FF8 750D jne short cXMMexit ; N: set error, quit 9506 ; - 9507 ;mov ax,XMM_MULTIPLEX SHL 8 + XMM_FUNCTION_ADDR - 9508 00001FFA B81043 mov ax,4310h - 9509 00001FFD CD2F int 2Fh - 9510 ; - Multiplex - XMS - GET DRIVER ADDRESS - 9511 ; Return: ES:BX -> driver entry point - 9512 - 9513 00001FFF 891E[9200] mov [XMMCallAddr], bx - 9514 00002003 8C06[9400] mov [XMMCallAddr+2],es - 9515 cXMMexit: - 9516 00002007 07 pop es - 9517 00002008 C3 retn ; done - 9518 - 9519 ;get_XMMAddr endp - 9520 - 9521 ;============================================================================= - 9522 ; UNINIT.ASM, MSDOS 6.0, 1991 - 9523 ;============================================================================= - 9524 ; 24/09/2018 - Retro DOS v3.0 - 9525 - 9526 ; (30/04/2018 - Retro DOS v2.0, MSDOS 2.11 COMMAND.COM) - 9527 - 9528 ; TITLE COMMAND Initialization messages - 9529 - 9530 ;INIT SEGMENT PUBLIC PARA - 9531 - 9532 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 9533 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9507 ; get the XMM control functions entry point, save it, we + 9508 ; need to call it later. + 9509 ; + 9510 ;mov ax,XMM_MULTIPLEX SHL 8 + XMM_FUNCTION_ADDR + 9511 00001FFA B81043 mov ax,4310h + 9512 00001FFD CD2F int 2Fh + 9513 ; - Multiplex - XMS - GET DRIVER ADDRESS + 9514 ; Return: ES:BX -> driver entry point + 9515 + 9516 00001FFF 891E[9200] mov [XMMCallAddr], bx + 9517 00002003 8C06[9400] mov [XMMCallAddr+2],es + 9518 cXMMexit: + 9519 00002007 07 pop es + 9520 00002008 C3 retn ; done + 9521 + 9522 ;get_XMMAddr endp + 9523 + 9524 ;============================================================================= + 9525 ; UNINIT.ASM, MSDOS 6.0, 1991 + 9526 ;============================================================================= + 9527 ; 24/09/2018 - Retro DOS v3.0 + 9528 + 9529 ; (30/04/2018 - Retro DOS v2.0, MSDOS 2.11 COMMAND.COM) + 9530 + 9531 ; TITLE COMMAND Initialization messages + 9532 + 9533 ;INIT SEGMENT PUBLIC PARA 9534 - 9535 ; 25/09/2018 - 9536 ; (15 bytes filler) - 9537 00002009 00 db 0 - 9538 ;db "25/9/2018 ETAN" - 9539 ; 30/01/2023 - 9540 ;db "30/1/2023 ETAN" - 9541 ; 19/06/2023 - 9542 ;db "19/6/2023 ETAN" - 9543 ; 31/07/2024 - 9544 0000200A 31342F382F32303234- db "14/8/2024 ETAN" ; 14/08/2024 - 9544 00002013 204554414E - 9545 00002018 00 db 0 - 9546 - 9547 ; 30/01/2023 - 9548 %if 0 - 9549 ; MSDOS 3.3 COMMAND.COM - offset 145Eh - 9550 ;dw 0 - 9551 COPYRIGHTMSG: ; MSDOS 3.3 COMMAND.COM - offset 1460h - 9552 db 0Dh,0Ah - 9553 db 0Dh,0Ah - 9554 db 'Microsoft(R) MS-DOS(R) Version 3.30' + 9535 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 9536 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9537 + 9538 ; 25/09/2018 + 9539 ; (15 bytes filler) + 9540 00002009 00 db 0 + 9541 ;db "25/9/2018 ETAN" + 9542 ; 30/01/2023 + 9543 ;db "30/1/2023 ETAN" + 9544 ; 19/06/2023 + 9545 ;db "19/6/2023 ETAN" + 9546 ; 31/07/2024 + 9547 0000200A 31352F382F32303234- db "15/8/2024 ETAN" ; 15/08/2024 + 9547 00002013 204554414E + 9548 00002018 00 db 0 + 9549 + 9550 ; 30/01/2023 + 9551 %if 0 + 9552 ; MSDOS 3.3 COMMAND.COM - offset 145Eh + 9553 ;dw 0 + 9554 COPYRIGHTMSG: ; MSDOS 3.3 COMMAND.COM - offset 1460h 9555 db 0Dh,0Ah - 9556 db ' (C)Copyright Microsoft Corp 1981-1987 ' - 9557 db ' ',0Dh,0Ah - 9558 db ' ', - 9559 db 0Dh,0Ah,0 - 9560 - 9561 times 43 db 20h - 9562 - 9563 _152Fh: db 'Specified COMMAND search directory bad',0Dh,0Ah,0 - 9564 BADCOMLKMES: - 9565 dw _152Fh - 9566 - 9567 _155Ah: db 'Specified COMMAND search directory bad access denied',0Dh,0Ah,0 - 9568 BADCOMACCMSG: - 9569 dw _155Ah - 9570 - 9571 _1593h: db 'Access denied',0Dh,0Ah,0 - 9572 ACCDENERR: - 9573 dw _1593h - 9574 - 9575 _15A5h: db 'Out of environment space',0Dh,0Ah,0 - 9576 OUTENVMSG: - 9577 dw _15A5h - 9578 - 9579 BADVERMSG: - 9580 db 'Incorrect DOS version',0Dh,0Ah,'$' + 9556 db 0Dh,0Ah + 9557 db 'Microsoft(R) MS-DOS(R) Version 3.30' + 9558 db 0Dh,0Ah + 9559 db ' (C)Copyright Microsoft Corp 1981-1987 ' + 9560 db ' ',0Dh,0Ah + 9561 db ' ', + 9562 db 0Dh,0Ah,0 + 9563 + 9564 times 43 db 20h + 9565 + 9566 _152Fh: db 'Specified COMMAND search directory bad',0Dh,0Ah,0 + 9567 BADCOMLKMES: + 9568 dw _152Fh + 9569 + 9570 _155Ah: db 'Specified COMMAND search directory bad access denied',0Dh,0Ah,0 + 9571 BADCOMACCMSG: + 9572 dw _155Ah + 9573 + 9574 _1593h: db 'Access denied',0Dh,0Ah,0 + 9575 ACCDENERR: + 9576 dw _1593h + 9577 + 9578 _15A5h: db 'Out of environment space',0Dh,0Ah,0 + 9579 OUTENVMSG: + 9580 dw _15A5h 9581 - 9582 BADENVSIZMSG: - 9583 db 'Invalid environment size specified',0Dh,0Ah,'$' + 9582 BADVERMSG: + 9583 db 'Incorrect DOS version',0Dh,0Ah,'$' 9584 - 9585 HEADERPTR: - 9586 dw COPYRIGHTMSG - 9587 %endif - 9588 - 9589 ; 30/01/2023 - 9590 ;align 16 - 9591 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 9592 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1E50h - 9593 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 9594 ; MSDOS 6.22 COMMAND.COM - RESGROUP:2100h - 9595 - 9596 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 9597 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2200h - 9598 ICONDEV: - 9599 00002019 2F4445562F db '/DEV/' - 9600 0000201E 434F4E000000000000 db 'CON',0,0,0,0,0,0 ; Room for 8 char device - 9601 BADCSPFL: - 9602 00002027 00 db 0 - 9603 COMSPECT: - 9604 00002028 5C434F4D4D414E442E- db '\COMMAND.COM',0 - 9604 00002031 434F4D00 - 9605 00002035 00 db 0 - 9606 AUTOBAT: - 9607 00002036 003A5C4155544F4558- db 0,':\AUTOEXEC.BAT',0,0Dh - 9607 0000203F 45432E424154000D - 9608 - 9609 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM - 9610 %if 0 - 9611 ; 07/06/2023 - 9612 KAUTOBAT: - 9613 db 0,':\KAUTOEXEC.BAT',0,0Dh - 9614 %endif - 9615 - 9616 PRDATTM: - 9617 00002047 FF db -1 ; 0FFh ; Init not to prompt for date time - 9618 INITADD: - 9619 00002048 00000000 dd 0 - 9620 print_add: - 9621 0000204C [1654] dw Printf_Init - 9622 0000204E 0000 dw 0 - 9623 triage_add: - 9624 00002050 [D430] dw Triage_Init - 9625 00002052 0000 dw 0 - 9626 ;CHUCKENV: - 9627 AllocedEnv: - 9628 00002054 00 db 0 - 9629 - 9630 ; 30/01/2023 - MSDOS 3.3 - 9631 ;COMSPOFFSET: - 9632 ;ECOMLOC: - 9633 ; ;dw 0Eh - 9634 ; ;dw offset ENVIRONMENT:ECOMSPEC-10h - 9635 ; dw ECOMSPEC-ENVIRONMENT ; 30/04/2018 - 9636 ;COMSPSTRING: - 9637 ; db 'COMSPEC=' - 9638 - 9639 ; 18/07/2024 - 9640 ; PCDOS 7.1 COMMAND.COM - RESGROUP:223Ch + 9585 BADENVSIZMSG: + 9586 db 'Invalid environment size specified',0Dh,0Ah,'$' + 9587 + 9588 HEADERPTR: + 9589 dw COPYRIGHTMSG + 9590 %endif + 9591 + 9592 ; 30/01/2023 + 9593 ;align 16 + 9594 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 9595 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1E50h + 9596 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9597 ; MSDOS 6.22 COMMAND.COM - RESGROUP:2100h + 9598 + 9599 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 9600 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2200h + 9601 ICONDEV: + 9602 00002019 2F4445562F db '/DEV/' + 9603 0000201E 434F4E000000000000 db 'CON',0,0,0,0,0,0 ; Room for 8 char device + 9604 BADCSPFL: + 9605 00002027 00 db 0 + 9606 COMSPECT: + 9607 00002028 5C434F4D4D414E442E- db '\COMMAND.COM',0 + 9607 00002031 434F4D00 + 9608 00002035 00 db 0 + 9609 AUTOBAT: + 9610 00002036 003A5C4155544F4558- db 0,':\AUTOEXEC.BAT',0,0Dh + 9610 0000203F 45432E424154000D + 9611 + 9612 ; 22/07/2024 - PCDOS 7.1 COMMAND.COM + 9613 %if 0 + 9614 ; 07/06/2023 + 9615 KAUTOBAT: + 9616 db 0,':\KAUTOEXEC.BAT',0,0Dh + 9617 %endif + 9618 + 9619 PRDATTM: + 9620 00002047 FF db -1 ; 0FFh ; Init not to prompt for date time + 9621 INITADD: + 9622 00002048 00000000 dd 0 + 9623 print_add: + 9624 0000204C [1654] dw Printf_Init + 9625 0000204E 0000 dw 0 + 9626 triage_add: + 9627 00002050 [D430] dw Triage_Init + 9628 00002052 0000 dw 0 + 9629 ;CHUCKENV: + 9630 AllocedEnv: + 9631 00002054 00 db 0 + 9632 + 9633 ; 30/01/2023 - MSDOS 3.3 + 9634 ;COMSPOFFSET: + 9635 ;ECOMLOC: + 9636 ; ;dw 0Eh + 9637 ; ;dw offset ENVIRONMENT:ECOMSPEC-10h + 9638 ; dw ECOMSPEC-ENVIRONMENT ; 30/04/2018 + 9639 ;COMSPSTRING: + 9640 ; db 'COMSPEC=' 9641 - 9642 ; 30/01/2023 - MSDOS 5.0 & MSDOS 6.0 - 9643 PathString: - 9644 00002055 504154483D00 db 'PATH=',0 - 9645 PathStrLen equ ($-PathString)-1 - 9646 ;;; - 9647 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 9648 ; MSDOS 6.0 - 9649 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 9650 ; PCDOS 7.1 - 9651 DefPathString: - 9652 ;db 'C:\MSDOS',0 - 9653 0000205B 433A5C444F5300 db 'C:\DOS',0 ; 18/07/2024 - 9654 DefPathStrLen equ ($-DefPathString)-1 - 9655 DefPath2String: - 9656 ;db 'C:\DOS',0 - 9657 00002062 433A5C4D53444F5300 db 'C:\MSDOS',0 ; 18/07/2024 - 9658 DefPath2StrLen equ ($-DefPath2String)-1 - 9659 - 9660 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM - 9661 ; PCDOS 7.1 COMMAND.COM - 9662 %if 0 - 9663 PrmptString: - 9664 db 'PROMPT=$P$G',0 - 9665 PrmptStrLen equ ($-PrmptString)-1 - 9666 PrmptStrLen2 equ 7 ; length of PROMPT= - 9667 %endif - 9668 - 9669 ; 18/07/2024 - 9670 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2252h + 9642 ; 18/07/2024 + 9643 ; PCDOS 7.1 COMMAND.COM - RESGROUP:223Ch + 9644 + 9645 ; 30/01/2023 - MSDOS 5.0 & MSDOS 6.0 + 9646 PathString: + 9647 00002055 504154483D00 db 'PATH=',0 + 9648 PathStrLen equ ($-PathString)-1 + 9649 ;;; + 9650 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9651 ; MSDOS 6.0 + 9652 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 9653 ; PCDOS 7.1 + 9654 DefPathString: + 9655 ;db 'C:\MSDOS',0 + 9656 0000205B 433A5C444F5300 db 'C:\DOS',0 ; 18/07/2024 + 9657 DefPathStrLen equ ($-DefPathString)-1 + 9658 DefPath2String: + 9659 ;db 'C:\DOS',0 + 9660 00002062 433A5C4D53444F5300 db 'C:\MSDOS',0 ; 18/07/2024 + 9661 DefPath2StrLen equ ($-DefPath2String)-1 + 9662 + 9663 ; 18/07/2024 - Retro DOS v5.0 COMMAND.COM + 9664 ; PCDOS 7.1 COMMAND.COM + 9665 %if 0 + 9666 PrmptString: + 9667 db 'PROMPT=$P$G',0 + 9668 PrmptStrLen equ ($-PrmptString)-1 + 9669 PrmptStrLen2 equ 7 ; length of PROMPT= + 9670 %endif 9671 - 9672 ComspOffset: - 9673 0000206B 0000 dw 0 - 9674 ;;; - 9675 ComspString: - 9676 0000206D 434F4D535045433D5C- db 'COMSPEC=\COMMAND.COM',0 - 9676 00002076 434F4D4D414E442E43- - 9676 0000207F 4F4D00 - 9677 ComspStrLen equ 8 ; length of COMSPEC= - 9678 ComspStrLen2 equ ($-ComspString)-1 - 9679 ; length of full COMSPEC - 9680 ; 29/01/2023 - 9681 ;equal_sign: - 9682 ;equalsign: - 9683 ; db '=' - 9684 ;letter_a: - 9685 ;lcasea: - 9686 ; db 'a' - 9687 ;letter_z: - 9688 ;lcasez: - 9689 ; db 'z' - 9690 ; 30/01/2023 - 9691 ;;slash_chr: - 9692 ;; db '/' - 9693 ;;bslash_chr: - 9694 ;; db '\' - 9695 ;space_chr: - 9696 ;;space: - 9697 ; db 20h - 9698 ;;letter_p: - 9699 ;; db 'p' - 9700 ;;letter_d: - 9701 ;; db 'd' - 9702 ;;letter_c: - 9703 ;; db 'c' - 9704 ; 16/04/2023 - 9705 ; MSDOS 5.0 & MSDOS 6.0 - 9706 ;scswitch: - 9707 ; db 'C' ; Single command - 9708 ;;skswitch: - 9709 ; db 'K' ; MSDOS 6.0 - 9710 ;;letter_A: - 9711 ;ucasea: ; 21/01/2023 - 9712 ; db 'A' - 9713 - 9714 ; 30/01/2023 - 9715 EnvSiz: - 9716 00002082 0000 dw 0 ; size user wants to allocate - 9717 EnvMax: - 9718 00002084 0000 dw 0 ; maximum size allowed - 9719 OldEnv: - 9720 00002086 0000 dw 0 ; envirseg at initialization - 9721 UsedEnv: - 9722 00002088 0000 dw 0 ; amount of envirseg used - 9723 ; MSDOS 5.0 & MSDOS 6.0 - 9724 PARS_MSG_OFF: - 9725 0000208A 0000 dw 0 ; SAVED PARSE ERROR MESSAGE OFFSET - 9726 PARS_MSG_SEG: - 9727 0000208C 0000 dw 0 ; SAVED PARSE ERROR MESSAGE SEGMENT - 9728 - 9729 ;Do not separate the following two words. Used to call transient PARSE routine - 9730 - 9731 Init_Parse: - 9732 ;dw 4FFBh ; MSDOS 5.0 COMMAND.COM (TRANGROUP:APPEND_PARSE) - 9733 init_p: - 9734 0000208E [1254] dw append_parse ; dw 564Bh ; PCDOS 7.1 COMMAND.COM ; 18/07/2024 - 9735 initend: - 9736 00002090 0000 dw 0 ; segment address of end of init - 9737 TrnSize: - 9738 00002092 0000 dw 0 ; size of transient in paragraphs - 9739 - 9740 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM - 9741 %if 0 - 9742 resetenv: - 9743 ;dw 0 ; set if we need to setblck env at endinit - 9744 ; 23/07/2024 - 9745 db 0 - 9746 %endif - 9747 - 9748 ext_msg: - 9749 00002094 00 db 0 ; set if /MSG switch entered - 9750 eswitch: - 9751 00002095 00 db 0 ; set if /e was entered - 9752 dswitch: - 9753 00002096 00 db 0 ; set if /d was entered - 9754 parsemes_ptr: - 9755 00002097 0000 dw 0 ; word to store parse error number - 9756 - 9757 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 9758 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1ED6h + 9672 ; 18/07/2024 + 9673 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2252h + 9674 + 9675 ComspOffset: + 9676 0000206B 0000 dw 0 + 9677 ;;; + 9678 ComspString: + 9679 0000206D 434F4D535045433D5C- db 'COMSPEC=\COMMAND.COM',0 + 9679 00002076 434F4D4D414E442E43- + 9679 0000207F 4F4D00 + 9680 ComspStrLen equ 8 ; length of COMSPEC= + 9681 ComspStrLen2 equ ($-ComspString)-1 + 9682 ; length of full COMSPEC + 9683 ; 29/01/2023 + 9684 ;equal_sign: + 9685 ;equalsign: + 9686 ; db '=' + 9687 ;letter_a: + 9688 ;lcasea: + 9689 ; db 'a' + 9690 ;letter_z: + 9691 ;lcasez: + 9692 ; db 'z' + 9693 ; 30/01/2023 + 9694 ;;slash_chr: + 9695 ;; db '/' + 9696 ;;bslash_chr: + 9697 ;; db '\' + 9698 ;space_chr: + 9699 ;;space: + 9700 ; db 20h + 9701 ;;letter_p: + 9702 ;; db 'p' + 9703 ;;letter_d: + 9704 ;; db 'd' + 9705 ;;letter_c: + 9706 ;; db 'c' + 9707 ; 16/04/2023 + 9708 ; MSDOS 5.0 & MSDOS 6.0 + 9709 ;scswitch: + 9710 ; db 'C' ; Single command + 9711 ;;skswitch: + 9712 ; db 'K' ; MSDOS 6.0 + 9713 ;;letter_A: + 9714 ;ucasea: ; 21/01/2023 + 9715 ; db 'A' + 9716 + 9717 ; 30/01/2023 + 9718 EnvSiz: + 9719 00002082 0000 dw 0 ; size user wants to allocate + 9720 EnvMax: + 9721 00002084 0000 dw 0 ; maximum size allowed + 9722 OldEnv: + 9723 00002086 0000 dw 0 ; envirseg at initialization + 9724 UsedEnv: + 9725 00002088 0000 dw 0 ; amount of envirseg used + 9726 ; MSDOS 5.0 & MSDOS 6.0 + 9727 PARS_MSG_OFF: + 9728 0000208A 0000 dw 0 ; SAVED PARSE ERROR MESSAGE OFFSET + 9729 PARS_MSG_SEG: + 9730 0000208C 0000 dw 0 ; SAVED PARSE ERROR MESSAGE SEGMENT + 9731 + 9732 ;Do not separate the following two words. Used to call transient PARSE routine + 9733 + 9734 Init_Parse: + 9735 ;dw 4FFBh ; MSDOS 5.0 COMMAND.COM (TRANGROUP:APPEND_PARSE) + 9736 init_p: + 9737 0000208E [1254] dw append_parse ; dw 564Bh ; PCDOS 7.1 COMMAND.COM ; 18/07/2024 + 9738 initend: + 9739 00002090 0000 dw 0 ; segment address of end of init + 9740 TrnSize: + 9741 00002092 0000 dw 0 ; size of transient in paragraphs + 9742 + 9743 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM + 9744 %if 0 + 9745 resetenv: + 9746 ;dw 0 ; set if we need to setblck env at endinit + 9747 ; 23/07/2024 + 9748 db 0 + 9749 %endif + 9750 + 9751 ext_msg: + 9752 00002094 00 db 0 ; set if /MSG switch entered + 9753 eswitch: + 9754 00002095 00 db 0 ; set if /e was entered + 9755 dswitch: + 9756 00002096 00 db 0 ; set if /d was entered + 9757 parsemes_ptr: + 9758 00002097 0000 dw 0 ; word to store parse error number 9759 - 9760 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 9761 ; MSDOS 6.22 COMMAND.COM - RESGROUP:21A5h + 9760 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 9761 ; MSDOS 5.0 COMMAND.COM - RESGROUP:1ED6h 9762 - 9763 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 9764 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2288h + 9763 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9764 ; MSDOS 6.22 COMMAND.COM - RESGROUP:21A5h 9765 - 9766 ; MSDOS 6.0 (UINIT.ASM, 1991) - 9767 ; The following parse control block is used for COMMAND. This block is - 9768 ; used for parsing during initialization. The syntax for COMMAND is: - 9769 ; COMMAND [/?] [d:][path][/P][/F][/D][/E:xxxxx][/MSG][/C executable] - 9770 ; - 9771 ; Anything on the command line after the /C switch will be passed to the - 9772 ; executable command, so if /C is used, it must be specified last. The - 9773 ; /MSG switch can only be specified if the /P switch is specified. - 9774 ; - 9775 ; The /? switch causes help text to be displayed. Any other options - 9776 ; on the command line are ignored. Command.com will not load if /? - 9777 ; is specified. - 9778 - 9779 INTERNAT_INFO: ; used for country info after parsing is completed - 9780 PARSE_COMMAND: - 9781 00002099 [9C20] dw COMMAND_PARMS - 9782 0000209B 00 db 0 ; no extra delimiter - 9783 COMMAND_PARMS: - 9784 0000209C 0002 db 0,2 ; 1 positional parm - 9785 0000209E [BA20] dw COMMAND_FILE - 9786 000020A0 [BA20] dw COMMAND_FILE - 9787 ; MSDOS 5.0 - 9788 ;db 7 ; 7 switches - 9789 ; MSDOS 6.0 - 9790 ;db 8 ; 8 switches - 9791 ; 07/06/2023 - 9792 ; MSDOS 6.22 - 9793 ;db 9 ; 9 switches - 9794 ; 22/07/2024 - 9795 ; PCDOS 7.1 - 9796 000020A2 0B db 11 ; 11 switches - 9797 000020A3 [C320] dw COMMAND_SWITCH1 - 9798 000020A5 [CF20] dw COMMAND_SWITCH2 - 9799 000020A7 [DB20] dw COMMAND_SWITCH3 - 9800 000020A9 [E720] dw COMMAND_SWITCH4 - 9801 000020AB [0021] dw COMMAND_SWITCH5 - 9802 000020AD [0C21] dw COMMAND_SWITCH6 - 9803 000020AF [1A21] dw COMMAND_SWITCH7 - 9804 ; 07/06/2023 - 9805 000020B1 [2621] dw COMMAND_SWITCH8 ; MSDOS 6.0 - 9806 000020B3 [3221] dw COMMAND_SWITCH9 ; MSDOS 6.22 - 9807 ; 22/07/2024 - 9808 000020B5 [3E21] dw COMMAND_SWITCH10 ; PCDOS 7.1 - 9809 000020B7 [4A21] dw COMMAND_SWITCH11 ; PCDOS 7.1 - 9810 000020B9 00 db 0 ; no keywords - 9811 - 9812 COMMAND_FILE: - 9813 000020BA 0102 dw 0201h ; filespec - optional - 9814 000020BC 0100 dw 1 ; capitalize - file table - 9815 000020BE [5621] dw COMND1_OUTPUT ; result buffer - 9816 000020C0 [5E21] dw NO_VAL ; - 9817 000020C2 00 db 0 ; no keywords - 9818 - 9819 COMMAND_SWITCH1: - 9820 000020C3 0000 dw 0 ; no match flags - 9821 000020C5 0200 dw 2 ; capitalize by char table - 9822 000020C7 [5621] dw COMND1_OUTPUT ; result buffer - 9823 000020C9 [5E21] dw NO_VAL ; - 9824 000020CB 01 db 1 ; 1 keyword - 9825 COMMAND_P_SYN: - 9826 000020CC 2F5000 db '/P',0 ; /P switch - 9827 - 9828 COMMAND_SWITCH2: - 9829 000020CF 0000 dw 0 ; no match flags - 9830 000020D1 0200 dw 2 ; capitalize by char table - 9831 000020D3 [5621] dw COMND1_OUTPUT ; result buffer - 9832 000020D5 [5E21] dw NO_VAL ; - 9833 000020D7 01 db 1 ; 1 keyword - 9834 COMMAND_F_SYN: - 9835 000020D8 2F4600 db '/F',0 ; /F switch - 9836 - 9837 COMMAND_SWITCH3: - 9838 000020DB 0000 dw 0 ; no match flags - 9839 000020DD 0200 dw 2 ; capitalize by char table - 9840 000020DF [5621] dw COMND1_OUTPUT ; result buffer - 9841 000020E1 [5E21] dw NO_VAL ; - 9842 000020E3 01 db 1 ; 1 keyword - 9843 COMMAND_D_SYN: - 9844 000020E4 2F4400 db '/D',0 ; /D switch - 9845 - 9846 COMMAND_SWITCH4: - 9847 000020E7 0080 dw 8000h ; numeric value - required - 9848 000020E9 0000 dw 0 ; no function flags - 9849 000020EB [5621] dw COMND1_OUTPUT ; result buffer - 9850 000020ED [F320] dw COMMAND_E_VAL ; pointer to value list - 9851 000020EF 01 db 1 ; 1 keyword - 9852 COMMAND_E_SYN: - 9853 000020F0 2F4500 db '/E',0 ; /E switch - 9854 - 9855 COMMAND_E_VAL: - 9856 000020F3 01 db 1 ; - 9857 000020F4 01 db 1 ; 1 range - 9858 000020F5 01 db 1 ; returned if result - 9859 ;dd ENVSML,ENVBIG ; minimum & maximum value - 9860 ; MSDOS 5.0 COMMAND.COM (RESGROUP:1F2Bh) - 9861 ; PCDOS 7.1 COMMAND.COM (RESGROUP:22E5h) - 9862 000020F6 A0000000 dd 160 ; ENVSML - 9863 000020FA 00800000 dd 32768 ; ENVBIG - 9864 000020FE 00 db 0 ; no numeric values - 9865 000020FF 00 db 0 ; no string values - 9866 - 9867 COMMAND_SWITCH5: - 9868 00002100 0000 dw 0 ; no match flags - 9869 00002102 0200 dw 2 ; capitalize by char table - 9870 00002104 [5621] dw COMND1_OUTPUT ; result buffer - 9871 00002106 [5E21] dw NO_VAL ; - 9872 00002108 01 db 1 ; 1 keyword - 9873 COMMAND_C_SYN: - 9874 00002109 2F4300 db '/C',0 ; /C switch - 9875 - 9876 COMMAND_SWITCH6: - 9877 0000210C 0000 dw 0 ; no match flags - 9878 0000210E 0200 dw 2 ; capitalize by char table - 9879 00002110 [5621] dw COMND1_OUTPUT ; result buffer - 9880 00002112 [5E21] dw NO_VAL ; - 9881 00002114 01 db 1 ; 1 keyword - 9882 COMMAND_M_SYN: - 9883 00002115 2F4D534700 db '/MSG',0 ; /MSG switch - 9884 - 9885 COMMAND_SWITCH7: - 9886 0000211A 0000 dw 0 ; no match flags - 9887 0000211C 0200 dw 2 ; capitalize by char table - 9888 0000211E [5621] dw COMND1_OUTPUT ; result buffer - 9889 00002120 [5E21] dw NO_VAL ; - 9890 00002122 01 db 1 ; 1 keyword - 9891 COMMAND_?_SYN: - 9892 00002123 2F3F00 db '/?',0 ; /? switch - 9893 - 9894 ; 07/06/2023 - 9895 ; MSDOS 6.0 - 9896 COMMAND_SWITCH8: - 9897 00002126 0000 dw 0 ; no match flags - 9898 00002128 0200 dw 2 ; capitalize by char table - 9899 0000212A [5621] dw COMND1_OUTPUT ; result buffer - 9900 0000212C [5E21] dw NO_VAL ; - 9901 0000212E 01 db 1 ; 1 keyword - 9902 COMMAND_K_SYN: - 9903 0000212F 2F4B00 db '/K',0 ; /K switch - 9904 - 9905 ; 07/06/2023 - 9906 ; MSDOS 6.22 - 9907 COMMAND_SWITCH9: - 9908 00002132 0000 dw 0 ; no match flags - 9909 00002134 0200 dw 2 ; capitalize by char table - 9910 00002136 [5621] dw COMND1_OUTPUT ; result buffer - 9911 00002138 [5E21] dw NO_VAL ; - 9912 0000213A 01 db 1 ; 1 keyword - 9913 COMMAND_Y_SYN: - 9914 0000213B 2F5900 db '/Y',0 ; /Y switch - 9915 - 9916 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM - 9917 %if 1 - 9918 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2336h - 9919 COMMAND_SWITCH10: - 9920 0000213E 0000 dw 0 ; no match flags - 9921 00002140 0200 dw 2 ; capitalize by char table - 9922 00002142 [5621] dw COMND1_OUTPUT ; result buffer - 9923 00002144 [5E21] dw NO_VAL ; - 9924 00002146 01 db 1 ; 1 keyword - 9925 COMMAND_H_SYN: - 9926 00002147 2F4800 db '/H',0 ; /H switch - 9927 - 9928 COMMAND_SWITCH11: - 9929 0000214A 0000 dw 0 ; no match flags - 9930 0000214C 0200 dw 2 ; capitalize by char table - 9931 0000214E [5621] dw COMND1_OUTPUT ; result buffer - 9932 00002150 [5E21] dw NO_VAL ; - 9933 00002152 01 db 1 ; 1 keyword - 9934 COMMAND_O_SYN: - 9935 00002153 2F4F00 db '/O',0 ; /O switch - 9936 %endif - 9937 - 9938 COMND1_OUTPUT: - 9939 COMND1_TYPE: - 9940 00002156 00 db 0 ; type - 9941 COMND1_CODE: - 9942 00002157 00 db 0 ; return value - 9943 COMND1_SYN: - 9944 00002158 0000 dw 0 ; synonym pointer - 9945 COMND1_ADDR: - 9946 0000215A 00000000 dd 0 ; numeric value / address - 9947 ; of string value - 9948 NO_VAL: - 9949 0000215E 00 db 0 ; no values - 9950 num_positionals: - 9951 0000215F 0000 dw 0 ; counter for positionals - 9952 old_parse_ptr: - 9953 00002161 0000 dw 0 ; SI position before calling parser - 9954 - 9955 ; 30/01/2023 - 9956 ;*** INITIALIZATION MESSAGES - 9957 ; ------------------------- - 9958 ; include comimsg.inc ;M00 - 9959 ;----------------------------------------------------------------------------- - 9960 - 9961 BADVERMSG: - 9962 00002163 17 db 23 - 9963 00002164 496E636F7272656374- db 'Incorrect DOS version',0Dh,0Ah - 9963 0000216D 20444F532076657273- - 9963 00002176 696F6E0D0A - 9964 OUTENVMSG: - 9965 0000217B 1A db 26 - 9966 0000217C 4F7574206F6620656E- db 'Out of environment space',0Dh,0Ah - 9966 00002185 7669726F6E6D656E74- - 9966 0000218E 2073706163650D0A - 9967 - 9968 ; 07/06/2023 - 9969 ;COPYRIGHTMSG: - 9970 ; db 94 - 9971 ; db 0Dh,0Ah - 9972 ; db 0Dh,0Ah - 9973 ; db 'Microsoft(R) MS-DOS(R) Version 5.00',0Dh,0Ah - 9974 ; db ' (C)Copyright Microsoft Corp 1981-1991.',0Dh,0Ah - 9975 - 9976 ; 23/07/2024 - 9977 %if 0 - 9978 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 9979 ; MSDOS 6.22 COMMAND.COM - RESGROUP:2286h - 9980 COPYRIGHTMSG: - 9981 db 94 - 9982 db 0Dh,0Ah - 9983 db 0Dh,0Ah - 9984 db 'Microsoft(R) MS-DOS(R) Version 6.22',0Dh,0Ah - 9985 db ' (C)Copyright Microsoft Corp 1981-1994.',0Dh,0Ah - 9986 %else - 9987 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM - 9988 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2385h - 9989 COPYRIGHTMSG: - 9990 00002196 64 db 100 - 9991 00002197 0D0A db 0Dh,0Ah - 9992 00002199 0D0A db 0Dh,0Ah - 9993 0000219B 504320444F53205665- db 'PC DOS Version 7.10',0Dh,0Ah - 9993 000021A4 7273696F6E20372E31- - 9993 000021AD 300D0A - 9994 000021B0 202020202020202020- db ' (C)Copyright International Business Machines Corp ' - 9994 000021B9 20202020284329436F- - 9994 000021C2 707972696768742049- - 9994 000021CB 6E7465726E6174696F- - 9994 000021D4 6E616C20427573696E- - 9994 000021DD 657373204D61636869- - 9994 000021E6 6E657320436F727020 - 9995 000021EF 313938312D32303032- db '1981-2002.',0Dh,0Ah - 9995 000021F8 2E0D0A - 9996 %endif - 9997 - 9998 BADCOMLKMES: - 9999 000021FB 28 db 40 - 10000 000021FC 537065636966696564- db 'Specified COMMAND search directory bad',0Dh,0Ah - 10000 00002205 20434F4D4D414E4420- - 10000 0000220E 736561726368206469- - 10000 00002217 726563746F72792062- - 10000 00002220 61640D0A - 10001 ; 07/06/2023 - 10002 BADCOMACCMSG: - 10003 00002224 37 db 55 - 10004 00002225 537065636966696564- db 'Specified COMMAND search directory bad, access denied',0Dh,0Ah - 10004 0000222E 20434F4D4D414E4420- - 10004 00002237 736561726368206469- - 10004 00002240 726563746F72792062- - 10004 00002249 61642C206163636573- - 10004 00002252 732064656E6965640D- - 10004 0000225B 0A - 10005 HELPMSG1: - 10006 0000225C 38 db 56 - 10007 ;db 'Starts a new copy of the MS-DOS command interpreter.',0Dh,0Ah - 10008 ; 23/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 10009 0000225D 537461727473206120- db 'Starts a new copy of the PC DOS command interpreter.',0Dh,0Ah - 10009 00002266 6E657720636F707920- - 10009 0000226F 6F6620746865205043- - 10009 00002278 20444F5320636F6D6D- - 10009 00002281 616E6420696E746572- - 10009 0000228A 7072657465722E0D0A - 10010 00002293 0D0A db 0Dh,0Ah - 10011 ;HELPMSG2: - 10012 ; db 70 - 10013 ; db 'COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]' - 10014 ; db 0Dh,0Ah - 10015 ; db 0Dh,0Ah - 10016 ; 07/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 10017 HELPMSG2: - 10018 00002295 38 db 56 - 10019 00002296 434F4D4D414E44205B- db 'COMMAND [[drive:]path] [device] [/E:nnnnn] [/P [/MSG]]',0Dh,0Ah - 10019 0000229F 5B64726976653A5D70- - 10019 000022A8 6174685D205B646576- - 10019 000022B1 6963655D205B2F453A- - 10019 000022BA 6E6E6E6E6E5D205B2F- - 10019 000022C3 50205B2F4D53475D5D- - 10019 000022CC 0D0A - 10020 HELPMSG3: - 10021 ;db 42 - 10022 ;db ' [/Y [/C command | /K command]]',0Dh,0Ah - 10023 ;db 0Dh,0Ah - 10024 ; 23/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 10025 000022CE 34 db 52 - 10026 000022CF 20202020202020205B- db ' [/H] [/O] [/Y [/C command | /K command]]',0Dh,0Ah - 10026 000022D8 2F485D205B2F4F5D20- - 10026 000022E1 5B2F59205B2F432063- - 10026 000022EA 6F6D6D616E64207C20- - 10026 000022F3 2F4B20636F6D6D616E- - 10026 000022FC 645D5D0D0A - 10027 00002301 0D0A db 0Dh,0Ah - 10028 ;HELPMSG3: - 10029 HELPMSG4: - 10030 00002303 48 db 72 - 10031 00002304 20205B64726976653A- db ' [drive:]path Specifies the directory containing COMMAND.COM ' - 10031 0000230D 5D7061746820202020- - 10031 00002316 537065636966696573- - 10031 0000231F 207468652064697265- - 10031 00002328 63746F727920636F6E- - 10031 00002331 7461696E696E672043- - 10031 0000233A 4F4D4D414E442E434F- - 10031 00002343 4D20 - 10032 00002345 66696C652E0D0A db 'file.',0Dh,0Ah - 10033 ;HELPMSG4: - 10034 HELPMSG5: - 10035 0000234C 4D db 77 - 10036 0000234D 202064657669636520- db ' device Specifies the device to use for command input and ' - 10036 00002356 202020202020202020- - 10036 0000235F 537065636966696573- - 10036 00002368 207468652064657669- - 10036 00002371 636520746F20757365- - 10036 0000237A 20666F7220636F6D6D- - 10036 00002383 616E6420696E707574- - 10036 0000238C 20616E6420 - 10037 00002391 6F75747075742E0D0A db 'output.',0Dh,0Ah - 10038 ;HELPMSG5: - 10039 HELPMSG6: - 10040 0000239A 45 db 69 - 10041 0000239B 20202F453A6E6E6E6E- db ' /E:nnnnn Sets the initial environment size to nnnnn bytes.' - 10041 000023A4 6E2020202020202020- - 10041 000023AD 536574732074686520- - 10041 000023B6 696E697469616C2065- - 10041 000023BF 6E7669726F6E6D656E- - 10041 000023C8 742073697A6520746F- - 10041 000023D1 206E6E6E6E6E206279- - 10041 000023DA 7465732E - 10042 000023DE 0D0A db 0Dh,0Ah - 10043 ;HELPMSG6: - 10044 HELPMSG7: - 10045 000023E0 4D db 77 - 10046 000023E1 20202F502020202020- db ' /P Makes the new Command Interpreter permanent ' - 10046 000023EA 202020202020202020- - 10046 000023F3 4D616B657320746865- - 10046 000023FC 206E657720436F6D6D- - 10046 00002405 616E6420496E746572- - 10046 0000240E 707265746572207065- - 10046 00002417 726D616E656E7420 - 10047 0000241F 2863616E2774206578- db '(can',27h,'t exit).',0Dh,0Ah - 10047 00002428 6974292E0D0A - 10048 ;HELPMSG7: - 10049 HELPMSG8: - 10050 ;db 80 - 10051 ;db ' /C string Carries out the command specified by string, and ' - 10052 ;db 'then stops.',0Dh,0Ah - 10053 ; 07/06/2023 - 10054 0000242E 46 db 70 - 10055 0000242F 20202F4D5347202020- db ' /MSG Stores all error messages in memory (requires /P).' - 10055 00002438 202020202020202020- - 10055 00002441 53746F72657320616C- - 10055 0000244A 6C206572726F72206D- - 10055 00002453 657373616765732069- - 10055 0000245C 6E206D656D6F727920- - 10055 00002465 287265717569726573- - 10055 0000246E 202F50292E - 10056 00002473 0D0A db 0Dh,0Ah - 10057 - 10058 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM - 10059 ; PCDOS 7.1 COMMAND.COM - 10060 ;*** - 10061 HELPMSG9: - 10062 00002475 4A db 74 - 10063 00002476 20202F482020202020- db ' /H Loads the Command Interpreter into a UMB ' - 10063 0000247F 202020202020202020- - 10063 00002488 4C6F61647320746865- - 10063 00002491 20436F6D6D616E6420- - 10063 0000249A 496E74657270726574- - 10063 000024A3 657220696E746F2061- - 10063 000024AC 20554D4220 - 10064 000024B1 696620617661696C61- db 'if available.',0Dh,0Ah - 10064 000024BA 626C652E0D0A - 10065 HELPMSG10: - 10066 000024C0 4E db 78 - 10067 000024C1 20202F4F2020202020- db ' /O Disables overwrite prompt on COPY,XCOPY,and MOVE ' - 10067 000024CA 202020202020202020- - 10067 000024D3 44697361626C657320- - 10067 000024DC 6F7665727772697465- - 10067 000024E5 2070726F6D7074206F- - 10067 000024EE 6E20434F50592C5843- - 10067 000024F7 4F50592C616E64204D- - 10067 00002500 4F564520 - 10068 00002504 636F6D6D616E64732E- db 'commands.',0Dh,0Ah - 10068 0000250D 0D0A - 10069 ;*** - 10070 - 10071 ;HELPMSG8: - 10072 ; 23/07/2024 - PCDOS 7.1 COMMAND.COM - 10073 ;HELPMSG9: - 10074 HELPMSG11: - 10075 ;db 78 - 10076 ;db ' /MSG Specifies that all error messages be stored in ' - 10077 ;db 'memory. You',0Dh,0Ah - 10078 ;HELPMSG9: - 10079 ;db 56 - 10080 ;db ' need to specify /P with this switch.',0Dh,0Ah - 10081 0000250F 4A db 74 - 10082 00002510 20202F592020202020- db ' /Y Steps through the batch program specified by /C' - 10082 00002519 202020202020202020- - 10082 00002522 537465707320746872- - 10082 0000252B 6F7567682074686520- - 10082 00002534 62617463682070726F- - 10082 0000253D 6772616D2073706563- - 10082 00002546 696669656420627920- - 10082 0000254F 2F43 - 10083 00002551 206F72202F4B2E0D0A db ' or /K.',0Dh,0Ah - 10084 - 10085 ; 07/06/2023 - 10086 ; 23/07/2024 - 10087 ;HELPMSG10: - 10088 HELPMSG12: - 10089 0000255A 3F db 63 - 10090 0000255B 20202F4320636F6D6D- db ' /C command Executes the specified command and returns.',0Dh,0Ah - 10090 00002564 616E64202020202020- - 10090 0000256D 457865637574657320- - 10090 00002576 746865207370656369- - 10090 0000257F 6669656420636F6D6D- - 10090 00002588 616E6420616E642072- - 10090 00002591 657475726E732E0D0A - 10091 ; 23/07/2024 - 10092 ;HELPMSG11: - 10093 HELPMSG13: - 10094 0000259A 4B db 75 - 10095 0000259B 20202F4B20636F6D6D- db ' /K command Executes the specified command and continues running.' - 10095 000025A4 616E64202020202020- - 10095 000025AD 457865637574657320- - 10095 000025B6 746865207370656369- - 10095 000025BF 6669656420636F6D6D- - 10095 000025C8 616E6420616E642063- - 10095 000025D1 6F6E74696E75657320- - 10095 000025DA 72756E6E696E672E - 10096 000025E2 0D0A db 0Dh,0Ah - 10097 000025E4 0D0A db 0Dh,0Ah - 10098 ;HELPMSG12: - 10099 ; 23/07/2024 - 10100 HELPMSG14: - 10101 000025E6 4C db 76 - 10102 000025E7 546865202F5020616E- db 'The /P and /MSG switches may be used only when COMMAND is started' - 10102 000025F0 64202F4D5347207377- - 10102 000025F9 697463686573206D61- - 10102 00002602 792062652075736564- - 10102 0000260B 206F6E6C7920776865- - 10102 00002614 6E20434F4D4D414E44- - 10102 0000261D 206973207374617274- - 10102 00002626 6564 - 10103 00002628 206279207573696E67- db ' by using',0Dh,0Ah - 10103 00002631 0D0A - 10104 ;HELPMSG13: - 10105 ; 23/07/2024 - 10106 HELPMSG15: - 10107 00002633 2B db 43 - 10108 00002634 746865205348454C4C- db 'the SHELL command in the CONFIG.SYS file.',0Dh,0Ah - 10108 0000263D 20636F6D6D616E6420- - 10108 00002646 696E2074686520434F- - 10108 0000264F 4E4649472E53595320- - 10108 00002658 66696C652E0D0A - 10109 - 10110 HelpMsgs: - 10111 0000265F [5C22] dw HELPMSG1 - 10112 00002661 [9522] dw HELPMSG2 - 10113 00002663 [CE22] dw HELPMSG3 - 10114 00002665 [0323] dw HELPMSG4 - 10115 00002667 [4C23] dw HELPMSG5 - 10116 00002669 [9A23] dw HELPMSG6 - 10117 0000266B [E023] dw HELPMSG7 - 10118 0000266D [2E24] dw HELPMSG8 - 10119 0000266F [7524] dw HELPMSG9 - 10120 - 10121 ; 07/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 10122 00002671 [C024] dw HELPMSG10 - 10123 00002673 [0F25] dw HELPMSG11 - 10124 00002675 [5A25] dw HELPMSG12 - 10125 00002677 [9A25] dw HELPMSG13 - 10126 - 10127 ; 23/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 10128 00002679 [E625] dw HELPMSG14 - 10129 0000267B [3326] dw HELPMSG15 - 10130 - 10131 ; 23/04/2023 - 10132 0000267D 0000 dw 0 + 9766 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 9767 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2288h + 9768 + 9769 ; MSDOS 6.0 (UINIT.ASM, 1991) + 9770 ; The following parse control block is used for COMMAND. This block is + 9771 ; used for parsing during initialization. The syntax for COMMAND is: + 9772 ; COMMAND [/?] [d:][path][/P][/F][/D][/E:xxxxx][/MSG][/C executable] + 9773 ; + 9774 ; Anything on the command line after the /C switch will be passed to the + 9775 ; executable command, so if /C is used, it must be specified last. The + 9776 ; /MSG switch can only be specified if the /P switch is specified. + 9777 ; + 9778 ; The /? switch causes help text to be displayed. Any other options + 9779 ; on the command line are ignored. Command.com will not load if /? + 9780 ; is specified. + 9781 + 9782 INTERNAT_INFO: ; used for country info after parsing is completed + 9783 PARSE_COMMAND: + 9784 00002099 [9C20] dw COMMAND_PARMS + 9785 0000209B 00 db 0 ; no extra delimiter + 9786 COMMAND_PARMS: + 9787 0000209C 0002 db 0,2 ; 1 positional parm + 9788 0000209E [BA20] dw COMMAND_FILE + 9789 000020A0 [BA20] dw COMMAND_FILE + 9790 ; MSDOS 5.0 + 9791 ;db 7 ; 7 switches + 9792 ; MSDOS 6.0 + 9793 ;db 8 ; 8 switches + 9794 ; 07/06/2023 + 9795 ; MSDOS 6.22 + 9796 ;db 9 ; 9 switches + 9797 ; 22/07/2024 + 9798 ; PCDOS 7.1 + 9799 000020A2 0B db 11 ; 11 switches + 9800 000020A3 [C320] dw COMMAND_SWITCH1 + 9801 000020A5 [CF20] dw COMMAND_SWITCH2 + 9802 000020A7 [DB20] dw COMMAND_SWITCH3 + 9803 000020A9 [E720] dw COMMAND_SWITCH4 + 9804 000020AB [0021] dw COMMAND_SWITCH5 + 9805 000020AD [0C21] dw COMMAND_SWITCH6 + 9806 000020AF [1A21] dw COMMAND_SWITCH7 + 9807 ; 07/06/2023 + 9808 000020B1 [2621] dw COMMAND_SWITCH8 ; MSDOS 6.0 + 9809 000020B3 [3221] dw COMMAND_SWITCH9 ; MSDOS 6.22 + 9810 ; 22/07/2024 + 9811 000020B5 [3E21] dw COMMAND_SWITCH10 ; PCDOS 7.1 + 9812 000020B7 [4A21] dw COMMAND_SWITCH11 ; PCDOS 7.1 + 9813 000020B9 00 db 0 ; no keywords + 9814 + 9815 COMMAND_FILE: + 9816 000020BA 0102 dw 0201h ; filespec - optional + 9817 000020BC 0100 dw 1 ; capitalize - file table + 9818 000020BE [5621] dw COMND1_OUTPUT ; result buffer + 9819 000020C0 [5E21] dw NO_VAL ; + 9820 000020C2 00 db 0 ; no keywords + 9821 + 9822 COMMAND_SWITCH1: + 9823 000020C3 0000 dw 0 ; no match flags + 9824 000020C5 0200 dw 2 ; capitalize by char table + 9825 000020C7 [5621] dw COMND1_OUTPUT ; result buffer + 9826 000020C9 [5E21] dw NO_VAL ; + 9827 000020CB 01 db 1 ; 1 keyword + 9828 COMMAND_P_SYN: + 9829 000020CC 2F5000 db '/P',0 ; /P switch + 9830 + 9831 COMMAND_SWITCH2: + 9832 000020CF 0000 dw 0 ; no match flags + 9833 000020D1 0200 dw 2 ; capitalize by char table + 9834 000020D3 [5621] dw COMND1_OUTPUT ; result buffer + 9835 000020D5 [5E21] dw NO_VAL ; + 9836 000020D7 01 db 1 ; 1 keyword + 9837 COMMAND_F_SYN: + 9838 000020D8 2F4600 db '/F',0 ; /F switch + 9839 + 9840 COMMAND_SWITCH3: + 9841 000020DB 0000 dw 0 ; no match flags + 9842 000020DD 0200 dw 2 ; capitalize by char table + 9843 000020DF [5621] dw COMND1_OUTPUT ; result buffer + 9844 000020E1 [5E21] dw NO_VAL ; + 9845 000020E3 01 db 1 ; 1 keyword + 9846 COMMAND_D_SYN: + 9847 000020E4 2F4400 db '/D',0 ; /D switch + 9848 + 9849 COMMAND_SWITCH4: + 9850 000020E7 0080 dw 8000h ; numeric value - required + 9851 000020E9 0000 dw 0 ; no function flags + 9852 000020EB [5621] dw COMND1_OUTPUT ; result buffer + 9853 000020ED [F320] dw COMMAND_E_VAL ; pointer to value list + 9854 000020EF 01 db 1 ; 1 keyword + 9855 COMMAND_E_SYN: + 9856 000020F0 2F4500 db '/E',0 ; /E switch + 9857 + 9858 COMMAND_E_VAL: + 9859 000020F3 01 db 1 ; + 9860 000020F4 01 db 1 ; 1 range + 9861 000020F5 01 db 1 ; returned if result + 9862 ;dd ENVSML,ENVBIG ; minimum & maximum value + 9863 ; MSDOS 5.0 COMMAND.COM (RESGROUP:1F2Bh) + 9864 ; PCDOS 7.1 COMMAND.COM (RESGROUP:22E5h) + 9865 000020F6 A0000000 dd 160 ; ENVSML + 9866 000020FA 00800000 dd 32768 ; ENVBIG + 9867 000020FE 00 db 0 ; no numeric values + 9868 000020FF 00 db 0 ; no string values + 9869 + 9870 COMMAND_SWITCH5: + 9871 00002100 0000 dw 0 ; no match flags + 9872 00002102 0200 dw 2 ; capitalize by char table + 9873 00002104 [5621] dw COMND1_OUTPUT ; result buffer + 9874 00002106 [5E21] dw NO_VAL ; + 9875 00002108 01 db 1 ; 1 keyword + 9876 COMMAND_C_SYN: + 9877 00002109 2F4300 db '/C',0 ; /C switch + 9878 + 9879 COMMAND_SWITCH6: + 9880 0000210C 0000 dw 0 ; no match flags + 9881 0000210E 0200 dw 2 ; capitalize by char table + 9882 00002110 [5621] dw COMND1_OUTPUT ; result buffer + 9883 00002112 [5E21] dw NO_VAL ; + 9884 00002114 01 db 1 ; 1 keyword + 9885 COMMAND_M_SYN: + 9886 00002115 2F4D534700 db '/MSG',0 ; /MSG switch + 9887 + 9888 COMMAND_SWITCH7: + 9889 0000211A 0000 dw 0 ; no match flags + 9890 0000211C 0200 dw 2 ; capitalize by char table + 9891 0000211E [5621] dw COMND1_OUTPUT ; result buffer + 9892 00002120 [5E21] dw NO_VAL ; + 9893 00002122 01 db 1 ; 1 keyword + 9894 COMMAND_?_SYN: + 9895 00002123 2F3F00 db '/?',0 ; /? switch + 9896 + 9897 ; 07/06/2023 + 9898 ; MSDOS 6.0 + 9899 COMMAND_SWITCH8: + 9900 00002126 0000 dw 0 ; no match flags + 9901 00002128 0200 dw 2 ; capitalize by char table + 9902 0000212A [5621] dw COMND1_OUTPUT ; result buffer + 9903 0000212C [5E21] dw NO_VAL ; + 9904 0000212E 01 db 1 ; 1 keyword + 9905 COMMAND_K_SYN: + 9906 0000212F 2F4B00 db '/K',0 ; /K switch + 9907 + 9908 ; 07/06/2023 + 9909 ; MSDOS 6.22 + 9910 COMMAND_SWITCH9: + 9911 00002132 0000 dw 0 ; no match flags + 9912 00002134 0200 dw 2 ; capitalize by char table + 9913 00002136 [5621] dw COMND1_OUTPUT ; result buffer + 9914 00002138 [5E21] dw NO_VAL ; + 9915 0000213A 01 db 1 ; 1 keyword + 9916 COMMAND_Y_SYN: + 9917 0000213B 2F5900 db '/Y',0 ; /Y switch + 9918 + 9919 ; 22/07/2024 - Retro DOS v5.0 COMMAND.COM + 9920 %if 1 + 9921 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2336h + 9922 COMMAND_SWITCH10: + 9923 0000213E 0000 dw 0 ; no match flags + 9924 00002140 0200 dw 2 ; capitalize by char table + 9925 00002142 [5621] dw COMND1_OUTPUT ; result buffer + 9926 00002144 [5E21] dw NO_VAL ; + 9927 00002146 01 db 1 ; 1 keyword + 9928 COMMAND_H_SYN: + 9929 00002147 2F4800 db '/H',0 ; /H switch + 9930 + 9931 COMMAND_SWITCH11: + 9932 0000214A 0000 dw 0 ; no match flags + 9933 0000214C 0200 dw 2 ; capitalize by char table + 9934 0000214E [5621] dw COMND1_OUTPUT ; result buffer + 9935 00002150 [5E21] dw NO_VAL ; + 9936 00002152 01 db 1 ; 1 keyword + 9937 COMMAND_O_SYN: + 9938 00002153 2F4F00 db '/O',0 ; /O switch + 9939 %endif + 9940 + 9941 COMND1_OUTPUT: + 9942 COMND1_TYPE: + 9943 00002156 00 db 0 ; type + 9944 COMND1_CODE: + 9945 00002157 00 db 0 ; return value + 9946 COMND1_SYN: + 9947 00002158 0000 dw 0 ; synonym pointer + 9948 COMND1_ADDR: + 9949 0000215A 00000000 dd 0 ; numeric value / address + 9950 ; of string value + 9951 NO_VAL: + 9952 0000215E 00 db 0 ; no values + 9953 num_positionals: + 9954 0000215F 0000 dw 0 ; counter for positionals + 9955 old_parse_ptr: + 9956 00002161 0000 dw 0 ; SI position before calling parser + 9957 + 9958 ; 30/01/2023 + 9959 ;*** INITIALIZATION MESSAGES + 9960 ; ------------------------- + 9961 ; include comimsg.inc ;M00 + 9962 ;----------------------------------------------------------------------------- + 9963 + 9964 BADVERMSG: + 9965 00002163 17 db 23 + 9966 00002164 496E636F7272656374- db 'Incorrect DOS version',0Dh,0Ah + 9966 0000216D 20444F532076657273- + 9966 00002176 696F6E0D0A + 9967 OUTENVMSG: + 9968 0000217B 1A db 26 + 9969 0000217C 4F7574206F6620656E- db 'Out of environment space',0Dh,0Ah + 9969 00002185 7669726F6E6D656E74- + 9969 0000218E 2073706163650D0A + 9970 + 9971 ; 07/06/2023 + 9972 ;COPYRIGHTMSG: + 9973 ; db 94 + 9974 ; db 0Dh,0Ah + 9975 ; db 0Dh,0Ah + 9976 ; db 'Microsoft(R) MS-DOS(R) Version 5.00',0Dh,0Ah + 9977 ; db ' (C)Copyright Microsoft Corp 1981-1991.',0Dh,0Ah + 9978 + 9979 ; 23/07/2024 + 9980 %if 0 + 9981 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 9982 ; MSDOS 6.22 COMMAND.COM - RESGROUP:2286h + 9983 COPYRIGHTMSG: + 9984 db 94 + 9985 db 0Dh,0Ah + 9986 db 0Dh,0Ah + 9987 db 'Microsoft(R) MS-DOS(R) Version 6.22',0Dh,0Ah + 9988 db ' (C)Copyright Microsoft Corp 1981-1994.',0Dh,0Ah + 9989 %else + 9990 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM + 9991 ; PCDOS 7.1 COMMAND.COM - RESGROUP:2385h + 9992 COPYRIGHTMSG: + 9993 00002196 64 db 100 + 9994 00002197 0D0A db 0Dh,0Ah + 9995 00002199 0D0A db 0Dh,0Ah + 9996 0000219B 504320444F53205665- db 'PC DOS Version 7.10',0Dh,0Ah + 9996 000021A4 7273696F6E20372E31- + 9996 000021AD 300D0A + 9997 000021B0 202020202020202020- db ' (C)Copyright International Business Machines Corp ' + 9997 000021B9 20202020284329436F- + 9997 000021C2 707972696768742049- + 9997 000021CB 6E7465726E6174696F- + 9997 000021D4 6E616C20427573696E- + 9997 000021DD 657373204D61636869- + 9997 000021E6 6E657320436F727020 + 9998 000021EF 313938312D32303032- db '1981-2002.',0Dh,0Ah + 9998 000021F8 2E0D0A + 9999 %endif + 10000 + 10001 BADCOMLKMES: + 10002 000021FB 28 db 40 + 10003 000021FC 537065636966696564- db 'Specified COMMAND search directory bad',0Dh,0Ah + 10003 00002205 20434F4D4D414E4420- + 10003 0000220E 736561726368206469- + 10003 00002217 726563746F72792062- + 10003 00002220 61640D0A + 10004 ; 07/06/2023 + 10005 BADCOMACCMSG: + 10006 00002224 37 db 55 + 10007 00002225 537065636966696564- db 'Specified COMMAND search directory bad, access denied',0Dh,0Ah + 10007 0000222E 20434F4D4D414E4420- + 10007 00002237 736561726368206469- + 10007 00002240 726563746F72792062- + 10007 00002249 61642C206163636573- + 10007 00002252 732064656E6965640D- + 10007 0000225B 0A + 10008 HELPMSG1: + 10009 0000225C 38 db 56 + 10010 ;db 'Starts a new copy of the MS-DOS command interpreter.',0Dh,0Ah + 10011 ; 23/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 10012 0000225D 537461727473206120- db 'Starts a new copy of the PC DOS command interpreter.',0Dh,0Ah + 10012 00002266 6E657720636F707920- + 10012 0000226F 6F6620746865205043- + 10012 00002278 20444F5320636F6D6D- + 10012 00002281 616E6420696E746572- + 10012 0000228A 7072657465722E0D0A + 10013 00002293 0D0A db 0Dh,0Ah + 10014 ;HELPMSG2: + 10015 ; db 70 + 10016 ; db 'COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]' + 10017 ; db 0Dh,0Ah + 10018 ; db 0Dh,0Ah + 10019 ; 07/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 10020 HELPMSG2: + 10021 00002295 38 db 56 + 10022 00002296 434F4D4D414E44205B- db 'COMMAND [[drive:]path] [device] [/E:nnnnn] [/P [/MSG]]',0Dh,0Ah + 10022 0000229F 5B64726976653A5D70- + 10022 000022A8 6174685D205B646576- + 10022 000022B1 6963655D205B2F453A- + 10022 000022BA 6E6E6E6E6E5D205B2F- + 10022 000022C3 50205B2F4D53475D5D- + 10022 000022CC 0D0A + 10023 HELPMSG3: + 10024 ;db 42 + 10025 ;db ' [/Y [/C command | /K command]]',0Dh,0Ah + 10026 ;db 0Dh,0Ah + 10027 ; 23/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 10028 000022CE 34 db 52 + 10029 000022CF 20202020202020205B- db ' [/H] [/O] [/Y [/C command | /K command]]',0Dh,0Ah + 10029 000022D8 2F485D205B2F4F5D20- + 10029 000022E1 5B2F59205B2F432063- + 10029 000022EA 6F6D6D616E64207C20- + 10029 000022F3 2F4B20636F6D6D616E- + 10029 000022FC 645D5D0D0A + 10030 00002301 0D0A db 0Dh,0Ah + 10031 ;HELPMSG3: + 10032 HELPMSG4: + 10033 00002303 48 db 72 + 10034 00002304 20205B64726976653A- db ' [drive:]path Specifies the directory containing COMMAND.COM ' + 10034 0000230D 5D7061746820202020- + 10034 00002316 537065636966696573- + 10034 0000231F 207468652064697265- + 10034 00002328 63746F727920636F6E- + 10034 00002331 7461696E696E672043- + 10034 0000233A 4F4D4D414E442E434F- + 10034 00002343 4D20 + 10035 00002345 66696C652E0D0A db 'file.',0Dh,0Ah + 10036 ;HELPMSG4: + 10037 HELPMSG5: + 10038 0000234C 4D db 77 + 10039 0000234D 202064657669636520- db ' device Specifies the device to use for command input and ' + 10039 00002356 202020202020202020- + 10039 0000235F 537065636966696573- + 10039 00002368 207468652064657669- + 10039 00002371 636520746F20757365- + 10039 0000237A 20666F7220636F6D6D- + 10039 00002383 616E6420696E707574- + 10039 0000238C 20616E6420 + 10040 00002391 6F75747075742E0D0A db 'output.',0Dh,0Ah + 10041 ;HELPMSG5: + 10042 HELPMSG6: + 10043 0000239A 45 db 69 + 10044 0000239B 20202F453A6E6E6E6E- db ' /E:nnnnn Sets the initial environment size to nnnnn bytes.' + 10044 000023A4 6E2020202020202020- + 10044 000023AD 536574732074686520- + 10044 000023B6 696E697469616C2065- + 10044 000023BF 6E7669726F6E6D656E- + 10044 000023C8 742073697A6520746F- + 10044 000023D1 206E6E6E6E6E206279- + 10044 000023DA 7465732E + 10045 000023DE 0D0A db 0Dh,0Ah + 10046 ;HELPMSG6: + 10047 HELPMSG7: + 10048 000023E0 4D db 77 + 10049 000023E1 20202F502020202020- db ' /P Makes the new Command Interpreter permanent ' + 10049 000023EA 202020202020202020- + 10049 000023F3 4D616B657320746865- + 10049 000023FC 206E657720436F6D6D- + 10049 00002405 616E6420496E746572- + 10049 0000240E 707265746572207065- + 10049 00002417 726D616E656E7420 + 10050 0000241F 2863616E2774206578- db '(can',27h,'t exit).',0Dh,0Ah + 10050 00002428 6974292E0D0A + 10051 ;HELPMSG7: + 10052 HELPMSG8: + 10053 ;db 80 + 10054 ;db ' /C string Carries out the command specified by string, and ' + 10055 ;db 'then stops.',0Dh,0Ah + 10056 ; 07/06/2023 + 10057 0000242E 46 db 70 + 10058 0000242F 20202F4D5347202020- db ' /MSG Stores all error messages in memory (requires /P).' + 10058 00002438 202020202020202020- + 10058 00002441 53746F72657320616C- + 10058 0000244A 6C206572726F72206D- + 10058 00002453 657373616765732069- + 10058 0000245C 6E206D656D6F727920- + 10058 00002465 287265717569726573- + 10058 0000246E 202F50292E + 10059 00002473 0D0A db 0Dh,0Ah + 10060 + 10061 ; 23/07/2024 - Retro DOS v5.0 COMMAND.COM + 10062 ; PCDOS 7.1 COMMAND.COM + 10063 ;*** + 10064 HELPMSG9: + 10065 00002475 4A db 74 + 10066 00002476 20202F482020202020- db ' /H Loads the Command Interpreter into a UMB ' + 10066 0000247F 202020202020202020- + 10066 00002488 4C6F61647320746865- + 10066 00002491 20436F6D6D616E6420- + 10066 0000249A 496E74657270726574- + 10066 000024A3 657220696E746F2061- + 10066 000024AC 20554D4220 + 10067 000024B1 696620617661696C61- db 'if available.',0Dh,0Ah + 10067 000024BA 626C652E0D0A + 10068 HELPMSG10: + 10069 000024C0 4E db 78 + 10070 000024C1 20202F4F2020202020- db ' /O Disables overwrite prompt on COPY,XCOPY,and MOVE ' + 10070 000024CA 202020202020202020- + 10070 000024D3 44697361626C657320- + 10070 000024DC 6F7665727772697465- + 10070 000024E5 2070726F6D7074206F- + 10070 000024EE 6E20434F50592C5843- + 10070 000024F7 4F50592C616E64204D- + 10070 00002500 4F564520 + 10071 00002504 636F6D6D616E64732E- db 'commands.',0Dh,0Ah + 10071 0000250D 0D0A + 10072 ;*** + 10073 + 10074 ;HELPMSG8: + 10075 ; 23/07/2024 - PCDOS 7.1 COMMAND.COM + 10076 ;HELPMSG9: + 10077 HELPMSG11: + 10078 ;db 78 + 10079 ;db ' /MSG Specifies that all error messages be stored in ' + 10080 ;db 'memory. You',0Dh,0Ah + 10081 ;HELPMSG9: + 10082 ;db 56 + 10083 ;db ' need to specify /P with this switch.',0Dh,0Ah + 10084 0000250F 4A db 74 + 10085 00002510 20202F592020202020- db ' /Y Steps through the batch program specified by /C' + 10085 00002519 202020202020202020- + 10085 00002522 537465707320746872- + 10085 0000252B 6F7567682074686520- + 10085 00002534 62617463682070726F- + 10085 0000253D 6772616D2073706563- + 10085 00002546 696669656420627920- + 10085 0000254F 2F43 + 10086 00002551 206F72202F4B2E0D0A db ' or /K.',0Dh,0Ah + 10087 + 10088 ; 07/06/2023 + 10089 ; 23/07/2024 + 10090 ;HELPMSG10: + 10091 HELPMSG12: + 10092 0000255A 3F db 63 + 10093 0000255B 20202F4320636F6D6D- db ' /C command Executes the specified command and returns.',0Dh,0Ah + 10093 00002564 616E64202020202020- + 10093 0000256D 457865637574657320- + 10093 00002576 746865207370656369- + 10093 0000257F 6669656420636F6D6D- + 10093 00002588 616E6420616E642072- + 10093 00002591 657475726E732E0D0A + 10094 ; 23/07/2024 + 10095 ;HELPMSG11: + 10096 HELPMSG13: + 10097 0000259A 4B db 75 + 10098 0000259B 20202F4B20636F6D6D- db ' /K command Executes the specified command and continues running.' + 10098 000025A4 616E64202020202020- + 10098 000025AD 457865637574657320- + 10098 000025B6 746865207370656369- + 10098 000025BF 6669656420636F6D6D- + 10098 000025C8 616E6420616E642063- + 10098 000025D1 6F6E74696E75657320- + 10098 000025DA 72756E6E696E672E + 10099 000025E2 0D0A db 0Dh,0Ah + 10100 000025E4 0D0A db 0Dh,0Ah + 10101 ;HELPMSG12: + 10102 ; 23/07/2024 + 10103 HELPMSG14: + 10104 000025E6 4C db 76 + 10105 000025E7 546865202F5020616E- db 'The /P and /MSG switches may be used only when COMMAND is started' + 10105 000025F0 64202F4D5347207377- + 10105 000025F9 697463686573206D61- + 10105 00002602 792062652075736564- + 10105 0000260B 206F6E6C7920776865- + 10105 00002614 6E20434F4D4D414E44- + 10105 0000261D 206973207374617274- + 10105 00002626 6564 + 10106 00002628 206279207573696E67- db ' by using',0Dh,0Ah + 10106 00002631 0D0A + 10107 ;HELPMSG13: + 10108 ; 23/07/2024 + 10109 HELPMSG15: + 10110 00002633 2B db 43 + 10111 00002634 746865205348454C4C- db 'the SHELL command in the CONFIG.SYS file.',0Dh,0Ah + 10111 0000263D 20636F6D6D616E6420- + 10111 00002646 696E2074686520434F- + 10111 0000264F 4E4649472E53595320- + 10111 00002658 66696C652E0D0A + 10112 + 10113 HelpMsgs: + 10114 0000265F [5C22] dw HELPMSG1 + 10115 00002661 [9522] dw HELPMSG2 + 10116 00002663 [CE22] dw HELPMSG3 + 10117 00002665 [0323] dw HELPMSG4 + 10118 00002667 [4C23] dw HELPMSG5 + 10119 00002669 [9A23] dw HELPMSG6 + 10120 0000266B [E023] dw HELPMSG7 + 10121 0000266D [2E24] dw HELPMSG8 + 10122 0000266F [7524] dw HELPMSG9 + 10123 + 10124 ; 07/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 10125 00002671 [C024] dw HELPMSG10 + 10126 00002673 [0F25] dw HELPMSG11 + 10127 00002675 [5A25] dw HELPMSG12 + 10128 00002677 [9A25] dw HELPMSG13 + 10129 + 10130 ; 23/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 10131 00002679 [E625] dw HELPMSG14 + 10132 0000267B [3326] dw HELPMSG15 10133 - 10134 ;----------------------------------------------------------------------------- - 10135 - 10136 ;SR; - 10137 ; This table of offsets is used by the init code to calculate the new offsets - 10138 ;for these labels after the resident code has been relocated - 10139 - 10140 ;Reloc_Table: - 10141 ;dw offset CODERES:MsgInt2fHandler - 10142 ;dw offset CODERES:Int_2e - 10143 ;dw offset CODERES:ContC - 10144 ;dw offset CODERES:DskErr - 10145 ;dw offset CODERES:Exec_Ret - 10146 ;dw offset CODERES:TRemCheck - 10147 ;dw offset CODERES:TrnLodCom1 - 10148 ;dw offset CODERES:LodCom - 10149 ;dw offset CODERES:MsgRetriever - 10150 ;dw offset CODERES:THeadFix - 10151 ;dw offset CODERES:Lh_OffUnlink ; M003 - 10152 - 10153 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10154 ; MSDOS 5.0 COMMAND.COM - RESGROUP:22F6h + 10134 ; 23/04/2023 + 10135 0000267D 0000 dw 0 + 10136 + 10137 ;----------------------------------------------------------------------------- + 10138 + 10139 ;SR; + 10140 ; This table of offsets is used by the init code to calculate the new offsets + 10141 ;for these labels after the resident code has been relocated + 10142 + 10143 ;Reloc_Table: + 10144 ;dw offset CODERES:MsgInt2fHandler + 10145 ;dw offset CODERES:Int_2e + 10146 ;dw offset CODERES:ContC + 10147 ;dw offset CODERES:DskErr + 10148 ;dw offset CODERES:Exec_Ret + 10149 ;dw offset CODERES:TRemCheck + 10150 ;dw offset CODERES:TrnLodCom1 + 10151 ;dw offset CODERES:LodCom + 10152 ;dw offset CODERES:MsgRetriever + 10153 ;dw offset CODERES:THeadFix + 10154 ;dw offset CODERES:Lh_OffUnlink ; M003 10155 - 10156 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10157 ; MSDOS 6.22 COMMAND.COM - RESGROUP:26C1h + 10156 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 10157 ; MSDOS 5.0 COMMAND.COM - RESGROUP:22F6h 10158 - 10159 Reloc_Table: ; 23/07/2024 ; PCDOS 7.1 COMMAND.COM CODERES addresses - 10160 0000267F 9007 dw MsgInt2fHandler - RCODE_START ; 7B2h (RESGROUP:7B2h+X) * - 10161 00002681 7601 dw Int_2e - RCODE_START ; 170h (RESGROUP:170h+X) * - 10162 00002683 3300 dw ContC - RCODE_START ; 02Eh (RESGROUP:02Eh+X) * - 10163 00002685 7B04 dw DSKERR - RCODE_START ; 495h (RESGROUP:495h+X) * - 10164 00002687 2700 dw Exec_Ret - RCODE_START ; 022h (RESGROUP:022h+X) * - 10165 00002689 A402 dw TRemCheck - RCODE_START ; 2A6h (RESGROUP:2A6h+X) * - 10166 0000268B 4604 dw TrnLodCom1 - RCODE_START ; 472h (RESGROUP:472h+X) * - 10167 0000268D AD01 dw LodCom - RCODE_START ; 1A7h (RESGROUP:1A7h+X) * - 10168 0000268F D307 dw MsgRetriever - RCODE_START ; 7F5h (RESGROUP:7F5h+X) * - 10169 00002691 C302 dw THeadFix - RCODE_START ; 2C5h (RESGROUP:2C5h+X) * - 10170 00002693 4C08 dw Lh_OffUnlink - RCODE_START ; 86Eh (RESGROUP:86Eh+X) * - 10171 - 10172 ; MSDOS 6.22 COMMAND.COM Reloc_Table CODERES addresses: - 10173 ; 738h,177h,035h,445h,029h,2A3h,422h,1AEh,77Bh,2C2h,7F4h + 10159 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10160 ; MSDOS 6.22 COMMAND.COM - RESGROUP:26C1h + 10161 + 10162 Reloc_Table: ; 23/07/2024 ; PCDOS 7.1 COMMAND.COM CODERES addresses + 10163 0000267F 9007 dw MsgInt2fHandler - RCODE_START ; 7B2h (RESGROUP:7B2h+X) * + 10164 00002681 7601 dw Int_2e - RCODE_START ; 170h (RESGROUP:170h+X) * + 10165 00002683 3300 dw ContC - RCODE_START ; 02Eh (RESGROUP:02Eh+X) * + 10166 00002685 7B04 dw DSKERR - RCODE_START ; 495h (RESGROUP:495h+X) * + 10167 00002687 2700 dw Exec_Ret - RCODE_START ; 022h (RESGROUP:022h+X) * + 10168 00002689 A402 dw TRemCheck - RCODE_START ; 2A6h (RESGROUP:2A6h+X) * + 10169 0000268B 4604 dw TrnLodCom1 - RCODE_START ; 472h (RESGROUP:472h+X) * + 10170 0000268D AD01 dw LodCom - RCODE_START ; 1A7h (RESGROUP:1A7h+X) * + 10171 0000268F D307 dw MsgRetriever - RCODE_START ; 7F5h (RESGROUP:7F5h+X) * + 10172 00002691 C302 dw THeadFix - RCODE_START ; 2C5h (RESGROUP:2C5h+X) * + 10173 00002693 4C08 dw Lh_OffUnlink - RCODE_START ; 86Eh (RESGROUP:86Eh+X) * 10174 - 10175 ; 07/06/2023 - 10176 ; X = 0D40h for MSDOS 5.0 COMMAND.COM - 10177 ; X = 0E50h for MSDOS 6.22 COMMAND.COM - 10178 ; 23/07/2024 - 10179 ; X = 0E10h for PCDOS 7.1 COMMAND.COM - 10180 ;; example: - 10181 ;; MsgIn2FHandler is at RESGROUP:15C2h or at CODERES:07B2h - 10182 ;; (in PCDOS 7.1 COMMAND.COM) - 10183 - 10184 NUM_RELOC_ENTRIES equ ($-Reloc_Table)/2 - 10185 - 10186 ResJmpTable: - 10187 00002695 00000000 dd 0 ; stores prev stub jump table addr - 10188 FirstCom: - 10189 00002699 00 db 0 ; flag set if first command.com - 10190 DevFlag: - 10191 0000269A 00 db 0 - 10192 PathFlag: - 10193 0000269B 00 db 0 - 10194 - 10195 ;; MSDOS 5.0 COMMAND.COM - RESGROUP:2313h - 10196 ;;times 13 db 0 + 10175 ; MSDOS 6.22 COMMAND.COM Reloc_Table CODERES addresses: + 10176 ; 738h,177h,035h,445h,029h,2A3h,422h,1AEh,77Bh,2C2h,7F4h + 10177 + 10178 ; 07/06/2023 + 10179 ; X = 0D40h for MSDOS 5.0 COMMAND.COM + 10180 ; X = 0E50h for MSDOS 6.22 COMMAND.COM + 10181 ; 23/07/2024 + 10182 ; X = 0E10h for PCDOS 7.1 COMMAND.COM + 10183 ;; example: + 10184 ;; MsgIn2FHandler is at RESGROUP:15C2h or at CODERES:07B2h + 10185 ;; (in PCDOS 7.1 COMMAND.COM) + 10186 + 10187 NUM_RELOC_ENTRIES equ ($-Reloc_Table)/2 + 10188 + 10189 ResJmpTable: + 10190 00002695 00000000 dd 0 ; stores prev stub jump table addr + 10191 FirstCom: + 10192 00002699 00 db 0 ; flag set if first command.com + 10193 DevFlag: + 10194 0000269A 00 db 0 + 10195 PathFlag: + 10196 0000269B 00 db 0 10197 - 10198 ; 07/06/2023 - 10199 ; MSDOS 6.22 COMMAND.COM - RESGROUP:26DEh - 10200 ;times 2 db 0 - 10201 - 10202 ; 30/01/2023 - 10203 coderes_end equ $ + 10198 ;; MSDOS 5.0 COMMAND.COM - RESGROUP:2313h + 10199 ;;times 13 db 0 + 10200 + 10201 ; 07/06/2023 + 10202 ; MSDOS 6.22 COMMAND.COM - RESGROUP:26DEh + 10203 ;times 2 db 0 10204 - 10205 ;INIT ENDS - 10206 - 10207 ; END - 10208 - 10209 ;----------------------------------------------------------------------------- - 10210 ; 14/10/2018 (Retro DOS v3.0 COMMAND.COM Signature) - 10211 ;----------------------------------------------------------------------------- - 10212 - 10213 ;db "Retro DOS v3.0 COMMAND.COM by Erdogan Tan [2018]" - 10214 ; 30/01/2023 - 10215 0000269C 00 db 0 - 10216 ;db "Retro DOS v4.0 COMMAND.COM by Erdogan Tan [2023]" - 10217 ; 07/06/2023 - 10218 ;db "Retro DOS v4.2 COMMAND.COM by Erdogan Tan [2023]" - 10219 ; 21/07/2024 - 10220 0000269D 526574726F20444F53- db "Retro DOS v5.0 COMMAND.COM by Erdogan Tan [2024]" - 10220 000026A6 2076352E3020434F4D- - 10220 000026AF 4D414E442E434F4D20- - 10220 000026B8 6279204572646F6761- - 10220 000026C1 6E2054616E205B3230- - 10220 000026CA 32345D - 10221 000026CD 00 db 0 - 10222 - 10223 ;----------------------------------------------------------------------------- - 10224 ; 24/09/2018 (Retro DOS v3.0 COMMAND) - 10225 ;----------------------------------------------------------------------------- - 10226 - 10227 ;TAIL SEGMENT PUBLIC PARA - 10228 ; ORG 0 - 10229 ;TRANSTART LABEL WORD - 10230 ;TAIL ENDS - 10231 - 10232 ;ALIGN 16 ; 25/09/2018 - 10233 - 10234 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10235 - 10236 numbertodiv equ ($-StartCode)+100h ; 16/04/2023 - 10237 numbertomod equ (numbertodiv % 16) + 10205 ; 30/01/2023 + 10206 coderes_end equ $ + 10207 + 10208 ;INIT ENDS + 10209 + 10210 ; END + 10211 + 10212 ;----------------------------------------------------------------------------- + 10213 ; 14/10/2018 (Retro DOS v3.0 COMMAND.COM Signature) + 10214 ;----------------------------------------------------------------------------- + 10215 + 10216 ;db "Retro DOS v3.0 COMMAND.COM by Erdogan Tan [2018]" + 10217 ; 30/01/2023 + 10218 0000269C 00 db 0 + 10219 ;db "Retro DOS v4.0 COMMAND.COM by Erdogan Tan [2023]" + 10220 ; 07/06/2023 + 10221 ;db "Retro DOS v4.2 COMMAND.COM by Erdogan Tan [2023]" + 10222 ; 21/07/2024 + 10223 0000269D 526574726F20444F53- db "Retro DOS v5.0 COMMAND.COM by Erdogan Tan [2024]" + 10223 000026A6 2076352E3020434F4D- + 10223 000026AF 4D414E442E434F4D20- + 10223 000026B8 6279204572646F6761- + 10223 000026C1 6E2054616E205B3230- + 10223 000026CA 32345D + 10224 000026CD 00 db 0 + 10225 + 10226 ;----------------------------------------------------------------------------- + 10227 ; 24/09/2018 (Retro DOS v3.0 COMMAND) + 10228 ;----------------------------------------------------------------------------- + 10229 + 10230 ;TAIL SEGMENT PUBLIC PARA + 10231 ; ORG 0 + 10232 ;TRANSTART LABEL WORD + 10233 ;TAIL ENDS + 10234 + 10235 ;ALIGN 16 ; 25/09/2018 + 10236 + 10237 ; 30/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 10238 - 10239 %if numbertomod>0 & numbertomod<16 - 10240 000026CE 00 times (16-numbertomod) db 0 - 10241 %endif - 10242 - 10243 ; 30/01/2023 - 10244 ;TRANSTART: + 10239 numbertodiv equ ($-StartCode)+100h ; 16/04/2023 + 10240 numbertomod equ (numbertodiv % 16) + 10241 + 10242 %if numbertomod>0 & numbertomod<16 + 10243 000026CE 00 times (16-numbertomod) db 0 + 10244 %endif 10245 - 10246 ; 21/04/2018 (Retro DOS v2.0 COMMAND) - 10247 ; times 128 db 0 + 10246 ; 30/01/2023 + 10247 ;TRANSTART: 10248 - 10249 ;----------------------------------------------------------------------------- - 10250 ; SEGMENT - TRANSCODE - 10251 ;----------------------------------------------------------------------------- - 10252 - 10253 ;TRANGROUP: ; 21/04/2018 - 10254 - 10255 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10256 ;----------------------------------------------------------------------------- + 10249 ; 21/04/2018 (Retro DOS v2.0 COMMAND) + 10250 ; times 128 db 0 + 10251 + 10252 ;----------------------------------------------------------------------------- + 10253 ; SEGMENT - TRANSCODE + 10254 ;----------------------------------------------------------------------------- + 10255 + 10256 ;TRANGROUP: ; 21/04/2018 10257 - 10258 ; MSDOS 3.3 COMMAND.COM Transient Portion Addresses - 10259 - 10260 ; 21/04/2018 - Retro DOS v2.0 - 10261 ; transcom.s (COMMAND.COM source file 2 of 2) code/data addresses - 10262 ; (these values must be changed when transcom.s source code is changed - 10263 ; and data offsets are changed) - 10264 ; - 10265 ; 30/04/2018 - 10266 ; 29/04/2018 - 10267 - 10268 ; 24/09/2018 (original MSDOS 3.3 COMMAND.COM TrnSeg offset addresses) - 10269 ;COMMAND EQU 012CH - 10270 ;DATINIT EQU 2091H - 10271 ;HEADCALL EQU 428FH - 10272 ;TRANSPACEEND EQU 4D5CH - 10273 ;TRANDATAEND EQU 3F44H - 10274 - 10275 ; 29/04/2018 (original MSDOS 3.3 COMMAND.COM TrnSeg offset addresses) - 10276 ;TRIAGE_INIT EQU 1F15H - 10277 ;PRINTF_INIT EQU 34E0H - 10278 - 10279 ;GETEXTERRNUM EQU 1EEEH ; TRIAGEERROR (GET_EXT_ERR_NUMBER) proc addr - 10280 - 10281 ;TPA EQU 4293H - 10282 ;TRNLEN EQU 04D6H + 10258 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 10259 ;----------------------------------------------------------------------------- + 10260 + 10261 ; MSDOS 3.3 COMMAND.COM Transient Portion Addresses + 10262 + 10263 ; 21/04/2018 - Retro DOS v2.0 + 10264 ; transcom.s (COMMAND.COM source file 2 of 2) code/data addresses + 10265 ; (these values must be changed when transcom.s source code is changed + 10266 ; and data offsets are changed) + 10267 ; + 10268 ; 30/04/2018 + 10269 ; 29/04/2018 + 10270 + 10271 ; 24/09/2018 (original MSDOS 3.3 COMMAND.COM TrnSeg offset addresses) + 10272 ;COMMAND EQU 012CH + 10273 ;DATINIT EQU 2091H + 10274 ;HEADCALL EQU 428FH + 10275 ;TRANSPACEEND EQU 4D5CH + 10276 ;TRANDATAEND EQU 3F44H + 10277 + 10278 ; 29/04/2018 (original MSDOS 3.3 COMMAND.COM TrnSeg offset addresses) + 10279 ;TRIAGE_INIT EQU 1F15H + 10280 ;PRINTF_INIT EQU 34E0H + 10281 + 10282 ;GETEXTERRNUM EQU 1EEEH ; TRIAGEERROR (GET_EXT_ERR_NUMBER) proc addr 10283 - 10284 ; 20/10/2018 - Retro DOS v3.0 COMMAND.COM transient portion addresses - 10285 ;COMMAND EQU 012CH - 10286 ;DATINIT EQU 206FH - 10287 ;HEADCALL EQU 426FH - 10288 ; 09/01/2023 - 10289 ;TRANSPACEEND EQU 4D3CH - 10290 ;TRANDATAEND EQU 3F24H - 10291 ;TRIAGE_INIT EQU 1EF3H - 10292 ;PRINTF_INIT EQU 34BFH - 10293 ; - 10294 ;GETEXTERRNUM EQU 1ECCH ; TRIAGEERROR (GET_EXT_ERR_NUMBER) proc addr - 10295 - 10296 ;----------------------------------------------------------------------------- - 10297 ; ARENA.INC, MSDOS 6.0, 1991 - 10298 ;----------------------------------------------------------------------------- - 10299 ; 13/10/2018 - Retro DOS 3.0 - 10300 ; 17/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10301 - 10302 ;BREAK - 10303 - 10304 ; (-*-) Same with MSDOS 2.11 & MSDOS 6.0 - 10305 - 10306 ; arena item - 10307 - 10308 struc ARENA - 10309 00000000 ?? .signature: resb 1 ; 4D for valid item, 5A for last item - 10310 00000001 ???? .owner: resw 1 ; owner of arena item - 10311 00000003 ???? .size: resw 1 ; size in paragraphs of item - 10312 endstruc - 10313 - 10314 ;----------------------------------------------------------------------------- - 10315 ;START OF TRANSIENT PORTION - 10316 ;This code is loaded at the end of memory and may be overwritten by - 10317 ;memory-intensive user programs. - 10318 ;----------------------------------------------------------------------------- - 10319 - 10320 ; 16/04/2023 - 10321 TRANSTART EQU ($-StartCode)+100h ; 18/04/2023 - 10322 ; 29/09/2018 - 10323 ; 31/01/2023 - 10324 ;TRANSTART: ; Offset 1660h in original MSDOS 3.3 COMMAND.COM - 10325 - 10326 ; 09/01/2023 - 10327 ; Offset 2320h in original MSDOS 5.0 COMMAND.COM + 10284 ;TPA EQU 4293H + 10285 ;TRNLEN EQU 04D6H + 10286 + 10287 ; 20/10/2018 - Retro DOS v3.0 COMMAND.COM transient portion addresses + 10288 ;COMMAND EQU 012CH + 10289 ;DATINIT EQU 206FH + 10290 ;HEADCALL EQU 426FH + 10291 ; 09/01/2023 + 10292 ;TRANSPACEEND EQU 4D3CH + 10293 ;TRANDATAEND EQU 3F24H + 10294 ;TRIAGE_INIT EQU 1EF3H + 10295 ;PRINTF_INIT EQU 34BFH + 10296 ; + 10297 ;GETEXTERRNUM EQU 1ECCH ; TRIAGEERROR (GET_EXT_ERR_NUMBER) proc addr + 10298 + 10299 ;----------------------------------------------------------------------------- + 10300 ; ARENA.INC, MSDOS 6.0, 1991 + 10301 ;----------------------------------------------------------------------------- + 10302 ; 13/10/2018 - Retro DOS 3.0 + 10303 ; 17/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 10304 + 10305 ;BREAK + 10306 + 10307 ; (-*-) Same with MSDOS 2.11 & MSDOS 6.0 + 10308 + 10309 ; arena item + 10310 + 10311 struc ARENA + 10312 00000000 ?? .signature: resb 1 ; 4D for valid item, 5A for last item + 10313 00000001 ???? .owner: resw 1 ; owner of arena item + 10314 00000003 ???? .size: resw 1 ; size in paragraphs of item + 10315 endstruc + 10316 + 10317 ;----------------------------------------------------------------------------- + 10318 ;START OF TRANSIENT PORTION + 10319 ;This code is loaded at the end of memory and may be overwritten by + 10320 ;memory-intensive user programs. + 10321 ;----------------------------------------------------------------------------- + 10322 + 10323 ; 16/04/2023 + 10324 TRANSTART EQU ($-StartCode)+100h ; 18/04/2023 + 10325 ; 29/09/2018 + 10326 ; 31/01/2023 + 10327 ;TRANSTART: ; Offset 1660h in original MSDOS 3.3 COMMAND.COM 10328 - 10329 ; 07/06/2023 - 10330 ; Offset 26E0h in original MSDOS 6.22 COMMAND.COM - 10331 - 10332 ; 25/09/2018 - 10333 ; (original MSDOS 3.3 COMMAND.COM TRIAGEERROR offset address) - 10334 ; - 10335 ; 'GET_EXT_ERR_NUMBER' ('TRIAGEERROR') procedure is at offset 354Eh - 10336 ; in MSDOS 3.3 COMMAND.COM (It is at offset 1EEEh in transient porsion). + 10329 ; 09/01/2023 + 10330 ; Offset 2320h in original MSDOS 5.0 COMMAND.COM + 10331 + 10332 ; 07/06/2023 + 10333 ; Offset 26E0h in original MSDOS 6.22 COMMAND.COM + 10334 + 10335 ; 25/09/2018 + 10336 ; (original MSDOS 3.3 COMMAND.COM TRIAGEERROR offset address) 10337 ; - 10338 ;TRIAGEERROR EQU TRANSTART+GETEXTERRNUM-100H - 10339 ; + 10338 ; 'GET_EXT_ERR_NUMBER' ('TRIAGEERROR') procedure is at offset 354Eh + 10339 ; in MSDOS 3.3 COMMAND.COM (It is at offset 1EEEh in transient porsion). 10340 ; - 10341 ;COMTRANS: + 10341 ;TRIAGEERROR EQU TRANSTART+GETEXTERRNUM-100H 10342 ; - 10343 ; 20/10/2018 - Retro DOS v3.0 - 10344 ;INCBIN "TRANCOM3.BIN" + 10343 ; + 10344 ;COMTRANS: 10345 ; - 10346 ;COMLEN EQU $-COMTRANS ; End of COMMAND load. - 10347 ; - 10348 ; 29/04/2018 - 10349 ;BSS_SIZE EQU TRANSPACEEND-TRANDATAEND + 10346 ; 20/10/2018 - Retro DOS v3.0 + 10347 ;INCBIN "TRANCOM3.BIN" + 10348 ; + 10349 ;COMLEN EQU $-COMTRANS ; End of COMMAND load. 10350 ; - 10351 ;TIMES BSS_SIZE db 0 - 10352 ; - 10353 ;COMLEN EQU $-COMTRANS ; 30/04/2018 - 10354 - 10355 ;COMMANDCOMSIZE equ $ - 100h - 10356 - 10357 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10358 ; ============================================================================ - 10359 ; --- ('trancom5.s', 31/01/2023 - modified from 'trancom3.s', 20/10/2018) ---- - 10360 ; ============================================================================ - 10361 - 10362 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM (MSDOS 6.22 COMMAND.COM) - 10363 - 10364 ; ---------------------------------------------------------------------------- - 10365 ; START OF TRANSIENT PORTION - 10366 ; ---------------------------------------------------------------------------- - 10367 ; SEGMENT - TRANSCODE - 10368 ; ---------------------------------------------------------------------------- - 10369 - 10370 ; 18/04/2023 - 10371 section .TRANGROUP vstart=0 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) + 10351 ; 29/04/2018 + 10352 ;BSS_SIZE EQU TRANSPACEEND-TRANDATAEND + 10353 ; + 10354 ;TIMES BSS_SIZE db 0 + 10355 ; + 10356 ;COMLEN EQU $-COMTRANS ; 30/04/2018 + 10357 + 10358 ;COMMANDCOMSIZE equ $ - 100h + 10359 + 10360 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 10361 ; ============================================================================ + 10362 ; --- ('trancom5.s', 31/01/2023 - modified from 'trancom3.s', 20/10/2018) ---- + 10363 ; ============================================================================ + 10364 + 10365 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM (MSDOS 6.22 COMMAND.COM) + 10366 + 10367 ; ---------------------------------------------------------------------------- + 10368 ; START OF TRANSIENT PORTION + 10369 ; ---------------------------------------------------------------------------- + 10370 ; SEGMENT - TRANSCODE + 10371 ; ---------------------------------------------------------------------------- 10372 10373 ; 18/04/2023 - 10374 ;----------------------------------------------------------------------------- - 10375 ; TRANSCODE segment offset 0 - 10376 TRANSIENTSTART: - 10377 - 10378 ; 31/01/2023 - 10379 00000000 00 times 256 db 0 ; Allow for 100H parameter area + 10374 section .TRANGROUP vstart=0 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) + 10375 + 10376 ; 18/04/2023 + 10377 ;----------------------------------------------------------------------------- + 10378 ; TRANSCODE segment offset 0 + 10379 TRANSIENTSTART: 10380 - 10381 ;============================================================================ - 10382 ; TCODE.ASM, MSDOS 6.0, 1991 - 10383 ;============================================================================ - 10384 ; 12/10/2018 - Retro DOS v3.0 - 10385 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) - 10386 - 10387 ;[ORG 100h] - 10388 - 10389 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 0100h - 10390 - 10391 ; --------------------------------------------------------------------------- - 10392 - 10393 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10394 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:0100h) - 10395 - 10396 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10397 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:0100h) - 10398 SETDRV: - 10399 00000100 B40E mov ah,0Eh - 10400 ;mov ah,SET_DEFAULT_DRIVE ; 0Eh - 10401 00000102 CD21 int 21h ; DOS - SELECT DISK - 10402 ; DL = new default drive number - 10403 ; (0 = A, 1 = B, ..) - 10404 ; Return: AL = number of logical drives - 10405 - 10406 ; --------------------------------------------------------------------------- - 10407 - 10408 ; TCOMMAND is the recycle point in COMMAND. Nothing is known here. - 10409 ; No registers (CS:IP) no flags, nothing. + 10381 ; 31/01/2023 + 10382 00000000 00 times 256 db 0 ; Allow for 100H parameter area + 10383 + 10384 ;============================================================================ + 10385 ; TCODE.ASM, MSDOS 6.0, 1991 + 10386 ;============================================================================ + 10387 ; 12/10/2018 - Retro DOS v3.0 + 10388 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) + 10389 + 10390 ;[ORG 100h] + 10391 + 10392 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 0100h + 10393 + 10394 ; --------------------------------------------------------------------------- + 10395 + 10396 ; 31/01/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 10397 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:0100h) + 10398 + 10399 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10400 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:0100h) + 10401 SETDRV: + 10402 00000100 B40E mov ah,0Eh + 10403 ;mov ah,SET_DEFAULT_DRIVE ; 0Eh + 10404 00000102 CD21 int 21h ; DOS - SELECT DISK + 10405 ; DL = new default drive number + 10406 ; (0 = A, 1 = B, ..) + 10407 ; Return: AL = number of logical drives + 10408 + 10409 ; --------------------------------------------------------------------------- 10410 - 10411 TCOMMAND: - 10412 ; 21/07/2024 - PCDOS 7.1 COMMAND.COM - TRANGROUP:0104h - 10413 ; Retro DOS v5.0 COMMAND.COM - 10414 %if 1 - 10415 00000104 90 nop - 10416 00000105 90 nop - 10417 %endif - 10418 00000106 2E8E1E[F59B] mov ds,[cs:RESSEG] - 10419 0000010B B8FFFF mov ax,-1 - 10420 0000010E 8706[A702] xchg ax,[VerVal] - 10421 00000112 83F8FF cmp ax,-1 - 10422 00000115 7404 je short NOSETVER2 - 10423 00000117 B42E mov ah,2Eh - 10424 ;mov ah,SET_VERIFY_ON_WRITE ; 2Eh - 10425 00000119 CD21 int 21h ; DOS - SET VERIFY FLAG - 10426 ; DL = 00h,AL = 01h VERIFY on / 00h VERIFY off - 10427 NOSETVER2: - 10428 0000011B 2EFF1E[F39B] call far [cs:HEADCALL] ; Make sure header fixed - 10429 00000120 31ED xor bp,bp ; Flag transient not read - 10430 00000122 833E[A502]FF cmp word [SingleCom],-1 - 10431 00000127 7505 jne short COMMAND - 10432 _$EXITPREP: - 10433 00000129 0E push cs - 10434 0000012A 1F pop ds - 10435 0000012B E9CF23 jmp _$EXIT ; Have finished the single command - 10436 - 10437 ; --------------------------------------------------------------------------- - 10438 ; - 10439 ; Main entry point from resident portion. - 10440 ; - 10441 ; If BP <> 0, then we have just loaded transient portion otherwise we are - 10442 ; just beginning the processing of another command. + 10411 ; TCOMMAND is the recycle point in COMMAND. Nothing is known here. + 10412 ; No registers (CS:IP) no flags, nothing. + 10413 + 10414 TCOMMAND: + 10415 ; 21/07/2024 - PCDOS 7.1 COMMAND.COM - TRANGROUP:0104h + 10416 ; Retro DOS v5.0 COMMAND.COM + 10417 %if 1 + 10418 00000104 90 nop + 10419 00000105 90 nop + 10420 %endif + 10421 00000106 2E8E1E[F59B] mov ds,[cs:RESSEG] + 10422 0000010B B8FFFF mov ax,-1 + 10423 0000010E 8706[A702] xchg ax,[VerVal] + 10424 00000112 83F8FF cmp ax,-1 + 10425 00000115 7404 je short NOSETVER2 + 10426 00000117 B42E mov ah,2Eh + 10427 ;mov ah,SET_VERIFY_ON_WRITE ; 2Eh + 10428 00000119 CD21 int 21h ; DOS - SET VERIFY FLAG + 10429 ; DL = 00h,AL = 01h VERIFY on / 00h VERIFY off + 10430 NOSETVER2: + 10431 0000011B 2EFF1E[F39B] call far [cs:HEADCALL] ; Make sure header fixed + 10432 00000120 31ED xor bp,bp ; Flag transient not read + 10433 00000122 833E[A502]FF cmp word [SingleCom],-1 + 10434 00000127 7505 jne short COMMAND + 10435 _$EXITPREP: + 10436 00000129 0E push cs + 10437 0000012A 1F pop ds + 10438 0000012B E9CF23 jmp _$EXIT ; Have finished the single command + 10439 + 10440 ; --------------------------------------------------------------------------- + 10441 ; + 10442 ; Main entry point from resident portion. 10443 ; - 10444 ; --------------------------------------------------------------------------- - 10445 - 10446 ; We are not always sure of the state of the world at this time. We presume - 10447 ; worst case and initialize the relevant registers: segments and stack. + 10444 ; If BP <> 0, then we have just loaded transient portion otherwise we are + 10445 ; just beginning the processing of another command. + 10446 ; + 10447 ; --------------------------------------------------------------------------- 10448 - 10449 COMMAND: - 10450 0000012E FC cld - 10451 0000012F 8CC8 mov ax,cs - 10452 00000131 FA cli - 10453 00000132 8ED0 mov ss,ax - 10454 ;mov sp,offset TRANGROUP:STACK - 10455 ; 07/06/2023 - 10456 00000134 BC[9EA5] mov sp,STACK ; 0AF24h for MSDOS 6.22 COMMAND.COM - 10457 ; 09854h for MSDOS 5.0 COMMAND.COM - 10458 ; 25/07/2024 - 10459 ; 0AA2Dh for PCDOS 7.1 COMMAND.COM - 10460 00000137 FB sti - 10461 - 10462 00000138 8EC0 mov es,ax - 10463 - 10464 ; MSDOS 6.0 - 10465 0000013A 8ED8 mov ds,ax ;AN000; set DS to transient - 10466 ;ASSUME ES:TRANGROUP,DS:TRANGROUP ;AC000; - 10467 ;invoke TSYSLOADMSG ;AN000; preload messages - 10468 ; 31/01/2023 - 10469 0000013C E8C653 call TSYSLOADMSG - 10470 0000013F C606[369F]00 mov byte [append_exec],0 ;AN041; set internal append state off - 10471 - 10472 ; MSDOS 3.3 (& MSDOS 6.0) - 10473 ;mov ds,[ss:RESSEG] - 10474 ; 31/01/2023 - 10475 00000144 8E1E[F59B] mov ds,[RESSEG] - 10476 00000148 36C606[D199]80 mov byte [ss:UCOMBUF],128 ; Init UCOMBUF - 10477 0000014E 36C606[549A]80 mov byte [ss:COMBUF],128 ; Init COMBUF (Autoexec doing DATE) - 10478 - 10479 ; If we have just loaded the transient, then we do NOT need to initialize the - 10480 ; command buffer. ???? DO WE NEED TO RESTORE THE USERS DIRECTORY ???? - 10481 ; I guess not: the only circumstances in which we reload the command processor - 10482 ; is after a transient program execution. In this case, we let the current - 10483 ; directory lie where it may. - 10484 - 10485 00000154 09ED or bp,bp ; See if just read - 10486 00000156 7409 jz short TESTRDIR ; Not read, check user directory - 10487 00000158 36C706[D299]010D mov word [ss:UCOMBUF+1],0D01h ; Reset buffer - 10488 0000015F EB17 jmp short NOSETBUF - 10489 TESTRDIR: - 10490 00000161 803E[A102]00 cmp byte [RestDir],0 - 10491 00000166 7410 jz short NOSETBUF ; User directory OK - 10492 00000168 1E push ds - 10493 - 10494 ; We have an unusual situation to handle. The user *may* have changed his - 10495 ; directory as a result of an internal command that got aborted. Restoring it - 10496 ; twice may not help us: the problem may never go away. We just attempt it - 10497 ; once and give up. - 10498 - 10499 00000169 C606[A102]00 mov byte [RestDir],0 ; Flag users dirs OK - 10500 - 10501 ; Restore users directory - 10502 0000016E 0E push cs - 10503 0000016F 1F pop ds - 10504 00000170 BA[D79A] mov dx,USERDIR1 - 10505 00000173 B43B mov ah,3Bh - 10506 ;mov ah,CHDir ; 3Bh - 10507 00000175 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 10508 ; DS:DX -> ASCIZ directory name (may include drive) - 10509 00000177 1F pop ds - 10510 NOSETBUF: - 10511 00000178 803E[1403]00 cmp byte [PipeFiles],0 - 10512 0000017D 740A jz short NOPCLOSE ; Don't bother if they don't exist - 10513 0000017F 803E[1303]00 cmp byte [PipeFlag],0 - 10514 00000184 7503 jnz short NOPCLOSE ; Don't del if still piping - 10515 00000186 E8972F call PIPEDEL - 10516 NOPCLOSE: - 10517 ;mov byte [0BE9h],0 ; MSDOS 3.3 - 10518 ; 31/01/2023 - 10519 00000189 C606[9902]00 mov byte [ExtCom],0 ; Flag internal command - 10520 0000018E 8CC8 mov ax,cs ; Get segment we're in - 10521 00000190 8ED8 mov ds,ax - 10522 00000192 50 push ax - 10523 ; 07/06/2023 (INTERNATVARS addr = STACK addr) - 10524 00000193 BA[9EA5] mov dx,INTERNATVARS ; 0AF24h for MSDOS 6.22 COMMAND.COM - 10525 ; 09854h for MSDOS 5.0 COMMAND.COM - 10526 ; 25/07/2024 - 10527 ; 0AA2Dh for PCDOS 7.1 COMMAND.COM - 10528 00000196 B80038 mov ax,3800h - 10529 ;mov ax,INTERNATIONAL*256 ; 3800h - 10530 00000199 CD21 int 21h ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION - 10531 ; get current-country info - 10532 ; DS:DX -> buffer for returned info - 10533 0000019B 58 pop ax - 10534 0000019C 2B06[F79B] sub ax,[TPA] ; AX=size of TPA in paragraphs - 10535 000001A0 53 push bx - 10536 000001A1 BB1000 mov bx,16 - 10537 000001A4 F7E3 mul bx ; DX:AX=size of TPA in bytes - 10538 000001A6 5B pop bx - 10539 000001A7 09D2 or dx,dx ; See if over 64K - 10540 000001A9 7403 jz short SAVSIZ ; OK if not - 10541 000001AB B8FFFF mov ax,-1 ; If so, limit to 65535 bytes - 10542 SAVSIZ: - 10543 - 10544 ; AX is the number of bytes free in the buffer between the resident and the - 10545 ; transient with a maximum of 64K-1. We round this down to a multiple of 512. + 10449 ; We are not always sure of the state of the world at this time. We presume + 10450 ; worst case and initialize the relevant registers: segments and stack. + 10451 + 10452 COMMAND: + 10453 0000012E FC cld + 10454 0000012F 8CC8 mov ax,cs + 10455 00000131 FA cli + 10456 00000132 8ED0 mov ss,ax + 10457 ;mov sp,offset TRANGROUP:STACK + 10458 ; 07/06/2023 + 10459 00000134 BC[9EA5] mov sp,STACK ; 0AF24h for MSDOS 6.22 COMMAND.COM + 10460 ; 09854h for MSDOS 5.0 COMMAND.COM + 10461 ; 25/07/2024 + 10462 ; 0AA2Dh for PCDOS 7.1 COMMAND.COM + 10463 00000137 FB sti + 10464 + 10465 00000138 8EC0 mov es,ax + 10466 + 10467 ; MSDOS 6.0 + 10468 0000013A 8ED8 mov ds,ax ;AN000; set DS to transient + 10469 ;ASSUME ES:TRANGROUP,DS:TRANGROUP ;AC000; + 10470 ;invoke TSYSLOADMSG ;AN000; preload messages + 10471 ; 31/01/2023 + 10472 0000013C E8C653 call TSYSLOADMSG + 10473 0000013F C606[369F]00 mov byte [append_exec],0 ;AN041; set internal append state off + 10474 + 10475 ; MSDOS 3.3 (& MSDOS 6.0) + 10476 ;mov ds,[ss:RESSEG] + 10477 ; 31/01/2023 + 10478 00000144 8E1E[F59B] mov ds,[RESSEG] + 10479 00000148 36C606[D199]80 mov byte [ss:UCOMBUF],128 ; Init UCOMBUF + 10480 0000014E 36C606[549A]80 mov byte [ss:COMBUF],128 ; Init COMBUF (Autoexec doing DATE) + 10481 + 10482 ; If we have just loaded the transient, then we do NOT need to initialize the + 10483 ; command buffer. ???? DO WE NEED TO RESTORE THE USERS DIRECTORY ???? + 10484 ; I guess not: the only circumstances in which we reload the command processor + 10485 ; is after a transient program execution. In this case, we let the current + 10486 ; directory lie where it may. + 10487 + 10488 00000154 09ED or bp,bp ; See if just read + 10489 00000156 7409 jz short TESTRDIR ; Not read, check user directory + 10490 00000158 36C706[D299]010D mov word [ss:UCOMBUF+1],0D01h ; Reset buffer + 10491 0000015F EB17 jmp short NOSETBUF + 10492 TESTRDIR: + 10493 00000161 803E[A102]00 cmp byte [RestDir],0 + 10494 00000166 7410 jz short NOSETBUF ; User directory OK + 10495 00000168 1E push ds + 10496 + 10497 ; We have an unusual situation to handle. The user *may* have changed his + 10498 ; directory as a result of an internal command that got aborted. Restoring it + 10499 ; twice may not help us: the problem may never go away. We just attempt it + 10500 ; once and give up. + 10501 + 10502 00000169 C606[A102]00 mov byte [RestDir],0 ; Flag users dirs OK + 10503 + 10504 ; Restore users directory + 10505 0000016E 0E push cs + 10506 0000016F 1F pop ds + 10507 00000170 BA[D79A] mov dx,USERDIR1 + 10508 00000173 B43B mov ah,3Bh + 10509 ;mov ah,CHDir ; 3Bh + 10510 00000175 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 10511 ; DS:DX -> ASCIZ directory name (may include drive) + 10512 00000177 1F pop ds + 10513 NOSETBUF: + 10514 00000178 803E[1403]00 cmp byte [PipeFiles],0 + 10515 0000017D 740A jz short NOPCLOSE ; Don't bother if they don't exist + 10516 0000017F 803E[1303]00 cmp byte [PipeFlag],0 + 10517 00000184 7503 jnz short NOPCLOSE ; Don't del if still piping + 10518 00000186 E8972F call PIPEDEL + 10519 NOPCLOSE: + 10520 ;mov byte [0BE9h],0 ; MSDOS 3.3 + 10521 ; 31/01/2023 + 10522 00000189 C606[9902]00 mov byte [ExtCom],0 ; Flag internal command + 10523 0000018E 8CC8 mov ax,cs ; Get segment we're in + 10524 00000190 8ED8 mov ds,ax + 10525 00000192 50 push ax + 10526 ; 07/06/2023 (INTERNATVARS addr = STACK addr) + 10527 00000193 BA[9EA5] mov dx,INTERNATVARS ; 0AF24h for MSDOS 6.22 COMMAND.COM + 10528 ; 09854h for MSDOS 5.0 COMMAND.COM + 10529 ; 25/07/2024 + 10530 ; 0AA2Dh for PCDOS 7.1 COMMAND.COM + 10531 00000196 B80038 mov ax,3800h + 10532 ;mov ax,INTERNATIONAL*256 ; 3800h + 10533 00000199 CD21 int 21h ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION + 10534 ; get current-country info + 10535 ; DS:DX -> buffer for returned info + 10536 0000019B 58 pop ax + 10537 0000019C 2B06[F79B] sub ax,[TPA] ; AX=size of TPA in paragraphs + 10538 000001A0 53 push bx + 10539 000001A1 BB1000 mov bx,16 + 10540 000001A4 F7E3 mul bx ; DX:AX=size of TPA in bytes + 10541 000001A6 5B pop bx + 10542 000001A7 09D2 or dx,dx ; See if over 64K + 10543 000001A9 7403 jz short SAVSIZ ; OK if not + 10544 000001AB B8FFFF mov ax,-1 ; If so, limit to 65535 bytes + 10545 SAVSIZ: 10546 - 10547 000001AE 3D0002 cmp ax,512 - 10548 000001B1 7603 jbe short GOTSIZE - 10549 ;and ax,~1FFh - 10550 000001B3 2500FE and ax,0FE00h ; NOT 511 = NOT 1FF - 10551 GOTSIZE: - 10552 000001B6 A3[159C] mov [BYTCNT],ax ; Max no. of bytes that can be buffered - 10553 000001B9 8E1E[F59B] mov ds,[RESSEG] ; All batch work must use resident seg. - 10554 - 10555 000001BD F606[9D02]01 test byte [EchoFlag],1 - 10556 000001C2 741E jz short GETCOM ; Don't do the CRLF - 10557 000001C4 E8382F call SINGLETEST - 10558 000001C7 7219 jb short GETCOM - 10559 000001C9 F606[1303]FF test byte [PipeFlag],0FFh ; -1 - 10560 000001CE 7512 jnz short GETCOM - 10561 ; G Don't print prompt in FOR - 10562 000001D0 F606[AB02]FF test byte [ForFlag],0FFh ; -1 - 10563 000001D5 750B jnz short GETCOM - 10564 ; G Don't print prompt if in batch - 10565 000001D7 F706[4902]FFFF test word [Batch],0FFFFh ; -1 - 10566 000001DD 7503 jnz short GETCOM - 10567 000001DF E89727 call CRLF2 - 10568 - 10569 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10570 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:01E0h - 10571 GETCOM: - 10572 000001E2 833E[A502]00 cmp word [SingleCom],0 - 10573 000001E7 750D jnz short GETCOM2 - 10574 000001E9 F706[4902]FFFF test word [Batch],0FFFFh - 10575 000001EF 7505 jnz short GETCOM2 - 10576 000001F1 8026[5A04]EF and byte [Y_Flag],0EFh ; Y/N question overwrite flag ; ~10h - 10577 - 10578 ;GETCOM: ; MSDOS 5.0 COMMAND.COM - 10579 GETCOM2: - 10580 000001F6 C606[B002]00 mov byte [Call_Flag],0 ; G Reset call flags - 10581 000001FB C606[B102]00 mov byte [Call_Batch_Flag],0 - 10582 00000200 B419 mov ah,19h - 10583 ;mov ah,GET_DEFAULT_DRIVE ; 19h - 10584 00000202 CD21 int 21h ; DOS - GET DEFAULT DISK NUMBER - 10585 00000204 36A2[079C] mov [ss:CURDRV],al - 10586 00000208 F606[1303]FF test byte [PipeFlag],0FFh ; -1 ; Pipe has highest presedence - 10587 0000020D 7403 jz short NOPIPE - 10588 0000020F E9DF2F jmp PIPEPROC ; Continue the pipeline - 10589 NOPIPE: - 10590 00000212 F606[9D02]01 test byte [EchoFlag],1 - 10591 00000217 7417 jz short NOPDRV ; No prompt if echo off - 10592 00000219 E8E32E call SINGLETEST - 10593 0000021C 7212 jb short NOPDRV - 10594 0000021E F606[AB02]FF test byte [ForFlag],0FFh ; G Don't print prompt in FOR - 10595 00000223 750B jnz short NOPDRV - 10596 00000225 F706[4902]FFFF test word [Batch],0FFFFh ; G Don't print prompt if in batch - 10597 0000022B 750D jnz short TESTFORBAT - 10598 0000022D E8C01E call PRINT_PROMPT ; Prompt the user - 10599 NOPDRV: - 10600 00000230 F606[AB02]FF test byte [ForFlag],0FFh ; FOR has next highest precedence - 10601 00000235 7403 jz short TESTFORBAT - 10602 00000237 E9BD0C jmp FORPROC ; Continue the FOR - 10603 - 10604 TESTFORBAT: - 10605 0000023A 36C606[A09B]00 mov byte [ss:RE_INSTR],0 ; Turn redirection back off - 10606 00000240 C606[C202]00 mov byte [Re_OutStr],0 ; [0C09h] for MSDOS 3.3 - 10607 00000245 C606[C102]00 mov byte [Re_Out_App],0 ; [0C08h] for MSDOS 3.3 - 10608 0000024A C606[AA02]00 mov byte [IfFlag],0 ; no more ifs... - 10609 0000024F F706[4902]FFFF test word [Batch],0FFFFh ; Batch has lowest precedence - 10610 00000255 7441 jz short ISNOBAT - 10611 - 10612 ; 31/01/2023 - 10613 - 10614 ; MSDOS 6.0 - 10615 - 10616 ; Bugbug: MULT_SHELL_GET no longer used? - 10617 - 10618 00000257 06 push es ;AN000; save ES - 10619 00000258 1E push ds ;AN000; save DS - 10620 ;mov ax,mult_shell_get ;AN000; check to see if SHELL has command - 10621 ; 05/02/2023 - 10622 00000259 B80219 mov ax,1902h - 10623 0000025C 8E06[4902] mov es,[Batch] ;AN000; get batch segment - 10624 ;mov di,20h - 10625 00000260 BF2000 mov di,BATCHSEGMENT.BatFile ;AN000; get batch file name - 10626 00000263 0E push cs ;AN000; get local segment to DS - 10627 00000264 1F pop ds ;AN000; - 10628 ;mov dx,offset trangroup:combuf ;AN000; pass communications buffer - 10629 00000265 BA[549A] mov dx,COMBUF - 10630 00000268 CD2F int 2Fh ;AN000; call the shell - 10631 ; - Multiplex - DOS 4.x only SHELLB.COM - COMMAND.COM INTERFACE - 10632 ; ES:DI -> ASCIZ full filename of current batch file, with at least the - 10633 ; final filename element uppercased - 10634 ; DS:DX -> buffer for results - 10635 ;cmp al,0FFh - 10636 0000026A 3CFF cmp al,shell_action ;AN000; does shell have a commmand? - 10637 0000026C 1F pop ds ;AN000; restore DS - 10638 0000026D 07 pop es ;AN000; restore ES - 10639 0000026E 7424 jz short JDOCOM1 ;AN000; yes - go process command - 10640 - 10641 ; MSDOS 3.3 (& MSDOS 6.0) - 10642 00000270 1E push ds - 10643 00000271 E80E04 call READBAT ; Continue BATCH - 10644 00000274 1F pop ds - 10645 00000275 C606[B402]00 mov byte [NullFlag],0 ;G reset no command flag - 10646 0000027A F706[4902]FFFF test word [Batch],0FFFFh - 10647 00000280 7512 jnz short JDOCOM1 ;G if batch still in progress continue - 10648 00000282 8B1E[B202] mov bx,[Next_Batch] - 10649 ; 31/01/2023 - 10650 00000286 09DB or bx,bx - 10651 ;cmp bx,0 ;G see if there is a new batch file - 10652 00000288 740A jz short JDOCOM1 ;G no - go do command - 10653 0000028A 891E[4902] mov [Batch],bx ;G get segment of next batch file - 10654 0000028E C706[B202]0000 mov word [Next_Batch],0 ;G reset next batch - 10655 JDOCOM1: - 10656 00000294 0E push cs - 10657 00000295 1F pop ds - 10658 ;jmp short DOCOM1 - 10659 ; 07/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 10660 00000296 EB5D jmp short DOCOM0 - 10661 ISNOBAT: - 10662 00000298 833E[A502]00 cmp word [SingleCom],0 - 10663 0000029D 741D jz short REGCOM - 10664 ; 07/06/2023 - MSDOS 6.22 COMMAND.COM - 10665 0000029F 8B36[A302] mov si,[SemiPermCom] ; MSDOS 6.0 - 10666 ;mov si,0FFFFh ; MSDOS 3.3 & MSDOS 5.0 - 10667 000002A3 8736[A502] xchg si,[SingleCom] - 10668 000002A7 BF[569A] mov di,COMBUF+2 - 10669 000002AA 31C9 xor cx,cx - 10670 SINGLELOOP: - 10671 000002AC AC lodsb - 10672 000002AD AA stosb - 10673 000002AE 41 inc cx - 10674 000002AF 3C0D cmp al,0Dh - 10675 000002B1 75F9 jnz short SINGLELOOP - 10676 000002B3 49 dec cx - 10677 000002B4 0E push cs - 10678 000002B5 1F pop ds - 10679 000002B6 880E[559A] mov [COMBUF+1],cl - 10680 - 10681 ; do NOT issue a trailing CRLF... - 10682 - 10683 ;jmp short DOCOM1 - 10684 ; 07/06/2023 - 10685 ; MSDOS 6.22 COMMAND.COM - 10686 000002BA EB39 jmp short DOCOM0 - 10687 - 10688 ;nop - 10689 - 10690 ; 31/01/2023 - Retro DOS v4.0 COMMAND.COM - 10691 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:02A6h + 10547 ; AX is the number of bytes free in the buffer between the resident and the + 10548 ; transient with a maximum of 64K-1. We round this down to a multiple of 512. + 10549 + 10550 000001AE 3D0002 cmp ax,512 + 10551 000001B1 7603 jbe short GOTSIZE + 10552 ;and ax,~1FFh + 10553 000001B3 2500FE and ax,0FE00h ; NOT 511 = NOT 1FF + 10554 GOTSIZE: + 10555 000001B6 A3[159C] mov [BYTCNT],ax ; Max no. of bytes that can be buffered + 10556 000001B9 8E1E[F59B] mov ds,[RESSEG] ; All batch work must use resident seg. + 10557 + 10558 000001BD F606[9D02]01 test byte [EchoFlag],1 + 10559 000001C2 741E jz short GETCOM ; Don't do the CRLF + 10560 000001C4 E8382F call SINGLETEST + 10561 000001C7 7219 jb short GETCOM + 10562 000001C9 F606[1303]FF test byte [PipeFlag],0FFh ; -1 + 10563 000001CE 7512 jnz short GETCOM + 10564 ; G Don't print prompt in FOR + 10565 000001D0 F606[AB02]FF test byte [ForFlag],0FFh ; -1 + 10566 000001D5 750B jnz short GETCOM + 10567 ; G Don't print prompt if in batch + 10568 000001D7 F706[4902]FFFF test word [Batch],0FFFFh ; -1 + 10569 000001DD 7503 jnz short GETCOM + 10570 000001DF E89727 call CRLF2 + 10571 + 10572 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10573 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:01E0h + 10574 GETCOM: + 10575 000001E2 833E[A502]00 cmp word [SingleCom],0 + 10576 000001E7 750D jnz short GETCOM2 + 10577 000001E9 F706[4902]FFFF test word [Batch],0FFFFh + 10578 000001EF 7505 jnz short GETCOM2 + 10579 000001F1 8026[5A04]EF and byte [Y_Flag],0EFh ; Y/N question overwrite flag ; ~10h + 10580 + 10581 ;GETCOM: ; MSDOS 5.0 COMMAND.COM + 10582 GETCOM2: + 10583 000001F6 C606[B002]00 mov byte [Call_Flag],0 ; G Reset call flags + 10584 000001FB C606[B102]00 mov byte [Call_Batch_Flag],0 + 10585 00000200 B419 mov ah,19h + 10586 ;mov ah,GET_DEFAULT_DRIVE ; 19h + 10587 00000202 CD21 int 21h ; DOS - GET DEFAULT DISK NUMBER + 10588 00000204 36A2[079C] mov [ss:CURDRV],al + 10589 00000208 F606[1303]FF test byte [PipeFlag],0FFh ; -1 ; Pipe has highest presedence + 10590 0000020D 7403 jz short NOPIPE + 10591 0000020F E9DF2F jmp PIPEPROC ; Continue the pipeline + 10592 NOPIPE: + 10593 00000212 F606[9D02]01 test byte [EchoFlag],1 + 10594 00000217 7417 jz short NOPDRV ; No prompt if echo off + 10595 00000219 E8E32E call SINGLETEST + 10596 0000021C 7212 jb short NOPDRV + 10597 0000021E F606[AB02]FF test byte [ForFlag],0FFh ; G Don't print prompt in FOR + 10598 00000223 750B jnz short NOPDRV + 10599 00000225 F706[4902]FFFF test word [Batch],0FFFFh ; G Don't print prompt if in batch + 10600 0000022B 750D jnz short TESTFORBAT + 10601 0000022D E8C01E call PRINT_PROMPT ; Prompt the user + 10602 NOPDRV: + 10603 00000230 F606[AB02]FF test byte [ForFlag],0FFh ; FOR has next highest precedence + 10604 00000235 7403 jz short TESTFORBAT + 10605 00000237 E9BD0C jmp FORPROC ; Continue the FOR + 10606 + 10607 TESTFORBAT: + 10608 0000023A 36C606[A09B]00 mov byte [ss:RE_INSTR],0 ; Turn redirection back off + 10609 00000240 C606[C202]00 mov byte [Re_OutStr],0 ; [0C09h] for MSDOS 3.3 + 10610 00000245 C606[C102]00 mov byte [Re_Out_App],0 ; [0C08h] for MSDOS 3.3 + 10611 0000024A C606[AA02]00 mov byte [IfFlag],0 ; no more ifs... + 10612 0000024F F706[4902]FFFF test word [Batch],0FFFFh ; Batch has lowest precedence + 10613 00000255 7441 jz short ISNOBAT + 10614 + 10615 ; 31/01/2023 + 10616 + 10617 ; MSDOS 6.0 + 10618 + 10619 ; Bugbug: MULT_SHELL_GET no longer used? + 10620 + 10621 00000257 06 push es ;AN000; save ES + 10622 00000258 1E push ds ;AN000; save DS + 10623 ;mov ax,mult_shell_get ;AN000; check to see if SHELL has command + 10624 ; 05/02/2023 + 10625 00000259 B80219 mov ax,1902h + 10626 0000025C 8E06[4902] mov es,[Batch] ;AN000; get batch segment + 10627 ;mov di,20h + 10628 00000260 BF2000 mov di,BATCHSEGMENT.BatFile ;AN000; get batch file name + 10629 00000263 0E push cs ;AN000; get local segment to DS + 10630 00000264 1F pop ds ;AN000; + 10631 ;mov dx,offset trangroup:combuf ;AN000; pass communications buffer + 10632 00000265 BA[549A] mov dx,COMBUF + 10633 00000268 CD2F int 2Fh ;AN000; call the shell + 10634 ; - Multiplex - DOS 4.x only SHELLB.COM - COMMAND.COM INTERFACE + 10635 ; ES:DI -> ASCIZ full filename of current batch file, with at least the + 10636 ; final filename element uppercased + 10637 ; DS:DX -> buffer for results + 10638 ;cmp al,0FFh + 10639 0000026A 3CFF cmp al,shell_action ;AN000; does shell have a commmand? + 10640 0000026C 1F pop ds ;AN000; restore DS + 10641 0000026D 07 pop es ;AN000; restore ES + 10642 0000026E 7424 jz short JDOCOM1 ;AN000; yes - go process command + 10643 + 10644 ; MSDOS 3.3 (& MSDOS 6.0) + 10645 00000270 1E push ds + 10646 00000271 E80E04 call READBAT ; Continue BATCH + 10647 00000274 1F pop ds + 10648 00000275 C606[B402]00 mov byte [NullFlag],0 ;G reset no command flag + 10649 0000027A F706[4902]FFFF test word [Batch],0FFFFh + 10650 00000280 7512 jnz short JDOCOM1 ;G if batch still in progress continue + 10651 00000282 8B1E[B202] mov bx,[Next_Batch] + 10652 ; 31/01/2023 + 10653 00000286 09DB or bx,bx + 10654 ;cmp bx,0 ;G see if there is a new batch file + 10655 00000288 740A jz short JDOCOM1 ;G no - go do command + 10656 0000028A 891E[4902] mov [Batch],bx ;G get segment of next batch file + 10657 0000028E C706[B202]0000 mov word [Next_Batch],0 ;G reset next batch + 10658 JDOCOM1: + 10659 00000294 0E push cs + 10660 00000295 1F pop ds + 10661 ;jmp short DOCOM1 + 10662 ; 07/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 10663 00000296 EB5D jmp short DOCOM0 + 10664 ISNOBAT: + 10665 00000298 833E[A502]00 cmp word [SingleCom],0 + 10666 0000029D 741D jz short REGCOM + 10667 ; 07/06/2023 - MSDOS 6.22 COMMAND.COM + 10668 0000029F 8B36[A302] mov si,[SemiPermCom] ; MSDOS 6.0 + 10669 ;mov si,0FFFFh ; MSDOS 3.3 & MSDOS 5.0 + 10670 000002A3 8736[A502] xchg si,[SingleCom] + 10671 000002A7 BF[569A] mov di,COMBUF+2 + 10672 000002AA 31C9 xor cx,cx + 10673 SINGLELOOP: + 10674 000002AC AC lodsb + 10675 000002AD AA stosb + 10676 000002AE 41 inc cx + 10677 000002AF 3C0D cmp al,0Dh + 10678 000002B1 75F9 jnz short SINGLELOOP + 10679 000002B3 49 dec cx + 10680 000002B4 0E push cs + 10681 000002B5 1F pop ds + 10682 000002B6 880E[559A] mov [COMBUF+1],cl + 10683 + 10684 ; do NOT issue a trailing CRLF... + 10685 + 10686 ;jmp short DOCOM1 + 10687 ; 07/06/2023 + 10688 ; MSDOS 6.22 COMMAND.COM + 10689 000002BA EB39 jmp short DOCOM0 + 10690 + 10691 ;nop 10692 - 10693 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10694 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:02BBh + 10693 ; 31/01/2023 - Retro DOS v4.0 COMMAND.COM + 10694 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:02A6h 10695 - 10696 ; We have a normal command. - 10697 ; Printers are a bizarre quantity. Sometimes they are a stream and - 10698 ; sometimes they aren't. At this point, we automatically close all spool - 10699 ; files and turn on truncation mode. - 10700 - 10701 REGCOM: - 10702 ;mov ax,(ServerCall shl 8) + 9 - 10703 ; 31/01/2023 - 10704 000002BC B8095D mov ax,5D09h - 10705 ;mov ax,(SERVERCALL<<8)+9 - 10706 000002BF CD21 int 21h ; DOS - 3.1+ internal - FLUSH REDIRECTED PRINTER OUTPUT - 10707 ;mov ax,(ServerCall shl 8) + 8 - 10708 000002C1 B8085D mov ax,5D08h - 10709 ;mov ax,(SERVERCALL<<8)+8 - 10710 000002C4 B201 mov dl,1 - 10711 000002C6 CD21 int 21h ; DOS - 3.1+ internal - SET REDIRECTED PRINTER MODE - 10712 ; DL = 00h redirected output is combined - 10713 ; 01h redirected output placed in separate jobs - 10714 ; start new print job now - 10715 000002C8 0E push cs - 10716 000002C9 1F pop ds ; Need local segment to point to buffer - 10717 000002CA BA[D199] mov dx,UCOMBUF - 10718 - 10719 ; MSDOS 6.0 - 10720 ; Try to read interactive command line via DOSKey. - 10721 ; If that fails, use DOS Buffered Keyboard Input. - 10722 - 10723 ; 31/01/2023 - 10724 000002CD B81048 mov ax,4810h ; AX = DOSKey Read Line function - 10725 000002D0 CD2F int 2Fh - 10726 000002D2 09C0 or ax,ax - 10727 000002D4 7404 jz short GOTCOM ; DOSKey gave us a command line - 10728 - 10729 000002D6 B40A mov ah,0Ah - 10730 ;mov ah,Std_Con_String_Input ; AH = DOS Buffered Keyboard Input - 10731 000002D8 CD21 int 21h ; DOS - BUFFERED KEYBOARD INPUT - 10732 ; DS:DX -> buffer - 10733 GOTCOM: - 10734 000002DA 8A0E[D199] mov cl,[UCOMBUF] - 10735 000002DE 30ED xor ch,ch - 10736 000002E0 83C103 add cx,3 - 10737 000002E3 BE[D199] mov si,UCOMBUF - 10738 000002E6 BF[549A] mov di,COMBUF - 10739 000002E9 F3A4 rep movsb ; Transfer it to the cooked buffer - 10740 - 10741 ; ------------- - 10742 - 10743 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10744 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:02EDh + 10696 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10697 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:02BBh + 10698 + 10699 ; We have a normal command. + 10700 ; Printers are a bizarre quantity. Sometimes they are a stream and + 10701 ; sometimes they aren't. At this point, we automatically close all spool + 10702 ; files and turn on truncation mode. + 10703 + 10704 REGCOM: + 10705 ;mov ax,(ServerCall shl 8) + 9 + 10706 ; 31/01/2023 + 10707 000002BC B8095D mov ax,5D09h + 10708 ;mov ax,(SERVERCALL<<8)+9 + 10709 000002BF CD21 int 21h ; DOS - 3.1+ internal - FLUSH REDIRECTED PRINTER OUTPUT + 10710 ;mov ax,(ServerCall shl 8) + 8 + 10711 000002C1 B8085D mov ax,5D08h + 10712 ;mov ax,(SERVERCALL<<8)+8 + 10713 000002C4 B201 mov dl,1 + 10714 000002C6 CD21 int 21h ; DOS - 3.1+ internal - SET REDIRECTED PRINTER MODE + 10715 ; DL = 00h redirected output is combined + 10716 ; 01h redirected output placed in separate jobs + 10717 ; start new print job now + 10718 000002C8 0E push cs + 10719 000002C9 1F pop ds ; Need local segment to point to buffer + 10720 000002CA BA[D199] mov dx,UCOMBUF + 10721 + 10722 ; MSDOS 6.0 + 10723 ; Try to read interactive command line via DOSKey. + 10724 ; If that fails, use DOS Buffered Keyboard Input. + 10725 + 10726 ; 31/01/2023 + 10727 000002CD B81048 mov ax,4810h ; AX = DOSKey Read Line function + 10728 000002D0 CD2F int 2Fh + 10729 000002D2 09C0 or ax,ax + 10730 000002D4 7404 jz short GOTCOM ; DOSKey gave us a command line + 10731 + 10732 000002D6 B40A mov ah,0Ah + 10733 ;mov ah,Std_Con_String_Input ; AH = DOS Buffered Keyboard Input + 10734 000002D8 CD21 int 21h ; DOS - BUFFERED KEYBOARD INPUT + 10735 ; DS:DX -> buffer + 10736 GOTCOM: + 10737 000002DA 8A0E[D199] mov cl,[UCOMBUF] + 10738 000002DE 30ED xor ch,ch + 10739 000002E0 83C103 add cx,3 + 10740 000002E3 BE[D199] mov si,UCOMBUF + 10741 000002E6 BF[549A] mov di,COMBUF + 10742 000002E9 F3A4 rep movsb ; Transfer it to the cooked buffer + 10743 + 10744 ; ------------- 10745 - 10746 000002EB E88B26 call CRLF2 - 10747 000002EE 31C0 xor ax,ax - 10748 000002F0 EB06 jmp short DOCOM2 - 10749 ; ------------- - 10750 - 10751 DOCOM: - 10752 000002F2 E88426 call CRLF2 + 10746 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10747 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:02EDh + 10748 + 10749 000002EB E88B26 call CRLF2 + 10750 000002EE 31C0 xor ax,ax + 10751 000002F0 EB06 jmp short DOCOM2 + 10752 ; ------------- 10753 - 10754 ; ------------- - 10755 - 10756 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10757 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:02F4h + 10754 DOCOM: + 10755 000002F2 E88426 call CRLF2 + 10756 + 10757 ; ------------- 10758 - 10759 - 10760 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 10761 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:02F6h - 10762 DOCOM0: - 10763 000002F5 B80100 mov ax,1 - 10764 DOCOM2: - 10765 000002F8 1E push ds - 10766 000002F9 8E1E[F59B] mov ds,[RESSEG] - 10767 000002FD A3[FD01] mov [cox_Y_option],ax - 10768 00000300 1F pop ds - 10769 00000301 BE[549A] mov si,COMBUF - 10770 00000304 8A4C01 mov cl,[si+1] - 10771 00000307 30ED xor ch,ch - 10772 00000309 83C602 add si,2 - 10773 0000030C E82501 call get_cox_y_n_opt - 10774 0000030F 7303 jnc short DOCOM1 ; YES answer - 10775 ; 07/06/2023 - 10776 NULLCOMJ: - 10777 00000311 E90201 jmp NULLCOM ; NO answer - 10778 ; ------------- - 10779 - 10780 ; MSDOS 5.0 & MSDOS 6.0 COMMAND.COM - 10781 DOCOM1: - 10782 00000314 E8662A call PRESCAN ; Cook the input buffer - 10783 00000317 7403 jz short NOPIPEPROC - 10784 00000319 E9502E jmp PIPEPROCSTRT ; Fire up the pipe - 10785 - 10786 ; 07/06/2023 - 10787 ;NULLCOMJ: - 10788 ;jmp NULLCOM - 10789 - 10790 NOPIPEPROC: - 10791 0000031C E85831 call PARSELINE - 10792 0000031F 730B jnb short OKPARSE ; user error? or maybe we goofed? - 10793 BADPARSE: - 10794 00000321 0E push cs - 10795 00000322 1F pop ds - 10796 00000323 BA[FA8F] mov dx,BADNAM_PTR ; 31/01/2023 - 10797 00000326 E8F750 call std_eprintf - 10798 00000329 E9D8FD jmp TCOMMAND - 10799 - 10800 OKPARSE: - 10801 ;test byte [ARGV0_ARG_FLAGS],2 - 10802 ;test byte [ARG+ARGV_ELE.argflags],2 ; wildcard - 10803 ; 01/02/2023 - 10804 0000032C F606[529F]02 test byte [ARG+ARGV_ELE.argflags],2 - 10805 00000331 75EE jnz short BADPARSE ; ambiguous commands not allowed - 10806 ;cmp word [ARG_ARGVCNT],0 ; there WAS a command, wasn't there? - 10807 00000333 833E[10A2]00 cmp word [ARG+ARG_UNIT.argvcnt],0 - 10808 00000338 74D7 jz short NULLCOMJ - 10809 ;cmp word [ARGV0_ARGLEN],0 ; probably an unnecessary check... - 10810 0000033A 833E[559F]00 cmp word [ARG+ARGV_ELE.arglen],0 - 10811 0000033F 74D0 jz short NULLCOMJ ; guarantees argv[0] at least x - 10812 - 10813 00000341 BE[569A] mov si,COMBUF+2 - 10814 00000344 BF[BA9C] mov di,IDLEN - 10815 ;;mov ax,(Parse_File_Descriptor shl 8) or 01h - 10816 ; Make FCB with blank scan-off - 10817 ;mov ax,(Parse_File_Descriptor<<8)|01h - 10818 00000347 B80129 mov ax,2901h - 10819 0000034A CD21 int 21h ; DOS - PARSE FILENAME - 10820 ; DS:SI -> string to parse - 10821 ; ES:DI -> buffer to fill with unopened FCB - 10822 ; AL = bit mask to control parsing - 10823 ;mov bx,[ARG_ARGV] - 10824 0000034C 8B1E[509F] mov bx,[ARG+ARG_UNIT.argv] ; mov bx,[ARG] - 10825 00000350 807F013A cmp byte [bx+1],':' ; was a drive specified? - 10826 00000354 751B jne short DRVGD ; no, use default of zero... - 10827 00000356 8A17 mov dl,[bx] ; pick-up drive letter - 10828 ;mov dl,[bx+ARGV_ELE.argpointer] ; mov dl,[bx+0] - 10829 ;and dl,~20h - 10830 00000358 80E2DF and dl,0DFh ; uppercase the sucker - 10831 ;sub dl,[CAPITAL_A] ; convert it to a drive number, A=0 - 10832 ; 31/01/2023 - 10833 0000035B 80EA41 sub dl,'A' - 10834 0000035E 3CFF cmp al,-1 ; See what PARSE said about our drive letter. - 10835 00000360 740C je short DRVBADJ ; It was invalid. - 10836 ;mov di,[ARGV0_ARGSTARTEL] - 10837 00000362 8B3E[539F] mov di,[ARG+ARGV_ELE.argstartel] - 10838 00000366 803D00 cmp byte [di],0 ; is there actually a command there? - 10839 00000369 7506 jne short DRVGD ; if not, we have: "d:", "d:\", "d:/" - 10840 0000036B E992FD jmp SETDRV ; and set drive to new drive spec - 10841 DRVBADJ: - 10842 0000036E E9B128 jmp DRVBAD - 10843 DRVGD: - 10844 00000371 8A05 mov al,[di] - 10845 00000373 A2[149C] mov [SPECDRV],al - 10846 00000376 B020 mov al,' ' - 10847 00000378 B90900 mov cx,9 - 10848 0000037B 47 inc di - 10849 0000037C F2AE repne scasb ; Count number of letters in command name - 10850 0000037E B008 mov al,8 - 10851 00000380 28C8 sub al,cl - 10852 00000382 A2[BA9C] mov [IDLEN],al ; IDLEN is truly the length - 10853 00000385 BF8100 mov di,81h - 10854 00000388 56 push si - 10855 00000389 BE[569A] mov si,COMBUF+2 ; Skip over all leading delims - 10856 0000038C E8F725 call scanoff - 10857 - 10858 ; 01/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 10859 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0356h + 10759 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10760 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:02F4h + 10761 + 10762 + 10763 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 10764 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:02F6h + 10765 DOCOM0: + 10766 000002F5 B80100 mov ax,1 + 10767 DOCOM2: + 10768 000002F8 1E push ds + 10769 000002F9 8E1E[F59B] mov ds,[RESSEG] + 10770 000002FD A3[FD01] mov [cox_Y_option],ax + 10771 00000300 1F pop ds + 10772 00000301 BE[549A] mov si,COMBUF + 10773 00000304 8A4C01 mov cl,[si+1] + 10774 00000307 30ED xor ch,ch + 10775 00000309 83C602 add si,2 + 10776 0000030C E82501 call get_cox_y_n_opt + 10777 0000030F 7303 jnc short DOCOM1 ; YES answer + 10778 ; 07/06/2023 + 10779 NULLCOMJ: + 10780 00000311 E90201 jmp NULLCOM ; NO answer + 10781 ; ------------- + 10782 + 10783 ; MSDOS 5.0 & MSDOS 6.0 COMMAND.COM + 10784 DOCOM1: + 10785 00000314 E8662A call PRESCAN ; Cook the input buffer + 10786 00000317 7403 jz short NOPIPEPROC + 10787 00000319 E9502E jmp PIPEPROCSTRT ; Fire up the pipe + 10788 + 10789 ; 07/06/2023 + 10790 ;NULLCOMJ: + 10791 ;jmp NULLCOM + 10792 + 10793 NOPIPEPROC: + 10794 0000031C E85831 call PARSELINE + 10795 0000031F 730B jnb short OKPARSE ; user error? or maybe we goofed? + 10796 BADPARSE: + 10797 00000321 0E push cs + 10798 00000322 1F pop ds + 10799 00000323 BA[FA8F] mov dx,BADNAM_PTR ; 31/01/2023 + 10800 00000326 E8F750 call std_eprintf + 10801 00000329 E9D8FD jmp TCOMMAND + 10802 + 10803 OKPARSE: + 10804 ;test byte [ARGV0_ARG_FLAGS],2 + 10805 ;test byte [ARG+ARGV_ELE.argflags],2 ; wildcard + 10806 ; 01/02/2023 + 10807 0000032C F606[529F]02 test byte [ARG+ARGV_ELE.argflags],2 + 10808 00000331 75EE jnz short BADPARSE ; ambiguous commands not allowed + 10809 ;cmp word [ARG_ARGVCNT],0 ; there WAS a command, wasn't there? + 10810 00000333 833E[10A2]00 cmp word [ARG+ARG_UNIT.argvcnt],0 + 10811 00000338 74D7 jz short NULLCOMJ + 10812 ;cmp word [ARGV0_ARGLEN],0 ; probably an unnecessary check... + 10813 0000033A 833E[559F]00 cmp word [ARG+ARGV_ELE.arglen],0 + 10814 0000033F 74D0 jz short NULLCOMJ ; guarantees argv[0] at least x + 10815 + 10816 00000341 BE[569A] mov si,COMBUF+2 + 10817 00000344 BF[BA9C] mov di,IDLEN + 10818 ;;mov ax,(Parse_File_Descriptor shl 8) or 01h + 10819 ; Make FCB with blank scan-off + 10820 ;mov ax,(Parse_File_Descriptor<<8)|01h + 10821 00000347 B80129 mov ax,2901h + 10822 0000034A CD21 int 21h ; DOS - PARSE FILENAME + 10823 ; DS:SI -> string to parse + 10824 ; ES:DI -> buffer to fill with unopened FCB + 10825 ; AL = bit mask to control parsing + 10826 ;mov bx,[ARG_ARGV] + 10827 0000034C 8B1E[509F] mov bx,[ARG+ARG_UNIT.argv] ; mov bx,[ARG] + 10828 00000350 807F013A cmp byte [bx+1],':' ; was a drive specified? + 10829 00000354 751B jne short DRVGD ; no, use default of zero... + 10830 00000356 8A17 mov dl,[bx] ; pick-up drive letter + 10831 ;mov dl,[bx+ARGV_ELE.argpointer] ; mov dl,[bx+0] + 10832 ;and dl,~20h + 10833 00000358 80E2DF and dl,0DFh ; uppercase the sucker + 10834 ;sub dl,[CAPITAL_A] ; convert it to a drive number, A=0 + 10835 ; 31/01/2023 + 10836 0000035B 80EA41 sub dl,'A' + 10837 0000035E 3CFF cmp al,-1 ; See what PARSE said about our drive letter. + 10838 00000360 740C je short DRVBADJ ; It was invalid. + 10839 ;mov di,[ARGV0_ARGSTARTEL] + 10840 00000362 8B3E[539F] mov di,[ARG+ARGV_ELE.argstartel] + 10841 00000366 803D00 cmp byte [di],0 ; is there actually a command there? + 10842 00000369 7506 jne short DRVGD ; if not, we have: "d:", "d:\", "d:/" + 10843 0000036B E992FD jmp SETDRV ; and set drive to new drive spec + 10844 DRVBADJ: + 10845 0000036E E9B128 jmp DRVBAD + 10846 DRVGD: + 10847 00000371 8A05 mov al,[di] + 10848 00000373 A2[149C] mov [SPECDRV],al + 10849 00000376 B020 mov al,' ' + 10850 00000378 B90900 mov cx,9 + 10851 0000037B 47 inc di + 10852 0000037C F2AE repne scasb ; Count number of letters in command name + 10853 0000037E B008 mov al,8 + 10854 00000380 28C8 sub al,cl + 10855 00000382 A2[BA9C] mov [IDLEN],al ; IDLEN is truly the length + 10856 00000385 BF8100 mov di,81h + 10857 00000388 56 push si + 10858 00000389 BE[569A] mov si,COMBUF+2 ; Skip over all leading delims + 10859 0000038C E8F725 call scanoff 10860 - 10861 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10862 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0391h + 10861 ; 01/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 10862 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0356h 10863 - 10864 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 10865 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0393h + 10864 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10865 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0391h 10866 - 10867 ; MSDOS 6.0 - 10868 ;SR; - 10869 ; We are going to skip over the first char always. The logic is that the - 10870 ;command tail can never start from the first character. The code below is - 10871 ;trying to figure out the command tail and copy it to the command line - 10872 ;buffer in the PSP. However, if the first character happens to be a switch - 10873 ;character and the user given command line is a full 128 bytes, we try to - 10874 ;copy 128 bytes to the PSP while it can take only 127 chars. This extra - 10875 ;char overwrites the code and leads to a crash on future commands. - 10876 - 10877 0000038F 46 inc si ; MSDOS 6.0 - 10878 - 10879 DO_SKIPCOM: - 10880 00000390 AC lodsb ; move command line pointer over - 10881 00000391 E8FA25 call DELIM ; pathname -- have to do it ourselves - 10882 00000394 740A jz short DO_SKIPPED ; 'cause parse_file_descriptor is dumb - 10883 00000396 3C0D cmp al,0Dh ; can't always depend on argv[0].arglen - 10884 00000398 7406 jz short DO_SKIPPED ; to be the same length as the user- - 10885 0000039A 3A06[F99B] cmp al,[SWITCHAR] ; specified command string - 10886 0000039E 75F0 jnz short DO_SKIPCOM - 10887 DO_SKIPPED: - 10888 000003A0 4E dec si - 10889 000003A1 31C9 xor cx,cx - 10890 COMTAIL: - 10891 000003A3 AC lodsb - 10892 000003A4 AA stosb ; Move command tail to 80h - 10893 000003A5 3C0D cmp al,0Dh - 10894 000003A7 E0FA loopne COMTAIL - 10895 000003A9 4F dec di - 10896 000003AA 89FD mov bp,di - 10897 000003AC F6D1 not cl - 10898 000003AE 880E8000 mov [80h],cl - 10899 000003B2 5E pop si - 10900 ;----- - 10901 ; Some of these comments are sadly at odds with this brave new code. - 10902 ;----- - 10903 ; If the command has 0 parameters must check here for - 10904 ; any switches that might be present. - 10905 ; SI -> first character after the command. - 10906 - 10907 ;mov di,arg.argv[0].argsw_word - 10908 ;mov di,[ARGV0_ARGSW_WORD] - 10909 000003B3 8B3E[579F] mov di,[ARG+ARGV_ELE.argsw_word] - 10910 000003B7 893E[0B9C] mov [COMSW],di ; ah yes, the old addressing mode problem... - 10911 ;mov SI,arg.argv[1 * SIZE argv_ele].argpointer - 10912 ; s = argv[1]; - 10913 ;mov si,[ARGV1_ARGPOINTER] - 10914 000003BB 8B36[5B9F] mov si,[ARG+ARGV_ELE.SIZE+ARGV_ELE.argpointer] - 10915 000003BF 09F6 or si,si ; if (s == NULL) - 10916 000003C1 7502 jnz short DOPARSE ; s = bp; (buffer end) - 10917 000003C3 89EE mov si,bp - 10918 DOPARSE: - 10919 000003C5 BF5C00 mov di,FCB ; 5Ch - 10920 ;mov ax,(Parse_File_Descriptor shl 8) or 01h - 10921 ; 01/02/2023 - 10922 000003C8 B80129 mov ax,2901h - 10923 ;mov ax,(Parse_File_Descriptor<<8)|01h - 10924 000003CB CD21 int 21h ; DOS - PARSE FILENAME - 10925 ; DS:SI -> string to parse - 10926 ; ES:DI -> buffer to fill with unopened FCB - 10927 ; AL = bit mask to control parsing - 10928 000003CD A2[089C] mov [PARM1],al ; Save result of parse - 10929 ;mov di,arg.argv[1*SIZE argv_ele].argsw_word - 10930 ;mov di,[ARGV1_ARGSW_WORD] - 10931 000003D0 8B3E[629F] mov di,[ARG+ARGV_ELE.SIZE+ARGV_ELE.argsw_word] - 10932 000003D4 893E[0D9C] mov [ARG1S],di - 10933 ;mov si,arg.argv[2*SIZE argv_ele].argpointer - 10934 ; s = argv[2]; - 10935 ;mov si,[ARGV2_ARGPOINTER] - 10936 000003D8 8B36[669F] mov si,[ARG+(2*ARGV_ELE.SIZE)+ARGV_ELE.argpointer] - 10937 000003DC 09F6 or si,si ; if (s == NULL) - 10938 000003DE 7502 jnz short DOPARSE2 - 10939 000003E0 89EE mov si,bp ; s = bp; (buffer end) - 10940 DOPARSE2: - 10941 000003E2 BF6C00 mov di,FCB+10h ; 6Ch - 10942 ;;mov ax,(Parse_File_Descriptor shl 8) or 01h - 10943 000003E5 B80129 mov ax,2901h - 10944 ;mov ax,(Parse_File_Descriptor<<8)|01h - 10945 000003E8 CD21 int 21h ; DOS - PARSE FILENAME - 10946 ; DS:SI -> string to parse - 10947 ; ES:DI -> buffer to fill with unopened FCB - 10948 ; AL = bit mask to control parsing - 10949 000003EA A2[0A9C] mov [PARM2],al ; Save result - 10950 ;mov di,[ARGV2_ARGSW_WORD] - 10951 ;mov di,arg.argv[2*SIZE argv_ele].argsw_word - 10952 000003ED 8B3E[6D9F] mov di,[ARG+(2*ARGV_ELE.SIZE)+ARGV_ELE.argsw_word] - 10953 000003F1 893E[0F9C] mov [ARG2S],di - 10954 ;mov di,[ARGV0_ARGSW_WORD] - 10955 ;mov di,arg.argv[0].argsw_word - 10956 000003F5 8B3E[579F] mov di,[ARG+ARGV_ELE.argsw_word] - 10957 000003F9 F7D7 not di ; ARGTS doesn't include the flags - 10958 ;and di,[ARG_ARGSWINFO] ; from COMSW... - 10959 ;and di,arg.argswinfo - 10960 000003FB 233E[12A2] and di,[ARG+ARG_UNIT.argswinfo] - 10961 000003FF 893E[119C] mov [ARGTS],di - 10962 - 10963 00000403 A0[BA9C] mov al,[IDLEN] - 10964 00000406 8A16[149C] mov dl,[SPECDRV] - 10965 0000040A 08D2 or dl,dl ; if a drive was specified... - 10966 0000040C 7505 jnz short EXTERNALJ1 ; it MUST be external, by this time - 10967 0000040E FEC8 dec al ; (I don't know why -- old code did it) - 10968 00000410 E96227 jmp FNDCOM ; otherwise, check internal com table - 10969 EXTERNALJ1: - 10970 00000413 E96428 jmp EXTERNAL - 10971 NULLCOM: - 10972 00000416 8E1E[F59B] mov ds,[RESSEG] - 10973 0000041A F706[4902]FFFF test word [Batch],0FFFFh ; -1 ;G Are we in a batch file? - 10974 00000420 7405 jz short NOSETFLAG ;G only set flag if in batch - 10975 00000422 C606[B402]01 mov byte [NullFlag],1 ;G set flag to indicate no command - 10976 ;mov byte [NullFlag],nullcommand ; 1 - 10977 NOSETFLAG: - 10978 00000427 833E[A502]FF cmp word [SingleCom],0FFFFh ; -1 - 10979 0000042C 7403 je short EXITJ - 10980 0000042E E9B1FD jmp GETCOM - 10981 EXITJ: - 10982 00000431 E9F5FC jmp _$EXITPREP - 10983 - 10984 ; 07/06/2023 - 10985 ; --------------------------------------------------------------------------- - 10986 ; MSDOS 6.2(2) COMMAND.COM procedure only ! - 10987 ; ----------------------------------------- - 10988 ; Hex-Rays IDA / disassembled source code ! modified for NASM by Erdogan Tan - 10989 ; --------------------------------------------------------------------------- - 10990 - 10991 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 10992 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0436h + 10867 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 10868 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0393h + 10869 + 10870 ; MSDOS 6.0 + 10871 ;SR; + 10872 ; We are going to skip over the first char always. The logic is that the + 10873 ;command tail can never start from the first character. The code below is + 10874 ;trying to figure out the command tail and copy it to the command line + 10875 ;buffer in the PSP. However, if the first character happens to be a switch + 10876 ;character and the user given command line is a full 128 bytes, we try to + 10877 ;copy 128 bytes to the PSP while it can take only 127 chars. This extra + 10878 ;char overwrites the code and leads to a crash on future commands. + 10879 + 10880 0000038F 46 inc si ; MSDOS 6.0 + 10881 + 10882 DO_SKIPCOM: + 10883 00000390 AC lodsb ; move command line pointer over + 10884 00000391 E8FA25 call DELIM ; pathname -- have to do it ourselves + 10885 00000394 740A jz short DO_SKIPPED ; 'cause parse_file_descriptor is dumb + 10886 00000396 3C0D cmp al,0Dh ; can't always depend on argv[0].arglen + 10887 00000398 7406 jz short DO_SKIPPED ; to be the same length as the user- + 10888 0000039A 3A06[F99B] cmp al,[SWITCHAR] ; specified command string + 10889 0000039E 75F0 jnz short DO_SKIPCOM + 10890 DO_SKIPPED: + 10891 000003A0 4E dec si + 10892 000003A1 31C9 xor cx,cx + 10893 COMTAIL: + 10894 000003A3 AC lodsb + 10895 000003A4 AA stosb ; Move command tail to 80h + 10896 000003A5 3C0D cmp al,0Dh + 10897 000003A7 E0FA loopne COMTAIL + 10898 000003A9 4F dec di + 10899 000003AA 89FD mov bp,di + 10900 000003AC F6D1 not cl + 10901 000003AE 880E8000 mov [80h],cl + 10902 000003B2 5E pop si + 10903 ;----- + 10904 ; Some of these comments are sadly at odds with this brave new code. + 10905 ;----- + 10906 ; If the command has 0 parameters must check here for + 10907 ; any switches that might be present. + 10908 ; SI -> first character after the command. + 10909 + 10910 ;mov di,arg.argv[0].argsw_word + 10911 ;mov di,[ARGV0_ARGSW_WORD] + 10912 000003B3 8B3E[579F] mov di,[ARG+ARGV_ELE.argsw_word] + 10913 000003B7 893E[0B9C] mov [COMSW],di ; ah yes, the old addressing mode problem... + 10914 ;mov SI,arg.argv[1 * SIZE argv_ele].argpointer + 10915 ; s = argv[1]; + 10916 ;mov si,[ARGV1_ARGPOINTER] + 10917 000003BB 8B36[5B9F] mov si,[ARG+ARGV_ELE.SIZE+ARGV_ELE.argpointer] + 10918 000003BF 09F6 or si,si ; if (s == NULL) + 10919 000003C1 7502 jnz short DOPARSE ; s = bp; (buffer end) + 10920 000003C3 89EE mov si,bp + 10921 DOPARSE: + 10922 000003C5 BF5C00 mov di,FCB ; 5Ch + 10923 ;mov ax,(Parse_File_Descriptor shl 8) or 01h + 10924 ; 01/02/2023 + 10925 000003C8 B80129 mov ax,2901h + 10926 ;mov ax,(Parse_File_Descriptor<<8)|01h + 10927 000003CB CD21 int 21h ; DOS - PARSE FILENAME + 10928 ; DS:SI -> string to parse + 10929 ; ES:DI -> buffer to fill with unopened FCB + 10930 ; AL = bit mask to control parsing + 10931 000003CD A2[089C] mov [PARM1],al ; Save result of parse + 10932 ;mov di,arg.argv[1*SIZE argv_ele].argsw_word + 10933 ;mov di,[ARGV1_ARGSW_WORD] + 10934 000003D0 8B3E[629F] mov di,[ARG+ARGV_ELE.SIZE+ARGV_ELE.argsw_word] + 10935 000003D4 893E[0D9C] mov [ARG1S],di + 10936 ;mov si,arg.argv[2*SIZE argv_ele].argpointer + 10937 ; s = argv[2]; + 10938 ;mov si,[ARGV2_ARGPOINTER] + 10939 000003D8 8B36[669F] mov si,[ARG+(2*ARGV_ELE.SIZE)+ARGV_ELE.argpointer] + 10940 000003DC 09F6 or si,si ; if (s == NULL) + 10941 000003DE 7502 jnz short DOPARSE2 + 10942 000003E0 89EE mov si,bp ; s = bp; (buffer end) + 10943 DOPARSE2: + 10944 000003E2 BF6C00 mov di,FCB+10h ; 6Ch + 10945 ;;mov ax,(Parse_File_Descriptor shl 8) or 01h + 10946 000003E5 B80129 mov ax,2901h + 10947 ;mov ax,(Parse_File_Descriptor<<8)|01h + 10948 000003E8 CD21 int 21h ; DOS - PARSE FILENAME + 10949 ; DS:SI -> string to parse + 10950 ; ES:DI -> buffer to fill with unopened FCB + 10951 ; AL = bit mask to control parsing + 10952 000003EA A2[0A9C] mov [PARM2],al ; Save result + 10953 ;mov di,[ARGV2_ARGSW_WORD] + 10954 ;mov di,arg.argv[2*SIZE argv_ele].argsw_word + 10955 000003ED 8B3E[6D9F] mov di,[ARG+(2*ARGV_ELE.SIZE)+ARGV_ELE.argsw_word] + 10956 000003F1 893E[0F9C] mov [ARG2S],di + 10957 ;mov di,[ARGV0_ARGSW_WORD] + 10958 ;mov di,arg.argv[0].argsw_word + 10959 000003F5 8B3E[579F] mov di,[ARG+ARGV_ELE.argsw_word] + 10960 000003F9 F7D7 not di ; ARGTS doesn't include the flags + 10961 ;and di,[ARG_ARGSWINFO] ; from COMSW... + 10962 ;and di,arg.argswinfo + 10963 000003FB 233E[12A2] and di,[ARG+ARG_UNIT.argswinfo] + 10964 000003FF 893E[119C] mov [ARGTS],di + 10965 + 10966 00000403 A0[BA9C] mov al,[IDLEN] + 10967 00000406 8A16[149C] mov dl,[SPECDRV] + 10968 0000040A 08D2 or dl,dl ; if a drive was specified... + 10969 0000040C 7505 jnz short EXTERNALJ1 ; it MUST be external, by this time + 10970 0000040E FEC8 dec al ; (I don't know why -- old code did it) + 10971 00000410 E96227 jmp FNDCOM ; otherwise, check internal com table + 10972 EXTERNALJ1: + 10973 00000413 E96428 jmp EXTERNAL + 10974 NULLCOM: + 10975 00000416 8E1E[F59B] mov ds,[RESSEG] + 10976 0000041A F706[4902]FFFF test word [Batch],0FFFFh ; -1 ;G Are we in a batch file? + 10977 00000420 7405 jz short NOSETFLAG ;G only set flag if in batch + 10978 00000422 C606[B402]01 mov byte [NullFlag],1 ;G set flag to indicate no command + 10979 ;mov byte [NullFlag],nullcommand ; 1 + 10980 NOSETFLAG: + 10981 00000427 833E[A502]FF cmp word [SingleCom],0FFFFh ; -1 + 10982 0000042C 7403 je short EXITJ + 10983 0000042E E9B1FD jmp GETCOM + 10984 EXITJ: + 10985 00000431 E9F5FC jmp _$EXITPREP + 10986 + 10987 ; 07/06/2023 + 10988 ; --------------------------------------------------------------------------- + 10989 ; MSDOS 6.2(2) COMMAND.COM procedure only ! + 10990 ; ----------------------------------------- + 10991 ; Hex-Rays IDA / disassembled source code ! modified for NASM by Erdogan Tan + 10992 ; --------------------------------------------------------------------------- 10993 - 10994 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 10995 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0438h - 10996 get_cox_y_n_opt: - 10997 00000434 E339 jcxz ccydp4 ; empty input buffer - 10998 ccydp0: - 10999 00000436 803C0D cmp byte [si],0Dh - 11000 00000439 7434 je short ccydp4 - 11001 0000043B 803C0A cmp byte [si],0Ah - 11002 0000043E 742F je short ccydp4 - 11003 00000440 06 push es - 11004 00000441 8E06[F59B] mov es,[RESSEG] - 11005 00000445 26A0[5A04] mov al,[es:Y_Flag] - 11006 00000449 A810 test al,10h ; bit 1 = 1 -> Y/N answer is needed - 11007 0000044B 7421 jz short ccydp3 ; cf=0 ; 07/06/2023 - 11008 0000044D 26803E[B102]01 cmp byte [es:Call_Batch_Flag],1 ; (in) Batch file ? - 11009 00000453 7419 je short ccydp3 ; yes, don't check for ESCAPE - 11010 00000455 A840 test al,40h ; ESCAPE status - 11011 ; (bit 4 is zero if Y/N is escaped) - 11012 00000457 7417 jz short ccydp5 - 11013 ccydp1: - 11014 00000459 26F706[4902]FFFF test word [es:Batch],0FFFFh - 11015 00000460 740B jz short ccydp2 - 11016 00000462 268E06[4902] mov es,[es:Batch] - 11017 ;mov byte [es:2],1 ; [es:BATCHSEGMENT.BatchEOF] - 11018 00000467 26C606020001 mov byte [es:BATCHSEGMENT.BatchEOF],1 - 11019 ccydp2: - 11020 0000046D F9 stc - 11021 ccydp3: ; 07/06/2023 ; cf = 0 - 11022 0000046E 07 pop es - 11023 ccydp4: ; 07/06/2023 ; cf = 0 - 11024 0000046F C3 retn - 11025 - 11026 ;ccydp3: - 11027 ; pop es - 11028 ;ccydp4: - 11029 ; clc - 11030 ; retn - 11031 - 11032 ccydp5: - 11033 00000470 89F2 mov dx,si - 11034 00000472 BB0200 mov bx,2 - 11035 00000475 B440 mov ah,40h - 11036 00000477 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 11037 ; BX = file handle, CX = number of bytes to write - 11038 ; DS:DX -> buffer - 11039 00000479 BA[9592] mov dx,cox_Y_quest_ptr ; msg number pointer of ' [Y/N]?' - 11040 ; (is 1082) - 11041 0000047C E8A14F call std_eprintf - 11042 0000047F 1E push ds - 11043 00000480 B83B04 mov ax,1083 ; cox_Y_answer number (overwrite Y/N answer letter) - 11044 00000483 B6FF mov dh,0FFh ; utility_msg_class - 11045 00000485 E88350 call TSYSGETMSG - 11046 ;mov cx,'NY' ; MASM word format - 11047 ; NASM word format - 11048 00000488 B9594E mov cx,'YN' ; 'YN' Yes/No (CL=Y) - 11049 0000048B 7202 jc short ccydp6 - 11050 0000048D 8B0C mov cx,[si] - 11051 ccydp6: - 11052 0000048F 1F pop ds - 11053 ccydp7: - 11054 00000490 B408 mov ah,8 - 11055 00000492 CD21 int 21h ; DOS - KEYBOARD INPUT, NO ECHO - 11056 ; Return: AL = character - 11057 00000494 84C0 test al,al - 11058 00000496 7510 jnz short ccydp8 - 11059 00000498 B408 mov ah,8 - 11060 0000049A CD21 int 21h ; DOS - KEYBOARD INPUT, NO ECHO - 11061 ; Return: AL = character - 11062 0000049C 3C3F cmp al,'?' - 11063 0000049E 75F0 jne short ccydp7 - 11064 000004A0 26800E[5A04]40 or byte [es:Y_Flag],40h ; bit 4, question flag - 11065 000004A6 EBB1 jmp short ccydp1 - 11066 ccydp8: - 11067 000004A8 3C1B cmp al,1Bh ; ESCAPE ? - 11068 000004AA 7509 jne short ccydp9 - 11069 000004AC 268026[5A04]EF and byte [es:Y_Flag],0EFh ; (ESCAPE) Clear bit 4 ; ~10h - 11070 ;jmp short ccydp12 - 11071 ; 07/06/2023 - 11072 000004B2 9C pushf - 11073 000004B3 EB18 jmp short ccydp12 - 11074 ccydp9: - 11075 ; 25/07/2024 - PCDOS 7.1 COMMAND.COM - 11076 000004B5 3C41 cmp al,41h ; 'A' - 11077 000004B7 7202 jb short ccydp13 - 11078 ; - 11079 000004B9 24DF and al,0DFh ; uppercase - 11080 ccydp13: ; 25/07/2024 - 11081 000004BB 38E8 cmp al,ch ; NO character (N) - 11082 000004BD 7503 jne short ccydp10 - 11083 000004BF F9 stc - 11084 000004C0 EB04 jmp short ccydp11 ; cf = 1 -> overwrite NO answer - 11085 ccydp10: - 11086 000004C2 38C8 cmp al,cl ; YES character (Y) - 11087 000004C4 75CA jne short ccydp7 - 11088 ccydp11: - 11089 000004C6 9C pushf ; cf = 0 -> overwrite YES answer - 11090 000004C7 88C2 mov dl,al - 11091 000004C9 B402 mov ah,2 - 11092 000004CB CD21 int 21h ; DOS - DISPLAY OUTPUT - 11093 ; DL = character to send to standard output - 11094 ; 07/06/2023 - 11095 ;popf - 11096 ccydp12: - 11097 ;pushf - 11098 000004CD E8A924 call CRLF2 - 11099 000004D0 9D popf - 11100 000004D1 07 pop es - 11101 000004D2 C3 retn - 11102 - 11103 ;============================================================================ - 11104 ; MSHALO.ASM, MSDOS 6.0, 1991 - 11105 ;============================================================================ - 11106 ; 12/10/2018 - Retro DOS v3.0 - 11107 - 11108 ; 05/02/2023 - Retro DOS v5.0 (& v4.1) COMMAND.COM - 11109 - 11110 ; SCCSID = @(#)ibmhalo.asm 1.1 85/04/10 - 11111 ; On 2K (800h) boundaries beginning at address C0000h and ending at EF800h - 11112 ; there is a header that describes a block of rom program. This header - 11113 ; contains information needed to initialize a module and to provide PCDOS - 11114 ; with a set of reserved names for execution. - 11115 ; - 11116 ; This header has the following format: - 11117 ; - 11118 ; rom_header STRUC - 11119 ; Signature1 DB 55h - 11120 ; Signature2 DB AAh - 11121 ; rom_length DB ? ; number of 512 byte pieces - 11122 ; init_jmp DB 3 dup (?) - 11123 ; name_list name_struc <> - 11124 ; rom_header ENDS - 11125 ; - 11126 ; name_struc STRUC - 11127 ; name_len DB ? - 11128 ; name_text DB ? DUP (?) - 11129 ; name_jmp DB 3 DUP (?) - 11130 ; name_struc ENDS - 11131 ; - 11132 ; The name list is a list of names that are reserved by a particular section - 11133 ; of a module. This list of names is terminated by a null name (length - 11134 ; is zero). - 11135 ; - 11136 ; Consider now, the PCDOS action when a user enters a command: - 11137 ; - 11138 ; COMMAND.COM has control. - 11139 ; o If location FFFFEh has FDh then - 11140 ; o Start scanning at C0000h, every 800h for a byte 55h followed - 11141 ; by AAh, stop scan if we get above or = F0000H - 11142 ; o When we've found one, compare the name entered by the user - 11143 ; with the one found in the rom. If we have a match, then - 11144 ; set up the environment for execution and do a long jump - 11145 ; to the near jump after the found name. - 11146 ; o If no more names in the list, then continue scanning the module - 11147 ; for more 55h followed by AAh. - 11148 ; o We get to this point only if there is no matching name in the - 11149 ; rom. We now look on disk for the command. - 11150 ; - 11151 ; This gives us the flexibility to execute any rom cartridge without having - 11152 ; to 'hard-code' the name of the cartridge into PCDOS. Rom modules that - 11153 ; want to be invisible to the DOS should not have any names in their lists - 11154 ; (i.e. they have a single null name). - 11155 ; - 11156 ; Consider a new release of BASIC, say, that patches bugs in the ROM version. - 11157 ; Clearly this version will be available on disk. How does a user actually - 11158 ; invoke this new BASIC?? He cannot call it BASIC on the disk because the - 11159 ; EXEC loader will execute the ROM before it even looks at the disk! Only - 11160 ; solution: - 11161 ; - 11162 ; o Keep things consistent and force the user to have his software named - 11163 ; differently from the ROM names (BASIC1, BASIC2, etc). - 11164 - 11165 struc ROM_HEADER - 11166 00000000 ?? .signature1: resb 1 - 11167 00000001 ?? .signature2: resb 1 - 11168 00000002 ?? .rom_length: resb 1 - 11169 00000003 ?????? .init_jmp: resb 3 - 11170 00000006 ?? .name_list: resb 1 - 11171 .size: - 11172 endstruc - 11173 - 11174 struc NAME_STRUC - 11175 00000000 ?? .name_len: resb 1 - 11176 00000001 ?? .name_text: resb 1 - 11177 00000002 ?????? .name_jmp: resb 3 - 11178 .size: - 11179 endstruc - 11180 - 11181 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 03D1h - 11182 - 11183 ; =============== S U B R O U T I N E ======================================= - 11184 - 11185 ;ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING - 11186 - 11187 ; 05/02/2023 - 11188 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:03FBh + 10994 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 10995 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0436h + 10996 + 10997 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 10998 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0438h + 10999 get_cox_y_n_opt: + 11000 00000434 E339 jcxz ccydp4 ; empty input buffer + 11001 ccydp0: + 11002 00000436 803C0D cmp byte [si],0Dh + 11003 00000439 7434 je short ccydp4 + 11004 0000043B 803C0A cmp byte [si],0Ah + 11005 0000043E 742F je short ccydp4 + 11006 00000440 06 push es + 11007 00000441 8E06[F59B] mov es,[RESSEG] + 11008 00000445 26A0[5A04] mov al,[es:Y_Flag] + 11009 00000449 A810 test al,10h ; bit 1 = 1 -> Y/N answer is needed + 11010 0000044B 7421 jz short ccydp3 ; cf=0 ; 07/06/2023 + 11011 0000044D 26803E[B102]01 cmp byte [es:Call_Batch_Flag],1 ; (in) Batch file ? + 11012 00000453 7419 je short ccydp3 ; yes, don't check for ESCAPE + 11013 00000455 A840 test al,40h ; ESCAPE status + 11014 ; (bit 4 is zero if Y/N is escaped) + 11015 00000457 7417 jz short ccydp5 + 11016 ccydp1: + 11017 00000459 26F706[4902]FFFF test word [es:Batch],0FFFFh + 11018 00000460 740B jz short ccydp2 + 11019 00000462 268E06[4902] mov es,[es:Batch] + 11020 ;mov byte [es:2],1 ; [es:BATCHSEGMENT.BatchEOF] + 11021 00000467 26C606020001 mov byte [es:BATCHSEGMENT.BatchEOF],1 + 11022 ccydp2: + 11023 0000046D F9 stc + 11024 ccydp3: ; 07/06/2023 ; cf = 0 + 11025 0000046E 07 pop es + 11026 ccydp4: ; 07/06/2023 ; cf = 0 + 11027 0000046F C3 retn + 11028 + 11029 ;ccydp3: + 11030 ; pop es + 11031 ;ccydp4: + 11032 ; clc + 11033 ; retn + 11034 + 11035 ccydp5: + 11036 00000470 89F2 mov dx,si + 11037 00000472 BB0200 mov bx,2 + 11038 00000475 B440 mov ah,40h + 11039 00000477 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 11040 ; BX = file handle, CX = number of bytes to write + 11041 ; DS:DX -> buffer + 11042 00000479 BA[9592] mov dx,cox_Y_quest_ptr ; msg number pointer of ' [Y/N]?' + 11043 ; (is 1082) + 11044 0000047C E8A14F call std_eprintf + 11045 0000047F 1E push ds + 11046 00000480 B83B04 mov ax,1083 ; cox_Y_answer number (overwrite Y/N answer letter) + 11047 00000483 B6FF mov dh,0FFh ; utility_msg_class + 11048 00000485 E88350 call TSYSGETMSG + 11049 ;mov cx,'NY' ; MASM word format + 11050 ; NASM word format + 11051 00000488 B9594E mov cx,'YN' ; 'YN' Yes/No (CL=Y) + 11052 0000048B 7202 jc short ccydp6 + 11053 0000048D 8B0C mov cx,[si] + 11054 ccydp6: + 11055 0000048F 1F pop ds + 11056 ccydp7: + 11057 00000490 B408 mov ah,8 + 11058 00000492 CD21 int 21h ; DOS - KEYBOARD INPUT, NO ECHO + 11059 ; Return: AL = character + 11060 00000494 84C0 test al,al + 11061 00000496 7510 jnz short ccydp8 + 11062 00000498 B408 mov ah,8 + 11063 0000049A CD21 int 21h ; DOS - KEYBOARD INPUT, NO ECHO + 11064 ; Return: AL = character + 11065 0000049C 3C3F cmp al,'?' + 11066 0000049E 75F0 jne short ccydp7 + 11067 000004A0 26800E[5A04]40 or byte [es:Y_Flag],40h ; bit 4, question flag + 11068 000004A6 EBB1 jmp short ccydp1 + 11069 ccydp8: + 11070 000004A8 3C1B cmp al,1Bh ; ESCAPE ? + 11071 000004AA 7509 jne short ccydp9 + 11072 000004AC 268026[5A04]EF and byte [es:Y_Flag],0EFh ; (ESCAPE) Clear bit 4 ; ~10h + 11073 ;jmp short ccydp12 + 11074 ; 07/06/2023 + 11075 000004B2 9C pushf + 11076 000004B3 EB18 jmp short ccydp12 + 11077 ccydp9: + 11078 ; 25/07/2024 - PCDOS 7.1 COMMAND.COM + 11079 000004B5 3C41 cmp al,41h ; 'A' + 11080 000004B7 7202 jb short ccydp13 + 11081 ; + 11082 000004B9 24DF and al,0DFh ; uppercase + 11083 ccydp13: ; 25/07/2024 + 11084 000004BB 38E8 cmp al,ch ; NO character (N) + 11085 000004BD 7503 jne short ccydp10 + 11086 000004BF F9 stc + 11087 000004C0 EB04 jmp short ccydp11 ; cf = 1 -> overwrite NO answer + 11088 ccydp10: + 11089 000004C2 38C8 cmp al,cl ; YES character (Y) + 11090 000004C4 75CA jne short ccydp7 + 11091 ccydp11: + 11092 000004C6 9C pushf ; cf = 0 -> overwrite YES answer + 11093 000004C7 88C2 mov dl,al + 11094 000004C9 B402 mov ah,2 + 11095 000004CB CD21 int 21h ; DOS - DISPLAY OUTPUT + 11096 ; DL = character to send to standard output + 11097 ; 07/06/2023 + 11098 ;popf + 11099 ccydp12: + 11100 ;pushf + 11101 000004CD E8A924 call CRLF2 + 11102 000004D0 9D popf + 11103 000004D1 07 pop es + 11104 000004D2 C3 retn + 11105 + 11106 ;============================================================================ + 11107 ; MSHALO.ASM, MSDOS 6.0, 1991 + 11108 ;============================================================================ + 11109 ; 12/10/2018 - Retro DOS v3.0 + 11110 + 11111 ; 05/02/2023 - Retro DOS v5.0 (& v4.1) COMMAND.COM + 11112 + 11113 ; SCCSID = @(#)ibmhalo.asm 1.1 85/04/10 + 11114 ; On 2K (800h) boundaries beginning at address C0000h and ending at EF800h + 11115 ; there is a header that describes a block of rom program. This header + 11116 ; contains information needed to initialize a module and to provide PCDOS + 11117 ; with a set of reserved names for execution. + 11118 ; + 11119 ; This header has the following format: + 11120 ; + 11121 ; rom_header STRUC + 11122 ; Signature1 DB 55h + 11123 ; Signature2 DB AAh + 11124 ; rom_length DB ? ; number of 512 byte pieces + 11125 ; init_jmp DB 3 dup (?) + 11126 ; name_list name_struc <> + 11127 ; rom_header ENDS + 11128 ; + 11129 ; name_struc STRUC + 11130 ; name_len DB ? + 11131 ; name_text DB ? DUP (?) + 11132 ; name_jmp DB 3 DUP (?) + 11133 ; name_struc ENDS + 11134 ; + 11135 ; The name list is a list of names that are reserved by a particular section + 11136 ; of a module. This list of names is terminated by a null name (length + 11137 ; is zero). + 11138 ; + 11139 ; Consider now, the PCDOS action when a user enters a command: + 11140 ; + 11141 ; COMMAND.COM has control. + 11142 ; o If location FFFFEh has FDh then + 11143 ; o Start scanning at C0000h, every 800h for a byte 55h followed + 11144 ; by AAh, stop scan if we get above or = F0000H + 11145 ; o When we've found one, compare the name entered by the user + 11146 ; with the one found in the rom. If we have a match, then + 11147 ; set up the environment for execution and do a long jump + 11148 ; to the near jump after the found name. + 11149 ; o If no more names in the list, then continue scanning the module + 11150 ; for more 55h followed by AAh. + 11151 ; o We get to this point only if there is no matching name in the + 11152 ; rom. We now look on disk for the command. + 11153 ; + 11154 ; This gives us the flexibility to execute any rom cartridge without having + 11155 ; to 'hard-code' the name of the cartridge into PCDOS. Rom modules that + 11156 ; want to be invisible to the DOS should not have any names in their lists + 11157 ; (i.e. they have a single null name). + 11158 ; + 11159 ; Consider a new release of BASIC, say, that patches bugs in the ROM version. + 11160 ; Clearly this version will be available on disk. How does a user actually + 11161 ; invoke this new BASIC?? He cannot call it BASIC on the disk because the + 11162 ; EXEC loader will execute the ROM before it even looks at the disk! Only + 11163 ; solution: + 11164 ; + 11165 ; o Keep things consistent and force the user to have his software named + 11166 ; differently from the ROM names (BASIC1, BASIC2, etc). + 11167 + 11168 struc ROM_HEADER + 11169 00000000 ?? .signature1: resb 1 + 11170 00000001 ?? .signature2: resb 1 + 11171 00000002 ?? .rom_length: resb 1 + 11172 00000003 ?????? .init_jmp: resb 3 + 11173 00000006 ?? .name_list: resb 1 + 11174 .size: + 11175 endstruc + 11176 + 11177 struc NAME_STRUC + 11178 00000000 ?? .name_len: resb 1 + 11179 00000001 ?? .name_text: resb 1 + 11180 00000002 ?????? .name_jmp: resb 3 + 11181 .size: + 11182 endstruc + 11183 + 11184 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 03D1h + 11185 + 11186 ; =============== S U B R O U T I N E ======================================= + 11187 + 11188 ;ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING 11189 - 11190 ; 07/06/2023 - 11191 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:04D5h + 11190 ; 05/02/2023 + 11191 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:03FBh 11192 - 11193 ; 25/07/2024 - 11194 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:04DBh + 11193 ; 07/06/2023 + 11194 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:04D5h 11195 - 11196 ; Check for IBM PC Jr rom cartrides. DS:DX is a pointer to name - 11197 - 11198 ROM_SCAN: - 11199 000004D3 06 push es - 11200 000004D4 56 push si - 11201 000004D5 57 push di - 11202 000004D6 51 push cx - 11203 000004D7 50 push ax - 11204 000004D8 53 push bx - 11205 - 11206 ; check for PC Jr signature in rom - 11207 - 11208 000004D9 B800F0 mov ax,0F000h - 11209 000004DC 8EC0 mov es,ax - 11210 000004DE 26803EFEFFFD cmp byte [es:0FFFEh],0FDh - 11211 000004E4 7408 je short SCAN_IT - 11212 NO_ROM: - 11213 000004E6 F8 clc - 11214 ROM_RET: - 11215 000004E7 5B pop bx - 11216 000004E8 58 pop ax - 11217 000004E9 59 pop cx - 11218 000004EA 5F pop di - 11219 000004EB 5E pop si - 11220 000004EC 07 pop es - 11221 000004ED C3 retn - 11222 - 11223 ; start scanning at C000h - 11224 SCAN_IT: - 11225 000004EE B800C0 mov ax,0C000h - 11226 SCAN_ONE: - 11227 000004F1 8EC0 mov es,ax - 11228 000004F3 31FF xor di,di - 11229 - 11230 ; check for a valid header - 11231 SCAN_MODULE: - 11232 000004F5 26813D55AA cmp word [es:di],0AA55h - 11233 000004FA 740A je short SCAN_LIST - 11234 000004FC 058000 add ax,80h - 11235 SCAN_END: - 11236 000004FF 3D00F0 cmp ax,0F000h - 11237 00000502 72ED jb short SCAN_ONE - 11238 00000504 EBE0 jmp short NO_ROM - 11239 - 11240 ; trundle down list of names - 11241 SCAN_LIST: - 11242 ;mov bl,[es:di+2] ; number of 512-byte jobbers - 11243 00000506 268A5D02 mov bl,[es:di+ROM_HEADER.rom_length] - 11244 0000050A 30FF xor bh,bh ; nothing in the high byte - 11245 0000050C D1E3 shl bx,1 - 11246 0000050E D1E3 shl bx,1 ; number of paragraphs - 11247 00000510 83C37F add bx,7Fh - 11248 00000513 83E380 and bx,0FF80h ; round to 2k - 11249 ;mov di,6 - 11250 ; 05/05/2023 - 11251 00000516 BF0600 mov di,ROM_HEADER.name_list - 11252 ;nop - 11253 SCAN_NAME: - 11254 00000519 268A0D mov cl,[es:di] ; length of name - 11255 0000051C 47 inc di ; point to name - 11256 0000051D 30ED xor ch,ch - 11257 0000051F 09C9 or cx,cx ; zero length name - 11258 00000521 7504 jnz short SCAN_TEST ; nope... compare - 11259 00000523 01D8 add ax,bx ; yep, skip to next block - 11260 00000525 EBD8 jmp short SCAN_END - 11261 - 11262 ; compare a single name - 11263 SCAN_TEST: - 11264 00000527 89D6 mov si,dx - 11265 00000529 46 inc si - 11266 0000052A F3A6 repe cmpsb ; compare name - 11267 0000052C 7407 jz short SCAN_FOUND ; success! - 11268 SCAN_NEXT: - 11269 0000052E 01CF add di,cx ; failure, next name piece - 11270 00000530 83C703 add di,3 - 11271 00000533 EBE4 jmp short SCAN_NAME - 11272 - 11273 ; found a name. save entry location - 11274 SCAN_FOUND: - 11275 00000535 803C3F cmp byte [si],'?' - 11276 00000538 7405 je short SCAN_SAVE - 11277 0000053A 803C20 cmp byte [si],' ' - 11278 0000053D 75EF jne short SCAN_NEXT - 11279 SCAN_SAVE: - 11280 0000053F 2E8C06[B79D] mov [cs:ROM_CS],es - 11281 00000544 2E893E[B59D] mov [cs:ROM_IP],di - 11282 00000549 F9 stc - 11283 0000054A EB9B jmp short ROM_RET - 11284 - 11285 ; --------------------------------------------------------------------------- - 11286 - 11287 ; execute a rom-placed body of code. allocate largest block - 11288 - 11289 ROM_EXEC: - 11290 0000054C BBFFFF mov bx,0FFFFh - 11291 ; 05/02/2023 - 11292 0000054F B448 mov ah,48h - 11293 ;mov ah,ALLOC ; 48h - 11294 00000551 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 11295 ; BX = number of 16-byte paragraphs desired - 11296 00000553 B448 mov ah,48h - 11297 ;mov ah,ALLOC ; 48h - 11298 00000555 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 11299 ; BX = number of 16-byte paragraphs desired - 11300 00000557 53 push bx - 11301 00000558 50 push ax - 11302 - 11303 ; set terminate addresses - 11304 - 11305 00000559 B82225 mov ax,2522h - 11306 ;;mov ax,(set_interrupt_vector SHL 8) + int_terminate - 11307 ;mov ax,(SET_INTERRUPT_VECTOR<<8)+INT_TERMINATE - 11308 0000055C 1E push ds - 11309 0000055D 2E8E1E[F59B] mov ds,[cs:RESSEG] - 11310 ;mov dx,offset RESGROUP:EXEC_WAIT - 11311 ;mov dx,131h ; MSDOS 3.3 - 11312 ; 05/02/2023 - 11313 ;mov dx,0D6Bh ; MSDOS 5.0 - 11314 00000562 BA[390D] mov dx,Exec_Wait - 11315 00000565 CD21 int 21h ; DOS - SET INTERRUPT VECTOR - 11316 ; AL = interrupt number - 11317 ; DS:DX = new vector to be used for specified interrupt - 11318 00000567 8CDA mov dx,ds - 11319 00000569 8EC2 mov es,dx - 11320 0000056B 1F pop ds - 11321 - 11322 ; and create program header and dup all jfn's - 11323 - 11324 0000056C 5A pop dx - 11325 0000056D B455 mov ah,55h - 11326 ;mov ah,DUP_PDB ; 55h - 11327 0000056F CD21 int 21h ; DOS - 2+ internal - CREATE PSP - 11328 ; DX = segment number at which to set up PSP - 11329 ; SI = (DOS 3+) value to place in memory size field at DX:[0002h] - 11330 - 11331 ; set up dma address - 11332 - 11333 00000571 8EDA mov ds,dx - 11334 00000573 BA8000 mov dx,80h - 11335 00000576 B41A mov ah,1Ah - 11336 ;mov ah,Set_DMA ; 1Ah - 11337 00000578 CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 11338 ; DS:DX -> disk transfer buffer - 11339 - 11340 ; copy in environment info - 11341 - 11342 0000057A 26A1[3A04] mov ax,[es:EnvirSeg] - 11343 ;mov [2Ch],ax - 11344 0000057E A32C00 mov [PDB.ENVIRON],ax - 11345 - 11346 ; set up correct size of block - 11347 - 11348 00000581 5B pop bx ; BX has size, DS has segment - 11349 00000582 8CDA mov dx,ds - 11350 00000584 01DA add dx,bx - 11351 ;mov [2],dx - 11352 00000586 89160200 mov [PDB.BLOCK_LEN],dx - 11353 - 11354 ; change ownership of block - 11355 - 11356 0000058A 8CDA mov dx,ds - 11357 0000058C 4A dec dx - 11358 0000058D 8EDA mov ds,dx - 11359 0000058F 42 inc dx - 11360 ;mov [1],dx - 11361 00000590 89160100 mov [ARENA.owner],dx - 11362 00000594 8EDA mov ds,dx - 11363 - 11364 ; set up correct stack - 11365 - 11366 00000596 81FB0010 cmp bx,1000h - 11367 0000059A 7202 jb short GOT_STACK - 11368 0000059C 31DB xor bx,bx - 11369 GOT_STACK: - 11370 0000059E B104 mov cl,4 - 11371 000005A0 D3E3 shl bx,cl - 11372 000005A2 8CDA mov dx,ds - 11373 000005A4 8ED2 mov ss,dx - 11374 000005A6 89DC mov sp,bx - 11375 000005A8 31C0 xor ax,ax - 11376 000005AA 50 push ax - 11377 - 11378 ; set up initial registers and go to the guy - 11379 - 11380 000005AB F7D0 not ax - 11381 000005AD 2EFF36[B79D] push word [cs:ROM_CS] - 11382 000005B2 2EFF36[B59D] push word [cs:ROM_IP] - 11383 000005B7 8EC2 mov es,dx - 11384 000005B9 CB retf ; far return - 11385 - 11386 ; 25/07/2024 - Retro DOS v5.0 - 11387 ; --------------------------------------------------------------------------- - 11388 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:05C2h - 11389 - 11390 ; =============== S U B R O U T I N E ======================================= - 11391 - 11392 int_21h_indirect: - 11393 000005BA 1E push ds ; (*) - 11394 000005BB 9C pushf ; (**) - 11395 000005BC 53 push bx - 11396 000005BD 31DB xor bx, bx - 11397 000005BF 8EDB mov ds, bx ; 0 - 11398 000005C1 5B pop bx - 11399 000005C2 0E push cs ; simulate INT 21h - 11400 ; stack: ip, cs, flags (**) - 11401 000005C3 E80300 call INT21h_fcall - 11402 000005C6 C20200 retn 2 ; discard ds (*) on top of stack - 11403 - 11404 ; =============== S U B R O U T I N E ======================================= - 11405 - 11406 INT21h_fcall: - 11407 ;push word ptr ds:86h - 11408 000005C9 FF368600 push word [(4*21h)+2] ; INT 21h segment - 11409 ;push word ptr ds:84h - 11410 000005CD FF368400 push word [4*21h] ; INT 21h offset - 11411 000005D1 55 push bp - 11412 000005D2 89E5 mov bp,sp - 11413 000005D4 8E5E0C mov ds,[bp+12] ; DS (*) in stack - 11414 000005D7 FF760E push word [bp+14] ; return addr of the caller of INT21h_fcall - 11415 000005DA 8F460C pop word [bp+12] ; return address from INT 21h - 11416 000005DD 5D pop bp - 11417 000005DE FA cli - 11418 000005DF CB retf - 11419 - 11420 ; =============== S U B R O U T I N E ======================================= - 11421 - 11422 int_2Fh_indirect: - 11423 000005E0 1E push ds - 11424 000005E1 53 push bx - 11425 000005E2 31DB xor bx,bx - 11426 000005E4 8EDB mov ds,bx - 11427 000005E6 5B pop bx - 11428 000005E7 9C pushf - 11429 000005E8 FA cli - 11430 ;call dword ptr ds:0BCh - 11431 000005E9 FF1EBC00 call far [4*2Fh] ; INT 2Fh handler - 11432 000005ED 1F pop ds - 11433 000005EE C3 retn - 11434 - 11435 ; --------------------------------------------------------------------------- - 11436 - 11437 ;============================================================================ - 11438 ; TBATCH.ASM, MSDOS 6.0, 1991 - 11439 ;============================================================================ - 11440 ; 12/10/2018 - Retro DOS v3.0 - 11441 - 11442 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 04B9h - 11443 - 11444 ; =============== S U B R O U T I N E ======================================= - 11445 - 11446 ;Break - 11447 - 11448 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM - 11449 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:04E2h + 11196 ; 25/07/2024 + 11197 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:04DBh + 11198 + 11199 ; Check for IBM PC Jr rom cartrides. DS:DX is a pointer to name + 11200 + 11201 ROM_SCAN: + 11202 000004D3 06 push es + 11203 000004D4 56 push si + 11204 000004D5 57 push di + 11205 000004D6 51 push cx + 11206 000004D7 50 push ax + 11207 000004D8 53 push bx + 11208 + 11209 ; check for PC Jr signature in rom + 11210 + 11211 000004D9 B800F0 mov ax,0F000h + 11212 000004DC 8EC0 mov es,ax + 11213 000004DE 26803EFEFFFD cmp byte [es:0FFFEh],0FDh + 11214 000004E4 7408 je short SCAN_IT + 11215 NO_ROM: + 11216 000004E6 F8 clc + 11217 ROM_RET: + 11218 000004E7 5B pop bx + 11219 000004E8 58 pop ax + 11220 000004E9 59 pop cx + 11221 000004EA 5F pop di + 11222 000004EB 5E pop si + 11223 000004EC 07 pop es + 11224 000004ED C3 retn + 11225 + 11226 ; start scanning at C000h + 11227 SCAN_IT: + 11228 000004EE B800C0 mov ax,0C000h + 11229 SCAN_ONE: + 11230 000004F1 8EC0 mov es,ax + 11231 000004F3 31FF xor di,di + 11232 + 11233 ; check for a valid header + 11234 SCAN_MODULE: + 11235 000004F5 26813D55AA cmp word [es:di],0AA55h + 11236 000004FA 740A je short SCAN_LIST + 11237 000004FC 058000 add ax,80h + 11238 SCAN_END: + 11239 000004FF 3D00F0 cmp ax,0F000h + 11240 00000502 72ED jb short SCAN_ONE + 11241 00000504 EBE0 jmp short NO_ROM + 11242 + 11243 ; trundle down list of names + 11244 SCAN_LIST: + 11245 ;mov bl,[es:di+2] ; number of 512-byte jobbers + 11246 00000506 268A5D02 mov bl,[es:di+ROM_HEADER.rom_length] + 11247 0000050A 30FF xor bh,bh ; nothing in the high byte + 11248 0000050C D1E3 shl bx,1 + 11249 0000050E D1E3 shl bx,1 ; number of paragraphs + 11250 00000510 83C37F add bx,7Fh + 11251 00000513 83E380 and bx,0FF80h ; round to 2k + 11252 ;mov di,6 + 11253 ; 05/05/2023 + 11254 00000516 BF0600 mov di,ROM_HEADER.name_list + 11255 ;nop + 11256 SCAN_NAME: + 11257 00000519 268A0D mov cl,[es:di] ; length of name + 11258 0000051C 47 inc di ; point to name + 11259 0000051D 30ED xor ch,ch + 11260 0000051F 09C9 or cx,cx ; zero length name + 11261 00000521 7504 jnz short SCAN_TEST ; nope... compare + 11262 00000523 01D8 add ax,bx ; yep, skip to next block + 11263 00000525 EBD8 jmp short SCAN_END + 11264 + 11265 ; compare a single name + 11266 SCAN_TEST: + 11267 00000527 89D6 mov si,dx + 11268 00000529 46 inc si + 11269 0000052A F3A6 repe cmpsb ; compare name + 11270 0000052C 7407 jz short SCAN_FOUND ; success! + 11271 SCAN_NEXT: + 11272 0000052E 01CF add di,cx ; failure, next name piece + 11273 00000530 83C703 add di,3 + 11274 00000533 EBE4 jmp short SCAN_NAME + 11275 + 11276 ; found a name. save entry location + 11277 SCAN_FOUND: + 11278 00000535 803C3F cmp byte [si],'?' + 11279 00000538 7405 je short SCAN_SAVE + 11280 0000053A 803C20 cmp byte [si],' ' + 11281 0000053D 75EF jne short SCAN_NEXT + 11282 SCAN_SAVE: + 11283 0000053F 2E8C06[B79D] mov [cs:ROM_CS],es + 11284 00000544 2E893E[B59D] mov [cs:ROM_IP],di + 11285 00000549 F9 stc + 11286 0000054A EB9B jmp short ROM_RET + 11287 + 11288 ; --------------------------------------------------------------------------- + 11289 + 11290 ; execute a rom-placed body of code. allocate largest block + 11291 + 11292 ROM_EXEC: + 11293 0000054C BBFFFF mov bx,0FFFFh + 11294 ; 05/02/2023 + 11295 0000054F B448 mov ah,48h + 11296 ;mov ah,ALLOC ; 48h + 11297 00000551 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 11298 ; BX = number of 16-byte paragraphs desired + 11299 00000553 B448 mov ah,48h + 11300 ;mov ah,ALLOC ; 48h + 11301 00000555 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 11302 ; BX = number of 16-byte paragraphs desired + 11303 00000557 53 push bx + 11304 00000558 50 push ax + 11305 + 11306 ; set terminate addresses + 11307 + 11308 00000559 B82225 mov ax,2522h + 11309 ;;mov ax,(set_interrupt_vector SHL 8) + int_terminate + 11310 ;mov ax,(SET_INTERRUPT_VECTOR<<8)+INT_TERMINATE + 11311 0000055C 1E push ds + 11312 0000055D 2E8E1E[F59B] mov ds,[cs:RESSEG] + 11313 ;mov dx,offset RESGROUP:EXEC_WAIT + 11314 ;mov dx,131h ; MSDOS 3.3 + 11315 ; 05/02/2023 + 11316 ;mov dx,0D6Bh ; MSDOS 5.0 + 11317 00000562 BA[390D] mov dx,Exec_Wait + 11318 00000565 CD21 int 21h ; DOS - SET INTERRUPT VECTOR + 11319 ; AL = interrupt number + 11320 ; DS:DX = new vector to be used for specified interrupt + 11321 00000567 8CDA mov dx,ds + 11322 00000569 8EC2 mov es,dx + 11323 0000056B 1F pop ds + 11324 + 11325 ; and create program header and dup all jfn's + 11326 + 11327 0000056C 5A pop dx + 11328 0000056D B455 mov ah,55h + 11329 ;mov ah,DUP_PDB ; 55h + 11330 0000056F CD21 int 21h ; DOS - 2+ internal - CREATE PSP + 11331 ; DX = segment number at which to set up PSP + 11332 ; SI = (DOS 3+) value to place in memory size field at DX:[0002h] + 11333 + 11334 ; set up dma address + 11335 + 11336 00000571 8EDA mov ds,dx + 11337 00000573 BA8000 mov dx,80h + 11338 00000576 B41A mov ah,1Ah + 11339 ;mov ah,Set_DMA ; 1Ah + 11340 00000578 CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 11341 ; DS:DX -> disk transfer buffer + 11342 + 11343 ; copy in environment info + 11344 + 11345 0000057A 26A1[3A04] mov ax,[es:EnvirSeg] + 11346 ;mov [2Ch],ax + 11347 0000057E A32C00 mov [PDB.ENVIRON],ax + 11348 + 11349 ; set up correct size of block + 11350 + 11351 00000581 5B pop bx ; BX has size, DS has segment + 11352 00000582 8CDA mov dx,ds + 11353 00000584 01DA add dx,bx + 11354 ;mov [2],dx + 11355 00000586 89160200 mov [PDB.BLOCK_LEN],dx + 11356 + 11357 ; change ownership of block + 11358 + 11359 0000058A 8CDA mov dx,ds + 11360 0000058C 4A dec dx + 11361 0000058D 8EDA mov ds,dx + 11362 0000058F 42 inc dx + 11363 ;mov [1],dx + 11364 00000590 89160100 mov [ARENA.owner],dx + 11365 00000594 8EDA mov ds,dx + 11366 + 11367 ; set up correct stack + 11368 + 11369 00000596 81FB0010 cmp bx,1000h + 11370 0000059A 7202 jb short GOT_STACK + 11371 0000059C 31DB xor bx,bx + 11372 GOT_STACK: + 11373 0000059E B104 mov cl,4 + 11374 000005A0 D3E3 shl bx,cl + 11375 000005A2 8CDA mov dx,ds + 11376 000005A4 8ED2 mov ss,dx + 11377 000005A6 89DC mov sp,bx + 11378 000005A8 31C0 xor ax,ax + 11379 000005AA 50 push ax + 11380 + 11381 ; set up initial registers and go to the guy + 11382 + 11383 000005AB F7D0 not ax + 11384 000005AD 2EFF36[B79D] push word [cs:ROM_CS] + 11385 000005B2 2EFF36[B59D] push word [cs:ROM_IP] + 11386 000005B7 8EC2 mov es,dx + 11387 000005B9 CB retf ; far return + 11388 + 11389 ; 25/07/2024 - Retro DOS v5.0 + 11390 ; --------------------------------------------------------------------------- + 11391 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:05C2h + 11392 + 11393 ; =============== S U B R O U T I N E ======================================= + 11394 + 11395 int_21h_indirect: + 11396 000005BA 1E push ds ; (*) + 11397 000005BB 9C pushf ; (**) + 11398 000005BC 53 push bx + 11399 000005BD 31DB xor bx, bx + 11400 000005BF 8EDB mov ds, bx ; 0 + 11401 000005C1 5B pop bx + 11402 000005C2 0E push cs ; simulate INT 21h + 11403 ; stack: ip, cs, flags (**) + 11404 000005C3 E80300 call INT21h_fcall + 11405 000005C6 C20200 retn 2 ; discard ds (*) on top of stack + 11406 + 11407 ; =============== S U B R O U T I N E ======================================= + 11408 + 11409 INT21h_fcall: + 11410 ;push word ptr ds:86h + 11411 000005C9 FF368600 push word [(4*21h)+2] ; INT 21h segment + 11412 ;push word ptr ds:84h + 11413 000005CD FF368400 push word [4*21h] ; INT 21h offset + 11414 000005D1 55 push bp + 11415 000005D2 89E5 mov bp,sp + 11416 000005D4 8E5E0C mov ds,[bp+12] ; DS (*) in stack + 11417 000005D7 FF760E push word [bp+14] ; return addr of the caller of INT21h_fcall + 11418 000005DA 8F460C pop word [bp+12] ; return address from INT 21h + 11419 000005DD 5D pop bp + 11420 000005DE FA cli + 11421 000005DF CB retf + 11422 + 11423 ; =============== S U B R O U T I N E ======================================= + 11424 + 11425 int_2Fh_indirect: + 11426 000005E0 1E push ds + 11427 000005E1 53 push bx + 11428 000005E2 31DB xor bx,bx + 11429 000005E4 8EDB mov ds,bx + 11430 000005E6 5B pop bx + 11431 000005E7 9C pushf + 11432 000005E8 FA cli + 11433 ;call dword ptr ds:0BCh + 11434 000005E9 FF1EBC00 call far [4*2Fh] ; INT 2Fh handler + 11435 000005ED 1F pop ds + 11436 000005EE C3 retn + 11437 + 11438 ; --------------------------------------------------------------------------- + 11439 + 11440 ;============================================================================ + 11441 ; TBATCH.ASM, MSDOS 6.0, 1991 + 11442 ;============================================================================ + 11443 ; 12/10/2018 - Retro DOS v3.0 + 11444 + 11445 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 04B9h + 11446 + 11447 ; =============== S U B R O U T I N E ======================================= + 11448 + 11449 ;Break 11450 - 11451 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 11452 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:05BCh + 11451 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM + 11452 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:04E2h 11453 - 11454 ; Open the batch file. If we cannot find the batch file. If the media is - 11455 ; changeable, we prompt for the change. Otherwise, we terminate the batch - 11456 ; file. Leave segment registers alone. - 11457 - 11458 PROMPTBAT: - 11459 000005EF E85308 call BATOPEN - 11460 000005F2 7201 jc short PROMPTBAT1 - 11461 000005F4 C3 retn - 11462 PROMPTBAT1: - 11463 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM - 11464 ; MSDOS 6.0 COMMAND.COM - 11465 000005F5 83FA02 cmp dx,ERROR_FILE_NOT_FOUND ;AN022; Ask for diskette if file not found - 11466 000005F8 740A je short BAT_REMCHECK ;AN022; - 11467 000005FA 83FA03 cmp dx,ERROR_PATH_NOT_FOUND ;AN022; Ask for diskette if path not found - 11468 000005FD 7405 je short BAT_REMCHECK ;AN022; Otherwise, issue message and exit - 11469 ;invoke output_batch_name ;AN022; set up batch name in bwdbuf - 11470 000005FF E83500 call output_batch_name - 11471 00000602 EB13 jmp short BATDIE ;AN022; - 11472 - 11473 ; 05/02/2023 - 11474 ; MSDOS 3.3 COMMAND.COM - 11475 ;cmp dx,ACCDENPTR - 11476 ;jz short BATDIE - 11477 - 11478 ; MSDOS 3.3 (& MSDOS 6.0) - 11479 BAT_REMCHECK: ;AN022; Go see if media is removable - 11480 00000604 2EFF1E[FF9B] call far [cs:RCH_ADDR] ; DX has error number - 11481 00000609 7417 jz short ASKFORBAT ; Media is removable - 11482 - 11483 ; The media is not changeable. Turn everything off. - 11484 - 11485 0000060B E84B0B call FOROFF - 11486 0000060E E8962D call PipeOff - 11487 00000611 A2[AA02] mov [IfFlag],al ; No If in progress. - 11488 00000614 BA[F48F] mov dx,BADBAT_PTR - 11489 BATDIE: - 11490 00000617 E8F803 call BATCHOFF - 11491 0000061A 0E push cs - 11492 0000061B 1F pop ds - 11493 ;invoke std_eprintf ;AC022; display message ; MSDOS 6.0 - 11494 ; 05/02/2023 - 11495 0000061C E8014E call std_eprintf ; MSDOS 6.0 - 11496 ;call STD_PRINTF ; MSDOS 3.3 - 11497 - 11498 ; TCOMMAND resets the stack. This is the equivalent of a non-local goto. - 11499 - 11500 0000061F E9E2FA jmp TCOMMAND - 11501 - 11502 ; Ask the user to reinsert the batch file - 11503 - 11504 ASKFORBAT: - 11505 00000622 1E push ds - 11506 00000623 0E push cs - 11507 00000624 1F pop ds - 11508 - 11509 ; MSDOS 6.0 - 11510 ;mov dx,offset TRANGROUP:NEEDBAT_ptr ;AN022; - 11511 00000625 BA[F78F] mov dx,NEEDBAT_PTR - 11512 ;invoke std_eprintf ;Prompt for batch file on stderr - 11513 ; 05/02/2023 - 11514 00000628 E8F54D call std_eprintf - 11515 ;mov dx,offset trangroup:pausemes_ptr - 11516 0000062B BA[A490] mov dx,PAUSEMES_PTR - 11517 ;invoke std_eprintf ;AN000; get second part of message - 11518 0000062E E8EF4D call std_eprintf - 11519 ;AN000; print it to stderr - 11520 ; MSDOS 3.3 (& MSDOS 6.0) - 11521 ;call STD_EPRINTF - 11522 00000631 E82E00 call GETKEYSTROKE - 11523 00000634 1F pop ds - 11524 00000635 EBB8 jmp short PROMPTBAT - 11525 - 11526 - 11527 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM - 11528 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:052Ah + 11454 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 11455 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:05BCh + 11456 + 11457 ; Open the batch file. If we cannot find the batch file. If the media is + 11458 ; changeable, we prompt for the change. Otherwise, we terminate the batch + 11459 ; file. Leave segment registers alone. + 11460 + 11461 PROMPTBAT: + 11462 000005EF E85308 call BATOPEN + 11463 000005F2 7201 jc short PROMPTBAT1 + 11464 000005F4 C3 retn + 11465 PROMPTBAT1: + 11466 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM + 11467 ; MSDOS 6.0 COMMAND.COM + 11468 000005F5 83FA02 cmp dx,ERROR_FILE_NOT_FOUND ;AN022; Ask for diskette if file not found + 11469 000005F8 740A je short BAT_REMCHECK ;AN022; + 11470 000005FA 83FA03 cmp dx,ERROR_PATH_NOT_FOUND ;AN022; Ask for diskette if path not found + 11471 000005FD 7405 je short BAT_REMCHECK ;AN022; Otherwise, issue message and exit + 11472 ;invoke output_batch_name ;AN022; set up batch name in bwdbuf + 11473 000005FF E83500 call output_batch_name + 11474 00000602 EB13 jmp short BATDIE ;AN022; + 11475 + 11476 ; 05/02/2023 + 11477 ; MSDOS 3.3 COMMAND.COM + 11478 ;cmp dx,ACCDENPTR + 11479 ;jz short BATDIE + 11480 + 11481 ; MSDOS 3.3 (& MSDOS 6.0) + 11482 BAT_REMCHECK: ;AN022; Go see if media is removable + 11483 00000604 2EFF1E[FF9B] call far [cs:RCH_ADDR] ; DX has error number + 11484 00000609 7417 jz short ASKFORBAT ; Media is removable + 11485 + 11486 ; The media is not changeable. Turn everything off. + 11487 + 11488 0000060B E84B0B call FOROFF + 11489 0000060E E8962D call PipeOff + 11490 00000611 A2[AA02] mov [IfFlag],al ; No If in progress. + 11491 00000614 BA[F48F] mov dx,BADBAT_PTR + 11492 BATDIE: + 11493 00000617 E8F803 call BATCHOFF + 11494 0000061A 0E push cs + 11495 0000061B 1F pop ds + 11496 ;invoke std_eprintf ;AC022; display message ; MSDOS 6.0 + 11497 ; 05/02/2023 + 11498 0000061C E8014E call std_eprintf ; MSDOS 6.0 + 11499 ;call STD_PRINTF ; MSDOS 3.3 + 11500 + 11501 ; TCOMMAND resets the stack. This is the equivalent of a non-local goto. + 11502 + 11503 0000061F E9E2FA jmp TCOMMAND + 11504 + 11505 ; Ask the user to reinsert the batch file + 11506 + 11507 ASKFORBAT: + 11508 00000622 1E push ds + 11509 00000623 0E push cs + 11510 00000624 1F pop ds + 11511 + 11512 ; MSDOS 6.0 + 11513 ;mov dx,offset TRANGROUP:NEEDBAT_ptr ;AN022; + 11514 00000625 BA[F78F] mov dx,NEEDBAT_PTR + 11515 ;invoke std_eprintf ;Prompt for batch file on stderr + 11516 ; 05/02/2023 + 11517 00000628 E8F54D call std_eprintf + 11518 ;mov dx,offset trangroup:pausemes_ptr + 11519 0000062B BA[A490] mov dx,PAUSEMES_PTR + 11520 ;invoke std_eprintf ;AN000; get second part of message + 11521 0000062E E8EF4D call std_eprintf + 11522 ;AN000; print it to stderr + 11523 ; MSDOS 3.3 (& MSDOS 6.0) + 11524 ;call STD_EPRINTF + 11525 00000631 E82E00 call GETKEYSTROKE + 11526 00000634 1F pop ds + 11527 00000635 EBB8 jmp short PROMPTBAT + 11528 11529 - 11530 ; MSDOS 6.0 - 11531 ;**************************************************************** - 11532 ;* - 11533 ;* ROUTINE: Output_batch_name - 11534 ;* - 11535 ;* FUNCTION: Sets up batch name to be printed on extended error - 11536 ;* - 11537 ;* INPUT: DX - extended error number - 11538 ;* - 11539 ;* OUTPUT: Ready to call print routine - 11540 ;* - 11541 ;**************************************************************** - 11542 ; - 11543 ;public output_batch_name ;AN022; - 11544 - 11545 output_batch_name: ;proc near ;AN022; - 11546 - 11547 00000637 1E push ds ;AN022; save resident segment - 11548 00000638 8E1E[4902] mov ds,[Batch] ;AN022; get batch file segment - 11549 ;assume DS:nothing ;AN022; - 11550 ;;mov SI,BatFile ;AN022; get offset of batch file - 11551 ; 05/02/2023 - 11552 ;mov si,20h - 11553 ; 24/04/2023 - 11554 0000063C BE2000 mov si,BATCHSEGMENT.BatFile - 11555 ;invoke dstrlen ;AN022; get length of string - 11556 0000063F E85D2A call dstrlen - 11557 ;mov di,offset Trangroup:bwdbuf - 11558 ;AN022; target for batch name - 11559 00000642 BF[399D] mov di,BWDBUF - 11560 00000645 F3A4 rep movsb ;AN022; move the name - 11561 - 11562 00000647 0E push cs ;AN022; get local segment - 11563 00000648 1F pop ds ;AN022; - 11564 ;assume DS:trangroup ;AN022; - 11565 ; 05/02/2023 - 11566 00000649 8916[D78F] mov [extend_buf_ptr],dx ;AN022; put message number in block - 11567 ;mov byte [msg_disp_class],1 - 11568 0000064D C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 11569 ;AN022; set up extended error msg class - 11570 ;mov dx,offset TranGroup:Extend_Buf_ptr - 11571 00000652 BA[D78F] mov dx,extend_buf_ptr - 11572 ;AN022; get extended message pointer - 11573 ;mov string_ptr_2,offset trangroup:bwdbuf - 11574 00000655 C706[A09D][399D] mov word [string_ptr_2],BWDBUF - 11575 ;AN022; point to substitution - 11576 ;mov byte [extend_buf_sub],1 - 11577 0000065B C606[D98F]01 mov byte [extend_buf_sub],one_subst - 11578 ;AN022; set up for one subst - 11579 00000660 1F pop ds ;AN022; restore data segment - 11580 00000661 C3 retn ;AN022; return - 11581 - 11582 ;output_batch_name endp ;AN022; - 11583 + 11530 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM + 11531 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:052Ah + 11532 + 11533 ; MSDOS 6.0 + 11534 ;**************************************************************** + 11535 ;* + 11536 ;* ROUTINE: Output_batch_name + 11537 ;* + 11538 ;* FUNCTION: Sets up batch name to be printed on extended error + 11539 ;* + 11540 ;* INPUT: DX - extended error number + 11541 ;* + 11542 ;* OUTPUT: Ready to call print routine + 11543 ;* + 11544 ;**************************************************************** + 11545 ; + 11546 ;public output_batch_name ;AN022; + 11547 + 11548 output_batch_name: ;proc near ;AN022; + 11549 + 11550 00000637 1E push ds ;AN022; save resident segment + 11551 00000638 8E1E[4902] mov ds,[Batch] ;AN022; get batch file segment + 11552 ;assume DS:nothing ;AN022; + 11553 ;;mov SI,BatFile ;AN022; get offset of batch file + 11554 ; 05/02/2023 + 11555 ;mov si,20h + 11556 ; 24/04/2023 + 11557 0000063C BE2000 mov si,BATCHSEGMENT.BatFile + 11558 ;invoke dstrlen ;AN022; get length of string + 11559 0000063F E85D2A call dstrlen + 11560 ;mov di,offset Trangroup:bwdbuf + 11561 ;AN022; target for batch name + 11562 00000642 BF[399D] mov di,BWDBUF + 11563 00000645 F3A4 rep movsb ;AN022; move the name + 11564 + 11565 00000647 0E push cs ;AN022; get local segment + 11566 00000648 1F pop ds ;AN022; + 11567 ;assume DS:trangroup ;AN022; + 11568 ; 05/02/2023 + 11569 00000649 8916[D78F] mov [extend_buf_ptr],dx ;AN022; put message number in block + 11570 ;mov byte [msg_disp_class],1 + 11571 0000064D C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 11572 ;AN022; set up extended error msg class + 11573 ;mov dx,offset TranGroup:Extend_Buf_ptr + 11574 00000652 BA[D78F] mov dx,extend_buf_ptr + 11575 ;AN022; get extended message pointer + 11576 ;mov string_ptr_2,offset trangroup:bwdbuf + 11577 00000655 C706[A09D][399D] mov word [string_ptr_2],BWDBUF + 11578 ;AN022; point to substitution + 11579 ;mov byte [extend_buf_sub],1 + 11580 0000065B C606[D98F]01 mov byte [extend_buf_sub],one_subst + 11581 ;AN022; set up for one subst + 11582 00000660 1F pop ds ;AN022; restore data segment + 11583 00000661 C3 retn ;AN022; return 11584 - 11585 ; =============== S U B R O U T I N E ======================================= + 11585 ;output_batch_name endp ;AN022; 11586 - 11587 ;Break - 11588 - 11589 ; Read the next keystroke. Since there may be several characters in the queue - 11590 ; after the one we ask for (function keys/Kanji), we need to flush the queue - 11591 ; AFTER waiting. - 11592 - 11593 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM - 11594 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0555h + 11587 + 11588 ; =============== S U B R O U T I N E ======================================= + 11589 + 11590 ;Break + 11591 + 11592 ; Read the next keystroke. Since there may be several characters in the queue + 11593 ; after the one we ask for (function keys/Kanji), we need to flush the queue + 11594 ; AFTER waiting. 11595 - 11596 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 11597 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:062Fh + 11596 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM + 11597 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0555h 11598 - 11599 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 11600 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:066Ah + 11599 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 11600 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:062Fh 11601 - 11602 GETKEYSTROKE: - 11603 ; 05/02/2023 - 11604 ; MSDOS 3.3 - 11605 ;;mov ax,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT_NO_ECHO - 11606 ;;mov ax,0C08h - 11607 ;mov ax,(STD_CON_INPUT_FLUSH<<8)|STD_CON_INPUT_NO_ECHO - 11608 ;int 21h ; DOS - CLEAR KEYBOARD BUFFER - 11609 ; ; AL must be 01h,06h,07h,08h,or 0Ah. - 11610 ;;mov ax,(STD_CON_INPUT_FLUSH SHL 8) + 0 - 11611 ;;mov ax,0C00h - 11612 ;mov ax,(STD_CON_INPUT_FLUSH<<8)+0 - 11613 ;int 21h ; DOS - CLEAR KEYBOARD BUFFER - 11614 ; ; AL must be 01h,06h,07h,08h,or 0Ah. - 11615 ;retn - 11616 - 11617 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM - 11618 ; MSDOS 6.0 - 11619 00000662 52 push dx ;AN000; 3/3/KK - 11620 ;mov ax,(ECS_call SHL 8) OR GetInterimMode - 11621 ;AN000; 3/3/KK - 11622 00000663 B80263 mov ax,6302h - 11623 00000666 CD21 int 21h ;AN000; 3/3/KK - 11624 ; DOS - 3.2+ only - GET KOREAN (HONGEUL) INPUT MODE - 11625 - 11626 00000668 52 push dx ;AN000; save interim state 3/3/KK - 11627 ;mov ax,(ECS_call SHL 8) OR SetInterimMode - 11628 ;AN000; 3/3/KK - 11629 00000669 B80163 mov ax,6301h - 11630 0000066C B201 mov dl,1 - 11631 ;mov dl,InterimMode ;AN000; 3/3/KK - 11632 0000066E CD21 int 21h ;AN000; 3/3/KK - 11633 ; DOS - 3.2+ only - SET KOREAN (HONGEUL) INPUT MODE - 11634 ; DL = new mode - 11635 ; 00h return only full characters on DOS keyboard input functions - 11636 ; 01h return partially-formed characters also - 11637 - 11638 ;mov ax,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT_no_echo - 11639 00000670 B8080C mov ax,0C08h - 11640 00000673 CD21 int 21h ; Get character with KB buffer flush - 11641 ; DOS - CLEAR KEYBOARD BUFFER - 11642 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. - 11643 - 11644 ;mov ax,(STD_CON_INPUT_FLUSH SHL 8) + 0 - 11645 00000675 B8000C mov ax,0C00h - 11646 00000678 CD21 int 21h - 11647 ; DOS - CLEAR KEYBOARD BUFFER - 11648 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. - 11649 - 11650 ;mov ax,(ECS_call SHL 8) OR SetInterimMode - 11651 ;AN000; 3/3/KK - 11652 0000067A B80163 mov ax,6301h - 11653 0000067D 5A pop dx ;AN000; restore interim state 3/3/KK - 11654 0000067E CD21 int 21h ;AN000; 3/3/KK - 11655 00000680 5A pop dx ;AN000; 3/3/KK - 11656 - 11657 00000681 C3 retn - 11658 - 11659 ; =============== S U B R O U T I N E ======================================= - 11660 - 11661 ; Break - 11662 - 11663 ; ReadBat - read a single line from the batch file. - 11664 ; Perform all substitutions as appropriate. + 11602 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 11603 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:066Ah + 11604 + 11605 GETKEYSTROKE: + 11606 ; 05/02/2023 + 11607 ; MSDOS 3.3 + 11608 ;;mov ax,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT_NO_ECHO + 11609 ;;mov ax,0C08h + 11610 ;mov ax,(STD_CON_INPUT_FLUSH<<8)|STD_CON_INPUT_NO_ECHO + 11611 ;int 21h ; DOS - CLEAR KEYBOARD BUFFER + 11612 ; ; AL must be 01h,06h,07h,08h,or 0Ah. + 11613 ;;mov ax,(STD_CON_INPUT_FLUSH SHL 8) + 0 + 11614 ;;mov ax,0C00h + 11615 ;mov ax,(STD_CON_INPUT_FLUSH<<8)+0 + 11616 ;int 21h ; DOS - CLEAR KEYBOARD BUFFER + 11617 ; ; AL must be 01h,06h,07h,08h,or 0Ah. + 11618 ;retn + 11619 + 11620 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM + 11621 ; MSDOS 6.0 + 11622 00000662 52 push dx ;AN000; 3/3/KK + 11623 ;mov ax,(ECS_call SHL 8) OR GetInterimMode + 11624 ;AN000; 3/3/KK + 11625 00000663 B80263 mov ax,6302h + 11626 00000666 CD21 int 21h ;AN000; 3/3/KK + 11627 ; DOS - 3.2+ only - GET KOREAN (HONGEUL) INPUT MODE + 11628 + 11629 00000668 52 push dx ;AN000; save interim state 3/3/KK + 11630 ;mov ax,(ECS_call SHL 8) OR SetInterimMode + 11631 ;AN000; 3/3/KK + 11632 00000669 B80163 mov ax,6301h + 11633 0000066C B201 mov dl,1 + 11634 ;mov dl,InterimMode ;AN000; 3/3/KK + 11635 0000066E CD21 int 21h ;AN000; 3/3/KK + 11636 ; DOS - 3.2+ only - SET KOREAN (HONGEUL) INPUT MODE + 11637 ; DL = new mode + 11638 ; 00h return only full characters on DOS keyboard input functions + 11639 ; 01h return partially-formed characters also + 11640 + 11641 ;mov ax,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT_no_echo + 11642 00000670 B8080C mov ax,0C08h + 11643 00000673 CD21 int 21h ; Get character with KB buffer flush + 11644 ; DOS - CLEAR KEYBOARD BUFFER + 11645 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. + 11646 + 11647 ;mov ax,(STD_CON_INPUT_FLUSH SHL 8) + 0 + 11648 00000675 B8000C mov ax,0C00h + 11649 00000678 CD21 int 21h + 11650 ; DOS - CLEAR KEYBOARD BUFFER + 11651 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. + 11652 + 11653 ;mov ax,(ECS_call SHL 8) OR SetInterimMode + 11654 ;AN000; 3/3/KK + 11655 0000067A B80163 mov ax,6301h + 11656 0000067D 5A pop dx ;AN000; restore interim state 3/3/KK + 11657 0000067E CD21 int 21h ;AN000; 3/3/KK + 11658 00000680 5A pop dx ;AN000; 3/3/KK + 11659 + 11660 00000681 C3 retn + 11661 + 11662 ; =============== S U B R O U T I N E ======================================= + 11663 + 11664 ; Break 11665 - 11666 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM - 11667 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0575h + 11666 ; ReadBat - read a single line from the batch file. + 11667 ; Perform all substitutions as appropriate. 11668 - 11669 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 11670 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:068Ah + 11669 ; 05/02/2023 - Retro DOS v4.0 COMMAND.COM + 11670 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0575h 11671 - 11672 READBAT: - 11673 ;ASSUME DS:ResGroup,ES:TranGroup - 11674 - 11675 ;mov byte [Suppress],1 - 11676 ; initialize line suppress status - 11677 00000682 C606[9E02]01 mov byte [Suppress],YES_ECHO - 11678 00000687 F606[9302]FF test byte [Batch_Abort],-1 ; 0FFh - 11679 0000068C 751F jnz short TRYING_TO_ABORT - 11680 0000068E C606[9202]01 mov byte [In_Batch],1 ; set flag to indicate batch job - 11681 - 11682 ; MSDOS 6.0 - 11683 - 11684 ;M037; Start of changes - 11685 ; We check here if we have set the flag indicating that the batchfile is at - 11686 ;EOF. In this case, we do not want to continue with the normal processing. - 11687 ;We call GetBatByt once more so that the batch segment gets freed up, the - 11688 ;batch file gets closed etc. and then return as if everything is done. - 11689 - 11690 ; 05/02/2023 - 11691 00000693 1E push ds - 11692 00000694 8E1E[4902] mov ds,[Batch] - 11693 ;cmp byte [2],0 - 11694 00000698 803E020000 cmp byte [BATCHSEGMENT.BatchEOF],0 - 11695 ; are we at EOF in batchfile - 11696 0000069D 1F pop ds - 11697 0000069E 740A jz short CONTBAT ; no, continue normal processing - 11698 ;invoke GetBatByt ; frees up batchseg - 11699 000006A0 E8DC03 call GETBATBYT - 11700 000006A3 26A2[569A] mov [es:COMBUF+2],al - 11701 ; stuff CR into command buffer - 11702 ; as a dummy command - 11703 ;;invoke CrLf2 ; print a CR-LF - 11704 ;call CRLF2 - 11705 ;;return ; done batch processing - 11706 ;retn - 11707 ; 24/04/2023 - 11708 000006A7 E9CF22 jmp CRLF2 - 11709 - 11710 ;M037; End of changes - 11711 - 11712 ; MSDOS 3.3 (& MSDOS 6.0) - 11713 CONTBAT: - 11714 000006AA E842FF call PROMPTBAT - 11715 - 11716 TRYING_TO_ABORT: - 11717 000006AD BF[569A] mov di,COMBUF+2 + 11672 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 11673 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:068Ah + 11674 + 11675 READBAT: + 11676 ;ASSUME DS:ResGroup,ES:TranGroup + 11677 + 11678 ;mov byte [Suppress],1 + 11679 ; initialize line suppress status + 11680 00000682 C606[9E02]01 mov byte [Suppress],YES_ECHO + 11681 00000687 F606[9302]FF test byte [Batch_Abort],-1 ; 0FFh + 11682 0000068C 751F jnz short TRYING_TO_ABORT + 11683 0000068E C606[9202]01 mov byte [In_Batch],1 ; set flag to indicate batch job + 11684 + 11685 ; MSDOS 6.0 + 11686 + 11687 ;M037; Start of changes + 11688 ; We check here if we have set the flag indicating that the batchfile is at + 11689 ;EOF. In this case, we do not want to continue with the normal processing. + 11690 ;We call GetBatByt once more so that the batch segment gets freed up, the + 11691 ;batch file gets closed etc. and then return as if everything is done. + 11692 + 11693 ; 05/02/2023 + 11694 00000693 1E push ds + 11695 00000694 8E1E[4902] mov ds,[Batch] + 11696 ;cmp byte [2],0 + 11697 00000698 803E020000 cmp byte [BATCHSEGMENT.BatchEOF],0 + 11698 ; are we at EOF in batchfile + 11699 0000069D 1F pop ds + 11700 0000069E 740A jz short CONTBAT ; no, continue normal processing + 11701 ;invoke GetBatByt ; frees up batchseg + 11702 000006A0 E8DC03 call GETBATBYT + 11703 000006A3 26A2[569A] mov [es:COMBUF+2],al + 11704 ; stuff CR into command buffer + 11705 ; as a dummy command + 11706 ;;invoke CrLf2 ; print a CR-LF + 11707 ;call CRLF2 + 11708 ;;return ; done batch processing + 11709 ;retn + 11710 ; 24/04/2023 + 11711 000006A7 E9CF22 jmp CRLF2 + 11712 + 11713 ;M037; End of changes + 11714 + 11715 ; MSDOS 3.3 (& MSDOS 6.0) + 11716 CONTBAT: + 11717 000006AA E842FF call PROMPTBAT 11718 - 11719 ; Save position and try to scan for first non delimiter. - 11720 - 11721 TESTNOP: - 11722 000006B0 8CD8 mov ax,ds - 11723 000006B2 8E1E[4902] mov ds,[Batch] - 11724 000006B6 FF360800 push word [BATCHSEGMENT.BatSeek] - 11725 000006BA FF360A00 push word [BATCHSEGMENT.BatSeek+2] - 11726 ; save current location. - 11727 000006BE 8ED8 mov ds,ax - 11728 000006C0 E85506 call SKIPDELIM ; skip to first non-delim - 11729 - 11730 ; If the first non-delimiter is not a : (label), we reseek back to the - 11731 ; beginning and read the line. + 11719 TRYING_TO_ABORT: + 11720 000006AD BF[569A] mov di,COMBUF+2 + 11721 + 11722 ; Save position and try to scan for first non delimiter. + 11723 + 11724 TESTNOP: + 11725 000006B0 8CD8 mov ax,ds + 11726 000006B2 8E1E[4902] mov ds,[Batch] + 11727 000006B6 FF360800 push word [BATCHSEGMENT.BatSeek] + 11728 000006BA FF360A00 push word [BATCHSEGMENT.BatSeek+2] + 11729 ; save current location. + 11730 000006BE 8ED8 mov ds,ax + 11731 000006C0 E85506 call SKIPDELIM ; skip to first non-delim 11732 - 11733 000006C3 3C3A cmp al,':' ; is it a label? - 11734 000006C5 59 pop cx - 11735 000006C6 5A pop dx ; restore position in bat file - 11736 000006C7 7432 jz short NOPLINE ; yes, resync everything. - 11737 000006C9 F706[4902]FFFF test word [Batch],-1 ; are we done with the batch file? - 11738 000006CF 7439 jz short RDBAT ; no, go read batch file - 11739 - 11740 ;cmp al,'@' - 11741 000006D1 3C40 cmp al,No_Echo_Char ; see if user wants to suppress line - 11742 000006D3 7507 jne short SET_BAT_POS ; no - go and set batch file position - 11743 ;mov byte [Suppress],0 - 11744 000006D5 C606[9E02]00 mov byte [Suppress],NO_ECHO ; yes set flag to indicate - 11745 000006DA EB2E jmp short RDBAT ; go read batch file - 11746 ;nop - 11747 SET_BAT_POS: - 11748 000006DC 1E push ds - 11749 000006DD 8E1E[4902] mov ds,[Batch] - 11750 ;mov [8],dx - 11751 000006E1 89160800 mov [BATCHSEGMENT.BatSeek],dx ; reseek back to beginning - 11752 ;mov [10],cx - 11753 000006E5 890E0A00 mov [BATCHSEGMENT.BatSeek+2],cx - 11754 000006E9 1F pop ds - 11755 ;;mov ax,(LSEEK SHL 8) + 0 - 11756 ; 05/02/2023 - 11757 000006EA B80042 mov ax,4200h - 11758 ;mov ax,(LSEEK*256) ; 4200h ; seek back - 11759 - 11760 ; 25/07/2024 - 11761 ; PCDOS 7.1 COMMAND.COM - 11762 %if 0 - 11763 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) - 11764 ; AL = method: offset from beginning of file - 11765 %else - 11766 000006ED E8CAFE call int_21h_indirect - 11767 %endif - 11768 ;mov word [cs:BATBUFPOS],0FFFFh - 11769 ; 24/04/2023 - 11770 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:05E3h - 11771 000006F0 26C706[C7A5]FFFF mov word [es:BATBUFPOS],-1; 0FFFFh - 11772 ;mov word [cs:BATBUFPOS],-1 ; nuke batch buffer position - 11773 000006F7 31C9 xor cx,cx ; Initialize line length to zero - 11774 000006F9 EB0F jmp short RDBAT - 11775 - 11776 ;nop - 11777 - 11778 ; The first non-delimiter is a :. This line is not echoed and is ignored. - 11779 ; We eat characters until a CR is seen. + 11733 ; If the first non-delimiter is not a : (label), we reseek back to the + 11734 ; beginning and read the line. + 11735 + 11736 000006C3 3C3A cmp al,':' ; is it a label? + 11737 000006C5 59 pop cx + 11738 000006C6 5A pop dx ; restore position in bat file + 11739 000006C7 7432 jz short NOPLINE ; yes, resync everything. + 11740 000006C9 F706[4902]FFFF test word [Batch],-1 ; are we done with the batch file? + 11741 000006CF 7439 jz short RDBAT ; no, go read batch file + 11742 + 11743 ;cmp al,'@' + 11744 000006D1 3C40 cmp al,No_Echo_Char ; see if user wants to suppress line + 11745 000006D3 7507 jne short SET_BAT_POS ; no - go and set batch file position + 11746 ;mov byte [Suppress],0 + 11747 000006D5 C606[9E02]00 mov byte [Suppress],NO_ECHO ; yes set flag to indicate + 11748 000006DA EB2E jmp short RDBAT ; go read batch file + 11749 ;nop + 11750 SET_BAT_POS: + 11751 000006DC 1E push ds + 11752 000006DD 8E1E[4902] mov ds,[Batch] + 11753 ;mov [8],dx + 11754 000006E1 89160800 mov [BATCHSEGMENT.BatSeek],dx ; reseek back to beginning + 11755 ;mov [10],cx + 11756 000006E5 890E0A00 mov [BATCHSEGMENT.BatSeek+2],cx + 11757 000006E9 1F pop ds + 11758 ;;mov ax,(LSEEK SHL 8) + 0 + 11759 ; 05/02/2023 + 11760 000006EA B80042 mov ax,4200h + 11761 ;mov ax,(LSEEK*256) ; 4200h ; seek back + 11762 + 11763 ; 25/07/2024 + 11764 ; PCDOS 7.1 COMMAND.COM + 11765 %if 0 + 11766 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) + 11767 ; AL = method: offset from beginning of file + 11768 %else + 11769 000006ED E8CAFE call int_21h_indirect + 11770 %endif + 11771 ;mov word [cs:BATBUFPOS],0FFFFh + 11772 ; 24/04/2023 + 11773 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:05E3h + 11774 000006F0 26C706[C7A5]FFFF mov word [es:BATBUFPOS],-1; 0FFFFh + 11775 ;mov word [cs:BATBUFPOS],-1 ; nuke batch buffer position + 11776 000006F7 31C9 xor cx,cx ; Initialize line length to zero + 11777 000006F9 EB0F jmp short RDBAT + 11778 + 11779 ;nop 11780 - 11781 NOPLINE: - 11782 000006FB E80501 call SKIPTOEOL - 11783 000006FE E87E03 call GETBATBYT ; eat trailing LF - 11784 ;test word [Batch],0FFFFh - 11785 00000701 F706[4902]FFFF test word [Batch],-1 ; are we done with the batch file? - 11786 00000707 75A7 jnz short TESTNOP ; no, go get another line - 11787 READBAT_RETN: ; Hit EOF - 11788 00000709 C3 retn - 11789 - 11790 ; --------------------------------------------------------------------------- - 11791 - 11792 ; Read a line into the buffer pointed to by ES:DI. If any %s are seen in the - 11793 ; input, we are to consider two special cases: - 11794 ; - 11795 ; %0 to %9 These represent replaceable parameters from the batch segment - 11796 ; %sym% This is a symbol from the environment - 11797 - 11798 RDBAT: - 11799 0000070A E87203 call GETBATBYT - 11800 0000070D 41 inc cx ; Inc the line length - 11801 - 11802 ; 05/02/2023 - 11803 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0601h - 11804 0000070E E85020 call testkanj - 11805 00000711 740C jz short RDBAT1 - 11806 ;cmp cx,127 - 11807 00000713 83F97F cmp cx,COMBUFLEN-1 - 11808 00000716 7350 jnb short TOOLONG - 11809 00000718 AA stosb - 11810 00000719 E86303 call GETBATBYT - 11811 0000071C 41 inc cx - 11812 0000071D EB0A jmp short SAVBATBYT - 11813 RDBAT1: - 11814 0000071F 81F98000 cmp cx,COMBUFLEN ; 128 ; Is it too long? - 11815 00000723 7343 jnb short TOOLONG ; Yes - handle it, handle it - 11816 - 11817 ; See if we have a parameter character. - 11818 - 11819 00000725 3C25 cmp al,'%' ; Check for parameter - 11820 00000727 7449 je short NEEDPARM + 11781 ; The first non-delimiter is a :. This line is not echoed and is ignored. + 11782 ; We eat characters until a CR is seen. + 11783 + 11784 NOPLINE: + 11785 000006FB E80501 call SKIPTOEOL + 11786 000006FE E87E03 call GETBATBYT ; eat trailing LF + 11787 ;test word [Batch],0FFFFh + 11788 00000701 F706[4902]FFFF test word [Batch],-1 ; are we done with the batch file? + 11789 00000707 75A7 jnz short TESTNOP ; no, go get another line + 11790 READBAT_RETN: ; Hit EOF + 11791 00000709 C3 retn + 11792 + 11793 ; --------------------------------------------------------------------------- + 11794 + 11795 ; Read a line into the buffer pointed to by ES:DI. If any %s are seen in the + 11796 ; input, we are to consider two special cases: + 11797 ; + 11798 ; %0 to %9 These represent replaceable parameters from the batch segment + 11799 ; %sym% This is a symbol from the environment + 11800 + 11801 RDBAT: + 11802 0000070A E87203 call GETBATBYT + 11803 0000070D 41 inc cx ; Inc the line length + 11804 + 11805 ; 05/02/2023 + 11806 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0601h + 11807 0000070E E85020 call testkanj + 11808 00000711 740C jz short RDBAT1 + 11809 ;cmp cx,127 + 11810 00000713 83F97F cmp cx,COMBUFLEN-1 + 11811 00000716 7350 jnb short TOOLONG + 11812 00000718 AA stosb + 11813 00000719 E86303 call GETBATBYT + 11814 0000071C 41 inc cx + 11815 0000071D EB0A jmp short SAVBATBYT + 11816 RDBAT1: + 11817 0000071F 81F98000 cmp cx,COMBUFLEN ; 128 ; Is it too long? + 11818 00000723 7343 jnb short TOOLONG ; Yes - handle it, handle it + 11819 + 11820 ; See if we have a parameter character. 11821 - 11822 ; no parameter character. Store it as usual and see if we are done. - 11823 - 11824 SAVBATBYT: - 11825 00000729 AA stosb ; End of line found? - 11826 0000072A 3C0D cmp al,0Dh - 11827 0000072C 75DC jne short RDBAT ; no, go for more - 11828 - 11829 ; We have read in an entire line. - 11830 ; Decide whether we should echo the command line or not. + 11822 00000725 3C25 cmp al,'%' ; Check for parameter + 11823 00000727 7449 je short NEEDPARM + 11824 + 11825 ; no parameter character. Store it as usual and see if we are done. + 11826 + 11827 SAVBATBYT: + 11828 00000729 AA stosb ; End of line found? + 11829 0000072A 3C0D cmp al,0Dh + 11830 0000072C 75DC jne short RDBAT ; no, go for more 11831 - 11832 FOUND_EOL: - 11833 0000072E 81EF[579A] sub di,COMBUF+3 - 11834 00000732 89F8 mov ax,di ; remember that we've not counted the CR - 11835 00000734 26A2[559A] mov [es:COMBUF+1],al - 11836 ; Set length of line - 11837 00000738 E84403 call GETBATBYT ; Eat linefeed - 11838 0000073B E8F206 call BATCLOSE - 11839 0000073E 803E[9E02]00 cmp byte [Suppress],NO_ECHO ; 0 - 11840 00000743 7407 jz short RESET - 11841 00000745 F606[9D02]01 test byte [EchoFlag],1 ; To echo or not to echo, that is the - 11842 0000074A 7504 jnz short TRY_NEXTFLAG ; question. (Profound, huh?) - 11843 RESET: - 11844 0000074C 0E push cs - 11845 0000074D 1F pop ds ; Go back to local segment - 11846 0000074E 74B9 jz short READBAT_RETN ; no echoing here... - 11847 TRY_NEXTFLAG: - 11848 00000750 803E[B402]01 cmp byte [NullFlag],nullcommand ; 1 - 11849 ;G was there a command last time? - 11850 00000755 7403 jz short NO_CRLF_PRINT - 11851 ;G no - don't print crlf - 11852 00000757 E81F22 call CRLF2 ;G Print out prompt - 11853 NO_CRLF_PRINT: - 11854 0000075A E89319 call PRINT_PROMPT - 11855 0000075D 0E push cs ;G change data segment - 11856 0000075E 1F pop ds - 11857 0000075F BA[569A] mov dx,COMBUF+2 ; get command line for echoing - 11858 00000762 E86D22 call CRPRINT - 11859 ;call CRLF2 - 11860 ;retn - 11861 ; 06/02/2023 - 11862 00000765 E91122 jmp CRLF2 - 11863 - 11864 ; The line was too long. Eat remainder of input text up until the CR - 11865 - 11866 TOOLONG: - 11867 00000768 3C0D cmp al,0Dh ; Has the end of the line been reached? - 11868 0000076A 7403 jz short LTLCONT ; Yes, continue - 11869 0000076C E89400 call SKIPTOEOL ; Eat remainder of line - 11870 LTLCONT: - 11871 0000076F AA stosb ; Terminate the command - 11872 00000770 EBBC jmp short FOUND_EOL ; Go process the valid part of the line - 11873 - 11874 ; We have found a parameter lead-in character. Check for the 0-9 case first - 11875 - 11876 NEEDPARM: - 11877 00000772 E80A03 call GETBATBYT ; get next character - 11878 00000775 3C25 cmp al,'%' ; Check for two consecutive % - 11879 00000777 74B0 je short SAVBATBYT ; if so, replace with a single % - 11880 00000779 3C0D cmp al,0Dh ; Check for end-of-line - 11881 0000077B 74AC je short SAVBATBYT ; yes, treat it normally - 11882 - 11883 ; We have found %. If the is in the range 0-9, we - 11884 ; retrieve the appropriate parameter from the batch segment. Otherwise we - 11885 ; see if the has a terminating % and then look up the contents - 11886 ; in the environment. - 11887 - 11888 PAROK: - 11889 0000077D 2C30 sub al,'0' - 11890 0000077F 7239 jb short NEEDENV ; look for parameter in the environment - 11891 00000781 3C09 cmp al,9 - 11892 00000783 7735 ja short NEEDENV - 11893 - 11894 ; We have found %. This is taken from the parameters in the - 11895 ; allocated batch area. + 11832 ; We have read in an entire line. + 11833 ; Decide whether we should echo the command line or not. + 11834 + 11835 FOUND_EOL: + 11836 0000072E 81EF[579A] sub di,COMBUF+3 + 11837 00000732 89F8 mov ax,di ; remember that we've not counted the CR + 11838 00000734 26A2[559A] mov [es:COMBUF+1],al + 11839 ; Set length of line + 11840 00000738 E84403 call GETBATBYT ; Eat linefeed + 11841 0000073B E8F206 call BATCLOSE + 11842 0000073E 803E[9E02]00 cmp byte [Suppress],NO_ECHO ; 0 + 11843 00000743 7407 jz short RESET + 11844 00000745 F606[9D02]01 test byte [EchoFlag],1 ; To echo or not to echo, that is the + 11845 0000074A 7504 jnz short TRY_NEXTFLAG ; question. (Profound, huh?) + 11846 RESET: + 11847 0000074C 0E push cs + 11848 0000074D 1F pop ds ; Go back to local segment + 11849 0000074E 74B9 jz short READBAT_RETN ; no echoing here... + 11850 TRY_NEXTFLAG: + 11851 00000750 803E[B402]01 cmp byte [NullFlag],nullcommand ; 1 + 11852 ;G was there a command last time? + 11853 00000755 7403 jz short NO_CRLF_PRINT + 11854 ;G no - don't print crlf + 11855 00000757 E81F22 call CRLF2 ;G Print out prompt + 11856 NO_CRLF_PRINT: + 11857 0000075A E89319 call PRINT_PROMPT + 11858 0000075D 0E push cs ;G change data segment + 11859 0000075E 1F pop ds + 11860 0000075F BA[569A] mov dx,COMBUF+2 ; get command line for echoing + 11861 00000762 E86D22 call CRPRINT + 11862 ;call CRLF2 + 11863 ;retn + 11864 ; 06/02/2023 + 11865 00000765 E91122 jmp CRLF2 + 11866 + 11867 ; The line was too long. Eat remainder of input text up until the CR + 11868 + 11869 TOOLONG: + 11870 00000768 3C0D cmp al,0Dh ; Has the end of the line been reached? + 11871 0000076A 7403 jz short LTLCONT ; Yes, continue + 11872 0000076C E89400 call SKIPTOEOL ; Eat remainder of line + 11873 LTLCONT: + 11874 0000076F AA stosb ; Terminate the command + 11875 00000770 EBBC jmp short FOUND_EOL ; Go process the valid part of the line + 11876 + 11877 ; We have found a parameter lead-in character. Check for the 0-9 case first + 11878 + 11879 NEEDPARM: + 11880 00000772 E80A03 call GETBATBYT ; get next character + 11881 00000775 3C25 cmp al,'%' ; Check for two consecutive % + 11882 00000777 74B0 je short SAVBATBYT ; if so, replace with a single % + 11883 00000779 3C0D cmp al,0Dh ; Check for end-of-line + 11884 0000077B 74AC je short SAVBATBYT ; yes, treat it normally + 11885 + 11886 ; We have found %. If the is in the range 0-9, we + 11887 ; retrieve the appropriate parameter from the batch segment. Otherwise we + 11888 ; see if the has a terminating % and then look up the contents + 11889 ; in the environment. + 11890 + 11891 PAROK: + 11892 0000077D 2C30 sub al,'0' + 11893 0000077F 7239 jb short NEEDENV ; look for parameter in the environment + 11894 00000781 3C09 cmp al,9 + 11895 00000783 7735 ja short NEEDENV 11896 - 11897 00000785 98 cbw - 11898 00000786 89C3 mov bx,ax ; move index into AX - 11899 00000788 D1E3 shl bx,1 ; convert word index into byte ptr - 11900 0000078A 06 push es - 11901 0000078B 8E06[4902] mov es,[Batch] - 11902 - 11903 ; The structure of the batch area is: - 11904 ; - 11905 ; BYTE type of segment - 11906 ; DWORD offset for next line - 11907 ; 10 WORD pointers to parameters. -1 is empty parameter - 11908 ; ASCIZ file name (with . and ..) - 11909 ; BYTES CR-terminated parameters - 11910 ; BYTE 0 flag to indicate end of parameters - 11911 ; - 11912 ; Get pointer to BX'th argument - 11913 - 11914 ;;mov si,[es:bx+0Bh] - 11915 ; 05/02/2023 - 11916 ;mov si,[es:bx+0Ch] ; MSDOS 5.0 COMMAND.COM - 11917 0000078F 268B770C mov si,[es:bx+BATCHSEGMENT.BatParm] - 11918 00000793 07 pop es - 11919 - 11920 ; Is there a parameter here? - 11921 - 11922 00000794 83FEFF cmp si,-1 ; Check if parameter exists - 11923 00000797 7503 jnz short YES_THERE_IS ; Yes go get it - 11924 00000799 E96EFF jmp RDBAT ; Ignore if it doesn't - 11925 - 11926 ; Copy in the found parameter from batch segment - 11927 - 11928 YES_THERE_IS: - 11929 0000079C 1E push ds - 11930 0000079D 8E1E[4902] mov ds,[Batch] - 11931 000007A1 49 dec cx ; Don't count '%' in line length - 11932 COPYPARM: - 11933 000007A2 AC lodsb ; From resident segment - 11934 000007A3 3C0D cmp al,0Dh ; Check for end of parameter - 11935 000007A5 740F je short ENDPARAM - 11936 000007A7 41 inc cx ; Inc the line length - 11937 000007A8 81F98000 cmp cx,COMBUFLEN ; 128 ; Is it too long? - 11938 000007AC 7303 jnb short LINETOOL ; Yes - handle it, handle it - 11939 000007AE AA stosb - 11940 000007AF EBF1 jmp short COPYPARM - 11941 - 11942 ; We have copied up to the limit. Stop copying and eat remainder of batch - 11943 ; line. We need to make sure that the tooLong code isn't fooled into - 11944 ; believing that we are at EOL. Clobber AL too. - 11945 - 11946 LINETOOL: - 11947 000007B1 30C0 xor al,al - 11948 000007B3 1F pop ds - 11949 000007B4 EBB2 jmp short TOOLONG - 11950 - 11951 ; We have copied in an entire parameter. Go back for more - 11952 - 11953 ENDPARAM: - 11954 000007B6 1F pop ds - 11955 000007B7 E950FF jmp RDBAT - 11956 - 11957 ; We have found % followed by something other than 0-9. We presume that there - 11958 ; will be a following % character. In between is an environment variable that - 11959 ; we will fetch and replace in the batch line with its value. - 11960 - 11961 NEEDENV: - 11962 ; MSDOS 6.0 COMMAND.COM - 11963 ; 05/02/2023 - 11964 000007BA 49 dec cx ;AN070; Don't count "%" - 11965 - 11966 ; MSDOS 3.3 (& MSDOS 6.0) - 11967 000007BB 1E push ds - 11968 000007BC 57 push di - 11969 ; temp spot for name - 11970 000007BD BF[BB9C] mov di,ID - 11971 000007C0 0430 add al,'0' ; reconvert character - 11972 000007C2 AA stosb ; store it in appropriate place - 11973 - 11974 ; loop getting characters until the next % is found or until EOL - 11975 - 11976 GETENV1: - 11977 000007C3 E8B902 call GETBATBYT ; get the byte - 11978 000007C6 AA stosb ; store it - 11979 000007C7 3C0D cmp al,0Dh ; EOL? - 11980 000007C9 7514 jne short GETENV15 ; no, see if it the term char - 11981 - 11982 ; The user entered a string with a % but no trailing %. We copy the string. - 11983 - 11984 000007CB 26C645FF00 mov byte [es:di-1],0 ; nul terminate the string - 11985 000007D0 BE[BB9C] mov si,ID ; point to buffer - 11986 000007D3 5F pop di ; point to line buffer - 11987 000007D4 0E push cs - 11988 000007D5 1F pop ds - 11989 000007D6 E89302 call STRCPY - 11990 ; 05/02/2023 - 11991 000007D9 72D6 jc short LINETOOL ; MSDOS 6.0 COMMAND.COM - 11992 ; 24/04/2023 - 11993 ;dec di ; MSDOS 3.3 COMMAND.COM - 11994 000007DB 1F pop ds - 11995 000007DC E94AFF jmp SAVBATBYT - 11996 GETENV15: - 11997 000007DF 3C25 cmp al,'%' ; terminating %? - 11998 000007E1 75E0 jne short GETENV1 ; no, go suck out more characters - 11999 - 12000 ; M017 - following DEC is wrong, because we replace the % with a = here. - 12001 ; This was the source of bug #1. - 12002 ; dec cx ;AN070; Don't count "%" - 12003 - 12004 000007E3 B03D mov al,'=' ; terminate with = - 12005 000007E5 268845FF mov [es:di-1],al + 11897 ; We have found %. This is taken from the parameters in the + 11898 ; allocated batch area. + 11899 + 11900 00000785 98 cbw + 11901 00000786 89C3 mov bx,ax ; move index into AX + 11902 00000788 D1E3 shl bx,1 ; convert word index into byte ptr + 11903 0000078A 06 push es + 11904 0000078B 8E06[4902] mov es,[Batch] + 11905 + 11906 ; The structure of the batch area is: + 11907 ; + 11908 ; BYTE type of segment + 11909 ; DWORD offset for next line + 11910 ; 10 WORD pointers to parameters. -1 is empty parameter + 11911 ; ASCIZ file name (with . and ..) + 11912 ; BYTES CR-terminated parameters + 11913 ; BYTE 0 flag to indicate end of parameters + 11914 ; + 11915 ; Get pointer to BX'th argument + 11916 + 11917 ;;mov si,[es:bx+0Bh] + 11918 ; 05/02/2023 + 11919 ;mov si,[es:bx+0Ch] ; MSDOS 5.0 COMMAND.COM + 11920 0000078F 268B770C mov si,[es:bx+BATCHSEGMENT.BatParm] + 11921 00000793 07 pop es + 11922 + 11923 ; Is there a parameter here? + 11924 + 11925 00000794 83FEFF cmp si,-1 ; Check if parameter exists + 11926 00000797 7503 jnz short YES_THERE_IS ; Yes go get it + 11927 00000799 E96EFF jmp RDBAT ; Ignore if it doesn't + 11928 + 11929 ; Copy in the found parameter from batch segment + 11930 + 11931 YES_THERE_IS: + 11932 0000079C 1E push ds + 11933 0000079D 8E1E[4902] mov ds,[Batch] + 11934 000007A1 49 dec cx ; Don't count '%' in line length + 11935 COPYPARM: + 11936 000007A2 AC lodsb ; From resident segment + 11937 000007A3 3C0D cmp al,0Dh ; Check for end of parameter + 11938 000007A5 740F je short ENDPARAM + 11939 000007A7 41 inc cx ; Inc the line length + 11940 000007A8 81F98000 cmp cx,COMBUFLEN ; 128 ; Is it too long? + 11941 000007AC 7303 jnb short LINETOOL ; Yes - handle it, handle it + 11942 000007AE AA stosb + 11943 000007AF EBF1 jmp short COPYPARM + 11944 + 11945 ; We have copied up to the limit. Stop copying and eat remainder of batch + 11946 ; line. We need to make sure that the tooLong code isn't fooled into + 11947 ; believing that we are at EOL. Clobber AL too. + 11948 + 11949 LINETOOL: + 11950 000007B1 30C0 xor al,al + 11951 000007B3 1F pop ds + 11952 000007B4 EBB2 jmp short TOOLONG + 11953 + 11954 ; We have copied in an entire parameter. Go back for more + 11955 + 11956 ENDPARAM: + 11957 000007B6 1F pop ds + 11958 000007B7 E950FF jmp RDBAT + 11959 + 11960 ; We have found % followed by something other than 0-9. We presume that there + 11961 ; will be a following % character. In between is an environment variable that + 11962 ; we will fetch and replace in the batch line with its value. + 11963 + 11964 NEEDENV: + 11965 ; MSDOS 6.0 COMMAND.COM + 11966 ; 05/02/2023 + 11967 000007BA 49 dec cx ;AN070; Don't count "%" + 11968 + 11969 ; MSDOS 3.3 (& MSDOS 6.0) + 11970 000007BB 1E push ds + 11971 000007BC 57 push di + 11972 ; temp spot for name + 11973 000007BD BF[BB9C] mov di,ID + 11974 000007C0 0430 add al,'0' ; reconvert character + 11975 000007C2 AA stosb ; store it in appropriate place + 11976 + 11977 ; loop getting characters until the next % is found or until EOL + 11978 + 11979 GETENV1: + 11980 000007C3 E8B902 call GETBATBYT ; get the byte + 11981 000007C6 AA stosb ; store it + 11982 000007C7 3C0D cmp al,0Dh ; EOL? + 11983 000007C9 7514 jne short GETENV15 ; no, see if it the term char + 11984 + 11985 ; The user entered a string with a % but no trailing %. We copy the string. + 11986 + 11987 000007CB 26C645FF00 mov byte [es:di-1],0 ; nul terminate the string + 11988 000007D0 BE[BB9C] mov si,ID ; point to buffer + 11989 000007D3 5F pop di ; point to line buffer + 11990 000007D4 0E push cs + 11991 000007D5 1F pop ds + 11992 000007D6 E89302 call STRCPY + 11993 ; 05/02/2023 + 11994 000007D9 72D6 jc short LINETOOL ; MSDOS 6.0 COMMAND.COM + 11995 ; 24/04/2023 + 11996 ;dec di ; MSDOS 3.3 COMMAND.COM + 11997 000007DB 1F pop ds + 11998 000007DC E94AFF jmp SAVBATBYT + 11999 GETENV15: + 12000 000007DF 3C25 cmp al,'%' ; terminating %? + 12001 000007E1 75E0 jne short GETENV1 ; no, go suck out more characters + 12002 + 12003 ; M017 - following DEC is wrong, because we replace the % with a = here. + 12004 ; This was the source of bug #1. + 12005 ; dec cx ;AN070; Don't count "%" 12006 - 12007 ; ID now either has a =-terminated string which we are to find in the - 12008 ; environment or a non =-terminated string which will not be found in the - 12009 ; environment. - 12010 - 12011 GETENV2: - 12012 000007E9 BE[BB9C] mov si,ID - 12013 000007EC 0E push cs - 12014 000007ED 1F pop ds ; DS:SI points to name - 12015 000007EE 51 push cx - 12016 000007EF E8C51E call find_name_in_environment - 12017 000007F2 59 pop cx - 12018 000007F3 06 push es - 12019 000007F4 1F pop ds - 12020 000007F5 0E push cs - 12021 000007F6 07 pop es - 12022 000007F7 89FE mov si,di - 12023 000007F9 5F pop di ; get back pointer to command line - 12024 - 12025 ; If the parameter was not found, there is no need to perform any replacement. - 12026 ; We merely pretend that we've copied the parameter. + 12007 000007E3 B03D mov al,'=' ; terminate with = + 12008 000007E5 268845FF mov [es:di-1],al + 12009 + 12010 ; ID now either has a =-terminated string which we are to find in the + 12011 ; environment or a non =-terminated string which will not be found in the + 12012 ; environment. + 12013 + 12014 GETENV2: + 12015 000007E9 BE[BB9C] mov si,ID + 12016 000007EC 0E push cs + 12017 000007ED 1F pop ds ; DS:SI points to name + 12018 000007EE 51 push cx + 12019 000007EF E8C51E call find_name_in_environment + 12020 000007F2 59 pop cx + 12021 000007F3 06 push es + 12022 000007F4 1F pop ds + 12023 000007F5 0E push cs + 12024 000007F6 07 pop es + 12025 000007F7 89FE mov si,di + 12026 000007F9 5F pop di ; get back pointer to command line 12027 - 12028 000007FA 7203 jc short GETENV6 - 12029 - 12030 ; ES:DI points to command line being built - 12031 ; DS:SI points either to nul-terminated environment object AFTER = + 12028 ; If the parameter was not found, there is no need to perform any replacement. + 12029 ; We merely pretend that we've copied the parameter. + 12030 + 12031 000007FA 7203 jc short GETENV6 12032 - 12033 000007FC E86D02 call STRCPY ; (let RdBat handle overflow) - 12034 ; 24/04/2022 - 12035 ;dec di ; MSDOS 3.3 COMMAND.COM - 12036 GETENV6: - 12037 000007FF 1F pop ds - 12038 00000800 E907FF jmp RDBAT ; go back to batch file - 12039 - 12040 ; =============== S U B R O U T I N E ======================================= - 12041 - 12042 ; SkipToEOL - read from batch file until end of line - 12043 - 12044 ; 06/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 12045 SKIPTOEOL: - 12046 00000803 F706[4902]FFFF test word [Batch],-1 ; 0FFFFh - 12047 ;jnz short SKIPTOEOL1 - 12048 ;retn ; no batch file in effect - 12049 - 12050 00000809 7407 jz short SKIPTOEOL2 ; Retro DOS v3.0 COMMAND.COM - 12051 SKIPTOEOL1: - 12052 0000080B E87102 call GETBATBYT - 12053 0000080E 3C0D cmp al,0Dh ; eol character? - 12054 00000810 75F1 jnz short SKIPTOEOL ; no, go eat another - 12055 SKIPTOEOL2: - 12056 00000812 C3 retn - 12057 - 12058 ; =============== S U B R O U T I N E ======================================= - 12059 - 12060 ;Break - 12061 - 12062 ; Free Transient. Modify ES,AX,flags - 12063 - 12064 ; 06/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 12065 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0708h + 12033 ; ES:DI points to command line being built + 12034 ; DS:SI points either to nul-terminated environment object AFTER = + 12035 + 12036 000007FC E86D02 call STRCPY ; (let RdBat handle overflow) + 12037 ; 24/04/2022 + 12038 ;dec di ; MSDOS 3.3 COMMAND.COM + 12039 GETENV6: + 12040 000007FF 1F pop ds + 12041 00000800 E907FF jmp RDBAT ; go back to batch file + 12042 + 12043 ; =============== S U B R O U T I N E ======================================= + 12044 + 12045 ; SkipToEOL - read from batch file until end of line + 12046 + 12047 ; 06/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 12048 SKIPTOEOL: + 12049 00000803 F706[4902]FFFF test word [Batch],-1 ; 0FFFFh + 12050 ;jnz short SKIPTOEOL1 + 12051 ;retn ; no batch file in effect + 12052 + 12053 00000809 7407 jz short SKIPTOEOL2 ; Retro DOS v3.0 COMMAND.COM + 12054 SKIPTOEOL1: + 12055 0000080B E87102 call GETBATBYT + 12056 0000080E 3C0D cmp al,0Dh ; eol character? + 12057 00000810 75F1 jnz short SKIPTOEOL ; no, go eat another + 12058 SKIPTOEOL2: + 12059 00000812 C3 retn + 12060 + 12061 ; =============== S U B R O U T I N E ======================================= + 12062 + 12063 ;Break + 12064 + 12065 ; Free Transient. Modify ES,AX,flags 12066 - 12067 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 12068 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:081Eh - 12069 FREE_TPA: - 12070 00000813 06 push es - 12071 00000814 8E06[F59B] mov es,[RESSEG] - 12072 00000818 268E06[5804] mov es,[es:Res_Tpa] - 12073 0000081D B449 mov ah,49h - 12074 ;mov ah,DEALLOC ; 49h - 12075 - 12076 ; 25/07/2024 - 12077 ; PCDOS 7.1 COMMAND.COM - 12078 %if 0 - 12079 int 21h ; DOS - 2+ - FREE MEMORY - 12080 ; ES = segment address of area to be freed - 12081 %else - 12082 0000081F E898FD call int_21h_indirect - 12083 %endif - 12084 - 12085 00000822 07 pop es - 12086 00000823 C3 retn + 12067 ; 06/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 12068 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0708h + 12069 + 12070 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 12071 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:081Eh + 12072 FREE_TPA: + 12073 00000813 06 push es + 12074 00000814 8E06[F59B] mov es,[RESSEG] + 12075 00000818 268E06[5804] mov es,[es:Res_Tpa] + 12076 0000081D B449 mov ah,49h + 12077 ;mov ah,DEALLOC ; 49h + 12078 + 12079 ; 25/07/2024 + 12080 ; PCDOS 7.1 COMMAND.COM + 12081 %if 0 + 12082 int 21h ; DOS - 2+ - FREE MEMORY + 12083 ; ES = segment address of area to be freed + 12084 %else + 12085 0000081F E898FD call int_21h_indirect + 12086 %endif 12087 - 12088 ; =============== S U B R O U T I N E ======================================= - 12089 - 12090 ; Allocate transient. Modify AX,BX,DX,flags - 12091 - 12092 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM - 12093 ; 06/02/2023 - 12094 ALLOC_TPA: - 12095 00000824 06 push es - 12096 00000825 8E06[F59B] mov es,[RESSEG] - 12097 00000829 BBFFFF mov bx,0FFFFh ; Re-allocate the transient - 12098 0000082C B448 mov ah,48h - 12099 ;mov ah,ALLOC ; 48h - 12100 - 12101 ; 25/07/2024 - 12102 ; PCDOS 7.1 COMMAND.COM - 12103 %if 0 - 12104 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 12105 ; BX = number of 16-byte paragraphs desired - 12106 %else - 12107 0000082E E889FD call int_21h_indirect - 12108 %endif - 12109 - 12110 00000831 53 push bx ; Save size of block - 12111 00000832 B448 mov ah,48h - 12112 ;mov ah,ALLOC ; 48h - 12113 - 12114 ; 25/07/2024 - 12115 ; PCDOS 7.1 COMMAND.COM - 12116 %if 0 - 12117 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 12118 ; BX = number of 16-byte paragraphs desired - 12119 %else - 12120 00000834 E883FD call int_21h_indirect - 12121 %endif - 12122 - 12123 ; Attempt to align TPA on 64K boundary - 12124 - 12125 00000837 5B pop bx ; Restore size of block - 12126 00000838 26A3[5804] mov [es:Res_Tpa],ax - 12127 ; Save segment to beginning of block - 12128 0000083C A3[039C] mov [TRAN_TPA],ax - 12129 - 12130 ; Is the segment already aligned on a 64K boundary - 12131 - 12132 0000083F 89C2 mov dx,ax ; Save segment - 12133 00000841 25FF0F and ax,0FFFh ; Test if above boundary - 12134 00000844 7507 jnz short CALC_TPA - 12135 00000846 89D0 mov ax,dx - 12136 00000848 2500F0 and ax,0F000h ; Test if multiple of 64K - 12137 0000084B 7523 jnz short NOROUND - 12138 CALC_TPA: - 12139 0000084D 89D0 mov ax,dx - 12140 0000084F 2500F0 and ax,0F000h - 12141 00000852 050010 add ax,1000h ; Round up to next 64K boundary - 12142 00000855 7219 jc short NOROUND ; Memory wrap if carry set - 12143 - 12144 ; Make sure that new boundary is within allocated range - 12145 - 12146 00000857 268B16[5804] mov dx,[es:Res_Tpa] - 12147 0000085C 01DA add dx,bx ; Compute maximum address - 12148 0000085E 39C2 cmp dx,ax ; Is 64K address out of range? - 12149 00000860 720E jb short NOROUND - 12150 - 12151 ; Make sure that we won't overwrite the transient - 12152 - 12153 00000862 8CCB mov bx,cs ; CS is beginning of transient - 12154 00000864 39C3 cmp bx,ax - 12155 00000866 7208 jb short NOROUND - 12156 - 12157 ; The area from the 64K boundary to the beginning of the transient must - 12158 ; be at least 64K. + 12088 00000822 07 pop es + 12089 00000823 C3 retn + 12090 + 12091 ; =============== S U B R O U T I N E ======================================= + 12092 + 12093 ; Allocate transient. Modify AX,BX,DX,flags + 12094 + 12095 ; 25/07/2024 - Retro DOS v5.0 COMMAND.COM + 12096 ; 06/02/2023 + 12097 ALLOC_TPA: + 12098 00000824 06 push es + 12099 00000825 8E06[F59B] mov es,[RESSEG] + 12100 00000829 BBFFFF mov bx,0FFFFh ; Re-allocate the transient + 12101 0000082C B448 mov ah,48h + 12102 ;mov ah,ALLOC ; 48h + 12103 + 12104 ; 25/07/2024 + 12105 ; PCDOS 7.1 COMMAND.COM + 12106 %if 0 + 12107 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 12108 ; BX = number of 16-byte paragraphs desired + 12109 %else + 12110 0000082E E889FD call int_21h_indirect + 12111 %endif + 12112 + 12113 00000831 53 push bx ; Save size of block + 12114 00000832 B448 mov ah,48h + 12115 ;mov ah,ALLOC ; 48h + 12116 + 12117 ; 25/07/2024 + 12118 ; PCDOS 7.1 COMMAND.COM + 12119 %if 0 + 12120 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 12121 ; BX = number of 16-byte paragraphs desired + 12122 %else + 12123 00000834 E883FD call int_21h_indirect + 12124 %endif + 12125 + 12126 ; Attempt to align TPA on 64K boundary + 12127 + 12128 00000837 5B pop bx ; Restore size of block + 12129 00000838 26A3[5804] mov [es:Res_Tpa],ax + 12130 ; Save segment to beginning of block + 12131 0000083C A3[039C] mov [TRAN_TPA],ax + 12132 + 12133 ; Is the segment already aligned on a 64K boundary + 12134 + 12135 0000083F 89C2 mov dx,ax ; Save segment + 12136 00000841 25FF0F and ax,0FFFh ; Test if above boundary + 12137 00000844 7507 jnz short CALC_TPA + 12138 00000846 89D0 mov ax,dx + 12139 00000848 2500F0 and ax,0F000h ; Test if multiple of 64K + 12140 0000084B 7523 jnz short NOROUND + 12141 CALC_TPA: + 12142 0000084D 89D0 mov ax,dx + 12143 0000084F 2500F0 and ax,0F000h + 12144 00000852 050010 add ax,1000h ; Round up to next 64K boundary + 12145 00000855 7219 jc short NOROUND ; Memory wrap if carry set + 12146 + 12147 ; Make sure that new boundary is within allocated range + 12148 + 12149 00000857 268B16[5804] mov dx,[es:Res_Tpa] + 12150 0000085C 01DA add dx,bx ; Compute maximum address + 12151 0000085E 39C2 cmp dx,ax ; Is 64K address out of range? + 12152 00000860 720E jb short NOROUND + 12153 + 12154 ; Make sure that we won't overwrite the transient + 12155 + 12156 00000862 8CCB mov bx,cs ; CS is beginning of transient + 12157 00000864 39C3 cmp bx,ax + 12158 00000866 7208 jb short NOROUND 12159 - 12160 00000868 29C3 sub bx,ax - 12161 ;cmp bx,4096 - 12162 0000086A 81FB0010 cmp bx,1000h ; Size greater than 64K? - 12163 0000086E 7304 jnb short ROUNDDONE - 12164 NOROUND: - 12165 00000870 26A1[5804] mov ax,[es:Res_Tpa] - 12166 ROUNDDONE: - 12167 00000874 26A3[4C04] mov [es:LTpa],ax ; Re-compute everything - 12168 00000878 A3[F79B] mov [TPA],ax - 12169 0000087B 89C3 mov bx,ax - 12170 0000087D 8CC8 mov ax,cs - 12171 0000087F 29D8 sub ax,bx - 12172 00000881 53 push bx - 12173 00000882 BB1000 mov bx,16 - 12174 00000885 F7E3 mul bx - 12175 00000887 5B pop bx - 12176 00000888 09D2 or dx,dx - 12177 0000088A 7403 jz short SAVSIZ2 - 12178 0000088C B8FFFF mov ax,-1 - 12179 SAVSIZ2: - 12180 - 12181 ; AX is the number of bytes free in the buffer between the resident and the - 12182 ; transient with a maximum of 64K-1. We round this down to a multiple of 512. + 12160 ; The area from the 64K boundary to the beginning of the transient must + 12161 ; be at least 64K. + 12162 + 12163 00000868 29C3 sub bx,ax + 12164 ;cmp bx,4096 + 12165 0000086A 81FB0010 cmp bx,1000h ; Size greater than 64K? + 12166 0000086E 7304 jnb short ROUNDDONE + 12167 NOROUND: + 12168 00000870 26A1[5804] mov ax,[es:Res_Tpa] + 12169 ROUNDDONE: + 12170 00000874 26A3[4C04] mov [es:LTpa],ax ; Re-compute everything + 12171 00000878 A3[F79B] mov [TPA],ax + 12172 0000087B 89C3 mov bx,ax + 12173 0000087D 8CC8 mov ax,cs + 12174 0000087F 29D8 sub ax,bx + 12175 00000881 53 push bx + 12176 00000882 BB1000 mov bx,16 + 12177 00000885 F7E3 mul bx + 12178 00000887 5B pop bx + 12179 00000888 09D2 or dx,dx + 12180 0000088A 7403 jz short SAVSIZ2 + 12181 0000088C B8FFFF mov ax,-1 + 12182 SAVSIZ2: 12183 - 12184 0000088F 3D0002 cmp ax,512 - 12185 00000892 7603 jbe short GOTSIZE2 - 12186 ;and ax,~1FFh - 12187 00000894 2500FE and ax,0FE00h ; NOT 511 = NOT 1FFh - 12188 GOTSIZE2: - 12189 00000897 A3[159C] mov [BYTCNT],ax - 12190 0000089A 07 pop es - 12191 0000089B C3 retn - 12192 - 12193 ; =============== S U B R O U T I N E ======================================= - 12194 - 12195 ;Break - 12196 - 12197 ; The exec search has determined that the user has requested a batch file for - 12198 ; execution. We parse the arguments, create the batch segment, and signal - 12199 ; batch processing. - 12200 - 12201 ; 12/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 12202 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:078Eh + 12184 ; AX is the number of bytes free in the buffer between the resident and the + 12185 ; transient with a maximum of 64K-1. We round this down to a multiple of 512. + 12186 + 12187 0000088F 3D0002 cmp ax,512 + 12188 00000892 7603 jbe short GOTSIZE2 + 12189 ;and ax,~1FFh + 12190 00000894 2500FE and ax,0FE00h ; NOT 511 = NOT 1FFh + 12191 GOTSIZE2: + 12192 00000897 A3[159C] mov [BYTCNT],ax + 12193 0000089A 07 pop es + 12194 0000089B C3 retn + 12195 + 12196 ; =============== S U B R O U T I N E ======================================= + 12197 + 12198 ;Break + 12199 + 12200 ; The exec search has determined that the user has requested a batch file for + 12201 ; execution. We parse the arguments, create the batch segment, and signal + 12202 ; batch processing. 12203 - 12204 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 12205 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0868h + 12204 ; 12/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 12205 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:078Eh 12206 - 12207 ; 18/07/2024 - Retro DOS 5.0 COMMAND.COM - 12208 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:08A7h + 12207 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 12208 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0868h 12209 - 12210 BATCOM: - 12211 - 12212 ;ASSUME DS:TRANGROUP, ES:NOTHING - 12213 - 12214 ; Batch parameters are read with ES set to segment of resident part - 12215 - 12216 ; MSDOS 6.0 - 12217 0000089C 8E06[F59B] mov es,[RESSEG] - 12218 ;ASSUME ES:RESGROUP - 12219 ;cmp byte [es:Call_Batch_Flag],1 - 12220 000008A0 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress - 12221 ;AN043; If in CALL, - 12222 000008A6 7403 jz short skip_ioset ;AN043; redirection was already set up - 12223 ;invoke IOSET ; Set up any redirection - 12224 000008A8 E80527 call IOSET - 12225 skip_ioset: ;AN043; - 12226 000008AB E865FF call FREE_TPA ; G - 12227 ;cmp byte [es:Call_Batch_Flag],1 - 12228 000008AE 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress - 12229 000008B4 7403 jz short GETECHO ; G if we're in a call, don't execute - 12230 - 12231 ; 12/02/2023 - 12232 ; MSDOS 3.3 - 12233 ;call IOSET - 12234 ;mov es,[RESSEG] - 12235 ;call FREE_TPA - 12236 ;;cmp byte [es:CALL_BATCH_FLAG],1 - 12237 ;cmp byte [es:CALL_BATCH_FLAG],call_in_progress - 12238 ;jz short GETECHO ; G if we're in a call, don't execute - 12239 - 12240 ; MSDOS 3.3 (& MSDOS 6.0) - 12241 - 12242 ; Since BATCH has lower precedence than PIPE or FOR. If a new BATCH file is - 12243 ; being started it MUST be true that no FOR or PIPE is currently in progress. - 12244 ; Don't execute if in call - 12245 - 12246 000008B6 E8A008 call FOROFF - 12247 GETECHO: - 12248 000008B9 E8EB2A call PipeOff - 12249 000008BC 26A0[9D02] mov al,[es:EchoFlag] ; preserve echo state for chaining - 12250 000008C0 2401 and al,1 ; Save current echo state - 12251 - 12252 000008C2 50 push ax - 12253 000008C3 31C0 xor ax,ax - 12254 000008C5 26F706[4902]FFFF test word [es:Batch],-1 ; Are we in a batch file? - 12255 000008CC 7414 jz short LEAVEBAT ; No, nothing to save - 12256 000008CE 26A1[4902] mov ax,[es:Batch] ; Get current batch segment - 12257 ;cmp byte [es:Call_Batch_Flag],1 - 12258 000008D2 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress - 12259 000008D8 7408 jz short LEAVEBAT - 12260 - 12261 ; We are in a chained batch file, save batlast from previous batch segment - 12262 ; so that if we're in a CALL, we will return to the correct batch file. + 12210 ; 18/07/2024 - Retro DOS 5.0 COMMAND.COM + 12211 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:08A7h + 12212 + 12213 BATCOM: + 12214 + 12215 ;ASSUME DS:TRANGROUP, ES:NOTHING + 12216 + 12217 ; Batch parameters are read with ES set to segment of resident part + 12218 + 12219 ; MSDOS 6.0 + 12220 0000089C 8E06[F59B] mov es,[RESSEG] + 12221 ;ASSUME ES:RESGROUP + 12222 ;cmp byte [es:Call_Batch_Flag],1 + 12223 000008A0 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress + 12224 ;AN043; If in CALL, + 12225 000008A6 7403 jz short skip_ioset ;AN043; redirection was already set up + 12226 ;invoke IOSET ; Set up any redirection + 12227 000008A8 E80527 call IOSET + 12228 skip_ioset: ;AN043; + 12229 000008AB E865FF call FREE_TPA ; G + 12230 ;cmp byte [es:Call_Batch_Flag],1 + 12231 000008AE 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress + 12232 000008B4 7403 jz short GETECHO ; G if we're in a call, don't execute + 12233 + 12234 ; 12/02/2023 + 12235 ; MSDOS 3.3 + 12236 ;call IOSET + 12237 ;mov es,[RESSEG] + 12238 ;call FREE_TPA + 12239 ;;cmp byte [es:CALL_BATCH_FLAG],1 + 12240 ;cmp byte [es:CALL_BATCH_FLAG],call_in_progress + 12241 ;jz short GETECHO ; G if we're in a call, don't execute + 12242 + 12243 ; MSDOS 3.3 (& MSDOS 6.0) + 12244 + 12245 ; Since BATCH has lower precedence than PIPE or FOR. If a new BATCH file is + 12246 ; being started it MUST be true that no FOR or PIPE is currently in progress. + 12247 ; Don't execute if in call + 12248 + 12249 000008B6 E8A008 call FOROFF + 12250 GETECHO: + 12251 000008B9 E8EB2A call PipeOff + 12252 000008BC 26A0[9D02] mov al,[es:EchoFlag] ; preserve echo state for chaining + 12253 000008C0 2401 and al,1 ; Save current echo state + 12254 + 12255 000008C2 50 push ax + 12256 000008C3 31C0 xor ax,ax + 12257 000008C5 26F706[4902]FFFF test word [es:Batch],-1 ; Are we in a batch file? + 12258 000008CC 7414 jz short LEAVEBAT ; No, nothing to save + 12259 000008CE 26A1[4902] mov ax,[es:Batch] ; Get current batch segment + 12260 ;cmp byte [es:Call_Batch_Flag],1 + 12261 000008D2 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress + 12262 000008D8 7408 jz short LEAVEBAT 12263 - 12264 000008DA 06 push es - 12265 000008DB 8EC0 mov es,ax ; Get current batch segment - 12266 ;mov ax,[es:02h] ; MSDOS 3.3 COMMAND.COM - 12267 ; Get previous batch segment - 12268 ; 12/02/2023 - 12269 ;mov ax,[es:03h] ; MSDOS 6.0 (&5.0) COMMAND.COM - 12270 000008DD 26A10300 mov ax,[es:BATCHSEGMENT.BatLast] - 12271 000008E1 07 pop es - 12272 LEAVEBAT: - 12273 000008E2 50 push ax ; Keep segment until new one created - 12274 ;cmp byte [es:Call_Batch_Flag],1 - 12275 000008E3 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress - 12276 000008E9 7403 jz short STARTBAT - 12277 000008EB E82401 call BATCHOFF - 12278 - 12279 ; Find length of batch file - 12280 - 12281 STARTBAT: - 12282 000008EE 26C606[B102]00 mov byte [es:Call_Batch_Flag],0 ; Reset call flag - 12283 000008F4 BE[1D9B] mov si,EXECPATH - 12284 - 12285 ; 12/02/2023 - 12286 ; MSDOS 6.0 - 12287 000008F7 B811B7 mov ax,0B711h - 12288 ;mov ax,AppendTruename - 12289 ;AN042; Get the real path where the batch file - 12290 000008FA CD2F int 2Fh ;AN042; was found with APPEND - 12291 000008FC B44E mov ah,4Eh - 12292 ;mov ah,Find_First ;AN042; The find_first will return it - 12293 000008FE 89F2 mov dx,si ;AN042; Get the string - 12294 00000900 B91300 mov cx,13h - 12295 ;mov cx,search_attr ;AN042; filetypes to search for - 12296 - 12297 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM - 12298 %if 0 - 12299 int 21h ;AN042; - 12300 %else - 12301 00000903 E8B4FC call int_21h_indirect - 12302 %endif - 12303 - 12304 ; MSDOS 3.3 (& MSDOS 6.0) - 12305 00000906 E89627 call dstrlen - 12306 ; - 12307 ; Allocate batch area: - 12308 ; BYTE type of segment - 12309 ; WORD segment of last batch file - 12310 ; WORD segment for FOR command - 12311 ; BYTE FOR flag state on entry to batch file - 12312 ; DWORD offset for next line - 12313 ; 10 WORD pointers to parameters. -1 is empty parameter - 12314 ; ASCIZ file name (with . and ..) - 12315 ; BYTES CR-terminated parameters - 12316 ; BYTE 0 flag to indicate end of parameters - 12317 ; - 12318 ; We allocate the maximum size for the command line and use setblock to shrink - 12319 ; later when we've squeezed out the extra + 12264 ; We are in a chained batch file, save batlast from previous batch segment + 12265 ; so that if we're in a CALL, we will return to the correct batch file. + 12266 + 12267 000008DA 06 push es + 12268 000008DB 8EC0 mov es,ax ; Get current batch segment + 12269 ;mov ax,[es:02h] ; MSDOS 3.3 COMMAND.COM + 12270 ; Get previous batch segment + 12271 ; 12/02/2023 + 12272 ;mov ax,[es:03h] ; MSDOS 6.0 (&5.0) COMMAND.COM + 12273 000008DD 26A10300 mov ax,[es:BATCHSEGMENT.BatLast] + 12274 000008E1 07 pop es + 12275 LEAVEBAT: + 12276 000008E2 50 push ax ; Keep segment until new one created + 12277 ;cmp byte [es:Call_Batch_Flag],1 + 12278 000008E3 26803E[B102]01 cmp byte [es:Call_Batch_Flag],call_in_progress + 12279 000008E9 7403 jz short STARTBAT + 12280 000008EB E82401 call BATCHOFF + 12281 + 12282 ; Find length of batch file + 12283 + 12284 STARTBAT: + 12285 000008EE 26C606[B102]00 mov byte [es:Call_Batch_Flag],0 ; Reset call flag + 12286 000008F4 BE[1D9B] mov si,EXECPATH + 12287 + 12288 ; 12/02/2023 + 12289 ; MSDOS 6.0 + 12290 000008F7 B811B7 mov ax,0B711h + 12291 ;mov ax,AppendTruename + 12292 ;AN042; Get the real path where the batch file + 12293 000008FA CD2F int 2Fh ;AN042; was found with APPEND + 12294 000008FC B44E mov ah,4Eh + 12295 ;mov ah,Find_First ;AN042; The find_first will return it + 12296 000008FE 89F2 mov dx,si ;AN042; Get the string + 12297 00000900 B91300 mov cx,13h + 12298 ;mov cx,search_attr ;AN042; filetypes to search for + 12299 + 12300 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM + 12301 %if 0 + 12302 int 21h ;AN042; + 12303 %else + 12304 00000903 E8B4FC call int_21h_indirect + 12305 %endif + 12306 + 12307 ; MSDOS 3.3 (& MSDOS 6.0) + 12308 00000906 E89627 call dstrlen + 12309 ; + 12310 ; Allocate batch area: + 12311 ; BYTE type of segment + 12312 ; WORD segment of last batch file + 12313 ; WORD segment for FOR command + 12314 ; BYTE FOR flag state on entry to batch file + 12315 ; DWORD offset for next line + 12316 ; 10 WORD pointers to parameters. -1 is empty parameter + 12317 ; ASCIZ file name (with . and ..) + 12318 ; BYTES CR-terminated parameters + 12319 ; BYTE 0 flag to indicate end of parameters 12320 ; - 12321 00000909 89CB mov bx,cx ; length of file name. - 12322 ;add bx,190 ; MSDOS 3.3 (BATCHSEGMENT struc size = 32) - 12323 ; 12/02/2023 - 12324 ;add bx,191 ; MSDOS 6.0 (BATCHSEGMENT struc size = 33) - 12325 ; PCDOS 7.1 ; 26/07/2024 - 12326 ; 25/04/2023 - 12327 0000090B 81C3BF00 add bx,15+BATCHSEGMENT.SIZE+COMBUFLEN+15 - 12328 ; structure + max len + round up - 12329 0000090F 51 push cx - 12330 00000910 B104 mov cl,4 - 12331 00000912 D3EB shr bx,cl ; convert to paragraphs - 12332 00000914 53 push bx ; Save size of batch segment - 12333 00000915 B448 mov ah,48h - 12334 ;mov ah,ALLOC ; 48h ; Allocate batch segment - 12335 - 12336 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM - 12337 %if 0 - 12338 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 12339 ; BX = number of 16-byte paragraphs desired - 12340 %else - 12341 00000917 E8A0FC call int_21h_indirect - 12342 %endif - 12343 - 12344 0000091A 5B pop bx ; Get size of batch segment - 12345 - 12346 ; This should *NEVER* return an error. The transient is MUCH bigger than - 12347 ; the batch segment. This may not be true, however, in a multitasking system. - 12348 ; G This error will occur with nesting of batch files. We also need to - 12349 ; G make sure that we don't overlay the transient. - 12350 - 12351 0000091B 7222 jc short MEM_ERROR ;G not enough memory - exit - 12352 - 12353 0000091D 50 push ax ;G save batch segment - 12354 0000091E 01D8 add ax,bx ;G get end of batch segment - 12355 00000920 83C020 add ax,20h ;G add some tpa work area - 12356 00000923 8CCB mov bx,cs ;G get the transient segment - 12357 - 12358 ; MSDOS 6.0 - 12359 ; M006; We cant check just for above. If the batchseg goes into a UMB, the - 12360 ; M006; batchseg is always above the transient. We need to change this code - 12361 ; M006; to only check for an overlap - 12362 - 12363 ;;mov dx,offset TRANGROUP:TranSpaceEnd ; M006 - 12364 ; 12/02/2023 - 12365 ;;mov dx,98C5h ; MSDOS 5.0 COMMAND.COM - 12366 ; 18/07/2024 - 12367 ;mov dx,0AA9Ah ; PCDOS 7.1 COMMAND.COM - 12368 ;mov dx,TRANSPACEEND - 12369 ;add dx,15 ;round up para; M006 - 12370 00000925 BA1AA6 mov dx,TRANSPACEEND+15 - 12371 - 12372 00000928 D3EA shr dx,cl ;para size of transient; M006 - 12373 0000092A 01DA add dx,bx ;dx = top of transient; M006 + 12321 ; We allocate the maximum size for the command line and use setblock to shrink + 12322 ; later when we've squeezed out the extra + 12323 ; + 12324 00000909 89CB mov bx,cx ; length of file name. + 12325 ;add bx,190 ; MSDOS 3.3 (BATCHSEGMENT struc size = 32) + 12326 ; 12/02/2023 + 12327 ;add bx,191 ; MSDOS 6.0 (BATCHSEGMENT struc size = 33) + 12328 ; PCDOS 7.1 ; 26/07/2024 + 12329 ; 25/04/2023 + 12330 0000090B 81C3BF00 add bx,15+BATCHSEGMENT.SIZE+COMBUFLEN+15 + 12331 ; structure + max len + round up + 12332 0000090F 51 push cx + 12333 00000910 B104 mov cl,4 + 12334 00000912 D3EB shr bx,cl ; convert to paragraphs + 12335 00000914 53 push bx ; Save size of batch segment + 12336 00000915 B448 mov ah,48h + 12337 ;mov ah,ALLOC ; 48h ; Allocate batch segment + 12338 + 12339 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM + 12340 %if 0 + 12341 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 12342 ; BX = number of 16-byte paragraphs desired + 12343 %else + 12344 00000917 E8A0FC call int_21h_indirect + 12345 %endif + 12346 + 12347 0000091A 5B pop bx ; Get size of batch segment + 12348 + 12349 ; This should *NEVER* return an error. The transient is MUCH bigger than + 12350 ; the batch segment. This may not be true, however, in a multitasking system. + 12351 ; G This error will occur with nesting of batch files. We also need to + 12352 ; G make sure that we don't overlay the transient. + 12353 + 12354 0000091B 7222 jc short MEM_ERROR ;G not enough memory - exit + 12355 + 12356 0000091D 50 push ax ;G save batch segment + 12357 0000091E 01D8 add ax,bx ;G get end of batch segment + 12358 00000920 83C020 add ax,20h ;G add some tpa work area + 12359 00000923 8CCB mov bx,cs ;G get the transient segment + 12360 + 12361 ; MSDOS 6.0 + 12362 ; M006; We cant check just for above. If the batchseg goes into a UMB, the + 12363 ; M006; batchseg is always above the transient. We need to change this code + 12364 ; M006; to only check for an overlap + 12365 + 12366 ;;mov dx,offset TRANGROUP:TranSpaceEnd ; M006 + 12367 ; 12/02/2023 + 12368 ;;mov dx,98C5h ; MSDOS 5.0 COMMAND.COM + 12369 ; 18/07/2024 + 12370 ;mov dx,0AA9Ah ; PCDOS 7.1 COMMAND.COM + 12371 ;mov dx,TRANSPACEEND + 12372 ;add dx,15 ;round up para; M006 + 12373 00000925 BA1AA6 mov dx,TRANSPACEEND+15 12374 - 12375 0000092C 39D8 cmp ax,bx ; M006 - 12376 0000092E 7212 jb short ENOUGH_MEM - 12377 ; Batchseg below transient - 12378 ; enough memory ; M006 - 12379 00000930 39D0 cmp ax,dx ; M006 - 12380 00000932 770E ja short ENOUGH_MEM - 12381 ; Batchseg above transient - 12382 ; enough memory ; M006 - 12383 - 12384 ; M006; Batchseg overlaps transient -- insufficient memory - 12385 - 12386 00000934 58 pop ax ; restore ax; M006 - 12387 - 12388 ; 12/02/2023 - 12389 ; MSDOS 3.3 - 12390 ; M006; cmp ax,bx ;G do we end before the transient - 12391 ; M006; pop ax ;G get batch segment back - 12392 ; M006; jb short ENOUGH_MEM ;G we have enough memory - continue - 12393 - 12394 ; MSDOS 3.3 (& MSDOS 6.0) - 12395 00000935 06 push es ;G no we're hitting the transient - 12396 00000936 8EC0 mov es,ax - 12397 00000938 B80049 mov ax,4900h - 12398 ;mov ax,DEALLOC*256 ; 4900h ;G deallocate the batch segment - 12399 - 12400 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM - 12401 %if 0 - 12402 int 21h ; DOS - 2+ - FREE MEMORY - 12403 ; ES = segment address of area to be freed - 12404 %else - 12405 0000093B E87CFC call int_21h_indirect - 12406 %endif - 12407 - 12408 0000093E 07 pop es - 12409 MEM_ERROR: - 12410 0000093F E9B900 jmp NO_MEMORY ;G Set up for message and exit - 12411 - 12412 ENOUGH_MEM: - 12413 ; 12/02/2023 - Retro DOS v4.0 COMMAND.COM - 12414 ; MSDOS 6.0 - 12415 00000942 58 pop ax ; restore ax; M006 - 12416 - 12417 ; MSDOS 3.3 (& MSDOS 6.0) - 12418 00000943 26A3[4902] mov [es:Batch],ax - 12419 00000947 E8DAFE call ALLOC_TPA - 12420 - 12421 ; Initialize batch segment - 12422 - 12423 0000094A 5A pop dx ; length of name - 12424 0000094B 58 pop ax ;G get saved batch segment back - 12425 0000094C 26FF06[AE02] inc word [es:Nest] ;G increment # batch files in progress - 12426 00000951 06 push es - 12427 00000952 268E06[4902] mov es,[es:Batch] - 12428 ;mov byte [ES:0],0 - 12429 ; signal batch file type - 12430 00000957 26C606000000 mov byte [es:BATCHSEGMENT.BatType],BATCHTYPE ; 0 - 12431 ;;mov [es:2],ax ; MSDOS 3.3 - 12432 ;G save segment of last batch file - 12433 ;mov [es:3],ax ; MSDOS 6.0 - 12434 0000095D 26A30300 mov [es:BATCHSEGMENT.BatLast],ax - 12435 00000961 1E push ds - 12436 00000962 8E1E[F59B] mov ds,[RESSEG] ;G set to resident data - 12437 - 12438 00000966 31C0 xor ax,ax - 12439 00000968 8A1E[AB02] mov bl,[ForFlag] ;G get the current FOR state - 12440 ;;mov [es:6],bl ; MSDOS 3.3 - 12441 ;G save it in the batch segment - 12442 ;mov [es:7],bl ; MSDOS 6.0 - 12443 0000096C 26881E0700 mov [es:BATCHSEGMENT.BatForFlag],bl - 12444 00000971 F6C3FF test bl,-1 ; 0FFh ;G are we in a FOR? - 12445 00000974 7406 jz short FOR_NOT_ON ;G no, for segment set to 0 - 12446 ;mov ax,[ForPtr] ;G yes, get current FOR segment - 12447 ;mov byte [ForFlag],0 ;G reset forflag - 12448 ; 26/07/2024 - 12449 00000976 A2[AB02] mov [ForFlag],al ; 0 - 12450 00000979 A1[AC02] mov ax,[ForPtr] ;G yes, get current FOR segment - 12451 FOR_NOT_ON: - 12452 ;;mov [es:4],ax ; MSDOS 3.3 - 12453 ;G save FOR segment in batch segment - 12454 ;mov [es:5],ax ; MSDOS 6.0 - 12455 0000097C 26A30500 mov [es:BATCHSEGMENT.BatForPtr],ax - 12456 00000980 31C0 xor ax,ax - 12457 00000982 A3[AC02] mov [ForPtr],ax ;G make sure for segment is not active - 12458 00000985 8A1E[9D02] mov bl,[EchoFlag] - 12459 00000989 1F pop ds - 12460 ;mov [es:1],bl - 12461 ;G save echo state of parent - 12462 0000098A 26881E0100 mov [es:BATCHSEGMENT.BatEchoFlag],bl - 12463 ;SR; - 12464 ; Initialize the new BatchEOF flag we have added to 0 - 12465 - 12466 ; MSDOS 6.0 - 12467 ;mov byte [es:2],0 - 12468 0000098F 26C606020000 mov byte [es:BATCHSEGMENT.BatchEOF],0 - 12469 - 12470 ;mov [es:08h],ax ; MSDOS 6.0 - 12471 00000995 26A30800 mov [es:BATCHSEGMENT.BatSeek],ax ; point to beginning of file - 12472 ;mov [es:0Ah],ax ; MSDOS 6.0 - 12473 00000999 26A30A00 mov [es:BATCHSEGMENT.BatSeek+2],ax - 12474 - 12475 ; Initialize pointers - 12476 - 12477 0000099D 48 dec ax ; put -1 into AX - 12478 ;;mov di,0Bh ; MSDOS 3.3 - 12479 ; point to parm area - 12480 ;mov di,0Ch ; MSDOS 6.0 - 12481 0000099E BF0C00 mov di,BATCHSEGMENT.BatParm - 12482 000009A1 89FB mov bx,di - 12483 000009A3 B90A00 mov cx,10 - 12484 000009A6 F3AB rep stosw ; Init to no parms - 12485 - 12486 ; Move in batch file name - 12487 - 12488 000009A8 89D1 mov cx,dx - 12489 000009AA F3A4 rep movsb + 12375 00000928 D3EA shr dx,cl ;para size of transient; M006 + 12376 0000092A 01DA add dx,bx ;dx = top of transient; M006 + 12377 + 12378 0000092C 39D8 cmp ax,bx ; M006 + 12379 0000092E 7212 jb short ENOUGH_MEM + 12380 ; Batchseg below transient + 12381 ; enough memory ; M006 + 12382 00000930 39D0 cmp ax,dx ; M006 + 12383 00000932 770E ja short ENOUGH_MEM + 12384 ; Batchseg above transient + 12385 ; enough memory ; M006 + 12386 + 12387 ; M006; Batchseg overlaps transient -- insufficient memory + 12388 + 12389 00000934 58 pop ax ; restore ax; M006 + 12390 + 12391 ; 12/02/2023 + 12392 ; MSDOS 3.3 + 12393 ; M006; cmp ax,bx ;G do we end before the transient + 12394 ; M006; pop ax ;G get batch segment back + 12395 ; M006; jb short ENOUGH_MEM ;G we have enough memory - continue + 12396 + 12397 ; MSDOS 3.3 (& MSDOS 6.0) + 12398 00000935 06 push es ;G no we're hitting the transient + 12399 00000936 8EC0 mov es,ax + 12400 00000938 B80049 mov ax,4900h + 12401 ;mov ax,DEALLOC*256 ; 4900h ;G deallocate the batch segment + 12402 + 12403 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM + 12404 %if 0 + 12405 int 21h ; DOS - 2+ - FREE MEMORY + 12406 ; ES = segment address of area to be freed + 12407 %else + 12408 0000093B E87CFC call int_21h_indirect + 12409 %endif + 12410 + 12411 0000093E 07 pop es + 12412 MEM_ERROR: + 12413 0000093F E9B900 jmp NO_MEMORY ;G Set up for message and exit + 12414 + 12415 ENOUGH_MEM: + 12416 ; 12/02/2023 - Retro DOS v4.0 COMMAND.COM + 12417 ; MSDOS 6.0 + 12418 00000942 58 pop ax ; restore ax; M006 + 12419 + 12420 ; MSDOS 3.3 (& MSDOS 6.0) + 12421 00000943 26A3[4902] mov [es:Batch],ax + 12422 00000947 E8DAFE call ALLOC_TPA + 12423 + 12424 ; Initialize batch segment + 12425 + 12426 0000094A 5A pop dx ; length of name + 12427 0000094B 58 pop ax ;G get saved batch segment back + 12428 0000094C 26FF06[AE02] inc word [es:Nest] ;G increment # batch files in progress + 12429 00000951 06 push es + 12430 00000952 268E06[4902] mov es,[es:Batch] + 12431 ;mov byte [ES:0],0 + 12432 ; signal batch file type + 12433 00000957 26C606000000 mov byte [es:BATCHSEGMENT.BatType],BATCHTYPE ; 0 + 12434 ;;mov [es:2],ax ; MSDOS 3.3 + 12435 ;G save segment of last batch file + 12436 ;mov [es:3],ax ; MSDOS 6.0 + 12437 0000095D 26A30300 mov [es:BATCHSEGMENT.BatLast],ax + 12438 00000961 1E push ds + 12439 00000962 8E1E[F59B] mov ds,[RESSEG] ;G set to resident data + 12440 + 12441 00000966 31C0 xor ax,ax + 12442 00000968 8A1E[AB02] mov bl,[ForFlag] ;G get the current FOR state + 12443 ;;mov [es:6],bl ; MSDOS 3.3 + 12444 ;G save it in the batch segment + 12445 ;mov [es:7],bl ; MSDOS 6.0 + 12446 0000096C 26881E0700 mov [es:BATCHSEGMENT.BatForFlag],bl + 12447 00000971 F6C3FF test bl,-1 ; 0FFh ;G are we in a FOR? + 12448 00000974 7406 jz short FOR_NOT_ON ;G no, for segment set to 0 + 12449 ;mov ax,[ForPtr] ;G yes, get current FOR segment + 12450 ;mov byte [ForFlag],0 ;G reset forflag + 12451 ; 26/07/2024 + 12452 00000976 A2[AB02] mov [ForFlag],al ; 0 + 12453 00000979 A1[AC02] mov ax,[ForPtr] ;G yes, get current FOR segment + 12454 FOR_NOT_ON: + 12455 ;;mov [es:4],ax ; MSDOS 3.3 + 12456 ;G save FOR segment in batch segment + 12457 ;mov [es:5],ax ; MSDOS 6.0 + 12458 0000097C 26A30500 mov [es:BATCHSEGMENT.BatForPtr],ax + 12459 00000980 31C0 xor ax,ax + 12460 00000982 A3[AC02] mov [ForPtr],ax ;G make sure for segment is not active + 12461 00000985 8A1E[9D02] mov bl,[EchoFlag] + 12462 00000989 1F pop ds + 12463 ;mov [es:1],bl + 12464 ;G save echo state of parent + 12465 0000098A 26881E0100 mov [es:BATCHSEGMENT.BatEchoFlag],bl + 12466 ;SR; + 12467 ; Initialize the new BatchEOF flag we have added to 0 + 12468 + 12469 ; MSDOS 6.0 + 12470 ;mov byte [es:2],0 + 12471 0000098F 26C606020000 mov byte [es:BATCHSEGMENT.BatchEOF],0 + 12472 + 12473 ;mov [es:08h],ax ; MSDOS 6.0 + 12474 00000995 26A30800 mov [es:BATCHSEGMENT.BatSeek],ax ; point to beginning of file + 12475 ;mov [es:0Ah],ax ; MSDOS 6.0 + 12476 00000999 26A30A00 mov [es:BATCHSEGMENT.BatSeek+2],ax + 12477 + 12478 ; Initialize pointers + 12479 + 12480 0000099D 48 dec ax ; put -1 into AX + 12481 ;;mov di,0Bh ; MSDOS 3.3 + 12482 ; point to parm area + 12483 ;mov di,0Ch ; MSDOS 6.0 + 12484 0000099E BF0C00 mov di,BATCHSEGMENT.BatParm + 12485 000009A1 89FB mov bx,di + 12486 000009A3 B90A00 mov cx,10 + 12487 000009A6 F3AB rep stosw ; Init to no parms + 12488 + 12489 ; Move in batch file name 12490 - 12491 ; Now copy the command line into batch segment, parsing the arguments along - 12492 ; the way. Segment will look like this: - 12493 ; - 12494 ; CRCR...CRCR...CR 0 - 12495 ; - 12496 ; or, in the case of fewer arguments: - 12497 ; - 12498 ; CRCR...CR CR CR ... CR 0 - 12499 - 12500 000009AC BE[569A] mov si,COMBUF+2 - 12501 ;mov cx,10 ; at most 10 arguments - 12502 ; 07/06/2023 - 12503 000009AF B10A mov cl,10 - 12504 EACHPARM: - 12505 000009B1 E8D21F call scanoff ; skip to argument - 12506 - 12507 ; AL is first non-delimiter. DS:SI points to char = AL - 12508 - 12509 000009B4 3C0D cmp al,0Dh ; end of road? - 12510 000009B6 741D jz short HAVPARM ; yes, no more arguments + 12491 000009A8 89D1 mov cx,dx + 12492 000009AA F3A4 rep movsb + 12493 + 12494 ; Now copy the command line into batch segment, parsing the arguments along + 12495 ; the way. Segment will look like this: + 12496 ; + 12497 ; CRCR...CRCR...CR 0 + 12498 ; + 12499 ; or, in the case of fewer arguments: + 12500 ; + 12501 ; CRCR...CR CR CR ... CR 0 + 12502 + 12503 000009AC BE[569A] mov si,COMBUF+2 + 12504 ;mov cx,10 ; at most 10 arguments + 12505 ; 07/06/2023 + 12506 000009AF B10A mov cl,10 + 12507 EACHPARM: + 12508 000009B1 E8D21F call scanoff ; skip to argument + 12509 + 12510 ; AL is first non-delimiter. DS:SI points to char = AL 12511 - 12512 ; If CX = 0 then we have stored the most parm we can. Skip store - 12513 - 12514 000009B8 E306 jcxz MOVPARM ; Only first 10 parms get pointers - 12515 - 12516 ; Go into allocated piece and stick in new argument pointer. - 12517 - 12518 000009BA 26893F mov [es:bx],di ; store batch pointer - 12519 000009BD 83C302 add bx,2 ; advance arg counter + 12512 000009B4 3C0D cmp al,0Dh ; end of road? + 12513 000009B6 741D jz short HAVPARM ; yes, no more arguments + 12514 + 12515 ; If CX = 0 then we have stored the most parm we can. Skip store + 12516 + 12517 000009B8 E306 jcxz MOVPARM ; Only first 10 parms get pointers + 12518 + 12519 ; Go into allocated piece and stick in new argument pointer. 12520 - 12521 ; Move the parameter into batch segment - 12522 - 12523 MOVPARM: - 12524 000009C0 AC lodsb ; get byte - 12525 000009C1 E8CA1F call DELIM ; if delimiter - 12526 000009C4 7407 jz short ENDPARM ; then done with parm - 12527 000009C6 AA stosb ; store byte - 12528 000009C7 3C0D cmp al,0Dh ; if CR then not delimiter - 12529 000009C9 740A jz short HAVPARM ; but end of parm list, finish - 12530 000009CB EBF3 jmp short MOVPARM - 12531 - 12532 ; We have copied a parameter up until the first separator. - 12533 ; Terminate it with CR. + 12521 000009BA 26893F mov [es:bx],di ; store batch pointer + 12522 000009BD 83C302 add bx,2 ; advance arg counter + 12523 + 12524 ; Move the parameter into batch segment + 12525 + 12526 MOVPARM: + 12527 000009C0 AC lodsb ; get byte + 12528 000009C1 E8CA1F call DELIM ; if delimiter + 12529 000009C4 7407 jz short ENDPARM ; then done with parm + 12530 000009C6 AA stosb ; store byte + 12531 000009C7 3C0D cmp al,0Dh ; if CR then not delimiter + 12532 000009C9 740A jz short HAVPARM ; but end of parm list, finish + 12533 000009CB EBF3 jmp short MOVPARM 12534 - 12535 ENDPARM: - 12536 000009CD B00D mov al,0Dh - 12537 000009CF AA stosb - 12538 000009D0 E3DF jcxz EACHPARM ; if no parameters, don't dec - 12539 000009D2 49 dec cx ; remember that we've seen one. - 12540 000009D3 EBDC jmp short EACHPARM - 12541 - 12542 ; We have parsed the entire line. Terminate the arg list - 12543 - 12544 HAVPARM: - 12545 000009D5 30C0 xor al,al ; Nul terminate the parms - 12546 000009D7 AA stosb - 12547 - 12548 ; Now we know EXACTLY how big the BATCH segment is. Round up size (from DI) - 12549 ; into paragraphs and setblock to the appropriate size + 12535 ; We have copied a parameter up until the first separator. + 12536 ; Terminate it with CR. + 12537 + 12538 ENDPARM: + 12539 000009CD B00D mov al,0Dh + 12540 000009CF AA stosb + 12541 000009D0 E3DF jcxz EACHPARM ; if no parameters, don't dec + 12542 000009D2 49 dec cx ; remember that we've seen one. + 12543 000009D3 EBDC jmp short EACHPARM + 12544 + 12545 ; We have parsed the entire line. Terminate the arg list + 12546 + 12547 HAVPARM: + 12548 000009D5 30C0 xor al,al ; Nul terminate the parms + 12549 000009D7 AA stosb 12550 - 12551 000009D8 8D5D0F lea bx,[di+15] - 12552 000009DB B104 mov cl,4 - 12553 000009DD D3EB shr bx,cl - 12554 000009DF B44A mov ah,4Ah - 12555 ;mov ah,SETBLOCK ; 4Ah - 12556 - 12557 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM - 12558 %if 0 - 12559 int 21h ; DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK) - 12560 ; ES = segment address of block to change - 12561 ; BX = new size in paragraphs - 12562 %else - 12563 000009E1 E8D6FB call int_21h_indirect - 12564 %endif - 12565 - 12566 000009E4 07 pop es - 12567 000009E5 06 push es - 12568 000009E6 1F pop ds ; Simply batch FCB setup - 12569 000009E7 833E[A502]FF cmp word [SingleCom],-1 ; 0FFFFh - 12570 000009EC 7506 jne short NOBATSING - 12571 000009EE C706[A502]F0FF mov word [SingleCom],0FFF0h ; Flag single command BATCH job - 12572 - 12573 NOBATSING: - 12574 - 12575 ; Enter the batch file with the current echo state - 12576 - 12577 000009F4 58 pop ax ; Get original echo state - 12578 000009F5 A2[9D02] mov [EchoFlag],al ; restore it - 12579 000009F8 E909F7 jmp TCOMMAND - 12580 - 12581 ; The following is executed if there isn't enough memory for batch segment - 12582 - 12583 NO_MEMORY: - 12584 000009FB 5A pop dx ; even up our stack - 12585 000009FC 58 pop ax - 12586 000009FD 58 pop ax - 12587 000009FE E823FE call ALLOC_TPA ; reallocate memory - 12588 - 12589 ; 12/02/2023 - 12590 ; MSDOS 3.3 - 12591 ;mov dx,INSFMEMMESPTR - 12592 ;jmp CERROR - 12593 - 12594 ; MSDOS 6.0 - 12595 ;mov byte [msg_disp_class],1 - 12596 00000A01 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 12597 ;AN000; set up extended error msg class - 12598 ;mov dx,offset TranGroup:Extend_Buf_ptr - 12599 00000A06 BA[D78F] mov dx,extend_buf_ptr - 12600 ; ;AC000; get extended message pointer - 12601 ;mov word [extend_buf_ptr],8 - 12602 00000A09 C706[D78F]0800 mov word [extend_buf_ptr],ERROR_NOT_ENOUGH_MEMORY - 12603 ;AN000; get message number in control block - 12604 00000A0F E91423 jmp cerror ;g print error message and go... - 12605 - 12606 ; =============== S U B R O U T I N E ======================================= - 12607 - 12608 ; 12/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 12609 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 12610 BATCHOFF: - 12611 00000A12 50 push ax - 12612 00000A13 06 push es - 12613 00000A14 1E push ds - 12614 00000A15 53 push bx - 12615 - 12616 00000A16 2E8E06[F59B] mov es,[cs:RESSEG] - 12617 ;mov ds,[cs:RESSEG] - 12618 ; 26/07/2024 - 12619 00000A1B 06 push es - 12620 00000A1C 1F pop ds - 12621 - 12622 00000A1D A1[4902] mov ax,[Batch] ; Free the batch segment - 12623 00000A20 09C0 or ax,ax - 12624 00000A22 7443 jz short NOTFREE - 12625 - 12626 00000A24 06 push es - 12627 00000A25 8EC0 mov es,ax - 12628 00000A27 F606[9D02]01 test byte [EchoFlag],1 - 12629 ;G Is echo on? - 12630 00000A2C 7505 jnz short ECHO_LAST_LINE - 12631 ;G Yes - echo last line in file - 12632 ;mov byte [SUPPRESS],0 - 12633 00000A2E C606[9E02]00 mov byte [Suppress],NO_ECHO - 12634 ;G no - don't echo last line in file - 12635 ECHO_LAST_LINE: - 12636 ;mov bl,[es:1] - 12637 00000A33 268A1E0100 mov bl,[es:BATCHSEGMENT.BatEchoFlag] - 12638 ; G get echo state - 12639 00000A38 881E[9D02] mov [EchoFlag],bl - 12640 ; G and restore it - 12641 ;;mov bx,[es:4] ; MSDOS 3.3 - 12642 ;mov bx,[es:5] ; MSDOS 6.0 - 12643 00000A3C 268B1E0500 mov bx,[es:BATCHSEGMENT.BatForPtr] - 12644 ;G Get FOR segment - 12645 00000A41 891E[AC02] mov [ForPtr],bx ;G and restore it - 12646 ;;mov bl,[es:6] ; MSDOS 3.3 - 12647 ;mov bl,[es:7] ; MSDOS 6.0 - 12648 00000A45 268A1E0700 mov bl,[es:BATCHSEGMENT.BatForFlag] - 12649 ;G Get FOR flag - 12650 00000A4A 881E[AB02] mov [ForFlag],bl - 12651 ;G and restore it - 12652 ;;mov bx,[es:2] ; MSDOS 3.3 - 12653 ;mov bx,[es:3] ; MSDOS 6.0 - 12654 00000A4E 268B1E0300 mov bx,[es:BATCHSEGMENT.BatLast] - 12655 ;G Get old batch segment - 12656 00000A53 B449 mov ah,49h - 12657 ;mov ah,DEALLOC ; 49h - 12658 - 12659 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM - 12660 %if 0 - 12661 int 21h ; DOS - 2+ - FREE MEMORY - 12662 ; ES = segment address of area to be freed - 12663 %else - 12664 00000A55 E862FB call int_21h_indirect - 12665 %endif - 12666 - 12667 00000A58 07 pop es - 12668 00000A59 891E[B202] mov [Next_Batch],bx ;G reset batch segment - 12669 00000A5D 26FF0E[AE02] dec word [es:Nest] - 12670 00000A62 31C0 xor ax,ax - 12671 00000A64 A3[4902] mov [Batch],ax ; No batch in progress - 12672 NOTFREE: - 12673 00000A67 5B pop bx - 12674 00000A68 1F pop ds - 12675 00000A69 07 pop es - 12676 00000A6A 58 pop ax - 12677 00000A6B C3 retn - 12678 - 12679 ; =============== S U B R O U T I N E ======================================= - 12680 - 12681 ; 12/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 12682 - 12683 ; StrCpy - copy string, checking count in CX against COMBUFLEN - 12684 ; Entry : DS:SI ==> source string - 12685 ; ES:DI ==> destination string - 12686 ; CX = current length of destination string - 12687 ; Exit : string copied, CX updated, Carry set if length limit exceeded - 12688 - 12689 ; 12/02/2023 - 12690 ; MSDOS 3.3 - 12691 ;STRCPY: - 12692 ;push ax - 12693 ;CCYCLE: - 12694 ;lodsb - 12695 ;stosb - 12696 ;or al,al - 12697 ;jnz short CCYCLE - 12698 ;pop ax - 12699 ;retn - 12700 - 12701 ;Procedure StrCpy,NEAR - 12702 - 12703 ; 12/02/2023 - 12704 ; MSDOS 6.0 - 12705 STRCPY: - 12706 00000A6C 50 push ax - 12707 ccycle: - 12708 00000A6D AC lodsb - 12709 00000A6E 41 inc cx - 12710 ;cmp cx,128 - 12711 00000A6F 81F98000 cmp cx,COMBUFLEN - 12712 ;jb short ccopy - 12713 ;stc ; set carry to signal error - 12714 ;jmp short ccend - 12715 ; 12/02/2023 - 12716 00000A73 F5 cmc - 12717 00000A74 7205 jc short ccend - 12718 ccopy: - 12719 00000A76 AA stosb - 12720 00000A77 08C0 or al,al - 12721 00000A79 75F2 jnz short ccycle - 12722 ccend: - 12723 00000A7B 49 dec cx ; discount extra byte - 12724 00000A7C 4F dec di ; back up pointer - 12725 00000A7D 58 pop ax - 12726 00000A7E C3 retn ; return carry clear - 12727 - 12728 ;EndProc StrCpy - 12729 - 12730 ;============================================================================ - 12731 ; TBATCH2.ASM, MSDOS 6.0, 1991 - 12732 ;============================================================================ - 12733 ; 12/10/2018 - Retro DOS v3.0 - 12734 - 12735 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 0892h - 12736 - 12737 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 12738 - 12739 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 0977h - 12740 - 12741 ; =============== S U B R O U T I N E ======================================= - 12742 - 12743 ;Break - 12744 - 12745 ; Get one byte from the batch file and return it in AL. End-of-file returns - 12746 ; and ends batch mode. DS must be set to resident segment. - 12747 ; AH, DX destroyed. - 12748 - 12749 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 12750 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 0A95h + 12551 ; Now we know EXACTLY how big the BATCH segment is. Round up size (from DI) + 12552 ; into paragraphs and setblock to the appropriate size + 12553 + 12554 000009D8 8D5D0F lea bx,[di+15] + 12555 000009DB B104 mov cl,4 + 12556 000009DD D3EB shr bx,cl + 12557 000009DF B44A mov ah,4Ah + 12558 ;mov ah,SETBLOCK ; 4Ah + 12559 + 12560 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM + 12561 %if 0 + 12562 int 21h ; DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK) + 12563 ; ES = segment address of block to change + 12564 ; BX = new size in paragraphs + 12565 %else + 12566 000009E1 E8D6FB call int_21h_indirect + 12567 %endif + 12568 + 12569 000009E4 07 pop es + 12570 000009E5 06 push es + 12571 000009E6 1F pop ds ; Simply batch FCB setup + 12572 000009E7 833E[A502]FF cmp word [SingleCom],-1 ; 0FFFFh + 12573 000009EC 7506 jne short NOBATSING + 12574 000009EE C706[A502]F0FF mov word [SingleCom],0FFF0h ; Flag single command BATCH job + 12575 + 12576 NOBATSING: + 12577 + 12578 ; Enter the batch file with the current echo state + 12579 + 12580 000009F4 58 pop ax ; Get original echo state + 12581 000009F5 A2[9D02] mov [EchoFlag],al ; restore it + 12582 000009F8 E909F7 jmp TCOMMAND + 12583 + 12584 ; The following is executed if there isn't enough memory for batch segment + 12585 + 12586 NO_MEMORY: + 12587 000009FB 5A pop dx ; even up our stack + 12588 000009FC 58 pop ax + 12589 000009FD 58 pop ax + 12590 000009FE E823FE call ALLOC_TPA ; reallocate memory + 12591 + 12592 ; 12/02/2023 + 12593 ; MSDOS 3.3 + 12594 ;mov dx,INSFMEMMESPTR + 12595 ;jmp CERROR + 12596 + 12597 ; MSDOS 6.0 + 12598 ;mov byte [msg_disp_class],1 + 12599 00000A01 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 12600 ;AN000; set up extended error msg class + 12601 ;mov dx,offset TranGroup:Extend_Buf_ptr + 12602 00000A06 BA[D78F] mov dx,extend_buf_ptr + 12603 ; ;AC000; get extended message pointer + 12604 ;mov word [extend_buf_ptr],8 + 12605 00000A09 C706[D78F]0800 mov word [extend_buf_ptr],ERROR_NOT_ENOUGH_MEMORY + 12606 ;AN000; get message number in control block + 12607 00000A0F E91423 jmp cerror ;g print error message and go... + 12608 + 12609 ; =============== S U B R O U T I N E ======================================= + 12610 + 12611 ; 12/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 12612 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 12613 BATCHOFF: + 12614 00000A12 50 push ax + 12615 00000A13 06 push es + 12616 00000A14 1E push ds + 12617 00000A15 53 push bx + 12618 + 12619 00000A16 2E8E06[F59B] mov es,[cs:RESSEG] + 12620 ;mov ds,[cs:RESSEG] + 12621 ; 26/07/2024 + 12622 00000A1B 06 push es + 12623 00000A1C 1F pop ds + 12624 + 12625 00000A1D A1[4902] mov ax,[Batch] ; Free the batch segment + 12626 00000A20 09C0 or ax,ax + 12627 00000A22 7443 jz short NOTFREE + 12628 + 12629 00000A24 06 push es + 12630 00000A25 8EC0 mov es,ax + 12631 00000A27 F606[9D02]01 test byte [EchoFlag],1 + 12632 ;G Is echo on? + 12633 00000A2C 7505 jnz short ECHO_LAST_LINE + 12634 ;G Yes - echo last line in file + 12635 ;mov byte [SUPPRESS],0 + 12636 00000A2E C606[9E02]00 mov byte [Suppress],NO_ECHO + 12637 ;G no - don't echo last line in file + 12638 ECHO_LAST_LINE: + 12639 ;mov bl,[es:1] + 12640 00000A33 268A1E0100 mov bl,[es:BATCHSEGMENT.BatEchoFlag] + 12641 ; G get echo state + 12642 00000A38 881E[9D02] mov [EchoFlag],bl + 12643 ; G and restore it + 12644 ;;mov bx,[es:4] ; MSDOS 3.3 + 12645 ;mov bx,[es:5] ; MSDOS 6.0 + 12646 00000A3C 268B1E0500 mov bx,[es:BATCHSEGMENT.BatForPtr] + 12647 ;G Get FOR segment + 12648 00000A41 891E[AC02] mov [ForPtr],bx ;G and restore it + 12649 ;;mov bl,[es:6] ; MSDOS 3.3 + 12650 ;mov bl,[es:7] ; MSDOS 6.0 + 12651 00000A45 268A1E0700 mov bl,[es:BATCHSEGMENT.BatForFlag] + 12652 ;G Get FOR flag + 12653 00000A4A 881E[AB02] mov [ForFlag],bl + 12654 ;G and restore it + 12655 ;;mov bx,[es:2] ; MSDOS 3.3 + 12656 ;mov bx,[es:3] ; MSDOS 6.0 + 12657 00000A4E 268B1E0300 mov bx,[es:BATCHSEGMENT.BatLast] + 12658 ;G Get old batch segment + 12659 00000A53 B449 mov ah,49h + 12660 ;mov ah,DEALLOC ; 49h + 12661 + 12662 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM + 12663 %if 0 + 12664 int 21h ; DOS - 2+ - FREE MEMORY + 12665 ; ES = segment address of area to be freed + 12666 %else + 12667 00000A55 E862FB call int_21h_indirect + 12668 %endif + 12669 + 12670 00000A58 07 pop es + 12671 00000A59 891E[B202] mov [Next_Batch],bx ;G reset batch segment + 12672 00000A5D 26FF0E[AE02] dec word [es:Nest] + 12673 00000A62 31C0 xor ax,ax + 12674 00000A64 A3[4902] mov [Batch],ax ; No batch in progress + 12675 NOTFREE: + 12676 00000A67 5B pop bx + 12677 00000A68 1F pop ds + 12678 00000A69 07 pop es + 12679 00000A6A 58 pop ax + 12680 00000A6B C3 retn + 12681 + 12682 ; =============== S U B R O U T I N E ======================================= + 12683 + 12684 ; 12/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 12685 + 12686 ; StrCpy - copy string, checking count in CX against COMBUFLEN + 12687 ; Entry : DS:SI ==> source string + 12688 ; ES:DI ==> destination string + 12689 ; CX = current length of destination string + 12690 ; Exit : string copied, CX updated, Carry set if length limit exceeded + 12691 + 12692 ; 12/02/2023 + 12693 ; MSDOS 3.3 + 12694 ;STRCPY: + 12695 ;push ax + 12696 ;CCYCLE: + 12697 ;lodsb + 12698 ;stosb + 12699 ;or al,al + 12700 ;jnz short CCYCLE + 12701 ;pop ax + 12702 ;retn + 12703 + 12704 ;Procedure StrCpy,NEAR + 12705 + 12706 ; 12/02/2023 + 12707 ; MSDOS 6.0 + 12708 STRCPY: + 12709 00000A6C 50 push ax + 12710 ccycle: + 12711 00000A6D AC lodsb + 12712 00000A6E 41 inc cx + 12713 ;cmp cx,128 + 12714 00000A6F 81F98000 cmp cx,COMBUFLEN + 12715 ;jb short ccopy + 12716 ;stc ; set carry to signal error + 12717 ;jmp short ccend + 12718 ; 12/02/2023 + 12719 00000A73 F5 cmc + 12720 00000A74 7205 jc short ccend + 12721 ccopy: + 12722 00000A76 AA stosb + 12723 00000A77 08C0 or al,al + 12724 00000A79 75F2 jnz short ccycle + 12725 ccend: + 12726 00000A7B 49 dec cx ; discount extra byte + 12727 00000A7C 4F dec di ; back up pointer + 12728 00000A7D 58 pop ax + 12729 00000A7E C3 retn ; return carry clear + 12730 + 12731 ;EndProc StrCpy + 12732 + 12733 ;============================================================================ + 12734 ; TBATCH2.ASM, MSDOS 6.0, 1991 + 12735 ;============================================================================ + 12736 ; 12/10/2018 - Retro DOS v3.0 + 12737 + 12738 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 0892h + 12739 + 12740 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 12741 + 12742 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 0977h + 12743 + 12744 ; =============== S U B R O U T I N E ======================================= + 12745 + 12746 ;Break + 12747 + 12748 ; Get one byte from the batch file and return it in AL. End-of-file returns + 12749 ; and ends batch mode. DS must be set to resident segment. + 12750 ; AH, DX destroyed. 12751 - 12752 GETBATBYT: - 12753 00000A7F 53 push bx - 12754 00000A80 51 push cx - 12755 00000A81 1E push ds - 12756 00000A82 F606[9302]FF test byte [Batch_Abort],-1 - 12757 ;jnz short BATEOF - 12758 ; 14/02/2023 - 12759 00000A87 7403 jz short getbatbyt1 - 12760 00000A89 E9D200 jmp BATEOF - 12761 getbatbyt1: - 12762 00000A8C F706[4902]FFFF test word [Batch],-1 - 12763 ;jz short BATEOF - 12764 ; 14/02/2023 - 12765 00000A92 7503 jnz short getbatbyt2 - 12766 00000A94 E9C700 jmp BATEOF - 12767 getbatbyt2: - 12768 00000A97 06 push es - 12769 00000A98 8E06[4902] mov es,[Batch] - 12770 - 12771 ; MSDOS 6.0 - 12772 ;M020; - 12773 ;Check if we have already reached EOF (BatchEOF flag set. Then, we do not - 12774 ;try to read from the batchfile again. - 12775 - 12776 ;cmp byte [es:2],0 - 12777 00000A9C 26803E020000 cmp byte [es:BATCHSEGMENT.BatchEOF],0 - 12778 ;already reached EOF? ;M020 - 12779 00000AA2 7403 jz short not_eof ;no, read batch file ;M020 - 12780 00000AA4 E99D00 jmp At_EOF ;yes, no more reads ;M020 - 12781 not_eof: ;M020 - 12782 ; MSDOS 3.3 (& MSDOS 6.0) - 12783 ;add word [es:8],1 ; MSDOS 6.0 - 12784 00000AA7 268306080001 add word [es:BATCHSEGMENT.BatSeek],1 - 12785 ;adc word [es:10],0 ; MSDOS 6.0 - 12786 00000AAD 2683160A0000 adc word [es:BATCHSEGMENT.BatSeek+2],0 - 12787 00000AB3 07 pop es - 12788 - 12789 ; See if we have bytes buffered... - 12790 - 12791 00000AB4 8CC8 mov ax,cs - 12792 00000AB6 8ED8 mov ds,ax - 12793 00000AB8 8B1E[C7A5] mov bx,[BATBUFPOS] - 12794 00000ABC 83FBFF cmp bx,-1 - 12795 00000ABF 7541 jnz short UNBUF - 12796 - 12797 ; There are no bytes in the buffer. Let's try to fill it up. - 12798 - 12799 00000AC1 BA[C9A5] mov dx,BATBUF - 12800 00000AC4 8B0E[E495] mov cx,[BATBUFLEN] ; max to read. - 12801 00000AC8 8B1E[F49E] mov bx,[BATHAND] - 12802 ; 14/02/2023 - 12803 00000ACC B43F mov ah,3Fh - 12804 ;mov ah,READ ; 3Fh ; Get one more byte from batch file - 12805 - 12806 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM - 12807 %if 0 - 12808 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE - 12809 ; BX = file handle,CX = number of bytes to read - 12810 ; DS:DX -> buffer - 12811 %else - 12812 00000ACE E8E9FA call int_21h_indirect - 12813 %endif - 12814 - 12815 ; MSDOS 6.0 - 12816 00000AD1 7321 jnc short bat_read_ok ;AN022; if no error - continue - 12817 ;invoke get_ext_error_number ;AN022; get the error - 12818 00000AD3 E87515 call get_ext_error_number - 12819 00000AD6 1E push ds ;AN022; save local segment - 12820 00000AD7 8E1E[F59B] mov ds,[RESSEG] ;AN022; get resident segment - 12821 ;assume ds:resgroup ;AN022; - 12822 00000ADB 89C2 mov dx,ax ;AN022; put error in DX - 12823 ;invoke output_batch_name ;AN022; set up to print the error - 12824 00000ADD E857FB call output_batch_name - 12825 00000AE0 1F pop ds ;AN022; - 12826 ;assume ds:trangroup ;AN022; - 12827 ;invoke std_eprintf ;AN022; print out the error - 12828 00000AE1 E83C49 call std_eprintf - 12829 ;mov byte ptr combuf+2,end_of_line_in - 12830 00000AE4 C606[569A]0D mov byte [COMBUF+2],END_OF_LINE_IN ; 0Dh - 12831 ; ;AN022; terminate the batch line for parsing - 12832 ;mov byte ptr combuf+3,end_of_line_out - 12833 00000AE9 C606[579A]00 mov byte [COMBUF+3],END_OF_LINE_OUT ; 0 - 12834 ; ;AN022; terminate the batch line for output - 12835 ;M020; - 12836 ;Old bug! We jump to BatEof from here without ds=RESGROUP. Probably, this - 12837 ;error is never hit (and it shouldn't be) - 12838 - 12839 00000AEE 8E1E[F59B] mov ds,[RESSEG] ; ds = RESGROUP ; M020 - 12840 00000AF2 EB6A jmp short BATEOF ;AN022; terminate the batch file - 12841 bat_read_ok: ;AN022; - 12842 ; MSDOS 3.3 (& MSDOS 6.0) - 12843 00000AF4 89C1 mov cx,ax - 12844 ;jcxz TURN_OFF ; MSDOS 3.3 - 12845 ; 14/02/2023 - 12846 00000AF6 E320 jcxz BATEOFDS ; MSDOS 6.0 - 12847 00000AF8 890E[E9A5] mov [BATBUFEND],cx - 12848 00000AFC 31DB xor bx,bx - 12849 00000AFE 891E[C7A5] mov [BATBUFPOS],bx - 12850 - 12851 ; Buffered bytes! - 12852 UNBUF: - 12853 00000B02 8A87[C9A5] mov al,[BATBUF+bx] ; get next byte - 12854 00000B06 43 inc bx - 12855 00000B07 3B1E[E9A5] cmp bx,[BATBUFEND] ; beyond end of buffer? - 12856 00000B0B 7203 jb short SETBUFPOS - 12857 00000B0D BBFFFF mov bx,-1 - 12858 SETBUFPOS: - 12859 00000B10 891E[C7A5] mov [BATBUFPOS],bx - 12860 00000B14 3C1A cmp al,1Ah ; ^Z for termination? - 12861 00000B16 7575 jne short GETBYTEDONE - 12862 - 12863 ;We get here only when we hit an EOF - 12864 - 12865 ; MSDOS 6.0 - 12866 BATEOFDS: - 12867 ;SR; - 12868 ; HACK!!! A massive hack being put in here to get batch processing to work - 12869 ;properly on EOF. Previously, a CR was returned and batch processing turned - 12870 ;off the moment we hit an EOF. Unfortunately, if the last line had no CR-LF, - 12871 ;batch processing is turned off before the last line is processed and so - 12872 ;this line would never be executed. - 12873 ; To fix this, a new flag BatchEOF has been introduced. This flag is - 12874 ;set to 4 if there is no CR-LF before the EOF -- this is determined by looking - 12875 ;at the buffer contents. If there is no LF ( we assume that presence of LF - 12876 ;indicated a CR-LF combination), then we set BatchEOF to 4 and return a - 12877 ;fake CR to the caller. This decrements BatchEOF. On the next call to this - 12878 ;routine, BatchEOF is decremented to 2 and a fake lF is returned. On the - 12879 ;third call, BatchEOF becomes zero and batch processing is turned off, - 12880 ;now that the last line has been processed. If the EOF is the first char read into the buffer - 12881 ;during this call, and there was a CR-LF previously, we are going to fake - 12882 ;another redundant CR-LF. There is no work-around I can think of. - 12883 ; I would love to restructure this entire routine and its caller to - 12884 ;make the flow really easy to understand but I guess this will have to wait. - 12885 ; - 12886 00000B18 06 push es - 12887 00000B19 8E06[F59B] mov es,[RESSEG] - 12888 ;SR; - 12889 ; If we had already set the BatchEOF flag on a previous call (BatchEOF == 2 - 12890 ;or BatchEOF == 1 now), then do not do the LF check. - 12891 ; - 12892 00000B1D 268E06[4902] mov es,[es:Batch] - 12893 ;cmp byte [es:2],0 - 12894 00000B22 26803E020000 cmp byte [es:BATCHSEGMENT.BatchEOF],0 - 12895 00000B28 7516 jnz short crpresent - 12896 - 12897 ;inc byte [es:2] - 12898 00000B2A 26FE060200 inc byte [es:BATCHSEGMENT.BatchEOF] - 12899 ;match the dec following - 12900 00000B2F 8B1E[E9A5] mov bx,[BATBUFEND] - 12901 00000B33 80BF[C8A5]0A cmp byte [bx+BATBUF-1],0Ah ;was a LF present? - 12902 00000B38 7406 je short crpresent ;yes, no need to fake it - 12903 - 12904 ;add byte [es:2],3 - 12905 00000B3A 268006020003 add byte [es:BATCHSEGMENT.BatchEOF],3 - 12906 ;BatchEOF == 4 to fake CR-LF - 12907 crpresent: - 12908 ;; ;pop es - 12909 - 12910 ;ASSUME DS:TranGroup - 12911 ; 14/02/2023 - 12912 00000B40 8E1E[F59B] mov ds,[RESSEG] - 12913 ;ASSUME DS:ResGroup - 12914 ;SR; - 12915 ; The shift operation is done here to replace the decrement. This is because - 12916 ;we can jump to this label directly from above when bogus calls are made to - 12917 ;this routine even after batch processing is turned off. The shift ensures - 12918 ;maintains the following invariance : 4 -> 2; 2 -> 1 ; 1 -> 0; 0 -> 0. Thus, - 12919 ;it is used as a decrement and also as a NOP to just fall through on bogus - 12920 ;calls. - 12921 ; We turn batch processing off if BatchEOF == 1 or BatchEOF == 0. - 12922 ;BatchEOF == 1 when we fall through from BatEOFDS and BatchEOF == 0 on a - 12923 ;direct jump to BATEOF. If BatchEOF == 4, we return a fake CR-LF without - 12924 ;turning batch processing off. - 12925 - 12926 At_EOF: ;new label added ;M020 - 12927 ;shr byte [es:2],1 - 12928 00000B44 26D02E0200 shr byte [es:BATCHSEGMENT.BatchEOF],1 - 12929 ;decrement the flag - 12930 00000B49 7412 jz short turn_off ;zero,turn batch off - 12931 ;cmp byte [es:2],1 - 12932 00000B4B 26803E020001 cmp byte [es:BATCHSEGMENT.BatchEOF],1 - 12933 00000B51 7405 jz short ret_lf ;BatchEOF was 2, return LF - 12934 ; - 12935 ;BatchEOF == 4, indicates return fake CR now and fake LF next. - 12936 ; - 12937 00000B53 B00D mov al,0Dh ;return fake CR. - 12938 00000B55 07 pop es - 12939 00000B56 EB35 jmp short GETBYTEDONE - 12940 ret_lf: - 12941 00000B58 B00A mov al,0Ah ;return fake LF - 12942 00000B5A 07 pop es - 12943 00000B5B EB30 jmp short GETBYTEDONE - 12944 turn_off: - 12945 00000B5D 07 pop es - 12946 ;BATEOF: - 12947 ; MSDOS 3.3 - 12948 ;TURN_OFF: - 12949 ;mov ds,[RESSEG] - 12950 - 12951 ; MSDOS 3.3 (& MSDOS 6.0) - 12952 BATEOF: - 12953 00000B5E E8B1FE call BATCHOFF - 12954 00000B61 E8CC02 call BATCLOSE - 12955 - 12956 ;;; mov BatchEOF,0 ;make sure BatchEOF = 0 - 12957 - 12958 ;SR; BugBug - 12959 ; There is a good reason why this carriage return is being returned here. - 12960 ;This was part of the old code, thanks to some brain-damaged coding. Because, - 12961 ;of the way the caller is structured, a fake CR has to be returned again on - 12962 ;EOF to ensure the termination of the caller's loop. If echo is on, this - 12963 ;results in an extra linefeed after the batchfile is run if the last line of - 12964 ;the batchfile already had a CR-LF. - 12965 ;NB: Do not confuse this with the faked CR. The fake CR-LF was to mark - 12966 ;the end-of-line. This CR is to mark the end-of-file. - 12967 - 12968 00000B64 B00D mov al,0Dh ; If end-of-file, then end of line - 12969 00000B66 F606[9302]FF test byte [Batch_Abort],-1 - 12970 00000B6B C606[9302]00 mov byte [Batch_Abort],0 - 12971 00000B70 7407 jz short CONT_GET_BYT - 12972 00000B72 BF[569A] mov di,COMBUF+2 ; reset pointer to beginning of buffer - 12973 00000B75 31C9 xor cx,cx ; zero line length - 12974 00000B77 EB14 jmp short GETBYTEDONE - 12975 CONT_GET_BYT: - 12976 00000B79 833E[A502]F0 cmp word [SingleCom],0FFF0h ; See if we need to set SINGLECOM - 12977 00000B7E 750D jne short GETBYTEDONE - 12978 00000B80 833E[AE02]00 cmp word [Nest],0 ;G See if we have nested batch files - 12979 00000B85 7506 jnz short GETBYTEDONE ;G Yes - don't exit just yet - 12980 00000B87 C706[A502]FFFF mov word [SingleCom],0FFFFh ; -1 ; Cause termination - 12981 GETBYTEDONE: - 12982 00000B8D 1F pop ds - 12983 00000B8E 59 pop cx - 12984 00000B8F 5B pop bx - 12985 00000B90 C3 retn - 12986 - 12987 ; --------------------------------------------------------------------------- - 12988 - 12989 ;break <$If - conditional execution> - 12990 - 12991 ; 17/04/2023 - 12992 ;IFERRORP: - 12993 ; pop ax - 12994 ;IFERROR: - 12995 ; ; 14/02/2023 - Retro DOS v4.0 COMMAND.COM - 12996 ;FORERROR: - 12997 ; mov dx,SYNTMES_PTR - 12998 ; jmp cerror - 12999 - 13000 ; --------------------------------------------------------------------------- - 13001 - 13002 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13003 ; - 13004 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 13005 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0B69h - 13006 - 13007 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 13008 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0BAEh - 13009 _$IF: - 13010 ; MSDOS 6.0 - 13011 ; Turn off any pipes in progress. - 13012 00000B91 1E push ds ;AN004; save local DS - 13013 00000B92 8E1E[F59B] mov ds,[RESSEG] ;AN004; get resident segment - 13014 ;assume ds:resgroup ;AN004; - 13015 00000B96 803E[1403]00 cmp byte [PipeFiles],0 ;AN004; Only turn off if present. - 13016 00000B9B 7403 jz short IFNoPipe ;AN004; no pipe - continue - 13017 ;invoke PipeDel ;AN004; turn off piping - 13018 00000B9D E88025 call PIPEDEL - 13019 IFNoPipe: ;AN004; - 13020 00000BA0 1F pop ds ;AN004; get local DS back - 13021 ;assume ds:trangroup ;AN004; - 13022 - 13023 ; MSDOS 3.3 (&MSDOS 6.0) - 13024 00000BA1 C606[069C]00 mov byte [IFNOTFLAG],0 - 13025 00000BA6 C706[9CA4]0000 mov word [IF_NOT_COUNT],0 - 13026 00000BAC BE8100 mov si,81h - 13027 IFREENT: - 13028 00000BAF E8D41D call scanoff - 13029 00000BB2 3C0D cmp al,0Dh - 13030 00000BB4 743C je short IFERROR - 13031 00000BB6 89F5 mov bp,si - 13032 00000BB8 BF[3394] mov di,IFTAB ; Prepare to search if table - 13033 ;mov ch,0 - 13034 ; 17/04/2023 - 13035 00000BBB 30ED xor ch,ch - 13036 IFINDCOM: - 13037 00000BBD 89EE mov si,bp - 13038 00000BBF 8A0D mov cl,[di] - 13039 00000BC1 47 inc di - 13040 00000BC2 E33E jcxz IFSTRING - 13041 00000BC4 EB02 jmp short FIRSTCOMP - 13042 IFCOMP: - 13043 00000BC6 7510 jnz short IF_DIF - 13044 FIRSTCOMP: - 13045 00000BC8 AC lodsb - 13046 00000BC9 268A25 mov ah,[es:di] - 13047 00000BCC 47 inc di - 13048 00000BCD 38E0 cmp al,ah - 13049 00000BCF 7405 je short IFLP - 13050 00000BD1 80CC20 or ah,20h ; Try lower case - 13051 00000BD4 38E0 cmp al,ah - 13052 IFLP: - 13053 00000BD6 E2EE loop IFCOMP - 13054 IF_DIF: - 13055 00000BD8 9F lahf - 13056 00000BD9 01CF add di,cx ; Bump to next position without affecting flags - 13057 00000BDB 8B1D mov bx,[di] ; Get handler address - 13058 00000BDD 47 inc di - 13059 00000BDE 47 inc di - 13060 00000BDF 9E sahf - 13061 00000BE0 75DB jnz short IFINDCOM - 13062 00000BE2 AC lodsb - 13063 00000BE3 3C0D cmp al,0Dh - 13064 IFERRJ: - 13065 00000BE5 740B jz short IFERROR - 13066 00000BE7 E8A41D call DELIM - 13067 00000BEA 75D1 jnz short IFINDCOM - 13068 00000BEC E8971D call scanoff - 13069 00000BEF FFE3 jmp bx - 13070 - 13071 ; 17/04/2023 - 13072 IFERRORP: - 13073 00000BF1 58 pop ax - 13074 IFERROR: - 13075 ; 14/02/2023 - Retro DOS v4.0 COMMAND.COM - 13076 FORERROR: - 13077 00000BF2 BA[AA90] mov dx,SYNTMES_PTR - 13078 00000BF5 E92E21 jmp cerror - 13079 - 13080 IFNOT: - 13081 00000BF8 F616[069C] not byte [IFNOTFLAG] - 13082 00000BFC FF06[9CA4] inc word [IF_NOT_COUNT] - 13083 00000C00 EBAD jmp short IFREENT - 13084 - 13085 ; We are comparing two strings for equality. First, find the end of the - 13086 ; first string. + 12752 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 12753 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 0A95h + 12754 + 12755 GETBATBYT: + 12756 00000A7F 53 push bx + 12757 00000A80 51 push cx + 12758 00000A81 1E push ds + 12759 00000A82 F606[9302]FF test byte [Batch_Abort],-1 + 12760 ;jnz short BATEOF + 12761 ; 14/02/2023 + 12762 00000A87 7403 jz short getbatbyt1 + 12763 00000A89 E9D200 jmp BATEOF + 12764 getbatbyt1: + 12765 00000A8C F706[4902]FFFF test word [Batch],-1 + 12766 ;jz short BATEOF + 12767 ; 14/02/2023 + 12768 00000A92 7503 jnz short getbatbyt2 + 12769 00000A94 E9C700 jmp BATEOF + 12770 getbatbyt2: + 12771 00000A97 06 push es + 12772 00000A98 8E06[4902] mov es,[Batch] + 12773 + 12774 ; MSDOS 6.0 + 12775 ;M020; + 12776 ;Check if we have already reached EOF (BatchEOF flag set. Then, we do not + 12777 ;try to read from the batchfile again. + 12778 + 12779 ;cmp byte [es:2],0 + 12780 00000A9C 26803E020000 cmp byte [es:BATCHSEGMENT.BatchEOF],0 + 12781 ;already reached EOF? ;M020 + 12782 00000AA2 7403 jz short not_eof ;no, read batch file ;M020 + 12783 00000AA4 E99D00 jmp At_EOF ;yes, no more reads ;M020 + 12784 not_eof: ;M020 + 12785 ; MSDOS 3.3 (& MSDOS 6.0) + 12786 ;add word [es:8],1 ; MSDOS 6.0 + 12787 00000AA7 268306080001 add word [es:BATCHSEGMENT.BatSeek],1 + 12788 ;adc word [es:10],0 ; MSDOS 6.0 + 12789 00000AAD 2683160A0000 adc word [es:BATCHSEGMENT.BatSeek+2],0 + 12790 00000AB3 07 pop es + 12791 + 12792 ; See if we have bytes buffered... + 12793 + 12794 00000AB4 8CC8 mov ax,cs + 12795 00000AB6 8ED8 mov ds,ax + 12796 00000AB8 8B1E[C7A5] mov bx,[BATBUFPOS] + 12797 00000ABC 83FBFF cmp bx,-1 + 12798 00000ABF 7541 jnz short UNBUF + 12799 + 12800 ; There are no bytes in the buffer. Let's try to fill it up. + 12801 + 12802 00000AC1 BA[C9A5] mov dx,BATBUF + 12803 00000AC4 8B0E[E495] mov cx,[BATBUFLEN] ; max to read. + 12804 00000AC8 8B1E[F49E] mov bx,[BATHAND] + 12805 ; 14/02/2023 + 12806 00000ACC B43F mov ah,3Fh + 12807 ;mov ah,READ ; 3Fh ; Get one more byte from batch file + 12808 + 12809 ; 26/07/2024 - PCDOS 7.1 COMMAND.COM + 12810 %if 0 + 12811 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE + 12812 ; BX = file handle,CX = number of bytes to read + 12813 ; DS:DX -> buffer + 12814 %else + 12815 00000ACE E8E9FA call int_21h_indirect + 12816 %endif + 12817 + 12818 ; MSDOS 6.0 + 12819 00000AD1 7321 jnc short bat_read_ok ;AN022; if no error - continue + 12820 ;invoke get_ext_error_number ;AN022; get the error + 12821 00000AD3 E87515 call get_ext_error_number + 12822 00000AD6 1E push ds ;AN022; save local segment + 12823 00000AD7 8E1E[F59B] mov ds,[RESSEG] ;AN022; get resident segment + 12824 ;assume ds:resgroup ;AN022; + 12825 00000ADB 89C2 mov dx,ax ;AN022; put error in DX + 12826 ;invoke output_batch_name ;AN022; set up to print the error + 12827 00000ADD E857FB call output_batch_name + 12828 00000AE0 1F pop ds ;AN022; + 12829 ;assume ds:trangroup ;AN022; + 12830 ;invoke std_eprintf ;AN022; print out the error + 12831 00000AE1 E83C49 call std_eprintf + 12832 ;mov byte ptr combuf+2,end_of_line_in + 12833 00000AE4 C606[569A]0D mov byte [COMBUF+2],END_OF_LINE_IN ; 0Dh + 12834 ; ;AN022; terminate the batch line for parsing + 12835 ;mov byte ptr combuf+3,end_of_line_out + 12836 00000AE9 C606[579A]00 mov byte [COMBUF+3],END_OF_LINE_OUT ; 0 + 12837 ; ;AN022; terminate the batch line for output + 12838 ;M020; + 12839 ;Old bug! We jump to BatEof from here without ds=RESGROUP. Probably, this + 12840 ;error is never hit (and it shouldn't be) + 12841 + 12842 00000AEE 8E1E[F59B] mov ds,[RESSEG] ; ds = RESGROUP ; M020 + 12843 00000AF2 EB6A jmp short BATEOF ;AN022; terminate the batch file + 12844 bat_read_ok: ;AN022; + 12845 ; MSDOS 3.3 (& MSDOS 6.0) + 12846 00000AF4 89C1 mov cx,ax + 12847 ;jcxz TURN_OFF ; MSDOS 3.3 + 12848 ; 14/02/2023 + 12849 00000AF6 E320 jcxz BATEOFDS ; MSDOS 6.0 + 12850 00000AF8 890E[E9A5] mov [BATBUFEND],cx + 12851 00000AFC 31DB xor bx,bx + 12852 00000AFE 891E[C7A5] mov [BATBUFPOS],bx + 12853 + 12854 ; Buffered bytes! + 12855 UNBUF: + 12856 00000B02 8A87[C9A5] mov al,[BATBUF+bx] ; get next byte + 12857 00000B06 43 inc bx + 12858 00000B07 3B1E[E9A5] cmp bx,[BATBUFEND] ; beyond end of buffer? + 12859 00000B0B 7203 jb short SETBUFPOS + 12860 00000B0D BBFFFF mov bx,-1 + 12861 SETBUFPOS: + 12862 00000B10 891E[C7A5] mov [BATBUFPOS],bx + 12863 00000B14 3C1A cmp al,1Ah ; ^Z for termination? + 12864 00000B16 7575 jne short GETBYTEDONE + 12865 + 12866 ;We get here only when we hit an EOF + 12867 + 12868 ; MSDOS 6.0 + 12869 BATEOFDS: + 12870 ;SR; + 12871 ; HACK!!! A massive hack being put in here to get batch processing to work + 12872 ;properly on EOF. Previously, a CR was returned and batch processing turned + 12873 ;off the moment we hit an EOF. Unfortunately, if the last line had no CR-LF, + 12874 ;batch processing is turned off before the last line is processed and so + 12875 ;this line would never be executed. + 12876 ; To fix this, a new flag BatchEOF has been introduced. This flag is + 12877 ;set to 4 if there is no CR-LF before the EOF -- this is determined by looking + 12878 ;at the buffer contents. If there is no LF ( we assume that presence of LF + 12879 ;indicated a CR-LF combination), then we set BatchEOF to 4 and return a + 12880 ;fake CR to the caller. This decrements BatchEOF. On the next call to this + 12881 ;routine, BatchEOF is decremented to 2 and a fake lF is returned. On the + 12882 ;third call, BatchEOF becomes zero and batch processing is turned off, + 12883 ;now that the last line has been processed. If the EOF is the first char read into the buffer + 12884 ;during this call, and there was a CR-LF previously, we are going to fake + 12885 ;another redundant CR-LF. There is no work-around I can think of. + 12886 ; I would love to restructure this entire routine and its caller to + 12887 ;make the flow really easy to understand but I guess this will have to wait. + 12888 ; + 12889 00000B18 06 push es + 12890 00000B19 8E06[F59B] mov es,[RESSEG] + 12891 ;SR; + 12892 ; If we had already set the BatchEOF flag on a previous call (BatchEOF == 2 + 12893 ;or BatchEOF == 1 now), then do not do the LF check. + 12894 ; + 12895 00000B1D 268E06[4902] mov es,[es:Batch] + 12896 ;cmp byte [es:2],0 + 12897 00000B22 26803E020000 cmp byte [es:BATCHSEGMENT.BatchEOF],0 + 12898 00000B28 7516 jnz short crpresent + 12899 + 12900 ;inc byte [es:2] + 12901 00000B2A 26FE060200 inc byte [es:BATCHSEGMENT.BatchEOF] + 12902 ;match the dec following + 12903 00000B2F 8B1E[E9A5] mov bx,[BATBUFEND] + 12904 00000B33 80BF[C8A5]0A cmp byte [bx+BATBUF-1],0Ah ;was a LF present? + 12905 00000B38 7406 je short crpresent ;yes, no need to fake it + 12906 + 12907 ;add byte [es:2],3 + 12908 00000B3A 268006020003 add byte [es:BATCHSEGMENT.BatchEOF],3 + 12909 ;BatchEOF == 4 to fake CR-LF + 12910 crpresent: + 12911 ;; ;pop es + 12912 + 12913 ;ASSUME DS:TranGroup + 12914 ; 14/02/2023 + 12915 00000B40 8E1E[F59B] mov ds,[RESSEG] + 12916 ;ASSUME DS:ResGroup + 12917 ;SR; + 12918 ; The shift operation is done here to replace the decrement. This is because + 12919 ;we can jump to this label directly from above when bogus calls are made to + 12920 ;this routine even after batch processing is turned off. The shift ensures + 12921 ;maintains the following invariance : 4 -> 2; 2 -> 1 ; 1 -> 0; 0 -> 0. Thus, + 12922 ;it is used as a decrement and also as a NOP to just fall through on bogus + 12923 ;calls. + 12924 ; We turn batch processing off if BatchEOF == 1 or BatchEOF == 0. + 12925 ;BatchEOF == 1 when we fall through from BatEOFDS and BatchEOF == 0 on a + 12926 ;direct jump to BATEOF. If BatchEOF == 4, we return a fake CR-LF without + 12927 ;turning batch processing off. + 12928 + 12929 At_EOF: ;new label added ;M020 + 12930 ;shr byte [es:2],1 + 12931 00000B44 26D02E0200 shr byte [es:BATCHSEGMENT.BatchEOF],1 + 12932 ;decrement the flag + 12933 00000B49 7412 jz short turn_off ;zero,turn batch off + 12934 ;cmp byte [es:2],1 + 12935 00000B4B 26803E020001 cmp byte [es:BATCHSEGMENT.BatchEOF],1 + 12936 00000B51 7405 jz short ret_lf ;BatchEOF was 2, return LF + 12937 ; + 12938 ;BatchEOF == 4, indicates return fake CR now and fake LF next. + 12939 ; + 12940 00000B53 B00D mov al,0Dh ;return fake CR. + 12941 00000B55 07 pop es + 12942 00000B56 EB35 jmp short GETBYTEDONE + 12943 ret_lf: + 12944 00000B58 B00A mov al,0Ah ;return fake LF + 12945 00000B5A 07 pop es + 12946 00000B5B EB30 jmp short GETBYTEDONE + 12947 turn_off: + 12948 00000B5D 07 pop es + 12949 ;BATEOF: + 12950 ; MSDOS 3.3 + 12951 ;TURN_OFF: + 12952 ;mov ds,[RESSEG] + 12953 + 12954 ; MSDOS 3.3 (& MSDOS 6.0) + 12955 BATEOF: + 12956 00000B5E E8B1FE call BATCHOFF + 12957 00000B61 E8CC02 call BATCLOSE + 12958 + 12959 ;;; mov BatchEOF,0 ;make sure BatchEOF = 0 + 12960 + 12961 ;SR; BugBug + 12962 ; There is a good reason why this carriage return is being returned here. + 12963 ;This was part of the old code, thanks to some brain-damaged coding. Because, + 12964 ;of the way the caller is structured, a fake CR has to be returned again on + 12965 ;EOF to ensure the termination of the caller's loop. If echo is on, this + 12966 ;results in an extra linefeed after the batchfile is run if the last line of + 12967 ;the batchfile already had a CR-LF. + 12968 ;NB: Do not confuse this with the faked CR. The fake CR-LF was to mark + 12969 ;the end-of-line. This CR is to mark the end-of-file. + 12970 + 12971 00000B64 B00D mov al,0Dh ; If end-of-file, then end of line + 12972 00000B66 F606[9302]FF test byte [Batch_Abort],-1 + 12973 00000B6B C606[9302]00 mov byte [Batch_Abort],0 + 12974 00000B70 7407 jz short CONT_GET_BYT + 12975 00000B72 BF[569A] mov di,COMBUF+2 ; reset pointer to beginning of buffer + 12976 00000B75 31C9 xor cx,cx ; zero line length + 12977 00000B77 EB14 jmp short GETBYTEDONE + 12978 CONT_GET_BYT: + 12979 00000B79 833E[A502]F0 cmp word [SingleCom],0FFF0h ; See if we need to set SINGLECOM + 12980 00000B7E 750D jne short GETBYTEDONE + 12981 00000B80 833E[AE02]00 cmp word [Nest],0 ;G See if we have nested batch files + 12982 00000B85 7506 jnz short GETBYTEDONE ;G Yes - don't exit just yet + 12983 00000B87 C706[A502]FFFF mov word [SingleCom],0FFFFh ; -1 ; Cause termination + 12984 GETBYTEDONE: + 12985 00000B8D 1F pop ds + 12986 00000B8E 59 pop cx + 12987 00000B8F 5B pop bx + 12988 00000B90 C3 retn + 12989 + 12990 ; --------------------------------------------------------------------------- + 12991 + 12992 ;break <$If - conditional execution> + 12993 + 12994 ; 17/04/2023 + 12995 ;IFERRORP: + 12996 ; pop ax + 12997 ;IFERROR: + 12998 ; ; 14/02/2023 - Retro DOS v4.0 COMMAND.COM + 12999 ;FORERROR: + 13000 ; mov dx,SYNTMES_PTR + 13001 ; jmp cerror + 13002 + 13003 ; --------------------------------------------------------------------------- + 13004 + 13005 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13006 ; + 13007 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 13008 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0B69h + 13009 + 13010 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 13011 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0BAEh + 13012 _$IF: + 13013 ; MSDOS 6.0 + 13014 ; Turn off any pipes in progress. + 13015 00000B91 1E push ds ;AN004; save local DS + 13016 00000B92 8E1E[F59B] mov ds,[RESSEG] ;AN004; get resident segment + 13017 ;assume ds:resgroup ;AN004; + 13018 00000B96 803E[1403]00 cmp byte [PipeFiles],0 ;AN004; Only turn off if present. + 13019 00000B9B 7403 jz short IFNoPipe ;AN004; no pipe - continue + 13020 ;invoke PipeDel ;AN004; turn off piping + 13021 00000B9D E88025 call PIPEDEL + 13022 IFNoPipe: ;AN004; + 13023 00000BA0 1F pop ds ;AN004; get local DS back + 13024 ;assume ds:trangroup ;AN004; + 13025 + 13026 ; MSDOS 3.3 (&MSDOS 6.0) + 13027 00000BA1 C606[069C]00 mov byte [IFNOTFLAG],0 + 13028 00000BA6 C706[9CA4]0000 mov word [IF_NOT_COUNT],0 + 13029 00000BAC BE8100 mov si,81h + 13030 IFREENT: + 13031 00000BAF E8D41D call scanoff + 13032 00000BB2 3C0D cmp al,0Dh + 13033 00000BB4 743C je short IFERROR + 13034 00000BB6 89F5 mov bp,si + 13035 00000BB8 BF[3394] mov di,IFTAB ; Prepare to search if table + 13036 ;mov ch,0 + 13037 ; 17/04/2023 + 13038 00000BBB 30ED xor ch,ch + 13039 IFINDCOM: + 13040 00000BBD 89EE mov si,bp + 13041 00000BBF 8A0D mov cl,[di] + 13042 00000BC1 47 inc di + 13043 00000BC2 E33E jcxz IFSTRING + 13044 00000BC4 EB02 jmp short FIRSTCOMP + 13045 IFCOMP: + 13046 00000BC6 7510 jnz short IF_DIF + 13047 FIRSTCOMP: + 13048 00000BC8 AC lodsb + 13049 00000BC9 268A25 mov ah,[es:di] + 13050 00000BCC 47 inc di + 13051 00000BCD 38E0 cmp al,ah + 13052 00000BCF 7405 je short IFLP + 13053 00000BD1 80CC20 or ah,20h ; Try lower case + 13054 00000BD4 38E0 cmp al,ah + 13055 IFLP: + 13056 00000BD6 E2EE loop IFCOMP + 13057 IF_DIF: + 13058 00000BD8 9F lahf + 13059 00000BD9 01CF add di,cx ; Bump to next position without affecting flags + 13060 00000BDB 8B1D mov bx,[di] ; Get handler address + 13061 00000BDD 47 inc di + 13062 00000BDE 47 inc di + 13063 00000BDF 9E sahf + 13064 00000BE0 75DB jnz short IFINDCOM + 13065 00000BE2 AC lodsb + 13066 00000BE3 3C0D cmp al,0Dh + 13067 IFERRJ: + 13068 00000BE5 740B jz short IFERROR + 13069 00000BE7 E8A41D call DELIM + 13070 00000BEA 75D1 jnz short IFINDCOM + 13071 00000BEC E8971D call scanoff + 13072 00000BEF FFE3 jmp bx + 13073 + 13074 ; 17/04/2023 + 13075 IFERRORP: + 13076 00000BF1 58 pop ax + 13077 IFERROR: + 13078 ; 14/02/2023 - Retro DOS v4.0 COMMAND.COM + 13079 FORERROR: + 13080 00000BF2 BA[AA90] mov dx,SYNTMES_PTR + 13081 00000BF5 E92E21 jmp cerror + 13082 + 13083 IFNOT: + 13084 00000BF8 F616[069C] not byte [IFNOTFLAG] + 13085 00000BFC FF06[9CA4] inc word [IF_NOT_COUNT] + 13086 00000C00 EBAD jmp short IFREENT 13087 - 13088 IFSTRING: - 13089 00000C02 56 push si ; save away pointer for later compare - 13090 00000C03 31C9 xor cx,cx ; count of chars in first string - 13091 FIRST_STRING: - 13092 00000C05 AC lodsb ; get character - 13093 00000C06 3C0D cmp al,0Dh ; end of line? - 13094 00000C08 74E7 jz short IFERRORP ; yes => error - 13095 00000C0A E8811D call DELIM ; is it a delimiter? - 13096 00000C0D 7403 jz short EQUAL_CHECK ; yes, go find equal sign - 13097 00000C0F 41 inc cx ; remember 1 byte for the length - 13098 00000C10 EBF3 jmp short FIRST_STRING ; go back for more - 13099 EQUAL_CHECK: - 13100 00000C12 3C3D cmp al,'=' ; is char we have an = sign? - 13101 00000C14 7407 je short EQUAL_CHECK2 ; yes, go find second one. - 13102 00000C16 3C0D cmp al,0Dh ; end of line? - 13103 00000C18 74D7 je short IFERRORP ; yes, syntax error - 13104 00000C1A AC lodsb ; get next char - 13105 00000C1B EBF5 jmp short EQUAL_CHECK - 13106 - 13107 ; The first = has been found. The next char had better be an = too. - 13108 - 13109 EQUAL_CHECK2: - 13110 00000C1D AC lodsb ; get potential = char - 13111 00000C1E 3C3D cmp al,'=' ; is it good? - 13112 ;jnz short IFERRPJ ; no, error - 13113 ; 17/04/2023 - 13114 00000C20 75CF jne short IFERRORP - 13115 - 13116 ; Find beginning of second string. - 13117 - 13118 00000C22 E8611D call scanoff - 13119 00000C25 3C0D cmp al,0Dh - 13120 ;jz short IFERRPJ - 13121 ; 17/04/2023 - 13122 00000C27 74C8 je short IFERRORP - 13123 00000C29 5F pop di - 13124 - 13125 ; DS:SI points to second string - 13126 ; CX has number of chars in first string - 13127 ; ES:DI points to first string - 13128 - 13129 00000C2A F3A6 repe cmpsb - 13130 00000C2C 7414 jz short MATCH ; match found! + 13088 ; We are comparing two strings for equality. First, find the end of the + 13089 ; first string. + 13090 + 13091 IFSTRING: + 13092 00000C02 56 push si ; save away pointer for later compare + 13093 00000C03 31C9 xor cx,cx ; count of chars in first string + 13094 FIRST_STRING: + 13095 00000C05 AC lodsb ; get character + 13096 00000C06 3C0D cmp al,0Dh ; end of line? + 13097 00000C08 74E7 jz short IFERRORP ; yes => error + 13098 00000C0A E8811D call DELIM ; is it a delimiter? + 13099 00000C0D 7403 jz short EQUAL_CHECK ; yes, go find equal sign + 13100 00000C0F 41 inc cx ; remember 1 byte for the length + 13101 00000C10 EBF3 jmp short FIRST_STRING ; go back for more + 13102 EQUAL_CHECK: + 13103 00000C12 3C3D cmp al,'=' ; is char we have an = sign? + 13104 00000C14 7407 je short EQUAL_CHECK2 ; yes, go find second one. + 13105 00000C16 3C0D cmp al,0Dh ; end of line? + 13106 00000C18 74D7 je short IFERRORP ; yes, syntax error + 13107 00000C1A AC lodsb ; get next char + 13108 00000C1B EBF5 jmp short EQUAL_CHECK + 13109 + 13110 ; The first = has been found. The next char had better be an = too. + 13111 + 13112 EQUAL_CHECK2: + 13113 00000C1D AC lodsb ; get potential = char + 13114 00000C1E 3C3D cmp al,'=' ; is it good? + 13115 ;jnz short IFERRPJ ; no, error + 13116 ; 17/04/2023 + 13117 00000C20 75CF jne short IFERRORP + 13118 + 13119 ; Find beginning of second string. + 13120 + 13121 00000C22 E8611D call scanoff + 13122 00000C25 3C0D cmp al,0Dh + 13123 ;jz short IFERRPJ + 13124 ; 17/04/2023 + 13125 00000C27 74C8 je short IFERRORP + 13126 00000C29 5F pop di + 13127 + 13128 ; DS:SI points to second string + 13129 ; CX has number of chars in first string + 13130 ; ES:DI points to first string 13131 - 13132 ; No match. Let's find out what was wrong. The character that did not match - 13133 ; has been advanced over. Let's back up to it. + 13132 00000C2A F3A6 repe cmpsb + 13133 00000C2C 7414 jz short MATCH ; match found! 13134 - 13135 00000C2E 4E dec si - 13136 - 13137 ; If it is EOL, then syntax error - 13138 - 13139 00000C2F 803C0D cmp byte [si],0Dh - 13140 ;jz short IFERRJ - 13141 ; 17/04/2023 - 13142 00000C32 74BE je short IFERROR - 13143 - 13144 ; Advance pointer over remainder of unmatched text to next delimiter - 13145 - 13146 SKIPSTRINGEND: - 13147 00000C34 AC lodsb - 13148 NOTMATCH: - 13149 00000C35 3C0D cmp al,0Dh - 13150 IFERRORJ2: - 13151 ;jz short IFERRJ - 13152 ; 17/04/2023 - 13153 00000C37 74B9 jz short IFERROR - 13154 00000C39 E8521D call DELIM - 13155 00000C3C 75F6 jnz short SKIPSTRINGEND - 13156 - 13157 ; Signal that we did NOT have a match - 13158 - 13159 00000C3E B0FF mov al,-1 ; 0FFh - 13160 00000C40 EB37 jmp short IFRET + 13135 ; No match. Let's find out what was wrong. The character that did not match + 13136 ; has been advanced over. Let's back up to it. + 13137 + 13138 00000C2E 4E dec si + 13139 + 13140 ; If it is EOL, then syntax error + 13141 + 13142 00000C2F 803C0D cmp byte [si],0Dh + 13143 ;jz short IFERRJ + 13144 ; 17/04/2023 + 13145 00000C32 74BE je short IFERROR + 13146 + 13147 ; Advance pointer over remainder of unmatched text to next delimiter + 13148 + 13149 SKIPSTRINGEND: + 13150 00000C34 AC lodsb + 13151 NOTMATCH: + 13152 00000C35 3C0D cmp al,0Dh + 13153 IFERRORJ2: + 13154 ;jz short IFERRJ + 13155 ; 17/04/2023 + 13156 00000C37 74B9 jz short IFERROR + 13157 00000C39 E8521D call DELIM + 13158 00000C3C 75F6 jnz short SKIPSTRINGEND + 13159 + 13160 ; Signal that we did NOT have a match 13161 - 13162 ; 17/04/2023 - 13163 ;IFERRPJ: - 13164 ;jmp IFERRORP - 13165 - 13166 ; The compare succeeded. Was the second string longer than the first? - 13167 ; We do this by seeing if the next char is a delimiter. + 13162 00000C3E B0FF mov al,-1 ; 0FFh + 13163 00000C40 EB37 jmp short IFRET + 13164 + 13165 ; 17/04/2023 + 13166 ;IFERRPJ: + 13167 ;jmp IFERRORP 13168 - 13169 MATCH: - 13170 00000C42 AC lodsb - 13171 00000C43 E8481D call DELIM - 13172 00000C46 75ED jnz short NOTMATCH ; not same. - 13173 00000C48 30C0 xor al,al - 13174 00000C4A EB2D jmp short IFRET - 13175 - 13176 ; --------------------------------------------------------------------------- - 13177 - 13178 IFEXISTS: - 13179 - 13180 IFEXIST_ATTR EQU ATTR_HIDDEN+ATTR_SYSTEM ; 2+4 = 6 - 13181 - 13182 ;MOREDELIM: - 13183 00000C4C AC lodsb - 13184 00000C4D E83E1D call DELIM - 13185 00000C50 75FA jnz short IFEXISTS - 13186 ;jnz short MOREDELIM - 13187 - 13188 00000C52 BA[399D] mov dx,DIRBUF - 13189 00000C55 B8001A mov ax,1A00h - 13190 ;mov ax,Set_DMA*256 ; 1A00h - 13191 00000C58 CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 13192 ; DS:DX -> disk transfer buffer - 13193 00000C5A BB0200 mov bx,2 ; if(0) [|not](|1) exist[1|2] file(2|3) - 13194 00000C5D 031E[9CA4] add bx,[IF_NOT_COUNT] - 13195 ;mov ax,ARG_ARGV - 13196 ;mov ax,ARG+ARG_UNIT.argv - 13197 00000C61 B8[509F] mov ax,ARG - 13198 00000C64 E82929 call argv_calc ; convert arg index to pointer - 13199 00000C67 8B17 mov dx,[bx] - 13200 ;mov dx,[bx+ARGV_ELE.argpointer] ; mov dx,[bx+0] - 13201 ;mov cx,6 - 13202 00000C69 B90600 mov cx,IFEXIST_ATTR ; filetypes to search for - 13203 00000C6C B8004E mov ax,4E00h - 13204 ;mov ax,Find_First*256 ; 4E00h ; request first match, if any - 13205 00000C6F CD21 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) - 13206 ; CX = search attributes - 13207 ; DS:DX -> ASCIZ filespec - 13208 ; (drive,path, and wildcards allowed) - 13209 00000C71 7204 jc short IF_EX_C ; carry is how to determine error - 13210 00000C73 30C0 xor al,al - 13211 00000C75 EB02 jmp short IFRET - 13212 - 13213 ;nop - 13214 IF_EX_C: - 13215 00000C77 B0FF mov al,-1 ; 0FFh ; false 'n' fall through... - 13216 IFRET: - 13217 00000C79 F606[069C]FF test byte [IFNOTFLAG],-1 ; 0FFh - 13218 00000C7E 7402 jz short REALTEST - 13219 00000C80 F6D0 not al - 13220 REALTEST: - 13221 00000C82 08C0 or al,al - 13222 00000C84 7403 jz short IFTRUE - 13223 00000C86 E97BF4 jmp TCOMMAND - 13224 - 13225 IFTRUE: - 13226 00000C89 E8FA1C call scanoff - 13227 00000C8C 89F1 mov cx,si - 13228 00000C8E 81E98100 sub cx,81h - 13229 00000C92 280E8000 sub [80h],cl - 13230 00000C96 8A0E8000 mov cl,[80h] - 13231 00000C9A 880E[559A] mov [COMBUF+1],cl - 13232 00000C9E BF[569A] mov di,COMBUF+2 - 13233 00000CA1 FC cld - 13234 00000CA2 F3A4 rep movsb - 13235 00000CA4 B00D mov al,0Dh - 13236 00000CA6 AA stosb - 13237 - 13238 ; Signal that an IF was done. - 13239 ; This prevents the redirections from getting lost. + 13169 ; The compare succeeded. Was the second string longer than the first? + 13170 ; We do this by seeing if the next char is a delimiter. + 13171 + 13172 MATCH: + 13173 00000C42 AC lodsb + 13174 00000C43 E8481D call DELIM + 13175 00000C46 75ED jnz short NOTMATCH ; not same. + 13176 00000C48 30C0 xor al,al + 13177 00000C4A EB2D jmp short IFRET + 13178 + 13179 ; --------------------------------------------------------------------------- + 13180 + 13181 IFEXISTS: + 13182 + 13183 IFEXIST_ATTR EQU ATTR_HIDDEN+ATTR_SYSTEM ; 2+4 = 6 + 13184 + 13185 ;MOREDELIM: + 13186 00000C4C AC lodsb + 13187 00000C4D E83E1D call DELIM + 13188 00000C50 75FA jnz short IFEXISTS + 13189 ;jnz short MOREDELIM + 13190 + 13191 00000C52 BA[399D] mov dx,DIRBUF + 13192 00000C55 B8001A mov ax,1A00h + 13193 ;mov ax,Set_DMA*256 ; 1A00h + 13194 00000C58 CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 13195 ; DS:DX -> disk transfer buffer + 13196 00000C5A BB0200 mov bx,2 ; if(0) [|not](|1) exist[1|2] file(2|3) + 13197 00000C5D 031E[9CA4] add bx,[IF_NOT_COUNT] + 13198 ;mov ax,ARG_ARGV + 13199 ;mov ax,ARG+ARG_UNIT.argv + 13200 00000C61 B8[509F] mov ax,ARG + 13201 00000C64 E82929 call argv_calc ; convert arg index to pointer + 13202 00000C67 8B17 mov dx,[bx] + 13203 ;mov dx,[bx+ARGV_ELE.argpointer] ; mov dx,[bx+0] + 13204 ;mov cx,6 + 13205 00000C69 B90600 mov cx,IFEXIST_ATTR ; filetypes to search for + 13206 00000C6C B8004E mov ax,4E00h + 13207 ;mov ax,Find_First*256 ; 4E00h ; request first match, if any + 13208 00000C6F CD21 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) + 13209 ; CX = search attributes + 13210 ; DS:DX -> ASCIZ filespec + 13211 ; (drive,path, and wildcards allowed) + 13212 00000C71 7204 jc short IF_EX_C ; carry is how to determine error + 13213 00000C73 30C0 xor al,al + 13214 00000C75 EB02 jmp short IFRET + 13215 + 13216 ;nop + 13217 IF_EX_C: + 13218 00000C77 B0FF mov al,-1 ; 0FFh ; false 'n' fall through... + 13219 IFRET: + 13220 00000C79 F606[069C]FF test byte [IFNOTFLAG],-1 ; 0FFh + 13221 00000C7E 7402 jz short REALTEST + 13222 00000C80 F6D0 not al + 13223 REALTEST: + 13224 00000C82 08C0 or al,al + 13225 00000C84 7403 jz short IFTRUE + 13226 00000C86 E97BF4 jmp TCOMMAND + 13227 + 13228 IFTRUE: + 13229 00000C89 E8FA1C call scanoff + 13230 00000C8C 89F1 mov cx,si + 13231 00000C8E 81E98100 sub cx,81h + 13232 00000C92 280E8000 sub [80h],cl + 13233 00000C96 8A0E8000 mov cl,[80h] + 13234 00000C9A 880E[559A] mov [COMBUF+1],cl + 13235 00000C9E BF[569A] mov di,COMBUF+2 + 13236 00000CA1 FC cld + 13237 00000CA2 F3A4 rep movsb + 13238 00000CA4 B00D mov al,0Dh + 13239 00000CA6 AA stosb 13240 - 13241 00000CA7 1E push ds - 13242 00000CA8 8E1E[F59B] mov ds,[RESSEG] - 13243 00000CAC C606[AA02]FF mov byte [IfFlag],-1 - 13244 00000CB1 1F pop ds - 13245 - 13246 ; Go do the command - 13247 - 13248 ;jmp DOCOM1 ; MSDOS 5.0 COMMAND.COM - 13249 ; 07/06/2023 - 13250 ; Retro DOS v4.2 COMMAND.COM - 13251 00000CB2 E940F6 jmp DOCOM0 ; MSDOS 6.22 COMMAND.COM - 13252 - 13253 ; --------------------------------------------------------------------------- - 13254 - 13255 IFERRORJ3: - 13256 00000CB5 EB80 jmp IFERRORJ2 + 13241 ; Signal that an IF was done. + 13242 ; This prevents the redirections from getting lost. + 13243 + 13244 00000CA7 1E push ds + 13245 00000CA8 8E1E[F59B] mov ds,[RESSEG] + 13246 00000CAC C606[AA02]FF mov byte [IfFlag],-1 + 13247 00000CB1 1F pop ds + 13248 + 13249 ; Go do the command + 13250 + 13251 ;jmp DOCOM1 ; MSDOS 5.0 COMMAND.COM + 13252 ; 07/06/2023 + 13253 ; Retro DOS v4.2 COMMAND.COM + 13254 00000CB2 E940F6 jmp DOCOM0 ; MSDOS 6.22 COMMAND.COM + 13255 + 13256 ; --------------------------------------------------------------------------- 13257 - 13258 IFERLEV: - 13259 - 13260 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 13261 ; PCDOS 7.1 COMMAND.COM - 13262 ;%if 1 - 13263 ; cmp byte [si],0F2h ; CODE PAGE 437 - 13264 ; jne short IFERLEV_@ - 13265 ; inc si - 13266 ;IFERLEV_@: - 13267 ;%endif - 13268 00000CB7 B70A mov bh,10 - 13269 00000CB9 30DB xor bl,bl - 13270 GETNUMLP: - 13271 00000CBB AC lodsb - 13272 00000CBC 3C0D cmp al,0Dh - 13273 00000CBE 74F5 je short IFERRORJ3 - 13274 00000CC0 E8CB1C call DELIM - 13275 00000CC3 740C jz short GOTNUM - 13276 00000CC5 2C30 sub al,'0' - 13277 00000CC7 86C3 xchg al,bl - 13278 00000CC9 F6E7 mul bh - 13279 00000CCB 00D8 add al,bl - 13280 00000CCD 86C3 xchg al,bl - 13281 00000CCF EBEA jmp short GETNUMLP - 13282 GOTNUM: - 13283 00000CD1 1E push ds - 13284 00000CD2 8E1E[F59B] mov ds,[RESSEG] - 13285 00000CD6 8A26[9A02] mov ah,[RetCode] - 13286 00000CDA 1F pop ds - 13287 00000CDB 30C0 xor al,al - 13288 00000CDD 38DC cmp ah,bl - 13289 00000CDF 7398 jnb short IFRET - 13290 00000CE1 FEC8 dec al - 13291 00000CE3 EB94 jmp short IFRET - 13292 - 13293 ; --------------------------------------------------------------------------- - 13294 - 13295 ; Shift the parameters in the batch structure by 1 and set up the new argument. - 13296 ; This is a NOP if no batch in progress. + 13258 IFERRORJ3: + 13259 00000CB5 EB80 jmp IFERRORJ2 + 13260 + 13261 IFERLEV: + 13262 + 13263 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 13264 ; PCDOS 7.1 COMMAND.COM + 13265 ;%if 1 + 13266 ; cmp byte [si],0F2h ; CODE PAGE 437 + 13267 ; jne short IFERLEV_@ + 13268 ; inc si + 13269 ;IFERLEV_@: + 13270 ;%endif + 13271 00000CB7 B70A mov bh,10 + 13272 00000CB9 30DB xor bl,bl + 13273 GETNUMLP: + 13274 00000CBB AC lodsb + 13275 00000CBC 3C0D cmp al,0Dh + 13276 00000CBE 74F5 je short IFERRORJ3 + 13277 00000CC0 E8CB1C call DELIM + 13278 00000CC3 740C jz short GOTNUM + 13279 00000CC5 2C30 sub al,'0' + 13280 00000CC7 86C3 xchg al,bl + 13281 00000CC9 F6E7 mul bh + 13282 00000CCB 00D8 add al,bl + 13283 00000CCD 86C3 xchg al,bl + 13284 00000CCF EBEA jmp short GETNUMLP + 13285 GOTNUM: + 13286 00000CD1 1E push ds + 13287 00000CD2 8E1E[F59B] mov ds,[RESSEG] + 13288 00000CD6 8A26[9A02] mov ah,[RetCode] + 13289 00000CDA 1F pop ds + 13290 00000CDB 30C0 xor al,al + 13291 00000CDD 38DC cmp ah,bl + 13292 00000CDF 7398 jnb short IFRET + 13293 00000CE1 FEC8 dec al + 13294 00000CE3 EB94 jmp short IFRET + 13295 + 13296 ; --------------------------------------------------------------------------- 13297 - 13298 _SHIFT: - 13299 00000CE5 8E1E[F59B] mov ds,[RESSEG] - 13300 00000CE9 A1[4902] mov ax,[Batch] ; get batch pointer - 13301 00000CEC 09C0 or ax,ax ; in batch mode? - 13302 00000CEE 7501 jnz short SHIFT1 ; yes, operate in batch segment - 13303 SHIFT_RETN: ; no, done. - 13304 00000CF0 C3 retn - 13305 SHIFT1: - 13306 00000CF1 8EC0 mov es,ax - 13307 00000CF3 8ED8 mov ds,ax - 13308 - 13309 ; Now move the batch args down by 1 word - 13310 - 13311 ;;mov di,0Bh ; MSDOS 3.3 COMMAND.COM - 13312 ;mov di,0Ch ; MSDOS 5.0 COMMAND.COM - 13313 00000CF5 BF0C00 mov di,BATCHSEGMENT.BatParm ; point to parm table - 13314 00000CF8 8D7502 lea si,[di+2] ; make source = dest + 2 - 13315 00000CFB B90900 mov cx,9 ; move 9 parameters - 13316 00000CFE F3A5 rep movsw ; SHIFT down - 13317 - 13318 ; If the last parameter (the one not moved) is empty (= -1) then we are done. - 13319 ; We have copied it into the previous position. + 13298 ; Shift the parameters in the batch structure by 1 and set up the new argument. + 13299 ; This is a NOP if no batch in progress. + 13300 + 13301 _SHIFT: + 13302 00000CE5 8E1E[F59B] mov ds,[RESSEG] + 13303 00000CE9 A1[4902] mov ax,[Batch] ; get batch pointer + 13304 00000CEC 09C0 or ax,ax ; in batch mode? + 13305 00000CEE 7501 jnz short SHIFT1 ; yes, operate in batch segment + 13306 SHIFT_RETN: ; no, done. + 13307 00000CF0 C3 retn + 13308 SHIFT1: + 13309 00000CF1 8EC0 mov es,ax + 13310 00000CF3 8ED8 mov ds,ax + 13311 + 13312 ; Now move the batch args down by 1 word + 13313 + 13314 ;;mov di,0Bh ; MSDOS 3.3 COMMAND.COM + 13315 ;mov di,0Ch ; MSDOS 5.0 COMMAND.COM + 13316 00000CF5 BF0C00 mov di,BATCHSEGMENT.BatParm ; point to parm table + 13317 00000CF8 8D7502 lea si,[di+2] ; make source = dest + 2 + 13318 00000CFB B90900 mov cx,9 ; move 9 parameters + 13319 00000CFE F3A5 rep movsw ; SHIFT down 13320 - 13321 00000D00 833DFF cmp word [di],-1 ; if last one was not in use then - 13322 00000D03 74EB je short SHIFT_RETN ; No new parm + 13321 ; If the last parameter (the one not moved) is empty (= -1) then we are done. + 13322 ; We have copied it into the previous position. 13323 - 13324 ; This last pointer is NOT nul. Get it and scan to find the next argument. - 13325 ; Assume, first, that there is no next argument. - 13326 - 13327 00000D05 8B35 mov si,[di] - 13328 00000D07 C705FFFF mov word [di],-1 ; Assume no parm - 13329 - 13330 ; The parameters are CR separated. Scan for end of this parm. - 13331 - 13332 SKIPCRLP: - 13333 00000D0B AC lodsb - 13334 00000D0C 3C0D cmp al,0Dh - 13335 00000D0E 75FB jne short SKIPCRLP - 13336 - 13337 ; We are now pointing at next arg. If it is 0 (end of original line) then we - 13338 ; are finished. There are no more parms and the pointer has been previously - 13339 ; initialized to indicate it. - 13340 - 13341 00000D10 803C00 cmp byte [si],0 - 13342 00000D13 74DB jz short SHIFT_RETN ; End of parms - 13343 00000D15 8935 mov [di],si ; Pointer to next parm as %9 - 13344 00000D17 C3 retn - 13345 - 13346 ; =============== S U B R O U T I N E ======================================= - 13347 - 13348 ; Skip delim reads bytes from the batch file until a non-delimiter is seen. - 13349 ; returns char in AL, carry set -> eof + 13324 00000D00 833DFF cmp word [di],-1 ; if last one was not in use then + 13325 00000D03 74EB je short SHIFT_RETN ; No new parm + 13326 + 13327 ; This last pointer is NOT nul. Get it and scan to find the next argument. + 13328 ; Assume, first, that there is no next argument. + 13329 + 13330 00000D05 8B35 mov si,[di] + 13331 00000D07 C705FFFF mov word [di],-1 ; Assume no parm + 13332 + 13333 ; The parameters are CR separated. Scan for end of this parm. + 13334 + 13335 SKIPCRLP: + 13336 00000D0B AC lodsb + 13337 00000D0C 3C0D cmp al,0Dh + 13338 00000D0E 75FB jne short SKIPCRLP + 13339 + 13340 ; We are now pointing at next arg. If it is 0 (end of original line) then we + 13341 ; are finished. There are no more parms and the pointer has been previously + 13342 ; initialized to indicate it. + 13343 + 13344 00000D10 803C00 cmp byte [si],0 + 13345 00000D13 74DB jz short SHIFT_RETN ; End of parms + 13346 00000D15 8935 mov [di],si ; Pointer to next parm as %9 + 13347 00000D17 C3 retn + 13348 + 13349 ; =============== S U B R O U T I N E ======================================= 13350 - 13351 SKIPDELIM: - 13352 00000D18 F706[4902]FFFF test word [Batch],-1 ; batch file empty. OOPS! - 13353 00000D1E 740A jz short SKIPERR - 13354 00000D20 E85CFD call GETBATBYT ; get a char - 13355 00000D23 E8681C call DELIM ; check for ignoreable chars - 13356 00000D26 74F0 jz short SKIPDELIM ; ignore this char. - 13357 00000D28 F8 clc - 13358 00000D29 C3 retn - 13359 SKIPERR: - 13360 00000D2A F9 stc - 13361 GOTO_RETN: - 13362 00000D2B C3 retn - 13363 - 13364 ; --------------------------------------------------------------------------- - 13365 - 13366 ; CALL is an internal command that transfers control to a .bat, .exe, or - 13367 ; .com file. This routine strips the CALL off the command line, sets - 13368 ; the CALL_FLAG to indicate a call in progress, and returns control to - 13369 ; DOCOM1 in TCODE to reprocess the command line and execute the file - 13370 ; being CALLed. - 13371 - 13372 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13373 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0C27h + 13351 ; Skip delim reads bytes from the batch file until a non-delimiter is seen. + 13352 ; returns char in AL, carry set -> eof + 13353 + 13354 SKIPDELIM: + 13355 00000D18 F706[4902]FFFF test word [Batch],-1 ; batch file empty. OOPS! + 13356 00000D1E 740A jz short SKIPERR + 13357 00000D20 E85CFD call GETBATBYT ; get a char + 13358 00000D23 E8681C call DELIM ; check for ignoreable chars + 13359 00000D26 74F0 jz short SKIPDELIM ; ignore this char. + 13360 00000D28 F8 clc + 13361 00000D29 C3 retn + 13362 SKIPERR: + 13363 00000D2A F9 stc + 13364 GOTO_RETN: + 13365 00000D2B C3 retn + 13366 + 13367 ; --------------------------------------------------------------------------- + 13368 + 13369 ; CALL is an internal command that transfers control to a .bat, .exe, or + 13370 ; .com file. This routine strips the CALL off the command line, sets + 13371 ; the CALL_FLAG to indicate a call in progress, and returns control to + 13372 ; DOCOM1 in TCODE to reprocess the command line and execute the file + 13373 ; being CALLed. 13374 - 13375 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 13376 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0D01h + 13375 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13376 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0C27h 13377 - 13378 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 13379 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0D4Ch - 13380 _$CALL: - 13381 - 13382 ; strip off CALL from command line - 13383 - 13384 ;ASSUME DS:trangroup,ES:trangroup - 13385 - 13386 00000D2C 56 push si - 13387 00000D2D 57 push di - 13388 00000D2E 50 push ax - 13389 00000D2F 51 push cx - 13390 00000D30 BE[569A] mov si,COMBUF+2 - 13391 00000D33 E8501C call scanoff ;get to first non-delimeter - 13392 ;add si,4 - 13393 00000D36 83C604 add si,length_call ;point to char past CALL - 13394 00000D39 BF[569A] mov di,COMBUF+2 - 13395 ;mov cx,124 - 13396 00000D3C B97C00 mov cx,COMBUFLEN-length_call - 13397 ;get length of buffer - 13398 00000D3F F3A4 rep movsb ;move it - 13399 00000D41 59 pop cx - 13400 00000D42 58 pop ax - 13401 00000D43 5F pop di - 13402 00000D44 5E pop si - 13403 - 13404 ; set call flag to indicate call in progress - 13405 - 13406 00000D45 1E push ds - 13407 00000D46 8E1E[F59B] mov ds,[RESSEG] - 13408 00000D4A C606[B002]01 mov byte [Call_Flag],call_in_progress ; 1 - 13409 00000D4F C606[B102]01 mov byte [Call_Batch_Flag],call_in_progress ; 1 - 13410 - 13411 ; Turn off any pipes in progress. - 13412 - 13413 00000D54 803E[1403]00 cmp byte [PipeFiles],0 ; Only turn off if present. - 13414 00000D59 7403 jz short _NOPIPE - 13415 00000D5B E8C223 call PIPEDEL - 13416 _NOPIPE: - 13417 00000D5E 1F pop ds - 13418 00000D5F C3 retn - 13419 - 13420 ; --------------------------------------------------------------------------- - 13421 - 13422 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13423 _GOTO: - 13424 00000D60 8E1E[F59B] mov ds,[RESSEG] - 13425 00000D64 F706[4902]FFFF test word [Batch],-1 ; If not in batch mode, a nop - 13426 00000D6A 74BF jz short GOTO_RETN - 13427 00000D6C 31D2 xor dx,dx - 13428 00000D6E 1E push ds - 13429 00000D6F 8E1E[4902] mov ds,[Batch] - 13430 ;mov [8],dx ; MSDOS 5.0 COMMAND.COM - 13431 00000D73 89160800 mov [BATCHSEGMENT.BatSeek],dx ; Back to start - 13432 ;mov [10],dx ; MSDOS 5.0 COMMAND.COM - 13433 00000D77 89160A00 mov [BATCHSEGMENT.BatSeek+2],dx ; Back to start - 13434 - 13435 ; MSDOS 6.0 - 13436 ;M037 - 13437 ; Clear EOF indicator because we have reseeked to the beginning of the file. - 13438 ; - 13439 00000D7B C606020000 mov byte [BATCHSEGMENT.BatchEOF],0 - 13440 ; clear eof indicator ;M037 - 13441 ; MSDOS 3.3 (& MSDOS 6.0) - 13442 00000D80 1F pop ds - 13443 GOTOOPEN: - 13444 00000D81 E86BF8 call PROMPTBAT - 13445 ;mov di,5Dh - 13446 00000D84 BF5D00 mov di,FCB+1 ; Get the label - 13447 00000D87 B90B00 mov cx,11 - 13448 00000D8A B020 mov al,' ' - 13449 00000D8C F2AE repne scasb - 13450 00000D8E 7501 jnz short NOINC - 13451 00000D90 41 inc cx - 13452 NOINC: - 13453 00000D91 83E90B sub cx,11 - 13454 00000D94 F7D9 neg cx - 13455 ;mov [cs:GOTOLEN],cx - 13456 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13457 00000D96 26890E[399D] mov [es:GOTOLEN],cx ; MSDOS 5.0 (& 6.0) - 13458 - 13459 ; At beginning of file. Skip to first non-delimiter char - 13460 - 13461 00000D9B E87AFF call SKIPDELIM - 13462 00000D9E 721C jb short BADGOTO - 13463 00000DA0 3C3A cmp al,':' - 13464 00000DA2 7426 jz short CHKLABEL - 13465 LABLKLP: ; Look for the label - 13466 00000DA4 E8D8FC call GETBATBYT - 13467 00000DA7 3C0A cmp al,0Ah - 13468 00000DA9 7509 jne short LABLKTST - 13469 - 13470 ; At beginning of line. Skip to first non-delimiter char - 13471 - 13472 00000DAB E86AFF call SKIPDELIM - 13473 00000DAE 720C jb short BADGOTO - 13474 00000DB0 3C3A cmp al,':' - 13475 00000DB2 7416 je short CHKLABEL - 13476 LABLKTST: - 13477 00000DB4 F706[4902]FFFF test word [Batch],0FFFFh ; -1 - 13478 00000DBA 75E8 jnz short LABLKLP - 13479 BADGOTO: - 13480 00000DBC E87100 call BATCLOSE - 13481 - 13482 ; MSDOS 6.0 - 13483 ;SR; - 13484 ; At this point we are terminating without freeing up any nested batch - 13485 ;segments i.e if the error occurred within a called batch file. This routine - 13486 ;will traverse the linked list of batch segments and free all of them. - 13487 ; - 13488 00000DBF E8BD00 call free_batch ; free up nested batch segments - 13489 - 13490 ; MSDOS 3.3 (& MSDOS 6.0) - 13491 00000DC2 0E push cs - 13492 00000DC3 1F pop ds - 13493 00000DC4 BA[A790] mov dx,BADLAB_PTR - 13494 00000DC7 E95C1F jmp cerror - 13495 - 13496 ; Found the :. Skip to first non-delimiter char - 13497 - 13498 CHKLABEL: - 13499 00000DCA E84BFF call SKIPDELIM - 13500 00000DCD 72ED jb short BADGOTO - 13501 00000DCF BF5D00 mov di,FCB+1 ; 5Dh - 13502 ;mov cx,[cs:GOTOLEN] - 13503 ; 14/02/2023 - 13504 00000DD2 268B0E[399D] mov cx,[es:GOTOLEN] ; MSDOS 5.0 (& 6.0) COMMAND.COM - 13505 00000DD7 EB05 jmp short GOTBYTE - 13506 - 13507 NEXTCHRLP: - 13508 00000DD9 51 push cx - 13509 00000DDA E8A2FC call GETBATBYT - 13510 00000DDD 59 pop cx - 13511 GOTBYTE: - 13512 ; 18/03/2023 - 13513 ; 14/02/2023 - 13514 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0CD9h - 13515 00000DDE E88019 call testkanj - 13516 00000DE1 7413 jz short NOTKANJ1 - 13517 00000DE3 263A05 cmp al,[es:di] - 13518 00000DE6 75CC jne short LABLKTST - 13519 00000DE8 47 inc di - 13520 00000DE9 49 dec cx - 13521 00000DEA E3C8 jcxz LABLKTST - 13522 00000DEC 51 push cx - 13523 00000DED E88FFC call GETBATBYT - 13524 00000DF0 59 pop cx - 13525 00000DF1 263A05 cmp al,[es:di] - 13526 00000DF4 EB0C jmp short KNEXTLABCHR - 13527 NOTKANJ1: - 13528 ; 14/02/2023 - 13529 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0CF1h - 13530 00000DF6 0C20 or al,20h - 13531 00000DF8 263A05 cmp al,[es:di] - 13532 ;jne short TRYUPPER - 13533 ;jmp short NEXTLABCHR - 13534 ; 25/04/2023 - 13535 00000DFB 7407 je short NEXTLABCHR - 13536 TRYUPPER: - 13537 00000DFD 2C20 sub al,20h - 13538 00000DFF 263A05 cmp al,[es:di] - 13539 KNEXTLABCHR: - 13540 00000E02 75B0 jnz short LABLKTST - 13541 NEXTLABCHR: - 13542 00000E04 47 inc di - 13543 00000E05 E2D2 loop NEXTCHRLP - 13544 00000E07 E875FC call GETBATBYT - 13545 ; 14/02/2023 - 13546 00000E0A 26833E[399D]08 cmp word [es:GOTOLEN],8 ; MSDOS 5.0 (& 6.0) COMMAND.COM - 13547 ;cmp word [cs:GOTOLEN],8 ; Is the label at least 8 chars long? - 13548 00000E10 7D04 jge short GOTOCONT ; Yes, then the next char doesn't matter - 13549 00000E12 3C20 cmp al,' ' - 13550 00000E14 779E ja short LABLKTST - 13551 GOTOCONT: - 13552 00000E16 3C0D cmp al,0Dh - 13553 00000E18 7407 je short SKIPLFEED - 13554 TONEXTBATLIN: - 13555 00000E1A E862FC call GETBATBYT - 13556 00000E1D 3C0D cmp al,0Dh - 13557 00000E1F 75F9 jne short TONEXTBATLIN - 13558 SKIPLFEED: - 13559 00000E21 E85BFC call GETBATBYT - 13560 - 13561 ; MSDOS 6.0 - 13562 ;SR; - 13563 ; The BatchEOF flag is set in GetBatByt to indicate that we are faking a - 13564 ;CR-LF for the last line. On a goto, this flag has to be cleared, because - 13565 ;BatchEOF == 1 now, after returning a CR-LF. The next call to GetBatByt - 13566 ;to get the EOF has not been made yet because we encountered the Goto. On - 13567 ;all other cases, EOF will be hit while trying to read the next line and - 13568 ;we are fine. I know, I know, what a massive hack from hell!! God help us!! - 13569 ; - 13570 00000E24 06 push es - 13571 00000E25 8E06[4902] mov es,[Batch] - 13572 00000E29 26C606020000 mov byte [es:BATCHSEGMENT.BatchEOF],0 - 13573 ;invalidate fake CR-LF flag - 13574 00000E2F 07 pop es - 13575 - 13576 ; MSDOS 3.3 (& MSDOS 6.0) - 13577 ;call BATCLOSE - 13578 ;retn - 13579 ; 14/02/2023 - 13580 ;jmp short BATCLOSE - 13581 - 13582 ; =============== S U B R O U T I N E ======================================= - 13583 - 13584 ; 27/07/2024 - 13585 BATCLOSE: - 13586 00000E30 2E8B1E[F49E] mov bx,[cs:BATHAND] - 13587 00000E35 83FB05 cmp bx,5 - 13588 00000E38 7205 jb short CLOSERETURN - 13589 ; 14/02/2023 - 13590 00000E3A B43E mov ah,3Eh - 13591 ;mov ah,CLOSE ; 3Eh - 13592 - 13593 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM - 13594 %if 0 - 13595 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 13596 ; BX = file handle - 13597 %else - 13598 00000E3C E87BF7 call int_21h_indirect - 13599 %endif - 13600 - 13601 CLOSERETURN: - 13602 00000E3F C606[9202]00 mov byte [In_Batch],0 ; reset flag - 13603 00000E44 C3 retn - 13604 - 13605 ; =============== S U B R O U T I N E ======================================= - 13606 - 13607 ; Open the BATCH file, If open fails, AL is drive of batch file (A=1) - 13608 ; Also, fills internal batch buffer. If access denied, then AX = -1 - 13609 - 13610 ; 27/07/2024 - 13611 ; 14/02/2023 - 13612 BATOPEN: - 13613 00000E45 1E push ds - 13614 00000E46 8E1E[4902] mov ds,[Batch] - 13615 ;;mov dx,1Fh ; MSDOS 3.3 COMMAND.COM - 13616 ;mov dx,20h ; MSDOS 5.0 COMMAND.COM - 13617 00000E4A BA2000 mov dx,BATCHSEGMENT.BatFile - 13618 - 13619 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM - 13620 %if 0 - 13621 mov ax,3D00h - 13622 ;mov ax,(OPEN<<8) ; 3D00h ; Open the batch file - 13623 - 13624 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 13625 ; DS:DX -> ASCIZ filename - 13626 ; AL = access mode - 13627 ; 0 - read - 13628 %else - 13629 00000E4D B8203D mov ax,3D20h - 13630 ;mov ax,(OPEN<<8)|20h ; 3D20h ; Open the batch file - 13631 ; 00-100-000b (00-DENYNONE-READONLY) - 13632 00000E50 E867F7 call int_21h_indirect - 13633 %endif - 13634 - 13635 00000E53 721C jc short SETERRDL - 13636 ;mov dx,[8] - 13637 00000E55 8B160800 mov dx,[BATCHSEGMENT.BatSeek] - 13638 ;mov cx,[10] - 13639 00000E59 8B0E0A00 mov cx,[BATCHSEGMENT.BatSeek+2] - 13640 00000E5D 1F pop ds - 13641 ;mov [cs:BATHAND],ax - 13642 00000E5E 26A3[F49E] mov [es:BATHAND],ax ; MSDOS 5.0 (& 6.0) COMMAND.COM - 13643 00000E62 89C3 mov bx,ax - 13644 00000E64 B80042 mov ax,4200h - 13645 ;mov ax,(LSEEK<<8) ; 4200h ; Go to the right spot - 13646 00000E67 CD21 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) - 13647 ; AL = method: offset from beginning of file - 13648 - 13649 ;mov word [cs:BATBUFPOS],-1 ; 0FFFFh - 13650 ; nuke batch buffer position - 13651 00000E69 26C706[C7A5]FFFF mov word [es:BATBUFPOS],-1 ; MSDOS 5.0 (& 6.0) COMMAND.COM - 13652 BATOPEN_RETN: - 13653 00000E70 C3 retn - 13654 - 13655 SETERRDL: - 13656 00000E71 89D3 mov bx,dx - 13657 ; MSDOS 6.0 - 13658 ;invoke get_ext_error_number ;AN022; get the extended error - 13659 ; 14/02/2023 - 13660 00000E73 E8D511 call get_ext_error_number - 13661 00000E76 89C2 mov dx,ax ;AN022; save extended error in DX - 13662 - 13663 ; MSDOS 3.3 - 13664 ;mov dx,INSERTDSKPTR - 13665 ;call GET_EXT_ERR_NUMBER - 13666 - 13667 ; MSDOS 3.3 (& MSDOS 6.0) - 13668 00000E78 8A07 mov al,[bx] ; Get drive spec - 13669 00000E7A 2C40 sub al,'@' ; sub al,40h ; A = 1, B = 2 .. - 13670 00000E7C 1F pop ds - 13671 00000E7D F9 stc ; SUB mucked over carry - 13672 00000E7E C3 retn - 13673 - 13674 ; =============== S U B R O U T I N E ======================================= - 13675 - 13676 ;Free_batch : This routine traverses the linked batch segments freeing all - 13677 ;the batch and FOR segments until all of them are freed. It also restores - 13678 ;the old state of the EchoFlag. - 13679 ; - 13680 ; ENTRY: ds = RESGROUP - 13681 ; - 13682 ; EXIT: All batch & FOR segments freed. - 13683 ; EchoFlag restored to old state before batch process. + 13378 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 13379 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0D01h + 13380 + 13381 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 13382 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:0D4Ch + 13383 _$CALL: + 13384 + 13385 ; strip off CALL from command line + 13386 + 13387 ;ASSUME DS:trangroup,ES:trangroup + 13388 + 13389 00000D2C 56 push si + 13390 00000D2D 57 push di + 13391 00000D2E 50 push ax + 13392 00000D2F 51 push cx + 13393 00000D30 BE[569A] mov si,COMBUF+2 + 13394 00000D33 E8501C call scanoff ;get to first non-delimeter + 13395 ;add si,4 + 13396 00000D36 83C604 add si,length_call ;point to char past CALL + 13397 00000D39 BF[569A] mov di,COMBUF+2 + 13398 ;mov cx,124 + 13399 00000D3C B97C00 mov cx,COMBUFLEN-length_call + 13400 ;get length of buffer + 13401 00000D3F F3A4 rep movsb ;move it + 13402 00000D41 59 pop cx + 13403 00000D42 58 pop ax + 13404 00000D43 5F pop di + 13405 00000D44 5E pop si + 13406 + 13407 ; set call flag to indicate call in progress + 13408 + 13409 00000D45 1E push ds + 13410 00000D46 8E1E[F59B] mov ds,[RESSEG] + 13411 00000D4A C606[B002]01 mov byte [Call_Flag],call_in_progress ; 1 + 13412 00000D4F C606[B102]01 mov byte [Call_Batch_Flag],call_in_progress ; 1 + 13413 + 13414 ; Turn off any pipes in progress. + 13415 + 13416 00000D54 803E[1403]00 cmp byte [PipeFiles],0 ; Only turn off if present. + 13417 00000D59 7403 jz short _NOPIPE + 13418 00000D5B E8C223 call PIPEDEL + 13419 _NOPIPE: + 13420 00000D5E 1F pop ds + 13421 00000D5F C3 retn + 13422 + 13423 ; --------------------------------------------------------------------------- + 13424 + 13425 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13426 _GOTO: + 13427 00000D60 8E1E[F59B] mov ds,[RESSEG] + 13428 00000D64 F706[4902]FFFF test word [Batch],-1 ; If not in batch mode, a nop + 13429 00000D6A 74BF jz short GOTO_RETN + 13430 00000D6C 31D2 xor dx,dx + 13431 00000D6E 1E push ds + 13432 00000D6F 8E1E[4902] mov ds,[Batch] + 13433 ;mov [8],dx ; MSDOS 5.0 COMMAND.COM + 13434 00000D73 89160800 mov [BATCHSEGMENT.BatSeek],dx ; Back to start + 13435 ;mov [10],dx ; MSDOS 5.0 COMMAND.COM + 13436 00000D77 89160A00 mov [BATCHSEGMENT.BatSeek+2],dx ; Back to start + 13437 + 13438 ; MSDOS 6.0 + 13439 ;M037 + 13440 ; Clear EOF indicator because we have reseeked to the beginning of the file. + 13441 ; + 13442 00000D7B C606020000 mov byte [BATCHSEGMENT.BatchEOF],0 + 13443 ; clear eof indicator ;M037 + 13444 ; MSDOS 3.3 (& MSDOS 6.0) + 13445 00000D80 1F pop ds + 13446 GOTOOPEN: + 13447 00000D81 E86BF8 call PROMPTBAT + 13448 ;mov di,5Dh + 13449 00000D84 BF5D00 mov di,FCB+1 ; Get the label + 13450 00000D87 B90B00 mov cx,11 + 13451 00000D8A B020 mov al,' ' + 13452 00000D8C F2AE repne scasb + 13453 00000D8E 7501 jnz short NOINC + 13454 00000D90 41 inc cx + 13455 NOINC: + 13456 00000D91 83E90B sub cx,11 + 13457 00000D94 F7D9 neg cx + 13458 ;mov [cs:GOTOLEN],cx + 13459 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13460 00000D96 26890E[399D] mov [es:GOTOLEN],cx ; MSDOS 5.0 (& 6.0) + 13461 + 13462 ; At beginning of file. Skip to first non-delimiter char + 13463 + 13464 00000D9B E87AFF call SKIPDELIM + 13465 00000D9E 721C jb short BADGOTO + 13466 00000DA0 3C3A cmp al,':' + 13467 00000DA2 7426 jz short CHKLABEL + 13468 LABLKLP: ; Look for the label + 13469 00000DA4 E8D8FC call GETBATBYT + 13470 00000DA7 3C0A cmp al,0Ah + 13471 00000DA9 7509 jne short LABLKTST + 13472 + 13473 ; At beginning of line. Skip to first non-delimiter char + 13474 + 13475 00000DAB E86AFF call SKIPDELIM + 13476 00000DAE 720C jb short BADGOTO + 13477 00000DB0 3C3A cmp al,':' + 13478 00000DB2 7416 je short CHKLABEL + 13479 LABLKTST: + 13480 00000DB4 F706[4902]FFFF test word [Batch],0FFFFh ; -1 + 13481 00000DBA 75E8 jnz short LABLKLP + 13482 BADGOTO: + 13483 00000DBC E87100 call BATCLOSE + 13484 + 13485 ; MSDOS 6.0 + 13486 ;SR; + 13487 ; At this point we are terminating without freeing up any nested batch + 13488 ;segments i.e if the error occurred within a called batch file. This routine + 13489 ;will traverse the linked list of batch segments and free all of them. + 13490 ; + 13491 00000DBF E8BD00 call free_batch ; free up nested batch segments + 13492 + 13493 ; MSDOS 3.3 (& MSDOS 6.0) + 13494 00000DC2 0E push cs + 13495 00000DC3 1F pop ds + 13496 00000DC4 BA[A790] mov dx,BADLAB_PTR + 13497 00000DC7 E95C1F jmp cerror + 13498 + 13499 ; Found the :. Skip to first non-delimiter char + 13500 + 13501 CHKLABEL: + 13502 00000DCA E84BFF call SKIPDELIM + 13503 00000DCD 72ED jb short BADGOTO + 13504 00000DCF BF5D00 mov di,FCB+1 ; 5Dh + 13505 ;mov cx,[cs:GOTOLEN] + 13506 ; 14/02/2023 + 13507 00000DD2 268B0E[399D] mov cx,[es:GOTOLEN] ; MSDOS 5.0 (& 6.0) COMMAND.COM + 13508 00000DD7 EB05 jmp short GOTBYTE + 13509 + 13510 NEXTCHRLP: + 13511 00000DD9 51 push cx + 13512 00000DDA E8A2FC call GETBATBYT + 13513 00000DDD 59 pop cx + 13514 GOTBYTE: + 13515 ; 18/03/2023 + 13516 ; 14/02/2023 + 13517 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0CD9h + 13518 00000DDE E88019 call testkanj + 13519 00000DE1 7413 jz short NOTKANJ1 + 13520 00000DE3 263A05 cmp al,[es:di] + 13521 00000DE6 75CC jne short LABLKTST + 13522 00000DE8 47 inc di + 13523 00000DE9 49 dec cx + 13524 00000DEA E3C8 jcxz LABLKTST + 13525 00000DEC 51 push cx + 13526 00000DED E88FFC call GETBATBYT + 13527 00000DF0 59 pop cx + 13528 00000DF1 263A05 cmp al,[es:di] + 13529 00000DF4 EB0C jmp short KNEXTLABCHR + 13530 NOTKANJ1: + 13531 ; 14/02/2023 + 13532 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0CF1h + 13533 00000DF6 0C20 or al,20h + 13534 00000DF8 263A05 cmp al,[es:di] + 13535 ;jne short TRYUPPER + 13536 ;jmp short NEXTLABCHR + 13537 ; 25/04/2023 + 13538 00000DFB 7407 je short NEXTLABCHR + 13539 TRYUPPER: + 13540 00000DFD 2C20 sub al,20h + 13541 00000DFF 263A05 cmp al,[es:di] + 13542 KNEXTLABCHR: + 13543 00000E02 75B0 jnz short LABLKTST + 13544 NEXTLABCHR: + 13545 00000E04 47 inc di + 13546 00000E05 E2D2 loop NEXTCHRLP + 13547 00000E07 E875FC call GETBATBYT + 13548 ; 14/02/2023 + 13549 00000E0A 26833E[399D]08 cmp word [es:GOTOLEN],8 ; MSDOS 5.0 (& 6.0) COMMAND.COM + 13550 ;cmp word [cs:GOTOLEN],8 ; Is the label at least 8 chars long? + 13551 00000E10 7D04 jge short GOTOCONT ; Yes, then the next char doesn't matter + 13552 00000E12 3C20 cmp al,' ' + 13553 00000E14 779E ja short LABLKTST + 13554 GOTOCONT: + 13555 00000E16 3C0D cmp al,0Dh + 13556 00000E18 7407 je short SKIPLFEED + 13557 TONEXTBATLIN: + 13558 00000E1A E862FC call GETBATBYT + 13559 00000E1D 3C0D cmp al,0Dh + 13560 00000E1F 75F9 jne short TONEXTBATLIN + 13561 SKIPLFEED: + 13562 00000E21 E85BFC call GETBATBYT + 13563 + 13564 ; MSDOS 6.0 + 13565 ;SR; + 13566 ; The BatchEOF flag is set in GetBatByt to indicate that we are faking a + 13567 ;CR-LF for the last line. On a goto, this flag has to be cleared, because + 13568 ;BatchEOF == 1 now, after returning a CR-LF. The next call to GetBatByt + 13569 ;to get the EOF has not been made yet because we encountered the Goto. On + 13570 ;all other cases, EOF will be hit while trying to read the next line and + 13571 ;we are fine. I know, I know, what a massive hack from hell!! God help us!! + 13572 ; + 13573 00000E24 06 push es + 13574 00000E25 8E06[4902] mov es,[Batch] + 13575 00000E29 26C606020000 mov byte [es:BATCHSEGMENT.BatchEOF],0 + 13576 ;invalidate fake CR-LF flag + 13577 00000E2F 07 pop es + 13578 + 13579 ; MSDOS 3.3 (& MSDOS 6.0) + 13580 ;call BATCLOSE + 13581 ;retn + 13582 ; 14/02/2023 + 13583 ;jmp short BATCLOSE + 13584 + 13585 ; =============== S U B R O U T I N E ======================================= + 13586 + 13587 ; 27/07/2024 + 13588 BATCLOSE: + 13589 00000E30 2E8B1E[F49E] mov bx,[cs:BATHAND] + 13590 00000E35 83FB05 cmp bx,5 + 13591 00000E38 7205 jb short CLOSERETURN + 13592 ; 14/02/2023 + 13593 00000E3A B43E mov ah,3Eh + 13594 ;mov ah,CLOSE ; 3Eh + 13595 + 13596 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM + 13597 %if 0 + 13598 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 13599 ; BX = file handle + 13600 %else + 13601 00000E3C E87BF7 call int_21h_indirect + 13602 %endif + 13603 + 13604 CLOSERETURN: + 13605 00000E3F C606[9202]00 mov byte [In_Batch],0 ; reset flag + 13606 00000E44 C3 retn + 13607 + 13608 ; =============== S U B R O U T I N E ======================================= + 13609 + 13610 ; Open the BATCH file, If open fails, AL is drive of batch file (A=1) + 13611 ; Also, fills internal batch buffer. If access denied, then AX = -1 + 13612 + 13613 ; 27/07/2024 + 13614 ; 14/02/2023 + 13615 BATOPEN: + 13616 00000E45 1E push ds + 13617 00000E46 8E1E[4902] mov ds,[Batch] + 13618 ;;mov dx,1Fh ; MSDOS 3.3 COMMAND.COM + 13619 ;mov dx,20h ; MSDOS 5.0 COMMAND.COM + 13620 00000E4A BA2000 mov dx,BATCHSEGMENT.BatFile + 13621 + 13622 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM + 13623 %if 0 + 13624 mov ax,3D00h + 13625 ;mov ax,(OPEN<<8) ; 3D00h ; Open the batch file + 13626 + 13627 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 13628 ; DS:DX -> ASCIZ filename + 13629 ; AL = access mode + 13630 ; 0 - read + 13631 %else + 13632 00000E4D B8203D mov ax,3D20h + 13633 ;mov ax,(OPEN<<8)|20h ; 3D20h ; Open the batch file + 13634 ; 00-100-000b (00-DENYNONE-READONLY) + 13635 00000E50 E867F7 call int_21h_indirect + 13636 %endif + 13637 + 13638 00000E53 721C jc short SETERRDL + 13639 ;mov dx,[8] + 13640 00000E55 8B160800 mov dx,[BATCHSEGMENT.BatSeek] + 13641 ;mov cx,[10] + 13642 00000E59 8B0E0A00 mov cx,[BATCHSEGMENT.BatSeek+2] + 13643 00000E5D 1F pop ds + 13644 ;mov [cs:BATHAND],ax + 13645 00000E5E 26A3[F49E] mov [es:BATHAND],ax ; MSDOS 5.0 (& 6.0) COMMAND.COM + 13646 00000E62 89C3 mov bx,ax + 13647 00000E64 B80042 mov ax,4200h + 13648 ;mov ax,(LSEEK<<8) ; 4200h ; Go to the right spot + 13649 00000E67 CD21 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) + 13650 ; AL = method: offset from beginning of file + 13651 + 13652 ;mov word [cs:BATBUFPOS],-1 ; 0FFFFh + 13653 ; nuke batch buffer position + 13654 00000E69 26C706[C7A5]FFFF mov word [es:BATBUFPOS],-1 ; MSDOS 5.0 (& 6.0) COMMAND.COM + 13655 BATOPEN_RETN: + 13656 00000E70 C3 retn + 13657 + 13658 SETERRDL: + 13659 00000E71 89D3 mov bx,dx + 13660 ; MSDOS 6.0 + 13661 ;invoke get_ext_error_number ;AN022; get the extended error + 13662 ; 14/02/2023 + 13663 00000E73 E8D511 call get_ext_error_number + 13664 00000E76 89C2 mov dx,ax ;AN022; save extended error in DX + 13665 + 13666 ; MSDOS 3.3 + 13667 ;mov dx,INSERTDSKPTR + 13668 ;call GET_EXT_ERR_NUMBER + 13669 + 13670 ; MSDOS 3.3 (& MSDOS 6.0) + 13671 00000E78 8A07 mov al,[bx] ; Get drive spec + 13672 00000E7A 2C40 sub al,'@' ; sub al,40h ; A = 1, B = 2 .. + 13673 00000E7C 1F pop ds + 13674 00000E7D F9 stc ; SUB mucked over carry + 13675 00000E7E C3 retn + 13676 + 13677 ; =============== S U B R O U T I N E ======================================= + 13678 + 13679 ;Free_batch : This routine traverses the linked batch segments freeing all + 13680 ;the batch and FOR segments until all of them are freed. It also restores + 13681 ;the old state of the EchoFlag. + 13682 ; + 13683 ; ENTRY: ds = RESGROUP 13684 ; - 13685 ; REGISTERS AFFECTED: bx, cx - 13686 - 13687 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13688 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0D7Eh + 13685 ; EXIT: All batch & FOR segments freed. + 13686 ; EchoFlag restored to old state before batch process. + 13687 ; + 13688 ; REGISTERS AFFECTED: bx, cx 13689 - 13690 free_batch: ;proc near - 13691 ;assume ds:RESGROUP,es:nothing + 13690 ; 14/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13691 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0D7Eh 13692 - 13693 00000E7F 06 push es - 13694 00000E80 8B1E[B202] mov bx,[Next_Batch] - 13695 00000E84 09DB or bx,bx - 13696 00000E86 7433 jz short fb_ret - 13697 _ClearBatch: - 13698 00000E88 8EC3 mov es,bx ; get batch segment - 13699 ;mov bx,es:BatForPtr ; get old FOR segment - 13700 00000E8A 268B1E0500 mov bx,[es:BATCHSEGMENT.BatForPtr] ; [es:5] - 13701 ;cmp bx,0 ; is a FOR in progress - 13702 ; 27/07/2024 - 13703 00000E8F 21DB and bx,bx - 13704 00000E91 7409 jz short no_bat_for ; no - don't deallocate - 13705 00000E93 06 push es ; - 13706 00000E94 8EC3 mov es,bx ; yes - free it up... - 13707 00000E96 B449 mov ah,49h - 13708 ;mov ah,DEALLOC ; - 13709 - 13710 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM - 13711 %if 0 - 13712 int 21h ; - 13713 %else - 13714 00000E98 E81FF7 call int_21h_indirect - 13715 %endif - 13716 00000E9B 07 pop es ; restore to batch segment - 13717 no_bat_for: - 13718 ;mov cl,[es:1] - 13719 00000E9C 268A0E0100 mov cl,[es:BATCHSEGMENT.BatEchoFlag] - 13720 ; get old echo flag - 13721 ;mov bx,[es:3] - 13722 00000EA1 268B1E0300 mov bx,[es:BATCHSEGMENT.BatLast] - 13723 ; get old batch segment - 13724 00000EA6 B449 mov ah,49h - 13725 ;mov ah,DEALLOC ; free it up... - 13726 - 13727 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM - 13728 %if 0 - 13729 int 21h ; - 13730 %else - 13731 00000EA8 E80FF7 call int_21h_indirect - 13732 %endif - 13733 ; 14/02/2023 - 13734 ;mov [Batch],bx ; get ready to deallocate next batch - 13735 00000EAB FF0E[AE02] dec word [Nest] ; is there another batch file? - 13736 00000EAF 75D7 jnz short _ClearBatch ; keep going until no batch file - 13737 - 13738 00000EB1 880E[9D02] mov [EchoFlag],cl ;restore echo status - 13739 00000EB5 C706[4902]0000 mov word [Batch],0 ;no batch process in progress - 13740 fb_ret: - 13741 00000EBB 07 pop es - 13742 00000EBC C3 ret - 13743 - 13744 ;free_batch endp - 13745 - 13746 ;============================================================================ - 13747 ; TFOR.ASM, MSDOS 6.0, 1991 - 13748 ;============================================================================ - 13749 ; 10/10/2018 - Retro DOS v3.0 - 13750 - 13751 ; All batch proccessing has DS set to segment of resident portion - 13752 - 13753 ;ASSUME DS:RESGROUP,ES:TRANGROUP - 13754 - 13755 ; MSDOS 3.3 COMMAND.COM, transient portion/segment offset 0BE9h - 13756 - 13757 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13758 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0DBFh + 13693 free_batch: ;proc near + 13694 ;assume ds:RESGROUP,es:nothing + 13695 + 13696 00000E7F 06 push es + 13697 00000E80 8B1E[B202] mov bx,[Next_Batch] + 13698 00000E84 09DB or bx,bx + 13699 00000E86 7433 jz short fb_ret + 13700 _ClearBatch: + 13701 00000E88 8EC3 mov es,bx ; get batch segment + 13702 ;mov bx,es:BatForPtr ; get old FOR segment + 13703 00000E8A 268B1E0500 mov bx,[es:BATCHSEGMENT.BatForPtr] ; [es:5] + 13704 ;cmp bx,0 ; is a FOR in progress + 13705 ; 27/07/2024 + 13706 00000E8F 21DB and bx,bx + 13707 00000E91 7409 jz short no_bat_for ; no - don't deallocate + 13708 00000E93 06 push es ; + 13709 00000E94 8EC3 mov es,bx ; yes - free it up... + 13710 00000E96 B449 mov ah,49h + 13711 ;mov ah,DEALLOC ; + 13712 + 13713 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM + 13714 %if 0 + 13715 int 21h ; + 13716 %else + 13717 00000E98 E81FF7 call int_21h_indirect + 13718 %endif + 13719 00000E9B 07 pop es ; restore to batch segment + 13720 no_bat_for: + 13721 ;mov cl,[es:1] + 13722 00000E9C 268A0E0100 mov cl,[es:BATCHSEGMENT.BatEchoFlag] + 13723 ; get old echo flag + 13724 ;mov bx,[es:3] + 13725 00000EA1 268B1E0300 mov bx,[es:BATCHSEGMENT.BatLast] + 13726 ; get old batch segment + 13727 00000EA6 B449 mov ah,49h + 13728 ;mov ah,DEALLOC ; free it up... + 13729 + 13730 ; 27/07/2024 - PCDOS 7.1 COMMAND.COM + 13731 %if 0 + 13732 int 21h ; + 13733 %else + 13734 00000EA8 E80FF7 call int_21h_indirect + 13735 %endif + 13736 ; 14/02/2023 + 13737 ;mov [Batch],bx ; get ready to deallocate next batch + 13738 00000EAB FF0E[AE02] dec word [Nest] ; is there another batch file? + 13739 00000EAF 75D7 jnz short _ClearBatch ; keep going until no batch file + 13740 + 13741 00000EB1 880E[9D02] mov [EchoFlag],cl ;restore echo status + 13742 00000EB5 C706[4902]0000 mov word [Batch],0 ;no batch process in progress + 13743 fb_ret: + 13744 00000EBB 07 pop es + 13745 00000EBC C3 ret + 13746 + 13747 ;free_batch endp + 13748 + 13749 ;============================================================================ + 13750 ; TFOR.ASM, MSDOS 6.0, 1991 + 13751 ;============================================================================ + 13752 ; 10/10/2018 - Retro DOS v3.0 + 13753 + 13754 ; All batch proccessing has DS set to segment of resident portion + 13755 + 13756 ;ASSUME DS:RESGROUP,ES:TRANGROUP + 13757 + 13758 ; MSDOS 3.3 COMMAND.COM, transient portion/segment offset 0BE9h 13759 - 13760 ; --------------------------------------------------------------------------- - 13761 - 13762 ; 15/02/2023 - 13763 FORTERM: - 13764 ; MSDOS 6.0 - 13765 00000EBD 0E push cs ;AN037; Get local segment into - 13766 00000EBE 1F pop ds ;AN037; DS, ES - 13767 00000EBF 0E push cs ;AN037; - 13768 00000EC0 07 pop es ;AN037; - 13769 - 13770 ; MSDOS 3.3 (& MSDOS 6.0) - 13771 00000EC1 E89502 call FOROFF - 13772 ;mov ds,[cs:RESSEG] - 13773 00000EC4 268E1E[F59B] mov ds,[es:RESSEG] ; 15/02/2023 - MSDOS 5.0 - 13774 00000EC9 813E[A502]00FF cmp word [SingleCom],0FF00h - 13775 00000ECF 750F jne short BAT_CRLF - 13776 00000ED1 833E[AE02]00 cmp word [Nest],0 ;See if we have nested batch files - 13777 00000ED6 7508 jne short BAT_CRLF ;Yes - don't exit just yet - 13778 00000ED8 C706[A502]FFFF mov word [SingleCom],-1 ; 0FFFFh ; Cause a terminate - 13779 00000EDE EB12 jmp short NOFORP2 - 13780 BAT_CRLF: - 13781 00000EE0 F606[9D02]01 test byte [EchoFlag],1 ; Is echo on? - 13782 00000EE5 740B jz short NOFORP2 ; no - exit - 13783 00000EE7 F706[4902]FFFF test word [Batch],-1 ; 0FFFFh - 13784 ; print CRLF if in batch - 13785 00000EED 7403 jz short NOFORP2 - 13786 00000EEF E8871A call CRLF2 - 13787 NOFORP2: - 13788 00000EF2 E90FF2 jmp TCOMMAND - 13789 - 13790 ; --------------------------------------------------------------------------- - 13791 - 13792 ;------ - 13793 ; For-loop processing. For loops are of the form: - 13794 ; for % in () do - 13795 ; where may contain references of the form %, which are - 13796 ; later substituted with the items in . The for-loop structure is - 13797 ; set-up by the procedure '$for'; successive calls to 'forproc' execute - 13798 ; once for each item in . All of the information needed for - 13799 ; loop processing is stored on a piece of memory gotten from 'alloc'. This - 13800 ; structure is actually fairly large, on the order of 700 bytes, and includes - 13801 ; a complete copy of the original command-line structure as parsed by - 13802 ; 'parseline', loop control variables, and a dma buffer for the - 13803 ; 'FindFirst/FindNext' expansion of wildcard filenames in . When loop - 13804 ; processing has completed, this chunk of memory is returned to the system. - 13805 ; - 13806 ; All of the previously defined variables, in 'datares', used for loop - 13807 ; processing may be erased. Only one, (DW) ForPtr, need be allocated. + 13760 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13761 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0DBFh + 13762 + 13763 ; --------------------------------------------------------------------------- + 13764 + 13765 ; 15/02/2023 + 13766 FORTERM: + 13767 ; MSDOS 6.0 + 13768 00000EBD 0E push cs ;AN037; Get local segment into + 13769 00000EBE 1F pop ds ;AN037; DS, ES + 13770 00000EBF 0E push cs ;AN037; + 13771 00000EC0 07 pop es ;AN037; + 13772 + 13773 ; MSDOS 3.3 (& MSDOS 6.0) + 13774 00000EC1 E89502 call FOROFF + 13775 ;mov ds,[cs:RESSEG] + 13776 00000EC4 268E1E[F59B] mov ds,[es:RESSEG] ; 15/02/2023 - MSDOS 5.0 + 13777 00000EC9 813E[A502]00FF cmp word [SingleCom],0FF00h + 13778 00000ECF 750F jne short BAT_CRLF + 13779 00000ED1 833E[AE02]00 cmp word [Nest],0 ;See if we have nested batch files + 13780 00000ED6 7508 jne short BAT_CRLF ;Yes - don't exit just yet + 13781 00000ED8 C706[A502]FFFF mov word [SingleCom],-1 ; 0FFFFh ; Cause a terminate + 13782 00000EDE EB12 jmp short NOFORP2 + 13783 BAT_CRLF: + 13784 00000EE0 F606[9D02]01 test byte [EchoFlag],1 ; Is echo on? + 13785 00000EE5 740B jz short NOFORP2 ; no - exit + 13786 00000EE7 F706[4902]FFFF test word [Batch],-1 ; 0FFFFh + 13787 ; print CRLF if in batch + 13788 00000EED 7403 jz short NOFORP2 + 13789 00000EEF E8871A call CRLF2 + 13790 NOFORP2: + 13791 00000EF2 E90FF2 jmp TCOMMAND + 13792 + 13793 ; --------------------------------------------------------------------------- + 13794 + 13795 ;------ + 13796 ; For-loop processing. For loops are of the form: + 13797 ; for % in () do + 13798 ; where may contain references of the form %, which are + 13799 ; later substituted with the items in . The for-loop structure is + 13800 ; set-up by the procedure '$for'; successive calls to 'forproc' execute + 13801 ; once for each item in . All of the information needed for + 13802 ; loop processing is stored on a piece of memory gotten from 'alloc'. This + 13803 ; structure is actually fairly large, on the order of 700 bytes, and includes + 13804 ; a complete copy of the original command-line structure as parsed by + 13805 ; 'parseline', loop control variables, and a dma buffer for the + 13806 ; 'FindFirst/FindNext' expansion of wildcard filenames in . When loop + 13807 ; processing has completed, this chunk of memory is returned to the system. 13808 ; - 13809 ; The error message, 'for_alloc_mes', should be moved into the file - 13810 ; containing all of the other error messages. + 13809 ; All of the previously defined variables, in 'datares', used for loop + 13810 ; processing may be erased. Only one, (DW) ForPtr, need be allocated. 13811 ; - 13812 ; Referencing the allocated for-loop structure is a little tricky. - 13813 ; At the moment, a byte is defined as part of a new segment, 'for_segment'. - 13814 ; When 'forproc' actually runs, ES and DS are set to point to the base of the - 13815 ; new chunk of memory. References to this byte, 'f', thus assemble correctly - 13816 ; as offsets of ES or DS. 'f' would not be necessary, except that the - 13817 ; assembler translates an instruction such as 'mov AX, [for_minarg]' as an - 13818 ; immediate move of the offset of 'for_minarg' into AX. In other words, in - 13819 ; terms of PDP-11 mnemonics, the assembler ACTUALLY assembles - 13820 ; mov AX, #for_minarg ; AX := 02CA (for example) - 13821 ; instead of - 13822 ; mov AX, for_minarg ; AX := [02CA] (contents of 02CA) - 13823 ; By using 'f', we pretend that we are actually referencing an allocated - 13824 ; structure, and the assembler coughs up the code we want. Notice that it - 13825 ; doesn't matter whether we put brackets around the location or not -- the - 13826 ; assembler is "smart" enough to know that we want an address instead of the - 13827 ; contents of that location. - 13828 ; - 13829 ; Finally, there now exists the potential to easily implement nested loops. - 13830 ; One method would be to have a link field in each for-structure pointing to - 13831 ; its parent. Variable references that couldn't be resolved in the local - 13832 ; frame would cause a search of prior frames. For-structures would still be - 13833 ; allocated and released in exactly the same fashion. The only limit on the - 13834 ; number of nested loops would be memory size (although at 700 bytes a pop, - 13835 ; memory wouldn't last THAT long). Alternately, a small structure could be - 13836 ; maintained in the resident data area. This structure would be an array of - 13837 ; control-variable names and pointers to for-structure blocks. This would - 13838 ; greatly speed up the resolution of non-local variable references. However, - 13839 ; since space in the resident is precious, we would have to compromise on a - 13840 ; "reasonable" level of nesting -- 10, 16, 32 levels, whatever. For-structure - 13841 ; allocation and de-allocation would have to be modified slightly to take this - 13842 ; new structure into account. - 13843 ; - 13844 ; Oops, just one more thing. Forbuf need not be a part of the for-structure. - 13845 ; It could just as well be one structure allocated in 'transpace'. Actually, - 13846 ; it may be easier to allocate it as part of 'for_segment'. - 13847 ;------ - 13848 ; include fordata.asm - 13849 - 13850 ; Data structure definitions included by tfor.asm - 13851 - 13852 struc FOR_INFO - 13853 00000000 .FOR_ARGS: resb ARG_UNIT.SIZE ; argv[] structure - 13854 00000444 ?? .FOR_COM_START: resb 1 ; beginning of - 13855 00000445 ???? .FOR_EXPAND: resw 1 ; * or ? item in ? - 13856 00000447 ???? .FOR_MINARG: resw 1 ; beginning of - 13857 00000449 ???? .FOR_MAXARG: resw 1 ; end of - 13858 0000044B .FORBUF: resw 64 ; temporary buffer - 13859 000004CB .FORDMA: resw 64 ; FindFirst/Next buffer - 13860 0000054B ?? .FOR_VAR: resb 1 ; loop control variable - 13861 .size: - 13862 endstruc - 13863 ; ARG_UNIT.SIZE = 1348 (544h) - 13864 ; ARG_UNIT.SIZE = 1092 ; 27/07/2024 - 13865 _$FOR_EXIT: - 13866 00000EF5 EBC6 jmp short FORTERM ; exceeding maxarg means all done - 13867 - 13868 ; --------------------------------------------------------------------------- - 13869 - 13870 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 13871 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 13872 FORPROC: - 13873 00000EF7 A1[AC02] mov ax,[ForPtr] - 13874 00000EFA 8ED8 mov ds,ax - 13875 00000EFC 8EC0 mov es,ax ; operate in for-info area - 13876 ;;mov dx,5CBh ; MSDOS 5.0 & 6.22 - 13877 ;mov dx,4CBh ; PCDOS 7.1 ; 27/07/2024 - 13878 00000EFE BACB04 mov dx,FOR_INFO.FORDMA ; 1348+1+2+2+2+128 = 1483 = 5CBh - 13879 ; PCDOS 7.1 COMMAND.COM ; 1092+1+2+2+2+128 = 1227 = 4CBh - 13880 00000F01 B8001A mov ax,1A00h - 13881 ;mov ax,Set_DMA*256 ; 1A00h - 13882 00000F04 CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 13883 ; DS:DX -> disk transfer buffer - 13884 FOR_BEGIN: - 13885 ;;cmp word [545h],0 - 13886 ;cmp word [445h] ; 27/07/2024 - 13887 00000F06 833E450400 cmp word [FOR_INFO.FOR_EXPAND],0 - 13888 00000F0B 7404 jz short FOR_BEGIN1 - 13889 ; non-zero for_expand equals FALSE - 13890 ;;inc word [547h] - 13891 ;inc word [447h] ; 27/07/2024 - 13892 00000F0D FF064704 inc word [FOR_INFO.FOR_MINARG] - 13893 FOR_BEGIN1: - 13894 ;mov bx,[447h] ; 27/07/2024 - 13895 00000F11 8B1E4704 mov bx,[FOR_INFO.FOR_MINARG] ; current item in to examine - 13896 ;cmp bx,[449h] ; 27/07/2024 - 13897 00000F15 3B1E4904 cmp bx,[FOR_INFO.FOR_MAXARG] - 13898 00000F19 7FDA jg short _$FOR_EXIT ; exceeding maxarg means all done - 13899 ;mov ax,0 - 13900 00000F1B B80000 mov ax,FOR_INFO.FOR_ARGS ; 0 - 13901 00000F1E E86F26 call argv_calc ; compute argv[x] address - 13902 ;mov cx,[bx+3] - 13903 00000F21 8B4F03 mov cx,[bx+ARGV_ELE.argstartel] - 13904 00000F24 8B17 mov dx,[bx] - 13905 ;mov dx,[bx+ARGV_ELE.argpointer] ; mov dx,[bx+0] - 13906 ;test byte [bx+2],4 ; Is there a path separator in this arg? - 13907 00000F26 F6470204 test byte [bx+ARGV_ELE.argflags],4 ; path_sep - 13908 00000F2A 7512 jnz short FORSUB ; Yes, argstartel should be correct - 13909 00000F2C 8B37 mov si,[bx] - 13910 ;mov si,[bx+ARGV_ELE.argpointer] - 13911 - 13912 ;mov al,[cs:LPAREN] - 13913 ; 15/02/2023 - 13914 ; MSDOS 6.0 (& 5.0) COMMAND.com - 13915 ;mov al,'(' ; mov al,lparen - 13916 ;cmp [si-1], al ; If the current token is the first - 13917 ; 27/07/2024 - 13918 00000F2E 807CFF28 cmp byte [si-1],'(' - 13919 00000F32 750A jne short FORSUB ; one in the list and originally had - 13920 00000F34 41 inc cx ; the opening paren as its first char, - 13921 ; the argstartel ptr needs to be - 13922 ; advanced passed it before the prefix - 13923 ; length is computed. - 13924 ;mov al,':' - 13925 ;cmp [si+1], al ; If the token begins with "(d:", - 13926 ; 27/07/2024 - 13927 00000F35 807C013A cmp byte [si+1],':' - 13928 00000F39 7503 jne short FORSUB ; argstartel has to be moved over the - 13929 00000F3B 83C102 add cx,2 ; rest of the prefix as well. - 13930 FORSUB: - 13931 00000F3E 29D1 sub cx,dx ; compute length of pathname prefix - 13932 ;;cmp word [545h],0 - 13933 ;cmp word [445h],0 ; 27/07/2024 - 13934 00000F40 833E450400 cmp word [FOR_INFO.FOR_EXPAND],0 - 13935 ; are we still expanding a name? - 13936 00000F45 7416 jz short FOR_FIND_NEXT - 13937 ; if so, get next matching filename - 13938 ;test byte [bx+2],2 - 13939 00000F47 F6470202 test byte [bx+ARGV_ELE.argflags],2 ; wildcard - 13940 00000F4B 7505 jnz short FOR_FIND_FIRST - 13941 ; should we expand THIS (new) arg? - 13942 ;mov cx,[bx+5] - 13943 ; else, just copy all of it directly - 13944 00000F4D 8B4F05 mov cx,[bx+ARGV_ELE.arglen] - 13945 00000F50 EB1D jmp short FOR_SMOOSH - 13946 - 13947 ;nop - 13948 ; 15/02/2023 - 13949 FOR_FIND_FIRST: - 13950 00000F52 51 push cx - 13951 00000F53 31C9 xor cx,cx - 13952 00000F55 B8004E mov ax,4E00h - 13953 ;mov ax,Find_First*256 ; 4E00h - 13954 00000F58 CD21 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) - 13955 ; CX = search attributes - 13956 ; DS:DX -> ASCIZ filespec - 13957 ; (drive,path, and wildcards allowed) - 13958 00000F5A 59 pop cx - 13959 00000F5B EB05 jmp short FOR_RESULT - 13960 - 13961 ;nop - 13962 FOR_FIND_NEXT: - 13963 00000F5D B8004F mov ax,4F00h - 13964 ;mov ax,Find_Next*256 ;4F00h - 13965 00000F60 CD21 int 21h ; DOS - 2+ - FIND NEXT ASCIZ (FINDNEXT) - 13966 ; [DTA] = data block from - 13967 ; last AH = 4Eh/4Fh call - 13968 FOR_RESULT: - 13969 00000F62 B8FFFF mov ax,-1 ; 0FFFFh ; assume worst case - 13970 00000F65 7201 jc short FOR_CHECK - 13971 ; 15/02/2023 - 13972 00000F67 40 inc ax ; ax = 0 - 13973 ;mov ax,0 ; Find* returns 0 for SUCCESS - 13974 FOR_CHECK: ; record success of findfirst/next - 13975 ;;mov [545h],ax - 13976 ;mov [445h],ax ; 27/07/2024 - 13977 00000F68 A34504 mov [FOR_INFO.FOR_EXPAND],ax - 13978 00000F6B 09C0 or ax,ax ; anything out there? - 13979 00000F6D 7597 jnz short FOR_BEGIN ; if not, try next arg - 13980 FOR_SMOOSH: - 13981 ;mov si,[bx+ARGV_ELE.argpointer] ; mov si,[bx+0] - 13982 00000F6F 8B37 mov si,[bx] ; copy argv[arg][0,CX] into destbuf - 13983 ;;mov di,54Bh ; MSDOS 5.0 & 6.22 COMMAND.COM - 13984 ;mov di,44Bh ; 27/07/2024 ; PCDOS 7.1 COMMAND.COM - 13985 00000F71 BF4B04 mov di,FOR_INFO.FORBUF ; some days this will be the entire - 13986 00000F74 F3A4 rep movsb ; arg, some days just the path prefix - 13987 - 13988 00000F76 833E450400 cmp word [FOR_INFO.FOR_EXPAND],0 - 13989 ; if we're not expanding, we can - 13990 00000F7B 7509 jnz short FOR_MAKE_COM ; skip the following - 13991 ; 15/02/2023 - 13992 ;;mov si,05E9h ; MSDOS 3.3 & 5.0 & 6.22 COMMAND.COM ; 27/07/2024 - 13993 ; 27/07/2024 - 13994 ;mov si,04E9h ; PCDOS 7.1 COMMAND.COM - 13995 00000F7D BEE904 mov si,FOR_INFO.FORDMA+FIND_BUF.PNAME ; 14/10/2018 - 13996 FOR_MORE: - 13997 ;cmp byte [si],0 ; tack on matching filename - 13998 ;jz short FOR_MAKE_COM - 13999 ;movsb - 14000 ;jnz short FOR_MORE - 14001 ; 25/04/2023 - 14002 00000F80 AC lodsb - 14003 00000F81 AA stosb - 14004 00000F82 08C0 or al,al - 14005 00000F84 75FA jnz short FOR_MORE - 14006 FOR_MAKE_COM: - 14007 ; 25/04/2023 - 14008 ;xor al,al ; tack a null byte onto the end - 14009 ;stosb ; of the substitute string - 14010 00000F86 31C9 xor cx,cx ; character count for command line - 14011 00000F88 F7D1 not cx ; negate it -- take advantage of loopnz - 14012 00000F8A 31DB xor bx,bx ; argpointer - 14013 00000F8C BF[569A] mov di,COMBUF+2 - 14014 ; 15/02/2023 - 14015 ;;mov bl,[544h] ; MSDOS 5.0-6.22 ; 27/07/2024 - 14016 ; 27/07/2024 - 14017 ;mov bl,[444h] ; PCDOS 7.1 COMMAND.COM - 14018 00000F8F 8A1E4404 mov bl,[FOR_INFO.FOR_COM_START] ; argindex - 14019 ;;mov dh,[64Bh] - 14020 ;mov dh,[54Bh] ; 27/07/2024 ; PCDOS 7.1 COMMAND.COM - 14021 00000F93 8A364B05 mov dh,[FOR_INFO.FOR_VAR] - 14022 ; % is replaced by [forbuf] - 14023 00000F97 0E push cs ; time to form the string - 14024 00000F98 07 pop es - 14025 ;assume ES:trangroup - 14026 ;mov ax,FOR_INFO.FOR_ARGS - 14027 00000F99 B80000 mov ax,0 ; translate offset to pointer - 14028 00000F9C E8F125 call argv_calc - 14029 ;mov si,[bx+9] - 14030 00000F9F 8B7709 mov si,[bx+ARGV_ELE.arg_ocomptr] - 14031 ; mov ptr passed beginning space - 14032 00000FA2 46 inc si - 14033 FOR_MAKE_LOOP: - 14034 00000FA3 8A04 mov al,[si] ; the arg, byte by byte - 14035 00000FA5 46 inc si - 14036 00000FA6 3C25 cmp al,'%' ; looking for % - 14037 00000FA8 7514 jne short FOR_STOSB ; no % ... add byte to string - 14038 00000FAA 3834 cmp [si],dh ; got the right ? - 14039 00000FAC 7510 jnz short FOR_STOSB ; got a %, but wrong - 14040 00000FAE 46 inc si ; skip over - 14041 - 14042 00000FAF 56 push si - 14043 ; 15/02/2023 - 14044 ;;mov si,54Bh ; MSDOS 5.0-6.22 ; 27/07/2024 - 14045 ; 27/07/2024 - 14046 ;mov si,44Bh ; PCDOS 7.1 COMMAND.COM - 14047 00000FB0 BE4B04 mov si,FOR_INFO.FORBUF - 14048 ; substitute the for - 14049 ; to make a final to execute - 14050 SLOOP: - 14051 00000FB3 AC lodsb ; grab all those bytes, and - 14052 00000FB4 AA stosb ; add 'em to the string, - 14053 00000FB5 08C0 or al,al ; until we run into a null - 14054 00000FB7 E0FA loopne SLOOP - 14055 00000FB9 4F dec di ; adjust length and pointer - 14056 00000FBA 41 inc cx ; so we can overwrite the null - 14057 00000FBB 5E pop si - 14058 00000FBC EBE5 jmp short FOR_MAKE_LOOP - 14059 ; got back for more bytes - 14060 FOR_STOSB: - 14061 00000FBE AA stosb ; take a byte from the arg - 14062 00000FBF 49 dec cx ; and put it into the to be - 14063 ; executed (and note length, too) - 14064 00000FC0 3C0D cmp al,0Dh - 14065 00000FC2 75DF jne short FOR_MAKE_LOOP ; If not done, loop. - 14066 FOR_MADE_COM: - 14067 00000FC4 F6D1 not cl - 14068 ;mov [cs:COMBUF+1],cl - 14069 ;mov ds,[cs:RESSEG] - 14070 ; 15/02/2023 - Retro DOS v4.0 COMMAND.COM - 14071 ; MSDOS 5.0 COMMAND.COM - 14072 00000FC6 26880E[559A] mov [es:COMBUF+1],cl - 14073 00000FCB 268E1E[F59B] mov ds,[es:RESSEG] - 14074 ;assume DS:resgroup - 14075 00000FD0 F606[9D02]01 test byte [EchoFlag],1 ; shall we echo this , dearie? - 14076 00000FD5 742F jz short NOECHO3 - 14077 ;cmp byte [NullFlag],nullcommand - 14078 00000FD7 803E[B402]01 cmp byte [NullFlag],1 ;G was there a command last time? - 14079 00000FDC 7403 jz short NO_CRLF_PR ;G no - don't print crlf - 14080 - 14081 00000FDE E89819 call CRLF2 ;G Print out prompt - 14082 NO_CRLF_PR: - 14083 00000FE1 C606[B402]00 mov byte [NullFlag],0 ;G reset no command flag - 14084 00000FE6 0E push cs - 14085 00000FE7 1F pop ds - 14086 00000FE8 57 push di - 14087 00000FE9 E80411 call PRINT_PROMPT ;G Prompt the user - 14088 00000FEC 5F pop di - 14089 - 14090 00000FED 26C645FF00 mov byte [es:di-1],0 ; yeah, PRINT it out... - 14091 00000FF2 C706[A09D][569A] mov word [string_ptr_2],COMBUF+2 - 14092 ; 17/04/2023 - 14093 00000FF8 BA[DF91] mov dx,string_buf_ptr - 14094 00000FFB E82A44 call std_printf - 14095 00000FFE 26C645FF0D mov byte [es:di-1],0Dh - 14096 00001003 E9ECF2 jmp DOCOM ; run silent, run deep... - 14097 NOECHO3: - 14098 00001006 C606[B402]00 mov byte [NullFlag],0 - 14099 0000100B 0E push cs - 14100 0000100C 1F pop ds - 14101 ;jmp DOCOM1 - 14102 ; 07/06/2023 - 14103 ; Retro DOS v4.2 COMMAND.COM - 14104 0000100D E9E5F2 jmp DOCOM0 ; MSDOS 6.22 COMMAND.COM - 14105 - 14106 FORNESTERRJ: ; no multi-loop processing... yet! - 14107 00001010 E84601 call FOROFF - 14108 00001013 E92901 jmp FORNESTERR - 14109 - 14110 ; --------------------------------------------------------------------------- - 14111 - 14112 FORERRORJ: - 14113 00001016 E9D9FB jmp FORERROR + 13812 ; The error message, 'for_alloc_mes', should be moved into the file + 13813 ; containing all of the other error messages. + 13814 ; + 13815 ; Referencing the allocated for-loop structure is a little tricky. + 13816 ; At the moment, a byte is defined as part of a new segment, 'for_segment'. + 13817 ; When 'forproc' actually runs, ES and DS are set to point to the base of the + 13818 ; new chunk of memory. References to this byte, 'f', thus assemble correctly + 13819 ; as offsets of ES or DS. 'f' would not be necessary, except that the + 13820 ; assembler translates an instruction such as 'mov AX, [for_minarg]' as an + 13821 ; immediate move of the offset of 'for_minarg' into AX. In other words, in + 13822 ; terms of PDP-11 mnemonics, the assembler ACTUALLY assembles + 13823 ; mov AX, #for_minarg ; AX := 02CA (for example) + 13824 ; instead of + 13825 ; mov AX, for_minarg ; AX := [02CA] (contents of 02CA) + 13826 ; By using 'f', we pretend that we are actually referencing an allocated + 13827 ; structure, and the assembler coughs up the code we want. Notice that it + 13828 ; doesn't matter whether we put brackets around the location or not -- the + 13829 ; assembler is "smart" enough to know that we want an address instead of the + 13830 ; contents of that location. + 13831 ; + 13832 ; Finally, there now exists the potential to easily implement nested loops. + 13833 ; One method would be to have a link field in each for-structure pointing to + 13834 ; its parent. Variable references that couldn't be resolved in the local + 13835 ; frame would cause a search of prior frames. For-structures would still be + 13836 ; allocated and released in exactly the same fashion. The only limit on the + 13837 ; number of nested loops would be memory size (although at 700 bytes a pop, + 13838 ; memory wouldn't last THAT long). Alternately, a small structure could be + 13839 ; maintained in the resident data area. This structure would be an array of + 13840 ; control-variable names and pointers to for-structure blocks. This would + 13841 ; greatly speed up the resolution of non-local variable references. However, + 13842 ; since space in the resident is precious, we would have to compromise on a + 13843 ; "reasonable" level of nesting -- 10, 16, 32 levels, whatever. For-structure + 13844 ; allocation and de-allocation would have to be modified slightly to take this + 13845 ; new structure into account. + 13846 ; + 13847 ; Oops, just one more thing. Forbuf need not be a part of the for-structure. + 13848 ; It could just as well be one structure allocated in 'transpace'. Actually, + 13849 ; it may be easier to allocate it as part of 'for_segment'. + 13850 ;------ + 13851 ; include fordata.asm + 13852 + 13853 ; Data structure definitions included by tfor.asm + 13854 + 13855 struc FOR_INFO + 13856 00000000 .FOR_ARGS: resb ARG_UNIT.SIZE ; argv[] structure + 13857 00000444 ?? .FOR_COM_START: resb 1 ; beginning of + 13858 00000445 ???? .FOR_EXPAND: resw 1 ; * or ? item in ? + 13859 00000447 ???? .FOR_MINARG: resw 1 ; beginning of + 13860 00000449 ???? .FOR_MAXARG: resw 1 ; end of + 13861 0000044B .FORBUF: resw 64 ; temporary buffer + 13862 000004CB .FORDMA: resw 64 ; FindFirst/Next buffer + 13863 0000054B ?? .FOR_VAR: resb 1 ; loop control variable + 13864 .size: + 13865 endstruc + 13866 ; ARG_UNIT.SIZE = 1348 (544h) + 13867 ; ARG_UNIT.SIZE = 1092 ; 27/07/2024 + 13868 _$FOR_EXIT: + 13869 00000EF5 EBC6 jmp short FORTERM ; exceeding maxarg means all done + 13870 + 13871 ; --------------------------------------------------------------------------- + 13872 + 13873 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 13874 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 13875 FORPROC: + 13876 00000EF7 A1[AC02] mov ax,[ForPtr] + 13877 00000EFA 8ED8 mov ds,ax + 13878 00000EFC 8EC0 mov es,ax ; operate in for-info area + 13879 ;;mov dx,5CBh ; MSDOS 5.0 & 6.22 + 13880 ;mov dx,4CBh ; PCDOS 7.1 ; 27/07/2024 + 13881 00000EFE BACB04 mov dx,FOR_INFO.FORDMA ; 1348+1+2+2+2+128 = 1483 = 5CBh + 13882 ; PCDOS 7.1 COMMAND.COM ; 1092+1+2+2+2+128 = 1227 = 4CBh + 13883 00000F01 B8001A mov ax,1A00h + 13884 ;mov ax,Set_DMA*256 ; 1A00h + 13885 00000F04 CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 13886 ; DS:DX -> disk transfer buffer + 13887 FOR_BEGIN: + 13888 ;;cmp word [545h],0 + 13889 ;cmp word [445h] ; 27/07/2024 + 13890 00000F06 833E450400 cmp word [FOR_INFO.FOR_EXPAND],0 + 13891 00000F0B 7404 jz short FOR_BEGIN1 + 13892 ; non-zero for_expand equals FALSE + 13893 ;;inc word [547h] + 13894 ;inc word [447h] ; 27/07/2024 + 13895 00000F0D FF064704 inc word [FOR_INFO.FOR_MINARG] + 13896 FOR_BEGIN1: + 13897 ;mov bx,[447h] ; 27/07/2024 + 13898 00000F11 8B1E4704 mov bx,[FOR_INFO.FOR_MINARG] ; current item in to examine + 13899 ;cmp bx,[449h] ; 27/07/2024 + 13900 00000F15 3B1E4904 cmp bx,[FOR_INFO.FOR_MAXARG] + 13901 00000F19 7FDA jg short _$FOR_EXIT ; exceeding maxarg means all done + 13902 ;mov ax,0 + 13903 00000F1B B80000 mov ax,FOR_INFO.FOR_ARGS ; 0 + 13904 00000F1E E86F26 call argv_calc ; compute argv[x] address + 13905 ;mov cx,[bx+3] + 13906 00000F21 8B4F03 mov cx,[bx+ARGV_ELE.argstartel] + 13907 00000F24 8B17 mov dx,[bx] + 13908 ;mov dx,[bx+ARGV_ELE.argpointer] ; mov dx,[bx+0] + 13909 ;test byte [bx+2],4 ; Is there a path separator in this arg? + 13910 00000F26 F6470204 test byte [bx+ARGV_ELE.argflags],4 ; path_sep + 13911 00000F2A 7512 jnz short FORSUB ; Yes, argstartel should be correct + 13912 00000F2C 8B37 mov si,[bx] + 13913 ;mov si,[bx+ARGV_ELE.argpointer] + 13914 + 13915 ;mov al,[cs:LPAREN] + 13916 ; 15/02/2023 + 13917 ; MSDOS 6.0 (& 5.0) COMMAND.com + 13918 ;mov al,'(' ; mov al,lparen + 13919 ;cmp [si-1], al ; If the current token is the first + 13920 ; 27/07/2024 + 13921 00000F2E 807CFF28 cmp byte [si-1],'(' + 13922 00000F32 750A jne short FORSUB ; one in the list and originally had + 13923 00000F34 41 inc cx ; the opening paren as its first char, + 13924 ; the argstartel ptr needs to be + 13925 ; advanced passed it before the prefix + 13926 ; length is computed. + 13927 ;mov al,':' + 13928 ;cmp [si+1], al ; If the token begins with "(d:", + 13929 ; 27/07/2024 + 13930 00000F35 807C013A cmp byte [si+1],':' + 13931 00000F39 7503 jne short FORSUB ; argstartel has to be moved over the + 13932 00000F3B 83C102 add cx,2 ; rest of the prefix as well. + 13933 FORSUB: + 13934 00000F3E 29D1 sub cx,dx ; compute length of pathname prefix + 13935 ;;cmp word [545h],0 + 13936 ;cmp word [445h],0 ; 27/07/2024 + 13937 00000F40 833E450400 cmp word [FOR_INFO.FOR_EXPAND],0 + 13938 ; are we still expanding a name? + 13939 00000F45 7416 jz short FOR_FIND_NEXT + 13940 ; if so, get next matching filename + 13941 ;test byte [bx+2],2 + 13942 00000F47 F6470202 test byte [bx+ARGV_ELE.argflags],2 ; wildcard + 13943 00000F4B 7505 jnz short FOR_FIND_FIRST + 13944 ; should we expand THIS (new) arg? + 13945 ;mov cx,[bx+5] + 13946 ; else, just copy all of it directly + 13947 00000F4D 8B4F05 mov cx,[bx+ARGV_ELE.arglen] + 13948 00000F50 EB1D jmp short FOR_SMOOSH + 13949 + 13950 ;nop + 13951 ; 15/02/2023 + 13952 FOR_FIND_FIRST: + 13953 00000F52 51 push cx + 13954 00000F53 31C9 xor cx,cx + 13955 00000F55 B8004E mov ax,4E00h + 13956 ;mov ax,Find_First*256 ; 4E00h + 13957 00000F58 CD21 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) + 13958 ; CX = search attributes + 13959 ; DS:DX -> ASCIZ filespec + 13960 ; (drive,path, and wildcards allowed) + 13961 00000F5A 59 pop cx + 13962 00000F5B EB05 jmp short FOR_RESULT + 13963 + 13964 ;nop + 13965 FOR_FIND_NEXT: + 13966 00000F5D B8004F mov ax,4F00h + 13967 ;mov ax,Find_Next*256 ;4F00h + 13968 00000F60 CD21 int 21h ; DOS - 2+ - FIND NEXT ASCIZ (FINDNEXT) + 13969 ; [DTA] = data block from + 13970 ; last AH = 4Eh/4Fh call + 13971 FOR_RESULT: + 13972 00000F62 B8FFFF mov ax,-1 ; 0FFFFh ; assume worst case + 13973 00000F65 7201 jc short FOR_CHECK + 13974 ; 15/02/2023 + 13975 00000F67 40 inc ax ; ax = 0 + 13976 ;mov ax,0 ; Find* returns 0 for SUCCESS + 13977 FOR_CHECK: ; record success of findfirst/next + 13978 ;;mov [545h],ax + 13979 ;mov [445h],ax ; 27/07/2024 + 13980 00000F68 A34504 mov [FOR_INFO.FOR_EXPAND],ax + 13981 00000F6B 09C0 or ax,ax ; anything out there? + 13982 00000F6D 7597 jnz short FOR_BEGIN ; if not, try next arg + 13983 FOR_SMOOSH: + 13984 ;mov si,[bx+ARGV_ELE.argpointer] ; mov si,[bx+0] + 13985 00000F6F 8B37 mov si,[bx] ; copy argv[arg][0,CX] into destbuf + 13986 ;;mov di,54Bh ; MSDOS 5.0 & 6.22 COMMAND.COM + 13987 ;mov di,44Bh ; 27/07/2024 ; PCDOS 7.1 COMMAND.COM + 13988 00000F71 BF4B04 mov di,FOR_INFO.FORBUF ; some days this will be the entire + 13989 00000F74 F3A4 rep movsb ; arg, some days just the path prefix + 13990 + 13991 00000F76 833E450400 cmp word [FOR_INFO.FOR_EXPAND],0 + 13992 ; if we're not expanding, we can + 13993 00000F7B 7509 jnz short FOR_MAKE_COM ; skip the following + 13994 ; 15/02/2023 + 13995 ;;mov si,05E9h ; MSDOS 3.3 & 5.0 & 6.22 COMMAND.COM ; 27/07/2024 + 13996 ; 27/07/2024 + 13997 ;mov si,04E9h ; PCDOS 7.1 COMMAND.COM + 13998 00000F7D BEE904 mov si,FOR_INFO.FORDMA+FIND_BUF.PNAME ; 14/10/2018 + 13999 FOR_MORE: + 14000 ;cmp byte [si],0 ; tack on matching filename + 14001 ;jz short FOR_MAKE_COM + 14002 ;movsb + 14003 ;jnz short FOR_MORE + 14004 ; 25/04/2023 + 14005 00000F80 AC lodsb + 14006 00000F81 AA stosb + 14007 00000F82 08C0 or al,al + 14008 00000F84 75FA jnz short FOR_MORE + 14009 FOR_MAKE_COM: + 14010 ; 25/04/2023 + 14011 ;xor al,al ; tack a null byte onto the end + 14012 ;stosb ; of the substitute string + 14013 00000F86 31C9 xor cx,cx ; character count for command line + 14014 00000F88 F7D1 not cx ; negate it -- take advantage of loopnz + 14015 00000F8A 31DB xor bx,bx ; argpointer + 14016 00000F8C BF[569A] mov di,COMBUF+2 + 14017 ; 15/02/2023 + 14018 ;;mov bl,[544h] ; MSDOS 5.0-6.22 ; 27/07/2024 + 14019 ; 27/07/2024 + 14020 ;mov bl,[444h] ; PCDOS 7.1 COMMAND.COM + 14021 00000F8F 8A1E4404 mov bl,[FOR_INFO.FOR_COM_START] ; argindex + 14022 ;;mov dh,[64Bh] + 14023 ;mov dh,[54Bh] ; 27/07/2024 ; PCDOS 7.1 COMMAND.COM + 14024 00000F93 8A364B05 mov dh,[FOR_INFO.FOR_VAR] + 14025 ; % is replaced by [forbuf] + 14026 00000F97 0E push cs ; time to form the string + 14027 00000F98 07 pop es + 14028 ;assume ES:trangroup + 14029 ;mov ax,FOR_INFO.FOR_ARGS + 14030 00000F99 B80000 mov ax,0 ; translate offset to pointer + 14031 00000F9C E8F125 call argv_calc + 14032 ;mov si,[bx+9] + 14033 00000F9F 8B7709 mov si,[bx+ARGV_ELE.arg_ocomptr] + 14034 ; mov ptr passed beginning space + 14035 00000FA2 46 inc si + 14036 FOR_MAKE_LOOP: + 14037 00000FA3 8A04 mov al,[si] ; the arg, byte by byte + 14038 00000FA5 46 inc si + 14039 00000FA6 3C25 cmp al,'%' ; looking for % + 14040 00000FA8 7514 jne short FOR_STOSB ; no % ... add byte to string + 14041 00000FAA 3834 cmp [si],dh ; got the right ? + 14042 00000FAC 7510 jnz short FOR_STOSB ; got a %, but wrong + 14043 00000FAE 46 inc si ; skip over + 14044 + 14045 00000FAF 56 push si + 14046 ; 15/02/2023 + 14047 ;;mov si,54Bh ; MSDOS 5.0-6.22 ; 27/07/2024 + 14048 ; 27/07/2024 + 14049 ;mov si,44Bh ; PCDOS 7.1 COMMAND.COM + 14050 00000FB0 BE4B04 mov si,FOR_INFO.FORBUF + 14051 ; substitute the for + 14052 ; to make a final to execute + 14053 SLOOP: + 14054 00000FB3 AC lodsb ; grab all those bytes, and + 14055 00000FB4 AA stosb ; add 'em to the string, + 14056 00000FB5 08C0 or al,al ; until we run into a null + 14057 00000FB7 E0FA loopne SLOOP + 14058 00000FB9 4F dec di ; adjust length and pointer + 14059 00000FBA 41 inc cx ; so we can overwrite the null + 14060 00000FBB 5E pop si + 14061 00000FBC EBE5 jmp short FOR_MAKE_LOOP + 14062 ; got back for more bytes + 14063 FOR_STOSB: + 14064 00000FBE AA stosb ; take a byte from the arg + 14065 00000FBF 49 dec cx ; and put it into the to be + 14066 ; executed (and note length, too) + 14067 00000FC0 3C0D cmp al,0Dh + 14068 00000FC2 75DF jne short FOR_MAKE_LOOP ; If not done, loop. + 14069 FOR_MADE_COM: + 14070 00000FC4 F6D1 not cl + 14071 ;mov [cs:COMBUF+1],cl + 14072 ;mov ds,[cs:RESSEG] + 14073 ; 15/02/2023 - Retro DOS v4.0 COMMAND.COM + 14074 ; MSDOS 5.0 COMMAND.COM + 14075 00000FC6 26880E[559A] mov [es:COMBUF+1],cl + 14076 00000FCB 268E1E[F59B] mov ds,[es:RESSEG] + 14077 ;assume DS:resgroup + 14078 00000FD0 F606[9D02]01 test byte [EchoFlag],1 ; shall we echo this , dearie? + 14079 00000FD5 742F jz short NOECHO3 + 14080 ;cmp byte [NullFlag],nullcommand + 14081 00000FD7 803E[B402]01 cmp byte [NullFlag],1 ;G was there a command last time? + 14082 00000FDC 7403 jz short NO_CRLF_PR ;G no - don't print crlf + 14083 + 14084 00000FDE E89819 call CRLF2 ;G Print out prompt + 14085 NO_CRLF_PR: + 14086 00000FE1 C606[B402]00 mov byte [NullFlag],0 ;G reset no command flag + 14087 00000FE6 0E push cs + 14088 00000FE7 1F pop ds + 14089 00000FE8 57 push di + 14090 00000FE9 E80411 call PRINT_PROMPT ;G Prompt the user + 14091 00000FEC 5F pop di + 14092 + 14093 00000FED 26C645FF00 mov byte [es:di-1],0 ; yeah, PRINT it out... + 14094 00000FF2 C706[A09D][569A] mov word [string_ptr_2],COMBUF+2 + 14095 ; 17/04/2023 + 14096 00000FF8 BA[DF91] mov dx,string_buf_ptr + 14097 00000FFB E82A44 call std_printf + 14098 00000FFE 26C645FF0D mov byte [es:di-1],0Dh + 14099 00001003 E9ECF2 jmp DOCOM ; run silent, run deep... + 14100 NOECHO3: + 14101 00001006 C606[B402]00 mov byte [NullFlag],0 + 14102 0000100B 0E push cs + 14103 0000100C 1F pop ds + 14104 ;jmp DOCOM1 + 14105 ; 07/06/2023 + 14106 ; Retro DOS v4.2 COMMAND.COM + 14107 0000100D E9E5F2 jmp DOCOM0 ; MSDOS 6.22 COMMAND.COM + 14108 + 14109 FORNESTERRJ: ; no multi-loop processing... yet! + 14110 00001010 E84601 call FOROFF + 14111 00001013 E92901 jmp FORNESTERR + 14112 + 14113 ; --------------------------------------------------------------------------- 14114 - 14115 ; --------------------------------------------------------------------------- - 14116 - 14117 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0F24h - 14118 - 14119 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 14120 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0FFEh + 14115 FORERRORJ: + 14116 00001016 E9D9FB jmp FORERROR + 14117 + 14118 ; --------------------------------------------------------------------------- + 14119 + 14120 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0F24h 14121 - 14122 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 14123 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1040h - 14124 _$FOR: - 14125 00001019 8E06[F59B] mov es,[RESSEG] - 14126 0000101D 26803E[AB02]00 cmp byte [es:ForFlag],0 ; is another one already running? - 14127 00001023 75EB jnz short FORNESTERRJ ; if flag is set.... boom! - 14128 - 14129 ; Turn off any pipes in progress. - 14130 - 14131 00001025 26803E[1403]00 cmp byte [es:PipeFiles],0 ; Only turn off if present. - 14132 0000102B 7403 jz short NO_PIPE - 14133 0000102D E8F020 call PIPEDEL - 14134 NO_PIPE: - 14135 00001030 31D2 xor dx,dx ; counter (0 <= DX < argvcnt) - 14136 00001032 E8F400 call NEXTARG ; move to next argv[n] - 14137 00001035 72DF jc short FORERRORJ ; no more args -- bad forloop - 14138 00001037 3C25 cmp al,'%' ; next arg MUST start with '%'... - 14139 00001039 75DB jne short FORERRORJ - 14140 0000103B 89C5 mov bp,ax ; save forloop variable - 14141 0000103D AC lodsb - 14142 0000103E 08C0 or al,al ; and MUST end immediately... - 14143 00001040 75D4 jnz short FORERRORJ - 14144 00001042 E8E400 call NEXTARG ; let's make sure the next arg is 'in' - 14145 00001045 72CF jb short FORERRORJ - 14146 ;and ax,0DFDFh - 14147 00001047 25DFDF and ax,~2020h ; uppercase the letters - 14148 ; 15/02/2023 - 14149 ;cmp ax,4E49h ; MSDOS 5.0 - 14150 ;cmp ax,[IN_WORD] ; MSDOS 3.3 - 14151 ;cmp ax,in_word ; MSDOS 5.0 - 14152 0000104A 3D494E cmp ax,'IN' - 14153 0000104D 75C7 jnz short FORERRORJ - 14154 0000104F AC lodsb - 14155 - 14156 ; 15/02/2023 - 14157 ; MSDOS 3.3 - 14158 ;or al,al ; it, too, must end right away - 14159 ;jz short CHECKLPAREN - 14160 ;cmp al,[LPAREN] - 14161 ;jnz short FORERRORJ - 14162 ;;add word [bx+ARGV_ELE.argpointer],2 ; add word [bx+0],2 - 14163 ;add word [bx],2 - 14164 ;;add word [bx+9],2 - 14165 ;add word [bx+ARGV_ELE.arg_ocomptr],2 - 14166 ;;sub word [bx+5],2 - 14167 ;sub word [bx+ARGV_ELE.arglen],2 - 14168 ;mov ax,[si-1] - 14169 ;jmp short LPCHECK - 14170 - 14171 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 14172 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0F5Bh + 14122 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 14123 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0FFEh + 14124 + 14125 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 14126 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1040h + 14127 _$FOR: + 14128 00001019 8E06[F59B] mov es,[RESSEG] + 14129 0000101D 26803E[AB02]00 cmp byte [es:ForFlag],0 ; is another one already running? + 14130 00001023 75EB jnz short FORNESTERRJ ; if flag is set.... boom! + 14131 + 14132 ; Turn off any pipes in progress. + 14133 + 14134 00001025 26803E[1403]00 cmp byte [es:PipeFiles],0 ; Only turn off if present. + 14135 0000102B 7403 jz short NO_PIPE + 14136 0000102D E8F020 call PIPEDEL + 14137 NO_PIPE: + 14138 00001030 31D2 xor dx,dx ; counter (0 <= DX < argvcnt) + 14139 00001032 E8F400 call NEXTARG ; move to next argv[n] + 14140 00001035 72DF jc short FORERRORJ ; no more args -- bad forloop + 14141 00001037 3C25 cmp al,'%' ; next arg MUST start with '%'... + 14142 00001039 75DB jne short FORERRORJ + 14143 0000103B 89C5 mov bp,ax ; save forloop variable + 14144 0000103D AC lodsb + 14145 0000103E 08C0 or al,al ; and MUST end immediately... + 14146 00001040 75D4 jnz short FORERRORJ + 14147 00001042 E8E400 call NEXTARG ; let's make sure the next arg is 'in' + 14148 00001045 72CF jb short FORERRORJ + 14149 ;and ax,0DFDFh + 14150 00001047 25DFDF and ax,~2020h ; uppercase the letters + 14151 ; 15/02/2023 + 14152 ;cmp ax,4E49h ; MSDOS 5.0 + 14153 ;cmp ax,[IN_WORD] ; MSDOS 3.3 + 14154 ;cmp ax,in_word ; MSDOS 5.0 + 14155 0000104A 3D494E cmp ax,'IN' + 14156 0000104D 75C7 jnz short FORERRORJ + 14157 0000104F AC lodsb + 14158 + 14159 ; 15/02/2023 + 14160 ; MSDOS 3.3 + 14161 ;or al,al ; it, too, must end right away + 14162 ;jz short CHECKLPAREN + 14163 ;cmp al,[LPAREN] + 14164 ;jnz short FORERRORJ + 14165 ;;add word [bx+ARGV_ELE.argpointer],2 ; add word [bx+0],2 + 14166 ;add word [bx],2 + 14167 ;;add word [bx+9],2 + 14168 ;add word [bx+ARGV_ELE.arg_ocomptr],2 + 14169 ;;sub word [bx+5],2 + 14170 ;sub word [bx+ARGV_ELE.arglen],2 + 14171 ;mov ax,[si-1] + 14172 ;jmp short LPCHECK 14173 - 14174 ; MSDOS 6.0 - 14175 ; Compaq bug fix -- exit from this loop on error + 14174 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 14175 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0F5Bh 14176 - 14177 00001050 08C0 or al,al - 14178 00001052 75C2 jne short FORERRORJ ; jump on error + 14177 ; MSDOS 6.0 + 14178 ; Compaq bug fix -- exit from this loop on error 14179 - 14180 ; je short CHECKLPAREN - 14181 ; - 14182 ; Not null. Perhaps there are no spaces between this and the (: - 14183 ; FOR %i in(foo bar... - 14184 ; Check for the Lparen here - 14185 ; - 14186 ;; cmp al,lparen - 14187 ;; jnz short FORERRORJ + 14180 00001050 08C0 or al,al + 14181 00001052 75C2 jne short FORERRORJ ; jump on error + 14182 + 14183 ; je short CHECKLPAREN + 14184 ; + 14185 ; Not null. Perhaps there are no spaces between this and the (: + 14186 ; FOR %i in(foo bar... + 14187 ; Check for the Lparen here 14188 ; - 14189 ; The token was in(... We strip off the "in" part to simulate a separator - 14190 ; being there in the first place. + 14189 ;; cmp al,lparen + 14190 ;; jnz short FORERRORJ 14191 ; - 14192 ;; add word [bx+ARGV_ELE.argpointer],2 ; advance source pointer - 14193 ;; add word [bx+ARGV_ELE.arg_ocomptr],2 - 14194 ;; ; advance original string - 14195 ;; sub word [bx+ARGV_ELE.arglen],2 ; decrement the appropriate length - 14196 ; - 14197 ; SI now points past the in(. Simulate a nextarg call that results in the - 14198 ; current value. + 14192 ; The token was in(... We strip off the "in" part to simulate a separator + 14193 ; being there in the first place. + 14194 ; + 14195 ;; add word [bx+ARGV_ELE.argpointer],2 ; advance source pointer + 14196 ;; add word [bx+ARGV_ELE.arg_ocomptr],2 + 14197 ;; ; advance original string + 14198 ;; sub word [bx+ARGV_ELE.arglen],2 ; decrement the appropriate length 14199 ; - 14200 ;; mov ax,[si-1] ; get lparen and next char - 14201 ;; jmp short LPCHECK + 14200 ; SI now points past the in(. Simulate a nextarg call that results in the + 14201 ; current value. 14202 ; - 14203 ; end of Compaq bug fix - 14204 - 14205 ; --------------------------------------------------------------------------- - 14206 - 14207 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 14208 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0F5Fh + 14203 ;; mov ax,[si-1] ; get lparen and next char + 14204 ;; jmp short LPCHECK + 14205 ; + 14206 ; end of Compaq bug fix + 14207 + 14208 ; --------------------------------------------------------------------------- 14209 - 14210 ; MSDOS 3.3 (& MSDOS 6.0) - 14211 CHECKLPAREN: - 14212 00001054 E8D200 call NEXTARG ; lparen delimits beginning of - 14213 00001057 72BD jc short FORERRORJ - 14214 LPCHECK: - 14215 ; 15/02/2023 - 14216 ; MSDOS 5.0 (% MSDOS 6.0) - 14217 ;;cmp al,[LPAREN] - 14218 ;cmp al,lparen - 14219 00001059 3C28 cmp al,'(' - 14220 0000105B 75B9 jne short FORERRORJ - 14221 0000105D 80FC00 cmp ah,0 - 14222 00001060 7410 je short FOR_PAREN_TOKEN - 14223 ;;cmp ah,[RPAREN] ; special case: null list - 14224 ;cmp ah,rparen - 14225 00001062 80FC29 cmp ah,')' - 14226 00001065 7503 jne short FOR_LIST_NOT_EMPTY - 14227 00001067 E953FE jmp FORTERM - 14228 FOR_LIST_NOT_EMPTY: - 14229 ;inc word [bx+ARGV_ELE.argpointer] ; inc word [bx+0] - 14230 0000106A FF07 inc word [bx] ; Advance ptr past "(" - 14231 ;dec word [bx+5] ; Adjust the rest of this argv entry - 14232 0000106C FF4F05 dec word [bx+ARGV_ELE.arglen] ; to agree. - 14233 0000106F 46 inc si ; Inc si so check for ")" works - 14234 00001070 EB0D jmp short FOR_LIST - 14235 - 14236 ;nop - 14237 FOR_PAREN_TOKEN: - 14238 00001072 E8B400 call NEXTARG ; what have we in our ? - 14239 00001075 729F jc short FORERRORJ - 14240 ; 15/02/2023 - 14241 ;;;cmp ax,[RPAREN+1] - 14242 ;;cmp ax,[NULLRPAREN] ; special case: null list - 14243 ;cmp ax,nullrparen - 14244 00001077 83F829 cmp ax,29h ; db 29h,0 ; db ')',0 - 14245 0000107A 7503 jne short FOR_LIST - 14246 0000107C E93EFE jmp FORTERM - 14247 - 14248 ;FORERORJJ: - 14249 ;jmp FORERROR + 14210 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 14211 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:0F5Fh + 14212 + 14213 ; MSDOS 3.3 (& MSDOS 6.0) + 14214 CHECKLPAREN: + 14215 00001054 E8D200 call NEXTARG ; lparen delimits beginning of + 14216 00001057 72BD jc short FORERRORJ + 14217 LPCHECK: + 14218 ; 15/02/2023 + 14219 ; MSDOS 5.0 (% MSDOS 6.0) + 14220 ;;cmp al,[LPAREN] + 14221 ;cmp al,lparen + 14222 00001059 3C28 cmp al,'(' + 14223 0000105B 75B9 jne short FORERRORJ + 14224 0000105D 80FC00 cmp ah,0 + 14225 00001060 7410 je short FOR_PAREN_TOKEN + 14226 ;;cmp ah,[RPAREN] ; special case: null list + 14227 ;cmp ah,rparen + 14228 00001062 80FC29 cmp ah,')' + 14229 00001065 7503 jne short FOR_LIST_NOT_EMPTY + 14230 00001067 E953FE jmp FORTERM + 14231 FOR_LIST_NOT_EMPTY: + 14232 ;inc word [bx+ARGV_ELE.argpointer] ; inc word [bx+0] + 14233 0000106A FF07 inc word [bx] ; Advance ptr past "(" + 14234 ;dec word [bx+5] ; Adjust the rest of this argv entry + 14235 0000106C FF4F05 dec word [bx+ARGV_ELE.arglen] ; to agree. + 14236 0000106F 46 inc si ; Inc si so check for ")" works + 14237 00001070 EB0D jmp short FOR_LIST + 14238 + 14239 ;nop + 14240 FOR_PAREN_TOKEN: + 14241 00001072 E8B400 call NEXTARG ; what have we in our ? + 14242 00001075 729F jc short FORERRORJ + 14243 ; 15/02/2023 + 14244 ;;;cmp ax,[RPAREN+1] + 14245 ;;cmp ax,[NULLRPAREN] ; special case: null list + 14246 ;cmp ax,nullrparen + 14247 00001077 83F829 cmp ax,29h ; db 29h,0 ; db ')',0 + 14248 0000107A 7503 jne short FOR_LIST + 14249 0000107C E93EFE jmp FORTERM 14250 - 14251 FOR_LIST: ; skip over rest of - 14252 0000107F 89D1 mov cx,dx ; first arg of + 14251 ;FORERORJJ: + 14252 ;jmp FORERROR 14253 - 14254 SKIP_LIST: - 14255 ;add si,[bx+5] - 14256 00001081 037705 add si,[bx+ARGV_ELE.arglen] - 14257 00001084 83EE03 sub si,3 ; si = ptr to last char of token - 14258 ; 15/02/2023 - 14259 ;;mov al,[RPAREN] - 14260 ;mov al,rparen - 14261 00001087 B029 mov al,')' - 14262 00001089 3804 cmp [si],al ; Is this the last element in - 14263 0000108B 7408 je short FOR_END_LIST ; Yes, exit loop. - 14264 0000108D E89900 call NEXTARG ; No, get next arg - 14265 ;jc short FORERORJJ ; If no more and no rparen, error. - 14266 ;jmp short SKIP_LIST - 14267 ; 15/02/2023 - 14268 00001090 73EF jnc short SKIP_LIST - 14269 + 14254 FOR_LIST: ; skip over rest of + 14255 0000107F 89D1 mov cx,dx ; first arg of + 14256 + 14257 SKIP_LIST: + 14258 ;add si,[bx+5] + 14259 00001081 037705 add si,[bx+ARGV_ELE.arglen] + 14260 00001084 83EE03 sub si,3 ; si = ptr to last char of token + 14261 ; 15/02/2023 + 14262 ;;mov al,[RPAREN] + 14263 ;mov al,rparen + 14264 00001087 B029 mov al,')' + 14265 00001089 3804 cmp [si],al ; Is this the last element in + 14266 0000108B 7408 je short FOR_END_LIST ; Yes, exit loop. + 14267 0000108D E89900 call NEXTARG ; No, get next arg + 14268 ;jc short FORERORJJ ; If no more and no rparen, error. + 14269 ;jmp short SKIP_LIST 14270 ; 15/02/2023 - 14271 FORERORJJ: - 14272 00001092 E95DFB jmp FORERROR - 14273 - 14274 FOR_END_LIST: - 14275 00001095 89D7 mov di,dx ; record position of last arg in - 14276 00001097 C60400 mov byte [si],0 ; Zap the rparen - 14277 ; 15/02/2023 - 14278 ;;;cmp ax,[RPAREN+1] - 14279 ;;cmp ax,[NULLRPAREN] ; Was this token only a rparen - 14280 ;cmp ax,nullparen - 14281 0000109A 83F829 cmp ax,29h ; db 29h,0 ; db ')',0 - 14282 0000109D 7401 je short FOR_DO ; Yes, continue - 14283 0000109F 47 inc di ; No, inc position of last arg - 14284 FOR_DO: - 14285 000010A0 E88600 call NEXTARG ; now we had BETTER find a 'do'... - 14286 000010A3 72ED jc short FORERORJJ - 14287 ;and ax,0DFDFh - 14288 000010A5 25DFDF and ax,~2020h ; uppercase the letters - 14289 ; 15/02/2023 - 14290 ;;cmp ax,[DO_WORD] - 14291 ;cmp ax,do_word ; 4F44h - 14292 000010A8 3D444F cmp ax,'DO' ; 4F44h - 14293 000010AB 75E5 jne short FORERORJJ - 14294 000010AD AC lodsb - 14295 000010AE 08C0 or al,al ; and it had BETTER be ONLY a 'do'... - 14296 000010B0 75E0 jnz short FORERORJJ - 14297 - 14298 000010B2 E87400 call NEXTARG ; on to the beginning of - 14299 000010B5 72DB jc short FORERORJJ ; null not legal - 14300 - 14301 000010B7 50 push ax - 14302 000010B8 53 push bx - 14303 000010B9 51 push cx - 14304 000010BA 52 push dx ; preserve registers against disaster - 14305 000010BB 57 push di - 14306 000010BC 56 push si - 14307 000010BD 55 push bp - 14308 000010BE E852F7 call FREE_TPA ; need to make free memory, first - 14309 000010C1 E89500 call FOROFF - 14310 ;mov bx,264 ; 27/07/2024 ; MSDOS 5.0-6.22 & PCDOS 7.1 - 14311 000010C4 BB0801 mov bx,FOR_INFO.size-ARG_UNIT.SIZE - 14312 000010C7 E8E927 call SAVE_ARGS ; extra bytes needed for for-info - 14313 000010CA 9C pushf - 14314 000010CB 26A3[AC02] mov [es:ForPtr],ax - 14315 000010CF E852F7 call ALLOC_TPA ; ALLOC_TPA clobbers registers... - 14316 000010D2 9D popf - 14317 000010D3 5D pop bp - 14318 000010D4 5E pop si - 14319 000010D5 5F pop di - 14320 000010D6 5A pop dx - 14321 000010D7 59 pop cx - 14322 000010D8 5B pop bx - 14323 000010D9 58 pop ax - 14324 000010DA 723C jc short FOR_ALLOC_ERR - 14325 - 14326 000010DC 06 push es ; save resgroup seg... - 14327 000010DD 26FF36[AC02] push word [es:ForPtr] - 14328 000010E2 07 pop es - 14329 ;assume es:for_segment - 14330 000010E3 49 dec cx ; forproc wants min pointing before - 14331 000010E4 4F dec di ; first arg, max right at last one - 14332 ; 15/02/2023 - 14333 ;;mov [547h],cx - 14334 ; 27/07/2024 - 14335 ;mov [447h],cx ; PCDOS 7.1 COMMAND.COM - 14336 000010E5 26890E4704 mov [es:FOR_INFO.FOR_MINARG],cx - 14337 ;;mov [549h],di - 14338 ;mov [449h],di ; PCDOS 7.1 COMMAND.COM ; 27/07/2024 - 14339 000010EA 26893E4904 mov [es:FOR_INFO.FOR_MAXARG],di - 14340 ;;mov [544h],dl - 14341 ;mov [444h],dl ; PCDOS 7.1 COMMAND.COM ; 27/07/2024 - 14342 000010EF 2688164404 mov [es:FOR_INFO.FOR_COM_START],dl - 14343 ;;mov word [545h],0FFFFh ; -1 - 14344 ;mov [445h],0FFFFh ; PCDOS 7.1 COMMAND.COM ; 27/07/2024 - 14345 000010F4 26C7064504FFFF mov word [es:FOR_INFO.FOR_EXPAND],-1 - 14346 ; non-zero means FALSE - 14347 000010FB 89E8 mov ax,bp - 14348 ;;mov [64Bh],ah - 14349 ;mov [54Bh],ah ; 27/07/2024 ; PCDOS 7.1 COMMAND.COM - 14350 000010FD 2688264B05 mov [es:FOR_INFO.FOR_VAR],ah - 14351 00001102 07 pop es - 14352 ;assume es:resgroup - 14353 00001103 26FE06[AB02] inc byte [es:ForFlag] - 14354 00001108 26833E[A502]FF cmp word [es:SingleCom],-1 - 14355 0000110E 7507 jne short FOR_RET - 14356 00001110 26C706[A502]00FF mov word [es:SingleCom],0FF00h - 14357 FOR_RET: - 14358 00001117 C3 retn - 14359 - 14360 FOR_ALLOC_ERR: - 14361 ; 15/02/2023 - 14362 ; MSDOS 3.3 - 14363 ;mov dx,INSFMEMMESPTR - 14364 ;jmp CERROR - 14365 - 14366 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 14367 ; MSDOS 6.0 - 14368 ;mov byte [msg_disp_class],1 - 14369 00001118 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 14370 ;AN000; set up extended error msg class - 14371 ;mov dx,offset TranGroup:Extend_Buf_ptr - 14372 0000111D BA[D78F] mov dx,extend_buf_ptr - 14373 ;AC000; get extended message pointer - 14374 ;mov word [extend_buf_ptr],8 - 14375 00001120 C706[D78F]0800 mov word [extend_buf_ptr],ERROR_NOT_ENOUGH_MEMORY - 14376 ;AN000; get message number in control block - 14377 00001126 E9FD1B jmp cerror - 14378 - 14379 - 14380 ; =============== S U B R O U T I N E ======================================= + 14271 00001090 73EF jnc short SKIP_LIST + 14272 + 14273 ; 15/02/2023 + 14274 FORERORJJ: + 14275 00001092 E95DFB jmp FORERROR + 14276 + 14277 FOR_END_LIST: + 14278 00001095 89D7 mov di,dx ; record position of last arg in + 14279 00001097 C60400 mov byte [si],0 ; Zap the rparen + 14280 ; 15/02/2023 + 14281 ;;;cmp ax,[RPAREN+1] + 14282 ;;cmp ax,[NULLRPAREN] ; Was this token only a rparen + 14283 ;cmp ax,nullparen + 14284 0000109A 83F829 cmp ax,29h ; db 29h,0 ; db ')',0 + 14285 0000109D 7401 je short FOR_DO ; Yes, continue + 14286 0000109F 47 inc di ; No, inc position of last arg + 14287 FOR_DO: + 14288 000010A0 E88600 call NEXTARG ; now we had BETTER find a 'do'... + 14289 000010A3 72ED jc short FORERORJJ + 14290 ;and ax,0DFDFh + 14291 000010A5 25DFDF and ax,~2020h ; uppercase the letters + 14292 ; 15/02/2023 + 14293 ;;cmp ax,[DO_WORD] + 14294 ;cmp ax,do_word ; 4F44h + 14295 000010A8 3D444F cmp ax,'DO' ; 4F44h + 14296 000010AB 75E5 jne short FORERORJJ + 14297 000010AD AC lodsb + 14298 000010AE 08C0 or al,al ; and it had BETTER be ONLY a 'do'... + 14299 000010B0 75E0 jnz short FORERORJJ + 14300 + 14301 000010B2 E87400 call NEXTARG ; on to the beginning of + 14302 000010B5 72DB jc short FORERORJJ ; null not legal + 14303 + 14304 000010B7 50 push ax + 14305 000010B8 53 push bx + 14306 000010B9 51 push cx + 14307 000010BA 52 push dx ; preserve registers against disaster + 14308 000010BB 57 push di + 14309 000010BC 56 push si + 14310 000010BD 55 push bp + 14311 000010BE E852F7 call FREE_TPA ; need to make free memory, first + 14312 000010C1 E89500 call FOROFF + 14313 ;mov bx,264 ; 27/07/2024 ; MSDOS 5.0-6.22 & PCDOS 7.1 + 14314 000010C4 BB0801 mov bx,FOR_INFO.size-ARG_UNIT.SIZE + 14315 000010C7 E8E927 call SAVE_ARGS ; extra bytes needed for for-info + 14316 000010CA 9C pushf + 14317 000010CB 26A3[AC02] mov [es:ForPtr],ax + 14318 000010CF E852F7 call ALLOC_TPA ; ALLOC_TPA clobbers registers... + 14319 000010D2 9D popf + 14320 000010D3 5D pop bp + 14321 000010D4 5E pop si + 14322 000010D5 5F pop di + 14323 000010D6 5A pop dx + 14324 000010D7 59 pop cx + 14325 000010D8 5B pop bx + 14326 000010D9 58 pop ax + 14327 000010DA 723C jc short FOR_ALLOC_ERR + 14328 + 14329 000010DC 06 push es ; save resgroup seg... + 14330 000010DD 26FF36[AC02] push word [es:ForPtr] + 14331 000010E2 07 pop es + 14332 ;assume es:for_segment + 14333 000010E3 49 dec cx ; forproc wants min pointing before + 14334 000010E4 4F dec di ; first arg, max right at last one + 14335 ; 15/02/2023 + 14336 ;;mov [547h],cx + 14337 ; 27/07/2024 + 14338 ;mov [447h],cx ; PCDOS 7.1 COMMAND.COM + 14339 000010E5 26890E4704 mov [es:FOR_INFO.FOR_MINARG],cx + 14340 ;;mov [549h],di + 14341 ;mov [449h],di ; PCDOS 7.1 COMMAND.COM ; 27/07/2024 + 14342 000010EA 26893E4904 mov [es:FOR_INFO.FOR_MAXARG],di + 14343 ;;mov [544h],dl + 14344 ;mov [444h],dl ; PCDOS 7.1 COMMAND.COM ; 27/07/2024 + 14345 000010EF 2688164404 mov [es:FOR_INFO.FOR_COM_START],dl + 14346 ;;mov word [545h],0FFFFh ; -1 + 14347 ;mov [445h],0FFFFh ; PCDOS 7.1 COMMAND.COM ; 27/07/2024 + 14348 000010F4 26C7064504FFFF mov word [es:FOR_INFO.FOR_EXPAND],-1 + 14349 ; non-zero means FALSE + 14350 000010FB 89E8 mov ax,bp + 14351 ;;mov [64Bh],ah + 14352 ;mov [54Bh],ah ; 27/07/2024 ; PCDOS 7.1 COMMAND.COM + 14353 000010FD 2688264B05 mov [es:FOR_INFO.FOR_VAR],ah + 14354 00001102 07 pop es + 14355 ;assume es:resgroup + 14356 00001103 26FE06[AB02] inc byte [es:ForFlag] + 14357 00001108 26833E[A502]FF cmp word [es:SingleCom],-1 + 14358 0000110E 7507 jne short FOR_RET + 14359 00001110 26C706[A502]00FF mov word [es:SingleCom],0FF00h + 14360 FOR_RET: + 14361 00001117 C3 retn + 14362 + 14363 FOR_ALLOC_ERR: + 14364 ; 15/02/2023 + 14365 ; MSDOS 3.3 + 14366 ;mov dx,INSFMEMMESPTR + 14367 ;jmp CERROR + 14368 + 14369 ; 15/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 14370 ; MSDOS 6.0 + 14371 ;mov byte [msg_disp_class],1 + 14372 00001118 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 14373 ;AN000; set up extended error msg class + 14374 ;mov dx,offset TranGroup:Extend_Buf_ptr + 14375 0000111D BA[D78F] mov dx,extend_buf_ptr + 14376 ;AC000; get extended message pointer + 14377 ;mov word [extend_buf_ptr],8 + 14378 00001120 C706[D78F]0800 mov word [extend_buf_ptr],ERROR_NOT_ENOUGH_MEMORY + 14379 ;AN000; get message number in control block + 14380 00001126 E9FD1B jmp cerror 14381 - 14382 NEXTARG: - 14383 00001129 42 inc dx ; next argv[n] - 14384 ;cmp dx,[ARG_ARGVCNT] - 14385 0000112A 3B16[10A2] cmp dx,[ARG+ARG_UNIT.argvcnt] - 14386 ; make sure we don't run off end - 14387 0000112E 7D0D jge short NEXTARG_ERR ; of argv[]... - 14388 00001130 89D3 mov bx,dx - 14389 ;mov ax,ARG_ARGV - 14390 ;mov ax,ARG+ARG_UNIT.argv - 14391 00001132 B8[509F] mov ax,ARG - 14392 00001135 E85824 call argv_calc ; convert array index to pointer - 14393 00001138 8B37 mov si,[bx] ; load pointer to argstring - 14394 ;mov si,[bx+ARGV_ELE.argpointer] ; mov si,[bx+0] - 14395 0000113A AD lodsw ; and load first two chars - 14396 0000113B F8 clc - 14397 0000113C C3 retn - 14398 NEXTARG_ERR: - 14399 0000113D F9 stc - 14400 0000113E C3 retn - 14401 - 14402 ; --------------------------------------------------------------------------- - 14403 - 14404 FORNESTERR: - 14405 0000113F 1E push ds - 14406 00001140 8E1E[F59B] mov ds,[RESSEG] - 14407 ;ASSUME DS:RESGROUP - 14408 00001144 BA[5A91] mov dx,FORNESTMES_PTR - 14409 00001147 813E[A502]00FF cmp word [SingleCom],0FF00h - 14410 0000114D 7506 jne short NOFORP3 - 14411 0000114F C706[A502]FFFF mov word [SingleCom],-1 ; 0FFFFh ; Cause termination - 14412 NOFORP3: - 14413 00001155 1F pop ds - 14414 00001156 E9CD1B jmp cerror - 14415 - 14416 ; =============== S U B R O U T I N E ======================================= - 14417 - 14418 ; General routine called to free the for segment. We also clear the forflag - 14419 ; too. Change no registers. + 14382 + 14383 ; =============== S U B R O U T I N E ======================================= + 14384 + 14385 NEXTARG: + 14386 00001129 42 inc dx ; next argv[n] + 14387 ;cmp dx,[ARG_ARGVCNT] + 14388 0000112A 3B16[10A2] cmp dx,[ARG+ARG_UNIT.argvcnt] + 14389 ; make sure we don't run off end + 14390 0000112E 7D0D jge short NEXTARG_ERR ; of argv[]... + 14391 00001130 89D3 mov bx,dx + 14392 ;mov ax,ARG_ARGV + 14393 ;mov ax,ARG+ARG_UNIT.argv + 14394 00001132 B8[509F] mov ax,ARG + 14395 00001135 E85824 call argv_calc ; convert array index to pointer + 14396 00001138 8B37 mov si,[bx] ; load pointer to argstring + 14397 ;mov si,[bx+ARGV_ELE.argpointer] ; mov si,[bx+0] + 14398 0000113A AD lodsw ; and load first two chars + 14399 0000113B F8 clc + 14400 0000113C C3 retn + 14401 NEXTARG_ERR: + 14402 0000113D F9 stc + 14403 0000113E C3 retn + 14404 + 14405 ; --------------------------------------------------------------------------- + 14406 + 14407 FORNESTERR: + 14408 0000113F 1E push ds + 14409 00001140 8E1E[F59B] mov ds,[RESSEG] + 14410 ;ASSUME DS:RESGROUP + 14411 00001144 BA[5A91] mov dx,FORNESTMES_PTR + 14412 00001147 813E[A502]00FF cmp word [SingleCom],0FF00h + 14413 0000114D 7506 jne short NOFORP3 + 14414 0000114F C706[A502]FFFF mov word [SingleCom],-1 ; 0FFFFh ; Cause termination + 14415 NOFORP3: + 14416 00001155 1F pop ds + 14417 00001156 E9CD1B jmp cerror + 14418 + 14419 ; =============== S U B R O U T I N E ======================================= 14420 - 14421 FOROFF: - 14422 00001159 50 push ax - 14423 0000115A 06 push es - 14424 0000115B 2E8E06[F59B] mov es,[cs:RESSEG] - 14425 00001160 26A1[AC02] mov ax,[es:ForPtr] - 14426 00001164 09C0 or ax,ax - 14427 00001166 7408 jz short FREEDONE - 14428 00001168 06 push es - 14429 00001169 8EC0 mov es,ax - 14430 ; 15/02/2023 - 14431 0000116B B449 mov ah,49h - 14432 ;mov ah,DEALLOC ; 49h - 14433 0000116D CD21 int 21h ; DOS - 2+ - FREE MEMORY - 14434 ; ES = segment address of area to be freed - 14435 0000116F 07 pop es - 14436 FREEDONE: - 14437 00001170 26C706[AC02]0000 mov word [es:ForPtr],0 - 14438 00001177 26C606[AB02]00 mov byte [es:ForFlag],0 - 14439 0000117D 07 pop es - 14440 0000117E 58 pop ax - 14441 0000117F C3 retn - 14442 - 14443 ;============================================================================ - 14444 ; TCMD1A.ASM, MSDOS 6.0, 1991 - 14445 ;============================================================================ - 14446 ; 09/10/2018 - Retro DOS v3.0 - 14447 - 14448 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 0ECBh - 14449 - 14450 ; --------------------------------------------------------------------------- - 14451 - 14452 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 14453 - 14454 %if 0 - 14455 - 14456 ; The DIR command displays the contents of a directory. - 14457 ; - 14458 ; **************************************************************** - 14459 ; * - 14460 ; * ROUTINE: CATALOG - display file(s) in directory - 14461 ; * - 14462 ; * FUNCTION: PARSE command line for drive, file, or path name. - 14463 ; * DIR allows two switches, /P (pause) and /W (wide). - 14464 ; * If an error occurs issue and error message and - 14465 ; * transfer control to CERROR. - 14466 ; * - 14467 ; * INPUT: command line at offset 81H - 14468 ; * - 14469 ; * OUTPUT: none - 14470 ; * - 14471 ; **************************************************************** - 14472 - 14473 CATALOG: - 14474 ; MSDOS 3.3 + 14421 ; General routine called to free the for segment. We also clear the forflag + 14422 ; too. Change no registers. + 14423 + 14424 FOROFF: + 14425 00001159 50 push ax + 14426 0000115A 06 push es + 14427 0000115B 2E8E06[F59B] mov es,[cs:RESSEG] + 14428 00001160 26A1[AC02] mov ax,[es:ForPtr] + 14429 00001164 09C0 or ax,ax + 14430 00001166 7408 jz short FREEDONE + 14431 00001168 06 push es + 14432 00001169 8EC0 mov es,ax + 14433 ; 15/02/2023 + 14434 0000116B B449 mov ah,49h + 14435 ;mov ah,DEALLOC ; 49h + 14436 0000116D CD21 int 21h ; DOS - 2+ - FREE MEMORY + 14437 ; ES = segment address of area to be freed + 14438 0000116F 07 pop es + 14439 FREEDONE: + 14440 00001170 26C706[AC02]0000 mov word [es:ForPtr],0 + 14441 00001177 26C606[AB02]00 mov byte [es:ForFlag],0 + 14442 0000117D 07 pop es + 14443 0000117E 58 pop ax + 14444 0000117F C3 retn + 14445 + 14446 ;============================================================================ + 14447 ; TCMD1A.ASM, MSDOS 6.0, 1991 + 14448 ;============================================================================ + 14449 ; 09/10/2018 - Retro DOS v3.0 + 14450 + 14451 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 0ECBh + 14452 + 14453 ; --------------------------------------------------------------------------- + 14454 + 14455 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 14456 + 14457 %if 0 + 14458 + 14459 ; The DIR command displays the contents of a directory. + 14460 ; + 14461 ; **************************************************************** + 14462 ; * + 14463 ; * ROUTINE: CATALOG - display file(s) in directory + 14464 ; * + 14465 ; * FUNCTION: PARSE command line for drive, file, or path name. + 14466 ; * DIR allows two switches, /P (pause) and /W (wide). + 14467 ; * If an error occurs issue and error message and + 14468 ; * transfer control to CERROR. + 14469 ; * + 14470 ; * INPUT: command line at offset 81H + 14471 ; * + 14472 ; * OUTPUT: none + 14473 ; * + 14474 ; **************************************************************** 14475 - 14476 ;mov ax,ARG_ARGV - 14477 ;mov ax,ARG+ARG_UNIT.argv - 14478 mov ax,ARG - 14479 mov dx,0FFFFh - 14480 xor cx,cx - 14481 xor si,si - 14482 DIR1: - 14483 ;cmp cx,[ARG_ARGVCNT] - 14484 cmp cx,[ARG+ARG_UNIT.argvcnt] - 14485 jnb short DIR6 ; No more arguments - 14486 mov bx,cx - 14487 call ARGV_CALC - 14488 ;or si,[bx+7] - 14489 or si,[bx+ARGV_ELE.argsw_word] - 14490 test si,7FFCh ; test si,~8003 - 14491 jnz short DIR2 ; /A,/B,/V switches (are invalid) - 14492 ;test byte [bx+2],1 - 14493 test byte [bx+ARGV_ELE.argflags],sw_flag ; 1 - 14494 jz short DIR3 - 14495 jmp short DIR5 - 14496 DIR2: - 14497 mov dx,BADPARMPTR - 14498 jmp CERROR - 14499 DIR3: - 14500 or cx,cx - 14501 jnz short DIR4 - 14502 ;cmp word [bx+5],3 - 14503 cmp word [bx+ARGV_ELE.arglen],3 - 14504 jz short DIR5 - 14505 ;add word [bx+ARGV_ELE.argpointer],3 ; add word [bx+0],3 - 14506 add word [bx],3 - 14507 ;add word [bx+9],3 - 14508 add word [bx+ARGV_ELE.arg_ocomptr],3 - 14509 ;add word [bx+3],3 - 14510 add word [bx+ARGV_ELE.argstartel],3 - 14511 ;sub word [bx+5],3 - 14512 sub word [bx+ARGV_ELE.arglen],3 - 14513 DIR4: - 14514 cmp dx,0FFFFh - 14515 jnz short DIR2 - 14516 mov dx,bx - 14517 DIR5: - 14518 inc cx - 14519 jmp short DIR1 - 14520 DIR6: - 14521 mov [COMSW],si - 14522 push dx - 14523 xor al,al - 14524 cmp dx,0FFFFh - 14525 jz short DIR7 - 14526 mov bx,dx - 14527 ;mov di,[bx+ARGV_ELE.argpointer] ;mov di,[bx+0] - 14528 mov di,[bx] - 14529 cmp byte [di+1],':' - 14530 jnz short DIR7 - 14531 mov al,[di] - 14532 or al,20h ; Lowercase drive name - 14533 sub al,'a'-1 ; 60h ; Convert to drive number (0,1..) - 14534 DIR7: - 14535 ;mov [5CH],al - 14536 mov [FCB],al - 14537 call OKVOLARG - 14538 mov al,'?' ; *.* is default file spec. - 14539 ;mov di,5Dh - 14540 mov di,FCB+1 - 14541 mov cx,11 - 14542 rep stosb - 14543 - 14544 ; Begin by processing any switches that may have been specified. - 14545 ; BITS will contain any information about switches that was - 14546 ; found when the command line was parsed. - 14547 - 14548 mov ax,[COMSW] ; Get switches from command - 14549 mov [_BITS],ax ; initialize switches - 14550 mov word [COMSW],0 ; initialize flags - 14551 mov byte [LINPERPAG],23 ; Set default for lines per page - 14552 ;test al,1 - 14553 test al,SWITCHW ; /W ? - 14554 ;mov al,1 - 14555 mov al,NORMPERLIN - 14556 jz short DIR8 - 14557 ;mov al,5 - 14558 mov al,WIDEPERLIN - 14559 DIR8: - 14560 mov [LINLEN],al ; Set number of entries per line - 14561 mov [LINCNT],al - 14562 mov word [FILECNT],0 ; Keep track of how many files found - 14563 mov dx,DIRBUF - 14564 mov ah,Set_DMA ; 1Ah - 14565 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 14566 ; DS:DX -> disk transfer buffer - 14567 ;mov dl,[5Ch] - 14568 mov dl,[FCB] - 14569 call SAVUDIR - 14570 pop bx - 14571 cmp bx,0FFFFh - 14572 jz short DIR9 - 14573 ;mov dx,[bx+ARGV_ELE.argpointer] ; mov dx,[bx+0] - 14574 mov dx,[bx] - 14575 - 14576 ; The user may have specified a device. Search for the path and see if the - 14577 ; attributes indicate a device. + 14476 CATALOG: + 14477 ; MSDOS 3.3 + 14478 + 14479 ;mov ax,ARG_ARGV + 14480 ;mov ax,ARG+ARG_UNIT.argv + 14481 mov ax,ARG + 14482 mov dx,0FFFFh + 14483 xor cx,cx + 14484 xor si,si + 14485 DIR1: + 14486 ;cmp cx,[ARG_ARGVCNT] + 14487 cmp cx,[ARG+ARG_UNIT.argvcnt] + 14488 jnb short DIR6 ; No more arguments + 14489 mov bx,cx + 14490 call ARGV_CALC + 14491 ;or si,[bx+7] + 14492 or si,[bx+ARGV_ELE.argsw_word] + 14493 test si,7FFCh ; test si,~8003 + 14494 jnz short DIR2 ; /A,/B,/V switches (are invalid) + 14495 ;test byte [bx+2],1 + 14496 test byte [bx+ARGV_ELE.argflags],sw_flag ; 1 + 14497 jz short DIR3 + 14498 jmp short DIR5 + 14499 DIR2: + 14500 mov dx,BADPARMPTR + 14501 jmp CERROR + 14502 DIR3: + 14503 or cx,cx + 14504 jnz short DIR4 + 14505 ;cmp word [bx+5],3 + 14506 cmp word [bx+ARGV_ELE.arglen],3 + 14507 jz short DIR5 + 14508 ;add word [bx+ARGV_ELE.argpointer],3 ; add word [bx+0],3 + 14509 add word [bx],3 + 14510 ;add word [bx+9],3 + 14511 add word [bx+ARGV_ELE.arg_ocomptr],3 + 14512 ;add word [bx+3],3 + 14513 add word [bx+ARGV_ELE.argstartel],3 + 14514 ;sub word [bx+5],3 + 14515 sub word [bx+ARGV_ELE.arglen],3 + 14516 DIR4: + 14517 cmp dx,0FFFFh + 14518 jnz short DIR2 + 14519 mov dx,bx + 14520 DIR5: + 14521 inc cx + 14522 jmp short DIR1 + 14523 DIR6: + 14524 mov [COMSW],si + 14525 push dx + 14526 xor al,al + 14527 cmp dx,0FFFFh + 14528 jz short DIR7 + 14529 mov bx,dx + 14530 ;mov di,[bx+ARGV_ELE.argpointer] ;mov di,[bx+0] + 14531 mov di,[bx] + 14532 cmp byte [di+1],':' + 14533 jnz short DIR7 + 14534 mov al,[di] + 14535 or al,20h ; Lowercase drive name + 14536 sub al,'a'-1 ; 60h ; Convert to drive number (0,1..) + 14537 DIR7: + 14538 ;mov [5CH],al + 14539 mov [FCB],al + 14540 call OKVOLARG + 14541 mov al,'?' ; *.* is default file spec. + 14542 ;mov di,5Dh + 14543 mov di,FCB+1 + 14544 mov cx,11 + 14545 rep stosb + 14546 + 14547 ; Begin by processing any switches that may have been specified. + 14548 ; BITS will contain any information about switches that was + 14549 ; found when the command line was parsed. + 14550 + 14551 mov ax,[COMSW] ; Get switches from command + 14552 mov [_BITS],ax ; initialize switches + 14553 mov word [COMSW],0 ; initialize flags + 14554 mov byte [LINPERPAG],23 ; Set default for lines per page + 14555 ;test al,1 + 14556 test al,SWITCHW ; /W ? + 14557 ;mov al,1 + 14558 mov al,NORMPERLIN + 14559 jz short DIR8 + 14560 ;mov al,5 + 14561 mov al,WIDEPERLIN + 14562 DIR8: + 14563 mov [LINLEN],al ; Set number of entries per line + 14564 mov [LINCNT],al + 14565 mov word [FILECNT],0 ; Keep track of how many files found + 14566 mov dx,DIRBUF + 14567 mov ah,Set_DMA ; 1Ah + 14568 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 14569 ; DS:DX -> disk transfer buffer + 14570 ;mov dl,[5Ch] + 14571 mov dl,[FCB] + 14572 call SAVUDIR + 14573 pop bx + 14574 cmp bx,0FFFFh + 14575 jz short DIR9 + 14576 ;mov dx,[bx+ARGV_ELE.argpointer] ; mov dx,[bx+0] + 14577 mov dx,[bx] 14578 - 14579 mov ah,Find_First ; 4Eh - 14580 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) - 14581 ; CX = search attributes - 14582 ; DS:DX -> ASCIZ filespec - 14583 ; (drive,path, and wildcards allowed) - 14584 jc short DIR10 - 14585 ; Check device atrribute.. - 14586 ;test byte [DIRBUF_ATTRIB2],40h - 14587 ;test byte [DIRBUF_ATTRIB2],ATTR_DEVICE - 14588 ; 14/10/2018 - 14589 ;test byte [DIRBUF+21],40h - 14590 test byte [DIRBUF+FIND_BUF.ATTR],ATTR_DEVICE - 14591 jz short DIR10 ; no, go do normal operation - 14592 mov word [COMSW],-2 ; 0FFFEh ; Signal device - 14593 DIR9: - 14594 jmp short DOHEADER - 14595 DIR10: - 14596 ;mov dx,[bx+ARGV_ELE.argpointer] - 14597 mov dx,[bx] - 14598 mov ah,CHDir ; 3Bh - 14599 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 14600 ; DS:DX -> ASCIZ directory name (may include drive) - 14601 jnc short DOHEADER - 14602 ;mov si,[bx+3] - 14603 mov si,[bx+ARGV_ELE.argstartel] - 14604 cmp dx,si - 14605 jz short DIR_NO_DRIVE - 14606 xor cl,cl - 14607 xchg cl,[si] - 14608 mov ah,CHDir ; 3Bh - 14609 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 14610 ; DS:DX -> ASCIZ directory name (may include drive) - 14611 xchg cl,[si] - 14612 jnc short DIR_NO_DRIVE - 14613 mov al,[si-1] - 14614 call PATHCHRCMP - 14615 jnz short DIR11 - 14616 mov al,[si-2] + 14579 ; The user may have specified a device. Search for the path and see if the + 14580 ; attributes indicate a device. + 14581 + 14582 mov ah,Find_First ; 4Eh + 14583 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) + 14584 ; CX = search attributes + 14585 ; DS:DX -> ASCIZ filespec + 14586 ; (drive,path, and wildcards allowed) + 14587 jc short DIR10 + 14588 ; Check device atrribute.. + 14589 ;test byte [DIRBUF_ATTRIB2],40h + 14590 ;test byte [DIRBUF_ATTRIB2],ATTR_DEVICE + 14591 ; 14/10/2018 + 14592 ;test byte [DIRBUF+21],40h + 14593 test byte [DIRBUF+FIND_BUF.ATTR],ATTR_DEVICE + 14594 jz short DIR10 ; no, go do normal operation + 14595 mov word [COMSW],-2 ; 0FFFEh ; Signal device + 14596 DIR9: + 14597 jmp short DOHEADER + 14598 DIR10: + 14599 ;mov dx,[bx+ARGV_ELE.argpointer] + 14600 mov dx,[bx] + 14601 mov ah,CHDir ; 3Bh + 14602 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 14603 ; DS:DX -> ASCIZ directory name (may include drive) + 14604 jnc short DOHEADER + 14605 ;mov si,[bx+3] + 14606 mov si,[bx+ARGV_ELE.argstartel] + 14607 cmp dx,si + 14608 jz short DIR_NO_DRIVE + 14609 xor cl,cl + 14610 xchg cl,[si] + 14611 mov ah,CHDir ; 3Bh + 14612 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 14613 ; DS:DX -> ASCIZ directory name (may include drive) + 14614 xchg cl,[si] + 14615 jnc short DIR_NO_DRIVE + 14616 mov al,[si-1] 14617 call PATHCHRCMP - 14618 jz short DIR12 - 14619 xchg cl,[si-1] - 14620 mov ah,CHDir ; 3Bh - 14621 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 14622 ; DS:DX -> ASCIZ directory name (may include drive) - 14623 xchg cl,[si-1] - 14624 jnc short DIR_NO_DRIVE - 14625 DIR11: - 14626 mov ch,':' - 14627 cmp ch,[si-1] - 14628 jnz short DIR12 - 14629 ;mov cx,[bx+ARGV_ELE.argpointer] ; mov cx,[bx+0] - 14630 mov cx,[bx] - 14631 xchg cx,si - 14632 sub cx,si - 14633 cmp cx,2 - 14634 jz short DIR_NO_DRIVE - 14635 DIR12: - 14636 mov dx,BADCDPTR - 14637 ;test byte [bx+2],4 - 14638 test byte [bx+ARGV_ELE.argflags],4 ; path_sep - 14639 jnz short DIRERROR - 14640 DIRNF: - 14641 mov dx,FNOTFOUNDPTR - 14642 DIRERROR: - 14643 jmp CERROR - 14644 DIR_NO_DRIVE: - 14645 cmp word [si],'..' - 14646 jnz short DOREALPARSE - 14647 cmp byte [si+2],0 - 14648 jnz short DOREALPARSE - 14649 inc word [COMSW] - 14650 jmp short DOHEADER - 14651 DOREALPARSE: - 14652 mov di,FCB ; 5Ch - 14653 ;mov ax,290Eh - 14654 mov ax,(Parse_File_Descriptor<<8)|0Eh - 14655 int 21h ; DOS - PARSE FILENAME - 14656 ; DS:SI -> string to parse - 14657 ; ES:DI -> buffer to fill with unopened FCB - 14658 ; AL = bit mask to control parsing - 14659 cmp byte [si],0 - 14660 jz short DOHEADER - 14661 dec word [COMSW] - 14662 DOHEADER: - 14663 - 14664 ; Display the header - 14665 - 14666 push bx - 14667 call BUILD_DIR_STRING - 14668 mov dx,DIRBUF - 14669 mov [VOL_DIR],dx - 14670 mov dx,DIRHEADPTR - 14671 call PRINTF_CRLF - 14672 pop bx - 14673 cmp bx,0FFFFh - 14674 jz short DOSEARCH - 14675 - 14676 ; If there were chars left after parse or device, then invalid file name - 14677 - 14678 cmp word [COMSW],0 - 14679 jz short DOSEARCH ; nothing left; good parse - 14680 jl short DIRNFFIX ; not .. => error file not found - 14681 call RESTUDIR - 14682 mov dx,BADCDPTR - 14683 jmp CERROR ; was .. => error directory not found - 14684 DIRNFFIX: - 14685 call RESTUDIR - 14686 jmp short DIRNF - 14687 - 14688 ; We are assured that everything is correct. Let's go and search. Use - 14689 ; attributes that will include finding directories. Perform the first search - 14690 ; and reset our directory afterward. - 14691 - 14692 DOSEARCH: - 14693 ;mov byte [55h],0FFh - 14694 mov byte [FCB-7],0FFh - 14695 ;mov byte [5Bh],10h - 14696 mov byte [FCB-1],10h - 14697 - 14698 ; Caution! Since we are using an extended FCB, we will *also* be returning - 14699 ; the directory information as an extended FCB. We must bias all fetches into - 14700 ; DIRBUF by 8 (Extended FCB part + drive) - 14701 - 14702 mov ah,Dir_Search_First ; 11h - 14703 mov dx,FCB-7 ; 55h - 14704 int 21h ; DOS - SEARCH FIRST USING FCB - 14705 ; DS:DX -> FCB - 14706 - 14707 ; Restore the user's directory. We preserve, though, the return from the - 14708 ; previous system call for later checking. + 14618 jnz short DIR11 + 14619 mov al,[si-2] + 14620 call PATHCHRCMP + 14621 jz short DIR12 + 14622 xchg cl,[si-1] + 14623 mov ah,CHDir ; 3Bh + 14624 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 14625 ; DS:DX -> ASCIZ directory name (may include drive) + 14626 xchg cl,[si-1] + 14627 jnc short DIR_NO_DRIVE + 14628 DIR11: + 14629 mov ch,':' + 14630 cmp ch,[si-1] + 14631 jnz short DIR12 + 14632 ;mov cx,[bx+ARGV_ELE.argpointer] ; mov cx,[bx+0] + 14633 mov cx,[bx] + 14634 xchg cx,si + 14635 sub cx,si + 14636 cmp cx,2 + 14637 jz short DIR_NO_DRIVE + 14638 DIR12: + 14639 mov dx,BADCDPTR + 14640 ;test byte [bx+2],4 + 14641 test byte [bx+ARGV_ELE.argflags],4 ; path_sep + 14642 jnz short DIRERROR + 14643 DIRNF: + 14644 mov dx,FNOTFOUNDPTR + 14645 DIRERROR: + 14646 jmp CERROR + 14647 DIR_NO_DRIVE: + 14648 cmp word [si],'..' + 14649 jnz short DOREALPARSE + 14650 cmp byte [si+2],0 + 14651 jnz short DOREALPARSE + 14652 inc word [COMSW] + 14653 jmp short DOHEADER + 14654 DOREALPARSE: + 14655 mov di,FCB ; 5Ch + 14656 ;mov ax,290Eh + 14657 mov ax,(Parse_File_Descriptor<<8)|0Eh + 14658 int 21h ; DOS - PARSE FILENAME + 14659 ; DS:SI -> string to parse + 14660 ; ES:DI -> buffer to fill with unopened FCB + 14661 ; AL = bit mask to control parsing + 14662 cmp byte [si],0 + 14663 jz short DOHEADER + 14664 dec word [COMSW] + 14665 DOHEADER: + 14666 + 14667 ; Display the header + 14668 + 14669 push bx + 14670 call BUILD_DIR_STRING + 14671 mov dx,DIRBUF + 14672 mov [VOL_DIR],dx + 14673 mov dx,DIRHEADPTR + 14674 call PRINTF_CRLF + 14675 pop bx + 14676 cmp bx,0FFFFh + 14677 jz short DOSEARCH + 14678 + 14679 ; If there were chars left after parse or device, then invalid file name + 14680 + 14681 cmp word [COMSW],0 + 14682 jz short DOSEARCH ; nothing left; good parse + 14683 jl short DIRNFFIX ; not .. => error file not found + 14684 call RESTUDIR + 14685 mov dx,BADCDPTR + 14686 jmp CERROR ; was .. => error directory not found + 14687 DIRNFFIX: + 14688 call RESTUDIR + 14689 jmp short DIRNF + 14690 + 14691 ; We are assured that everything is correct. Let's go and search. Use + 14692 ; attributes that will include finding directories. Perform the first search + 14693 ; and reset our directory afterward. + 14694 + 14695 DOSEARCH: + 14696 ;mov byte [55h],0FFh + 14697 mov byte [FCB-7],0FFh + 14698 ;mov byte [5Bh],10h + 14699 mov byte [FCB-1],10h + 14700 + 14701 ; Caution! Since we are using an extended FCB, we will *also* be returning + 14702 ; the directory information as an extended FCB. We must bias all fetches into + 14703 ; DIRBUF by 8 (Extended FCB part + drive) + 14704 + 14705 mov ah,Dir_Search_First ; 11h + 14706 mov dx,FCB-7 ; 55h + 14707 int 21h ; DOS - SEARCH FIRST USING FCB + 14708 ; DS:DX -> FCB 14709 - 14710 FOUND_FIRST_FILE: - 14711 push ax ; save return state - 14712 call RESTUDIR ; restore user's dir - 14713 pop ax ; get return state back - 14714 - 14715 ; Main scanning loop. Entry has AL = Search first/next error code. Test for - 14716 ; no more. + 14710 ; Restore the user's directory. We preserve, though, the return from the + 14711 ; previous system call for later checking. + 14712 + 14713 FOUND_FIRST_FILE: + 14714 push ax ; save return state + 14715 call RESTUDIR ; restore user's dir + 14716 pop ax ; get return state back 14717 - 14718 DIRSTART: - 14719 inc al ; 0FFh = file not found - 14720 jnz short DISPLAY ; Either an error or we are finished - 14721 jmp CHKCNT - 14722 DISPLAY: - 14723 inc word [FILECNT] ; Keep track of how many we find - 14724 mov si,DIRBUF+8 ; SI -> information returned by sys call - 14725 ;call SHONAME - 14726 call DISPLAYNAME - 14727 ;test byte [_BITS],1 - 14728 test byte [_BITS],SWITCHW ; W switch set? - 14729 jz short DIRTEST ; If so, no size, date, or time - 14730 jmp NEXENT - 14731 DIRTEST: - 14732 ;test byte [DIRBUF_ATTRIB1],10h - 14733 ; 14/10/2018 - 14734 ;test byte [DIRBUF_ATTRIB1],ATTR_DIRECTORY - 14735 ;test byte [DIRBUF+19],10h - 14736 test byte [DIRBUF+8+DIR_ENTRY.DIR_ATTR],ATTR_DIRECTORY - 14737 jz short FILEENT - 14738 mov dx,DMESPTR - 14739 call STD_PRINTF - 14740 jmp short NOFSIZ - 14741 FILEENT: - 14742 ;mov dx,[DIRBUF_FSIZ_L] - 14743 ;mov dx,[DIRBUF+36] - 14744 mov dx,[DIRBUF+8+DIR_ENTRY.DIR_SIZE_L] - 14745 mov [FILESIZE_L],dx - 14746 ;mov dx,[DIRBUF_FSIZ_H] - 14747 ;mov dx,[DIRBUF+38] - 14748 mov dx,[DIRBUF+8+DIR_ENTRY.DIR_SIZE_H] - 14749 mov [FILESIZE_H],dx - 14750 mov dx,FSIZEMESPTR - 14751 call STD_PRINTF ; Print size of file - 14752 NOFSIZ: - 14753 ;mov ax,[DIRBUF_FDATE] ; Get date - 14754 ;mov ax,[DIRBUF+32] - 14755 mov ax,[DIRBUF+8+DIR_ENTRY.DIR_DATE] - 14756 or ax,ax - 14757 jz short NEXENT ; Skip if no date - 14758 mov di,CHARBUF - 14759 push ax - 14760 mov ax,' ' - 14761 stosw - 14762 pop ax - 14763 mov bx,ax - 14764 and ax,1Fh ; Get day - 14765 mov dl,al - 14766 mov ax,bx - 14767 mov cl,5 - 14768 shr ax,cl ; Align month - 14769 and al,0Fh ; Get month - 14770 mov dh,al - 14771 mov cl,bh - 14772 shr cl,1 ; Align year - 14773 xor ch,ch - 14774 add cx,80 ; Relative 1980 - 14775 cmp cl,100 - 14776 jb short MILLENIUM - 14777 sub cl,100 - 14778 MILLENIUM: - 14779 call DATE_CXDX - 14780 ;mov cx,[DIRBUF_FTIME] - 14781 ;mov cx,[DIRBUF+30] - 14782 mov cx,[DIRBUF+8+DIR_ENTRY.DIR_TIME] - 14783 jcxz PRBUF ; Time field present? - 14784 mov ax,2020h - 14785 stosw - 14786 shr cx,1 - 14787 shr cx,1 - 14788 shr cx,1 - 14789 shr cl,1 - 14790 shr cl,1 ; Hours in CH, minutes in CL - 14791 mov bl,[TIME_24] - 14792 or bl,80h ; Tell P_TIME called from DIR - 14793 call P_TIME ; Don't care about DX, never used with DIR - 14794 PRBUF: - 14795 xor ax,ax - 14796 stosb - 14797 mov dx,CHARBUF - 14798 mov [STRING_PTR_2],dx - 14799 mov dx,STRINGBUF2PTR - 14800 call STD_PRINTF - 14801 NEXENT: - 14802 dec byte [LINCNT] - 14803 jnz short SAMLIN - 14804 NEXLIN: - 14805 mov al,[LINLEN] - 14806 mov [LINCNT],al - 14807 call CRLF2 - 14808 dec byte [LINPERPAG] - 14809 jnz short SCROLL - 14810 ;test byte [_BITS],2 - 14811 test byte [_BITS],SWITCHP ; P switch present? - 14812 jz short SCROLL ; If not, just continue - 14813 mov byte [LINPERPAG],23 - 14814 call PAUSE - 14815 jmp short SCROLL - 14816 SAMLIN: - 14817 mov dx,TABPTR ; Output a tab - 14818 call STD_PRINTF - 14819 SCROLL: - 14820 mov ah,Dir_Search_Next ; 12h - 14821 ;mov dx,55h - 14822 mov dx,FCB-7 ; DX -> Unopened FCB - 14823 int 21h ; DOS - SEARCH NEXT USING FCB - 14824 ; DS:DX -> FCB - 14825 ; Return: AL = status - 14826 jmp DIRSTART - 14827 CHKCNT: - 14828 test word [FILECNT],0FFFFh ; -1 - 14829 jnz short TRAILER - 14830 jmp DIRNF - 14831 TRAILER: - 14832 mov al,[LINLEN] - 14833 cmp al,[LINCNT] - 14834 jz short MMESSAGE - 14835 call CRLF2 - 14836 MMESSAGE: - 14837 mov dx,DIRMESPTR - 14838 mov si,[FILECNT] - 14839 mov [DIR_NUM],si - 14840 call STD_PRINTF - 14841 DTFREE: - 14842 mov ah,GET_DRIVE_FREESPACE ; 36h - 14843 ;mov dl,[5Ch] - 14844 mov dl,[FCB] - 14845 int 21h ; DOS - 2+ - GET DISK SPACE - 14846 ; DL = drive code (0 = default, 1 = A,2 = B,etc.) - 14847 cmp ax,-1 - 14848 jnz short DTFREE1 - 14849 DTRET: - 14850 retn - 14851 DTFREE1: - 14852 mul cx - 14853 mul bx - 14854 mov [BYTES_FREE],ax - 14855 mov [BYTES_FREE+2],dx - 14856 mov dx,BYTEMESPTR - 14857 jmp STD_PRINTF - 14858 - 14859 ; =============== S U B R O U T I N E ======================================= - 14860 - 14861 SHONAME: - 14862 DISPLAYNAME: - 14863 ; MSDOS 3.3 - 14864 mov di,CHARBUF - 14865 mov cx,8 - 14866 rep movsb - 14867 mov al,' ' - 14868 stosb - 14869 mov cx,3 - 14870 rep movsb - 14871 xor ax,ax - 14872 stosb - 14873 push dx - 14874 mov dx,CHARBUF - 14875 mov [STRING_PTR_2],dx - 14876 mov dx,STRINGBUF2PTR - 14877 call STD_PRINTF - 14878 pop dx - 14879 retn - 14880 - 14881 %endif - 14882 - 14883 ;============================================================================ - 14884 ; DIR.ASM, MSDOS 6.0, 1991 - 14885 ;============================================================================ - 14886 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 14887 - 14888 ; MSDOS 6.0 - 14889 %if 0 + 14718 ; Main scanning loop. Entry has AL = Search first/next error code. Test for + 14719 ; no more. + 14720 + 14721 DIRSTART: + 14722 inc al ; 0FFh = file not found + 14723 jnz short DISPLAY ; Either an error or we are finished + 14724 jmp CHKCNT + 14725 DISPLAY: + 14726 inc word [FILECNT] ; Keep track of how many we find + 14727 mov si,DIRBUF+8 ; SI -> information returned by sys call + 14728 ;call SHONAME + 14729 call DISPLAYNAME + 14730 ;test byte [_BITS],1 + 14731 test byte [_BITS],SWITCHW ; W switch set? + 14732 jz short DIRTEST ; If so, no size, date, or time + 14733 jmp NEXENT + 14734 DIRTEST: + 14735 ;test byte [DIRBUF_ATTRIB1],10h + 14736 ; 14/10/2018 + 14737 ;test byte [DIRBUF_ATTRIB1],ATTR_DIRECTORY + 14738 ;test byte [DIRBUF+19],10h + 14739 test byte [DIRBUF+8+DIR_ENTRY.DIR_ATTR],ATTR_DIRECTORY + 14740 jz short FILEENT + 14741 mov dx,DMESPTR + 14742 call STD_PRINTF + 14743 jmp short NOFSIZ + 14744 FILEENT: + 14745 ;mov dx,[DIRBUF_FSIZ_L] + 14746 ;mov dx,[DIRBUF+36] + 14747 mov dx,[DIRBUF+8+DIR_ENTRY.DIR_SIZE_L] + 14748 mov [FILESIZE_L],dx + 14749 ;mov dx,[DIRBUF_FSIZ_H] + 14750 ;mov dx,[DIRBUF+38] + 14751 mov dx,[DIRBUF+8+DIR_ENTRY.DIR_SIZE_H] + 14752 mov [FILESIZE_H],dx + 14753 mov dx,FSIZEMESPTR + 14754 call STD_PRINTF ; Print size of file + 14755 NOFSIZ: + 14756 ;mov ax,[DIRBUF_FDATE] ; Get date + 14757 ;mov ax,[DIRBUF+32] + 14758 mov ax,[DIRBUF+8+DIR_ENTRY.DIR_DATE] + 14759 or ax,ax + 14760 jz short NEXENT ; Skip if no date + 14761 mov di,CHARBUF + 14762 push ax + 14763 mov ax,' ' + 14764 stosw + 14765 pop ax + 14766 mov bx,ax + 14767 and ax,1Fh ; Get day + 14768 mov dl,al + 14769 mov ax,bx + 14770 mov cl,5 + 14771 shr ax,cl ; Align month + 14772 and al,0Fh ; Get month + 14773 mov dh,al + 14774 mov cl,bh + 14775 shr cl,1 ; Align year + 14776 xor ch,ch + 14777 add cx,80 ; Relative 1980 + 14778 cmp cl,100 + 14779 jb short MILLENIUM + 14780 sub cl,100 + 14781 MILLENIUM: + 14782 call DATE_CXDX + 14783 ;mov cx,[DIRBUF_FTIME] + 14784 ;mov cx,[DIRBUF+30] + 14785 mov cx,[DIRBUF+8+DIR_ENTRY.DIR_TIME] + 14786 jcxz PRBUF ; Time field present? + 14787 mov ax,2020h + 14788 stosw + 14789 shr cx,1 + 14790 shr cx,1 + 14791 shr cx,1 + 14792 shr cl,1 + 14793 shr cl,1 ; Hours in CH, minutes in CL + 14794 mov bl,[TIME_24] + 14795 or bl,80h ; Tell P_TIME called from DIR + 14796 call P_TIME ; Don't care about DX, never used with DIR + 14797 PRBUF: + 14798 xor ax,ax + 14799 stosb + 14800 mov dx,CHARBUF + 14801 mov [STRING_PTR_2],dx + 14802 mov dx,STRINGBUF2PTR + 14803 call STD_PRINTF + 14804 NEXENT: + 14805 dec byte [LINCNT] + 14806 jnz short SAMLIN + 14807 NEXLIN: + 14808 mov al,[LINLEN] + 14809 mov [LINCNT],al + 14810 call CRLF2 + 14811 dec byte [LINPERPAG] + 14812 jnz short SCROLL + 14813 ;test byte [_BITS],2 + 14814 test byte [_BITS],SWITCHP ; P switch present? + 14815 jz short SCROLL ; If not, just continue + 14816 mov byte [LINPERPAG],23 + 14817 call PAUSE + 14818 jmp short SCROLL + 14819 SAMLIN: + 14820 mov dx,TABPTR ; Output a tab + 14821 call STD_PRINTF + 14822 SCROLL: + 14823 mov ah,Dir_Search_Next ; 12h + 14824 ;mov dx,55h + 14825 mov dx,FCB-7 ; DX -> Unopened FCB + 14826 int 21h ; DOS - SEARCH NEXT USING FCB + 14827 ; DS:DX -> FCB + 14828 ; Return: AL = status + 14829 jmp DIRSTART + 14830 CHKCNT: + 14831 test word [FILECNT],0FFFFh ; -1 + 14832 jnz short TRAILER + 14833 jmp DIRNF + 14834 TRAILER: + 14835 mov al,[LINLEN] + 14836 cmp al,[LINCNT] + 14837 jz short MMESSAGE + 14838 call CRLF2 + 14839 MMESSAGE: + 14840 mov dx,DIRMESPTR + 14841 mov si,[FILECNT] + 14842 mov [DIR_NUM],si + 14843 call STD_PRINTF + 14844 DTFREE: + 14845 mov ah,GET_DRIVE_FREESPACE ; 36h + 14846 ;mov dl,[5Ch] + 14847 mov dl,[FCB] + 14848 int 21h ; DOS - 2+ - GET DISK SPACE + 14849 ; DL = drive code (0 = default, 1 = A,2 = B,etc.) + 14850 cmp ax,-1 + 14851 jnz short DTFREE1 + 14852 DTRET: + 14853 retn + 14854 DTFREE1: + 14855 mul cx + 14856 mul bx + 14857 mov [BYTES_FREE],ax + 14858 mov [BYTES_FREE+2],dx + 14859 mov dx,BYTEMESPTR + 14860 jmp STD_PRINTF + 14861 + 14862 ; =============== S U B R O U T I N E ======================================= + 14863 + 14864 SHONAME: + 14865 DISPLAYNAME: + 14866 ; MSDOS 3.3 + 14867 mov di,CHARBUF + 14868 mov cx,8 + 14869 rep movsb + 14870 mov al,' ' + 14871 stosb + 14872 mov cx,3 + 14873 rep movsb + 14874 xor ax,ax + 14875 stosb + 14876 push dx + 14877 mov dx,CHARBUF + 14878 mov [STRING_PTR_2],dx + 14879 mov dx,STRINGBUF2PTR + 14880 call STD_PRINTF + 14881 pop dx + 14882 retn + 14883 + 14884 %endif + 14885 + 14886 ;============================================================================ + 14887 ; DIR.ASM, MSDOS 6.0, 1991 + 14888 ;============================================================================ + 14889 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 14890 - 14891 ;*** DIR.ASM - DIR internal command - 14892 - 14893 comment % ================================================================= - 14894 - 14895 This module replaces TCMD1A.ASM. The old module was titled - 14896 "PART4 COMMAND Transient routines". + 14891 ; MSDOS 6.0 + 14892 %if 0 + 14893 + 14894 ;*** DIR.ASM - DIR internal command + 14895 + 14896 comment % ================================================================= 14897 - 14898 From residual documentation, I surmise that TCMD.ASM originally - 14899 contained the internal commands DIR, PAUSE, ERASE, TYPE, VOL, and - 14900 VER. The file seems to have been successively split: - 14901 - 14902 TCMD -> TCMD1,TCMD2 -> TCMD1A,TCMD1B,TCMD2A,TCMD2B - 14903 - 14904 TCMD1A.ASM contained only the DIR command. - 14905 - 14906 Usage: - 14907 ------ + 14898 This module replaces TCMD1A.ASM. The old module was titled + 14899 "PART4 COMMAND Transient routines". + 14900 + 14901 From residual documentation, I surmise that TCMD.ASM originally + 14902 contained the internal commands DIR, PAUSE, ERASE, TYPE, VOL, and + 14903 VER. The file seems to have been successively split: + 14904 + 14905 TCMD -> TCMD1,TCMD2 -> TCMD1A,TCMD1B,TCMD2A,TCMD2B + 14906 + 14907 TCMD1A.ASM contained only the DIR command. 14908 - 14909 DIR /w /p /b /s /l /c /o /a - 14910 - 14911 DIR /? - 14912 + 14909 Usage: + 14910 ------ + 14911 + 14912 DIR /w /p /b /s /l /c /o /a 14913 - 14914 may include any or none of: drive; directory path; - 14915 wildcarded filename. If drive or directory path are - 14916 omitted, the current defaults are used. If the - 14917 file name or extension is omitted, wildcards are - 14918 assumed. - 14919 - 14920 /w Wide listing format. Files are displayed in compressed - 14921 'name.ext' format. Subdirectory files are enclosed in - 14922 brackets, '[dirname]'. - 14923 - 14924 /p Paged, or prompted listing. A screenful is displayed - 14925 at a time. The name of the directory being listed appears - 14926 at the top of each page. - 14927 - 14928 Bugbug: pages nead to be uniform length..? - 14929 - 14930 /b Bare listing format. Turns off /w or /p. Files are - 14931 listed in compressed 'name.ext' format, one per line, - 14932 without additional information. Good for making batch - 14933 files or for piping. When used with /s, complete - 14934 pathnames are listed. - 14935 - 14936 /s Descend subdirectory tree. Performs command on current - 14937 or specified directory, then for each subdirectory below - 14938 that directory. Directory header and footer is displayed - 14939 for each directory where matching files are found, unless - 14940 used with /b. /b suppresses headers and footers. - 14941 - 14942 Tree is explored depth first, alphabetically within the - 14943 same level. + 14914 DIR /? + 14915 + 14916 + 14917 may include any or none of: drive; directory path; + 14918 wildcarded filename. If drive or directory path are + 14919 omitted, the current defaults are used. If the + 14920 file name or extension is omitted, wildcards are + 14921 assumed. + 14922 + 14923 /w Wide listing format. Files are displayed in compressed + 14924 'name.ext' format. Subdirectory files are enclosed in + 14925 brackets, '[dirname]'. + 14926 + 14927 /p Paged, or prompted listing. A screenful is displayed + 14928 at a time. The name of the directory being listed appears + 14929 at the top of each page. + 14930 + 14931 Bugbug: pages nead to be uniform length..? + 14932 + 14933 /b Bare listing format. Turns off /w or /p. Files are + 14934 listed in compressed 'name.ext' format, one per line, + 14935 without additional information. Good for making batch + 14936 files or for piping. When used with /s, complete + 14937 pathnames are listed. + 14938 + 14939 /s Descend subdirectory tree. Performs command on current + 14940 or specified directory, then for each subdirectory below + 14941 that directory. Directory header and footer is displayed + 14942 for each directory where matching files are found, unless + 14943 used with /b. /b suppresses headers and footers. 14944 - 14945 Bugbug: hidden directories aren't searched. - 14946 - 14947 /l Display file names, extensions and paths in lowercase. ;M010 - 14948 - 14949 /c Display file compression ratio, if the file is on a MagicDrv - 14950 compressed volume. + 14945 Tree is explored depth first, alphabetically within the + 14946 same level. + 14947 + 14948 Bugbug: hidden directories aren't searched. + 14949 + 14950 /l Display file names, extensions and paths in lowercase. ;M010 14951 - 14952 /o Sort order. /o alone sorts by default order (dirs-first, name, - 14953 extension). A sort order may be specified after /o. Any of - 14954 the following characters may be used: nedsgc (name, extension, - 14955 date/time, size, group-dirs-first, compression ratio). Placing - 14956 a '-' before any letter causes a downward sort on that field. - 14957 E.g., /oe-d means sort first by extension in alphabetical order, - 14958 then within each extension sort by date and time in reverse - 14959 chronological order. - 14960 - 14961 /a Attribute selection. Without /a, hidden and system files - 14962 are suppressed from the listing. With /a alone, all files - 14963 are listed. An attribute list may follow /a, consisting of - 14964 any of the following characters: hsdar (hidden, system, - 14965 directory, archive, read-only). A '-' before any letter - 14966 means 'not' that attribute. E.g., /ar-d means files that - 14967 are marked read-only and are not directory files. Note - 14968 that hidden or system files may be included in the listing. - 14969 They are suppressed without /a but are treated like any other - 14970 attribute with /a. - 14971 - 14972 /? Help listing. Display DIR useage information. ;M008;Handled externally - 14973 - 14974 /h has been removed. ;M008 - 14975 - 14976 DIRCMD An environment variable named DIRCMD is parsed before the - 14977 DIR command line. Any command line options may be specified - 14978 in DIRCMD, and become defaults. /? will be ignored in DIRCMD. - 14979 A filespec may be specified in DIRCMD and will be used unless - 14980 a filespec is specified on the command line. Any switch - 14981 specified in DIRCMD may be overridden on the command line. - 14982 If the original DIR default action is desired for a particular - 14983 switch, the switch letter may be preceded by a '-' on the - 14984 command line. E.g., - 14985 - 14986 /-w use long listing format - 14987 /-p don't page the listing - 14988 /-b don't use bare format - 14989 /-s don't descend subdirectory tree - 14990 /-o display files in disk order - 14991 /-a suppress hidden and system files - 14992 - 14993 Notes: - 14994 ------ + 14952 /c Display file compression ratio, if the file is on a MagicDrv + 14953 compressed volume. + 14954 + 14955 /o Sort order. /o alone sorts by default order (dirs-first, name, + 14956 extension). A sort order may be specified after /o. Any of + 14957 the following characters may be used: nedsgc (name, extension, + 14958 date/time, size, group-dirs-first, compression ratio). Placing + 14959 a '-' before any letter causes a downward sort on that field. + 14960 E.g., /oe-d means sort first by extension in alphabetical order, + 14961 then within each extension sort by date and time in reverse + 14962 chronological order. + 14963 + 14964 /a Attribute selection. Without /a, hidden and system files + 14965 are suppressed from the listing. With /a alone, all files + 14966 are listed. An attribute list may follow /a, consisting of + 14967 any of the following characters: hsdar (hidden, system, + 14968 directory, archive, read-only). A '-' before any letter + 14969 means 'not' that attribute. E.g., /ar-d means files that + 14970 are marked read-only and are not directory files. Note + 14971 that hidden or system files may be included in the listing. + 14972 They are suppressed without /a but are treated like any other + 14973 attribute with /a. + 14974 + 14975 /? Help listing. Display DIR useage information. ;M008;Handled externally + 14976 + 14977 /h has been removed. ;M008 + 14978 + 14979 DIRCMD An environment variable named DIRCMD is parsed before the + 14980 DIR command line. Any command line options may be specified + 14981 in DIRCMD, and become defaults. /? will be ignored in DIRCMD. + 14982 A filespec may be specified in DIRCMD and will be used unless + 14983 a filespec is specified on the command line. Any switch + 14984 specified in DIRCMD may be overridden on the command line. + 14985 If the original DIR default action is desired for a particular + 14986 switch, the switch letter may be preceded by a '-' on the + 14987 command line. E.g., + 14988 + 14989 /-w use long listing format + 14990 /-p don't page the listing + 14991 /-b don't use bare format + 14992 /-s don't descend subdirectory tree + 14993 /-o display files in disk order + 14994 /-a suppress hidden and system files 14995 - 14996 For sorted listings, file entries are loaded into the TPA buffer, which - 14997 is usually about 64K in size. This allows sorts of up to 3000 files at - 14998 a time. Each entry takes up 21 bytes in the buffer (see EntryStruc below). - 14999 The byte after the last entry is 0FFh. The first byte of each entry is - 15000 a flag byte which is made zero when the entry is loaded, and made one - 15001 when the entry is used. - 15002 - 15003 Revision History - 15004 ================ - 15005 M01 md 7/13/90 Use ROM BIOS data area to obtain screen height - 15006 in the absence of ANSI.SYS - 15007 - 15008 M007 sa 8/1/90 Allow /p/b combination - 15009 - 15010 M008 sa 8/1/90 Remove /h parameter. Eliminate code used - 15011 to internally handle /? message. + 14996 Notes: + 14997 ------ + 14998 + 14999 For sorted listings, file entries are loaded into the TPA buffer, which + 15000 is usually about 64K in size. This allows sorts of up to 3000 files at + 15001 a time. Each entry takes up 21 bytes in the buffer (see EntryStruc below). + 15002 The byte after the last entry is 0FFh. The first byte of each entry is + 15003 a flag byte which is made zero when the entry is loaded, and made one + 15004 when the entry is used. + 15005 + 15006 Revision History + 15007 ================ + 15008 M01 md 7/13/90 Use ROM BIOS data area to obtain screen height + 15009 in the absence of ANSI.SYS + 15010 + 15011 M007 sa 8/1/90 Allow /p/b combination 15012 - 15013 M010 sa 8/5/90 Add support for /l (lowercase) option. - 15014 - 15015 M011 sa 8/5/90 Patch up bug where MS-DOS does not load the - 15016 first FCB with the drive number when the drive - 15017 letter in the command line is preceded by a - 15018 switch. Now dir manually loads the drive - 15019 number after parsing. - 15020 - 15021 M018 md 8/12/90 Increment the screen height by 1 when obtained - 15022 from the ROM BIOS. + 15013 M008 sa 8/1/90 Remove /h parameter. Eliminate code used + 15014 to internally handle /? message. + 15015 + 15016 M010 sa 8/5/90 Add support for /l (lowercase) option. + 15017 + 15018 M011 sa 8/5/90 Patch up bug where MS-DOS does not load the + 15019 first FCB with the drive number when the drive + 15020 letter in the command line is preceded by a + 15021 switch. Now dir manually loads the drive + 15022 number after parsing. 15023 - 15024 M023 sa 8/31/90 Prevent DIR from failing if it encounters - 15025 a subdirectory having len(pathname)>MAXPATH. - 15026 Just skip over that subdirectory. - 15027 - 15028 M028 dbo 9/24/90 When country=US, sort by strict character - 15029 byte value, rather than collating table. - 15030 This to match MS-DOS Shell's sort order. - 15031 - 15032 ========================================================================= % - 15033 - 15034 %endif - 15035 - 15036 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM (PCDOS 7.1) - 15037 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM (MSDOS 6.22) - 15038 ;ifdef DBLSPACE_HOOKS - 15039 ;NUM_DIR_SWS equ 16 ; # of dir switch synonyms in Dir_Sw_Ptrs list - 15040 ; 28/07/2024 - PCDOS 7.1 COMMAND.COM - 15041 NUM_DIR_SWS equ 18 - 15042 ;else - 15043 ; 16/02/2023 - Retro DOS v4.0 (v4.1) COMMAND.COM (MSDOS 5.0) - 15044 ;NUM_DIR_SWS equ 14 ; # of dir switch synonyms in Dir_Sw_Ptrs list - 15045 ;endif - 15046 - 15047 ;OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1 - 15048 ; - 15049 ; on/off bit record for /l, /b, /s, /p, /w, /c options - 15050 ; (order is hard-coded; see OnOffSw) - 15051 ; Inmem is set when entries are loaded in memory. - 15052 - 15053 ; 28/07/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM - 15054 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM (MSDOS 5.0) - 15055 mask.wide equ 1 ; dir /W switch - 15056 mask.pagd equ 2 ; dir /P switch - 15057 mask.subd equ 4 ; dir /S switch - 15058 mask.bare equ 8 ; dir /B switch - 15059 mask.lcase equ 16 ; dir /L switch - 15060 ;mask.inmem equ 32 ; - 15061 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 15062 mask.narrow equ 32 ; dir /Z switch - 15063 mask.year4 equ 64 ; dir /4 switch - 15064 mask.inmem equ 128 ; - 15065 - 15066 ; 28/07/2024 - 15067 ; 05/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 15068 ;ifdef DBLSPACE_HOOKS - 15069 ; OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1,cratio:1 - 15070 ;else - 15071 ; OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1 - 15072 ;endif - 15073 ;mask.cratio equ 1 - 15074 ;mask.wide equ 2 - 15075 ;mask.pagd equ 4 - 15076 ;mask.subd equ 8 - 15077 ;mask.bare equ 16 - 15078 ;mask.lcase equ 32 - 15079 ;mask.inmem equ 64 - 15080 ; - 15081 mask.dev equ 1 - 15082 mask.baddir equ 2 - 15083 - 15084 NUM_ATTR_LTRS equ 6 ; length of attribute letter list - 15085 - 15086 ; 05/06/2023 - 15087 ;ifdef DBLSPACE_HOOKS - 15088 NUM_ORDER_LTRS equ 6 ; length of sort order letter list - 15089 CRATIO_ORDER equ 6 ; position of 'C' in ORDER_LTRS - 15090 ;else - 15091 ;NUM_ORDER_LTRS equ 5 ; length of sort order letter list - 15092 ;endif - 15093 - 15094 ;ResultBuffer struc ; structure of parse result buffer - 15095 ;ValueType db ? - 15096 ;ValueTag db ? - 15097 ;SynPtr dw ? - 15098 ;ValuePtr dd ? - 15099 ;ResultBuffer ends - 15100 - 15101 ;ErrorRec record baddir:1,dev:1 - 15102 ; - 15103 ; Error bits are: - 15104 ; Invalid directory format - 15105 ; File is device - 15106 - 15107 ;EntryStruc struc ; our private directory entry structure - 15108 ;used db ? ; =0 until entry used, then =1 - 15109 ;filename db 8 dup (?) ; filename - 15110 ;fileext db 3 dup (?) ; extension - 15111 ;fileattr db ? ; file attributes - 15112 ;filetime dw ? ; file time - 15113 ;filedate dw ? ; file date - 15114 ;filesize dd ? ; file size - 15115 ; 05/06/2023 - 15116 ;;ifdef DBLSPACE_HOOKS - 15117 ;compratio db ? ; compression ratio - 15118 ;;endif - 15119 ;EntryStruc ends - 15120 - 15121 ;shove macro val ; hose-bag 8086 doesn't push immediate - 15122 ; mov ax,val ; invisible, dangerous use of AX! - 15123 ; push ax - 15124 ; endm - 15125 - 15126 ; public Catalog ; our entry point - 15127 ; - 15128 ; break - 15129 ; - 15130 ; assume cs:TRANGROUP,ds:TRANGROUP,es:nothing,ss:TRANGROUP - 15131 ; --------------------------------------------------------------------------- - 15132 ; Bugbug: Each routine should start with it's own ASSUME. - 15133 - 15134 ;---------------------------------------------------------------------------- - 15135 ;---------------------------------------------------------------------------- + 15024 M018 md 8/12/90 Increment the screen height by 1 when obtained + 15025 from the ROM BIOS. + 15026 + 15027 M023 sa 8/31/90 Prevent DIR from failing if it encounters + 15028 a subdirectory having len(pathname)>MAXPATH. + 15029 Just skip over that subdirectory. + 15030 + 15031 M028 dbo 9/24/90 When country=US, sort by strict character + 15032 byte value, rather than collating table. + 15033 This to match MS-DOS Shell's sort order. + 15034 + 15035 ========================================================================= % + 15036 + 15037 %endif + 15038 + 15039 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM (PCDOS 7.1) + 15040 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM (MSDOS 6.22) + 15041 ;ifdef DBLSPACE_HOOKS + 15042 ;NUM_DIR_SWS equ 16 ; # of dir switch synonyms in Dir_Sw_Ptrs list + 15043 ; 28/07/2024 - PCDOS 7.1 COMMAND.COM + 15044 NUM_DIR_SWS equ 18 + 15045 ;else + 15046 ; 16/02/2023 - Retro DOS v4.0 (v4.1) COMMAND.COM (MSDOS 5.0) + 15047 ;NUM_DIR_SWS equ 14 ; # of dir switch synonyms in Dir_Sw_Ptrs list + 15048 ;endif + 15049 + 15050 ;OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1 + 15051 ; + 15052 ; on/off bit record for /l, /b, /s, /p, /w, /c options + 15053 ; (order is hard-coded; see OnOffSw) + 15054 ; Inmem is set when entries are loaded in memory. + 15055 + 15056 ; 28/07/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM + 15057 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM (MSDOS 5.0) + 15058 mask.wide equ 1 ; dir /W switch + 15059 mask.pagd equ 2 ; dir /P switch + 15060 mask.subd equ 4 ; dir /S switch + 15061 mask.bare equ 8 ; dir /B switch + 15062 mask.lcase equ 16 ; dir /L switch + 15063 ;mask.inmem equ 32 ; + 15064 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 15065 mask.narrow equ 32 ; dir /Z switch + 15066 mask.year4 equ 64 ; dir /4 switch + 15067 mask.inmem equ 128 ; + 15068 + 15069 ; 28/07/2024 + 15070 ; 05/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 15071 ;ifdef DBLSPACE_HOOKS + 15072 ; OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1,cratio:1 + 15073 ;else + 15074 ; OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1 + 15075 ;endif + 15076 ;mask.cratio equ 1 + 15077 ;mask.wide equ 2 + 15078 ;mask.pagd equ 4 + 15079 ;mask.subd equ 8 + 15080 ;mask.bare equ 16 + 15081 ;mask.lcase equ 32 + 15082 ;mask.inmem equ 64 + 15083 ; + 15084 mask.dev equ 1 + 15085 mask.baddir equ 2 + 15086 + 15087 NUM_ATTR_LTRS equ 6 ; length of attribute letter list + 15088 + 15089 ; 05/06/2023 + 15090 ;ifdef DBLSPACE_HOOKS + 15091 NUM_ORDER_LTRS equ 6 ; length of sort order letter list + 15092 CRATIO_ORDER equ 6 ; position of 'C' in ORDER_LTRS + 15093 ;else + 15094 ;NUM_ORDER_LTRS equ 5 ; length of sort order letter list + 15095 ;endif + 15096 + 15097 ;ResultBuffer struc ; structure of parse result buffer + 15098 ;ValueType db ? + 15099 ;ValueTag db ? + 15100 ;SynPtr dw ? + 15101 ;ValuePtr dd ? + 15102 ;ResultBuffer ends + 15103 + 15104 ;ErrorRec record baddir:1,dev:1 + 15105 ; + 15106 ; Error bits are: + 15107 ; Invalid directory format + 15108 ; File is device + 15109 + 15110 ;EntryStruc struc ; our private directory entry structure + 15111 ;used db ? ; =0 until entry used, then =1 + 15112 ;filename db 8 dup (?) ; filename + 15113 ;fileext db 3 dup (?) ; extension + 15114 ;fileattr db ? ; file attributes + 15115 ;filetime dw ? ; file time + 15116 ;filedate dw ? ; file date + 15117 ;filesize dd ? ; file size + 15118 ; 05/06/2023 + 15119 ;;ifdef DBLSPACE_HOOKS + 15120 ;compratio db ? ; compression ratio + 15121 ;;endif + 15122 ;EntryStruc ends + 15123 + 15124 ;shove macro val ; hose-bag 8086 doesn't push immediate + 15125 ; mov ax,val ; invisible, dangerous use of AX! + 15126 ; push ax + 15127 ; endm + 15128 + 15129 ; public Catalog ; our entry point + 15130 ; + 15131 ; break + 15132 ; + 15133 ; assume cs:TRANGROUP,ds:TRANGROUP,es:nothing,ss:TRANGROUP + 15134 ; --------------------------------------------------------------------------- + 15135 ; Bugbug: Each routine should start with it's own ASSUME. 15136 - 15137 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 15138 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:108Dh + 15137 ;---------------------------------------------------------------------------- + 15138 ;---------------------------------------------------------------------------- 15139 - 15140 ;*** Catalog - DIR command main routine - 15141 ; - 15142 ; ENTRY FCB #1 in PSP has drive# from cmd-line or default - 15143 ; Cmd-line tail text is at 81h, terminated by 0Dh - 15144 ; CS, DS, ES, SS = TRANGROUP seg addr - 15145 ; Tpa = TPA buffer seg addr - 15146 ; BytCnt = # bytes in TPA buffer - 15147 ; - 15148 ; EXIT nothing - 15149 ; - 15150 ; USED AX,BX,CX,DX,SI,DI,BP - 15151 ; - 15152 ; ERROR EXITS - 15153 ; - 15154 ; Errors are handled by setting up error message pointers - 15155 ; for Std_EPrintf and jumping to CError. Syntax errors in - 15156 ; the environment variable, however, are handled by printing - 15157 ; an error message and continuing. - 15158 ; - 15159 ; EFFECTS - 15160 ; - 15161 ; Directory listing is displayed (on standard output). - 15162 ; APPEND is disabled. HeadFix routine is expected to - 15163 ; restore APPEND state. - 15164 ; Working directory may be changed. The user's default - 15165 ; directory is saved and flagged for restoration by RestUDir - 15166 ; during COMMAND cycle. - 15167 ; Lots of variables may be changed in TRANSPACE segment. - 15168 ; - 15169 ; NOTES - 15170 ; - 15171 ; ES = TRANGROUP seg addr except when used to address the - 15172 ; the TPA buffer, where directory entries are loaded from disk. - 15173 - 15174 ; 16/02/2023 - 15175 - 15176 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 15177 ; ---------------------------------------- - 15178 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1167h - 15179 - 15180 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 15181 ;---------------------------------------------------------------------------- - 15182 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:11B7h - 15183 - 15184 CATALOG: - 15185 - 15186 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 15187 %if 0 - 15188 ; 07/06/2023 - 15189 ; MSDOS 6.22 COMMAND COM feature only ! - 15190 call screen_f_set ; set display parameters for video/text mode - 15191 ; ; (different depending on scr width/columns) - 15192 call SetDefaults - 15193 call ParseEnvironment - 15194 call ParseCmdLine - 15195 jnc short catalog1 ; no parse error - 15196 ;jmp catErr ; error msg is set up - 15197 ; 07/06/2023 - 15198 ; Retro DOS v4.2 - MSDOS 6.22 COMMANBD.COM - 15199 jmp catExtErr2 - 15200 %else - 15201 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 15202 ; PCDOS 7.1 COMMAND.COM - 15203 00001180 C606[2B9C]00 mov byte [nocommas],0 - 15204 00001185 C606[2D9C]00 mov byte [bfree_not_kilo],0 - 15205 ; use kilobyte if number of bytes is very big - 15206 0000118A 50 push ax - 15207 0000118B 51 push cx - 15208 0000118C 57 push di - 15209 0000118D 56 push si - 15210 0000118E 06 push es - 15211 0000118F BE[0C93] mov si,no_sep_text ; NO_SEP=1 ; Removes the commas from numbers - 15212 00001192 E82215 call find_name_in_environment - 15213 00001195 720A jb short catalog0 - 15214 00001197 C606[2D9C]FF mov byte [bfree_not_kilo],0FFh - 15215 ; no need to kilobyte (short) display - 15216 0000119C C606[2B9C]FF mov byte [nocommas],0FFh - 15217 ; do not use commas for displaying numbers - 15218 catalog0: - 15219 000011A1 07 pop es - 15220 000011A2 5E pop si - 15221 000011A3 5F pop di - 15222 000011A4 59 pop cx - 15223 000011A5 58 pop ax - 15224 000011A6 E8D000 call SetDefaults - 15225 000011A9 E8F400 call ParseEnvironment - 15226 000011AC E80C01 call ParseCmdLine - 15227 000011AF 7303 jnc short catalog1 ; no parse error - 15228 ;jmp catErr - 15229 ; 31/07/2024 - 15230 000011B1 E9C200 jmp catExtErr2 - 15231 %endif - 15232 - 15233 catalog1: - 15234 000011B4 E83501 call SetOptions - 15235 000011B7 E80B01 call SetCollatingTable - 15236 - 15237 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 15238 %if 1 - 15239 000011BA C606[2A9C]00 mov byte [narrow],0 - 15240 ;test byte [_Bits],20h ; /Z switch (narrow) - 15241 000011BF F606[8B9D]20 test byte [_Bits],mask.narrow ; 20h - 15242 000011C4 740A jz short catalog1_1 - 15243 000011C6 C606[2A9C]FF mov byte [narrow],0FFh - 15244 000011CB C606[2B9C]FF mov byte [nocommas],0FFh - 15245 catalog1_1: - 15246 ;test byte [_Bits],40h ; /4 switch - 15247 000011D0 F606[8B9D]40 test byte [_Bits],mask.year4 ; 40h - 15248 000011D5 7407 jz short catalog1_2 - 15249 ;mov byte [cs:yeardigit4],0FFh ; 4 digits year - 15250 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 15251 000011D7 C606[2C9C]FF mov byte [yeardigit4],0FFh - 15252 000011DC EB05 jmp short catalog1_3 - 15253 catalog1_2: - 15254 ;mov byte [cs:yeardigit4],0 ; 2 digits year - 15255 000011DE C606[2C9C]00 mov byte [yeardigit4],0 - 15256 catalog1_3: - 15257 %endif - 15258 - 15259 ; Drive # to operate on has already been placed in FCB by - 15260 ; COMMAND preprocessing. OkVolArg & PathCrunch depend on that. + 15140 ; 16/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 15141 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:108Dh + 15142 + 15143 ;*** Catalog - DIR command main routine + 15144 ; + 15145 ; ENTRY FCB #1 in PSP has drive# from cmd-line or default + 15146 ; Cmd-line tail text is at 81h, terminated by 0Dh + 15147 ; CS, DS, ES, SS = TRANGROUP seg addr + 15148 ; Tpa = TPA buffer seg addr + 15149 ; BytCnt = # bytes in TPA buffer + 15150 ; + 15151 ; EXIT nothing + 15152 ; + 15153 ; USED AX,BX,CX,DX,SI,DI,BP + 15154 ; + 15155 ; ERROR EXITS + 15156 ; + 15157 ; Errors are handled by setting up error message pointers + 15158 ; for Std_EPrintf and jumping to CError. Syntax errors in + 15159 ; the environment variable, however, are handled by printing + 15160 ; an error message and continuing. + 15161 ; + 15162 ; EFFECTS + 15163 ; + 15164 ; Directory listing is displayed (on standard output). + 15165 ; APPEND is disabled. HeadFix routine is expected to + 15166 ; restore APPEND state. + 15167 ; Working directory may be changed. The user's default + 15168 ; directory is saved and flagged for restoration by RestUDir + 15169 ; during COMMAND cycle. + 15170 ; Lots of variables may be changed in TRANSPACE segment. + 15171 ; + 15172 ; NOTES + 15173 ; + 15174 ; ES = TRANGROUP seg addr except when used to address the + 15175 ; the TPA buffer, where directory entries are loaded from disk. + 15176 + 15177 ; 16/02/2023 + 15178 + 15179 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 15180 ; ---------------------------------------- + 15181 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1167h + 15182 + 15183 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 15184 ;---------------------------------------------------------------------------- + 15185 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:11B7h + 15186 + 15187 CATALOG: + 15188 + 15189 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 15190 %if 0 + 15191 ; 07/06/2023 + 15192 ; MSDOS 6.22 COMMAND COM feature only ! + 15193 call screen_f_set ; set display parameters for video/text mode + 15194 ; ; (different depending on scr width/columns) + 15195 call SetDefaults + 15196 call ParseEnvironment + 15197 call ParseCmdLine + 15198 jnc short catalog1 ; no parse error + 15199 ;jmp catErr ; error msg is set up + 15200 ; 07/06/2023 + 15201 ; Retro DOS v4.2 - MSDOS 6.22 COMMANBD.COM + 15202 jmp catExtErr2 + 15203 %else + 15204 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 15205 ; PCDOS 7.1 COMMAND.COM + 15206 00001180 C606[2B9C]00 mov byte [nocommas],0 + 15207 00001185 C606[2D9C]00 mov byte [bfree_not_kilo],0 + 15208 ; use kilobyte if number of bytes is very big + 15209 0000118A 50 push ax + 15210 0000118B 51 push cx + 15211 0000118C 57 push di + 15212 0000118D 56 push si + 15213 0000118E 06 push es + 15214 0000118F BE[0C93] mov si,no_sep_text ; NO_SEP=1 ; Removes the commas from numbers + 15215 00001192 E82215 call find_name_in_environment + 15216 00001195 720A jb short catalog0 + 15217 00001197 C606[2D9C]FF mov byte [bfree_not_kilo],0FFh + 15218 ; no need to kilobyte (short) display + 15219 0000119C C606[2B9C]FF mov byte [nocommas],0FFh + 15220 ; do not use commas for displaying numbers + 15221 catalog0: + 15222 000011A1 07 pop es + 15223 000011A2 5E pop si + 15224 000011A3 5F pop di + 15225 000011A4 59 pop cx + 15226 000011A5 58 pop ax + 15227 000011A6 E8D000 call SetDefaults + 15228 000011A9 E8F400 call ParseEnvironment + 15229 000011AC E80C01 call ParseCmdLine + 15230 000011AF 7303 jnc short catalog1 ; no parse error + 15231 ;jmp catErr + 15232 ; 31/07/2024 + 15233 000011B1 E9C200 jmp catExtErr2 + 15234 %endif + 15235 + 15236 catalog1: + 15237 000011B4 E83501 call SetOptions + 15238 000011B7 E80B01 call SetCollatingTable + 15239 + 15240 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 15241 %if 1 + 15242 000011BA C606[2A9C]00 mov byte [narrow],0 + 15243 ;test byte [_Bits],20h ; /Z switch (narrow) + 15244 000011BF F606[8B9D]20 test byte [_Bits],mask.narrow ; 20h + 15245 000011C4 740A jz short catalog1_1 + 15246 000011C6 C606[2A9C]FF mov byte [narrow],0FFh + 15247 000011CB C606[2B9C]FF mov byte [nocommas],0FFh + 15248 catalog1_1: + 15249 ;test byte [_Bits],40h ; /4 switch + 15250 000011D0 F606[8B9D]40 test byte [_Bits],mask.year4 ; 40h + 15251 000011D5 7407 jz short catalog1_2 + 15252 ;mov byte [cs:yeardigit4],0FFh ; 4 digits year + 15253 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 15254 000011D7 C606[2C9C]FF mov byte [yeardigit4],0FFh + 15255 000011DC EB05 jmp short catalog1_3 + 15256 catalog1_2: + 15257 ;mov byte [cs:yeardigit4],0 ; 2 digits year + 15258 000011DE C606[2C9C]00 mov byte [yeardigit4],0 + 15259 catalog1_3: + 15260 %endif 15261 - 15262 ;;;test Bits,mask bare - 15263 ;;test word [_Bits],8 - 15264 ;test byte [_Bits],8 - 15265 ; 07/06/2023 - 15266 000011E3 F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 (6.22) - 15267 ; 31/07/2024 ; mask.bare = 8 ; PCDOS 7.1 - 15268 000011E8 750A jnz short catalog2 ; don't display volume info for /b - 15269 ;invoke OkVolArg ; find & display volume info - 15270 000011EA E8CD0D call OkVolArg - 15271 ;sub byte [LeftOnpage],2 - 15272 000011ED 832E[1E9C]02 sub word [LeftOnPage],2 - 15273 ; record display lines used by volume info - 15274 000011F2 EB14 jmp short catCrunch - 15275 - 15276 ; OkVolArg side effects: - 15277 ; APPEND is disabled; - 15278 ; DTA established at DirBuf; - 15279 ; Filename fields in FCB are wildcarded. - 15280 - 15281 catalog2: - 15282 ; OkVolArg wasn't executed, so we have to do these ourselves. + 15262 ; Drive # to operate on has already been placed in FCB by + 15263 ; COMMAND preprocessing. OkVolArg & PathCrunch depend on that. + 15264 + 15265 ;;;test Bits,mask bare + 15266 ;;test word [_Bits],8 + 15267 ;test byte [_Bits],8 + 15268 ; 07/06/2023 + 15269 000011E3 F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 (6.22) + 15270 ; 31/07/2024 ; mask.bare = 8 ; PCDOS 7.1 + 15271 000011E8 750A jnz short catalog2 ; don't display volume info for /b + 15272 ;invoke OkVolArg ; find & display volume info + 15273 000011EA E8CD0D call OkVolArg + 15274 ;sub byte [LeftOnpage],2 + 15275 000011ED 832E[1E9C]02 sub word [LeftOnPage],2 + 15276 ; record display lines used by volume info + 15277 000011F2 EB14 jmp short catCrunch + 15278 + 15279 ; OkVolArg side effects: + 15280 ; APPEND is disabled; + 15281 ; DTA established at DirBuf; + 15282 ; Filename fields in FCB are wildcarded. 15283 - 15284 ;invoke DisAppend ; disable APPEND - 15285 000011F4 E88C0D call DisAppend + 15284 catalog2: + 15285 ; OkVolArg wasn't executed, so we have to do these ourselves. 15286 - 15287 ;mov dx,offset TRANGROUP:DirBuf - 15288 000011F7 BA[399D] mov dx,DIRBUF - 15289 000011FA B41A mov ah,1Ah - 15290 ;mov ah,Set_DMA - 15291 000011FC CD21 int 21h ; set DTA - 15292 - 15293 ;mov di,FCB ; 5Ch ; ES:DI = ptr to FCB - 15294 ;inc di ; ES:DI = ptr to filename field of FCB - 15295 ; 28/07/2024 - 15296 000011FE BF5D00 mov di, FCB+1 ; 5Dh - 15297 00001201 B03F mov al,'?' ; AL = wildcard character - 15298 00001203 B90B00 mov cx,11 - 15299 00001206 F3AA rep stosb ; wildcard filename field - 15300 - 15301 catCrunch: - 15302 00001208 E83C01 call CrunchPath ; crunch pathname to get directory and filename - 15303 0000120B 7233 jc short catRecErr ; handle recorded or extended error - 15304 - 15305 ; User's directory has been saved, we've changed to specified directory. - 15306 ; ComSw = error bits for later use - 15307 ; FCB contains parsed filename - 15308 - 15309 ;cmp byte [COMSW],0 - 15310 0000120D 833E[0B9C]00 cmp word [COMSW],0 - 15311 00001212 752C jne short catRecErr ; handle recorded error - 15312 - 15313 00001214 E88A01 call InstallCtrlC ; install control-C handler - 15314 - 15315 ; 31/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 15316 %if 0 - 15317 ; 07/06/2023 - 15318 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 15319 ; MSDOS 6.0 (DBLSPACE/DRVSPACE) - 15320 - 15321 ;test word [_Bits],1 ; mask.cratio - 15322 test byte [_Bits],mask.cratio ; compression ratio wanted? - 15323 jz short catalog4 - 15324 call OpenCVF ; yes, try to open CVF file - 15325 jnc short catalog4 - 15326 - 15327 ;and word [_Bits],0FFFEh ; not (mask cratio) - 15328 and byte [_Bits],~mask.cratio ; 0FEh - 15329 %endif - 15330 - 15331 catalog4: ; 07/06/2023 - 15332 00001217 E8A10A call ZeroTotals ; zero grand totals - 15333 0000121A E8DD04 call ListDir ; list main directory - 15334 ;jc short catExtErr - 15335 ; 07/06/2023 - 15336 ; MSDOS 6.22 COMMAND.COM - 15337 0000121D 7247 jc short catExtErr1 - 15338 - 15339 ;;;test Bits,mask subd - 15340 ;;test word [_Bits],4 - 15341 ;test byte [_Bits],4 - 15342 ; 07/06/2023 - 15343 0000121F F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 (6.22) - 15344 ; 31/07/2024 ; 4 ; PCDOS 7.1 - 15345 00001224 7405 jz short catalog3 ; subdirectories option not set - 15346 00001226 E89001 call ListSubds ; list subdirectories - 15347 ;jc short catExtErr - 15348 ; 07/06/2023 - 15349 ; MSDOS 6.22 COMMAND.COM - 15350 00001229 723B jc short catExtErr1 - 15351 - 15352 catalog3: - 15353 ; Check if any files were found. + 15287 ;invoke DisAppend ; disable APPEND + 15288 000011F4 E88C0D call DisAppend + 15289 + 15290 ;mov dx,offset TRANGROUP:DirBuf + 15291 000011F7 BA[399D] mov dx,DIRBUF + 15292 000011FA B41A mov ah,1Ah + 15293 ;mov ah,Set_DMA + 15294 000011FC CD21 int 21h ; set DTA + 15295 + 15296 ;mov di,FCB ; 5Ch ; ES:DI = ptr to FCB + 15297 ;inc di ; ES:DI = ptr to filename field of FCB + 15298 ; 28/07/2024 + 15299 000011FE BF5D00 mov di, FCB+1 ; 5Dh + 15300 00001201 B03F mov al,'?' ; AL = wildcard character + 15301 00001203 B90B00 mov cx,11 + 15302 00001206 F3AA rep stosb ; wildcard filename field + 15303 + 15304 catCrunch: + 15305 00001208 E83C01 call CrunchPath ; crunch pathname to get directory and filename + 15306 0000120B 7233 jc short catRecErr ; handle recorded or extended error + 15307 + 15308 ; User's directory has been saved, we've changed to specified directory. + 15309 ; ComSw = error bits for later use + 15310 ; FCB contains parsed filename + 15311 + 15312 ;cmp byte [COMSW],0 + 15313 0000120D 833E[0B9C]00 cmp word [COMSW],0 + 15314 00001212 752C jne short catRecErr ; handle recorded error + 15315 + 15316 00001214 E88A01 call InstallCtrlC ; install control-C handler + 15317 + 15318 ; 31/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 15319 %if 0 + 15320 ; 07/06/2023 + 15321 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 15322 ; MSDOS 6.0 (DBLSPACE/DRVSPACE) + 15323 + 15324 ;test word [_Bits],1 ; mask.cratio + 15325 test byte [_Bits],mask.cratio ; compression ratio wanted? + 15326 jz short catalog4 + 15327 call OpenCVF ; yes, try to open CVF file + 15328 jnc short catalog4 + 15329 + 15330 ;and word [_Bits],0FFFEh ; not (mask cratio) + 15331 and byte [_Bits],~mask.cratio ; 0FEh + 15332 %endif + 15333 + 15334 catalog4: ; 07/06/2023 + 15335 00001217 E8A10A call ZeroTotals ; zero grand totals + 15336 0000121A E8DD04 call ListDir ; list main directory + 15337 ;jc short catExtErr + 15338 ; 07/06/2023 + 15339 ; MSDOS 6.22 COMMAND.COM + 15340 0000121D 7247 jc short catExtErr1 + 15341 + 15342 ;;;test Bits,mask subd + 15343 ;;test word [_Bits],4 + 15344 ;test byte [_Bits],4 + 15345 ; 07/06/2023 + 15346 0000121F F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 (6.22) + 15347 ; 31/07/2024 ; 4 ; PCDOS 7.1 + 15348 00001224 7405 jz short catalog3 ; subdirectories option not set + 15349 00001226 E89001 call ListSubds ; list subdirectories + 15350 ;jc short catExtErr + 15351 ; 07/06/2023 + 15352 ; MSDOS 6.22 COMMAND.COM + 15353 00001229 723B jc short catExtErr1 15354 - 15355 ;;;test Bits,mask bare - 15356 ;;test word [_Bits],8 - 15357 ;test byte [_Bits],8 - 15358 ; 07/06/2023 - 15359 0000122B F606[8B9D]08 test byte [_Bits],mask.bare ; 16 ; MSDOS 6.0 (6.22) - 15360 ; 31/07/2024 ; 8 ; PCDOS 7.1 - 15361 00001230 750D jnz short catRet ; don't bother for bare format - 15362 - 15363 ; 31/07/2024 - 15364 ; PCDOS 7.1 COMMAND.COM - 15365 %if 0 - 15366 mov ax,[FileCntTotal] - 15367 or ax,ax - 15368 jz short catNoFiles ; no files found - 15369 %else - 15370 00001232 8B0E[5E9C] mov cx,[FileCntTotal] - 15371 00001236 0B0E[609C] or cx,[FileCntTotal+2] - 15372 0000123A E317 jcxz catNoFiles ; no files found - 15373 %endif - 15374 - 15375 0000123C E8BA02 call DisplayTotals ; display trailing grand totals - 15376 ;jmp short catRet ; all done - 15377 ; 25/04/2023 - 15378 ; 07/06/2023 - 15379 catRet: - 15380 ;retn ; MSDOS 5.0 COMMAND.COM - 15381 - 15382 ; 31/07/2024 - 15383 ; PCDOS 7.1 COMMAND.COM - 15384 %if 0 - 15385 ; 07/06/2023 - 15386 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 15387 - 15388 ;test word [_Bits],1 ; mask.cratio - 15389 test byte [_Bits],mask.cratio - 15390 jz short catRetn - 15391 call CloseCVF - 15392 %endif - 15393 - 15394 catRetn: - 15395 0000123F C3 retn + 15355 catalog3: + 15356 ; Check if any files were found. + 15357 + 15358 ;;;test Bits,mask bare + 15359 ;;test word [_Bits],8 + 15360 ;test byte [_Bits],8 + 15361 ; 07/06/2023 + 15362 0000122B F606[8B9D]08 test byte [_Bits],mask.bare ; 16 ; MSDOS 6.0 (6.22) + 15363 ; 31/07/2024 ; 8 ; PCDOS 7.1 + 15364 00001230 750D jnz short catRet ; don't bother for bare format + 15365 + 15366 ; 31/07/2024 + 15367 ; PCDOS 7.1 COMMAND.COM + 15368 %if 0 + 15369 mov ax,[FileCntTotal] + 15370 or ax,ax + 15371 jz short catNoFiles ; no files found + 15372 %else + 15373 00001232 8B0E[5E9C] mov cx,[FileCntTotal] + 15374 00001236 0B0E[609C] or cx,[FileCntTotal+2] + 15375 0000123A E317 jcxz catNoFiles ; no files found + 15376 %endif + 15377 + 15378 0000123C E8BA02 call DisplayTotals ; display trailing grand totals + 15379 ;jmp short catRet ; all done + 15380 ; 25/04/2023 + 15381 ; 07/06/2023 + 15382 catRet: + 15383 ;retn ; MSDOS 5.0 COMMAND.COM + 15384 + 15385 ; 31/07/2024 + 15386 ; PCDOS 7.1 COMMAND.COM + 15387 %if 0 + 15388 ; 07/06/2023 + 15389 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 15390 + 15391 ;test word [_Bits],1 ; mask.cratio + 15392 test byte [_Bits],mask.cratio + 15393 jz short catRetn + 15394 call CloseCVF + 15395 %endif 15396 - 15397 catRecErr: - 15398 - 15399 ; ComSw may have error bit set. If not, do extended error. - 15400 - 15401 ;;;test ComSw,mask dev - 15402 ;;test word [COMSW],1 - 15403 ;test byte [COMSW],1 - 15404 00001240 F606[0B9C]01 test byte [COMSW],mask.dev - 15405 00001245 750C jnz short catNoFiles - 15406 ; filename is device, respond 'file not found' - 15407 ;;test ComSw,mask baddir - 15408 ;;test word [COMSW],2 - 15409 ;test byte [COMSW],2 - 15410 00001247 F606[0B9C]02 test byte [COMSW],mask.baddir - 15411 ;jz short catExtErr ; no ComSw error bits, must be extended error - 15412 ; 07/06/2023 - 15413 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 15414 0000124C 7418 jz short catExtErr1 - 15415 - 15416 ;mov dx,offset TRANGROUP:BadCd_Ptr - 15417 ; invalid directory - 15418 0000124E BA[3791] mov dx,badcd_ptr - 15419 ;jmp short catErr - 15420 ; 07/06/2023 - 15421 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 15422 00001251 EB23 jmp short catExtErr2 - 15423 - 15424 catNoFiles: - 15425 - 15426 ; Display header and force 'file not found' message. - 15427 - 15428 00001253 E8EF07 call DisplayHeader - 15429 00001256 B80200 mov ax,ERROR_FILE_NOT_FOUND ; 2 - 15430 00001259 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class ; 1 - 15431 0000125E BA[D78F] mov dx,extend_buf_ptr - 15432 00001261 A3[D78F] mov [extend_buf_ptr],ax - 15433 ;jmp short catErr - 15434 ; 07/06/2023 - 15435 ; MSDOS 6.22 COMMAND.COM - 15436 00001264 EB10 jmp short catExtErr2 - 15437 - 15438 catExtErr: ; Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM - 15439 ; 07/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 15440 catExtErr1: - 15441 - 15442 ; DOS has returned an error status. Get the extended error#, and - 15443 ; set up an error message, changing 'No more files' error - 15444 ; to 'File not found' error. - 15445 - 15446 00001266 E8D20D call Set_Ext_Error_Msg - 15447 00001269 833E[D78F]12 cmp word [extend_buf_ptr],ERROR_NO_MORE_FILES ; 18 - 15448 ;jne short catalog4 ; catErr ; MSDOS 5.0 COMMAND.COM - 15449 ; 07/06/2023 - 15450 ; MSDOS 6.22 COMMAND.COM - 15451 0000126E 7506 jne short catExtErr2 - 15452 - 15453 00001270 C706[D78F]0200 mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND ; 2 - 15454 - 15455 ;catalog4: ; Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM - 15456 ; 07/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 15457 catExtErr2: - 15458 - 15459 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 15460 %if 0 - 15461 ;test word [_Bits],1 ; mask.cratio - 15462 test byte [_Bits],mask.cratio - 15463 ; close Compressed Volume File if cratio - 15464 jz short catErr - 15465 call CloseCVF - 15466 %endif - 15467 - 15468 ; Error exit. Error message information has been set up - 15469 ; for Std_EPrintf. + 15397 catRetn: + 15398 0000123F C3 retn + 15399 + 15400 catRecErr: + 15401 + 15402 ; ComSw may have error bit set. If not, do extended error. + 15403 + 15404 ;;;test ComSw,mask dev + 15405 ;;test word [COMSW],1 + 15406 ;test byte [COMSW],1 + 15407 00001240 F606[0B9C]01 test byte [COMSW],mask.dev + 15408 00001245 750C jnz short catNoFiles + 15409 ; filename is device, respond 'file not found' + 15410 ;;test ComSw,mask baddir + 15411 ;;test word [COMSW],2 + 15412 ;test byte [COMSW],2 + 15413 00001247 F606[0B9C]02 test byte [COMSW],mask.baddir + 15414 ;jz short catExtErr ; no ComSw error bits, must be extended error + 15415 ; 07/06/2023 + 15416 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 15417 0000124C 7418 jz short catExtErr1 + 15418 + 15419 ;mov dx,offset TRANGROUP:BadCd_Ptr + 15420 ; invalid directory + 15421 0000124E BA[3791] mov dx,badcd_ptr + 15422 ;jmp short catErr + 15423 ; 07/06/2023 + 15424 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 15425 00001251 EB23 jmp short catExtErr2 + 15426 + 15427 catNoFiles: + 15428 + 15429 ; Display header and force 'file not found' message. + 15430 + 15431 00001253 E8EF07 call DisplayHeader + 15432 00001256 B80200 mov ax,ERROR_FILE_NOT_FOUND ; 2 + 15433 00001259 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class ; 1 + 15434 0000125E BA[D78F] mov dx,extend_buf_ptr + 15435 00001261 A3[D78F] mov [extend_buf_ptr],ax + 15436 ;jmp short catErr + 15437 ; 07/06/2023 + 15438 ; MSDOS 6.22 COMMAND.COM + 15439 00001264 EB10 jmp short catExtErr2 + 15440 + 15441 catExtErr: ; Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM + 15442 ; 07/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 15443 catExtErr1: + 15444 + 15445 ; DOS has returned an error status. Get the extended error#, and + 15446 ; set up an error message, changing 'No more files' error + 15447 ; to 'File not found' error. + 15448 + 15449 00001266 E8D20D call Set_Ext_Error_Msg + 15450 00001269 833E[D78F]12 cmp word [extend_buf_ptr],ERROR_NO_MORE_FILES ; 18 + 15451 ;jne short catalog4 ; catErr ; MSDOS 5.0 COMMAND.COM + 15452 ; 07/06/2023 + 15453 ; MSDOS 6.22 COMMAND.COM + 15454 0000126E 7506 jne short catExtErr2 + 15455 + 15456 00001270 C706[D78F]0200 mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND ; 2 + 15457 + 15458 ;catalog4: ; Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM + 15459 ; 07/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 15460 catExtErr2: + 15461 + 15462 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 15463 %if 0 + 15464 ;test word [_Bits],1 ; mask.cratio + 15465 test byte [_Bits],mask.cratio + 15466 ; close Compressed Volume File if cratio + 15467 jz short catErr + 15468 call CloseCVF + 15469 %endif 15470 - 15471 catErr: - 15472 00001276 E9AD1A jmp cerror ; go to COMMAND error recycle point + 15471 ; Error exit. Error message information has been set up + 15472 ; for Std_EPrintf. 15473 - 15474 ; 25/04/2023 - 15475 ;catRet: - 15476 ;retn - 15477 - 15478 ; --------------------------------------------------------------------------- - 15479 - 15480 ;*** SetDefaults - set default pathname, options - 15481 ; - 15482 ; ENTRY DS = TRANGROUP seg addr - 15483 ; - 15484 ; EXIT nothing - 15485 ; - 15486 ; USED AX,DI - 15487 ; - 15488 ; EFFECTS - 15489 ; SrcBuf = '*',EOL - default pathname - 15490 ; PathPos = ptr to pathname - 15491 ; PathCnt = length of pathname - 15492 - 15493 ; 16/02/2023 - 15494 SetDefaults: - 15495 00001279 BF[219E] mov di,SrcBuf ; DI = ptr to pathname buffer - 15496 0000127C 893E[8F9D] mov [PathPos],di ; PathPos = ptr to pathname - 15497 ;mov al,STAR - 15498 00001280 B02A mov al,'*' - 15499 00001282 AA stosb - 15500 ;mov al,END_OF_LINE_IN - 15501 00001283 B00D mov al,0Dh ; cr - 15502 00001285 AA stosb ; SrcBuf = '*',0Dh - 15503 00001286 C706[8D9D]0100 mov word [PathCnt],1 ; PathCnt = pathname length - 15504 - 15505 0000128C 31C0 xor ax,ax ; AX = 0 - 15506 0000128E A3[0B9C] mov [COMSW],ax ; = no error - 15507 00001291 A3[8B9D] mov [_Bits],ax ; = options off - 15508 00001294 A2[BE9D] mov [DestBuf],al ; = no sort - 15509 00001297 C606[939D]06 mov byte [AttrSpecified],ATTR_HIDDEN+ATTR_SYSTEM ; 6 - 15510 0000129C A2[949D] mov [AttrSelect],al ; exclude hidden, system files - 15511 peRet: ; 25/04/2023 - 15512 0000129F C3 retn - 15513 - 15514 ; --------------------------------------------------------------------------- - 15515 - 15516 ;*** ParseEnvironment - find and parse our environment variable - 15517 ; - 15518 ; Find our environment variable and parse it. If a parse - 15519 ; error occurs, issue an error message. The parse results - 15520 ; up to the error will still have effect. Always leave - 15521 ; the option variables in a useable state. - 15522 ; - 15523 ; ENTRY DS = TRANGROUP seg addr - 15524 ; - 15525 ; EXIT nothing - 15526 ; - 15527 ; USED AX,BX,CX,DX,SI,DI - 15528 ; - 15529 ; EFFECTS - 15530 ; - 15531 ; Bits may contain new option settings. - 15532 ; DestBuf may contain new series of sort codes. - 15533 ; AttrSpecified, AttrSelect may contain new attribute conditions. - 15534 ; SrcBuf may contain a new default pathname/filespec. - 15535 ; PathPos, PathCnt updated for new pathname. - 15536 ; - 15537 ; If a parse error occurred, an error message will be issued. - 15538 - 15539 ; 16/02/2023 - 15540 ParseEnvironment: - 15541 000012A0 E80D04 call GetEnvValue ; get environment variable value - 15542 000012A3 72FA jc short peRet ; name not found in environment - 15543 - 15544 ; SI = ptr to value of environment variable, in TRANGROUP seg - 15545 - 15546 000012A5 E85E05 call Parse_Line ; parse environment value - 15547 000012A8 83F8FF cmp ax,-1 ; 0FFFFh - 15548 ;cmp ax,END_OF_LINE - 15549 000012AB 74F2 je short peRet ; successful completion - 15550 - 15551 ; Some kind of parse error occurred. - 15552 ; We're set up for a Std_EPrintf call. + 15474 catErr: + 15475 00001276 E9AD1A jmp cerror ; go to COMMAND error recycle point + 15476 + 15477 ; 25/04/2023 + 15478 ;catRet: + 15479 ;retn + 15480 + 15481 ; --------------------------------------------------------------------------- + 15482 + 15483 ;*** SetDefaults - set default pathname, options + 15484 ; + 15485 ; ENTRY DS = TRANGROUP seg addr + 15486 ; + 15487 ; EXIT nothing + 15488 ; + 15489 ; USED AX,DI + 15490 ; + 15491 ; EFFECTS + 15492 ; SrcBuf = '*',EOL - default pathname + 15493 ; PathPos = ptr to pathname + 15494 ; PathCnt = length of pathname + 15495 + 15496 ; 16/02/2023 + 15497 SetDefaults: + 15498 00001279 BF[219E] mov di,SrcBuf ; DI = ptr to pathname buffer + 15499 0000127C 893E[8F9D] mov [PathPos],di ; PathPos = ptr to pathname + 15500 ;mov al,STAR + 15501 00001280 B02A mov al,'*' + 15502 00001282 AA stosb + 15503 ;mov al,END_OF_LINE_IN + 15504 00001283 B00D mov al,0Dh ; cr + 15505 00001285 AA stosb ; SrcBuf = '*',0Dh + 15506 00001286 C706[8D9D]0100 mov word [PathCnt],1 ; PathCnt = pathname length + 15507 + 15508 0000128C 31C0 xor ax,ax ; AX = 0 + 15509 0000128E A3[0B9C] mov [COMSW],ax ; = no error + 15510 00001291 A3[8B9D] mov [_Bits],ax ; = options off + 15511 00001294 A2[BE9D] mov [DestBuf],al ; = no sort + 15512 00001297 C606[939D]06 mov byte [AttrSpecified],ATTR_HIDDEN+ATTR_SYSTEM ; 6 + 15513 0000129C A2[949D] mov [AttrSelect],al ; exclude hidden, system files + 15514 peRet: ; 25/04/2023 + 15515 0000129F C3 retn + 15516 + 15517 ; --------------------------------------------------------------------------- + 15518 + 15519 ;*** ParseEnvironment - find and parse our environment variable + 15520 ; + 15521 ; Find our environment variable and parse it. If a parse + 15522 ; error occurs, issue an error message. The parse results + 15523 ; up to the error will still have effect. Always leave + 15524 ; the option variables in a useable state. + 15525 ; + 15526 ; ENTRY DS = TRANGROUP seg addr + 15527 ; + 15528 ; EXIT nothing + 15529 ; + 15530 ; USED AX,BX,CX,DX,SI,DI + 15531 ; + 15532 ; EFFECTS + 15533 ; + 15534 ; Bits may contain new option settings. + 15535 ; DestBuf may contain new series of sort codes. + 15536 ; AttrSpecified, AttrSelect may contain new attribute conditions. + 15537 ; SrcBuf may contain a new default pathname/filespec. + 15538 ; PathPos, PathCnt updated for new pathname. + 15539 ; + 15540 ; If a parse error occurred, an error message will be issued. + 15541 + 15542 ; 16/02/2023 + 15543 ParseEnvironment: + 15544 000012A0 E80D04 call GetEnvValue ; get environment variable value + 15545 000012A3 72FA jc short peRet ; name not found in environment + 15546 + 15547 ; SI = ptr to value of environment variable, in TRANGROUP seg + 15548 + 15549 000012A5 E85E05 call Parse_Line ; parse environment value + 15550 000012A8 83F8FF cmp ax,-1 ; 0FFFFh + 15551 ;cmp ax,END_OF_LINE + 15552 000012AB 74F2 je short peRet ; successful completion 15553 - 15554 000012AD E87041 call std_eprintf ; display the parse error - 15555 ;mov byte [Msg_Disp_Class],util_msg_class ; -1 - 15556 ; restore default msg class - 15557 000012B0 C606[D58F]FF mov byte [msg_disp_class],0FFh ; -1 - 15558 ;mov dx,offset TRANGROUP:ErrParsEnv_Ptr - 15559 000012B5 BA[9292] mov dx,errparsenv_ptr - 15560 ;;invoke Printf_Crlf ; "(Error occurred in environment.." - 15561 ;call Printf_Crlf - 15562 ; 25/04/2023 - 15563 ;retn - 15564 000012B8 E95F41 jmp Printf_Crlf - 15565 ;M008;Internal handling of /? removed - 15566 ;peOk: and Bits,not mask help ; disallow /h in environment variable - 15567 ; 25/04/2023 - 15568 ;peRet: - 15569 ;retn - 15570 - 15571 ; --------------------------------------------------------------------------- - 15572 - 15573 ;*** ParseCmdLine - parse and record command line parameters - 15574 ; - 15575 ; ENTRY PSP offset 81h is beginning of cmd line buffer - 15576 ; DS, ES, CS = TRANGROUP seg addr + 15554 ; Some kind of parse error occurred. + 15555 ; We're set up for a Std_EPrintf call. + 15556 + 15557 000012AD E87041 call std_eprintf ; display the parse error + 15558 ;mov byte [Msg_Disp_Class],util_msg_class ; -1 + 15559 ; restore default msg class + 15560 000012B0 C606[D58F]FF mov byte [msg_disp_class],0FFh ; -1 + 15561 ;mov dx,offset TRANGROUP:ErrParsEnv_Ptr + 15562 000012B5 BA[9292] mov dx,errparsenv_ptr + 15563 ;;invoke Printf_Crlf ; "(Error occurred in environment.." + 15564 ;call Printf_Crlf + 15565 ; 25/04/2023 + 15566 ;retn + 15567 000012B8 E95F41 jmp Printf_Crlf + 15568 ;M008;Internal handling of /? removed + 15569 ;peOk: and Bits,not mask help ; disallow /h in environment variable + 15570 ; 25/04/2023 + 15571 ;peRet: + 15572 ;retn + 15573 + 15574 ; --------------------------------------------------------------------------- + 15575 + 15576 ;*** ParseCmdLine - parse and record command line parameters 15577 ; - 15578 ; EXIT CY = set if parse error occurred - 15579 ; - 15580 ; If parse error occurred, we're set up for Std_EPrintf call: - 15581 ; AX = system parser error code - 15582 ; DX = ptr to message block - 15583 ; - 15584 ; USED AX,BX,CX,DX,SI,DI - 15585 ; - 15586 ; EFFECTS - 15587 ; - 15588 ; Bits may contain new option settings. - 15589 ; DestBuf may contain new series of sort codes. - 15590 ; AttrSpecified, AttrSelect may contain new attribute conditions. - 15591 ; SrcBuf may contain a new default pathname/filespec. - 15592 ; PathPos, PathCnt updated for new pathname. - 15593 ; - 15594 ; If parse error occurred, we're set up for Std_EPrintf call: - 15595 ; Msg_Disp_Class = parse error class - 15596 ; Byte after last parameter in text is zeroed to make ASCIIZ string - 15597 ; Message block (see DX) is set up for parse error message - 15598 - 15599 ; 16/02/2023 - 15600 ParseCmdLine: - 15601 000012BB BE8100 mov si,81h ; SI = ptr to cmd-line tail text - 15602 000012BE E84505 call Parse_Line ; parse cmd line tail - 15603 000012C1 83F8FF cmp ax,-1 ; 0FFFFh - 15604 ;;cmp ax,END_OF_LINE - 15605 ; 25/04/2023 - 15606 ;je short pcOk ; parse completed successfully - 15607 - 15608 ; A parse error occurred. We're all set up for message output. - 15609 - 15610 ; 25/04/2023 - 15611 ; cf = 1 (ax < 0FFFFh) - 15612 ;stc ; return failure - 15613 ;jmp short pcRet - 15614 ; 25/04/2023 - 15615 ;retn - 15616 pcOk: + 15578 ; ENTRY PSP offset 81h is beginning of cmd line buffer + 15579 ; DS, ES, CS = TRANGROUP seg addr + 15580 ; + 15581 ; EXIT CY = set if parse error occurred + 15582 ; + 15583 ; If parse error occurred, we're set up for Std_EPrintf call: + 15584 ; AX = system parser error code + 15585 ; DX = ptr to message block + 15586 ; + 15587 ; USED AX,BX,CX,DX,SI,DI + 15588 ; + 15589 ; EFFECTS + 15590 ; + 15591 ; Bits may contain new option settings. + 15592 ; DestBuf may contain new series of sort codes. + 15593 ; AttrSpecified, AttrSelect may contain new attribute conditions. + 15594 ; SrcBuf may contain a new default pathname/filespec. + 15595 ; PathPos, PathCnt updated for new pathname. + 15596 ; + 15597 ; If parse error occurred, we're set up for Std_EPrintf call: + 15598 ; Msg_Disp_Class = parse error class + 15599 ; Byte after last parameter in text is zeroed to make ASCIIZ string + 15600 ; Message block (see DX) is set up for parse error message + 15601 + 15602 ; 16/02/2023 + 15603 ParseCmdLine: + 15604 000012BB BE8100 mov si,81h ; SI = ptr to cmd-line tail text + 15605 000012BE E84505 call Parse_Line ; parse cmd line tail + 15606 000012C1 83F8FF cmp ax,-1 ; 0FFFFh + 15607 ;;cmp ax,END_OF_LINE + 15608 ; 25/04/2023 + 15609 ;je short pcOk ; parse completed successfully + 15610 + 15611 ; A parse error occurred. We're all set up for message output. + 15612 + 15613 ; 25/04/2023 + 15614 ; cf = 1 (ax < 0FFFFh) + 15615 ;stc ; return failure + 15616 ;jmp short pcRet 15617 ; 25/04/2023 - 15618 ;cf = 0 (ax = 0FFFFh) - 15619 ;clc ; return success - 15620 pcRet: - 15621 000012C4 C3 retn - 15622 - 15623 ; --------------------------------------------------------------------------- - 15624 - 15625 ;*** SetCollatingTable - set up character collating table for sorting - 15626 ; - 15627 ; If country is other than USA, try to get a collating table - 15628 ; for character sorting. For USA, use straight byte values. - 15629 ; This is so DIR behaves like the MS-DOS Shell, which sorts - 15630 ; by straight byte values in the USA for better performance. - 15631 ; - 15632 ; ENTRY ES = TRANGROUP seg addr - 15633 ; - 15634 ; EXIT nothing - 15635 ; - 15636 ; USED AX,BX,CX,DX,DI - 15637 ; - 15638 ; EFFECTS - 15639 ; - 15640 ; If collating table is set - - 15641 ; CountryPtrId = 6. - 15642 ; CountryPtr points to collating table. - 15643 ; - 15644 ; Otherwise - - 15645 ; CountryPtrId = 0. - 15646 - 15647 SetCollatingTable: - 15648 - 15649 ; Begin modification M028 - 15650 - 15651 ;mov dx,offset TRANGROUP:InternatVars - 15652 ; ; DS:DX = ptr to international info buffer - 15653 000012C5 BA[9EA5] mov dx,INTERNATVARS - 15654 000012C8 B80038 mov ax,3800h - 15655 ;mov ax,INTERNATIONAL << 8 - 15656 ;;mov ax,INTERNATIONAL shl 8 - 15657 ; AX = 'Get current country info' - 15658 000012CB CD21 int 21h ; call DOS - 15659 000012CD 7217 jc short scNoTable ; error - so don't collate - 15660 - 15661 ; BX = country code - 15662 - 15663 000012CF 83FB01 cmp bx,1 - 15664 000012D2 7412 je short scNoTable ; we're in USA, don't collate + 15618 ;retn + 15619 pcOk: + 15620 ; 25/04/2023 + 15621 ;cf = 0 (ax = 0FFFFh) + 15622 ;clc ; return success + 15623 pcRet: + 15624 000012C4 C3 retn + 15625 + 15626 ; --------------------------------------------------------------------------- + 15627 + 15628 ;*** SetCollatingTable - set up character collating table for sorting + 15629 ; + 15630 ; If country is other than USA, try to get a collating table + 15631 ; for character sorting. For USA, use straight byte values. + 15632 ; This is so DIR behaves like the MS-DOS Shell, which sorts + 15633 ; by straight byte values in the USA for better performance. + 15634 ; + 15635 ; ENTRY ES = TRANGROUP seg addr + 15636 ; + 15637 ; EXIT nothing + 15638 ; + 15639 ; USED AX,BX,CX,DX,DI + 15640 ; + 15641 ; EFFECTS + 15642 ; + 15643 ; If collating table is set - + 15644 ; CountryPtrId = 6. + 15645 ; CountryPtr points to collating table. + 15646 ; + 15647 ; Otherwise - + 15648 ; CountryPtrId = 0. + 15649 + 15650 SetCollatingTable: + 15651 + 15652 ; Begin modification M028 + 15653 + 15654 ;mov dx,offset TRANGROUP:InternatVars + 15655 ; ; DS:DX = ptr to international info buffer + 15656 000012C5 BA[9EA5] mov dx,INTERNATVARS + 15657 000012C8 B80038 mov ax,3800h + 15658 ;mov ax,INTERNATIONAL << 8 + 15659 ;;mov ax,INTERNATIONAL shl 8 + 15660 ; AX = 'Get current country info' + 15661 000012CB CD21 int 21h ; call DOS + 15662 000012CD 7217 jc short scNoTable ; error - so don't collate + 15663 + 15664 ; BX = country code 15665 - 15666 ; End modification M028 - 15667 - 15668 ;* Country code is other than USA. Try to get a collating table. - 15669 - 15670 000012D4 B80665 mov ax,6506h - 15671 ;mov ax,(GETEXTCNTRY << 8) + SETCOLLATE - 15672 ;;mov ax,(GETEXTCNTRY shl 8) + SETCOLLATE - 15673 ; AH = 'Get Extended Country Info' - 15674 ; AL = 'Get Pointer to Collating Table' - 15675 000012D7 BBFFFF mov bx,-1 ; BX = code page of interest = CON - 15676 000012DA B90500 mov cx,5 ; CX = length of info buffer - 15677 000012DD 89DA mov dx,bx ; DX = country ID = default - 15678 ;mov di,offset TRANGROUP:CountryPtrInfo - 15679 000012DF BF[BEA5] mov di,CountryPtrInfo - 15680 ; ES:DI = ptr to info buffer - 15681 000012E2 CD21 int 21h ; call DOS - 15682 000012E4 7305 jnc short scRet ; success - 15683 - 15684 ;* Set CountryPtrId = 0 to signal no collating table. - 15685 - 15686 scNoTable: ;M028 - 15687 000012E6 C606[BEA5]00 mov byte [CountryPtrId],0 - 15688 scRet: - 15689 000012EB C3 retn - 15690 - 15691 ; --------------------------------------------------------------------------- - 15692 - 15693 ;*** SetOptions - check and set options - 15694 ; - 15695 ; ENTRY nothing - 15696 ; - 15697 ; EXIT nothing - 15698 ; - 15699 ; USED AX,BX,CX,DX - 15700 ; - 15701 ; EFFECTS - 15702 ; - 15703 ; Bits may contain modified option settings. - 15704 ; Display_Ioctl table, including LinPerPag variable, is filled in. - 15705 ; LeftOnPage is initialized to # lines till end of page is handled. - 15706 ; PerLine is set according to /w presence. - 15707 - 15708 ; 16/02/2023 - 15709 - 15710 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 15711 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:12BEh + 15666 000012CF 83FB01 cmp bx,1 + 15667 000012D2 7412 je short scNoTable ; we're in USA, don't collate + 15668 + 15669 ; End modification M028 + 15670 + 15671 ;* Country code is other than USA. Try to get a collating table. + 15672 + 15673 000012D4 B80665 mov ax,6506h + 15674 ;mov ax,(GETEXTCNTRY << 8) + SETCOLLATE + 15675 ;;mov ax,(GETEXTCNTRY shl 8) + SETCOLLATE + 15676 ; AH = 'Get Extended Country Info' + 15677 ; AL = 'Get Pointer to Collating Table' + 15678 000012D7 BBFFFF mov bx,-1 ; BX = code page of interest = CON + 15679 000012DA B90500 mov cx,5 ; CX = length of info buffer + 15680 000012DD 89DA mov dx,bx ; DX = country ID = default + 15681 ;mov di,offset TRANGROUP:CountryPtrInfo + 15682 000012DF BF[BEA5] mov di,CountryPtrInfo + 15683 ; ES:DI = ptr to info buffer + 15684 000012E2 CD21 int 21h ; call DOS + 15685 000012E4 7305 jnc short scRet ; success + 15686 + 15687 ;* Set CountryPtrId = 0 to signal no collating table. + 15688 + 15689 scNoTable: ;M028 + 15690 000012E6 C606[BEA5]00 mov byte [CountryPtrId],0 + 15691 scRet: + 15692 000012EB C3 retn + 15693 + 15694 ; --------------------------------------------------------------------------- + 15695 + 15696 ;*** SetOptions - check and set options + 15697 ; + 15698 ; ENTRY nothing + 15699 ; + 15700 ; EXIT nothing + 15701 ; + 15702 ; USED AX,BX,CX,DX + 15703 ; + 15704 ; EFFECTS + 15705 ; + 15706 ; Bits may contain modified option settings. + 15707 ; Display_Ioctl table, including LinPerPag variable, is filled in. + 15708 ; LeftOnPage is initialized to # lines till end of page is handled. + 15709 ; PerLine is set according to /w presence. + 15710 + 15711 ; 16/02/2023 15712 - 15713 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 15714 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1335h + 15713 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 15714 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:12BEh 15715 - 15716 SetOptions: - 15717 - 15718 ; If bare listing requested, cancel wide listings. - 15719 - 15720 ;;;test Bits,mask bare - 15721 ;;test word [_Bits],8 - 15722 ;test byte [_Bits],8 - 15723 ; 07/06/2023 - 15724 000012EC F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 - 15725 ; 31/07/2024 ; mask.bare = 8 ; PCDOS 7.1 - 15726 000012F1 7405 jz short setopts1 - 15727 ;;;and Bits,not mask wide ;M007;Allow /p with /b - 15728 ;;and word [_Bits],0FFFEh - 15729 ;;and byte [_Bits],0FEh - 15730 ; 31/07/2024 - 15731 ;and word [_Bits],0FFFEh ; PCDOS 7.1 COMMAND.COM - 15732 ; 07/06/2023 - 15733 000012F3 8026[8B9D]FE and byte [_Bits],~mask.wide ; 0FDh ; MSDOS 6.0 - 15734 ; 31/07/2024 ; 0FEh ; PCDOS 7.1 - 15735 - 15736 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 15737 %if 0 - 15738 ;setopts1: ; MSDOS 5.0 COMMAND.COM - 15739 ; 07/06/2023 - 15740 ; MSDOS 6.22 COMMAND.COM - 15741 setopts0: - 15742 ;test word [_Bits],12h ; (mask bare) or (mask wide) - 15743 test byte [_Bits],(mask.bare|mask.wide) - 15744 jz short setopts1 - 15745 ;and word [_Bits],0FFFEh ; not mask cratio - 15746 and byte [_Bits],~mask.cratio - 15747 %endif - 15748 - 15749 setopts1: - 15750 ; Set # lines per display page. + 15716 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 15717 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1335h + 15718 + 15719 SetOptions: + 15720 + 15721 ; If bare listing requested, cancel wide listings. + 15722 + 15723 ;;;test Bits,mask bare + 15724 ;;test word [_Bits],8 + 15725 ;test byte [_Bits],8 + 15726 ; 07/06/2023 + 15727 000012EC F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 + 15728 ; 31/07/2024 ; mask.bare = 8 ; PCDOS 7.1 + 15729 000012F1 7405 jz short setopts1 + 15730 ;;;and Bits,not mask wide ;M007;Allow /p with /b + 15731 ;;and word [_Bits],0FFFEh + 15732 ;;and byte [_Bits],0FEh + 15733 ; 31/07/2024 + 15734 ;and word [_Bits],0FFFEh ; PCDOS 7.1 COMMAND.COM + 15735 ; 07/06/2023 + 15736 000012F3 8026[8B9D]FE and byte [_Bits],~mask.wide ; 0FDh ; MSDOS 6.0 + 15737 ; 31/07/2024 ; 0FEh ; PCDOS 7.1 + 15738 + 15739 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 15740 %if 0 + 15741 ;setopts1: ; MSDOS 5.0 COMMAND.COM + 15742 ; 07/06/2023 + 15743 ; MSDOS 6.22 COMMAND.COM + 15744 setopts0: + 15745 ;test word [_Bits],12h ; (mask bare) or (mask wide) + 15746 test byte [_Bits],(mask.bare|mask.wide) + 15747 jz short setopts1 + 15748 ;and word [_Bits],0FFFEh ; not mask cratio + 15749 and byte [_Bits],~mask.cratio + 15750 %endif 15751 - 15752 ;M01 Obtain screen height from ROM BIOS data area - 15753 ; - 15754 ;M01 mov LinPerPag,LINESPERPAGE ; default value - 15755 - 15756 000012F8 1E push ds - 15757 ;mov ax,ROMBIOS_DATA ; Get ROM Data segment - 15758 000012F9 B84000 mov ax,40h - 15759 000012FC 8ED8 mov ds,ax ; - 15760 ;Assume DS:ROMBIOS_DATA - 15761 - 15762 ;mov al,[CRT_Rows] ; [84h] ; Get max rows - 15763 000012FE A08400 mov al,[84h] - 15764 00001301 1F pop ds ; - 15765 ;Assume DS:Trangroup - 15766 - 15767 00001302 08C0 or al,al ; If zero specified - 15768 00001304 7502 jnz short setopts2 ; + 15752 setopts1: + 15753 ; Set # lines per display page. + 15754 + 15755 ;M01 Obtain screen height from ROM BIOS data area + 15756 ; + 15757 ;M01 mov LinPerPag,LINESPERPAGE ; default value + 15758 + 15759 000012F8 1E push ds + 15760 ;mov ax,ROMBIOS_DATA ; Get ROM Data segment + 15761 000012F9 B84000 mov ax,40h + 15762 000012FC 8ED8 mov ds,ax ; + 15763 ;Assume DS:ROMBIOS_DATA + 15764 + 15765 ;mov al,[CRT_Rows] ; [84h] ; Get max rows + 15766 000012FE A08400 mov al,[84h] + 15767 00001301 1F pop ds ; + 15768 ;Assume DS:Trangroup 15769 - 15770 ;mov al,LINESPERPAGE ; assume 24 rows - 15771 00001306 B019 mov al,25 ; MSDOS 5.0 COMMAND.COM (TRANGROUP:11D1h) - 15772 setopts2: - 15773 00001308 30E4 xor ah,ah - 15774 setopts3: - 15775 0000130A FEC0 inc al ; height + 1 ;M018 - 15776 - 15777 0000130C A3[179F] mov [LinPerPag],ax ; set the rows now - 15778 - 15779 ; Now the console driver can change the rows if it knows better (M01 end) - 15780 - 15781 ;mov ax,(IOCTL shl 8)+GENERIC_IOCTL_HANDLE - 15782 ; IOCTL for handles - 15783 0000130F B80C44 mov ax,440Ch - 15784 ;mov bx,STDOUT ; handle # - 15785 00001312 BB0100 mov bx,1 - 15786 ;mov ch,IOC_SC ; screen - 15787 00001315 B503 mov ch,3 - 15788 ;mov cl,get_generic ; get display info - 15789 00001317 B17F mov cl,7Fh - 15790 00001319 BA[079F] mov dx,Display_Ioctl ; info block - 15791 0000131C CD21 int 21h ; call DOS - 15792 - 15793 0000131E A1[179F] mov ax,[LinPerPag] ; AX = # lines per page - 15794 00001321 A3[1E9C] mov [LeftOnPage],ax ; initialize # lines left on page + 15770 00001302 08C0 or al,al ; If zero specified + 15771 00001304 7502 jnz short setopts2 ; + 15772 + 15773 ;mov al,LINESPERPAGE ; assume 24 rows + 15774 00001306 B019 mov al,25 ; MSDOS 5.0 COMMAND.COM (TRANGROUP:11D1h) + 15775 setopts2: + 15776 00001308 30E4 xor ah,ah + 15777 setopts3: + 15778 0000130A FEC0 inc al ; height + 1 ;M018 + 15779 + 15780 0000130C A3[179F] mov [LinPerPag],ax ; set the rows now + 15781 + 15782 ; Now the console driver can change the rows if it knows better (M01 end) + 15783 + 15784 ;mov ax,(IOCTL shl 8)+GENERIC_IOCTL_HANDLE + 15785 ; IOCTL for handles + 15786 0000130F B80C44 mov ax,440Ch + 15787 ;mov bx,STDOUT ; handle # + 15788 00001312 BB0100 mov bx,1 + 15789 ;mov ch,IOC_SC ; screen + 15790 00001315 B503 mov ch,3 + 15791 ;mov cl,get_generic ; get display info + 15792 00001317 B17F mov cl,7Fh + 15793 00001319 BA[079F] mov dx,Display_Ioctl ; info block + 15794 0000131C CD21 int 21h ; call DOS 15795 - 15796 ; Set # entries per line. - 15797 - 15798 ;mov byte [PerLine],NORMPERLIN - 15799 ; # entries per line without /w - 15800 00001324 C606[1D9C]01 mov byte [PerLine],1 - 15801 ;;;test Bits,mask wide - 15802 ;;test word [_Bits],1 - 15803 ;test byte [_Bits],1 - 15804 ; 07/06/2023 - 15805 00001329 F606[8B9D]01 test byte [_Bits],mask.wide ; 2 ; MSDOS 6.0 - 15806 ; 31/07/2024 ; 1 ; PCDOS 7.1 - 15807 0000132E 7405 jz short setopts4 - 15808 ;mov byte [PerLine],WIDEPERLIN - 15809 ; # entries per line with /w - 15810 00001330 C606[1D9C]05 mov byte [PerLine],5 - 15811 setopts4: - 15812 ;M011;start;The following code checks if a drive - 15813 ;letter has been parsed into SrcBuf, and if - 15814 ;so, the correct drive number is loaded into - 15815 ;the first FCB, at offset 5C. - 15816 - 15817 ;cmp TRANGROUP:[SrcBuf+1],COLON_CHAR ; is this a drive letter? - 15818 00001335 803E[229E]3A cmp byte [SrcBuf+1],':' - 15819 0000133A 750A jne short soRet - 15820 ;mov al,TRANGROUP:[SrcBuf] ; load drive letter into al - 15821 0000133C A0[219E] mov al,[SrcBuf] - 15822 ;and al,not 20h ; capitalize ASCII drive letter (LowerCase-32)-->UpperCase - 15823 0000133F 24DF and al,0DFh ; ~20h ; not 20h - 15824 00001341 2C40 sub al,'@' ; 40h ; convert to 1-based number (1=A) - 15825 00001343 A25C00 mov [FCB],al ; [5Ch] ; store in first FCB - 15826 ;M011;end - 15827 soRet: - 15828 00001346 C3 retn - 15829 - 15830 ; --------------------------------------------------------------------------- - 15831 - 15832 ;*** CrunchPath - analyze supplied or default pathname - 15833 ; - 15834 ; ENTRY PathPos = ptr to pathname buffer - 15835 ; PathCnt = length of pathname, not incl trailing delimiter - 15836 ; Pathname in buffer must end in delimiter (like CR) and - 15837 ; must have space for another char after the delimiter. - 15838 ; - 15839 ; EXIT CY = clear if no error - 15840 ; We are changed to directory found in pathname - 15841 ; Previous directory ready to be restored via RestUDir - 15842 ; FCB filename fields contain filename (possibly w/ wildcards) - 15843 ; - 15844 ; If error occurred, - 15845 ; CY = set - 15846 ; ComSw = error bits (see ErrorRec) - 15847 ; If ComSw not set, - 15848 ; Ready for DOS Get Extended Error call - 15849 - 15850 ; 16/02/2023 - 15851 CrunchPath: - 15852 00001347 E87802 call FileIsDevice - 15853 0000134A 7507 jne short crpath1 ; not a device, skip ahead - 15854 ;;;or ComSw,mask dev ; signal file is device - 15855 ;;or word [COMSW],1 - 15856 ;or byte [COMSW],1 - 15857 0000134C 800E[0B9C]01 or byte [COMSW],mask.dev - 15858 00001351 EB2F jmp short cpErr ; return error - 15859 crpath1: - 15860 00001353 FF36[8F9D] push word [PathPos] ; save ptr to pathname - 15861 00001357 C606[979D]FF mov byte [DirFlag],-1 - 15862 ; tell PathCrunch not to parse file into FCB - 15863 0000135C E8C316 call PathCrunch ; change to directory in pathname - 15864 0000135F C606[979D]00 mov byte [DirFlag],0 - 15865 ; reset our little flag - 15866 00001364 5E pop si ; SI = ptr to pathname - 15867 00001365 7208 jc short cpNoDir ; didn't find directory path - 15868 00001367 741A jz short cpRet ; found directory path w/ no filename - 15869 ; - leave wildcard default in FCB and return - 15870 - 15871 ;* We found a directory, and there was a filename attached. - 15872 ; DestTail = ptr to ASCIIZ filename + 15796 0000131E A1[179F] mov ax,[LinPerPag] ; AX = # lines per page + 15797 00001321 A3[1E9C] mov [LeftOnPage],ax ; initialize # lines left on page + 15798 + 15799 ; Set # entries per line. + 15800 + 15801 ;mov byte [PerLine],NORMPERLIN + 15802 ; # entries per line without /w + 15803 00001324 C606[1D9C]01 mov byte [PerLine],1 + 15804 ;;;test Bits,mask wide + 15805 ;;test word [_Bits],1 + 15806 ;test byte [_Bits],1 + 15807 ; 07/06/2023 + 15808 00001329 F606[8B9D]01 test byte [_Bits],mask.wide ; 2 ; MSDOS 6.0 + 15809 ; 31/07/2024 ; 1 ; PCDOS 7.1 + 15810 0000132E 7405 jz short setopts4 + 15811 ;mov byte [PerLine],WIDEPERLIN + 15812 ; # entries per line with /w + 15813 00001330 C606[1D9C]05 mov byte [PerLine],5 + 15814 setopts4: + 15815 ;M011;start;The following code checks if a drive + 15816 ;letter has been parsed into SrcBuf, and if + 15817 ;so, the correct drive number is loaded into + 15818 ;the first FCB, at offset 5C. + 15819 + 15820 ;cmp TRANGROUP:[SrcBuf+1],COLON_CHAR ; is this a drive letter? + 15821 00001335 803E[229E]3A cmp byte [SrcBuf+1],':' + 15822 0000133A 750A jne short soRet + 15823 ;mov al,TRANGROUP:[SrcBuf] ; load drive letter into al + 15824 0000133C A0[219E] mov al,[SrcBuf] + 15825 ;and al,not 20h ; capitalize ASCII drive letter (LowerCase-32)-->UpperCase + 15826 0000133F 24DF and al,0DFh ; ~20h ; not 20h + 15827 00001341 2C40 sub al,'@' ; 40h ; convert to 1-based number (1=A) + 15828 00001343 A25C00 mov [FCB],al ; [5Ch] ; store in first FCB + 15829 ;M011;end + 15830 soRet: + 15831 00001346 C3 retn + 15832 + 15833 ; --------------------------------------------------------------------------- + 15834 + 15835 ;*** CrunchPath - analyze supplied or default pathname + 15836 ; + 15837 ; ENTRY PathPos = ptr to pathname buffer + 15838 ; PathCnt = length of pathname, not incl trailing delimiter + 15839 ; Pathname in buffer must end in delimiter (like CR) and + 15840 ; must have space for another char after the delimiter. + 15841 ; + 15842 ; EXIT CY = clear if no error + 15843 ; We are changed to directory found in pathname + 15844 ; Previous directory ready to be restored via RestUDir + 15845 ; FCB filename fields contain filename (possibly w/ wildcards) + 15846 ; + 15847 ; If error occurred, + 15848 ; CY = set + 15849 ; ComSw = error bits (see ErrorRec) + 15850 ; If ComSw not set, + 15851 ; Ready for DOS Get Extended Error call + 15852 + 15853 ; 16/02/2023 + 15854 CrunchPath: + 15855 00001347 E87802 call FileIsDevice + 15856 0000134A 7507 jne short crpath1 ; not a device, skip ahead + 15857 ;;;or ComSw,mask dev ; signal file is device + 15858 ;;or word [COMSW],1 + 15859 ;or byte [COMSW],1 + 15860 0000134C 800E[0B9C]01 or byte [COMSW],mask.dev + 15861 00001351 EB2F jmp short cpErr ; return error + 15862 crpath1: + 15863 00001353 FF36[8F9D] push word [PathPos] ; save ptr to pathname + 15864 00001357 C606[979D]FF mov byte [DirFlag],-1 + 15865 ; tell PathCrunch not to parse file into FCB + 15866 0000135C E8C316 call PathCrunch ; change to directory in pathname + 15867 0000135F C606[979D]00 mov byte [DirFlag],0 + 15868 ; reset our little flag + 15869 00001364 5E pop si ; SI = ptr to pathname + 15870 00001365 7208 jc short cpNoDir ; didn't find directory path + 15871 00001367 741A jz short cpRet ; found directory path w/ no filename + 15872 ; - leave wildcard default in FCB and return 15873 - 15874 00001369 8B36[BB9D] mov si,[DestTail] ; SI = ptr to filename - 15875 0000136D EB28 jmp short cpFile ; go parse the file into FCB + 15874 ;* We found a directory, and there was a filename attached. + 15875 ; DestTail = ptr to ASCIIZ filename 15876 - 15877 ;* PathCrunch failed to find a directory in the pathname. - 15878 ; - 15879 ; Msg_Numb = error code - 15880 ; DestIsDir = nonzero if path delimiter char's occur in pathname - 15881 ; SI = ptr to pathname (now an ASCIIZ string) - 15882 - 15883 cpNoDir: - 15884 0000136F A1[349F] mov ax,[Msg_Numb] ; AX = error code from PathCrunch - 15885 00001372 09C0 or ax,ax - 15886 00001374 750C jnz short cpErr ; error occurred - return it - 15887 00001376 803E[B99D]00 cmp byte [DestIsDir],0 - 15888 0000137B 7407 je short cpMaybe ; no path delimiters seen, maybe it's a file - 15889 crpath3: - 15890 ;;;or ComSw,mask baddir ; signal invalid directory name - 15891 ;;or word [COMSW],2 - 15892 ;or byte [COMSW],2 - 15893 0000137D 800E[0B9C]02 or byte [COMSW],mask.baddir - 15894 ;jmp short cpErr ; return error - 15895 ; 16/02/2023 - 15896 cpErr: - 15897 00001382 F9 stc ; return error - 15898 cpRet: - 15899 00001383 C3 retn - 15900 - 15901 cpMaybe: - 15902 ; SI = ptr to pathname + 15877 00001369 8B36[BB9D] mov si,[DestTail] ; SI = ptr to filename + 15878 0000136D EB28 jmp short cpFile ; go parse the file into FCB + 15879 + 15880 ;* PathCrunch failed to find a directory in the pathname. + 15881 ; + 15882 ; Msg_Numb = error code + 15883 ; DestIsDir = nonzero if path delimiter char's occur in pathname + 15884 ; SI = ptr to pathname (now an ASCIIZ string) + 15885 + 15886 cpNoDir: + 15887 0000136F A1[349F] mov ax,[Msg_Numb] ; AX = error code from PathCrunch + 15888 00001372 09C0 or ax,ax + 15889 00001374 750C jnz short cpErr ; error occurred - return it + 15890 00001376 803E[B99D]00 cmp byte [DestIsDir],0 + 15891 0000137B 7407 je short cpMaybe ; no path delimiters seen, maybe it's a file + 15892 crpath3: + 15893 ;;;or ComSw,mask baddir ; signal invalid directory name + 15894 ;;or word [COMSW],2 + 15895 ;or byte [COMSW],2 + 15896 0000137D 800E[0B9C]02 or byte [COMSW],mask.baddir + 15897 ;jmp short cpErr ; return error + 15898 ; 16/02/2023 + 15899 cpErr: + 15900 00001382 F9 stc ; return error + 15901 cpRet: + 15902 00001383 C3 retn 15903 - 15904 ;cmp byte [si+1],COLON_CHAR - 15905 00001384 807C013A cmp byte [si+1],':' - 15906 00001388 7501 jne short crpath2 ; no drive specifier, skip ahead - 15907 0000138A AD lodsw ; SI = ptr past drive specifier "d:" - 15908 crpath2: - 15909 0000138B 813C2E2E cmp word [si],".." ; 2E2Eh - 15910 0000138F 7506 jne short cpFile ; if not "..", treat as a file - 15911 00001391 807C0200 cmp byte [si+2],0 - 15912 ;jne short cpFile ; or if there's more after "..", treat as file - 15913 ;;;;or ComSw,mask baddir ; signal invalid directory - 15914 ;;;or word [COMSW],2 - 15915 ;;or byte [COMSW],2 - 15916 ;or byte [COMSW],mask.baddir - 15917 ;jmp short cpErr ; return error - 15918 ; 16/02/2023 - 15919 00001395 74E6 je short crpath3 - 15920 - 15921 ; The preceding code was taken from the old DIR routine. - 15922 ; It's garbage, I'm afraid. It's meant to check for ".." - 15923 ; occurring when we're at the root directory. Too bad it - 15924 ; doesn't handle problems with "..\..", etc. - 15925 - 15926 ; We're ready to parse a filename into the FCB. - 15927 ; SI = ptr to ASCIIZ filename + 15904 cpMaybe: + 15905 ; SI = ptr to pathname + 15906 + 15907 ;cmp byte [si+1],COLON_CHAR + 15908 00001384 807C013A cmp byte [si+1],':' + 15909 00001388 7501 jne short crpath2 ; no drive specifier, skip ahead + 15910 0000138A AD lodsw ; SI = ptr past drive specifier "d:" + 15911 crpath2: + 15912 0000138B 813C2E2E cmp word [si],".." ; 2E2Eh + 15913 0000138F 7506 jne short cpFile ; if not "..", treat as a file + 15914 00001391 807C0200 cmp byte [si+2],0 + 15915 ;jne short cpFile ; or if there's more after "..", treat as file + 15916 ;;;;or ComSw,mask baddir ; signal invalid directory + 15917 ;;;or word [COMSW],2 + 15918 ;;or byte [COMSW],2 + 15919 ;or byte [COMSW],mask.baddir + 15920 ;jmp short cpErr ; return error + 15921 ; 16/02/2023 + 15922 00001395 74E6 je short crpath3 + 15923 + 15924 ; The preceding code was taken from the old DIR routine. + 15925 ; It's garbage, I'm afraid. It's meant to check for ".." + 15926 ; occurring when we're at the root directory. Too bad it + 15927 ; doesn't handle problems with "..\..", etc. 15928 - 15929 cpFile: - 15930 00001397 BF5C00 mov di,FCB ; 5Ch ; DI = ptr to FCB - 15931 0000139A B80E29 mov ax,290Eh - 15932 ;mov ax,(Parse_File_Descriptor<<8)|0Eh - 15933 ;;mov ax,(Parse_File_Descriptor shl 8) or 0Eh - 15934 ; wildcards already in FCB used as defaults - 15935 0000139D CD21 int 21h - 15936 0000139F F8 clc ; return success - 15937 ;jmp short cpRet - 15938 ; 16/02/2023 - 15939 000013A0 C3 retn - 15940 - 15941 ;cpErr: - 15942 ; stc ; return error - 15943 ;cpRet: - 15944 ; retn - 15945 - 15946 ; --------------------------------------------------------------------------- - 15947 - 15948 ;*** InstallCtrlC - install our private control-C handler - 15949 ; - 15950 ; Put our control-c handler in front of command.com's default - 15951 ; handler, to make sure the user's default directory gets restored. - 15952 ; This shouldn't be necessary, but, for now, there are situations - 15953 ; where the TDATA segment is left in a modified state when a - 15954 ; control-c occurs. This means that the transient will be - 15955 ; reloaded, and the user's directory cannot be restored. - 15956 ; - 15957 ; Bugbug: fix the wider problem? Involves message services. Ugly. - 15958 ; - 15959 ; ENTRY nothing - 15960 ; - 15961 ; EXIT nothing - 15962 ; - 15963 ; USED AX,BX,DX - 15964 ; - 15965 ; EFFECTS - 15966 ; - 15967 ; CtrlCHandler address placed in int 23 vector. - 15968 ; - 15969 ; NOTE - 15970 ; - 15971 ; Command.com's basic control-c handler will be restored - 15972 ; to the int 23 vector by the HeadFix routine, after DIR finishes. - 15973 - 15974 ; 16/02/2023 - 15975 InstallCtrlC: - 15976 000013A1 06 push es ; preserve ES - 15977 000013A2 B82335 mov ax,3523h - 15978 ;mov ax,(GET_INTERRUPT_VECTOR<<8)+23h - 15979 ;;mov ax,(GET_INTERRUPT_VECTOR shl 8) + 23h - 15980 000013A5 CD21 int 21h - 15981 000013A7 891E[C3A5] mov [OldCtrlCHandler],bx ; save old int 23 vector - 15982 000013AB 8C06[C5A5] mov [OldCtrlCHandler+2],es - 15983 000013AF 07 pop es ; restore ES - 15984 - 15985 000013B0 BA[C61C] mov dx,CtrlCHandler ; DS:DX = ptr to CtrlCHandler - 15986 000013B3 B82325 mov ax,2523h - 15987 ;mov ax,(SET_INTERRUPT_VECTOR<<8)+23h - 15988 ;;mov ax,(SET_INTERRUPT_VECTOR shl 8) + 23h - 15989 000013B6 CD21 int 21h - 15990 000013B8 C3 retn - 15991 - 15992 ; --------------------------------------------------------------------------- - 15993 - 15994 ;*** ListSubds - search and list files in subdirectories - 15995 ; - 15996 ; ENTRY Current directory (on selected drive) is top of subdir tree - 15997 ; FCB is still set up for file searches - 15998 ; Bits, AttrSpecified, AttrSelect, DestBuf all still set up - 15999 ; - 16000 ; EXIT CY = clear if no error - 16001 ; FileCnt = # files found & displayed - 16002 ; FileSiz = total size of files found - 16003 ; - 16004 ; If error, - 16005 ; CY = set - 16006 ; Ready for DOS Get Extended Error call - 16007 ; - 16008 ; USED AX,BX,CX,DX,SI,DI,BP - 16009 ; - 16010 ; EFFECTS - 16011 ; - 16012 ; FileCntTotal, FileSizTotal are updated. - 16013 ; Subdirectories may be listed on standard output device. + 15929 ; We're ready to parse a filename into the FCB. + 15930 ; SI = ptr to ASCIIZ filename + 15931 + 15932 cpFile: + 15933 00001397 BF5C00 mov di,FCB ; 5Ch ; DI = ptr to FCB + 15934 0000139A B80E29 mov ax,290Eh + 15935 ;mov ax,(Parse_File_Descriptor<<8)|0Eh + 15936 ;;mov ax,(Parse_File_Descriptor shl 8) or 0Eh + 15937 ; wildcards already in FCB used as defaults + 15938 0000139D CD21 int 21h + 15939 0000139F F8 clc ; return success + 15940 ;jmp short cpRet + 15941 ; 16/02/2023 + 15942 000013A0 C3 retn + 15943 + 15944 ;cpErr: + 15945 ; stc ; return error + 15946 ;cpRet: + 15947 ; retn + 15948 + 15949 ; --------------------------------------------------------------------------- + 15950 + 15951 ;*** InstallCtrlC - install our private control-C handler + 15952 ; + 15953 ; Put our control-c handler in front of command.com's default + 15954 ; handler, to make sure the user's default directory gets restored. + 15955 ; This shouldn't be necessary, but, for now, there are situations + 15956 ; where the TDATA segment is left in a modified state when a + 15957 ; control-c occurs. This means that the transient will be + 15958 ; reloaded, and the user's directory cannot be restored. + 15959 ; + 15960 ; Bugbug: fix the wider problem? Involves message services. Ugly. + 15961 ; + 15962 ; ENTRY nothing + 15963 ; + 15964 ; EXIT nothing + 15965 ; + 15966 ; USED AX,BX,DX + 15967 ; + 15968 ; EFFECTS + 15969 ; + 15970 ; CtrlCHandler address placed in int 23 vector. + 15971 ; + 15972 ; NOTE + 15973 ; + 15974 ; Command.com's basic control-c handler will be restored + 15975 ; to the int 23 vector by the HeadFix routine, after DIR finishes. + 15976 + 15977 ; 16/02/2023 + 15978 InstallCtrlC: + 15979 000013A1 06 push es ; preserve ES + 15980 000013A2 B82335 mov ax,3523h + 15981 ;mov ax,(GET_INTERRUPT_VECTOR<<8)+23h + 15982 ;;mov ax,(GET_INTERRUPT_VECTOR shl 8) + 23h + 15983 000013A5 CD21 int 21h + 15984 000013A7 891E[C3A5] mov [OldCtrlCHandler],bx ; save old int 23 vector + 15985 000013AB 8C06[C5A5] mov [OldCtrlCHandler+2],es + 15986 000013AF 07 pop es ; restore ES + 15987 + 15988 000013B0 BA[C61C] mov dx,CtrlCHandler ; DS:DX = ptr to CtrlCHandler + 15989 000013B3 B82325 mov ax,2523h + 15990 ;mov ax,(SET_INTERRUPT_VECTOR<<8)+23h + 15991 ;;mov ax,(SET_INTERRUPT_VECTOR shl 8) + 23h + 15992 000013B6 CD21 int 21h + 15993 000013B8 C3 retn + 15994 + 15995 ; --------------------------------------------------------------------------- + 15996 + 15997 ;*** ListSubds - search and list files in subdirectories + 15998 ; + 15999 ; ENTRY Current directory (on selected drive) is top of subdir tree + 16000 ; FCB is still set up for file searches + 16001 ; Bits, AttrSpecified, AttrSelect, DestBuf all still set up + 16002 ; + 16003 ; EXIT CY = clear if no error + 16004 ; FileCnt = # files found & displayed + 16005 ; FileSiz = total size of files found + 16006 ; + 16007 ; If error, + 16008 ; CY = set + 16009 ; Ready for DOS Get Extended Error call + 16010 ; + 16011 ; USED AX,BX,CX,DX,SI,DI,BP + 16012 ; + 16013 ; EFFECTS 16014 ; - 16015 ; NOTES - 16016 ; - 16017 ; ListSubds seeds the recursive entry point lsNode with a ptr - 16018 ; to a buffer where we'll stack up subdirectory filenames. - 16019 ; Each name is stored ASCIIZ. - 16020 - 16021 ; 16/02/2023 - 16022 ListSubds: - 16023 ;invoke SetRest1 ; make sure user's dir gets restored - 16024 000013B9 E8581D call SetRest1 - 16025 - 16026 000013BC BB[7B9E] mov bx,ScanBuf ; BX = ptr to child name buffer - 16027 lsNode: - 16028 000013BF C60700 mov byte [bx],0 ; start with null child name - 16029 lsLoop: - 16030 000013C2 E88702 call FindNextChild ; search for next subdirectory - 16031 000013C5 7235 jc short lsErr ; search failed - examine error - 16032 - 16033 000013C7 89DA mov dx,bx ; DX = ptr to child's name - 16034 000013C9 E8ED04 call ChangeDir ; enter child directory + 16015 ; FileCntTotal, FileSizTotal are updated. + 16016 ; Subdirectories may be listed on standard output device. + 16017 ; + 16018 ; NOTES + 16019 ; + 16020 ; ListSubds seeds the recursive entry point lsNode with a ptr + 16021 ; to a buffer where we'll stack up subdirectory filenames. + 16022 ; Each name is stored ASCIIZ. + 16023 + 16024 ; 16/02/2023 + 16025 ListSubds: + 16026 ;invoke SetRest1 ; make sure user's dir gets restored + 16027 000013B9 E8581D call SetRest1 + 16028 + 16029 000013BC BB[7B9E] mov bx,ScanBuf ; BX = ptr to child name buffer + 16030 lsNode: + 16031 000013BF C60700 mov byte [bx],0 ; start with null child name + 16032 lsLoop: + 16033 000013C2 E88702 call FindNextChild ; search for next subdirectory + 16034 000013C5 7235 jc short lsErr ; search failed - examine error 16035 - 16036 ; M023;start - 16037 000013CC 7306 jnc short lstsd1 ; check for error - 16038 ;cmp ax,3 - 16039 000013CE 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; error due to len(pathname)>MAXPATH? - 16040 000013D1 74EF je short lsLoop ; yes, skip over this subdirectory - 16041 ;jmp short lsRet ; no, other error: DIR must fail - 16042 ; 16/02/2023 ; M023;end - 16043 000013D3 C3 retn - 16044 lstsd1: - 16045 000013D4 53 push bx - 16046 000013D5 E82203 call ListDir ; list the directory - 16047 000013D8 5B pop bx - 16048 - 16049 ; Note we're ignoring errors returned here. - 16050 - 16051 000013D9 89DF mov di,bx ; DI = ptr to child's name - 16052 000013DB B90D00 mov cx,13 ; CX = max name length w/ null - 16053 000013DE 30C0 xor al,al ; AL = zero byte to look for - 16054 000013E0 F2AE repne scasb ; DI = ptr to next name pos'n in buf - 16055 000013E2 53 push bx ; save ptr to child's name - 16056 000013E3 89FB mov bx,di ; BX = ptr to next name pos'n in buf - 16057 000013E5 E8D7FF call lsNode ; recurse from new node - 16058 000013E8 5B pop bx ; BX = ptr to child's name - 16059 000013E9 9C pushf ; save error condition - 16060 - 16061 ;;shove 0 - 16062 ;mov ax,0 - 16063 000013EA 29C0 sub ax,ax ; 0 - 16064 000013EC 50 push ax - 16065 ;shove ".." - 16066 000013ED B82E2E mov ax,'..' ; 2E2Eh - 16067 000013F0 50 push ax - 16068 000013F1 89E2 mov dx,sp ; DX = ptr to "..",0 on stack - 16069 000013F3 E8C304 call ChangeDir ; return to parent directory - 16070 000013F6 58 pop ax ; restore stack - 16071 000013F7 58 pop ax - 16072 - 16073 000013F8 9D popf ; restore error condition from child - 16074 ;jc short lsRet ; return error - 16075 ;jmp short lsLoop ; look for more children - 16076 ; 16/02/2023 - 16077 000013F9 73C7 jnc short lsLoop - 16078 000013FB C3 retn - 16079 lsErr: - 16080 000013FC E84C0C call get_ext_error_number ; AX = extended error code - 16081 ;cmp ax,2 - 16082 000013FF 83F802 cmp ax,ERROR_FILE_NOT_FOUND - 16083 00001402 7406 je short lsRet ; file not found, we're ok - 16084 ;cmp ax,18 - 16085 00001404 83F812 cmp ax,ERROR_NO_MORE_FILES - 16086 00001407 7401 je short lsRet ; no more files, we're ok - 16087 00001409 F9 stc ; return other errors - 16088 lsRet: - 16089 0000140A C3 retn - 16090 - 16091 ; --------------------------------------------------------------------------- - 16092 - 16093 ;break - 16094 - 16095 ;*** SUPPORT ROUTINES - 16096 - 16097 ; ---------------------- - 16098 - 16099 ;*** CheckChild - check potential subdirectory name for FindNextChild - 16100 ; - 16101 ; ENTRY DirBuf contains DOS Find-buffer with potential child - 16102 ; BX = ptr to last child's name - 16103 ; BP = ptr to temp child's name - 16104 ; - 16105 ; EXIT nothing - 16106 ; - 16107 ; USED AX,CX,SI,DI - 16108 ; - 16109 ; EFFECTS - 16110 ; - 16111 ; Filename pointed to by BP may be changed. - 16112 ; - 16113 ; NOTES - 16114 ; - 16115 ; Potential filename replaces temp filename if: - 16116 ; it's a subdirectory file; - 16117 ; it doesn't start with a '.'; - 16118 ; it's alphanumerically greater than last child's name; - 16119 ; and it's alphanumerically less than temp name. - 16120 - 16121 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM - 16122 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 16123 CheckChild: - 16124 ;test DirBuf.find_buf_attr,ATTR_DIRECTORY - 16125 0000140B F606[4E9D]10 test byte [DIRBUF+FIND_BUF.ATTR],ATTR_DIRECTORY ; 10h - 16126 00001410 741D jz short ccRet ; not a subdirectory file- return - 16127 - 16128 ; 16/02/2023 - 16129 00001412 BE[579D] mov si,DIRBUF+FIND_BUF.PNAME - 16130 00001415 803C2E cmp byte [si],'.' - 16131 ;;cmp DirBuf.find_buf_pname,'.' - 16132 ;cmp byte [DIRBUF+FIND_BUF.PNAME],'.' - 16133 00001418 7415 je short ccRet ; starts with a dot- return - 16134 - 16135 ;;mov si,offset TRANGROUP:DirBuf+find_buf_pname - 16136 ;mov si,DIRBUF+FIND_BUF.PNAME - 16137 0000141A 89DF mov di,bx - 16138 0000141C E8B104 call CmpAscz ; compare candidate to last child's name - 16139 0000141F 760E jna short ccRet ; it's not above it- return - 16140 - 16141 ; 07/06/2023 - 16142 ;;mov si,offset TRANGROUP:DirBuf+find_buf_pname - 16143 ;mov si,DIRBUF+FIND_BUF.PNAME - 16144 ; si = DIRBUF+FIND_BUF.PNAME - 16145 00001421 89EF mov di,bp - 16146 00001423 E8AA04 call CmpAscz ; compare candidate to temp name - 16147 00001426 7307 jnb short ccRet ; it's not below it- return - 16148 - 16149 ; New kid is alright. Copy to temp. - 16150 - 16151 ; 07/06/2023 - 16152 ;;mov si,offset TRANGROUP:DirBuf+find_buf_pname - 16153 ;mov si,DIRBUF+FIND_BUF.PNAME - 16154 ; si = DIRBUF+FIND_BUF.PNAME - 16155 00001428 89EF mov di,bp - 16156 0000142A B90D00 mov cx,13 - 16157 0000142D F3A4 rep movsb - 16158 ccRet: - 16159 0000142F C3 retn - 16160 - 16161 ; --------------------------------------------------------------------------- - 16162 - 16163 ;*** CmpEntry - compare one directory entry to another in sort order - 16164 ; - 16165 ; Compare one directory entry against another according to - 16166 ; the sort codes in DestBuf. One or more comparisons - 16167 ; may be made of file name, extension, time/date, and - 16168 ; size. Comparisons may be made for upward or downward - 16169 ; sort order. - 16170 ; - 16171 ; ENTRY ES:BX = ptr to entry to compare - 16172 ; ES:BP = ptr to entry to be compared against - 16173 ; DestBuf contains sort codes (see DestBuf) - 16174 ; DS = TRANGROUP seg addr - 16175 ; - 16176 ; EXIT BX = unchanged - 16177 ; BP = unchanged - 16178 ; Condition flags set for same, above, or below - 16179 ; comparing BX entry against BP entry. - 16180 ; 'Same, above, below' translate to 'same, after, before'. - 16181 ; - 16182 ; USED: AX,CX,DX,SI,DI - 16183 - 16184 ; 16/02/2023 - 16185 CmpEntry: - 16186 00001430 BE[BE9D] mov si,DestBuf ; (DS:SI) = ptr to sort codes - 16187 ceLoop: - 16188 00001433 31C0 xor ax,ax ; AX = 0 - 16189 00001435 8A04 mov al,[si] ; AL = sort code - 16190 00001437 08C0 or al,al - 16191 00001439 741C jz short ceDone ; sort code is zero, we're done - 16192 0000143B 46 inc si ; DS:SI = ptr to next sort code - 16193 0000143C 56 push si ; save ptr to next sort code - 16194 0000143D FEC8 dec al - 16195 0000143F D0E0 shl al,1 - 16196 ;sal al,1 ; AX = index into cmp call table - 16197 ; CY set for downward sort order - 16198 00001441 89C6 mov si,ax ; SI = index into cmp call table - 16199 00001443 2E8B84[5814] mov ax,[cs:si+FieldCmps] - 16200 ; AX = addr of compare routine - 16201 00001448 7204 jc short ceDn ; downwards sort - go swap entries - 16202 0000144A FFD0 call ax ; do upwards sort - 16203 0000144C EB06 jmp short ceNs - 16204 ceDn: - 16205 0000144E 87DD xchg bx,bp ; swap entry ptrs for downward sort order - 16206 00001450 FFD0 call ax ; do sort - 16207 00001452 87DD xchg bx,bp ; swap ptrs back - 16208 ceNs: - 16209 00001454 5E pop si ; SI = ptr to next sort code - 16210 00001455 74DC je short ceLoop ; compare showed no difference, keep trying - 16211 ceDone: - 16212 - 16213 ; Get here either from unequal compare or sort code = 0. - 16214 ; In the latter case, condition codes indicate equality, - 16215 ; which is correct. - 16216 - 16217 00001457 C3 retn - 16218 - 16219 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM - 16220 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:1339h) + 16036 000013C7 89DA mov dx,bx ; DX = ptr to child's name + 16037 000013C9 E8ED04 call ChangeDir ; enter child directory + 16038 + 16039 ; M023;start + 16040 000013CC 7306 jnc short lstsd1 ; check for error + 16041 ;cmp ax,3 + 16042 000013CE 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; error due to len(pathname)>MAXPATH? + 16043 000013D1 74EF je short lsLoop ; yes, skip over this subdirectory + 16044 ;jmp short lsRet ; no, other error: DIR must fail + 16045 ; 16/02/2023 ; M023;end + 16046 000013D3 C3 retn + 16047 lstsd1: + 16048 000013D4 53 push bx + 16049 000013D5 E82203 call ListDir ; list the directory + 16050 000013D8 5B pop bx + 16051 + 16052 ; Note we're ignoring errors returned here. + 16053 + 16054 000013D9 89DF mov di,bx ; DI = ptr to child's name + 16055 000013DB B90D00 mov cx,13 ; CX = max name length w/ null + 16056 000013DE 30C0 xor al,al ; AL = zero byte to look for + 16057 000013E0 F2AE repne scasb ; DI = ptr to next name pos'n in buf + 16058 000013E2 53 push bx ; save ptr to child's name + 16059 000013E3 89FB mov bx,di ; BX = ptr to next name pos'n in buf + 16060 000013E5 E8D7FF call lsNode ; recurse from new node + 16061 000013E8 5B pop bx ; BX = ptr to child's name + 16062 000013E9 9C pushf ; save error condition + 16063 + 16064 ;;shove 0 + 16065 ;mov ax,0 + 16066 000013EA 29C0 sub ax,ax ; 0 + 16067 000013EC 50 push ax + 16068 ;shove ".." + 16069 000013ED B82E2E mov ax,'..' ; 2E2Eh + 16070 000013F0 50 push ax + 16071 000013F1 89E2 mov dx,sp ; DX = ptr to "..",0 on stack + 16072 000013F3 E8C304 call ChangeDir ; return to parent directory + 16073 000013F6 58 pop ax ; restore stack + 16074 000013F7 58 pop ax + 16075 + 16076 000013F8 9D popf ; restore error condition from child + 16077 ;jc short lsRet ; return error + 16078 ;jmp short lsLoop ; look for more children + 16079 ; 16/02/2023 + 16080 000013F9 73C7 jnc short lsLoop + 16081 000013FB C3 retn + 16082 lsErr: + 16083 000013FC E84C0C call get_ext_error_number ; AX = extended error code + 16084 ;cmp ax,2 + 16085 000013FF 83F802 cmp ax,ERROR_FILE_NOT_FOUND + 16086 00001402 7406 je short lsRet ; file not found, we're ok + 16087 ;cmp ax,18 + 16088 00001404 83F812 cmp ax,ERROR_NO_MORE_FILES + 16089 00001407 7401 je short lsRet ; no more files, we're ok + 16090 00001409 F9 stc ; return other errors + 16091 lsRet: + 16092 0000140A C3 retn + 16093 + 16094 ; --------------------------------------------------------------------------- + 16095 + 16096 ;break + 16097 + 16098 ;*** SUPPORT ROUTINES + 16099 + 16100 ; ---------------------- + 16101 + 16102 ;*** CheckChild - check potential subdirectory name for FindNextChild + 16103 ; + 16104 ; ENTRY DirBuf contains DOS Find-buffer with potential child + 16105 ; BX = ptr to last child's name + 16106 ; BP = ptr to temp child's name + 16107 ; + 16108 ; EXIT nothing + 16109 ; + 16110 ; USED AX,CX,SI,DI + 16111 ; + 16112 ; EFFECTS + 16113 ; + 16114 ; Filename pointed to by BP may be changed. + 16115 ; + 16116 ; NOTES + 16117 ; + 16118 ; Potential filename replaces temp filename if: + 16119 ; it's a subdirectory file; + 16120 ; it doesn't start with a '.'; + 16121 ; it's alphanumerically greater than last child's name; + 16122 ; and it's alphanumerically less than temp name. + 16123 + 16124 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM + 16125 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 16126 CheckChild: + 16127 ;test DirBuf.find_buf_attr,ATTR_DIRECTORY + 16128 0000140B F606[4E9D]10 test byte [DIRBUF+FIND_BUF.ATTR],ATTR_DIRECTORY ; 10h + 16129 00001410 741D jz short ccRet ; not a subdirectory file- return + 16130 + 16131 ; 16/02/2023 + 16132 00001412 BE[579D] mov si,DIRBUF+FIND_BUF.PNAME + 16133 00001415 803C2E cmp byte [si],'.' + 16134 ;;cmp DirBuf.find_buf_pname,'.' + 16135 ;cmp byte [DIRBUF+FIND_BUF.PNAME],'.' + 16136 00001418 7415 je short ccRet ; starts with a dot- return + 16137 + 16138 ;;mov si,offset TRANGROUP:DirBuf+find_buf_pname + 16139 ;mov si,DIRBUF+FIND_BUF.PNAME + 16140 0000141A 89DF mov di,bx + 16141 0000141C E8B104 call CmpAscz ; compare candidate to last child's name + 16142 0000141F 760E jna short ccRet ; it's not above it- return + 16143 + 16144 ; 07/06/2023 + 16145 ;;mov si,offset TRANGROUP:DirBuf+find_buf_pname + 16146 ;mov si,DIRBUF+FIND_BUF.PNAME + 16147 ; si = DIRBUF+FIND_BUF.PNAME + 16148 00001421 89EF mov di,bp + 16149 00001423 E8AA04 call CmpAscz ; compare candidate to temp name + 16150 00001426 7307 jnb short ccRet ; it's not below it- return + 16151 + 16152 ; New kid is alright. Copy to temp. + 16153 + 16154 ; 07/06/2023 + 16155 ;;mov si,offset TRANGROUP:DirBuf+find_buf_pname + 16156 ;mov si,DIRBUF+FIND_BUF.PNAME + 16157 ; si = DIRBUF+FIND_BUF.PNAME + 16158 00001428 89EF mov di,bp + 16159 0000142A B90D00 mov cx,13 + 16160 0000142D F3A4 rep movsb + 16161 ccRet: + 16162 0000142F C3 retn + 16163 + 16164 ; --------------------------------------------------------------------------- + 16165 + 16166 ;*** CmpEntry - compare one directory entry to another in sort order + 16167 ; + 16168 ; Compare one directory entry against another according to + 16169 ; the sort codes in DestBuf. One or more comparisons + 16170 ; may be made of file name, extension, time/date, and + 16171 ; size. Comparisons may be made for upward or downward + 16172 ; sort order. + 16173 ; + 16174 ; ENTRY ES:BX = ptr to entry to compare + 16175 ; ES:BP = ptr to entry to be compared against + 16176 ; DestBuf contains sort codes (see DestBuf) + 16177 ; DS = TRANGROUP seg addr + 16178 ; + 16179 ; EXIT BX = unchanged + 16180 ; BP = unchanged + 16181 ; Condition flags set for same, above, or below + 16182 ; comparing BX entry against BP entry. + 16183 ; 'Same, above, below' translate to 'same, after, before'. + 16184 ; + 16185 ; USED: AX,CX,DX,SI,DI + 16186 + 16187 ; 16/02/2023 + 16188 CmpEntry: + 16189 00001430 BE[BE9D] mov si,DestBuf ; (DS:SI) = ptr to sort codes + 16190 ceLoop: + 16191 00001433 31C0 xor ax,ax ; AX = 0 + 16192 00001435 8A04 mov al,[si] ; AL = sort code + 16193 00001437 08C0 or al,al + 16194 00001439 741C jz short ceDone ; sort code is zero, we're done + 16195 0000143B 46 inc si ; DS:SI = ptr to next sort code + 16196 0000143C 56 push si ; save ptr to next sort code + 16197 0000143D FEC8 dec al + 16198 0000143F D0E0 shl al,1 + 16199 ;sal al,1 ; AX = index into cmp call table + 16200 ; CY set for downward sort order + 16201 00001441 89C6 mov si,ax ; SI = index into cmp call table + 16202 00001443 2E8B84[5814] mov ax,[cs:si+FieldCmps] + 16203 ; AX = addr of compare routine + 16204 00001448 7204 jc short ceDn ; downwards sort - go swap entries + 16205 0000144A FFD0 call ax ; do upwards sort + 16206 0000144C EB06 jmp short ceNs + 16207 ceDn: + 16208 0000144E 87DD xchg bx,bp ; swap entry ptrs for downward sort order + 16209 00001450 FFD0 call ax ; do sort + 16210 00001452 87DD xchg bx,bp ; swap ptrs back + 16211 ceNs: + 16212 00001454 5E pop si ; SI = ptr to next sort code + 16213 00001455 74DC je short ceLoop ; compare showed no difference, keep trying + 16214 ceDone: + 16215 + 16216 ; Get here either from unequal compare or sort code = 0. + 16217 ; In the latter case, condition codes indicate equality, + 16218 ; which is correct. + 16219 + 16220 00001457 C3 retn 16221 - 16222 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 16223 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:144Eh) + 16222 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM + 16223 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:1339h) 16224 - 16225 FieldCmps: ; call table of entry comparisons - 16226 00001458 [6214] dw CmpName - 16227 0000145A [6D14] dw CmpExt - 16228 0000145C [BE14] dw CmpTime - 16229 0000145E [DA14] dw CmpSize - 16230 00001460 [DF14] dw CmpType - 16231 - 16232 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 16233 %if 0 - 16234 ; 05/06/2023 - Retro DOS 4.2 COMMAND.COM - 16235 dw CmpCratio - 16236 %endif - 16237 - 16238 ; --------------------------------------------------------------------------- - 16239 - 16240 ;*** CmpName - compare file name of two entries - 16241 ;*** CmpExt - compare extension of two entries - 16242 ; - 16243 ; ENTRY ES:BX = ptr to one entry - 16244 ; ES:BP = ptr to another entry + 16225 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 16226 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:144Eh) + 16227 + 16228 FieldCmps: ; call table of entry comparisons + 16229 00001458 [6214] dw CmpName + 16230 0000145A [6D14] dw CmpExt + 16231 0000145C [BE14] dw CmpTime + 16232 0000145E [DA14] dw CmpSize + 16233 00001460 [DF14] dw CmpType + 16234 + 16235 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 16236 %if 0 + 16237 ; 05/06/2023 - Retro DOS 4.2 COMMAND.COM + 16238 dw CmpCratio + 16239 %endif + 16240 + 16241 ; --------------------------------------------------------------------------- + 16242 + 16243 ;*** CmpName - compare file name of two entries + 16244 ;*** CmpExt - compare extension of two entries 16245 ; - 16246 ; EXIT BX = unchanged - 16247 ; BP = unchanged - 16248 ; Condition flags set for same, above, or below - 16249 ; comparing BX entry to BP entry. - 16250 ; - 16251 ; USED: AX,CX,DX,SI,DI - 16252 - 16253 ; 16/02/2023 - 16254 CmpName: - 16255 00001462 89DE mov si,bx ; ES:SI = ptr to BX entry - 16256 00001464 89EF mov di,bp ; ES:DI = ptr to BP entry - 16257 ;;add si,filename ; ES:SI = ptr to BX name - 16258 ;add si,1 - 16259 ; 25/04/2023 - 16260 00001466 46 inc si - 16261 ;;add di,filename ; ES:DI = ptr to BP name - 16262 ;add di,1 - 16263 ; 25/04/2023 - 16264 00001467 47 inc di - 16265 ;mov cx,size filename - 16266 ; CX = length of name - 16267 00001468 B90800 mov cx,8 - 16268 0000146B EB0C jmp short CmpStr - 16269 - 16270 CmpExt: - 16271 ; 07/06/2023 - 16272 ;mov si,bx ; ES:SI = ptr to BX entry - 16273 ;mov di,bp ; ES:DI = ptr to BP entry - 16274 ;;add si,fileext ; ES:SI = ptr to BX extension - 16275 ;add si,9 - 16276 ;;add di,fileext ; ES:DI = ptr to BP extension - 16277 ;add di,9 - 16278 ; - 16279 0000146D BE0900 mov si,9 - 16280 00001470 89F7 mov di,si ; mov di,9 - 16281 00001472 01DE add si,bx - 16282 00001474 01EF add di,bp - 16283 ; - 16284 ;mov cx,size fileext ; CX = length of extension field - 16285 00001476 B90300 mov cx,3 - 16286 - 16287 ; Bugbug: use symbol for subfunction code. - 16288 - 16289 CmpStr: - 16290 00001479 803E[BEA5]06 cmp byte [CountryPtrId],6 - 16291 0000147E 753A jne short cnNoCollTable - 16292 ; no collating table available - 16293 - 16294 ;* Compare strings using collating table. - 16295 ; - 16296 ; ES:SI = ptr to 1st string - 16297 ; ES:DI = ptr to 2nd string - 16298 ; CX = length - 16299 - 16300 00001480 55 push bp ; preserve BP - 16301 00001481 53 push bx ; preserve BX - 16302 00001482 1E push ds ; preserve DS - 16303 00001483 C51E[BFA5] lds bx,[CountryPtr] ; DS:BX = ptr to collating table - 16304 ;assume ds:NOTHING - 16305 00001487 8B2F mov bp,[bx] ; BP = size of collating table - 16306 00001489 43 inc bx - 16307 0000148A 43 inc bx ; DS:BX = ptr to collating values - 16308 ; DS:[BX]-2 = size of table - 16309 0000148B 31C0 xor ax,ax ; AX = 0 for starters - 16310 - 16311 ; Bugbug: Investigate removing collating table length checks. - 16312 - 16313 cnNextChar: - 16314 0000148D 268A05 mov al,[es:di] ; AL = AX = char from 2nd string - 16315 00001490 47 inc di ; ES:DI = ptr to next char 2nd string - 16316 - 16317 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 16318 %if 0 - 16319 cmp ax,bp ; compare to collating table length - 16320 jae short cn1 ; char not in table - 16321 xlat - 16322 cn1: ; AL = AX = collating value - 16323 mov dx,ax ; DX = collating value from 2nd string - 16324 ;lods byte ptr es:[si] - 16325 es lodsb ; AL = AX = char from 1st string - 16326 ; ES:SI = ptr to next char 1st string - 16327 cmp ax,bp ; compare to collating table length - 16328 jae short cn2 ; char not in table - 16329 xlat - 16330 cn2: ; AL = AX = collating value - 16331 cmp ax,dx ; compare collating values - 16332 loope cnNextChar ; until unequal or no more left - 16333 - 16334 pop ds ; restore DS - 16335 ;assume ds:TRANGROUP - 16336 pop bx ; restore BX - 16337 pop bp ; restore BP - 16338 retn - 16339 - 16340 ;* If no collating table is available, simply compare raw ASCII values. - 16341 ; Don't we wish we could just do this all the time? Sigh. + 16246 ; ENTRY ES:BX = ptr to one entry + 16247 ; ES:BP = ptr to another entry + 16248 ; + 16249 ; EXIT BX = unchanged + 16250 ; BP = unchanged + 16251 ; Condition flags set for same, above, or below + 16252 ; comparing BX entry to BP entry. + 16253 ; + 16254 ; USED: AX,CX,DX,SI,DI + 16255 + 16256 ; 16/02/2023 + 16257 CmpName: + 16258 00001462 89DE mov si,bx ; ES:SI = ptr to BX entry + 16259 00001464 89EF mov di,bp ; ES:DI = ptr to BP entry + 16260 ;;add si,filename ; ES:SI = ptr to BX name + 16261 ;add si,1 + 16262 ; 25/04/2023 + 16263 00001466 46 inc si + 16264 ;;add di,filename ; ES:DI = ptr to BP name + 16265 ;add di,1 + 16266 ; 25/04/2023 + 16267 00001467 47 inc di + 16268 ;mov cx,size filename + 16269 ; CX = length of name + 16270 00001468 B90800 mov cx,8 + 16271 0000146B EB0C jmp short CmpStr + 16272 + 16273 CmpExt: + 16274 ; 07/06/2023 + 16275 ;mov si,bx ; ES:SI = ptr to BX entry + 16276 ;mov di,bp ; ES:DI = ptr to BP entry + 16277 ;;add si,fileext ; ES:SI = ptr to BX extension + 16278 ;add si,9 + 16279 ;;add di,fileext ; ES:DI = ptr to BP extension + 16280 ;add di,9 + 16281 ; + 16282 0000146D BE0900 mov si,9 + 16283 00001470 89F7 mov di,si ; mov di,9 + 16284 00001472 01DE add si,bx + 16285 00001474 01EF add di,bp + 16286 ; + 16287 ;mov cx,size fileext ; CX = length of extension field + 16288 00001476 B90300 mov cx,3 + 16289 + 16290 ; Bugbug: use symbol for subfunction code. + 16291 + 16292 CmpStr: + 16293 00001479 803E[BEA5]06 cmp byte [CountryPtrId],6 + 16294 0000147E 753A jne short cnNoCollTable + 16295 ; no collating table available + 16296 + 16297 ;* Compare strings using collating table. + 16298 ; + 16299 ; ES:SI = ptr to 1st string + 16300 ; ES:DI = ptr to 2nd string + 16301 ; CX = length + 16302 + 16303 00001480 55 push bp ; preserve BP + 16304 00001481 53 push bx ; preserve BX + 16305 00001482 1E push ds ; preserve DS + 16306 00001483 C51E[BFA5] lds bx,[CountryPtr] ; DS:BX = ptr to collating table + 16307 ;assume ds:NOTHING + 16308 00001487 8B2F mov bp,[bx] ; BP = size of collating table + 16309 00001489 43 inc bx + 16310 0000148A 43 inc bx ; DS:BX = ptr to collating values + 16311 ; DS:[BX]-2 = size of table + 16312 0000148B 31C0 xor ax,ax ; AX = 0 for starters + 16313 + 16314 ; Bugbug: Investigate removing collating table length checks. + 16315 + 16316 cnNextChar: + 16317 0000148D 268A05 mov al,[es:di] ; AL = AX = char from 2nd string + 16318 00001490 47 inc di ; ES:DI = ptr to next char 2nd string + 16319 + 16320 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 16321 %if 0 + 16322 cmp ax,bp ; compare to collating table length + 16323 jae short cn1 ; char not in table + 16324 xlat + 16325 cn1: ; AL = AX = collating value + 16326 mov dx,ax ; DX = collating value from 2nd string + 16327 ;lods byte ptr es:[si] + 16328 es lodsb ; AL = AX = char from 1st string + 16329 ; ES:SI = ptr to next char 1st string + 16330 cmp ax,bp ; compare to collating table length + 16331 jae short cn2 ; char not in table + 16332 xlat + 16333 cn2: ; AL = AX = collating value + 16334 cmp ax,dx ; compare collating values + 16335 loope cnNextChar ; until unequal or no more left + 16336 + 16337 pop ds ; restore DS + 16338 ;assume ds:TRANGROUP + 16339 pop bx ; restore BX + 16340 pop bp ; restore BP + 16341 retn 16342 - 16343 %else - 16344 ; 31/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 16345 00001491 84F6 test dh,dh - 16346 00001493 7408 jz short cn1 - 16347 00001495 30F6 xor dh,dh - 16348 00001497 88C2 mov dl,al - 16349 ;lods byte ptr es:[si] - 16350 00001499 26AC es lodsb - 16351 0000149B EB15 jmp short cn4 - 16352 cn1: - 16353 0000149D E8C112 call testkanj - 16354 000014A0 7402 jz short cn2 - 16355 000014A2 B601 mov dh,1 - 16356 cn2: - 16357 000014A4 39E8 cmp ax,bp - 16358 000014A6 7301 jnb short cn3 - 16359 000014A8 D7 xlat - 16360 cn3: - 16361 000014A9 88C2 mov dl,al - 16362 ;lods byte ptr es:[si] - 16363 000014AB 26AC es lodsb - 16364 000014AD 39E8 cmp ax,bp - 16365 000014AF 7301 jnb short cn4 - 16366 000014B1 D7 xlat - 16367 cn4: - 16368 000014B2 38D0 cmp al,dl - 16369 000014B4 E1D7 loope cnNextChar - 16370 000014B6 1F pop ds - 16371 000014B7 5B pop bx - 16372 000014B8 5D pop bp - 16373 000014B9 C3 retn - 16374 %endif - 16375 - 16376 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM - 16377 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:138Dh) - 16378 cnNoCollTable: - 16379 ;repe cmps byte ptr es:[si], byte ptr es:[di] ; 31/07/2024 - 16380 ;db 0F3h,26h,0A6h,0C3h - 16381 000014BA F3 repe ; 0F3h - 16382 000014BB 26 es ; 26h - 16383 000014BC A6 cmpsb ; 0A6h - 16384 000014BD C3 retn ; 0C3h - 16385 - 16386 ; --------------------------------------------------------------------------- - 16387 - 16388 ;*** CmpTime - compare entries by date/time - 16389 ; - 16390 ; ENTRY ES:BX = ptr to one entry - 16391 ; ES:BP = ptr to another entry + 16343 ;* If no collating table is available, simply compare raw ASCII values. + 16344 ; Don't we wish we could just do this all the time? Sigh. + 16345 + 16346 %else + 16347 ; 31/07/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 16348 00001491 84F6 test dh,dh + 16349 00001493 7408 jz short cn1 + 16350 00001495 30F6 xor dh,dh + 16351 00001497 88C2 mov dl,al + 16352 ;lods byte ptr es:[si] + 16353 00001499 26AC es lodsb + 16354 0000149B EB15 jmp short cn4 + 16355 cn1: + 16356 0000149D E8C112 call testkanj + 16357 000014A0 7402 jz short cn2 + 16358 000014A2 B601 mov dh,1 + 16359 cn2: + 16360 000014A4 39E8 cmp ax,bp + 16361 000014A6 7301 jnb short cn3 + 16362 000014A8 D7 xlat + 16363 cn3: + 16364 000014A9 88C2 mov dl,al + 16365 ;lods byte ptr es:[si] + 16366 000014AB 26AC es lodsb + 16367 000014AD 39E8 cmp ax,bp + 16368 000014AF 7301 jnb short cn4 + 16369 000014B1 D7 xlat + 16370 cn4: + 16371 000014B2 38D0 cmp al,dl + 16372 000014B4 E1D7 loope cnNextChar + 16373 000014B6 1F pop ds + 16374 000014B7 5B pop bx + 16375 000014B8 5D pop bp + 16376 000014B9 C3 retn + 16377 %endif + 16378 + 16379 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM + 16380 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:138Dh) + 16381 cnNoCollTable: + 16382 ;repe cmps byte ptr es:[si], byte ptr es:[di] ; 31/07/2024 + 16383 ;db 0F3h,26h,0A6h,0C3h + 16384 000014BA F3 repe ; 0F3h + 16385 000014BB 26 es ; 26h + 16386 000014BC A6 cmpsb ; 0A6h + 16387 000014BD C3 retn ; 0C3h + 16388 + 16389 ; --------------------------------------------------------------------------- + 16390 + 16391 ;*** CmpTime - compare entries by date/time 16392 ; - 16393 ; EXIT BX = unchanged - 16394 ; BP = unchanged - 16395 ; Condition flags set for same, above, or below - 16396 ; comparing BX entry to BP entry. - 16397 ; - 16398 ; USED: CX,SI,DI - 16399 ; - 16400 ; NOTE Filetime and filedate fields in our private entry - 16401 ; structure must be adjacent and in that order. - 16402 - 16403 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM - 16404 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 16405 CmpTime: - 16406 000014BE 89DE mov si,bx - 16407 000014C0 89EF mov di,bp - 16408 ;add si,filedate + size filedate - 1 - 16409 000014C2 83C610 add si,16 ; 15+2-1 - 16410 ;add di,filedate + size filedate - 1 - 16411 000014C5 83C710 add di,16 ; 15+2-1 - 16412 ; 07/06/2023 - 16413 000014C8 BE1000 mov si,16 - 16414 CmpST2: ; 07/06/2023 - 16415 000014CB 89F7 mov di,si ; mov di,16 - 16416 000014CD 01DE add si,bx - 16417 000014CF 01EF add di,bp - 16418 - 16419 ;mov cx,size filetime + size filedate - 16420 000014D1 B90400 mov cx,4 ; 2+2 - 16421 000014D4 FD std - 16422 ;repe cmps byte ptr es:[si],[di] - 16423 ;db 0F3h,26h,0A6h, 0FCh,0C3h - 16424 000014D5 F3 repe ; 0F3h - 16425 000014D6 26 es ; 26h - 16426 000014D7 A6 cmpsb ; 0A6h - 16427 - 16428 000014D8 FC cld ; 0FCh - 16429 000014D9 C3 retn ; 0C3h - 16430 - 16431 ; --------------------------------------------------------------------------- - 16432 - 16433 ;*** CmpSize - compare entries by size - 16434 ; - 16435 ; ENTRY ES:BX = ptr to one entry - 16436 ; ES:BP = ptr to another entry + 16393 ; ENTRY ES:BX = ptr to one entry + 16394 ; ES:BP = ptr to another entry + 16395 ; + 16396 ; EXIT BX = unchanged + 16397 ; BP = unchanged + 16398 ; Condition flags set for same, above, or below + 16399 ; comparing BX entry to BP entry. + 16400 ; + 16401 ; USED: CX,SI,DI + 16402 ; + 16403 ; NOTE Filetime and filedate fields in our private entry + 16404 ; structure must be adjacent and in that order. + 16405 + 16406 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM + 16407 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 16408 CmpTime: + 16409 000014BE 89DE mov si,bx + 16410 000014C0 89EF mov di,bp + 16411 ;add si,filedate + size filedate - 1 + 16412 000014C2 83C610 add si,16 ; 15+2-1 + 16413 ;add di,filedate + size filedate - 1 + 16414 000014C5 83C710 add di,16 ; 15+2-1 + 16415 ; 07/06/2023 + 16416 000014C8 BE1000 mov si,16 + 16417 CmpST2: ; 07/06/2023 + 16418 000014CB 89F7 mov di,si ; mov di,16 + 16419 000014CD 01DE add si,bx + 16420 000014CF 01EF add di,bp + 16421 + 16422 ;mov cx,size filetime + size filedate + 16423 000014D1 B90400 mov cx,4 ; 2+2 + 16424 000014D4 FD std + 16425 ;repe cmps byte ptr es:[si],[di] + 16426 ;db 0F3h,26h,0A6h, 0FCh,0C3h + 16427 000014D5 F3 repe ; 0F3h + 16428 000014D6 26 es ; 26h + 16429 000014D7 A6 cmpsb ; 0A6h + 16430 + 16431 000014D8 FC cld ; 0FCh + 16432 000014D9 C3 retn ; 0C3h + 16433 + 16434 ; --------------------------------------------------------------------------- + 16435 + 16436 ;*** CmpSize - compare entries by size 16437 ; - 16438 ; EXIT BX = unchanged - 16439 ; BP = unchanged - 16440 ; Condition flags set for same, above, or below - 16441 ; comparing BX entry to BP entry. - 16442 ; - 16443 ; USED: CX,SI,DI - 16444 - 16445 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM - 16446 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 16447 CmpSize: - 16448 ;mov si,bx - 16449 ;mov di,bp - 16450 ;;add si,filesize + size filesize - 1 - 16451 ;add si,20 ; 17+4-1 - 16452 ;;add di,filesize + size filesize - 1 - 16453 ;add di,20 ; 17+4-1 - 16454 ; 07/06/2023 - 16455 000014DA BE1400 mov si,20 - 16456 ;;; - 16457 000014DD EBEC jmp short CmpST2 ; 07/06/2023 - 16458 ;;; - 16459 ;CmpST2: - 16460 ; mov di,si ; mov di,20 - 16461 ; add si,bx - 16462 ; add di,bp - 16463 ; - 16464 ; ;mov cx,size filesize - 16465 ; mov cx,4 - 16466 ; std - 16467 ; ;repe cmps byte ptr es:[si],[di] - 16468 ; ;db 0F3h,26h,0A6h - 16469 ; repe ; 0F3h - 16470 ; es ; 26h - 16471 ; cmpsb ; 0A6h - 16472 ; - 16473 ; cld - 16474 ; retn - 16475 - 16476 ; --------------------------------------------------------------------------- - 16477 - 16478 ;*** CmpType - compare entries by file type (subdirectory or not) - 16479 ; - 16480 ; ENTRY ES:BX = ptr to one entry - 16481 ; ES:BP = ptr to another entry + 16438 ; ENTRY ES:BX = ptr to one entry + 16439 ; ES:BP = ptr to another entry + 16440 ; + 16441 ; EXIT BX = unchanged + 16442 ; BP = unchanged + 16443 ; Condition flags set for same, above, or below + 16444 ; comparing BX entry to BP entry. + 16445 ; + 16446 ; USED: CX,SI,DI + 16447 + 16448 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM + 16449 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 16450 CmpSize: + 16451 ;mov si,bx + 16452 ;mov di,bp + 16453 ;;add si,filesize + size filesize - 1 + 16454 ;add si,20 ; 17+4-1 + 16455 ;;add di,filesize + size filesize - 1 + 16456 ;add di,20 ; 17+4-1 + 16457 ; 07/06/2023 + 16458 000014DA BE1400 mov si,20 + 16459 ;;; + 16460 000014DD EBEC jmp short CmpST2 ; 07/06/2023 + 16461 ;;; + 16462 ;CmpST2: + 16463 ; mov di,si ; mov di,20 + 16464 ; add si,bx + 16465 ; add di,bp + 16466 ; + 16467 ; ;mov cx,size filesize + 16468 ; mov cx,4 + 16469 ; std + 16470 ; ;repe cmps byte ptr es:[si],[di] + 16471 ; ;db 0F3h,26h,0A6h + 16472 ; repe ; 0F3h + 16473 ; es ; 26h + 16474 ; cmpsb ; 0A6h + 16475 ; + 16476 ; cld + 16477 ; retn + 16478 + 16479 ; --------------------------------------------------------------------------- + 16480 + 16481 ;*** CmpType - compare entries by file type (subdirectory or not) 16482 ; - 16483 ; EXIT BX = unchanged - 16484 ; BP = unchanged - 16485 ; Condition flags set for same, above, or below - 16486 ; comparing BX entry to BP entry. - 16487 ; - 16488 ; USED: AX - 16489 - 16490 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM - 16491 CmpType: - 16492 ;mov al,es:[bx].fileattr - 16493 000014DF 268A470C mov al,[es:bx+12] - 16494 ;mov ah,es:[bp].fileattr - 16495 000014E3 268A660C mov ah,[es:bp+12] - 16496 ;and ax,(ATTR_DIRECTORY shl 8) + ATTR_DIRECTORY - 16497 ;and ax,1010h - 16498 000014E7 251010 and ax,(ATTR_DIRECTORY<<8)+ATTR_DIRECTORY - 16499 000014EA 38C4 cmp ah,al - 16500 000014EC C3 retn - 16501 - 16502 ; --------------------------------------------------------------------------- - 16503 - 16504 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 16505 %if 0 + 16483 ; ENTRY ES:BX = ptr to one entry + 16484 ; ES:BP = ptr to another entry + 16485 ; + 16486 ; EXIT BX = unchanged + 16487 ; BP = unchanged + 16488 ; Condition flags set for same, above, or below + 16489 ; comparing BX entry to BP entry. + 16490 ; + 16491 ; USED: AX + 16492 + 16493 ; 16/02/2023 - Retro DOS v4.0 COMMAND.COM + 16494 CmpType: + 16495 ;mov al,es:[bx].fileattr + 16496 000014DF 268A470C mov al,[es:bx+12] + 16497 ;mov ah,es:[bp].fileattr + 16498 000014E3 268A660C mov ah,[es:bp+12] + 16499 ;and ax,(ATTR_DIRECTORY shl 8) + ATTR_DIRECTORY + 16500 ;and ax,1010h + 16501 000014E7 251010 and ax,(ATTR_DIRECTORY<<8)+ATTR_DIRECTORY + 16502 000014EA 38C4 cmp ah,al + 16503 000014EC C3 retn + 16504 + 16505 ; --------------------------------------------------------------------------- 16506 - 16507 ;*** CmpCratio - compare entries by compression ratio - 16508 ; - 16509 ; ENTRY ES:BX = ptr to one entry - 16510 ; ES:BP = ptr to another entry + 16507 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 16508 %if 0 + 16509 + 16510 ;*** CmpCratio - compare entries by compression ratio 16511 ; - 16512 ; EXIT BX = unchanged - 16513 ; BP = unchanged - 16514 ; Condition flags set for same, above, or below - 16515 ; comparing BX entry to BP entry. - 16516 ; - 16517 ; USED: AX - 16518 - 16519 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 16520 CmpCratio: - 16521 ;mov al,es:[bx].compratio - 16522 mov al,[es:bx+21] - 16523 ;cmp al,es:[bp].compratio - 16524 cmp al,[es:bp+21] - 16525 retn - 16526 - 16527 %endif - 16528 - 16529 ; --------------------------------------------------------------------------- - 16530 - 16531 ;*** DefaultAttr - set default attribute conditions - 16532 ; - 16533 ; ENTRY nothing - 16534 ; - 16535 ; EXIT CY clear - 16536 ; - 16537 ; USED - 16538 ; - 16539 ; EFFECTS - 16540 ; - 16541 ; AttrSpecified, AttrSelect are updated with new attribute conditions. - 16542 - 16543 ; 16/02/2023 - 16544 DefaultAttr: - 16545 ;mov byte [AttrSpecified],6 - 16546 000014ED C606[939D]06 mov byte [AttrSpecified],ATTR_HIDDEN+ATTR_SYSTEM - 16547 ; specify H and S - 16548 000014F2 C606[949D]00 mov byte [AttrSelect],0 ; H and S must be off - 16549 000014F7 F8 clc ; return success - 16550 dtRet: ; 18/02/2023 - 16551 000014F8 C3 retn - 16552 - 16553 ; --------------------------------------------------------------------------- - 16554 - 16555 ;*** DisplayTotals - display grand total stats - 16556 ; - 16557 ; If we searched subdirectories, display the total # files found - 16558 ; and total size of files found. - 16559 ; Display disk space remaining. - 16560 ; - 16561 ; ENTRY FileCntTotal, FileSizTotal contain correct values - 16562 ; Bits contains setting of /s - 16563 ; FCB contains drive # - 16564 ; - 16565 ; EXIT nothing - 16566 ; - 16567 ; USES AX,DX - 16568 ; FileSiz - 16569 - 16570 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 16571 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:13D1h + 16512 ; ENTRY ES:BX = ptr to one entry + 16513 ; ES:BP = ptr to another entry + 16514 ; + 16515 ; EXIT BX = unchanged + 16516 ; BP = unchanged + 16517 ; Condition flags set for same, above, or below + 16518 ; comparing BX entry to BP entry. + 16519 ; + 16520 ; USED: AX + 16521 + 16522 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 16523 CmpCratio: + 16524 ;mov al,es:[bx].compratio + 16525 mov al,[es:bx+21] + 16526 ;cmp al,es:[bp].compratio + 16527 cmp al,[es:bp+21] + 16528 retn + 16529 + 16530 %endif + 16531 + 16532 ; --------------------------------------------------------------------------- + 16533 + 16534 ;*** DefaultAttr - set default attribute conditions + 16535 ; + 16536 ; ENTRY nothing + 16537 ; + 16538 ; EXIT CY clear + 16539 ; + 16540 ; USED + 16541 ; + 16542 ; EFFECTS + 16543 ; + 16544 ; AttrSpecified, AttrSelect are updated with new attribute conditions. + 16545 + 16546 ; 16/02/2023 + 16547 DefaultAttr: + 16548 ;mov byte [AttrSpecified],6 + 16549 000014ED C606[939D]06 mov byte [AttrSpecified],ATTR_HIDDEN+ATTR_SYSTEM + 16550 ; specify H and S + 16551 000014F2 C606[949D]00 mov byte [AttrSelect],0 ; H and S must be off + 16552 000014F7 F8 clc ; return success + 16553 dtRet: ; 18/02/2023 + 16554 000014F8 C3 retn + 16555 + 16556 ; --------------------------------------------------------------------------- + 16557 + 16558 ;*** DisplayTotals - display grand total stats + 16559 ; + 16560 ; If we searched subdirectories, display the total # files found + 16561 ; and total size of files found. + 16562 ; Display disk space remaining. + 16563 ; + 16564 ; ENTRY FileCntTotal, FileSizTotal contain correct values + 16565 ; Bits contains setting of /s + 16566 ; FCB contains drive # + 16567 ; + 16568 ; EXIT nothing + 16569 ; + 16570 ; USES AX,DX + 16571 ; FileSiz 16572 - 16573 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 16574 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:14F1h + 16573 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 16574 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:13D1h 16575 - 16576 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 16577 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1565h + 16576 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 16577 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:14F1h 16578 - 16579 DisplayTotals: - 16580 ;;;test Bits,mask subd - 16581 ;;test word [_Bits],4 - 16582 ;test byte [_Bits],4 - 16583 ; 07/06/2023 - 16584 000014F9 F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 - 16585 ; 31/07/2024 ; 4 ; PCDOS 7.1 - 16586 000014FE 7423 jz short dtFree ; no subdirectories- do bytes free - 16587 - 16588 00001500 E87614 call CRLF2 ; start on new line - 16589 00001503 E87304 call UseLine + 16579 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 16580 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1565h + 16581 + 16582 DisplayTotals: + 16583 ;;;test Bits,mask subd + 16584 ;;test word [_Bits],4 + 16585 ;test byte [_Bits],4 + 16586 ; 07/06/2023 + 16587 000014F9 F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 + 16588 ; 31/07/2024 ; 4 ; PCDOS 7.1 + 16589 000014FE 7423 jz short dtFree ; no subdirectories- do bytes free 16590 - 16591 00001506 BA[8F92] mov dx,total_ptr - 16592 00001509 E81C3F call std_printf ; "Total:",cr,lf - 16593 0000150C E86A04 call UseLine - 16594 - 16595 ; 31/07/2024 - 16596 ; PCDOS 7.1 COMMAND.COM - 16597 ;;; - 16598 %if 0 - 16599 ; 07/06/2023 - 16600 ; MSDOS 6.22 COMMAND.COM - 16601 ;test word [_Bits],1 ; mask.cratio - 16602 test byte [_Bits],mask.cratio - 16603 jz short dtCntSize - 16604 mov ax,[ccluUsedTotal] - 16605 mov [ccluUsedDir],ax - 16606 mov si,csecUsedTotal - 16607 mov di,csecUsedDir - 16608 movsw - 16609 movsw - 16610 dtCntSize: - 16611 %endif - 16612 ;;; - 16613 0000150F A1[5E9C] mov ax,[FileCntTotal] ; AX = # files found mod 64K - 16614 00001512 BE[629C] mov si,FileSizTotal - 16615 00001515 BF[229C] mov di,FileSiz - 16616 00001518 A5 movsw ; move total size to size variable - 16617 00001519 A5 movsw - 16618 - 16619 ; 31/07/2024 - 16620 ; PCDOS 7.1 COMMAND.COM - 16621 %if 1 - 16622 0000151A A5 movsw - 16623 0000151B A5 movsw - 16624 0000151C 8B16[609C] mov dx,[FileCntTotal+2] - 16625 %endif - 16626 00001520 E8D306 call DisplayCntSiz ; display file count & size - 16627 dtFree: - 16628 - 16629 ; 31/07/2024 - 16630 ; PCDOS 7.1 COMMAND.COM - 16631 %if 0 - 16632 mov ah,36h - 16633 ;mov ah,GET_DRIVE_FREESPACE ; AH = DOS Get Free Space function - 16634 mov dl,[FCB] ; [5Ch] ; DL = drive# - 16635 int 21h ; call DOS - 16636 cmp ax,-1 ; check 'invalid drive' return code - 16637 jz short dtRet ; can't get drive space - return - 16638 mul cx - 16639 mul bx - 16640 mov [Bytes_Free],ax - 16641 mov [Bytes_Free+2],dx - 16642 mov dx,bytmes_ptr - 16643 %else - 16644 ; 31/07/2024 - Retro DOS v5.0 - 16645 ; PCDOS 7.1 COMMAND.COM - 16646 00001523 E86907 call GetDriveLtr - 16647 00001526 A2[5A9C] mov byte [efs_drive],al ; "C:\" - 16648 00001529 BA[5A9C] mov dx,efs_drive ; "C:\" - 16649 0000152C BF[2E9C] mov di,efs_buffer - 16650 0000152F B92C00 mov cx,44 - 16651 00001532 26890D mov [es:di],cx - 16652 00001535 26C745020000 mov word [es:di+2],0 - 16653 0000153B B80373 mov ax,7303h ; GET EXTENDED FREE SPACE ON DRIVE (Windows95, FAT32) - 16654 ; DS:DX -> ASCIZ string for drive ("C:\" or "\\SERVER\Share") - 16655 ; ES:DI -> buffer for extended free space structure - 16656 ; CX = length of buffer for extended free space - 16657 0000153E CD21 int 21h ; DOS - - 16658 ; - 16659 ; Return: - 16660 ; CF clear if successful - 16661 ; ES:DI buffer filled - 16662 ; CF set on error - 16663 ; AX = error code - 16664 ; - 16665 ; Format of extended free space structure: - 16666 ; - 16667 ; Offset Size Description - 16668 ; 00h WORD (ret) size of returned structure - 16669 ; 02h WORD (call) structure version (0000h) - 16670 ; (ret) actual structure version (0000h) - 16671 ; 04h DWORD number of sectors per cluster - 16672 ; (with adjustment for compression) - 16673 ; 08h DWORD number of bytes per sector - 16674 ; 0Ch DWORD number of available clusters - 16675 ; 10h DWORD total number of clusters on the drive - 16676 ; 14h DWORD number of physical sectors available on the drive, - 16677 ; without adjustment for compression - 16678 ; 18h DWORD total number of physical sectors on the drive, - 16679 ; without adjustment for compression - 16680 ; 1Ch DWORD number of available allocation units, - 16681 ; without adjustment for compression - 16682 ; 20h DWORD total allocation units, - 16683 ; without adjustment for compression - 16684 ; 24h 8 BYTEs reserved - 16685 00001540 89C1 mov cx,ax ; error code (cf=1) or (cf=0) efs structure size (44) - 16686 00001542 268B5D08 mov bx,[es:di+8] ; bytes per sector - 16687 00001546 268B4514 mov ax,[es:di+14h] ; number of sectors available - 16688 0000154A 268B5516 mov dx,[es:di+16h] - 16689 0000154E 7204 jc short get_efs_err - 16690 00001550 08C9 or cl,cl - 16691 00001552 750F jnz short dtFree_1 ; cl = 44 (IBMDOS 7.1 Kernel, INT 21h, AX=7303h return value) - 16692 get_efs_err: - 16693 00001554 B436 mov ah,36h - 16694 ;mov ah,GET_DRIVE_FREESPACE ; AH = DOS Get Free Space function - 16695 00001556 8A165C00 mov dl,[FCB] ; DL = drive# - 16696 ;mov dl,[5Ch] - 16697 0000155A CD21 int 21h ; DOS - 2+ - GET DISK SPACE - 16698 ; DL = drive code (0 = default, 1 = A, 2 = B, etc.) - 16699 0000155C 83F8FF cmp ax,0FFFFh ; ax = sectors per cluster - 16700 0000155F 7497 je short dtRet ; ! invalid drive ! return - 16701 00001561 F7E1 mul cx ; * bytes per sectors - 16702 ; dx:ax = bytes per cluster - 16703 ; bx = free clusters - 16704 dtFree_1: - 16705 00001563 89D1 mov cx,dx ; hw of free sectors - 16706 00001565 F7E3 mul bx ; lw of free sectors * bytes per sector - 16707 00001567 91 xchg ax,cx - 16708 00001568 87D3 xchg dx,bx - 16709 0000156A F7E2 mul dx - 16710 0000156C 01D8 add ax,bx - 16711 0000156E 83D200 adc dx,0 ; dx:ax:cx = free bytes - 16712 00001571 09D2 or dx,dx - 16713 00001573 7416 jz short dtFree_2 - 16714 00001575 88E9 mov cl,ch ; prints free space as kilobytes - 16715 00001577 88C5 mov ch,al ; save al - 16716 00001579 88E0 mov al,ah ; / 256 - 16717 0000157B 88D4 mov ah,dl - 16718 0000157D D0CE ror dh,1 ; / 2 (= free bytes / 512) - 16719 0000157F D1D8 rcr ax,1 - 16720 00001581 D1D9 rcr cx,1 - 16721 00001583 D0CE ror dh,1 ; / 2 (= free bytes / 1024) - 16722 00001585 D1D8 rcr ax,1 - 16723 00001587 D1D9 rcr cx,1 - 16724 00001589 B2FF mov dl,0FFh ; dx > 0 - 16725 dtFree_2: - 16726 0000158B 890E[A99D] mov [Bytes_Free],cx - 16727 0000158F A3[AB9D] mov [Bytes_Free+2],ax - 16728 00001592 09D2 or dx,dx ; is dx > 0 ? - 16729 00001594 740F jz short dtFree_3 ; no - 16730 00001596 BA[D592] mov dx,kbytesf_ptr ; MSG_1106 (".. K bytes free" msg) - 16731 ; 30 digits, long binary do decimal - 16732 00001599 803E[2D9C]00 cmp byte [bfree_not_kilo],0 - 16733 0000159E 741C jz short dtFree_5 - 16734 000015A0 BA[D592] mov dx,kbytesf_ptr ; MSG_1106 - 16735 ; ".. K bytes free" msg, 28 digits - 16736 000015A3 EB17 jmp short dtFree_5 - 16737 dtFree_3: - 16738 000015A5 BA[4490] mov dx,bytmes1_ptr ; MSG_1020 (".. bytes free" msg) - 16739 ; 30 digits, long binary do decimal - 16740 000015A8 803E[2A9C]00 cmp byte [narrow],0 ; narrow display area ? - 16741 000015AD 7503 jnz short dtFree_4 ; yes - 16742 000015AF BA[5290] mov dx,bytmes2_ptr ; MSG_1020, 33 digits - 16743 dtFree_4: - 16744 000015B2 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; not kilobyte option - 16745 000015B7 7403 jz short dtFree_5 ; use kilo bytes (if number of free bytes is big) - 16746 000015B9 BA[6090] mov dx,bytmes_n_ptr ; narrow (28 digits), MSG_1020 - 16747 dtFree_5: - 16748 %endif - 16749 000015BC E8693E call std_printf ; "nnn bytes free",cr,lf - 16750 ;call UseLine - 16751 ;dtRet: - 16752 ;retn - 16753 ; 18/02/2023 - 16754 000015BF E9B703 jmp UseLine - 16755 - 16756 ; --------------------------------------------------------------------------- - 16757 - 16758 ;*** FileIsDevice - see if file looks like a device - 16759 ; - 16760 ; ENTRY PathPos = ptr to pathname - 16761 ; PathCnt = length of pathname w/o terminating char - 16762 ; DirBuf is DOS DTA - 16763 ; - 16764 ; EXIT ZR = set if file looks like a device - 16765 ; - 16766 ; USED AX,BX,CX,DX,DI - 16767 ; - 16768 ; EFFECTS - 16769 ; - 16770 ; DTA buffer holds results of Find First function - 16771 ; - 16772 ; NOTES - 16773 ; - 16774 ; We try to flag devices in two ways. First, we try - 16775 ; the DOS Find First function. It returns attribute bit 6 - 16776 ; set on a successful find if it identifies a device name. - 16777 ; Unfortunately, it returns 'path not found' for a device - 16778 ; name terminated with colon, such as "CON:". So, we look - 16779 ; for any colon in the pathname after the 2nd character, - 16780 ; and flag the pathname as a device if we find one. - 16781 - 16782 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 16783 FileIsDevice: - 16784 000015C2 8B16[8F9D] mov dx,[PathPos] ; DX = ptr to pathname - 16785 - 16786 000015C6 89D7 mov di,dx - 16787 000015C8 033E[8D9D] add di,[PathCnt] ; DI = ptr to byte after pathname - 16788 000015CC 30DB xor bl,bl ; BL = NUL to terminate pathname with - 16789 000015CE 861D xchg bl,[di] ; BL = saved pathname terminating char - 16790 - 16791 000015D0 31C9 xor cx,cx ; CX = attribute mask (normal search) - 16792 000015D2 B44E mov ah,4Eh - 16793 ;mov ah,Find_First ; AH = DOS Find First function code - 16794 000015D4 CD21 int 21h ; call DOS - 16795 000015D6 861D xchg bl,[di] ; restore pathname terminating char - 16796 000015D8 720A jc short piCol ; didn't find a dir entry, check for colon - 16797 - 16798 ; Found a dir entry, see if Find First thinks it's a device. - 16799 - 16800 ;test byte [DIRBUF+21],40h - 16801 000015DA F606[4E9D]40 test byte [DIRBUF+FIND_BUF.ATTR],ATTR_DEVICE - 16802 000015DF 7403 jz short piCol ; device attribute not set, look for colon - 16803 000015E1 31C9 xor cx,cx ; it's a device, return ZR flag - 16804 ;jmp short piRet - 16805 ; 25/04/2023 - 16806 piRet: - 16807 000015E3 C3 retn - 16808 - 16809 ; Device attribute not returned by Find First function. But - 16810 ; let's check for a colon anywhere in the pathname after the - 16811 ; second byte. - 16812 ; - 16813 ; DI = ptr to byte after pathname - 16814 - 16815 piCol: - 16816 000015E4 4F dec di ; DI = ptr to last char in pathname - 16817 000015E5 B03A mov al,':' - 16818 ;mov al,COLON_CHAR ; AL = colon char to search for - 16819 000015E7 8B0E[8D9D] mov cx,[PathCnt] ; CX = # chars to scan - 16820 000015EB 49 dec cx - 16821 000015EC 49 dec cx ; ignore 1st two chars of pathname - 16822 000015ED 09C9 or cx,cx - 16823 000015EF 78F2 js short piRet ; if < 2 chars in pathname, just return - 16824 000015F1 09FF or di,di ; clear ZR in case CX = 0 - 16825 000015F3 FD std ; scan downward - 16826 000015F4 F2AE repne scasb - 16827 000015F6 FC cld ; restore default upward direction - 16828 - 16829 ; After scanning, the ZR flag is set to indicate presence of a colon. - 16830 ;piRet: - 16831 000015F7 C3 retn - 16832 - 16833 ;FileIsDevice endp - 16834 - 16835 ; --------------------------------------------------------------------------- - 16836 - 16837 ;*** FindFirst - find first directory entry to display - 16838 ;*** FindNext - find next directory entry to display - 16839 ; - 16840 ; ENTRY Bits = set if entries are loaded in TPA - 16841 ; AttrSpecified, AttrSelect are set + 16591 00001500 E87614 call CRLF2 ; start on new line + 16592 00001503 E87304 call UseLine + 16593 + 16594 00001506 BA[8F92] mov dx,total_ptr + 16595 00001509 E81C3F call std_printf ; "Total:",cr,lf + 16596 0000150C E86A04 call UseLine + 16597 + 16598 ; 31/07/2024 + 16599 ; PCDOS 7.1 COMMAND.COM + 16600 ;;; + 16601 %if 0 + 16602 ; 07/06/2023 + 16603 ; MSDOS 6.22 COMMAND.COM + 16604 ;test word [_Bits],1 ; mask.cratio + 16605 test byte [_Bits],mask.cratio + 16606 jz short dtCntSize + 16607 mov ax,[ccluUsedTotal] + 16608 mov [ccluUsedDir],ax + 16609 mov si,csecUsedTotal + 16610 mov di,csecUsedDir + 16611 movsw + 16612 movsw + 16613 dtCntSize: + 16614 %endif + 16615 ;;; + 16616 0000150F A1[5E9C] mov ax,[FileCntTotal] ; AX = # files found mod 64K + 16617 00001512 BE[629C] mov si,FileSizTotal + 16618 00001515 BF[229C] mov di,FileSiz + 16619 00001518 A5 movsw ; move total size to size variable + 16620 00001519 A5 movsw + 16621 + 16622 ; 31/07/2024 + 16623 ; PCDOS 7.1 COMMAND.COM + 16624 %if 1 + 16625 0000151A A5 movsw + 16626 0000151B A5 movsw + 16627 0000151C 8B16[609C] mov dx,[FileCntTotal+2] + 16628 %endif + 16629 00001520 E8D306 call DisplayCntSiz ; display file count & size + 16630 dtFree: + 16631 + 16632 ; 31/07/2024 + 16633 ; PCDOS 7.1 COMMAND.COM + 16634 %if 0 + 16635 mov ah,36h + 16636 ;mov ah,GET_DRIVE_FREESPACE ; AH = DOS Get Free Space function + 16637 mov dl,[FCB] ; [5Ch] ; DL = drive# + 16638 int 21h ; call DOS + 16639 cmp ax,-1 ; check 'invalid drive' return code + 16640 jz short dtRet ; can't get drive space - return + 16641 mul cx + 16642 mul bx + 16643 mov [Bytes_Free],ax + 16644 mov [Bytes_Free+2],dx + 16645 mov dx,bytmes_ptr + 16646 %else + 16647 ; 31/07/2024 - Retro DOS v5.0 + 16648 ; PCDOS 7.1 COMMAND.COM + 16649 00001523 E86907 call GetDriveLtr + 16650 00001526 A2[5A9C] mov byte [efs_drive],al ; "C:\" + 16651 00001529 BA[5A9C] mov dx,efs_drive ; "C:\" + 16652 0000152C BF[2E9C] mov di,efs_buffer + 16653 0000152F B92C00 mov cx,44 + 16654 00001532 26890D mov [es:di],cx + 16655 00001535 26C745020000 mov word [es:di+2],0 + 16656 0000153B B80373 mov ax,7303h ; GET EXTENDED FREE SPACE ON DRIVE (Windows95, FAT32) + 16657 ; DS:DX -> ASCIZ string for drive ("C:\" or "\\SERVER\Share") + 16658 ; ES:DI -> buffer for extended free space structure + 16659 ; CX = length of buffer for extended free space + 16660 0000153E CD21 int 21h ; DOS - + 16661 ; + 16662 ; Return: + 16663 ; CF clear if successful + 16664 ; ES:DI buffer filled + 16665 ; CF set on error + 16666 ; AX = error code + 16667 ; + 16668 ; Format of extended free space structure: + 16669 ; + 16670 ; Offset Size Description + 16671 ; 00h WORD (ret) size of returned structure + 16672 ; 02h WORD (call) structure version (0000h) + 16673 ; (ret) actual structure version (0000h) + 16674 ; 04h DWORD number of sectors per cluster + 16675 ; (with adjustment for compression) + 16676 ; 08h DWORD number of bytes per sector + 16677 ; 0Ch DWORD number of available clusters + 16678 ; 10h DWORD total number of clusters on the drive + 16679 ; 14h DWORD number of physical sectors available on the drive, + 16680 ; without adjustment for compression + 16681 ; 18h DWORD total number of physical sectors on the drive, + 16682 ; without adjustment for compression + 16683 ; 1Ch DWORD number of available allocation units, + 16684 ; without adjustment for compression + 16685 ; 20h DWORD total allocation units, + 16686 ; without adjustment for compression + 16687 ; 24h 8 BYTEs reserved + 16688 00001540 89C1 mov cx,ax ; error code (cf=1) or (cf=0) efs structure size (44) + 16689 00001542 268B5D08 mov bx,[es:di+8] ; bytes per sector + 16690 00001546 268B4514 mov ax,[es:di+14h] ; number of sectors available + 16691 0000154A 268B5516 mov dx,[es:di+16h] + 16692 0000154E 7204 jc short get_efs_err + 16693 00001550 08C9 or cl,cl + 16694 00001552 750F jnz short dtFree_1 ; cl = 44 (IBMDOS 7.1 Kernel, INT 21h, AX=7303h return value) + 16695 get_efs_err: + 16696 00001554 B436 mov ah,36h + 16697 ;mov ah,GET_DRIVE_FREESPACE ; AH = DOS Get Free Space function + 16698 00001556 8A165C00 mov dl,[FCB] ; DL = drive# + 16699 ;mov dl,[5Ch] + 16700 0000155A CD21 int 21h ; DOS - 2+ - GET DISK SPACE + 16701 ; DL = drive code (0 = default, 1 = A, 2 = B, etc.) + 16702 0000155C 83F8FF cmp ax,0FFFFh ; ax = sectors per cluster + 16703 0000155F 7497 je short dtRet ; ! invalid drive ! return + 16704 00001561 F7E1 mul cx ; * bytes per sectors + 16705 ; dx:ax = bytes per cluster + 16706 ; bx = free clusters + 16707 dtFree_1: + 16708 00001563 89D1 mov cx,dx ; hw of free sectors + 16709 00001565 F7E3 mul bx ; lw of free sectors * bytes per sector + 16710 00001567 91 xchg ax,cx + 16711 00001568 87D3 xchg dx,bx + 16712 0000156A F7E2 mul dx + 16713 0000156C 01D8 add ax,bx + 16714 0000156E 83D200 adc dx,0 ; dx:ax:cx = free bytes + 16715 00001571 09D2 or dx,dx + 16716 00001573 7416 jz short dtFree_2 + 16717 00001575 88E9 mov cl,ch ; prints free space as kilobytes + 16718 00001577 88C5 mov ch,al ; save al + 16719 00001579 88E0 mov al,ah ; / 256 + 16720 0000157B 88D4 mov ah,dl + 16721 0000157D D0CE ror dh,1 ; / 2 (= free bytes / 512) + 16722 0000157F D1D8 rcr ax,1 + 16723 00001581 D1D9 rcr cx,1 + 16724 00001583 D0CE ror dh,1 ; / 2 (= free bytes / 1024) + 16725 00001585 D1D8 rcr ax,1 + 16726 00001587 D1D9 rcr cx,1 + 16727 00001589 B2FF mov dl,0FFh ; dx > 0 + 16728 dtFree_2: + 16729 0000158B 890E[A99D] mov [Bytes_Free],cx + 16730 0000158F A3[AB9D] mov [Bytes_Free+2],ax + 16731 00001592 09D2 or dx,dx ; is dx > 0 ? + 16732 00001594 740F jz short dtFree_3 ; no + 16733 00001596 BA[D592] mov dx,kbytesf_ptr ; MSG_1106 (".. K bytes free" msg) + 16734 ; 30 digits, long binary do decimal + 16735 00001599 803E[2D9C]00 cmp byte [bfree_not_kilo],0 + 16736 0000159E 741C jz short dtFree_5 + 16737 000015A0 BA[D592] mov dx,kbytesf_ptr ; MSG_1106 + 16738 ; ".. K bytes free" msg, 28 digits + 16739 000015A3 EB17 jmp short dtFree_5 + 16740 dtFree_3: + 16741 000015A5 BA[4490] mov dx,bytmes1_ptr ; MSG_1020 (".. bytes free" msg) + 16742 ; 30 digits, long binary do decimal + 16743 000015A8 803E[2A9C]00 cmp byte [narrow],0 ; narrow display area ? + 16744 000015AD 7503 jnz short dtFree_4 ; yes + 16745 000015AF BA[5290] mov dx,bytmes2_ptr ; MSG_1020, 33 digits + 16746 dtFree_4: + 16747 000015B2 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; not kilobyte option + 16748 000015B7 7403 jz short dtFree_5 ; use kilo bytes (if number of free bytes is big) + 16749 000015B9 BA[6090] mov dx,bytmes_n_ptr ; narrow (28 digits), MSG_1020 + 16750 dtFree_5: + 16751 %endif + 16752 000015BC E8693E call std_printf ; "nnn bytes free",cr,lf + 16753 ;call UseLine + 16754 ;dtRet: + 16755 ;retn + 16756 ; 18/02/2023 + 16757 000015BF E9B703 jmp UseLine + 16758 + 16759 ; --------------------------------------------------------------------------- + 16760 + 16761 ;*** FileIsDevice - see if file looks like a device + 16762 ; + 16763 ; ENTRY PathPos = ptr to pathname + 16764 ; PathCnt = length of pathname w/o terminating char + 16765 ; DirBuf is DOS DTA + 16766 ; + 16767 ; EXIT ZR = set if file looks like a device + 16768 ; + 16769 ; USED AX,BX,CX,DX,DI + 16770 ; + 16771 ; EFFECTS + 16772 ; + 16773 ; DTA buffer holds results of Find First function + 16774 ; + 16775 ; NOTES + 16776 ; + 16777 ; We try to flag devices in two ways. First, we try + 16778 ; the DOS Find First function. It returns attribute bit 6 + 16779 ; set on a successful find if it identifies a device name. + 16780 ; Unfortunately, it returns 'path not found' for a device + 16781 ; name terminated with colon, such as "CON:". So, we look + 16782 ; for any colon in the pathname after the 2nd character, + 16783 ; and flag the pathname as a device if we find one. + 16784 + 16785 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 16786 FileIsDevice: + 16787 000015C2 8B16[8F9D] mov dx,[PathPos] ; DX = ptr to pathname + 16788 + 16789 000015C6 89D7 mov di,dx + 16790 000015C8 033E[8D9D] add di,[PathCnt] ; DI = ptr to byte after pathname + 16791 000015CC 30DB xor bl,bl ; BL = NUL to terminate pathname with + 16792 000015CE 861D xchg bl,[di] ; BL = saved pathname terminating char + 16793 + 16794 000015D0 31C9 xor cx,cx ; CX = attribute mask (normal search) + 16795 000015D2 B44E mov ah,4Eh + 16796 ;mov ah,Find_First ; AH = DOS Find First function code + 16797 000015D4 CD21 int 21h ; call DOS + 16798 000015D6 861D xchg bl,[di] ; restore pathname terminating char + 16799 000015D8 720A jc short piCol ; didn't find a dir entry, check for colon + 16800 + 16801 ; Found a dir entry, see if Find First thinks it's a device. + 16802 + 16803 ;test byte [DIRBUF+21],40h + 16804 000015DA F606[4E9D]40 test byte [DIRBUF+FIND_BUF.ATTR],ATTR_DEVICE + 16805 000015DF 7403 jz short piCol ; device attribute not set, look for colon + 16806 000015E1 31C9 xor cx,cx ; it's a device, return ZR flag + 16807 ;jmp short piRet + 16808 ; 25/04/2023 + 16809 piRet: + 16810 000015E3 C3 retn + 16811 + 16812 ; Device attribute not returned by Find First function. But + 16813 ; let's check for a colon anywhere in the pathname after the + 16814 ; second byte. + 16815 ; + 16816 ; DI = ptr to byte after pathname + 16817 + 16818 piCol: + 16819 000015E4 4F dec di ; DI = ptr to last char in pathname + 16820 000015E5 B03A mov al,':' + 16821 ;mov al,COLON_CHAR ; AL = colon char to search for + 16822 000015E7 8B0E[8D9D] mov cx,[PathCnt] ; CX = # chars to scan + 16823 000015EB 49 dec cx + 16824 000015EC 49 dec cx ; ignore 1st two chars of pathname + 16825 000015ED 09C9 or cx,cx + 16826 000015EF 78F2 js short piRet ; if < 2 chars in pathname, just return + 16827 000015F1 09FF or di,di ; clear ZR in case CX = 0 + 16828 000015F3 FD std ; scan downward + 16829 000015F4 F2AE repne scasb + 16830 000015F6 FC cld ; restore default upward direction + 16831 + 16832 ; After scanning, the ZR flag is set to indicate presence of a colon. + 16833 ;piRet: + 16834 000015F7 C3 retn + 16835 + 16836 ;FileIsDevice endp + 16837 + 16838 ; --------------------------------------------------------------------------- + 16839 + 16840 ;*** FindFirst - find first directory entry to display + 16841 ;*** FindNext - find next directory entry to display 16842 ; - 16843 ; EXIT CY = clear if successful - 16844 ; BX = offset in TPA buffer of directory entry found + 16843 ; ENTRY Bits = set if entries are loaded in TPA + 16844 ; AttrSpecified, AttrSelect are set 16845 ; - 16846 ; If unsuccessful, - 16847 ; CY = set - 16848 ; AX = DOS error code - 16849 ; DOS Get Extended Error call will get error code - 16850 ; - 16851 ; NOTE: if entries were loaded into TPA, AX contains - 16852 ; ERROR_NO_MORE_FILES when no more entries are available, - 16853 ; but DOS Get Extended Error call WON'T return the correct - 16854 ; error. That's ok, because we'll see the value in AX - 16855 ; and recognize it as a non-error condition. - 16856 ; - 16857 ; USED AX,CX,DX,SI,DI - 16858 ; - 16859 ; EFFECTS - 16860 ; - 16861 ; Entries in memory may be marked as output. - 16862 ; If not sorted, entry is loaded at TPA. + 16846 ; EXIT CY = clear if successful + 16847 ; BX = offset in TPA buffer of directory entry found + 16848 ; + 16849 ; If unsuccessful, + 16850 ; CY = set + 16851 ; AX = DOS error code + 16852 ; DOS Get Extended Error call will get error code + 16853 ; + 16854 ; NOTE: if entries were loaded into TPA, AX contains + 16855 ; ERROR_NO_MORE_FILES when no more entries are available, + 16856 ; but DOS Get Extended Error call WON'T return the correct + 16857 ; error. That's ok, because we'll see the value in AX + 16858 ; and recognize it as a non-error condition. + 16859 ; + 16860 ; USED AX,CX,DX,SI,DI + 16861 ; + 16862 ; EFFECTS 16863 ; - 16864 ; NOTES - 16865 ; - 16866 ; If we don't find a qualifying file, we return after the final - 16867 ; DOS Find File call. A DOS Get Extended Error call will then - 16868 ; indicate an appropriate condition. - 16869 - 16870 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 16871 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:144Fh + 16864 ; Entries in memory may be marked as output. + 16865 ; If not sorted, entry is loaded at TPA. + 16866 ; + 16867 ; NOTES + 16868 ; + 16869 ; If we don't find a qualifying file, we return after the final + 16870 ; DOS Find File call. A DOS Get Extended Error call will then + 16871 ; indicate an appropriate condition. 16872 - 16873 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 16874 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1585h + 16873 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 16874 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:144Fh 16875 - 16876 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 16877 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1667h - 16878 - 16879 FindFirst: - 16880 ;mov ax,offset TRANGROUP:GetFirst - 16881 000015F8 B8[CF16] mov ax,GetFirst - 16882 000015FB EB03 jmp short ffFindEntry - 16883 - 16884 ; 18/02/2023 - 16885 FindNext: - 16886 ;mov ax,offset TRANGROUP:GetNext - 16887 000015FD B8[DD16] mov ax,GetNext - 16888 - 16889 ; AX = address of correct disk get routine to use. - 16890 - 16891 ffFindEntry: - 16892 00001600 06 push es ; save TRANGROUP seg addr - 16893 ;;;test Bits,mask inmem - 16894 ;;test word [_Bits],20h - 16895 ;test byte [_Bits],20h - 16896 ; 07/06/2023 - 16897 00001601 F606[8B9D]80 test byte [_Bits],mask.inmem ; 40h ; MSDOS 6.0 - 16898 ; 31/07/2024 ; 80h ; PCDOS 7.1 - 16899 00001606 7405 jz short ffDisk ; entries not in memory, search disk - 16900 - 16901 ; Entries are loaded in memory to sort out. Find the first one. - 16902 ; There will always be one, or LoadEntries would've failed. + 16876 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 16877 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1585h + 16878 + 16879 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 16880 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1667h + 16881 + 16882 FindFirst: + 16883 ;mov ax,offset TRANGROUP:GetFirst + 16884 000015F8 B8[CF16] mov ax,GetFirst + 16885 000015FB EB03 jmp short ffFindEntry + 16886 + 16887 ; 18/02/2023 + 16888 FindNext: + 16889 ;mov ax,offset TRANGROUP:GetNext + 16890 000015FD B8[DD16] mov ax,GetNext + 16891 + 16892 ; AX = address of correct disk get routine to use. + 16893 + 16894 ffFindEntry: + 16895 00001600 06 push es ; save TRANGROUP seg addr + 16896 ;;;test Bits,mask inmem + 16897 ;;test word [_Bits],20h + 16898 ;test byte [_Bits],20h + 16899 ; 07/06/2023 + 16900 00001601 F606[8B9D]80 test byte [_Bits],mask.inmem ; 40h ; MSDOS 6.0 + 16901 ; 31/07/2024 ; 80h ; PCDOS 7.1 + 16902 00001606 7405 jz short ffDisk ; entries not in memory, search disk 16903 - 16904 00001608 E81A00 call FindInMem ; find first entry in TPA - 16905 0000160B EB16 jmp short ffRet ; return what TPA search returns + 16904 ; Entries are loaded in memory to sort out. Find the first one. + 16905 ; There will always be one, or LoadEntries would've failed. 16906 - 16907 ; Get entry from disk. - 16908 - 16909 ffDisk: - 16910 0000160D FFD0 call ax ; get entry from disk - 16911 0000160F 720E jc short ffGetErr ; get & return error - 16912 00001611 8E06[F79B] mov es,[TPA] ; ES = seg addr of TPA - 16913 00001615 31FF xor di,di ; ES:DI = ptr to TPA - 16914 00001617 89FB mov bx,di ; BX = offset of entry in TPA - 16915 00001619 E85C01 call LoadEntry ; load entry to TPA - 16916 0000161C F8 clc ; return success - 16917 0000161D EB04 jmp short ffRet - 16918 - 16919 ffGetErr: - 16920 0000161F E8290A call get_ext_error_number ; AX = DOS error code - 16921 00001622 F9 stc - 16922 ffRet: - 16923 00001623 07 pop es ; ES = TRANGROUP seg addr again - 16924 00001624 C3 retn - 16925 - 16926 ; --------------------------------------------------------------------------- - 16927 - 16928 ;*** FindInMem - find next directory entry in TPA buffer - 16929 ; - 16930 ; ENTRY TPA is loaded (see LoadEntries) - 16931 ; - 16932 ; EXIT BX = offset in TPA of entry found - 16933 ; - 16934 ; If no more files, - 16935 ; CY = set - 16936 ; AX = DOS 'no more files' error code - 16937 ; - 16938 ; USED AX,BX,CX,DX,SI,DI,BP,ES - 16939 ; - 16940 ; EFFECTS - 16941 ; - 16942 ; Entry found is flagged as 'used' (see EntryStruc). - 16943 - 16944 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 16945 FindInMem: - 16946 00001625 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr - 16947 00001629 31DB xor bx,bx ; ES:BX = ptr to 1st entry in TPA - 16948 0000162B FC cld ; make sure default string direction is up - 16949 - 16950 0000162C E86D00 call FindOneInMem ; locate an entry - 16951 0000162F 720E jc short fiNoMore ; none left, set up 'no more files' error - 16952 - 16953 ; BX = ptr to entry in TPA - 16954 - 16955 fiBest: - 16956 00001631 89DD mov bp,bx ; BP = ptr to best entry so far - 16957 fiNext: - 16958 00001633 E87300 call FindNextInMem ; locate next entry - 16959 00001636 720C jc short fiFound ; no more, best entry so far wins - 16960 - 16961 ; BX = ptr to next entry - 16962 - 16963 00001638 E8F5FD call CmpEntry ; compare it to best found so far (BP) - 16964 0000163B 73F6 jnb short fiNext ; it's not better, go look at next one - 16965 0000163D EBF2 jmp short fiBest ; it's better, go mark it as best so far - 16966 - 16967 fiNoMore: - 16968 - 16969 ; No more entries available in TPA. Set up 'no more files' error. - 16970 - 16971 ;mov ax,18 - 16972 0000163F B81200 mov ax,ERROR_NO_MORE_FILES ; AX = 'no more files' error code - 16973 00001642 F9 stc ; return error - 16974 ;jmp short fiRet - 16975 ; 18/02/2023 - 16976 00001643 C3 retn - 16977 - 16978 fiFound: - 16979 00001644 89EB mov bx,bp ; BX = ptr to best entry found - 16980 00001646 26C60701 mov byte [es:bx],1 ; mark entry 'used' - 16981 0000164A F8 clc ; return success - 16982 fiRet: - 16983 0000164B C3 retn - 16984 - 16985 ; --------------------------------------------------------------------------- - 16986 - 16987 ;*** FindNextChild - find next subdirectory in current directory - 16988 ; - 16989 ; ENTRY BX = ptr to last child found, ASCIIZ filename - 16990 ; DirBuf is established DTA + 16907 00001608 E81A00 call FindInMem ; find first entry in TPA + 16908 0000160B EB16 jmp short ffRet ; return what TPA search returns + 16909 + 16910 ; Get entry from disk. + 16911 + 16912 ffDisk: + 16913 0000160D FFD0 call ax ; get entry from disk + 16914 0000160F 720E jc short ffGetErr ; get & return error + 16915 00001611 8E06[F79B] mov es,[TPA] ; ES = seg addr of TPA + 16916 00001615 31FF xor di,di ; ES:DI = ptr to TPA + 16917 00001617 89FB mov bx,di ; BX = offset of entry in TPA + 16918 00001619 E85C01 call LoadEntry ; load entry to TPA + 16919 0000161C F8 clc ; return success + 16920 0000161D EB04 jmp short ffRet + 16921 + 16922 ffGetErr: + 16923 0000161F E8290A call get_ext_error_number ; AX = DOS error code + 16924 00001622 F9 stc + 16925 ffRet: + 16926 00001623 07 pop es ; ES = TRANGROUP seg addr again + 16927 00001624 C3 retn + 16928 + 16929 ; --------------------------------------------------------------------------- + 16930 + 16931 ;*** FindInMem - find next directory entry in TPA buffer + 16932 ; + 16933 ; ENTRY TPA is loaded (see LoadEntries) + 16934 ; + 16935 ; EXIT BX = offset in TPA of entry found + 16936 ; + 16937 ; If no more files, + 16938 ; CY = set + 16939 ; AX = DOS 'no more files' error code + 16940 ; + 16941 ; USED AX,BX,CX,DX,SI,DI,BP,ES + 16942 ; + 16943 ; EFFECTS + 16944 ; + 16945 ; Entry found is flagged as 'used' (see EntryStruc). + 16946 + 16947 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 16948 FindInMem: + 16949 00001625 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr + 16950 00001629 31DB xor bx,bx ; ES:BX = ptr to 1st entry in TPA + 16951 0000162B FC cld ; make sure default string direction is up + 16952 + 16953 0000162C E86D00 call FindOneInMem ; locate an entry + 16954 0000162F 720E jc short fiNoMore ; none left, set up 'no more files' error + 16955 + 16956 ; BX = ptr to entry in TPA + 16957 + 16958 fiBest: + 16959 00001631 89DD mov bp,bx ; BP = ptr to best entry so far + 16960 fiNext: + 16961 00001633 E87300 call FindNextInMem ; locate next entry + 16962 00001636 720C jc short fiFound ; no more, best entry so far wins + 16963 + 16964 ; BX = ptr to next entry + 16965 + 16966 00001638 E8F5FD call CmpEntry ; compare it to best found so far (BP) + 16967 0000163B 73F6 jnb short fiNext ; it's not better, go look at next one + 16968 0000163D EBF2 jmp short fiBest ; it's better, go mark it as best so far + 16969 + 16970 fiNoMore: + 16971 + 16972 ; No more entries available in TPA. Set up 'no more files' error. + 16973 + 16974 ;mov ax,18 + 16975 0000163F B81200 mov ax,ERROR_NO_MORE_FILES ; AX = 'no more files' error code + 16976 00001642 F9 stc ; return error + 16977 ;jmp short fiRet + 16978 ; 18/02/2023 + 16979 00001643 C3 retn + 16980 + 16981 fiFound: + 16982 00001644 89EB mov bx,bp ; BX = ptr to best entry found + 16983 00001646 26C60701 mov byte [es:bx],1 ; mark entry 'used' + 16984 0000164A F8 clc ; return success + 16985 fiRet: + 16986 0000164B C3 retn + 16987 + 16988 ; --------------------------------------------------------------------------- + 16989 + 16990 ;*** FindNextChild - find next subdirectory in current directory 16991 ; - 16992 ; EXIT BX = ptr (same addr) to next child found, ASCIIZ filename - 16993 ; - 16994 ; If failure, - 16995 ; CY = set - 16996 ; DOS Get Extended Error call will get error - 16997 ; - 16998 ; USED AX,CX,DX,SI,DI,BP - 16999 ; - 17000 ; EFFECTS - 17001 ; - 17002 ; DirBuf is used for find first/next calls. - 17003 ; - 17004 ; NOTES - 17005 ; - 17006 ; We keep on checking files until DOS returns an error. If - 17007 ; the error is 'no more files' and the temp filename is not - 17008 ; the initial high tag, copy the temp to the child's name spot - 17009 ; and return success. Otherwise, send the error back to caller. - 17010 ; - 17011 ; This routine depends on DS,ES,CS, & SS all being equal. - 17012 - 17013 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17014 FindNextChild: - 17015 0000164C 83EC0C sub sp,12 ; make temp filename buf on stack - 17016 ;shove 00FFh ; temp filename = high tag - 17017 0000164F B8FF00 mov ax,0FFh - 17018 00001652 50 push ax - 17019 00001653 89E5 mov bp,sp ; BP = ptr to temp filename buf - 17020 ;shove "*" - 17021 00001655 B02A mov al,'*' ; ax = 002Ah - 17022 00001657 50 push ax - 17023 ;;shove ".*" - 17024 ;mov ax,"*." - 17025 ;mov ax,2E2Ah - 17026 00001658 B42E mov ah,'.' - 17027 0000165A 50 push ax - 17028 0000165B E83106 call GetDriveLtr ; AX = "d:" - 17029 0000165E 50 push ax - 17030 0000165F 89E2 mov dx,sp ; DX = ptr to "d:*.*",0 on stack - 17031 - 17032 ; See that the stack is restored properly at the end of this proc. - 17033 - 17034 ;mov cx,10h - 17035 00001661 B91000 mov cx,ATTR_DIRECTORY ; CX = attributes for file search - 17036 00001664 B44E mov ah,4Eh - 17037 ;mov ah,Find_First - 17038 00001666 CD21 int 21h ; DOS- Find First matching file - 17039 00001668 722C jc short fcRet ; return error - 17040 - 17041 0000166A E89EFD call CheckChild ; check child against last, temp - 17042 fcNext: - 17043 ;mov cx,10h - 17044 0000166D B91000 mov cx,ATTR_DIRECTORY ; CX = attributes for file search - 17045 00001670 B44F mov ah,4Fh - 17046 ;mov ah,Find_Next - 17047 00001672 CD21 int 21h ; DOS- Find Next matching file - 17048 00001674 7205 jc short fcErr ; examine error - 17049 - 17050 00001676 E892FD call CheckChild ; check child against last, temp - 17051 00001679 EBF2 jmp short fcNext ; go find another child + 16992 ; ENTRY BX = ptr to last child found, ASCIIZ filename + 16993 ; DirBuf is established DTA + 16994 ; + 16995 ; EXIT BX = ptr (same addr) to next child found, ASCIIZ filename + 16996 ; + 16997 ; If failure, + 16998 ; CY = set + 16999 ; DOS Get Extended Error call will get error + 17000 ; + 17001 ; USED AX,CX,DX,SI,DI,BP + 17002 ; + 17003 ; EFFECTS + 17004 ; + 17005 ; DirBuf is used for find first/next calls. + 17006 ; + 17007 ; NOTES + 17008 ; + 17009 ; We keep on checking files until DOS returns an error. If + 17010 ; the error is 'no more files' and the temp filename is not + 17011 ; the initial high tag, copy the temp to the child's name spot + 17012 ; and return success. Otherwise, send the error back to caller. + 17013 ; + 17014 ; This routine depends on DS,ES,CS, & SS all being equal. + 17015 + 17016 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17017 FindNextChild: + 17018 0000164C 83EC0C sub sp,12 ; make temp filename buf on stack + 17019 ;shove 00FFh ; temp filename = high tag + 17020 0000164F B8FF00 mov ax,0FFh + 17021 00001652 50 push ax + 17022 00001653 89E5 mov bp,sp ; BP = ptr to temp filename buf + 17023 ;shove "*" + 17024 00001655 B02A mov al,'*' ; ax = 002Ah + 17025 00001657 50 push ax + 17026 ;;shove ".*" + 17027 ;mov ax,"*." + 17028 ;mov ax,2E2Ah + 17029 00001658 B42E mov ah,'.' + 17030 0000165A 50 push ax + 17031 0000165B E83106 call GetDriveLtr ; AX = "d:" + 17032 0000165E 50 push ax + 17033 0000165F 89E2 mov dx,sp ; DX = ptr to "d:*.*",0 on stack + 17034 + 17035 ; See that the stack is restored properly at the end of this proc. + 17036 + 17037 ;mov cx,10h + 17038 00001661 B91000 mov cx,ATTR_DIRECTORY ; CX = attributes for file search + 17039 00001664 B44E mov ah,4Eh + 17040 ;mov ah,Find_First + 17041 00001666 CD21 int 21h ; DOS- Find First matching file + 17042 00001668 722C jc short fcRet ; return error + 17043 + 17044 0000166A E89EFD call CheckChild ; check child against last, temp + 17045 fcNext: + 17046 ;mov cx,10h + 17047 0000166D B91000 mov cx,ATTR_DIRECTORY ; CX = attributes for file search + 17048 00001670 B44F mov ah,4Fh + 17049 ;mov ah,Find_Next + 17050 00001672 CD21 int 21h ; DOS- Find Next matching file + 17051 00001674 7205 jc short fcErr ; examine error 17052 - 17053 fcErr: - 17054 0000167B E8CD09 call get_ext_error_number ; AX = extended error code - 17055 ;cmp ax,18 - 17056 0000167E 83F812 cmp ax,ERROR_NO_MORE_FILES ; no more files? - 17057 00001681 7512 jne short fcNope ; some other error- return it - 17058 - 17059 ; We ran out of files. See if we qualified at least one. - 17060 - 17061 00001683 807E00FF cmp byte [bp],0FFh - 17062 00001687 740C je short fcNope ; temp filename is unused- no child + 17053 00001676 E892FD call CheckChild ; check child against last, temp + 17054 00001679 EBF2 jmp short fcNext ; go find another child + 17055 + 17056 fcErr: + 17057 0000167B E8CD09 call get_ext_error_number ; AX = extended error code + 17058 ;cmp ax,18 + 17059 0000167E 83F812 cmp ax,ERROR_NO_MORE_FILES ; no more files? + 17060 00001681 7512 jne short fcNope ; some other error- return it + 17061 + 17062 ; We ran out of files. See if we qualified at least one. 17063 - 17064 ; Move temp filename to child name position. - 17065 - 17066 00001689 89EE mov si,bp ; SI = ptr to temp filename - 17067 0000168B 89DF mov di,bx ; DI = ptr to child name pos'n - 17068 fcMove: - 17069 0000168D AC lodsb ; AL = next byte of filename - 17070 0000168E AA stosb ; store byte - 17071 0000168F 08C0 or al,al - 17072 00001691 7403 jz short fcRet ; byte was zero, return success (CY clear) - 17073 00001693 EBF8 jmp short fcMove ; go move another byte - 17074 fcNope: - 17075 00001695 F9 stc ; return error - 17076 fcRet: - 17077 00001696 9F lahf - 17078 00001697 83C414 add sp,20 ; restore stack - 17079 0000169A 9E sahf - 17080 0000169B C3 retn - 17081 - 17082 ; --------------------------------------------------------------------------- - 17083 - 17084 ;*** FindOneInMem - find the first available entry in TPA - 17085 ;*** FindNextInMem - find the next available entry in TPA - 17086 ; - 17087 ; ENTRY ES = TPA seg addr - 17088 ; BX = ptr to entry in TPA + 17064 00001683 807E00FF cmp byte [bp],0FFh + 17065 00001687 740C je short fcNope ; temp filename is unused- no child + 17066 + 17067 ; Move temp filename to child name position. + 17068 + 17069 00001689 89EE mov si,bp ; SI = ptr to temp filename + 17070 0000168B 89DF mov di,bx ; DI = ptr to child name pos'n + 17071 fcMove: + 17072 0000168D AC lodsb ; AL = next byte of filename + 17073 0000168E AA stosb ; store byte + 17074 0000168F 08C0 or al,al + 17075 00001691 7403 jz short fcRet ; byte was zero, return success (CY clear) + 17076 00001693 EBF8 jmp short fcMove ; go move another byte + 17077 fcNope: + 17078 00001695 F9 stc ; return error + 17079 fcRet: + 17080 00001696 9F lahf + 17081 00001697 83C414 add sp,20 ; restore stack + 17082 0000169A 9E sahf + 17083 0000169B C3 retn + 17084 + 17085 ; --------------------------------------------------------------------------- + 17086 + 17087 ;*** FindOneInMem - find the first available entry in TPA + 17088 ;*** FindNextInMem - find the next available entry in TPA 17089 ; - 17090 ; EXIT BX = ptr to entry found - 17091 ; CY = set if no more entries available in TPA + 17090 ; ENTRY ES = TPA seg addr + 17091 ; BX = ptr to entry in TPA 17092 ; - 17093 ; USED AL - 17094 - 17095 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17096 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 17097 FindOneInMem: - 17098 0000169C 268A07 mov al,[es:bx] ; examine 'used' byte of starting entry - 17099 0000169F 3C01 cmp al,1 - 17100 000016A1 7406 je short FindNextInMem ; entry has already been used - 17101 000016A3 3CFF cmp al,0FFh - 17102 000016A5 7407 je short foNoMore ; 0FFh, we're at the end of the list - 17103 - 17104 ; BX = ptr to entry that hasn't been output yet. - 17105 - 17106 000016A7 F8 clc ; return success - 17107 000016A8 C3 retn + 17093 ; EXIT BX = ptr to entry found + 17094 ; CY = set if no more entries available in TPA + 17095 ; + 17096 ; USED AL + 17097 + 17098 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17099 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 17100 FindOneInMem: + 17101 0000169C 268A07 mov al,[es:bx] ; examine 'used' byte of starting entry + 17102 0000169F 3C01 cmp al,1 + 17103 000016A1 7406 je short FindNextInMem ; entry has already been used + 17104 000016A3 3CFF cmp al,0FFh + 17105 000016A5 7407 je short foNoMore ; 0FFh, we're at the end of the list + 17106 + 17107 ; BX = ptr to entry that hasn't been output yet. 17108 - 17109 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 17110 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:163Ah - 17111 FindNextInMem: - 17112 ; 07/06/2023 - 17113 ;add bx,21 ; MSDOS 5.0 - 17114 ; 07/06/2023 - 17115 000016A9 83C316 add bx,22 ; MSDOS 6.0 ; size EntryStruc (22 = 21 + compratio) - 17116 ;add bx,size EntryStruc ; BX = ptr to next entry - 17117 000016AC EBEE jmp short FindOneInMem ; go look at it - 17118 foNoMore: - 17119 000016AE F9 stc ; ran out of entries, return failure - 17120 000016AF C3 retn - 17121 - 17122 ; --------------------------------------------------------------------------- - 17123 - 17124 ;*** GetEnvValue - get value of our environment variable - 17125 ; - 17126 ; ENTRY DS, ES = TRANGROUP seg addr - 17127 ; - 17128 ; EXIT CY = set if environment variable not in environment - 17129 ; - 17130 ; Otherwise: - 17131 ; SI = ptr to environment variable asciiz value in TRANGROUP + 17109 000016A7 F8 clc ; return success + 17110 000016A8 C3 retn + 17111 + 17112 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 17113 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:163Ah + 17114 FindNextInMem: + 17115 ; 07/06/2023 + 17116 ;add bx,21 ; MSDOS 5.0 + 17117 ; 07/06/2023 + 17118 000016A9 83C316 add bx,22 ; MSDOS 6.0 ; size EntryStruc (22 = 21 + compratio) + 17119 ;add bx,size EntryStruc ; BX = ptr to next entry + 17120 000016AC EBEE jmp short FindOneInMem ; go look at it + 17121 foNoMore: + 17122 000016AE F9 stc ; ran out of entries, return failure + 17123 000016AF C3 retn + 17124 + 17125 ; --------------------------------------------------------------------------- + 17126 + 17127 ;*** GetEnvValue - get value of our environment variable + 17128 ; + 17129 ; ENTRY DS, ES = TRANGROUP seg addr + 17130 ; + 17131 ; EXIT CY = set if environment variable not in environment 17132 ; - 17133 ; USED AX,BX,CX,DX,DI - 17134 ; (We assume the (almost) worst, since we don't know about - 17135 ; Find_Name_In_Environment.) - 17136 ; - 17137 ; EFFECTS - 17138 ; - 17139 ; ScanBuf is loaded with value text - 17140 - 17141 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17142 GetEnvValue: - 17143 000016B0 06 push es ; save ES - 17144 ;mov si,offset TRANGROUP:DirEnvVar ; DS:SI = ptr to variable name - 17145 000016B1 BE[0593] mov si,DirEnvVar ; "DIRCMD=" - 17146 ;invoke Find_Name_In_Environment - 17147 000016B4 E80010 call find_name_in_environment - 17148 000016B7 7214 jc short geRet ; name not found in environment - 17149 - 17150 ; ES:DI = ptr to value of environment variable - 17151 ; We're assuming DS, CS, and SS are unchanged. + 17133 ; Otherwise: + 17134 ; SI = ptr to environment variable asciiz value in TRANGROUP + 17135 ; + 17136 ; USED AX,BX,CX,DX,DI + 17137 ; (We assume the (almost) worst, since we don't know about + 17138 ; Find_Name_In_Environment.) + 17139 ; + 17140 ; EFFECTS + 17141 ; + 17142 ; ScanBuf is loaded with value text + 17143 + 17144 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17145 GetEnvValue: + 17146 000016B0 06 push es ; save ES + 17147 ;mov si,offset TRANGROUP:DirEnvVar ; DS:SI = ptr to variable name + 17148 000016B1 BE[0593] mov si,DirEnvVar ; "DIRCMD=" + 17149 ;invoke Find_Name_In_Environment + 17150 000016B4 E80010 call find_name_in_environment + 17151 000016B7 7214 jc short geRet ; name not found in environment 17152 - 17153 000016B9 1E push ds - 17154 000016BA 06 push es - 17155 000016BB 1F pop ds - 17156 000016BC 07 pop es - 17157 - 17158 ;assume ds:nothing - 17159 - 17160 ; DS = seg addr of environment variable value (in environment segment) - 17161 ; ES = TRANGROUP seg addr + 17153 ; ES:DI = ptr to value of environment variable + 17154 ; We're assuming DS, CS, and SS are unchanged. + 17155 + 17156 000016B9 1E push ds + 17157 000016BA 06 push es + 17158 000016BB 1F pop ds + 17159 000016BC 07 pop es + 17160 + 17161 ;assume ds:nothing 17162 - 17163 000016BD 89FE mov si,di ; DS:SI = ptr to value string - 17164 ;mov di,offset TRANGROUP:ScanBuf ; ES:DI = ptr to dest buffer - 17165 000016BF BF[7B9E] mov di,ScanBuf - 17166 geLoop: - 17167 ;@@: - 17168 000016C2 AC lodsb - 17169 000016C3 08C0 or al,al - 17170 000016C5 AA stosb - 17171 ;loopnz @B ; move the string, including trailing null - 17172 000016C6 E0FA loopnz geLoop - 17173 - 17174 000016C8 06 push es - 17175 000016C9 1F pop ds ; DS = TRANGROUP seg addr again - 17176 ;assume ds:TRANGROUP - 17177 - 17178 ;mov si,offset TRANGROUP:ScanBuf ; SI = ptr to var value - 17179 000016CA BE[7B9E] mov si,ScanBuf - 17180 geRet: - 17181 000016CD 07 pop es ; restore ES - 17182 000016CE C3 retn - 17183 - 17184 ; --------------------------------------------------------------------------- - 17185 - 17186 ;*** GetFirst - get first directory entry from disk - 17187 ; - 17188 ; ENTRY DOS DTA established at DirBuf - 17189 ; FCB contains drive # and filename - 17190 ; Current directory (on selected drive) is the one to search - 17191 ; AttrSpecified & AttrSelect masks set - 17192 ; - 17193 ; EXIT CY = clear if success - 17194 ; DirBuf contains extended FCB for file found + 17163 ; DS = seg addr of environment variable value (in environment segment) + 17164 ; ES = TRANGROUP seg addr + 17165 + 17166 000016BD 89FE mov si,di ; DS:SI = ptr to value string + 17167 ;mov di,offset TRANGROUP:ScanBuf ; ES:DI = ptr to dest buffer + 17168 000016BF BF[7B9E] mov di,ScanBuf + 17169 geLoop: + 17170 ;@@: + 17171 000016C2 AC lodsb + 17172 000016C3 08C0 or al,al + 17173 000016C5 AA stosb + 17174 ;loopnz @B ; move the string, including trailing null + 17175 000016C6 E0FA loopnz geLoop + 17176 + 17177 000016C8 06 push es + 17178 000016C9 1F pop ds ; DS = TRANGROUP seg addr again + 17179 ;assume ds:TRANGROUP + 17180 + 17181 ;mov si,offset TRANGROUP:ScanBuf ; SI = ptr to var value + 17182 000016CA BE[7B9E] mov si,ScanBuf + 17183 geRet: + 17184 000016CD 07 pop es ; restore ES + 17185 000016CE C3 retn + 17186 + 17187 ; --------------------------------------------------------------------------- + 17188 + 17189 ;*** GetFirst - get first directory entry from disk + 17190 ; + 17191 ; ENTRY DOS DTA established at DirBuf + 17192 ; FCB contains drive # and filename + 17193 ; Current directory (on selected drive) is the one to search + 17194 ; AttrSpecified & AttrSelect masks set 17195 ; - 17196 ; If unsuccessful, - 17197 ; CY = set - 17198 ; Ready for DOS Get Extended Error call - 17199 ; - 17200 ; USED AX,DX - 17201 ; - 17202 ; EFFECTS - 17203 ; - 17204 ; FCB-7 = 0FFh to mark extended FCB - 17205 ; FCB-1 = attribute mask to find all files - 17206 ; These fields should remain unmodified for GetNext calls. - 17207 ; - 17208 ;*** GetNext - get next directory entry from disk - 17209 ; - 17210 ; ENTRY As for GetFirst, plus - 17211 ; FCB-7 set up as extended FCB w/ find-all attribute byte + 17196 ; EXIT CY = clear if success + 17197 ; DirBuf contains extended FCB for file found + 17198 ; + 17199 ; If unsuccessful, + 17200 ; CY = set + 17201 ; Ready for DOS Get Extended Error call + 17202 ; + 17203 ; USED AX,DX + 17204 ; + 17205 ; EFFECTS + 17206 ; + 17207 ; FCB-7 = 0FFh to mark extended FCB + 17208 ; FCB-1 = attribute mask to find all files + 17209 ; These fields should remain unmodified for GetNext calls. + 17210 ; + 17211 ;*** GetNext - get next directory entry from disk 17212 ; - 17213 ; EXIT As for GetFirst - 17214 ; - 17215 ; USED AX,DX - 17216 - 17217 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17218 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:144Fh + 17213 ; ENTRY As for GetFirst, plus + 17214 ; FCB-7 set up as extended FCB w/ find-all attribute byte + 17215 ; + 17216 ; EXIT As for GetFirst + 17217 ; + 17218 ; USED AX,DX 17219 - 17220 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 17221 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1660h - 17222 GetFirst: - 17223 ;mov byte [55h],0FFh ; -1 - 17224 000016CF C6065500FF mov byte [FCB-7],0FFh ; signal extended FCB - 17225 ;mov byte [5Bh],16h - 17226 000016D4 C6065B0016 mov byte [FCB-1],ATTR_ALL ; 16h - 17227 ; find any file - 17228 ; 07/06/2023 - 17229 ;mov dx,FCB-7 ; 55h ; DX = ptr to extended FCB - 17230 000016D9 B411 mov ah,11h - 17231 ;mov ah,Dir_Search_First ; AH = DOS Find First function code - 17232 ; 07/06/2023 - 17233 ;int 21h ; call DOS - 17234 ;shl al,1 ; CY = set if error - 17235 ;jc short gfRet ; return error - 17236 ;jmp short gfFound ; go look at attr's - 17237 ; 07/06/2023 - 17238 000016DB EB02 jmp short GetFrstNxt - 17239 GetNext: + 17220 ; 18/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17221 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:144Fh + 17222 + 17223 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 17224 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1660h + 17225 GetFirst: + 17226 ;mov byte [55h],0FFh ; -1 + 17227 000016CF C6065500FF mov byte [FCB-7],0FFh ; signal extended FCB + 17228 ;mov byte [5Bh],16h + 17229 000016D4 C6065B0016 mov byte [FCB-1],ATTR_ALL ; 16h + 17230 ; find any file + 17231 ; 07/06/2023 + 17232 ;mov dx,FCB-7 ; 55h ; DX = ptr to extended FCB + 17233 000016D9 B411 mov ah,11h + 17234 ;mov ah,Dir_Search_First ; AH = DOS Find First function code + 17235 ; 07/06/2023 + 17236 ;int 21h ; call DOS + 17237 ;shl al,1 ; CY = set if error + 17238 ;jc short gfRet ; return error + 17239 ;jmp short gfFound ; go look at attr's 17240 ; 07/06/2023 - 17241 ;;mov dx,55h - 17242 ;mov dx,FCB-7 ; DX = ptr to extended FCB - 17243 000016DD B412 mov ah,12h - 17244 ;mov ah,Dir_Search_Next ; AH = DOS Find Next function code - 17245 GetFrstNxt: - 17246 ; 07/06/2023 - 17247 000016DF BA5500 mov dx,FCB-7 ; mov dx,55h - 17248 ; - 17249 000016E2 CD21 int 21h ; call DOS - 17250 000016E4 D0E0 shl al,1 ; CY = set if error - 17251 000016E6 7211 jc short gfRet ; return error - 17252 - 17253 ;* Found an entry. Check attributes. - 17254 gfFound: - 17255 ;;mov al,[DirBuf+8].dir_attr ; AL = file attributes - 17256 ;mov al,[DIRBUF+19] - 17257 000016E8 A0[4C9D] mov al,[DIRBUF+8+DIR_ENTRY.DIR_ATTR] - 17258 000016EB 8A26[939D] mov ah,[AttrSpecified] ; AH = mask of pertinent attr's - 17259 000016EF 20E0 and al,ah ; AL = pertinent attr's of file - 17260 000016F1 2226[949D] and ah,[AttrSelect] ; AH = attr settings to match - 17261 000016F5 38E0 cmp al,ah - 17262 000016F7 75E4 jne short GetNext ; attr's don't match, look for another - 17263 gfRet: - 17264 000016F9 C3 retn - 17265 - 17266 ; --------------------------------------------------------------------------- - 17267 - 17268 ;*** ListDir - search for and list files in the current directory - 17269 ; - 17270 ; List header, files, and trailer for current directory on selected - 17271 ; drive. Header & trailer are listed if at least one file is found. - 17272 ; If no qualifying files are found, no display output occurs. - 17273 ; - 17274 ; ENTRY Current directory (on selected drive) is the one to be listed - 17275 ; FCB contains selected drive # and filename spec - 17276 ; Option bits, attribute masks, and sort codes set up - 17277 ; - 17278 ; EXIT CY = clear if no error - 17279 ; FileCnt = # files found & displayed + 17241 000016DB EB02 jmp short GetFrstNxt + 17242 GetNext: + 17243 ; 07/06/2023 + 17244 ;;mov dx,55h + 17245 ;mov dx,FCB-7 ; DX = ptr to extended FCB + 17246 000016DD B412 mov ah,12h + 17247 ;mov ah,Dir_Search_Next ; AH = DOS Find Next function code + 17248 GetFrstNxt: + 17249 ; 07/06/2023 + 17250 000016DF BA5500 mov dx,FCB-7 ; mov dx,55h + 17251 ; + 17252 000016E2 CD21 int 21h ; call DOS + 17253 000016E4 D0E0 shl al,1 ; CY = set if error + 17254 000016E6 7211 jc short gfRet ; return error + 17255 + 17256 ;* Found an entry. Check attributes. + 17257 gfFound: + 17258 ;;mov al,[DirBuf+8].dir_attr ; AL = file attributes + 17259 ;mov al,[DIRBUF+19] + 17260 000016E8 A0[4C9D] mov al,[DIRBUF+8+DIR_ENTRY.DIR_ATTR] + 17261 000016EB 8A26[939D] mov ah,[AttrSpecified] ; AH = mask of pertinent attr's + 17262 000016EF 20E0 and al,ah ; AL = pertinent attr's of file + 17263 000016F1 2226[949D] and ah,[AttrSelect] ; AH = attr settings to match + 17264 000016F5 38E0 cmp al,ah + 17265 000016F7 75E4 jne short GetNext ; attr's don't match, look for another + 17266 gfRet: + 17267 000016F9 C3 retn + 17268 + 17269 ; --------------------------------------------------------------------------- + 17270 + 17271 ;*** ListDir - search for and list files in the current directory + 17272 ; + 17273 ; List header, files, and trailer for current directory on selected + 17274 ; drive. Header & trailer are listed if at least one file is found. + 17275 ; If no qualifying files are found, no display output occurs. + 17276 ; + 17277 ; ENTRY Current directory (on selected drive) is the one to be listed + 17278 ; FCB contains selected drive # and filename spec + 17279 ; Option bits, attribute masks, and sort codes set up 17280 ; - 17281 ; If error, - 17282 ; CY = set - 17283 ; Ready for DOS Get Extended Error call - 17284 ; - 17285 ; USED AX,BX,CX,DX,SI,DI,BP - 17286 ; FileSiz + 17281 ; EXIT CY = clear if no error + 17282 ; FileCnt = # files found & displayed + 17283 ; + 17284 ; If error, + 17285 ; CY = set + 17286 ; Ready for DOS Get Extended Error call 17287 ; - 17288 ; EFFECTS - 17289 ; - 17290 ; FileCntTotal, FileSizTotal are updated. - 17291 ; Files found are listed. A directory header and trailer are - 17292 ; displayed only if files are found. - 17293 - 17294 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17295 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:155Eh + 17288 ; USED AX,BX,CX,DX,SI,DI,BP + 17289 ; FileSiz + 17290 ; + 17291 ; EFFECTS + 17292 ; + 17293 ; FileCntTotal, FileSizTotal are updated. + 17294 ; Files found are listed. A directory header and trailer are + 17295 ; displayed only if files are found. 17296 - 17297 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 17298 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1694h + 17297 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17298 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:155Eh 17299 - 17300 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 17301 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1776h - 17302 ListDir: - 17303 000016FA 31C0 xor ax,ax ; 0 - 17304 000016FC A3[209C] mov [FileCnt],ax ; zero file count - 17305 000016FF A3[229C] mov [FileSiz],ax ; zero file size accumulator - 17306 00001702 A3[249C] mov [FileSiz+2],ax - 17307 - 17308 ; 31/07/2024 - 17309 ; PCDOS 7.1 COMMAND.COM - 17310 %if 1 - 17311 00001705 A3[269C] mov [FileSiz+4],ax - 17312 00001708 A3[289C] mov [FileSiz+6],ax - 17313 %else - 17314 ; 08/06/2023 - 17315 ; MSDOS 6.0 - 17316 ;ifdef DBLSPACE_HOOKS - 17317 mov [ccluUsedDir],ax ; zero count clusters used - 17318 mov [csecUsedDir],ax ; zero count compressed sectors used - 17319 mov [csecUsedDir+2],ax - 17320 ;endif - 17321 %endif - 17322 ;cmp byte [DestBuf],0 ; check for sort code - 17323 ; 31/07/2024 - 17324 0000170B 3806[BE9D] cmp [DestBuf],al ; 0 - 17325 0000170F 740A je short ld1 ; no sort - 17326 00001711 E83000 call LoadEntries ; load entries for sorted listing - 17327 00001714 7305 jnc short ld1 ; no error - continue - 17328 00001716 E83209 call get_ext_error_number ; AX = DOS error code - 17329 ; 19/02/2023 - 17330 ;stc - 17331 00001719 EB12 jmp short ldErr ; return error - 17332 ld1: - 17333 0000171B E8DAFE call FindFirst ; find first file - 17334 0000171E 720D jc short ldErr ; not found, return error - 17335 - 17336 ; BX = offset in TPA buffer of entry found - 17337 - 17338 00001720 E82203 call DisplayHeader ; if at least one file, display header - 17339 ldNext: - 17340 00001723 E8FA02 call DisplayFile ; display the file entry - 17341 ;ldNext: - 17342 00001726 E8D4FE call FindNext ; find another file - 17343 00001729 7202 jc short ldErr ; not found - 17344 ;call DisplayFile ; display entry - 17345 ;jmp short ldNext ; go find another one - 17346 ; 19/02/2023 - 17347 0000172B EBF6 jmp short ldNext - 17348 ldErr: - 17349 ;cmp ax,2 - 17350 0000172D 83F802 cmp ax,ERROR_FILE_NOT_FOUND - 17351 00001730 7407 je short ldDone ; file not found, we're done - 17352 ;cmp ax,18 - 17353 00001732 83F812 cmp ax,ERROR_NO_MORE_FILES - 17354 00001735 7402 je short ldDone ; no more files, we're done - 17355 00001737 F9 stc - 17356 ;jmp short ldRet - 17357 ; 19/02/2023 - 17358 00001738 C3 retn - 17359 ldDone: - 17360 00001739 833E[209C]00 cmp word [FileCnt],0 - 17361 ;je short ld2 ; no files found, just return - 17362 ; 25/04/2023 - 17363 0000173E 7403 jz short ldRet - 17364 00001740 E8A104 call DisplayTrailer ; display trailing info - 17365 ; 08/06/2023 - 17366 ; cf=0 - 17367 ;ld2: - 17368 ;clc ; return success - 17369 ldRet: - 17370 00001743 C3 retn - 17371 - 17372 ; --------------------------------------------------------------------------- - 17373 - 17374 ;*** LoadEntries - attempt to load entries from current directory - 17375 ; - 17376 ; Load all qualifying directory entries from the current directory - 17377 ; into the TPA. If an error is returned by FindFirst/FindNext calls - 17378 ; other than 'no more files', return to caller with carry flag set. - 17379 ; If we run out of buffer space, display a message that we haven't - 17380 ; enough memory to sort this directory, but return without error. - 17381 ; Other routines know whether or not entries have been loaded by - 17382 ; the 'inmem' flag bit, which we set here. - 17383 ; - 17384 ; The TPA is usually 64K - 512 bytes long. At 20 bytes per entry, - 17385 ; this allows sorting over 3000 entries in a directory. + 17300 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 17301 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1694h + 17302 + 17303 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 17304 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1776h + 17305 ListDir: + 17306 000016FA 31C0 xor ax,ax ; 0 + 17307 000016FC A3[209C] mov [FileCnt],ax ; zero file count + 17308 000016FF A3[229C] mov [FileSiz],ax ; zero file size accumulator + 17309 00001702 A3[249C] mov [FileSiz+2],ax + 17310 + 17311 ; 31/07/2024 + 17312 ; PCDOS 7.1 COMMAND.COM + 17313 %if 1 + 17314 00001705 A3[269C] mov [FileSiz+4],ax + 17315 00001708 A3[289C] mov [FileSiz+6],ax + 17316 %else + 17317 ; 08/06/2023 + 17318 ; MSDOS 6.0 + 17319 ;ifdef DBLSPACE_HOOKS + 17320 mov [ccluUsedDir],ax ; zero count clusters used + 17321 mov [csecUsedDir],ax ; zero count compressed sectors used + 17322 mov [csecUsedDir+2],ax + 17323 ;endif + 17324 %endif + 17325 ;cmp byte [DestBuf],0 ; check for sort code + 17326 ; 31/07/2024 + 17327 0000170B 3806[BE9D] cmp [DestBuf],al ; 0 + 17328 0000170F 740A je short ld1 ; no sort + 17329 00001711 E83000 call LoadEntries ; load entries for sorted listing + 17330 00001714 7305 jnc short ld1 ; no error - continue + 17331 00001716 E83209 call get_ext_error_number ; AX = DOS error code + 17332 ; 19/02/2023 + 17333 ;stc + 17334 00001719 EB12 jmp short ldErr ; return error + 17335 ld1: + 17336 0000171B E8DAFE call FindFirst ; find first file + 17337 0000171E 720D jc short ldErr ; not found, return error + 17338 + 17339 ; BX = offset in TPA buffer of entry found + 17340 + 17341 00001720 E82203 call DisplayHeader ; if at least one file, display header + 17342 ldNext: + 17343 00001723 E8FA02 call DisplayFile ; display the file entry + 17344 ;ldNext: + 17345 00001726 E8D4FE call FindNext ; find another file + 17346 00001729 7202 jc short ldErr ; not found + 17347 ;call DisplayFile ; display entry + 17348 ;jmp short ldNext ; go find another one + 17349 ; 19/02/2023 + 17350 0000172B EBF6 jmp short ldNext + 17351 ldErr: + 17352 ;cmp ax,2 + 17353 0000172D 83F802 cmp ax,ERROR_FILE_NOT_FOUND + 17354 00001730 7407 je short ldDone ; file not found, we're done + 17355 ;cmp ax,18 + 17356 00001732 83F812 cmp ax,ERROR_NO_MORE_FILES + 17357 00001735 7402 je short ldDone ; no more files, we're done + 17358 00001737 F9 stc + 17359 ;jmp short ldRet + 17360 ; 19/02/2023 + 17361 00001738 C3 retn + 17362 ldDone: + 17363 00001739 833E[209C]00 cmp word [FileCnt],0 + 17364 ;je short ld2 ; no files found, just return + 17365 ; 25/04/2023 + 17366 0000173E 7403 jz short ldRet + 17367 00001740 E8A104 call DisplayTrailer ; display trailing info + 17368 ; 08/06/2023 + 17369 ; cf=0 + 17370 ;ld2: + 17371 ;clc ; return success + 17372 ldRet: + 17373 00001743 C3 retn + 17374 + 17375 ; --------------------------------------------------------------------------- + 17376 + 17377 ;*** LoadEntries - attempt to load entries from current directory + 17378 ; + 17379 ; Load all qualifying directory entries from the current directory + 17380 ; into the TPA. If an error is returned by FindFirst/FindNext calls + 17381 ; other than 'no more files', return to caller with carry flag set. + 17382 ; If we run out of buffer space, display a message that we haven't + 17383 ; enough memory to sort this directory, but return without error. + 17384 ; Other routines know whether or not entries have been loaded by + 17385 ; the 'inmem' flag bit, which we set here. 17386 ; - 17387 ; ENTRY Tpa = buffer seg addr - 17388 ; BytCnt = buffer length, in bytes - 17389 ; Current directory (on selected drive) is the one to load - 17390 ; FCB contains drive # and filespec - 17391 ; Bits, AttrSpecified, AttrSelect, & DestBuf (sort codes) are set - 17392 ; - 17393 ; EXIT CY = set if error - 17394 ; If error, DOS Get Extended Error will get error info + 17387 ; The TPA is usually 64K - 512 bytes long. At 20 bytes per entry, + 17388 ; this allows sorting over 3000 entries in a directory. + 17389 ; + 17390 ; ENTRY Tpa = buffer seg addr + 17391 ; BytCnt = buffer length, in bytes + 17392 ; Current directory (on selected drive) is the one to load + 17393 ; FCB contains drive # and filespec + 17394 ; Bits, AttrSpecified, AttrSelect, & DestBuf (sort codes) are set 17395 ; - 17396 ; USED AX,CX,DX,SI,DI - 17397 ; - 17398 ; EFFECTS - 17399 ; - 17400 ; Inmem bit of Bits = set if load succeeded. - 17401 ; Tpa buffer contains directory entries. - 17402 ; Byte after last entry = 0FFh. - 17403 - 17404 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17405 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 17406 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 17407 LoadEntries: - 17408 00001744 06 push es ; save TRANGROUP seg addr - 17409 00001745 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr - 17410 00001749 31FF xor di,di ; ES:DI = destination ptr - 17411 ;;;and Bits,not mask inmem ; signal entries not loaded - 17412 ; MSDOS 5.0 - 17413 ;;;and word [_Bits],0FFDFh - 17414 ;;and byte [_Bits],0DFh ; not 20h - 17415 ; 31/07/2024 - 17416 ;and word [_Bits],0FF7Fh ; PCDOS 7.1 COMMAND.COM - 17417 ; 08/06/2023 - 17418 ;and byte [_Bits],0BFh ; ~20h ; MSDOS 6.0 - 17419 0000174B 8026[8B9D]7F and byte [_Bits],~mask.inmem ; 0BFh ; MSDOS 6.0 - 17420 ; 31/07/2024 ; 07Fh ; PCDOS 7.1 - 17421 - 17422 00001750 E87CFF call GetFirst ; look for first file - 17423 00001753 7221 jc short leRet ; return any error - 17424 00001755 E82000 call LoadEntry ; load entry into TPA - 17425 leNext: - 17426 00001758 E882FF call GetNext ; get another file - 17427 0000175B 720F jc short leLoaded ; assume any error is no more files - 17428 0000175D A1[159C] mov ax,[BYTCNT] ; AX = size of TPA - 17429 00001760 29F8 sub ax,di ; AX = bytes left in TPA - 17430 ; 08/06/2023 - 17431 ;;cmp ax,size EntryStruc+2 ; insist on entry size + 2 bytes - 17432 ;cmp ax,23 ; 21+2 ; MSDOS 5.0 - 17433 00001762 83F818 cmp ax,24 ; 22+2 ; MSDOS 6.0 - 17434 00001765 720E jb short leOk ; not enough memory left, give up - 17435 00001767 E80E00 call LoadEntry ; load entry into TPA - 17436 0000176A EBEC jmp short leNext ; go get another file - 17437 - 17438 leLoaded: - 17439 0000176C 26C605FF mov byte [es:di],0FFh ; mark end of entry list - 17440 ;;;or Bits,mask inmem ; signal entries loaded in memory - 17441 ; MSDOS 5.0 - 17442 ;;or word [_Bits],20h - 17443 ;or byte [_Bits],20h - 17444 ; 08/06/2023 - 17445 ;or byte [_Bits],40h ; MSDOS 6.0 - 17446 00001770 800E[8B9D]80 or byte [_Bits],mask.inmem ; 40h ; MSDOS 6.0 - 17447 ; 31/07/2024 ; 80h ; PCDOS 7.1 - 17448 ; 25/04/2023 - 17449 ; cf = 0 - 17450 leOk: - 17451 00001775 F8 clc ; return no error - 17452 leRet: - 17453 00001776 07 pop es ; ES = TRANGROUP seg addr again - 17454 00001777 C3 retn - 17455 - 17456 ; --------------------------------------------------------------------------- - 17457 - 17458 ;*** LoadEntry - load directory entry from DirBuf ext'd FCB - 17459 ; - 17460 ; ENTRY ES:DI = ptr to load point in TPA - 17461 ; DirBuf contains extended FCB of entry to load + 17396 ; EXIT CY = set if error + 17397 ; If error, DOS Get Extended Error will get error info + 17398 ; + 17399 ; USED AX,CX,DX,SI,DI + 17400 ; + 17401 ; EFFECTS + 17402 ; + 17403 ; Inmem bit of Bits = set if load succeeded. + 17404 ; Tpa buffer contains directory entries. + 17405 ; Byte after last entry = 0FFh. + 17406 + 17407 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17408 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 17409 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 17410 LoadEntries: + 17411 00001744 06 push es ; save TRANGROUP seg addr + 17412 00001745 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr + 17413 00001749 31FF xor di,di ; ES:DI = destination ptr + 17414 ;;;and Bits,not mask inmem ; signal entries not loaded + 17415 ; MSDOS 5.0 + 17416 ;;;and word [_Bits],0FFDFh + 17417 ;;and byte [_Bits],0DFh ; not 20h + 17418 ; 31/07/2024 + 17419 ;and word [_Bits],0FF7Fh ; PCDOS 7.1 COMMAND.COM + 17420 ; 08/06/2023 + 17421 ;and byte [_Bits],0BFh ; ~20h ; MSDOS 6.0 + 17422 0000174B 8026[8B9D]7F and byte [_Bits],~mask.inmem ; 0BFh ; MSDOS 6.0 + 17423 ; 31/07/2024 ; 07Fh ; PCDOS 7.1 + 17424 + 17425 00001750 E87CFF call GetFirst ; look for first file + 17426 00001753 7221 jc short leRet ; return any error + 17427 00001755 E82000 call LoadEntry ; load entry into TPA + 17428 leNext: + 17429 00001758 E882FF call GetNext ; get another file + 17430 0000175B 720F jc short leLoaded ; assume any error is no more files + 17431 0000175D A1[159C] mov ax,[BYTCNT] ; AX = size of TPA + 17432 00001760 29F8 sub ax,di ; AX = bytes left in TPA + 17433 ; 08/06/2023 + 17434 ;;cmp ax,size EntryStruc+2 ; insist on entry size + 2 bytes + 17435 ;cmp ax,23 ; 21+2 ; MSDOS 5.0 + 17436 00001762 83F818 cmp ax,24 ; 22+2 ; MSDOS 6.0 + 17437 00001765 720E jb short leOk ; not enough memory left, give up + 17438 00001767 E80E00 call LoadEntry ; load entry into TPA + 17439 0000176A EBEC jmp short leNext ; go get another file + 17440 + 17441 leLoaded: + 17442 0000176C 26C605FF mov byte [es:di],0FFh ; mark end of entry list + 17443 ;;;or Bits,mask inmem ; signal entries loaded in memory + 17444 ; MSDOS 5.0 + 17445 ;;or word [_Bits],20h + 17446 ;or byte [_Bits],20h + 17447 ; 08/06/2023 + 17448 ;or byte [_Bits],40h ; MSDOS 6.0 + 17449 00001770 800E[8B9D]80 or byte [_Bits],mask.inmem ; 40h ; MSDOS 6.0 + 17450 ; 31/07/2024 ; 80h ; PCDOS 7.1 + 17451 ; 25/04/2023 + 17452 ; cf = 0 + 17453 leOk: + 17454 00001775 F8 clc ; return no error + 17455 leRet: + 17456 00001776 07 pop es ; ES = TRANGROUP seg addr again + 17457 00001777 C3 retn + 17458 + 17459 ; --------------------------------------------------------------------------- + 17460 + 17461 ;*** LoadEntry - load directory entry from DirBuf ext'd FCB 17462 ; - 17463 ; EXIT ES:DI = ptr to next byte available in TPA - 17464 ; - 17465 ; USED AX,CX,SI - 17466 ; - 17467 ; NOTES - 17468 ; - 17469 ; I could've used symbolic offsets and sizes of fields from - 17470 ; the dir_entry struc to do this, but this is time-critical, - 17471 ; so I hard-wired the structure of the DOS 4.x returned FCB, - 17472 ; as well as our private directory entry structure. - 17473 ; - 17474 ; We force a zero size for subdirectory files. A zero size is - 17475 ; ordinarily returned for subdirectories, but with Novell - 17476 ; Netware 286 or 386 loaded, we can't depend on it. Bug #1594. - 17477 - 17478 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17479 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:15DDh - 17480 - 17481 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM - 17482 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:171Ch - 17483 - 17484 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 17485 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:17FDh - 17486 LoadEntry: - 17487 ;mov si,offset TRANGROUP:Dirbuf+8 ; DS:SI = ptr to filename - 17488 00001778 BE[419D] mov si,DIRBUF+8 - 17489 0000177B 30C0 xor al,al ; AL = 0 - 17490 0000177D AA stosb ; 'used' byte = false - 17491 0000177E B90B00 mov cx,11 - 17492 00001781 F3A4 rep movsb ; transfer filename & extension - 17493 00001783 AC lodsb ; AL = attrib byte - 17494 00001784 AA stosb ; store attrib byte - 17495 ;add si,10 ; 22-11-1 - 17496 ;add si,dir_time-dir_attr-1 ; skip to time field - 17497 00001785 83C60A add si,(DIR_ENTRY.DIR_TIME-DIR_ENTRY.DIR_ATTR)-1 - 17498 00001788 A5 movsw ; transfer time - 17499 00001789 A5 movsw ; transfer date - 17500 - 17501 ; 08/06/2023 - 17502 ; MSDOS 5.0 - 17503 %if 0 - 17504 inc si ; skip alloc unit - 17505 inc si - 17506 ;and al,10h - 17507 and al,ATTR_DIRECTORY - 17508 jnz short leSetDirSize ; force zero size for subdir - 17509 movsw - 17510 movsw ; transfer size - 17511 retn - 17512 leSetDirSize: - 17513 xor ax,ax ; 0 - 17514 stosw - 17515 stosw ; store zero size - 17516 retn - 17517 %endif - 17518 - 17519 ; 08/06/2023 - 17520 ; MSDOS 6.0 - 17521 ;%if 1 - 17522 ;ifdef DBLSPACE_HOOKS - 17523 0000178A 88C1 mov cl,al ; attrib to cl - 17524 0000178C AD lodsw ; allocation unit (cluster - 17525 ;and cl,10h - 17526 0000178D 80E110 and cl,ATTR_DIRECTORY - 17527 00001790 7506 jnz short leSetDirSize ; force zero size for subdir - 17528 00001792 A5 movsw - 17529 00001793 A5 movsw ; transfer size - 17530 - 17531 ; 31/07/2024 - Retro DOS 5.0 - PCDOS 7.1 COMMAND.COM - 17532 %if 0 - 17533 ;;test word [_Bits],1 - 17534 ;test word [_Bits],mask.cratio ; compression ratio report? - 17535 test byte [_Bits],mask.cratio - 17536 jnz short leCalcRatio ; yup - 17537 %endif - 17538 - 17539 00001794 31C0 xor ax,ax - 17540 00001796 AA stosb ; dummy compression ratio - 17541 00001797 C3 retn - 17542 - 17543 ; 31/07/2024 - Retro DOS 5.0 - PCDOS 7.1 COMMAND.COM - 17544 %if 0 - 17545 leCalcRatio: - 17546 call CalcCompRatio ; takes cluster in AX - 17547 or ax,ax ; returns ratio in AX - 17548 jz short leNoRatio ; 0 means couldn't calculate - 17549 dec ah ; pack 1.0 - 16.0 comp ratio - 17550 mov cl,4 ; into 2 nibbles. Store - 17551 shl ah,cl ; 1-16 as 0-15 in hi nibble, - 17552 or al,ah ; tenths (0-9) in low nibble - 17553 stosb - 17554 retn - 17555 %endif - 17556 - 17557 leSetDirSize: - 17558 00001798 31C0 xor ax,ax ; 0 - 17559 0000179A AB stosw - 17560 0000179B AB stosw ; store zero size - 17561 leNoRatio: - 17562 0000179C FEC8 dec al ; al = FFh = special invalid - 17563 0000179E AA stosb ; compression ratio - 17564 0000179F C3 retn - 17565 ;endif - 17566 ;%endif - 17567 - 17568 ; --------------------------------------------------------------------------- - 17569 - 17570 ;*** NoOrder - turn sorting off - 17571 ; - 17572 ; ENTRY nothing - 17573 ; - 17574 ; EXIT CY clear - 17575 ; - 17576 ; USED AX - 17577 ; - 17578 ; EFFECTS - 17579 ; - 17580 ; DestBuf is updated with sort code bytes. See DestBuf description. - 17581 - 17582 ; 19/02/2023 - 17583 NoOrder: - 17584 000017A0 C606[BE9D]00 mov byte [DestBuf],0 - 17585 ; no sort - 17586 000017A5 F8 clc ; no error - 17587 000017A6 C3 retn - 17588 - 17589 ; --------------------------------------------------------------------------- - 17590 - 17591 ;*** OnOffSw - record occurence of on/off option switch - 17592 ; - 17593 ; ENTRY DI = index into word list of switches - 17594 ; - 17595 ; EXIT CY clear - 17596 ; - 17597 ; USED AX,CX - 17598 ; - 17599 ; EFFECTS - 17600 ; - 17601 ; Bits modified to indicate option state. - 17602 - 17603 ; 19/02/2023 - 17604 OnOffSw: - 17605 000017A7 89F9 mov cx,di ; CX = index into word list of options - 17606 000017A9 D1E9 shr cx,1 - 17607 000017AB D1E9 shr cx,1 ; CX = bit position of option - 17608 000017AD B80100 mov ax,1 - 17609 000017B0 D3E0 shl ax,cl ; AX = bit mask of option - 17610 000017B2 F7C70200 test di,2 ; check if it is a negated option - 17611 000017B6 7405 jz short oo1 ; it's negated - 17612 ;or Bits,ax ; turn option on - 17613 000017B8 0906[8B9D] or [_Bits],ax - 17614 ;jmp short ooRet - 17615 ; 19/02/2023 - 17616 ;cf=0 - 17617 000017BC C3 retn - 17618 oo1: - 17619 000017BD F7D0 not ax ; AX = complemented bit mask of option - 17620 ;and Bits,ax ; turn option off - 17621 000017BF 2106[8B9D] and [_Bits],ax - 17622 ooRet: - 17623 ; 19/02/2023 - 17624 ;cf=0 - 17625 ;clc ; always return success - 17626 000017C3 C3 retn - 17627 - 17628 ; --------------------------------------------------------------------------- - 17629 - 17630 ;*** ParseAttr - parse and record /A option - 17631 ; - 17632 ; ENTRY BX = ptr to system parser result buffer for /A occurence - 17633 ; - 17634 ; EXIT CY = set if error occurs parsing attribute conditions - 17635 ; - 17636 ; For parse error, we set up for Std_EPrintf call: - 17637 ; AX = parse error code, like system parser - 17638 ; DX = ptr to message block - 17639 ; - 17640 ; USED AX,CX,DX,DI - 17641 ; - 17642 ; EFFECTS - 17643 ; - 17644 ; AttrSpecified, AttrSelect are updated with new attribute conditions. - 17645 ; If parse error occurs, attribute conditions parsed so far hold. + 17463 ; ENTRY ES:DI = ptr to load point in TPA + 17464 ; DirBuf contains extended FCB of entry to load + 17465 ; + 17466 ; EXIT ES:DI = ptr to next byte available in TPA + 17467 ; + 17468 ; USED AX,CX,SI + 17469 ; + 17470 ; NOTES + 17471 ; + 17472 ; I could've used symbolic offsets and sizes of fields from + 17473 ; the dir_entry struc to do this, but this is time-critical, + 17474 ; so I hard-wired the structure of the DOS 4.x returned FCB, + 17475 ; as well as our private directory entry structure. + 17476 ; + 17477 ; We force a zero size for subdirectory files. A zero size is + 17478 ; ordinarily returned for subdirectories, but with Novell + 17479 ; Netware 286 or 386 loaded, we can't depend on it. Bug #1594. + 17480 + 17481 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17482 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:15DDh + 17483 + 17484 ; 07/06/2023 - Retro DOS v4.2 COMMAND.COM + 17485 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:171Ch + 17486 + 17487 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 17488 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:17FDh + 17489 LoadEntry: + 17490 ;mov si,offset TRANGROUP:Dirbuf+8 ; DS:SI = ptr to filename + 17491 00001778 BE[419D] mov si,DIRBUF+8 + 17492 0000177B 30C0 xor al,al ; AL = 0 + 17493 0000177D AA stosb ; 'used' byte = false + 17494 0000177E B90B00 mov cx,11 + 17495 00001781 F3A4 rep movsb ; transfer filename & extension + 17496 00001783 AC lodsb ; AL = attrib byte + 17497 00001784 AA stosb ; store attrib byte + 17498 ;add si,10 ; 22-11-1 + 17499 ;add si,dir_time-dir_attr-1 ; skip to time field + 17500 00001785 83C60A add si,(DIR_ENTRY.DIR_TIME-DIR_ENTRY.DIR_ATTR)-1 + 17501 00001788 A5 movsw ; transfer time + 17502 00001789 A5 movsw ; transfer date + 17503 + 17504 ; 08/06/2023 + 17505 ; MSDOS 5.0 + 17506 %if 0 + 17507 inc si ; skip alloc unit + 17508 inc si + 17509 ;and al,10h + 17510 and al,ATTR_DIRECTORY + 17511 jnz short leSetDirSize ; force zero size for subdir + 17512 movsw + 17513 movsw ; transfer size + 17514 retn + 17515 leSetDirSize: + 17516 xor ax,ax ; 0 + 17517 stosw + 17518 stosw ; store zero size + 17519 retn + 17520 %endif + 17521 + 17522 ; 08/06/2023 + 17523 ; MSDOS 6.0 + 17524 ;%if 1 + 17525 ;ifdef DBLSPACE_HOOKS + 17526 0000178A 88C1 mov cl,al ; attrib to cl + 17527 0000178C AD lodsw ; allocation unit (cluster + 17528 ;and cl,10h + 17529 0000178D 80E110 and cl,ATTR_DIRECTORY + 17530 00001790 7506 jnz short leSetDirSize ; force zero size for subdir + 17531 00001792 A5 movsw + 17532 00001793 A5 movsw ; transfer size + 17533 + 17534 ; 31/07/2024 - Retro DOS 5.0 - PCDOS 7.1 COMMAND.COM + 17535 %if 0 + 17536 ;;test word [_Bits],1 + 17537 ;test word [_Bits],mask.cratio ; compression ratio report? + 17538 test byte [_Bits],mask.cratio + 17539 jnz short leCalcRatio ; yup + 17540 %endif + 17541 + 17542 00001794 31C0 xor ax,ax + 17543 00001796 AA stosb ; dummy compression ratio + 17544 00001797 C3 retn + 17545 + 17546 ; 31/07/2024 - Retro DOS 5.0 - PCDOS 7.1 COMMAND.COM + 17547 %if 0 + 17548 leCalcRatio: + 17549 call CalcCompRatio ; takes cluster in AX + 17550 or ax,ax ; returns ratio in AX + 17551 jz short leNoRatio ; 0 means couldn't calculate + 17552 dec ah ; pack 1.0 - 16.0 comp ratio + 17553 mov cl,4 ; into 2 nibbles. Store + 17554 shl ah,cl ; 1-16 as 0-15 in hi nibble, + 17555 or al,ah ; tenths (0-9) in low nibble + 17556 stosb + 17557 retn + 17558 %endif + 17559 + 17560 leSetDirSize: + 17561 00001798 31C0 xor ax,ax ; 0 + 17562 0000179A AB stosw + 17563 0000179B AB stosw ; store zero size + 17564 leNoRatio: + 17565 0000179C FEC8 dec al ; al = FFh = special invalid + 17566 0000179E AA stosb ; compression ratio + 17567 0000179F C3 retn + 17568 ;endif + 17569 ;%endif + 17570 + 17571 ; --------------------------------------------------------------------------- + 17572 + 17573 ;*** NoOrder - turn sorting off + 17574 ; + 17575 ; ENTRY nothing + 17576 ; + 17577 ; EXIT CY clear + 17578 ; + 17579 ; USED AX + 17580 ; + 17581 ; EFFECTS + 17582 ; + 17583 ; DestBuf is updated with sort code bytes. See DestBuf description. + 17584 + 17585 ; 19/02/2023 + 17586 NoOrder: + 17587 000017A0 C606[BE9D]00 mov byte [DestBuf],0 + 17588 ; no sort + 17589 000017A5 F8 clc ; no error + 17590 000017A6 C3 retn + 17591 + 17592 ; --------------------------------------------------------------------------- + 17593 + 17594 ;*** OnOffSw - record occurence of on/off option switch + 17595 ; + 17596 ; ENTRY DI = index into word list of switches + 17597 ; + 17598 ; EXIT CY clear + 17599 ; + 17600 ; USED AX,CX + 17601 ; + 17602 ; EFFECTS + 17603 ; + 17604 ; Bits modified to indicate option state. + 17605 + 17606 ; 19/02/2023 + 17607 OnOffSw: + 17608 000017A7 89F9 mov cx,di ; CX = index into word list of options + 17609 000017A9 D1E9 shr cx,1 + 17610 000017AB D1E9 shr cx,1 ; CX = bit position of option + 17611 000017AD B80100 mov ax,1 + 17612 000017B0 D3E0 shl ax,cl ; AX = bit mask of option + 17613 000017B2 F7C70200 test di,2 ; check if it is a negated option + 17614 000017B6 7405 jz short oo1 ; it's negated + 17615 ;or Bits,ax ; turn option on + 17616 000017B8 0906[8B9D] or [_Bits],ax + 17617 ;jmp short ooRet + 17618 ; 19/02/2023 + 17619 ;cf=0 + 17620 000017BC C3 retn + 17621 oo1: + 17622 000017BD F7D0 not ax ; AX = complemented bit mask of option + 17623 ;and Bits,ax ; turn option off + 17624 000017BF 2106[8B9D] and [_Bits],ax + 17625 ooRet: + 17626 ; 19/02/2023 + 17627 ;cf=0 + 17628 ;clc ; always return success + 17629 000017C3 C3 retn + 17630 + 17631 ; --------------------------------------------------------------------------- + 17632 + 17633 ;*** ParseAttr - parse and record /A option + 17634 ; + 17635 ; ENTRY BX = ptr to system parser result buffer for /A occurence + 17636 ; + 17637 ; EXIT CY = set if error occurs parsing attribute conditions + 17638 ; + 17639 ; For parse error, we set up for Std_EPrintf call: + 17640 ; AX = parse error code, like system parser + 17641 ; DX = ptr to message block + 17642 ; + 17643 ; USED AX,CX,DX,DI + 17644 ; + 17645 ; EFFECTS 17646 ; - 17647 ; For parse error, we set up for Std_EPrintf call: - 17648 ; Msg_Disp_Class = parse error message class - 17649 ; Message block (see DX) is set up for parse error message - 17650 - 17651 ; 19/02/2023 - 17652 ParseAttr: - 17653 000017C4 56 push si ; save SI - 17654 000017C5 C606[939D]00 mov byte [AttrSpecified],0 ; cancel all attribute conditions - 17655 - 17656 ; Each /A invocation starts by assuming all files are to be listed. - 17657 - 17658 ;;mov si,word ptr [bx].ValuePtr - 17659 ; SI = ptr to string after /A - 17660 ;mov si,[bx+ResultBuffer.ValuePtr] - 17661 000017CA 8B7704 mov si,[bx+4] - 17662 paLoop: - 17663 000017CD BA0100 mov dx,1 ; DX = 1 (for un-negated attribute) - 17664 000017D0 AC lodsb ; AL = next char in string - 17665 000017D1 08C0 or al,al - 17666 ;jz short paOk ; it's terminating null, we're done - 17667 ; 19/02/2023 - 17668 000017D3 742F jz short paRet ; cf=0 - 17669 000017D5 3C2D cmp al,'-' - 17670 000017D7 7502 jne short pa1 ; not '-', go look for letter - 17671 000017D9 4A dec dx ; DX = 0 (for negated attribute) - 17672 000017DA AC lodsb ; AL = next char - 17673 pa1: - 17674 ;mov di,offset TRANGROUP:AttrLtrs - 17675 ; DI = ptr to attrib letter list - 17676 000017DB BF[D895] mov di,AttrLtrs ; "RHSvDA" - 17677 ;mov cx,6 - 17678 000017DE B90600 mov cx,NUM_ATTR_LTRS ; 6 ; CX = length of attrib letter list - 17679 000017E1 F2AE repne scasb ; look for our letter in the list - 17680 000017E3 751B jne short paErr ; not found, return error - 17681 - 17682 000017E5 F7D1 not cx - 17683 ;add cx,6 - 17684 000017E7 83C106 add cx,NUM_ATTR_LTRS ; CX = attrib bit #, 0-5 - 17685 - 17686 ; Note that we rely on AttrLtrs to be in the attribute bit order, - 17687 ; starting from bit 0. + 17647 ; AttrSpecified, AttrSelect are updated with new attribute conditions. + 17648 ; If parse error occurs, attribute conditions parsed so far hold. + 17649 ; + 17650 ; For parse error, we set up for Std_EPrintf call: + 17651 ; Msg_Disp_Class = parse error message class + 17652 ; Message block (see DX) is set up for parse error message + 17653 + 17654 ; 19/02/2023 + 17655 ParseAttr: + 17656 000017C4 56 push si ; save SI + 17657 000017C5 C606[939D]00 mov byte [AttrSpecified],0 ; cancel all attribute conditions + 17658 + 17659 ; Each /A invocation starts by assuming all files are to be listed. + 17660 + 17661 ;;mov si,word ptr [bx].ValuePtr + 17662 ; SI = ptr to string after /A + 17663 ;mov si,[bx+ResultBuffer.ValuePtr] + 17664 000017CA 8B7704 mov si,[bx+4] + 17665 paLoop: + 17666 000017CD BA0100 mov dx,1 ; DX = 1 (for un-negated attribute) + 17667 000017D0 AC lodsb ; AL = next char in string + 17668 000017D1 08C0 or al,al + 17669 ;jz short paOk ; it's terminating null, we're done + 17670 ; 19/02/2023 + 17671 000017D3 742F jz short paRet ; cf=0 + 17672 000017D5 3C2D cmp al,'-' + 17673 000017D7 7502 jne short pa1 ; not '-', go look for letter + 17674 000017D9 4A dec dx ; DX = 0 (for negated attribute) + 17675 000017DA AC lodsb ; AL = next char + 17676 pa1: + 17677 ;mov di,offset TRANGROUP:AttrLtrs + 17678 ; DI = ptr to attrib letter list + 17679 000017DB BF[D895] mov di,AttrLtrs ; "RHSvDA" + 17680 ;mov cx,6 + 17681 000017DE B90600 mov cx,NUM_ATTR_LTRS ; 6 ; CX = length of attrib letter list + 17682 000017E1 F2AE repne scasb ; look for our letter in the list + 17683 000017E3 751B jne short paErr ; not found, return error + 17684 + 17685 000017E5 F7D1 not cx + 17686 ;add cx,6 + 17687 000017E7 83C106 add cx,NUM_ATTR_LTRS ; CX = attrib bit #, 0-5 17688 - 17689 ; Record this attribute bit in AttrSpecified. - 17690 - 17691 000017EA B001 mov al,1 - 17692 000017EC D2E0 shl al,cl ; AL = mask for our bit - 17693 000017EE 0806[939D] or [AttrSpecified],al ; set it in the 'specified' mask - 17694 - 17695 ; Record the selected state for this attribute in AttrSelect. - 17696 ; DX = 0 or 1, the selected state for this attribute. + 17689 ; Note that we rely on AttrLtrs to be in the attribute bit order, + 17690 ; starting from bit 0. + 17691 + 17692 ; Record this attribute bit in AttrSpecified. + 17693 + 17694 000017EA B001 mov al,1 + 17695 000017EC D2E0 shl al,cl ; AL = mask for our bit + 17696 000017EE 0806[939D] or [AttrSpecified],al ; set it in the 'specified' mask 17697 - 17698 000017F2 F6D0 not al ; AL = mask for all other bits - 17699 000017F4 2006[949D] and [AttrSelect],al ; clear our bit - 17700 000017F8 D2E2 shl dl,cl ; DL = our bit state in position - 17701 000017FA 0816[949D] or [AttrSelect],dl ; set selected attr state - 17702 000017FE EBCD jmp short paLoop ; go look at next char - 17703 - 17704 ; The attribute letter string is invalid. - 17705 - 17706 paErr: - 17707 00001800 E89D04 call SetupParamError ; set message up for Std_EPrintf - 17708 00001803 F9 stc ; return error - 17709 ; 19/02/2023 - 17710 ;jmp short paRet - 17711 ;paOk: - 17712 ;clc ; return success - 17713 paRet: - 17714 00001804 5E pop si ; restore SI - 17715 00001805 C3 retn - 17716 - 17717 ; --------------------------------------------------------------------------- - 17718 - 17719 ;*** ParseLine - parse a line of text - 17720 ; - 17721 ; Parse text until an EOL (CR or NUL) is found, or until a parse - 17722 ; error occurs. + 17698 ; Record the selected state for this attribute in AttrSelect. + 17699 ; DX = 0 or 1, the selected state for this attribute. + 17700 + 17701 000017F2 F6D0 not al ; AL = mask for all other bits + 17702 000017F4 2006[949D] and [AttrSelect],al ; clear our bit + 17703 000017F8 D2E2 shl dl,cl ; DL = our bit state in position + 17704 000017FA 0816[949D] or [AttrSelect],dl ; set selected attr state + 17705 000017FE EBCD jmp short paLoop ; go look at next char + 17706 + 17707 ; The attribute letter string is invalid. + 17708 + 17709 paErr: + 17710 00001800 E89D04 call SetupParamError ; set message up for Std_EPrintf + 17711 00001803 F9 stc ; return error + 17712 ; 19/02/2023 + 17713 ;jmp short paRet + 17714 ;paOk: + 17715 ;clc ; return success + 17716 paRet: + 17717 00001804 5E pop si ; restore SI + 17718 00001805 C3 retn + 17719 + 17720 ; --------------------------------------------------------------------------- + 17721 + 17722 ;*** ParseLine - parse a line of text 17723 ; - 17724 ; ENTRY DS:SI = ptr to text - 17725 ; CS, DS, ES = TRANGROUP seg addr + 17724 ; Parse text until an EOL (CR or NUL) is found, or until a parse + 17725 ; error occurs. 17726 ; - 17727 ; EXIT AX = last return code from system parser - 17728 ; CX = # positional parameters (pathnames) found - 0 or 1 + 17727 ; ENTRY DS:SI = ptr to text + 17728 ; CS, DS, ES = TRANGROUP seg addr 17729 ; - 17730 ; If parse error occurred, we're set up for Std_EPrintf call: - 17731 ; DX = ptr to message block + 17730 ; EXIT AX = last return code from system parser + 17731 ; CX = # positional parameters (pathnames) found - 0 or 1 17732 ; - 17733 ; USED BX,CX,DX,SI,DI - 17734 ; - 17735 ; EFFECTS - 17736 ; - 17737 ; Bits may contain new option settings. - 17738 ; DestBuf may contain new series of sort codes. - 17739 ; AttrSpecified, AttrSelect may contain new attribute conditions. - 17740 ; SrcBuf may contain a new default pathname/filespec. - 17741 ; PathPos, PathCnt updated for new pathname. - 17742 ; - 17743 ; If parse error occurred, we're set up for Std_EPrintf call: - 17744 ; Msg_Disp_Class = parse error class - 17745 ; Byte after last parameter in text is zeroed to make ASCIIZ string - 17746 ; Message block (see DX) is set up for parse error message - 17747 - 17748 ; 19/02/2023 - 17749 Parse_Line: - 17750 ; 04/05/2023 - 17751 00001806 BF[A596] mov di,PARSE_DIR ; ES:DI = ptr to parse block - 17752 00001809 31C9 xor cx,cx ; CX = # positionals found - 17753 plPars: - 17754 0000180B E84D0D call Parse_With_Msg ; call parser - 17755 0000180E 83F8FF cmp ax,-1 - 17756 ;cmp ax,END_OF_LINE ; 0FFFFh ; -1 - 17757 00001811 7411 je short plRet ; EOL encountered, return - 17758 00001813 83F800 cmp ax,RESULT_NO_ERROR ; 0 - 17759 00001816 750C jne short plRet ; parse error occurred, return - 17760 - 17761 ; Parse call succeeded. We have a filespec or a switch. - 17762 ; DX = ptr to result buffer + 17733 ; If parse error occurred, we're set up for Std_EPrintf call: + 17734 ; DX = ptr to message block + 17735 ; + 17736 ; USED BX,CX,DX,SI,DI + 17737 ; + 17738 ; EFFECTS + 17739 ; + 17740 ; Bits may contain new option settings. + 17741 ; DestBuf may contain new series of sort codes. + 17742 ; AttrSpecified, AttrSelect may contain new attribute conditions. + 17743 ; SrcBuf may contain a new default pathname/filespec. + 17744 ; PathPos, PathCnt updated for new pathname. + 17745 ; + 17746 ; If parse error occurred, we're set up for Std_EPrintf call: + 17747 ; Msg_Disp_Class = parse error class + 17748 ; Byte after last parameter in text is zeroed to make ASCIIZ string + 17749 ; Message block (see DX) is set up for parse error message + 17750 + 17751 ; 19/02/2023 + 17752 Parse_Line: + 17753 ; 04/05/2023 + 17754 00001806 BF[A596] mov di,PARSE_DIR ; ES:DI = ptr to parse block + 17755 00001809 31C9 xor cx,cx ; CX = # positionals found + 17756 plPars: + 17757 0000180B E84D0D call Parse_With_Msg ; call parser + 17758 0000180E 83F8FF cmp ax,-1 + 17759 ;cmp ax,END_OF_LINE ; 0FFFFh ; -1 + 17760 00001811 7411 je short plRet ; EOL encountered, return + 17761 00001813 83F800 cmp ax,RESULT_NO_ERROR ; 0 + 17762 00001816 750C jne short plRet ; parse error occurred, return 17763 - 17764 00001818 89D3 mov bx,dx ; BX = ptr to parse result buffer - 17765 0000181A 803F05 cmp byte [bx],RESULT_FILESPEC ; 5 - 17766 0000181D 7406 je short plFil ; we have a filespec - 17767 - 17768 0000181F E85900 call ParseSwitch ; else we have a switch - 17769 ;jc short plRet ; error parsing switch, return - 17770 ;jmp short plPars ; parse more - 17771 ; 19/02/2023 - 17772 00001822 73E7 jnc short plPars - 17773 plRet: - 17774 00001824 C3 retn - 17775 plFil: - 17776 00001825 E8BA00 call CopyPathname ; copy pathname into our buffer - 17777 00001828 EBE1 jmp short plPars ; parse more - 17778 ;plRet: - 17779 ; retn - 17780 - 17781 ; --------------------------------------------------------------------------- - 17782 - 17783 ;*** ParseOrder - parse and record /O option - 17784 ; - 17785 ; ENTRY BX = ptr to system parser result buffer for /O occurence - 17786 ; - 17787 ; EXIT CY = set if error occurs parsing order - 17788 ; - 17789 ; For parse error, we set up for Std_EPrintf call: - 17790 ; AX = parse error code, like system parser - 17791 ; DX = ptr to message block - 17792 ; - 17793 ; USED AX,CX,DX,DI - 17794 ; - 17795 ; EFFECTS - 17796 ; - 17797 ; DestBuf is updated with sort code bytes. See DestBuf description. - 17798 ; - 17799 ; For parse error, we set up for Std_EPrintf call: - 17800 ; Msg_Disp_Class = parse error message class - 17801 ; Message block (see DX) is set up for parse error message - 17802 - 17803 ; 19/02/2023 - Retro DOS v4.0 COMMAND.COM - 17804 ; - 17805 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 17806 ; MSDOS 6.22 COMMAND.COM - 17807 ParseOrder: - 17808 0000182A 56 push si ; save SI - 17809 0000182B 53 push bx ; save ptr to result buffer - 17810 - 17811 ;;mov si,word ptr [bx].ValuePtr - 17812 ;mov si,[bx+ResultBuffer.ValuePtr] - 17813 0000182C 8B7704 mov si,[bx+4] ; SI = ptr to order letters - 17814 ;mov bx,offset TRANGROUP:DestBuf - 17815 ; 08/06/2023 - 17816 0000182F BB[BE9D] mov bx,DestBuf ; BX = ptr to sort code buffer - 17817 00001832 8A04 mov al,[si] ; AL = 1st char of order string - 17818 00001834 08C0 or al,al - 17819 00001836 750E jnz short poLtr ; not NUL, go parse letters - 17820 - 17821 ; We have /O alone. Set standard sort order. - 17822 ; Note hardwired dependency on character order in OrderLtrs. + 17764 ; Parse call succeeded. We have a filespec or a switch. + 17765 ; DX = ptr to result buffer + 17766 + 17767 00001818 89D3 mov bx,dx ; BX = ptr to parse result buffer + 17768 0000181A 803F05 cmp byte [bx],RESULT_FILESPEC ; 5 + 17769 0000181D 7406 je short plFil ; we have a filespec + 17770 + 17771 0000181F E85900 call ParseSwitch ; else we have a switch + 17772 ;jc short plRet ; error parsing switch, return + 17773 ;jmp short plPars ; parse more + 17774 ; 19/02/2023 + 17775 00001822 73E7 jnc short plPars + 17776 plRet: + 17777 00001824 C3 retn + 17778 plFil: + 17779 00001825 E8BA00 call CopyPathname ; copy pathname into our buffer + 17780 00001828 EBE1 jmp short plPars ; parse more + 17781 ;plRet: + 17782 ; retn + 17783 + 17784 ; --------------------------------------------------------------------------- + 17785 + 17786 ;*** ParseOrder - parse and record /O option + 17787 ; + 17788 ; ENTRY BX = ptr to system parser result buffer for /O occurence + 17789 ; + 17790 ; EXIT CY = set if error occurs parsing order + 17791 ; + 17792 ; For parse error, we set up for Std_EPrintf call: + 17793 ; AX = parse error code, like system parser + 17794 ; DX = ptr to message block + 17795 ; + 17796 ; USED AX,CX,DX,DI + 17797 ; + 17798 ; EFFECTS + 17799 ; + 17800 ; DestBuf is updated with sort code bytes. See DestBuf description. + 17801 ; + 17802 ; For parse error, we set up for Std_EPrintf call: + 17803 ; Msg_Disp_Class = parse error message class + 17804 ; Message block (see DX) is set up for parse error message + 17805 + 17806 ; 19/02/2023 - Retro DOS v4.0 COMMAND.COM + 17807 ; + 17808 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 17809 ; MSDOS 6.22 COMMAND.COM + 17810 ParseOrder: + 17811 0000182A 56 push si ; save SI + 17812 0000182B 53 push bx ; save ptr to result buffer + 17813 + 17814 ;;mov si,word ptr [bx].ValuePtr + 17815 ;mov si,[bx+ResultBuffer.ValuePtr] + 17816 0000182C 8B7704 mov si,[bx+4] ; SI = ptr to order letters + 17817 ;mov bx,offset TRANGROUP:DestBuf + 17818 ; 08/06/2023 + 17819 0000182F BB[BE9D] mov bx,DestBuf ; BX = ptr to sort code buffer + 17820 00001832 8A04 mov al,[si] ; AL = 1st char of order string + 17821 00001834 08C0 or al,al + 17822 00001836 750E jnz short poLtr ; not NUL, go parse letters 17823 - 17824 00001838 C60705 mov byte [bx],5 ; sort 1st by group (subdirs 1st) - 17825 0000183B 43 inc bx - 17826 0000183C C60701 mov byte [bx],1 ; then by name - 17827 0000183F 43 inc bx - 17828 00001840 C60702 mov byte [bx],2 ; then by extension - 17829 00001843 43 inc bx - 17830 00001844 EB2F jmp short poOk ; return success - 17831 - 17832 ; We have /O. Parse sort order letters. - 17833 - 17834 poLtr: - 17835 00001846 30D2 xor dl,dl ; DL = 0 (upward sort) - 17836 00001848 AC lodsb ; AL = next sort order letter - 17837 00001849 08C0 or al,al - 17838 0000184B 7428 jz short poOk ; NUL found, return success - 17839 - 17840 0000184D 3C2D cmp al,'-' - 17841 0000184F 7503 jne short po1 ; not '-', go look for letter - 17842 00001851 B280 mov dl,80h ; DL = downward sort mask - 17843 00001853 AC lodsb ; AL = next char - 17844 po1: - 17845 ;mov di,offset TRANGROUP:OrderLtrs - 17846 ; 08/06/2023 - 17847 00001854 BF[DE95] mov di,OrderLtrs ;"NEDSGC" ; DI = ptr to list of letters - 17848 ; (NUM_ORDER_LTRS = 6 for MSDOS 6.22 COMMAND.COM) - 17849 ; ((N,E,D,S,G for MSDOS 5.0 and N,E,D,S,G,C for MSDOS 6.22)) - 17850 ;mov cx,6 ; 08/06/2023 - 17851 00001857 B90600 mov cx,NUM_ORDER_LTRS ; 5 ; CX = length of list - 17852 0000185A F2AE repne scasb ; look for our letter in the list - 17853 0000185C 7510 jne short poErr ; not found, return error - 17854 - 17855 0000185E F7D9 neg cx - 17856 ;add cx,6 ; 08/06/2023 - 17857 00001860 83C106 add cx,NUM_ORDER_LTRS ; 5 ; CL = sort order code, 1-6 - 17858 - 17859 00001863 08D1 or cl,dl ; CL = sort code with up/dn bit - 17860 00001865 880F mov [bx],cl ; store sort order code in buffer - 17861 00001867 43 inc bx ; BX = ptr to next spot in buffer - 17862 ;cmp bx,offset TRANGROUP:EndDestBuf - 17863 00001868 81FB[159E] cmp bx,EndDestBuf - 17864 ;jae short poErr ; too many letters - 17865 ; - 17866 ;jmp short poLtr ; go look at next char - 17867 ; 19/02/2023 - 17868 0000186C 72D8 jb short poLtr - 17869 - 17870 ; The sort order string is invalid. - 17871 - 17872 poErr: - 17873 0000186E 5B pop bx ; BX = ptr to result buffer - 17874 0000186F E82E04 call SetupParamError ; set message up for Std_EPrintf - 17875 00001872 F9 stc ; return failure - 17876 00001873 EB04 jmp short poRet - 17877 poOk: - 17878 00001875 C60700 mov byte [bx],0 ; mark end of sort code list - 17879 00001878 5B pop bx ; BX = ptr to result buffer - 17880 ; 19/02/2023 - 17881 ;cf=0 - 17882 ;clc ; return success - 17883 poRet: - 17884 00001879 5E pop si ; restore SI - 17885 0000187A C3 retn - 17886 - 17887 ; --------------------------------------------------------------------------- - 17888 ; MSDOS 6.0 - 17889 ; 08/06/2023 - 17890 - 17891 ; 31/07/2024 - Retro DOS 5.0 - PCDOS 7.1 COMMAND.COM - 17892 %if 0 + 17824 ; We have /O alone. Set standard sort order. + 17825 ; Note hardwired dependency on character order in OrderLtrs. + 17826 + 17827 00001838 C60705 mov byte [bx],5 ; sort 1st by group (subdirs 1st) + 17828 0000183B 43 inc bx + 17829 0000183C C60701 mov byte [bx],1 ; then by name + 17830 0000183F 43 inc bx + 17831 00001840 C60702 mov byte [bx],2 ; then by extension + 17832 00001843 43 inc bx + 17833 00001844 EB2F jmp short poOk ; return success + 17834 + 17835 ; We have /O. Parse sort order letters. + 17836 + 17837 poLtr: + 17838 00001846 30D2 xor dl,dl ; DL = 0 (upward sort) + 17839 00001848 AC lodsb ; AL = next sort order letter + 17840 00001849 08C0 or al,al + 17841 0000184B 7428 jz short poOk ; NUL found, return success + 17842 + 17843 0000184D 3C2D cmp al,'-' + 17844 0000184F 7503 jne short po1 ; not '-', go look for letter + 17845 00001851 B280 mov dl,80h ; DL = downward sort mask + 17846 00001853 AC lodsb ; AL = next char + 17847 po1: + 17848 ;mov di,offset TRANGROUP:OrderLtrs + 17849 ; 08/06/2023 + 17850 00001854 BF[DE95] mov di,OrderLtrs ;"NEDSGC" ; DI = ptr to list of letters + 17851 ; (NUM_ORDER_LTRS = 6 for MSDOS 6.22 COMMAND.COM) + 17852 ; ((N,E,D,S,G for MSDOS 5.0 and N,E,D,S,G,C for MSDOS 6.22)) + 17853 ;mov cx,6 ; 08/06/2023 + 17854 00001857 B90600 mov cx,NUM_ORDER_LTRS ; 5 ; CX = length of list + 17855 0000185A F2AE repne scasb ; look for our letter in the list + 17856 0000185C 7510 jne short poErr ; not found, return error + 17857 + 17858 0000185E F7D9 neg cx + 17859 ;add cx,6 ; 08/06/2023 + 17860 00001860 83C106 add cx,NUM_ORDER_LTRS ; 5 ; CL = sort order code, 1-6 + 17861 + 17862 00001863 08D1 or cl,dl ; CL = sort code with up/dn bit + 17863 00001865 880F mov [bx],cl ; store sort order code in buffer + 17864 00001867 43 inc bx ; BX = ptr to next spot in buffer + 17865 ;cmp bx,offset TRANGROUP:EndDestBuf + 17866 00001868 81FB[159E] cmp bx,EndDestBuf + 17867 ;jae short poErr ; too many letters + 17868 ; + 17869 ;jmp short poLtr ; go look at next char + 17870 ; 19/02/2023 + 17871 0000186C 72D8 jb short poLtr + 17872 + 17873 ; The sort order string is invalid. + 17874 + 17875 poErr: + 17876 0000186E 5B pop bx ; BX = ptr to result buffer + 17877 0000186F E82E04 call SetupParamError ; set message up for Std_EPrintf + 17878 00001872 F9 stc ; return failure + 17879 00001873 EB04 jmp short poRet + 17880 poOk: + 17881 00001875 C60700 mov byte [bx],0 ; mark end of sort code list + 17882 00001878 5B pop bx ; BX = ptr to result buffer + 17883 ; 19/02/2023 + 17884 ;cf=0 + 17885 ;clc ; return success + 17886 poRet: + 17887 00001879 5E pop si ; restore SI + 17888 0000187A C3 retn + 17889 + 17890 ; --------------------------------------------------------------------------- + 17891 ; MSDOS 6.0 + 17892 ; 08/06/2023 17893 - 17894 ;ifdef DBLSPACE_HOOKS - 17895 - 17896 ;*** ParseRatio - parse and record /C[H] option - 17897 ; - 17898 ; ENTRY BX = ptr to system parser result buffer for /C occurence - 17899 ; DI = index into word list of switches + 17894 ; 31/07/2024 - Retro DOS 5.0 - PCDOS 7.1 COMMAND.COM + 17895 %if 0 + 17896 + 17897 ;ifdef DBLSPACE_HOOKS + 17898 + 17899 ;*** ParseRatio - parse and record /C[H] option 17900 ; - 17901 ; EXIT CY = set if error occurs parsing order - 17902 ; - 17903 ; For parse error, we set up for Std_EPrintf call: - 17904 ; AX = parse error code, like system parser - 17905 ; DX = ptr to message block - 17906 ; - 17907 ; USED AX,CX,DX,DI - 17908 ; - 17909 ; EFFECTS - 17910 ; - 17911 ; Bits modified to indicate option state. - 17912 ; fUseHostSize is set to zero for /C, non-zero for /CH. + 17901 ; ENTRY BX = ptr to system parser result buffer for /C occurence + 17902 ; DI = index into word list of switches + 17903 ; + 17904 ; EXIT CY = set if error occurs parsing order + 17905 ; + 17906 ; For parse error, we set up for Std_EPrintf call: + 17907 ; AX = parse error code, like system parser + 17908 ; DX = ptr to message block + 17909 ; + 17910 ; USED AX,CX,DX,DI + 17911 ; + 17912 ; EFFECTS 17913 ; - 17914 ; For parse error, we set up for Std_EPrintf call: - 17915 ; Msg_Disp_Class = parse error message class - 17916 ; Message block (see DX) is set up for parse error message - 17917 - 17918 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 17919 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:184Ch + 17914 ; Bits modified to indicate option state. + 17915 ; fUseHostSize is set to zero for /C, non-zero for /CH. + 17916 ; + 17917 ; For parse error, we set up for Std_EPrintf call: + 17918 ; Msg_Disp_Class = parse error message class + 17919 ; Message block (see DX) is set up for parse error message 17920 - 17921 ParseRatio: ;proc - 17922 call OnOffSw ; turn on option bit - 17923 push si ; save SI - 17924 ;;mov si,word ptr [bx].ValuePtr - 17925 ;mov si,[bx+ResultBuffer.ValuePtr] - 17926 mov si,[bx+4] ; SI = ptr to possible H option - 17927 mov al,[si] ; AL = null or 'H' - 17928 or al,al - 17929 jz short prDone ; if null, no H option to check - 17930 cmp al,'H' ; only H is allowed, make sure that's - 17931 je short prDone ; what it is - 17932 call SetupParamError ; set message up for Std_EPrintf - 17933 stc ; return failure - 17934 jmp short prRet - 17935 prDone: - 17936 mov [fUseHostSize],al ; set Host cluster size flag - 17937 ; 08/06/2023 - 17938 ;clc - 17939 ;;cf = 0 - 17940 prRet: - 17941 pop si - 17942 retn - 17943 - 17944 ;ParseRatio ;endp - 17945 ;endif + 17921 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 17922 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:184Ch + 17923 + 17924 ParseRatio: ;proc + 17925 call OnOffSw ; turn on option bit + 17926 push si ; save SI + 17927 ;;mov si,word ptr [bx].ValuePtr + 17928 ;mov si,[bx+ResultBuffer.ValuePtr] + 17929 mov si,[bx+4] ; SI = ptr to possible H option + 17930 mov al,[si] ; AL = null or 'H' + 17931 or al,al + 17932 jz short prDone ; if null, no H option to check + 17933 cmp al,'H' ; only H is allowed, make sure that's + 17934 je short prDone ; what it is + 17935 call SetupParamError ; set message up for Std_EPrintf + 17936 stc ; return failure + 17937 jmp short prRet + 17938 prDone: + 17939 mov [fUseHostSize],al ; set Host cluster size flag + 17940 ; 08/06/2023 + 17941 ;clc + 17942 ;;cf = 0 + 17943 prRet: + 17944 pop si + 17945 retn 17946 - 17947 %endif - 17948 - 17949 ; --------------------------------------------------------------------------- - 17950 - 17951 ;*** ParseSwitch - parse a switch - 17952 ; - 17953 ; ENTRY BX = ptr to parse result buffer after system parser processed - 17954 ; a switch + 17947 ;ParseRatio ;endp + 17948 ;endif + 17949 + 17950 %endif + 17951 + 17952 ; --------------------------------------------------------------------------- + 17953 + 17954 ;*** ParseSwitch - parse a switch 17955 ; - 17956 ; EXIT CY = set if parse error occurred - 17957 ; - 17958 ; If parse error occurred, we're set up for Std_EPrintf call: - 17959 ; AX = parse error code, like system parser - 17960 ; DX = ptr to message block - 17961 ; - 17962 ; USED AX,BX,DX - 17963 ; - 17964 ; EFFECTS - 17965 ; - 17966 ; Bits may contain new option settings. - 17967 ; DestBuf may contain new series of sort codes. - 17968 ; AttrSpecified, AttrSelect may contain new attribute conditions. - 17969 ; - 17970 ; If parse error occurred, we're set up for Std_EPrintf call: - 17971 ; Msg_Disp_Class = parse error class - 17972 ; Byte after last parameter in text is zeroed to make ASCIIZ string - 17973 ; Message block (see DX) is set up for parse error message - 17974 - 17975 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 17976 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:16E2h + 17956 ; ENTRY BX = ptr to parse result buffer after system parser processed + 17957 ; a switch + 17958 ; + 17959 ; EXIT CY = set if parse error occurred + 17960 ; + 17961 ; If parse error occurred, we're set up for Std_EPrintf call: + 17962 ; AX = parse error code, like system parser + 17963 ; DX = ptr to message block + 17964 ; + 17965 ; USED AX,BX,DX + 17966 ; + 17967 ; EFFECTS + 17968 ; + 17969 ; Bits may contain new option settings. + 17970 ; DestBuf may contain new series of sort codes. + 17971 ; AttrSpecified, AttrSelect may contain new attribute conditions. + 17972 ; + 17973 ; If parse error occurred, we're set up for Std_EPrintf call: + 17974 ; Msg_Disp_Class = parse error class + 17975 ; Byte after last parameter in text is zeroed to make ASCIIZ string + 17976 ; Message block (see DX) is set up for parse error message 17977 - 17978 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 17979 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1869h - 17980 ParseSwitch: - 17981 0000187B 51 push cx ; save CX - 17982 0000187C 57 push di ; save DI - 17983 - 17984 ;;mov ax,[bx].SynPtr ; AX = synonym ptr - 17985 ;mov ax,[bx+ResultBuffer.SynPtr] - 17986 0000187D 8B4702 mov ax,[bx+2] - 17987 ;mov di,offset TRANGROUP:Dir_Sw_Ptrs - 17988 00001880 BF[0397] mov di,Dir_Sw_Ptrs ; ES:DI = ptr to list of synonym ptrs - 17989 ; 08/06/2023 - 17990 ; (NUM_DIR_SWS = 16 for MSDOS 6.0) - 17991 ;mov cx,16 - 17992 ; 31/07/2024 - 17993 ;mov cx,18 ; PCDOS 7.1 COMMAND.COM - 17994 00001883 B91200 mov cx,NUM_DIR_SWS ; 14 ; CX = # of dir switches in list - 17995 00001886 FC cld ; scan direction = upward - 17996 00001887 F2AF repne scasw ; locate synonym ptr in list - 17997 ;sub di,offset TRANGROUP:Dir_Sw_Ptrs + 2 - 17998 00001889 81EF[0597] sub di,Dir_Sw_Ptrs+2 - 17999 - 18000 ; DI = index into word list of synonym ptrs - 18001 - 18002 0000188D 2EFF95[9518] call word [cs:di+SwHandler] ; use same index into call table - 18003 - 18004 00001892 5F pop di ; restore DI - 18005 00001893 59 pop cx ; restore CX + 17978 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 17979 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:16E2h + 17980 + 17981 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 17982 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1869h + 17983 ParseSwitch: + 17984 0000187B 51 push cx ; save CX + 17985 0000187C 57 push di ; save DI + 17986 + 17987 ;;mov ax,[bx].SynPtr ; AX = synonym ptr + 17988 ;mov ax,[bx+ResultBuffer.SynPtr] + 17989 0000187D 8B4702 mov ax,[bx+2] + 17990 ;mov di,offset TRANGROUP:Dir_Sw_Ptrs + 17991 00001880 BF[0397] mov di,Dir_Sw_Ptrs ; ES:DI = ptr to list of synonym ptrs + 17992 ; 08/06/2023 + 17993 ; (NUM_DIR_SWS = 16 for MSDOS 6.0) + 17994 ;mov cx,16 + 17995 ; 31/07/2024 + 17996 ;mov cx,18 ; PCDOS 7.1 COMMAND.COM + 17997 00001883 B91200 mov cx,NUM_DIR_SWS ; 14 ; CX = # of dir switches in list + 17998 00001886 FC cld ; scan direction = upward + 17999 00001887 F2AF repne scasw ; locate synonym ptr in list + 18000 ;sub di,offset TRANGROUP:Dir_Sw_Ptrs + 2 + 18001 00001889 81EF[0597] sub di,Dir_Sw_Ptrs+2 + 18002 + 18003 ; DI = index into word list of synonym ptrs + 18004 + 18005 0000188D 2EFF95[9518] call word [cs:di+SwHandler] ; use same index into call table 18006 - 18007 00001894 C3 retn - 18008 - 18009 ; --------------------------------------------------------------------------- - 18010 - 18011 ; Order in this table must correspond to order in Dir_Sw_Ptrs list. - 18012 ; Simple on/off switches must occur first in both lists, and must be - 18013 ; in order of option bits in Bits, starting with bit 0. - 18014 - 18015 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18016 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:16FCh + 18007 00001892 5F pop di ; restore DI + 18008 00001893 59 pop cx ; restore CX + 18009 + 18010 00001894 C3 retn + 18011 + 18012 ; --------------------------------------------------------------------------- + 18013 + 18014 ; Order in this table must correspond to order in Dir_Sw_Ptrs list. + 18015 ; Simple on/off switches must occur first in both lists, and must be + 18016 ; in order of option bits in Bits, starting with bit 0. 18017 - 18018 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18019 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1883h - 18020 SwHandler: - 18021 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 18022 - 18023 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 18024 %if 0 - 18025 ; ifdef DBLSPACE_HOOKS - 18026 dw OnOffSw ; /-C - 18027 dw ParseRatio ; /C[H] - 18028 ; ; endif - 18029 %endif - 18030 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 18031 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1922h - 18032 - 18033 00001895 [A717] dw OnOffSw ; /-W - 18034 00001897 [A717] dw OnOffSw ; /W - 18035 00001899 [A717] dw OnOffSw ; /-P - 18036 0000189B [A717] dw OnOffSw ; /P - 18037 0000189D [A717] dw OnOffSw ; /-S - 18038 0000189F [A717] dw OnOffSw ; /S - 18039 000018A1 [A717] dw OnOffSw ; /-B - 18040 000018A3 [A717] dw OnOffSw ; /B - 18041 000018A5 [A717] dw OnOffSw ; /-L ;M010 - 18042 000018A7 [A717] dw OnOffSw ; /L ;M010 - 18043 - 18044 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 18045 %if 1 - 18046 000018A9 [A717] dw OnOffSw ; /-Z - 18047 000018AB [A717] dw OnOffSw ; /Z - 18048 000018AD [A717] dw OnOffSw ; /-4 - 18049 000018AF [A717] dw OnOffSw ; /4 - 18050 %endif - 18051 000018B1 [A017] dw NoOrder ; /-O - 18052 000018B3 [2A18] dw ParseOrder ; /O - 18053 000018B5 [ED14] dw DefaultAttr ; /-A - 18054 000018B7 [C417] dw ParseAttr ; /A - 18055 - 18056 ; --------------------------------------------------------------------------- - 18057 - 18058 ;break - 18059 - 18060 ;*** UTILITY ROUTINES - 18061 ; ---------------------- + 18018 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18019 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:16FCh + 18020 + 18021 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18022 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1883h + 18023 SwHandler: + 18024 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 18025 + 18026 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 18027 %if 0 + 18028 ; ifdef DBLSPACE_HOOKS + 18029 dw OnOffSw ; /-C + 18030 dw ParseRatio ; /C[H] + 18031 ; ; endif + 18032 %endif + 18033 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 18034 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1922h + 18035 + 18036 00001895 [A717] dw OnOffSw ; /-W + 18037 00001897 [A717] dw OnOffSw ; /W + 18038 00001899 [A717] dw OnOffSw ; /-P + 18039 0000189B [A717] dw OnOffSw ; /P + 18040 0000189D [A717] dw OnOffSw ; /-S + 18041 0000189F [A717] dw OnOffSw ; /S + 18042 000018A1 [A717] dw OnOffSw ; /-B + 18043 000018A3 [A717] dw OnOffSw ; /B + 18044 000018A5 [A717] dw OnOffSw ; /-L ;M010 + 18045 000018A7 [A717] dw OnOffSw ; /L ;M010 + 18046 + 18047 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 18048 %if 1 + 18049 000018A9 [A717] dw OnOffSw ; /-Z + 18050 000018AB [A717] dw OnOffSw ; /Z + 18051 000018AD [A717] dw OnOffSw ; /-4 + 18052 000018AF [A717] dw OnOffSw ; /4 + 18053 %endif + 18054 000018B1 [A017] dw NoOrder ; /-O + 18055 000018B3 [2A18] dw ParseOrder ; /O + 18056 000018B5 [ED14] dw DefaultAttr ; /-A + 18057 000018B7 [C417] dw ParseAttr ; /A + 18058 + 18059 ; --------------------------------------------------------------------------- + 18060 + 18061 ;break 18062 - 18063 ; --------------------------------------------------------------------------- - 18064 - 18065 ;*** ChangeDir - change directory on target drive - 18066 ; - 18067 ; ENTRY FCB contains drive # - 18068 ; DS:DX = ptr to ASCIIZ string w/o drive specifier + 18063 ;*** UTILITY ROUTINES + 18064 ; ---------------------- + 18065 + 18066 ; --------------------------------------------------------------------------- + 18067 + 18068 ;*** ChangeDir - change directory on target drive 18069 ; - 18070 ; EXIT Changed current directory on drive - 18071 ; - 18072 ; If error, - 18073 ; CY = set - 18074 ; DOS Get Extended Error call will get error - 18075 ; - 18076 ; USED AX,DX,SI,DI - 18077 ; - 18078 ; EFFECTS - 18079 ; - 18080 ; DirBuf is used to build "d:string". - 18081 - 18082 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18083 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1718h + 18070 ; ENTRY FCB contains drive # + 18071 ; DS:DX = ptr to ASCIIZ string w/o drive specifier + 18072 ; + 18073 ; EXIT Changed current directory on drive + 18074 ; + 18075 ; If error, + 18076 ; CY = set + 18077 ; DOS Get Extended Error call will get error + 18078 ; + 18079 ; USED AX,DX,SI,DI + 18080 ; + 18081 ; EFFECTS + 18082 ; + 18083 ; DirBuf is used to build "d:string". 18084 - 18085 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18086 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:18A3h + 18085 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18086 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1718h 18087 - 18088 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 18089 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1946h - 18090 ChangeDir: - 18091 ;mov di,offset TRANGROUP:DirBuf - 18092 000018B9 BF[399D] mov di,DIRBUF - 18093 000018BC E8D003 call GetDriveLtr ; AX = "d:" - 18094 000018BF AB stosw ; put drive specifier in buffer - 18095 000018C0 89D6 mov si,dx ; SI = ptr to argument string - 18096 cdLoop: - 18097 000018C2 AC lodsb - 18098 000018C3 AA stosb ; move byte to buffer - 18099 000018C4 08C0 or al,al - 18100 000018C6 75FA jne short cdLoop ; continue until null transferred - 18101 - 18102 ;mov dx,offset TRANGROUP:DirBuf - 18103 000018C8 BA[399D] mov dx,DIRBUF ; DX = ptr to "d:string" - 18104 ;mov ah,CHDir - 18105 000018CB B43B mov ah,3Bh - 18106 000018CD CD21 int 21h ; change directory - 18107 000018CF C3 retn ; return what CHDIR returns - 18108 - 18109 ; --------------------------------------------------------------------------- - 18110 - 18111 ;*** CmpAscz - compare two ASCIIZ strings alphanumerically - 18112 ; - 18113 ; ENTRY DS:SI = ptr to one ASCIIZ string - 18114 ; ES:DI = ptr to another ASCIIZ string + 18088 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18089 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:18A3h + 18090 + 18091 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 18092 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1946h + 18093 ChangeDir: + 18094 ;mov di,offset TRANGROUP:DirBuf + 18095 000018B9 BF[399D] mov di,DIRBUF + 18096 000018BC E8D003 call GetDriveLtr ; AX = "d:" + 18097 000018BF AB stosw ; put drive specifier in buffer + 18098 000018C0 89D6 mov si,dx ; SI = ptr to argument string + 18099 cdLoop: + 18100 000018C2 AC lodsb + 18101 000018C3 AA stosb ; move byte to buffer + 18102 000018C4 08C0 or al,al + 18103 000018C6 75FA jne short cdLoop ; continue until null transferred + 18104 + 18105 ;mov dx,offset TRANGROUP:DirBuf + 18106 000018C8 BA[399D] mov dx,DIRBUF ; DX = ptr to "d:string" + 18107 ;mov ah,CHDir + 18108 000018CB B43B mov ah,3Bh + 18109 000018CD CD21 int 21h ; change directory + 18110 000018CF C3 retn ; return what CHDIR returns + 18111 + 18112 ; --------------------------------------------------------------------------- + 18113 + 18114 ;*** CmpAscz - compare two ASCIIZ strings alphanumerically 18115 ; - 18116 ; EXIT flags set after REPE CMPSB - 18117 ; - 18118 ; USED AL,CX,SI,DI - 18119 ; - 18120 ; NOTES - 18121 ; - 18122 ; Maximum run of comparison is length of DS:SI string. - 18123 ; This ensures that two identical strings followed by - 18124 ; random characters will compare correctly. - 18125 - 18126 ; 19/02/2023 - 18127 CmpAscz: - 18128 ; 07/06/2023 - 18129 000018D0 56 push si ; * - 18130 ; - 18131 000018D1 57 push di - 18132 - 18133 000018D2 89F7 mov di,si - 18134 000018D4 30C0 xor al,al - 18135 000018D6 B9FFFF mov cx,0FFFFh - 18136 000018D9 F2AE repne scasb - 18137 000018DB F7D1 not cx - 18138 - 18139 000018DD 5F pop di - 18140 000018DE F3A6 repe cmpsb + 18116 ; ENTRY DS:SI = ptr to one ASCIIZ string + 18117 ; ES:DI = ptr to another ASCIIZ string + 18118 ; + 18119 ; EXIT flags set after REPE CMPSB + 18120 ; + 18121 ; USED AL,CX,SI,DI + 18122 ; + 18123 ; NOTES + 18124 ; + 18125 ; Maximum run of comparison is length of DS:SI string. + 18126 ; This ensures that two identical strings followed by + 18127 ; random characters will compare correctly. + 18128 + 18129 ; 19/02/2023 + 18130 CmpAscz: + 18131 ; 07/06/2023 + 18132 000018D0 56 push si ; * + 18133 ; + 18134 000018D1 57 push di + 18135 + 18136 000018D2 89F7 mov di,si + 18137 000018D4 30C0 xor al,al + 18138 000018D6 B9FFFF mov cx,0FFFFh + 18139 000018D9 F2AE repne scasb + 18140 000018DB F7D1 not cx 18141 - 18142 ; 07/06/2023 - 18143 000018E0 5E pop si ; * - 18144 ; - 18145 000018E1 C3 retn - 18146 - 18147 ; --------------------------------------------------------------------------- - 18148 - 18149 ;*** CopyPathname - copy pathname to our buffer - 18150 ; - 18151 ; ENTRY BX = ptr to parse result buffer after system parser processed - 18152 ; a filespec + 18142 000018DD 5F pop di + 18143 000018DE F3A6 repe cmpsb + 18144 + 18145 ; 07/06/2023 + 18146 000018E0 5E pop si ; * + 18147 ; + 18148 000018E1 C3 retn + 18149 + 18150 ; --------------------------------------------------------------------------- + 18151 + 18152 ;*** CopyPathname - copy pathname to our buffer 18153 ; - 18154 ; EXIT nothing - 18155 ; - 18156 ; USED AX - 18157 ; - 18158 ; EFFECTS - 18159 ; - 18160 ; SrcBuf may contain a new pathname/filespec. - 18161 ; PathPos, PathCnt updated for new pathname. - 18162 - 18163 ; 19/02/2023 - 18164 CopyPathname: - 18165 000018E2 56 push si - 18166 ;;lds si,dword ptr [bx].ValuePtr ; load far ptr from result buffer - 18167 ;lds si,[bx+ResultBuffer.ValuePtr] - 18168 000018E3 C57704 lds si,[bx+4] - 18169 ;invoke Move_To_SrcBuf ; copy pathname to SrcBuf - 18170 000018E6 E8EF17 call Move_To_SrcBuf - 18171 000018E9 5E pop si - 18172 000018EA C3 retn - 18173 - 18174 ; --------------------------------------------------------------------------- - 18175 - 18176 ;*** CountFile - update counters with current file - 18177 ; - 18178 ; ENTRY BX = offset of entry in TPA buffer - 18179 ; - 18180 ; EXIT nothing - 18181 ; - 18182 ; USED AX,DX - 18183 ; - 18184 ; EFFECTS - 18185 ; - 18186 ; FileCnt, FileCntTotal, FileSiz, FileSizTotal are updated. - 18187 - 18188 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18189 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 18190 CountFile: - 18191 000018EB 06 push es ; save TRANGROUP seg addr - 18192 000018EC 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr - 18193 - 18194 000018F0 FF06[209C] inc word [FileCnt] ; # files this directory - 18195 000018F4 FF06[5E9C] inc word [FileCntTotal] ; # files total - 18196 000018F8 7504 jnz short cntf1 - 18197 000018FA FF06[609C] inc word [FileCntTotal+2] - 18198 cntf1: - 18199 ;mov ax,word ptr es:[bx].filesize - 18200 ; AX = low word of file size - 18201 ;mov dx,word ptr es:[bx].filesize+2 - 18202 ; DX = high word of file size - 18203 000018FE 268B4711 mov ax,[es:bx+17] ; [es:bx+EntryStruc.filesize] - 18204 00001902 268B5713 mov dx,[es:bx+19] ; [es:bx+EntryStruc.filesize+2] - 18205 00001906 0106[229C] add [FileSiz],ax - 18206 0000190A 1116[249C] adc [FileSiz+2],dx ; size of this directory - 18207 - 18208 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 18209 %if 1 - 18210 0000190E 8316[269C]00 adc word [FileSiz+4],0 - 18211 %endif - 18212 00001913 0106[629C] add [FileSizTotal],ax - 18213 00001917 1116[649C] adc [FileSizTotal+2],dx ; total size of files listed - 18214 - 18215 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - 18216 %if 1 - 18217 0000191B 8316[669C]00 adc word [FileSizTotal+4],0 - 18218 %endif - 18219 00001920 07 pop es ; ES = TRANGROUP seg addr again - 18220 dbRet: ; 19/02/2023 - 18221 00001921 C3 retn - 18222 - 18223 ; --------------------------------------------------------------------------- - 18224 - 18225 ;*** DisplayBare - display filename in bare format - 18226 ; - 18227 ; ENTRY BX = offset of entry in TPA buffer - 18228 ; - 18229 ; EXIT DX = # char's displayed, including dot - 18230 ; - 18231 ; USED AX,CX,SI,DI - 18232 ; - 18233 ; EFFECTS - 18234 ; - 18235 ; Filename is displayed in name.ext format, followed by cr/lf. - 18236 ; If /s is on, complete pathname is displayed. + 18154 ; ENTRY BX = ptr to parse result buffer after system parser processed + 18155 ; a filespec + 18156 ; + 18157 ; EXIT nothing + 18158 ; + 18159 ; USED AX + 18160 ; + 18161 ; EFFECTS + 18162 ; + 18163 ; SrcBuf may contain a new pathname/filespec. + 18164 ; PathPos, PathCnt updated for new pathname. + 18165 + 18166 ; 19/02/2023 + 18167 CopyPathname: + 18168 000018E2 56 push si + 18169 ;;lds si,dword ptr [bx].ValuePtr ; load far ptr from result buffer + 18170 ;lds si,[bx+ResultBuffer.ValuePtr] + 18171 000018E3 C57704 lds si,[bx+4] + 18172 ;invoke Move_To_SrcBuf ; copy pathname to SrcBuf + 18173 000018E6 E8EF17 call Move_To_SrcBuf + 18174 000018E9 5E pop si + 18175 000018EA C3 retn + 18176 + 18177 ; --------------------------------------------------------------------------- + 18178 + 18179 ;*** CountFile - update counters with current file + 18180 ; + 18181 ; ENTRY BX = offset of entry in TPA buffer + 18182 ; + 18183 ; EXIT nothing + 18184 ; + 18185 ; USED AX,DX + 18186 ; + 18187 ; EFFECTS + 18188 ; + 18189 ; FileCnt, FileCntTotal, FileSiz, FileSizTotal are updated. + 18190 + 18191 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18192 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 18193 CountFile: + 18194 000018EB 06 push es ; save TRANGROUP seg addr + 18195 000018EC 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr + 18196 + 18197 000018F0 FF06[209C] inc word [FileCnt] ; # files this directory + 18198 000018F4 FF06[5E9C] inc word [FileCntTotal] ; # files total + 18199 000018F8 7504 jnz short cntf1 + 18200 000018FA FF06[609C] inc word [FileCntTotal+2] + 18201 cntf1: + 18202 ;mov ax,word ptr es:[bx].filesize + 18203 ; AX = low word of file size + 18204 ;mov dx,word ptr es:[bx].filesize+2 + 18205 ; DX = high word of file size + 18206 000018FE 268B4711 mov ax,[es:bx+17] ; [es:bx+EntryStruc.filesize] + 18207 00001902 268B5713 mov dx,[es:bx+19] ; [es:bx+EntryStruc.filesize+2] + 18208 00001906 0106[229C] add [FileSiz],ax + 18209 0000190A 1116[249C] adc [FileSiz+2],dx ; size of this directory + 18210 + 18211 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 18212 %if 1 + 18213 0000190E 8316[269C]00 adc word [FileSiz+4],0 + 18214 %endif + 18215 00001913 0106[629C] add [FileSizTotal],ax + 18216 00001917 1116[649C] adc [FileSizTotal+2],dx ; total size of files listed + 18217 + 18218 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM + 18219 %if 1 + 18220 0000191B 8316[669C]00 adc word [FileSizTotal+4],0 + 18221 %endif + 18222 00001920 07 pop es ; ES = TRANGROUP seg addr again + 18223 dbRet: ; 19/02/2023 + 18224 00001921 C3 retn + 18225 + 18226 ; --------------------------------------------------------------------------- + 18227 + 18228 ;*** DisplayBare - display filename in bare format + 18229 ; + 18230 ; ENTRY BX = offset of entry in TPA buffer + 18231 ; + 18232 ; EXIT DX = # char's displayed, including dot + 18233 ; + 18234 ; USED AX,CX,SI,DI + 18235 ; + 18236 ; EFFECTS 18237 ; - 18238 ; NOTE - 18239 ; - 18240 ; Directory pseudofiles . and .. and suppressed in bare listing. - 18241 - 18242 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18243 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1775h + 18238 ; Filename is displayed in name.ext format, followed by cr/lf. + 18239 ; If /s is on, complete pathname is displayed. + 18240 ; + 18241 ; NOTE + 18242 ; + 18243 ; Directory pseudofiles . and .. and suppressed in bare listing. 18244 - 18245 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18246 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1900h + 18245 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18246 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1775h 18247 - 18248 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18249 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:19ADh + 18248 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18249 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1900h 18250 - 18251 DisplayBare: - 18252 ; Suppress . and .. files from bare listing. + 18251 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18252 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:19ADh 18253 - 18254 00001922 8CD9 mov cx,ds ; CX = saved TRANGROUP seg addr - 18255 00001924 8E1E[F79B] mov ds,[TPA] ; DS:BX = ptr to file entry - 18256 ;assume ds:NOTHING - 18257 ;cmp ds:[bx].filename,'.' ; check 1st char of filename - 18258 00001928 807F012E cmp byte [bx+1],'.' ; [bx+EntrStruc.filename] - 18259 0000192C 8ED9 mov ds,cx ; DS = TRANGROUP seg addr again - 18260 ;assume ds:TRANGROUP - 18261 0000192E 74F1 je short dbRet ; it's . or .. - don't display - 18262 - 18263 ;;;test Bits,mask subd - 18264 ;;test word [_Bits],4 - 18265 ;test byte [_Bits],4 - 18266 ; 08/06/2023 - 18267 00001930 F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 - 18268 ; 01/08/2024 ; 4 ; PCDOS 7.1 - 18269 00001935 743C jz short dbNameExt ; not /s - display filename only - 18270 - 18271 ;invoke Build_Dir_String - 18272 00001937 E8C308 call build_dir_string - 18273 ;mov di,offset TRANGROUP:BwdBuf - 18274 0000193A BF[399D] mov di,BWDBUF ; ES:DI = ptr to dir string - 18275 - 18276 ;;;test Bits,mask lcase ;M010;check for lowercase option - 18277 ;;test word [_Bits],10h - 18278 ;test byte [_Bits],10h - 18279 ; 08/06/2023 - 18280 0000193D F606[8B9D]10 test byte [_Bits],mask.lcase ; 20h ; MSDOS 6.0 - 18281 ; 01/08/2024 ; 10h ; PCDOS 7.1 - 18282 ;jz @F ;M010;lowercase not needed - 18283 00001942 7405 jz short dbare1 - 18284 00001944 89FE mov si,di ;M010;DS:SI --> ASCIIZ string in BwdBuf - 18285 00001946 E89803 call LowercaseString ;M010;path string is in BwdBuf - 18286 dbare1: - 18287 ;@@: - 18288 ;xor al,al ; AL = 0 - 18289 ; 19/02/2023 - 18290 00001949 31C0 xor ax,ax - 18291 0000194B B9FFFF mov cx,0FFFFh - 18292 0000194E FC cld - 18293 0000194F F2AE repne scasb ; ES:DI = ptr to byte after null - 18294 00001951 4F dec di ; ES:DI = ptr to null byte - 18295 - 18296 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18297 %if 1 ; *! - 18298 ;ifdef DBCS - 18299 00001952 56 push si ; *! - 18300 00001953 57 push di - 18301 ;mov si,offset TRANGROUP:BwdBuf - 18302 00001954 BE[399D] mov si,BWDBUF - 18303 00001957 4F dec di - 18304 00001958 E8C911 call CheckDBCSTailByte - 18305 0000195B 5F pop di - 18306 ; 01/08/2024 - 18307 ;pop si ; *! - 18308 0000195C 7407 jz short dbTailByte ; if last char is double byte - 18309 ;endif - 18310 %endif - 18311 0000195E 26807DFF5C cmp byte [es:di-1],'\' - 18312 ;je @F - 18313 00001963 7403 je short dbare2 ; already terminated w/ '\' - 18314 - 18315 dbTailByte: ; 01/08/2024 - 18316 ;mov ax,'\' ; AX = '\',0 - 18317 00001965 B05C mov al,'\' - 18318 00001967 AB stosw ; add to dir string - 18319 ;@@: - 18320 dbare2: - 18321 ;;mov String_Ptr_2,offset TRANGROUP:BwdBuf - 18322 ;mov word [string_ptr_2],BWDBUF ; *! - 18323 ; 01/08/2024 - 18324 00001968 8936[A09D] mov [string_ptr_2],si ; BWDBUF ; *! - 18325 0000196C 5E pop si ; *! - 18326 ;mov dx,offset TRANGROUP:String_Buf_Ptr - 18327 0000196D BA[DF91] mov dx,string_buf_ptr - 18328 ;invoke Std_Printf ; display device & directory path - 18329 00001970 E8B53A call std_printf - 18330 dbNameExt: - 18331 00001973 E82D00 call DisplayDotForm ; display name.ext - 18332 ;invoke CrLf2 ; display cr/lf - 18333 00001976 E80010 call CRLF2 - 18334 ; 19/02/2023 - 18335 ;call UseLine ;M007;Allow /p with /b - 18336 ;dbRet: - 18337 ;retn - 18338 - 18339 ; 19/02/2023 - 18340 ;jmp short UseLine + 18254 DisplayBare: + 18255 ; Suppress . and .. files from bare listing. + 18256 + 18257 00001922 8CD9 mov cx,ds ; CX = saved TRANGROUP seg addr + 18258 00001924 8E1E[F79B] mov ds,[TPA] ; DS:BX = ptr to file entry + 18259 ;assume ds:NOTHING + 18260 ;cmp ds:[bx].filename,'.' ; check 1st char of filename + 18261 00001928 807F012E cmp byte [bx+1],'.' ; [bx+EntrStruc.filename] + 18262 0000192C 8ED9 mov ds,cx ; DS = TRANGROUP seg addr again + 18263 ;assume ds:TRANGROUP + 18264 0000192E 74F1 je short dbRet ; it's . or .. - don't display + 18265 + 18266 ;;;test Bits,mask subd + 18267 ;;test word [_Bits],4 + 18268 ;test byte [_Bits],4 + 18269 ; 08/06/2023 + 18270 00001930 F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 + 18271 ; 01/08/2024 ; 4 ; PCDOS 7.1 + 18272 00001935 743C jz short dbNameExt ; not /s - display filename only + 18273 + 18274 ;invoke Build_Dir_String + 18275 00001937 E8C308 call build_dir_string + 18276 ;mov di,offset TRANGROUP:BwdBuf + 18277 0000193A BF[399D] mov di,BWDBUF ; ES:DI = ptr to dir string + 18278 + 18279 ;;;test Bits,mask lcase ;M010;check for lowercase option + 18280 ;;test word [_Bits],10h + 18281 ;test byte [_Bits],10h + 18282 ; 08/06/2023 + 18283 0000193D F606[8B9D]10 test byte [_Bits],mask.lcase ; 20h ; MSDOS 6.0 + 18284 ; 01/08/2024 ; 10h ; PCDOS 7.1 + 18285 ;jz @F ;M010;lowercase not needed + 18286 00001942 7405 jz short dbare1 + 18287 00001944 89FE mov si,di ;M010;DS:SI --> ASCIIZ string in BwdBuf + 18288 00001946 E89803 call LowercaseString ;M010;path string is in BwdBuf + 18289 dbare1: + 18290 ;@@: + 18291 ;xor al,al ; AL = 0 + 18292 ; 19/02/2023 + 18293 00001949 31C0 xor ax,ax + 18294 0000194B B9FFFF mov cx,0FFFFh + 18295 0000194E FC cld + 18296 0000194F F2AE repne scasb ; ES:DI = ptr to byte after null + 18297 00001951 4F dec di ; ES:DI = ptr to null byte + 18298 + 18299 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18300 %if 1 ; *! + 18301 ;ifdef DBCS + 18302 00001952 56 push si ; *! + 18303 00001953 57 push di + 18304 ;mov si,offset TRANGROUP:BwdBuf + 18305 00001954 BE[399D] mov si,BWDBUF + 18306 00001957 4F dec di + 18307 00001958 E8C911 call CheckDBCSTailByte + 18308 0000195B 5F pop di + 18309 ; 01/08/2024 + 18310 ;pop si ; *! + 18311 0000195C 7407 jz short dbTailByte ; if last char is double byte + 18312 ;endif + 18313 %endif + 18314 0000195E 26807DFF5C cmp byte [es:di-1],'\' + 18315 ;je @F + 18316 00001963 7403 je short dbare2 ; already terminated w/ '\' + 18317 + 18318 dbTailByte: ; 01/08/2024 + 18319 ;mov ax,'\' ; AX = '\',0 + 18320 00001965 B05C mov al,'\' + 18321 00001967 AB stosw ; add to dir string + 18322 ;@@: + 18323 dbare2: + 18324 ;;mov String_Ptr_2,offset TRANGROUP:BwdBuf + 18325 ;mov word [string_ptr_2],BWDBUF ; *! + 18326 ; 01/08/2024 + 18327 00001968 8936[A09D] mov [string_ptr_2],si ; BWDBUF ; *! + 18328 0000196C 5E pop si ; *! + 18329 ;mov dx,offset TRANGROUP:String_Buf_Ptr + 18330 0000196D BA[DF91] mov dx,string_buf_ptr + 18331 ;invoke Std_Printf ; display device & directory path + 18332 00001970 E8B53A call std_printf + 18333 dbNameExt: + 18334 00001973 E82D00 call DisplayDotForm ; display name.ext + 18335 ;invoke CrLf2 ; display cr/lf + 18336 00001976 E80010 call CRLF2 + 18337 ; 19/02/2023 + 18338 ;call UseLine ;M007;Allow /p with /b + 18339 ;dbRet: + 18340 ;retn 18341 - 18342 ; --------------------------------------------------------------------------- - 18343 - 18344 ;*** UseLine - use a display line, start a new page if none left - 18345 ; - 18346 ; ENTRY nothing - 18347 ; - 18348 ; EXIT nothing - 18349 ; - 18350 ; USED flags - 18351 - 18352 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18353 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A04h + 18342 ; 19/02/2023 + 18343 ;jmp short UseLine + 18344 + 18345 ; --------------------------------------------------------------------------- + 18346 + 18347 ;*** UseLine - use a display line, start a new page if none left + 18348 ; + 18349 ; ENTRY nothing + 18350 ; + 18351 ; EXIT nothing + 18352 ; + 18353 ; USED flags 18354 - 18355 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18356 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D58h - 18357 UseLine: - 18358 00001979 FF0E[1E9C] dec word [LeftOnPage] - 18359 0000197D 833E[1E9C]02 cmp word [LeftOnPage],2 - 18360 00001982 771E ja short ulRet - 18361 ; 19/02/2023 - 18362 ;call EndPage - 18363 ;ulRet: - 18364 ;retn - 18365 - 18366 ; 19/02/2023 - 18367 ;jmp short EndPage + 18355 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18356 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A04h + 18357 + 18358 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18359 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D58h + 18360 UseLine: + 18361 00001979 FF0E[1E9C] dec word [LeftOnPage] + 18362 0000197D 833E[1E9C]02 cmp word [LeftOnPage],2 + 18363 00001982 771E ja short ulRet + 18364 ; 19/02/2023 + 18365 ;call EndPage + 18366 ;ulRet: + 18367 ;retn 18368 - 18369 ; --------------------------------------------------------------------------- - 18370 - 18371 ;*** EndPage - end the current display page - 18372 ; - 18373 ; ENTRY LeftOnPage = # lines left on display page - 18374 ; Current directory (on selected drive) is the one being listed - 18375 ; Bits contains /p setting - 18376 ; - 18377 ; EXIT LeftOnPage = # lines left for next page - 18378 ; - 18379 ; USED AX,DX - 18380 ; - 18381 ; EFFECTS - 18382 ; - 18383 ; Pause is invoked to display a message and wait for a keystroke. - 18384 ; BwdBuf (same as DirBuf) used to build directory string. - 18385 - 18386 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18387 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:19B8h + 18369 ; 19/02/2023 + 18370 ;jmp short EndPage + 18371 + 18372 ; --------------------------------------------------------------------------- + 18373 + 18374 ;*** EndPage - end the current display page + 18375 ; + 18376 ; ENTRY LeftOnPage = # lines left on display page + 18377 ; Current directory (on selected drive) is the one being listed + 18378 ; Bits contains /p setting + 18379 ; + 18380 ; EXIT LeftOnPage = # lines left for next page + 18381 ; + 18382 ; USED AX,DX + 18383 ; + 18384 ; EFFECTS + 18385 ; + 18386 ; Pause is invoked to display a message and wait for a keystroke. + 18387 ; BwdBuf (same as DirBuf) used to build directory string. 18388 - 18389 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18390 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1BADh + 18389 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18390 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:19B8h 18391 - 18392 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18393 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D0Ch - 18394 EndPage: - 18395 ;;;test Bits,mask pagd - 18396 ;;test word [_Bits],2 - 18397 ;test byte [_Bits],2 - 18398 ; 08/06/2023 - 18399 00001984 F606[8B9D]02 test byte [_Bits],mask.pagd ; 4 ; MSDOS 6.0 - 18400 ; 01/08/2024 ; 2 ; PCDOS 7.1 - 18401 00001989 7410 jz short epNew ; paged display isn't enabled - 18402 - 18403 0000198B 53 push bx ; save BX - 18404 0000198C 51 push cx ; save CX + 18392 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18393 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1BADh + 18394 + 18395 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18396 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D0Ch + 18397 EndPage: + 18398 ;;;test Bits,mask pagd + 18399 ;;test word [_Bits],2 + 18400 ;test byte [_Bits],2 + 18401 ; 08/06/2023 + 18402 00001984 F606[8B9D]02 test byte [_Bits],mask.pagd ; 4 ; MSDOS 6.0 + 18403 ; 01/08/2024 ; 2 ; PCDOS 7.1 + 18404 00001989 7410 jz short epNew ; paged display isn't enabled 18405 - 18406 ;invoke Pause ; "Press any key to continue..." - 18407 0000198D E87003 call PAUSE + 18406 0000198B 53 push bx ; save BX + 18407 0000198C 51 push cx ; save CX 18408 - 18409 ;invoke Build_Dir_String - 18410 00001990 E86A08 call build_dir_string - 18411 ;mov dx,offset TRANGROUP:DirCont_Ptr - 18412 00001993 BA[9B92] mov dx,dircont_ptr - 18413 ;invoke Printf_Crlf ; "(continuing )", cr/lf - 18414 00001996 E8813A call Printf_Crlf - 18415 - 18416 00001999 59 pop cx ; restore CX - 18417 0000199A 5B pop bx ; restore BX - 18418 epNew: - 18419 0000199B A1[179F] mov ax,[LinPerPag] ; AX = # lines per page - 18420 0000199E 48 dec ax ; AX = # lines till next EndPage - 18421 0000199F A3[1E9C] mov [LeftOnPage],ax ; LeftOnPage = countdown variable - 18422 ulRet: - 18423 ; 19/02/2023 - 18424 000019A2 C3 retn - 18425 - 18426 ; --------------------------------------------------------------------------- - 18427 - 18428 ;*** DisplayDotForm - display filename in compressed dot format - 18429 ; - 18430 ; Display name.ext, with no cr/lf's. Dot is displayed only - 18431 ; if the filename has a nonblank extension. + 18409 ;invoke Pause ; "Press any key to continue..." + 18410 0000198D E87003 call PAUSE + 18411 + 18412 ;invoke Build_Dir_String + 18413 00001990 E86A08 call build_dir_string + 18414 ;mov dx,offset TRANGROUP:DirCont_Ptr + 18415 00001993 BA[9B92] mov dx,dircont_ptr + 18416 ;invoke Printf_Crlf ; "(continuing )", cr/lf + 18417 00001996 E8813A call Printf_Crlf + 18418 + 18419 00001999 59 pop cx ; restore CX + 18420 0000199A 5B pop bx ; restore BX + 18421 epNew: + 18422 0000199B A1[179F] mov ax,[LinPerPag] ; AX = # lines per page + 18423 0000199E 48 dec ax ; AX = # lines till next EndPage + 18424 0000199F A3[1E9C] mov [LeftOnPage],ax ; LeftOnPage = countdown variable + 18425 ulRet: + 18426 ; 19/02/2023 + 18427 000019A2 C3 retn + 18428 + 18429 ; --------------------------------------------------------------------------- + 18430 + 18431 ;*** DisplayDotForm - display filename in compressed dot format 18432 ; - 18433 ; ENTRY BX = offset of entry in TPA buffer - 18434 ; - 18435 ; EXIT DX = # char's displayed, including dot - 18436 ; - 18437 ; USED AX,CX,SI,DI - 18438 ; - 18439 ; EFFECTS - 18440 ; - 18441 ; Filename is displayed in name.ext format. - 18442 ; - 18443 ; NOTE - 18444 ; - 18445 ; We allow for bogus filenames that have blanks embedded - 18446 ; in the name or extension. - 18447 - 18448 ; Bugbug: might be a good performance gain if we buffered - 18449 ; up the output and used DOS function 9. + 18433 ; Display name.ext, with no cr/lf's. Dot is displayed only + 18434 ; if the filename has a nonblank extension. + 18435 ; + 18436 ; ENTRY BX = offset of entry in TPA buffer + 18437 ; + 18438 ; EXIT DX = # char's displayed, including dot + 18439 ; + 18440 ; USED AX,CX,SI,DI + 18441 ; + 18442 ; EFFECTS + 18443 ; + 18444 ; Filename is displayed in name.ext format. + 18445 ; + 18446 ; NOTE + 18447 ; + 18448 ; We allow for bogus filenames that have blanks embedded + 18449 ; in the name or extension. 18450 - 18451 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18452 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:17C8h + 18451 ; Bugbug: might be a good performance gain if we buffered + 18452 ; up the output and used DOS function 9. 18453 - 18454 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18455 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1953h + 18454 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18455 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:17C8h 18456 - 18457 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18458 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1A0Dh - 18459 DisplayDotForm: - 18460 000019A3 1E push ds ; save TRANGROUP seg addr - 18461 000019A4 06 push es ; save ES - 18462 000019A5 2EA1[F79B] mov ax,[cs:TPA] ; AX = TPA seg addr - 18463 000019A9 8ED8 mov ds,ax ; DS:BX = ptr to entry - 18464 ;assume ds:nothing - 18465 000019AB 8EC0 mov es,ax ; ES:BX = ptr to entry - 18466 - 18467 ; 08/06/2023 - 18468 ;mov di,bx ; ES:DI = ptr to entry - 18469 ;;;add di,filename + size filename - 1 - 18470 ;add di,8 ; 1+8-1 ; ES:DI = ptr to last char in name field - 18471 ;;mov cx,size filename ; CX = length of name field - 18472 ;mov cx,8 - 18473 ; 08/06/2023 - 18474 000019AD B90800 mov cx,8 - 18475 000019B0 89CF mov di,cx - 18476 000019B2 01DF add di,bx - 18477 - 18478 000019B4 B020 mov al,' ' - 18479 000019B6 FD std ; scan down - 18480 000019B7 F3AE repe scasb ; scan for nonblank - 18481 - 18482 ; Assume file name has at least one character. - 18483 - 18484 000019B9 41 inc cx ; CX = # chars in name - 18485 000019BA 89CA mov dx,cx ; DX = # chars to be displayed + 18457 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18458 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1953h + 18459 + 18460 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18461 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1A0Dh + 18462 DisplayDotForm: + 18463 000019A3 1E push ds ; save TRANGROUP seg addr + 18464 000019A4 06 push es ; save ES + 18465 000019A5 2EA1[F79B] mov ax,[cs:TPA] ; AX = TPA seg addr + 18466 000019A9 8ED8 mov ds,ax ; DS:BX = ptr to entry + 18467 ;assume ds:nothing + 18468 000019AB 8EC0 mov es,ax ; ES:BX = ptr to entry + 18469 + 18470 ; 08/06/2023 + 18471 ;mov di,bx ; ES:DI = ptr to entry + 18472 ;;;add di,filename + size filename - 1 + 18473 ;add di,8 ; 1+8-1 ; ES:DI = ptr to last char in name field + 18474 ;;mov cx,size filename ; CX = length of name field + 18475 ;mov cx,8 + 18476 ; 08/06/2023 + 18477 000019AD B90800 mov cx,8 + 18478 000019B0 89CF mov di,cx + 18479 000019B2 01DF add di,bx + 18480 + 18481 000019B4 B020 mov al,' ' + 18482 000019B6 FD std ; scan down + 18483 000019B7 F3AE repe scasb ; scan for nonblank + 18484 + 18485 ; Assume file name has at least one character. 18486 - 18487 000019BC 89DE mov si,bx ; DS:SI = ptr to entry - 18488 ;;add si,filename ; DS:SI = ptr to name - 18489 ;add si,1 - 18490 ; ; add si,EntryStruc.filename - 18491 ; 25/04/2023 - 18492 000019BE 46 inc si - 18493 NextNameChar: - 18494 000019BF FC cld - 18495 000019C0 AC lodsb ; AL = next char - 18496 - 18497 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18498 %if 1 - 18499 ;ifdef DBCS - 18500 ;invoke testkanj - 18501 ;jz @f ; if this is not lead byte - 18502 000019C1 E89D0D call testkanj - 18503 000019C4 7409 jz short ddf3 - 18504 ;invoke Print_Char ; display lead byte - 18505 000019C6 E8E507 call PRINT_CHAR - 18506 000019C9 49 dec cx - 18507 000019CA 7413 jz short ExtChar ; if this is end - 18508 000019CC AC lodsb ; get tail byte - 18509 ;jmp short NameChar10 ; display tail byte - 18510 000019CD EB0B jmp short ddf1 - 18511 ;@@: - 18512 ddf3: - 18513 ;endif - 18514 %endif - 18515 ;;;test Bits,mask lcase ;M010;check for lowercase option - 18516 ;;test word [ss:_Bits],10h - 18517 ;test byte [ss:_Bits],10h - 18518 ; 08/06/2023 - 18519 000019CF 36F606[8B9D]10 test byte [ss:_Bits],mask.lcase ; 20h ; MSDOS 6.0 - 18520 ; 01/08/2024 ; 10h ; PCDOS 7.1 - 18521 ;jz short @F ;M010;lowercase not required - 18522 000019D5 7403 jz short ddf1 - 18523 000019D7 E8FC02 call LowerCase ;M010;filename char is in AL - 18524 - 18525 ;NameChar10: - 18526 ddf1: - 18527 ;@@: - 18528 ;invoke Print_Char ; display it - 18529 000019DA E8D107 call PRINT_CHAR - 18530 000019DD E2E0 loop NextNameChar - 18531 - 18532 ExtChar: ; 01/08/2024 - 18533 - 18534 ; Now do extension. - 18535 - 18536 000019DF 89DF mov di,bx ; ES:DI = ptr to entry - 18537 ;add di,fileext + size fileext - 1 - 18538 000019E1 83C70B add di,11 ; 9+3-1 ; ES:DI = ptr to last char in ext field - 18539 ;mov cx,size fileext ; CX = length of ext field - 18540 000019E4 B90300 mov cx,3 - 18541 000019E7 B020 mov al,' ' - 18542 000019E9 FD std ; scan down - 18543 000019EA F3AE repe scasb ; scan for nonblank - 18544 000019EC 742E je short ddDone ; no nonblank chars in ext - 18545 - 18546 000019EE 41 inc cx ; CX = # chars in ext - 18547 000019EF 01CA add dx,cx ; DX = total # chars to be displayed - 18548 000019F1 42 inc dx ; including dot - 18549 - 18550 000019F2 B02E mov al,'.' - 18551 000019F4 E8B707 call PRINT_CHAR - 18552 000019F7 89DE mov si,bx ; DS:SI = ptr to entry - 18553 ;add si,fileext ; DS:SI = ptr to ext - 18554 000019F9 83C609 add si,9 - 18555 - 18556 NextExtChar: - 18557 000019FC FC cld - 18558 000019FD AC lodsb ; AL = next char - 18559 - 18560 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18561 %if 1 - 18562 ;ifdef DBCS - 18563 ;invoke testkanj - 18564 ;jz @f ; if this is not lead byte - 18565 000019FE E8600D call testkanj - 18566 00001A01 7409 jz short ddf4 - 18567 ;invoke Print_Char ; display lead byte - 18568 00001A03 E8A807 call PRINT_CHAR - 18569 00001A06 49 dec cx - 18570 00001A07 7413 jz short ddDone ; if this is end - 18571 00001A09 AC lodsb ; get tail byte - 18572 ;jmp short ExtChar10 ; display tail byte - 18573 00001A0A EB0B jmp short ddf2 - 18574 ;@@: - 18575 ddf4: - 18576 ;endif - 18577 %endif - 18578 ;;;test CS:Bits,mask lcase ;M010;check for lowercase option - 18579 ;;test word [cs:_Bits],10h - 18580 ;test byte [cs:_Bits],10h - 18581 ; 08/06/2023 - 18582 00001A0C 2EF606[8B9D]10 test byte [cs:_Bits],mask.lcase ; 20h ; MSDOS 6.0 - 18583 ; 01/08/2024 ; 10h ; PCDOS 7.1 - 18584 ;jz short @F ;M010;lowercase not required - 18585 00001A12 7403 jz short ddf2 - 18586 00001A14 E8BF02 call LowerCase ;M010;fileext char is in AL - 18587 ;@@: - 18588 ddf2: - 18589 ;invoke Print_Char ; display it - 18590 00001A17 E89407 call PRINT_CHAR - 18591 00001A1A E2E0 loop NextExtChar - 18592 ddDone: - 18593 00001A1C 07 pop es ; restore ES - 18594 00001A1D 1F pop ds ; DS = TRANGROUP seg addr again - 18595 ;assume ds:TRANGROUP - 18596 00001A1E FC cld ; leave direction flag = up - 18597 00001A1F C3 retn - 18598 - 18599 ; --------------------------------------------------------------------------- - 18600 - 18601 ;*** DisplayFile - display file entry, update counters - 18602 ; - 18603 ; ENTRY BX = offset of entry in TPA buffer - 18604 ; Bits contains /w, /p settings + 18487 000019B9 41 inc cx ; CX = # chars in name + 18488 000019BA 89CA mov dx,cx ; DX = # chars to be displayed + 18489 + 18490 000019BC 89DE mov si,bx ; DS:SI = ptr to entry + 18491 ;;add si,filename ; DS:SI = ptr to name + 18492 ;add si,1 + 18493 ; ; add si,EntryStruc.filename + 18494 ; 25/04/2023 + 18495 000019BE 46 inc si + 18496 NextNameChar: + 18497 000019BF FC cld + 18498 000019C0 AC lodsb ; AL = next char + 18499 + 18500 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18501 %if 1 + 18502 ;ifdef DBCS + 18503 ;invoke testkanj + 18504 ;jz @f ; if this is not lead byte + 18505 000019C1 E89D0D call testkanj + 18506 000019C4 7409 jz short ddf3 + 18507 ;invoke Print_Char ; display lead byte + 18508 000019C6 E8E507 call PRINT_CHAR + 18509 000019C9 49 dec cx + 18510 000019CA 7413 jz short ExtChar ; if this is end + 18511 000019CC AC lodsb ; get tail byte + 18512 ;jmp short NameChar10 ; display tail byte + 18513 000019CD EB0B jmp short ddf1 + 18514 ;@@: + 18515 ddf3: + 18516 ;endif + 18517 %endif + 18518 ;;;test Bits,mask lcase ;M010;check for lowercase option + 18519 ;;test word [ss:_Bits],10h + 18520 ;test byte [ss:_Bits],10h + 18521 ; 08/06/2023 + 18522 000019CF 36F606[8B9D]10 test byte [ss:_Bits],mask.lcase ; 20h ; MSDOS 6.0 + 18523 ; 01/08/2024 ; 10h ; PCDOS 7.1 + 18524 ;jz short @F ;M010;lowercase not required + 18525 000019D5 7403 jz short ddf1 + 18526 000019D7 E8FC02 call LowerCase ;M010;filename char is in AL + 18527 + 18528 ;NameChar10: + 18529 ddf1: + 18530 ;@@: + 18531 ;invoke Print_Char ; display it + 18532 000019DA E8D107 call PRINT_CHAR + 18533 000019DD E2E0 loop NextNameChar + 18534 + 18535 ExtChar: ; 01/08/2024 + 18536 + 18537 ; Now do extension. + 18538 + 18539 000019DF 89DF mov di,bx ; ES:DI = ptr to entry + 18540 ;add di,fileext + size fileext - 1 + 18541 000019E1 83C70B add di,11 ; 9+3-1 ; ES:DI = ptr to last char in ext field + 18542 ;mov cx,size fileext ; CX = length of ext field + 18543 000019E4 B90300 mov cx,3 + 18544 000019E7 B020 mov al,' ' + 18545 000019E9 FD std ; scan down + 18546 000019EA F3AE repe scasb ; scan for nonblank + 18547 000019EC 742E je short ddDone ; no nonblank chars in ext + 18548 + 18549 000019EE 41 inc cx ; CX = # chars in ext + 18550 000019EF 01CA add dx,cx ; DX = total # chars to be displayed + 18551 000019F1 42 inc dx ; including dot + 18552 + 18553 000019F2 B02E mov al,'.' + 18554 000019F4 E8B707 call PRINT_CHAR + 18555 000019F7 89DE mov si,bx ; DS:SI = ptr to entry + 18556 ;add si,fileext ; DS:SI = ptr to ext + 18557 000019F9 83C609 add si,9 + 18558 + 18559 NextExtChar: + 18560 000019FC FC cld + 18561 000019FD AC lodsb ; AL = next char + 18562 + 18563 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18564 %if 1 + 18565 ;ifdef DBCS + 18566 ;invoke testkanj + 18567 ;jz @f ; if this is not lead byte + 18568 000019FE E8600D call testkanj + 18569 00001A01 7409 jz short ddf4 + 18570 ;invoke Print_Char ; display lead byte + 18571 00001A03 E8A807 call PRINT_CHAR + 18572 00001A06 49 dec cx + 18573 00001A07 7413 jz short ddDone ; if this is end + 18574 00001A09 AC lodsb ; get tail byte + 18575 ;jmp short ExtChar10 ; display tail byte + 18576 00001A0A EB0B jmp short ddf2 + 18577 ;@@: + 18578 ddf4: + 18579 ;endif + 18580 %endif + 18581 ;;;test CS:Bits,mask lcase ;M010;check for lowercase option + 18582 ;;test word [cs:_Bits],10h + 18583 ;test byte [cs:_Bits],10h + 18584 ; 08/06/2023 + 18585 00001A0C 2EF606[8B9D]10 test byte [cs:_Bits],mask.lcase ; 20h ; MSDOS 6.0 + 18586 ; 01/08/2024 ; 10h ; PCDOS 7.1 + 18587 ;jz short @F ;M010;lowercase not required + 18588 00001A12 7403 jz short ddf2 + 18589 00001A14 E8BF02 call LowerCase ;M010;fileext char is in AL + 18590 ;@@: + 18591 ddf2: + 18592 ;invoke Print_Char ; display it + 18593 00001A17 E89407 call PRINT_CHAR + 18594 00001A1A E2E0 loop NextExtChar + 18595 ddDone: + 18596 00001A1C 07 pop es ; restore ES + 18597 00001A1D 1F pop ds ; DS = TRANGROUP seg addr again + 18598 ;assume ds:TRANGROUP + 18599 00001A1E FC cld ; leave direction flag = up + 18600 00001A1F C3 retn + 18601 + 18602 ; --------------------------------------------------------------------------- + 18603 + 18604 ;*** DisplayFile - display file entry, update counters 18605 ; - 18606 ; EXIT nothing - 18607 ; - 18608 ; USED AX,CX,DX,SI,DI,BP - 18609 ; - 18610 ; EFFECTS - 18611 ; - 18612 ; Entry is displayed. - 18613 ; If not /b, - 18614 ; Cursor is left at end of entry on screen. - 18615 ; FileCnt, FileCntTotal, FileSiz, FileSizTotal are updated. - 18616 ; If /b, - 18617 ; Cursor is left at beginning of next line. - 18618 ; Cnt's and Siz's aren't updated. - 18619 - 18620 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18621 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:182Eh - 18622 - 18623 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18624 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:19B9h - 18625 - 18626 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18627 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1A8Fh + 18606 ; ENTRY BX = offset of entry in TPA buffer + 18607 ; Bits contains /w, /p settings + 18608 ; + 18609 ; EXIT nothing + 18610 ; + 18611 ; USED AX,CX,DX,SI,DI,BP + 18612 ; + 18613 ; EFFECTS + 18614 ; + 18615 ; Entry is displayed. + 18616 ; If not /b, + 18617 ; Cursor is left at end of entry on screen. + 18618 ; FileCnt, FileCntTotal, FileSiz, FileSizTotal are updated. + 18619 ; If /b, + 18620 ; Cursor is left at beginning of next line. + 18621 ; Cnt's and Siz's aren't updated. + 18622 + 18623 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18624 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:182Eh + 18625 + 18626 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18627 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:19B9h 18628 - 18629 DisplayFile: - 18630 ;;;test Bits,mask bare - 18631 ;;test word [_Bits],8 - 18632 ;test byte [_Bits],8 - 18633 ; 08/06/2023 - 18634 00001A20 F606[8B9D]08 test byte [_Bits],mask.bare ; 16 ; MSDOS 6.0 - 18635 ; 01/08/2024 ; 8 ; PCDOS 7.1 - 18636 00001A25 7405 jz short dfNorm ; not /b - do normal display - 18637 - 18638 00001A27 E8F8FE call DisplayBare ; display file in bare format - 18639 00001A2A EB18 jmp short dfRet - 18640 dfNorm: - 18641 00001A2C E87800 call DisplayNext ; pos'n cursor for next entry - 18642 ;;;test Bits,mask wide - 18643 ;;test word [_Bits],1 - 18644 ;test byte [_Bits],1 - 18645 ; 08/06/2023 - 18646 00001A2F F606[8B9D]01 test byte [_Bits],mask.wide ; 2 ; MSDOS 6.0 - 18647 ; 01/08/2024 ; 1 ; PCDOS 7.1 - 18648 00001A34 7405 jz short dfFull ; full format - 18649 00001A36 E82A02 call DisplayWide ; wide format - 18650 00001A39 EB06 jmp short dfCnt - 18651 dfFull: - 18652 00001A3B E83400 call DisplayName ; display filename & extension - 18653 00001A3E E88D00 call DisplayTheRest ; display size, date, time - 18654 - 18655 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18656 %if 0 - 18657 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 18658 ; MSDOS 6.0 - 18659 ;ifdef DBLSPACE_HOOKS - 18660 ;;test Bits,mask cratio - 18661 ;test word [_Bits],1 - 18662 test byte [_Bits],mask.cratio - 18663 ; display compression ratio - 18664 jz short dfCnt - 18665 call DisplayCompRatio - 18666 ;endif - 18667 %endif - 18668 - 18669 dfCnt: - 18670 00001A41 E8A7FE call CountFile ; update file counters - 18671 dfRet: - 18672 dhRet: ; 19/02/2023 - 18673 00001A44 C3 retn - 18674 - 18675 ; --------------------------------------------------------------------------- - 18676 - 18677 ;*** DisplayHeader - display directory header of working directory - 18678 ; - 18679 ; ENTRY Current directory (on selected drive) is the one to display - 18680 ; LeftOnPage = # lines left on display page + 18629 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18630 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1A8Fh + 18631 + 18632 DisplayFile: + 18633 ;;;test Bits,mask bare + 18634 ;;test word [_Bits],8 + 18635 ;test byte [_Bits],8 + 18636 ; 08/06/2023 + 18637 00001A20 F606[8B9D]08 test byte [_Bits],mask.bare ; 16 ; MSDOS 6.0 + 18638 ; 01/08/2024 ; 8 ; PCDOS 7.1 + 18639 00001A25 7405 jz short dfNorm ; not /b - do normal display + 18640 + 18641 00001A27 E8F8FE call DisplayBare ; display file in bare format + 18642 00001A2A EB18 jmp short dfRet + 18643 dfNorm: + 18644 00001A2C E87800 call DisplayNext ; pos'n cursor for next entry + 18645 ;;;test Bits,mask wide + 18646 ;;test word [_Bits],1 + 18647 ;test byte [_Bits],1 + 18648 ; 08/06/2023 + 18649 00001A2F F606[8B9D]01 test byte [_Bits],mask.wide ; 2 ; MSDOS 6.0 + 18650 ; 01/08/2024 ; 1 ; PCDOS 7.1 + 18651 00001A34 7405 jz short dfFull ; full format + 18652 00001A36 E82A02 call DisplayWide ; wide format + 18653 00001A39 EB06 jmp short dfCnt + 18654 dfFull: + 18655 00001A3B E83400 call DisplayName ; display filename & extension + 18656 00001A3E E88D00 call DisplayTheRest ; display size, date, time + 18657 + 18658 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18659 %if 0 + 18660 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 18661 ; MSDOS 6.0 + 18662 ;ifdef DBLSPACE_HOOKS + 18663 ;;test Bits,mask cratio + 18664 ;test word [_Bits],1 + 18665 test byte [_Bits],mask.cratio + 18666 ; display compression ratio + 18667 jz short dfCnt + 18668 call DisplayCompRatio + 18669 ;endif + 18670 %endif + 18671 + 18672 dfCnt: + 18673 00001A41 E8A7FE call CountFile ; update file counters + 18674 dfRet: + 18675 dhRet: ; 19/02/2023 + 18676 00001A44 C3 retn + 18677 + 18678 ; --------------------------------------------------------------------------- + 18679 + 18680 ;*** DisplayHeader - display directory header of working directory 18681 ; - 18682 ; EXIT nothing - 18683 ; - 18684 ; ERROR EXIT - 18685 ; - 18686 ; Build_Dir_String will exit through CError with "Invalid drive - 18687 ; specification" if there's a problem obtaining the current - 18688 ; directory pathname. - 18689 ; - 18690 ; USED AX,DX,SI,DI - 18691 ; - 18692 ; EFFECTS - 18693 ; - 18694 ; BwdBuf (which is really the same buffer as DirBuf, which - 18695 ; we are using for the DTA) contains the directory string. - 18696 ; LeftOnPage is adjusted. - 18697 - 18698 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18699 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18682 ; ENTRY Current directory (on selected drive) is the one to display + 18683 ; LeftOnPage = # lines left on display page + 18684 ; + 18685 ; EXIT nothing + 18686 ; + 18687 ; ERROR EXIT + 18688 ; + 18689 ; Build_Dir_String will exit through CError with "Invalid drive + 18690 ; specification" if there's a problem obtaining the current + 18691 ; directory pathname. + 18692 ; + 18693 ; USED AX,DX,SI,DI + 18694 ; + 18695 ; EFFECTS + 18696 ; + 18697 ; BwdBuf (which is really the same buffer as DirBuf, which + 18698 ; we are using for the DTA) contains the directory string. + 18699 ; LeftOnPage is adjusted. 18700 - 18701 DisplayHeader: - 18702 ;;;test Bits,mask bare - 18703 ;;test word [_Bits],8 - 18704 ;test byte [_Bits],8 - 18705 ; 08/06/2023 - 18706 00001A45 F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 - 18707 ; 01/08/2024 ; 8 ; PCDOS 7.1 - 18708 00001A4A 75F8 jnz short dhRet ; /b - don't display header - 18709 - 18710 ;;;test Bits,mask subd - 18711 ;;test word [_Bits],4 - 18712 ;test byte [_Bits],4 - 18713 ; 08/06/2023 - 18714 00001A4C F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 - 18715 ; 01/08/2024 ; 4 ; PCDOS 7.1 - 18716 00001A51 7408 jz short dhNorm ; not /s - 18717 - 18718 ; For subdirectory listings, put a blank line before the header. - 18719 - 18720 ;invoke Crlf2 ; start with a blank line - 18721 00001A53 E8230F call CRLF2 - 18722 00001A56 E820FF call UseLine - 18723 00001A59 EB05 jmp short dhCom - 18724 dhNorm: - 18725 00001A5B B020 mov al,' ' ; 20h - 18726 ;mov al,BLANK ; if not /s, precede by a blank - 18727 00001A5D E84E07 call PRINT_CHAR ; print a leading blank - 18728 dhCom: - 18729 00001A60 E89A07 call build_dir_string - 18730 00001A63 BA[4391] mov dx,dirhead_ptr - 18731 00001A66 E8BF39 call std_printf ; print header & cr/lf - 18732 00001A69 E80DFF call UseLine - 18733 00001A6C E80A0F call CRLF2 ; another cr/lf - 18734 ;call UseLine - 18735 ;dhRet: - 18736 ;retn - 18737 - 18738 ; 19/02/2023 - 18739 00001A6F E907FF jmp UseLine + 18701 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18702 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18703 + 18704 DisplayHeader: + 18705 ;;;test Bits,mask bare + 18706 ;;test word [_Bits],8 + 18707 ;test byte [_Bits],8 + 18708 ; 08/06/2023 + 18709 00001A45 F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 + 18710 ; 01/08/2024 ; 8 ; PCDOS 7.1 + 18711 00001A4A 75F8 jnz short dhRet ; /b - don't display header + 18712 + 18713 ;;;test Bits,mask subd + 18714 ;;test word [_Bits],4 + 18715 ;test byte [_Bits],4 + 18716 ; 08/06/2023 + 18717 00001A4C F606[8B9D]04 test byte [_Bits],mask.subd ; 8 ; MSDOS 6.0 + 18718 ; 01/08/2024 ; 4 ; PCDOS 7.1 + 18719 00001A51 7408 jz short dhNorm ; not /s + 18720 + 18721 ; For subdirectory listings, put a blank line before the header. + 18722 + 18723 ;invoke Crlf2 ; start with a blank line + 18724 00001A53 E8230F call CRLF2 + 18725 00001A56 E820FF call UseLine + 18726 00001A59 EB05 jmp short dhCom + 18727 dhNorm: + 18728 00001A5B B020 mov al,' ' ; 20h + 18729 ;mov al,BLANK ; if not /s, precede by a blank + 18730 00001A5D E84E07 call PRINT_CHAR ; print a leading blank + 18731 dhCom: + 18732 00001A60 E89A07 call build_dir_string + 18733 00001A63 BA[4391] mov dx,dirhead_ptr + 18734 00001A66 E8BF39 call std_printf ; print header & cr/lf + 18735 00001A69 E80DFF call UseLine + 18736 00001A6C E80A0F call CRLF2 ; another cr/lf + 18737 ;call UseLine + 18738 ;dhRet: + 18739 ;retn 18740 - 18741 ; --------------------------------------------------------------------------- - 18742 - 18743 ;*** DisplayName - display file name & extension - 18744 ; - 18745 ; ENTRY BX = offset of entry in TPA buffer - 18746 ; - 18747 ; EXIT nothing - 18748 ; - 18749 ; USED AX,CX,DX,SI,DI - 18750 ; - 18751 ; EFFECTS - 18752 ; - 18753 ; Filename & extension are displayed in spread format. - 18754 ; Cursor is left at end of extension. - 18755 - 18756 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18757 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18758 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18759 - 18760 DisplayName: - 18761 00001A72 1E push ds ; save TRANGROUP seg addr - 18762 00001A73 8E1E[F79B] mov ds,[TPA] ; DS:BX = ptr to entry - 18763 ;assume ds:nothing - 18764 00001A77 89DE mov si,bx ; DS:SI = ptr to entry - 18765 ;;add si,filename ; DS:SI = ptr to filename - 18766 ;add si,1 ; EntryStruc.filename - 18767 ; 08/06/2023 - 18768 00001A79 46 inc si - 18769 00001A7A BF[6A9C] mov di,CHARBUF ; ES:DI = ptr to CharBuf - 18770 - 18771 00001A7D B90800 mov cx,8 - 18772 00001A80 FC cld - 18773 00001A81 F3A4 rep movsb ; move filename to CharBuf - 18774 00001A83 B020 mov al,' ' - 18775 00001A85 AA stosb ; add a blank - 18776 ;mov cx,3 - 18777 ; 08/06/2023 - 18778 00001A86 B103 mov cl,3 - 18779 00001A88 F3A4 rep movsb ; add extension - 18780 00001A8A 30C0 xor al,al - 18781 00001A8C AA stosb ; add a NULL - 18782 - 18783 00001A8D 1F pop ds ; DS = TRANGROUP seg addr again - 18784 ;assume ds:TRANGROUP + 18741 ; 19/02/2023 + 18742 00001A6F E907FF jmp UseLine + 18743 + 18744 ; --------------------------------------------------------------------------- + 18745 + 18746 ;*** DisplayName - display file name & extension + 18747 ; + 18748 ; ENTRY BX = offset of entry in TPA buffer + 18749 ; + 18750 ; EXIT nothing + 18751 ; + 18752 ; USED AX,CX,DX,SI,DI + 18753 ; + 18754 ; EFFECTS + 18755 ; + 18756 ; Filename & extension are displayed in spread format. + 18757 ; Cursor is left at end of extension. + 18758 + 18759 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18760 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18761 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18762 + 18763 DisplayName: + 18764 00001A72 1E push ds ; save TRANGROUP seg addr + 18765 00001A73 8E1E[F79B] mov ds,[TPA] ; DS:BX = ptr to entry + 18766 ;assume ds:nothing + 18767 00001A77 89DE mov si,bx ; DS:SI = ptr to entry + 18768 ;;add si,filename ; DS:SI = ptr to filename + 18769 ;add si,1 ; EntryStruc.filename + 18770 ; 08/06/2023 + 18771 00001A79 46 inc si + 18772 00001A7A BF[6A9C] mov di,CHARBUF ; ES:DI = ptr to CharBuf + 18773 + 18774 00001A7D B90800 mov cx,8 + 18775 00001A80 FC cld + 18776 00001A81 F3A4 rep movsb ; move filename to CharBuf + 18777 00001A83 B020 mov al,' ' + 18778 00001A85 AA stosb ; add a blank + 18779 ;mov cx,3 + 18780 ; 08/06/2023 + 18781 00001A86 B103 mov cl,3 + 18782 00001A88 F3A4 rep movsb ; add extension + 18783 00001A8A 30C0 xor al,al + 18784 00001A8C AA stosb ; add a NULL 18785 - 18786 ;;;test Bits,mask lcase ;M010;check for lowercase option - 18787 ;;test word [_Bits],10h - 18788 ;test byte [_Bits],10h - 18789 ; 08/06/2023 - 18790 00001A8E F606[8B9D]10 test byte [_Bits],mask.lcase ; 20h ; MSDOS 6.0 - 18791 ; 01/08/2024 ; 10h ; PCDOS 7.1 - 18792 00001A93 7406 jz short dn1 ;M010;lowercase not required - 18793 00001A95 BE[6A9C] mov si,CHARBUF ;M010;DS:SI --> ASCIIZ string - 18794 00001A98 E84602 call LowercaseString ;M010;filename.ext string is in CharBuf - 18795 dn1: - 18796 00001A9B C706[A09D][6A9C] mov word [string_ptr_2],CHARBUF - 18797 00001AA1 BA[DF91] mov dx,string_buf_ptr - 18798 ;call std_printf ; print filename & extension - 18799 ;retn - 18800 ; 19/02/2023 - 18801 00001AA4 E98139 jmp std_printf - 18802 - 18803 ; --------------------------------------------------------------------------- - 18804 - 18805 ;*** DisplayNext - move display cursor to next entry position - 18806 ; - 18807 ; ENTRY LeftOnLine = # entries can still be printed on this line - 18808 ; LeftOnPage = # lines can still be printed for this page - 18809 ; FileCnt = # files in this dir displayed before this one - 18810 ; Bits contains /w setting - 18811 ; - 18812 ; EXIT nothing - 18813 ; - 18814 ; USED AX,DX - 18815 ; - 18816 ; EFFECTS - 18817 ; - 18818 ; LeftOnLine will be updated to reflect the entry about to be - 18819 ; displayed. - 18820 ; LeftOnPage may be updated. - 18821 - 18822 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18823 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18824 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18825 - 18826 DisplayNext: - 18827 00001AA7 833E[209C]00 cmp word [FileCnt],0 - 18828 00001AAC 7415 je short dn1st ; 1st file in directory - 18829 00001AAE 803E[1C9C]00 cmp byte [LeftOnLine],0 - 18830 00001AB3 7E08 jng short dnEol ; jle ; no more room on this line - 18831 - 18832 ; We are in wide mode (LeftOnLine is always 0 otherwise) and - 18833 ; we still have room for more on this line. - 18834 ; Tab to next position. - 18835 - 18836 00001AB5 BA[EE91] mov dx,tab_ptr - 18837 00001AB8 E86D39 call std_printf - 18838 00001ABB EB0C jmp short dnDone - 18839 dnEol: - 18840 ; Start this entry on a new line. - 18841 - 18842 00001ABD E8B90E call CRLF2 ; start on new line - 18843 00001AC0 E8B6FE call UseLine - 18844 dn1st: - 18845 00001AC3 A0[1D9C] mov al,[PerLine] - 18846 00001AC6 A2[1C9C] mov [LeftOnLine],al ; reset # entries left on line - 18847 - 18848 dnDone: - 18849 00001AC9 FE0E[1C9C] dec byte [LeftOnLine] - 18850 ; reflect the entry about to be displayed - 18851 00001ACD C3 retn - 18852 - 18853 ; --------------------------------------------------------------------------- - 18854 - 18855 ;*** DisplayTheRest - display file size/dir, date, time - 18856 ; - 18857 ; ENTRY BX = offset of entry in TPA buffer - 18858 ; Display cursor is at end of file extension + 18786 00001A8D 1F pop ds ; DS = TRANGROUP seg addr again + 18787 ;assume ds:TRANGROUP + 18788 + 18789 ;;;test Bits,mask lcase ;M010;check for lowercase option + 18790 ;;test word [_Bits],10h + 18791 ;test byte [_Bits],10h + 18792 ; 08/06/2023 + 18793 00001A8E F606[8B9D]10 test byte [_Bits],mask.lcase ; 20h ; MSDOS 6.0 + 18794 ; 01/08/2024 ; 10h ; PCDOS 7.1 + 18795 00001A93 7406 jz short dn1 ;M010;lowercase not required + 18796 00001A95 BE[6A9C] mov si,CHARBUF ;M010;DS:SI --> ASCIIZ string + 18797 00001A98 E84602 call LowercaseString ;M010;filename.ext string is in CharBuf + 18798 dn1: + 18799 00001A9B C706[A09D][6A9C] mov word [string_ptr_2],CHARBUF + 18800 00001AA1 BA[DF91] mov dx,string_buf_ptr + 18801 ;call std_printf ; print filename & extension + 18802 ;retn + 18803 ; 19/02/2023 + 18804 00001AA4 E98139 jmp std_printf + 18805 + 18806 ; --------------------------------------------------------------------------- + 18807 + 18808 ;*** DisplayNext - move display cursor to next entry position + 18809 ; + 18810 ; ENTRY LeftOnLine = # entries can still be printed on this line + 18811 ; LeftOnPage = # lines can still be printed for this page + 18812 ; FileCnt = # files in this dir displayed before this one + 18813 ; Bits contains /w setting + 18814 ; + 18815 ; EXIT nothing + 18816 ; + 18817 ; USED AX,DX + 18818 ; + 18819 ; EFFECTS + 18820 ; + 18821 ; LeftOnLine will be updated to reflect the entry about to be + 18822 ; displayed. + 18823 ; LeftOnPage may be updated. + 18824 + 18825 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 18826 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18827 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18828 + 18829 DisplayNext: + 18830 00001AA7 833E[209C]00 cmp word [FileCnt],0 + 18831 00001AAC 7415 je short dn1st ; 1st file in directory + 18832 00001AAE 803E[1C9C]00 cmp byte [LeftOnLine],0 + 18833 00001AB3 7E08 jng short dnEol ; jle ; no more room on this line + 18834 + 18835 ; We are in wide mode (LeftOnLine is always 0 otherwise) and + 18836 ; we still have room for more on this line. + 18837 ; Tab to next position. + 18838 + 18839 00001AB5 BA[EE91] mov dx,tab_ptr + 18840 00001AB8 E86D39 call std_printf + 18841 00001ABB EB0C jmp short dnDone + 18842 dnEol: + 18843 ; Start this entry on a new line. + 18844 + 18845 00001ABD E8B90E call CRLF2 ; start on new line + 18846 00001AC0 E8B6FE call UseLine + 18847 dn1st: + 18848 00001AC3 A0[1D9C] mov al,[PerLine] + 18849 00001AC6 A2[1C9C] mov [LeftOnLine],al ; reset # entries left on line + 18850 + 18851 dnDone: + 18852 00001AC9 FE0E[1C9C] dec byte [LeftOnLine] + 18853 ; reflect the entry about to be displayed + 18854 00001ACD C3 retn + 18855 + 18856 ; --------------------------------------------------------------------------- + 18857 + 18858 ;*** DisplayTheRest - display file size/dir, date, time 18859 ; - 18860 ; EXIT nothing - 18861 ; - 18862 ; USED AX,CX,DX,SI,DI,BP - 18863 ; - 18864 ; EFFECTS - 18865 ; - 18866 ; File size, date, & time are displayed. - 18867 - 18868 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 18869 - 18870 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 18871 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1A7Ch + 18860 ; ENTRY BX = offset of entry in TPA buffer + 18861 ; Display cursor is at end of file extension + 18862 ; + 18863 ; EXIT nothing + 18864 ; + 18865 ; USED AX,CX,DX,SI,DI,BP + 18866 ; + 18867 ; EFFECTS + 18868 ; + 18869 ; File size, date, & time are displayed. + 18870 + 18871 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 18872 - 18873 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 18874 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1B47h + 18873 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 18874 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1A7Ch 18875 - 18876 DisplayTheRest: - 18877 00001ACE 06 push es ; save TRANGROUP seg addr - 18878 00001ACF 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr - 18879 00001AD3 89DD mov bp,bx ; BP = offset of entry in TPA - 18880 ;;test es:[bp].fileattr,ATTR_DIRECTORY - 18881 ;test byte [es:bp+EntryStruc.fileattr],10h - 18882 00001AD5 26F6460C10 test byte [es:bp+12],ATTR_DIRECTORY - 18883 00001ADA 7425 jz short drNonDir ; not a directory file - 18884 - 18885 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18886 %if 1 - 18887 00001ADC 803E[2B9C]00 cmp byte [nocommas],0 ; no commas ? - 18888 00001AE1 750C jnz short dr_2 ; yes - 18889 00001AE3 C706[A09D][0094] mov word [string_ptr_2],twospacechars ; db " ",0 - 18890 00001AE9 BA[DF91] mov dx,string_buf_ptr - 18891 00001AEC E83939 call std_printf - 18892 dr_2: - 18893 %endif - 18894 - 18895 ; For a directory file, display instead of size. - 18896 - 18897 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18898 %if 0 - 18899 mov dx,dmes_ptr - 18900 call std_printf - 18901 ; 08/06/2023 - 18902 ;jmp short drCom - 18903 + 18876 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 18877 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1B47h + 18878 + 18879 DisplayTheRest: + 18880 00001ACE 06 push es ; save TRANGROUP seg addr + 18881 00001ACF 8E06[F79B] mov es,[TPA] ; ES = TPA seg addr + 18882 00001AD3 89DD mov bp,bx ; BP = offset of entry in TPA + 18883 ;;test es:[bp].fileattr,ATTR_DIRECTORY + 18884 ;test byte [es:bp+EntryStruc.fileattr],10h + 18885 00001AD5 26F6460C10 test byte [es:bp+12],ATTR_DIRECTORY + 18886 00001ADA 7425 jz short drNonDir ; not a directory file + 18887 + 18888 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18889 %if 1 + 18890 00001ADC 803E[2B9C]00 cmp byte [nocommas],0 ; no commas ? + 18891 00001AE1 750C jnz short dr_2 ; yes + 18892 00001AE3 C706[A09D][0094] mov word [string_ptr_2],twospacechars ; db " ",0 + 18893 00001AE9 BA[DF91] mov dx,string_buf_ptr + 18894 00001AEC E83939 call std_printf + 18895 dr_2: + 18896 %endif + 18897 + 18898 ; For a directory file, display instead of size. + 18899 + 18900 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18901 %if 0 + 18902 mov dx,dmes_ptr + 18903 call std_printf 18904 ; 08/06/2023 - 18905 ; MSDOS 6.22 COMMAND.COM (disassembled source code) - 18906 test byte [screen_f_1],40h ; 80 columns ? - 18907 jz short dr_0 ; no - 18908 mov dx,space_4_ptr ; 4 space chars - 18909 call std_printf - 18910 dr_0: - 18911 jmp short drCom ; skip to common fields - 18912 %else - 18913 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18914 00001AEF BA[F191] mov dx,dmes_ptr ; MSG_1068 - 18915 00001AF2 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; size will be displayed as kilobyte ? - 18916 00001AF7 7403 jz short dr_3 ; yes - 18917 00001AF9 BA[F491] mov dx,space_4_ptr ; 4 space chars - 18918 dr_3: - 18919 00001AFC E82939 call std_printf - 18920 00001AFF EB2A jmp short drCom - 18921 %endif - 18922 - 18923 drNonDir: - 18924 ; For a non-directory file, display file size. + 18905 ;jmp short drCom + 18906 + 18907 ; 08/06/2023 + 18908 ; MSDOS 6.22 COMMAND.COM (disassembled source code) + 18909 test byte [screen_f_1],40h ; 80 columns ? + 18910 jz short dr_0 ; no + 18911 mov dx,space_4_ptr ; 4 space chars + 18912 call std_printf + 18913 dr_0: + 18914 jmp short drCom ; skip to common fields + 18915 %else + 18916 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18917 00001AEF BA[F191] mov dx,dmes_ptr ; MSG_1068 + 18918 00001AF2 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; size will be displayed as kilobyte ? + 18919 00001AF7 7403 jz short dr_3 ; yes + 18920 00001AF9 BA[F491] mov dx,space_4_ptr ; 4 space chars + 18921 dr_3: + 18922 00001AFC E82939 call std_printf + 18923 00001AFF EB2A jmp short drCom + 18924 %endif 18925 - 18926 ;;mov dx,word ptr es:[bp].filesize - 18927 ;mov dx,[es:bp+EntryStruc.filesize] - 18928 00001B01 268B5611 mov dx,[es:bp+17] - 18929 00001B05 8916[9C9D] mov [File_Size_Low],dx - 18930 ;;mov dx,word ptr es:[bp].filesize+2 - 18931 ;mov dx,[es:bp+EntryStruc.filesize+2] - 18932 00001B09 268B5613 mov dx,[es:bp+19] - 18933 00001B0D 8916[9E9D] mov [File_Size_High],dx - 18934 00001B11 BA[B591] mov dx,disp_file_size_ptr - 18935 - 18936 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18937 %if 1 - 18938 00001B14 803E[2A9C]00 cmp byte [narrow],0 - 18939 00001B19 7503 jnz short dr_4 ; narrow display - 18940 00001B1B BA[C391] mov dx,disp_file_size_w_ptr ; big file (wide) - 18941 dr_4: - 18942 00001B1E 803E[2D9C]00 cmp byte [bfree_not_kilo],0 - 18943 00001B23 7403 jz short dr_5 ; big file - 18944 00001B25 BA[D191] mov dx,disp_file_size_n_ptr ; not big file - 18945 dr_5: - 18946 %endif - 18947 - 18948 00001B28 E8FD38 call std_printf - 18949 drCom: - 18950 ; For all files, display date & time. - 18951 - 18952 ;;mov ax,es:[bp].filedate ; AX = date word - 18953 ;mov ax,[es:bp+EntryStruc.filedate] - 18954 00001B2B 268B460F mov ax,[es:bp+15] - 18955 - 18956 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18957 %if 0 - 18958 or ax,ax ; test for null date (DOS 1.x) - 18959 jz short drDone ; no date, skip date/time display - 18960 %else - 18961 00001B2F 09C0 or ax,ax - 18962 00001B31 7503 jnz short dr_6 - 18963 00001B33 E9AA00 jmp drDone - 18964 dr_6: - 18965 %endif - 18966 - 18967 00001B36 89C3 mov bx,ax ; BX = date word - 18968 00001B38 83E01F and ax,1Fh ; AX = day of month - 18969 00001B3B 88C2 mov dl,al ; DL = day of month - 18970 00001B3D 89D8 mov ax,bx ; AX = date word - 18971 00001B3F B105 mov cl,5 - 18972 00001B41 D3E8 shr ax,cl ; shift day out - 18973 00001B43 240F and al,0Fh ; AL = month - 18974 00001B45 88C6 mov dh,al ; DH = month - 18975 00001B47 88F9 mov cl,bh - 18976 00001B49 D0E9 shr cl,1 ; CL = year - 1980 - 18977 00001B4B 30ED xor ch,ch ; CX = year - 1980 - 18978 - 18979 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 18980 %if 0 - 18981 ; MSDOS 5.0-6.22 - 18982 add cx,80 ; CX = 2-digit year - 18983 cmp cl,100 - 18984 jb short dr_1 ; not year 2000 yet, skip ahead - 18985 sub cl,100 ; adjust for 21st century - 18986 %else - 18987 ; PCDOS 7.1 - 18988 00001B4D 81C1BC07 add cx,1980 ; CX = 4-digit year - 18989 00001B51 803E[2C9C]00 cmp byte [yeardigit4],0 ; 4 digits year display ? - 18990 00001B56 7509 jnz short dr_1 ; yes - 18991 00001B58 81E9D007 sub cx,2000 ; after year 2000 (21st century) - 18992 00001B5C 7903 jns short dr_1 - 18993 00001B5E 83C164 add cx,100 ; before year 2000 (20th century) - 18994 %endif - 18995 - 18996 dr_1: - 18997 00001B61 86F2 xchg dh,dl ; DX = month/day - 18998 00001B63 890E[3292] mov [DirDat_Yr],cx ; move year to msg block - 18999 00001B67 8916[3492] mov [DirDat_Mo_Day],dx ; move month/day to msg block - 19000 ;;mov cx,es:[bp].filetime ; CX = file time - 19001 ;mov cx,[es:bp+EntryStruc.filetime] - 19002 00001B6B 268B4E0D mov cx,[es:bp+13] - 19003 00001B6F E310 jcxz drPrint ; no time field - go print - 19004 00001B71 D1E9 shr cx,1 - 19005 00001B73 D1E9 shr cx,1 - 19006 00001B75 D1E9 shr cx,1 ; CH = hours - 19007 00001B77 D0E9 shr cl,1 - 19008 00001B79 D0E9 shr cl,1 ; CL = minutes - 19009 00001B7B 86E9 xchg ch,cl ; CX = hr/min - 19010 00001B7D 890E[3D92] mov [DirTim_Hr_Min],cx ; move time to msg block - 19011 drPrint: - 19012 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 19013 %if 1 - 19014 00001B81 C706[2D92]3504 mov word [dirdattim_ptr],1077 ; MSG_1077 (normal) - 19015 00001B87 C606[3792]A4 mov byte [DirDat_form],0A4h ; Right_Align+DATE_MDY_2 - 19016 00001B8C C706[3892]0A08 mov word [DirDat_width],80Ah ; 10 (max), 8 (min) - 19017 00001B92 803E[2A9C]00 cmp byte [narrow],0 - 19018 00001B97 750C jnz short dr_narrow - 19019 00001B99 C706[2D92]3304 mov word [dirdattim_ptr],1075 ; MSG_1075 (narrow) - 19020 00001B9F 8106[3892]0202 add word [DirDat_width],202h ; 12 (max), 10 (min) - 19021 dr_narrow: - 19022 00001BA5 803E[2C9C]00 cmp byte [yeardigit4],0 - 19023 00001BAA 740B jz short dr_7 ; 2 digits year display - 19024 ; 4 digits year display - 19025 00001BAC C606[3792]B4 mov byte [DirDat_form],0B4h ; Right_Align+DATE_MDY_4 - 19026 00001BB1 8106[3892]0202 add word [DirDat_width],202h ; 12 (max), 10 (min) - 19027 dr_7: - 19028 %endif - 19029 00001BB7 BA[2D92] mov dx,dirdattim_ptr - 19030 00001BBA E86B38 call std_printf ; print date & time - 19031 - 19032 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM - 19033 %if 1 - 19034 ; restore message data format fields (to the default values) - 19035 00001BBD C706[2D92]3504 mov word [dirdattim_ptr],1077 ; MSG_1077 - 19036 00001BC3 C606[3792]A4 mov byte [DirDat_form],0A4h ; Right_Align+DATE_MDY_2 - 19037 00001BC8 C706[3892]0A08 mov word [DirDat_width],80Ah ; 10 (max), 8 (min) - 19038 00001BCE C706[3292]0000 mov word [DirDat_Yr],0 - 19039 00001BD4 C706[3492]0000 mov word [DirDat_Mo_Day],0 - 19040 00001BDA C706[3D92]0000 mov word [DirTim_Hr_Min],0 - 19041 %endif - 19042 - 19043 drDone: - 19044 00001BE0 07 pop es ; ES = TRANGROUP seg addr again - 19045 00001BE1 89EB mov bx,bp ; BX = offset of entry in TPA again - 19046 dtrRet: ; 03/08/2024 - 19047 ; 19/02/2023 - 19048 00001BE3 C3 retn - 19049 - 19050 ; --------------------------------------------------------------------------- - 19051 ; MSDOS 6.0 + 18926 drNonDir: + 18927 ; For a non-directory file, display file size. + 18928 + 18929 ;;mov dx,word ptr es:[bp].filesize + 18930 ;mov dx,[es:bp+EntryStruc.filesize] + 18931 00001B01 268B5611 mov dx,[es:bp+17] + 18932 00001B05 8916[9C9D] mov [File_Size_Low],dx + 18933 ;;mov dx,word ptr es:[bp].filesize+2 + 18934 ;mov dx,[es:bp+EntryStruc.filesize+2] + 18935 00001B09 268B5613 mov dx,[es:bp+19] + 18936 00001B0D 8916[9E9D] mov [File_Size_High],dx + 18937 00001B11 BA[B591] mov dx,disp_file_size_ptr + 18938 + 18939 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18940 %if 1 + 18941 00001B14 803E[2A9C]00 cmp byte [narrow],0 + 18942 00001B19 7503 jnz short dr_4 ; narrow display + 18943 00001B1B BA[C391] mov dx,disp_file_size_w_ptr ; big file (wide) + 18944 dr_4: + 18945 00001B1E 803E[2D9C]00 cmp byte [bfree_not_kilo],0 + 18946 00001B23 7403 jz short dr_5 ; big file + 18947 00001B25 BA[D191] mov dx,disp_file_size_n_ptr ; not big file + 18948 dr_5: + 18949 %endif + 18950 + 18951 00001B28 E8FD38 call std_printf + 18952 drCom: + 18953 ; For all files, display date & time. + 18954 + 18955 ;;mov ax,es:[bp].filedate ; AX = date word + 18956 ;mov ax,[es:bp+EntryStruc.filedate] + 18957 00001B2B 268B460F mov ax,[es:bp+15] + 18958 + 18959 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18960 %if 0 + 18961 or ax,ax ; test for null date (DOS 1.x) + 18962 jz short drDone ; no date, skip date/time display + 18963 %else + 18964 00001B2F 09C0 or ax,ax + 18965 00001B31 7503 jnz short dr_6 + 18966 00001B33 E9AA00 jmp drDone + 18967 dr_6: + 18968 %endif + 18969 + 18970 00001B36 89C3 mov bx,ax ; BX = date word + 18971 00001B38 83E01F and ax,1Fh ; AX = day of month + 18972 00001B3B 88C2 mov dl,al ; DL = day of month + 18973 00001B3D 89D8 mov ax,bx ; AX = date word + 18974 00001B3F B105 mov cl,5 + 18975 00001B41 D3E8 shr ax,cl ; shift day out + 18976 00001B43 240F and al,0Fh ; AL = month + 18977 00001B45 88C6 mov dh,al ; DH = month + 18978 00001B47 88F9 mov cl,bh + 18979 00001B49 D0E9 shr cl,1 ; CL = year - 1980 + 18980 00001B4B 30ED xor ch,ch ; CX = year - 1980 + 18981 + 18982 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 18983 %if 0 + 18984 ; MSDOS 5.0-6.22 + 18985 add cx,80 ; CX = 2-digit year + 18986 cmp cl,100 + 18987 jb short dr_1 ; not year 2000 yet, skip ahead + 18988 sub cl,100 ; adjust for 21st century + 18989 %else + 18990 ; PCDOS 7.1 + 18991 00001B4D 81C1BC07 add cx,1980 ; CX = 4-digit year + 18992 00001B51 803E[2C9C]00 cmp byte [yeardigit4],0 ; 4 digits year display ? + 18993 00001B56 7509 jnz short dr_1 ; yes + 18994 00001B58 81E9D007 sub cx,2000 ; after year 2000 (21st century) + 18995 00001B5C 7903 jns short dr_1 + 18996 00001B5E 83C164 add cx,100 ; before year 2000 (20th century) + 18997 %endif + 18998 + 18999 dr_1: + 19000 00001B61 86F2 xchg dh,dl ; DX = month/day + 19001 00001B63 890E[3292] mov [DirDat_Yr],cx ; move year to msg block + 19002 00001B67 8916[3492] mov [DirDat_Mo_Day],dx ; move month/day to msg block + 19003 ;;mov cx,es:[bp].filetime ; CX = file time + 19004 ;mov cx,[es:bp+EntryStruc.filetime] + 19005 00001B6B 268B4E0D mov cx,[es:bp+13] + 19006 00001B6F E310 jcxz drPrint ; no time field - go print + 19007 00001B71 D1E9 shr cx,1 + 19008 00001B73 D1E9 shr cx,1 + 19009 00001B75 D1E9 shr cx,1 ; CH = hours + 19010 00001B77 D0E9 shr cl,1 + 19011 00001B79 D0E9 shr cl,1 ; CL = minutes + 19012 00001B7B 86E9 xchg ch,cl ; CX = hr/min + 19013 00001B7D 890E[3D92] mov [DirTim_Hr_Min],cx ; move time to msg block + 19014 drPrint: + 19015 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 19016 %if 1 + 19017 00001B81 C706[2D92]3504 mov word [dirdattim_ptr],1077 ; MSG_1077 (normal) + 19018 00001B87 C606[3792]A4 mov byte [DirDat_form],0A4h ; Right_Align+DATE_MDY_2 + 19019 00001B8C C706[3892]0A08 mov word [DirDat_width],80Ah ; 10 (max), 8 (min) + 19020 00001B92 803E[2A9C]00 cmp byte [narrow],0 + 19021 00001B97 750C jnz short dr_narrow + 19022 00001B99 C706[2D92]3304 mov word [dirdattim_ptr],1075 ; MSG_1075 (narrow) + 19023 00001B9F 8106[3892]0202 add word [DirDat_width],202h ; 12 (max), 10 (min) + 19024 dr_narrow: + 19025 00001BA5 803E[2C9C]00 cmp byte [yeardigit4],0 + 19026 00001BAA 740B jz short dr_7 ; 2 digits year display + 19027 ; 4 digits year display + 19028 00001BAC C606[3792]B4 mov byte [DirDat_form],0B4h ; Right_Align+DATE_MDY_4 + 19029 00001BB1 8106[3892]0202 add word [DirDat_width],202h ; 12 (max), 10 (min) + 19030 dr_7: + 19031 %endif + 19032 00001BB7 BA[2D92] mov dx,dirdattim_ptr + 19033 00001BBA E86B38 call std_printf ; print date & time + 19034 + 19035 ; 01/08/2024 - PCDOS 7.1 COMMAND.COM + 19036 %if 1 + 19037 ; restore message data format fields (to the default values) + 19038 00001BBD C706[2D92]3504 mov word [dirdattim_ptr],1077 ; MSG_1077 + 19039 00001BC3 C606[3792]A4 mov byte [DirDat_form],0A4h ; Right_Align+DATE_MDY_2 + 19040 00001BC8 C706[3892]0A08 mov word [DirDat_width],80Ah ; 10 (max), 8 (min) + 19041 00001BCE C706[3292]0000 mov word [DirDat_Yr],0 + 19042 00001BD4 C706[3492]0000 mov word [DirDat_Mo_Day],0 + 19043 00001BDA C706[3D92]0000 mov word [DirTim_Hr_Min],0 + 19044 %endif + 19045 + 19046 drDone: + 19047 00001BE0 07 pop es ; ES = TRANGROUP seg addr again + 19048 00001BE1 89EB mov bx,bp ; BX = offset of entry in TPA again + 19049 dtrRet: ; 03/08/2024 + 19050 ; 19/02/2023 + 19051 00001BE3 C3 retn 19052 - 19053 ; 01/08/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 19054 %if 0 - 19055 ;ifdef DBLSPACE_HOOKS - 19056 - 19057 ;*** DisplayCompRatio - display compression ratio - 19058 ; - 19059 ; ENTRY BX = offset of entry in TPA buffer - 19060 ; - 19061 ; EXIT nothing - 19062 ; - 19063 ; USED AX,CX,DX - 19064 ; - 19065 ; EFFECTS - 19066 ; - 19067 ; File compression ratio is displayed. - 19068 - 19069 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 19070 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1B09h + 19053 ; --------------------------------------------------------------------------- + 19054 ; MSDOS 6.0 + 19055 + 19056 ; 01/08/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 19057 %if 0 + 19058 ;ifdef DBLSPACE_HOOKS + 19059 + 19060 ;*** DisplayCompRatio - display compression ratio + 19061 ; + 19062 ; ENTRY BX = offset of entry in TPA buffer + 19063 ; + 19064 ; EXIT nothing + 19065 ; + 19066 ; USED AX,CX,DX + 19067 ; + 19068 ; EFFECTS + 19069 ; + 19070 ; File compression ratio is displayed. 19071 - 19072 DisplayCompRatio: ;proc - 19073 push es ; save TRANGROUP seg addr - 19074 mov es,[TPA] ; ES = TPA seg addr - 19075 ;;mov al,es:[bx].compratio - 19076 ;mov al,[es:bx+EntryStruc.compratio] - 19077 mov al,[es:bx+15h] - 19078 cmp al,0FFh ; invalid/no compression ratio? - 19079 je short dcrRet - 19080 - 19081 mov ah,al ; unpack compression ratio - 19082 mov cl,4 - 19083 shr ah,cl ; isolate whole number portion - 19084 inc ah ; 0-15 = 1-16 - 19085 and al,0Fh ; isolate tenths - 19086 - 19087 mov [Dir_CRatio_1],ah - 19088 mov [Dir_CRatio_2],al - 19089 ;mov dx,offset TRANGROUP:DirCompRatio_Ptr - 19090 ;invoke Std_Printf - 19091 mov dx,DirCompRatio_Ptr - 19092 call std_printf - 19093 dcrRet: - 19094 pop es - 19095 dtrRet: ; 08/06/2023 - 19096 retn - 19097 - 19098 ;DisplayCompRatio ;endp - 19099 - 19100 ;endif - 19101 %endif + 19072 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 19073 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1B09h + 19074 + 19075 DisplayCompRatio: ;proc + 19076 push es ; save TRANGROUP seg addr + 19077 mov es,[TPA] ; ES = TPA seg addr + 19078 ;;mov al,es:[bx].compratio + 19079 ;mov al,[es:bx+EntryStruc.compratio] + 19080 mov al,[es:bx+15h] + 19081 cmp al,0FFh ; invalid/no compression ratio? + 19082 je short dcrRet + 19083 + 19084 mov ah,al ; unpack compression ratio + 19085 mov cl,4 + 19086 shr ah,cl ; isolate whole number portion + 19087 inc ah ; 0-15 = 1-16 + 19088 and al,0Fh ; isolate tenths + 19089 + 19090 mov [Dir_CRatio_1],ah + 19091 mov [Dir_CRatio_2],al + 19092 ;mov dx,offset TRANGROUP:DirCompRatio_Ptr + 19093 ;invoke Std_Printf + 19094 mov dx,DirCompRatio_Ptr + 19095 call std_printf + 19096 dcrRet: + 19097 pop es + 19098 dtrRet: ; 08/06/2023 + 19099 retn + 19100 + 19101 ;DisplayCompRatio ;endp 19102 - 19103 ; --------------------------------------------------------------------------- - 19104 - 19105 ;*** DisplayTrailer - display trailing lines for directory listing - 19106 ; - 19107 ; ENTRY LeftOnPage = # lines left on display page - 19108 ; FileCnt = # files listed - 19109 ; FileSiz = total size of files listed - 19110 ; - 19111 ; EXIT nothing - 19112 ; - 19113 ; USED - 19114 ; - 19115 ; EFFECTS - 19116 ; - 19117 ; Trailing info lines are displayed - 19118 - 19119 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19120 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 19121 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM - 19122 ; 14/08/2024 - 19123 DisplayTrailer: - 19124 ;;;test Bits,mask bare - 19125 ;;test word [_Bits],8 - 19126 ;test byte [_Bits],8 - 19127 ; 08/06/2023 - 19128 00001BE4 F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 - 19129 ; 02/08/2024 ; 8 ; PCDOS 7.1 - 19130 00001BE9 75F8 jnz short dtrRet ; /b - don't display trailer - 19131 - 19132 00001BEB E88B0D call CRLF2 ; start on new line - 19133 00001BEE E888FD call UseLine - 19134 00001BF1 A1[209C] mov ax,[FileCnt] ; AX = # files found - 19135 ; 14/08/2024 - 19136 00001BF4 31D2 xor dx,dx - 19137 - 19138 ; DisplayTotals uses this entry point. - 19139 ; - 19140 DisplayCntSiz: - 19141 ; AX = # files - 19142 ; FileSiz = dword total size of files - 19143 - 19144 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM - 19145 ; PCDOS 7.1 COMMAND.COM - 19146 %if 0 - 19147 mov [Dir_Num],ax ; load # files - 19148 mov dx,dirmes_ptr ; DX = ptr to message block - 19149 call std_printf ; "nnn File(s)" - 19150 - 19151 mov dx,bytes_ptr - 19152 call std_printf ; "nnn bytes",cr,lf - 19153 ; 19/02/2023 - 19154 ;call UseLine - 19155 ;dtrRet: - 19156 ;retn - 19157 - 19158 ; 19/02/2023 - 19159 jmp UseLine - 19160 %else - 19161 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM - 19162 00001BF6 A3[A59D] mov [Dir_Num],ax ; number of files - 19163 00001BF9 8916[A79D] mov [Dir_Num+2],dx - 19164 00001BFD BA[1A90] mov dx,dirmes_ptr ; MSG_1019, 9 bytes, word - 19165 00001C00 803E[2A9C]00 cmp byte [narrow],0 ; narrow display ? - 19166 00001C05 7503 jnz short dcs_1 ; yes - 19167 00001C07 BA[2890] mov dx,dirmes_w_ptr ; MSG_1019, 10 bytes - 19168 dcs_1: - 19169 00001C0A 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; is kilobyte display usable? - 19170 00001C0F 7403 jz short dcs_2 ; yes (big files) - 19171 00001C11 BA[3690] mov dx,dirmes2_ptr ; MSG_1019, 9 bytes, dword - 19172 dcs_2: - 19173 00001C14 E81138 call std_printf ; "nnn File(s)" - 19174 00001C17 8B0E[269C] mov cx,[FileSiz+4] ; 5th and 6th byte of the file size - 19175 ; (6th byte=0) - 19176 00001C1B E329 jcxz dcs_3 ; file size is (in) 4 bytes - 19177 00001C1D 8B16[259C] mov dx,[FileSiz+3] ; convert to kilobytes - 19178 00001C21 A1[239C] mov ax,[FileSiz+1] - 19179 00001C24 D0CD ror ch,1 ; ch = 5th byte of file size - 19180 00001C26 D1DA rcr dx,1 - 19181 00001C28 D1D8 rcr ax,1 - 19182 00001C2A D0CD ror ch,1 - 19183 00001C2C D1DA rcr dx,1 - 19184 00001C2E D1D8 rcr ax,1 ; dx:ax = (ch:dx:ax) / 1024 - 19185 00001C30 8916[249C] mov [FileSiz+2],dx - 19186 00001C34 A3[229C] mov [FileSiz],ax - 19187 00001C37 BA[7392] mov dx,kbytes_ptr ; MSG_1107 normal, 14 bytes - 19188 00001C3A 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; is kilobyte display usable? - 19189 00001C3F 741C jz short dcs_5 ; yes (big files) - 19190 ; no (not big files) - 19191 00001C41 BA[8192] mov dx,kybytes_n_ptr ; MSG_1107 narrow, 10 bytes - 19192 00001C44 EB17 jmp short dcs_5 - 19193 dcs_3: - 19194 00001C46 BA[4992] mov dx,bytes_ptr ; MSG_1079 normal, 12 bytes - 19195 00001C49 803E[2A9C]00 cmp byte [narrow],0 ; narrow display option - 19196 00001C4E 7503 jnz short dcs_4 - 19197 00001C50 BA[5792] mov dx,bytes_w_tr ; MSG_1079 wide, 14 bytes - 19198 dcs_4: - 19199 00001C53 803E[2D9C]00 cmp byte [bfree_not_kilo],0 - 19200 00001C58 7403 jz short dcs_5 - 19201 00001C5A BA[6592] mov dx,bytes_n_ptr ; MSG_1079 narrow, 10 bytes - 19202 dcs_5: - 19203 00001C5D E8C837 call std_printf ; "nnn bytes",cr,lf - 19204 ;call UseLine - 19205 ;dtrRet: - 19206 ;retn - 19207 ; 02/08/2024 - 19208 00001C60 E916FD jmp UseLine - 19209 %endif - 19210 - 19211 ; --------------------------------------------------------------------------- - 19212 - 19213 ;*** DisplayWide - display filename in wide format - 19214 ; - 19215 ; ENTRY BX = offset of entry in TPA buffer - 19216 ; - 19217 ; EXIT nothing - 19218 ; - 19219 ; USED AX,CX,DX,SI,DI - 19220 ; - 19221 ; EFFECTS - 19222 ; - 19223 ; Name.ext is displayed. Cursor left at end of field (padded - 19224 ; with blanks). Subdirectory files are displayed as [name.ext]. - 19225 - 19226 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19227 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:198Ah + 19103 ;endif + 19104 %endif + 19105 + 19106 ; --------------------------------------------------------------------------- + 19107 + 19108 ;*** DisplayTrailer - display trailing lines for directory listing + 19109 ; + 19110 ; ENTRY LeftOnPage = # lines left on display page + 19111 ; FileCnt = # files listed + 19112 ; FileSiz = total size of files listed + 19113 ; + 19114 ; EXIT nothing + 19115 ; + 19116 ; USED + 19117 ; + 19118 ; EFFECTS + 19119 ; + 19120 ; Trailing info lines are displayed + 19121 + 19122 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19123 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 19124 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM + 19125 ; 14/08/2024 + 19126 DisplayTrailer: + 19127 ;;;test Bits,mask bare + 19128 ;;test word [_Bits],8 + 19129 ;test byte [_Bits],8 + 19130 ; 08/06/2023 + 19131 00001BE4 F606[8B9D]08 test byte [_Bits],mask.bare ; 10h ; MSDOS 6.0 + 19132 ; 02/08/2024 ; 8 ; PCDOS 7.1 + 19133 00001BE9 75F8 jnz short dtrRet ; /b - don't display trailer + 19134 + 19135 00001BEB E88B0D call CRLF2 ; start on new line + 19136 00001BEE E888FD call UseLine + 19137 00001BF1 A1[209C] mov ax,[FileCnt] ; AX = # files found + 19138 ; 14/08/2024 + 19139 00001BF4 31D2 xor dx,dx + 19140 + 19141 ; DisplayTotals uses this entry point. + 19142 ; + 19143 DisplayCntSiz: + 19144 ; AX = # files + 19145 ; FileSiz = dword total size of files + 19146 + 19147 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM + 19148 ; PCDOS 7.1 COMMAND.COM + 19149 %if 0 + 19150 mov [Dir_Num],ax ; load # files + 19151 mov dx,dirmes_ptr ; DX = ptr to message block + 19152 call std_printf ; "nnn File(s)" + 19153 + 19154 mov dx,bytes_ptr + 19155 call std_printf ; "nnn bytes",cr,lf + 19156 ; 19/02/2023 + 19157 ;call UseLine + 19158 ;dtrRet: + 19159 ;retn + 19160 + 19161 ; 19/02/2023 + 19162 jmp UseLine + 19163 %else + 19164 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM + 19165 00001BF6 A3[A59D] mov [Dir_Num],ax ; number of files + 19166 00001BF9 8916[A79D] mov [Dir_Num+2],dx + 19167 00001BFD BA[1A90] mov dx,dirmes_ptr ; MSG_1019, 9 bytes, word + 19168 00001C00 803E[2A9C]00 cmp byte [narrow],0 ; narrow display ? + 19169 00001C05 7503 jnz short dcs_1 ; yes + 19170 00001C07 BA[2890] mov dx,dirmes_w_ptr ; MSG_1019, 10 bytes + 19171 dcs_1: + 19172 00001C0A 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; is kilobyte display usable? + 19173 00001C0F 7403 jz short dcs_2 ; yes (big files) + 19174 00001C11 BA[3690] mov dx,dirmes2_ptr ; MSG_1019, 9 bytes, dword + 19175 dcs_2: + 19176 00001C14 E81138 call std_printf ; "nnn File(s)" + 19177 00001C17 8B0E[269C] mov cx,[FileSiz+4] ; 5th and 6th byte of the file size + 19178 ; (6th byte=0) + 19179 00001C1B E329 jcxz dcs_3 ; file size is (in) 4 bytes + 19180 00001C1D 8B16[259C] mov dx,[FileSiz+3] ; convert to kilobytes + 19181 00001C21 A1[239C] mov ax,[FileSiz+1] + 19182 00001C24 D0CD ror ch,1 ; ch = 5th byte of file size + 19183 00001C26 D1DA rcr dx,1 + 19184 00001C28 D1D8 rcr ax,1 + 19185 00001C2A D0CD ror ch,1 + 19186 00001C2C D1DA rcr dx,1 + 19187 00001C2E D1D8 rcr ax,1 ; dx:ax = (ch:dx:ax) / 1024 + 19188 00001C30 8916[249C] mov [FileSiz+2],dx + 19189 00001C34 A3[229C] mov [FileSiz],ax + 19190 00001C37 BA[7392] mov dx,kbytes_ptr ; MSG_1107 normal, 14 bytes + 19191 00001C3A 803E[2D9C]00 cmp byte [bfree_not_kilo],0 ; is kilobyte display usable? + 19192 00001C3F 741C jz short dcs_5 ; yes (big files) + 19193 ; no (not big files) + 19194 00001C41 BA[8192] mov dx,kybytes_n_ptr ; MSG_1107 narrow, 10 bytes + 19195 00001C44 EB17 jmp short dcs_5 + 19196 dcs_3: + 19197 00001C46 BA[4992] mov dx,bytes_ptr ; MSG_1079 normal, 12 bytes + 19198 00001C49 803E[2A9C]00 cmp byte [narrow],0 ; narrow display option + 19199 00001C4E 7503 jnz short dcs_4 + 19200 00001C50 BA[5792] mov dx,bytes_w_tr ; MSG_1079 wide, 14 bytes + 19201 dcs_4: + 19202 00001C53 803E[2D9C]00 cmp byte [bfree_not_kilo],0 + 19203 00001C58 7403 jz short dcs_5 + 19204 00001C5A BA[6592] mov dx,bytes_n_ptr ; MSG_1079 narrow, 10 bytes + 19205 dcs_5: + 19206 00001C5D E8C837 call std_printf ; "nnn bytes",cr,lf + 19207 ;call UseLine + 19208 ;dtrRet: + 19209 ;retn + 19210 ; 02/08/2024 + 19211 00001C60 E916FD jmp UseLine + 19212 %endif + 19213 + 19214 ; --------------------------------------------------------------------------- + 19215 + 19216 ;*** DisplayWide - display filename in wide format + 19217 ; + 19218 ; ENTRY BX = offset of entry in TPA buffer + 19219 ; + 19220 ; EXIT nothing + 19221 ; + 19222 ; USED AX,CX,DX,SI,DI + 19223 ; + 19224 ; EFFECTS + 19225 ; + 19226 ; Name.ext is displayed. Cursor left at end of field (padded + 19227 ; with blanks). Subdirectory files are displayed as [name.ext]. 19228 - 19229 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 19230 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1CDEh + 19229 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19230 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:198Ah 19231 - 19232 DisplayWide: - 19233 00001C63 1E push ds ; save TRANGROUP seg addr - 19234 00001C64 8E1E[F79B] mov ds,[TPA] ; DS:BX = ptr to entry - 19235 ;assume ds:nothing - 19236 - 19237 ;;test ds:[bx].fileattr,ATTR_DIRECTORY - 19238 ;test byte [bx+EntryStruc.fileattr],10h - 19239 00001C68 F6470C10 test byte [bx+12],ATTR_DIRECTORY - 19240 00001C6C 9C pushf ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 19241 00001C6D 7405 jz short dw1 ; not a subdirectory file - 19242 00001C6F B05B mov al,'[' - 19243 00001C71 E83A05 call PRINT_CHAR ; prefix subdirectory - 19244 dw1: - 19245 00001C74 E82CFD call DisplayDotForm ; display name.ext - 19246 - 19247 ; DX = # chars displayed in name.ext - 19248 - 19249 ;;test ds:[bx].fileattr,ATTR_DIRECTORY - 19250 ;test byte [bx+EntryStruc.fileattr],10h - 19251 ; 03/08/2024 - 19252 ;test byte [bx+12],ATTR_DIRECTORY - 19253 00001C77 9D popf ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 19254 00001C78 7405 jz short dw2 ; not a subdirectory file - 19255 00001C7A B05D mov al,']' - 19256 00001C7C E82F05 call PRINT_CHAR ; postfix subdirectory - 19257 dw2: - 19258 ; Pad field with blanks. - 19259 - 19260 ;mov cx,size filename + size fileext + 1 - 19261 00001C7F B90C00 mov cx,12 ; 8+3+1 - 19262 ; CX = field size - 19263 00001C82 29D1 sub cx,dx ; CX = # pad char's - 19264 00001C84 E307 jcxz dwDone - 19265 00001C86 B020 mov al,' ' - 19266 dw3: - 19267 00001C88 E82305 call PRINT_CHAR - 19268 00001C8B E2FB loop dw3 - 19269 dwDone: - 19270 00001C8D 1F pop ds ; DS = TRANGROUP seg addr again - 19271 ;assume ds:TRANGROUP - 19272 00001C8E C3 retn - 19273 - 19274 ; --------------------------------------------------------------------------- - 19275 - 19276 ;*** GetDriveLtr - get target drive letter - 19277 ; - 19278 ; ENTRY FCB contains drive # - 19279 ; - 19280 ; EXIT AX = "d:" - 19281 ; - 19282 ; USED nothing - 19283 - 19284 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19285 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:19D8h - 19286 GetDriveLtr: - 19287 00001C8F A05C00 mov al,[FCB] ; 5Ch ; AL = target drive # - 19288 00001C92 08C0 or al,al - 19289 00001C94 7505 jnz short gdl1 ; not current drive default, skip ahead - 19290 00001C96 A0[079C] mov al,[CURDRV] ; AL = current drive # - 19291 00001C99 FEC0 inc al ; AL = 1-based drive # - 19292 gdl1: - 19293 00001C9B 0440 add al,'A'-1 ; 40h ; AL = target drive letter - 19294 00001C9D B43A mov ah,':' ; AX = "d:" - 19295 00001C9F C3 retn - 19296 - 19297 ; --------------------------------------------------------------------------- - 19298 - 19299 ;*** SetupParamError - set up for Std_EPrintf parameter parse error message - 19300 ; - 19301 ; Do for our /O and /A string parsers what Parse_With_Msg does - 19302 ; for system parser calls. Set up a message substitution block, - 19303 ; etc. for invalid value strings. I copied the procedure from - 19304 ; Setup_Parse_Error_Msg. - 19305 ; - 19306 ; ENTRY BX = ptr to system parser result buffer (contains ptr to str) - 19307 ; + 19232 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 19233 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1CDEh + 19234 + 19235 DisplayWide: + 19236 00001C63 1E push ds ; save TRANGROUP seg addr + 19237 00001C64 8E1E[F79B] mov ds,[TPA] ; DS:BX = ptr to entry + 19238 ;assume ds:nothing + 19239 + 19240 ;;test ds:[bx].fileattr,ATTR_DIRECTORY + 19241 ;test byte [bx+EntryStruc.fileattr],10h + 19242 00001C68 F6470C10 test byte [bx+12],ATTR_DIRECTORY + 19243 00001C6C 9C pushf ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 19244 00001C6D 7405 jz short dw1 ; not a subdirectory file + 19245 00001C6F B05B mov al,'[' + 19246 00001C71 E83A05 call PRINT_CHAR ; prefix subdirectory + 19247 dw1: + 19248 00001C74 E82CFD call DisplayDotForm ; display name.ext + 19249 + 19250 ; DX = # chars displayed in name.ext + 19251 + 19252 ;;test ds:[bx].fileattr,ATTR_DIRECTORY + 19253 ;test byte [bx+EntryStruc.fileattr],10h + 19254 ; 03/08/2024 + 19255 ;test byte [bx+12],ATTR_DIRECTORY + 19256 00001C77 9D popf ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 19257 00001C78 7405 jz short dw2 ; not a subdirectory file + 19258 00001C7A B05D mov al,']' + 19259 00001C7C E82F05 call PRINT_CHAR ; postfix subdirectory + 19260 dw2: + 19261 ; Pad field with blanks. + 19262 + 19263 ;mov cx,size filename + size fileext + 1 + 19264 00001C7F B90C00 mov cx,12 ; 8+3+1 + 19265 ; CX = field size + 19266 00001C82 29D1 sub cx,dx ; CX = # pad char's + 19267 00001C84 E307 jcxz dwDone + 19268 00001C86 B020 mov al,' ' + 19269 dw3: + 19270 00001C88 E82305 call PRINT_CHAR + 19271 00001C8B E2FB loop dw3 + 19272 dwDone: + 19273 00001C8D 1F pop ds ; DS = TRANGROUP seg addr again + 19274 ;assume ds:TRANGROUP + 19275 00001C8E C3 retn + 19276 + 19277 ; --------------------------------------------------------------------------- + 19278 + 19279 ;*** GetDriveLtr - get target drive letter + 19280 ; + 19281 ; ENTRY FCB contains drive # + 19282 ; + 19283 ; EXIT AX = "d:" + 19284 ; + 19285 ; USED nothing + 19286 + 19287 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19288 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:19D8h + 19289 GetDriveLtr: + 19290 00001C8F A05C00 mov al,[FCB] ; 5Ch ; AL = target drive # + 19291 00001C92 08C0 or al,al + 19292 00001C94 7505 jnz short gdl1 ; not current drive default, skip ahead + 19293 00001C96 A0[079C] mov al,[CURDRV] ; AL = current drive # + 19294 00001C99 FEC0 inc al ; AL = 1-based drive # + 19295 gdl1: + 19296 00001C9B 0440 add al,'A'-1 ; 40h ; AL = target drive letter + 19297 00001C9D B43A mov ah,':' ; AX = "d:" + 19298 00001C9F C3 retn + 19299 + 19300 ; --------------------------------------------------------------------------- + 19301 + 19302 ;*** SetupParamError - set up for Std_EPrintf parameter parse error message + 19303 ; + 19304 ; Do for our /O and /A string parsers what Parse_With_Msg does + 19305 ; for system parser calls. Set up a message substitution block, + 19306 ; etc. for invalid value strings. I copied the procedure from + 19307 ; Setup_Parse_Error_Msg. 19308 ; - 19309 ; EXIT AX = system parser error return code for bad param format - 19310 ; DX = ptr to message description block for Std_EPrintf + 19309 ; ENTRY BX = ptr to system parser result buffer (contains ptr to str) + 19310 ; 19311 ; - 19312 ; USED SI - 19313 ; - 19314 ; EFFECTS - 19315 ; - 19316 ; Msg_Disp_Class = parse error message class - 19317 ; Message block (see DX) is set up for parse error message - 19318 - 19319 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19320 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:19E9h - 19321 SetupParamError: - 19322 00001CA0 B80900 mov ax,9 ; parse error # - 19323 00001CA3 C606[D58F]02 mov byte [msg_disp_class],parse_msg_class - 19324 ;mov byte [msg_disp_class],2 - 19325 00001CA8 A3[D78F] mov [extend_buf_ptr],ax - 19326 ;mov si,[bx+ResultBuffer.ValuePtr] - 19327 00001CAB 8B7704 mov si,[bx+4] - 19328 00001CAE 8936[A09D] mov [string_ptr_2],si - 19329 00001CB2 C606[D98F]01 mov byte [extend_buf_sub],one_subst - 19330 ;mov byte [extend_buf_sub],1 - 19331 00001CB7 BA[D78F] mov dx,extend_buf_ptr - 19332 00001CBA C3 retn - 19333 - 19334 ; --------------------------------------------------------------------------- - 19335 - 19336 ;*** ZeroTotals - zero grand total file count, size - 19337 ; - 19338 ; ENTRY nothing - 19339 ; - 19340 ; EXIT nothing - 19341 ; - 19342 ; USED AX - 19343 ; - 19344 ; EFFECTS - 19345 ; - 19346 ; FileCntTotal & FileSizTotal are zeroed. - 19347 ; - 19348 ; NOTES - 19349 ; - 19350 ; FileCntTotal throuth csecUsedTotal must be together! - 19351 - 19352 ; 05/06/2023 - 19353 ;ifdef DBLSPACE_HOOKS - 19354 ;csecSIZE EQU size csecUsed + size csecUsedDir + size csecUsedTotal - 19355 ;ccluSIZE EQU size ccluUsed + size ccluUsedDir + size ccluUsedTotal - 19356 ;endif - 19357 - 19358 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19359 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A13h + 19312 ; EXIT AX = system parser error return code for bad param format + 19313 ; DX = ptr to message description block for Std_EPrintf + 19314 ; + 19315 ; USED SI + 19316 ; + 19317 ; EFFECTS + 19318 ; + 19319 ; Msg_Disp_Class = parse error message class + 19320 ; Message block (see DX) is set up for parse error message + 19321 + 19322 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19323 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:19E9h + 19324 SetupParamError: + 19325 00001CA0 B80900 mov ax,9 ; parse error # + 19326 00001CA3 C606[D58F]02 mov byte [msg_disp_class],parse_msg_class + 19327 ;mov byte [msg_disp_class],2 + 19328 00001CA8 A3[D78F] mov [extend_buf_ptr],ax + 19329 ;mov si,[bx+ResultBuffer.ValuePtr] + 19330 00001CAB 8B7704 mov si,[bx+4] + 19331 00001CAE 8936[A09D] mov [string_ptr_2],si + 19332 00001CB2 C606[D98F]01 mov byte [extend_buf_sub],one_subst + 19333 ;mov byte [extend_buf_sub],1 + 19334 00001CB7 BA[D78F] mov dx,extend_buf_ptr + 19335 00001CBA C3 retn + 19336 + 19337 ; --------------------------------------------------------------------------- + 19338 + 19339 ;*** ZeroTotals - zero grand total file count, size + 19340 ; + 19341 ; ENTRY nothing + 19342 ; + 19343 ; EXIT nothing + 19344 ; + 19345 ; USED AX + 19346 ; + 19347 ; EFFECTS + 19348 ; + 19349 ; FileCntTotal & FileSizTotal are zeroed. + 19350 ; + 19351 ; NOTES + 19352 ; + 19353 ; FileCntTotal throuth csecUsedTotal must be together! + 19354 + 19355 ; 05/06/2023 + 19356 ;ifdef DBLSPACE_HOOKS + 19357 ;csecSIZE EQU size csecUsed + size csecUsedDir + size csecUsedTotal + 19358 ;ccluSIZE EQU size ccluUsed + size ccluUsedDir + size ccluUsedTotal + 19359 ;endif 19360 - 19361 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 19362 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1C08h + 19361 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19362 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A13h 19363 - 19364 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 19365 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D67h - 19366 ZeroTotals: - 19367 00001CBB BF[5E9C] mov di,FileCntTotal - 19368 - 19369 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 19370 ;;mov cx,size FileCntTotal+size FileSizTotal - 19371 ;mov cx,8 - 19372 ;ifdef DBLSPACE_HOOKS - 19373 ;mov cx,size FileCntTotal+size FileSizTotal+csecSIZE+ccluSIZE - 19374 ;endif - 19375 ;mov cx,26 - 19376 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 19377 00001CBE B90C00 mov cx,12 - 19378 - 19379 00001CC1 30C0 xor al,al - 19380 00001CC3 F3AA rep stosb - 19381 00001CC5 C3 retn - 19382 - 19383 ; --------------------------------------------------------------------------- - 19384 - 19385 ;*** CtrlCHandler - our own control-c handler - 19386 ; - 19387 ; Make sure user's default directory gets restored. See notes - 19388 ; at InstallCtrlCHandler. + 19364 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 19365 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1C08h + 19366 + 19367 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 19368 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D67h + 19369 ZeroTotals: + 19370 00001CBB BF[5E9C] mov di,FileCntTotal + 19371 + 19372 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 19373 ;;mov cx,size FileCntTotal+size FileSizTotal + 19374 ;mov cx,8 + 19375 ;ifdef DBLSPACE_HOOKS + 19376 ;mov cx,size FileCntTotal+size FileSizTotal+csecSIZE+ccluSIZE + 19377 ;endif + 19378 ;mov cx,26 + 19379 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 19380 00001CBE B90C00 mov cx,12 + 19381 + 19382 00001CC1 30C0 xor al,al + 19383 00001CC3 F3AA rep stosb + 19384 00001CC5 C3 retn + 19385 + 19386 ; --------------------------------------------------------------------------- + 19387 + 19388 ;*** CtrlCHandler - our own control-c handler 19389 ; - 19390 ; ENTRY control-c - 19391 ; - 19392 ; EXIT to OldCtrlCHandler - 19393 ; - 19394 ; USED DS,flags - 19395 ; - 19396 ; EFFECTS - 19397 ; - 19398 ; Restore user's default directory. - 19399 ; - 19400 ; NOTES - 19401 ; - 19402 ; This handler is only installed after calling PathCrunch, - 19403 ; which sets UserDir1, so the restoration will work. + 19390 ; Make sure user's default directory gets restored. See notes + 19391 ; at InstallCtrlCHandler. + 19392 ; + 19393 ; ENTRY control-c + 19394 ; + 19395 ; EXIT to OldCtrlCHandler + 19396 ; + 19397 ; USED DS,flags + 19398 ; + 19399 ; EFFECTS + 19400 ; + 19401 ; Restore user's default directory. + 19402 ; + 19403 ; NOTES 19404 ; - 19405 ; The original control-c vector will be restored, whether - 19406 ; or not this one is invoked, in the HeadFix routine. - 19407 - 19408 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19409 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A1Eh + 19405 ; This handler is only installed after calling PathCrunch, + 19406 ; which sets UserDir1, so the restoration will work. + 19407 ; + 19408 ; The original control-c vector will be restored, whether + 19409 ; or not this one is invoked, in the HeadFix routine. 19410 - 19411 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM - 19412 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1C13h ; * + 19411 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19412 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A1Eh 19413 - 19414 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 19415 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D72h + 19414 ; 05/06/2023 - Retro DOS v4.2 COMMAND.COM + 19415 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1C13h ; * 19416 - 19417 CtrlCHandler: ;proc far - 19418 - 19419 ;SR; - 19420 ; Save all registers used: ds, dx, ax. I know ax is being used by the - 19421 ;CtrlC handler, am not sure about ds & dx. Save them to be safe - 19422 ; - 19423 00001CC6 1E push ds - 19424 00001CC7 0E push cs - 19425 00001CC8 1F pop ds ; DS = TRANGROUP seg addr - 19426 00001CC9 50 push ax - 19427 - 19428 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 19429 %if 0 - 19430 push bx ; * - 19431 push dx - 19432 call CloseCVF ; * ; close CVF file if open - 19433 call RestUDir ; restore user's default directory - 19434 pop dx - 19435 pop bx ; * - 19436 %else - 19437 00001CCA 52 push dx - 19438 00001CCB E8620B call RestUDir ; restore user's default directory - 19439 00001CCE 5A pop dx - 19440 %endif - 19441 00001CCF 58 pop ax - 19442 00001CD0 1F pop ds - 19443 00001CD1 2EFF2E[C3A5] jmp far [cs:OldCtrlCHandler] - 19444 ; go to previous int 23 handler - 19445 - 19446 ; --------------------------------------------------------------------------- - 19447 - 19448 ;M010;start - 19449 ;*** LowerCase - convert ASCII character in AL to lowercase - 19450 ; - 19451 ; ENTRY AL = character to be displayed - 19452 ; - 19453 ; EXIT AL is lowercase - 19454 ; - 19455 ; USED nothing - 19456 - 19457 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19458 LowerCase: - 19459 00001CD6 3C41 cmp al,'A' ; ensure AL is in range 'A'-'Z' - 19460 00001CD8 7206 jb short lcRet - 19461 00001CDA 3C5A cmp al,'Z' - 19462 00001CDC 7702 ja short lcRet - 19463 - 19464 00001CDE 0C20 or al,20h ; convert to ASCII lowercase (UpperCase+32)-->LowerCase - 19465 lcRet: - 19466 00001CE0 C3 retn - 19467 - 19468 ; --------------------------------------------------------------------------- - 19469 - 19470 ;*** LowercaseString - convert ASCIIZ string at DS:SI to lowercase - 19471 ; - 19472 ; ENTRY DS:SI points to start of ASCIIZ string - 19473 ; ES = DS + 19417 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 19418 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1D72h + 19419 + 19420 CtrlCHandler: ;proc far + 19421 + 19422 ;SR; + 19423 ; Save all registers used: ds, dx, ax. I know ax is being used by the + 19424 ;CtrlC handler, am not sure about ds & dx. Save them to be safe + 19425 ; + 19426 00001CC6 1E push ds + 19427 00001CC7 0E push cs + 19428 00001CC8 1F pop ds ; DS = TRANGROUP seg addr + 19429 00001CC9 50 push ax + 19430 + 19431 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 19432 %if 0 + 19433 push bx ; * + 19434 push dx + 19435 call CloseCVF ; * ; close CVF file if open + 19436 call RestUDir ; restore user's default directory + 19437 pop dx + 19438 pop bx ; * + 19439 %else + 19440 00001CCA 52 push dx + 19441 00001CCB E8620B call RestUDir ; restore user's default directory + 19442 00001CCE 5A pop dx + 19443 %endif + 19444 00001CCF 58 pop ax + 19445 00001CD0 1F pop ds + 19446 00001CD1 2EFF2E[C3A5] jmp far [cs:OldCtrlCHandler] + 19447 ; go to previous int 23 handler + 19448 + 19449 ; --------------------------------------------------------------------------- + 19450 + 19451 ;M010;start + 19452 ;*** LowerCase - convert ASCII character in AL to lowercase + 19453 ; + 19454 ; ENTRY AL = character to be displayed + 19455 ; + 19456 ; EXIT AL is lowercase + 19457 ; + 19458 ; USED nothing + 19459 + 19460 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19461 LowerCase: + 19462 00001CD6 3C41 cmp al,'A' ; ensure AL is in range 'A'-'Z' + 19463 00001CD8 7206 jb short lcRet + 19464 00001CDA 3C5A cmp al,'Z' + 19465 00001CDC 7702 ja short lcRet + 19466 + 19467 00001CDE 0C20 or al,20h ; convert to ASCII lowercase (UpperCase+32)-->LowerCase + 19468 lcRet: + 19469 00001CE0 C3 retn + 19470 + 19471 ; --------------------------------------------------------------------------- + 19472 + 19473 ;*** LowercaseString - convert ASCIIZ string at DS:SI to lowercase 19474 ; - 19475 ; EXIT nothing - 19476 ; - 19477 ; USED AL,SI - 19478 - 19479 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 19480 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 19481 LowercaseString: - 19482 00001CE1 57 push di ; save di - 19483 00001CE2 89F7 mov di,si ; ES:DI --> ASCIIZ string - 19484 00001CE4 FC cld - 19485 NextChar: - 19486 00001CE5 AC lodsb ; get character from string into al - 19487 00001CE6 08C0 or al,al ; are we at end of string? - 19488 00001CE8 7414 jz short EndOfString - 19489 - 19490 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 19491 %if 1 - 19492 ;ifdef DBCS - 19493 ;invoke testkanj - 19494 ;jz @f ; if this is not lead byte - 19495 00001CEA E8740A call testkanj - 19496 00001CED 7409 jz short NextChar_@ - 19497 00001CEF AA stosb ; store lead byte - 19498 00001CF0 AC lodsb ; get tail byte - 19499 00001CF1 08C0 or al,al - 19500 00001CF3 7409 jz short EndOfString ; if end - 19501 00001CF5 AA stosb ; store tail byte - 19502 00001CF6 EBED jmp short NextChar - 19503 ;@@: - 19504 NextChar_@: - 19505 ;endif - 19506 %endif - 19507 00001CF8 E8DBFF call LowerCase ; convert character to lowercase - 19508 00001CFB AA stosb ; store character back into buffer - 19509 00001CFC EBE7 jmp short NextChar ; repeat until end of string - 19510 - 19511 EndOfString: - 19512 00001CFE 5F pop di ; restore di - 19513 00001CFF C3 retn - 19514 - 19515 ;M010;end - 19516 - 19517 ; 08/06/2023 - 19518 ; --------------------------------------------------------------------------- - 19519 ; MSDOS 6.2(2) COMMAND.COM procedure only ! - 19520 ; ----------------------------------------- - 19521 ; Hex-Rays IDA / disassembled source code ! modified for NASM by Erdogan Tan - 19522 ; --------------------------------------------------------------------------- - 19523 - 19524 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 19525 %if 0 - 19526 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 19527 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1C44h - 19528 screen_f_set: - 19529 ; set dir display parameters depending on screen width (# of columns) - 19530 push ds - 19531 mov ax,40h - 19532 mov ds,ax - 19533 cmp word [4Ah],40 ; Check ROMBIOS DATA colums per row - 19534 ; value (80 or 40) - 19535 pop ds - 19536 jnz short columns_80 ; 80 columns per line (video mode 3) - 19537 and byte [screen_f_1],0BFh ; ~40h - 19538 mov word [screen_f_2],0A0Ah ; 10 bytes (file size field) - 19539 and byte [screen_f_3],0BFh - 19540 and byte [screen_f_4],0BFh - 19541 mov word [screen_f_5],0A0Ah ; 10 bytes (file size field) - 19542 and byte [screen_f_6],0BFh - 19543 mov word [screen_f_7],1C1Ch ; 28 bytes (free bytes field) - 19544 ;jmp short screen_f_set_retn - 19545 retn - 19546 columns_80: - 19547 or byte [screen_f_1],40h - 19548 mov word [screen_f_2],0E0Eh ; 14 bytes (file size field) - 19549 or byte [screen_f_3],40h - 19550 or byte [screen_f_4],40h - 19551 mov word [screen_f_5],0E0Eh ; 14 bytes (file size field) - 19552 or byte [screen_f_6],40h - 19553 mov word [screen_f_7],2020h ; 32 bytes (free bytes field) - 19554 screen_f_set_retn: - 19555 retn - 19556 %endif - 19557 - 19558 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 19559 %if 0 + 19475 ; ENTRY DS:SI points to start of ASCIIZ string + 19476 ; ES = DS + 19477 ; + 19478 ; EXIT nothing + 19479 ; + 19480 ; USED AL,SI + 19481 + 19482 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 19483 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 19484 LowercaseString: + 19485 00001CE1 57 push di ; save di + 19486 00001CE2 89F7 mov di,si ; ES:DI --> ASCIIZ string + 19487 00001CE4 FC cld + 19488 NextChar: + 19489 00001CE5 AC lodsb ; get character from string into al + 19490 00001CE6 08C0 or al,al ; are we at end of string? + 19491 00001CE8 7414 jz short EndOfString + 19492 + 19493 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 19494 %if 1 + 19495 ;ifdef DBCS + 19496 ;invoke testkanj + 19497 ;jz @f ; if this is not lead byte + 19498 00001CEA E8740A call testkanj + 19499 00001CED 7409 jz short NextChar_@ + 19500 00001CEF AA stosb ; store lead byte + 19501 00001CF0 AC lodsb ; get tail byte + 19502 00001CF1 08C0 or al,al + 19503 00001CF3 7409 jz short EndOfString ; if end + 19504 00001CF5 AA stosb ; store tail byte + 19505 00001CF6 EBED jmp short NextChar + 19506 ;@@: + 19507 NextChar_@: + 19508 ;endif + 19509 %endif + 19510 00001CF8 E8DBFF call LowerCase ; convert character to lowercase + 19511 00001CFB AA stosb ; store character back into buffer + 19512 00001CFC EBE7 jmp short NextChar ; repeat until end of string + 19513 + 19514 EndOfString: + 19515 00001CFE 5F pop di ; restore di + 19516 00001CFF C3 retn + 19517 + 19518 ;M010;end + 19519 + 19520 ; 08/06/2023 + 19521 ; --------------------------------------------------------------------------- + 19522 ; MSDOS 6.2(2) COMMAND.COM procedure only ! + 19523 ; ----------------------------------------- + 19524 ; Hex-Rays IDA / disassembled source code ! modified for NASM by Erdogan Tan + 19525 ; --------------------------------------------------------------------------- + 19526 + 19527 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 19528 %if 0 + 19529 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 19530 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1C44h + 19531 screen_f_set: + 19532 ; set dir display parameters depending on screen width (# of columns) + 19533 push ds + 19534 mov ax,40h + 19535 mov ds,ax + 19536 cmp word [4Ah],40 ; Check ROMBIOS DATA colums per row + 19537 ; value (80 or 40) + 19538 pop ds + 19539 jnz short columns_80 ; 80 columns per line (video mode 3) + 19540 and byte [screen_f_1],0BFh ; ~40h + 19541 mov word [screen_f_2],0A0Ah ; 10 bytes (file size field) + 19542 and byte [screen_f_3],0BFh + 19543 and byte [screen_f_4],0BFh + 19544 mov word [screen_f_5],0A0Ah ; 10 bytes (file size field) + 19545 and byte [screen_f_6],0BFh + 19546 mov word [screen_f_7],1C1Ch ; 28 bytes (free bytes field) + 19547 ;jmp short screen_f_set_retn + 19548 retn + 19549 columns_80: + 19550 or byte [screen_f_1],40h + 19551 mov word [screen_f_2],0E0Eh ; 14 bytes (file size field) + 19552 or byte [screen_f_3],40h + 19553 or byte [screen_f_4],40h + 19554 mov word [screen_f_5],0E0Eh ; 14 bytes (file size field) + 19555 or byte [screen_f_6],40h + 19556 mov word [screen_f_7],2020h ; 32 bytes (free bytes field) + 19557 screen_f_set_retn: + 19558 retn + 19559 %endif 19560 - 19561 ;============================================================================ - 19562 ; CRATIO.ASM, MSDOS 6.0, 1992 - 19563 ;============================================================================ - 19564 ; 08/06/2023 - Retro DOS v4.2 - 19565 - 19566 ; The code to calculate compression ratios requires access to the drive's - 19567 ; (DOS) FAT and MagicDrv FAT regions. Two buffers are used (one for each - 19568 ; FAT type). pbufDOSFAT and pbufMDFAT contain the offset to the buffers, - 19569 ; segFATBuf contains the segment (both buffers are in the same segment). - 19570 ; The buffers are of variable size: cFATEntries contains the size of the - 19571 ; buffers in terms of the number of FAT entries they can contain. - 19572 - 19573 ; --------------------------------------------------------------------------- - 19574 - 19575 ;*** OpenCVF - open Compressed Volume File for compression ratio report - 19576 ; - 19577 ; ENTRY - 19578 ; FCB setup with drive for DIR + 19561 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 19562 %if 0 + 19563 + 19564 ;============================================================================ + 19565 ; CRATIO.ASM, MSDOS 6.0, 1992 + 19566 ;============================================================================ + 19567 ; 08/06/2023 - Retro DOS v4.2 + 19568 + 19569 ; The code to calculate compression ratios requires access to the drive's + 19570 ; (DOS) FAT and MagicDrv FAT regions. Two buffers are used (one for each + 19571 ; FAT type). pbufDOSFAT and pbufMDFAT contain the offset to the buffers, + 19572 ; segFATBuf contains the segment (both buffers are in the same segment). + 19573 ; The buffers are of variable size: cFATEntries contains the size of the + 19574 ; buffers in terms of the number of FAT entries they can contain. + 19575 + 19576 ; --------------------------------------------------------------------------- + 19577 + 19578 ;*** OpenCVF - open Compressed Volume File for compression ratio report 19579 ; - 19580 ; EXIT If successful, CY clear, CVF file open, fhCVF has file handle, - 19581 ; szCVF has \0 terminated CVF file name, MDBPB loaded. + 19580 ; ENTRY + 19581 ; FCB setup with drive for DIR 19582 ; - 19583 ; If unsuccessful, CY set - 19584 ; - 19585 ; USED AX, BX, CX, DX, SI, DI - 19586 - 19587 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 19588 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1CA1h - 19589 OpenCVF: - 19590 mov ax,-1 - 19591 mov [fhCVF],ax ;indicate CVF not open - 19592 mov [entInBuf],ax ; and no FAT entries in buffers - 19593 - 19594 mov dl,[FCB] ; mov dl,5Ch ;target drive of DIR cmd - 19595 or dl,dl ;default drive? - 19596 jz short ocvf_default - 19597 dec dl ;no, from 1=A to 0=A - 19598 jmp short ocvf_swap_info - 19599 - 19600 ocvf_default: - 19601 mov dl,[CURDRV] ;0=A, 1=B, ... + 19583 ; EXIT If successful, CY clear, CVF file open, fhCVF has file handle, + 19584 ; szCVF has \0 terminated CVF file name, MDBPB loaded. + 19585 ; + 19586 ; If unsuccessful, CY set + 19587 ; + 19588 ; USED AX, BX, CX, DX, SI, DI + 19589 + 19590 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 19591 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1CA1h + 19592 OpenCVF: + 19593 mov ax,-1 + 19594 mov [fhCVF],ax ;indicate CVF not open + 19595 mov [entInBuf],ax ; and no FAT entries in buffers + 19596 + 19597 mov dl,[FCB] ; mov dl,5Ch ;target drive of DIR cmd + 19598 or dl,dl ;default drive? + 19599 jz short ocvf_default + 19600 dec dl ;no, from 1=A to 0=A + 19601 jmp short ocvf_swap_info 19602 - 19603 ocvf_swap_info: - 19604 mov ax,4A11h ; multMagicDrv ;magicdrv Int 2Fh multiplex ID - 19605 mov bx,1 ; MD_DRIVE_MAP ;get drive swap info - 19606 int 2fh - 19607 - 19608 or ax,ax ;0 if okay - 19609 jnz short ocvf_error + 19603 ocvf_default: + 19604 mov dl,[CURDRV] ;0=A, 1=B, ... + 19605 + 19606 ocvf_swap_info: + 19607 mov ax,4A11h ; multMagicDrv ;magicdrv Int 2Fh multiplex ID + 19608 mov bx,1 ; MD_DRIVE_MAP ;get drive swap info + 19609 int 2fh 19610 - 19611 test bl,80h ;80h set if compressed volume - 19612 jz short ocvf_error + 19611 or ax,ax ;0 if okay + 19612 jnz short ocvf_error 19613 - 19614 and bl,7Fh ;bl = host drive, bh = seq # - 19615 - 19616 ; The CVF may have been mounted from a swapped host drive, in which - 19617 ; case the host drive returned in BL is the original host (now - 19618 ; swapped with a CVF). Make a second drive swap info call on the - 19619 ; returned host to see if it must be accessed by a different drive - 19620 ; letter. - 19621 - 19622 push bx - 19623 push dx ;save dl, orig drive letter + 19614 test bl,80h ;80h set if compressed volume + 19615 jz short ocvf_error + 19616 + 19617 and bl,7Fh ;bl = host drive, bh = seq # + 19618 + 19619 ; The CVF may have been mounted from a swapped host drive, in which + 19620 ; case the host drive returned in BL is the original host (now + 19621 ; swapped with a CVF). Make a second drive swap info call on the + 19622 ; returned host to see if it must be accessed by a different drive + 19623 ; letter. 19624 - 19625 mov ax,4A11h ; mov ax,multMagicDrv - 19626 mov dl,bl - 19627 mov bx,1 ; mov bx,MD_DRIVE_MAP - 19628 int 2fh - 19629 - 19630 pop dx - 19631 pop cx ;bx from 1st drive swap info call + 19625 push bx + 19626 push dx ;save dl, orig drive letter + 19627 + 19628 mov ax,4A11h ; mov ax,multMagicDrv + 19629 mov dl,bl + 19630 mov bx,1 ; mov bx,MD_DRIVE_MAP + 19631 int 2fh 19632 - 19633 or ax,ax ;0 if okay - 19634 jnz short ocvf_error + 19633 pop dx + 19634 pop cx ;bx from 1st drive swap info call 19635 - 19636 and bl,7Fh - 19637 xchg bx,cx ;bx = 1st, cx = 2nd swap results + 19636 or ax,ax ;0 if okay + 19637 jnz short ocvf_error 19638 - 19639 cmp dl,cl ;2nd swap info call return orig drive? - 19640 je short ocvf_got_host ;yes, 1st swap info call returned host + 19639 and bl,7Fh + 19640 xchg bx,cx ;bx = 1st, cx = 2nd swap results 19641 - 19642 mov bl,cl ;no, use swapped host, orig seq # - 19643 ocvf_got_host: - 19644 ; Build the filename of the Compressed Volume File - 19645 - 19646 ;mov di,offset TRANGROUP:szCVF - 19647 ;CVF name buffer - 19648 mov di,szCVF - 19649 - 19650 mov al,bl - 19651 add al,'A' - 19652 mov ah,':' - 19653 cld - 19654 stosw ; drive: - 19655 - 19656 ;mov si,offset TRANGROUP:sCVFRoot - 19657 ; \name. - 19658 mov si,sCVFRoot ; "\DBLSPACE" - 19659 ;mov cx,cbCVFRoot - 19660 mov cx,10 - 19661 rep movsb - 19662 - 19663 add di,3 ; point past extension - 19664 xor al,al - 19665 std - 19666 stosb ; null terminate - 19667 - 19668 mov al,bh ; seq # - 19669 mov bl,10 - 19670 ;mov cx,3 ; 3 digit ext/seq # - 19671 mov cl,3 - 19672 ;@@: - 19673 ocvf_1: xor ah,ah ; convert seq # to ascii - 19674 div bl ; and store as CVF extension - 19675 add ah,'0' - 19676 xchg ah,al - 19677 stosb - 19678 mov al,ah - 19679 ;loop @b - 19680 loop ocvf_1 - 19681 - 19682 cld - 19683 - 19684 ; Now open the Compressed Volume File - 19685 - 19686 ; 08/06/2023 - 19687 ; MSDOS 6.22 COMMAND.COM code only ! - 19688 ;;; - 19689 mov di,szCVF ; * - 19690 mov word [di+4],5652h ; 'RV' (DRVSPACE) - 19691 mov ax,3D00h - 19692 ;mov dx,szCVF - 19693 mov dx,di ; * - 19694 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 19695 ; DS:DX -> ASCIZ filename - 19696 ; AL = access mode - 19697 ; 0 - read - 19698 jnb short ocvf_2 - 19699 mov word [di+4],4C42h ; 'BL' (DBLSPACE) - 19700 ;;; - 19701 - 19702 ;mov ax,(OPEN shl 8) or 00h ;compatibility mode/read access - 19703 mov ax,3D00h - 19704 ;;mov dx,offset TRANGROUP:szCVF - 19705 ;mov dx,szCVF - 19706 mov dx,di ; * - 19707 int 21h - 19708 ;jc short ocvf_error - 19709 ; 18/06/2023 - 19710 jnc short ocvf_2 - 19711 ocvf_error: ; 18/06/2023 - 19712 stc ;indicate failure - 19713 retn - 19714 ocvf_2: - 19715 mov [fhCVF],ax ; success, save CVF file handle - 19716 - 19717 ; Read the extended MagicDrv BPB - 19718 - 19719 mov bx,ax - 19720 ;mov ah,READ - 19721 mov ah,3Fh - 19722 ;mov cx,size MD_BPB - 19723 mov cx,64 - 19724 ;mov dx,offset TRANGROUP:MDBPB - 19725 mov dx,MDBPB - 19726 int 21h - 19727 jc short ocvf_error1 - 19728 - 19729 cmp ax,cx ; get it all? - 19730 je short ocvf_pick_cluster_size - 19731 ; yes... - 19732 ocvf_error1: - 19733 call CloseCVF - 19734 ; 18/06/2023 - 19735 ;ocvf_error: - 19736 stc ;indicate failure - 19737 ;jmp short ocvf_ret - 19738 retn - 19739 - 19740 ; Determine the cluster size to use for ratio calculation - 19741 - 19742 ocvf_pick_cluster_size: - 19743 cmp byte [fUseHostSize],0 ; user want Host drive cluster size? - 19744 je short ovcf_use_CVF_size ; no, use CVF cluster size - 19745 - 19746 ;mov ah,Get_Drive_Data ; get the host drive cluster size - 19747 mov ah,1Ch - 19748 mov dl,[szCVF] - 19749 ;sub dl,40h - 19750 sub dl,'A'-1 ; 1 = A, 2 = B, ... - 19751 push ds - 19752 int 21h - 19753 pop ds - 19754 - 19755 cmp al,0FFh ; host drive cluster size in AL if okay, - 19756 jne short ovcf_set_size ; failed = 0FFh + 19642 cmp dl,cl ;2nd swap info call return orig drive? + 19643 je short ocvf_got_host ;yes, 1st swap info call returned host + 19644 + 19645 mov bl,cl ;no, use swapped host, orig seq # + 19646 ocvf_got_host: + 19647 ; Build the filename of the Compressed Volume File + 19648 + 19649 ;mov di,offset TRANGROUP:szCVF + 19650 ;CVF name buffer + 19651 mov di,szCVF + 19652 + 19653 mov al,bl + 19654 add al,'A' + 19655 mov ah,':' + 19656 cld + 19657 stosw ; drive: + 19658 + 19659 ;mov si,offset TRANGROUP:sCVFRoot + 19660 ; \name. + 19661 mov si,sCVFRoot ; "\DBLSPACE" + 19662 ;mov cx,cbCVFRoot + 19663 mov cx,10 + 19664 rep movsb + 19665 + 19666 add di,3 ; point past extension + 19667 xor al,al + 19668 std + 19669 stosb ; null terminate + 19670 + 19671 mov al,bh ; seq # + 19672 mov bl,10 + 19673 ;mov cx,3 ; 3 digit ext/seq # + 19674 mov cl,3 + 19675 ;@@: + 19676 ocvf_1: xor ah,ah ; convert seq # to ascii + 19677 div bl ; and store as CVF extension + 19678 add ah,'0' + 19679 xchg ah,al + 19680 stosb + 19681 mov al,ah + 19682 ;loop @b + 19683 loop ocvf_1 + 19684 + 19685 cld + 19686 + 19687 ; Now open the Compressed Volume File + 19688 + 19689 ; 08/06/2023 + 19690 ; MSDOS 6.22 COMMAND.COM code only ! + 19691 ;;; + 19692 mov di,szCVF ; * + 19693 mov word [di+4],5652h ; 'RV' (DRVSPACE) + 19694 mov ax,3D00h + 19695 ;mov dx,szCVF + 19696 mov dx,di ; * + 19697 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 19698 ; DS:DX -> ASCIZ filename + 19699 ; AL = access mode + 19700 ; 0 - read + 19701 jnb short ocvf_2 + 19702 mov word [di+4],4C42h ; 'BL' (DBLSPACE) + 19703 ;;; + 19704 + 19705 ;mov ax,(OPEN shl 8) or 00h ;compatibility mode/read access + 19706 mov ax,3D00h + 19707 ;;mov dx,offset TRANGROUP:szCVF + 19708 ;mov dx,szCVF + 19709 mov dx,di ; * + 19710 int 21h + 19711 ;jc short ocvf_error + 19712 ; 18/06/2023 + 19713 jnc short ocvf_2 + 19714 ocvf_error: ; 18/06/2023 + 19715 stc ;indicate failure + 19716 retn + 19717 ocvf_2: + 19718 mov [fhCVF],ax ; success, save CVF file handle + 19719 + 19720 ; Read the extended MagicDrv BPB + 19721 + 19722 mov bx,ax + 19723 ;mov ah,READ + 19724 mov ah,3Fh + 19725 ;mov cx,size MD_BPB + 19726 mov cx,64 + 19727 ;mov dx,offset TRANGROUP:MDBPB + 19728 mov dx,MDBPB + 19729 int 21h + 19730 jc short ocvf_error1 + 19731 + 19732 cmp ax,cx ; get it all? + 19733 je short ocvf_pick_cluster_size + 19734 ; yes... + 19735 ocvf_error1: + 19736 call CloseCVF + 19737 ; 18/06/2023 + 19738 ;ocvf_error: + 19739 stc ;indicate failure + 19740 ;jmp short ocvf_ret + 19741 retn + 19742 + 19743 ; Determine the cluster size to use for ratio calculation + 19744 + 19745 ocvf_pick_cluster_size: + 19746 cmp byte [fUseHostSize],0 ; user want Host drive cluster size? + 19747 je short ovcf_use_CVF_size ; no, use CVF cluster size + 19748 + 19749 ;mov ah,Get_Drive_Data ; get the host drive cluster size + 19750 mov ah,1Ch + 19751 mov dl,[szCVF] + 19752 ;sub dl,40h + 19753 sub dl,'A'-1 ; 1 = A, 2 = B, ... + 19754 push ds + 19755 int 21h + 19756 pop ds 19757 - 19758 ovcf_use_CVF_size: - 19759 ;mov al,[MDBPB.dos_bpb.csecPerClu] - 19760 mov al,[MDBPB+0Dh] ; using CVF cluster size - 19761 - 19762 ovcf_set_size: - 19763 mov [csecPerCluster],al + 19758 cmp al,0FFh ; host drive cluster size in AL if okay, + 19759 jne short ovcf_set_size ; failed = 0FFh + 19760 + 19761 ovcf_use_CVF_size: + 19762 ;mov al,[MDBPB.dos_bpb.csecPerClu] + 19763 mov al,[MDBPB+0Dh] ; using CVF cluster size 19764 - 19765 ; Lastly, setup the FAT buffers - 19766 ocvf_set_buf: - 19767 mov ax,[BYTCNT] ; if >= 32k TPA space available, - 19768 mov [savBytCnt],ax ; setup larger FAT buffers - 19769 cmp ax,32*1024 ; 8000h - 19770 jae short ocvf_big_buf - 19771 - 19772 ; small TPA, use small resident buffers - 19773 - 19774 ;mov word ptr [cFATEntries],cRES_FAT_ENTRIES - 19775 mov word [cFATEntries],32 ; cRES_FAT_ENTRIES - 19776 mov [segFATBuf],ds - 19777 ;mov word ptr [pbufDOSFAT],offset TRANGROUP:bufDOSFAT - 19778 ;mov word ptr [pbufMDFAT],offset TRANGROUP:bufMDFAT - 19779 mov word [pbufDOSFAT],bufDOSFAT - 19780 mov word [pbufMDFAT],bufMDFAT - 19781 ;jmp short ocvf_success - 19782 ; 08/06/2023 - 19783 ; cf = 1 - 19784 clc - 19785 retn - 19786 - 19787 ocvf_big_buf: - 19788 ;mov bx,cBIG_FAT_ENTRIES - 19789 mov bx,256 - 19790 mov [cFATEntries],bx - 19791 - 19792 shl bx,1 ; 6 bytes per entry (2 for DOS FAT, 4 MD FAT) - 19793 mov cx,bx ; entries * 2 - 19794 shl bx,1 - 19795 add bx,cx ; bx = # entries * 6 - 19796 - 19797 sub ax,bx ; reduce TPA size by size of FAT buffers - 19798 and ax,0FE00h ; init code rounds BytCnt down to multiple of - 19799 mov [BYTCNT],ax ; 512 bytes -- a no-op with some buf sizes. - 19800 - 19801 mov bx,[TPA] ; buffers in the TPA - 19802 mov [segFATBuf],bx - 19803 mov [pbufDOSFAT],ax ; DOS FAT buffer offset - 19804 add ax,cx ; + DOS FAT buffer size - 19805 mov [pbufMDFAT],ax ; = MD FAT buffer offset - 19806 ; 08/06/2023 - 19807 ; cf = 0 - 19808 ;ocvf_success: - 19809 ;clc ;indicate success - 19810 ocvf_ret: - 19811 retn - 19812 - 19813 ; --------------------------------------------------------------------------- - 19814 - 19815 ;*** CloseCVF - close Compressed Volume File - 19816 ; - 19817 ; ENTRY fhCVF has file handle - 19818 ; - 19819 ; EXIT - 19820 ; - 19821 ; USED AX, BX, CX, DX - 19822 - 19823 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 19824 CloseCVF: - 19825 mov bx,[fhCVF] ; -1 unless file is open - 19826 cmp bx,-1 ; 0FFFFh - 19827 je short ccvf_ret - 19828 - 19829 ;mov ah,CLOSE - 19830 mov ah,3Eh - 19831 int 21h - 19832 - 19833 mov word [fhCVF],-1 ; 0FFFFh ; don't try to close again - 19834 - 19835 mov ax,[savBytCnt] ; 'deallocate' DOS & MD FAT buffers - 19836 mov [BYTCNT],ax ; by restoring old TPA byte count - 19837 ccvf_ret: - 19838 retn - 19839 - 19840 ; --------------------------------------------------------------------------- - 19841 - 19842 ;*** CalcCompRatio - calculate file compression ratio - 19843 ; - 19844 ; ENTRY AX = starting cluster of file to get compression ratio of - 19845 ; - 19846 ; EXIT AX = compression ratio. Example: a ratio of 2.7 to 1.0 - 19847 ; will return AH = 02h & AL = 07h - 19848 ; ccluUsed set to # DOS clusters used by file - 19849 ; csecUsed set to # compressed sectors used by file - 19850 ; ccluUsedDir, ccluUsedTotal, csecUsedDir, csecUsedTotal updated - 19851 ; USED none - 19852 - 19853 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 19854 CalcCompRatio: - 19855 push bx - 19856 push cx - 19857 push dx - 19858 push es - 19859 mov es,[segFATBuf] ; es is pointer to FAT buffers - 19860 ;assume es:nothing - 19861 - 19862 xor bx,bx ; zero count of sectors & clusters used - 19863 mov [ccluUsed],bx - 19864 mov [csecUsed],bx - 19865 mov [csecUsed+2],bx - 19866 ccr_next: - 19867 cmp ax,2 ; sanity check the DOS FAT value - 19868 jb short ccr_screwy - 19869 - 19870 cmp ax,0FFF0h ; end of file? - 19871 jae short ccr_eof + 19765 ovcf_set_size: + 19766 mov [csecPerCluster],al + 19767 + 19768 ; Lastly, setup the FAT buffers + 19769 ocvf_set_buf: + 19770 mov ax,[BYTCNT] ; if >= 32k TPA space available, + 19771 mov [savBytCnt],ax ; setup larger FAT buffers + 19772 cmp ax,32*1024 ; 8000h + 19773 jae short ocvf_big_buf + 19774 + 19775 ; small TPA, use small resident buffers + 19776 + 19777 ;mov word ptr [cFATEntries],cRES_FAT_ENTRIES + 19778 mov word [cFATEntries],32 ; cRES_FAT_ENTRIES + 19779 mov [segFATBuf],ds + 19780 ;mov word ptr [pbufDOSFAT],offset TRANGROUP:bufDOSFAT + 19781 ;mov word ptr [pbufMDFAT],offset TRANGROUP:bufMDFAT + 19782 mov word [pbufDOSFAT],bufDOSFAT + 19783 mov word [pbufMDFAT],bufMDFAT + 19784 ;jmp short ocvf_success + 19785 ; 08/06/2023 + 19786 ; cf = 1 + 19787 clc + 19788 retn + 19789 + 19790 ocvf_big_buf: + 19791 ;mov bx,cBIG_FAT_ENTRIES + 19792 mov bx,256 + 19793 mov [cFATEntries],bx + 19794 + 19795 shl bx,1 ; 6 bytes per entry (2 for DOS FAT, 4 MD FAT) + 19796 mov cx,bx ; entries * 2 + 19797 shl bx,1 + 19798 add bx,cx ; bx = # entries * 6 + 19799 + 19800 sub ax,bx ; reduce TPA size by size of FAT buffers + 19801 and ax,0FE00h ; init code rounds BytCnt down to multiple of + 19802 mov [BYTCNT],ax ; 512 bytes -- a no-op with some buf sizes. + 19803 + 19804 mov bx,[TPA] ; buffers in the TPA + 19805 mov [segFATBuf],bx + 19806 mov [pbufDOSFAT],ax ; DOS FAT buffer offset + 19807 add ax,cx ; + DOS FAT buffer size + 19808 mov [pbufMDFAT],ax ; = MD FAT buffer offset + 19809 ; 08/06/2023 + 19810 ; cf = 0 + 19811 ;ocvf_success: + 19812 ;clc ;indicate success + 19813 ocvf_ret: + 19814 retn + 19815 + 19816 ; --------------------------------------------------------------------------- + 19817 + 19818 ;*** CloseCVF - close Compressed Volume File + 19819 ; + 19820 ; ENTRY fhCVF has file handle + 19821 ; + 19822 ; EXIT + 19823 ; + 19824 ; USED AX, BX, CX, DX + 19825 + 19826 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 19827 CloseCVF: + 19828 mov bx,[fhCVF] ; -1 unless file is open + 19829 cmp bx,-1 ; 0FFFFh + 19830 je short ccvf_ret + 19831 + 19832 ;mov ah,CLOSE + 19833 mov ah,3Eh + 19834 int 21h + 19835 + 19836 mov word [fhCVF],-1 ; 0FFFFh ; don't try to close again + 19837 + 19838 mov ax,[savBytCnt] ; 'deallocate' DOS & MD FAT buffers + 19839 mov [BYTCNT],ax ; by restoring old TPA byte count + 19840 ccvf_ret: + 19841 retn + 19842 + 19843 ; --------------------------------------------------------------------------- + 19844 + 19845 ;*** CalcCompRatio - calculate file compression ratio + 19846 ; + 19847 ; ENTRY AX = starting cluster of file to get compression ratio of + 19848 ; + 19849 ; EXIT AX = compression ratio. Example: a ratio of 2.7 to 1.0 + 19850 ; will return AH = 02h & AL = 07h + 19851 ; ccluUsed set to # DOS clusters used by file + 19852 ; csecUsed set to # compressed sectors used by file + 19853 ; ccluUsedDir, ccluUsedTotal, csecUsedDir, csecUsedTotal updated + 19854 ; USED none + 19855 + 19856 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 19857 CalcCompRatio: + 19858 push bx + 19859 push cx + 19860 push dx + 19861 push es + 19862 mov es,[segFATBuf] ; es is pointer to FAT buffers + 19863 ;assume es:nothing + 19864 + 19865 xor bx,bx ; zero count of sectors & clusters used + 19866 mov [ccluUsed],bx + 19867 mov [csecUsed],bx + 19868 mov [csecUsed+2],bx + 19869 ccr_next: + 19870 cmp ax,2 ; sanity check the DOS FAT value + 19871 jb short ccr_screwy 19872 - 19873 call CheckFATBuffers ; make sure buffers contain target - 19874 jc short ccr_screwy ; FAT entries + 19873 cmp ax,0FFF0h ; end of file? + 19874 jae short ccr_eof 19875 - 19876 call GetMDFATEntry ; returns corresponding entry in BX:CX - 19877 jc short ccr_screwy + 19876 call CheckFATBuffers ; make sure buffers contain target + 19877 jc short ccr_screwy ; FAT entries 19878 - 19879 shl bx,1 ; used bit to CY - 19880 jnc short ccr_screwy ; better be used! + 19879 call GetMDFATEntry ; returns corresponding entry in BX:CX + 19880 jc short ccr_screwy 19881 - 19882 mov ch,bh ; save uncompressed count - 19883 - 19884 shl bx,1 ; get count into position - 19885 and bx,0F00h ; bh = count of compressed sectors used - 19886 xchg bh,bl ; bx = count - 19887 inc bx ; 0 - 15 means 1 - 16 used - 19888 - 19889 add [csecUsed],bx - 19890 adc word [csecUsed+2],0 + 19882 shl bx,1 ; used bit to CY + 19883 jnc short ccr_screwy ; better be used! + 19884 + 19885 mov ch,bh ; save uncompressed count + 19886 + 19887 shl bx,1 ; get count into position + 19888 and bx,0F00h ; bh = count of compressed sectors used + 19889 xchg bh,bl ; bx = count + 19890 inc bx ; 0 - 15 means 1 - 16 used 19891 - 19892 mov dx,ax ; save cluster # in dx - 19893 - 19894 mov al,ch ; uncompressed count to al - 19895 mov cl,3 - 19896 shr al,cl ; get uncompressed count into position - 19897 and ax,000Fh ; ax = uncompressed count (0 - 15) - 19898 dec bx ; bx = compressed count (0 - 15) - 19899 cmp ax,bx ; if the compressed cnt > uncompressed - 19900 ;jae @f ; fudge a little and use the larger - 19901 jae short ccr_1 ; jnb - 19902 mov ax,bx - 19903 ;@@: - 19904 ccr_1: - 19905 mov cl,[csecPerCluster] ; round up to the number of clusters - 19906 xor ch,ch ; required for uncompressed - 19907 add ax,cx ; sectors - 19908 div cl - 19909 xor ah,ah - 19910 add [ccluUsed],ax - 19911 - 19912 mov ax,dx ; restore cluster # - 19913 call GetDOSFATEntry ; retuns next DOS FAT entry in AX - 19914 ;jc short ccr_screwy - 19915 ;jmp short ccr_next - 19916 ; 08/06/2023 - 19917 jnc short ccr_next - 19918 ccr_screwy: - 19919 xor ax,ax ; something screwy happened, set - 19920 ; ratio to 0.0 and exit - 19921 ccr_ret: - 19922 pop es - 19923 pop dx - 19924 pop cx - 19925 pop bx - 19926 retn - 19927 - 19928 ; Reached the end-of-file, now calculate the ratio as the - 19929 ; number of DOS sectors used / number of compressed sectors used. + 19892 add [csecUsed],bx + 19893 adc word [csecUsed+2],0 + 19894 + 19895 mov dx,ax ; save cluster # in dx + 19896 + 19897 mov al,ch ; uncompressed count to al + 19898 mov cl,3 + 19899 shr al,cl ; get uncompressed count into position + 19900 and ax,000Fh ; ax = uncompressed count (0 - 15) + 19901 dec bx ; bx = compressed count (0 - 15) + 19902 cmp ax,bx ; if the compressed cnt > uncompressed + 19903 ;jae @f ; fudge a little and use the larger + 19904 jae short ccr_1 ; jnb + 19905 mov ax,bx + 19906 ;@@: + 19907 ccr_1: + 19908 mov cl,[csecPerCluster] ; round up to the number of clusters + 19909 xor ch,ch ; required for uncompressed + 19910 add ax,cx ; sectors + 19911 div cl + 19912 xor ah,ah + 19913 add [ccluUsed],ax + 19914 + 19915 mov ax,dx ; restore cluster # + 19916 call GetDOSFATEntry ; retuns next DOS FAT entry in AX + 19917 ;jc short ccr_screwy + 19918 ;jmp short ccr_next + 19919 ; 08/06/2023 + 19920 jnc short ccr_next + 19921 ccr_screwy: + 19922 xor ax,ax ; something screwy happened, set + 19923 ; ratio to 0.0 and exit + 19924 ccr_ret: + 19925 pop es + 19926 pop dx + 19927 pop cx + 19928 pop bx + 19929 retn 19930 - 19931 ccr_eof: - 19932 mov ax,[ccluUsed] - 19933 add [ccluUsedDir],ax ; update cluster used totals - 19934 add [ccluUsedTotal],ax - 19935 - 19936 mov cx,[csecUsed+2] - 19937 mov bx,[csecUsed] ; cx:bx = # compressed sectors used + 19931 ; Reached the end-of-file, now calculate the ratio as the + 19932 ; number of DOS sectors used / number of compressed sectors used. + 19933 + 19934 ccr_eof: + 19935 mov ax,[ccluUsed] + 19936 add [ccluUsedDir],ax ; update cluster used totals + 19937 add [ccluUsedTotal],ax 19938 - 19939 add [csecUsedDir],bx ; update sector used totals - 19940 adc [csecUsedDir+2],cx - 19941 add [csecUsedTotal],bx - 19942 adc [csecUsedTotal+2],cx - 19943 - 19944 call ComputeRatio ; ax=clusters used, cx:bx=sectors used - 19945 - 19946 jmp short ccr_ret - 19947 - 19948 ; 08/06/2023 - 19949 ;ccr_screwy: - 19950 ; xor ax,ax ; something screwy happened, set - 19951 ; ; ratio to 0.0 and exit - 19952 ;ccr_ret: - 19953 ; pop es - 19954 ; pop dx - 19955 ; pop cx - 19956 ; pop bx - 19957 ; retn - 19958 - 19959 ; --------------------------------------------------------------------------- - 19960 - 19961 ;*** ComputeRatio - calculate ratio of compressed sectors used to - 19962 ; (would be) DOS sectors used - 19963 ; - 19964 ; Entry - 19965 ; AX = DOS clusters used, cx:bx = compressed sectors used - 19966 ; Exit - 19967 ; ah = whole portion, al = tenths - 19968 ; - 19969 ; Used BX, CX, DX - 19970 - 19971 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 19972 ComputeRatio: - 19973 push si - 19974 push di - 19975 - 19976 mov si,bx - 19977 mov di,cx ; save cx:bx in di:si + 19939 mov cx,[csecUsed+2] + 19940 mov bx,[csecUsed] ; cx:bx = # compressed sectors used + 19941 + 19942 add [csecUsedDir],bx ; update sector used totals + 19943 adc [csecUsedDir+2],cx + 19944 add [csecUsedTotal],bx + 19945 adc [csecUsedTotal+2],cx + 19946 + 19947 call ComputeRatio ; ax=clusters used, cx:bx=sectors used + 19948 + 19949 jmp short ccr_ret + 19950 + 19951 ; 08/06/2023 + 19952 ;ccr_screwy: + 19953 ; xor ax,ax ; something screwy happened, set + 19954 ; ; ratio to 0.0 and exit + 19955 ;ccr_ret: + 19956 ; pop es + 19957 ; pop dx + 19958 ; pop cx + 19959 ; pop bx + 19960 ; retn + 19961 + 19962 ; --------------------------------------------------------------------------- + 19963 + 19964 ;*** ComputeRatio - calculate ratio of compressed sectors used to + 19965 ; (would be) DOS sectors used + 19966 ; + 19967 ; Entry + 19968 ; AX = DOS clusters used, cx:bx = compressed sectors used + 19969 ; Exit + 19970 ; ah = whole portion, al = tenths + 19971 ; + 19972 ; Used BX, CX, DX + 19973 + 19974 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 19975 ComputeRatio: + 19976 push si + 19977 push di 19978 - 19979 mov bl,[csecPerCluster] - 19980 xor bh,bh - 19981 mul bx ; dx:ax = # DOS sectors used - 19982 mov bx,si ; restore bx - 19983 - 19984 call Div32 ; dx:ax = quotient, cx:bx = remainder - 19985 - 19986 push ax ; save quotient - 19987 - 19988 mov ax,bx ; if no remainder, tenths will be 0 - 19989 or ax,cx ; which is in AX so skip following - 19990 jz short cr_got_tenths ; (happens frequently) - 19991 - 19992 ; Multiply the reminder by 10, add half the divisor so result is - 19993 ; rounded up, and divide again to get tenths digit + 19979 mov si,bx + 19980 mov di,cx ; save cx:bx in di:si + 19981 + 19982 mov bl,[csecPerCluster] + 19983 xor bh,bh + 19984 mul bx ; dx:ax = # DOS sectors used + 19985 mov bx,si ; restore bx + 19986 + 19987 call Div32 ; dx:ax = quotient, cx:bx = remainder + 19988 + 19989 push ax ; save quotient + 19990 + 19991 mov ax,bx ; if no remainder, tenths will be 0 + 19992 or ax,cx ; which is in AX so skip following + 19993 jz short cr_got_tenths ; (happens frequently) 19994 - 19995 mov ax,cx - 19996 xor dx,dx - 19997 mov cx,bx - 19998 mov bx,10 - 19999 mul bx - 20000 xchg ax,cx - 20001 mul bx - 20002 add dx,cx ; dx:ax = remainder * 10 - 20003 - 20004 mov cx,di - 20005 mov bx,si - 20006 shr cx,1 - 20007 rcr bx,1 ; cx:bx = 1/2 divisor - 20008 add ax,bx - 20009 adc dx,cx ; dx:ax = remainder * 10 + 1/2 divisor - 20010 - 20011 mov cx,di - 20012 mov bx,si + 19995 ; Multiply the reminder by 10, add half the divisor so result is + 19996 ; rounded up, and divide again to get tenths digit + 19997 + 19998 mov ax,cx + 19999 xor dx,dx + 20000 mov cx,bx + 20001 mov bx,10 + 20002 mul bx + 20003 xchg ax,cx + 20004 mul bx + 20005 add dx,cx ; dx:ax = remainder * 10 + 20006 + 20007 mov cx,di + 20008 mov bx,si + 20009 shr cx,1 + 20010 rcr bx,1 ; cx:bx = 1/2 divisor + 20011 add ax,bx + 20012 adc dx,cx ; dx:ax = remainder * 10 + 1/2 divisor 20013 - 20014 call Div32 - 20015 - 20016 cr_got_tenths: - 20017 pop bx ; original quotient - 20018 mov ah,bl - 20019 - 20020 cmp al,10 ; if the tenths rounded up to the - 20021 jb short cr_exit ; next whole number, adjust the - 20022 ; whole number part and 0 the - 20023 inc ah ; tenths (i.e. round 1.97 to 2.0) - 20024 xor al,al - 20025 cr_exit: - 20026 pop di - 20027 pop si - 20028 - 20029 retn - 20030 - 20031 ; --------------------------------------------------------------------------- - 20032 - 20033 ;*** Div32 - 32 bit divide for computing ratios - 20034 ; - 20035 ; Entry DX:AX = dividend, CX:BX = divisor - 20036 ; - 20037 ; Exit DX:AX = quotient, CX:BX = reminder - 20038 - 20039 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 20040 Div32: - 20041 jcxz d32_16bit ; differently if 16bit divisor - 20042 - 20043 push si - 20044 push di + 20014 mov cx,di + 20015 mov bx,si + 20016 + 20017 call Div32 + 20018 + 20019 cr_got_tenths: + 20020 pop bx ; original quotient + 20021 mov ah,bl + 20022 + 20023 cmp al,10 ; if the tenths rounded up to the + 20024 jb short cr_exit ; next whole number, adjust the + 20025 ; whole number part and 0 the + 20026 inc ah ; tenths (i.e. round 1.97 to 2.0) + 20027 xor al,al + 20028 cr_exit: + 20029 pop di + 20030 pop si + 20031 + 20032 retn + 20033 + 20034 ; --------------------------------------------------------------------------- + 20035 + 20036 ;*** Div32 - 32 bit divide for computing ratios + 20037 ; + 20038 ; Entry DX:AX = dividend, CX:BX = divisor + 20039 ; + 20040 ; Exit DX:AX = quotient, CX:BX = reminder + 20041 + 20042 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 20043 Div32: + 20044 jcxz d32_16bit ; differently if 16bit divisor 20045 - 20046 ; Brute force divide by subtraction. This is okay because worse case - 20047 ; the dividend will only be 16 times greater, and typically about 2 - 20048 ; times - 20049 - 20050 xor si,si - 20051 mov di,si ; di:si is quotient - 20052 ;@@: - 20053 div32_1: - 20054 sub ax,bx ; subtract divisor - 20055 sbb dx,cx - 20056 jc short d32_too_far - 20057 - 20058 add si, 1 ; accumulate quotient - 20059 adc di, 0 - 20060 ;jmp short @b - 20061 jmp short div32_1 - 20062 - 20063 d32_too_far: - 20064 add ax,bx ; fix the last subtraction - 20065 adc dx,cx - 20066 - 20067 mov cx,di - 20068 mov bx,si ; dx:ax = remainder, cx:bx = quoient + 20046 push si + 20047 push di + 20048 + 20049 ; Brute force divide by subtraction. This is okay because worse case + 20050 ; the dividend will only be 16 times greater, and typically about 2 + 20051 ; times + 20052 + 20053 xor si,si + 20054 mov di,si ; di:si is quotient + 20055 ;@@: + 20056 div32_1: + 20057 sub ax,bx ; subtract divisor + 20058 sbb dx,cx + 20059 jc short d32_too_far + 20060 + 20061 add si, 1 ; accumulate quotient + 20062 adc di, 0 + 20063 ;jmp short @b + 20064 jmp short div32_1 + 20065 + 20066 d32_too_far: + 20067 add ax,bx ; fix the last subtraction + 20068 adc dx,cx 20069 - 20070 xchg ax,bx - 20071 xchg dx,cx ; dx:ax = quoient, cx:bx = remainder + 20070 mov cx,di + 20071 mov bx,si ; dx:ax = remainder, cx:bx = quoient 20072 - 20073 pop di - 20074 pop si + 20073 xchg ax,bx + 20074 xchg dx,cx ; dx:ax = quoient, cx:bx = remainder 20075 - 20076 retn - 20077 - 20078 d32_16bit: - 20079 div bx ; divide dx:ax by bx + 20076 pop di + 20077 pop si + 20078 + 20079 retn 20080 - 20081 mov bx,dx ; remainder to cx:bx - 20082 xor dx,dx ; quotient to dx:ax - 20083 mov cx,dx - 20084 retn - 20085 - 20086 ; --------------------------------------------------------------------------- - 20087 - 20088 ;*** GetDOSFATEntry - returns next cluster in file's FAT chain - 20089 ; - 20090 ; Entry AX = current cluster number - 20091 ; ES = segment of FAT buffer - 20092 ; Entry should be in FAT buffer - 20093 ; - 20094 ; Exit AX = next cluster number - 20095 ; CY set if error + 20081 d32_16bit: + 20082 div bx ; divide dx:ax by bx + 20083 + 20084 mov bx,dx ; remainder to cx:bx + 20085 xor dx,dx ; quotient to dx:ax + 20086 mov cx,dx + 20087 retn + 20088 + 20089 ; --------------------------------------------------------------------------- + 20090 + 20091 ;*** GetDOSFATEntry - returns next cluster in file's FAT chain + 20092 ; + 20093 ; Entry AX = current cluster number + 20094 ; ES = segment of FAT buffer + 20095 ; Entry should be in FAT buffer 20096 ; - 20097 ; Uses BX - 20098 - 20099 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20100 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1EF2h - 20101 GetDOSFATEntry: - 20102 sub ax,[entInBuf] ; calc entry # in buffer - 20103 jc short gdf_ret ; CY already set for error - 20104 - 20105 mov bx,ax - 20106 - 20107 ;cmp MDBPB.f12BitFAT, 0 ; 12 or 16 bit FAT? - 20108 cmp byte [MDBPB+3Dh],0 - 20109 jnz short gdf_12 ; go do 12 - 20110 - 20111 shl bx,1 ; offset = entry * 2 - 20112 add bx,[pbufDOSFAT] - 20113 mov ax,[es:bx] - 20114 ; 08/06/2023 - 20115 ; cf = 0 - 20116 ;gdf_success: - 20117 ;clc ; success - 20118 gdf_ret: - 20119 retn - 20120 - 20121 gdf_12: - 20122 shr bx,1 - 20123 add bx,ax ; offset to entry = entry * 1.5 - 20124 add bx,[pbufDOSFAT] - 20125 - 20126 ; ES:BX points to the word containing the desired 12 bit FAT entry. - 20127 ; For odd entries, the upper 12 bits are valid, for even entries - 20128 ; the low 12 bits are valid. odd: OOOx even: xEEE - 20129 - 20130 test al,1 ; is current entry odd? - 20131 - 20132 mov ax,[es:bx] ; word with FAT entry - 20133 jnz short gdf_odd + 20097 ; Exit AX = next cluster number + 20098 ; CY set if error + 20099 ; + 20100 ; Uses BX + 20101 + 20102 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20103 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1EF2h + 20104 GetDOSFATEntry: + 20105 sub ax,[entInBuf] ; calc entry # in buffer + 20106 jc short gdf_ret ; CY already set for error + 20107 + 20108 mov bx,ax + 20109 + 20110 ;cmp MDBPB.f12BitFAT, 0 ; 12 or 16 bit FAT? + 20111 cmp byte [MDBPB+3Dh],0 + 20112 jnz short gdf_12 ; go do 12 + 20113 + 20114 shl bx,1 ; offset = entry * 2 + 20115 add bx,[pbufDOSFAT] + 20116 mov ax,[es:bx] + 20117 ; 08/06/2023 + 20118 ; cf = 0 + 20119 ;gdf_success: + 20120 ;clc ; success + 20121 gdf_ret: + 20122 retn + 20123 + 20124 gdf_12: + 20125 shr bx,1 + 20126 add bx,ax ; offset to entry = entry * 1.5 + 20127 add bx,[pbufDOSFAT] + 20128 + 20129 ; ES:BX points to the word containing the desired 12 bit FAT entry. + 20130 ; For odd entries, the upper 12 bits are valid, for even entries + 20131 ; the low 12 bits are valid. odd: OOOx even: xEEE + 20132 + 20133 test al,1 ; is current entry odd? 20134 - 20135 and ax,0FFFh ; keep low 12 bits for even - 20136 jmp short gdf_testEOF + 20135 mov ax,[es:bx] ; word with FAT entry + 20136 jnz short gdf_odd 20137 - 20138 gdf_odd: - 20139 mov bx,cx ; (save cx in bx) - 20140 mov cl,4 - 20141 shr ax,cl ; upper 12 bits for odd - 20142 mov cx,bx ; (restore cx) - 20143 - 20144 gdf_testEOF: - 20145 cmp ax,0FF0h ; valid entry? - 20146 ;jb short gdf_success - 20147 cmc ; cf = 1 <--> cf = 0 - 20148 jnc short gdf_ret - 20149 - 20150 or ah,0F0h ; caller expects 16 bit special values - 20151 ;jmp short gdf_success - 20152 ; cf = 0 - 20153 retn - 20154 - 20155 ; --------------------------------------------------------------------------- - 20156 - 20157 ;*** GetMDFATEntry - returns requested MD FAT entry - 20158 ; - 20159 ; Entry AX = current DOS cluster number - 20160 ; ES = segment of FAT buffer - 20161 ; Entry should be in FAT buffer - 20162 ; - 20163 ; Exit BX:CX = corresponding MD FAT entry - 20164 ; CY set if error + 20138 and ax,0FFFh ; keep low 12 bits for even + 20139 jmp short gdf_testEOF + 20140 + 20141 gdf_odd: + 20142 mov bx,cx ; (save cx in bx) + 20143 mov cl,4 + 20144 shr ax,cl ; upper 12 bits for odd + 20145 mov cx,bx ; (restore cx) + 20146 + 20147 gdf_testEOF: + 20148 cmp ax,0FF0h ; valid entry? + 20149 ;jb short gdf_success + 20150 cmc ; cf = 1 <--> cf = 0 + 20151 jnc short gdf_ret + 20152 + 20153 or ah,0F0h ; caller expects 16 bit special values + 20154 ;jmp short gdf_success + 20155 ; cf = 0 + 20156 retn + 20157 + 20158 ; --------------------------------------------------------------------------- + 20159 + 20160 ;*** GetMDFATEntry - returns requested MD FAT entry + 20161 ; + 20162 ; Entry AX = current DOS cluster number + 20163 ; ES = segment of FAT buffer + 20164 ; Entry should be in FAT buffer 20165 ; - 20166 ; Uses None - 20167 - 20168 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 20169 GetMDFATEntry: - 20170 mov bx,ax - 20171 sub bx,[entInBuf] ; calc entry # in buffer - 20172 jc short gmf_ret ; CY already set for error return - 20173 - 20174 shl bx,1 - 20175 shl bx,1 ; * 4 bytes per MDFAT entry + 20166 ; Exit BX:CX = corresponding MD FAT entry + 20167 ; CY set if error + 20168 ; + 20169 ; Uses None + 20170 + 20171 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 20172 GetMDFATEntry: + 20173 mov bx,ax + 20174 sub bx,[entInBuf] ; calc entry # in buffer + 20175 jc short gmf_ret ; CY already set for error return 20176 - 20177 add bx,[pbufMDFAT] - 20178 mov cx,[es:bx] - 20179 mov bx,[es:bx+2] - 20180 - 20181 clc - 20182 gmf_ret: - 20183 retn - 20184 - 20185 ; --------------------------------------------------------------------------- - 20186 - 20187 ;*** CheckFATBuffers - check that target FAT entry is in FAT buffers. If - 20188 ; not, fill the buffers starting with the requested - 20189 ; entry. - 20190 ; - 20191 ; ENTRY AX = FAT entry # - 20192 ; ES = segment of FAT buffers + 20177 shl bx,1 + 20178 shl bx,1 ; * 4 bytes per MDFAT entry + 20179 + 20180 add bx,[pbufMDFAT] + 20181 mov cx,[es:bx] + 20182 mov bx,[es:bx+2] + 20183 + 20184 clc + 20185 gmf_ret: + 20186 retn + 20187 + 20188 ; --------------------------------------------------------------------------- + 20189 + 20190 ;*** CheckFATBuffers - check that target FAT entry is in FAT buffers. If + 20191 ; not, fill the buffers starting with the requested + 20192 ; entry. 20193 ; - 20194 ; EXIT FAT buffers contain target entry, or CY set if error - 20195 ; entInBuf updated + 20194 ; ENTRY AX = FAT entry # + 20195 ; ES = segment of FAT buffers 20196 ; - 20197 ; USED BX - 20198 - 20199 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20200 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1F4Bh + 20197 ; EXIT FAT buffers contain target entry, or CY set if error + 20198 ; entInBuf updated + 20199 ; + 20200 ; USED BX 20201 - 20202 CheckFATBuffers: - 20203 mov bx,ax - 20204 sub bx,[entInBuf] - 20205 jb short cfb_load_fat - 20206 - 20207 sub bx,[cFATEntries] - 20208 jae short cfb_load_fat ; jnb + 20202 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20203 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1F4Bh + 20204 + 20205 CheckFATBuffers: + 20206 mov bx,ax + 20207 sub bx,[entInBuf] + 20208 jb short cfb_load_fat 20209 - 20210 clc - 20211 retn + 20210 sub bx,[cFATEntries] + 20211 jae short cfb_load_fat ; jnb 20212 - 20213 ; Desired entry isn't in the FAT buffers, reload the buffers to - 20214 ; include it + 20213 clc + 20214 retn 20215 - 20216 cfb_load_fat: - 20217 push ax - 20218 push cx - 20219 push dx - 20220 - 20221 ; Start with the DOS FAT buffer - 20222 - 20223 xor cx,cx ; zero high offset to FAT file position - 20224 - 20225 ;cmp MDBPB.f12BitFAT, 0 ; 12 or 16 bit FAT? - 20226 cmp byte [MDBPB+3Dh],0 - 20227 jnz short cfb_12 ; go do 12 - 20228 - 20229 mov [entInBuf],ax ; this entry is first - 20230 - 20231 shl ax,1 ; 2 bytes per cluster # - 20232 rcl cx,1 ; cx:ax = offset to FAT entry + 20216 ; Desired entry isn't in the FAT buffers, reload the buffers to + 20217 ; include it + 20218 + 20219 cfb_load_fat: + 20220 push ax + 20221 push cx + 20222 push dx + 20223 + 20224 ; Start with the DOS FAT buffer + 20225 + 20226 xor cx,cx ; zero high offset to FAT file position + 20227 + 20228 ;cmp MDBPB.f12BitFAT, 0 ; 12 or 16 bit FAT? + 20229 cmp byte [MDBPB+3Dh],0 + 20230 jnz short cfb_12 ; go do 12 + 20231 + 20232 mov [entInBuf],ax ; this entry is first 20233 - 20234 jmp short cfb_common - 20235 - 20236 cfb_12: - 20237 ;and al,not 1 ; 0FEh ; start with even # entry - 20238 and al,~1 - 20239 mov [entInBuf],ax - 20240 - 20241 mov bx,ax - 20242 shr bx,1 - 20243 add ax,bx ; ax = offset to FAT entry - 20244 ; (entry # * 1.5) - 20245 cfb_common: - 20246 mov bx,ax ; cx:bx = offset to FAT entry - 20247 - 20248 ;mov ax,[MDBPB.csecMDReserved] ; # magicDrv reserved sectors - 20249 mov ax,[MDBPB+27h] - 20250 ;add ax,[MDBPB.dos_bpb.csecReserved] - 20251 add ax,[MDBPB+0Eh] - 20252 - 20253 ;mul word [MDBPB.dos_bpb.cbPerSec] - 20254 mul word [MDBPB+0Bh] ; DX:AX = DOS FAT file origin - 20255 add ax,bx - 20256 adc dx,cx ; DX:AX = file offset to read from - 20257 - 20258 mov cx,[cFATEntries] ; size to read - 20259 shl cx,1 - 20260 mov bx,[pbufDOSFAT] ; es:bx = location to read - 20261 - 20262 call ReadCVFile - 20263 jc short cfb_error + 20234 shl ax,1 ; 2 bytes per cluster # + 20235 rcl cx,1 ; cx:ax = offset to FAT entry + 20236 + 20237 jmp short cfb_common + 20238 + 20239 cfb_12: + 20240 ;and al,not 1 ; 0FEh ; start with even # entry + 20241 and al,~1 + 20242 mov [entInBuf],ax + 20243 + 20244 mov bx,ax + 20245 shr bx,1 + 20246 add ax,bx ; ax = offset to FAT entry + 20247 ; (entry # * 1.5) + 20248 cfb_common: + 20249 mov bx,ax ; cx:bx = offset to FAT entry + 20250 + 20251 ;mov ax,[MDBPB.csecMDReserved] ; # magicDrv reserved sectors + 20252 mov ax,[MDBPB+27h] + 20253 ;add ax,[MDBPB.dos_bpb.csecReserved] + 20254 add ax,[MDBPB+0Eh] + 20255 + 20256 ;mul word [MDBPB.dos_bpb.cbPerSec] + 20257 mul word [MDBPB+0Bh] ; DX:AX = DOS FAT file origin + 20258 add ax,bx + 20259 adc dx,cx ; DX:AX = file offset to read from + 20260 + 20261 mov cx,[cFATEntries] ; size to read + 20262 shl cx,1 + 20263 mov bx,[pbufDOSFAT] ; es:bx = location to read 20264 - 20265 ; Now read the corresponding MagicDrv FAT entries - 20266 - 20267 ;mov ax,[MDBPB.secMDFATStart] - 20268 mov ax,[MDBPB+24h] - 20269 inc ax - 20270 ;mul word [MDBPB.dos_bpb.cbPerSec] - 20271 mul word [MDBPB+0Bh] ; DX:AX = MDFAT file offset - 20272 - 20273 mov bx,[entInBuf] - 20274 xor cx,cx ; CX:BX = 32 bit cluster # - 20275 ;add bx,[MDBPB.cluFirstData] - 20276 add bx,[MDBPB+2Dh] - 20277 adc cx,cx ; CX:BX = MDFAT entry # - 20278 - 20279 shl bx,1 - 20280 rcl cx,1 - 20281 shl bx,1 - 20282 rcl cx,1 ; * 4 bytes per MDFAT entry - 20283 - 20284 add ax,bx - 20285 adc dx,cx ; DX:AX = file offset of MDFAT entry + 20265 call ReadCVFile + 20266 jc short cfb_error + 20267 + 20268 ; Now read the corresponding MagicDrv FAT entries + 20269 + 20270 ;mov ax,[MDBPB.secMDFATStart] + 20271 mov ax,[MDBPB+24h] + 20272 inc ax + 20273 ;mul word [MDBPB.dos_bpb.cbPerSec] + 20274 mul word [MDBPB+0Bh] ; DX:AX = MDFAT file offset + 20275 + 20276 mov bx,[entInBuf] + 20277 xor cx,cx ; CX:BX = 32 bit cluster # + 20278 ;add bx,[MDBPB.cluFirstData] + 20279 add bx,[MDBPB+2Dh] + 20280 adc cx,cx ; CX:BX = MDFAT entry # + 20281 + 20282 shl bx,1 + 20283 rcl cx,1 + 20284 shl bx,1 + 20285 rcl cx,1 ; * 4 bytes per MDFAT entry 20286 - 20287 mov cx,[cFATEntries] - 20288 shl cx,1 - 20289 shl cx,1 ; size to read - 20290 mov bx,[pbufMDFAT] ; es:bx = location to read into - 20291 - 20292 call ReadCVFile - 20293 ;jnc short cfb_ret ; cf = 0 ; 08/06/2023 - 20294 ; 08/06/2023 - 20295 ; cf = 1 - 20296 cfb_error: - 20297 ;stc - 20298 cfb_ret: - 20299 pop dx - 20300 pop cx - 20301 pop ax - 20302 retn - 20303 - 20304 ; --------------------------------------------------------------------------- - 20305 - 20306 ;*** ReadCVFile - read from the Compressed Volume File - 20307 ; - 20308 ; Entry DX:AX file offset, ES:BX buffer location, CX length in bytes - 20309 ; - 20310 ; Exit CY set if error, else data read - 20311 ; - 20312 ; Uses AX, BX, CX, DX - 20313 - 20314 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 20315 ReadCVFile: - 20316 push bx ; save buffer loc - 20317 push cx ; save read length - 20318 - 20319 mov cx,dx - 20320 mov dx,ax ; cx:dx = file offset of fat entry - 20321 ;mov ax,(LSEEK shl 8) or 0 - 20322 mov ax,4200h - 20323 mov bx,[fhCVF] - 20324 int 21h - 20325 jc short rcf_ret ; CY set for error return - 20326 - 20327 ;mov ah,READ - 20328 mov ah,3Fh - 20329 pop cx ; read length - 20330 pop dx ; buffer loc offset - 20331 push ds - 20332 push es - 20333 pop ds ; buffer loc segment - 20334 int 21h - 20335 pop ds - 20336 jc short rcf_ret ; CY set for error return - 20337 - 20338 cmp ax,cx ; read it all? - 20339 ;je short rcf_ret ; yes, CY clear - 20340 ; 08/06/2023 - 20341 ; ax < cx - 20342 ;stc ; end-of-file? - 20343 rcf_ret: - 20344 retn - 20345 - 20346 %endif - 20347 - 20348 ;============================================================================ - 20349 ; TCMD1B.ASM, MSDOS 6.0, 1991 - 20350 ;============================================================================ - 20351 ; 09/10/2018 - Retro DOS v3.0 - 20352 - 20353 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1195h - 20354 - 20355 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 20356 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 1A4Ah + 20287 add ax,bx + 20288 adc dx,cx ; DX:AX = file offset of MDFAT entry + 20289 + 20290 mov cx,[cFATEntries] + 20291 shl cx,1 + 20292 shl cx,1 ; size to read + 20293 mov bx,[pbufMDFAT] ; es:bx = location to read into + 20294 + 20295 call ReadCVFile + 20296 ;jnc short cfb_ret ; cf = 0 ; 08/06/2023 + 20297 ; 08/06/2023 + 20298 ; cf = 1 + 20299 cfb_error: + 20300 ;stc + 20301 cfb_ret: + 20302 pop dx + 20303 pop cx + 20304 pop ax + 20305 retn + 20306 + 20307 ; --------------------------------------------------------------------------- + 20308 + 20309 ;*** ReadCVFile - read from the Compressed Volume File + 20310 ; + 20311 ; Entry DX:AX file offset, ES:BX buffer location, CX length in bytes + 20312 ; + 20313 ; Exit CY set if error, else data read + 20314 ; + 20315 ; Uses AX, BX, CX, DX + 20316 + 20317 ; 08/06/2023 - Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 20318 ReadCVFile: + 20319 push bx ; save buffer loc + 20320 push cx ; save read length + 20321 + 20322 mov cx,dx + 20323 mov dx,ax ; cx:dx = file offset of fat entry + 20324 ;mov ax,(LSEEK shl 8) or 0 + 20325 mov ax,4200h + 20326 mov bx,[fhCVF] + 20327 int 21h + 20328 jc short rcf_ret ; CY set for error return + 20329 + 20330 ;mov ah,READ + 20331 mov ah,3Fh + 20332 pop cx ; read length + 20333 pop dx ; buffer loc offset + 20334 push ds + 20335 push es + 20336 pop ds ; buffer loc segment + 20337 int 21h + 20338 pop ds + 20339 jc short rcf_ret ; CY set for error return + 20340 + 20341 cmp ax,cx ; read it all? + 20342 ;je short rcf_ret ; yes, CY clear + 20343 ; 08/06/2023 + 20344 ; ax < cx + 20345 ;stc ; end-of-file? + 20346 rcf_ret: + 20347 retn + 20348 + 20349 %endif + 20350 + 20351 ;============================================================================ + 20352 ; TCMD1B.ASM, MSDOS 6.0, 1991 + 20353 ;============================================================================ + 20354 ; 09/10/2018 - Retro DOS v3.0 + 20355 + 20356 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1195h 20357 - 20358 ; =============== S U B R O U T I N E ======================================= - 20359 - 20360 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20361 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1FF4h + 20358 ; 19/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 20359 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 1A4Ah + 20360 + 20361 ; =============== S U B R O U T I N E ======================================= 20362 - 20363 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 20364 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1DCCh - 20365 PAUSE: - 20366 00001D00 BA[A490] mov dx,PAUSEMES_PTR ; 19/02/2023 - 20367 00001D03 E82237 call std_printf - 20368 00001D06 E859E9 call GETKEYSTROKE - 20369 ;call CRLF2 - 20370 ;retn - 20371 ; 19/02/2023 - 20372 00001D09 E96D0C jmp CRLF2 - 20373 - 20374 ; --------------------------------------------------------------------------- - 20375 - 20376 ;**************************************************************** - 20377 ;* - 20378 ;* ROUTINE: DEL/ERASE - erase file(s) - 20379 ;* - 20380 ;* FUNCTION: PARSE command line for file or path name and /P - 20381 ;* and invoke PATHCRUNCH. If an error occurs, set - 20382 ;* up an error message and transfer control to CERROR. - 20383 ;* Otherwise, transfer control to NOTEST2 if /P not - 20384 ;* entered or SLASHP_ERASE if /P entered. - 20385 ;* - 20386 ;* INPUT: command line at offset 81H - 20387 ;* - 20388 ;* OUTPUT: if no error: - 20389 ;* FCB at 5ch set up with filename(s) entered - 20390 ;* Current directory set to entered directory - 20391 ;* - 20392 ;**************************************************************** - 20393 - 20394 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 20395 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A57h + 20363 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20364 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:1FF4h + 20365 + 20366 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 20367 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1DCCh + 20368 PAUSE: + 20369 00001D00 BA[A490] mov dx,PAUSEMES_PTR ; 19/02/2023 + 20370 00001D03 E82237 call std_printf + 20371 00001D06 E859E9 call GETKEYSTROKE + 20372 ;call CRLF2 + 20373 ;retn + 20374 ; 19/02/2023 + 20375 00001D09 E96D0C jmp CRLF2 + 20376 + 20377 ; --------------------------------------------------------------------------- + 20378 + 20379 ;**************************************************************** + 20380 ;* + 20381 ;* ROUTINE: DEL/ERASE - erase file(s) + 20382 ;* + 20383 ;* FUNCTION: PARSE command line for file or path name and /P + 20384 ;* and invoke PATHCRUNCH. If an error occurs, set + 20385 ;* up an error message and transfer control to CERROR. + 20386 ;* Otherwise, transfer control to NOTEST2 if /P not + 20387 ;* entered or SLASHP_ERASE if /P entered. + 20388 ;* + 20389 ;* INPUT: command line at offset 81H + 20390 ;* + 20391 ;* OUTPUT: if no error: + 20392 ;* FCB at 5ch set up with filename(s) entered + 20393 ;* Current directory set to entered directory + 20394 ;* + 20395 ;**************************************************************** 20396 - 20397 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20398 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2001h + 20397 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 20398 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1A57h 20399 - 20400 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 20401 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1DD9h - 20402 ERASE: - 20403 ; MSDOS 6.0 - 20404 - 20405 ;assume ds:trangroup,es:trangroup - 20406 - 20407 00001D0C BE8100 mov si,81h ;AC000; get command line - 20408 00001D0F C706[0B9C]0000 mov word [COMSW],0 ;AN000; clear switch indicator - 20409 00001D15 BF[9A96] mov di,PARSE_ERASE - 20410 ;AN000; Get address of PARSE_ERASE - 20411 00001D18 31C9 xor cx,cx ;AN000; clear cx,dx - 20412 erase_scan: - 20413 00001D1A 31D2 xor dx,dx ;AN000; - 20414 00001D1C E83C08 call Parse_With_Msg ;AC018; call parser - 20415 - 20416 ;cmp ax,-1 ; 0FFFFh - 20417 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? - 20418 ;je short good_line ;AN000; yes - done parsing - 20419 ;;cmp ax,0 - 20420 ;;cmp ax,RESULT_NO_ERROR ; 0 - 20421 ;and ax,ax ;AC000; did we have an error? - 20422 ;jnz short errj2 ;AC000; yes exit - 20423 ; 10/06/2023 - 20424 00001D1F 40 inc ax ; cmp ax,-1 - 20425 00001D20 743C jz short good_line ; 0FFFFh -> 0 - 20426 00001D22 48 dec ax ; cmp ax,0 - 20427 00001D23 7566 jnz short errj2 ; 1 -> 0 - 20428 ; ax = 0 - 20429 - 20430 00001D25 813E[EDA5][0D96] cmp word [PARSE1_SYN],SLASH_P_SYN ; "/P" - 20431 ;AN000; was /P entered? - 20432 00001D2B 741C je short set_erase_prompt - 20433 ;AN000; yes - go set prompt - 20434 ; - 20435 ; Must be filespec since no other matches occurred. move filename to srcbuf - 20436 ; - 20437 00001D2D 56 push si ;AC000; save position in line - 20438 00001D2E C536[EFA5] lds si,[PARSE1_ADDR] - 20439 ;AC000; get address of filespec - 20440 ;cmp byte [si+1],colon_char - 20441 00001D32 807C013A cmp byte [si+1],':' ;AC000; drive specified? - 20442 00001D36 750B jne short erase_drive_ok - 20443 ;AC000; no - continue - 20444 ;cmp byte [si+2],END_OF_LINE_OUT - 20445 00001D38 807C0200 cmp byte [si+2],0 ;AC000; was only drive entered? - 20446 00001D3C 7505 jne short erase_drive_ok - 20447 ;AC000; no - continue - 20448 00001D3E B80200 mov ax,ERROR_FILE_NOT_FOUND ; 2 - 20449 ;AN022; get message number in control block - 20450 00001D41 EB3D jmp short extend_setup - 20451 ;AC000; exit - 20452 erase_drive_ok: - 20453 00001D43 E89213 call Move_To_SrcBuf ;AC000; move to srcbuf - 20454 00001D46 5E pop si ;AC000; get position back - 20455 00001D47 EBD1 jmp short erase_scan - 20456 ;AN000; continue parsing - 20457 set_erase_prompt: - 20458 00001D49 833E[0B9C]00 cmp word [COMSW],0 ;AN018; was /P already entered? - 20459 00001D4E 7408 jz short ok_to_set_erase_prompt - 20460 ;AN018; no go set switch - 20461 ;mov ax,1 - 20462 00001D50 B80100 mov ax,MoreArgs_Ptr - 20463 ;AN018; set up too many arguments - 20464 00001D53 E81408 call setup_parse_error_msg - 20465 ;AN018; set up an error message - 20466 00001D56 EB33 jmp short errj2 ;AN018; exit - 20467 - 20468 ok_to_set_erase_prompt: ;AN018; - 20469 00001D58 FF06[0B9C] inc word [COMSW] ;AN000; indicate /p specified - 20470 00001D5C EBBC jmp short erase_scan - 20471 ;AN000; continue parsing - 20472 good_line: ;G We know line is good - 20473 00001D5E E8C10C call PathCrunch - 20474 00001D61 730D jnc short checkdr - 20475 00001D63 A1[349F] mov ax,[Msg_Numb] ;AN022; get message number - 20476 ;cmp ax,0 ;AN022; was message flag set? - 20477 00001D66 09C0 or ax,ax - 20478 00001D68 7516 jnz short extend_setup - 20479 ;AN022; yes - print out message - 20480 ;cmp byte [DestIsDir],0 - 20481 00001D6A 3806[B99D] cmp [DestIsDir],al ; No CHDIRs worked - 20482 00001D6E 750D jnz short badpath_err - 20483 ;AC022; see if they should have - 20484 checkdr: - 20485 00001D70 833E[0B9C]00 cmp word [COMSW],0 ;AN000; was /p specified - 20486 00001D75 7403 jz short notest2j ;AN000; no - go to notest2 - 20487 00001D77 E9FB1B jmp slashp_erase ;AN000; yes - go to slashp_erase - 20488 notest2j: - 20489 00001D7A E9931B jmp notest2 - 20490 - 20491 badpath_err: ;AN022; "Path not found" message - 20492 00001D7D B80300 mov ax,ERROR_PATH_NOT_FOUND ; 3 - 20493 ;AN022; set up error number - 20494 extend_setup: ;AN022; - 20495 ;mov byte [msg_disp_class],1 - 20496 00001D80 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 20497 ;AN022; set up extended error msg class - 20498 00001D85 BA[D78F] mov dx,extend_buf_ptr - 20499 ;AC022; get extended message pointer - 20500 00001D88 A3[D78F] mov [extend_buf_ptr],ax - 20501 ;AN022; get message number in control block - 20502 errj2: ;AC022; exit jump - 20503 00001D8B E9980F jmp cerror ;AN022; - 20504 - 20505 ; --------------------------------------------------------------------------- - 20506 - 20507 ; **************************************************************** - 20508 ; * - 20509 ; * ROUTINE: CRENAME - rename file(s) - 20510 ; * - 20511 ; * FUNCTION: PARSE command line for one full filespec and one - 20512 ; * filename. Invoke PATHCRUNCH on the full filespec. - 20513 ; * Make sure the second filespec only contains a - 20514 ; * filename. If both openands are valid, attempt - 20515 ; * to rename the file. - 20516 ; * - 20517 ; * INPUT: command line at offset 81H - 20518 ; * - 20519 ; * OUTPUT: none - 20520 ; * - 20521 ; **************************************************************** - 20522 - 20523 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 20524 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20525 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 20526 CRENAME: - 20527 ; MSDOS 6.0 - 20528 ;assume ds:trangroup,es:trangroup - 20529 - 20530 00001D8E BE8100 mov si,81h ;AC000; Point to command line - 20531 00001D91 BF[2797] mov di,PARSE_RENAME - 20532 ;AN000; Get address of PARSE_RENAME - 20533 00001D94 31C9 xor cx,cx ;AN000; clear cx,dx - 20534 00001D96 31D2 xor dx,dx ;AN000; - 20535 00001D98 E8C007 call Parse_With_Msg ;AC018; call parser - 20536 ;cmp ax,RESULT_NO_ERROR ; 0 - 20537 00001D9B 09C0 or ax,ax ; 0 ? ;AC000; did we have an error? - 20538 ; jz short crename_no_parse_error - 20539 ;AC000; no - continue - 20540 00001D9D 752C jnz short crename_parse_error - 20541 ;AC000; Yes, fail. (need long jump) - 20542 ; - 20543 ; Get first file name returned from parse into our buffer - 20544 ; - 20545 crename_no_parse_error: - 20546 00001D9F 56 push si ;AN000; save position in line - 20547 00001DA0 C536[EFA5] lds si,[PARSE1_ADDR] - 20548 ;AN000; get address of filespec - 20549 00001DA4 E83113 call Move_To_SrcBuf ;AN000; move to srcbuf - 20550 00001DA7 5E pop si ;AN000; restore position in line - 20551 - 20552 00001DA8 31D2 xor dx,dx ;AN000; clear dx - 20553 00001DAA E8AE07 call Parse_With_Msg ;AC018; call parser - 20554 ;cmp ax,RESULT_NO_ERROR - 20555 00001DAD 21C0 and ax,ax ; 0 ? ;AN000; did we have an error? - 20556 00001DAF 751A jnz short crename_parse_error - 20557 ;AN000; Yes, fail. - 20558 ; - 20559 ; Check the second file name for drive letter colon - 20560 ; - 20561 00001DB1 56 push si ;AN000; save position in line - 20562 00001DB2 C536[EFA5] lds si,[PARSE1_ADDR] - 20563 ;AC000; get address of path - 20564 ;mov al,':' ;AC000; - 20565 ;cmp [si+1],al ;AC000; Does the 2nd parm have a drive spec? - 20566 00001DB6 807C013A cmp byte [si+1],':' - 20567 00001DBA 7511 jnz short ren_no_drive - 20568 ;AN000; Yes, error - 20569 ;mov byte [msg_disp_class],2 - 20570 00001DBC C606[D58F]02 mov byte [msg_disp_class],parse_msg_class - 20571 ;AN000; set up parse error msg class - 20572 00001DC1 BA[D78F] mov dx,extend_buf_ptr - 20573 ;AC000; get extended message pointer - 20574 ;mov word [extend_buf_ptr],0Ah - 20575 00001DC4 C706[D78F]0A00 mov word [extend_buf_ptr],BadParm_Ptr - 20576 ;AN000; get "Invalid parameter" message number - 20577 00001DCA 5E pop si ;AN000; - 20578 crename_parse_error: ;AC022; - 20579 00001DCB EB64 jmp short errj ;AC000; - 20580 - 20581 ; Get second file name returned from parse into the fCB. Save - 20582 ; character after file name so we can later check to make sure it - 20583 ; isn't a path character. - 20584 - 20585 ren_no_drive: - 20586 00001DCD BF6C00 mov di,FCB+10h ; 6Ch - 20587 ;AC000; set up to parse second file name - 20588 ;mov ax,(Parse_File_Descriptor SHL 8) OR 01H ;AC000; - 20589 00001DD0 B80129 mov ax,2901h - 20590 00001DD3 CD21 int 21h ;AC000; do the function - 20591 00001DD5 AC lodsb ;AC000; Load char after filename - 20592 00001DD6 A2[B19D] mov [One_Char_Val],al - 20593 ;AN000; save char after filename - 20594 00001DD9 5E pop si ;AN000; get line position back - 20595 ; - 20596 ; We have source and target. See if any args beyond. - 20597 ; - 20598 00001DDA BF[2797] mov di,PARSE_RENAME - 20599 ;AC000; get address of parse_rename - 20600 00001DDD E86507 call parse_check_eol ;AC000; are we at end of line? - 20601 00001DE0 75E9 jnz short crename_parse_error - 20602 ;AN000; no, fail. - 20603 00001DE2 E83D0C call PathCrunch - 20604 00001DE5 BA[E88F] mov dx,BADCPMES_PTR - 20605 00001DE8 74A1 jz short errj2 ; If 1st parm a dir, print error msg - 20606 00001DEA 730F jnc short notest3 - 20607 00001DEC A1[349F] mov ax,[Msg_Numb] ;AN022; get message number - 20608 ;cmp ax,0 ;AN022; was message flag set? - 20609 00001DEF 21C0 and ax,ax ; 0 ? - 20610 00001DF1 758D jnz short extend_setup - 20611 ;AN022; yes - print out message - 20612 ;cmp byte [DestIsDir],0 - 20613 00001DF3 3806[B99D] cmp [DestIsDir],al ; No CHDIRs worked - 20614 00001DF7 7402 jz short notest3 ; see if they should have - 20615 00001DF9 EB82 Jmp badpath_err ;AC022; set up error - 20616 notest3: - 20617 00001DFB A0[B19D] mov al,[One_Char_Val] - 20618 ;AN000; move char into AX - 20619 00001DFE BA[0990] mov dx,INORNOT_PTR - 20620 ; Load invalid fname error ptr - 20621 00001E01 E8100C call pathchrcmp ; Is the char in al a path sep? - 20622 00001E04 742B jz short errj ; Yes, error - 2nd arg must be - 20623 ; filename only. - 20624 ;mov ah,FCB_Rename - 20625 00001E06 B417 mov ah,17h - 20626 00001E08 BA5C00 mov dx,FCB ; 5Ch - 20627 00001E0B CD21 int 21h - 20628 00001E0D 3CFF cmp al,0FFh ; Did an error occur?? - 20629 00001E0F 7506 jne short renameok - 20630 - 20631 00001E11 E83702 call get_ext_error_number - 20632 ;AN022; get extended error - 20633 00001E14 50 push ax ;AC022; Save results - 20634 00001E15 B0FF mov al,0FFh ; Restore original error state - 20635 renameok: - 20636 00001E17 50 push ax - 20637 00001E18 E8150A call RestUDir - 20638 00001E1B 58 pop ax - 20639 00001E1C FEC0 inc al - 20640 ;;retnz - 20641 ;jz short rn1 - 20642 ;retn - 20643 00001E1E 7514 jnz short ret56 - 20644 rn1: - 20645 00001E20 58 pop ax ;AC022; get the error number back - 20646 00001E21 83F802 cmp ax,ERROR_FILE_NOT_FOUND ; 2 - 20647 ;AN022; error file not found? - 20648 00001E24 7408 je short use_renerr - 20649 ;AN022; yes - use generic error message - 20650 00001E26 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 - 20651 ;AN022; error file not found? - 20652 00001E29 7403 je short use_renerr - 20653 ;AN022; yes - use generic error message - 20654 00001E2B E952FF jmp extend_setup ;AN022; need long jump - use extended error - 20655 - 20656 use_renerr: - 20657 00001E2E BA[E58F] mov dx,RENERR_PTR ;AC022; - 20658 errj: - 20659 00001E31 E9F20E jmp cerror - 20660 ret56: - 20661 ;typefil_ret: ; 20/02/2023 ; 17/04/2023 - 20662 00001E34 C3 retn - 20663 - 20664 ; --------------------------------------------------------------------------- - 20665 - 20666 ;**************************************************************** - 20667 ;* - 20668 ;* ROUTINE: TYPEFIL - Display the contents of a file to the - 20669 ;* standard output device + 20400 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20401 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2001h + 20402 + 20403 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 20404 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:1DD9h + 20405 ERASE: + 20406 ; MSDOS 6.0 + 20407 + 20408 ;assume ds:trangroup,es:trangroup + 20409 + 20410 00001D0C BE8100 mov si,81h ;AC000; get command line + 20411 00001D0F C706[0B9C]0000 mov word [COMSW],0 ;AN000; clear switch indicator + 20412 00001D15 BF[9A96] mov di,PARSE_ERASE + 20413 ;AN000; Get address of PARSE_ERASE + 20414 00001D18 31C9 xor cx,cx ;AN000; clear cx,dx + 20415 erase_scan: + 20416 00001D1A 31D2 xor dx,dx ;AN000; + 20417 00001D1C E83C08 call Parse_With_Msg ;AC018; call parser + 20418 + 20419 ;cmp ax,-1 ; 0FFFFh + 20420 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? + 20421 ;je short good_line ;AN000; yes - done parsing + 20422 ;;cmp ax,0 + 20423 ;;cmp ax,RESULT_NO_ERROR ; 0 + 20424 ;and ax,ax ;AC000; did we have an error? + 20425 ;jnz short errj2 ;AC000; yes exit + 20426 ; 10/06/2023 + 20427 00001D1F 40 inc ax ; cmp ax,-1 + 20428 00001D20 743C jz short good_line ; 0FFFFh -> 0 + 20429 00001D22 48 dec ax ; cmp ax,0 + 20430 00001D23 7566 jnz short errj2 ; 1 -> 0 + 20431 ; ax = 0 + 20432 + 20433 00001D25 813E[EDA5][0D96] cmp word [PARSE1_SYN],SLASH_P_SYN ; "/P" + 20434 ;AN000; was /P entered? + 20435 00001D2B 741C je short set_erase_prompt + 20436 ;AN000; yes - go set prompt + 20437 ; + 20438 ; Must be filespec since no other matches occurred. move filename to srcbuf + 20439 ; + 20440 00001D2D 56 push si ;AC000; save position in line + 20441 00001D2E C536[EFA5] lds si,[PARSE1_ADDR] + 20442 ;AC000; get address of filespec + 20443 ;cmp byte [si+1],colon_char + 20444 00001D32 807C013A cmp byte [si+1],':' ;AC000; drive specified? + 20445 00001D36 750B jne short erase_drive_ok + 20446 ;AC000; no - continue + 20447 ;cmp byte [si+2],END_OF_LINE_OUT + 20448 00001D38 807C0200 cmp byte [si+2],0 ;AC000; was only drive entered? + 20449 00001D3C 7505 jne short erase_drive_ok + 20450 ;AC000; no - continue + 20451 00001D3E B80200 mov ax,ERROR_FILE_NOT_FOUND ; 2 + 20452 ;AN022; get message number in control block + 20453 00001D41 EB3D jmp short extend_setup + 20454 ;AC000; exit + 20455 erase_drive_ok: + 20456 00001D43 E89213 call Move_To_SrcBuf ;AC000; move to srcbuf + 20457 00001D46 5E pop si ;AC000; get position back + 20458 00001D47 EBD1 jmp short erase_scan + 20459 ;AN000; continue parsing + 20460 set_erase_prompt: + 20461 00001D49 833E[0B9C]00 cmp word [COMSW],0 ;AN018; was /P already entered? + 20462 00001D4E 7408 jz short ok_to_set_erase_prompt + 20463 ;AN018; no go set switch + 20464 ;mov ax,1 + 20465 00001D50 B80100 mov ax,MoreArgs_Ptr + 20466 ;AN018; set up too many arguments + 20467 00001D53 E81408 call setup_parse_error_msg + 20468 ;AN018; set up an error message + 20469 00001D56 EB33 jmp short errj2 ;AN018; exit + 20470 + 20471 ok_to_set_erase_prompt: ;AN018; + 20472 00001D58 FF06[0B9C] inc word [COMSW] ;AN000; indicate /p specified + 20473 00001D5C EBBC jmp short erase_scan + 20474 ;AN000; continue parsing + 20475 good_line: ;G We know line is good + 20476 00001D5E E8C10C call PathCrunch + 20477 00001D61 730D jnc short checkdr + 20478 00001D63 A1[349F] mov ax,[Msg_Numb] ;AN022; get message number + 20479 ;cmp ax,0 ;AN022; was message flag set? + 20480 00001D66 09C0 or ax,ax + 20481 00001D68 7516 jnz short extend_setup + 20482 ;AN022; yes - print out message + 20483 ;cmp byte [DestIsDir],0 + 20484 00001D6A 3806[B99D] cmp [DestIsDir],al ; No CHDIRs worked + 20485 00001D6E 750D jnz short badpath_err + 20486 ;AC022; see if they should have + 20487 checkdr: + 20488 00001D70 833E[0B9C]00 cmp word [COMSW],0 ;AN000; was /p specified + 20489 00001D75 7403 jz short notest2j ;AN000; no - go to notest2 + 20490 00001D77 E9FB1B jmp slashp_erase ;AN000; yes - go to slashp_erase + 20491 notest2j: + 20492 00001D7A E9931B jmp notest2 + 20493 + 20494 badpath_err: ;AN022; "Path not found" message + 20495 00001D7D B80300 mov ax,ERROR_PATH_NOT_FOUND ; 3 + 20496 ;AN022; set up error number + 20497 extend_setup: ;AN022; + 20498 ;mov byte [msg_disp_class],1 + 20499 00001D80 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 20500 ;AN022; set up extended error msg class + 20501 00001D85 BA[D78F] mov dx,extend_buf_ptr + 20502 ;AC022; get extended message pointer + 20503 00001D88 A3[D78F] mov [extend_buf_ptr],ax + 20504 ;AN022; get message number in control block + 20505 errj2: ;AC022; exit jump + 20506 00001D8B E9980F jmp cerror ;AN022; + 20507 + 20508 ; --------------------------------------------------------------------------- + 20509 + 20510 ; **************************************************************** + 20511 ; * + 20512 ; * ROUTINE: CRENAME - rename file(s) + 20513 ; * + 20514 ; * FUNCTION: PARSE command line for one full filespec and one + 20515 ; * filename. Invoke PATHCRUNCH on the full filespec. + 20516 ; * Make sure the second filespec only contains a + 20517 ; * filename. If both openands are valid, attempt + 20518 ; * to rename the file. + 20519 ; * + 20520 ; * INPUT: command line at offset 81H + 20521 ; * + 20522 ; * OUTPUT: none + 20523 ; * + 20524 ; **************************************************************** + 20525 + 20526 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 20527 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20528 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 20529 CRENAME: + 20530 ; MSDOS 6.0 + 20531 ;assume ds:trangroup,es:trangroup + 20532 + 20533 00001D8E BE8100 mov si,81h ;AC000; Point to command line + 20534 00001D91 BF[2797] mov di,PARSE_RENAME + 20535 ;AN000; Get address of PARSE_RENAME + 20536 00001D94 31C9 xor cx,cx ;AN000; clear cx,dx + 20537 00001D96 31D2 xor dx,dx ;AN000; + 20538 00001D98 E8C007 call Parse_With_Msg ;AC018; call parser + 20539 ;cmp ax,RESULT_NO_ERROR ; 0 + 20540 00001D9B 09C0 or ax,ax ; 0 ? ;AC000; did we have an error? + 20541 ; jz short crename_no_parse_error + 20542 ;AC000; no - continue + 20543 00001D9D 752C jnz short crename_parse_error + 20544 ;AC000; Yes, fail. (need long jump) + 20545 ; + 20546 ; Get first file name returned from parse into our buffer + 20547 ; + 20548 crename_no_parse_error: + 20549 00001D9F 56 push si ;AN000; save position in line + 20550 00001DA0 C536[EFA5] lds si,[PARSE1_ADDR] + 20551 ;AN000; get address of filespec + 20552 00001DA4 E83113 call Move_To_SrcBuf ;AN000; move to srcbuf + 20553 00001DA7 5E pop si ;AN000; restore position in line + 20554 + 20555 00001DA8 31D2 xor dx,dx ;AN000; clear dx + 20556 00001DAA E8AE07 call Parse_With_Msg ;AC018; call parser + 20557 ;cmp ax,RESULT_NO_ERROR + 20558 00001DAD 21C0 and ax,ax ; 0 ? ;AN000; did we have an error? + 20559 00001DAF 751A jnz short crename_parse_error + 20560 ;AN000; Yes, fail. + 20561 ; + 20562 ; Check the second file name for drive letter colon + 20563 ; + 20564 00001DB1 56 push si ;AN000; save position in line + 20565 00001DB2 C536[EFA5] lds si,[PARSE1_ADDR] + 20566 ;AC000; get address of path + 20567 ;mov al,':' ;AC000; + 20568 ;cmp [si+1],al ;AC000; Does the 2nd parm have a drive spec? + 20569 00001DB6 807C013A cmp byte [si+1],':' + 20570 00001DBA 7511 jnz short ren_no_drive + 20571 ;AN000; Yes, error + 20572 ;mov byte [msg_disp_class],2 + 20573 00001DBC C606[D58F]02 mov byte [msg_disp_class],parse_msg_class + 20574 ;AN000; set up parse error msg class + 20575 00001DC1 BA[D78F] mov dx,extend_buf_ptr + 20576 ;AC000; get extended message pointer + 20577 ;mov word [extend_buf_ptr],0Ah + 20578 00001DC4 C706[D78F]0A00 mov word [extend_buf_ptr],BadParm_Ptr + 20579 ;AN000; get "Invalid parameter" message number + 20580 00001DCA 5E pop si ;AN000; + 20581 crename_parse_error: ;AC022; + 20582 00001DCB EB64 jmp short errj ;AC000; + 20583 + 20584 ; Get second file name returned from parse into the fCB. Save + 20585 ; character after file name so we can later check to make sure it + 20586 ; isn't a path character. + 20587 + 20588 ren_no_drive: + 20589 00001DCD BF6C00 mov di,FCB+10h ; 6Ch + 20590 ;AC000; set up to parse second file name + 20591 ;mov ax,(Parse_File_Descriptor SHL 8) OR 01H ;AC000; + 20592 00001DD0 B80129 mov ax,2901h + 20593 00001DD3 CD21 int 21h ;AC000; do the function + 20594 00001DD5 AC lodsb ;AC000; Load char after filename + 20595 00001DD6 A2[B19D] mov [One_Char_Val],al + 20596 ;AN000; save char after filename + 20597 00001DD9 5E pop si ;AN000; get line position back + 20598 ; + 20599 ; We have source and target. See if any args beyond. + 20600 ; + 20601 00001DDA BF[2797] mov di,PARSE_RENAME + 20602 ;AC000; get address of parse_rename + 20603 00001DDD E86507 call parse_check_eol ;AC000; are we at end of line? + 20604 00001DE0 75E9 jnz short crename_parse_error + 20605 ;AN000; no, fail. + 20606 00001DE2 E83D0C call PathCrunch + 20607 00001DE5 BA[E88F] mov dx,BADCPMES_PTR + 20608 00001DE8 74A1 jz short errj2 ; If 1st parm a dir, print error msg + 20609 00001DEA 730F jnc short notest3 + 20610 00001DEC A1[349F] mov ax,[Msg_Numb] ;AN022; get message number + 20611 ;cmp ax,0 ;AN022; was message flag set? + 20612 00001DEF 21C0 and ax,ax ; 0 ? + 20613 00001DF1 758D jnz short extend_setup + 20614 ;AN022; yes - print out message + 20615 ;cmp byte [DestIsDir],0 + 20616 00001DF3 3806[B99D] cmp [DestIsDir],al ; No CHDIRs worked + 20617 00001DF7 7402 jz short notest3 ; see if they should have + 20618 00001DF9 EB82 Jmp badpath_err ;AC022; set up error + 20619 notest3: + 20620 00001DFB A0[B19D] mov al,[One_Char_Val] + 20621 ;AN000; move char into AX + 20622 00001DFE BA[0990] mov dx,INORNOT_PTR + 20623 ; Load invalid fname error ptr + 20624 00001E01 E8100C call pathchrcmp ; Is the char in al a path sep? + 20625 00001E04 742B jz short errj ; Yes, error - 2nd arg must be + 20626 ; filename only. + 20627 ;mov ah,FCB_Rename + 20628 00001E06 B417 mov ah,17h + 20629 00001E08 BA5C00 mov dx,FCB ; 5Ch + 20630 00001E0B CD21 int 21h + 20631 00001E0D 3CFF cmp al,0FFh ; Did an error occur?? + 20632 00001E0F 7506 jne short renameok + 20633 + 20634 00001E11 E83702 call get_ext_error_number + 20635 ;AN022; get extended error + 20636 00001E14 50 push ax ;AC022; Save results + 20637 00001E15 B0FF mov al,0FFh ; Restore original error state + 20638 renameok: + 20639 00001E17 50 push ax + 20640 00001E18 E8150A call RestUDir + 20641 00001E1B 58 pop ax + 20642 00001E1C FEC0 inc al + 20643 ;;retnz + 20644 ;jz short rn1 + 20645 ;retn + 20646 00001E1E 7514 jnz short ret56 + 20647 rn1: + 20648 00001E20 58 pop ax ;AC022; get the error number back + 20649 00001E21 83F802 cmp ax,ERROR_FILE_NOT_FOUND ; 2 + 20650 ;AN022; error file not found? + 20651 00001E24 7408 je short use_renerr + 20652 ;AN022; yes - use generic error message + 20653 00001E26 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 + 20654 ;AN022; error file not found? + 20655 00001E29 7403 je short use_renerr + 20656 ;AN022; yes - use generic error message + 20657 00001E2B E952FF jmp extend_setup ;AN022; need long jump - use extended error + 20658 + 20659 use_renerr: + 20660 00001E2E BA[E58F] mov dx,RENERR_PTR ;AC022; + 20661 errj: + 20662 00001E31 E9F20E jmp cerror + 20663 ret56: + 20664 ;typefil_ret: ; 20/02/2023 ; 17/04/2023 + 20665 00001E34 C3 retn + 20666 + 20667 ; --------------------------------------------------------------------------- + 20668 + 20669 ;**************************************************************** 20670 ;* - 20671 ;* SYNTAX: TYPE filespec - 20672 ;* - 20673 ;* FUNCTION: If a valid filespec is found, read the file until - 20674 ;* 1Ah and display the contents to STDOUT. + 20671 ;* ROUTINE: TYPEFIL - Display the contents of a file to the + 20672 ;* standard output device + 20673 ;* + 20674 ;* SYNTAX: TYPE filespec 20675 ;* - 20676 ;* INPUT: command line at offset 81H - 20677 ;* - 20678 ;* OUTPUT: none - 20679 ;* - 20680 ;**************************************************************** - 20681 - 20682 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 20683 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20684 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 20685 TYPEFIL: - 20686 ; MSDOS 6.0 - 20687 ;assume ds:trangroup,es:trangroup - 20688 - 20689 00001E35 BE8100 mov si,81h - 20690 00001E38 BF[8896] mov di,PARSE_MRDIR - 20691 ;AN000; Get address of PARSE_MRDIR - 20692 00001E3B 31C9 xor cx,cx ;AN000; clear cx,dx - 20693 00001E3D 31D2 xor dx,dx ;AN000; - 20694 00001E3F E81907 call Parse_With_Msg ;AC018; call parser - 20695 ;cmp ax,RESULT_NO_ERROR - 20696 00001E42 09C0 or ax,ax ; 0 ? ;AC000; did we have an error? - 20697 00001E44 751E jnz short typefil_parse_error - 20698 ;AN000; yes - issue error message - 20699 - 20700 00001E46 56 push si ;AC000; save position in line - 20701 00001E47 C536[EFA5] lds si,[PARSE1_ADDR] - 20702 ;AC000; get address of filespec - 20703 00001E4B E88A12 call Move_To_SrcBuf ;AC000; move to srcbuf - 20704 00001E4E 5E pop si ;AC000; get position back - 20705 00001E4F BF[8896] mov di,PARSE_MRDIR - 20706 ;AC000; get address of parse_mrdir - 20707 00001E52 E8F006 call parse_check_eol ;AC000; are we at end of line? - 20708 ;jz short gottarg ;AC000; yes - continue - 20709 ; 20/02/2023 - 20710 ;typefil_parse_error: ;AN000; no - set up error message and exit - 20711 ;jmp cerror - 20712 00001E55 750D jnz short typefil_parse_error - 20713 gottarg: - 20714 00001E57 E8C510 call SETPATH - 20715 00001E5A F606[BD9D]02 test byte [DestInfo],00000010b ; 2 - 20716 ; Does the filespec contain wildcards - 20717 00001E5F 7406 jz short nowilds ; No, continue processing - 20718 00001E61 BA[0990] mov dx,INORNOT_PTR ; Yes, report error - 20719 ; 20/02/2023 - 20720 typefil_parse_error: - 20721 00001E64 E9BF0E jmp cerror - 20722 nowilds: - 20723 ;mov ax,ExtOpen SHL 8 ;AC000; open the file - 20724 00001E67 B8006C mov ax,6C00h - 20725 ;mov bx,read_open_mode ; 0 - 20726 ;AN000; get open mode for TYPE - 20727 00001E6A 31C9 xor cx,cx ;AN000; no special files - 20728 00001E6C 89CB mov bx,cx ; 20/02/2023 - 20729 00001E6E BA0101 mov dx,101h - 20730 ;mov dx,read_open_flag ; 101h - 20731 ;AN000; set up open flags - 20732 00001E71 BE[219E] mov si,SrcBuf ;AN030; get file name - 20733 ;int 21h - 20734 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20735 00001E74 E843E7 call int_21h_indirect - 20736 00001E77 7313 jnc short typecont ; If open worked, continue. Otherwise load - 20737 - 20738 typerr: ;AN022; - 20739 00001E79 0E push cs ;AN022; make sure we have local segment - 20740 00001E7A 1F pop ds ;AN022; - 20741 00001E7B E8BD01 call Set_Ext_Error_Msg ;AN022; - 20742 00001E7E C706[A09D][219E] mov word [string_ptr_2],SrcBuf - 20743 ;AC022; get address of failed string - 20744 ;mov byte [extend_buf_sub],1 - 20745 00001E84 C606[D98F]01 mov byte [extend_buf_sub],one_subst - 20746 ;AC022; put number of subst in control block - 20747 00001E89 E99A0E jmp cerror ;AC022; exit - 20748 - 20749 typecont: - 20750 00001E8C 89C3 mov bx,ax ;AC000; get Handle - 20751 ;M043 - 20752 ; We should do the LSEEK for filesize only if this handle belongs to a file - 20753 ;and not if it belongs to a device. If device, set TypeFilSiz+2 to -1 to - 20754 ;indicate it is a device. - 20755 ; - 20756 ;mov ax,(IOCTL shl 8) or 0 - 20757 00001E8E B80044 mov ax,4400h - 20758 ;int 21h - 20759 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20760 00001E91 E826E7 call int_21h_indirect - 20761 - 20762 00001E94 F6C280 test dl,80h ;is it a device? - 20763 00001E97 7408 jz short not_device - 20764 ;no, a file - 20765 - 20766 ;mov word [TypeFilSiz+2],-1 ; 0FFFFh - 20767 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20768 00001E99 C706[9E9D]FFFF mov word [File_Size_High],-1 ; 0FFFFh - 20769 ;indicate it is a device - 20770 00001E9F EB19 jmp short dotype - 20771 not_device: - 20772 ;SR; - 20773 ; Find the filesize by seeking to the end and then reset file pointer to - 20774 ;start of file - 20775 - 20776 ;mov ax,(LSEEK shl 8) or 2 - 20777 00001EA1 B80242 mov ax,4202h - 20778 00001EA4 31D2 xor dx,dx - 20779 00001EA6 89D1 mov cx,dx ;seek to end of file - 20780 ;int 21h - 20781 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20782 00001EA8 E80FE7 call int_21h_indirect - 20783 - 20784 ;mov [TypeFilSiz],ax - 20785 ;mov [TypeFilSiz+2],dx ;store filesize - 20786 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20787 00001EAB A3[9C9D] mov [File_Size_Low],ax - 20788 00001EAE 8916[9E9D] mov [File_Size_High],dx - 20789 - 20790 ;mov ax,(LSEEK shl 8) or 0 - 20791 00001EB2 B80042 mov ax,4200h - 20792 00001EB5 31D2 xor dx,dx - 20793 ;int 21h ;reset file pointer to start - 20794 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20795 00001EB7 E800E7 call int_21h_indirect - 20796 dotype: ;M043 - 20797 00001EBA C606[E59E]00 mov byte [zflag],0 ; Reset ^Z flag - 20798 00001EBF 8E1E[F79B] mov ds,[TPA] - 20799 00001EC3 31D2 xor dx,dx - 20800 ;ASSUME DS:NOTHING - 20801 typelp: - 20802 00001EC5 2E803E[E59E]00 cmp byte [cs:zflag],0 - 20803 ;AC050; Is the ^Z flag set? - 20804 ;retnz ; Yes, return - 20805 ; 17/04/2023 - 20806 00001ECB 7401 jz short tf1 - 20807 00001ECD C3 retn - 20808 tf1: - 20809 00001ECE 2E8B0E[159C] mov cx,[cs:BYTCNT] ;AC056; No, continue - 20810 - 20811 ;Update the filesize left to read - 20812 - 20813 ;cmp word [cs:TypeFilSiz+2],-1 - 20814 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20815 00001ED3 2E833E[9E9D]FF cmp word [cs:File_Size_High],-1 ; 0FFFFh - 20816 ;is it a device? M043 - 20817 00001ED9 7431 je short typ_read ;yes, just read from it; M043 - 20818 - 20819 ;cmp word [cs:TypeFilSiz+2],0 - 20820 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20821 00001EDB 2E833E[9E9D]00 cmp word [cs:File_Size_High],0 - 20822 ;more than 64K left? - 20823 00001EE1 740D jz short lt64k ;no, do word subtraction - 20824 ;sub [cs:TypeFilSiz],cx - 20825 ;sbb word [cs:TypeFilSiz+2],0 - 20826 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20827 00001EE3 2E290E[9C9D] sub [cs:File_Size_Low],cx - 20828 00001EE8 2E831E[9E9D]00 sbb word [cs:File_Size_High],0 - 20829 ;update filesize - 20830 00001EEE EB1C jmp short typ_read ;do the read - 20831 lt64k: - 20832 ;cmp cx,[cs:TypeFilSiz] - 20833 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20834 00001EF0 2E3B0E[9C9D] cmp cx,[cs:File_Size_Low] - 20835 ;readsize <= buffer? - 20836 00001EF5 7610 jbe short gtbuf ; yes, just update readsize - 20837 - 20838 ;Buffer size is larger than bytes to read - 20839 - 20840 ;mov cx,[cs:TypeFilSiz] - 20841 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20842 00001EF7 2E8B0E[9C9D] mov cx,[cs:File_Size_Low] - 20843 00001EFC E364 jcxz typelp_ret - 20844 ;mov word [cs:TypeFilSiz],0 - 20845 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20846 00001EFE 2EC706[9C9D]0000 mov word [cs:File_Size_Low],0 - 20847 00001F05 EB05 jmp short typ_read - 20848 gtbuf: - 20849 ;sub [cs:TypeFilSiz],cx - 20850 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20851 00001F07 2E290E[9C9D] sub [cs:File_Size_Low],cx - 20852 ;update filesize remaining - 20853 typ_read: - 20854 ;mov ah,read - 20855 00001F0C B43F mov ah,3Fh - 20856 ;int 21h - 20857 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20858 00001F0E E8A9E6 call int_21h_indirect - 20859 00001F11 7303 jnc short tf2 ;M043 - 20860 00001F13 E963FF jmp typerr ;M043 - 20861 tf2: ;M043 - 20862 ;M043; jc typerr ;AN022; Exit if error - 20863 - 20864 00001F16 89C1 mov cx,ax - 20865 00001F18 E348 jcxz typelp_ret ;AC000; exit if nothing read - 20866 00001F1A 1E push ds - 20867 00001F1B 07 pop es ; Check to see if a ^Z was read. - 20868 ;assume es:nothing - 20869 00001F1C 31FF xor di,di - 20870 00001F1E 50 push ax - 20871 00001F1F B01A mov al,1Ah - 20872 00001F21 F2AE repnz scasb - 20873 00001F23 58 pop ax - 20874 00001F24 91 xchg ax,cx - 20875 ;cmp ax,0 - 20876 00001F25 21C0 and ax,ax - 20877 00001F27 7506 jnz short foundz ; Yes, handle it - 20878 00001F29 807DFF1A cmp byte [di-1],1Ah ; No, double check - 20879 00001F2D 750A jnz short typecont2 ; No ^Z, continue - 20880 foundz: - 20881 00001F2F 29C1 sub cx,ax ; Otherwise change cx so that only those - 20882 00001F31 49 dec cx ; bytes up to but NOT including the ^Z - 20883 00001F32 0E push cs ; will be typed. - 20884 00001F33 07 pop es - 20885 ;assume es:trangroup - 20886 00001F34 26F616[E59E] not byte [es:zflag] ; Turn on ^Z flag so that the routine - 20887 typecont2: ; will quit after this write. - 20888 00001F39 53 push bx - 20889 00001F3A BB0100 mov bx,1 - 20890 ;mov ah,Write - 20891 00001F3D B440 mov ah,40h - 20892 ;int 21h - 20893 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20894 00001F3F E878E6 call int_21h_indirect - 20895 00001F42 5B pop bx - 20896 00001F43 720C jc short Error_outputj - 20897 00001F45 39C8 cmp ax,cx - 20898 00001F47 7503 jnz short tf3 ;M043 - 20899 00001F49 E979FF jmp typelp ;M043 - 20900 tf3: ;M043 - 20901 ;M043; jz short typelp - 20902 00001F4C 49 dec cx - 20903 00001F4D 39C8 cmp ax,cx - 20904 ;;retz ; One less byte OK (^Z) - 20905 ;jnz short Error_outputj - 20906 ;tf4: - 20907 ;retn - 20908 00001F4F 7411 jz short typelp_ret ; 20/02/2023 - 20909 - 20910 Error_outputj: - 20911 00001F51 BB0100 mov bx,1 - 20912 ;mov ax,IOCTL SHL 8 - 20913 00001F54 B80044 mov ax,4400h - 20914 ;int 21h - 20915 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 20916 00001F57 E860E6 call int_21h_indirect - 20917 00001F5A F6C280 test dl,80h - 20918 ;test dl,devid_ISDEV - 20919 ;;retnz ; If device, no error message - 20920 ;jnz short tf4 - 20921 00001F5D 7503 jnz short typelp_ret - 20922 00001F5F E9980A jmp error_output - 20923 typelp_ret: - 20924 00001F62 C3 retn - 20925 - 20926 ; --------------------------------------------------------------------------- - 20927 - 20928 ; VOLUME command displays the volume ID on the specified drive - 20929 - 20930 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 20931 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20932 ; 10/06/2023 - 20933 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 20934 VOLUME: - 20935 ; MSDOS 6.0 - 20936 00001F63 BE8100 mov si,81h - 20937 00001F66 BF[7696] mov di,PARSE_VOL - 20938 ;AN000; Get address of PARSE_VOL - 20939 00001F69 31C9 xor cx,cx ;AN000; clear cx,dx - 20940 00001F6B 31D2 xor dx,dx ;AN000; - 20941 00001F6D E8EB05 call Parse_With_Msg ;AC018; call parser - 20942 - 20943 ;cmp ax,-1 ; 0FFFFh - 20944 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? - 20945 ;je short OkVolArg ;AC000; Yes, display default volume ID - 20946 ;;cmp ax,RESULT_NO_ERROR - 20947 ;;cmp ax,0 ;AC000; did we have an error? - 20948 ;or ax,ax ; 0? - 20949 ;jnz short badvolarg ;AC000; Yes, fail. - 20950 ; 10/06/2023 - 20951 00001F70 40 inc ax ; cmp ax,-1 - 20952 00001F71 7447 jz short OkVolArg ; 0FFFFh -> 0 - 20953 00001F73 48 dec ax ; cmp ax,0 - 20954 00001F74 750A jnz short badvolarg ; 1 -> 0 - 20955 ; ax = 0 - 20956 - 20957 ; We have parsed off the drive. See if there are any more chars left - 20958 - 20959 00001F76 BF[7696] mov di,PARSE_VOL - 20960 ;AC000; get address of parse_vol - 20961 00001F79 31D2 xor dx,dx ;AC000; - 20962 00001F7B E8C705 call parse_check_eol ;AC000; call parser - 20963 00001F7E 743A jz short OkVolArg ;AC000; yes, end of road - 20964 - 20965 ; The line was not interpretable. Report an error. - 20966 - 20967 badvolarg: - 20968 00001F80 E9A30D jmp cerror + 20676 ;* FUNCTION: If a valid filespec is found, read the file until + 20677 ;* 1Ah and display the contents to STDOUT. + 20678 ;* + 20679 ;* INPUT: command line at offset 81H + 20680 ;* + 20681 ;* OUTPUT: none + 20682 ;* + 20683 ;**************************************************************** + 20684 + 20685 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 20686 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20687 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 20688 TYPEFIL: + 20689 ; MSDOS 6.0 + 20690 ;assume ds:trangroup,es:trangroup + 20691 + 20692 00001E35 BE8100 mov si,81h + 20693 00001E38 BF[8896] mov di,PARSE_MRDIR + 20694 ;AN000; Get address of PARSE_MRDIR + 20695 00001E3B 31C9 xor cx,cx ;AN000; clear cx,dx + 20696 00001E3D 31D2 xor dx,dx ;AN000; + 20697 00001E3F E81907 call Parse_With_Msg ;AC018; call parser + 20698 ;cmp ax,RESULT_NO_ERROR + 20699 00001E42 09C0 or ax,ax ; 0 ? ;AC000; did we have an error? + 20700 00001E44 751E jnz short typefil_parse_error + 20701 ;AN000; yes - issue error message + 20702 + 20703 00001E46 56 push si ;AC000; save position in line + 20704 00001E47 C536[EFA5] lds si,[PARSE1_ADDR] + 20705 ;AC000; get address of filespec + 20706 00001E4B E88A12 call Move_To_SrcBuf ;AC000; move to srcbuf + 20707 00001E4E 5E pop si ;AC000; get position back + 20708 00001E4F BF[8896] mov di,PARSE_MRDIR + 20709 ;AC000; get address of parse_mrdir + 20710 00001E52 E8F006 call parse_check_eol ;AC000; are we at end of line? + 20711 ;jz short gottarg ;AC000; yes - continue + 20712 ; 20/02/2023 + 20713 ;typefil_parse_error: ;AN000; no - set up error message and exit + 20714 ;jmp cerror + 20715 00001E55 750D jnz short typefil_parse_error + 20716 gottarg: + 20717 00001E57 E8C510 call SETPATH + 20718 00001E5A F606[BD9D]02 test byte [DestInfo],00000010b ; 2 + 20719 ; Does the filespec contain wildcards + 20720 00001E5F 7406 jz short nowilds ; No, continue processing + 20721 00001E61 BA[0990] mov dx,INORNOT_PTR ; Yes, report error + 20722 ; 20/02/2023 + 20723 typefil_parse_error: + 20724 00001E64 E9BF0E jmp cerror + 20725 nowilds: + 20726 ;mov ax,ExtOpen SHL 8 ;AC000; open the file + 20727 00001E67 B8006C mov ax,6C00h + 20728 ;mov bx,read_open_mode ; 0 + 20729 ;AN000; get open mode for TYPE + 20730 00001E6A 31C9 xor cx,cx ;AN000; no special files + 20731 00001E6C 89CB mov bx,cx ; 20/02/2023 + 20732 00001E6E BA0101 mov dx,101h + 20733 ;mov dx,read_open_flag ; 101h + 20734 ;AN000; set up open flags + 20735 00001E71 BE[219E] mov si,SrcBuf ;AN030; get file name + 20736 ;int 21h + 20737 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20738 00001E74 E843E7 call int_21h_indirect + 20739 00001E77 7313 jnc short typecont ; If open worked, continue. Otherwise load + 20740 + 20741 typerr: ;AN022; + 20742 00001E79 0E push cs ;AN022; make sure we have local segment + 20743 00001E7A 1F pop ds ;AN022; + 20744 00001E7B E8BD01 call Set_Ext_Error_Msg ;AN022; + 20745 00001E7E C706[A09D][219E] mov word [string_ptr_2],SrcBuf + 20746 ;AC022; get address of failed string + 20747 ;mov byte [extend_buf_sub],1 + 20748 00001E84 C606[D98F]01 mov byte [extend_buf_sub],one_subst + 20749 ;AC022; put number of subst in control block + 20750 00001E89 E99A0E jmp cerror ;AC022; exit + 20751 + 20752 typecont: + 20753 00001E8C 89C3 mov bx,ax ;AC000; get Handle + 20754 ;M043 + 20755 ; We should do the LSEEK for filesize only if this handle belongs to a file + 20756 ;and not if it belongs to a device. If device, set TypeFilSiz+2 to -1 to + 20757 ;indicate it is a device. + 20758 ; + 20759 ;mov ax,(IOCTL shl 8) or 0 + 20760 00001E8E B80044 mov ax,4400h + 20761 ;int 21h + 20762 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20763 00001E91 E826E7 call int_21h_indirect + 20764 + 20765 00001E94 F6C280 test dl,80h ;is it a device? + 20766 00001E97 7408 jz short not_device + 20767 ;no, a file + 20768 + 20769 ;mov word [TypeFilSiz+2],-1 ; 0FFFFh + 20770 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20771 00001E99 C706[9E9D]FFFF mov word [File_Size_High],-1 ; 0FFFFh + 20772 ;indicate it is a device + 20773 00001E9F EB19 jmp short dotype + 20774 not_device: + 20775 ;SR; + 20776 ; Find the filesize by seeking to the end and then reset file pointer to + 20777 ;start of file + 20778 + 20779 ;mov ax,(LSEEK shl 8) or 2 + 20780 00001EA1 B80242 mov ax,4202h + 20781 00001EA4 31D2 xor dx,dx + 20782 00001EA6 89D1 mov cx,dx ;seek to end of file + 20783 ;int 21h + 20784 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20785 00001EA8 E80FE7 call int_21h_indirect + 20786 + 20787 ;mov [TypeFilSiz],ax + 20788 ;mov [TypeFilSiz+2],dx ;store filesize + 20789 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20790 00001EAB A3[9C9D] mov [File_Size_Low],ax + 20791 00001EAE 8916[9E9D] mov [File_Size_High],dx + 20792 + 20793 ;mov ax,(LSEEK shl 8) or 0 + 20794 00001EB2 B80042 mov ax,4200h + 20795 00001EB5 31D2 xor dx,dx + 20796 ;int 21h ;reset file pointer to start + 20797 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20798 00001EB7 E800E7 call int_21h_indirect + 20799 dotype: ;M043 + 20800 00001EBA C606[E59E]00 mov byte [zflag],0 ; Reset ^Z flag + 20801 00001EBF 8E1E[F79B] mov ds,[TPA] + 20802 00001EC3 31D2 xor dx,dx + 20803 ;ASSUME DS:NOTHING + 20804 typelp: + 20805 00001EC5 2E803E[E59E]00 cmp byte [cs:zflag],0 + 20806 ;AC050; Is the ^Z flag set? + 20807 ;retnz ; Yes, return + 20808 ; 17/04/2023 + 20809 00001ECB 7401 jz short tf1 + 20810 00001ECD C3 retn + 20811 tf1: + 20812 00001ECE 2E8B0E[159C] mov cx,[cs:BYTCNT] ;AC056; No, continue + 20813 + 20814 ;Update the filesize left to read + 20815 + 20816 ;cmp word [cs:TypeFilSiz+2],-1 + 20817 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20818 00001ED3 2E833E[9E9D]FF cmp word [cs:File_Size_High],-1 ; 0FFFFh + 20819 ;is it a device? M043 + 20820 00001ED9 7431 je short typ_read ;yes, just read from it; M043 + 20821 + 20822 ;cmp word [cs:TypeFilSiz+2],0 + 20823 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20824 00001EDB 2E833E[9E9D]00 cmp word [cs:File_Size_High],0 + 20825 ;more than 64K left? + 20826 00001EE1 740D jz short lt64k ;no, do word subtraction + 20827 ;sub [cs:TypeFilSiz],cx + 20828 ;sbb word [cs:TypeFilSiz+2],0 + 20829 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20830 00001EE3 2E290E[9C9D] sub [cs:File_Size_Low],cx + 20831 00001EE8 2E831E[9E9D]00 sbb word [cs:File_Size_High],0 + 20832 ;update filesize + 20833 00001EEE EB1C jmp short typ_read ;do the read + 20834 lt64k: + 20835 ;cmp cx,[cs:TypeFilSiz] + 20836 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20837 00001EF0 2E3B0E[9C9D] cmp cx,[cs:File_Size_Low] + 20838 ;readsize <= buffer? + 20839 00001EF5 7610 jbe short gtbuf ; yes, just update readsize + 20840 + 20841 ;Buffer size is larger than bytes to read + 20842 + 20843 ;mov cx,[cs:TypeFilSiz] + 20844 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20845 00001EF7 2E8B0E[9C9D] mov cx,[cs:File_Size_Low] + 20846 00001EFC E364 jcxz typelp_ret + 20847 ;mov word [cs:TypeFilSiz],0 + 20848 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20849 00001EFE 2EC706[9C9D]0000 mov word [cs:File_Size_Low],0 + 20850 00001F05 EB05 jmp short typ_read + 20851 gtbuf: + 20852 ;sub [cs:TypeFilSiz],cx + 20853 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20854 00001F07 2E290E[9C9D] sub [cs:File_Size_Low],cx + 20855 ;update filesize remaining + 20856 typ_read: + 20857 ;mov ah,read + 20858 00001F0C B43F mov ah,3Fh + 20859 ;int 21h + 20860 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20861 00001F0E E8A9E6 call int_21h_indirect + 20862 00001F11 7303 jnc short tf2 ;M043 + 20863 00001F13 E963FF jmp typerr ;M043 + 20864 tf2: ;M043 + 20865 ;M043; jc typerr ;AN022; Exit if error + 20866 + 20867 00001F16 89C1 mov cx,ax + 20868 00001F18 E348 jcxz typelp_ret ;AC000; exit if nothing read + 20869 00001F1A 1E push ds + 20870 00001F1B 07 pop es ; Check to see if a ^Z was read. + 20871 ;assume es:nothing + 20872 00001F1C 31FF xor di,di + 20873 00001F1E 50 push ax + 20874 00001F1F B01A mov al,1Ah + 20875 00001F21 F2AE repnz scasb + 20876 00001F23 58 pop ax + 20877 00001F24 91 xchg ax,cx + 20878 ;cmp ax,0 + 20879 00001F25 21C0 and ax,ax + 20880 00001F27 7506 jnz short foundz ; Yes, handle it + 20881 00001F29 807DFF1A cmp byte [di-1],1Ah ; No, double check + 20882 00001F2D 750A jnz short typecont2 ; No ^Z, continue + 20883 foundz: + 20884 00001F2F 29C1 sub cx,ax ; Otherwise change cx so that only those + 20885 00001F31 49 dec cx ; bytes up to but NOT including the ^Z + 20886 00001F32 0E push cs ; will be typed. + 20887 00001F33 07 pop es + 20888 ;assume es:trangroup + 20889 00001F34 26F616[E59E] not byte [es:zflag] ; Turn on ^Z flag so that the routine + 20890 typecont2: ; will quit after this write. + 20891 00001F39 53 push bx + 20892 00001F3A BB0100 mov bx,1 + 20893 ;mov ah,Write + 20894 00001F3D B440 mov ah,40h + 20895 ;int 21h + 20896 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20897 00001F3F E878E6 call int_21h_indirect + 20898 00001F42 5B pop bx + 20899 00001F43 720C jc short Error_outputj + 20900 00001F45 39C8 cmp ax,cx + 20901 00001F47 7503 jnz short tf3 ;M043 + 20902 00001F49 E979FF jmp typelp ;M043 + 20903 tf3: ;M043 + 20904 ;M043; jz short typelp + 20905 00001F4C 49 dec cx + 20906 00001F4D 39C8 cmp ax,cx + 20907 ;;retz ; One less byte OK (^Z) + 20908 ;jnz short Error_outputj + 20909 ;tf4: + 20910 ;retn + 20911 00001F4F 7411 jz short typelp_ret ; 20/02/2023 + 20912 + 20913 Error_outputj: + 20914 00001F51 BB0100 mov bx,1 + 20915 ;mov ax,IOCTL SHL 8 + 20916 00001F54 B80044 mov ax,4400h + 20917 ;int 21h + 20918 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 20919 00001F57 E860E6 call int_21h_indirect + 20920 00001F5A F6C280 test dl,80h + 20921 ;test dl,devid_ISDEV + 20922 ;;retnz ; If device, no error message + 20923 ;jnz short tf4 + 20924 00001F5D 7503 jnz short typelp_ret + 20925 00001F5F E9980A jmp error_output + 20926 typelp_ret: + 20927 00001F62 C3 retn + 20928 + 20929 ; --------------------------------------------------------------------------- + 20930 + 20931 ; VOLUME command displays the volume ID on the specified drive + 20932 + 20933 ; 20/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 20934 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20935 ; 10/06/2023 + 20936 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 20937 VOLUME: + 20938 ; MSDOS 6.0 + 20939 00001F63 BE8100 mov si,81h + 20940 00001F66 BF[7696] mov di,PARSE_VOL + 20941 ;AN000; Get address of PARSE_VOL + 20942 00001F69 31C9 xor cx,cx ;AN000; clear cx,dx + 20943 00001F6B 31D2 xor dx,dx ;AN000; + 20944 00001F6D E8EB05 call Parse_With_Msg ;AC018; call parser + 20945 + 20946 ;cmp ax,-1 ; 0FFFFh + 20947 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? + 20948 ;je short OkVolArg ;AC000; Yes, display default volume ID + 20949 ;;cmp ax,RESULT_NO_ERROR + 20950 ;;cmp ax,0 ;AC000; did we have an error? + 20951 ;or ax,ax ; 0? + 20952 ;jnz short badvolarg ;AC000; Yes, fail. + 20953 ; 10/06/2023 + 20954 00001F70 40 inc ax ; cmp ax,-1 + 20955 00001F71 7447 jz short OkVolArg ; 0FFFFh -> 0 + 20956 00001F73 48 dec ax ; cmp ax,0 + 20957 00001F74 750A jnz short badvolarg ; 1 -> 0 + 20958 ; ax = 0 + 20959 + 20960 ; We have parsed off the drive. See if there are any more chars left + 20961 + 20962 00001F76 BF[7696] mov di,PARSE_VOL + 20963 ;AC000; get address of parse_vol + 20964 00001F79 31D2 xor dx,dx ;AC000; + 20965 00001F7B E8C705 call parse_check_eol ;AC000; call parser + 20966 00001F7E 743A jz short OkVolArg ;AC000; yes, end of road + 20967 + 20968 ; The line was not interpretable. Report an error. 20969 - 20970 ; --------------------------------------------------------------------------- - 20971 - 20972 ;*** DisAppend - disable APPEND - 20973 ; - 20974 ; ENTRY nothing - 20975 ; - 20976 ; EXIT nothing - 20977 ; - 20978 ; USED AX,BX - 20979 ; - 20980 ; EFFECTS - 20981 ; - 20982 ; APPEND is disabled. If it was active, it will be re-enabled - 20983 ; after the command finishes, by the HeadFix routine. + 20970 badvolarg: + 20971 00001F80 E9A30D jmp cerror + 20972 + 20973 ; --------------------------------------------------------------------------- + 20974 + 20975 ;*** DisAppend - disable APPEND + 20976 ; + 20977 ; ENTRY nothing + 20978 ; + 20979 ; EXIT nothing + 20980 ; + 20981 ; USED AX,BX + 20982 ; + 20983 ; EFFECTS 20984 ; - 20985 ; NOTE - 20986 ; - 20987 ; This routine must not be called more than once during a single - 20988 ; command cycle. The second call would permanently disable APPEND. - 20989 - 20990 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 20991 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1CDFh - 20992 - 20993 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 20994 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2289h - 20995 - 20996 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 20997 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2069h + 20985 ; APPEND is disabled. If it was active, it will be re-enabled + 20986 ; after the command finishes, by the HeadFix routine. + 20987 ; + 20988 ; NOTE + 20989 ; + 20990 ; This routine must not be called more than once during a single + 20991 ; command cycle. The second call would permanently disable APPEND. + 20992 + 20993 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 20994 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1CDFh + 20995 + 20996 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 20997 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2289h 20998 - 20999 ; MSDOS 6.0 - 21000 DisAppend: - 21001 00001F83 1E push ds ; save DS - 21002 00001F84 06 push es ; save ES - 21003 00001F85 57 push di - 21004 - 21005 ;mov ax,APPENDINSTALL ; AX = Append Installed Check code - 21006 00001F86 B800B7 mov ax,0B700h - 21007 ;int 2Fh ; talk to APPEND via multiplex - 21008 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21009 00001F89 E854E6 call int_2Fh_indirect - 21010 00001F8C 08C0 or al,al - 21011 00001F8E 7426 jz short daRet ; APPEND not installed, return - 21012 - 21013 ;mov ax,APPENDDOS ; AX = Get Append Version code - 21014 00001F90 B802B7 mov ax,0B702h - 21015 ;int 2Fh ; talk to APPEND via multiplex - 21016 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21017 00001F93 E84AE6 call int_2Fh_indirect - 21018 00001F96 83F8FF cmp ax,0FFFFh - 21019 00001F99 751B jne short daRet ; it's not a local version, return - 21020 - 21021 ;mov ax,APPENDGETSTATE ; AX = Get Function State code - 21022 00001F9B B806B7 mov ax,0B706h - 21023 ;int 2Fh ; talk to APPEND via multiplex - 21024 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21025 00001F9E E83FE6 call int_2Fh_indirect - 21026 - 21027 00001FA1 8E1E[F59B] mov ds,[RESSEG] ; DS = resident seg addr - 21028 - 21029 00001FA5 891E[BE02] mov [Append_State],bx ; Append_State = saved APPEND state - 21030 00001FA9 C606[C002]FF mov byte [Append_Flag],-1 ; Append_Flag = true, restore state + 20999 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 21000 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2069h + 21001 + 21002 ; MSDOS 6.0 + 21003 DisAppend: + 21004 00001F83 1E push ds ; save DS + 21005 00001F84 06 push es ; save ES + 21006 00001F85 57 push di + 21007 + 21008 ;mov ax,APPENDINSTALL ; AX = Append Installed Check code + 21009 00001F86 B800B7 mov ax,0B700h + 21010 ;int 2Fh ; talk to APPEND via multiplex + 21011 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21012 00001F89 E854E6 call int_2Fh_indirect + 21013 00001F8C 08C0 or al,al + 21014 00001F8E 7426 jz short daRet ; APPEND not installed, return + 21015 + 21016 ;mov ax,APPENDDOS ; AX = Get Append Version code + 21017 00001F90 B802B7 mov ax,0B702h + 21018 ;int 2Fh ; talk to APPEND via multiplex + 21019 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21020 00001F93 E84AE6 call int_2Fh_indirect + 21021 00001F96 83F8FF cmp ax,0FFFFh + 21022 00001F99 751B jne short daRet ; it's not a local version, return + 21023 + 21024 ;mov ax,APPENDGETSTATE ; AX = Get Function State code + 21025 00001F9B B806B7 mov ax,0B706h + 21026 ;int 2Fh ; talk to APPEND via multiplex + 21027 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21028 00001F9E E83FE6 call int_2Fh_indirect + 21029 + 21030 00001FA1 8E1E[F59B] mov ds,[RESSEG] ; DS = resident seg addr 21031 - 21032 00001FAE 31DB xor bx,bx ; BX = APPEND state = off - 21033 ;mov ax,APPENDSETSTATE ; AX = Set Append State code - 21034 00001FB0 B807B7 mov ax,0B707h - 21035 ;int 2Fh ; talk to APPEND via multiplex - 21036 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21037 00001FB3 E82AE6 call int_2Fh_indirect - 21038 daRet: - 21039 00001FB6 5F pop di - 21040 00001FB7 07 pop es ; restore ES - 21041 00001FB8 1F pop ds ; restore DS - 21042 - 21043 00001FB9 C3 retn - 21044 - 21045 ; --------------------------------------------------------------------------- - 21046 - 21047 ; Find the Volume ID on the disk. - 21048 - 21049 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21050 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21051 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 21052 - 21053 ; MSDOS 6.0 - 21054 OkVolArg: - 21055 00001FBA E8C6FF call DisAppend ; disable APPEND - 21056 00001FBD E8B909 call CRLF2 - 21057 ;mov al,blank - 21058 00001FC0 B020 mov al,' ' ; 20h ;AN051; Print out a blank - 21059 00001FC2 E8E901 call PRINT_CHAR ;AN051; before volume message - 21060 00001FC5 1E push ds - 21061 00001FC6 07 pop es - 21062 - 21063 ; Volume IDs are only findable via extended FCBs or find_first with attributes - 21064 ; of volume_id ONLY. + 21032 00001FA5 891E[BE02] mov [Append_State],bx ; Append_State = saved APPEND state + 21033 00001FA9 C606[C002]FF mov byte [Append_Flag],-1 ; Append_Flag = true, restore state + 21034 + 21035 00001FAE 31DB xor bx,bx ; BX = APPEND state = off + 21036 ;mov ax,APPENDSETSTATE ; AX = Set Append State code + 21037 00001FB0 B807B7 mov ax,0B707h + 21038 ;int 2Fh ; talk to APPEND via multiplex + 21039 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21040 00001FB3 E82AE6 call int_2Fh_indirect + 21041 daRet: + 21042 00001FB6 5F pop di + 21043 00001FB7 07 pop es ; restore ES + 21044 00001FB8 1F pop ds ; restore DS + 21045 + 21046 00001FB9 C3 retn + 21047 + 21048 ; --------------------------------------------------------------------------- + 21049 + 21050 ; Find the Volume ID on the disk. + 21051 + 21052 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21053 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21054 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 21055 + 21056 ; MSDOS 6.0 + 21057 OkVolArg: + 21058 00001FBA E8C6FF call DisAppend ; disable APPEND + 21059 00001FBD E8B909 call CRLF2 + 21060 ;mov al,blank + 21061 00001FC0 B020 mov al,' ' ; 20h ;AN051; Print out a blank + 21062 00001FC2 E8E901 call PRINT_CHAR ;AN051; before volume message + 21063 00001FC5 1E push ds + 21064 00001FC6 07 pop es 21065 - 21066 00001FC7 BF5500 mov di,FCB-7 ; 55h ; Point to extended FCB beginning - 21067 00001FCA B0FF mov al,-1 ; 0FFh ; Tag to indicate Extention - 21068 00001FCC AA stosb - 21069 00001FCD 31C0 xor ax,ax ; Zero padding to volume label - 21070 00001FCF AB stosw - 21071 00001FD0 AB stosw - 21072 00001FD1 AA stosb - 21073 00001FD2 B008 mov al,ATTR_VOLUME_ID ; 8 ; Look for volume label - 21074 00001FD4 AA stosb - 21075 00001FD5 47 inc di ; Skip drive byte; it is already set - 21076 00001FD6 B90B00 mov cx,11 ; fill in remainder of file - 21077 00001FD9 B03F mov al,'?' - 21078 00001FDB F3AA rep stosb - 21079 - 21080 ; Set up transfer address (destination of search first information) - 21081 - 21082 00001FDD BA[399D] mov dx,DIRBUF - 21083 ;mov ah,Set_DMA - 21084 00001FE0 B41A mov ah,1Ah - 21085 ;int 21h - 21086 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21087 00001FE2 E8D5E5 call int_21h_indirect - 21088 - 21089 ; Do the search - 21090 - 21091 00001FE5 BA5500 mov dx,FCB-7 ; 55h - 21092 ;mov ah,Dir_Search_First - 21093 00001FE8 B411 mov ah,11h - 21094 ;int 21h - 21095 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21096 00001FEA E8CDE5 call int_21h_indirect - 21097 - 21098 - 21099 ;******************************** - 21100 ; Print volume ID info + 21066 ; Volume IDs are only findable via extended FCBs or find_first with attributes + 21067 ; of volume_id ONLY. + 21068 + 21069 00001FC7 BF5500 mov di,FCB-7 ; 55h ; Point to extended FCB beginning + 21070 00001FCA B0FF mov al,-1 ; 0FFh ; Tag to indicate Extention + 21071 00001FCC AA stosb + 21072 00001FCD 31C0 xor ax,ax ; Zero padding to volume label + 21073 00001FCF AB stosw + 21074 00001FD0 AB stosw + 21075 00001FD1 AA stosb + 21076 00001FD2 B008 mov al,ATTR_VOLUME_ID ; 8 ; Look for volume label + 21077 00001FD4 AA stosb + 21078 00001FD5 47 inc di ; Skip drive byte; it is already set + 21079 00001FD6 B90B00 mov cx,11 ; fill in remainder of file + 21080 00001FD9 B03F mov al,'?' + 21081 00001FDB F3AA rep stosb + 21082 + 21083 ; Set up transfer address (destination of search first information) + 21084 + 21085 00001FDD BA[399D] mov dx,DIRBUF + 21086 ;mov ah,Set_DMA + 21087 00001FE0 B41A mov ah,1Ah + 21088 ;int 21h + 21089 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21090 00001FE2 E8D5E5 call int_21h_indirect + 21091 + 21092 ; Do the search + 21093 + 21094 00001FE5 BA5500 mov dx,FCB-7 ; 55h + 21095 ;mov ah,Dir_Search_First + 21096 00001FE8 B411 mov ah,11h + 21097 ;int 21h + 21098 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21099 00001FEA E8CDE5 call int_21h_indirect + 21100 21101 - 21102 00001FED 50 push ax ;AC000; AX return from SEARCH_FIRST for VOL ID - 21103 00001FEE A05C00 mov al,[FCB] ; [5Ch] ;AC000; get drive letter - 21104 00001FF1 0440 add al,'@' ; add al,40h - 21105 00001FF3 3C40 cmp al,'@' - 21106 00001FF5 7505 jne short drvok - 21107 00001FF7 A0[079C] mov al,[CURDRV] - 21108 ;add al,capital_A - 21109 00001FFA 0441 add al,'A' - 21110 drvok: - 21111 00001FFC A2[B39D] mov [vol_drv],al ;AC000; get drive letter into argument - 21112 00001FFF 58 pop ax ;AC000; get return code back - 21113 00002000 08C0 or al,al ;AC000; volume label found? - 21114 00002002 7405 jz short Get_vol_name ;AC000; volume label exists - go get it - 21115 00002004 BA[F790] mov dx,VolMes_Ptr_2 ;AC000; set up no volume message - 21116 00002007 EB13 jmp short print_serial ;AC000; go print it - 21117 - 21118 Get_vol_name: - 21119 00002009 BF[6A9C] mov di,CHARBUF - 21120 0000200C 89FA mov dx,di - 21121 0000200E BE[419D] mov si,DIRBUF+8 ;AN000; 3/3/KK - 21122 00002011 B90B00 mov cx,11 ;AN000; 3/3/KK - 21123 00002014 F3A4 rep movsb ;AN000; 3/3/KK - 21124 - 21125 00002016 30C0 xor al,al ;AC000; store a zero to terminate the string - 21126 00002018 AA stosb - 21127 00002019 BA[0591] mov dx,VolMes_Ptr ;AC000; set up message - 21128 - 21129 print_serial: - 21130 - 21131 ; Attempt to get the volume serial number from the disk. If an error - 21132 ; occurs, do not print volume serial number. + 21102 ;******************************** + 21103 ; Print volume ID info + 21104 + 21105 00001FED 50 push ax ;AC000; AX return from SEARCH_FIRST for VOL ID + 21106 00001FEE A05C00 mov al,[FCB] ; [5Ch] ;AC000; get drive letter + 21107 00001FF1 0440 add al,'@' ; add al,40h + 21108 00001FF3 3C40 cmp al,'@' + 21109 00001FF5 7505 jne short drvok + 21110 00001FF7 A0[079C] mov al,[CURDRV] + 21111 ;add al,capital_A + 21112 00001FFA 0441 add al,'A' + 21113 drvok: + 21114 00001FFC A2[B39D] mov [vol_drv],al ;AC000; get drive letter into argument + 21115 00001FFF 58 pop ax ;AC000; get return code back + 21116 00002000 08C0 or al,al ;AC000; volume label found? + 21117 00002002 7405 jz short Get_vol_name ;AC000; volume label exists - go get it + 21118 00002004 BA[F790] mov dx,VolMes_Ptr_2 ;AC000; set up no volume message + 21119 00002007 EB13 jmp short print_serial ;AC000; go print it + 21120 + 21121 Get_vol_name: + 21122 00002009 BF[6A9C] mov di,CHARBUF + 21123 0000200C 89FA mov dx,di + 21124 0000200E BE[419D] mov si,DIRBUF+8 ;AN000; 3/3/KK + 21125 00002011 B90B00 mov cx,11 ;AN000; 3/3/KK + 21126 00002014 F3A4 rep movsb ;AN000; 3/3/KK + 21127 + 21128 00002016 30C0 xor al,al ;AC000; store a zero to terminate the string + 21129 00002018 AA stosb + 21130 00002019 BA[0591] mov dx,VolMes_Ptr ;AC000; set up message + 21131 + 21132 print_serial: 21133 - 21134 0000201C 52 push dx ;AN000; save message offset - 21135 ;mov ax,(GetSetMediaID SHL 8) - 21136 0000201D B80069 mov ax,6900h ;AC036; Get the volume serial info - 21137 00002020 8A1E5C00 mov bl,[FCB] ; [5Ch] ;AN000; get drive number from FCB - 21138 00002024 BA[199F] mov dx,vol_ioctl_buf ;AN000; target buffer - 21139 ;int 21h ;AN000; do the call - 21140 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21141 00002027 E890E5 call int_21h_indirect - 21142 ; DOS - 4.0 internal - GET/SET DISK SERIAL NUMBER - 21143 ; AL = 00h get serial number / 01h set serial number - 21144 ; BL = drive (0=default, 1=A, 2=B, etc) - 21145 ; DS:DX -> disk info - 21146 0000202A 5A pop dx ;AN000; get message offset back - 21147 0000202B 720B jc short printvol_end ;AN000; if error, just go print label - 21148 0000202D E8F833 call std_printf ;AC000; go print volume message - 21149 ;mov al,blank - 21150 00002030 B020 mov al,' ' ; 20h ;AN051; Print out a blank - 21151 00002032 E87901 call PRINT_CHAR ;AN051; before volume message - 21152 00002035 BA[1E91] mov dx,VolSerMes_Ptr ;AN000; get serial number message - 21153 printvol_end: - 21154 00002038 E9ED33 jmp std_printf ;AC000; go print and exit - 21155 - 21156 ; --------------------------------------------------------------------------- - 21157 - 21158 ;**************************************************************** - 21159 ;* - 21160 ;* ROUTINE: Set_ext_error_msg - 21161 ;* - 21162 ;* FUNCTION: Sets up extended error message for printing - 21163 ;* - 21164 ;* INPUT: return from INT 21 - 21165 ;* - 21166 ;* OUTPUT: extended error message set up in extended error - 21167 ;* buffer. + 21134 ; Attempt to get the volume serial number from the disk. If an error + 21135 ; occurs, do not print volume serial number. + 21136 + 21137 0000201C 52 push dx ;AN000; save message offset + 21138 ;mov ax,(GetSetMediaID SHL 8) + 21139 0000201D B80069 mov ax,6900h ;AC036; Get the volume serial info + 21140 00002020 8A1E5C00 mov bl,[FCB] ; [5Ch] ;AN000; get drive number from FCB + 21141 00002024 BA[199F] mov dx,vol_ioctl_buf ;AN000; target buffer + 21142 ;int 21h ;AN000; do the call + 21143 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21144 00002027 E890E5 call int_21h_indirect + 21145 ; DOS - 4.0 internal - GET/SET DISK SERIAL NUMBER + 21146 ; AL = 00h get serial number / 01h set serial number + 21147 ; BL = drive (0=default, 1=A, 2=B, etc) + 21148 ; DS:DX -> disk info + 21149 0000202A 5A pop dx ;AN000; get message offset back + 21150 0000202B 720B jc short printvol_end ;AN000; if error, just go print label + 21151 0000202D E8F833 call std_printf ;AC000; go print volume message + 21152 ;mov al,blank + 21153 00002030 B020 mov al,' ' ; 20h ;AN051; Print out a blank + 21154 00002032 E87901 call PRINT_CHAR ;AN051; before volume message + 21155 00002035 BA[1E91] mov dx,VolSerMes_Ptr ;AN000; get serial number message + 21156 printvol_end: + 21157 00002038 E9ED33 jmp std_printf ;AC000; go print and exit + 21158 + 21159 ; --------------------------------------------------------------------------- + 21160 + 21161 ;**************************************************************** + 21162 ;* + 21163 ;* ROUTINE: Set_ext_error_msg + 21164 ;* + 21165 ;* FUNCTION: Sets up extended error message for printing + 21166 ;* + 21167 ;* INPUT: return from INT 21 21168 ;* - 21169 ;**************************************************************** - 21170 - 21171 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21172 - 21173 ; MSDOS 6.0 - 21174 Set_Ext_Error_Msg: ;AN000; - 21175 0000203B E80D00 call get_ext_error_number ;AC022; get the extended error - 21176 0000203E C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 21177 ;mov byte [msg_disp_class],1 ;AN000; set up extended error msg class - 21178 00002043 BA[D78F] mov dx,extend_buf_ptr ;AC000; get extended message pointer - 21179 00002046 A3[D78F] mov [extend_buf_ptr],ax ;AN000; get message number in control block - 21180 00002049 F9 stc ;AN000; make sure carry is set - 21181 0000204A C3 retn ;AN000; return - 21182 - 21183 ; --------------------------------------------------------------------------- - 21184 - 21185 ;**************************************************************** - 21186 ;* - 21187 ;* ROUTINE: Get_ext_error_number - 21188 ;* - 21189 ;* FUNCTION: Does get extended error function call - 21190 ;* - 21191 ;* INPUT: return from INT 21 - 21192 ;* - 21193 ;* OUTPUT: AX - extended error number - 21194 ;* - 21195 ;**************************************************************** - 21196 - 21197 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21198 - 21199 ; MSDOS 6.0 - 21200 get_ext_error_number: ;AN022; + 21169 ;* OUTPUT: extended error message set up in extended error + 21170 ;* buffer. + 21171 ;* + 21172 ;**************************************************************** + 21173 + 21174 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21175 + 21176 ; MSDOS 6.0 + 21177 Set_Ext_Error_Msg: ;AN000; + 21178 0000203B E80D00 call get_ext_error_number ;AC022; get the extended error + 21179 0000203E C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 21180 ;mov byte [msg_disp_class],1 ;AN000; set up extended error msg class + 21181 00002043 BA[D78F] mov dx,extend_buf_ptr ;AC000; get extended message pointer + 21182 00002046 A3[D78F] mov [extend_buf_ptr],ax ;AN000; get message number in control block + 21183 00002049 F9 stc ;AN000; make sure carry is set + 21184 0000204A C3 retn ;AN000; return + 21185 + 21186 ; --------------------------------------------------------------------------- + 21187 + 21188 ;**************************************************************** + 21189 ;* + 21190 ;* ROUTINE: Get_ext_error_number + 21191 ;* + 21192 ;* FUNCTION: Does get extended error function call + 21193 ;* + 21194 ;* INPUT: return from INT 21 + 21195 ;* + 21196 ;* OUTPUT: AX - extended error number + 21197 ;* + 21198 ;**************************************************************** + 21199 + 21200 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 21201 - 21202 ;SaveReg - 21203 ;AN022; save registers - 21204 0000204B 53 push bx - 21205 0000204C 51 push cx - 21206 0000204D 52 push dx - 21207 0000204E 56 push si - 21208 0000204F 57 push di - 21209 00002050 55 push bp - 21210 00002051 06 push es - 21211 00002052 1E push ds - 21212 ;mov ah,GetExtendedError ;AN022; get extended error - 21213 00002053 B459 mov ah,59h - 21214 00002055 31DB xor bx,bx ;AN022; clear BX - 21215 00002057 CD21 int 21h ;AN022; - 21216 ; DOS - 3+ - GET EXTENDED ERROR CODE - 21217 ; BX = version code (0000h for DOS 3.x) - 21218 - 21219 ;RestoreReg - 21220 ;AN022; restore registers - 21221 00002059 1F pop ds - 21222 0000205A 07 pop es - 21223 0000205B 5D pop bp - 21224 0000205C 5F pop di - 21225 0000205D 5E pop si - 21226 0000205E 5A pop dx - 21227 0000205F 59 pop cx - 21228 00002060 5B pop bx - 21229 - 21230 00002061 C3 retn ;AN022; return - 21231 - 21232 ;============================================================================ - 21233 ; TCMD2A.ASM, MSDOS 6.0, 1991 - 21234 ;============================================================================ - 21235 ; 08/10/2018 - Retro DOS v3.0 - 21236 - 21237 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1379h - 21238 - 21239 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) - 21240 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 1DB7h + 21202 ; MSDOS 6.0 + 21203 get_ext_error_number: ;AN022; + 21204 + 21205 ;SaveReg + 21206 ;AN022; save registers + 21207 0000204B 53 push bx + 21208 0000204C 51 push cx + 21209 0000204D 52 push dx + 21210 0000204E 56 push si + 21211 0000204F 57 push di + 21212 00002050 55 push bp + 21213 00002051 06 push es + 21214 00002052 1E push ds + 21215 ;mov ah,GetExtendedError ;AN022; get extended error + 21216 00002053 B459 mov ah,59h + 21217 00002055 31DB xor bx,bx ;AN022; clear BX + 21218 00002057 CD21 int 21h ;AN022; + 21219 ; DOS - 3+ - GET EXTENDED ERROR CODE + 21220 ; BX = version code (0000h for DOS 3.x) + 21221 + 21222 ;RestoreReg + 21223 ;AN022; restore registers + 21224 00002059 1F pop ds + 21225 0000205A 07 pop es + 21226 0000205B 5D pop bp + 21227 0000205C 5F pop di + 21228 0000205D 5E pop si + 21229 0000205E 5A pop dx + 21230 0000205F 59 pop cx + 21231 00002060 5B pop bx + 21232 + 21233 00002061 C3 retn ;AN022; return + 21234 + 21235 ;============================================================================ + 21236 ; TCMD2A.ASM, MSDOS 6.0, 1991 + 21237 ;============================================================================ + 21238 ; 08/10/2018 - Retro DOS v3.0 + 21239 + 21240 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1379h 21241 - 21242 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21243 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 2361h + 21242 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) + 21243 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 1DB7h 21244 - 21245 ; --------------------------------------------------------------------------- - 21246 - 21247 ; MSDOS 6.0 - 21248 ;*** Version - display DOS version - 21249 ; - 21250 ; SYNTAX ver [/debug] - 21251 ; - 21252 ; /debug - display additional DOS configuration info - 21253 ; - 21254 ; ENTRY command-line tail is in PSP - 21255 ; - 21256 ; EXIT if successful, nothing - 21257 ; if parse fails, - 21258 ; parse error message is set up (for Std_EPrintf) - 21259 ; AX = system parser error code - 21260 ; DX = ptr to message block - 21261 ; we jump to CError - 21262 ; - 21263 ; EFFECTS - 21264 ; If parse fails, a parse error message is displayed. - 21265 ; Otherwise, version message is displayed. - 21266 ; If /debug is specified, additional DOS info is displayed. - 21267 - 21268 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21269 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21270 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM - 21271 VERSION: - 21272 ;assume ds:TRANGROUP,es:TRANGROUP - 21273 - 21274 ; Parse command line for /debug switch. - 21275 - 21276 00002062 BE8100 mov si,81h ; DS:SI = ptr to command tail - 21277 00002065 BF[4497] mov di,PARSE_VER ; ES:DI = ptr to parse block - 21278 00002068 31C9 xor cx,cx ; CX = # positional param's found - 21279 0000206A E8EE04 call Parse_With_Msg - 21280 - 21281 0000206D B301 mov bl,1 ; BL = flag = /debug present - 21282 ;cmp ax,RESULT_NO_ERROR - 21283 ;cmp ax,0 - 21284 ;je short verPrintVer ; something parsed - must be /debug - 21285 0000206F 09C0 or ax,ax - 21286 00002071 740A jz short verPrintVer - 21287 00002073 FECB dec bl ; BL = flag = no /debug present - 21288 ;cmp ax,END_OF_LINE ; -1 - 21289 00002075 83F8FF cmp ax,-1 ; 0FFFFh - 21290 - 21291 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM - 21292 %if 0 - 21293 je short verPrintVer ; reached end of line - ok - 21294 %else - 21295 00002078 7414 je short not_truever_sw - 21296 %endif - 21297 - 21298 ; The parse failed. Error message has been set up. - 21299 - 21300 0000207A E9A90C jmp cerror - 21301 - 21302 verPrintVer: - 21303 - 21304 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM - 21305 %if 1 - 21306 check_t_switch: - 21307 0000207D 813E[EDA5][6497] cmp word [PARSE1_SYN],SLASH_T_SYN ; "/T" ; /t switch - 21308 00002083 7509 jne short not_truever_sw - 21309 00002085 BA[8797] mov dx,RD5CMD_VER_MSG - 21310 00002088 B409 mov ah,STD_CON_STRING_OUTPUT ; 9 ; print the message - 21311 0000208A CD21 int 21h - 21312 0000208C EB47 jmp short verDone - 21313 not_truever_sw: - 21314 %endif - 21315 0000208E 53 push bx ; save /debug flag - 21316 0000208F E8E708 call CRLF2 - 21317 00002092 E84300 call PRINT_VERSION - 21318 00002095 E8E108 call CRLF2 - 21319 00002098 5B pop bx ; BL = /debug flag - 21320 00002099 08DB or bl,bl - 21321 0000209B 7438 jz short verDone ; /debug is false - we're done - 21322 - 21323 ;* For /debug, display DOS internal revision and DOS location - 21324 ; (low memory, HMA, or ROM). + 21245 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21246 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 2361h + 21247 + 21248 ; --------------------------------------------------------------------------- + 21249 + 21250 ; MSDOS 6.0 + 21251 ;*** Version - display DOS version + 21252 ; + 21253 ; SYNTAX ver [/debug] + 21254 ; + 21255 ; /debug - display additional DOS configuration info + 21256 ; + 21257 ; ENTRY command-line tail is in PSP + 21258 ; + 21259 ; EXIT if successful, nothing + 21260 ; if parse fails, + 21261 ; parse error message is set up (for Std_EPrintf) + 21262 ; AX = system parser error code + 21263 ; DX = ptr to message block + 21264 ; we jump to CError + 21265 ; + 21266 ; EFFECTS + 21267 ; If parse fails, a parse error message is displayed. + 21268 ; Otherwise, version message is displayed. + 21269 ; If /debug is specified, additional DOS info is displayed. + 21270 + 21271 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21272 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21273 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM + 21274 VERSION: + 21275 ;assume ds:TRANGROUP,es:TRANGROUP + 21276 + 21277 ; Parse command line for /debug switch. + 21278 + 21279 00002062 BE8100 mov si,81h ; DS:SI = ptr to command tail + 21280 00002065 BF[4497] mov di,PARSE_VER ; ES:DI = ptr to parse block + 21281 00002068 31C9 xor cx,cx ; CX = # positional param's found + 21282 0000206A E8EE04 call Parse_With_Msg + 21283 + 21284 0000206D B301 mov bl,1 ; BL = flag = /debug present + 21285 ;cmp ax,RESULT_NO_ERROR + 21286 ;cmp ax,0 + 21287 ;je short verPrintVer ; something parsed - must be /debug + 21288 0000206F 09C0 or ax,ax + 21289 00002071 740A jz short verPrintVer + 21290 00002073 FECB dec bl ; BL = flag = no /debug present + 21291 ;cmp ax,END_OF_LINE ; -1 + 21292 00002075 83F8FF cmp ax,-1 ; 0FFFFh + 21293 + 21294 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM + 21295 %if 0 + 21296 je short verPrintVer ; reached end of line - ok + 21297 %else + 21298 00002078 7414 je short not_truever_sw + 21299 %endif + 21300 + 21301 ; The parse failed. Error message has been set up. + 21302 + 21303 0000207A E9A90C jmp cerror + 21304 + 21305 verPrintVer: + 21306 + 21307 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM + 21308 %if 1 + 21309 check_t_switch: + 21310 0000207D 813E[EDA5][6497] cmp word [PARSE1_SYN],SLASH_T_SYN ; "/T" ; /t switch + 21311 00002083 7509 jne short not_truever_sw + 21312 00002085 BA[8797] mov dx,RD5CMD_VER_MSG + 21313 00002088 B409 mov ah,STD_CON_STRING_OUTPUT ; 9 ; print the message + 21314 0000208A CD21 int 21h + 21315 0000208C EB47 jmp short verDone + 21316 not_truever_sw: + 21317 %endif + 21318 0000208E 53 push bx ; save /debug flag + 21319 0000208F E8E708 call CRLF2 + 21320 00002092 E84300 call PRINT_VERSION + 21321 00002095 E8E108 call CRLF2 + 21322 00002098 5B pop bx ; BL = /debug flag + 21323 00002099 08DB or bl,bl + 21324 0000209B 7438 jz short verDone ; /debug is false - we're done 21325 - 21326 ; Bugbug: use symbols for bitmasks below. - 21327 - 21328 ;mov ax,(Set_CTRL_C_Trapping shl 8) + 6 ; M013 - 21329 0000209D B80633 mov ax,3306h - 21330 000020A0 CD21 int 21h - 21331 ; DOS - 5+ Get TRUE Version Number - 21332 ; (BL major, BH minor, DL revision, DH flags) - 21333 000020A2 88D0 mov al,dl ;revision number in dl; M013 - 21334 000020A4 88F7 mov bh,dh ;flags in dh now; M013 - 21335 ;M032 and al,7 ; AL = DOS internal revision - 21336 000020A6 3C19 cmp al,'Z'-'A' ; 25 ;M032 ; revision in A-to-Z range? - 21337 ;jbe short @f ;M032 ; A-to-Z revision ok - 21338 000020A8 7602 jbe short ver1 - 21339 ;mov al,0E9h - 21340 000020AA B0E9 mov al,'*'-'A' ; -23 ;M032 ; beyond Z, just say revision * - 21341 ;@@: - 21342 ver1: - 21343 - 21344 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 21345 %if 0 - 21346 add al,'A' ; 41h ; AL = DOS internal rev letter - 21347 %else - 21348 ; PCDOS 7.1 COMMAND.COM - 21349 000020AC 0430 add al,'0' ; 30h - 21350 %endif - 21351 - 21352 000020AE A2[B19D] mov [One_Char_Val],al - 21353 000020B1 BA[A992] mov dx,dosrev_ptr ; MSG_1090 - 21354 000020B4 E87133 call std_printf ; print DOS internal revision - 21355 - 21356 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 21357 %if 1 - 21358 000020B7 08D2 or dl,dl - 21359 000020B9 741A jz short verDone ; Revision 0 - 21360 %endif - 21361 - 21362 000020BB B104 mov cl,4 - 21363 000020BD D2EF shr bh,cl ; CY = DOS in ROM - 21364 000020BF 7209 jc short verRom - 21365 000020C1 D0EF shr bh,1 ; CY = DOS in HMA - 21366 000020C3 720A jc short verHma - 21367 - 21368 ; DOS isn't in ROM or HMA, so it must be in lower memory. - 21369 - 21370 ;mov dx,offset TRANGROUP:DosLow_Ptr - 21371 000020C5 BA[BD92] mov dx,DosLow_Ptr ; MSG_1093 - 21372 000020C8 EB08 jmp short verPrintLoc - 21373 verRom: - 21374 ;mov dx,offset TRANGROUP:DosRom_Ptr - 21375 000020CA BA[B792] mov dx,DosRom_Ptr ; MSG_1091 - 21376 000020CD EB03 jmp short verPrintLoc - 21377 verHma: - 21378 ;mov dx,offset TRANGROUP:DosHma_Ptr - 21379 000020CF BA[BA92] mov dx,DosHma_Ptr ; MSG_1092 - 21380 verPrintLoc: - 21381 000020D2 E85333 call std_printf - 21382 verDone: - 21383 000020D5 E9A108 jmp CRLF2 - 21384 - 21385 ; 21/02/2023 - 21386 ; ; MSDOS 3.3 - 21387 ;VERSION: - 21388 ; call CRLF2 - 21389 ; call PRINT_VERSION - 21390 ; jmp CRLF2 - 21391 - 21392 ; =============== S U B R O U T I N E ======================================= - 21393 - 21394 ; 21/02/2023 - Retro DOS v4.0 - 21395 PRINT_VERSION: - 21396 ;mov ah,GET_VERSION ; 30h - 21397 000020D8 B430 mov ah,30h - 21398 000020DA CD21 int 21h ; DOS - GET DOS VERSION - 21399 ; Return: AL = major version number (00h for DOS 1.x) - 21400 000020DC 50 push ax - 21401 000020DD 30E4 xor ah,ah - 21402 000020DF A3[AD9D] mov [Major_Ver_Num],ax - 21403 000020E2 58 pop ax - 21404 000020E3 86E0 xchg ah,al - 21405 000020E5 30E4 xor ah,ah - 21406 000020E7 A3[AF9D] mov [Minor_Ver_Num],ax - 21407 000020EA BA[F490] mov dx,VerMes_Ptr ; MSG_1040 - 21408 000020ED E93833 jmp std_printf - 21409 - 21410 ; =============== S U B R O U T I N E ======================================= - 21411 - 21412 ; 21/02/2023 - Retro DOS v4.0 - 21413 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21414 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 21415 - 21416 PRINT_PROMPT: - 21417 - 21418 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 21419 %if 0 - 21420 push ds - 21421 push cs - 21422 pop ds ; Make sure DS is in TRANGROUP - 21423 push es - 21424 call find_prompt ; Look for prompt string - 21425 jc short PP0 ; Can't find one - 21426 cmp byte [es:di],0 - 21427 jnz short PP1 - 21428 PP0: ; Use default prompt - 21429 call PRINT_DRIVE - 21430 mov al,'>' - 21431 ;mov al,SYM - 21432 call PRINT_CHAR - 21433 jmp short PP5 - 21434 ;PP1: - 21435 ; mov al,[es:di] ; Get a char - 21436 ; inc di - 21437 ; or al,al - 21438 ; jz short PP5 ; Nul terminated - 21439 ; ; 21/02/2023 - 21440 ; cmp al,'$' ; 24h - 21441 ; ;cmp al,[DOLLAR] ; Meta character - 21442 ; jz short PP2 ; Nope - 21443 ; call PRINT_CHAR - 21444 ; jmp short PP1 - 21445 PP2: - 21446 mov al,[es:di] - 21447 inc di - 21448 ;mov bx,CLSSTRING+2 ; "[2J" - 21449 mov bx,PROMPT_TABLE-3 - 21450 or al,al - 21451 jz short PP5 - 21452 PP3: - 21453 add bx,3 - 21454 ; 21/02/2023 - 21455 call UPCONV ; MSDOS 5.0 (& 6.0) - 21456 ;call UPCONV_MAPCALL ; MSDOS 3.3 - 21457 cmp al,[bx] - 21458 jz short PP4 - 21459 cmp byte [bx],0 - 21460 jnz short PP3 - 21461 ;jmp short PP1 - 21462 ; 21/02/2023 - 21463 PP1: - 21464 mov al,[es:di] ; Get a char - 21465 inc di - 21466 or al,al - 21467 jz short PP5 ; Nul terminated - 21468 ; 21/02/2023 - 21469 cmp al,'$' ; 24h - 21470 ;cmp al,[DOLLAR] ; Meta character - 21471 jz short PP2 ; Nope - 21472 call PRINT_CHAR - 21473 jmp short PP1 - 21474 PP4: - 21475 push es - 21476 push di - 21477 push cs - 21478 pop es - 21479 call word [bx+1] - 21480 pop di + 21326 ;* For /debug, display DOS internal revision and DOS location + 21327 ; (low memory, HMA, or ROM). + 21328 + 21329 ; Bugbug: use symbols for bitmasks below. + 21330 + 21331 ;mov ax,(Set_CTRL_C_Trapping shl 8) + 6 ; M013 + 21332 0000209D B80633 mov ax,3306h + 21333 000020A0 CD21 int 21h + 21334 ; DOS - 5+ Get TRUE Version Number + 21335 ; (BL major, BH minor, DL revision, DH flags) + 21336 000020A2 88D0 mov al,dl ;revision number in dl; M013 + 21337 000020A4 88F7 mov bh,dh ;flags in dh now; M013 + 21338 ;M032 and al,7 ; AL = DOS internal revision + 21339 000020A6 3C19 cmp al,'Z'-'A' ; 25 ;M032 ; revision in A-to-Z range? + 21340 ;jbe short @f ;M032 ; A-to-Z revision ok + 21341 000020A8 7602 jbe short ver1 + 21342 ;mov al,0E9h + 21343 000020AA B0E9 mov al,'*'-'A' ; -23 ;M032 ; beyond Z, just say revision * + 21344 ;@@: + 21345 ver1: + 21346 + 21347 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 21348 %if 0 + 21349 add al,'A' ; 41h ; AL = DOS internal rev letter + 21350 %else + 21351 ; PCDOS 7.1 COMMAND.COM + 21352 000020AC 0430 add al,'0' ; 30h + 21353 %endif + 21354 + 21355 000020AE A2[B19D] mov [One_Char_Val],al + 21356 000020B1 BA[A992] mov dx,dosrev_ptr ; MSG_1090 + 21357 000020B4 E87133 call std_printf ; print DOS internal revision + 21358 + 21359 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 21360 %if 1 + 21361 000020B7 08D2 or dl,dl + 21362 000020B9 741A jz short verDone ; Revision 0 + 21363 %endif + 21364 + 21365 000020BB B104 mov cl,4 + 21366 000020BD D2EF shr bh,cl ; CY = DOS in ROM + 21367 000020BF 7209 jc short verRom + 21368 000020C1 D0EF shr bh,1 ; CY = DOS in HMA + 21369 000020C3 720A jc short verHma + 21370 + 21371 ; DOS isn't in ROM or HMA, so it must be in lower memory. + 21372 + 21373 ;mov dx,offset TRANGROUP:DosLow_Ptr + 21374 000020C5 BA[BD92] mov dx,DosLow_Ptr ; MSG_1093 + 21375 000020C8 EB08 jmp short verPrintLoc + 21376 verRom: + 21377 ;mov dx,offset TRANGROUP:DosRom_Ptr + 21378 000020CA BA[B792] mov dx,DosRom_Ptr ; MSG_1091 + 21379 000020CD EB03 jmp short verPrintLoc + 21380 verHma: + 21381 ;mov dx,offset TRANGROUP:DosHma_Ptr + 21382 000020CF BA[BA92] mov dx,DosHma_Ptr ; MSG_1092 + 21383 verPrintLoc: + 21384 000020D2 E85333 call std_printf + 21385 verDone: + 21386 000020D5 E9A108 jmp CRLF2 + 21387 + 21388 ; 21/02/2023 + 21389 ; ; MSDOS 3.3 + 21390 ;VERSION: + 21391 ; call CRLF2 + 21392 ; call PRINT_VERSION + 21393 ; jmp CRLF2 + 21394 + 21395 ; =============== S U B R O U T I N E ======================================= + 21396 + 21397 ; 21/02/2023 - Retro DOS v4.0 + 21398 PRINT_VERSION: + 21399 ;mov ah,GET_VERSION ; 30h + 21400 000020D8 B430 mov ah,30h + 21401 000020DA CD21 int 21h ; DOS - GET DOS VERSION + 21402 ; Return: AL = major version number (00h for DOS 1.x) + 21403 000020DC 50 push ax + 21404 000020DD 30E4 xor ah,ah + 21405 000020DF A3[AD9D] mov [Major_Ver_Num],ax + 21406 000020E2 58 pop ax + 21407 000020E3 86E0 xchg ah,al + 21408 000020E5 30E4 xor ah,ah + 21409 000020E7 A3[AF9D] mov [Minor_Ver_Num],ax + 21410 000020EA BA[F490] mov dx,VerMes_Ptr ; MSG_1040 + 21411 000020ED E93833 jmp std_printf + 21412 + 21413 ; =============== S U B R O U T I N E ======================================= + 21414 + 21415 ; 21/02/2023 - Retro DOS v4.0 + 21416 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21417 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 21418 + 21419 PRINT_PROMPT: + 21420 + 21421 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 21422 %if 0 + 21423 push ds + 21424 push cs + 21425 pop ds ; Make sure DS is in TRANGROUP + 21426 push es + 21427 call find_prompt ; Look for prompt string + 21428 jc short PP0 ; Can't find one + 21429 cmp byte [es:di],0 + 21430 jnz short PP1 + 21431 PP0: ; Use default prompt + 21432 call PRINT_DRIVE + 21433 mov al,'>' + 21434 ;mov al,SYM + 21435 call PRINT_CHAR + 21436 jmp short PP5 + 21437 ;PP1: + 21438 ; mov al,[es:di] ; Get a char + 21439 ; inc di + 21440 ; or al,al + 21441 ; jz short PP5 ; Nul terminated + 21442 ; ; 21/02/2023 + 21443 ; cmp al,'$' ; 24h + 21444 ; ;cmp al,[DOLLAR] ; Meta character + 21445 ; jz short PP2 ; Nope + 21446 ; call PRINT_CHAR + 21447 ; jmp short PP1 + 21448 PP2: + 21449 mov al,[es:di] + 21450 inc di + 21451 ;mov bx,CLSSTRING+2 ; "[2J" + 21452 mov bx,PROMPT_TABLE-3 + 21453 or al,al + 21454 jz short PP5 + 21455 PP3: + 21456 add bx,3 + 21457 ; 21/02/2023 + 21458 call UPCONV ; MSDOS 5.0 (& 6.0) + 21459 ;call UPCONV_MAPCALL ; MSDOS 3.3 + 21460 cmp al,[bx] + 21461 jz short PP4 + 21462 cmp byte [bx],0 + 21463 jnz short PP3 + 21464 ;jmp short PP1 + 21465 ; 21/02/2023 + 21466 PP1: + 21467 mov al,[es:di] ; Get a char + 21468 inc di + 21469 or al,al + 21470 jz short PP5 ; Nul terminated + 21471 ; 21/02/2023 + 21472 cmp al,'$' ; 24h + 21473 ;cmp al,[DOLLAR] ; Meta character + 21474 jz short PP2 ; Nope + 21475 call PRINT_CHAR + 21476 jmp short PP1 + 21477 PP4: + 21478 push es + 21479 push di + 21480 push cs 21481 pop es - 21482 jmp short PP1 - 21483 PP5: - 21484 pop es ; Restore segments - 21485 pop ds - 21486 retn - 21487 %else - 21488 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 21489 ; PCDOS 7.1 COMMAND.COM - 21490 000020F0 1E push ds - 21491 000020F1 0E push cs - 21492 000020F2 1F pop ds ; Make sure DS is in TRANGROUP - 21493 000020F3 06 push es - 21494 000020F4 9C pushf - 21495 PP0: - 21496 000020F5 B8104A mov ax,4A10h ; SMARTDRV INSTALLATION CHECK (*) - 21497 000020F8 BB0000 mov bx,0 ; (*) - 21498 000020FB CD2F int 2Fh - 21499 000020FD 3DBEBA cmp ax,0BABEh ; 0BABEh if installed - 21500 00002100 7504 jnz short PP1 - 21501 ;cmp cx,0 ; number of dirty cache elements - 21502 00002102 21C9 and cx,cx ; 03/08/2024 - 21503 00002104 7516 jnz short PP3 - 21504 PP1: - 21505 00002106 9D popf - 21506 00002107 E8AA05 call find_prompt ; Look for prompt string - 21507 0000210A 7206 jc short PP2 ; Can't find one - 21508 0000210C 26803D00 cmp byte [es:di],0 - 21509 00002110 752E jnz short PP4 - 21510 PP2: ; Use default prompt - 21511 00002112 1E push ds - 21512 00002113 07 pop es - 21513 00002114 E8AE00 call build_dir_for_prompt - 21514 00002117 E88A00 call PRINT_G - 21515 0000211A EB40 jmp short PP8 - 21516 PP3: - 21517 0000211C B8104A mov ax,4A10h ; SMARTDRV - FLUSH BUFFERS (**) - 21518 0000211F BB0100 mov bx,1 ; (**) - 21519 00002122 CD2F int 2Fh - 21520 00002124 EBCF jmp short PP0 - 21521 PP5: - 21522 00002126 268A05 mov al,[es:di] - 21523 00002129 47 inc di - 21524 ;mov bx,CLSSTRING+2 ; "[2J" - 21525 0000212A BB[0594] mov bx,PROMPT_TABLE-3 - 21526 0000212D 08C0 or al,al - 21527 0000212F 742B jz short PP8 - 21528 PP6: - 21529 00002131 83C303 add bx,3 - 21530 00002134 E85406 call UPCONV - 21531 00002137 3A07 cmp al,[bx] - 21532 00002139 7416 je short PP7 - 21533 0000213B 803F00 cmp byte [bx],0 - 21534 0000213E 75F1 jnz short PP6 - 21535 ;jmp short PP4 - 21536 PP4: - 21537 00002140 268A05 mov al,[es:di] ; Get a char - 21538 00002143 47 inc di - 21539 00002144 08C0 or al,al - 21540 00002146 74DE jz short PP5 ; Nul terminated - 21541 00002148 3C24 cmp al,'$' ; 24h ; Meta character - 21542 0000214A 74DA je short PP5 ; Nope - 21543 0000214C E85F00 call PRINT_CHAR - 21544 0000214F EBEF jmp short PP4 - 21545 PP7: - 21546 00002151 06 push es - 21547 00002152 57 push di - 21548 00002153 0E push cs - 21549 00002154 07 pop es - 21550 00002155 FF5701 call word [bx+1] - 21551 00002158 5F pop di - 21552 00002159 07 pop es - 21553 0000215A EBE4 jmp short PP4 - 21554 PP8: - 21555 0000215C 07 pop es ; Restore segments - 21556 0000215D 1F pop ds - 21557 0000215E C3 retn - 21558 - 21559 %endif - 21560 - 21561 ; --------------------------------------------------------------------------- - 21562 - 21563 PRINT_BACK: - 21564 ; 21/02/2023 - 21565 0000215F BA[F791] mov dx,dback_ptr - 21566 00002162 E9C332 jmp std_printf - 21567 - 21568 ; --------------------------------------------------------------------------- - 21569 - 21570 PRINT_EQ: - 21571 00002165 B03D mov al,'=' - 21572 00002167 EB45 jmp short PRINT_CHAR - 21573 - 21574 ; --------------------------------------------------------------------------- - 21575 - 21576 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 21577 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:223Eh - 21578 %if 1 - 21579 PRINT_R: ; Print [RetCode] as PROMPT - 21580 00002169 1E push ds - 21581 0000216A 8E1E[F59B] mov ds,[RESSEG] - 21582 0000216E A0[9A02] mov al,[RetCode] - 21583 00002171 1F pop ds - 21584 00002172 30E4 xor ah,ah - 21585 00002174 B20A mov dl,10 - 21586 00002176 BE[9C21] mov si,RetCode_str ; "000" - 21587 00002179 F6F2 div dl - 21588 0000217B 80C430 add ah,30h ; '0' - 21589 0000217E 886402 mov [si+2],ah - 21590 00002181 30E4 xor ah,ah - 21591 00002183 F6F2 div dl - 21592 00002185 053030 add ax,3030h - 21593 00002188 8904 mov [si],ax - 21594 0000218A 3C30 cmp al,30h ; '0' - 21595 0000218C 7507 jnz short Print_R_@ - 21596 0000218E 46 inc si - 21597 0000218F 80FC30 cmp ah,30h ; '0' - 21598 00002192 7501 jnz short Print_R_@ - 21599 00002194 46 inc si - 21600 Print_R_@: - 21601 00002195 8936[A09D] mov [string_ptr_2],si - 21602 00002199 F8 clc - 21603 0000219A EB46 jmp short Print_R_@@ - 21604 - 21605 ; --------------------------------------------------------------------------- - 21606 RetCode_str: - 21607 0000219C 30303000 db '000',0 + 21482 call word [bx+1] + 21483 pop di + 21484 pop es + 21485 jmp short PP1 + 21486 PP5: + 21487 pop es ; Restore segments + 21488 pop ds + 21489 retn + 21490 %else + 21491 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 21492 ; PCDOS 7.1 COMMAND.COM + 21493 000020F0 1E push ds + 21494 000020F1 0E push cs + 21495 000020F2 1F pop ds ; Make sure DS is in TRANGROUP + 21496 000020F3 06 push es + 21497 000020F4 9C pushf + 21498 PP0: + 21499 000020F5 B8104A mov ax,4A10h ; SMARTDRV INSTALLATION CHECK (*) + 21500 000020F8 BB0000 mov bx,0 ; (*) + 21501 000020FB CD2F int 2Fh + 21502 000020FD 3DBEBA cmp ax,0BABEh ; 0BABEh if installed + 21503 00002100 7504 jnz short PP1 + 21504 ;cmp cx,0 ; number of dirty cache elements + 21505 00002102 21C9 and cx,cx ; 03/08/2024 + 21506 00002104 7516 jnz short PP3 + 21507 PP1: + 21508 00002106 9D popf + 21509 00002107 E8AA05 call find_prompt ; Look for prompt string + 21510 0000210A 7206 jc short PP2 ; Can't find one + 21511 0000210C 26803D00 cmp byte [es:di],0 + 21512 00002110 752E jnz short PP4 + 21513 PP2: ; Use default prompt + 21514 00002112 1E push ds + 21515 00002113 07 pop es + 21516 00002114 E8AE00 call build_dir_for_prompt + 21517 00002117 E88A00 call PRINT_G + 21518 0000211A EB40 jmp short PP8 + 21519 PP3: + 21520 0000211C B8104A mov ax,4A10h ; SMARTDRV - FLUSH BUFFERS (**) + 21521 0000211F BB0100 mov bx,1 ; (**) + 21522 00002122 CD2F int 2Fh + 21523 00002124 EBCF jmp short PP0 + 21524 PP5: + 21525 00002126 268A05 mov al,[es:di] + 21526 00002129 47 inc di + 21527 ;mov bx,CLSSTRING+2 ; "[2J" + 21528 0000212A BB[0594] mov bx,PROMPT_TABLE-3 + 21529 0000212D 08C0 or al,al + 21530 0000212F 742B jz short PP8 + 21531 PP6: + 21532 00002131 83C303 add bx,3 + 21533 00002134 E85406 call UPCONV + 21534 00002137 3A07 cmp al,[bx] + 21535 00002139 7416 je short PP7 + 21536 0000213B 803F00 cmp byte [bx],0 + 21537 0000213E 75F1 jnz short PP6 + 21538 ;jmp short PP4 + 21539 PP4: + 21540 00002140 268A05 mov al,[es:di] ; Get a char + 21541 00002143 47 inc di + 21542 00002144 08C0 or al,al + 21543 00002146 74DE jz short PP5 ; Nul terminated + 21544 00002148 3C24 cmp al,'$' ; 24h ; Meta character + 21545 0000214A 74DA je short PP5 ; Nope + 21546 0000214C E85F00 call PRINT_CHAR + 21547 0000214F EBEF jmp short PP4 + 21548 PP7: + 21549 00002151 06 push es + 21550 00002152 57 push di + 21551 00002153 0E push cs + 21552 00002154 07 pop es + 21553 00002155 FF5701 call word [bx+1] + 21554 00002158 5F pop di + 21555 00002159 07 pop es + 21556 0000215A EBE4 jmp short PP4 + 21557 PP8: + 21558 0000215C 07 pop es ; Restore segments + 21559 0000215D 1F pop ds + 21560 0000215E C3 retn + 21561 + 21562 %endif + 21563 + 21564 ; --------------------------------------------------------------------------- + 21565 + 21566 PRINT_BACK: + 21567 ; 21/02/2023 + 21568 0000215F BA[F791] mov dx,dback_ptr + 21569 00002162 E9C332 jmp std_printf + 21570 + 21571 ; --------------------------------------------------------------------------- + 21572 + 21573 PRINT_EQ: + 21574 00002165 B03D mov al,'=' + 21575 00002167 EB45 jmp short PRINT_CHAR + 21576 + 21577 ; --------------------------------------------------------------------------- + 21578 + 21579 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 21580 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:223Eh + 21581 %if 1 + 21582 PRINT_R: ; Print [RetCode] as PROMPT + 21583 00002169 1E push ds + 21584 0000216A 8E1E[F59B] mov ds,[RESSEG] + 21585 0000216E A0[9A02] mov al,[RetCode] + 21586 00002171 1F pop ds + 21587 00002172 30E4 xor ah,ah + 21588 00002174 B20A mov dl,10 + 21589 00002176 BE[9C21] mov si,RetCode_str ; "000" + 21590 00002179 F6F2 div dl + 21591 0000217B 80C430 add ah,30h ; '0' + 21592 0000217E 886402 mov [si+2],ah + 21593 00002181 30E4 xor ah,ah + 21594 00002183 F6F2 div dl + 21595 00002185 053030 add ax,3030h + 21596 00002188 8904 mov [si],ax + 21597 0000218A 3C30 cmp al,30h ; '0' + 21598 0000218C 7507 jnz short Print_R_@ + 21599 0000218E 46 inc si + 21600 0000218F 80FC30 cmp ah,30h ; '0' + 21601 00002192 7501 jnz short Print_R_@ + 21602 00002194 46 inc si + 21603 Print_R_@: + 21604 00002195 8936[A09D] mov [string_ptr_2],si + 21605 00002199 F8 clc + 21606 0000219A EB46 jmp short Print_R_@@ + 21607 21608 ; --------------------------------------------------------------------------- - 21609 ;; 'PROMPT $R' test for PCDOS 7.1 COMMAND.COM - Erdogan Tan - August 6, 2024 - 21610 ; - 21611 ; [org 100h] - 21612 ; - 21613 ; ;mov ah,09h - 21614 ; ;mov dx,program_name - 21615 ; ;int 21h - 21616 ; call print_msg - 21617 ; - 21618 ; mov al,255 ; Return Code - 21619 ; mov ah,4Ch - 21620 ; int 21h - 21621 ;hang: - 21622 ; ;sti - 21623 ; jmp short hang - 21624 ; - 21625 ;print_msg: - 21626 ; mov ah,0Eh - 21627 ; mov bx,7 - 21628 ; mov si,program_name - 21629 ;nextchr: - 21630 ; lodsb - 21631 ; or al,al - 21632 ; jz short pmsg_end - 21633 ; int 10h - 21634 ; jmp short nextchr - 21635 ;pmsg_end: - 21636 ; retn - 21637 ; - 21638 ;program_name: - 21639 ; db 0Dh,0Ah - 21640 ; db "IBM PCDOS 7.1 COMMAND.COM (Prompt " - 21641 ; db 24h,"R) Return Code Test Program" + 21609 RetCode_str: + 21610 0000219C 30303000 db '000',0 + 21611 ; --------------------------------------------------------------------------- + 21612 ;; 'PROMPT $R' test for PCDOS 7.1 COMMAND.COM - Erdogan Tan - August 6, 2024 + 21613 ; + 21614 ; [org 100h] + 21615 ; + 21616 ; ;mov ah,09h + 21617 ; ;mov dx,program_name + 21618 ; ;int 21h + 21619 ; call print_msg + 21620 ; + 21621 ; mov al,255 ; Return Code + 21622 ; mov ah,4Ch + 21623 ; int 21h + 21624 ;hang: + 21625 ; ;sti + 21626 ; jmp short hang + 21627 ; + 21628 ;print_msg: + 21629 ; mov ah,0Eh + 21630 ; mov bx,7 + 21631 ; mov si,program_name + 21632 ;nextchr: + 21633 ; lodsb + 21634 ; or al,al + 21635 ; jz short pmsg_end + 21636 ; int 10h + 21637 ; jmp short nextchr + 21638 ;pmsg_end: + 21639 ; retn + 21640 ; + 21641 ;program_name: 21642 ; db 0Dh,0Ah - 21643 ; db "(Erdogan Tan - 06/08/2024)" - 21644 ; ;db 0Dh,0Ah,"$" - 21645 ; db 0Dh,0Ah,0 - 21646 - 21647 %endif - 21648 - 21649 ; --------------------------------------------------------------------------- - 21650 - 21651 PRINT_ESC: - 21652 000021A0 B01B mov al,1Bh - 21653 000021A2 EB0A jmp short PRINT_CHAR - 21654 - 21655 ; --------------------------------------------------------------------------- - 21656 - 21657 ; 21/02/2023 - 21658 PRINT_G: - 21659 ;mov al,[RABRACKET] - 21660 000021A4 B03E mov al,'>' ; 3Eh - 21661 000021A6 EB06 jmp short PRINT_CHAR - 21662 - 21663 ; --------------------------------------------------------------------------- - 21664 - 21665 ; 21/02/2023 - 21666 PRINT_L: - 21667 ;mov al,[LABRACKET] - 21668 000021A8 B03C mov al,'<' ; 3Ch - 21669 000021AA EB02 jmp short PRINT_CHAR - 21670 - 21671 ; --------------------------------------------------------------------------- - 21672 - 21673 ; 21/02/2023 - 21674 Print_B: - 21675 ;mov al,[VBAR] - 21676 000021AC B07C mov al,'|' ; 7Ch - 21677 - 21678 ; =============== S U B R O U T I N E ======================================= - 21679 - 21680 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21681 PRINT_CHAR: - 21682 ; MSDOS 6.0 - 21683 - 21684 ; Bugbug: Why bother with ds,es here? - 21685 - 21686 000021AE 06 push es - 21687 000021AF 1E push ds - 21688 000021B0 07 pop es - 21689 000021B1 57 push di - 21690 000021B2 52 push dx - 21691 000021B3 88C2 mov dl,al ;AC000; Get char into al - 21692 ;mov ah,STD_CON_OUTPUT - 21693 ;AC000; print the char to stdout - 21694 000021B5 B402 mov ah,2 - 21695 000021B7 CD21 int 21h ;AC000; - 21696 000021B9 5A pop dx - 21697 000021BA 5F pop di - 21698 000021BB 07 pop es - 21699 000021BC C3 retn - 21700 - 21701 ; --------------------------------------------------------------------------- - 21702 - 21703 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21704 PRINT_DRIVE: - 21705 ;mov ah,GET_DEFAULT_DRIVE ; 19h - 21706 000021BD B419 mov ah,19h - 21707 000021BF CD21 int 21h ; DOS - GET DEFAULT DISK NUMBER - 21708 000021C1 0441 add al,'A' - 21709 ;add al,[CAPITAL_A] - 21710 ;call PRINT_CHAR - 21711 ;retn - 21712 ; 21/02/2023 - 21713 000021C3 EBE9 jmp short PRINT_CHAR - 21714 - 21715 ; --------------------------------------------------------------------------- - 21716 - 21717 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21718 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1EB6h + 21643 ; db "IBM PCDOS 7.1 COMMAND.COM (Prompt " + 21644 ; db 24h,"R) Return Code Test Program" + 21645 ; db 0Dh,0Ah + 21646 ; db "(Erdogan Tan - 06/08/2024)" + 21647 ; ;db 0Dh,0Ah,"$" + 21648 ; db 0Dh,0Ah,0 + 21649 + 21650 %endif + 21651 + 21652 ; --------------------------------------------------------------------------- + 21653 + 21654 PRINT_ESC: + 21655 000021A0 B01B mov al,1Bh + 21656 000021A2 EB0A jmp short PRINT_CHAR + 21657 + 21658 ; --------------------------------------------------------------------------- + 21659 + 21660 ; 21/02/2023 + 21661 PRINT_G: + 21662 ;mov al,[RABRACKET] + 21663 000021A4 B03E mov al,'>' ; 3Eh + 21664 000021A6 EB06 jmp short PRINT_CHAR + 21665 + 21666 ; --------------------------------------------------------------------------- + 21667 + 21668 ; 21/02/2023 + 21669 PRINT_L: + 21670 ;mov al,[LABRACKET] + 21671 000021A8 B03C mov al,'<' ; 3Ch + 21672 000021AA EB02 jmp short PRINT_CHAR + 21673 + 21674 ; --------------------------------------------------------------------------- + 21675 + 21676 ; 21/02/2023 + 21677 Print_B: + 21678 ;mov al,[VBAR] + 21679 000021AC B07C mov al,'|' ; 7Ch + 21680 + 21681 ; =============== S U B R O U T I N E ======================================= + 21682 + 21683 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21684 PRINT_CHAR: + 21685 ; MSDOS 6.0 + 21686 + 21687 ; Bugbug: Why bother with ds,es here? + 21688 + 21689 000021AE 06 push es + 21690 000021AF 1E push ds + 21691 000021B0 07 pop es + 21692 000021B1 57 push di + 21693 000021B2 52 push dx + 21694 000021B3 88C2 mov dl,al ;AC000; Get char into al + 21695 ;mov ah,STD_CON_OUTPUT + 21696 ;AC000; print the char to stdout + 21697 000021B5 B402 mov ah,2 + 21698 000021B7 CD21 int 21h ;AC000; + 21699 000021B9 5A pop dx + 21700 000021BA 5F pop di + 21701 000021BB 07 pop es + 21702 000021BC C3 retn + 21703 + 21704 ; --------------------------------------------------------------------------- + 21705 + 21706 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21707 PRINT_DRIVE: + 21708 ;mov ah,GET_DEFAULT_DRIVE ; 19h + 21709 000021BD B419 mov ah,19h + 21710 000021BF CD21 int 21h ; DOS - GET DEFAULT DISK NUMBER + 21711 000021C1 0441 add al,'A' + 21712 ;add al,[CAPITAL_A] + 21713 ;call PRINT_CHAR + 21714 ;retn + 21715 ; 21/02/2023 + 21716 000021C3 EBE9 jmp short PRINT_CHAR + 21717 + 21718 ; --------------------------------------------------------------------------- 21719 - 21720 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21721 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2460h + 21720 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21721 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1EB6h 21722 - 21723 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 21724 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:229Ch + 21723 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21724 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2460h 21725 - 21726 build_dir_for_prompt: - 21727 000021C5 30D2 xor dl,dl - 21728 000021C7 BE[399D] mov si,BWDBUF - 21729 000021CA 89F7 mov di,si - 21730 000021CC A0[079C] mov al,[CURDRV] - 21731 000021CF 0441 add al,'A' - 21732 000021D1 B43A mov ah,':' - 21733 000021D3 AB stosw - 21734 000021D4 A0[FA9B] mov al,[DIRCHAR] - 21735 000021D7 AA stosb - 21736 000021D8 87F7 xchg si,di - 21737 000021DA 893E[A09D] mov [string_ptr_2],di - 21738 ;mov ah,CURRENT_DIR ; 47h - 21739 000021DE B447 mov ah,47h - 21740 000021E0 CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY - 21741 ; DL = drive (0=default,1=A,etc.) - 21742 ; DS:SI points to 64-byte buffer area - 21743 ;mov dx,STRINGBUF2PTR ; MSDOS 3.3 - 21744 Print_R_@@: ; 06/08/2024 - 21745 000021E2 BA[DF91] mov dx,string_buf_ptr - 21746 000021E5 7303 jnc short doprint - 21747 ;mov dx,BADCURDRVPTR ; MSDOS 3.3 - 21748 000021E7 BA[A190] mov dx,BADCURDRV - 21749 doprint: - 21750 ;call std_printf - 21751 ;retn - 21752 000021EA E93B32 jmp std_printf - 21753 - 21754 ; =============== S U B R O U T I N E ======================================= - 21755 - 21756 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21757 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1EDFh + 21726 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 21727 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:229Ch + 21728 + 21729 build_dir_for_prompt: + 21730 000021C5 30D2 xor dl,dl + 21731 000021C7 BE[399D] mov si,BWDBUF + 21732 000021CA 89F7 mov di,si + 21733 000021CC A0[079C] mov al,[CURDRV] + 21734 000021CF 0441 add al,'A' + 21735 000021D1 B43A mov ah,':' + 21736 000021D3 AB stosw + 21737 000021D4 A0[FA9B] mov al,[DIRCHAR] + 21738 000021D7 AA stosb + 21739 000021D8 87F7 xchg si,di + 21740 000021DA 893E[A09D] mov [string_ptr_2],di + 21741 ;mov ah,CURRENT_DIR ; 47h + 21742 000021DE B447 mov ah,47h + 21743 000021E0 CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY + 21744 ; DL = drive (0=default,1=A,etc.) + 21745 ; DS:SI points to 64-byte buffer area + 21746 ;mov dx,STRINGBUF2PTR ; MSDOS 3.3 + 21747 Print_R_@@: ; 06/08/2024 + 21748 000021E2 BA[DF91] mov dx,string_buf_ptr + 21749 000021E5 7303 jnc short doprint + 21750 ;mov dx,BADCURDRVPTR ; MSDOS 3.3 + 21751 000021E7 BA[A190] mov dx,BADCURDRV + 21752 doprint: + 21753 ;call std_printf + 21754 ;retn + 21755 000021EA E93B32 jmp std_printf + 21756 + 21757 ; =============== S U B R O U T I N E ======================================= 21758 - 21759 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 21760 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:22C5h + 21759 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21760 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1EDFh 21761 - 21762 build_dir_for_chdir: - 21763 000021ED E80D00 call build_dir_string - 21764 000021F0 BA[399D] mov dx,DIRBUF - 21765 000021F3 8916[A09D] mov [string_ptr_2],dx - 21766 ;mov dx,offset trangroup:string_buf_ptr ; MSDOS 6.0 - 21767 ;mov dx,STRINGBUF2PTR ; MSDOS 3.3 - 21768 000021F7 BA[DF91] mov dx,string_buf_ptr - 21769 ;call std_printf - 21770 ;retn - 21771 ; 21/02/2023 - 21772 ;jmp short doprint - 21773 000021FA E92B32 jmp std_printf - 21774 - 21775 ; =============== S U B R O U T I N E ======================================= - 21776 - 21777 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21778 build_dir_string: - 21779 000021FD 8A165C00 mov dl,[FCB] ; mov dl,[5Ch] - 21780 00002201 88D0 mov al,dl - 21781 00002203 0440 add al,'@' ; 40h - 21782 00002205 3C40 cmp al,'@' - 21783 00002207 7506 jne short gotdrive - 21784 00002209 0206[079C] add al,[CURDRV] - 21785 0000220D FEC0 inc al - 21786 gotdrive: - 21787 0000220F 50 push ax - 21788 00002210 BE[3C9D] mov si,BWDBUF+3 - 21789 ;mov ah,CURRENT_DIR ; 47h - 21790 00002213 B447 mov ah,47h - 21791 00002215 CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY - 21792 ; DL = drive (0=default,1=A,etc.) - 21793 ; DS:SI points to 64-byte buffer area - 21794 00002217 7305 jnc short dpbisok - 21795 00002219 0E push cs - 21796 0000221A 1F pop ds - 21797 0000221B E9040A jmp DRVBAD - 21798 dpbisok: - 21799 0000221E BF[399D] mov di,BWDBUF - 21800 00002221 89FA mov dx,di - 21801 00002223 58 pop ax - 21802 00002224 B43A mov ah,':' - 21803 00002226 AB stosw - 21804 00002227 A0[FA9B] mov al,[DIRCHAR] - 21805 0000222A AA stosb - 21806 0000222B C3 retn - 21807 - 21808 ; --------------------------------------------------------------------------- - 21809 - 21810 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21811 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1F1Fh + 21762 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 21763 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:22C5h + 21764 + 21765 build_dir_for_chdir: + 21766 000021ED E80D00 call build_dir_string + 21767 000021F0 BA[399D] mov dx,DIRBUF + 21768 000021F3 8916[A09D] mov [string_ptr_2],dx + 21769 ;mov dx,offset trangroup:string_buf_ptr ; MSDOS 6.0 + 21770 ;mov dx,STRINGBUF2PTR ; MSDOS 3.3 + 21771 000021F7 BA[DF91] mov dx,string_buf_ptr + 21772 ;call std_printf + 21773 ;retn + 21774 ; 21/02/2023 + 21775 ;jmp short doprint + 21776 000021FA E92B32 jmp std_printf + 21777 + 21778 ; =============== S U B R O U T I N E ======================================= + 21779 + 21780 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21781 build_dir_string: + 21782 000021FD 8A165C00 mov dl,[FCB] ; mov dl,[5Ch] + 21783 00002201 88D0 mov al,dl + 21784 00002203 0440 add al,'@' ; 40h + 21785 00002205 3C40 cmp al,'@' + 21786 00002207 7506 jne short gotdrive + 21787 00002209 0206[079C] add al,[CURDRV] + 21788 0000220D FEC0 inc al + 21789 gotdrive: + 21790 0000220F 50 push ax + 21791 00002210 BE[3C9D] mov si,BWDBUF+3 + 21792 ;mov ah,CURRENT_DIR ; 47h + 21793 00002213 B447 mov ah,47h + 21794 00002215 CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY + 21795 ; DL = drive (0=default,1=A,etc.) + 21796 ; DS:SI points to 64-byte buffer area + 21797 00002217 7305 jnc short dpbisok + 21798 00002219 0E push cs + 21799 0000221A 1F pop ds + 21800 0000221B E9040A jmp DRVBAD + 21801 dpbisok: + 21802 0000221E BF[399D] mov di,BWDBUF + 21803 00002221 89FA mov dx,di + 21804 00002223 58 pop ax + 21805 00002224 B43A mov ah,':' + 21806 00002226 AB stosw + 21807 00002227 A0[FA9B] mov al,[DIRCHAR] + 21808 0000222A AA stosb + 21809 0000222B C3 retn + 21810 + 21811 ; --------------------------------------------------------------------------- 21812 - 21813 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21814 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:24C9h + 21813 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21814 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:1F1Fh 21815 - 21816 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 21817 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2305h - 21818 PATH: - 21819 ; MSDOS 6.0 - 21820 0000222C 30C0 xor al,al ;AN049; Set up holding buffer - 21821 0000222E BF[2399] mov di,SRCXNAME ;AN049; for PATH while parsing - 21822 00002231 AA stosb ;AN049; Initialize PATH to null - 21823 00002232 4F dec di ;AN049; point to the start of buffer - 21824 00002233 E8600D call PGETARG ; Pre scan for arguments - 21825 00002236 7460 jz short disppath ; Print the current path - 21826 ;cmp al,semicolon ;AC049; NUL path argument? - 21827 00002238 3C3B cmp al,';' ; 3Bh - 21828 0000223A 7503 jne short pathslp ;AC049; - 21829 0000223C 46 inc si ;AN049; point past semicolon - 21830 0000223D EB1B jmp short scan_white ;AC049; Yes - make sure nothing else on line - 21831 pathslp: ; Get the user specified path - 21832 0000223F AC lodsb ; Get a character - 21833 00002240 3C0D cmp al,0Dh - 21834 ;cmp al,END_OF_LINE_IN ;AC049; Is it end of line? - 21835 00002242 7434 je short path_eol ;AC049; yes - end of command - 21836 00002244 E81A05 call testkanj ;See if DBCS - 21837 00002247 7405 jz short notkanj2 ;No - continue - 21838 00002249 AA stosb ;AC049; Yes - store the first byte - 21839 0000224A AC lodsb ;skip second byte of DBCS - 21840 path_hold: ;AN049; - 21841 0000224B AA stosb ;AC049; Store a byte in the PATH buffer - 21842 0000224C EBF1 jmp short pathslp ;continue parsing - 21843 notkanj2: - 21844 0000224E E83A05 call UPCONV ;upper case the character - 21845 - 21846 00002251 3C3B cmp al,';' ; 3Bh - 21847 ;cmp al,semicolon ;AC049; ';' not a delimiter on PATH - 21848 00002253 74F6 je short path_hold ;AC049; go store it - 21849 00002255 E83607 call DELIM ;delimiter? - 21850 00002258 75F1 jnz short path_hold ;AC049; no - go store character - 21851 scan_white: ;AN049; make sure were at EOL - 21852 0000225A AC lodsb ;AN049; get a character - 21853 0000225B 3C0D cmp al,0Dh - 21854 ;cmp al,END_OF_LINE_IN ;AN049; end of line? - 21855 0000225D 7419 je short path_eol ;AN049; yes - go set path - 21856 0000225F 3C20 cmp al,' ' ; 20h - 21857 ;cmp al,blank ;AN049; whitespace? - 21858 00002261 74F7 je short scan_white ;AN049; yes - continue scanning - 21859 ;cmp al,9 - 21860 00002263 3C09 cmp al,tab_chr ; 9 ;AN049; whitespace? - 21861 00002265 74F3 je short scan_white ;AN049; yes - continue scanning - 21862 - 21863 00002267 BA[D78F] mov dx,extend_buf_ptr ;AN049; no - set up error message - 21864 ;mov word [extend_buf_ptr],1 ;AN049; get "Too many parameters" message number - 21865 0000226A C706[D78F]0100 mov word [extend_buf_ptr],MoreArgs_Ptr - 21866 ;mov byte [msg_disp_class],2 - 21867 ;AN049; set up parse error msg class - 21868 00002270 C606[D58F]02 mov byte [msg_disp_class],parse_msg_class - 21869 00002275 E9AE0A jmp cerror ;AN049; - 21870 path_eol: ;AN049; Parsing was clean - 21871 00002278 30C0 xor al,al ;AN049; null terminate the PATH - 21872 0000227A AA stosb ;AN049; buffer - 21873 0000227B E83104 call find_path ;AN049; Find PATH in environment - 21874 0000227E E80504 call delete_path ;AC049; Delete any offending name - 21875 00002281 E8BB04 call scan_double_null ;AC049; Scan to end of environment - 21876 00002284 E88B04 call move_name ;AC049; move in PATH= - 21877 00002287 BE[2399] mov si,SRCXNAME ;AN049; Set up source as PATH buffer - 21878 store_path: ;AN049; Store the PATH in the environment - 21879 0000228A AC lodsb ;AN049; Get a character - 21880 ;cmp al,END_OF_LINE_OUT ; 0 ;AN049; null character? - 21881 0000228B 20C0 and al,al ; al=0 ? - 21882 0000228D 7405 jz short got_paths ;AN049; yes - exit - 21883 0000228F E81B05 call store_char ;AN049; no - store character - 21884 00002292 EBF6 jmp short store_path ;AN049; continue - 21885 got_paths: ;AN049; we're finished - 21886 00002294 31C0 xor ax,ax ; null terminate the PATH in - 21887 00002296 AB stosw ; the environment - 21888 00002297 C3 retn - 21889 disppath: - 21890 00002298 E81404 call find_path ;AN049; - 21891 0000229B E80300 call print_path - 21892 ;call CRLF2 - 21893 ;retn - 21894 ; 21/02/2023 - 21895 0000229E E9D806 jmp CRLF2 - 21896 - 21897 ; =============== S U B R O U T I N E ======================================= - 21898 - 21899 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21900 print_path: - 21901 000022A1 26803D00 cmp byte [es:di],0 - 21902 000022A5 750A jnz short path1 - 21903 path0: - 21904 000022A7 BA[5191] mov dx,NULLPATH_PTR - 21905 000022AA 0E push cs - 21906 000022AB 07 pop es - 21907 000022AC 0E push cs - 21908 000022AD 1F pop ds - 21909 000022AE E97731 jmp std_printf - 21910 path1: - 21911 000022B1 06 push es - 21912 000022B2 1F pop ds - 21913 000022B3 83EF05 sub di,5 - 21914 000022B6 89FE mov si,di - 21915 000022B8 E89E04 call SCASB2 ; Look for null - 21916 ;cmp cx,0FFh ; 255 - 21917 ; 21/02/2023 - 21918 ;ch = 0 - 21919 000022BB 80F9FF cmp cl,255 - 21920 000022BE 74E7 je short path0 - 21921 000022C0 0E push cs - 21922 000022C1 07 pop es - 21923 000022C2 BF[96A3] mov di,Arg_Buf - 21924 ;mov dx,100h ; 256 - 21925 ;sub dx,cx - 21926 ;xchg dx,cx - 21927 ; 21/02/2023 - 21928 000022C5 F6D9 neg cl ; 256-cl - 21929 000022C7 F3A4 rep movsb - 21930 000022C9 BA[9991] mov dx,arg_buf_ptr - 21931 000022CC 0E push cs - 21932 000022CD 1F pop ds - 21933 000022CE E95731 jmp std_printf - 21934 - 21935 ; --------------------------------------------------------------------------- - 21936 - 21937 ; **************************************************************** - 21938 ; * - 21939 ; * ROUTINE: CLS - 21940 ; * - 21941 ; * FUNCTION: Clear the screen using INT 10h. If ANSI.SYS is - 21942 ; * installed, send a control string to clear the - 21943 ; * screen. - 21944 ; * - 21945 ; * INPUT: command line at offset 81H - 21946 ; * - 21947 ; * OUTPUT: none - 21948 ; * - 21949 ; **************************************************************** - 21950 - 21951 ; MSDOS 6.0 - 21952 - 21953 ANSI_installed equ 0FFh - 21954 - 21955 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 21956 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM - 21957 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 21958 CLS: - 21959 ;;mov ah,Mult_ANSI ;AN000; see if ANSI.SYS installed - 21960 ;mov ah,1Ah - 21961 ;mov al,0 ;AN000; - 21962 000022D1 B8001A mov ax,1A00h - 21963 000022D4 CD2F int 2Fh ;AN000; - 21964 ; - Multiplex - DOS 4+ ANSI.SYS internal - INSTALLATION CHECK - 21965 ; Return: AL = FFh if installed - 21966 000022D6 3CFF cmp al,ANSI_installed ;AN000; - 21967 000022D8 7429 je short ansicls ;AN000; installed - go do ANSI CLS - 21968 - 21969 check_lines: - 21970 ;mov ax,(IOCTL SHL 8) + generic_ioctl_handle ; 440Ch - 21971 000022DA B80C44 mov ax,440Ch ;AN000; get lines per page on display - 21972 ;mov bx,stdout ;AN000; lines for stdout - 21973 000022DD BB0100 mov bx,1 ; handle - 21974 ;;mov ch,ioc_sc ;AN000; type is display - 21975 ;mov ch,3 ; CON device - 21976 ;;mov cl,get_generic ;AN000; get information - 21977 ;mov cl,7Fh ; minor function, get display info - 21978 ; 25/04/2023 - 21979 000022E0 B97F03 mov cx,037Fh - 21980 000022E3 BA[079F] mov dx,Display_Ioctl ;AN000; - 21981 000022E6 CD21 int 21h ;AN000; - 21982 000022E8 720A jc short no_variable ;AN000; function had error, use default - 21983 ; 21/02/2023 - 21984 ; ds:dx = parameter block - 21985 ; --- https://stanislavs.org/helppc/int_21-44-c.html --- - 21986 ; offset 00h byte level (0 for DOS 4.0) - 21987 ; 01h byte reserved - 21988 ; 02h word length of following data - 21989 ; 04h word control flags - 21990 ; bit 0 set for blink, clear for intensity - 21991 ; bits 1 to 15 reserved - 21992 ; 06h byte mode type (1=text, 2=graphics) - 21993 ; 07h byte reserved - 21994 ; 08h word colors; 0=monochrome, n=bits per pixel - 21995 ; 0Ah word pixel columns - 21996 ; 0Ch word pixel rows - 21997 ; 0Eh word character columns - 21998 ; 10h word character rows - 21999 - 22000 ;mov ax,[LinPerPag] ; [Display_Ioctl+10h] - 22001 ; ;AN000; get number of rows returned - 22002 ;mov dh,al ;AN000; set number of rows - 22003 ;mov ax,[display_width] ; [Display_Ioctl+0Eh] - 22004 ; ;AN000; get number of columns returned - 22005 ;mov dl,al ;AN000; set number of columns - 22006 ; 21/02/2023 - 22007 000022EA 8A16[159F] mov dl,[display_width] - 22008 000022EE 8A36[179F] mov dh,[LinPerPag] - 22009 000022F2 EB3B jmp short regcls ;AN000; go do cls - 22010 - 22011 no_variable: - 22012 ;;mov bx,stdout ;AC000; set handle as stdout - 22013 ;mov bx,1 - 22014 ; bx = 1 - 22015 ;mov ax,IOCTL SHL 8 ;AC000; do ioctl - get device info - 22016 000022F4 B80044 mov ax,4400h - 22017 000022F7 CD21 int 21h ;AC000; - 22018 000022F9 F6C280 test dl,80h - 22019 ;test dl,devid_ISDEV ;AC000; is handle a device - 22020 000022FC 7405 jz short ansicls ;AC000; If a file put out ANSI - 22021 000022FE F6C210 test dl,10h - 22022 ;test dl,devid_SPECIAL ;AC000; - 22023 00002301 7505 jnz short cls_normal ;AC000; If not special CON, do ANSI - 22024 - 22025 ansicls: - 22026 00002303 E85200 call ansi_cls ;AN000; clear the screen - 22027 00002306 EB2C jmp short cls_ret ;AN000; exit - 22028 - 22029 ; Get video mode - 22030 - 22031 cls_normal: ;AC000; - 22032 ;mov ah,get_video_state ;AC000; set up to get video state - 22033 00002308 B40F mov ah,0Fh - 22034 ;int video_io_int ;AC000; do int 10h - BIOS video IO - 22035 0000230A CD10 int 10h - 22036 0000230C 3C03 cmp al,3 - 22037 ;cmp al,video_alpha ;AC000; see if in text mode - 22038 0000230E 760A jbe short DoAlpha - 22039 00002310 3C07 cmp al,7 - 22040 ;cmp al,video_bw ;AC000; see if black & white card - 22041 00002312 7406 je short DoAlpha - 22042 - 22043 ; We are in graphics mode. Bogus IBM ROM does not scroll correctly. We will - 22044 ; be just as bogus and set the mode that we just got. This will blank the - 22045 ; screen too. - 22046 - 22047 ;mov ah,set_video_mode ;AC000; set video mode call - 22048 00002314 B400 mov ah,0 - 22049 ;int video_io_int ;AC000; do int 10h - BIOS video IO - 22050 00002316 CD10 int 10h - 22051 00002318 EB1A jmp short cls_ret ;AC000; exit - 22052 - 22053 DoAlpha: - 22054 - 22055 ; Get video mode and number of columns to scroll - 22056 - 22057 ;M01 - INT 10 Function 0F doesn't reliably return the number of rows on some - 22058 ;M01 adaptors. We circumvent this by reaching directly into the BIOS data - 22059 ;M01 area - 22060 ;M01 Commented out code here is the original - 22061 ;M01 mov ah,get_video_state ;AC000; set up to get current video state - 22062 ;M01 int video_io_int ;AC000; do int 10h - BIOS video IO - 22063 ;M01 mov dl,ah - 22064 ;M01 mov dh,linesperpage ;AC000; have 25 rows on the screen - 22065 - 22066 ;M01 Following code lifted from a fix Compaq applied to ANSI - 22067 - 22068 0000231A 1E push ds - 22069 ;mov ax,ROMBIOS_DATA ; GET ROM Data segment M01 - 22070 0000231B B84000 mov ax,40h - 22071 0000231E 8ED8 mov ds,ax ; * M01 - 22072 - 22073 ;mov dx,[CRT_Cols] ; Get Columns - assume < 256 M01 - 22074 00002320 8A164A00 mov dl,[4Ah] - 22075 ;mov dh,[CRT_Rows] ; GET MAX NUM OF ROWS M01 - 22076 00002324 8A368400 mov dh,[84h] - 22077 00002328 1F pop ds ; M01 - 22078 - 22079 00002329 08F6 or dh,dh ; Q:ZERO M01 - 22080 0000232B 7502 jnz short regcls ; *JMP IF NO M01 + 21816 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21817 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:24C9h + 21818 + 21819 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 21820 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2305h + 21821 PATH: + 21822 ; MSDOS 6.0 + 21823 0000222C 30C0 xor al,al ;AN049; Set up holding buffer + 21824 0000222E BF[2399] mov di,SRCXNAME ;AN049; for PATH while parsing + 21825 00002231 AA stosb ;AN049; Initialize PATH to null + 21826 00002232 4F dec di ;AN049; point to the start of buffer + 21827 00002233 E8600D call PGETARG ; Pre scan for arguments + 21828 00002236 7460 jz short disppath ; Print the current path + 21829 ;cmp al,semicolon ;AC049; NUL path argument? + 21830 00002238 3C3B cmp al,';' ; 3Bh + 21831 0000223A 7503 jne short pathslp ;AC049; + 21832 0000223C 46 inc si ;AN049; point past semicolon + 21833 0000223D EB1B jmp short scan_white ;AC049; Yes - make sure nothing else on line + 21834 pathslp: ; Get the user specified path + 21835 0000223F AC lodsb ; Get a character + 21836 00002240 3C0D cmp al,0Dh + 21837 ;cmp al,END_OF_LINE_IN ;AC049; Is it end of line? + 21838 00002242 7434 je short path_eol ;AC049; yes - end of command + 21839 00002244 E81A05 call testkanj ;See if DBCS + 21840 00002247 7405 jz short notkanj2 ;No - continue + 21841 00002249 AA stosb ;AC049; Yes - store the first byte + 21842 0000224A AC lodsb ;skip second byte of DBCS + 21843 path_hold: ;AN049; + 21844 0000224B AA stosb ;AC049; Store a byte in the PATH buffer + 21845 0000224C EBF1 jmp short pathslp ;continue parsing + 21846 notkanj2: + 21847 0000224E E83A05 call UPCONV ;upper case the character + 21848 + 21849 00002251 3C3B cmp al,';' ; 3Bh + 21850 ;cmp al,semicolon ;AC049; ';' not a delimiter on PATH + 21851 00002253 74F6 je short path_hold ;AC049; go store it + 21852 00002255 E83607 call DELIM ;delimiter? + 21853 00002258 75F1 jnz short path_hold ;AC049; no - go store character + 21854 scan_white: ;AN049; make sure were at EOL + 21855 0000225A AC lodsb ;AN049; get a character + 21856 0000225B 3C0D cmp al,0Dh + 21857 ;cmp al,END_OF_LINE_IN ;AN049; end of line? + 21858 0000225D 7419 je short path_eol ;AN049; yes - go set path + 21859 0000225F 3C20 cmp al,' ' ; 20h + 21860 ;cmp al,blank ;AN049; whitespace? + 21861 00002261 74F7 je short scan_white ;AN049; yes - continue scanning + 21862 ;cmp al,9 + 21863 00002263 3C09 cmp al,tab_chr ; 9 ;AN049; whitespace? + 21864 00002265 74F3 je short scan_white ;AN049; yes - continue scanning + 21865 + 21866 00002267 BA[D78F] mov dx,extend_buf_ptr ;AN049; no - set up error message + 21867 ;mov word [extend_buf_ptr],1 ;AN049; get "Too many parameters" message number + 21868 0000226A C706[D78F]0100 mov word [extend_buf_ptr],MoreArgs_Ptr + 21869 ;mov byte [msg_disp_class],2 + 21870 ;AN049; set up parse error msg class + 21871 00002270 C606[D58F]02 mov byte [msg_disp_class],parse_msg_class + 21872 00002275 E9AE0A jmp cerror ;AN049; + 21873 path_eol: ;AN049; Parsing was clean + 21874 00002278 30C0 xor al,al ;AN049; null terminate the PATH + 21875 0000227A AA stosb ;AN049; buffer + 21876 0000227B E83104 call find_path ;AN049; Find PATH in environment + 21877 0000227E E80504 call delete_path ;AC049; Delete any offending name + 21878 00002281 E8BB04 call scan_double_null ;AC049; Scan to end of environment + 21879 00002284 E88B04 call move_name ;AC049; move in PATH= + 21880 00002287 BE[2399] mov si,SRCXNAME ;AN049; Set up source as PATH buffer + 21881 store_path: ;AN049; Store the PATH in the environment + 21882 0000228A AC lodsb ;AN049; Get a character + 21883 ;cmp al,END_OF_LINE_OUT ; 0 ;AN049; null character? + 21884 0000228B 20C0 and al,al ; al=0 ? + 21885 0000228D 7405 jz short got_paths ;AN049; yes - exit + 21886 0000228F E81B05 call store_char ;AN049; no - store character + 21887 00002292 EBF6 jmp short store_path ;AN049; continue + 21888 got_paths: ;AN049; we're finished + 21889 00002294 31C0 xor ax,ax ; null terminate the PATH in + 21890 00002296 AB stosw ; the environment + 21891 00002297 C3 retn + 21892 disppath: + 21893 00002298 E81404 call find_path ;AN049; + 21894 0000229B E80300 call print_path + 21895 ;call CRLF2 + 21896 ;retn + 21897 ; 21/02/2023 + 21898 0000229E E9D806 jmp CRLF2 + 21899 + 21900 ; =============== S U B R O U T I N E ======================================= + 21901 + 21902 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21903 print_path: + 21904 000022A1 26803D00 cmp byte [es:di],0 + 21905 000022A5 750A jnz short path1 + 21906 path0: + 21907 000022A7 BA[5191] mov dx,NULLPATH_PTR + 21908 000022AA 0E push cs + 21909 000022AB 07 pop es + 21910 000022AC 0E push cs + 21911 000022AD 1F pop ds + 21912 000022AE E97731 jmp std_printf + 21913 path1: + 21914 000022B1 06 push es + 21915 000022B2 1F pop ds + 21916 000022B3 83EF05 sub di,5 + 21917 000022B6 89FE mov si,di + 21918 000022B8 E89E04 call SCASB2 ; Look for null + 21919 ;cmp cx,0FFh ; 255 + 21920 ; 21/02/2023 + 21921 ;ch = 0 + 21922 000022BB 80F9FF cmp cl,255 + 21923 000022BE 74E7 je short path0 + 21924 000022C0 0E push cs + 21925 000022C1 07 pop es + 21926 000022C2 BF[96A3] mov di,Arg_Buf + 21927 ;mov dx,100h ; 256 + 21928 ;sub dx,cx + 21929 ;xchg dx,cx + 21930 ; 21/02/2023 + 21931 000022C5 F6D9 neg cl ; 256-cl + 21932 000022C7 F3A4 rep movsb + 21933 000022C9 BA[9991] mov dx,arg_buf_ptr + 21934 000022CC 0E push cs + 21935 000022CD 1F pop ds + 21936 000022CE E95731 jmp std_printf + 21937 + 21938 ; --------------------------------------------------------------------------- + 21939 + 21940 ; **************************************************************** + 21941 ; * + 21942 ; * ROUTINE: CLS + 21943 ; * + 21944 ; * FUNCTION: Clear the screen using INT 10h. If ANSI.SYS is + 21945 ; * installed, send a control string to clear the + 21946 ; * screen. + 21947 ; * + 21948 ; * INPUT: command line at offset 81H + 21949 ; * + 21950 ; * OUTPUT: none + 21951 ; * + 21952 ; **************************************************************** + 21953 + 21954 ; MSDOS 6.0 + 21955 + 21956 ANSI_installed equ 0FFh + 21957 + 21958 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 21959 ; 08/06/2023 - Retro DOS v4.2 COMMAND.COM + 21960 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 21961 CLS: + 21962 ;;mov ah,Mult_ANSI ;AN000; see if ANSI.SYS installed + 21963 ;mov ah,1Ah + 21964 ;mov al,0 ;AN000; + 21965 000022D1 B8001A mov ax,1A00h + 21966 000022D4 CD2F int 2Fh ;AN000; + 21967 ; - Multiplex - DOS 4+ ANSI.SYS internal - INSTALLATION CHECK + 21968 ; Return: AL = FFh if installed + 21969 000022D6 3CFF cmp al,ANSI_installed ;AN000; + 21970 000022D8 7429 je short ansicls ;AN000; installed - go do ANSI CLS + 21971 + 21972 check_lines: + 21973 ;mov ax,(IOCTL SHL 8) + generic_ioctl_handle ; 440Ch + 21974 000022DA B80C44 mov ax,440Ch ;AN000; get lines per page on display + 21975 ;mov bx,stdout ;AN000; lines for stdout + 21976 000022DD BB0100 mov bx,1 ; handle + 21977 ;;mov ch,ioc_sc ;AN000; type is display + 21978 ;mov ch,3 ; CON device + 21979 ;;mov cl,get_generic ;AN000; get information + 21980 ;mov cl,7Fh ; minor function, get display info + 21981 ; 25/04/2023 + 21982 000022E0 B97F03 mov cx,037Fh + 21983 000022E3 BA[079F] mov dx,Display_Ioctl ;AN000; + 21984 000022E6 CD21 int 21h ;AN000; + 21985 000022E8 720A jc short no_variable ;AN000; function had error, use default + 21986 ; 21/02/2023 + 21987 ; ds:dx = parameter block + 21988 ; --- https://stanislavs.org/helppc/int_21-44-c.html --- + 21989 ; offset 00h byte level (0 for DOS 4.0) + 21990 ; 01h byte reserved + 21991 ; 02h word length of following data + 21992 ; 04h word control flags + 21993 ; bit 0 set for blink, clear for intensity + 21994 ; bits 1 to 15 reserved + 21995 ; 06h byte mode type (1=text, 2=graphics) + 21996 ; 07h byte reserved + 21997 ; 08h word colors; 0=monochrome, n=bits per pixel + 21998 ; 0Ah word pixel columns + 21999 ; 0Ch word pixel rows + 22000 ; 0Eh word character columns + 22001 ; 10h word character rows + 22002 + 22003 ;mov ax,[LinPerPag] ; [Display_Ioctl+10h] + 22004 ; ;AN000; get number of rows returned + 22005 ;mov dh,al ;AN000; set number of rows + 22006 ;mov ax,[display_width] ; [Display_Ioctl+0Eh] + 22007 ; ;AN000; get number of columns returned + 22008 ;mov dl,al ;AN000; set number of columns + 22009 ; 21/02/2023 + 22010 000022EA 8A16[159F] mov dl,[display_width] + 22011 000022EE 8A36[179F] mov dh,[LinPerPag] + 22012 000022F2 EB3B jmp short regcls ;AN000; go do cls + 22013 + 22014 no_variable: + 22015 ;;mov bx,stdout ;AC000; set handle as stdout + 22016 ;mov bx,1 + 22017 ; bx = 1 + 22018 ;mov ax,IOCTL SHL 8 ;AC000; do ioctl - get device info + 22019 000022F4 B80044 mov ax,4400h + 22020 000022F7 CD21 int 21h ;AC000; + 22021 000022F9 F6C280 test dl,80h + 22022 ;test dl,devid_ISDEV ;AC000; is handle a device + 22023 000022FC 7405 jz short ansicls ;AC000; If a file put out ANSI + 22024 000022FE F6C210 test dl,10h + 22025 ;test dl,devid_SPECIAL ;AC000; + 22026 00002301 7505 jnz short cls_normal ;AC000; If not special CON, do ANSI + 22027 + 22028 ansicls: + 22029 00002303 E85200 call ansi_cls ;AN000; clear the screen + 22030 00002306 EB2C jmp short cls_ret ;AN000; exit + 22031 + 22032 ; Get video mode + 22033 + 22034 cls_normal: ;AC000; + 22035 ;mov ah,get_video_state ;AC000; set up to get video state + 22036 00002308 B40F mov ah,0Fh + 22037 ;int video_io_int ;AC000; do int 10h - BIOS video IO + 22038 0000230A CD10 int 10h + 22039 0000230C 3C03 cmp al,3 + 22040 ;cmp al,video_alpha ;AC000; see if in text mode + 22041 0000230E 760A jbe short DoAlpha + 22042 00002310 3C07 cmp al,7 + 22043 ;cmp al,video_bw ;AC000; see if black & white card + 22044 00002312 7406 je short DoAlpha + 22045 + 22046 ; We are in graphics mode. Bogus IBM ROM does not scroll correctly. We will + 22047 ; be just as bogus and set the mode that we just got. This will blank the + 22048 ; screen too. + 22049 + 22050 ;mov ah,set_video_mode ;AC000; set video mode call + 22051 00002314 B400 mov ah,0 + 22052 ;int video_io_int ;AC000; do int 10h - BIOS video IO + 22053 00002316 CD10 int 10h + 22054 00002318 EB1A jmp short cls_ret ;AC000; exit + 22055 + 22056 DoAlpha: + 22057 + 22058 ; Get video mode and number of columns to scroll + 22059 + 22060 ;M01 - INT 10 Function 0F doesn't reliably return the number of rows on some + 22061 ;M01 adaptors. We circumvent this by reaching directly into the BIOS data + 22062 ;M01 area + 22063 ;M01 Commented out code here is the original + 22064 ;M01 mov ah,get_video_state ;AC000; set up to get current video state + 22065 ;M01 int video_io_int ;AC000; do int 10h - BIOS video IO + 22066 ;M01 mov dl,ah + 22067 ;M01 mov dh,linesperpage ;AC000; have 25 rows on the screen + 22068 + 22069 ;M01 Following code lifted from a fix Compaq applied to ANSI + 22070 + 22071 0000231A 1E push ds + 22072 ;mov ax,ROMBIOS_DATA ; GET ROM Data segment M01 + 22073 0000231B B84000 mov ax,40h + 22074 0000231E 8ED8 mov ds,ax ; * M01 + 22075 + 22076 ;mov dx,[CRT_Cols] ; Get Columns - assume < 256 M01 + 22077 00002320 8A164A00 mov dl,[4Ah] + 22078 ;mov dh,[CRT_Rows] ; GET MAX NUM OF ROWS M01 + 22079 00002324 8A368400 mov dh,[84h] + 22080 00002328 1F pop ds ; M01 22081 - 22082 ;mov dh,LINESPERPAGE ; SET TO 24 ROWS M01 - 22083 ; 25/04/2023 - 22084 0000232D B619 mov dh,25 - 22085 regcls: - 22086 0000232F FEC6 inc dh ; height+1 M018 - 22087 00002331 E80100 call reg_cls ; go clear the screen - 22088 cls_ret: - 22089 00002334 C3 retn ; exit - 22090 - 22091 ; --------------------------------------------------------------------------- - 22092 - 22093 ; MSDOS 6.0 - 22094 - 22095 ; **************************************************************** - 22096 ; * - 22097 ; * ROUTINE: REG_CLS - 22098 ; * - 22099 ; * FUNCTION: Clear the screen using INT 10H. - 22100 ; * - 22101 ; * INPUT: DL = NUMBER OF COLUMNS - 22102 ; * DH = NUMBER OF ROWS + 22082 00002329 08F6 or dh,dh ; Q:ZERO M01 + 22083 0000232B 7502 jnz short regcls ; *JMP IF NO M01 + 22084 + 22085 ;mov dh,LINESPERPAGE ; SET TO 24 ROWS M01 + 22086 ; 25/04/2023 + 22087 0000232D B619 mov dh,25 + 22088 regcls: + 22089 0000232F FEC6 inc dh ; height+1 M018 + 22090 00002331 E80100 call reg_cls ; go clear the screen + 22091 cls_ret: + 22092 00002334 C3 retn ; exit + 22093 + 22094 ; --------------------------------------------------------------------------- + 22095 + 22096 ; MSDOS 6.0 + 22097 + 22098 ; **************************************************************** + 22099 ; * + 22100 ; * ROUTINE: REG_CLS + 22101 ; * + 22102 ; * FUNCTION: Clear the screen using INT 10H. 22103 ; * - 22104 ; * OUTPUT: none - 22105 ; * - 22106 ; **************************************************************** - 22107 - 22108 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22109 reg_cls: - 22110 ; Set overscan to black. - 22111 - 22112 00002335 FECE dec dh ; decrement rows and columns - 22113 00002337 FECA dec dl ; to zero base - 22114 00002339 52 push dx ; save rows,columns - 22115 ;mov ah,set_color_palette ; set up to set the color to blank - 22116 0000233A B40B mov ah,0Bh - 22117 0000233C 31DB xor bx,bx - 22118 ;int video_io_int ; do int 10h - BIOS video IO - 22119 0000233E CD10 int 10h - 22120 00002340 5A pop dx ; restore rows,colums - 22121 - 22122 00002341 31C0 xor ax,ax ; zero out ax - 22123 00002343 89C1 mov cx,ax ; and cx + 22104 ; * INPUT: DL = NUMBER OF COLUMNS + 22105 ; * DH = NUMBER OF ROWS + 22106 ; * + 22107 ; * OUTPUT: none + 22108 ; * + 22109 ; **************************************************************** + 22110 + 22111 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22112 reg_cls: + 22113 ; Set overscan to black. + 22114 + 22115 00002335 FECE dec dh ; decrement rows and columns + 22116 00002337 FECA dec dl ; to zero base + 22117 00002339 52 push dx ; save rows,columns + 22118 ;mov ah,set_color_palette ; set up to set the color to blank + 22119 0000233A B40B mov ah,0Bh + 22120 0000233C 31DB xor bx,bx + 22121 ;int video_io_int ; do int 10h - BIOS video IO + 22122 0000233E CD10 int 10h + 22123 00002340 5A pop dx ; restore rows,colums 22124 - 22125 ; Scroll active page - 22126 - 22127 ;mov ah,scroll_video_page ; set up to scroll page up - 22128 00002345 B406 mov ah,6 - 22129 ;mov bh,video_attribute ; attribute for blank line - 22130 00002347 B707 mov bh,7 - 22131 00002349 30DB xor bl,bl ; set BL to 0 - 22132 ;int video_io_int ; do int 10h - BIOS video IO - 22133 0000234B CD10 int 10h - 22134 - 22135 ; Seek to cursor to 0,0 - 22136 - 22137 ;M022 following two lines added - 22138 ;mov ah,get_video_state ; get current video page in BH - 22139 0000234D B40F mov ah,0Fh - 22140 ;int video_io_int - 22141 0000234F CD10 int 10h - 22142 ;mov ah,set_cursor_position ; set up to set cursor position - 22143 00002351 B402 mov ah,2 - 22144 00002353 31D2 xor dx,dx ; row and column 0 - 22145 ;M022 mov bh,0 - 22146 ;int video_io_int ; do into 10h - BIOS video IO - 22147 00002355 CD10 int 10h - 22148 - 22149 00002357 C3 retn - 22150 - 22151 ; --------------------------------------------------------------------------- - 22152 - 22153 ; MSDOS 6.0 - 22154 - 22155 ; **************************************************************** - 22156 ; * - 22157 ; * ROUTINE: ANSI_CLS - 22158 ; * - 22159 ; * FUNCTION: Clear the screen using by writing a control code - 22160 ; * to STDOUT. + 22125 00002341 31C0 xor ax,ax ; zero out ax + 22126 00002343 89C1 mov cx,ax ; and cx + 22127 + 22128 ; Scroll active page + 22129 + 22130 ;mov ah,scroll_video_page ; set up to scroll page up + 22131 00002345 B406 mov ah,6 + 22132 ;mov bh,video_attribute ; attribute for blank line + 22133 00002347 B707 mov bh,7 + 22134 00002349 30DB xor bl,bl ; set BL to 0 + 22135 ;int video_io_int ; do int 10h - BIOS video IO + 22136 0000234B CD10 int 10h + 22137 + 22138 ; Seek to cursor to 0,0 + 22139 + 22140 ;M022 following two lines added + 22141 ;mov ah,get_video_state ; get current video page in BH + 22142 0000234D B40F mov ah,0Fh + 22143 ;int video_io_int + 22144 0000234F CD10 int 10h + 22145 ;mov ah,set_cursor_position ; set up to set cursor position + 22146 00002351 B402 mov ah,2 + 22147 00002353 31D2 xor dx,dx ; row and column 0 + 22148 ;M022 mov bh,0 + 22149 ;int video_io_int ; do into 10h - BIOS video IO + 22150 00002355 CD10 int 10h + 22151 + 22152 00002357 C3 retn + 22153 + 22154 ; --------------------------------------------------------------------------- + 22155 + 22156 ; MSDOS 6.0 + 22157 + 22158 ; **************************************************************** + 22159 ; * + 22160 ; * ROUTINE: ANSI_CLS 22161 ; * - 22162 ; * INPUT: none - 22163 ; * - 22164 ; * OUTPUT: none - 22165 ; * - 22166 ; **************************************************************** - 22167 - 22168 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22169 ansi_cls: ;AC000; - 22170 00002358 BE[0394] mov si,CLSSTRING - 22171 ; db 4,1Bh,'[2J' - 22172 0000235B AC lodsb - 22173 0000235C 88C1 mov cl,al ; al = 4 - 22174 0000235E 30ED xor ch,ch - 22175 ;mov ah,Raw_CON_IO - 22176 00002360 B406 mov ah,6 - 22177 clrloop: - 22178 00002362 AC lodsb - 22179 00002363 88C2 mov dl,al - 22180 00002365 CD21 int 21h - 22181 ; DOS - DIRECT CONSOLE I/O CHARACTER OUTPUT - 22182 00002367 E2F9 loop clrloop - 22183 00002369 C3 retn - 22184 - 22185 ;============================================================================ - 22186 ; TCMD2B.ASM, MSDOS 6.0, 1991 - 22187 ;============================================================================ - 22188 ; 08/10/2018 - Retro DOS v3.0 - 22189 - 22190 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 156Dh - 22191 - 22192 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) - 22193 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 206Bh + 22162 ; * FUNCTION: Clear the screen using by writing a control code + 22163 ; * to STDOUT. + 22164 ; * + 22165 ; * INPUT: none + 22166 ; * + 22167 ; * OUTPUT: none + 22168 ; * + 22169 ; **************************************************************** + 22170 + 22171 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22172 ansi_cls: ;AC000; + 22173 00002358 BE[0394] mov si,CLSSTRING + 22174 ; db 4,1Bh,'[2J' + 22175 0000235B AC lodsb + 22176 0000235C 88C1 mov cl,al ; al = 4 + 22177 0000235E 30ED xor ch,ch + 22178 ;mov ah,Raw_CON_IO + 22179 00002360 B406 mov ah,6 + 22180 clrloop: + 22181 00002362 AC lodsb + 22182 00002363 88C2 mov dl,al + 22183 00002365 CD21 int 21h + 22184 ; DOS - DIRECT CONSOLE I/O CHARACTER OUTPUT + 22185 00002367 E2F9 loop clrloop + 22186 00002369 C3 retn + 22187 + 22188 ;============================================================================ + 22189 ; TCMD2B.ASM, MSDOS 6.0, 1991 + 22190 ;============================================================================ + 22191 ; 08/10/2018 - Retro DOS v3.0 + 22192 + 22193 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 156Dh 22194 - 22195 ; --------------------------------------------------------------------------- - 22196 - 22197 ; **************************************************************** - 22198 ; * - 22199 ; * ROUTINE: CTTY - Change console - 22200 ; * - 22201 ; * SYNTAX: CTTY device - 22202 ; * - 22203 ; * FUNCTION: If a valid console device is specified, CTTY will - 22204 ; * duplicate the device handle to STDIN, STDOUT and - 22205 ; * STDERR. This routine returns to LODCOM1. - 22206 ; * - 22207 ; * INPUT: command line at offset 81H - 22208 ; * - 22209 ; * OUTPUT: none - 22210 ; * - 22211 ; **************************************************************** - 22212 - 22213 ; 21/02/2023 - Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM - 22214 ; 08/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 22215 ; 10/06/2023 - 22216 ; 03/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM - 22217 CTTY: - 22218 ; MSDOS 6.0 - 22219 0000236A 1E push ds ;AN000; Get local ES - 22220 0000236B 07 pop es ;AN000; - 22221 0000236C BE8100 mov si,81h ;AC000; Get command argument for CTTY - 22222 0000236F BF[3297] mov di,PARSE_CTTY - 22223 ;AC000; Get address of PARSE_CTTY - 22224 00002372 31C9 xor cx,cx ;AC000; clear cx,dx - 22225 00002374 31D2 xor dx,dx ;AC000; - 22226 00002376 E8F325 call cmd_parse ;AC000; call parser - 22227 - 22228 ;cmp ax,-1 ; 0FFFFh - 22229 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? - 22230 ;je short ctty_error ;AN000; yes - error - 22231 ;;cmp ax,RESULT_NO_ERROR ; 0 ;AN000; did an error occur - 22232 ;and ax,ax ; ax > 0 ? - 22233 ;jnz short ctty_error ;AN000; YES -ERROR - 22234 ; 10/06/2023 - 22235 00002379 40 inc ax ; cmp ax,-1 - 22236 0000237A 7434 jz short ctty_error ; 0FFFFh -> 0 - 22237 0000237C 48 dec ax ; cmp ax,0 - 22238 0000237D 7531 jnz short ctty_error ; 1 -> 0 - 22239 ; ax = 0 - 22240 - 22241 0000237F 56 push si ;AN000; save position in line - 22242 00002380 C536[EFA5] lds si,[PARSE1_ADDR] ;AN000; get address of filespec - 22243 00002384 BF[219E] mov di,SrcBuf ;AN000; get address of srcbuf - 22244 ctty_move_filename: ;AN000; put filespec in srcbuf - 22245 00002387 AC lodsb ;AN000; get a char from buffer - 22246 00002388 AA stosb ;AN000; store in srcbuf - 22247 ;cmp al,END_OF_LINE_OUT ; 0 ;AN000; it char a terminator? - 22248 00002389 08C0 or al,al ; al = 0 ? - 22249 0000238B 75FA jnz short ctty_move_filename ; 26/04/2023 - 22250 ;AN000; no - keep moving - 22251 0000238D 5E pop si ;AN000; get line position back - 22252 0000238E BF[3297] mov di,PARSE_CTTY ;AC000; Get address of PARSE_CTTY - 22253 00002391 E8B101 call parse_check_eol ;AN000; are we at end of line? - 22254 ;jz short nocolon ;AN000; yes - continue - 22255 ; 21/02/2023 - 22256 00002394 751A jnz short ctty_error - 22257 ;ctty_error: - 22258 ;jmp short isbaddev ;AC000; yes - exit - 22259 - 22260 ; 21/02/2023 - 22261 ; MSDOS 3.3 - 22262 ;call SETPATH - 22263 ;dec si - 22264 ;dec si - 22265 ;cmp byte [si],':' - 22266 ;jnz short NOCOLON - 22267 ;mov byte [si],0 - 22268 nocolon: - 22269 ; 21/02/2023 - 22270 ; MSDOS 6.0 - 22271 00002396 BA[219E] mov dx,SrcBuf - 22272 ;NOCOLON: - 22273 ; MSDOS 3.3 & MSDOS 6.0 - 22274 ;;mov ax,(OPEN SHL 8) OR 2 ; Read and write - 22275 ;mov ax,(OPEN<<8)|2 ; 3D02h - 22276 00002399 B8023D mov ax,3D02h ; 21/02/2023 - 22277 0000239C CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 22278 ; DS:DX -> ASCIZ filename - 22279 ; AL = access mode - 22280 ; 2 - read & write - 22281 0000239E 7210 jc short isbaddev - 22282 000023A0 89C3 mov bx,ax - 22283 ;mov ax,IOCTL*256 ; 4400h - 22284 000023A2 B80044 mov ax,4400h - 22285 000023A5 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 22286 ; BX = file or device handle - 22287 000023A7 F6C280 test dl,80h - 22288 000023AA 750C jnz short devisok - 22289 closedev: - 22290 ;mov ah,CLOSE ; 3Eh ; Close initial handle - 22291 000023AC B43E mov ah,3Eh - 22292 000023AE CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 22293 ; BX = file handle - 22294 ctty_error: - 22295 isbaddev: - 22296 000023B0 BA[5791] mov dx,BADDEV_PTR - 22297 000023B3 E87230 call std_printf - 22298 000023B6 EB40 jmp short resret - 22299 - 22300 ;nop - 22301 devisok: - 22302 ; 21/02/2023 - 22303 ; MSDOS 6.0 - 22304 000023B8 52 push dx ;AN007; save device info - 22305 ; 08/06/2023 - 22306 000023B9 A1[FA91] mov ax,[acrlf_ptr] ;AN021; get message number for 0d, 0a - 22307 ;mov dh,util_msg_class - 22308 000023BC B6FF mov dh,-1 ; 0FFh ;AN021; this is a utility message - 22309 000023BE 53 push bx ;AN021; save handle - 22310 000023BF E84931 call TSYSGETMSG ;AN021; get the address of the message - 22311 000023C2 89F2 mov dx,si ;AN021; get address into dx - 22312 ;mov ax,(Write shl 8) - 22313 000023C4 B80040 mov ax,4000h ;AN007; write to device - 22314 000023C7 B90200 mov cx,2 ;AN007; write two bytes - 22315 000023CA CD21 int 21h ;AN007; - 22316 000023CC 5B pop bx ;AN021; get back handle - 22317 000023CD 5A pop dx ;AN007; get back device info - 22318 000023CE 72DC jc short closedev ;AN007; if error, quit - 22319 - 22320 ; MSDOS 3.3 & MSDOS 6.0 - 22321 000023D0 30F6 xor dh,dh - 22322 000023D2 80CA03 or dl,3 - 22323 ;;mov ax,(IOCTL SHL 8) OR 1 - 22324 ;mov ax,(IOCTL<<8)|1 ; 4401h - 22325 000023D5 B80144 mov ax,4401h - 22326 000023D8 CD21 int 21h ; DOS - 2+ - IOCTL - SET DEVICE INFORMATION - 22327 ; BX = device handle,DH = 0 - 22328 ; DL = device information to set - 22329 ; (bits 0-7 from function 0) - 22330 000023DA 53 push bx - 22331 000023DB B90300 mov cx,3 - 22332 000023DE 31DB xor bx,bx - 22333 iclloop: ; Close basic handles - 22334 ;mov ah,CLOSE ; 3Eh - 22335 000023E0 B43E mov ah,3Eh - 22336 000023E2 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 22337 ; BX = file handle - 22338 000023E4 43 inc bx - 22339 000023E5 E2F9 loop iclloop - 22340 000023E7 5B pop bx ; Get handle - 22341 ;mov ah,XDUP ; 45h - 22342 000023E8 B445 mov ah,45h - 22343 000023EA CD21 int 21h ; DOS - 2+ - CREATE DUPLICATE HANDLE (DUP) - 22344 ; BX = file handle to duplicate - 22345 ;mov ah,XDUP ; 45h - 22346 000023EC B445 mov ah,45h - 22347 000023EE CD21 int 21h ; DOS - 2+ - CREATE DUPLICATE HANDLE (DUP) - 22348 ; BX = file handle to duplicate - 22349 ;mov ah,XDUP ; 45h - 22350 000023F0 B445 mov ah,45h - 22351 000023F2 CD21 int 21h ; DOS - 2+ - CREATE DUPLICATE HANDLE (DUP) - 22352 ; BX = file handle to duplicate - 22353 ;mov ah,CLOSE ; 3Eh - 22354 000023F4 B43E mov ah,3Eh - 22355 000023F6 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 22356 ; BX = file handle - 22357 resret: - 22358 000023F8 8E1E[F59B] mov ds,[RESSEG] - 22359 000023FC 1E push ds - 22360 ;mov ax,[18h] - 22361 000023FD A11800 mov ax,[PDB.JFN_TABLE] ; Get new 0 and 1 - 22362 00002400 A3[9F02] mov [Io_Save],ax - 22363 ;;;mov ax,31Eh ; MSDOS 3.3 - 22364 ;;mov ax,LODCOM1 - 22365 ;;mov ax,offset DATARES:TrnLodCom1_Trap ; MSDOS 6.0 - 22366 ;mov ax,175h ; MSDOS 6.0 - 22367 00002403 B8[D600] mov ax,TrnLodCom1_Trap - 22368 00002406 50 push ax - 22369 - 22370 00002407 CB retf ; Far return - 22371 - 22372 ; --------------------------------------------------------------------------- - 22373 - 22374 ;**************************************************************** - 22375 ;* - 22376 ;* ROUTINE: CHCP - Change code page internal command - 22377 ;* (added DOS 3.30 07/21/86) + 22195 ; 21/02/2023 - Retro DOS v4.0 (& v4.1) + 22196 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 206Bh + 22197 + 22198 ; --------------------------------------------------------------------------- + 22199 + 22200 ; **************************************************************** + 22201 ; * + 22202 ; * ROUTINE: CTTY - Change console + 22203 ; * + 22204 ; * SYNTAX: CTTY device + 22205 ; * + 22206 ; * FUNCTION: If a valid console device is specified, CTTY will + 22207 ; * duplicate the device handle to STDIN, STDOUT and + 22208 ; * STDERR. This routine returns to LODCOM1. + 22209 ; * + 22210 ; * INPUT: command line at offset 81H + 22211 ; * + 22212 ; * OUTPUT: none + 22213 ; * + 22214 ; **************************************************************** + 22215 + 22216 ; 21/02/2023 - Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM + 22217 ; 08/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 22218 ; 10/06/2023 + 22219 ; 03/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM + 22220 CTTY: + 22221 ; MSDOS 6.0 + 22222 0000236A 1E push ds ;AN000; Get local ES + 22223 0000236B 07 pop es ;AN000; + 22224 0000236C BE8100 mov si,81h ;AC000; Get command argument for CTTY + 22225 0000236F BF[3297] mov di,PARSE_CTTY + 22226 ;AC000; Get address of PARSE_CTTY + 22227 00002372 31C9 xor cx,cx ;AC000; clear cx,dx + 22228 00002374 31D2 xor dx,dx ;AC000; + 22229 00002376 E8F325 call cmd_parse ;AC000; call parser + 22230 + 22231 ;cmp ax,-1 ; 0FFFFh + 22232 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? + 22233 ;je short ctty_error ;AN000; yes - error + 22234 ;;cmp ax,RESULT_NO_ERROR ; 0 ;AN000; did an error occur + 22235 ;and ax,ax ; ax > 0 ? + 22236 ;jnz short ctty_error ;AN000; YES -ERROR + 22237 ; 10/06/2023 + 22238 00002379 40 inc ax ; cmp ax,-1 + 22239 0000237A 7434 jz short ctty_error ; 0FFFFh -> 0 + 22240 0000237C 48 dec ax ; cmp ax,0 + 22241 0000237D 7531 jnz short ctty_error ; 1 -> 0 + 22242 ; ax = 0 + 22243 + 22244 0000237F 56 push si ;AN000; save position in line + 22245 00002380 C536[EFA5] lds si,[PARSE1_ADDR] ;AN000; get address of filespec + 22246 00002384 BF[219E] mov di,SrcBuf ;AN000; get address of srcbuf + 22247 ctty_move_filename: ;AN000; put filespec in srcbuf + 22248 00002387 AC lodsb ;AN000; get a char from buffer + 22249 00002388 AA stosb ;AN000; store in srcbuf + 22250 ;cmp al,END_OF_LINE_OUT ; 0 ;AN000; it char a terminator? + 22251 00002389 08C0 or al,al ; al = 0 ? + 22252 0000238B 75FA jnz short ctty_move_filename ; 26/04/2023 + 22253 ;AN000; no - keep moving + 22254 0000238D 5E pop si ;AN000; get line position back + 22255 0000238E BF[3297] mov di,PARSE_CTTY ;AC000; Get address of PARSE_CTTY + 22256 00002391 E8B101 call parse_check_eol ;AN000; are we at end of line? + 22257 ;jz short nocolon ;AN000; yes - continue + 22258 ; 21/02/2023 + 22259 00002394 751A jnz short ctty_error + 22260 ;ctty_error: + 22261 ;jmp short isbaddev ;AC000; yes - exit + 22262 + 22263 ; 21/02/2023 + 22264 ; MSDOS 3.3 + 22265 ;call SETPATH + 22266 ;dec si + 22267 ;dec si + 22268 ;cmp byte [si],':' + 22269 ;jnz short NOCOLON + 22270 ;mov byte [si],0 + 22271 nocolon: + 22272 ; 21/02/2023 + 22273 ; MSDOS 6.0 + 22274 00002396 BA[219E] mov dx,SrcBuf + 22275 ;NOCOLON: + 22276 ; MSDOS 3.3 & MSDOS 6.0 + 22277 ;;mov ax,(OPEN SHL 8) OR 2 ; Read and write + 22278 ;mov ax,(OPEN<<8)|2 ; 3D02h + 22279 00002399 B8023D mov ax,3D02h ; 21/02/2023 + 22280 0000239C CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 22281 ; DS:DX -> ASCIZ filename + 22282 ; AL = access mode + 22283 ; 2 - read & write + 22284 0000239E 7210 jc short isbaddev + 22285 000023A0 89C3 mov bx,ax + 22286 ;mov ax,IOCTL*256 ; 4400h + 22287 000023A2 B80044 mov ax,4400h + 22288 000023A5 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 22289 ; BX = file or device handle + 22290 000023A7 F6C280 test dl,80h + 22291 000023AA 750C jnz short devisok + 22292 closedev: + 22293 ;mov ah,CLOSE ; 3Eh ; Close initial handle + 22294 000023AC B43E mov ah,3Eh + 22295 000023AE CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 22296 ; BX = file handle + 22297 ctty_error: + 22298 isbaddev: + 22299 000023B0 BA[5791] mov dx,BADDEV_PTR + 22300 000023B3 E87230 call std_printf + 22301 000023B6 EB40 jmp short resret + 22302 + 22303 ;nop + 22304 devisok: + 22305 ; 21/02/2023 + 22306 ; MSDOS 6.0 + 22307 000023B8 52 push dx ;AN007; save device info + 22308 ; 08/06/2023 + 22309 000023B9 A1[FA91] mov ax,[acrlf_ptr] ;AN021; get message number for 0d, 0a + 22310 ;mov dh,util_msg_class + 22311 000023BC B6FF mov dh,-1 ; 0FFh ;AN021; this is a utility message + 22312 000023BE 53 push bx ;AN021; save handle + 22313 000023BF E84931 call TSYSGETMSG ;AN021; get the address of the message + 22314 000023C2 89F2 mov dx,si ;AN021; get address into dx + 22315 ;mov ax,(Write shl 8) + 22316 000023C4 B80040 mov ax,4000h ;AN007; write to device + 22317 000023C7 B90200 mov cx,2 ;AN007; write two bytes + 22318 000023CA CD21 int 21h ;AN007; + 22319 000023CC 5B pop bx ;AN021; get back handle + 22320 000023CD 5A pop dx ;AN007; get back device info + 22321 000023CE 72DC jc short closedev ;AN007; if error, quit + 22322 + 22323 ; MSDOS 3.3 & MSDOS 6.0 + 22324 000023D0 30F6 xor dh,dh + 22325 000023D2 80CA03 or dl,3 + 22326 ;;mov ax,(IOCTL SHL 8) OR 1 + 22327 ;mov ax,(IOCTL<<8)|1 ; 4401h + 22328 000023D5 B80144 mov ax,4401h + 22329 000023D8 CD21 int 21h ; DOS - 2+ - IOCTL - SET DEVICE INFORMATION + 22330 ; BX = device handle,DH = 0 + 22331 ; DL = device information to set + 22332 ; (bits 0-7 from function 0) + 22333 000023DA 53 push bx + 22334 000023DB B90300 mov cx,3 + 22335 000023DE 31DB xor bx,bx + 22336 iclloop: ; Close basic handles + 22337 ;mov ah,CLOSE ; 3Eh + 22338 000023E0 B43E mov ah,3Eh + 22339 000023E2 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 22340 ; BX = file handle + 22341 000023E4 43 inc bx + 22342 000023E5 E2F9 loop iclloop + 22343 000023E7 5B pop bx ; Get handle + 22344 ;mov ah,XDUP ; 45h + 22345 000023E8 B445 mov ah,45h + 22346 000023EA CD21 int 21h ; DOS - 2+ - CREATE DUPLICATE HANDLE (DUP) + 22347 ; BX = file handle to duplicate + 22348 ;mov ah,XDUP ; 45h + 22349 000023EC B445 mov ah,45h + 22350 000023EE CD21 int 21h ; DOS - 2+ - CREATE DUPLICATE HANDLE (DUP) + 22351 ; BX = file handle to duplicate + 22352 ;mov ah,XDUP ; 45h + 22353 000023F0 B445 mov ah,45h + 22354 000023F2 CD21 int 21h ; DOS - 2+ - CREATE DUPLICATE HANDLE (DUP) + 22355 ; BX = file handle to duplicate + 22356 ;mov ah,CLOSE ; 3Eh + 22357 000023F4 B43E mov ah,3Eh + 22358 000023F6 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 22359 ; BX = file handle + 22360 resret: + 22361 000023F8 8E1E[F59B] mov ds,[RESSEG] + 22362 000023FC 1E push ds + 22363 ;mov ax,[18h] + 22364 000023FD A11800 mov ax,[PDB.JFN_TABLE] ; Get new 0 and 1 + 22365 00002400 A3[9F02] mov [Io_Save],ax + 22366 ;;;mov ax,31Eh ; MSDOS 3.3 + 22367 ;;mov ax,LODCOM1 + 22368 ;;mov ax,offset DATARES:TrnLodCom1_Trap ; MSDOS 6.0 + 22369 ;mov ax,175h ; MSDOS 6.0 + 22370 00002403 B8[D600] mov ax,TrnLodCom1_Trap + 22371 00002406 50 push ax + 22372 + 22373 00002407 CB retf ; Far return + 22374 + 22375 ; --------------------------------------------------------------------------- + 22376 + 22377 ;**************************************************************** 22378 ;* - 22379 ;* SYNTAX: CHCP [xxx] - 22380 ;* where xxx is a valid code page + 22379 ;* ROUTINE: CHCP - Change code page internal command + 22380 ;* (added DOS 3.30 07/21/86) 22381 ;* - 22382 ;* FUNCTION: If xxx is specified, CHCP will use INT 21H function - 22383 ;* 6402H to set the code page to xxxx. If no parameters - 22384 ;* are specified, CHCP will use INT 21H function 6401H - 22385 ;* to get global code page and display it to the user. - 22386 ;* - 22387 ;* INPUT: command line at offset 81H - 22388 ;* - 22389 ;* OUTPUT: none - 22390 ;* - 22391 ;**************************************************************** - 22392 - 22393 NLSFUNC_installed equ 0FFh - 22394 set_global_cp equ 2 - 22395 get_global_cp equ 1 - 22396 - 22397 ; 21/02/2023 - Retro DOS v4.0 - 22398 ; 09/06/2023 - Retro DOS v4.2 COMMAND.COM - 22399 ; 10/06/2023 - 22400 ; 03/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM - 22401 CHCP: - 22402 ; MSDOS 6.0 - 22403 00002408 1E push ds ;AN000; Get local ES - 22404 00002409 07 pop es ;AN000; - 22405 0000240A BE8100 mov si,81h ;AC000; Get command argument for CHCP - 22406 0000240D BF[3396] mov di,PARSE_CHCP - 22407 ;AN000; Get address of PARSE_CHCP - 22408 00002410 31C9 xor cx,cx ;AC000; clear cx,dx - 22409 00002412 31D2 xor dx,dx ;AC000; - 22410 00002414 E84401 call Parse_With_Msg ;AC018; call parser - 22411 - 22412 ;cmp ax,-1 - 22413 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? - 22414 ;;jne short setcp ;AC000; no go get number & set code page - 22415 ;je short getcp ;AC000; yes - no parm - get code page - 22416 ;setcp: - 22417 ;;cmp ax,0 - 22418 ;;cmp ax,RESULT_NO_ERROR - 22419 ; ;AN000; did we have an error? - 22420 ;;jne short cp_error ;AC018; yes - go issue message - 22421 ;and ax,ax ; ax > 0 ? - 22422 ;jnz short cp_error - 22423 ; 10/06/2023 - 22424 00002417 40 inc ax ; cmp ax,-1 - 22425 00002418 745C jz short getcp ; 0FFFFh -> 0 - 22426 0000241A 48 dec ax ; cmp ax,0 - 22427 0000241B 7556 jnz short cp_error ; 1 -> 0 - 22428 ; ax = 0 - 22429 - 22430 ;;push cx ;AN000; save positional count - 22431 ;mov bx,PARSE1_ADDR ;AN000; get number returned - 22432 ;;mov cx,[bx] ;AN000; into cx - 22433 ;;mov [system_cpage],cx - 22434 ; ;AN000; save user input number - 22435 ;;pop cx ;AC000; restore positional count - 22436 ;; 21/02/2023 - 22437 ;mov di,[bx] - 22438 ;mov [system_cpage],di - 22439 ; 09/06/2023 - 22440 0000241D 8B1E[EFA5] mov bx,[PARSE1_ADDR] - 22441 00002421 891E[9A9D] mov [system_cpage],bx - 22442 ; - 22443 00002425 BF[3396] mov di,PARSE_CHCP ;AN000; Get address of PARSE_CHCP - 22444 00002428 E81A01 call parse_check_eol ;AN000; are we at end of line? - 22445 0000242B 7546 jnz short cp_error ;AC000; no - exit - 22446 okset: - 22447 ;;mov ah,NLSFUNC ;AN000; see if NLSFUNC installed - 22448 ;mov ah,14h - 22449 ;mov al,0 ;AN000; - 22450 0000242D B80014 mov ax,1400h - 22451 00002430 CD2F int 2Fh ;AN000; - 22452 ;cmp al,0FFh - 22453 00002432 3CFF cmp al,NLSFUNC_installed - 22454 ;AN000; - 22455 00002434 7405 je short got_NLS ;AN000; Yes - continue - 22456 00002436 BA[9B90] mov dx,NLSFUNC_PTR - 22457 ;AN000; no - set up error message - 22458 00002439 EB38 jmp short cp_error ;AN000; error exit - 22459 - 22460 ; 21/02/2023 - 22461 got_NLS: - 22462 ; MSDOS 6.0 - 22463 0000243B 8B1E[9A9D] mov bx,[system_cpage] - 22464 ;AN000; get user input code page - 22465 ;SET_CP_TBL_NUM: - 22466 ;mov [SYSTEM_CPAGE],bx ; MSDOS 3.3 - 22467 ; - 22468 ; MSDOS 3.3 & MSDOS 6.0 - 22469 ;;mov ah,GETSETCDPG ;get/set global code page function - 22470 ;mov ah,66h - 22471 ;;mov al,set_global_cp - 22472 ;mov al,2 ;minor - set - 22473 ; 26/04/2023 - 22474 0000243F B80266 mov ax,6602h - 22475 00002442 CD21 int 21h - 22476 ; DOS - 3.3+ - SET GLOBAL CODE PAGE TABLE - 22477 ; BX = active code page - 22478 ; DX = system code page (active page at boot time) - 22479 - 22480 00002444 733F jnc short chcp_return - 22481 ;no error - exit + 22382 ;* SYNTAX: CHCP [xxx] + 22383 ;* where xxx is a valid code page + 22384 ;* + 22385 ;* FUNCTION: If xxx is specified, CHCP will use INT 21H function + 22386 ;* 6402H to set the code page to xxxx. If no parameters + 22387 ;* are specified, CHCP will use INT 21H function 6401H + 22388 ;* to get global code page and display it to the user. + 22389 ;* + 22390 ;* INPUT: command line at offset 81H + 22391 ;* + 22392 ;* OUTPUT: none + 22393 ;* + 22394 ;**************************************************************** + 22395 + 22396 NLSFUNC_installed equ 0FFh + 22397 set_global_cp equ 2 + 22398 get_global_cp equ 1 + 22399 + 22400 ; 21/02/2023 - Retro DOS v4.0 + 22401 ; 09/06/2023 - Retro DOS v4.2 COMMAND.COM + 22402 ; 10/06/2023 + 22403 ; 03/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM + 22404 CHCP: + 22405 ; MSDOS 6.0 + 22406 00002408 1E push ds ;AN000; Get local ES + 22407 00002409 07 pop es ;AN000; + 22408 0000240A BE8100 mov si,81h ;AC000; Get command argument for CHCP + 22409 0000240D BF[3396] mov di,PARSE_CHCP + 22410 ;AN000; Get address of PARSE_CHCP + 22411 00002410 31C9 xor cx,cx ;AC000; clear cx,dx + 22412 00002412 31D2 xor dx,dx ;AC000; + 22413 00002414 E84401 call Parse_With_Msg ;AC018; call parser + 22414 + 22415 ;cmp ax,-1 + 22416 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? + 22417 ;;jne short setcp ;AC000; no go get number & set code page + 22418 ;je short getcp ;AC000; yes - no parm - get code page + 22419 ;setcp: + 22420 ;;cmp ax,0 + 22421 ;;cmp ax,RESULT_NO_ERROR + 22422 ; ;AN000; did we have an error? + 22423 ;;jne short cp_error ;AC018; yes - go issue message + 22424 ;and ax,ax ; ax > 0 ? + 22425 ;jnz short cp_error + 22426 ; 10/06/2023 + 22427 00002417 40 inc ax ; cmp ax,-1 + 22428 00002418 745C jz short getcp ; 0FFFFh -> 0 + 22429 0000241A 48 dec ax ; cmp ax,0 + 22430 0000241B 7556 jnz short cp_error ; 1 -> 0 + 22431 ; ax = 0 + 22432 + 22433 ;;push cx ;AN000; save positional count + 22434 ;mov bx,PARSE1_ADDR ;AN000; get number returned + 22435 ;;mov cx,[bx] ;AN000; into cx + 22436 ;;mov [system_cpage],cx + 22437 ; ;AN000; save user input number + 22438 ;;pop cx ;AC000; restore positional count + 22439 ;; 21/02/2023 + 22440 ;mov di,[bx] + 22441 ;mov [system_cpage],di + 22442 ; 09/06/2023 + 22443 0000241D 8B1E[EFA5] mov bx,[PARSE1_ADDR] + 22444 00002421 891E[9A9D] mov [system_cpage],bx + 22445 ; + 22446 00002425 BF[3396] mov di,PARSE_CHCP ;AN000; Get address of PARSE_CHCP + 22447 00002428 E81A01 call parse_check_eol ;AN000; are we at end of line? + 22448 0000242B 7546 jnz short cp_error ;AC000; no - exit + 22449 okset: + 22450 ;;mov ah,NLSFUNC ;AN000; see if NLSFUNC installed + 22451 ;mov ah,14h + 22452 ;mov al,0 ;AN000; + 22453 0000242D B80014 mov ax,1400h + 22454 00002430 CD2F int 2Fh ;AN000; + 22455 ;cmp al,0FFh + 22456 00002432 3CFF cmp al,NLSFUNC_installed + 22457 ;AN000; + 22458 00002434 7405 je short got_NLS ;AN000; Yes - continue + 22459 00002436 BA[9B90] mov dx,NLSFUNC_PTR + 22460 ;AN000; no - set up error message + 22461 00002439 EB38 jmp short cp_error ;AN000; error exit + 22462 + 22463 ; 21/02/2023 + 22464 got_NLS: + 22465 ; MSDOS 6.0 + 22466 0000243B 8B1E[9A9D] mov bx,[system_cpage] + 22467 ;AN000; get user input code page + 22468 ;SET_CP_TBL_NUM: + 22469 ;mov [SYSTEM_CPAGE],bx ; MSDOS 3.3 + 22470 ; + 22471 ; MSDOS 3.3 & MSDOS 6.0 + 22472 ;;mov ah,GETSETCDPG ;get/set global code page function + 22473 ;mov ah,66h + 22474 ;;mov al,set_global_cp + 22475 ;mov al,2 ;minor - set + 22476 ; 26/04/2023 + 22477 0000243F B80266 mov ax,6602h + 22478 00002442 CD21 int 21h + 22479 ; DOS - 3.3+ - SET GLOBAL CODE PAGE TABLE + 22480 ; BX = active code page + 22481 ; DX = system code page (active page at boot time) 22482 - 22483 00002446 83F802 cmp ax,ERROR_FILE_NOT_FOUND ; 2 - 22484 00002449 7515 jnz short chcp_other_error + 22483 00002444 733F jnc short chcp_return + 22484 ;no error - exit 22485 - 22486 ;mov ah,GETEXTENDEDERROR ; 59h - 22487 0000244B B459 mov ah,59h - 22488 0000244D 31DB xor bx,bx - 22489 0000244F CD21 int 21h ; DOS - 3+ - GET EXTENDED ERROR CODE - 22490 ; BX = version code (0000h for DOS 3.x) - 22491 - 22492 00002451 83F80D cmp ax,ERROR_INVALID_DATA ; 0Dh ; invalid code page - 22493 00002454 7505 jne short no_countrysys ; 26/04/2023 - 22494 ;mov dx,FNOTFOUNDPTR ; MSDOS 3.3 - 22495 00002456 BA[9E90] mov dx,INV_CODE_PAGE - 22496 ;jmp cerror - 22497 00002459 EB18 jmp short cp_error - 22498 - 22499 ; 21/02/2023 - 22500 ; MSDOS 6.0 (& 5.0) COMMAND.COM - 22501 no_countrysys: - 22502 ;M045; mov byte [msg_disp_class],ext_msg_class - 22503 ; ;AN000; set up extended error msg class - 22504 ;M045; mov dx,extend_buf_ptr ;AC000; get extended message pointer - 22505 ;M045; mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND - 22506 ;AN000; get message number in control block - 22507 0000245B BA[C692] mov dx,NoCntry_Ptr - 22508 0000245E EB13 jmp short cp_error - 22509 - 22510 chcp_other_error: ; end of p716 - 22511 ;mov ah,GETEXTENDEDERROR ; 59h ;error - see what it is - 22512 00002460 B459 mov ah,59h - 22513 00002462 31DB xor bx,bx - 22514 00002464 CD21 int 21h ; DOS - 3+ - GET EXTENDED ERROR CODE - 22515 ; BX = version code (0000h for DOS 3.x) - 22516 00002466 83F841 cmp ax,65 ;was it access denied? - 22517 00002469 7505 jne short none_set ;no - assume all failed - 22518 0000246B BA[7F90] mov dx,cp_not_all_ptr - 22519 ;set up message - 22520 ;jmp cerror ;AC000; error exit - 22521 0000246E EB03 jmp short cp_error - 22522 none_set: - 22523 00002470 BA[7190] mov dx,cp_not_set_ptr - 22524 ;set up message - 22525 cp_error: - 22526 00002473 E9B008 jmp cerror ;exit - 22527 getcp: - 22528 ;;mov ah,GETSETCDPG ; 66h - 22529 ;mov ah,66h ;get/set global code page function - 22530 ;;mov al,get_global_cp ; 1 - 22531 ;mov al,1 ;minor - get - 22532 ; 26/04/2023 - 22533 00002476 B80166 mov ax,6601h - 22534 00002479 CD21 int 21h ; DOS - 3.3+ - GET GLOBAL CODE PAGE TABLE - 22535 0000247B 891E[9A9D] mov [system_cpage],bx - 22536 ;get active cp for output - 22537 0000247F BA[8D90] mov dx,cp_active_ptr - 22538 00002482 E8A32F call std_printf ;print it out - 22539 chcp_return: - 22540 00002485 C3 retn - 22541 - 22542 ; --------------------------------------------------------------------------- - 22543 - 22544 ; **************************************************************** - 22545 ; * - 22546 ; * ROUTINE: TRUENAME - 22547 ; * - 22548 ; * FUNCTION: Entry point for the internal TRUENAME command. - 22549 ; * Parses the command line. If a path is found, set - 22550 ; * SRCXNAME to path. If only a drive letter is found, - 22551 ; * set SRCXNAME to the drive letter. If no path - 22552 ; * is found, set the path of SRCXNAME to dot (.) for - 22553 ; * current directory. Use the NAME TRANSLATE system - 22554 ; * call to get the real name and then display the - 22555 ; * real name. If an error occurs issue an error - 22556 ; * message and transfer control to CERROR. - 22557 ; * - 22558 ; * INPUT: command line at offset 81H - 22559 ; * - 22560 ; * OUTPUT: none - 22561 ; * - 22562 ; **************************************************************** - 22563 - 22564 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22565 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2197h + 22486 00002446 83F802 cmp ax,ERROR_FILE_NOT_FOUND ; 2 + 22487 00002449 7515 jnz short chcp_other_error + 22488 + 22489 ;mov ah,GETEXTENDEDERROR ; 59h + 22490 0000244B B459 mov ah,59h + 22491 0000244D 31DB xor bx,bx + 22492 0000244F CD21 int 21h ; DOS - 3+ - GET EXTENDED ERROR CODE + 22493 ; BX = version code (0000h for DOS 3.x) + 22494 + 22495 00002451 83F80D cmp ax,ERROR_INVALID_DATA ; 0Dh ; invalid code page + 22496 00002454 7505 jne short no_countrysys ; 26/04/2023 + 22497 ;mov dx,FNOTFOUNDPTR ; MSDOS 3.3 + 22498 00002456 BA[9E90] mov dx,INV_CODE_PAGE + 22499 ;jmp cerror + 22500 00002459 EB18 jmp short cp_error + 22501 + 22502 ; 21/02/2023 + 22503 ; MSDOS 6.0 (& 5.0) COMMAND.COM + 22504 no_countrysys: + 22505 ;M045; mov byte [msg_disp_class],ext_msg_class + 22506 ; ;AN000; set up extended error msg class + 22507 ;M045; mov dx,extend_buf_ptr ;AC000; get extended message pointer + 22508 ;M045; mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND + 22509 ;AN000; get message number in control block + 22510 0000245B BA[C692] mov dx,NoCntry_Ptr + 22511 0000245E EB13 jmp short cp_error + 22512 + 22513 chcp_other_error: ; end of p716 + 22514 ;mov ah,GETEXTENDEDERROR ; 59h ;error - see what it is + 22515 00002460 B459 mov ah,59h + 22516 00002462 31DB xor bx,bx + 22517 00002464 CD21 int 21h ; DOS - 3+ - GET EXTENDED ERROR CODE + 22518 ; BX = version code (0000h for DOS 3.x) + 22519 00002466 83F841 cmp ax,65 ;was it access denied? + 22520 00002469 7505 jne short none_set ;no - assume all failed + 22521 0000246B BA[7F90] mov dx,cp_not_all_ptr + 22522 ;set up message + 22523 ;jmp cerror ;AC000; error exit + 22524 0000246E EB03 jmp short cp_error + 22525 none_set: + 22526 00002470 BA[7190] mov dx,cp_not_set_ptr + 22527 ;set up message + 22528 cp_error: + 22529 00002473 E9B008 jmp cerror ;exit + 22530 getcp: + 22531 ;;mov ah,GETSETCDPG ; 66h + 22532 ;mov ah,66h ;get/set global code page function + 22533 ;;mov al,get_global_cp ; 1 + 22534 ;mov al,1 ;minor - get + 22535 ; 26/04/2023 + 22536 00002476 B80166 mov ax,6601h + 22537 00002479 CD21 int 21h ; DOS - 3.3+ - GET GLOBAL CODE PAGE TABLE + 22538 0000247B 891E[9A9D] mov [system_cpage],bx + 22539 ;get active cp for output + 22540 0000247F BA[8D90] mov dx,cp_active_ptr + 22541 00002482 E8A32F call std_printf ;print it out + 22542 chcp_return: + 22543 00002485 C3 retn + 22544 + 22545 ; --------------------------------------------------------------------------- + 22546 + 22547 ; **************************************************************** + 22548 ; * + 22549 ; * ROUTINE: TRUENAME + 22550 ; * + 22551 ; * FUNCTION: Entry point for the internal TRUENAME command. + 22552 ; * Parses the command line. If a path is found, set + 22553 ; * SRCXNAME to path. If only a drive letter is found, + 22554 ; * set SRCXNAME to the drive letter. If no path + 22555 ; * is found, set the path of SRCXNAME to dot (.) for + 22556 ; * current directory. Use the NAME TRANSLATE system + 22557 ; * call to get the real name and then display the + 22558 ; * real name. If an error occurs issue an error + 22559 ; * message and transfer control to CERROR. + 22560 ; * + 22561 ; * INPUT: command line at offset 81H + 22562 ; * + 22563 ; * OUTPUT: none + 22564 ; * + 22565 ; **************************************************************** 22566 - 22567 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM - 22568 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2741h + 22567 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22568 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2197h 22569 - 22570 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 22571 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:257Dh + 22570 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM + 22571 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2741h 22572 - 22573 TRUENAME: ;AN000; TRUENAME entry point - 22574 00002486 1E push ds ;AN000; Get local ES - 22575 00002487 07 pop es ;AN000; - 22576 00002488 BE8100 mov si,81h ;AN000; Get command line - 22577 0000248B BF[9196] mov di,PARSE_CHDIR ;AN000; Get address of PARSE_CHDIR - 22578 0000248E 31C9 xor cx,cx ;AN000; clear cx,dx - 22579 00002490 31D2 xor dx,dx ;AN000; - 22580 00002492 E8C600 call Parse_With_Msg ;AC018; call parser - 22581 - 22582 00002495 BF[2399] mov di,SRCXNAME ;AN000; get address of srcxname - 22583 ;cmp ax,0FFFFh - 22584 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? - 22585 ;je short tn_eol ;AN000; yes - go process - 22586 ;; 22/02/2023 - 22587 ;;cmp ax,0 - 22588 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? - 22589 ;;jne short tn_parse_error ;AN000; yes - go issue message - 22590 ;and ax,ax ; ax = 0 ? - 22591 ;jnz short tn_parse_error ; no, parse error - 22592 ; 10/06/2023 - 22593 00002498 40 inc ax ; 0FFFFh -> 0 ; cmp ax,0FFFFh - 22594 00002499 7433 jz short tn_eol ; ah = 0 ; * - 22595 0000249B 48 dec ax ; 1 -> 0 ; cmp ax, 0 - 22596 0000249C 752D jnz short tn_parse_error - 22597 - 22598 ;cmp byte [PARSE1_TYPE],6 - 22599 0000249E 803E[EBA5]06 cmp byte [PARSE1_TYPE],result_drive - 22600 ;AN000; was a drive entered? - 22601 ;je short tn_drive ;AN000; yes - go process - 22602 ;jmp short tn_filespec ;AN000; nothing else - must be filespec - 22603 ; 23/02/2023 - 22604 000024A3 7512 jne short tn_filespec - 22605 - 22606 ;tn_eol: - 22607 ; ;mov ah,0 ;AN000; no parameters on line - 22608 ; mov ah,END_OF_LINE_OUT ;AN000; set buffer to . - 22609 ; ;mov al,dot_chr ;AN000; for current dir - 22610 ; mov al,'.' - 22611 ; stosw ;AN000; store in srcxname - 22612 ; jmp short tn_doit ;AN000; go do command - 22613 - 22614 tn_drive: ;AN000; a drive was entered - 22615 000024A5 56 push si ;AN000; save position in line - 22616 000024A6 BE[EFA5] mov si,PARSE1_ADDR ;AN000; get address of drive - 22617 000024A9 AC lodsb ;AN000; get the drive number - 22618 000024AA 0440 add al,"A"-1 ; 40h ;AN000; convert it to char - 22619 000024AC AA stosb ;AN000; store it in srcxname - 22620 ;mov ax,dot_colon ;AN000; get colon and . and - 22621 000024AD B83A2E mov ax,':.' ; 2E3Ah ; ah=".", al=":" - 22622 000024B0 AB stosw ;AN000; store in srcxname - 22623 ;mov al,0 - 22624 000024B1 B000 mov al,END_OF_LINE_OUT ;AN000; put a terminator char - 22625 000024B3 AA stosb ;AN000; - 22626 000024B4 5E pop si ;AN000; get line position back - 22627 000024B5 EB0C jmp short tn_check_eol ;AN000; check to make sure eol - 22628 - 22629 tn_filespec: ;AN000; a filespec was entered - 22630 000024B7 56 push si ;AN000; save position in line - 22631 000024B8 C536[EFA5] lds si,[PARSE1_ADDR] ;AN000; get address of filespec - 22632 - 22633 tn_move_filename: ;AN000; put filespec in srcxname - 22634 000024BC AC lodsb ;AN000; get a char from buffer - 22635 000024BD AA stosb ;AN000; store in srcxname - 22636 ;;cmp al,0 - 22637 ;cmp al,END_OF_LINE_OUT ;AN000; it char a terminator? - 22638 000024BE 08C0 or al,al ; al = 0 ? - 22639 000024C0 75FA jnz short tn_move_filename ;AN000; no - keep moving - 22640 000024C2 5E pop si ;AN000; get line position back - 22641 - 22642 tn_check_eol: ;AN000; make sure no extra parms - 22643 000024C3 BF[9196] mov di,PARSE_CHDIR ;AN000; get address of parse_chdir - 22644 000024C6 E87C00 call parse_check_eol ;AN000; are we at end of line? - 22645 000024C9 7406 jz short tn_doit ;AN000; Yes - do the command - 22646 tn_parse_error: ;AN000; A parse error occurred - 22647 000024CB E95808 jmp cerror ;AN000; Go to error routine - 22648 - 22649 tn_eol: - 22650 ;23/02/2023 - 22651 ;;mov ah,0 ;AN000; no parameters on line - 22652 ;mov ah,END_OF_LINE_OUT ;AN000; set buffer to . - 22653 ;;mov al,dot_chr ;AN000; for current dir - 22654 ;mov al,'.' - 22655 ; 10/06/2023 - 22656 ;mov ax,002Eh - 22657 ; ah = 0 ; * - 22658 000024CE B02E mov al,'.' ;dot_chr ; 2Eh - 22659 ; - 22660 000024D0 AB stosw ;AN000; store in srcxname - 22661 ; 23/02/2023 - 22662 ;jmp short tn_doit ;AN000; go do command - 22663 - 22664 tn_doit: ;AN000; - 22665 000024D1 BE[2399] mov si,SRCXNAME ;AN000; set up srcxname as source - 22666 000024D4 BF[549A] mov di,COMBUF ;AN000; set up combuf as target (need big target) - 22667 000024D7 B460 mov ah,xNameTrans ;AN000; do name translate call - 22668 ;mov ah,60h - 22669 000024D9 CD21 int 21h ;AN000; - 22670 000024DB 7311 jnc short tn_print_xname ;AN000; If no error - print result - 22671 - 22672 000024DD E85BFB call Set_Ext_Error_Msg ;AN000; get extended message - 22673 000024E0 C706[A09D][2399] mov word [string_ptr_2],SRCXNAME - 22674 ;AN000; get address of failed string - 22675 ;mov byte [extend_buf_sub],1 - 22676 000024E6 C606[D98F]01 mov byte [extend_buf_sub],one_subst - 22677 ;AN000; put number of subst in control block - 22678 000024EB E93808 jmp cerror ;AN000; Go to error routine - 22679 - 22680 tn_print_xname: ;AN000; - 22681 000024EE C706[A09D][549A] mov word [string_ptr_2],COMBUF - 22682 ;AN000; Set up address of combuf - 22683 000024F4 BA[DF91] mov dx,string_buf_ptr ;AN000; Set up address of print control block - 22684 000024F7 E87F04 call CRLF2 ;AN000; print a crlf - 22685 ;call Printf_Crlf ;AN000; print it out - 22686 ;retn ;AN000; - 22687 ; 23/02/2023 - 22688 000024FA E91D2F jmp Printf_Crlf - 22689 - 22690 ; --------------------------------------------------------------------------- - 22691 - 22692 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22693 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2219h + 22573 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 22574 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:257Dh + 22575 + 22576 TRUENAME: ;AN000; TRUENAME entry point + 22577 00002486 1E push ds ;AN000; Get local ES + 22578 00002487 07 pop es ;AN000; + 22579 00002488 BE8100 mov si,81h ;AN000; Get command line + 22580 0000248B BF[9196] mov di,PARSE_CHDIR ;AN000; Get address of PARSE_CHDIR + 22581 0000248E 31C9 xor cx,cx ;AN000; clear cx,dx + 22582 00002490 31D2 xor dx,dx ;AN000; + 22583 00002492 E8C600 call Parse_With_Msg ;AC018; call parser + 22584 + 22585 00002495 BF[2399] mov di,SRCXNAME ;AN000; get address of srcxname + 22586 ;cmp ax,0FFFFh + 22587 ;;cmp ax,END_OF_LINE ;AN000; are we at end of line? + 22588 ;je short tn_eol ;AN000; yes - go process + 22589 ;; 22/02/2023 + 22590 ;;cmp ax,0 + 22591 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? + 22592 ;;jne short tn_parse_error ;AN000; yes - go issue message + 22593 ;and ax,ax ; ax = 0 ? + 22594 ;jnz short tn_parse_error ; no, parse error + 22595 ; 10/06/2023 + 22596 00002498 40 inc ax ; 0FFFFh -> 0 ; cmp ax,0FFFFh + 22597 00002499 7433 jz short tn_eol ; ah = 0 ; * + 22598 0000249B 48 dec ax ; 1 -> 0 ; cmp ax, 0 + 22599 0000249C 752D jnz short tn_parse_error + 22600 + 22601 ;cmp byte [PARSE1_TYPE],6 + 22602 0000249E 803E[EBA5]06 cmp byte [PARSE1_TYPE],result_drive + 22603 ;AN000; was a drive entered? + 22604 ;je short tn_drive ;AN000; yes - go process + 22605 ;jmp short tn_filespec ;AN000; nothing else - must be filespec + 22606 ; 23/02/2023 + 22607 000024A3 7512 jne short tn_filespec + 22608 + 22609 ;tn_eol: + 22610 ; ;mov ah,0 ;AN000; no parameters on line + 22611 ; mov ah,END_OF_LINE_OUT ;AN000; set buffer to . + 22612 ; ;mov al,dot_chr ;AN000; for current dir + 22613 ; mov al,'.' + 22614 ; stosw ;AN000; store in srcxname + 22615 ; jmp short tn_doit ;AN000; go do command + 22616 + 22617 tn_drive: ;AN000; a drive was entered + 22618 000024A5 56 push si ;AN000; save position in line + 22619 000024A6 BE[EFA5] mov si,PARSE1_ADDR ;AN000; get address of drive + 22620 000024A9 AC lodsb ;AN000; get the drive number + 22621 000024AA 0440 add al,"A"-1 ; 40h ;AN000; convert it to char + 22622 000024AC AA stosb ;AN000; store it in srcxname + 22623 ;mov ax,dot_colon ;AN000; get colon and . and + 22624 000024AD B83A2E mov ax,':.' ; 2E3Ah ; ah=".", al=":" + 22625 000024B0 AB stosw ;AN000; store in srcxname + 22626 ;mov al,0 + 22627 000024B1 B000 mov al,END_OF_LINE_OUT ;AN000; put a terminator char + 22628 000024B3 AA stosb ;AN000; + 22629 000024B4 5E pop si ;AN000; get line position back + 22630 000024B5 EB0C jmp short tn_check_eol ;AN000; check to make sure eol + 22631 + 22632 tn_filespec: ;AN000; a filespec was entered + 22633 000024B7 56 push si ;AN000; save position in line + 22634 000024B8 C536[EFA5] lds si,[PARSE1_ADDR] ;AN000; get address of filespec + 22635 + 22636 tn_move_filename: ;AN000; put filespec in srcxname + 22637 000024BC AC lodsb ;AN000; get a char from buffer + 22638 000024BD AA stosb ;AN000; store in srcxname + 22639 ;;cmp al,0 + 22640 ;cmp al,END_OF_LINE_OUT ;AN000; it char a terminator? + 22641 000024BE 08C0 or al,al ; al = 0 ? + 22642 000024C0 75FA jnz short tn_move_filename ;AN000; no - keep moving + 22643 000024C2 5E pop si ;AN000; get line position back + 22644 + 22645 tn_check_eol: ;AN000; make sure no extra parms + 22646 000024C3 BF[9196] mov di,PARSE_CHDIR ;AN000; get address of parse_chdir + 22647 000024C6 E87C00 call parse_check_eol ;AN000; are we at end of line? + 22648 000024C9 7406 jz short tn_doit ;AN000; Yes - do the command + 22649 tn_parse_error: ;AN000; A parse error occurred + 22650 000024CB E95808 jmp cerror ;AN000; Go to error routine + 22651 + 22652 tn_eol: + 22653 ;23/02/2023 + 22654 ;;mov ah,0 ;AN000; no parameters on line + 22655 ;mov ah,END_OF_LINE_OUT ;AN000; set buffer to . + 22656 ;;mov al,dot_chr ;AN000; for current dir + 22657 ;mov al,'.' + 22658 ; 10/06/2023 + 22659 ;mov ax,002Eh + 22660 ; ah = 0 ; * + 22661 000024CE B02E mov al,'.' ;dot_chr ; 2Eh + 22662 ; + 22663 000024D0 AB stosw ;AN000; store in srcxname + 22664 ; 23/02/2023 + 22665 ;jmp short tn_doit ;AN000; go do command + 22666 + 22667 tn_doit: ;AN000; + 22668 000024D1 BE[2399] mov si,SRCXNAME ;AN000; set up srcxname as source + 22669 000024D4 BF[549A] mov di,COMBUF ;AN000; set up combuf as target (need big target) + 22670 000024D7 B460 mov ah,xNameTrans ;AN000; do name translate call + 22671 ;mov ah,60h + 22672 000024D9 CD21 int 21h ;AN000; + 22673 000024DB 7311 jnc short tn_print_xname ;AN000; If no error - print result + 22674 + 22675 000024DD E85BFB call Set_Ext_Error_Msg ;AN000; get extended message + 22676 000024E0 C706[A09D][2399] mov word [string_ptr_2],SRCXNAME + 22677 ;AN000; get address of failed string + 22678 ;mov byte [extend_buf_sub],1 + 22679 000024E6 C606[D98F]01 mov byte [extend_buf_sub],one_subst + 22680 ;AN000; put number of subst in control block + 22681 000024EB E93808 jmp cerror ;AN000; Go to error routine + 22682 + 22683 tn_print_xname: ;AN000; + 22684 000024EE C706[A09D][549A] mov word [string_ptr_2],COMBUF + 22685 ;AN000; Set up address of combuf + 22686 000024F4 BA[DF91] mov dx,string_buf_ptr ;AN000; Set up address of print control block + 22687 000024F7 E87F04 call CRLF2 ;AN000; print a crlf + 22688 ;call Printf_Crlf ;AN000; print it out + 22689 ;retn ;AN000; + 22690 ; 23/02/2023 + 22691 000024FA E91D2F jmp Printf_Crlf + 22692 + 22693 ; --------------------------------------------------------------------------- 22694 - 22695 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM - 22696 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:27C3h + 22695 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22696 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2219h 22697 - 22698 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 22699 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2600h - 22700 _$EXIT: - 22701 ; MSDOS 6.0 - 22702 000024FD 1E push ds ;AN000; save data segment - 22703 000024FE 8E1E[F59B] mov ds,[RESSEG] ;AN000; get resident data segment - 22704 ;assume ds:resgroup ;AN000; - 22705 - 22706 00002502 803E[A202]00 cmp byte [PermCom],0 ;AN045; is this a permanent COMMAND? - 22707 00002507 740A jz short free_com ;AN045; no - free everything + 22698 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM + 22699 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:27C3h + 22700 + 22701 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 22702 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2600h + 22703 _$EXIT: + 22704 ; MSDOS 6.0 + 22705 000024FD 1E push ds ;AN000; save data segment + 22706 000024FE 8E1E[F59B] mov ds,[RESSEG] ;AN000; get resident data segment + 22707 ;assume ds:resgroup ;AN000; 22708 - 22709 ; We're a permanent command. - 22710 ; Unless this is a singlecom (int 2Eh), don't deallocate transient. + 22709 00002502 803E[A202]00 cmp byte [PermCom],0 ;AN045; is this a permanent COMMAND? + 22710 00002507 740A jz short free_com ;AN045; no - free everything 22711 - 22712 00002509 833E[A502]FF cmp word [SingleCom],-1 ;M034 - 22713 0000250E 7403 je short no_reset ;M034 ; exit singlecom - 22714 00002510 E9F1DB jmp TCOMMAND ;permanent command, recycle - 22715 - 22716 free_com: - 22717 - 22718 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 22719 %if 0 - 22720 ;mov ax,(multdos shl 8 or message_2f) - 22721 mov ax,122Eh ;AN060; reset parse message pointers - 22722 ;mov dl,SET_CRITICAL_MSG ;AN000; set up critical error message address - 22723 mov dl,5 - 22724 mov di,[Crit_Msg_Off] ;AN000; old offset of critical messages - 22725 mov es,[Crit_Msg_Seg] ;AN000; old segment of critical messages - 22726 int 2Fh ;AN000; go set it - 22727 %endif - 22728 - 22729 no_reset: ;AN045; - 22730 00002513 1F pop ds ;AN000; restore local data segment - 22731 ;assume ds:trangroup ;AN000; - 22732 ;M040 - 22733 ; Restore user directory if the restore flag is set. RestUDir1 checks for - 22734 ;this, restores user dir if flag is set and resets the flag. - 22735 - 22736 ;invoke RestUDir1 ;restore user dir if needed ;M040 - 22737 00002514 E80C03 call RestUDir1 - 22738 00002517 8E06[F59B] mov es,[RESSEG] - 22739 ;assume es:resgroup - 22740 - 22741 0000251B 26A1[3E02] mov ax,[es:Parent] - 22742 ;mov [es:16h],ax - 22743 ;mov [es:PDB_Parent_PID],ax - 22744 0000251F 26A31600 mov [es:PDB.PARENT_PID],ax - 22745 00002523 26A1[4002] mov ax,[es:OldTerm] - 22746 ;mov [es:0Ah],ax - 22747 ;mov [es:PDB_Exit],ax - 22748 00002527 26A30A00 mov [es:PDB.EXIT],ax - 22749 0000252B 26A1[4202] mov ax,[es:OldTerm+2] - 22750 ;mov [es:0Ch],ax - 22751 ;mov [es:PDB_Exit+2],ax - 22752 0000252F 26A30C00 mov [es:PDB.EXIT+2],ax - 22753 - 22754 00002533 06 push es - 22755 00002534 8E06[039C] mov es,[TRAN_TPA] - 22756 ;mov ah,DEALLOC - 22757 00002538 B449 mov ah,49h - 22758 0000253A CD21 int 21h ; Now running in "free" space - 22759 0000253C 07 pop es - 22760 - 22761 ;mov ah,Exit - 22762 0000253D B44C mov ah,4Ch - 22763 ;mov al,byte ptr RetCode - 22764 0000253F 26A0[9A02] mov al,[es:RetCode] - 22765 00002543 CD21 int 21h - 22766 - 22767 ; --------------------------------------------------------------------------- - 22768 - 22769 ; MSDOS 6.0 - 22770 ; **************************************************************** - 22771 ; * - 22772 ; * ROUTINE: PARSE_CHECK_EOL - 22773 ; * - 22774 ; * FUNCTION: Calls parser to see if end of line occurred. - 22775 ; * If not end of line, set up to print parse - 22776 ; * error message. ASSUMES NO MORE PARAMETERS ARE - 22777 ; * EXPECTED! - 22778 ; * - 22779 ; * INPUT: DS:SI last output from parser - 22780 ; * ES:DI points to parse block - 22781 ; * CX last output from parser - 22782 ; * - 22783 ; * OUTPUT: AX parser return code - 22784 ; * - 22785 ; * if end of line found - 22786 ; * zero flag set - 22787 ; * else - 22788 ; * MSG_DISPLAY_CLASS set to parse error - 22789 ; * - 22790 ; **************************************************************** - 22791 - 22792 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22793 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2270h + 22712 ; We're a permanent command. + 22713 ; Unless this is a singlecom (int 2Eh), don't deallocate transient. + 22714 + 22715 00002509 833E[A502]FF cmp word [SingleCom],-1 ;M034 + 22716 0000250E 7403 je short no_reset ;M034 ; exit singlecom + 22717 00002510 E9F1DB jmp TCOMMAND ;permanent command, recycle + 22718 + 22719 free_com: + 22720 + 22721 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 22722 %if 0 + 22723 ;mov ax,(multdos shl 8 or message_2f) + 22724 mov ax,122Eh ;AN060; reset parse message pointers + 22725 ;mov dl,SET_CRITICAL_MSG ;AN000; set up critical error message address + 22726 mov dl,5 + 22727 mov di,[Crit_Msg_Off] ;AN000; old offset of critical messages + 22728 mov es,[Crit_Msg_Seg] ;AN000; old segment of critical messages + 22729 int 2Fh ;AN000; go set it + 22730 %endif + 22731 + 22732 no_reset: ;AN045; + 22733 00002513 1F pop ds ;AN000; restore local data segment + 22734 ;assume ds:trangroup ;AN000; + 22735 ;M040 + 22736 ; Restore user directory if the restore flag is set. RestUDir1 checks for + 22737 ;this, restores user dir if flag is set and resets the flag. + 22738 + 22739 ;invoke RestUDir1 ;restore user dir if needed ;M040 + 22740 00002514 E80C03 call RestUDir1 + 22741 00002517 8E06[F59B] mov es,[RESSEG] + 22742 ;assume es:resgroup + 22743 + 22744 0000251B 26A1[3E02] mov ax,[es:Parent] + 22745 ;mov [es:16h],ax + 22746 ;mov [es:PDB_Parent_PID],ax + 22747 0000251F 26A31600 mov [es:PDB.PARENT_PID],ax + 22748 00002523 26A1[4002] mov ax,[es:OldTerm] + 22749 ;mov [es:0Ah],ax + 22750 ;mov [es:PDB_Exit],ax + 22751 00002527 26A30A00 mov [es:PDB.EXIT],ax + 22752 0000252B 26A1[4202] mov ax,[es:OldTerm+2] + 22753 ;mov [es:0Ch],ax + 22754 ;mov [es:PDB_Exit+2],ax + 22755 0000252F 26A30C00 mov [es:PDB.EXIT+2],ax + 22756 + 22757 00002533 06 push es + 22758 00002534 8E06[039C] mov es,[TRAN_TPA] + 22759 ;mov ah,DEALLOC + 22760 00002538 B449 mov ah,49h + 22761 0000253A CD21 int 21h ; Now running in "free" space + 22762 0000253C 07 pop es + 22763 + 22764 ;mov ah,Exit + 22765 0000253D B44C mov ah,4Ch + 22766 ;mov al,byte ptr RetCode + 22767 0000253F 26A0[9A02] mov al,[es:RetCode] + 22768 00002543 CD21 int 21h + 22769 + 22770 ; --------------------------------------------------------------------------- + 22771 + 22772 ; MSDOS 6.0 + 22773 ; **************************************************************** + 22774 ; * + 22775 ; * ROUTINE: PARSE_CHECK_EOL + 22776 ; * + 22777 ; * FUNCTION: Calls parser to see if end of line occurred. + 22778 ; * If not end of line, set up to print parse + 22779 ; * error message. ASSUMES NO MORE PARAMETERS ARE + 22780 ; * EXPECTED! + 22781 ; * + 22782 ; * INPUT: DS:SI last output from parser + 22783 ; * ES:DI points to parse block + 22784 ; * CX last output from parser + 22785 ; * + 22786 ; * OUTPUT: AX parser return code + 22787 ; * + 22788 ; * if end of line found + 22789 ; * zero flag set + 22790 ; * else + 22791 ; * MSG_DISPLAY_CLASS set to parse error + 22792 ; * + 22793 ; **************************************************************** 22794 - 22795 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 22796 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2648h - 22797 parse_check_eol: - 22798 00002545 31D2 xor dx,dx ;AN000; - 22799 00002547 8936[989D] mov [parse_last],si ;AN018; save start of parameter - 22800 0000254B E81E24 call cmd_parse ;AN000; call parser - 22801 0000254E 3CFF cmp al,-1 ; 0FFh - 22802 ;cmp al,END_OF_LINE ; 0FFh ;AN000; Are we at end of line? - 22803 00002550 7408 je short parse_good_eol ;AN000; yes - no problem - 22804 ;cmp ax,0 - 22805 ;cmp ax,RESULT_NO_ERROR ;AN018; was any error found? - 22806 00002552 21C0 and ax,ax ; ax = 0 ? - 22807 00002554 7501 jnz short ok_to_setup_pmsg ;AN018; yes - continue - 22808 00002556 40 inc ax ;AN018; set AX to 1 and turn off zero flag - 22809 ok_to_setup_pmsg: - 22810 00002557 E81000 call setup_parse_error_msg ;AN018; go set up error message - 22811 parse_good_eol: - 22812 parse_msg_good: ; 23/02/2023 - 22813 0000255A C3 retn ;AN000; - 22814 - 22815 ; --------------------------------------------------------------------------- - 22816 - 22817 ; MSDOS 6.0 - 22818 ; **************************************************************** - 22819 ; * - 22820 ; * ROUTINE: PARSE_WITH_MSG - 22821 ; * - 22822 ; * FUNCTION: Calls parser. If an error occurred, the error - 22823 ; * message is set up. + 22795 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22796 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2270h + 22797 + 22798 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 22799 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2648h + 22800 parse_check_eol: + 22801 00002545 31D2 xor dx,dx ;AN000; + 22802 00002547 8936[989D] mov [parse_last],si ;AN018; save start of parameter + 22803 0000254B E81E24 call cmd_parse ;AN000; call parser + 22804 0000254E 3CFF cmp al,-1 ; 0FFh + 22805 ;cmp al,END_OF_LINE ; 0FFh ;AN000; Are we at end of line? + 22806 00002550 7408 je short parse_good_eol ;AN000; yes - no problem + 22807 ;cmp ax,0 + 22808 ;cmp ax,RESULT_NO_ERROR ;AN018; was any error found? + 22809 00002552 21C0 and ax,ax ; ax = 0 ? + 22810 00002554 7501 jnz short ok_to_setup_pmsg ;AN018; yes - continue + 22811 00002556 40 inc ax ;AN018; set AX to 1 and turn off zero flag + 22812 ok_to_setup_pmsg: + 22813 00002557 E81000 call setup_parse_error_msg ;AN018; go set up error message + 22814 parse_good_eol: + 22815 parse_msg_good: ; 23/02/2023 + 22816 0000255A C3 retn ;AN000; + 22817 + 22818 ; --------------------------------------------------------------------------- + 22819 + 22820 ; MSDOS 6.0 + 22821 ; **************************************************************** + 22822 ; * + 22823 ; * ROUTINE: PARSE_WITH_MSG 22824 ; * - 22825 ; * INPUT: DS:SI last output from parser - 22826 ; * ES:DI points to parse block - 22827 ; * CX last output from parser - 22828 ; * - 22829 ; * OUTPUT: AX parser return code - 22830 ; * - 22831 ; * if no error - 22832 ; * outputs from parser - 22833 ; * else - 22834 ; * MSG_DISPLAY_CLASS set to parse error - 22835 ; * error message set up for STD_PRINTF - 22836 ; * - 22837 ; **************************************************************** - 22838 - 22839 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22840 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 22841 Parse_With_Msg: - 22842 0000255B 8936[989D] mov [parse_last],si ;AN018; save start of parameter - 22843 0000255F E80A24 call cmd_parse ;AN018; call parser - 22844 00002562 3CFF cmp al,-1 ; 0FFh - 22845 ;cmp al,END_OF_LINE ; 0FFh ;AN018; Are we at end of line? - 22846 00002564 74F4 je short parse_msg_good ;AN018; yes - no problem - 22847 ;cmp ax,0 - 22848 ;cmp ax,RESULT_NO_ERROR ;AN018; did an error occur - 22849 00002566 09C0 or ax,ax ; ax = 0 ? - 22850 00002568 74F0 jz short parse_msg_good ;AN018; yes - no problem - 22851 ; 23/02/2023 - 22852 ;call setup_parse_error_msg ;AN018; go set up error message - 22853 ;parse_msg_good: - 22854 ;retn ;AN018; - 22855 ; 23/02/2023 - 22856 ;jmp short setup_parse_error_msg - 22857 - 22858 ; --------------------------------------------------------------------------- - 22859 - 22860 ; MSDOS 6.0 - 22861 ; **************************************************************** - 22862 ; * - 22863 ; * ROUTINE: SETUP_PARSE_ERROR_MSG - 22864 ; * - 22865 ; * FUNCTION: Calls parser. If an error occurred, the error - 22866 ; * message is set up. + 22825 ; * FUNCTION: Calls parser. If an error occurred, the error + 22826 ; * message is set up. + 22827 ; * + 22828 ; * INPUT: DS:SI last output from parser + 22829 ; * ES:DI points to parse block + 22830 ; * CX last output from parser + 22831 ; * + 22832 ; * OUTPUT: AX parser return code + 22833 ; * + 22834 ; * if no error + 22835 ; * outputs from parser + 22836 ; * else + 22837 ; * MSG_DISPLAY_CLASS set to parse error + 22838 ; * error message set up for STD_PRINTF + 22839 ; * + 22840 ; **************************************************************** + 22841 + 22842 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22843 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 22844 Parse_With_Msg: + 22845 0000255B 8936[989D] mov [parse_last],si ;AN018; save start of parameter + 22846 0000255F E80A24 call cmd_parse ;AN018; call parser + 22847 00002562 3CFF cmp al,-1 ; 0FFh + 22848 ;cmp al,END_OF_LINE ; 0FFh ;AN018; Are we at end of line? + 22849 00002564 74F4 je short parse_msg_good ;AN018; yes - no problem + 22850 ;cmp ax,0 + 22851 ;cmp ax,RESULT_NO_ERROR ;AN018; did an error occur + 22852 00002566 09C0 or ax,ax ; ax = 0 ? + 22853 00002568 74F0 jz short parse_msg_good ;AN018; yes - no problem + 22854 ; 23/02/2023 + 22855 ;call setup_parse_error_msg ;AN018; go set up error message + 22856 ;parse_msg_good: + 22857 ;retn ;AN018; + 22858 ; 23/02/2023 + 22859 ;jmp short setup_parse_error_msg + 22860 + 22861 ; --------------------------------------------------------------------------- + 22862 + 22863 ; MSDOS 6.0 + 22864 ; **************************************************************** + 22865 ; * + 22866 ; * ROUTINE: SETUP_PARSE_ERROR_MSG 22867 ; * - 22868 ; * INPUT: AX Parse error number - 22869 ; * SI Set to past last parameter - 22870 ; * Parse_last Set to start of last parameter - 22871 ; * - 22872 ; * OUTPUT: MSG_DISPLAY_CLASS set to parse error - 22873 ; * error message set up for STD_PRINTF + 22868 ; * FUNCTION: Calls parser. If an error occurred, the error + 22869 ; * message is set up. + 22870 ; * + 22871 ; * INPUT: AX Parse error number + 22872 ; * SI Set to past last parameter + 22873 ; * Parse_last Set to start of last parameter 22874 ; * - 22875 ; **************************************************************** - 22876 - 22877 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 22878 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 22879 setup_parse_error_msg: - 22880 0000256A C606[D58F]02 mov byte [msg_disp_class],parse_msg_class - 22881 ;mov byte [msg_disp_class],2 ;AC018; Set up parse message class - 22882 0000256F BA[D78F] mov dx,extend_buf_ptr ;AC018; get extended message pointer - 22883 00002572 C60400 mov byte [si],END_OF_LINE_OUT ; 0 - 22884 ;AC018; terminate the parameter string - 22885 00002575 A3[D78F] mov [extend_buf_ptr],ax ;AC018; get message number in control block - 22886 00002578 83F802 cmp ax,2 - 22887 ;cmp ax,LessArgs_Ptr ;AC018; if required parameter missing - 22888 0000257B 740D je short setup_parse_msg_ret - 22889 ;AN018; no subst - 22890 0000257D 8B36[989D] mov si,[parse_last] ;AC018; get start of parameter - 22891 00002581 8936[A09D] mov [string_ptr_2],si ;AC018; get address of failed string - 22892 00002585 C606[D98F]01 mov byte [extend_buf_sub],one_subst - 22893 ;AC018; put number of subst in control block - 22894 ;mov byte [extend_buf_sub],1 - 22895 setup_parse_msg_ret: - 22896 0000258A 46 inc si ;AN018; make sure zero flag not set - 22897 0000258B C3 retn ;AC018; - 22898 - 22899 ;============================================================================ - 22900 ; TENV.ASM, MSDOS 6.0, 1991 - 22901 ;============================================================================ - 22902 ; 08/10/2018 - Retro DOS v3.0 - 22903 - 22904 ; TITLE Part6 COMMAND Transient routines. - 22905 - 22906 ; Environment utilities and misc. routines - 22907 - 22908 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1690h - 22909 - 22910 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) - 22911 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 22BDh + 22875 ; * OUTPUT: MSG_DISPLAY_CLASS set to parse error + 22876 ; * error message set up for STD_PRINTF + 22877 ; * + 22878 ; **************************************************************** + 22879 + 22880 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 22881 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 22882 setup_parse_error_msg: + 22883 0000256A C606[D58F]02 mov byte [msg_disp_class],parse_msg_class + 22884 ;mov byte [msg_disp_class],2 ;AC018; Set up parse message class + 22885 0000256F BA[D78F] mov dx,extend_buf_ptr ;AC018; get extended message pointer + 22886 00002572 C60400 mov byte [si],END_OF_LINE_OUT ; 0 + 22887 ;AC018; terminate the parameter string + 22888 00002575 A3[D78F] mov [extend_buf_ptr],ax ;AC018; get message number in control block + 22889 00002578 83F802 cmp ax,2 + 22890 ;cmp ax,LessArgs_Ptr ;AC018; if required parameter missing + 22891 0000257B 740D je short setup_parse_msg_ret + 22892 ;AN018; no subst + 22893 0000257D 8B36[989D] mov si,[parse_last] ;AC018; get start of parameter + 22894 00002581 8936[A09D] mov [string_ptr_2],si ;AC018; get address of failed string + 22895 00002585 C606[D98F]01 mov byte [extend_buf_sub],one_subst + 22896 ;AC018; put number of subst in control block + 22897 ;mov byte [extend_buf_sub],1 + 22898 setup_parse_msg_ret: + 22899 0000258A 46 inc si ;AN018; make sure zero flag not set + 22900 0000258B C3 retn ;AC018; + 22901 + 22902 ;============================================================================ + 22903 ; TENV.ASM, MSDOS 6.0, 1991 + 22904 ;============================================================================ + 22905 ; 08/10/2018 - Retro DOS v3.0 + 22906 + 22907 ; TITLE Part6 COMMAND Transient routines. + 22908 + 22909 ; Environment utilities and misc. routines + 22910 + 22911 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1690h 22912 - 22913 ; --------------------------------------------------------------------------- - 22914 - 22915 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 22916 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM - 22917 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 22918 ADD_PROMPT: - 22919 0000258C E8FC00 call delete_prompt ; Delete any existing prompt - 22920 0000258F E8AD01 call scan_double_null - 22921 - 22922 ADD_PROMPT2: - 22923 00002592 56 push si - 22924 00002593 E89B01 call GETARG - 22925 00002596 5E pop si - 22926 00002597 7501 jnz short ADD_PROMPT3 - 22927 ADD_PROMPT_RETN: - 22928 00002599 C3 retn - 22929 ADD_PROMPT3: ; Pre scan for arguments - 22930 0000259A E87501 call move_name ; Move in name - 22931 0000259D E89101 call GETARG - 22932 000025A0 56 push si - 22933 000025A1 EB53 jmp short ADD_NAME - 22934 - 22935 ;break The SET command - 22936 - 22937 ; Input: DS:SI points to a CR terminated string - 22938 ; Output: carry flag is set if no room - 22939 ; otherwise name is added to environment - 22940 - 22941 DISP_ENVJ: - 22942 000025A3 E9BC00 jmp DISP_ENV + 22913 ; 23/02/2023 - Retro DOS v4.0 (& v4.1) + 22914 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 22BDh + 22915 + 22916 ; --------------------------------------------------------------------------- + 22917 + 22918 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 22919 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM + 22920 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 22921 ADD_PROMPT: + 22922 0000258C E8FC00 call delete_prompt ; Delete any existing prompt + 22923 0000258F E8AD01 call scan_double_null + 22924 + 22925 ADD_PROMPT2: + 22926 00002592 56 push si + 22927 00002593 E89B01 call GETARG + 22928 00002596 5E pop si + 22929 00002597 7501 jnz short ADD_PROMPT3 + 22930 ADD_PROMPT_RETN: + 22931 00002599 C3 retn + 22932 ADD_PROMPT3: ; Pre scan for arguments + 22933 0000259A E87501 call move_name ; Move in name + 22934 0000259D E89101 call GETARG + 22935 000025A0 56 push si + 22936 000025A1 EB53 jmp short ADD_NAME + 22937 + 22938 ;break The SET command + 22939 + 22940 ; Input: DS:SI points to a CR terminated string + 22941 ; Output: carry flag is set if no room + 22942 ; otherwise name is added to environment 22943 - 22944 ADD_NAME_TO_ENVIRONMENT: - 22945 000025A6 E88801 call GETARG - 22946 000025A9 74F8 jz short DISP_ENVJ - 22947 - 22948 ; check if line contains exactly one equals sign - 22949 - 22950 000025AB 31DB xor bx,bx ; = count is 0 - 22951 000025AD 56 push si ; Save pointer to beginning of line - 22952 EQLP: - 22953 000025AE AC lodsb ; Get a char - 22954 000025AF 3C0D cmp al,13 ; 0Dh ; IF CR we're all done - 22955 000025B1 740F je short QUEQ - 22956 000025B3 3C3D cmp al,'=' ; Look for = sign - 22957 000025B5 75F7 jne short EQLP ; not there, get next char - 22958 000025B7 FEC3 inc bl ; Otherwise increment EQ count - 22959 000025B9 803C0D cmp byte [si],13 ; Look for CR following = sign - 22960 000025BC 75F0 jne short EQLP - 22961 000025BE FEC7 inc bh ; Set BH=1 means no parameters - 22962 000025C0 EBEC jmp short EQLP ; And look for more - 22963 QUEQ: - 22964 000025C2 5E pop si ; Restore beginning of line - 22965 000025C3 FECB dec bl ; Zero flag means only one EQ - 22966 000025C5 7406 jz short ONEQ ; Good line - 22967 000025C7 BA[AA90] mov dx,SYNTMES_PTR - 22968 000025CA E95907 jmp cerror - 22969 ONEQ: - 22970 000025CD 53 push bx - 22971 000025CE E8BD00 call delete_name_in_environment - 22972 000025D1 5B pop bx - 22973 000025D2 FECF dec bh - 22974 000025D4 74C3 jz short ADD_PROMPT_RETN - 22975 000025D6 E86601 call scan_double_null - 22976 000025D9 89FB mov bx,di ; Save ptr to beginning of env var name - 22977 000025DB E83401 call move_name - 22978 000025DE 56 push si - 22979 000025DF 87DF xchg bx,di ; Switch ptrs to beginning and end of - 22980 ; env var name - 22981 - 22982 ; We want to special-case COMSPEC. This is to reduce the amount of code - 22983 ; necessary in the resident for re-reading the transient. Let's look for - 22984 ; COMSPEC= - 22985 - 22986 000025E1 C606[E395]00 mov byte [comspec_flag],0 ; MSDOS 6.0 ; clear flag ; M024 - 22987 000025E6 BE[FD92] mov si,COMSPECSTR ; "COMSPEC=" - 22988 000025E9 B90400 mov cx,4 - 22989 000025EC F3A7 repe cmpsw - 22990 000025EE 7504 jnz short NOT_COMSPEC - 22991 ; Zero set => exact match - 22992 000025F0 FE06[E395] inc byte [comspec_flag] ; MSDOS 6.0 ; comspec is changing ; M024 - 22993 ;mov byte [COMSPEC_FLAG],1 - 22994 NOT_COMSPEC: - 22995 000025F4 89DF mov di,bx ; Load ptr to end of env var name - 22996 ADD_NAME: - 22997 000025F6 5E pop si ; Add the value of the new env var - 22998 000025F7 56 push si ; to the environment. - 22999 ADD_NAME1: - 23000 000025F8 AC lodsb - 23001 000025F9 3C0D cmp al,13 ; 0Dh - 23002 000025FB 7405 je short ADD_NAME_RET - 23003 000025FD E8AD01 call store_char - 23004 00002600 EBF6 jmp short ADD_NAME1 - 23005 ADD_NAME_RET: - 23006 00002602 5E pop si - 23007 00002603 803E[E395]00 cmp byte [comspec_flag],0 - 23008 ; If the new env var is comspec, - 23009 ADD_NAME_JZ_RET: - 23010 00002608 748F jz short ADD_PROMPT_RETN - 23011 ; copy the value into the - 23012 ; comspec var in the resident - 23013 - 23014 ; We have changed the COMSPEC variable. We need to update the resident - 23015 ; pieces necessary to reread in the info. First, skip all delimiters + 22944 DISP_ENVJ: + 22945 000025A3 E9BC00 jmp DISP_ENV + 22946 + 22947 ADD_NAME_TO_ENVIRONMENT: + 22948 000025A6 E88801 call GETARG + 22949 000025A9 74F8 jz short DISP_ENVJ + 22950 + 22951 ; check if line contains exactly one equals sign + 22952 + 22953 000025AB 31DB xor bx,bx ; = count is 0 + 22954 000025AD 56 push si ; Save pointer to beginning of line + 22955 EQLP: + 22956 000025AE AC lodsb ; Get a char + 22957 000025AF 3C0D cmp al,13 ; 0Dh ; IF CR we're all done + 22958 000025B1 740F je short QUEQ + 22959 000025B3 3C3D cmp al,'=' ; Look for = sign + 22960 000025B5 75F7 jne short EQLP ; not there, get next char + 22961 000025B7 FEC3 inc bl ; Otherwise increment EQ count + 22962 000025B9 803C0D cmp byte [si],13 ; Look for CR following = sign + 22963 000025BC 75F0 jne short EQLP + 22964 000025BE FEC7 inc bh ; Set BH=1 means no parameters + 22965 000025C0 EBEC jmp short EQLP ; And look for more + 22966 QUEQ: + 22967 000025C2 5E pop si ; Restore beginning of line + 22968 000025C3 FECB dec bl ; Zero flag means only one EQ + 22969 000025C5 7406 jz short ONEQ ; Good line + 22970 000025C7 BA[AA90] mov dx,SYNTMES_PTR + 22971 000025CA E95907 jmp cerror + 22972 ONEQ: + 22973 000025CD 53 push bx + 22974 000025CE E8BD00 call delete_name_in_environment + 22975 000025D1 5B pop bx + 22976 000025D2 FECF dec bh + 22977 000025D4 74C3 jz short ADD_PROMPT_RETN + 22978 000025D6 E86601 call scan_double_null + 22979 000025D9 89FB mov bx,di ; Save ptr to beginning of env var name + 22980 000025DB E83401 call move_name + 22981 000025DE 56 push si + 22982 000025DF 87DF xchg bx,di ; Switch ptrs to beginning and end of + 22983 ; env var name + 22984 + 22985 ; We want to special-case COMSPEC. This is to reduce the amount of code + 22986 ; necessary in the resident for re-reading the transient. Let's look for + 22987 ; COMSPEC= + 22988 + 22989 000025E1 C606[E395]00 mov byte [comspec_flag],0 ; MSDOS 6.0 ; clear flag ; M024 + 22990 000025E6 BE[FD92] mov si,COMSPECSTR ; "COMSPEC=" + 22991 000025E9 B90400 mov cx,4 + 22992 000025EC F3A7 repe cmpsw + 22993 000025EE 7504 jnz short NOT_COMSPEC + 22994 ; Zero set => exact match + 22995 000025F0 FE06[E395] inc byte [comspec_flag] ; MSDOS 6.0 ; comspec is changing ; M024 + 22996 ;mov byte [COMSPEC_FLAG],1 + 22997 NOT_COMSPEC: + 22998 000025F4 89DF mov di,bx ; Load ptr to end of env var name + 22999 ADD_NAME: + 23000 000025F6 5E pop si ; Add the value of the new env var + 23001 000025F7 56 push si ; to the environment. + 23002 ADD_NAME1: + 23003 000025F8 AC lodsb + 23004 000025F9 3C0D cmp al,13 ; 0Dh + 23005 000025FB 7405 je short ADD_NAME_RET + 23006 000025FD E8AD01 call store_char + 23007 00002600 EBF6 jmp short ADD_NAME1 + 23008 ADD_NAME_RET: + 23009 00002602 5E pop si + 23010 00002603 803E[E395]00 cmp byte [comspec_flag],0 + 23011 ; If the new env var is comspec, + 23012 ADD_NAME_JZ_RET: + 23013 00002608 748F jz short ADD_PROMPT_RETN + 23014 ; copy the value into the + 23015 ; comspec var in the resident 23016 - 23017 0000260A E87903 call scanoff - 23018 0000260D 8E06[F59B] mov es,[RESSEG] ; comspec var in the resident + 23017 ; We have changed the COMSPEC variable. We need to update the resident + 23018 ; pieces necessary to reread in the info. First, skip all delimiters 23019 - 23020 ; Make sure that the printer knows where the beginning of the string is - 23021 - 23022 00002611 BF[4B02] mov di,ComSpec - 23023 00002614 89FB mov bx,di + 23020 0000260A E87903 call scanoff + 23021 0000260D 8E06[F59B] mov es,[RESSEG] ; comspec var in the resident + 23022 + 23023 ; Make sure that the printer knows where the beginning of the string is 23024 - 23025 ; Generate drive letter for display - 23026 - 23027 00002616 31C0 xor ax,ax ;g assume no drive first - 23028 00002618 26A2[9402] mov [es:ComDrv],al - 23029 ; 23/02/2023 - 23030 ; MSDOS 6.0 (& 5.0) - 23031 0000261C 50 push ax ;AN000; 3/3/KK - 23032 0000261D 8A04 mov al,[si] ;AN000; 3/3/KK - 23033 0000261F E83F01 call testkanj ;AN000; 3/3/KK - 23034 00002622 58 pop ax ;AN000; 3/3/KK - 23035 00002623 7518 jnz short _GOTDRIVE - 23036 ; - 23037 00002625 807C013A cmp byte [si+1],':' ; drive specified? - 23038 00002629 7512 jne short _GOTDRIVE - 23039 0000262B 8A04 mov al,[si] ; get his specified drive - 23040 ; 23/02/2023 - 23041 0000262D E85B01 call UPCONV - 23042 ;call UPCONV_MAPCALL ; convert to uppercase - 23043 00002630 2C41 sub al,'A' ; convert to 0-based - 23044 00002632 83C702 add di,2 - 23045 00002635 FEC0 inc al ; convert to 1-based number - 23046 00002637 26A2[9402] mov [es:ComDrv],al - 23047 - 23048 ; Stick the drive letter in the prompt message. Nothing special needs to be - 23049 ; done here.. - 23050 ;add al,40h - 23051 0000263B 0440 add al,'A'-1 - 23052 _GOTDRIVE: - 23053 ; 23/02/2023 - 23054 ;;mov [es:0BD9h],di ; MSDOS 3.3 COMMAND.COM offset 1734h - 23055 ;mov [es:PUTBACKSUBSTPTR],di - 23056 ;mov [es:0233h],di ; MSDOS 5.0 COMMAND.COM offset 236Eh - 23057 0000263D 26893E[2A02] mov [es:PutBackComSpec],di - 23058 ;g point to beginning of name after drive - 23059 ;;mov [es:0A21h],al ; MSDOS 3.3 COMMAND.COM offset 1739h - 23060 ;mov [es:PUTBACKDRV],al - 23061 ;mov [es:0238h],al ; MSDOS 5.0 COMMAND.COM offset 2373h - 23062 00002642 26A2[2F02] mov [es:PutBackDrv],al - 23063 - 23064 ; Copy chars until delim - 23065 - 23066 00002646 89DF mov di,bx - 23067 COPY_COMSPEC: - 23068 00002648 AC lodsb - 23069 00002649 E84203 call DELIM - 23070 0000264C 7407 jz short COPYDONE - 23071 0000264E 3C0D cmp al,13 ; 0Dh - 23072 00002650 7403 je short COPYDONE - 23073 00002652 AA stosb - 23074 00002653 EBF3 jmp short COPY_COMSPEC - 23075 COPYDONE: - 23076 00002655 30C0 xor al,al ; Null terminate the string and quit - 23077 00002657 AA stosb - 23078 ;mov byte [comspec_flag],0 - 23079 00002658 A2[E395] mov [comspec_flag],al ; 0 ; 23/02/2023 - 23080 0000265B 4F dec di - 23081 0000265C 26893E[8B02] mov [es:ComSpec_End],di - 23082 00002661 C3 retn - 23083 - 23084 DISP_ENV: - 23085 00002662 8E1E[F59B] mov ds,[RESSEG] - 23086 00002666 8E1E[3A04] mov ds,[EnvirSeg] - 23087 ; assume ds:nothing - 23088 0000266A 31F6 xor si,si - 23089 PENVLP: - 23090 0000266C 803C00 cmp byte [si],0 - 23091 0000266F 7497 jz short ADD_NAME_JZ_RET - 23092 00002671 BF[96A3] mov di,Arg_Buf - 23093 PENVLP2: - 23094 00002674 AC lodsb - 23095 00002675 AA stosb - 23096 00002676 08C0 or al,al - 23097 00002678 75FA jnz short PENVLP2 - 23098 0000267A BA[9991] mov dx,arg_buf_ptr - 23099 0000267D 1E push ds - 23100 0000267E 06 push es - 23101 0000267F 1F pop ds - 23102 ; assume ds:nothing - 23103 00002680 E8972D call Printf_Crlf - 23104 00002683 1F pop ds - 23105 00002684 EBE6 jmp short PENVLP - 23106 - 23107 ; =============== S U B R O U T I N E ======================================= - 23108 - 23109 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23110 delete_path: - 23111 00002686 BE[F192] mov si,PATH_TEXT ; "PATH=" - 23112 00002689 EB03 jmp short delete_name_in_environment - 23113 - 23114 ; =============== S U B R O U T I N E ======================================= - 23115 - 23116 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23117 delete_prompt: - 23118 0000268B BE[F692] mov si,PROMPT_TEXT ; "PROMPT=" - 23119 - 23120 ; --------------------------------------------------------------------------- - 23121 - 23122 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23123 delete_name_in_environment: + 23025 00002611 BF[4B02] mov di,ComSpec + 23026 00002614 89FB mov bx,di + 23027 + 23028 ; Generate drive letter for display + 23029 + 23030 00002616 31C0 xor ax,ax ;g assume no drive first + 23031 00002618 26A2[9402] mov [es:ComDrv],al + 23032 ; 23/02/2023 + 23033 ; MSDOS 6.0 (& 5.0) + 23034 0000261C 50 push ax ;AN000; 3/3/KK + 23035 0000261D 8A04 mov al,[si] ;AN000; 3/3/KK + 23036 0000261F E83F01 call testkanj ;AN000; 3/3/KK + 23037 00002622 58 pop ax ;AN000; 3/3/KK + 23038 00002623 7518 jnz short _GOTDRIVE + 23039 ; + 23040 00002625 807C013A cmp byte [si+1],':' ; drive specified? + 23041 00002629 7512 jne short _GOTDRIVE + 23042 0000262B 8A04 mov al,[si] ; get his specified drive + 23043 ; 23/02/2023 + 23044 0000262D E85B01 call UPCONV + 23045 ;call UPCONV_MAPCALL ; convert to uppercase + 23046 00002630 2C41 sub al,'A' ; convert to 0-based + 23047 00002632 83C702 add di,2 + 23048 00002635 FEC0 inc al ; convert to 1-based number + 23049 00002637 26A2[9402] mov [es:ComDrv],al + 23050 + 23051 ; Stick the drive letter in the prompt message. Nothing special needs to be + 23052 ; done here.. + 23053 ;add al,40h + 23054 0000263B 0440 add al,'A'-1 + 23055 _GOTDRIVE: + 23056 ; 23/02/2023 + 23057 ;;mov [es:0BD9h],di ; MSDOS 3.3 COMMAND.COM offset 1734h + 23058 ;mov [es:PUTBACKSUBSTPTR],di + 23059 ;mov [es:0233h],di ; MSDOS 5.0 COMMAND.COM offset 236Eh + 23060 0000263D 26893E[2A02] mov [es:PutBackComSpec],di + 23061 ;g point to beginning of name after drive + 23062 ;;mov [es:0A21h],al ; MSDOS 3.3 COMMAND.COM offset 1739h + 23063 ;mov [es:PUTBACKDRV],al + 23064 ;mov [es:0238h],al ; MSDOS 5.0 COMMAND.COM offset 2373h + 23065 00002642 26A2[2F02] mov [es:PutBackDrv],al + 23066 + 23067 ; Copy chars until delim + 23068 + 23069 00002646 89DF mov di,bx + 23070 COPY_COMSPEC: + 23071 00002648 AC lodsb + 23072 00002649 E84203 call DELIM + 23073 0000264C 7407 jz short COPYDONE + 23074 0000264E 3C0D cmp al,13 ; 0Dh + 23075 00002650 7403 je short COPYDONE + 23076 00002652 AA stosb + 23077 00002653 EBF3 jmp short COPY_COMSPEC + 23078 COPYDONE: + 23079 00002655 30C0 xor al,al ; Null terminate the string and quit + 23080 00002657 AA stosb + 23081 ;mov byte [comspec_flag],0 + 23082 00002658 A2[E395] mov [comspec_flag],al ; 0 ; 23/02/2023 + 23083 0000265B 4F dec di + 23084 0000265C 26893E[8B02] mov [es:ComSpec_End],di + 23085 00002661 C3 retn + 23086 + 23087 DISP_ENV: + 23088 00002662 8E1E[F59B] mov ds,[RESSEG] + 23089 00002666 8E1E[3A04] mov ds,[EnvirSeg] + 23090 ; assume ds:nothing + 23091 0000266A 31F6 xor si,si + 23092 PENVLP: + 23093 0000266C 803C00 cmp byte [si],0 + 23094 0000266F 7497 jz short ADD_NAME_JZ_RET + 23095 00002671 BF[96A3] mov di,Arg_Buf + 23096 PENVLP2: + 23097 00002674 AC lodsb + 23098 00002675 AA stosb + 23099 00002676 08C0 or al,al + 23100 00002678 75FA jnz short PENVLP2 + 23101 0000267A BA[9991] mov dx,arg_buf_ptr + 23102 0000267D 1E push ds + 23103 0000267E 06 push es + 23104 0000267F 1F pop ds + 23105 ; assume ds:nothing + 23106 00002680 E8972D call Printf_Crlf + 23107 00002683 1F pop ds + 23108 00002684 EBE6 jmp short PENVLP + 23109 + 23110 ; =============== S U B R O U T I N E ======================================= + 23111 + 23112 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23113 delete_path: + 23114 00002686 BE[F192] mov si,PATH_TEXT ; "PATH=" + 23115 00002689 EB03 jmp short delete_name_in_environment + 23116 + 23117 ; =============== S U B R O U T I N E ======================================= + 23118 + 23119 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23120 delete_prompt: + 23121 0000268B BE[F692] mov si,PROMPT_TEXT ; "PROMPT=" + 23122 + 23123 ; --------------------------------------------------------------------------- 23124 - 23125 ; Input: DS:SI points to a "=" terminated string - 23126 ; Output: carry flag is set if name not found - 23127 ; otherwise name is deleted - 23128 - 23129 0000268E 56 push si - 23130 0000268F 1E push ds - 23131 00002690 E82C00 call FIND ; ES:DI points to name - 23132 00002693 7217 jc short del1 - 23133 00002695 89FE mov si,di ; Save it - 23134 00002697 E8BF00 call SCASB2 ; Scan for the nul - 23135 0000269A 87F7 xchg si,di - 23136 ;SR; - 23137 ; If we have only one env string, then the double null is lost when the last - 23138 ;string is deleted and we have an invalid empty environment with only a - 23139 ;single null. To avoid this, we will look for the double null case and then - 23140 ;move an extra null char. - 23141 ; Bugbug: The only possible problem is that the last pathstring - 23142 ;will be followed by a triple null. Is this really a problem? - 23143 - 23144 ; MSDOS 6.0 - 23145 0000269C 26803C00 cmp byte [es:si],0 ;null char? - 23146 000026A0 7501 jnz short not_dnull ;no, we are at a double null - 23147 000026A2 4E dec si ;point at the double null - 23148 not_dnull: - 23149 ; MSDOS 3.3 (& MSDOS 6.0) - 23150 000026A3 E86901 call GETENVSIZ - 23151 000026A6 29F1 sub cx,si - 23152 000026A8 06 push es - 23153 000026A9 1F pop ds ; ES:DI points to name - 23154 ; DS:SI points to next name - 23155 000026AA F3A4 rep movsb - 23156 del1: - 23157 000026AC 1F pop ds - 23158 000026AD 5E pop si - 23159 find_retn: - 23160 000026AE C3 retn - 23161 - 23162 ; =============== S U B R O U T I N E ======================================= - 23163 - 23164 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23165 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:23E2h - 23166 find_path: - 23167 000026AF BE[F192] mov si,PATH_TEXT ; "PATH=" - 23168 000026B2 EB03 jmp short find_name_in_environment - 23169 - 23170 ; =============== S U B R O U T I N E ======================================= - 23171 - 23172 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23173 find_prompt: - 23174 000026B4 BE[F692] mov si,PROMPT_TEXT ; "PROMPT=" - 23175 - 23176 ; --------------------------------------------------------------------------- - 23177 - 23178 find_name_in_environment: - 23179 - 23180 ; Input: DS:SI points to a "=" terminated string - 23181 ; Output: ES:DI points to the arguments in the environment - 23182 ; zero is set if name not found - 23183 ; carry flag is set if name not valid format - 23184 - 23185 000026B7 E80500 call FIND ; Find the name - 23186 000026BA 72F2 jc short find_retn ; Carry means not found - 23187 000026BC E99600 jmp SCASB1 ; Scan for = sign - 23188 - 23189 ; --------------------------------------------------------------------------- - 23190 ;nop + 23125 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23126 delete_name_in_environment: + 23127 + 23128 ; Input: DS:SI points to a "=" terminated string + 23129 ; Output: carry flag is set if name not found + 23130 ; otherwise name is deleted + 23131 + 23132 0000268E 56 push si + 23133 0000268F 1E push ds + 23134 00002690 E82C00 call FIND ; ES:DI points to name + 23135 00002693 7217 jc short del1 + 23136 00002695 89FE mov si,di ; Save it + 23137 00002697 E8BF00 call SCASB2 ; Scan for the nul + 23138 0000269A 87F7 xchg si,di + 23139 ;SR; + 23140 ; If we have only one env string, then the double null is lost when the last + 23141 ;string is deleted and we have an invalid empty environment with only a + 23142 ;single null. To avoid this, we will look for the double null case and then + 23143 ;move an extra null char. + 23144 ; Bugbug: The only possible problem is that the last pathstring + 23145 ;will be followed by a triple null. Is this really a problem? + 23146 + 23147 ; MSDOS 6.0 + 23148 0000269C 26803C00 cmp byte [es:si],0 ;null char? + 23149 000026A0 7501 jnz short not_dnull ;no, we are at a double null + 23150 000026A2 4E dec si ;point at the double null + 23151 not_dnull: + 23152 ; MSDOS 3.3 (& MSDOS 6.0) + 23153 000026A3 E86901 call GETENVSIZ + 23154 000026A6 29F1 sub cx,si + 23155 000026A8 06 push es + 23156 000026A9 1F pop ds ; ES:DI points to name + 23157 ; DS:SI points to next name + 23158 000026AA F3A4 rep movsb + 23159 del1: + 23160 000026AC 1F pop ds + 23161 000026AD 5E pop si + 23162 find_retn: + 23163 000026AE C3 retn + 23164 + 23165 ; =============== S U B R O U T I N E ======================================= + 23166 + 23167 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23168 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:23E2h + 23169 find_path: + 23170 000026AF BE[F192] mov si,PATH_TEXT ; "PATH=" + 23171 000026B2 EB03 jmp short find_name_in_environment + 23172 + 23173 ; =============== S U B R O U T I N E ======================================= + 23174 + 23175 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23176 find_prompt: + 23177 000026B4 BE[F692] mov si,PROMPT_TEXT ; "PROMPT=" + 23178 + 23179 ; --------------------------------------------------------------------------- + 23180 + 23181 find_name_in_environment: + 23182 + 23183 ; Input: DS:SI points to a "=" terminated string + 23184 ; Output: ES:DI points to the arguments in the environment + 23185 ; zero is set if name not found + 23186 ; carry flag is set if name not valid format + 23187 + 23188 000026B7 E80500 call FIND ; Find the name + 23189 000026BA 72F2 jc short find_retn ; Carry means not found + 23190 000026BC E99600 jmp SCASB1 ; Scan for = sign 23191 - 23192 ; =============== S U B R O U T I N E ======================================= - 23193 - 23194 ; On return of FIND1, ES:DI points to beginning of name - 23195 - 23196 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM - 23197 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 23198 FIND: - 23199 000026BF FC cld - 23200 000026C0 E84100 call COUNT0 ; CX = Length of name - 23201 000026C3 8E06[F59B] mov es,[RESSEG] - 23202 ;assume es:RESGROUP - 23203 000026C7 268E06[3A04] mov es,[es:EnvirSeg] - 23204 ;assume es:NOTHING - 23205 000026CC 31FF xor di,di - 23206 find1: - 23207 000026CE 51 push cx - 23208 000026CF 56 push si - 23209 000026D0 57 push di - 23210 find11: - 23211 000026D1 AC lodsb - 23212 ; 23/02/2023 - 23213 ; MSDOS 6.0 (& 5.0) - 23214 000026D2 E88C00 call testkanj - 23215 000026D5 740F jz short notkanj3 - 23216 000026D7 4E dec si - 23217 000026D8 AD lodsw - 23218 000026D9 47 inc di - 23219 000026DA 47 inc di - 23220 000026DB 263B45FE cmp ax,[es:di-2] - 23221 000026DF 7511 jne short find12 - 23222 000026E1 49 dec cx - 23223 000026E2 E2ED loop find11 - 23224 000026E4 EB0C jmp short find12 - 23225 notkanj3: - 23226 000026E6 E8A200 call UPCONV ; MSDOS 5.0 (& 6.0) - 23227 ;call UPCONV_MAPCALL ; MSDOS 3.3 - 23228 000026E9 47 inc di - 23229 000026EA 263A45FF cmp al,[es:di-1] - 23230 000026EE 7502 jne short find12 - 23231 000026F0 E2DF loop find11 - 23232 find12: - 23233 000026F2 5F pop di - 23234 000026F3 5E pop si - 23235 000026F4 59 pop cx - 23236 000026F5 74B7 jz short find_retn - 23237 000026F7 51 push cx - 23238 000026F8 E85E00 call SCASB2 ; Scan for a nul - 23239 000026FB 59 pop cx - 23240 000026FC 26803D00 cmp byte [es:di],0 - 23241 00002700 75CC jnz short find1 - 23242 00002702 F9 stc ; Indicate not found - 23243 00002703 C3 retn - 23244 - 23245 ; =============== S U B R O U T I N E ======================================= - 23246 - 23247 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23248 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2437h - 23249 COUNT0: - 23250 00002704 1E push ds - 23251 00002705 07 pop es - 23252 ;assume es:nothing - 23253 00002706 89F7 mov di,si - 23254 ;COUNT1: - 23255 00002708 57 push di ; Count number of chars until "=" - 23256 00002709 E84900 call SCASB1 - 23257 ; 23/02/2023 - 23258 ; jmp short COUNTX - 23259 ;COUNT2: - 23260 ; push di ; Count number of chars until nul - 23261 ; call SCASB2 - 23262 ;COUNTX: - 23263 0000270C 59 pop cx - 23264 0000270D 29CF sub di,cx - 23265 0000270F 87F9 xchg di,cx - 23266 move_name_retn: - 23267 00002711 C3 retn - 23268 - 23269 ; =============== S U B R O U T I N E ======================================= - 23270 - 23271 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23272 move_name: - 23273 00002712 803C0D cmp byte [si],13 ; 0Dh - 23274 00002715 74FA je short move_name_retn - 23275 00002717 AC lodsb - 23276 ; 23/02/2023 - 23277 ; MSDOS 6.0 (& 5.0) - 23278 00002718 E84600 call testkanj - 23279 0000271B 7409 jz short notkanj1 - 23280 0000271D E88D00 call store_char - 23281 00002720 AC lodsb - 23282 00002721 E88900 call store_char - 23283 00002724 EBEC jmp short move_name - 23284 notkanj1: - 23285 00002726 E86200 call UPCONV - 23286 ;call UPCONV_MAPCALL ; MSDOS 3.3 - 23287 00002729 E88100 call store_char - 23288 0000272C 3C3D cmp al,'=' - 23289 0000272E 75E2 jne short move_name - 23290 getarg_retn: - 23291 00002730 C3 retn - 23292 - 23293 ; =============== S U B R O U T I N E ======================================= - 23294 - 23295 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23296 GETARG: - 23297 00002731 BE8000 mov si,80h - 23298 00002734 AC lodsb - 23299 00002735 08C0 or al,al - 23300 00002737 74F7 jz short getarg_retn - 23301 00002739 E84A02 call scanoff - 23302 0000273C 3C0D cmp al,13 ; 0Dh - 23303 sdn_retn: - 23304 0000273E C3 retn - 23305 - 23306 ; =============== S U B R O U T I N E ======================================= - 23307 - 23308 ; Point ES:DI to the final NULL string. Note that in an empty environment, - 23309 ; there is NO double NULL, merely a string that is empty. + 23192 ; --------------------------------------------------------------------------- + 23193 ;nop + 23194 + 23195 ; =============== S U B R O U T I N E ======================================= + 23196 + 23197 ; On return of FIND1, ES:DI points to beginning of name + 23198 + 23199 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM + 23200 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 23201 FIND: + 23202 000026BF FC cld + 23203 000026C0 E84100 call COUNT0 ; CX = Length of name + 23204 000026C3 8E06[F59B] mov es,[RESSEG] + 23205 ;assume es:RESGROUP + 23206 000026C7 268E06[3A04] mov es,[es:EnvirSeg] + 23207 ;assume es:NOTHING + 23208 000026CC 31FF xor di,di + 23209 find1: + 23210 000026CE 51 push cx + 23211 000026CF 56 push si + 23212 000026D0 57 push di + 23213 find11: + 23214 000026D1 AC lodsb + 23215 ; 23/02/2023 + 23216 ; MSDOS 6.0 (& 5.0) + 23217 000026D2 E88C00 call testkanj + 23218 000026D5 740F jz short notkanj3 + 23219 000026D7 4E dec si + 23220 000026D8 AD lodsw + 23221 000026D9 47 inc di + 23222 000026DA 47 inc di + 23223 000026DB 263B45FE cmp ax,[es:di-2] + 23224 000026DF 7511 jne short find12 + 23225 000026E1 49 dec cx + 23226 000026E2 E2ED loop find11 + 23227 000026E4 EB0C jmp short find12 + 23228 notkanj3: + 23229 000026E6 E8A200 call UPCONV ; MSDOS 5.0 (& 6.0) + 23230 ;call UPCONV_MAPCALL ; MSDOS 3.3 + 23231 000026E9 47 inc di + 23232 000026EA 263A45FF cmp al,[es:di-1] + 23233 000026EE 7502 jne short find12 + 23234 000026F0 E2DF loop find11 + 23235 find12: + 23236 000026F2 5F pop di + 23237 000026F3 5E pop si + 23238 000026F4 59 pop cx + 23239 000026F5 74B7 jz short find_retn + 23240 000026F7 51 push cx + 23241 000026F8 E85E00 call SCASB2 ; Scan for a nul + 23242 000026FB 59 pop cx + 23243 000026FC 26803D00 cmp byte [es:di],0 + 23244 00002700 75CC jnz short find1 + 23245 00002702 F9 stc ; Indicate not found + 23246 00002703 C3 retn + 23247 + 23248 ; =============== S U B R O U T I N E ======================================= + 23249 + 23250 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23251 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2437h + 23252 COUNT0: + 23253 00002704 1E push ds + 23254 00002705 07 pop es + 23255 ;assume es:nothing + 23256 00002706 89F7 mov di,si + 23257 ;COUNT1: + 23258 00002708 57 push di ; Count number of chars until "=" + 23259 00002709 E84900 call SCASB1 + 23260 ; 23/02/2023 + 23261 ; jmp short COUNTX + 23262 ;COUNT2: + 23263 ; push di ; Count number of chars until nul + 23264 ; call SCASB2 + 23265 ;COUNTX: + 23266 0000270C 59 pop cx + 23267 0000270D 29CF sub di,cx + 23268 0000270F 87F9 xchg di,cx + 23269 move_name_retn: + 23270 00002711 C3 retn + 23271 + 23272 ; =============== S U B R O U T I N E ======================================= + 23273 + 23274 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23275 move_name: + 23276 00002712 803C0D cmp byte [si],13 ; 0Dh + 23277 00002715 74FA je short move_name_retn + 23278 00002717 AC lodsb + 23279 ; 23/02/2023 + 23280 ; MSDOS 6.0 (& 5.0) + 23281 00002718 E84600 call testkanj + 23282 0000271B 7409 jz short notkanj1 + 23283 0000271D E88D00 call store_char + 23284 00002720 AC lodsb + 23285 00002721 E88900 call store_char + 23286 00002724 EBEC jmp short move_name + 23287 notkanj1: + 23288 00002726 E86200 call UPCONV + 23289 ;call UPCONV_MAPCALL ; MSDOS 3.3 + 23290 00002729 E88100 call store_char + 23291 0000272C 3C3D cmp al,'=' + 23292 0000272E 75E2 jne short move_name + 23293 getarg_retn: + 23294 00002730 C3 retn + 23295 + 23296 ; =============== S U B R O U T I N E ======================================= + 23297 + 23298 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23299 GETARG: + 23300 00002731 BE8000 mov si,80h + 23301 00002734 AC lodsb + 23302 00002735 08C0 or al,al + 23303 00002737 74F7 jz short getarg_retn + 23304 00002739 E84A02 call scanoff + 23305 0000273C 3C0D cmp al,13 ; 0Dh + 23306 sdn_retn: + 23307 0000273E C3 retn + 23308 + 23309 ; =============== S U B R O U T I N E ======================================= 23310 - 23311 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23312 scan_double_null: - 23313 0000273F 8E06[F59B] mov es,[RESSEG] - 23314 00002743 268E06[3A04] mov es,[es:EnvirSeg] - 23315 00002748 31FF xor di,di - 23316 - 23317 ; Top cycle-point. If the string here is empty, then we are done - 23318 - 23319 sdn1: - 23320 0000274A 26803D00 cmp byte [es:di],0 ; nul string? - 23321 0000274E 74EE jz short sdn_retn ; yep, all done - 23322 00002750 E80600 call SCASB2 - 23323 00002753 EBF5 jmp short sdn1 - 23324 - 23325 ; =============== S U B R O U T I N E ======================================= - 23326 - 23327 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23328 SCASB1: - 23329 00002755 B03D mov al,'=' ; Scan for an = - 23330 00002757 EB02 jmp short SCASBX - 23331 - 23332 ; =============== S U B R O U T I N E ======================================= - 23333 - 23334 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23335 SCASB2: - 23336 00002759 30C0 xor al,al ; Scan for a nul - 23337 - 23338 ; --------------------------------------------------------------------------- - 23339 - 23340 ; 23/02/2023 - 23341 SCASBX: - 23342 0000275B B90001 mov cx,256 - 23343 0000275E F2AE repne scasb - 23344 00002760 C3 retn - 23345 - 23346 ; =============== S U B R O U T I N E ======================================= - 23347 - 23348 ; MSDOS 6.0 - 23349 - 23350 ;Bugbug: This is Kanji stuff - put it in conditionals - 23351 - 23352 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM - 23353 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:249Ah + 23311 ; Point ES:DI to the final NULL string. Note that in an empty environment, + 23312 ; there is NO double NULL, merely a string that is empty. + 23313 + 23314 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23315 scan_double_null: + 23316 0000273F 8E06[F59B] mov es,[RESSEG] + 23317 00002743 268E06[3A04] mov es,[es:EnvirSeg] + 23318 00002748 31FF xor di,di + 23319 + 23320 ; Top cycle-point. If the string here is empty, then we are done + 23321 + 23322 sdn1: + 23323 0000274A 26803D00 cmp byte [es:di],0 ; nul string? + 23324 0000274E 74EE jz short sdn_retn ; yep, all done + 23325 00002750 E80600 call SCASB2 + 23326 00002753 EBF5 jmp short sdn1 + 23327 + 23328 ; =============== S U B R O U T I N E ======================================= + 23329 + 23330 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23331 SCASB1: + 23332 00002755 B03D mov al,'=' ; Scan for an = + 23333 00002757 EB02 jmp short SCASBX + 23334 + 23335 ; =============== S U B R O U T I N E ======================================= + 23336 + 23337 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23338 SCASB2: + 23339 00002759 30C0 xor al,al ; Scan for a nul + 23340 + 23341 ; --------------------------------------------------------------------------- + 23342 + 23343 ; 23/02/2023 + 23344 SCASBX: + 23345 0000275B B90001 mov cx,256 + 23346 0000275E F2AE repne scasb + 23347 00002760 C3 retn + 23348 + 23349 ; =============== S U B R O U T I N E ======================================= + 23350 + 23351 ; MSDOS 6.0 + 23352 + 23353 ;Bugbug: This is Kanji stuff - put it in conditionals 23354 - 23355 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM - 23356 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2872h - 23357 testkanj: - 23358 00002761 1E push ds ;AN000; 3/3/KK - 23359 00002762 56 push si ;AN000; 3/3/KK - 23360 00002763 50 push ax ;AN000; 3/3/KK - 23361 00002764 2E8E1E[F59B] mov ds,[cs:RESSEG] ;AN000; Get resident segment - 23362 00002769 C536[BA02] lds si,[Dbcs_Vector_Addr] ;AN000; get DBCS vector - 23363 ktlop: ;AN000; 3/3/KK - 23364 0000276D 833C00 cmp word [si],0 ;AN000; end of Table 3/3/KK - 23365 00002770 740E je short notlead ;AN000; 3/3/KK - 23366 00002772 58 pop ax ;AN000; 3/3/KK - 23367 00002773 50 push ax ;AN000; 3/3/KK - 23368 00002774 3A04 cmp al,[si] ;AN000; 3/3/KK - 23369 00002776 7208 jb short notlead ;AN000; 3/3/KK - 23370 00002778 46 inc si ;AN000; 3/3/KK - 23371 00002779 3A04 cmp al,[si] ;AN000; 3/3/KK - 23372 0000277B 7607 jbe short islead ;AN000; 3/3/KK - 23373 0000277D 46 inc si ;AN000; 3/3/KK - 23374 0000277E EBED jmp short ktlop ;AN000; try another range ; 3/3/KK - 23375 notlead: ;AN000; 3/3/KK - 23376 00002780 31C0 xor ax,ax ;AN000; set zero 3/3/KK - 23377 00002782 EB03 jmp short ktret ;AN000; 3/3/KK - 23378 islead: ;AN000; 3/3/KK - 23379 00002784 31C0 xor ax,ax ;AN000; reset zero 3/3/KK - 23380 00002786 40 inc ax ;AN000; 3/3/KK - 23381 ktret: ;AN000; 3/3/KK - 23382 00002787 58 pop ax ;AN000; 3/3/KK - 23383 00002788 5E pop si ;AN000; 3/3/KK - 23384 00002789 1F pop ds ;AN000; 3/3/KK - 23385 0000278A C3 retn ;AN000; 3/3/KK - 23386 - 23387 ; =============== S U B R O U T I N E ======================================= - 23388 - 23389 ; MSDOS 6.0 - 23390 - 23391 ; **************************************************************** - 23392 ; * - 23393 ; * ROUTINE: UPCONV (ADDED BY EMG 4.00) - 23394 ; * - 23395 ; * FUNCTION: This routine returns the upper case equivalent of - 23396 ; * the character in AL from the file upper case table - 23397 ; * in DOS if character if above ascii 128, else - 23398 ; * subtracts 20H if between "a" and "z". - 23399 ; * - 23400 ; * INPUT: AL char to be upper cased - 23401 ; * FUCASE_ADDR set to the file upper case table + 23355 ; 23/02/2023 - Retro DOS v4.0 COMMAND.COM + 23356 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:249Ah + 23357 + 23358 ; 26/07/2024 - Retro DOS v5.0 COMMAND.COM + 23359 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2872h + 23360 testkanj: + 23361 00002761 1E push ds ;AN000; 3/3/KK + 23362 00002762 56 push si ;AN000; 3/3/KK + 23363 00002763 50 push ax ;AN000; 3/3/KK + 23364 00002764 2E8E1E[F59B] mov ds,[cs:RESSEG] ;AN000; Get resident segment + 23365 00002769 C536[BA02] lds si,[Dbcs_Vector_Addr] ;AN000; get DBCS vector + 23366 ktlop: ;AN000; 3/3/KK + 23367 0000276D 833C00 cmp word [si],0 ;AN000; end of Table 3/3/KK + 23368 00002770 740E je short notlead ;AN000; 3/3/KK + 23369 00002772 58 pop ax ;AN000; 3/3/KK + 23370 00002773 50 push ax ;AN000; 3/3/KK + 23371 00002774 3A04 cmp al,[si] ;AN000; 3/3/KK + 23372 00002776 7208 jb short notlead ;AN000; 3/3/KK + 23373 00002778 46 inc si ;AN000; 3/3/KK + 23374 00002779 3A04 cmp al,[si] ;AN000; 3/3/KK + 23375 0000277B 7607 jbe short islead ;AN000; 3/3/KK + 23376 0000277D 46 inc si ;AN000; 3/3/KK + 23377 0000277E EBED jmp short ktlop ;AN000; try another range ; 3/3/KK + 23378 notlead: ;AN000; 3/3/KK + 23379 00002780 31C0 xor ax,ax ;AN000; set zero 3/3/KK + 23380 00002782 EB03 jmp short ktret ;AN000; 3/3/KK + 23381 islead: ;AN000; 3/3/KK + 23382 00002784 31C0 xor ax,ax ;AN000; reset zero 3/3/KK + 23383 00002786 40 inc ax ;AN000; 3/3/KK + 23384 ktret: ;AN000; 3/3/KK + 23385 00002787 58 pop ax ;AN000; 3/3/KK + 23386 00002788 5E pop si ;AN000; 3/3/KK + 23387 00002789 1F pop ds ;AN000; 3/3/KK + 23388 0000278A C3 retn ;AN000; 3/3/KK + 23389 + 23390 ; =============== S U B R O U T I N E ======================================= + 23391 + 23392 ; MSDOS 6.0 + 23393 + 23394 ; **************************************************************** + 23395 ; * + 23396 ; * ROUTINE: UPCONV (ADDED BY EMG 4.00) + 23397 ; * + 23398 ; * FUNCTION: This routine returns the upper case equivalent of + 23399 ; * the character in AL from the file upper case table + 23400 ; * in DOS if character if above ascii 128, else + 23401 ; * subtracts 20H if between "a" and "z". 23402 ; * - 23403 ; * OUTPUT: AL upper cased character - 23404 ; * - 23405 ; **************************************************************** - 23406 - 23407 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 23408 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:24C4h + 23403 ; * INPUT: AL char to be upper cased + 23404 ; * FUCASE_ADDR set to the file upper case table + 23405 ; * + 23406 ; * OUTPUT: AL upper cased character + 23407 ; * + 23408 ; **************************************************************** 23409 - 23410 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM - 23411 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2A6Eh + 23410 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 23411 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:24C4h 23412 - 23413 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 23414 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:289Ch - 23415 UPCONV: - 23416 0000278B 3C80 cmp al,80h ;AN000; see if char is > ascii 128 - 23417 0000278D 7213 jb short oth_fucase ;AN000; no - upper case math - 23418 0000278F 2C80 sub al,80h ;AN000; only upper 128 chars in table - 23419 00002791 1E push ds ;AN000; - 23420 00002792 53 push bx ;AN000; - 23421 00002793 8E1E[F59B] mov ds,[RESSEG] ;AN000; get resident data segment - 23422 ;lds bx,dword ptr FUCase_Addr+1 - 23423 00002797 C51E[B602] lds bx,[FUCase_Addr+1] ;AN000; get table address - 23424 0000279B 83C302 add bx,2 ;AN000; skip over first word - 23425 ;xlat ds:byte ptr [bx] ;AN000; convert to upper case - 23426 0000279E D7 xlat - 23427 0000279F 5B pop bx ;AN000; - 23428 000027A0 1F pop ds ;AN000; - 23429 ;jmp short upconv_end ;AN000; we finished - exit - 23430 ; 10/06/2023 - 23431 upconv_end: - 23432 ; 24/02/2023 - 23433 000027A1 C3 retn - 23434 oth_fucase: ;AN000; - 23435 000027A2 3C61 cmp al,'a' ; small_a ;AC000; if between "a" and "z", - 23436 000027A4 72FB jb short upconv_end ;AC000; subtract 20h to get - 23437 000027A6 3C7A cmp al,'z' ; small_z ;AC000; upper case equivalent. - 23438 000027A8 77F7 ja short upconv_end ;AC000; - 23439 000027AA 2C20 sub al,20h ;AC000; Change lower-case to upper - 23440 ;upconv_end: ; 10/06/2023 ;AN000; - 23441 000027AC C3 retn - 23442 - 23443 ; --------------------------------------------------------------------------- - 23444 - 23445 ; MSDOS 3.3 - 23446 - 23447 ; 24/02/2023 - 23448 ;UPCONV_MAPCALL: - 23449 ; ; If between "a" and "z" - 23450 ;cmp al,[small_a] - 23451 ;jb short UPCONV_END - 23452 ;cmp al,[small_z] - 23453 ;ja short UPCONV_END - 23454 ;sub al,20h ; Change lower-case to upper - 23455 ;UPCONV_END: - 23456 ;call far [cs:MAP_CALL] ; (far) call to char mapping routine - 23457 ; ; for (current) country - 23458 ;retn - 23459 - 23460 ; =============== S U B R O U T I N E ======================================= - 23461 - 23462 ; STORE A CHAR IN environment, GROWING IT IF NECESSARY - 23463 - 23464 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 23465 store_char: - 23466 000027AD 51 push cx - 23467 000027AE 53 push bx - 23468 - 23469 ; 24/02/2023 - 23470 ;;16/10/2018 - 23471 ; MSDOS 6.0 - 23472 000027AF 06 push es ;AN056;* - 23473 000027B0 1E push ds ;AN056; Save local DS - 23474 000027B1 8E1E[F59B] mov ds,[RESSEG] ;AN056; Get resident segment - 23475 000027B5 8E06[3A04] mov es,[EnvirSeg] ;AN056; Get environment segment - 23476 000027B9 1F pop ds ;AN056; Get local segment back - 23477 - 23478 ; MSDOS 3.3 (& MSDOS 6.0) - 23479 000027BA E85200 call GETENVSIZ - 23480 000027BD 89CB mov bx,cx ; Save room for double nul - 23481 000027BF 83EB02 sub bx,2 - 23482 000027C2 39DF cmp di,bx - 23483 000027C4 723F jb short store1 - 23484 000027C6 50 push ax - 23485 000027C7 51 push cx - 23486 000027C8 53 push bx ; Save Size of environment - 23487 000027C9 E847E0 call FREE_TPA - 23488 000027CC 5B pop bx - 23489 000027CD 83C302 add bx,2 ; Recover true environment size - 23490 - 23491 000027D0 81FB0080 cmp bx,8000h ; Don't let environment grow > 32K - 23492 000027D4 7203 jb short envsiz_ok - 23493 bad_env_size: ;AN056; - 23494 000027D6 F9 stc - 23495 000027D7 EB16 jmp short envnoset - 23496 ;nop - 23497 envsiz_ok: - 23498 000027D9 B104 mov cl,4 - 23499 000027DB D3EB shr bx,cl ; Convert back to paragraphs - 23500 000027DD 43 inc bx - 23501 ; 24/02/2023 - 23502 ; MSDOS 6.0 - 23503 000027DE 8CC1 mov cx,es ;AN056; Get environment segment - 23504 000027E0 01D9 add cx,bx ;AN056; Add in size of environment - 23505 000027E2 83C120 add cx,20h ;AN056; Add in some TPA - 23506 000027E5 8CC8 mov ax,cs ;AN056; Get the transient segment - 23507 000027E7 39C1 cmp cx,ax ;AN056; Are we hitting the transient? - 23508 000027E9 73EB jnb short bad_env_size - 23509 ;AN056; Yes - don't do it!!! - 23510 ; MSDOS 3.3 (& MSDOS 6.0) - 23511 000027EB B44A mov ah,4Ah - 23512 ;mov ah,SETBLOCK ; 4Ah - 23513 000027ED CD21 int 21h ; DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK) - 23514 ; ES = segment address of block to change - 23515 ; BX = new size in paragraphs - 23516 envnoset: - 23517 000027EF 9C pushf - 23518 000027F0 06 push es - 23519 000027F1 8E06[F59B] mov es,[RESSEG] - 23520 000027F5 E82CE0 call ALLOC_TPA - 23521 000027F8 07 pop es - 23522 000027F9 9D popf - 23523 000027FA 59 pop cx - 23524 000027FB 58 pop ax - 23525 ; 10/06/2023 - 23526 000027FC 7307 jnc short store1 - 23527 ; 24/02/2023 - 23528 000027FE 07 pop es ; MSDOS 6.0 ;AN056;* - 23529 ;jnc short store1 - 23530 000027FF BA[EE8F] mov dx,ENVERR_PTR - 23531 00002802 E92105 jmp cerror - 23532 store1: - 23533 00002805 AA stosb - 23534 00002806 26C7050000 mov word [es:di],0 ; NULL IS AT END - 23535 ; 24/02/2023 - 23536 0000280B 07 pop es ; MSDOS 6.0 ;AN056;* - 23537 0000280C 5B pop bx - 23538 0000280D 59 pop cx - 23539 0000280E C3 retn - 23540 - 23541 ; =============== S U B R O U T I N E ======================================= - 23542 - 23543 ; 24/02/2023 - 23544 GETENVSIZ: + 23413 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM + 23414 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2A6Eh + 23415 + 23416 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 23417 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:289Ch + 23418 UPCONV: + 23419 0000278B 3C80 cmp al,80h ;AN000; see if char is > ascii 128 + 23420 0000278D 7213 jb short oth_fucase ;AN000; no - upper case math + 23421 0000278F 2C80 sub al,80h ;AN000; only upper 128 chars in table + 23422 00002791 1E push ds ;AN000; + 23423 00002792 53 push bx ;AN000; + 23424 00002793 8E1E[F59B] mov ds,[RESSEG] ;AN000; get resident data segment + 23425 ;lds bx,dword ptr FUCase_Addr+1 + 23426 00002797 C51E[B602] lds bx,[FUCase_Addr+1] ;AN000; get table address + 23427 0000279B 83C302 add bx,2 ;AN000; skip over first word + 23428 ;xlat ds:byte ptr [bx] ;AN000; convert to upper case + 23429 0000279E D7 xlat + 23430 0000279F 5B pop bx ;AN000; + 23431 000027A0 1F pop ds ;AN000; + 23432 ;jmp short upconv_end ;AN000; we finished - exit + 23433 ; 10/06/2023 + 23434 upconv_end: + 23435 ; 24/02/2023 + 23436 000027A1 C3 retn + 23437 oth_fucase: ;AN000; + 23438 000027A2 3C61 cmp al,'a' ; small_a ;AC000; if between "a" and "z", + 23439 000027A4 72FB jb short upconv_end ;AC000; subtract 20h to get + 23440 000027A6 3C7A cmp al,'z' ; small_z ;AC000; upper case equivalent. + 23441 000027A8 77F7 ja short upconv_end ;AC000; + 23442 000027AA 2C20 sub al,20h ;AC000; Change lower-case to upper + 23443 ;upconv_end: ; 10/06/2023 ;AN000; + 23444 000027AC C3 retn + 23445 + 23446 ; --------------------------------------------------------------------------- + 23447 + 23448 ; MSDOS 3.3 + 23449 + 23450 ; 24/02/2023 + 23451 ;UPCONV_MAPCALL: + 23452 ; ; If between "a" and "z" + 23453 ;cmp al,[small_a] + 23454 ;jb short UPCONV_END + 23455 ;cmp al,[small_z] + 23456 ;ja short UPCONV_END + 23457 ;sub al,20h ; Change lower-case to upper + 23458 ;UPCONV_END: + 23459 ;call far [cs:MAP_CALL] ; (far) call to char mapping routine + 23460 ; ; for (current) country + 23461 ;retn + 23462 + 23463 ; =============== S U B R O U T I N E ======================================= + 23464 + 23465 ; STORE A CHAR IN environment, GROWING IT IF NECESSARY + 23466 + 23467 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 23468 store_char: + 23469 000027AD 51 push cx + 23470 000027AE 53 push bx + 23471 + 23472 ; 24/02/2023 + 23473 ;;16/10/2018 + 23474 ; MSDOS 6.0 + 23475 000027AF 06 push es ;AN056;* + 23476 000027B0 1E push ds ;AN056; Save local DS + 23477 000027B1 8E1E[F59B] mov ds,[RESSEG] ;AN056; Get resident segment + 23478 000027B5 8E06[3A04] mov es,[EnvirSeg] ;AN056; Get environment segment + 23479 000027B9 1F pop ds ;AN056; Get local segment back + 23480 + 23481 ; MSDOS 3.3 (& MSDOS 6.0) + 23482 000027BA E85200 call GETENVSIZ + 23483 000027BD 89CB mov bx,cx ; Save room for double nul + 23484 000027BF 83EB02 sub bx,2 + 23485 000027C2 39DF cmp di,bx + 23486 000027C4 723F jb short store1 + 23487 000027C6 50 push ax + 23488 000027C7 51 push cx + 23489 000027C8 53 push bx ; Save Size of environment + 23490 000027C9 E847E0 call FREE_TPA + 23491 000027CC 5B pop bx + 23492 000027CD 83C302 add bx,2 ; Recover true environment size + 23493 + 23494 000027D0 81FB0080 cmp bx,8000h ; Don't let environment grow > 32K + 23495 000027D4 7203 jb short envsiz_ok + 23496 bad_env_size: ;AN056; + 23497 000027D6 F9 stc + 23498 000027D7 EB16 jmp short envnoset + 23499 ;nop + 23500 envsiz_ok: + 23501 000027D9 B104 mov cl,4 + 23502 000027DB D3EB shr bx,cl ; Convert back to paragraphs + 23503 000027DD 43 inc bx + 23504 ; 24/02/2023 + 23505 ; MSDOS 6.0 + 23506 000027DE 8CC1 mov cx,es ;AN056; Get environment segment + 23507 000027E0 01D9 add cx,bx ;AN056; Add in size of environment + 23508 000027E2 83C120 add cx,20h ;AN056; Add in some TPA + 23509 000027E5 8CC8 mov ax,cs ;AN056; Get the transient segment + 23510 000027E7 39C1 cmp cx,ax ;AN056; Are we hitting the transient? + 23511 000027E9 73EB jnb short bad_env_size + 23512 ;AN056; Yes - don't do it!!! + 23513 ; MSDOS 3.3 (& MSDOS 6.0) + 23514 000027EB B44A mov ah,4Ah + 23515 ;mov ah,SETBLOCK ; 4Ah + 23516 000027ED CD21 int 21h ; DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK) + 23517 ; ES = segment address of block to change + 23518 ; BX = new size in paragraphs + 23519 envnoset: + 23520 000027EF 9C pushf + 23521 000027F0 06 push es + 23522 000027F1 8E06[F59B] mov es,[RESSEG] + 23523 000027F5 E82CE0 call ALLOC_TPA + 23524 000027F8 07 pop es + 23525 000027F9 9D popf + 23526 000027FA 59 pop cx + 23527 000027FB 58 pop ax + 23528 ; 10/06/2023 + 23529 000027FC 7307 jnc short store1 + 23530 ; 24/02/2023 + 23531 000027FE 07 pop es ; MSDOS 6.0 ;AN056;* + 23532 ;jnc short store1 + 23533 000027FF BA[EE8F] mov dx,ENVERR_PTR + 23534 00002802 E92105 jmp cerror + 23535 store1: + 23536 00002805 AA stosb + 23537 00002806 26C7050000 mov word [es:di],0 ; NULL IS AT END + 23538 ; 24/02/2023 + 23539 0000280B 07 pop es ; MSDOS 6.0 ;AN056;* + 23540 0000280C 5B pop bx + 23541 0000280D 59 pop cx + 23542 0000280E C3 retn + 23543 + 23544 ; =============== S U B R O U T I N E ======================================= 23545 - 23546 ;Get size of environment in bytes, rounded up to paragraph boundry - 23547 ;ES has environment segment - 23548 ;Size returned in CX, all other registers preserved - 23549 - 23550 0000280F 06 push es - 23551 00002810 50 push ax - 23552 00002811 8CC0 mov ax,es - 23553 00002813 48 dec ax ;Point at arena - 23554 00002814 8EC0 mov es,ax - 23555 ;mov ax,[es:3] - 23556 00002816 26A10300 mov ax,[es:ARENA.size] - 23557 0000281A B104 mov cl,4 - 23558 0000281C D3E0 shl ax,cl ;Convert to bytes - 23559 0000281E 89C1 mov cx,ax - 23560 00002820 58 pop ax - 23561 00002821 07 pop es - 23562 getenvsiz_retn: - 23563 00002822 C3 retn - 23564 - 23565 ; =============== S U B R O U T I N E ======================================= - 23566 - 23567 ; 24/02/2023 - 23568 RestUDir1: - 23569 00002823 1E push ds - 23570 00002824 8E1E[F59B] mov ds,[RESSEG] - 23571 00002828 803E[A102]00 cmp byte [RestDir],0 - 23572 0000282D 1F pop ds - 23573 0000282E 74F2 jz short getenvsiz_retn - 23574 - 23575 ; =============== S U B R O U T I N E ======================================= - 23576 - 23577 ; 24/02/2023 - 23578 RestUDir: - 23579 00002830 BA[D79A] mov dx,USERDIR1 - 23580 00002833 B43B mov ah,3Bh - 23581 ;mov ah,CHDir ; 3Bh - 23582 00002835 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 23583 ; DS:DX -> ASCIZ directory name (may include drive) - 23584 00002837 30C0 xor al,al - 23585 ;call SETREST - 23586 ;retn - 23587 ; 24/02/2023 - 23588 00002839 E9DA08 jmp SETREST - 23589 - 23590 ;============================================================================ - 23591 ; TENV2.ASM, MSDOS 6.0, 1991 - 23592 ;============================================================================ - 23593 ; 07/10/2018 - Retro DOS v3.0 - 23594 - 23595 ; TITLE Part6 COMMAND Transient routines. - 23596 - 23597 ; Environment utilities and misc. routines - 23598 - 23599 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 18C2h - 23600 - 23601 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 23602 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2577h + 23546 ; 24/02/2023 + 23547 GETENVSIZ: + 23548 + 23549 ;Get size of environment in bytes, rounded up to paragraph boundry + 23550 ;ES has environment segment + 23551 ;Size returned in CX, all other registers preserved + 23552 + 23553 0000280F 06 push es + 23554 00002810 50 push ax + 23555 00002811 8CC0 mov ax,es + 23556 00002813 48 dec ax ;Point at arena + 23557 00002814 8EC0 mov es,ax + 23558 ;mov ax,[es:3] + 23559 00002816 26A10300 mov ax,[es:ARENA.size] + 23560 0000281A B104 mov cl,4 + 23561 0000281C D3E0 shl ax,cl ;Convert to bytes + 23562 0000281E 89C1 mov cx,ax + 23563 00002820 58 pop ax + 23564 00002821 07 pop es + 23565 getenvsiz_retn: + 23566 00002822 C3 retn + 23567 + 23568 ; =============== S U B R O U T I N E ======================================= + 23569 + 23570 ; 24/02/2023 + 23571 RestUDir1: + 23572 00002823 1E push ds + 23573 00002824 8E1E[F59B] mov ds,[RESSEG] + 23574 00002828 803E[A102]00 cmp byte [RestDir],0 + 23575 0000282D 1F pop ds + 23576 0000282E 74F2 jz short getenvsiz_retn + 23577 + 23578 ; =============== S U B R O U T I N E ======================================= + 23579 + 23580 ; 24/02/2023 + 23581 RestUDir: + 23582 00002830 BA[D79A] mov dx,USERDIR1 + 23583 00002833 B43B mov ah,3Bh + 23584 ;mov ah,CHDir ; 3Bh + 23585 00002835 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 23586 ; DS:DX -> ASCIZ directory name (may include drive) + 23587 00002837 30C0 xor al,al + 23588 ;call SETREST + 23589 ;retn + 23590 ; 24/02/2023 + 23591 00002839 E9DA08 jmp SETREST + 23592 + 23593 ;============================================================================ + 23594 ; TENV2.ASM, MSDOS 6.0, 1991 + 23595 ;============================================================================ + 23596 ; 07/10/2018 - Retro DOS v3.0 + 23597 + 23598 ; TITLE Part6 COMMAND Transient routines. + 23599 + 23600 ; Environment utilities and misc. routines + 23601 + 23602 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 18C2h 23603 - 23604 ; --------------------------------------------------------------------------- - 23605 - 23606 ; **************************************************************** - 23607 ; * - 23608 ; * ROUTINE: $CHDIR - 23609 ; * - 23610 ; * FUNCTION: Entry point for CHDIR command. Parse the command - 23611 ; * line. If path is found, CHDIR to path. If a drive - 23612 ; * letter is found, get and display the current dir - 23613 ; * of the specified drive. If nothing is found, get - 23614 ; * and display the current dir of the default drive. - 23615 ; * - 23616 ; * INPUT: command line at offset 81H - 23617 ; * - 23618 ; * OUTPUT: none - 23619 ; * - 23620 ; **************************************************************** - 23621 - 23622 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 23623 - 23624 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM - 23625 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2B21h + 23604 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 23605 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2577h + 23606 + 23607 ; --------------------------------------------------------------------------- + 23608 + 23609 ; **************************************************************** + 23610 ; * + 23611 ; * ROUTINE: $CHDIR + 23612 ; * + 23613 ; * FUNCTION: Entry point for CHDIR command. Parse the command + 23614 ; * line. If path is found, CHDIR to path. If a drive + 23615 ; * letter is found, get and display the current dir + 23616 ; * of the specified drive. If nothing is found, get + 23617 ; * and display the current dir of the default drive. + 23618 ; * + 23619 ; * INPUT: command line at offset 81H + 23620 ; * + 23621 ; * OUTPUT: none + 23622 ; * + 23623 ; **************************************************************** + 23624 + 23625 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) 23626 - 23627 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 23628 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:294Fh + 23627 ; 10/06/2023 - Retro DOS v4.2 COMMAND.COM + 23628 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2B21h 23629 - 23630 _$CHDIR: - 23631 ; MSDOS 6.0 - 23632 0000283C BE8100 mov si,81h - 23633 0000283F BF[9196] mov di,PARSE_CHDIR - 23634 ;AN000; Get address of PARSE_CHDIR - 23635 00002842 31C9 xor cx,cx ;AN000; clear cx,dx - 23636 00002844 31D2 xor dx,dx ;AN000; - 23637 00002846 E812FD call Parse_With_Msg ;AC018; call parser - 23638 - 23639 ;cmp ax,-1 - 23640 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? - 23641 ;je short bwdj ; No args - 23642 ;;cmp ax,0 - 23643 ;;cmp ax,RESULT_NO_ERROR - 23644 ; ;AC000; did we have an error? - 23645 ;or ax,ax ; ax = 0 ? - 23646 ;jnz short ChDirErr ;AC018; yes - exit - 23647 - 23648 ; 10/06/2023 - 23649 00002849 40 inc ax ; cmp ax,-1 - 23650 0000284A 7414 jz short bwdj ; 0FFFFh -> 0 - 23651 0000284C 48 dec ax ; cmp ax,0 - 23652 0000284D 756F jnz short ChDirErr ; 1 -> 0 - 23653 ; ax = 0 - 23654 - 23655 ;cmp byte [PARSE1_TYPE],6 - 23656 0000284F 803E[EBA5]06 cmp byte [PARSE1_TYPE],result_drive - 23657 ;AC000; was a drive entered? - 23658 00002854 7511 jne short REALCD ; no - 23659 - 23660 ; D: was found. See if there is anything more. - 23661 - 23662 00002856 BF[9196] mov di,PARSE_CHDIR - 23663 ;AC000; get address of parse_chdir - 23664 00002859 31D2 xor dx,dx ;AC000; - 23665 0000285B E8E7FC call parse_check_eol ;AC000; call parser - 23666 0000285E 755E jnz short ChDirErr ;AC000; - 23667 bwdj: - 23668 00002860 E88AF9 call build_dir_for_chdir - 23669 ; Drive only specified - 23670 00002863 E81301 call CRLF2 - 23671 chdir_retn: - 23672 00002866 C3 retn - 23673 - 23674 ; 24/02/2023 - 23675 ; MSDOS 3.3 - 23676 ;mov ax,[COMSW] - 23677 ;or ax,[ALLSWITCH] - 23678 ;mov dx,BADPARMPTR - 23679 ;jnz short CHDIR_ERR - 23680 ;mov si,81h - 23681 ;call SCANOFF - 23682 ;cmp al,0Dh ; are we at end of line? - 23683 ;je short BWDJ ; No args - 23684 ;inc si - 23685 ;lodsb - 23686 ;cmp al,':' - 23687 ;jne short REALCD - 23688 ;push si - 23689 ;call SCANOFF - 23690 ;pop si - 23691 ;cmp al,0Dh ; was a drive entered? - 23692 ;jne short REALCD ; no - 23693 ;BWDJ: - 23694 ;call BUILD_DIR_FOR_CHDIR ; Drive only specified - 23695 ;call CRLF2 - 23696 ;CHDIR_RETN: - 23697 ;retn - 23698 - 23699 ; 24/02/2023 - 23700 ; MSDOS 6.0 - 23701 REALCD: - 23702 00002867 56 push si ;AN000; save position in line - 23703 00002868 C536[EFA5] lds si,[PARSE1_ADDR] - 23704 ;AN000; get address of filespec - 23705 0000286C E86908 call Move_To_SrcBuf ;AN000; move to srcbuf - 23706 0000286F 5E pop si ;AN000; restore position in line - 23707 00002870 BF[9196] mov di,PARSE_CHDIR ;AC000; get address of parse_chdir - 23708 00002873 31D2 xor dx,dx ;AC000; - 23709 00002875 E8CDFC call parse_check_eol ;AC000; call parser - 23710 00002878 7544 jnz short ChDirErr ;AC000; - 23711 - 23712 0000287A E8A206 call SETPATH - 23713 0000287D F606[BD9D]02 test byte [DestInfo],2 - 23714 00002882 7519 jnz short BadChDir - 23715 - 23716 ; 26/04/2023 - 23717 00002884 B43B mov ah,3Bh - 23718 ;mov ah,CHDir - 23719 ;int 21h - 23720 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 23721 00002886 E831DD call int_21h_indirect - 23722 00002889 73DB jnc short chdir_retn - 23723 - 23724 0000288B E8BDF7 call get_ext_error_number - 23725 ;AN022; get the extended error - 23726 0000288E 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; 3 - 23727 ;AN022; see if path not found - 23728 00002891 740A je short BadChDir ;AN022; yes - issue old message - 23729 ;SR; - 23730 ; We want to issue "Invalid Directory" message even if the path is valid - 23731 ;but is not a directory. The extended error returns "Access denied" which - 23732 ;is kind of confusing. Issue the old message if access denied error is - 23733 ;returned - 23734 - 23735 00002893 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 - 23736 00002896 7405 je short BadChDir - 23737 - 23738 00002898 E8A200 call set_ext_error_subst ;AN022; - 23739 0000289B EB21 jmp short ChDirErr ;AN022; - 23740 - 23741 BadChDir: - 23742 0000289D BA[3791] mov dx,badcd_ptr - 23743 ;ChDirErr: - 23744 ; call std_eprintf - 23745 ;mkdir_retn: - 23746 ;retn - 23747 ; 24/02/2023 - 23748 000028A0 EB1C jmp short ChDirErr ;AN022; - 23749 + 23630 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 23631 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:294Fh + 23632 + 23633 _$CHDIR: + 23634 ; MSDOS 6.0 + 23635 0000283C BE8100 mov si,81h + 23636 0000283F BF[9196] mov di,PARSE_CHDIR + 23637 ;AN000; Get address of PARSE_CHDIR + 23638 00002842 31C9 xor cx,cx ;AN000; clear cx,dx + 23639 00002844 31D2 xor dx,dx ;AN000; + 23640 00002846 E812FD call Parse_With_Msg ;AC018; call parser + 23641 + 23642 ;cmp ax,-1 + 23643 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? + 23644 ;je short bwdj ; No args + 23645 ;;cmp ax,0 + 23646 ;;cmp ax,RESULT_NO_ERROR + 23647 ; ;AC000; did we have an error? + 23648 ;or ax,ax ; ax = 0 ? + 23649 ;jnz short ChDirErr ;AC018; yes - exit + 23650 + 23651 ; 10/06/2023 + 23652 00002849 40 inc ax ; cmp ax,-1 + 23653 0000284A 7414 jz short bwdj ; 0FFFFh -> 0 + 23654 0000284C 48 dec ax ; cmp ax,0 + 23655 0000284D 756F jnz short ChDirErr ; 1 -> 0 + 23656 ; ax = 0 + 23657 + 23658 ;cmp byte [PARSE1_TYPE],6 + 23659 0000284F 803E[EBA5]06 cmp byte [PARSE1_TYPE],result_drive + 23660 ;AC000; was a drive entered? + 23661 00002854 7511 jne short REALCD ; no + 23662 + 23663 ; D: was found. See if there is anything more. + 23664 + 23665 00002856 BF[9196] mov di,PARSE_CHDIR + 23666 ;AC000; get address of parse_chdir + 23667 00002859 31D2 xor dx,dx ;AC000; + 23668 0000285B E8E7FC call parse_check_eol ;AC000; call parser + 23669 0000285E 755E jnz short ChDirErr ;AC000; + 23670 bwdj: + 23671 00002860 E88AF9 call build_dir_for_chdir + 23672 ; Drive only specified + 23673 00002863 E81301 call CRLF2 + 23674 chdir_retn: + 23675 00002866 C3 retn + 23676 + 23677 ; 24/02/2023 + 23678 ; MSDOS 3.3 + 23679 ;mov ax,[COMSW] + 23680 ;or ax,[ALLSWITCH] + 23681 ;mov dx,BADPARMPTR + 23682 ;jnz short CHDIR_ERR + 23683 ;mov si,81h + 23684 ;call SCANOFF + 23685 ;cmp al,0Dh ; are we at end of line? + 23686 ;je short BWDJ ; No args + 23687 ;inc si + 23688 ;lodsb + 23689 ;cmp al,':' + 23690 ;jne short REALCD + 23691 ;push si + 23692 ;call SCANOFF + 23693 ;pop si + 23694 ;cmp al,0Dh ; was a drive entered? + 23695 ;jne short REALCD ; no + 23696 ;BWDJ: + 23697 ;call BUILD_DIR_FOR_CHDIR ; Drive only specified + 23698 ;call CRLF2 + 23699 ;CHDIR_RETN: + 23700 ;retn + 23701 + 23702 ; 24/02/2023 + 23703 ; MSDOS 6.0 + 23704 REALCD: + 23705 00002867 56 push si ;AN000; save position in line + 23706 00002868 C536[EFA5] lds si,[PARSE1_ADDR] + 23707 ;AN000; get address of filespec + 23708 0000286C E86908 call Move_To_SrcBuf ;AN000; move to srcbuf + 23709 0000286F 5E pop si ;AN000; restore position in line + 23710 00002870 BF[9196] mov di,PARSE_CHDIR ;AC000; get address of parse_chdir + 23711 00002873 31D2 xor dx,dx ;AC000; + 23712 00002875 E8CDFC call parse_check_eol ;AC000; call parser + 23713 00002878 7544 jnz short ChDirErr ;AC000; + 23714 + 23715 0000287A E8A206 call SETPATH + 23716 0000287D F606[BD9D]02 test byte [DestInfo],2 + 23717 00002882 7519 jnz short BadChDir + 23718 + 23719 ; 26/04/2023 + 23720 00002884 B43B mov ah,3Bh + 23721 ;mov ah,CHDir + 23722 ;int 21h + 23723 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 23724 00002886 E831DD call int_21h_indirect + 23725 00002889 73DB jnc short chdir_retn + 23726 + 23727 0000288B E8BDF7 call get_ext_error_number + 23728 ;AN022; get the extended error + 23729 0000288E 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; 3 + 23730 ;AN022; see if path not found + 23731 00002891 740A je short BadChDir ;AN022; yes - issue old message + 23732 ;SR; + 23733 ; We want to issue "Invalid Directory" message even if the path is valid + 23734 ;but is not a directory. The extended error returns "Access denied" which + 23735 ;is kind of confusing. Issue the old message if access denied error is + 23736 ;returned + 23737 + 23738 00002893 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 + 23739 00002896 7405 je short BadChDir + 23740 + 23741 00002898 E8A200 call set_ext_error_subst ;AN022; + 23742 0000289B EB21 jmp short ChDirErr ;AN022; + 23743 + 23744 BadChDir: + 23745 0000289D BA[3791] mov dx,badcd_ptr + 23746 ;ChDirErr: + 23747 ; call std_eprintf + 23748 ;mkdir_retn: + 23749 ;retn 23750 ; 24/02/2023 - 23751 ; MSDOS 3.3 - 23752 ;REALCD: - 23753 ;call SETPATH - 23754 ;test byte [DESTINFO],2 - 23755 ;jnz short BADCHDIR - 23756 ;mov ah,CHDir ; 3Bh - 23757 ;int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 23758 ; ; DS:DX -> ASCIZ directory name (may include drive) - 23759 ;jnc short CHDIR_RETN - 23760 ;BADCHDIR: - 23761 ;mov dx,BADCDPTR - 23762 ;CHDIR_ERR: - 23763 ;call STD_EPRINTF - 23764 ;MKDIR_RETN: - 23765 ;retn - 23766 - 23767 ; =============== S U B R O U T I N E ======================================= - 23768 - 23769 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 23770 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:25E2h + 23751 000028A0 EB1C jmp short ChDirErr ;AN022; + 23752 + 23753 ; 24/02/2023 + 23754 ; MSDOS 3.3 + 23755 ;REALCD: + 23756 ;call SETPATH + 23757 ;test byte [DESTINFO],2 + 23758 ;jnz short BADCHDIR + 23759 ;mov ah,CHDir ; 3Bh + 23760 ;int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 23761 ; ; DS:DX -> ASCIZ directory name (may include drive) + 23762 ;jnc short CHDIR_RETN + 23763 ;BADCHDIR: + 23764 ;mov dx,BADCDPTR + 23765 ;CHDIR_ERR: + 23766 ;call STD_EPRINTF + 23767 ;MKDIR_RETN: + 23768 ;retn + 23769 + 23770 ; =============== S U B R O U T I N E ======================================= 23771 - 23772 ; 11/06/2023 - Retro DOS v4.2 - 23773 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2B8Ch + 23772 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 23773 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:25E2h 23774 - 23775 ; 04/08/2024 - Retro DOS v5.0 - 23776 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:29BBh + 23775 ; 11/06/2023 - Retro DOS v4.2 + 23776 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2B8Ch 23777 - 23778 _$MKDIR: - 23779 ; MSDOS 6.0 - 23780 000028A2 E86700 call SETRMMK - 23781 000028A5 7217 jc short MkDirErr - 23782 - 23783 000028A7 B439 mov ah,39h - 23784 ;mov ah,MKDIR - 23785 ;int 21h - 23786 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 23787 000028A9 E80EDD call int_21h_indirect - 23788 000028AC 7313 jnc short mkdir_retn - 23789 - 23790 000028AE E89AF7 call get_ext_error_number - 23791 ;AN022; get the extended error - 23792 000028B1 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; 3 - 23793 ;AN022; see if path not found - 23794 000028B4 742C je short MD_other_err - 23795 ;AN022; yes - issue old message - 23796 000028B6 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 - 23797 ;AN022; access denied? - 23798 000028B9 7407 je short badmderr ;AN022; yes - see if file exists - 23799 - 23800 000028BB E87F00 call set_ext_error_subst - 23801 ;AN022; - 23802 ;jmp short MkDirerr ;AC022; yes - go print it - 23803 ; 24/02/2023 - 23804 ChDirErr: - 23805 MkDirErr: - 23806 RmDirErr: - 23807 000028BE E85F2B call std_eprintf - 23808 mkdir_retn: - 23809 rmdir_retn: - 23810 000028C1 C3 retn - 23811 - 23812 badmderr: - 23813 000028C2 BA[2399] mov dx,SRCXNAME ;AN006; Set Disk transfer address - 23814 000028C5 B41A mov ah,1Ah - 23815 ;mov ah,Set_DMA ;AN006; - 23816 ;int 21h ;AN006; - 23817 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 23818 000028C7 E8F0DC call int_21h_indirect - 23819 - 23820 000028CA B44E mov ah,4Eh - 23821 ;mov ah,Find_First ;AN006; see if file/dir exists - 23822 ;mov cx,10h - 23823 000028CC B91000 mov cx,ATTR_DIRECTORY - 23824 ;AN006; search for directory - 23825 ;int 21h ;AN006; - 23826 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 23827 000028CF E8E8DC call int_21h_indirect - 23828 000028D2 720E jc short MD_other_err - 23829 ;AN006; doesn't exist - must be something else - 23830 ;;mov dl,SRCXNAME.find_buf_attr - 23831 ;AN006; we found a file/dir - 23832 ;mov dl,[SRCXNAME+21] - 23833 000028D4 8A16[3899] mov dl,[SRCXNAME+FIND_BUF.ATTR] - 23834 000028D8 F6C210 test dl,ATTR_DIRECTORY - 23835 ;AN006; was it a directory? - 23836 000028DB 7405 jz short MD_other_err - 23837 ;AN006; no - must have been a file - 23838 000028DD BA[4692] mov dx,MD_EXISTS_PTR - 23839 ;AN006; set up already exists error - 23840 000028E0 EBDC jmp short MkDirErr ;AN006; make sure we didn't have network error - 23841 MD_other_err: ;AN006; - 23842 000028E2 BA[3A91] mov dx,badmkd_ptr - 23843 ;MkDirErr: - 23844 ;call std_eprintf - 23845 ;retn - 23846 ; 24/02/2023 - 23847 000028E5 EBD7 jmp short MkDirErr - 23848 + 23778 ; 04/08/2024 - Retro DOS v5.0 + 23779 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:29BBh + 23780 + 23781 _$MKDIR: + 23782 ; MSDOS 6.0 + 23783 000028A2 E86700 call SETRMMK + 23784 000028A5 7217 jc short MkDirErr + 23785 + 23786 000028A7 B439 mov ah,39h + 23787 ;mov ah,MKDIR + 23788 ;int 21h + 23789 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 23790 000028A9 E80EDD call int_21h_indirect + 23791 000028AC 7313 jnc short mkdir_retn + 23792 + 23793 000028AE E89AF7 call get_ext_error_number + 23794 ;AN022; get the extended error + 23795 000028B1 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; 3 + 23796 ;AN022; see if path not found + 23797 000028B4 742C je short MD_other_err + 23798 ;AN022; yes - issue old message + 23799 000028B6 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 + 23800 ;AN022; access denied? + 23801 000028B9 7407 je short badmderr ;AN022; yes - see if file exists + 23802 + 23803 000028BB E87F00 call set_ext_error_subst + 23804 ;AN022; + 23805 ;jmp short MkDirerr ;AC022; yes - go print it + 23806 ; 24/02/2023 + 23807 ChDirErr: + 23808 MkDirErr: + 23809 RmDirErr: + 23810 000028BE E85F2B call std_eprintf + 23811 mkdir_retn: + 23812 rmdir_retn: + 23813 000028C1 C3 retn + 23814 + 23815 badmderr: + 23816 000028C2 BA[2399] mov dx,SRCXNAME ;AN006; Set Disk transfer address + 23817 000028C5 B41A mov ah,1Ah + 23818 ;mov ah,Set_DMA ;AN006; + 23819 ;int 21h ;AN006; + 23820 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 23821 000028C7 E8F0DC call int_21h_indirect + 23822 + 23823 000028CA B44E mov ah,4Eh + 23824 ;mov ah,Find_First ;AN006; see if file/dir exists + 23825 ;mov cx,10h + 23826 000028CC B91000 mov cx,ATTR_DIRECTORY + 23827 ;AN006; search for directory + 23828 ;int 21h ;AN006; + 23829 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 23830 000028CF E8E8DC call int_21h_indirect + 23831 000028D2 720E jc short MD_other_err + 23832 ;AN006; doesn't exist - must be something else + 23833 ;;mov dl,SRCXNAME.find_buf_attr + 23834 ;AN006; we found a file/dir + 23835 ;mov dl,[SRCXNAME+21] + 23836 000028D4 8A16[3899] mov dl,[SRCXNAME+FIND_BUF.ATTR] + 23837 000028D8 F6C210 test dl,ATTR_DIRECTORY + 23838 ;AN006; was it a directory? + 23839 000028DB 7405 jz short MD_other_err + 23840 ;AN006; no - must have been a file + 23841 000028DD BA[4692] mov dx,MD_EXISTS_PTR + 23842 ;AN006; set up already exists error + 23843 000028E0 EBDC jmp short MkDirErr ;AN006; make sure we didn't have network error + 23844 MD_other_err: ;AN006; + 23845 000028E2 BA[3A91] mov dx,badmkd_ptr + 23846 ;MkDirErr: + 23847 ;call std_eprintf + 23848 ;retn 23849 ; 24/02/2023 - 23850 ; MSDOS 3.3 - 23851 ;call SETRMMK - 23852 ;jb short MKDIRERR - 23853 ;mov ah,MKDIR ; 39h - 23854 ;int 21h ; DOS - 2+ - CREATE A SUBDIRECTORY (MKDIR) - 23855 ; ; DS:DX -> ASCIZ pathname (may include drive) - 23856 ;jnc short MKDIR_RETN - 23857 ;mov dx,BADMKDPTR - 23858 ;call GET_EXT_ERR_NUMBER - 23859 ;MKDIRERR: - 23860 ;call STD_EPRINTF - 23861 ;retn - 23862 - 23863 ; =============== S U B R O U T I N E ======================================= - 23864 - 23865 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 23866 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2656h - 23867 - 23868 ; 11/06/2023 - Retro DOS v4.2 - 23869 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2C00h + 23850 000028E5 EBD7 jmp short MkDirErr + 23851 + 23852 ; 24/02/2023 + 23853 ; MSDOS 3.3 + 23854 ;call SETRMMK + 23855 ;jb short MKDIRERR + 23856 ;mov ah,MKDIR ; 39h + 23857 ;int 21h ; DOS - 2+ - CREATE A SUBDIRECTORY (MKDIR) + 23858 ; ; DS:DX -> ASCIZ pathname (may include drive) + 23859 ;jnc short MKDIR_RETN + 23860 ;mov dx,BADMKDPTR + 23861 ;call GET_EXT_ERR_NUMBER + 23862 ;MKDIRERR: + 23863 ;call STD_EPRINTF + 23864 ;retn + 23865 + 23866 ; =============== S U B R O U T I N E ======================================= + 23867 + 23868 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 23869 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2656h 23870 - 23871 ; 04/08/2024 - Retro DOS v5.0 - 23872 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2A32h - 23873 - 23874 _$RMDIR: - 23875 000028E7 E82200 call SETRMMK - 23876 000028EA 72D2 jb short RmDirErr - 23877 000028EC 7519 jnz short badrderr - 23878 - 23879 000028EE B43A mov ah,3Ah - 23880 ;mov ah,RMDIR ; 3Ah - 23881 ;int 21h ; DOS - 2+ - REMOVE A DIRECTORY ENTRY (RMDIR) - 23882 ; DS:DX -> ASCIZ pathname (may include drive) - 23883 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 23884 000028F0 E8C7DC call int_21h_indirect - 23885 000028F3 73CC jnc short rmdir_retn ; 24/02/2023 - 23886 - 23887 ; 24/02/2023 - 23888 ; MSDOS 6.0 - 23889 000028F5 E853F7 call get_ext_error_number - 23890 ;AN022; get the extended error - 23891 000028F8 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; 3 - 23892 ;AN022; see if path not found - 23893 000028FB 740A je short badrderr ;AN022; yes - issue old message - 23894 000028FD 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 - 23895 ;AN022; access denied? - 23896 00002900 7405 je short badrderr ;AN022; yes - issue old message - 23897 - 23898 00002902 E83800 call set_ext_error_subst - 23899 ;AN022; - 23900 00002905 EBB7 jmp short RmDirErr ;AC022; yes - go print it - 23901 - 23902 ; MSDOS 6.0 - 23903 badrderr: - 23904 ; 24/02/2023 - 23905 00002907 BA[3D91] mov dx,badrmd_ptr - 23906 0000290A EBB2 jmp short RmDirErr - 23907 ;RmDirErr: - 23908 ;call std_eprintf - 23909 ;;rmdir_retn - 23910 ;retn - 23911 - 23912 ; 24/02/2023 - 23913 ; MSDOS 3.3 - 23914 ;mov dx,BADRMDPTR - 23915 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 - 23916 ;RMDIRERR: - 23917 ;call STD_EPRINTF - 23918 ;RMDIR_RETN: - 23919 ;retn - 23920 - 23921 ; =============== S U B R O U T I N E ======================================= - 23922 - 23923 ; - 23924 ;**************************************************************** - 23925 ;* - 23926 ;* ROUTINE: SETRMMK - 23927 ;* - 23928 ;* FUNCTION: Parse routine for the internal MKDIR and RMDIR - 23929 ;* commands. Parses the command line for a required - 23930 ;* filespec. - 23931 ;* - 23932 ;* INPUT: command line at offset 81H - 23933 ;* - 23934 ;* OUTPUT: carry clear - 23935 ;* DS:DX points to ASCIIZ argument - 23936 ;* carry set - 23937 ;* DS:DX has error message pointer - 23938 ;* - 23939 ;**************************************************************** - 23940 - 23941 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 23942 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2624h - 23943 - 23944 ; 11/06/2023 - Retro DOS v4.2 - 23945 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2BCEh - 23946 - 23947 ; 04/08/2024 - Retro DOS v5.0 - 23948 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2A00h + 23871 ; 11/06/2023 - Retro DOS v4.2 + 23872 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2C00h + 23873 + 23874 ; 04/08/2024 - Retro DOS v5.0 + 23875 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2A32h + 23876 + 23877 _$RMDIR: + 23878 000028E7 E82200 call SETRMMK + 23879 000028EA 72D2 jb short RmDirErr + 23880 000028EC 7519 jnz short badrderr + 23881 + 23882 000028EE B43A mov ah,3Ah + 23883 ;mov ah,RMDIR ; 3Ah + 23884 ;int 21h ; DOS - 2+ - REMOVE A DIRECTORY ENTRY (RMDIR) + 23885 ; DS:DX -> ASCIZ pathname (may include drive) + 23886 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 23887 000028F0 E8C7DC call int_21h_indirect + 23888 000028F3 73CC jnc short rmdir_retn ; 24/02/2023 + 23889 + 23890 ; 24/02/2023 + 23891 ; MSDOS 6.0 + 23892 000028F5 E853F7 call get_ext_error_number + 23893 ;AN022; get the extended error + 23894 000028F8 83F803 cmp ax,ERROR_PATH_NOT_FOUND ; 3 + 23895 ;AN022; see if path not found + 23896 000028FB 740A je short badrderr ;AN022; yes - issue old message + 23897 000028FD 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 + 23898 ;AN022; access denied? + 23899 00002900 7405 je short badrderr ;AN022; yes - issue old message + 23900 + 23901 00002902 E83800 call set_ext_error_subst + 23902 ;AN022; + 23903 00002905 EBB7 jmp short RmDirErr ;AC022; yes - go print it + 23904 + 23905 ; MSDOS 6.0 + 23906 badrderr: + 23907 ; 24/02/2023 + 23908 00002907 BA[3D91] mov dx,badrmd_ptr + 23909 0000290A EBB2 jmp short RmDirErr + 23910 ;RmDirErr: + 23911 ;call std_eprintf + 23912 ;;rmdir_retn + 23913 ;retn + 23914 + 23915 ; 24/02/2023 + 23916 ; MSDOS 3.3 + 23917 ;mov dx,BADRMDPTR + 23918 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 + 23919 ;RMDIRERR: + 23920 ;call STD_EPRINTF + 23921 ;RMDIR_RETN: + 23922 ;retn + 23923 + 23924 ; =============== S U B R O U T I N E ======================================= + 23925 + 23926 ; + 23927 ;**************************************************************** + 23928 ;* + 23929 ;* ROUTINE: SETRMMK + 23930 ;* + 23931 ;* FUNCTION: Parse routine for the internal MKDIR and RMDIR + 23932 ;* commands. Parses the command line for a required + 23933 ;* filespec. + 23934 ;* + 23935 ;* INPUT: command line at offset 81H + 23936 ;* + 23937 ;* OUTPUT: carry clear + 23938 ;* DS:DX points to ASCIIZ argument + 23939 ;* carry set + 23940 ;* DS:DX has error message pointer + 23941 ;* + 23942 ;**************************************************************** + 23943 + 23944 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 23945 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2624h + 23946 + 23947 ; 11/06/2023 - Retro DOS v4.2 + 23948 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2BCEh 23949 - 23950 SETRMMK: - 23951 ; MSDOS 6.0 - 23952 0000290C BE8100 mov si,81h - 23953 0000290F BF[8896] mov di,PARSE_MRDIR ;AN000; Get address of PARSE_MRDIR - 23954 00002912 31C9 xor cx,cx ;AN000; clear cx,dx - 23955 00002914 31D2 xor dx,dx ;AN000; - 23956 ;invoke Parse_With_Msg ;AC000; call parser - 23957 00002916 E842FC call Parse_With_Msg - 23958 ;cmp ax,0 - 23959 ;cmp ax,RESULT_NO_ERROR - 23960 00002919 09C0 or ax,ax ; 0 ? ;AC000; did we have an error? - 23961 0000291B 7519 jnz short noargerr ;AC000; yes - exit - 23962 - 23963 0000291D BF[2399] mov di,SRCXNAME - 23964 ;AN000; get address of srcxname - 23965 00002920 57 push di ;AN000; save address - 23966 00002921 56 push si ;AN000; save position in line - 23967 00002922 C536[EFA5] lds si,[PARSE1_ADDR] - 23968 ;AN000; get address of path - 23969 mrdir_move_filename: ;AN000; put filespec in srcxname - 23970 00002926 AC lodsb ;get a char from buffer - 23971 00002927 AA stosb ;AN000; store in srcxname - 23972 ;cmp al,0 - 23973 ;cmp al,END_OF_LINE_OUT - 23974 00002928 20C0 and al,al ; 0 ? ;AC000; it char a terminator? - 23975 0000292A 75FA jnz short mrdir_move_filename - 23976 ;AC000; no - keep moving - 23977 0000292C 5E pop si ;AN000; get line position back - 23978 - 23979 ; we have scanned an argument. See if any args beyond. - 23980 - 23981 0000292D BF[8896] mov di,PARSE_MRDIR - 23982 00002930 E812FC call parse_check_eol ;AC000; are we at end of line? - 23983 00002933 5A pop dx ;AC000; get address of SRCXNAME - 23984 ;retz ;yes - return no error - 23985 00002934 7406 jz short setrmmk_retn - 23986 noargerr: - 23987 00002936 BA[D78F] mov dx,extend_buf_ptr - 23988 ;AC000; get extended message pointer - 23989 00002939 31C0 xor ax,ax - 23990 0000293B F9 stc - 23991 setrmmk_retn: - 23992 0000293C C3 retn - 23993 - 23994 ; 24/02/2023 - 23995 ; MSDOS 3.3 - 23996 ;SETRMMK: - 23997 ;mov si,81h - 23998 ;call SCANOFF - 23999 ;cmp al,0Dh - 24000 ;je short NOARGERR - 24001 ;mov dx,si - 24002 ;SETRMMK1: - 24003 ;lodsb - 24004 ;call DELIM - 24005 ;jz short SETRMMK3 - 24006 ;cmp al,0Dh - 24007 ;jne short SETRMMK1 - 24008 ;mov byte [si-1],0 - 24009 ;SETRMMK2: - 24010 ;retn - 24011 ;SETRMMK3: - 24012 ;mov byte [si-1],0 - 24013 ;push si - 24014 ;call SCANOFF - 24015 ;pop si - 24016 ;cmp al,0Dh - 24017 ;je short SETRMMK2 - 24018 ;NOARGERR: - 24019 ;mov dx,BADARGSPTR - 24020 ;xor ax,ax - 24021 ;stc - 24022 ;SETRMMK_RETN: - 24023 ;retn - 24024 - 24025 ; =============== S U B R O U T I N E ======================================= - 24026 - 24027 ; MSDOS 6.0 - 24028 - 24029 ;**************************************************************** - 24030 ;* - 24031 ;* ROUTINE: Set_ext_error_subst - 24032 ;* - 24033 ;* FUNCTION: Sets up substitution for extended error - 24034 ;* - 24035 ;* INPUT: AX - extended error number - 24036 ;* DX - offset of string + 23950 ; 04/08/2024 - Retro DOS v5.0 + 23951 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2A00h + 23952 + 23953 SETRMMK: + 23954 ; MSDOS 6.0 + 23955 0000290C BE8100 mov si,81h + 23956 0000290F BF[8896] mov di,PARSE_MRDIR ;AN000; Get address of PARSE_MRDIR + 23957 00002912 31C9 xor cx,cx ;AN000; clear cx,dx + 23958 00002914 31D2 xor dx,dx ;AN000; + 23959 ;invoke Parse_With_Msg ;AC000; call parser + 23960 00002916 E842FC call Parse_With_Msg + 23961 ;cmp ax,0 + 23962 ;cmp ax,RESULT_NO_ERROR + 23963 00002919 09C0 or ax,ax ; 0 ? ;AC000; did we have an error? + 23964 0000291B 7519 jnz short noargerr ;AC000; yes - exit + 23965 + 23966 0000291D BF[2399] mov di,SRCXNAME + 23967 ;AN000; get address of srcxname + 23968 00002920 57 push di ;AN000; save address + 23969 00002921 56 push si ;AN000; save position in line + 23970 00002922 C536[EFA5] lds si,[PARSE1_ADDR] + 23971 ;AN000; get address of path + 23972 mrdir_move_filename: ;AN000; put filespec in srcxname + 23973 00002926 AC lodsb ;get a char from buffer + 23974 00002927 AA stosb ;AN000; store in srcxname + 23975 ;cmp al,0 + 23976 ;cmp al,END_OF_LINE_OUT + 23977 00002928 20C0 and al,al ; 0 ? ;AC000; it char a terminator? + 23978 0000292A 75FA jnz short mrdir_move_filename + 23979 ;AC000; no - keep moving + 23980 0000292C 5E pop si ;AN000; get line position back + 23981 + 23982 ; we have scanned an argument. See if any args beyond. + 23983 + 23984 0000292D BF[8896] mov di,PARSE_MRDIR + 23985 00002930 E812FC call parse_check_eol ;AC000; are we at end of line? + 23986 00002933 5A pop dx ;AC000; get address of SRCXNAME + 23987 ;retz ;yes - return no error + 23988 00002934 7406 jz short setrmmk_retn + 23989 noargerr: + 23990 00002936 BA[D78F] mov dx,extend_buf_ptr + 23991 ;AC000; get extended message pointer + 23992 00002939 31C0 xor ax,ax + 23993 0000293B F9 stc + 23994 setrmmk_retn: + 23995 0000293C C3 retn + 23996 + 23997 ; 24/02/2023 + 23998 ; MSDOS 3.3 + 23999 ;SETRMMK: + 24000 ;mov si,81h + 24001 ;call SCANOFF + 24002 ;cmp al,0Dh + 24003 ;je short NOARGERR + 24004 ;mov dx,si + 24005 ;SETRMMK1: + 24006 ;lodsb + 24007 ;call DELIM + 24008 ;jz short SETRMMK3 + 24009 ;cmp al,0Dh + 24010 ;jne short SETRMMK1 + 24011 ;mov byte [si-1],0 + 24012 ;SETRMMK2: + 24013 ;retn + 24014 ;SETRMMK3: + 24015 ;mov byte [si-1],0 + 24016 ;push si + 24017 ;call SCANOFF + 24018 ;pop si + 24019 ;cmp al,0Dh + 24020 ;je short SETRMMK2 + 24021 ;NOARGERR: + 24022 ;mov dx,BADARGSPTR + 24023 ;xor ax,ax + 24024 ;stc + 24025 ;SETRMMK_RETN: + 24026 ;retn + 24027 + 24028 ; =============== S U B R O U T I N E ======================================= + 24029 + 24030 ; MSDOS 6.0 + 24031 + 24032 ;**************************************************************** + 24033 ;* + 24034 ;* ROUTINE: Set_ext_error_subst + 24035 ;* + 24036 ;* FUNCTION: Sets up substitution for extended error 24037 ;* - 24038 ;* OUTPUT: Extend_Buf_Ptr set up for STD_EPRINTF - 24039 ;* - 24040 ;**************************************************************** - 24041 - 24042 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24043 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:267Ch - 24044 set_ext_error_subst: - 24045 ;mov byte [msg_disp_class],1 - 24046 0000293D C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 24047 ;AN022; set up extended error msg class - 24048 00002942 8916[A09D] mov [string_ptr_2],dx ;AN022; get address of failed string - 24049 ;mov byte [extend_buf_sub],1 - 24050 00002946 C606[D98F]01 mov byte [extend_buf_sub],one_subst - 24051 ;AN022; put number of subst in control block - 24052 0000294B BA[D78F] mov dx,extend_buf_ptr ;AN022; get extended message pointer - 24053 0000294E A3[D78F] mov [extend_buf_ptr],ax ;AN022; get message number in control block - 24054 savudir_err_retn: ; 24/02/2023 - 24055 00002951 C3 retn ;AN022; return - 24056 - 24057 ; =============== S U B R O U T I N E ======================================= - 24058 - 24059 ; - 24060 - 24061 ; SavUDir - move the user's current directory on a drive into UserDir1 - 24062 ; SavUDir1 - move the user's current directory on a drive into a specified - 24063 ; buffer - 24064 ; - 24065 ; Inputs: DL has 1-based drive number - 24066 ; ES:DI has destination buffer (SavUDir1 only) - 24067 ; Outputs: Carry Clear - 24068 ; DS = TranGroup - 24069 ; Carry Set - 24070 ; AX has error code - 24071 ; Registers Modified: AX, SI - 24072 - 24073 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24074 SAVUDIR: - 24075 00002952 BF[D79A] mov di,USERDIR1 - 24076 ; -------------- - 24077 SAVUDIR1: - 24078 00002955 88D0 mov al,dl - 24079 00002957 0440 add al,'@' ; 40h - 24080 00002959 3C40 cmp al,'@' ; 40h - 24081 0000295B 7506 jne short GOTUDRV - 24082 0000295D 0206[079C] add al,[CURDRV] - 24083 00002961 FEC0 inc al ; A = 1 - 24084 GOTUDRV: - 24085 00002963 AA stosb - 24086 00002964 8A26[FA9B] mov ah,[DIRCHAR] - 24087 00002968 B03A mov al,':' ; 3Ah - 24088 0000296A AB stosw - 24089 0000296B 06 push es - 24090 0000296C 1F pop ds - 24091 0000296D 89FE mov si,di - 24092 0000296F B447 mov ah,47h ; 24/02/2023 - 24093 ;mov ah,CURRENT_DIR ; 47h - 24094 ;int 21h ; DOS - 2+ - GET CURRENT DIRECTORY - 24095 ; DL = drive (0=default,1=A,etc.) - 24096 ; DS:SI points to 64-byte buffer area - 24097 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 24098 00002971 E846DC call int_21h_indirect - 24099 00002974 72DB jc short savudir_err_retn ; 24/02/2023 - 24100 00002976 0E push cs - 24101 00002977 1F pop ds - 24102 00002978 C3 retn - 24103 - 24104 ; =============== S U B R O U T I N E ======================================= - 24105 - 24106 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24107 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:26B7h - 24108 CRLF2: - 24109 00002979 52 push dx - 24110 0000297A BA[FA91] mov dx,acrlf_ptr - 24111 0000297D 1E push ds - 24112 0000297E 0E push cs - 24113 0000297F 1F pop ds - 24114 00002980 E8A52A call std_printf - 24115 00002983 1F pop ds - 24116 00002984 5A pop dx - 24117 00002985 C3 retn - 24118 - 24119 ; =============== S U B R O U T I N E ======================================= - 24120 - 24121 ; These routines (SCANOFF, DELIM) are called in batch processing when DS - 24122 ; may NOT be TRANGROUP + 24038 ;* INPUT: AX - extended error number + 24039 ;* DX - offset of string + 24040 ;* + 24041 ;* OUTPUT: Extend_Buf_Ptr set up for STD_EPRINTF + 24042 ;* + 24043 ;**************************************************************** + 24044 + 24045 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24046 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:267Ch + 24047 set_ext_error_subst: + 24048 ;mov byte [msg_disp_class],1 + 24049 0000293D C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 24050 ;AN022; set up extended error msg class + 24051 00002942 8916[A09D] mov [string_ptr_2],dx ;AN022; get address of failed string + 24052 ;mov byte [extend_buf_sub],1 + 24053 00002946 C606[D98F]01 mov byte [extend_buf_sub],one_subst + 24054 ;AN022; put number of subst in control block + 24055 0000294B BA[D78F] mov dx,extend_buf_ptr ;AN022; get extended message pointer + 24056 0000294E A3[D78F] mov [extend_buf_ptr],ax ;AN022; get message number in control block + 24057 savudir_err_retn: ; 24/02/2023 + 24058 00002951 C3 retn ;AN022; return + 24059 + 24060 ; =============== S U B R O U T I N E ======================================= + 24061 + 24062 ; + 24063 + 24064 ; SavUDir - move the user's current directory on a drive into UserDir1 + 24065 ; SavUDir1 - move the user's current directory on a drive into a specified + 24066 ; buffer + 24067 ; + 24068 ; Inputs: DL has 1-based drive number + 24069 ; ES:DI has destination buffer (SavUDir1 only) + 24070 ; Outputs: Carry Clear + 24071 ; DS = TranGroup + 24072 ; Carry Set + 24073 ; AX has error code + 24074 ; Registers Modified: AX, SI + 24075 + 24076 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24077 SAVUDIR: + 24078 00002952 BF[D79A] mov di,USERDIR1 + 24079 ; -------------- + 24080 SAVUDIR1: + 24081 00002955 88D0 mov al,dl + 24082 00002957 0440 add al,'@' ; 40h + 24083 00002959 3C40 cmp al,'@' ; 40h + 24084 0000295B 7506 jne short GOTUDRV + 24085 0000295D 0206[079C] add al,[CURDRV] + 24086 00002961 FEC0 inc al ; A = 1 + 24087 GOTUDRV: + 24088 00002963 AA stosb + 24089 00002964 8A26[FA9B] mov ah,[DIRCHAR] + 24090 00002968 B03A mov al,':' ; 3Ah + 24091 0000296A AB stosw + 24092 0000296B 06 push es + 24093 0000296C 1F pop ds + 24094 0000296D 89FE mov si,di + 24095 0000296F B447 mov ah,47h ; 24/02/2023 + 24096 ;mov ah,CURRENT_DIR ; 47h + 24097 ;int 21h ; DOS - 2+ - GET CURRENT DIRECTORY + 24098 ; DL = drive (0=default,1=A,etc.) + 24099 ; DS:SI points to 64-byte buffer area + 24100 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 24101 00002971 E846DC call int_21h_indirect + 24102 00002974 72DB jc short savudir_err_retn ; 24/02/2023 + 24103 00002976 0E push cs + 24104 00002977 1F pop ds + 24105 00002978 C3 retn + 24106 + 24107 ; =============== S U B R O U T I N E ======================================= + 24108 + 24109 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24110 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:26B7h + 24111 CRLF2: + 24112 00002979 52 push dx + 24113 0000297A BA[FA91] mov dx,acrlf_ptr + 24114 0000297D 1E push ds + 24115 0000297E 0E push cs + 24116 0000297F 1F pop ds + 24117 00002980 E8A52A call std_printf + 24118 00002983 1F pop ds + 24119 00002984 5A pop dx + 24120 00002985 C3 retn + 24121 + 24122 ; =============== S U B R O U T I N E ======================================= 24123 - 24124 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24125 scanoff: - 24126 00002986 AC lodsb - 24127 00002987 E80400 call DELIM - 24128 0000298A 74FA jz short scanoff - 24129 0000298C 4E dec si ; Point to first non-delimiter - 24130 scanoff_retn: - 24131 0000298D C3 retn - 24132 - 24133 ; =============== S U B R O U T I N E ======================================= - 24134 - 24135 ; Input: AL is character to classify - 24136 ; Output: Z set if delimiter - 24137 ; NZ set otherwise - 24138 ; Registers modified: none - 24139 - 24140 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24141 DELIM: - 24142 0000298E 3C20 cmp al,' ' ;20h - 24143 00002990 74FB je short scanoff_retn - 24144 00002992 3C3D cmp al,'=' ; 3Dh - 24145 00002994 74F7 je short scanoff_retn - 24146 00002996 3C2C cmp al,',' ; 2Ch - 24147 00002998 74F3 je short scanoff_retn - 24148 0000299A 3C3B cmp al,';' ;3Bh - 24149 0000299C 74EF je short scanoff_retn - 24150 0000299E 3C09 cmp al,9 ; Check for TAB character - 24151 000029A0 74EB je short scanoff_retn - 24152 000029A2 3C0A cmp al,0Ah ; Check for line feed character - BAS - 24153 000029A4 C3 retn - 24154 - 24155 - 24156 ; =============== S U B R O U T I N E ======================================= + 24124 ; These routines (SCANOFF, DELIM) are called in batch processing when DS + 24125 ; may NOT be TRANGROUP + 24126 + 24127 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24128 scanoff: + 24129 00002986 AC lodsb + 24130 00002987 E80400 call DELIM + 24131 0000298A 74FA jz short scanoff + 24132 0000298C 4E dec si ; Point to first non-delimiter + 24133 scanoff_retn: + 24134 0000298D C3 retn + 24135 + 24136 ; =============== S U B R O U T I N E ======================================= + 24137 + 24138 ; Input: AL is character to classify + 24139 ; Output: Z set if delimiter + 24140 ; NZ set otherwise + 24141 ; Registers modified: none + 24142 + 24143 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24144 DELIM: + 24145 0000298E 3C20 cmp al,' ' ;20h + 24146 00002990 74FB je short scanoff_retn + 24147 00002992 3C3D cmp al,'=' ; 3Dh + 24148 00002994 74F7 je short scanoff_retn + 24149 00002996 3C2C cmp al,',' ; 2Ch + 24150 00002998 74F3 je short scanoff_retn + 24151 0000299A 3C3B cmp al,';' ;3Bh + 24152 0000299C 74EF je short scanoff_retn + 24153 0000299E 3C09 cmp al,9 ; Check for TAB character + 24154 000029A0 74EB je short scanoff_retn + 24155 000029A2 3C0A cmp al,0Ah ; Check for line feed character - BAS + 24156 000029A4 C3 retn 24157 - 24158 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24159 FCB_TO_ASCZ: - 24160 ; Convert DS:SI to ASCIZ ES:DI - 24161 000029A5 B90800 mov cx,8 - 24162 MAINNAME: - 24163 000029A8 AC lodsb - 24164 000029A9 3C20 cmp al,' ' ; 20h - 24165 000029AB 7401 jz short SKIPSPC - 24166 000029AD AA stosb - 24167 SKIPSPC: - 24168 000029AE E2F8 loop MAINNAME - 24169 000029B0 AC lodsb - 24170 000029B1 3C20 cmp al,' ' - 24171 000029B3 740F je short GOTNAME - 24172 000029B5 88C4 mov ah,al - 24173 ; 24/02/2023 - 24174 000029B7 B02E mov al,'.' ; 2Eh ; MSDOS 5.0 (& 6.0) - 24175 ;mov al,[DOT_CHR] ; MSDOS 3.3 - 24176 ;stosb - 24177 ;xchg al,ah - 24178 ;stosb - 24179 ; 24/02/2023 - 24180 000029B9 AB stosw - 24181 000029BA B102 mov cl,2 - 24182 EXTNAME: - 24183 000029BC AC lodsb - 24184 000029BD 3C20 cmp al,' ' - 24185 000029BF 7403 je short GOTNAME - 24186 000029C1 AA stosb - 24187 000029C2 E2F8 loop EXTNAME - 24188 GOTNAME: - 24189 000029C4 30C0 xor al,al - 24190 000029C6 AA stosb - 24191 STRCOMP_RETN: - 24192 000029C7 C3 retn - 24193 - 24194 ; =============== S U B R O U T I N E ======================================= - 24195 - 24196 ; Compare ASCIZ DS:SI with ES:DI. - 24197 ; SI,DI destroyed. + 24158 + 24159 ; =============== S U B R O U T I N E ======================================= + 24160 + 24161 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24162 FCB_TO_ASCZ: + 24163 ; Convert DS:SI to ASCIZ ES:DI + 24164 000029A5 B90800 mov cx,8 + 24165 MAINNAME: + 24166 000029A8 AC lodsb + 24167 000029A9 3C20 cmp al,' ' ; 20h + 24168 000029AB 7401 jz short SKIPSPC + 24169 000029AD AA stosb + 24170 SKIPSPC: + 24171 000029AE E2F8 loop MAINNAME + 24172 000029B0 AC lodsb + 24173 000029B1 3C20 cmp al,' ' + 24174 000029B3 740F je short GOTNAME + 24175 000029B5 88C4 mov ah,al + 24176 ; 24/02/2023 + 24177 000029B7 B02E mov al,'.' ; 2Eh ; MSDOS 5.0 (& 6.0) + 24178 ;mov al,[DOT_CHR] ; MSDOS 3.3 + 24179 ;stosb + 24180 ;xchg al,ah + 24181 ;stosb + 24182 ; 24/02/2023 + 24183 000029B9 AB stosw + 24184 000029BA B102 mov cl,2 + 24185 EXTNAME: + 24186 000029BC AC lodsb + 24187 000029BD 3C20 cmp al,' ' + 24188 000029BF 7403 je short GOTNAME + 24189 000029C1 AA stosb + 24190 000029C2 E2F8 loop EXTNAME + 24191 GOTNAME: + 24192 000029C4 30C0 xor al,al + 24193 000029C6 AA stosb + 24194 STRCOMP_RETN: + 24195 000029C7 C3 retn + 24196 + 24197 ; =============== S U B R O U T I N E ======================================= 24198 - 24199 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24200 STRCOMP: - 24201 000029C8 A6 cmpsb - 24202 000029C9 75FC jnz short STRCOMP_RETN ; Strings not equal - 24203 000029CB 807CFF00 cmp byte [si-1],0 ; Hit NUL terminator? - 24204 ;jz short STRCOMP_RETN ; Yes, strings equal - 24205 ;jmp short STRCOMP ; Equal so far, keep going - 24206 ; 24/02/2023 - 24207 000029CF 75F7 jnz short STRCOMP - 24208 000029D1 C3 retn - 24209 - 24210 ; =============== S U B R O U T I N E ======================================= - 24211 - 24212 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 24213 CRPRINT: - 24214 000029D2 50 push ax - 24215 ;mov al,13 ; 0Dh - 24216 000029D3 B00D mov al,0Dh - 24217 000029D5 51 push cx - 24218 000029D6 57 push di - 24219 000029D7 89D7 mov di,dx - 24220 000029D9 B9FFFF mov cx,65535 ; 0FFFFh - 24221 000029DC 06 push es - 24222 000029DD 1E push ds - 24223 000029DE 07 pop es - 24224 000029DF F2AE repne scasb ; LOOK FOR TERMINATOR - 24225 000029E1 C645FF00 mov byte [di-1],0 ; nul terminate the string - 24226 000029E5 07 pop es - 24227 000029E6 8916[A09D] mov [string_ptr_2],dx - 24228 ;mov dx,STRINGBUF2PTR ; MSDOS 3.3 (Retro DOS v3.0 COMMAND.COM) - 24229 000029EA BA[DF91] mov dx,string_buf_ptr ; MSDOS 5.0 (& 6.0) - 24230 000029ED E8382A call std_printf - 24231 ;mov byte [di-1],13 - 24232 000029F0 C645FF0D mov byte [di-1],0Dh ; now put the CR back - 24233 000029F4 7204 jb short error_output - 24234 000029F6 5F pop di - 24235 000029F7 59 pop cx - 24236 000029F8 58 pop ax - 24237 000029F9 C3 retn - 24238 - 24239 ; --------------------------------------------------------------------------- - 24240 - 24241 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24242 error_output: - 24243 000029FA 0E push cs - 24244 000029FB 1F pop ds - 24245 000029FC 8E06[F59B] mov es,[RESSEG] - 24246 00002A00 BA[EB8F] mov dx,NOSPACE_PTR - 24247 00002A03 26803E[1303]00 cmp byte [es:PipeFlag],0 - 24248 00002A09 7406 jz short go_to_error - 24249 00002A0B E89909 call PipeOff - 24250 00002A0E BA[5D91] mov dx,PIPEEMES_PTR - 24251 go_to_error: - 24252 00002A11 E91203 jmp cerror - 24253 - 24254 ; =============== S U B R O U T I N E ======================================= - 24255 - 24256 ;---- Mod for path invocation ---- - 24257 - 24258 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) - 24259 pathchrcmp: - 24260 ; 18/03/2023 - 24261 ;push ax - 24262 ;mov ah,'/' ; 2Fh - 24263 ;cmp [SWITCHAR],ah - 24264 00002A14 803E[F99B]2F cmp byte [SWITCHAR],'/' ; 2Fh - 24265 00002A19 7404 je short noslasht - 24266 00002A1B 3C2F cmp al,'/' - 24267 00002A1D 7402 je short pccont - 24268 noslasht: - 24269 00002A1F 3C5C cmp al,'\' ; 5Ch - 24270 pccont: - 24271 ;pop ax - 24272 00002A21 C3 retn - 24273 - 24274 ; =============== S U B R O U T I N E ======================================= - 24275 - 24276 ; PATHCRUNCH - - 24277 ; - 24278 ; ENTRY FCB (in PSP) contains drive # to crunch on - 24279 ; PathPos = ptr to string with pathname in it - 24280 ; PathCnt = length of string - 24281 ; - 24282 ; EXIT PathPos = ptr after pathname (w/ NULL) in string - 24283 ; PathCnt = length left in string - 24284 ; DestIsDir = nonzero if pathname delimiter char's found in pathname - 24285 ; DestInfo = set if wildcard char's found in pathname - 24286 ; If path crunched successfully, - 24287 ; CY = clear - 24288 ; Current directory is changed to directory in pathname - 24289 ; UserDir1 contains previous directory for use by RestUDir - 24290 ; RestDir = nonzero to flag later restoration of user's dir - 24291 ; DestTail = ptr to beginning of filename - 24292 ; If filename found in pathname, - 24293 ; ZR = clear - 24294 ; FCB filename fields contain filename - 24295 ; If filename not found (pure directory path), - 24296 ; ZR = set - 24297 ; FCB filename fields are wildcarded with ?'s - 24298 ; If pathcrunch failed (no ChDir's worked), - 24299 ; CY = set - 24300 ; Msg_Numb = extended error code - 24301 ; - 24302 ; NOTE DIR asks PathCrunch to forego parsing the filename into the - 24303 ; FCB by setting DirFlag. In this case, the FCB is returned - 24304 ; with the filename wildcarded. - 24305 - 24306 ; 25/02/2023 - Retro DOS v4.0 (& v4.1) - 24307 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2767h + 24199 ; Compare ASCIZ DS:SI with ES:DI. + 24200 ; SI,DI destroyed. + 24201 + 24202 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24203 STRCOMP: + 24204 000029C8 A6 cmpsb + 24205 000029C9 75FC jnz short STRCOMP_RETN ; Strings not equal + 24206 000029CB 807CFF00 cmp byte [si-1],0 ; Hit NUL terminator? + 24207 ;jz short STRCOMP_RETN ; Yes, strings equal + 24208 ;jmp short STRCOMP ; Equal so far, keep going + 24209 ; 24/02/2023 + 24210 000029CF 75F7 jnz short STRCOMP + 24211 000029D1 C3 retn + 24212 + 24213 ; =============== S U B R O U T I N E ======================================= + 24214 + 24215 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 24216 CRPRINT: + 24217 000029D2 50 push ax + 24218 ;mov al,13 ; 0Dh + 24219 000029D3 B00D mov al,0Dh + 24220 000029D5 51 push cx + 24221 000029D6 57 push di + 24222 000029D7 89D7 mov di,dx + 24223 000029D9 B9FFFF mov cx,65535 ; 0FFFFh + 24224 000029DC 06 push es + 24225 000029DD 1E push ds + 24226 000029DE 07 pop es + 24227 000029DF F2AE repne scasb ; LOOK FOR TERMINATOR + 24228 000029E1 C645FF00 mov byte [di-1],0 ; nul terminate the string + 24229 000029E5 07 pop es + 24230 000029E6 8916[A09D] mov [string_ptr_2],dx + 24231 ;mov dx,STRINGBUF2PTR ; MSDOS 3.3 (Retro DOS v3.0 COMMAND.COM) + 24232 000029EA BA[DF91] mov dx,string_buf_ptr ; MSDOS 5.0 (& 6.0) + 24233 000029ED E8382A call std_printf + 24234 ;mov byte [di-1],13 + 24235 000029F0 C645FF0D mov byte [di-1],0Dh ; now put the CR back + 24236 000029F4 7204 jb short error_output + 24237 000029F6 5F pop di + 24238 000029F7 59 pop cx + 24239 000029F8 58 pop ax + 24240 000029F9 C3 retn + 24241 + 24242 ; --------------------------------------------------------------------------- + 24243 + 24244 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24245 error_output: + 24246 000029FA 0E push cs + 24247 000029FB 1F pop ds + 24248 000029FC 8E06[F59B] mov es,[RESSEG] + 24249 00002A00 BA[EB8F] mov dx,NOSPACE_PTR + 24250 00002A03 26803E[1303]00 cmp byte [es:PipeFlag],0 + 24251 00002A09 7406 jz short go_to_error + 24252 00002A0B E89909 call PipeOff + 24253 00002A0E BA[5D91] mov dx,PIPEEMES_PTR + 24254 go_to_error: + 24255 00002A11 E91203 jmp cerror + 24256 + 24257 ; =============== S U B R O U T I N E ======================================= + 24258 + 24259 ;---- Mod for path invocation ---- + 24260 + 24261 ; 24/02/2023 - Retro DOS v4.0 (& v4.1) + 24262 pathchrcmp: + 24263 ; 18/03/2023 + 24264 ;push ax + 24265 ;mov ah,'/' ; 2Fh + 24266 ;cmp [SWITCHAR],ah + 24267 00002A14 803E[F99B]2F cmp byte [SWITCHAR],'/' ; 2Fh + 24268 00002A19 7404 je short noslasht + 24269 00002A1B 3C2F cmp al,'/' + 24270 00002A1D 7402 je short pccont + 24271 noslasht: + 24272 00002A1F 3C5C cmp al,'\' ; 5Ch + 24273 pccont: + 24274 ;pop ax + 24275 00002A21 C3 retn + 24276 + 24277 ; =============== S U B R O U T I N E ======================================= + 24278 + 24279 ; PATHCRUNCH - + 24280 ; + 24281 ; ENTRY FCB (in PSP) contains drive # to crunch on + 24282 ; PathPos = ptr to string with pathname in it + 24283 ; PathCnt = length of string + 24284 ; + 24285 ; EXIT PathPos = ptr after pathname (w/ NULL) in string + 24286 ; PathCnt = length left in string + 24287 ; DestIsDir = nonzero if pathname delimiter char's found in pathname + 24288 ; DestInfo = set if wildcard char's found in pathname + 24289 ; If path crunched successfully, + 24290 ; CY = clear + 24291 ; Current directory is changed to directory in pathname + 24292 ; UserDir1 contains previous directory for use by RestUDir + 24293 ; RestDir = nonzero to flag later restoration of user's dir + 24294 ; DestTail = ptr to beginning of filename + 24295 ; If filename found in pathname, + 24296 ; ZR = clear + 24297 ; FCB filename fields contain filename + 24298 ; If filename not found (pure directory path), + 24299 ; ZR = set + 24300 ; FCB filename fields are wildcarded with ?'s + 24301 ; If pathcrunch failed (no ChDir's worked), + 24302 ; CY = set + 24303 ; Msg_Numb = extended error code + 24304 ; + 24305 ; NOTE DIR asks PathCrunch to forego parsing the filename into the + 24306 ; FCB by setting DirFlag. In this case, the FCB is returned + 24307 ; with the filename wildcarded. 24308 - 24309 ; 11/06/2023 - Retro DOS v4.2 - 24310 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2D11h + 24309 ; 25/02/2023 - Retro DOS v4.0 (& v4.1) + 24310 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2767h 24311 - 24312 ; 04/08/2024 - Retro DOS v5.0 - 24313 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2B45h - 24314 PathCrunch: - 24315 ; MSDOS 6.0 - 24316 00002A22 C706[349F]0000 mov word [Msg_Numb],0 - 24317 ;AN022; Set up message flag - 24318 ; MSDOS 3.3 (& MSDOS 6.0) - 24319 ;mov dl,[5Ch] - 24320 00002A28 8A165C00 mov dl,[FCB] ; DL = drive # (1 = A) - 24321 00002A2C E823FF call SAVUDIR ; save current directory in UserDir1 - 24322 ; MSDOS 6.0 - 24323 00002A2F 7233 jc short pcrunch_cderrj - 24324 ;AN022; if error on current dir - report - 24325 00002A31 E8EB04 call SETPATH ; scan past switches, whitespace - 24326 - 24327 ; DX = ptr to pathname, NULL-terminated - 24328 ; PathPos = ptr to byte after NULL at end of pathname + 24312 ; 11/06/2023 - Retro DOS v4.2 + 24313 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2D11h + 24314 + 24315 ; 04/08/2024 - Retro DOS v5.0 + 24316 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2B45h + 24317 PathCrunch: + 24318 ; MSDOS 6.0 + 24319 00002A22 C706[349F]0000 mov word [Msg_Numb],0 + 24320 ;AN022; Set up message flag + 24321 ; MSDOS 3.3 (& MSDOS 6.0) + 24322 ;mov dl,[5Ch] + 24323 00002A28 8A165C00 mov dl,[FCB] ; DL = drive # (1 = A) + 24324 00002A2C E823FF call SAVUDIR ; save current directory in UserDir1 + 24325 ; MSDOS 6.0 + 24326 00002A2F 7233 jc short pcrunch_cderrj + 24327 ;AN022; if error on current dir - report + 24328 00002A31 E8EB04 call SETPATH ; scan past switches, whitespace 24329 - 24330 ; MSDOS 3.3 (& MSDOS 6.0) - 24331 00002A34 F606[BD9D]02 test byte [DestInfo],2 ; test if wildcards (? or *) seen - 24332 00002A39 752C jnz short trypeel ; wildcard seen, peel filename - 24333 - 24334 ;mov ah,CHDir ; 3Bh - 24335 00002A3B B43B mov ah,3Bh - 24336 00002A3D CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 24337 ; DS:DX -> ASCIZ directory name (may include drive) - 24338 ; MSDOS 6.0 - 24339 00002A3F 7313 jnc short chdir_worked ;AN022; no error - continue - 24340 - 24341 00002A41 E807F6 call get_ext_error_number ;AN022; get the extended error - 24342 00002A44 83F803 cmp ax,ERROR_PATH_NOT_FOUND ;AN022; if path not found - 24343 00002A47 741E je short trypeel ;AC022; keep trying - 24344 00002A49 83F805 cmp ax,ERROR_ACCESS_DENIED ;AN022; if access denied - 24345 00002A4C 7419 je short trypeel ;AC022; keep trying - 24346 00002A4E A3[349F] mov [Msg_Numb],ax ;AN022; set up message flag - 24347 00002A51 E99D00 jmp peelfail ;AN022; exit with other error - 24348 - 24349 ; MSDOS 3.3 - 24350 ;jc short trypeel - 24351 chdir_worked: - 24352 ; MSDOS 3.3 (& MSDOS 6.0) - 24353 00002A54 E8BD06 call SetRest1 ; set 'Restore Directory' flag true - 24354 00002A57 B03F mov al,'?' ; if pure dir, wildcard filename in FCB - 24355 00002A59 BF5D00 mov di,5Dh ; FCB+1 - 24356 00002A5C B90B00 mov cx,11 - 24357 00002A5F F3AA rep stosb - 24358 00002A61 30C0 xor al,al ; return carry clear, zero set - 24359 00002A63 C3 retn - 24360 - 24361 pcrunch_cderrj: ;AN022; need this for long jmp - 24362 00002A64 E98200 jmp pcrunch_cderr ;AN022; + 24330 ; DX = ptr to pathname, NULL-terminated + 24331 ; PathPos = ptr to byte after NULL at end of pathname + 24332 + 24333 ; MSDOS 3.3 (& MSDOS 6.0) + 24334 00002A34 F606[BD9D]02 test byte [DestInfo],2 ; test if wildcards (? or *) seen + 24335 00002A39 752C jnz short trypeel ; wildcard seen, peel filename + 24336 + 24337 ;mov ah,CHDir ; 3Bh + 24338 00002A3B B43B mov ah,3Bh + 24339 00002A3D CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 24340 ; DS:DX -> ASCIZ directory name (may include drive) + 24341 ; MSDOS 6.0 + 24342 00002A3F 7313 jnc short chdir_worked ;AN022; no error - continue + 24343 + 24344 00002A41 E807F6 call get_ext_error_number ;AN022; get the extended error + 24345 00002A44 83F803 cmp ax,ERROR_PATH_NOT_FOUND ;AN022; if path not found + 24346 00002A47 741E je short trypeel ;AC022; keep trying + 24347 00002A49 83F805 cmp ax,ERROR_ACCESS_DENIED ;AN022; if access denied + 24348 00002A4C 7419 je short trypeel ;AC022; keep trying + 24349 00002A4E A3[349F] mov [Msg_Numb],ax ;AN022; set up message flag + 24350 00002A51 E99D00 jmp peelfail ;AN022; exit with other error + 24351 + 24352 ; MSDOS 3.3 + 24353 ;jc short trypeel + 24354 chdir_worked: + 24355 ; MSDOS 3.3 (& MSDOS 6.0) + 24356 00002A54 E8BD06 call SetRest1 ; set 'Restore Directory' flag true + 24357 00002A57 B03F mov al,'?' ; if pure dir, wildcard filename in FCB + 24358 00002A59 BF5D00 mov di,5Dh ; FCB+1 + 24359 00002A5C B90B00 mov cx,11 + 24360 00002A5F F3AA rep stosb + 24361 00002A61 30C0 xor al,al ; return carry clear, zero set + 24362 00002A63 C3 retn 24363 - 24364 trypeel: - 24365 00002A67 8B36[8F9D] mov si,[PathPos] - 24366 00002A6B 4E dec si ; SI = ptr to NULL at end of pathname - 24367 00002A6C 8A44FF mov al,[si-1] ; AL = last char of pathname - 24368 ; 25/02/2023 - 24369 ; MSDOS 5.0 (& 6.0) - 24370 00002A6F 803E[4F9F]00 cmp byte [KPARSE],0 - 24371 00002A74 7505 jnz short delstrt ; Last char is 2nd KANJI byte, might be '\' - 24372 - 24373 00002A76 E89BFF call pathchrcmp - 24374 00002A79 7476 jz short peelfail ; Trailing '/' - 24375 delstrt: - 24376 00002A7B 89F1 mov cx,si ; CX = ptr to NULL at end of pathname - 24377 00002A7D 89D6 mov si,dx ; SI = ptr to start of pathname - 24378 00002A7F 52 push dx ; save ptr to pathname - 24379 delloop: - 24380 00002A80 39CE cmp si,cx - 24381 ;jz short BADRET - 24382 ; 25/02/2023 - 24383 00002A82 7413 je short gotdele ; no char's left, we have what we have - 24384 00002A84 AC lodsb ; AL = next char of pathname - 24385 00002A85 E8D9FC call testkanj - 24386 00002A88 7403 jz short notkanj8 ; not Kanji, move along - 24387 00002A8A 46 inc si - 24388 00002A8B EBF3 jmp short delloop - 24389 - 24390 ; 25/02/2023 - 24391 ; MSDOS 3.3 - 24392 ;mov al,[si] - 24393 ;call PATHCHRCMP - 24394 ;jz short TRYCD - 24395 ;dec si - 24396 ;jmp short delloop - 24397 - 24398 notkanj8: - 24399 00002A8D E884FF call pathchrcmp - 24400 00002A90 75EE jnz short delloop ; not a path delimiter, keep looking - 24401 00002A92 89F2 mov dx,si - 24402 00002A94 4A dec dx ; DX = ptr to last delimiter found - 24403 00002A95 EBE9 jmp short delloop ; go look for more - 24404 - 24405 ; 25/02/2023 - 24406 ; MSDOS 5.0 (& 6.0) - 24407 gotdele: - 24408 00002A97 89D6 mov si,dx ; SI = ptr to pathname or last delim - 24409 00002A99 5A pop dx ; DX = ptr to pathname - 24410 00002A9A 39D6 cmp si,dx - 24411 00002A9C 7455 je short badret ; didn't find path delim - 24412 00002A9E 89F1 mov cx,si ; CX = ptr to last path delimiter - 24413 00002AA0 89D6 mov si,dx ; SI = ptr to pathname - 24414 delloop2: ; Set value of KPARSE - 24415 00002AA2 39CE cmp si,cx - 24416 00002AA4 7412 je short trycd ; roll up till SI meets CX - 24417 00002AA6 C606[4F9F]00 mov byte [KPARSE],0 - 24418 00002AAB AC lodsb - 24419 00002AAC E8B2FC call testkanj - 24420 00002AAF 74F1 jz short delloop2 - 24421 00002AB1 46 inc si - 24422 00002AB2 FE06[4F9F] inc byte [KPARSE] - 24423 00002AB6 EBEA jmp short delloop2 - 24424 - 24425 trycd: - 24426 00002AB8 50 push ax - 24427 ; 25/02/2023 - 24428 00002AB9 B02E mov al,'.' - 24429 ;mov al,[DOT_CHR] ; AL = '.' - 24430 ; MSDOS 6.0 - 24431 00002ABB 384401 cmp [si+1],al ; check for '.' after path delim - 24432 ;M019; allow continuation if '. ' or - 24433 ;M019; '..' is not found. - 24434 00002ABE 7509 jne short trycd1 ;M019; '.' not found - 24435 00002AC0 384402 cmp [si+2],al ;M019; check for '..' - 24436 00002AC3 7404 je short trycd1 ;M019; found '..' - 24437 00002AC5 807C0200 cmp byte [si+2],0 ;M019; check for '. ' (null terminated) - 24438 trycd1: - 24439 00002AC9 58 pop ax - 24440 00002ACA 7425 jz short peelfail ; if . or .., pure cd should have worked - 24441 - 24442 ; 25/02/2023 - 24443 ; MSDOS 3.3 - 24444 ;cmp [si+1], al ; check for '.' after path delim - 24445 ;pop ax - 24446 ;jz short PEELFAIL ; if . or .., pure cd should have worked - 24447 - 24448 ; MSDOS 3.3 (& MSDOS 6.0) - 24449 00002ACC 8A44FF mov al,[si-1] - 24450 00002ACF 3C3A cmp al,':' ; Special case d:\file - 24451 00002AD1 7420 je short badret - 24452 ; 25/02/2023 - 24453 ; MSDOS 6.0 - 24454 00002AD3 803E[4F9F]00 cmp byte [KPARSE],0 - 24455 00002AD8 7505 jnz short notdoublesl - 24456 00002ADA E837FF call pathchrcmp - 24457 ;jnz short notdoublesl - 24458 ; Last char is 2nd KANJI byte, might be '\' - 24459 ; 25/02/2023 - 24460 00002ADD 7412 jz short peelfail - 24461 ;peelfail: - 24462 ;stc - 24463 ;retn - 24464 - 24465 notdoublesl: - 24466 00002ADF C60400 mov byte [si],0 - 24467 ;mov ah,CHDir ; 3Bh - 24468 00002AE2 B43B mov ah,3Bh - 24469 ;int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 24470 ; DS:DX -> ASCIZ directory name (may include drive) - 24471 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 24472 00002AE4 E8D3DA call int_21h_indirect - 24473 00002AE7 7321 jnc short cdsucc - 24474 - 24475 ; 25/02/2023 - 24476 ; MSDOS 6.0 - 24477 pcrunch_cderr: - 24478 00002AE9 E85FF5 call get_ext_error_number - 24479 ;AN022; get the extended error - 24480 00002AEC A3[349F] mov [Msg_Numb],ax ;AN022; set up message flag - 24481 00002AEF 09F6 or si,si ;AN022; set up zero flag to not zero - 24482 peelfail: ; 25/02/2023 - 24483 00002AF1 F9 stc ;AN022; set up carry flag - 24484 pcrunch_retn: - 24485 00002AF2 C3 retn - 24486 - 24487 badret: - 24488 ; MSDOS 3.3 & MSDOS 6.0 - 24489 00002AF3 8A04 mov al,[si] - 24490 00002AF5 E81CFF call pathchrcmp ; Special case 'DIRCHAR'file - 24491 00002AF8 F9 stc - 24492 00002AF9 75F7 jnz short pcrunch_retn - 24493 00002AFB 30DB xor bl,bl - 24494 00002AFD 865C01 xchg bl,[si+1] - 24495 ;mov ah,CHDir ; 3Bh - 24496 00002B00 B43B mov ah,3Bh - 24497 ;int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 24498 ; DS:DX -> ASCIZ directory name (may include drive) - 24499 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 24500 00002B02 E8B5DA call int_21h_indirect - 24501 ;jc short pcrunch_retn ; MSDOS 3.3 - 24502 ; 25/02/2023 - 24503 00002B05 72E2 jc short pcrunch_cderr - 24504 ;AN022; go to error exit - 24505 00002B07 885C01 mov [si+1],bl - 24506 cdsucc: - 24507 00002B0A E80706 call SetRest1 - 24508 00002B0D 46 inc si ; Reset zero - 24509 00002B0E 8936[BB9D] mov [DestTail],si - 24510 ; 25/02/2023 - 24511 ; MSDOS 6.0 - 24512 00002B12 9C pushf ;AN015; save flags - 24513 00002B13 803E[979D]FF cmp byte [DirFlag],-1 - 24514 ;AN015; don't do parse if in DIR - 24515 00002B18 7408 je short pcrunch_end - 24516 ;AN015; - 24517 ; MSDOS 3.3 & MSDOS 6.0 - 24518 00002B1A BF5C00 mov di,FCB ; 5Ch - 24519 ;mov ax,(Parse_File_Descriptor<<8)|2 ; 2902h - 24520 00002B1D B80229 mov ax,2902h - 24521 00002B20 CD21 int 21h ; Parse with default drive - 24522 ; DOS - PARSE FILENAME - 24523 ; DS:SI -> string to parse - 24524 ; ES:DI -> buffer to fill with unopened FCB - 24525 ; AL = bit mask to control parsing - 24526 ; MSDOS 3.3 - 24527 ;retn - 24528 - 24529 pcrunch_end: - 24530 00002B22 9D popf ;AN015; get flags back - 24531 00002B23 C3 retn - 24532 - 24533 ; =============== S U B R O U T I N E ======================================= - 24534 - 24535 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM - 24536 ; PCDOS 7.1 COMMAND.COM - 24537 %if 1 - 24538 ;ifdef DBCS - 24539 ; - 24540 ; Check if the character position is at Tail Byte of DBCS - 24541 ; - 24542 ; input: ds:si = start address of the string - 24543 ; ds:di = character position to check - 24544 ; output: ZF = 1 if at Tail Byte - 24545 ; - 24546 ;CheckDBCSTailByte proc near - 24547 CheckDBCSTailByte: - 24548 00002B24 50 push ax - 24549 00002B25 51 push cx - 24550 00002B26 57 push di - 24551 00002B27 89F9 mov cx,di ; save character position - 24552 cdtb_check: - 24553 00002B29 39F7 cmp di,si - 24554 00002B2B 7409 jz short cdtb_next ; if at the top - 24555 00002B2D 4F dec di ; go back - 24556 00002B2E 8A05 mov al,[di] ; get character - 24557 ;invoke testkanj - 24558 00002B30 E82EFC call testkanj - 24559 00002B33 75F4 jnz short cdtb_check ; if DBCS lead byte do next - 24560 00002B35 47 inc di ; adjust - 24561 cdtb_next: - 24562 00002B36 29F9 sub cx,di ; if the length is odd then - 24563 00002B38 80F101 xor cl,1 ; the character position is - 24564 00002B3B F6C101 test cl,1 ; at the tail byte - 24565 00002B3E 5F pop di - 24566 00002B3F 59 pop cx - 24567 00002B40 58 pop ax - 24568 00002B41 C3 retn - 24569 ;CheckDBCSTailByte endp - 24570 ;endif - 24571 %endif - 24572 - 24573 ;============================================================================ - 24574 ; TMISC1.ASM, MSDOS 6.0, 1991 - 24575 ;============================================================================ - 24576 ; 05/10/2018 - Retro DOS v3.0 - 24577 - 24578 ;TITLE Part7 COMMAND Transient Routines - 24579 - 24580 ; More misc routines - 24581 - 24582 ;--------------------------- - 24583 ; We can get rid of this switch processing code if we can take - 24584 ; care of the remaining two calls to switch, later in the file. - 24585 ; However, I have not checked whether or not any other files use - 24586 ; switch -- after all, it IS public! - 24587 ;--------------------------- - 24588 - 24589 ; 14/06/2023 - 24590 SWCOUNT EQU 8 ; MSDOS 6.22 ; Length of switch_list - 24591 ; 28/03/2023 - 24592 ;SWCOUNT EQU 6 ; MSDOS 6.0 (& MSDOS 5.0) - 24593 ;;SWCOUNT EQU 5 ; MSDOS 3.3 - 24594 - 24595 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1AC2h - 24596 - 24597 ; 25/02/2023 - Retro DOS v4.0 (& v4.1) - 24598 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2869h + 24364 pcrunch_cderrj: ;AN022; need this for long jmp + 24365 00002A64 E98200 jmp pcrunch_cderr ;AN022; + 24366 + 24367 trypeel: + 24368 00002A67 8B36[8F9D] mov si,[PathPos] + 24369 00002A6B 4E dec si ; SI = ptr to NULL at end of pathname + 24370 00002A6C 8A44FF mov al,[si-1] ; AL = last char of pathname + 24371 ; 25/02/2023 + 24372 ; MSDOS 5.0 (& 6.0) + 24373 00002A6F 803E[4F9F]00 cmp byte [KPARSE],0 + 24374 00002A74 7505 jnz short delstrt ; Last char is 2nd KANJI byte, might be '\' + 24375 + 24376 00002A76 E89BFF call pathchrcmp + 24377 00002A79 7476 jz short peelfail ; Trailing '/' + 24378 delstrt: + 24379 00002A7B 89F1 mov cx,si ; CX = ptr to NULL at end of pathname + 24380 00002A7D 89D6 mov si,dx ; SI = ptr to start of pathname + 24381 00002A7F 52 push dx ; save ptr to pathname + 24382 delloop: + 24383 00002A80 39CE cmp si,cx + 24384 ;jz short BADRET + 24385 ; 25/02/2023 + 24386 00002A82 7413 je short gotdele ; no char's left, we have what we have + 24387 00002A84 AC lodsb ; AL = next char of pathname + 24388 00002A85 E8D9FC call testkanj + 24389 00002A88 7403 jz short notkanj8 ; not Kanji, move along + 24390 00002A8A 46 inc si + 24391 00002A8B EBF3 jmp short delloop + 24392 + 24393 ; 25/02/2023 + 24394 ; MSDOS 3.3 + 24395 ;mov al,[si] + 24396 ;call PATHCHRCMP + 24397 ;jz short TRYCD + 24398 ;dec si + 24399 ;jmp short delloop + 24400 + 24401 notkanj8: + 24402 00002A8D E884FF call pathchrcmp + 24403 00002A90 75EE jnz short delloop ; not a path delimiter, keep looking + 24404 00002A92 89F2 mov dx,si + 24405 00002A94 4A dec dx ; DX = ptr to last delimiter found + 24406 00002A95 EBE9 jmp short delloop ; go look for more + 24407 + 24408 ; 25/02/2023 + 24409 ; MSDOS 5.0 (& 6.0) + 24410 gotdele: + 24411 00002A97 89D6 mov si,dx ; SI = ptr to pathname or last delim + 24412 00002A99 5A pop dx ; DX = ptr to pathname + 24413 00002A9A 39D6 cmp si,dx + 24414 00002A9C 7455 je short badret ; didn't find path delim + 24415 00002A9E 89F1 mov cx,si ; CX = ptr to last path delimiter + 24416 00002AA0 89D6 mov si,dx ; SI = ptr to pathname + 24417 delloop2: ; Set value of KPARSE + 24418 00002AA2 39CE cmp si,cx + 24419 00002AA4 7412 je short trycd ; roll up till SI meets CX + 24420 00002AA6 C606[4F9F]00 mov byte [KPARSE],0 + 24421 00002AAB AC lodsb + 24422 00002AAC E8B2FC call testkanj + 24423 00002AAF 74F1 jz short delloop2 + 24424 00002AB1 46 inc si + 24425 00002AB2 FE06[4F9F] inc byte [KPARSE] + 24426 00002AB6 EBEA jmp short delloop2 + 24427 + 24428 trycd: + 24429 00002AB8 50 push ax + 24430 ; 25/02/2023 + 24431 00002AB9 B02E mov al,'.' + 24432 ;mov al,[DOT_CHR] ; AL = '.' + 24433 ; MSDOS 6.0 + 24434 00002ABB 384401 cmp [si+1],al ; check for '.' after path delim + 24435 ;M019; allow continuation if '. ' or + 24436 ;M019; '..' is not found. + 24437 00002ABE 7509 jne short trycd1 ;M019; '.' not found + 24438 00002AC0 384402 cmp [si+2],al ;M019; check for '..' + 24439 00002AC3 7404 je short trycd1 ;M019; found '..' + 24440 00002AC5 807C0200 cmp byte [si+2],0 ;M019; check for '. ' (null terminated) + 24441 trycd1: + 24442 00002AC9 58 pop ax + 24443 00002ACA 7425 jz short peelfail ; if . or .., pure cd should have worked + 24444 + 24445 ; 25/02/2023 + 24446 ; MSDOS 3.3 + 24447 ;cmp [si+1], al ; check for '.' after path delim + 24448 ;pop ax + 24449 ;jz short PEELFAIL ; if . or .., pure cd should have worked + 24450 + 24451 ; MSDOS 3.3 (& MSDOS 6.0) + 24452 00002ACC 8A44FF mov al,[si-1] + 24453 00002ACF 3C3A cmp al,':' ; Special case d:\file + 24454 00002AD1 7420 je short badret + 24455 ; 25/02/2023 + 24456 ; MSDOS 6.0 + 24457 00002AD3 803E[4F9F]00 cmp byte [KPARSE],0 + 24458 00002AD8 7505 jnz short notdoublesl + 24459 00002ADA E837FF call pathchrcmp + 24460 ;jnz short notdoublesl + 24461 ; Last char is 2nd KANJI byte, might be '\' + 24462 ; 25/02/2023 + 24463 00002ADD 7412 jz short peelfail + 24464 ;peelfail: + 24465 ;stc + 24466 ;retn + 24467 + 24468 notdoublesl: + 24469 00002ADF C60400 mov byte [si],0 + 24470 ;mov ah,CHDir ; 3Bh + 24471 00002AE2 B43B mov ah,3Bh + 24472 ;int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 24473 ; DS:DX -> ASCIZ directory name (may include drive) + 24474 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 24475 00002AE4 E8D3DA call int_21h_indirect + 24476 00002AE7 7321 jnc short cdsucc + 24477 + 24478 ; 25/02/2023 + 24479 ; MSDOS 6.0 + 24480 pcrunch_cderr: + 24481 00002AE9 E85FF5 call get_ext_error_number + 24482 ;AN022; get the extended error + 24483 00002AEC A3[349F] mov [Msg_Numb],ax ;AN022; set up message flag + 24484 00002AEF 09F6 or si,si ;AN022; set up zero flag to not zero + 24485 peelfail: ; 25/02/2023 + 24486 00002AF1 F9 stc ;AN022; set up carry flag + 24487 pcrunch_retn: + 24488 00002AF2 C3 retn + 24489 + 24490 badret: + 24491 ; MSDOS 3.3 & MSDOS 6.0 + 24492 00002AF3 8A04 mov al,[si] + 24493 00002AF5 E81CFF call pathchrcmp ; Special case 'DIRCHAR'file + 24494 00002AF8 F9 stc + 24495 00002AF9 75F7 jnz short pcrunch_retn + 24496 00002AFB 30DB xor bl,bl + 24497 00002AFD 865C01 xchg bl,[si+1] + 24498 ;mov ah,CHDir ; 3Bh + 24499 00002B00 B43B mov ah,3Bh + 24500 ;int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 24501 ; DS:DX -> ASCIZ directory name (may include drive) + 24502 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 24503 00002B02 E8B5DA call int_21h_indirect + 24504 ;jc short pcrunch_retn ; MSDOS 3.3 + 24505 ; 25/02/2023 + 24506 00002B05 72E2 jc short pcrunch_cderr + 24507 ;AN022; go to error exit + 24508 00002B07 885C01 mov [si+1],bl + 24509 cdsucc: + 24510 00002B0A E80706 call SetRest1 + 24511 00002B0D 46 inc si ; Reset zero + 24512 00002B0E 8936[BB9D] mov [DestTail],si + 24513 ; 25/02/2023 + 24514 ; MSDOS 6.0 + 24515 00002B12 9C pushf ;AN015; save flags + 24516 00002B13 803E[979D]FF cmp byte [DirFlag],-1 + 24517 ;AN015; don't do parse if in DIR + 24518 00002B18 7408 je short pcrunch_end + 24519 ;AN015; + 24520 ; MSDOS 3.3 & MSDOS 6.0 + 24521 00002B1A BF5C00 mov di,FCB ; 5Ch + 24522 ;mov ax,(Parse_File_Descriptor<<8)|2 ; 2902h + 24523 00002B1D B80229 mov ax,2902h + 24524 00002B20 CD21 int 21h ; Parse with default drive + 24525 ; DOS - PARSE FILENAME + 24526 ; DS:SI -> string to parse + 24527 ; ES:DI -> buffer to fill with unopened FCB + 24528 ; AL = bit mask to control parsing + 24529 ; MSDOS 3.3 + 24530 ;retn + 24531 + 24532 pcrunch_end: + 24533 00002B22 9D popf ;AN015; get flags back + 24534 00002B23 C3 retn + 24535 + 24536 ; =============== S U B R O U T I N E ======================================= + 24537 + 24538 ; 01/08/2024 - Retro DOS v5.0 COMMAND.COM + 24539 ; PCDOS 7.1 COMMAND.COM + 24540 %if 1 + 24541 ;ifdef DBCS + 24542 ; + 24543 ; Check if the character position is at Tail Byte of DBCS + 24544 ; + 24545 ; input: ds:si = start address of the string + 24546 ; ds:di = character position to check + 24547 ; output: ZF = 1 if at Tail Byte + 24548 ; + 24549 ;CheckDBCSTailByte proc near + 24550 CheckDBCSTailByte: + 24551 00002B24 50 push ax + 24552 00002B25 51 push cx + 24553 00002B26 57 push di + 24554 00002B27 89F9 mov cx,di ; save character position + 24555 cdtb_check: + 24556 00002B29 39F7 cmp di,si + 24557 00002B2B 7409 jz short cdtb_next ; if at the top + 24558 00002B2D 4F dec di ; go back + 24559 00002B2E 8A05 mov al,[di] ; get character + 24560 ;invoke testkanj + 24561 00002B30 E82EFC call testkanj + 24562 00002B33 75F4 jnz short cdtb_check ; if DBCS lead byte do next + 24563 00002B35 47 inc di ; adjust + 24564 cdtb_next: + 24565 00002B36 29F9 sub cx,di ; if the length is odd then + 24566 00002B38 80F101 xor cl,1 ; the character position is + 24567 00002B3B F6C101 test cl,1 ; at the tail byte + 24568 00002B3E 5F pop di + 24569 00002B3F 59 pop cx + 24570 00002B40 58 pop ax + 24571 00002B41 C3 retn + 24572 ;CheckDBCSTailByte endp + 24573 ;endif + 24574 %endif + 24575 + 24576 ;============================================================================ + 24577 ; TMISC1.ASM, MSDOS 6.0, 1991 + 24578 ;============================================================================ + 24579 ; 05/10/2018 - Retro DOS v3.0 + 24580 + 24581 ;TITLE Part7 COMMAND Transient Routines + 24582 + 24583 ; More misc routines + 24584 + 24585 ;--------------------------- + 24586 ; We can get rid of this switch processing code if we can take + 24587 ; care of the remaining two calls to switch, later in the file. + 24588 ; However, I have not checked whether or not any other files use + 24589 ; switch -- after all, it IS public! + 24590 ;--------------------------- + 24591 + 24592 ; 14/06/2023 + 24593 SWCOUNT EQU 8 ; MSDOS 6.22 ; Length of switch_list + 24594 ; 28/03/2023 + 24595 ;SWCOUNT EQU 6 ; MSDOS 6.0 (& MSDOS 5.0) + 24596 ;;SWCOUNT EQU 5 ; MSDOS 3.3 + 24597 + 24598 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1AC2h 24599 - 24600 ; --------------------------------------------------------------------------- - 24601 - 24602 ; 25/02/2023 - 24603 RETSW: - 24604 00002B42 93 xchg ax,bx ; Put switches in AX - 24605 00002B43 C3 retn - 24606 - 24607 ; =============== S U B R O U T I N E ======================================= - 24608 - 24609 ; 25/02/2023 - Retro DOS v4.0 COMMAND.COM - 24610 ; 11/06/2023 - Retro DOS 4.2 COMMAND.COM - 24611 ; 04/08/2024 - Retro DOS 5.0 COMMAND.COM - 24612 SWITCH: - 24613 00002B44 31DB xor bx,bx ; Initialize - no switches set - 24614 SWLOOP: - 24615 00002B46 E83DFE call scanoff ; Skip any delimiters - 24616 00002B49 3A06[F99B] cmp al,[SWITCHAR] ; Is it a switch specifier? - 24617 00002B4D 75F3 jnz short RETSW ; No -- we're finished - 24618 00002B4F 81CB0080 or bx,8000h - 24619 ;or bx,FSWITCH ; Indicate there is a switch specified - 24620 00002B53 46 inc si ; Skip over the switch character - 24621 00002B54 E82FFE call scanoff - 24622 00002B57 3C0D cmp al,0Dh - 24623 00002B59 74E7 je short RETSW ; Oops - 24624 00002B5B 46 inc si - 24625 - 24626 ; Convert lower case input to upper case - 24627 - 24628 00002B5C E82CFC call UPCONV - 24629 ;call UPCONV_MAPCALL ; MSDOS 3.3 + 24600 ; 25/02/2023 - Retro DOS v4.0 (& v4.1) + 24601 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2869h + 24602 + 24603 ; --------------------------------------------------------------------------- + 24604 + 24605 ; 25/02/2023 + 24606 RETSW: + 24607 00002B42 93 xchg ax,bx ; Put switches in AX + 24608 00002B43 C3 retn + 24609 + 24610 ; =============== S U B R O U T I N E ======================================= + 24611 + 24612 ; 25/02/2023 - Retro DOS v4.0 COMMAND.COM + 24613 ; 11/06/2023 - Retro DOS 4.2 COMMAND.COM + 24614 ; 04/08/2024 - Retro DOS 5.0 COMMAND.COM + 24615 SWITCH: + 24616 00002B44 31DB xor bx,bx ; Initialize - no switches set + 24617 SWLOOP: + 24618 00002B46 E83DFE call scanoff ; Skip any delimiters + 24619 00002B49 3A06[F99B] cmp al,[SWITCHAR] ; Is it a switch specifier? + 24620 00002B4D 75F3 jnz short RETSW ; No -- we're finished + 24621 00002B4F 81CB0080 or bx,8000h + 24622 ;or bx,FSWITCH ; Indicate there is a switch specified + 24623 00002B53 46 inc si ; Skip over the switch character + 24624 00002B54 E82FFE call scanoff + 24625 00002B57 3C0D cmp al,0Dh + 24626 00002B59 74E7 je short RETSW ; Oops + 24627 00002B5B 46 inc si + 24628 + 24629 ; Convert lower case input to upper case 24630 - 24631 00002B5F BF[D095] mov di,switch_list ; "-Y?VBAPW" (for PCDOS 7.1) ; 04/08/2024 - 24632 ; "-Y?VBAPW" (for MSDOS 6.22) ; 11/06/2023 - 24633 ; "?VBAPW" (for MSDOS 6.0) - 24634 ; ("VBAPW" (for MSDOS 3.3)) - 24635 ; 11/06/2023 - 24636 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2E33h - 24637 00002B62 B90800 mov cx,8 ; MSDOS 6.22 - 24638 ;mov cx,6 ; MSDOS 6.0 (& MSDOS 5.0) - 24639 ;;mov cx,5 ; MSDOS 3.3 - 24640 ;;mov cx,SWCOUNT ; 5 (for MSDOS 3.3), (6 (for MSDOS 6.0)) - 24641 - 24642 ;nop - 24643 - 24644 00002B65 F2AE repne scasb ; Look for matching switch - 24645 00002B67 7507 jnz short BADSW - 24646 00002B69 B80100 mov ax,1 - 24647 00002B6C D3E0 shl ax,cl ; Set a bit for the switch - 24648 00002B6E 09C3 or bx,ax - 24649 BADSW: ; Retro DOS v3.0 COMMAND.COM modificiation - 24650 00002B70 EBD4 jmp short SWLOOP - 24651 ;BADSW: - 24652 ;jmp short SWLOOP - 24653 ;DRVBAD: - 24654 ; mov dx,baddrv_ptr - 24655 ; jmp cerror - 24656 EXTERNALJ: - 24657 00002B72 E90501 jmp EXTERNAL - 24658 FNDCOM: ; search the internal command table - 24659 00002B75 08C0 or al,al ; Get real length of first arg - 24660 00002B77 74F9 jz short EXTERNALJ ; If 0, it must begin with "\" so has - 24661 ; to be external. - 24662 ; barryf code starts here - 24663 - 24664 00002B79 E89203 call test_append ; see if APPEND installed - 24665 00002B7C 7429 jz short CONTCOM ; not loaded + 24631 00002B5C E82CFC call UPCONV + 24632 ;call UPCONV_MAPCALL ; MSDOS 3.3 + 24633 + 24634 00002B5F BF[D095] mov di,switch_list ; "-Y?VBAPW" (for PCDOS 7.1) ; 04/08/2024 + 24635 ; "-Y?VBAPW" (for MSDOS 6.22) ; 11/06/2023 + 24636 ; "?VBAPW" (for MSDOS 6.0) + 24637 ; ("VBAPW" (for MSDOS 3.3)) + 24638 ; 11/06/2023 + 24639 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2E33h + 24640 00002B62 B90800 mov cx,8 ; MSDOS 6.22 + 24641 ;mov cx,6 ; MSDOS 6.0 (& MSDOS 5.0) + 24642 ;;mov cx,5 ; MSDOS 3.3 + 24643 ;;mov cx,SWCOUNT ; 5 (for MSDOS 3.3), (6 (for MSDOS 6.0)) + 24644 + 24645 ;nop + 24646 + 24647 00002B65 F2AE repne scasb ; Look for matching switch + 24648 00002B67 7507 jnz short BADSW + 24649 00002B69 B80100 mov ax,1 + 24650 00002B6C D3E0 shl ax,cl ; Set a bit for the switch + 24651 00002B6E 09C3 or bx,ax + 24652 BADSW: ; Retro DOS v3.0 COMMAND.COM modificiation + 24653 00002B70 EBD4 jmp short SWLOOP + 24654 ;BADSW: + 24655 ;jmp short SWLOOP + 24656 ;DRVBAD: + 24657 ; mov dx,baddrv_ptr + 24658 ; jmp cerror + 24659 EXTERNALJ: + 24660 00002B72 E90501 jmp EXTERNAL + 24661 FNDCOM: ; search the internal command table + 24662 00002B75 08C0 or al,al ; Get real length of first arg + 24663 00002B77 74F9 jz short EXTERNALJ ; If 0, it must begin with "\" so has + 24664 ; to be external. + 24665 ; barryf code starts here 24666 - 24667 APPEND_INTERNAL: - 24668 00002B7E 8A0E[BA9C] mov cl,[IDLEN] - 24669 00002B82 B500 mov ch,0 - 24670 00002B84 890E[8F9D] mov [PathPos],cx - 24671 - 24672 ; 25/02/2023 - 24673 ; MSDOS 6.0 - 24674 00002B88 FE06[369F] inc byte [append_exec] - 24675 ;AN041; set APPEND to ON - 24676 00002B8C E82104 call IOSET ; re-direct the o'l io - 24677 - 24678 00002B8F BE[BA9C] mov si,IDLEN ; address command name, DS already set - 24679 00002B92 BAFFFF mov dx,-1 ; 0FFFFh ; set invoke function - 24680 - 24681 ; MSDOS 6.0 - 24682 00002B95 BF[1254] mov di,append_parse - 24683 ;AN010; Get the entry point for PARSE for APPEND - 24684 ; MSDOS 3.3 (& MSDOS 6.0) - 24685 00002B98 B801AE mov ax,0AE01h - 24686 00002B9B CD2F int 2Fh ; - Multiplex - DOS 3.3+ internal - 24687 ; - INSTALLABLE COMMAND - EXECUTE - 24688 ; DX = FFFFh, DS:SI -> buffer - 24689 ; Return: buffer at DS:SI filled with a length byte - 24690 ; followed by the uppercase internal command - 24691 ; to execute (if length not 0) - 24692 ; 25/02/2023 - 24693 ; INT 2Fh - 24694 ; AX = AE01h - 24695 ; entry: - 24696 ; DX = magic value FFFFh - 24697 ; CH = 00h - 24698 ; CL = length of command name - 24699 ; DS:BX -> command line buffer -- (offset COMBUF) - 24700 ; DS:SI -> command name buffer -- (offset IDLEN) - 24701 ; return: - 24702 ; DS:SI buffer updated - 24703 ; if length byte is nonzero, the following bytes contain - 24704 ; the uppercase internal command to execute and the command line - 24705 ; buffer contains the command's parameters - 24706 ; (the first DS:[SI] bytes are ignored) - 24707 ; - 24708 ; Format of COMMAND.COM command line buffer: - 24709 ; Offset Size Description - 24710 ; 00h BYTE max length of command line, as in INT 21/AH=0Ah - 24711 ; 01h BYTE count of bytes to follow, excluding terminating 0Dh - 24712 ; N BYTEs command line text, terminated by 0Dh - 24713 ; - 24714 ; Format of command name buffer: - 24715 ; Offset Size Description - 24716 ; 00h BYTE length of command name - 24717 ; 01h N BYTEs uppercased command name (blank-padded to 11 chars) - 24718 - 24719 00002B9D 803E[BA9C]00 cmp byte [IDLEN],0 ; execute requested - 24720 00002BA2 7503 jne short CONTCOM - 24721 00002BA4 E9A300 jmp CMD_DONE - 24722 - 24723 ;nop - 24724 CONTCOM: ; continue with internal scan - 24725 00002BA7 BF[4F94] mov di,COMTAB - 24726 00002BAA 31C9 xor cx,cx - 24727 FINDCOM: - 24728 00002BAC BE[BB9C] mov si,ID ; pointer to command argument - 24729 00002BAF 8A0D mov cl,[di] ; load length of internal command - 24730 00002BB1 47 inc di ; advance past length - 24731 00002BB2 E3BE jcxz EXTERNALJ ; if it's zero, we're out of internals - 24732 00002BB4 3A0E[BA9C] cmp cl,[IDLEN] ; that of the command argument - 24733 00002BB8 7506 jne short ABCD ; lengths not equal ==> strings not eq - 24734 00002BBA 890E[8F9D] mov [PathPos],cx ; store length of command - 24735 00002BBE F3A6 repe cmpsb - 24736 ABCD: - 24737 00002BC0 9F lahf ; save the good ol' flags - 24738 00002BC1 01CF add di,cx ; skip over remaining internal, if any - 24739 00002BC3 8A05 mov al,[di] ; load drive-check indicator byte (DCIB) - 24740 00002BC5 A2[059C] mov [CHKDRV],al ; save command flag byte in chkdrv - 24741 00002BC8 47 inc di ; increment DI (OK, OK, I'll stop) - 24742 00002BC9 8B1D mov bx,[di] ; load internal command address - 24743 00002BCB 47 inc di ; skip over the puppy - 24744 00002BCC 47 inc di - 24745 - 24746 ; MSDOS 6.0 - 24747 00002BCD 8B15 mov dx,[di] ; load ptr to help msg #s - 24748 00002BCF 47 inc di - 24749 00002BD0 47 inc di - 24750 00002BD1 9E sahf ; remember those flags? - 24751 00002BD2 75D8 jnz short FINDCOM ; well, if all the cmps worked... - 24752 - 24753 ; All messages get redirected. - 24754 - 24755 00002BD4 803E[369F]00 cmp byte [append_exec],0 - 24756 ;AN041; APPEND just executed? - 24757 00002BD9 7503 jnz short DONT_SET_IO - 24758 ;AN041; Yes - this junk is already set - 24759 00002BDB E8D203 call IOSET ; re-direct the ol' i/o - 24760 - 24761 DONT_SET_IO: ;AN041; - 24762 - 24763 ; Check for /?. Certain commands, flagged fLimitHelp, - 24764 ; respond to /? only if it is the only command-line argument. + 24667 00002B79 E89203 call test_append ; see if APPEND installed + 24668 00002B7C 7429 jz short CONTCOM ; not loaded + 24669 + 24670 APPEND_INTERNAL: + 24671 00002B7E 8A0E[BA9C] mov cl,[IDLEN] + 24672 00002B82 B500 mov ch,0 + 24673 00002B84 890E[8F9D] mov [PathPos],cx + 24674 + 24675 ; 25/02/2023 + 24676 ; MSDOS 6.0 + 24677 00002B88 FE06[369F] inc byte [append_exec] + 24678 ;AN041; set APPEND to ON + 24679 00002B8C E82104 call IOSET ; re-direct the o'l io + 24680 + 24681 00002B8F BE[BA9C] mov si,IDLEN ; address command name, DS already set + 24682 00002B92 BAFFFF mov dx,-1 ; 0FFFFh ; set invoke function + 24683 + 24684 ; MSDOS 6.0 + 24685 00002B95 BF[1254] mov di,append_parse + 24686 ;AN010; Get the entry point for PARSE for APPEND + 24687 ; MSDOS 3.3 (& MSDOS 6.0) + 24688 00002B98 B801AE mov ax,0AE01h + 24689 00002B9B CD2F int 2Fh ; - Multiplex - DOS 3.3+ internal + 24690 ; - INSTALLABLE COMMAND - EXECUTE + 24691 ; DX = FFFFh, DS:SI -> buffer + 24692 ; Return: buffer at DS:SI filled with a length byte + 24693 ; followed by the uppercase internal command + 24694 ; to execute (if length not 0) + 24695 ; 25/02/2023 + 24696 ; INT 2Fh + 24697 ; AX = AE01h + 24698 ; entry: + 24699 ; DX = magic value FFFFh + 24700 ; CH = 00h + 24701 ; CL = length of command name + 24702 ; DS:BX -> command line buffer -- (offset COMBUF) + 24703 ; DS:SI -> command name buffer -- (offset IDLEN) + 24704 ; return: + 24705 ; DS:SI buffer updated + 24706 ; if length byte is nonzero, the following bytes contain + 24707 ; the uppercase internal command to execute and the command line + 24708 ; buffer contains the command's parameters + 24709 ; (the first DS:[SI] bytes are ignored) + 24710 ; + 24711 ; Format of COMMAND.COM command line buffer: + 24712 ; Offset Size Description + 24713 ; 00h BYTE max length of command line, as in INT 21/AH=0Ah + 24714 ; 01h BYTE count of bytes to follow, excluding terminating 0Dh + 24715 ; N BYTEs command line text, terminated by 0Dh + 24716 ; + 24717 ; Format of command name buffer: + 24718 ; Offset Size Description + 24719 ; 00h BYTE length of command name + 24720 ; 01h N BYTEs uppercased command name (blank-padded to 11 chars) + 24721 + 24722 00002B9D 803E[BA9C]00 cmp byte [IDLEN],0 ; execute requested + 24723 00002BA2 7503 jne short CONTCOM + 24724 00002BA4 E9A300 jmp CMD_DONE + 24725 + 24726 ;nop + 24727 CONTCOM: ; continue with internal scan + 24728 00002BA7 BF[4F94] mov di,COMTAB + 24729 00002BAA 31C9 xor cx,cx + 24730 FINDCOM: + 24731 00002BAC BE[BB9C] mov si,ID ; pointer to command argument + 24732 00002BAF 8A0D mov cl,[di] ; load length of internal command + 24733 00002BB1 47 inc di ; advance past length + 24734 00002BB2 E3BE jcxz EXTERNALJ ; if it's zero, we're out of internals + 24735 00002BB4 3A0E[BA9C] cmp cl,[IDLEN] ; that of the command argument + 24736 00002BB8 7506 jne short ABCD ; lengths not equal ==> strings not eq + 24737 00002BBA 890E[8F9D] mov [PathPos],cx ; store length of command + 24738 00002BBE F3A6 repe cmpsb + 24739 ABCD: + 24740 00002BC0 9F lahf ; save the good ol' flags + 24741 00002BC1 01CF add di,cx ; skip over remaining internal, if any + 24742 00002BC3 8A05 mov al,[di] ; load drive-check indicator byte (DCIB) + 24743 00002BC5 A2[059C] mov [CHKDRV],al ; save command flag byte in chkdrv + 24744 00002BC8 47 inc di ; increment DI (OK, OK, I'll stop) + 24745 00002BC9 8B1D mov bx,[di] ; load internal command address + 24746 00002BCB 47 inc di ; skip over the puppy + 24747 00002BCC 47 inc di + 24748 + 24749 ; MSDOS 6.0 + 24750 00002BCD 8B15 mov dx,[di] ; load ptr to help msg #s + 24751 00002BCF 47 inc di + 24752 00002BD0 47 inc di + 24753 00002BD1 9E sahf ; remember those flags? + 24754 00002BD2 75D8 jnz short FINDCOM ; well, if all the cmps worked... + 24755 + 24756 ; All messages get redirected. + 24757 + 24758 00002BD4 803E[369F]00 cmp byte [append_exec],0 + 24759 ;AN041; APPEND just executed? + 24760 00002BD9 7503 jnz short DONT_SET_IO + 24761 ;AN041; Yes - this junk is already set + 24762 00002BDB E8D203 call IOSET ; re-direct the ol' i/o + 24763 + 24764 DONT_SET_IO: ;AN041; 24765 - 24766 00002BDE A1[0B9C] mov ax,[COMSW] ; AX = switches after command - 24767 00002BE1 0B06[119C] or ax,[AllSwitch] ; AX = all switches - 24768 ;and ax,SwitchQues - 24769 00002BE5 83E020 and ax,20h - 24770 00002BE8 7426 jz short DRIVE_CHECK - 24771 ; /? not in command line - 24772 00002BEA F606[059C]04 test byte [CHKDRV],4 - 24773 ;test byte [CHKDRV],fLimitHelp - 24774 00002BEF 7407 jz short DO_HELP ; /? allowed in combination - 24775 - 24776 ; Make sure /? is the only argument on the command line. - 24777 - 24778 00002BF1 833E[10A2]02 cmp word [ARG+ARG_UNIT.argvcnt],2 - 24779 00002BF6 7518 jne short DRIVE_CHECK - 24780 ; /? not only arg - ignore - 24781 - 24782 ; Note: this is all the check we need, even against things like /??. - 24783 ; Our argv parser breaks /?? into two args, /? and ?. + 24766 ; Check for /?. Certain commands, flagged fLimitHelp, + 24767 ; respond to /? only if it is the only command-line argument. + 24768 + 24769 00002BDE A1[0B9C] mov ax,[COMSW] ; AX = switches after command + 24770 00002BE1 0B06[119C] or ax,[AllSwitch] ; AX = all switches + 24771 ;and ax,SwitchQues + 24772 00002BE5 83E020 and ax,20h + 24773 00002BE8 7426 jz short DRIVE_CHECK + 24774 ; /? not in command line + 24775 00002BEA F606[059C]04 test byte [CHKDRV],4 + 24776 ;test byte [CHKDRV],fLimitHelp + 24777 00002BEF 7407 jz short DO_HELP ; /? allowed in combination + 24778 + 24779 ; Make sure /? is the only argument on the command line. + 24780 + 24781 00002BF1 833E[10A2]02 cmp word [ARG+ARG_UNIT.argvcnt],2 + 24782 00002BF6 7518 jne short DRIVE_CHECK + 24783 ; /? not only arg - ignore 24784 - 24785 DO_HELP: - 24786 ; DX = ptr to word list of msg #s, terminated by zero word + 24785 ; Note: this is all the check we need, even against things like /??. + 24786 ; Our argv parser breaks /?? into two args, /? and ?. 24787 - 24788 00002BF8 89D6 mov si,dx ; SI = ptr to list of msg #s - 24789 ;mov ax,no_subst ; AL = no subst's code - 24790 00002BFA B80000 mov ax,0 - 24791 00002BFD 50 push ax ; build subst block on stack - 24792 - 24793 NEXT_HELP_MSG: - 24794 00002BFE AD lodsw ; AX = help msg # or zero - 24795 00002BFF 09C0 or ax,ax - 24796 00002C01 7409 jz short HELP_DONE - 24797 00002C03 50 push ax ; SS:SP = ptr to subst block - 24798 ; (msg # and no_subst byte) - 24799 ;; We assume DS = SS. - 24800 - 24801 00002C04 89E2 mov dx,sp ; DS:DX = ptr to subst block - 24802 00002C06 E81F28 call std_printf ; display help message - 24803 00002C09 58 pop ax ; remove msg # from stack - 24804 00002C0A EBF2 jmp short NEXT_HELP_MSG - 24805 - 24806 HELP_DONE: - 24807 00002C0C 58 pop ax ; clean up stack - 24808 00002C0D E9F4D4 jmp TCOMMAND - 24809 - 24810 ; 25/02/2023 - 24811 ; MSDOS 3.3 - 24812 ;sahf ; remember those flags? - 24813 ;jnz short FINDCOM ; well, if all the cmps worked... - 24814 ;call IOSET ; re-direct the ol' i/o - 24815 - 24816 DRIVE_CHECK: - 24817 00002C10 F606[059C]01 test byte [CHKDRV],1 - 24818 ;test byte [CHKDRV],FCHECKDRIVE - 24819 ; did we wanna check those drives? - 24820 00002C15 7411 jz short NOCHECK - 24821 00002C17 A0[089C] mov al,[PARM1] ; parse_file_descriptor results tell - 24822 00002C1A 0A06[0A9C] or al,[PARM2] ; us whether those drives were OK - 24823 00002C1E 3CFF cmp al,-1 - 24824 00002C20 7506 jne short NOCHECK - 24825 ;jmp DRVBAD - 24826 ; 25/02/2023 - 24827 DRVBAD: - 24828 00002C22 BA[6E90] mov dx,baddrv_ptr - 24829 00002C25 E9FE00 jmp cerror - 24830 - 24831 ; The user may have omitted the space between the command and its arguments. - 24832 ; We need to copy the remainder of the user's command line into the buffer. - 24833 ; Note that thisdoes not screw up the arg structure; it points into COMBUF not - 24834 ; into the command line at 80. - 24835 - 24836 NOCHECK: - 24837 00002C28 E8C602 call cmd_copy - 24838 SWITCHECK: - 24839 ;test byte [CHKDRV],2 - 24840 00002C2B F606[059C]02 test byte [CHKDRV],fSwitchAllowed - 24841 ; Does the command take switches - 24842 00002C30 7516 jnz short REALWORK ; Yes, process the command - 24843 00002C32 E82F00 call noswit ; No, check to see if any switches - 24844 00002C35 7511 jnz short REALWORK ; None, process the command - 24845 - 24846 ; MSDOS 6.0 - 24847 ;mov byte [msg_disp_class],2 - 24848 00002C37 C606[D58F]02 mov byte [msg_disp_class],parse_msg_class - 24849 ;AN000; set up parse error msg class - 24850 00002C3C BA[D78F] mov dx,extend_buf_ptr - 24851 ;AC000; get extended message pointer - 24852 ;mov word [extend_buf_ptr],3 - 24853 00002C3F C706[D78F]0300 mov word [extend_buf_ptr],BadSwt_Ptr - 24854 ;AN000; get "Invalid switch" message number - 24855 00002C45 E9DE00 jmp cerror ; Print error and chill out... - 24856 - 24857 ; 25/02/2023 - 24858 ; MSDOS 3.3 - 24859 ;mov dx,BADPARMPTR - 24860 ;jmp CERROR - 24861 - 24862 REALWORK: - 24863 00002C48 FFD3 call bx ; do some real work, at last + 24788 DO_HELP: + 24789 ; DX = ptr to word list of msg #s, terminated by zero word + 24790 + 24791 00002BF8 89D6 mov si,dx ; SI = ptr to list of msg #s + 24792 ;mov ax,no_subst ; AL = no subst's code + 24793 00002BFA B80000 mov ax,0 + 24794 00002BFD 50 push ax ; build subst block on stack + 24795 + 24796 NEXT_HELP_MSG: + 24797 00002BFE AD lodsw ; AX = help msg # or zero + 24798 00002BFF 09C0 or ax,ax + 24799 00002C01 7409 jz short HELP_DONE + 24800 00002C03 50 push ax ; SS:SP = ptr to subst block + 24801 ; (msg # and no_subst byte) + 24802 ;; We assume DS = SS. + 24803 + 24804 00002C04 89E2 mov dx,sp ; DS:DX = ptr to subst block + 24805 00002C06 E81F28 call std_printf ; display help message + 24806 00002C09 58 pop ax ; remove msg # from stack + 24807 00002C0A EBF2 jmp short NEXT_HELP_MSG + 24808 + 24809 HELP_DONE: + 24810 00002C0C 58 pop ax ; clean up stack + 24811 00002C0D E9F4D4 jmp TCOMMAND + 24812 + 24813 ; 25/02/2023 + 24814 ; MSDOS 3.3 + 24815 ;sahf ; remember those flags? + 24816 ;jnz short FINDCOM ; well, if all the cmps worked... + 24817 ;call IOSET ; re-direct the ol' i/o + 24818 + 24819 DRIVE_CHECK: + 24820 00002C10 F606[059C]01 test byte [CHKDRV],1 + 24821 ;test byte [CHKDRV],FCHECKDRIVE + 24822 ; did we wanna check those drives? + 24823 00002C15 7411 jz short NOCHECK + 24824 00002C17 A0[089C] mov al,[PARM1] ; parse_file_descriptor results tell + 24825 00002C1A 0A06[0A9C] or al,[PARM2] ; us whether those drives were OK + 24826 00002C1E 3CFF cmp al,-1 + 24827 00002C20 7506 jne short NOCHECK + 24828 ;jmp DRVBAD + 24829 ; 25/02/2023 + 24830 DRVBAD: + 24831 00002C22 BA[6E90] mov dx,baddrv_ptr + 24832 00002C25 E9FE00 jmp cerror + 24833 + 24834 ; The user may have omitted the space between the command and its arguments. + 24835 ; We need to copy the remainder of the user's command line into the buffer. + 24836 ; Note that thisdoes not screw up the arg structure; it points into COMBUF not + 24837 ; into the command line at 80. + 24838 + 24839 NOCHECK: + 24840 00002C28 E8C602 call cmd_copy + 24841 SWITCHECK: + 24842 ;test byte [CHKDRV],2 + 24843 00002C2B F606[059C]02 test byte [CHKDRV],fSwitchAllowed + 24844 ; Does the command take switches + 24845 00002C30 7516 jnz short REALWORK ; Yes, process the command + 24846 00002C32 E82F00 call noswit ; No, check to see if any switches + 24847 00002C35 7511 jnz short REALWORK ; None, process the command + 24848 + 24849 ; MSDOS 6.0 + 24850 ;mov byte [msg_disp_class],2 + 24851 00002C37 C606[D58F]02 mov byte [msg_disp_class],parse_msg_class + 24852 ;AN000; set up parse error msg class + 24853 00002C3C BA[D78F] mov dx,extend_buf_ptr + 24854 ;AC000; get extended message pointer + 24855 ;mov word [extend_buf_ptr],3 + 24856 00002C3F C706[D78F]0300 mov word [extend_buf_ptr],BadSwt_Ptr + 24857 ;AN000; get "Invalid switch" message number + 24858 00002C45 E9DE00 jmp cerror ; Print error and chill out... + 24859 + 24860 ; 25/02/2023 + 24861 ; MSDOS 3.3 + 24862 ;mov dx,BADPARMPTR + 24863 ;jmp CERROR 24864 - 24865 ; See if we're in a batch CALL command. If we are, reprocess the command line, - 24866 ; otherwise, go get another command. + 24865 REALWORK: + 24866 00002C48 FFD3 call bx ; do some real work, at last 24867 - 24868 CMD_DONE: - 24869 00002C4A 0E push cs ; g restore data segment - 24870 00002C4B 1F pop ds ; g - 24871 00002C4C 1E push ds - 24872 00002C4D 8E1E[F59B] mov ds,[RESSEG] ; g save data segment - 24873 ;cmp byte [Call_Flag],1 - 24874 ; G Is a call in progress? - 24875 00002C51 803E[B002]01 cmp byte [Call_Flag],call_in_progress - 24876 00002C56 C606[B002]00 mov byte [Call_Flag],0 - 24877 ; G Either way, reset flag - 24878 00002C5B 1F pop ds ; g get data segment back - 24879 00002C5C 7403 jz short INCALL ; G - 24880 00002C5E E9A3D4 jmp TCOMMAND ; chill out... - 24881 INCALL: - 24882 ;jmp DOCOM1 - 24883 ; 11/06/2023 - 24884 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM - 24885 00002C61 E991D6 jmp DOCOM0 - 24886 - 24887 ; =============== S U B R O U T I N E ======================================= - 24888 - 24889 ; 25/02/2023 - 24890 noswit: - 24891 00002C64 57 push di ; Save di - 24892 00002C65 BF8100 mov di,81h ; di = ptr to command args - 24893 00002C68 BE8000 mov si,80h ; Get address of length of command args - 24894 00002C6B AC lodsb ; Load length - 24895 00002C6C 88C1 mov cl,al ; Move length to cl - 24896 00002C6E 30ED xor ch,ch ; Zero ch - 24897 00002C70 2EA0[F99B] mov al,[cs:SWITCHAR] ; al = switch character - 24898 ;cmp al,0 ; Turn off ZF - 24899 ; 25/02/2023 - 24900 00002C74 20C0 and al,al - 24901 00002C76 F2AE repne scasb ; Scan for a switch character and return - 24902 00002C78 5F pop di ; with ZF set if one was found - 24903 00002C79 C3 retn - 24904 - 24905 ; --------------------------------------------------------------------------- - 24906 - 24907 ; 25/02/2023 - Retro DOS v4.0 COMMAND.COM - 24908 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:29A6h + 24868 ; See if we're in a batch CALL command. If we are, reprocess the command line, + 24869 ; otherwise, go get another command. + 24870 + 24871 CMD_DONE: + 24872 00002C4A 0E push cs ; g restore data segment + 24873 00002C4B 1F pop ds ; g + 24874 00002C4C 1E push ds + 24875 00002C4D 8E1E[F59B] mov ds,[RESSEG] ; g save data segment + 24876 ;cmp byte [Call_Flag],1 + 24877 ; G Is a call in progress? + 24878 00002C51 803E[B002]01 cmp byte [Call_Flag],call_in_progress + 24879 00002C56 C606[B002]00 mov byte [Call_Flag],0 + 24880 ; G Either way, reset flag + 24881 00002C5B 1F pop ds ; g get data segment back + 24882 00002C5C 7403 jz short INCALL ; G + 24883 00002C5E E9A3D4 jmp TCOMMAND ; chill out... + 24884 INCALL: + 24885 ;jmp DOCOM1 + 24886 ; 11/06/2023 + 24887 ; Retro DOS v4.2 - MSDOS 6.22 COMMAND.COM + 24888 00002C61 E991D6 jmp DOCOM0 + 24889 + 24890 ; =============== S U B R O U T I N E ======================================= + 24891 + 24892 ; 25/02/2023 + 24893 noswit: + 24894 00002C64 57 push di ; Save di + 24895 00002C65 BF8100 mov di,81h ; di = ptr to command args + 24896 00002C68 BE8000 mov si,80h ; Get address of length of command args + 24897 00002C6B AC lodsb ; Load length + 24898 00002C6C 88C1 mov cl,al ; Move length to cl + 24899 00002C6E 30ED xor ch,ch ; Zero ch + 24900 00002C70 2EA0[F99B] mov al,[cs:SWITCHAR] ; al = switch character + 24901 ;cmp al,0 ; Turn off ZF + 24902 ; 25/02/2023 + 24903 00002C74 20C0 and al,al + 24904 00002C76 F2AE repne scasb ; Scan for a switch character and return + 24905 00002C78 5F pop di ; with ZF set if one was found + 24906 00002C79 C3 retn + 24907 + 24908 ; --------------------------------------------------------------------------- 24909 - 24910 EXTERNAL: - 24911 00002C7A E89102 call test_append ; check to see if append installed - 24912 00002C7D 7403 jz short NOT_BARRYF - 24913 ; no - truly external command - 24914 00002C7F E9FCFE jmp APPEND_INTERNAL ; yes - go to Barryf code - 24915 - 24916 NOT_BARRYF: - 24917 00002C82 2EC606[069C]00 mov byte [cs:FILTYP],0 - 24918 00002C88 2E8A16[149C] mov dl,[cs:SPECDRV] - 24919 00002C8D 2E8816[BA9C] mov [cs:IDLEN],dl - 24920 00002C92 2EC606[B49D]00 mov byte [cs:ROM_CALL],0 - 24921 00002C98 52 push dx - 24922 00002C99 BA[BA9C] mov dx,IDLEN - 24923 00002C9C E834D8 call ROM_SCAN - 24924 00002C9F 5A pop dx - 24925 ;jnc short POSTSAVE - 24926 00002CA0 7305 jnc short DO_SCAN - 24927 00002CA2 2EFE06[B49D] inc byte [cs:ROM_CALL] - 24928 ;jmp short POSTSAVE - 24929 - 24930 ;nop - 24931 DO_SCAN: - 24932 POSTSAVE: - 24933 00002CA7 BF[1D9B] mov di,EXECPATH - 24934 00002CAA C60500 mov byte [di],0 ; Initialize to current directory - 24935 - 24936 00002CAD 2E803E[B49D]00 cmp byte [cs:ROM_CALL],0 - 24937 ;jz short RESEARCH - 24938 ; 25/02/2023 - 24939 ;jmp short NEOEXECUTE - 24940 00002CB3 7577 jnz short NEOEXECUTE - 24941 - 24942 ;nop - 24943 RESEARCH: - 24944 00002CB5 E8E808 call path_search ; find the mother (result in execpath) - 24945 00002CB8 09C0 or ax,ax ; did we find anything? - 24946 ;jz short BADCOMJ45 ; null means no (sob) - 24947 ; 25/02/2023 - 24948 00002CBA 7465 jz short BADCOM - 24949 00002CBC 83F804 cmp ax,4 ; 04H and 08H are .exe and .com - 24950 ; fuckin' sixteen-bit machine ought - 24951 ;jl short BATCOMJ ; to be able to handle a SIXTEEN-BIT - 24952 ; DISPLACEMENT!! - 24953 ;;jmp short NEOEXECUTE - 24954 ;jmp short EXECUTE - 24955 ; 25/02/2023 - 24956 00002CBF 7D6B jnl short EXECUTE ; jge - 24957 - 24958 ; 02H is .bat - 24959 - 24960 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 24961 ; PCDOS 7.1 COMMAND.COM - 24962 %if 1 - 24963 ; ... .BAT file ... - 24964 00002CC1 BA[1D9B] mov dx,EXECPATH - 24965 00002CC4 B8003D mov ax,3D00h - 24966 00002CC7 CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 24967 ; DS:DX -> ASCIZ filename - 24968 ; AL = access mode - 24969 ; 0 - read - 24970 00002CC9 7253 jb short BATCOMJ - 24971 00002CCB 8326[96A3]00 and word [TPBUF],0 ; clear 1st two bytes of the buffer - 24972 00002CD0 BA[96A3] mov dx,TPBUF - 24973 00002CD3 B90200 mov cx,2 - 24974 00002CD6 89C3 mov bx,ax - 24975 00002CD8 B43F mov ah,3Fh - 24976 00002CDA CD21 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE - 24977 ; BX = file handle, CX = number of bytes to read - 24978 ; DS:DX -> buffer - 24979 00002CDC B43E mov ah,3Eh - 24980 00002CDE CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 24981 ; BX = file handle - 24982 00002CE0 813E[96A3]2F2A cmp word [TPBUF],2A2Fh ; '/*' (NASM syntax) - 24983 00002CE6 7536 jnz short BATCOMJ - 24984 00002CE8 B8[7E97] mov ax,REXX_EXE ; "REXX.EXE" - 24985 ;mov [ARG_ARGV],ax - 24986 00002CEB A3[509F] mov [ARG+ARGV_ELE.argpointer],ax - 24987 ;mov word [ARGV0_ARG_FLAGS],0 - 24988 00002CEE C706[529F]0000 mov word [ARG+ARGV_ELE.argflags],0 - 24989 ;mov [ARGV0_ARGSTARTEL],ax - 24990 00002CF4 A3[539F] mov [ARG+ARGV_ELE.argstartel],ax - 24991 ;mov word [ARGV0_ARGLEN],8 - 24992 00002CF7 C706[559F]0800 mov word [ARG+ARGV_ELE.arglen],8 - 24993 ;mov word [ARGV0_ARGSW_WORD],0 - 24994 00002CFD C706[579F]0000 mov word [ARG+ARGV_ELE.argsw_word],0 - 24995 ;mov [ARGV0_ARG_OCOMPTR],ax - 24996 00002D03 A3[599F] mov [ARG+ARGV_ELE.arg_ocomptr],ax - 24997 ; pointer into original command string - 24998 00002D06 E89708 call path_search - 24999 00002D09 85C0 test ax,ax - 25000 00002D0B 740C jz short rexx_nf_err - 25001 00002D0D BE[559A] mov si,COMBUF+1 - 25002 00002D10 BF8000 mov di,80h ; PSP command tail (arguments) - 25003 00002D13 89F9 mov cx,di ; 128 - 25004 00002D15 F3A4 rep movsb - 25005 00002D17 EB13 jmp short NEOEXECUTE - 25006 rexx_nf_err: - 25007 00002D19 BA[FD8F] mov dx,REXXNOTF_PTR ; MSG_1012 ; REXX.EXE not found - 25008 00002D1C EB08 jmp short cerror - 25009 %endif - 25010 - 25011 ;nop - 25012 BATCOMJ: - 25013 00002D1E E97BDB jmp BATCOM - 25014 - 25015 ; 25/02/2023 - 25016 ;BADCOMJ45: - 25017 ;jmp short BADCOM - 25018 - 25019 ; 06/08/2024 - 25020 ; --------------------------------------------------------------------------- + 24910 ; 25/02/2023 - Retro DOS v4.0 COMMAND.COM + 24911 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:29A6h + 24912 + 24913 EXTERNAL: + 24914 00002C7A E89102 call test_append ; check to see if append installed + 24915 00002C7D 7403 jz short NOT_BARRYF + 24916 ; no - truly external command + 24917 00002C7F E9FCFE jmp APPEND_INTERNAL ; yes - go to Barryf code + 24918 + 24919 NOT_BARRYF: + 24920 00002C82 2EC606[069C]00 mov byte [cs:FILTYP],0 + 24921 00002C88 2E8A16[149C] mov dl,[cs:SPECDRV] + 24922 00002C8D 2E8816[BA9C] mov [cs:IDLEN],dl + 24923 00002C92 2EC606[B49D]00 mov byte [cs:ROM_CALL],0 + 24924 00002C98 52 push dx + 24925 00002C99 BA[BA9C] mov dx,IDLEN + 24926 00002C9C E834D8 call ROM_SCAN + 24927 00002C9F 5A pop dx + 24928 ;jnc short POSTSAVE + 24929 00002CA0 7305 jnc short DO_SCAN + 24930 00002CA2 2EFE06[B49D] inc byte [cs:ROM_CALL] + 24931 ;jmp short POSTSAVE + 24932 + 24933 ;nop + 24934 DO_SCAN: + 24935 POSTSAVE: + 24936 00002CA7 BF[1D9B] mov di,EXECPATH + 24937 00002CAA C60500 mov byte [di],0 ; Initialize to current directory + 24938 + 24939 00002CAD 2E803E[B49D]00 cmp byte [cs:ROM_CALL],0 + 24940 ;jz short RESEARCH + 24941 ; 25/02/2023 + 24942 ;jmp short NEOEXECUTE + 24943 00002CB3 7577 jnz short NEOEXECUTE + 24944 + 24945 ;nop + 24946 RESEARCH: + 24947 00002CB5 E8E808 call path_search ; find the mother (result in execpath) + 24948 00002CB8 09C0 or ax,ax ; did we find anything? + 24949 ;jz short BADCOMJ45 ; null means no (sob) + 24950 ; 25/02/2023 + 24951 00002CBA 7465 jz short BADCOM + 24952 00002CBC 83F804 cmp ax,4 ; 04H and 08H are .exe and .com + 24953 ; fuckin' sixteen-bit machine ought + 24954 ;jl short BATCOMJ ; to be able to handle a SIXTEEN-BIT + 24955 ; DISPLACEMENT!! + 24956 ;;jmp short NEOEXECUTE + 24957 ;jmp short EXECUTE + 24958 ; 25/02/2023 + 24959 00002CBF 7D6B jnl short EXECUTE ; jge + 24960 + 24961 ; 02H is .bat + 24962 + 24963 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 24964 ; PCDOS 7.1 COMMAND.COM + 24965 %if 1 + 24966 ; ... .BAT file ... + 24967 00002CC1 BA[1D9B] mov dx,EXECPATH + 24968 00002CC4 B8003D mov ax,3D00h + 24969 00002CC7 CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 24970 ; DS:DX -> ASCIZ filename + 24971 ; AL = access mode + 24972 ; 0 - read + 24973 00002CC9 7253 jb short BATCOMJ + 24974 00002CCB 8326[96A3]00 and word [TPBUF],0 ; clear 1st two bytes of the buffer + 24975 00002CD0 BA[96A3] mov dx,TPBUF + 24976 00002CD3 B90200 mov cx,2 + 24977 00002CD6 89C3 mov bx,ax + 24978 00002CD8 B43F mov ah,3Fh + 24979 00002CDA CD21 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE + 24980 ; BX = file handle, CX = number of bytes to read + 24981 ; DS:DX -> buffer + 24982 00002CDC B43E mov ah,3Eh + 24983 00002CDE CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 24984 ; BX = file handle + 24985 00002CE0 813E[96A3]2F2A cmp word [TPBUF],2A2Fh ; '/*' (NASM syntax) + 24986 00002CE6 7536 jnz short BATCOMJ + 24987 00002CE8 B8[7E97] mov ax,REXX_EXE ; "REXX.EXE" + 24988 ;mov [ARG_ARGV],ax + 24989 00002CEB A3[509F] mov [ARG+ARGV_ELE.argpointer],ax + 24990 ;mov word [ARGV0_ARG_FLAGS],0 + 24991 00002CEE C706[529F]0000 mov word [ARG+ARGV_ELE.argflags],0 + 24992 ;mov [ARGV0_ARGSTARTEL],ax + 24993 00002CF4 A3[539F] mov [ARG+ARGV_ELE.argstartel],ax + 24994 ;mov word [ARGV0_ARGLEN],8 + 24995 00002CF7 C706[559F]0800 mov word [ARG+ARGV_ELE.arglen],8 + 24996 ;mov word [ARGV0_ARGSW_WORD],0 + 24997 00002CFD C706[579F]0000 mov word [ARG+ARGV_ELE.argsw_word],0 + 24998 ;mov [ARGV0_ARG_OCOMPTR],ax + 24999 00002D03 A3[599F] mov [ARG+ARGV_ELE.arg_ocomptr],ax + 25000 ; pointer into original command string + 25001 00002D06 E89708 call path_search + 25002 00002D09 85C0 test ax,ax + 25003 00002D0B 740C jz short rexx_nf_err + 25004 00002D0D BE[559A] mov si,COMBUF+1 + 25005 00002D10 BF8000 mov di,80h ; PSP command tail (arguments) + 25006 00002D13 89F9 mov cx,di ; 128 + 25007 00002D15 F3A4 rep movsb + 25008 00002D17 EB13 jmp short NEOEXECUTE + 25009 rexx_nf_err: + 25010 00002D19 BA[FD8F] mov dx,REXXNOTF_PTR ; MSG_1012 ; REXX.EXE not found + 25011 00002D1C EB08 jmp short cerror + 25012 %endif + 25013 + 25014 ;nop + 25015 BATCOMJ: + 25016 00002D1E E97BDB jmp BATCOM + 25017 + 25018 ; 25/02/2023 + 25019 ;BADCOMJ45: + 25020 ;jmp short BADCOM 25021 - 25022 ; 25/02/2023 - Retro DOS v4.0 COMMAND.COM - 25023 BADCOM: - 25024 00002D21 0E push cs - 25025 00002D22 1F pop ds - 25026 00002D23 BA[FA8F] mov dx,BADNAM_PTR - 25027 cerror: - 25028 00002D26 E8F726 call std_eprintf - 25029 00002D29 E9D8D3 jmp TCOMMAND - 25030 - 25031 ; --------------------------------------------------------------------------- - 25032 - 25033 ;nop - 25034 EXECUTE: - 25035 NEOEXECUTE: - 25036 00002D2C E88102 call IOSET - 25037 - 25038 ; MSDOS 6.0 - 25039 ;M051 - 25040 ; Previously LoadHigh was jumping to the execute label above. This was wrong - 25041 ;because IOSET was getting invoked twice resulting in 2 sets of redirections. - 25042 ;After a close, this would still leave one open active resulting in sharing - 25043 ;errors on subsequent opens of the redirected file. - 25044 - 25045 LH_EXECUTE: ;M051 - 25046 00002D2F 8E06[039C] mov es,[TRAN_TPA] - 25047 ;mov ah,DEALLOC ; 49h - 25048 00002D33 B449 mov ah,49h - 25049 00002D35 CD21 int 21h ; DOS - 2+ - FREE MEMORY - 25050 ; ES = segment address of area to be freed - 25051 ; Now running in "free" space - 25052 00002D37 8E06[F59B] mov es,[RESSEG] - 25053 00002D3B 26FE06[9902] inc byte [es:ExtCom] ; Indicate external command - 25054 00002D40 26C606[A102]00 mov byte [es:RestDir],0 - 25055 ; Since USERDIR1 is in transient, insure - 25056 ; this flag value for re-entry to COMMAND - 25057 ; MSDOS 6.0 - 25058 00002D46 BE[1D9B] mov si,EXECPATH ; offset TRANGROUP:EXECPATH - 25059 00002D49 BF[5E04] mov di,SafePathBuffer ; offset RESGROUP:SAFEPATHBUFFER - 25060 ;mov cx,LENMSGORPATHBUF - 25061 00002D4C B95000 mov cx,80 - 25062 00002D4F FC cld - 25063 00002D50 F3A4 rep movsb ; copy program pathname to resident - 25064 - 25065 ; MSDOS 3.3 (& MSDOS 6.0) - 25066 00002D52 BF5C00 mov di,FCB ; 5Ch - 25067 00002D55 89FE mov si,di - 25068 ;mov cx,82 ; 52h ; moving (100h-5Ch)/2 = 80h-2Eh - 25069 00002D57 B152 mov cl,82 ; 25/02/2023 - 25070 00002D59 F3A5 rep movsw ; Transfer parameters to resident header - 25071 - 25072 ; 25/02/2023 - 25073 ;mov dx,EXECPATH ; MSDOS 3.3 - 25074 ; MSDOS 6.0 (& 5.0) - 25075 ;mov dx,offset RESGROUP:SAFEPATHBUFFER - 25076 00002D5B BA[5E04] mov dx,SafePathBuffer - 25077 00002D5E 06 push es - 25078 00002D5F 1F pop ds - 25079 - 25080 ;mov bx,offset RESGROUP:EXEC_BLOCK - 25081 00002D60 BB[3A04] mov bx,Exec_Block ; = offset EnvirSeg - 25082 ;mov ax,EXEC*256 ; 4B00h - 25083 00002D63 B8004B mov ax,4B00h - 25084 ;test byte [ROM_CALL],-1 ; 0FFh ; MSDOS 3.3 - 25085 00002D66 2EF606[B49D]FF test byte [cs:ROM_CALL],-1 ; MSDOS 6.0 (& 5.0) - 25086 00002D6C 7403 jz short OK_EXEC - 25087 00002D6E E9DBD7 jmp ROM_EXEC - 25088 - 25089 OK_EXEC: - 25090 - 25091 ; we are now running in free space. Anything we do from here on may get - 25092 ; trashed. Move the stack (also in free space) to allocated space because - 25093 ; since EXEC restores the stack, somebody may trash what is on the stack. - 25094 - 25095 00002D71 8CC1 mov cx,es - 25096 00002D73 8ED1 mov ss,cx - 25097 00002D75 BC[2E05] mov sp,RStack - 25098 ; MSDOS 3.3 - 25099 ;jmp far [EXEC_ADDR] ; Jmp to the EXEC in the resident - 25100 ; 25/02/2023 - 25101 ; MSDOS 6.0 - 25102 00002D78 2EFF2E[FB9B] jmp far [cs:EXEC_ADDR] ; Jmp to the EXEC in the resident - 25103 - 25104 ; =============== S U B R O U T I N E ======================================= - 25105 - 25106 ; Prescan converts the input buffer into a canonicalized form. - 25107 ; All redirections and pipes are removed. + 25022 ; 06/08/2024 + 25023 ; --------------------------------------------------------------------------- + 25024 + 25025 ; 25/02/2023 - Retro DOS v4.0 COMMAND.COM + 25026 BADCOM: + 25027 00002D21 0E push cs + 25028 00002D22 1F pop ds + 25029 00002D23 BA[FA8F] mov dx,BADNAM_PTR + 25030 cerror: + 25031 00002D26 E8F726 call std_eprintf + 25032 00002D29 E9D8D3 jmp TCOMMAND + 25033 + 25034 ; --------------------------------------------------------------------------- + 25035 + 25036 ;nop + 25037 EXECUTE: + 25038 NEOEXECUTE: + 25039 00002D2C E88102 call IOSET + 25040 + 25041 ; MSDOS 6.0 + 25042 ;M051 + 25043 ; Previously LoadHigh was jumping to the execute label above. This was wrong + 25044 ;because IOSET was getting invoked twice resulting in 2 sets of redirections. + 25045 ;After a close, this would still leave one open active resulting in sharing + 25046 ;errors on subsequent opens of the redirected file. + 25047 + 25048 LH_EXECUTE: ;M051 + 25049 00002D2F 8E06[039C] mov es,[TRAN_TPA] + 25050 ;mov ah,DEALLOC ; 49h + 25051 00002D33 B449 mov ah,49h + 25052 00002D35 CD21 int 21h ; DOS - 2+ - FREE MEMORY + 25053 ; ES = segment address of area to be freed + 25054 ; Now running in "free" space + 25055 00002D37 8E06[F59B] mov es,[RESSEG] + 25056 00002D3B 26FE06[9902] inc byte [es:ExtCom] ; Indicate external command + 25057 00002D40 26C606[A102]00 mov byte [es:RestDir],0 + 25058 ; Since USERDIR1 is in transient, insure + 25059 ; this flag value for re-entry to COMMAND + 25060 ; MSDOS 6.0 + 25061 00002D46 BE[1D9B] mov si,EXECPATH ; offset TRANGROUP:EXECPATH + 25062 00002D49 BF[5E04] mov di,SafePathBuffer ; offset RESGROUP:SAFEPATHBUFFER + 25063 ;mov cx,LENMSGORPATHBUF + 25064 00002D4C B95000 mov cx,80 + 25065 00002D4F FC cld + 25066 00002D50 F3A4 rep movsb ; copy program pathname to resident + 25067 + 25068 ; MSDOS 3.3 (& MSDOS 6.0) + 25069 00002D52 BF5C00 mov di,FCB ; 5Ch + 25070 00002D55 89FE mov si,di + 25071 ;mov cx,82 ; 52h ; moving (100h-5Ch)/2 = 80h-2Eh + 25072 00002D57 B152 mov cl,82 ; 25/02/2023 + 25073 00002D59 F3A5 rep movsw ; Transfer parameters to resident header + 25074 + 25075 ; 25/02/2023 + 25076 ;mov dx,EXECPATH ; MSDOS 3.3 + 25077 ; MSDOS 6.0 (& 5.0) + 25078 ;mov dx,offset RESGROUP:SAFEPATHBUFFER + 25079 00002D5B BA[5E04] mov dx,SafePathBuffer + 25080 00002D5E 06 push es + 25081 00002D5F 1F pop ds + 25082 + 25083 ;mov bx,offset RESGROUP:EXEC_BLOCK + 25084 00002D60 BB[3A04] mov bx,Exec_Block ; = offset EnvirSeg + 25085 ;mov ax,EXEC*256 ; 4B00h + 25086 00002D63 B8004B mov ax,4B00h + 25087 ;test byte [ROM_CALL],-1 ; 0FFh ; MSDOS 3.3 + 25088 00002D66 2EF606[B49D]FF test byte [cs:ROM_CALL],-1 ; MSDOS 6.0 (& 5.0) + 25089 00002D6C 7403 jz short OK_EXEC + 25090 00002D6E E9DBD7 jmp ROM_EXEC + 25091 + 25092 OK_EXEC: + 25093 + 25094 ; we are now running in free space. Anything we do from here on may get + 25095 ; trashed. Move the stack (also in free space) to allocated space because + 25096 ; since EXEC restores the stack, somebody may trash what is on the stack. + 25097 + 25098 00002D71 8CC1 mov cx,es + 25099 00002D73 8ED1 mov ss,cx + 25100 00002D75 BC[2E05] mov sp,RStack + 25101 ; MSDOS 3.3 + 25102 ;jmp far [EXEC_ADDR] ; Jmp to the EXEC in the resident + 25103 ; 25/02/2023 + 25104 ; MSDOS 6.0 + 25105 00002D78 2EFF2E[FB9B] jmp far [cs:EXEC_ADDR] ; Jmp to the EXEC in the resident + 25106 + 25107 ; =============== S U B R O U T I N E ======================================= 25108 - 25109 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25110 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2A51h + 25109 ; Prescan converts the input buffer into a canonicalized form. + 25110 ; All redirections and pipes are removed. 25111 - 25112 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 25113 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2FFBh + 25112 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25113 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2A51h 25114 - 25115 ; 05/08/2024 - Retro DOS v5.0 COMMAND.COM - 25116 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2E8Dh - 25117 PRESCAN: - 25118 00002D7D 31C9 xor cx,cx - 25119 00002D7F 8E06[F59B] mov es,[RESSEG] - 25120 00002D83 BE[569A] mov si,COMBUF+2 - 25121 00002D86 89F7 mov di,si - 25122 COUNTQUOTES: - 25123 00002D88 AC lodsb ; get a byte - 25124 00002D89 3C22 cmp al,22h ; '"' ; is it a quote? - 25125 00002D8B 7504 jne short COUNTEND ; no, try for end of road - 25126 00002D8D FEC5 inc ch ; bump count - 25127 00002D8F EBF7 jmp short COUNTQUOTES - 25128 ; go get next char - 25129 COUNTEND: - 25130 00002D91 3C0D cmp al,0Dh ; 13 ; end of road? - 25131 00002D93 75F3 jne short COUNTQUOTES - 25132 ; no, go back for next char - 25133 ; 26/02/2023 - 25134 ; MSDOS 5.0 (& 6.0) - 25135 00002D95 51 push cx ; save count - 25136 00002D96 89FE mov si,di ; restore pointer to begining - 25137 KanjiScan: - 25138 00002D98 AC lodsb ; get a byte - 25139 00002D99 E8C5F9 call testkanj ; is it a leadin byte - 25140 00002D9C 740F jz short KanjiQuote - 25141 ; no, check for quotes - 25142 00002D9E 88C4 mov ah,al ; save leadin - 25143 00002DA0 AC lodsb ; get trailing byte - 25144 00002DA1 3D2020 cmp ax,2020h - 25145 ;cmp ax,DB_SPACE ; is it Kanji space - 25146 00002DA4 75F2 jne short KanjiScan ; no, go get next - 25147 00002DA6 C744FE2020 mov word [si-2],2020h - 25148 ; replace with spaces - 25149 00002DAB EBEB jmp short KanjiScan ; go get next char - 25150 - 25151 KanjiQuote: - 25152 00002DAD 3C22 cmp al,22h ; '"' ; beginning of quoted string - 25153 00002DAF 750D jne short KanjiEnd ; no, check for end - 25154 00002DB1 FECD dec ch ; drop count - 25155 00002DB3 74E3 jz short KanjiScan ; if count is zero, no quoting - 25156 KanjiQuoteLoop: - 25157 00002DB5 AC lodsb ; get next byte - 25158 00002DB6 3C22 cmp al,22h ; '"' ; is it another quote - 25159 00002DB8 75FB jne short KanjiQuoteLoop - 25160 ; no, get another - 25161 00002DBA FECD dec ch ; yes, drop count - 25162 00002DBC EBDA jmp short KanjiScan ; go get next char - 25163 KanjiEnd: - 25164 00002DBE 3C0D cmp al,13 ; 0Dh ; end of line character? - 25165 00002DC0 75D6 jne short KanjiScan ; go back to beginning - 25166 00002DC2 59 pop cx ; get back original count - 25167 ; 26/04/2023 - 25168 00002DC3 89FE mov si,di ; restore pointer to beginning - 25169 - 25170 ; MSDOS 3.3 (& MSDOS 6.0) - 25171 PRESCANLP: - 25172 00002DC5 AC lodsb - 25173 ; 26/02/2023 - 25174 00002DC6 E898F9 call testkanj - 25175 00002DC9 740C jz short NOTKANJ6 - 25176 ; MSDOS 6.0 - 25177 00002DCB 8805 mov [di],al - 25178 00002DCD 47 inc di ; fake STOSB into DS - 25179 00002DCE AC lodsb ; grab second byte - 25180 00002DCF 8805 mov [di],al ; fake stosb into DS - 25181 00002DD1 FEC1 inc cl - 25182 00002DD3 FEC1 inc cl - 25183 00002DD5 EBEE jmp short PRESCANLP - 25184 - 25185 NOTKANJ6: - 25186 ; MSDOS 3.3 (& MSDOS 6.0) - 25187 00002DD7 3C22 cmp al,'"' ; 22h ; " character - 25188 00002DD9 7510 jne short TRYGREATER - 25189 00002DDB FECD dec ch - 25190 00002DDD 740C jz short TRYGREATER - 25191 QLOOP: - 25192 00002DDF 8805 mov [di],al - 25193 00002DE1 47 inc di - 25194 00002DE2 FEC1 inc cl - 25195 00002DE4 AC lodsb - 25196 00002DE5 3C22 cmp al,'"' ; " character - 25197 00002DE7 75F6 jne short QLOOP - 25198 00002DE9 FECD dec ch - 25199 TRYGREATER: - 25200 00002DEB 3C3E cmp al,'>' ; 3Eh - 25201 ;cmp al,rabracket ; MSDOS 6.0 (& 5.0) - 25202 ;;cmp al,[RABRACKET] ; MSDOS 3.3 - 25203 00002DED 7565 jne short NOOUT - 25204 - 25205 ; We have found a ">" char. We need to see if there is another ">" - 25206 ; following it. + 25115 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 25116 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:2FFBh + 25117 + 25118 ; 05/08/2024 - Retro DOS v5.0 COMMAND.COM + 25119 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2E8Dh + 25120 PRESCAN: + 25121 00002D7D 31C9 xor cx,cx + 25122 00002D7F 8E06[F59B] mov es,[RESSEG] + 25123 00002D83 BE[569A] mov si,COMBUF+2 + 25124 00002D86 89F7 mov di,si + 25125 COUNTQUOTES: + 25126 00002D88 AC lodsb ; get a byte + 25127 00002D89 3C22 cmp al,22h ; '"' ; is it a quote? + 25128 00002D8B 7504 jne short COUNTEND ; no, try for end of road + 25129 00002D8D FEC5 inc ch ; bump count + 25130 00002D8F EBF7 jmp short COUNTQUOTES + 25131 ; go get next char + 25132 COUNTEND: + 25133 00002D91 3C0D cmp al,0Dh ; 13 ; end of road? + 25134 00002D93 75F3 jne short COUNTQUOTES + 25135 ; no, go back for next char + 25136 ; 26/02/2023 + 25137 ; MSDOS 5.0 (& 6.0) + 25138 00002D95 51 push cx ; save count + 25139 00002D96 89FE mov si,di ; restore pointer to begining + 25140 KanjiScan: + 25141 00002D98 AC lodsb ; get a byte + 25142 00002D99 E8C5F9 call testkanj ; is it a leadin byte + 25143 00002D9C 740F jz short KanjiQuote + 25144 ; no, check for quotes + 25145 00002D9E 88C4 mov ah,al ; save leadin + 25146 00002DA0 AC lodsb ; get trailing byte + 25147 00002DA1 3D2020 cmp ax,2020h + 25148 ;cmp ax,DB_SPACE ; is it Kanji space + 25149 00002DA4 75F2 jne short KanjiScan ; no, go get next + 25150 00002DA6 C744FE2020 mov word [si-2],2020h + 25151 ; replace with spaces + 25152 00002DAB EBEB jmp short KanjiScan ; go get next char + 25153 + 25154 KanjiQuote: + 25155 00002DAD 3C22 cmp al,22h ; '"' ; beginning of quoted string + 25156 00002DAF 750D jne short KanjiEnd ; no, check for end + 25157 00002DB1 FECD dec ch ; drop count + 25158 00002DB3 74E3 jz short KanjiScan ; if count is zero, no quoting + 25159 KanjiQuoteLoop: + 25160 00002DB5 AC lodsb ; get next byte + 25161 00002DB6 3C22 cmp al,22h ; '"' ; is it another quote + 25162 00002DB8 75FB jne short KanjiQuoteLoop + 25163 ; no, get another + 25164 00002DBA FECD dec ch ; yes, drop count + 25165 00002DBC EBDA jmp short KanjiScan ; go get next char + 25166 KanjiEnd: + 25167 00002DBE 3C0D cmp al,13 ; 0Dh ; end of line character? + 25168 00002DC0 75D6 jne short KanjiScan ; go back to beginning + 25169 00002DC2 59 pop cx ; get back original count + 25170 ; 26/04/2023 + 25171 00002DC3 89FE mov si,di ; restore pointer to beginning + 25172 + 25173 ; MSDOS 3.3 (& MSDOS 6.0) + 25174 PRESCANLP: + 25175 00002DC5 AC lodsb + 25176 ; 26/02/2023 + 25177 00002DC6 E898F9 call testkanj + 25178 00002DC9 740C jz short NOTKANJ6 + 25179 ; MSDOS 6.0 + 25180 00002DCB 8805 mov [di],al + 25181 00002DCD 47 inc di ; fake STOSB into DS + 25182 00002DCE AC lodsb ; grab second byte + 25183 00002DCF 8805 mov [di],al ; fake stosb into DS + 25184 00002DD1 FEC1 inc cl + 25185 00002DD3 FEC1 inc cl + 25186 00002DD5 EBEE jmp short PRESCANLP + 25187 + 25188 NOTKANJ6: + 25189 ; MSDOS 3.3 (& MSDOS 6.0) + 25190 00002DD7 3C22 cmp al,'"' ; 22h ; " character + 25191 00002DD9 7510 jne short TRYGREATER + 25192 00002DDB FECD dec ch + 25193 00002DDD 740C jz short TRYGREATER + 25194 QLOOP: + 25195 00002DDF 8805 mov [di],al + 25196 00002DE1 47 inc di + 25197 00002DE2 FEC1 inc cl + 25198 00002DE4 AC lodsb + 25199 00002DE5 3C22 cmp al,'"' ; " character + 25200 00002DE7 75F6 jne short QLOOP + 25201 00002DE9 FECD dec ch + 25202 TRYGREATER: + 25203 00002DEB 3C3E cmp al,'>' ; 3Eh + 25204 ;cmp al,rabracket ; MSDOS 6.0 (& 5.0) + 25205 ;;cmp al,[RABRACKET] ; MSDOS 3.3 + 25206 00002DED 7565 jne short NOOUT 25207 - 25208 00002DEF 3804 cmp [si],al - 25209 00002DF1 7506 jne short NOAPPND - 25210 00002DF3 AC lodsb - 25211 00002DF4 26FE06[C102] inc byte [es:Re_Out_App] ; Flag >> - 25212 NOAPPND: - 25213 ; Now we attempt to find the file name. First, scan off all whitespace - 25214 - 25215 00002DF9 E88AFB call scanoff - 25216 - 25217 ; 26/02/2023 - 25218 ; MSDOS 6.0 - 25219 00002DFC 3C3C cmp al,'<' ; 3Ch - 25220 ;cmp al,labracket ;AN040; was there no filename? - 25221 00002DFE 7404 je short REOUT_ERRSET - 25222 ;AN040; yes - set up error - 25223 ; MSDOS 3.3 (& MSDOS 6.0) - 25224 00002E00 3C0D cmp al,0Dh - 25225 00002E02 750D jnz short GOTREOFIL - 25226 - 25227 ; There was no file present. Set us up at end-of-line. - 25228 - 25229 REOUT_ERRSET: ;AN040; set up for an error - 25230 00002E04 C6050D mov byte [di],0Dh ; Clobber first ">" - 25231 00002E07 26C706[C202]0900 mov word [es:Re_OutStr],9 - 25232 ; Cause an error later - 25233 00002E0E E9B700 jmp PRESCANEND - 25234 - 25235 GOTREOFIL: - 25236 00002E11 57 push di - 25237 ;mov di,offset RESGROUP:RE_OUTSTR - 25238 00002E12 BF[C202] mov di,Re_OutStr - 25239 00002E15 89FB mov bx,di - 25240 00002E17 06 push es - 25241 - 25242 ; 26/02/2023 - 25243 ; MSDOS 6.0 - 25244 SETREOUTSTR: ; Get the output redirection name - 25245 ; MSKK06 07/14/89 - 25246 00002E18 51 push cx ; save cx - 25247 00002E19 B94D00 mov cx,64+13 ; CX = max string length - 25248 SETREOUTSTR_LOOP: - 25249 00002E1C AC lodsb - 25250 00002E1D 3C0D cmp al,0Dh - 25251 00002E1F 741A je short GOTRESTR_J - 25252 00002E21 E86AFB call DELIM - 25253 00002E24 7415 jz short GOTRESTR_J - 25254 00002E26 3A06[F99B] cmp al,[SWITCHAR] - 25255 00002E2A 740F je short GOTRESTR_J - 25256 00002E2C 3C22 cmp al,'"' ; 22h ;AN033; Is the character a quote? - 25257 00002E2E 7421 je short PIPEERRSYNJ5_J - 25258 ;AN033; Yes - get out quick - or system crashes - 25259 00002E30 3C3C cmp al,'<' ; 3Ch - 25260 ;cmp al,labracket ;AN002; Is char for input redirection - 25261 00002E32 7404 je short ABRACKET_TERM - 25262 ;AN002; yes - end of string - 25263 00002E34 3C3E cmp al,'>' ; 3Eh - 25264 ;cmp al,rabracket ;AN002; Is char for output redirection - 25265 00002E36 7506 jne short NO_ABRACKET - 25266 ;AN002; no - not end of string - 25267 ABRACKET_TERM: ;AN002; have end of string by < or > - 25268 00002E38 4E dec si ;AN002; back up over symbol - 25269 00002E39 B020 mov al,20h ; BLANK ;AN002; show delimiter as char - 25270 GOTRESTR_J: - 25271 00002E3B 59 pop cx ; MSKK06 07/14/89 - 25272 00002E3C EB66 jmp short GOTRESTR ;AN002; go process it - 25273 NO_ABRACKET: ;AN002; NOT AT END OF STRING - 25274 00002E3E AA stosb ; store it into resgroup - 25275 - 25276 ; 05/08/2024 - PCDOS 7.1 COMMAND.COM - 25277 %if 1 - 25278 ;ifdef DBCS - 25279 ;invoke testkanj - 25280 ;jz short @f ; if not lead byte of DBCS - 25281 00002E3F E81FF9 call testkanj - 25282 00002E42 7409 jz short NO_ABRACKET_@ - 25283 00002E44 E3F5 jcxz GOTRESTR_J ; if no tail byte - 25284 00002E46 AC lodsb - 25285 00002E47 3C0D cmp al,0Dh - 25286 00002E49 74F0 jz short GOTRESTR_J ; if tail byte does't come and ends - 25287 00002E4B AA stosb ; copy tail byte - 25288 00002E4C 49 dec cx - 25289 ;@@: - 25290 NO_ABRACKET_@: ; 05/08/2024 - 25291 ;endif - 25292 %endif - 25293 - 25294 00002E4D E2CD loop SETREOUTSTR_LOOP - 25295 ; MSKK06 07/14/89 - 25296 00002E4F EBEA jmp short GOTRESTR_J - 25297 PIPEERRSYNJ5_J: - 25298 00002E51 59 pop cx ; recover CX - 25299 00002E52 EB4B jmp short PIPEERRSYNJ5 - 25300 - 25301 ; 26/02/2023 - 25302 ; ; MSDOS 3.3 - 25303 ;SETREOUTSTR_LOOP: ; Get the output redirection name - 25304 ; lodsb - 25305 ; cmp al,0Dh - 25306 ; jz short GOTRESTR - 25307 ; call DELIM - 25308 ; jz short GOTRESTR - 25309 ; cmp al,[SWITCHAR] - 25310 ; je short GOTRESTR - 25311 ; cmp al,'"' - 25312 ; jne short NO_ABRACKET - 25313 ; dec ch - 25314 ;NO_ABRACKET: - 25315 ; stosb - 25316 ; jmp short SETREOUTSTR_LOOP - 25317 - 25318 NOOUT: - 25319 ; 26/02/2023 - 25320 ; MSDOS 3.3 (& MSDOS 6.0) - 25321 00002E54 3C3C cmp al, '<' ; 3Ch - 25322 ;cmp al,labracket ; MSDOS 6.0 - 25323 ;;cmp al,[LABRACKET] ; MSDOS 3.3 - 25324 00002E56 7523 jne short CHKPIPE - 25325 00002E58 89F3 mov bx,si ; Save loc of "<" - 25326 00002E5A E829FB call scanoff - 25327 ; MSDOS 6.0 - 25328 00002E5D 3C3E cmp al,'>' ; 3Eh - 25329 ;cmp al,rabracket ;AN040; was there no filename? - 25330 00002E5F 7404 je short REIN_ERRSET ;AN040; yes - set up error - 25331 ; MSDOS 3.3 (& MSDOS 6.0) - 25332 00002E61 3C0D cmp al,0Dh - 25333 00002E63 750B jne short GOTREIFIL - 25334 REIN_ERRSET: ;AN040; set up for error - 25335 00002E65 C6050D mov byte [di],0Dh ; Clobber "<" - 25336 00002E68 C706[A09B]0900 mov word [RE_INSTR],9 - 25337 ; Cause an error later - 25338 00002E6E EB58 jmp short PRESCANEND - 25339 GOTREIFIL: - 25340 00002E70 57 push di - 25341 00002E71 BF[A09B] mov di,RE_INSTR - 25342 00002E74 89FB mov bx,di - 25343 00002E76 06 push es - 25344 00002E77 0E push cs - 25345 00002E78 07 pop es ; store in TRANGROUP - 25346 ; 26/04/2023 - 25347 ;jmp short SETREOUTSTR_LOOP ; MSDOS 3.3 COMMAND.COM - 25348 00002E79 EB9D jmp short SETREOUTSTR ; MSDOS 5.0 (& 6.0) COMMAND.COM - 25349 ; Get the input redirection name - 25350 CHKPIPE: - 25351 00002E7B 88C4 mov ah,al - 25352 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25353 00002E7D 80FC7C cmp ah,'|' ; 7Ch - 25354 ;cmp ah,ALTPIPECHR ; 7Ch - 25355 ;je short ISPIPE3 - 25356 ;; MSDOS 6.0 - 25357 ;cmp ah,'|' ; 7Ch - 25358 ;;cmp al,vbar ; 7Ch - 25359 ;;;cmp ah,[VBAR] ; MSDOS 3.3 - 25360 00002E80 7539 jne short CONTPRESCAN - 25361 ISPIPE3: - 25362 ; Only push the echo flag if we are entering the pipe for the first time. - 25363 - 25364 00002E82 26803E[1303]00 cmp byte [es:PipeFlag],0 - 25365 00002E88 7505 jne short NOECHOPUSH - 25366 00002E8A 26D026[9D02] shl byte [es:EchoFlag],1 ; push echo state and turn it off - 25367 NOECHOPUSH: - 25368 00002E8F 26FE06[1303] inc byte [es:PipeFlag] - 25369 00002E94 E8EFFA call scanoff - 25370 00002E97 3C0D cmp al,0Dh - 25371 00002E99 7404 je short PIPEERRSYNJ5 - 25372 ; 26/02/2023 - 25373 00002E9B 3C7C cmp al,'|' ; 7Ch - 25374 ;cmp al,ALTPIPECHR ; 7Ch - 25375 ;je short PIPEERRSYNJ5 - 25376 ;; MSDOS 6.0 - 25377 ;cmp al,'|' ; 7Ch - 25378 ;;cmp al,vbar ; 7Ch - 25379 ;;;cmp al,[VBAR] ; MSDOS 3.3 - 25380 00002E9D 751C jne short CONTPRESCAN - 25381 - 25382 PIPEERRSYNJ5: - 25383 00002E9F 06 push es - 25384 00002EA0 1F pop ds - 25385 00002EA1 E99E02 jmp PIPEERRSYN - 25386 - 25387 ; Trailing :s are allowed on devices. Check to be sure that there is more - 25388 ; than just a : in the redir string. + 25208 ; We have found a ">" char. We need to see if there is another ">" + 25209 ; following it. + 25210 + 25211 00002DEF 3804 cmp [si],al + 25212 00002DF1 7506 jne short NOAPPND + 25213 00002DF3 AC lodsb + 25214 00002DF4 26FE06[C102] inc byte [es:Re_Out_App] ; Flag >> + 25215 NOAPPND: + 25216 ; Now we attempt to find the file name. First, scan off all whitespace + 25217 + 25218 00002DF9 E88AFB call scanoff + 25219 + 25220 ; 26/02/2023 + 25221 ; MSDOS 6.0 + 25222 00002DFC 3C3C cmp al,'<' ; 3Ch + 25223 ;cmp al,labracket ;AN040; was there no filename? + 25224 00002DFE 7404 je short REOUT_ERRSET + 25225 ;AN040; yes - set up error + 25226 ; MSDOS 3.3 (& MSDOS 6.0) + 25227 00002E00 3C0D cmp al,0Dh + 25228 00002E02 750D jnz short GOTREOFIL + 25229 + 25230 ; There was no file present. Set us up at end-of-line. + 25231 + 25232 REOUT_ERRSET: ;AN040; set up for an error + 25233 00002E04 C6050D mov byte [di],0Dh ; Clobber first ">" + 25234 00002E07 26C706[C202]0900 mov word [es:Re_OutStr],9 + 25235 ; Cause an error later + 25236 00002E0E E9B700 jmp PRESCANEND + 25237 + 25238 GOTREOFIL: + 25239 00002E11 57 push di + 25240 ;mov di,offset RESGROUP:RE_OUTSTR + 25241 00002E12 BF[C202] mov di,Re_OutStr + 25242 00002E15 89FB mov bx,di + 25243 00002E17 06 push es + 25244 + 25245 ; 26/02/2023 + 25246 ; MSDOS 6.0 + 25247 SETREOUTSTR: ; Get the output redirection name + 25248 ; MSKK06 07/14/89 + 25249 00002E18 51 push cx ; save cx + 25250 00002E19 B94D00 mov cx,64+13 ; CX = max string length + 25251 SETREOUTSTR_LOOP: + 25252 00002E1C AC lodsb + 25253 00002E1D 3C0D cmp al,0Dh + 25254 00002E1F 741A je short GOTRESTR_J + 25255 00002E21 E86AFB call DELIM + 25256 00002E24 7415 jz short GOTRESTR_J + 25257 00002E26 3A06[F99B] cmp al,[SWITCHAR] + 25258 00002E2A 740F je short GOTRESTR_J + 25259 00002E2C 3C22 cmp al,'"' ; 22h ;AN033; Is the character a quote? + 25260 00002E2E 7421 je short PIPEERRSYNJ5_J + 25261 ;AN033; Yes - get out quick - or system crashes + 25262 00002E30 3C3C cmp al,'<' ; 3Ch + 25263 ;cmp al,labracket ;AN002; Is char for input redirection + 25264 00002E32 7404 je short ABRACKET_TERM + 25265 ;AN002; yes - end of string + 25266 00002E34 3C3E cmp al,'>' ; 3Eh + 25267 ;cmp al,rabracket ;AN002; Is char for output redirection + 25268 00002E36 7506 jne short NO_ABRACKET + 25269 ;AN002; no - not end of string + 25270 ABRACKET_TERM: ;AN002; have end of string by < or > + 25271 00002E38 4E dec si ;AN002; back up over symbol + 25272 00002E39 B020 mov al,20h ; BLANK ;AN002; show delimiter as char + 25273 GOTRESTR_J: + 25274 00002E3B 59 pop cx ; MSKK06 07/14/89 + 25275 00002E3C EB66 jmp short GOTRESTR ;AN002; go process it + 25276 NO_ABRACKET: ;AN002; NOT AT END OF STRING + 25277 00002E3E AA stosb ; store it into resgroup + 25278 + 25279 ; 05/08/2024 - PCDOS 7.1 COMMAND.COM + 25280 %if 1 + 25281 ;ifdef DBCS + 25282 ;invoke testkanj + 25283 ;jz short @f ; if not lead byte of DBCS + 25284 00002E3F E81FF9 call testkanj + 25285 00002E42 7409 jz short NO_ABRACKET_@ + 25286 00002E44 E3F5 jcxz GOTRESTR_J ; if no tail byte + 25287 00002E46 AC lodsb + 25288 00002E47 3C0D cmp al,0Dh + 25289 00002E49 74F0 jz short GOTRESTR_J ; if tail byte does't come and ends + 25290 00002E4B AA stosb ; copy tail byte + 25291 00002E4C 49 dec cx + 25292 ;@@: + 25293 NO_ABRACKET_@: ; 05/08/2024 + 25294 ;endif + 25295 %endif + 25296 + 25297 00002E4D E2CD loop SETREOUTSTR_LOOP + 25298 ; MSKK06 07/14/89 + 25299 00002E4F EBEA jmp short GOTRESTR_J + 25300 PIPEERRSYNJ5_J: + 25301 00002E51 59 pop cx ; recover CX + 25302 00002E52 EB4B jmp short PIPEERRSYNJ5 + 25303 + 25304 ; 26/02/2023 + 25305 ; ; MSDOS 3.3 + 25306 ;SETREOUTSTR_LOOP: ; Get the output redirection name + 25307 ; lodsb + 25308 ; cmp al,0Dh + 25309 ; jz short GOTRESTR + 25310 ; call DELIM + 25311 ; jz short GOTRESTR + 25312 ; cmp al,[SWITCHAR] + 25313 ; je short GOTRESTR + 25314 ; cmp al,'"' + 25315 ; jne short NO_ABRACKET + 25316 ; dec ch + 25317 ;NO_ABRACKET: + 25318 ; stosb + 25319 ; jmp short SETREOUTSTR_LOOP + 25320 + 25321 NOOUT: + 25322 ; 26/02/2023 + 25323 ; MSDOS 3.3 (& MSDOS 6.0) + 25324 00002E54 3C3C cmp al, '<' ; 3Ch + 25325 ;cmp al,labracket ; MSDOS 6.0 + 25326 ;;cmp al,[LABRACKET] ; MSDOS 3.3 + 25327 00002E56 7523 jne short CHKPIPE + 25328 00002E58 89F3 mov bx,si ; Save loc of "<" + 25329 00002E5A E829FB call scanoff + 25330 ; MSDOS 6.0 + 25331 00002E5D 3C3E cmp al,'>' ; 3Eh + 25332 ;cmp al,rabracket ;AN040; was there no filename? + 25333 00002E5F 7404 je short REIN_ERRSET ;AN040; yes - set up error + 25334 ; MSDOS 3.3 (& MSDOS 6.0) + 25335 00002E61 3C0D cmp al,0Dh + 25336 00002E63 750B jne short GOTREIFIL + 25337 REIN_ERRSET: ;AN040; set up for error + 25338 00002E65 C6050D mov byte [di],0Dh ; Clobber "<" + 25339 00002E68 C706[A09B]0900 mov word [RE_INSTR],9 + 25340 ; Cause an error later + 25341 00002E6E EB58 jmp short PRESCANEND + 25342 GOTREIFIL: + 25343 00002E70 57 push di + 25344 00002E71 BF[A09B] mov di,RE_INSTR + 25345 00002E74 89FB mov bx,di + 25346 00002E76 06 push es + 25347 00002E77 0E push cs + 25348 00002E78 07 pop es ; store in TRANGROUP + 25349 ; 26/04/2023 + 25350 ;jmp short SETREOUTSTR_LOOP ; MSDOS 3.3 COMMAND.COM + 25351 00002E79 EB9D jmp short SETREOUTSTR ; MSDOS 5.0 (& 6.0) COMMAND.COM + 25352 ; Get the input redirection name + 25353 CHKPIPE: + 25354 00002E7B 88C4 mov ah,al + 25355 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25356 00002E7D 80FC7C cmp ah,'|' ; 7Ch + 25357 ;cmp ah,ALTPIPECHR ; 7Ch + 25358 ;je short ISPIPE3 + 25359 ;; MSDOS 6.0 + 25360 ;cmp ah,'|' ; 7Ch + 25361 ;;cmp al,vbar ; 7Ch + 25362 ;;;cmp ah,[VBAR] ; MSDOS 3.3 + 25363 00002E80 7539 jne short CONTPRESCAN + 25364 ISPIPE3: + 25365 ; Only push the echo flag if we are entering the pipe for the first time. + 25366 + 25367 00002E82 26803E[1303]00 cmp byte [es:PipeFlag],0 + 25368 00002E88 7505 jne short NOECHOPUSH + 25369 00002E8A 26D026[9D02] shl byte [es:EchoFlag],1 ; push echo state and turn it off + 25370 NOECHOPUSH: + 25371 00002E8F 26FE06[1303] inc byte [es:PipeFlag] + 25372 00002E94 E8EFFA call scanoff + 25373 00002E97 3C0D cmp al,0Dh + 25374 00002E99 7404 je short PIPEERRSYNJ5 + 25375 ; 26/02/2023 + 25376 00002E9B 3C7C cmp al,'|' ; 7Ch + 25377 ;cmp al,ALTPIPECHR ; 7Ch + 25378 ;je short PIPEERRSYNJ5 + 25379 ;; MSDOS 6.0 + 25380 ;cmp al,'|' ; 7Ch + 25381 ;;cmp al,vbar ; 7Ch + 25382 ;;;cmp al,[VBAR] ; MSDOS 3.3 + 25383 00002E9D 751C jne short CONTPRESCAN + 25384 + 25385 PIPEERRSYNJ5: + 25386 00002E9F 06 push es + 25387 00002EA0 1F pop ds + 25388 00002EA1 E99E02 jmp PIPEERRSYN 25389 - 25390 GOTRESTR: - 25391 00002EA4 86E0 xchg ah,al - 25392 00002EA6 B03A mov al,':' ; 3Ah - 25393 00002EA8 29FB sub bx,di ; compute negative of number of chars - 25394 00002EAA 83FBFF cmp bx,-1 ; is there just a :? - 25395 00002EAD 7407 je short NOTRAILCOL ; yep, don't change - 25396 00002EAF 263845FF cmp [es:di-1],al ; Trailing ':' OK on devices - 25397 00002EB3 7501 jne short NOTRAILCOL - 25398 00002EB5 4F dec di ; Back up over trailing ':' - 25399 NOTRAILCOL: - 25400 00002EB6 30C0 xor al,al - 25401 00002EB8 AA stosb ; NUL terminate the string - 25402 00002EB9 07 pop es - 25403 00002EBA 5F pop di ; Remember the start - 25404 CONTPRESCAN: - 25405 00002EBB 8825 mov [di],ah ; "delete" the redirection string - 25406 00002EBD 47 inc di - 25407 00002EBE 80FC0D cmp ah,0Dh - 25408 00002EC1 7405 je short PRESCANEND - 25409 00002EC3 FEC1 inc cl - 25410 00002EC5 E9FDFE jmp PRESCANLP - 25411 PRESCANEND: - 25412 00002EC8 26803E[1303]00 cmp byte [es:PipeFlag],0 - 25413 00002ECE 7414 jz short ISNOPIPE - 25414 - 25415 ; 11/06/2023 - 25416 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:314Ah - 25417 ;mov di,48Ah ; PipeStr ; RESGROUP:EndInit+160 - 25418 ;mov [es:488h],di ; [es:PipePtr],di - 25419 ; (RESGROUP:EndInit+158) - 25420 ; 26/02/2023 - 25421 ;;MSDOS 5.0 COMMAND.COM - TRANGROUP:2BA0h - 25422 ;;mov di,3C0h ; offset RESGROUP:PIPESTR - 25423 ;; ; (EndInit+160] - 25424 - 25425 ; 05/08/2024 - 25426 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2FEAh - 25427 ;mov di,4BEh ; PipeStr ; RESGROUP:EndInit+160 - 25428 ;mov [es:4BCh],di ; (RESGROUP:EndInit+158) - 25429 - 25430 ;mov di,offset RESGROUP:PIPESTR - 25431 00002ED0 BF[B503] mov di,PipeStr ; RESGROUP:EndInit+160 + 25390 ; Trailing :s are allowed on devices. Check to be sure that there is more + 25391 ; than just a : in the redir string. + 25392 + 25393 GOTRESTR: + 25394 00002EA4 86E0 xchg ah,al + 25395 00002EA6 B03A mov al,':' ; 3Ah + 25396 00002EA8 29FB sub bx,di ; compute negative of number of chars + 25397 00002EAA 83FBFF cmp bx,-1 ; is there just a :? + 25398 00002EAD 7407 je short NOTRAILCOL ; yep, don't change + 25399 00002EAF 263845FF cmp [es:di-1],al ; Trailing ':' OK on devices + 25400 00002EB3 7501 jne short NOTRAILCOL + 25401 00002EB5 4F dec di ; Back up over trailing ':' + 25402 NOTRAILCOL: + 25403 00002EB6 30C0 xor al,al + 25404 00002EB8 AA stosb ; NUL terminate the string + 25405 00002EB9 07 pop es + 25406 00002EBA 5F pop di ; Remember the start + 25407 CONTPRESCAN: + 25408 00002EBB 8825 mov [di],ah ; "delete" the redirection string + 25409 00002EBD 47 inc di + 25410 00002EBE 80FC0D cmp ah,0Dh + 25411 00002EC1 7405 je short PRESCANEND + 25412 00002EC3 FEC1 inc cl + 25413 00002EC5 E9FDFE jmp PRESCANLP + 25414 PRESCANEND: + 25415 00002EC8 26803E[1303]00 cmp byte [es:PipeFlag],0 + 25416 00002ECE 7414 jz short ISNOPIPE + 25417 + 25418 ; 11/06/2023 + 25419 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:314Ah + 25420 ;mov di,48Ah ; PipeStr ; RESGROUP:EndInit+160 + 25421 ;mov [es:488h],di ; [es:PipePtr],di + 25422 ; (RESGROUP:EndInit+158) + 25423 ; 26/02/2023 + 25424 ;;MSDOS 5.0 COMMAND.COM - TRANGROUP:2BA0h + 25425 ;;mov di,3C0h ; offset RESGROUP:PIPESTR + 25426 ;; ; (EndInit+160] + 25427 + 25428 ; 05/08/2024 + 25429 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:2FEAh + 25430 ;mov di,4BEh ; PipeStr ; RESGROUP:EndInit+160 + 25431 ;mov [es:4BCh],di ; (RESGROUP:EndInit+158) 25432 - 25433 ;;MSDOS 5.0 COMMAND.COM - TRANGROUP:2BA3h - 25434 ;;mov [es:3BEh],di ; [es:EndInit+158] - 25435 00002ED3 26893E[B303] mov [es:PipePtr],di ; RESGROUP:EndInit+158 - 25436 - 25437 00002ED8 BE[569A] mov si,COMBUF+2 - 25438 00002EDB E8A8FA call scanoff - 25439 PIPESETLP: ; Transfer the pipe into the resident - 25440 00002EDE AC lodsb ; pipe buffer - 25441 00002EDF AA stosb - 25442 00002EE0 3C0D cmp al,0Dh - 25443 00002EE2 75FA jnz short PIPESETLP - 25444 ISNOPIPE: - 25445 00002EE4 880E[559A] mov [COMBUF+1],cl - 25446 00002EE8 26803E[1303]00 cmp byte [es:PipeFlag],0 ; [es:41Ch] ; PCDOS 7.1 COMMAND.COM - 25447 00002EEE 0E push cs - 25448 00002EEF 07 pop es - 25449 00002EF0 C3 retn - 25450 - 25451 ; =============== S U B R O U T I N E ======================================= - 25452 - 25453 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25454 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2BC1h - 25455 cmd_copy: - 25456 00002EF1 BE[569A] mov si,COMBUF+2 - 25457 00002EF4 E88FFA call scanoff ; advance past separators... - 25458 00002EF7 0336[8F9D] add si,[PathPos] - 25459 00002EFB BF8100 mov di,81h - 25460 00002EFE 31C9 xor cx,cx - 25461 cmdcopy: - 25462 00002F00 AC lodsb - 25463 00002F01 AA stosb - 25464 00002F02 3C0D cmp al,0Dh - 25465 00002F04 7403 je short copy_done - 25466 00002F06 41 inc cx - 25467 00002F07 EBF7 jmp short cmdcopy - 25468 copy_done: - 25469 00002F09 880E8000 mov [80h],cl - 25470 00002F0D C3 retn - 25471 - 25472 ; =============== S U B R O U T I N E ======================================= - 25473 - 25474 ; 25/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25475 test_append: - 25476 00002F0E BB[549A] mov bx,COMBUF ; barry can address - 25477 00002F11 BE[BA9C] mov si,IDLEN ; address command name, DS already set - 25478 00002F14 BAFFFF mov dx,-1 - 25479 00002F17 B800AE mov ax,0AE00h - 25480 00002F1A CD2F int 2Fh ; - Multiplex - DOS 3.3+ internal - 25481 ; - INSTALLABLE COMMAND - INSTALL CHECK - 25482 ; DX = FFFFh,[BX -> command line - 25483 ; Return: AL = FFh if this command is a TSR extension - 25484 ; to COMMAND.COM - 25485 ; AL = 00h if the command should be executed as usual - 25486 ;cmp al,0 - 25487 00002F1C 08C0 or al,al ; 25/02/2023 - 25488 00002F1E C3 retn - 25489 - 25490 ; 25/02/2023 - 25491 ; INT 2Fh - 25492 ; AX = AE00h - 25493 ; entry: - 25494 ; DX = magic value FFFFh - 25495 ; CH = FFh - 25496 ; CL = length of command line tail - 25497 ; DS:BX -> command line buffer -- (offset COMBUF) - 25498 ; DS:SI -> command name buffer -- (offset IDLEN) - 25499 ; return: - 25500 ; AL = FFh if this command is a TSR extension to COMMAND.COM - 25501 ; AL = 00h if the command should be executed as usual - 25502 ; - 25503 ; Format of COMMAND.COM command line buffer: - 25504 ; Offset Size Description - 25505 ; 00h BYTE max length of command line, as in INT 21/AH=0Ah - 25506 ; 01h BYTE count of bytes to follow, excluding terminating 0Dh - 25507 ; N BYTEs command line text, terminated by 0Dh - 25508 ; - 25509 ; Format of command name buffer: - 25510 ; Offset Size Description - 25511 ; 00h BYTE length of command name - 25512 ; 01h N BYTEs uppercased command name (blank-padded to 11 chars) - 25513 - 25514 ;============================================================================ - 25515 ; TMISC2.ASM, MSDOS 6.0, 1991 - 25516 ;============================================================================ - 25517 ; 05/10/2018 - Retro DOS v3.0 - 25518 - 25519 ; More misc routines - 25520 - 25521 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1D9Bh - 25522 - 25523 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25524 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2BEFh + 25433 ;mov di,offset RESGROUP:PIPESTR + 25434 00002ED0 BF[B503] mov di,PipeStr ; RESGROUP:EndInit+160 + 25435 + 25436 ;;MSDOS 5.0 COMMAND.COM - TRANGROUP:2BA3h + 25437 ;;mov [es:3BEh],di ; [es:EndInit+158] + 25438 00002ED3 26893E[B303] mov [es:PipePtr],di ; RESGROUP:EndInit+158 + 25439 + 25440 00002ED8 BE[569A] mov si,COMBUF+2 + 25441 00002EDB E8A8FA call scanoff + 25442 PIPESETLP: ; Transfer the pipe into the resident + 25443 00002EDE AC lodsb ; pipe buffer + 25444 00002EDF AA stosb + 25445 00002EE0 3C0D cmp al,0Dh + 25446 00002EE2 75FA jnz short PIPESETLP + 25447 ISNOPIPE: + 25448 00002EE4 880E[559A] mov [COMBUF+1],cl + 25449 00002EE8 26803E[1303]00 cmp byte [es:PipeFlag],0 ; [es:41Ch] ; PCDOS 7.1 COMMAND.COM + 25450 00002EEE 0E push cs + 25451 00002EEF 07 pop es + 25452 00002EF0 C3 retn + 25453 + 25454 ; =============== S U B R O U T I N E ======================================= + 25455 + 25456 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25457 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2BC1h + 25458 cmd_copy: + 25459 00002EF1 BE[569A] mov si,COMBUF+2 + 25460 00002EF4 E88FFA call scanoff ; advance past separators... + 25461 00002EF7 0336[8F9D] add si,[PathPos] + 25462 00002EFB BF8100 mov di,81h + 25463 00002EFE 31C9 xor cx,cx + 25464 cmdcopy: + 25465 00002F00 AC lodsb + 25466 00002F01 AA stosb + 25467 00002F02 3C0D cmp al,0Dh + 25468 00002F04 7403 je short copy_done + 25469 00002F06 41 inc cx + 25470 00002F07 EBF7 jmp short cmdcopy + 25471 copy_done: + 25472 00002F09 880E8000 mov [80h],cl + 25473 00002F0D C3 retn + 25474 + 25475 ; =============== S U B R O U T I N E ======================================= + 25476 + 25477 ; 25/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25478 test_append: + 25479 00002F0E BB[549A] mov bx,COMBUF ; barry can address + 25480 00002F11 BE[BA9C] mov si,IDLEN ; address command name, DS already set + 25481 00002F14 BAFFFF mov dx,-1 + 25482 00002F17 B800AE mov ax,0AE00h + 25483 00002F1A CD2F int 2Fh ; - Multiplex - DOS 3.3+ internal + 25484 ; - INSTALLABLE COMMAND - INSTALL CHECK + 25485 ; DX = FFFFh,[BX -> command line + 25486 ; Return: AL = FFh if this command is a TSR extension + 25487 ; to COMMAND.COM + 25488 ; AL = 00h if the command should be executed as usual + 25489 ;cmp al,0 + 25490 00002F1C 08C0 or al,al ; 25/02/2023 + 25491 00002F1E C3 retn + 25492 + 25493 ; 25/02/2023 + 25494 ; INT 2Fh + 25495 ; AX = AE00h + 25496 ; entry: + 25497 ; DX = magic value FFFFh + 25498 ; CH = FFh + 25499 ; CL = length of command line tail + 25500 ; DS:BX -> command line buffer -- (offset COMBUF) + 25501 ; DS:SI -> command name buffer -- (offset IDLEN) + 25502 ; return: + 25503 ; AL = FFh if this command is a TSR extension to COMMAND.COM + 25504 ; AL = 00h if the command should be executed as usual + 25505 ; + 25506 ; Format of COMMAND.COM command line buffer: + 25507 ; Offset Size Description + 25508 ; 00h BYTE max length of command line, as in INT 21/AH=0Ah + 25509 ; 01h BYTE count of bytes to follow, excluding terminating 0Dh + 25510 ; N BYTEs command line text, terminated by 0Dh + 25511 ; + 25512 ; Format of command name buffer: + 25513 ; Offset Size Description + 25514 ; 00h BYTE length of command name + 25515 ; 01h N BYTEs uppercased command name (blank-padded to 11 chars) + 25516 + 25517 ;============================================================================ + 25518 ; TMISC2.ASM, MSDOS 6.0, 1991 + 25519 ;============================================================================ + 25520 ; 05/10/2018 - Retro DOS v3.0 + 25521 + 25522 ; More misc routines + 25523 + 25524 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1D9Bh 25525 - 25526 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 25527 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3199h + 25526 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25527 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2BEFh 25528 - 25529 ; 05/08/2024 - Retro DOS v5.0 COMMAND.COM - 25530 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 3039h + 25529 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 25530 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3199h 25531 - 25532 ; =============== S U B R O U T I N E ======================================= - 25533 - 25534 SETPATH: - 25535 - 25536 ; ENTRY PathPos = ptr to string - 25537 ; PathCnt = length of string - 25538 ; - 25539 ; EXIT PathPos = ptr to string after pathname - 25540 ; PathCnt = length of rest of string - 25541 ; DX = ptr to pathname in string, made ASCIIZ - 25542 ; DestIsDir = 1 if pathname delimiters appeared in pathname, 0 otherwise - 25543 ; DestInfo = 2 if wildcards (?, *) appeared in pathname, 0 otherwise - 25544 ; - 25545 ; A null character is dropped at the end of the pathname. If the - 25546 ; character in that spot previously was CR, it is copied into the - 25547 ; following byte. So there must be at least two two character - 25548 ; positions in the buffer following the pathname. - 25549 - 25550 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25551 - 25552 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 25553 ; MSDOS 6.0 - 25554 ;mov ax,[PathCnt] ;AC000; get length of string - 25555 ;mov si,[PathPos] ;AC000; get start of source buffer - 25556 - 25557 ; 26/02/2023 - 25558 ; MSDOS 3.3 - 25559 ;mov si,80h - 25560 ;lodsb - 25561 ;xor ah,ah - 25562 ;mov [PATCNT],ax - 25563 ;mov [PATHPOS],si - 25564 GETPATH: - 25565 ; MSDOS 3.3 (& MSDOS 6.0) - 25566 00002F1F C606[BD9D]00 mov byte [DestInfo],0 - 25567 00002F24 C606[B99D]00 mov byte [DestIsDir],0 - 25568 00002F29 8B36[8F9D] mov si,[PathPos] ; SI = ptr to string - 25569 00002F2D 8B0E[8D9D] mov cx,[PathCnt] ; CX = string length - 25570 00002F31 89F2 mov dx,si ; DX = ptr to string - 25571 00002F33 E34D jcxz PATHDONE ; string length is zero, we're done - 25572 00002F35 51 push cx ; save string length - 25573 00002F36 56 push si ; save ptr to string - 25574 00002F37 E80AFC call SWITCH - 25575 - 25576 ; After Switch, SI has been scanned past any switches, and - 25577 ; switches that COMMAND intrinsically recognizes are recorded in AX. + 25532 ; 05/08/2024 - Retro DOS v5.0 COMMAND.COM + 25533 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 3039h + 25534 + 25535 ; =============== S U B R O U T I N E ======================================= + 25536 + 25537 SETPATH: + 25538 + 25539 ; ENTRY PathPos = ptr to string + 25540 ; PathCnt = length of string + 25541 ; + 25542 ; EXIT PathPos = ptr to string after pathname + 25543 ; PathCnt = length of rest of string + 25544 ; DX = ptr to pathname in string, made ASCIIZ + 25545 ; DestIsDir = 1 if pathname delimiters appeared in pathname, 0 otherwise + 25546 ; DestInfo = 2 if wildcards (?, *) appeared in pathname, 0 otherwise + 25547 ; + 25548 ; A null character is dropped at the end of the pathname. If the + 25549 ; character in that spot previously was CR, it is copied into the + 25550 ; following byte. So there must be at least two two character + 25551 ; positions in the buffer following the pathname. + 25552 + 25553 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25554 + 25555 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 25556 ; MSDOS 6.0 + 25557 ;mov ax,[PathCnt] ;AC000; get length of string + 25558 ;mov si,[PathPos] ;AC000; get start of source buffer + 25559 + 25560 ; 26/02/2023 + 25561 ; MSDOS 3.3 + 25562 ;mov si,80h + 25563 ;lodsb + 25564 ;xor ah,ah + 25565 ;mov [PATCNT],ax + 25566 ;mov [PATHPOS],si + 25567 GETPATH: + 25568 ; MSDOS 3.3 (& MSDOS 6.0) + 25569 00002F1F C606[BD9D]00 mov byte [DestInfo],0 + 25570 00002F24 C606[B99D]00 mov byte [DestIsDir],0 + 25571 00002F29 8B36[8F9D] mov si,[PathPos] ; SI = ptr to string + 25572 00002F2D 8B0E[8D9D] mov cx,[PathCnt] ; CX = string length + 25573 00002F31 89F2 mov dx,si ; DX = ptr to string + 25574 00002F33 E34D jcxz PATHDONE ; string length is zero, we're done + 25575 00002F35 51 push cx ; save string length + 25576 00002F36 56 push si ; save ptr to string + 25577 00002F37 E80AFC call SWITCH 25578 - 25579 00002F3A A3[919D] mov [PathSw],ax ; PathSw = switch occurrence mask - 25580 00002F3D 5B pop bx ; BX = ptr to original string - 25581 00002F3E 29F3 sub bx,si ; BX = -(# chars scanned by Switch) - 25582 00002F40 59 pop cx ; CX = string length - 25583 00002F41 01D9 add cx,bx ; CX = string length from current SI - 25584 00002F43 89F2 mov dx,si ; DX = ptr to current string - 25585 SKIPPATH: - 25586 ; 26/02/2023 - 25587 ; MSDOS 6.0 - 25588 00002F45 C606[4F9F]00 mov byte [KPARSE],0 - 25589 SKIPPATH2: - 25590 00002F4A E336 jcxz PATHDONE ; string length is zero, we're done - 25591 00002F4C 49 dec cx ; CX = length left after next char - 25592 00002F4D AC lodsb ; AL = next char of string - 25593 ; SI = ptr to char after this one - 25594 ; 26/02/2023 - 25595 00002F4E E810F8 call testkanj - 25596 00002F51 7408 jz short TESTPPSEP - 25597 00002F53 49 dec cx - 25598 00002F54 46 inc si - 25599 00002F55 FE06[4F9F] inc byte [KPARSE] - 25600 00002F59 EBEF jmp short SKIPPATH2 - 25601 TESTPPSEP: - 25602 00002F5B E8B6FA call pathchrcmp ; compare AL to path delimiter char - 25603 00002F5E 7504 jnz short TESTPMETA ; it's not a path delim - 25604 00002F60 FE06[B99D] inc byte [DestIsDir] - 25605 ; DestIsDir = 1, signalling path char - 25606 TESTPMETA: - 25607 00002F64 3C3F cmp al,'?' - 25608 00002F66 7505 jne short TESTPSTAR ; char is not '?' - 25609 00002F68 800E[BD9D]02 or byte [DestInfo],2 ; DestInfo = 2, signalling wildcard - 25610 TESTPSTAR: - 25611 00002F6D 3C2A cmp al,'*' - 25612 ;cmp al,[STAR] ; MSDOS 3.3 - 25613 00002F6F 7505 jne short TESTPDELIM ; char is not '*' - 25614 00002F71 800E[BD9D]02 or byte [DestInfo],2 ; DestInfo = 2, signalling wildcard - 25615 TESTPDELIM: - 25616 00002F76 E815FA call DELIM ; compare AL to all delimiters - 25617 00002F79 7406 jz short PATHDONEDEC ; delimiter found, back up & leave - 25618 00002F7B 3A06[F99B] cmp al,[SWITCHAR] - 25619 00002F7F 75C4 jne short SKIPPATH ; char isn't switch, go get next char - 25620 PATHDONEDEC: - 25621 00002F81 4E dec si ; SI = ptr to char after pathname - 25622 PATHDONE: - 25623 00002F82 30C0 xor al,al ; AL = NULL - 25624 00002F84 8604 xchg al,[si] ; place NULL after pathname - 25625 00002F86 46 inc si ; SI = ptr to byte after NULL - 25626 00002F87 3C0D cmp al,0Dh ; were we at end of line? - 25627 00002F89 7502 jne short NOPSTORE ; not EOL, finish up - 25628 00002F8B 8804 mov [si],al ; save EOL after NULL - 25629 NOPSTORE: - 25630 00002F8D 8936[8F9D] mov [PathPos],si ; PathPos = ptr to char after NULL - 25631 00002F91 890E[8D9D] mov [PathCnt],cx ; PathCnt = length of string left - 25632 SETPATH_RETN: - 25633 00002F95 C3 retn - 25634 - 25635 ; --------------------------------------------------------------------------- - 25636 - 25637 PGETARG: - 25638 00002F96 BE8000 mov si,80h - 25639 00002F99 AC lodsb - 25640 00002F9A 08C0 or al,al - 25641 00002F9C 74F7 jz short SETPATH_RETN - 25642 00002F9E E80300 call PSCANOFF - 25643 00002FA1 3C0D cmp al,0Dh - 25644 00002FA3 C3 retn - 25645 - 25646 ; --------------------------------------------------------------------------- - 25647 - 25648 PSCANOFF: - 25649 00002FA4 AC lodsb - 25650 00002FA5 E8E6F9 call DELIM - 25651 00002FA8 7504 jnz short PSCANOFFD - 25652 00002FAA 3C3B cmp al,';' ; 3Bh - 25653 00002FAC 75F6 jne short PSCANOFF ; ';' is not a delimiter - 25654 PSCANOFFD: - 25655 00002FAE 4E dec si ; Point to first non-delimiter - 25656 00002FAF C3 retn - 25657 - 25658 ; =============== S U B R O U T I N E ======================================= - 25659 - 25660 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25661 IOSET: - 25662 ; ALL REGISTERS PRESERVED - 25663 00002FB0 1E push ds - 25664 00002FB1 52 push dx - 25665 00002FB2 50 push ax - 25666 00002FB3 53 push bx - 25667 00002FB4 51 push cx - 25668 00002FB5 2E8E1E[F59B] mov ds,[cs:RESSEG] - 25669 00002FBA 803E[1303]00 cmp byte [PipeFlag],0 - 25670 00002FBF 750D jne short NOREDIR - 25671 00002FC1 F606[AA02]FF test byte [IfFlag],0FFh - 25672 00002FC6 7506 jnz short NOREDIR - 25673 00002FC8 E88C00 call TESTDOREIN - 25674 00002FCB E80600 call TESTDOREOUT - 25675 NOREDIR: - 25676 00002FCE 59 pop cx - 25677 00002FCF 5B pop bx - 25678 00002FD0 58 pop ax - 25679 00002FD1 5A pop dx - 25680 00002FD2 1F pop ds - 25681 IOSET_RETN: ; 06/08/2024 - 25682 00002FD3 C3 retn - 25683 - 25684 ; =============== S U B R O U T I N E ======================================= - 25685 - 25686 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25687 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2CF3h + 25579 ; After Switch, SI has been scanned past any switches, and + 25580 ; switches that COMMAND intrinsically recognizes are recorded in AX. + 25581 + 25582 00002F3A A3[919D] mov [PathSw],ax ; PathSw = switch occurrence mask + 25583 00002F3D 5B pop bx ; BX = ptr to original string + 25584 00002F3E 29F3 sub bx,si ; BX = -(# chars scanned by Switch) + 25585 00002F40 59 pop cx ; CX = string length + 25586 00002F41 01D9 add cx,bx ; CX = string length from current SI + 25587 00002F43 89F2 mov dx,si ; DX = ptr to current string + 25588 SKIPPATH: + 25589 ; 26/02/2023 + 25590 ; MSDOS 6.0 + 25591 00002F45 C606[4F9F]00 mov byte [KPARSE],0 + 25592 SKIPPATH2: + 25593 00002F4A E336 jcxz PATHDONE ; string length is zero, we're done + 25594 00002F4C 49 dec cx ; CX = length left after next char + 25595 00002F4D AC lodsb ; AL = next char of string + 25596 ; SI = ptr to char after this one + 25597 ; 26/02/2023 + 25598 00002F4E E810F8 call testkanj + 25599 00002F51 7408 jz short TESTPPSEP + 25600 00002F53 49 dec cx + 25601 00002F54 46 inc si + 25602 00002F55 FE06[4F9F] inc byte [KPARSE] + 25603 00002F59 EBEF jmp short SKIPPATH2 + 25604 TESTPPSEP: + 25605 00002F5B E8B6FA call pathchrcmp ; compare AL to path delimiter char + 25606 00002F5E 7504 jnz short TESTPMETA ; it's not a path delim + 25607 00002F60 FE06[B99D] inc byte [DestIsDir] + 25608 ; DestIsDir = 1, signalling path char + 25609 TESTPMETA: + 25610 00002F64 3C3F cmp al,'?' + 25611 00002F66 7505 jne short TESTPSTAR ; char is not '?' + 25612 00002F68 800E[BD9D]02 or byte [DestInfo],2 ; DestInfo = 2, signalling wildcard + 25613 TESTPSTAR: + 25614 00002F6D 3C2A cmp al,'*' + 25615 ;cmp al,[STAR] ; MSDOS 3.3 + 25616 00002F6F 7505 jne short TESTPDELIM ; char is not '*' + 25617 00002F71 800E[BD9D]02 or byte [DestInfo],2 ; DestInfo = 2, signalling wildcard + 25618 TESTPDELIM: + 25619 00002F76 E815FA call DELIM ; compare AL to all delimiters + 25620 00002F79 7406 jz short PATHDONEDEC ; delimiter found, back up & leave + 25621 00002F7B 3A06[F99B] cmp al,[SWITCHAR] + 25622 00002F7F 75C4 jne short SKIPPATH ; char isn't switch, go get next char + 25623 PATHDONEDEC: + 25624 00002F81 4E dec si ; SI = ptr to char after pathname + 25625 PATHDONE: + 25626 00002F82 30C0 xor al,al ; AL = NULL + 25627 00002F84 8604 xchg al,[si] ; place NULL after pathname + 25628 00002F86 46 inc si ; SI = ptr to byte after NULL + 25629 00002F87 3C0D cmp al,0Dh ; were we at end of line? + 25630 00002F89 7502 jne short NOPSTORE ; not EOL, finish up + 25631 00002F8B 8804 mov [si],al ; save EOL after NULL + 25632 NOPSTORE: + 25633 00002F8D 8936[8F9D] mov [PathPos],si ; PathPos = ptr to char after NULL + 25634 00002F91 890E[8D9D] mov [PathCnt],cx ; PathCnt = length of string left + 25635 SETPATH_RETN: + 25636 00002F95 C3 retn + 25637 + 25638 ; --------------------------------------------------------------------------- + 25639 + 25640 PGETARG: + 25641 00002F96 BE8000 mov si,80h + 25642 00002F99 AC lodsb + 25643 00002F9A 08C0 or al,al + 25644 00002F9C 74F7 jz short SETPATH_RETN + 25645 00002F9E E80300 call PSCANOFF + 25646 00002FA1 3C0D cmp al,0Dh + 25647 00002FA3 C3 retn + 25648 + 25649 ; --------------------------------------------------------------------------- + 25650 + 25651 PSCANOFF: + 25652 00002FA4 AC lodsb + 25653 00002FA5 E8E6F9 call DELIM + 25654 00002FA8 7504 jnz short PSCANOFFD + 25655 00002FAA 3C3B cmp al,';' ; 3Bh + 25656 00002FAC 75F6 jne short PSCANOFF ; ';' is not a delimiter + 25657 PSCANOFFD: + 25658 00002FAE 4E dec si ; Point to first non-delimiter + 25659 00002FAF C3 retn + 25660 + 25661 ; =============== S U B R O U T I N E ======================================= + 25662 + 25663 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25664 IOSET: + 25665 ; ALL REGISTERS PRESERVED + 25666 00002FB0 1E push ds + 25667 00002FB1 52 push dx + 25668 00002FB2 50 push ax + 25669 00002FB3 53 push bx + 25670 00002FB4 51 push cx + 25671 00002FB5 2E8E1E[F59B] mov ds,[cs:RESSEG] + 25672 00002FBA 803E[1303]00 cmp byte [PipeFlag],0 + 25673 00002FBF 750D jne short NOREDIR + 25674 00002FC1 F606[AA02]FF test byte [IfFlag],0FFh + 25675 00002FC6 7506 jnz short NOREDIR + 25676 00002FC8 E88C00 call TESTDOREIN + 25677 00002FCB E80600 call TESTDOREOUT + 25678 NOREDIR: + 25679 00002FCE 59 pop cx + 25680 00002FCF 5B pop bx + 25681 00002FD0 58 pop ax + 25682 00002FD1 5A pop dx + 25683 00002FD2 1F pop ds + 25684 IOSET_RETN: ; 06/08/2024 + 25685 00002FD3 C3 retn + 25686 + 25687 ; =============== S U B R O U T I N E ======================================= 25688 - 25689 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 25690 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:313Dh - 25691 TESTDOREOUT: - 25692 00002FD4 803E[C202]00 cmp byte [Re_OutStr],0 - 25693 ;je short NOREOUT ; MSDOS 3.3 - 25694 ; 26/02/2023 - 25695 ;jne short REOUTEXISTS - 25696 ;jmp NOREOUT - 25697 ; 06/08/2024 - 25698 00002FD9 74F8 jz short IOSET_RETN - 25699 REOUTEXISTS: - 25700 00002FDB 803E[C102]00 cmp byte [Re_Out_App],0 - 25701 00002FE0 745D je short REOUTCRT - 25702 - 25703 00002FE2 BA[C202] mov dx,Re_OutStr - 25704 - 25705 ; 26/02/2023 - 25706 ; MSDOS 6.0 - 25707 ;mov ax,(OPEN SHL 8) OR 2 ;AC011; Open for read/write - 25708 00002FE5 B8023D mov ax,3D02h - 25709 ; MSDOS 3.3 - 25710 ;mov ax,(OPEN<<8)|1 ; 3D01h ; Open for write - 25711 - 25712 ; MSDOS 3.3 (& MSDOS 6.0) - 25713 00002FE8 50 push ax - 25714 00002FE9 CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 25715 ; DS:DX -> ASCIZ filename - 25716 ; AL = access mode - 25717 ; 1 - write - 25718 00002FEB 5B pop bx - 25719 00002FEC 724B jc short OpenWriteError - 25720 - 25721 ; 26/02/2023 - 25722 ; MSDOS 6.0 - 25723 00002FEE 89C3 mov bx,ax - 25724 ;mov ax,IOCTL<<8 ;AN035; Get attributes of handle - 25725 00002FF0 B80044 mov ax,4400h - 25726 00002FF3 CD21 int 21h ;AN035; - 25727 ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 25728 ; BX = file or device handle - 25729 00002FF5 F6C280 test dl,80h - 25730 ;test dl,devid_ISDEV ;AN035; Is it a device? - 25731 00002FF8 7554 jnz short SET_REOUT ;AN035; Yes, don't read from it - 25732 - 25733 ;mov ax,(LSEEK SHL 8) OR 2 - 25734 00002FFA B80242 mov ax,4202h - 25735 00002FFD B9FFFF mov cx,-1 ;AC011; MOVE TO EOF -1 - 25736 00003000 89CA mov dx,cx ;AC011; - 25737 00003002 CD21 int 21h - 25738 ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) - 25739 ; AL = method: offset from end of file - 25740 00003004 0E push cs ;AN011; Get transient seg to DS - 25741 00003005 1F pop ds ;AN011; - 25742 - 25743 ;mov ax,(READ SHL 8) ;AN011; Read one byte from the - 25744 00003006 B8003F mov ax,3F00h - 25745 00003009 B90100 mov cx,1 ;AN011; file into one_char_val - 25746 0000300C BA[B19D] mov dx,One_Char_Val ;AN011; - 25747 0000300F CD21 int 21h ;AN011; - 25748 ; DOS - 2+ - READ FROM FILE WITH HANDLE - 25749 ; BX = file handle, CX = number of bytes to read - 25750 ; DS:DX -> buffer - 25751 00003011 7226 jc short OpenWriteError ;AN011; If error, exit - 25752 00003013 39C8 cmp ax,cx ;AN017; Did we read 1 byte? - 25753 00003015 7517 jnz short reout_0_length ;AN017; No - file must be 0 length - 25754 - 25755 00003017 803E[B19D]1A cmp byte [One_Char_Val],1Ah ;AN011; Was char an eof mark? - 25756 0000301C 8E1E[F59B] mov ds,[RESSEG] ;AN011; Get resident segment back - 25757 00003020 752C jne short SET_REOUT ;AN011; No, just continue - 25758 - 25759 ;mov ax,(LSEEK<<8)|1 ;AN011; EOF mark found - 25760 00003022 B80142 mov ax,4201h - 25761 00003025 B9FFFF mov cx,-1 ;AN011; LSEEK back one byte - 25762 setreout_p: ; 26/02/2023 - 25763 00003028 89CA mov dx,cx ;AN011; - 25764 0000302A CD21 int 21h ;AN011; - 25765 0000302C EB20 jmp short SET_REOUT - 25766 reout_0_length: ;AN017; We have a 0 length file - 25767 ; ds = cs ; 26/02/2023 - 25768 ;mov ds,[cs:RESSEG] ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2D50h - 25769 ;AN017; Get resident segment back - 25770 ; 26/02/2023 - 25771 0000302E 8E1E[F59B] mov ds,[RESSEG] - 25772 ;mov ax,(LSEEK SHL 8) ;AN017; Move to beginning of file - 25773 00003032 B80042 mov ax,4200h - 25774 00003035 31C9 xor cx,cx ;AN017; Offset is 0 - 25775 ;mov dx,cx ;AN017; - 25776 ;int 21h ;AN017; - 25777 ;jmp short SET_REOUT ;AN017; now finish setting up redirection - 25778 ; 26/02/2023 - 25779 00003037 EBEF jmp short setreout_p - 25780 + 25689 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25690 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2CF3h + 25691 + 25692 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 25693 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:313Dh + 25694 TESTDOREOUT: + 25695 00002FD4 803E[C202]00 cmp byte [Re_OutStr],0 + 25696 ;je short NOREOUT ; MSDOS 3.3 + 25697 ; 26/02/2023 + 25698 ;jne short REOUTEXISTS + 25699 ;jmp NOREOUT + 25700 ; 06/08/2024 + 25701 00002FD9 74F8 jz short IOSET_RETN + 25702 REOUTEXISTS: + 25703 00002FDB 803E[C102]00 cmp byte [Re_Out_App],0 + 25704 00002FE0 745D je short REOUTCRT + 25705 + 25706 00002FE2 BA[C202] mov dx,Re_OutStr + 25707 + 25708 ; 26/02/2023 + 25709 ; MSDOS 6.0 + 25710 ;mov ax,(OPEN SHL 8) OR 2 ;AC011; Open for read/write + 25711 00002FE5 B8023D mov ax,3D02h + 25712 ; MSDOS 3.3 + 25713 ;mov ax,(OPEN<<8)|1 ; 3D01h ; Open for write + 25714 + 25715 ; MSDOS 3.3 (& MSDOS 6.0) + 25716 00002FE8 50 push ax + 25717 00002FE9 CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 25718 ; DS:DX -> ASCIZ filename + 25719 ; AL = access mode + 25720 ; 1 - write + 25721 00002FEB 5B pop bx + 25722 00002FEC 724B jc short OpenWriteError + 25723 + 25724 ; 26/02/2023 + 25725 ; MSDOS 6.0 + 25726 00002FEE 89C3 mov bx,ax + 25727 ;mov ax,IOCTL<<8 ;AN035; Get attributes of handle + 25728 00002FF0 B80044 mov ax,4400h + 25729 00002FF3 CD21 int 21h ;AN035; + 25730 ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 25731 ; BX = file or device handle + 25732 00002FF5 F6C280 test dl,80h + 25733 ;test dl,devid_ISDEV ;AN035; Is it a device? + 25734 00002FF8 7554 jnz short SET_REOUT ;AN035; Yes, don't read from it + 25735 + 25736 ;mov ax,(LSEEK SHL 8) OR 2 + 25737 00002FFA B80242 mov ax,4202h + 25738 00002FFD B9FFFF mov cx,-1 ;AC011; MOVE TO EOF -1 + 25739 00003000 89CA mov dx,cx ;AC011; + 25740 00003002 CD21 int 21h + 25741 ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) + 25742 ; AL = method: offset from end of file + 25743 00003004 0E push cs ;AN011; Get transient seg to DS + 25744 00003005 1F pop ds ;AN011; + 25745 + 25746 ;mov ax,(READ SHL 8) ;AN011; Read one byte from the + 25747 00003006 B8003F mov ax,3F00h + 25748 00003009 B90100 mov cx,1 ;AN011; file into one_char_val + 25749 0000300C BA[B19D] mov dx,One_Char_Val ;AN011; + 25750 0000300F CD21 int 21h ;AN011; + 25751 ; DOS - 2+ - READ FROM FILE WITH HANDLE + 25752 ; BX = file handle, CX = number of bytes to read + 25753 ; DS:DX -> buffer + 25754 00003011 7226 jc short OpenWriteError ;AN011; If error, exit + 25755 00003013 39C8 cmp ax,cx ;AN017; Did we read 1 byte? + 25756 00003015 7517 jnz short reout_0_length ;AN017; No - file must be 0 length + 25757 + 25758 00003017 803E[B19D]1A cmp byte [One_Char_Val],1Ah ;AN011; Was char an eof mark? + 25759 0000301C 8E1E[F59B] mov ds,[RESSEG] ;AN011; Get resident segment back + 25760 00003020 752C jne short SET_REOUT ;AN011; No, just continue + 25761 + 25762 ;mov ax,(LSEEK<<8)|1 ;AN011; EOF mark found + 25763 00003022 B80142 mov ax,4201h + 25764 00003025 B9FFFF mov cx,-1 ;AN011; LSEEK back one byte + 25765 setreout_p: ; 26/02/2023 + 25766 00003028 89CA mov dx,cx ;AN011; + 25767 0000302A CD21 int 21h ;AN011; + 25768 0000302C EB20 jmp short SET_REOUT + 25769 reout_0_length: ;AN017; We have a 0 length file + 25770 ; ds = cs ; 26/02/2023 + 25771 ;mov ds,[cs:RESSEG] ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2D50h + 25772 ;AN017; Get resident segment back + 25773 ; 26/02/2023 + 25774 0000302E 8E1E[F59B] mov ds,[RESSEG] + 25775 ;mov ax,(LSEEK SHL 8) ;AN017; Move to beginning of file + 25776 00003032 B80042 mov ax,4200h + 25777 00003035 31C9 xor cx,cx ;AN017; Offset is 0 + 25778 ;mov dx,cx ;AN017; + 25779 ;int 21h ;AN017; + 25780 ;jmp short SET_REOUT ;AN017; now finish setting up redirection 25781 ; 26/02/2023 - 25782 ; MSDOS 3.3 - 25783 ;xor dx,dx - 25784 ;xor cx,cx - 25785 ;mov bx,ax - 25786 ;mov ax,(LSEEK<<8)|2 ; 4202h - 25787 ;int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) - 25788 ; ; AL = method: offset from end of file - 25789 ;jmp short SET_REOUT - 25790 - 25791 ; MSDOS 3.3 (& MSDOS 6.0) - 25792 OpenWriteError: - 25793 ;cmp ax,5 - 25794 00003039 83F805 cmp ax,ERROR_ACCESS_DENIED - 25795 0000303C F9 stc - 25796 ;;je short REDIRERR ; MSDOS 3.3 - 25797 ; 26/02/2023 - 25798 ;jnz short REOUTCRT - 25799 ;jmp REDIRERR - 25800 0000303D 743B je short REDIRERR - 25801 - 25802 REOUTCRT: - 25803 0000303F BA[C202] mov dx,Re_OutStr - 25804 00003042 31C9 xor cx,cx - 25805 ;mov ah,CREAT ; 3Ch - 25806 00003044 B43C mov ah,3Ch - 25807 00003046 50 push ax - 25808 00003047 CD21 int 21h ; DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT) - 25809 ; CX = attributes for file - 25810 ; DS:DX -> ASCIZ filename (may include drive and path) - 25811 00003049 5B pop bx - 25812 ;jc short REDIRERR ; MSDOS 3.3 - 25813 ; 26/02/2023 - 25814 ;jnc short NOREDIRERR - 25815 ;jmp REDIRERR - 25816 0000304A 722E jc short REDIRERR - 25817 - 25818 NOREDIRERR: - 25819 0000304C 89C3 mov bx,ax - 25820 SET_REOUT: - 25821 - 25822 ; Mega sleaze!! We move the SFN from the new handle spot into the old stdout - 25823 ; spot. We invalidate the new JFN we got. + 25782 00003037 EBEF jmp short setreout_p + 25783 + 25784 ; 26/02/2023 + 25785 ; MSDOS 3.3 + 25786 ;xor dx,dx + 25787 ;xor cx,cx + 25788 ;mov bx,ax + 25789 ;mov ax,(LSEEK<<8)|2 ; 4202h + 25790 ;int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) + 25791 ; ; AL = method: offset from end of file + 25792 ;jmp short SET_REOUT + 25793 + 25794 ; MSDOS 3.3 (& MSDOS 6.0) + 25795 OpenWriteError: + 25796 ;cmp ax,5 + 25797 00003039 83F805 cmp ax,ERROR_ACCESS_DENIED + 25798 0000303C F9 stc + 25799 ;;je short REDIRERR ; MSDOS 3.3 + 25800 ; 26/02/2023 + 25801 ;jnz short REOUTCRT + 25802 ;jmp REDIRERR + 25803 0000303D 743B je short REDIRERR + 25804 + 25805 REOUTCRT: + 25806 0000303F BA[C202] mov dx,Re_OutStr + 25807 00003042 31C9 xor cx,cx + 25808 ;mov ah,CREAT ; 3Ch + 25809 00003044 B43C mov ah,3Ch + 25810 00003046 50 push ax + 25811 00003047 CD21 int 21h ; DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT) + 25812 ; CX = attributes for file + 25813 ; DS:DX -> ASCIZ filename (may include drive and path) + 25814 00003049 5B pop bx + 25815 ;jc short REDIRERR ; MSDOS 3.3 + 25816 ; 26/02/2023 + 25817 ;jnc short NOREDIRERR + 25818 ;jmp REDIRERR + 25819 0000304A 722E jc short REDIRERR + 25820 + 25821 NOREDIRERR: + 25822 0000304C 89C3 mov bx,ax + 25823 SET_REOUT: 25824 - 25825 0000304E B0FF mov al,0FFh - 25826 ;xchg al,[bx+18h] - 25827 00003050 864718 xchg al,[bx+PDB.JFN_TABLE] - 25828 00003053 A21900 mov [PDB.JFN_TABLE+1],al - 25829 NOREOUT: ; 06/08/2024 - 25830 00003056 C3 retn - 25831 - 25832 ; =============== S U B R O U T I N E ======================================= - 25833 - 25834 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25835 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2CABh + 25825 ; Mega sleaze!! We move the SFN from the new handle spot into the old stdout + 25826 ; spot. We invalidate the new JFN we got. + 25827 + 25828 0000304E B0FF mov al,0FFh + 25829 ;xchg al,[bx+18h] + 25830 00003050 864718 xchg al,[bx+PDB.JFN_TABLE] + 25831 00003053 A21900 mov [PDB.JFN_TABLE+1],al + 25832 NOREOUT: ; 06/08/2024 + 25833 00003056 C3 retn + 25834 + 25835 ; =============== S U B R O U T I N E ======================================= 25836 - 25837 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 25838 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:30F5h - 25839 TESTDOREIN: - 25840 00003057 2E803E[A09B]00 cmp byte [cs:RE_INSTR],0 - 25841 ;jz short IOSET_RETN - 25842 ; 06/08/2024 - 25843 0000305D 74F7 jz short NOREOUT - 25844 0000305F 1E push ds - 25845 00003060 0E push cs - 25846 00003061 1F pop ds - 25847 00003062 BA[A09B] mov dx,RE_INSTR - 25848 ;;mov ax,OPEN*256 ; 3D00h - 25849 ;mov ax,3D00h - 25850 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 25851 ;mov ax,(OPEN*256)+SHARING_DENY_NONE - 25852 00003065 B8403D mov ax,3D40h - 25853 00003068 89C3 mov bx,ax - 25854 0000306A CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 25855 ; DS:DX -> ASCIZ filename - 25856 ; AL = access mode - 25857 ; 0 - read - 25858 0000306C 1F pop ds - 25859 - 25860 0000306D 720B jc short REDIRERR - 25861 - 25862 0000306F 89C3 mov bx,ax - 25863 00003071 B0FF mov al,0FFh + 25837 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25838 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2CABh + 25839 + 25840 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 25841 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:30F5h + 25842 TESTDOREIN: + 25843 00003057 2E803E[A09B]00 cmp byte [cs:RE_INSTR],0 + 25844 ;jz short IOSET_RETN + 25845 ; 06/08/2024 + 25846 0000305D 74F7 jz short NOREOUT + 25847 0000305F 1E push ds + 25848 00003060 0E push cs + 25849 00003061 1F pop ds + 25850 00003062 BA[A09B] mov dx,RE_INSTR + 25851 ;;mov ax,OPEN*256 ; 3D00h + 25852 ;mov ax,3D00h + 25853 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 25854 ;mov ax,(OPEN*256)+SHARING_DENY_NONE + 25855 00003065 B8403D mov ax,3D40h + 25856 00003068 89C3 mov bx,ax + 25857 0000306A CD21 int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 25858 ; DS:DX -> ASCIZ filename + 25859 ; AL = access mode + 25860 ; 0 - read + 25861 0000306C 1F pop ds + 25862 + 25863 0000306D 720B jc short REDIRERR 25864 - 25865 ; Mega sleaze!! We move the SFN from the new handle spot into the old stdin - 25866 ; spot. We invalidate the new JFN we got. + 25865 0000306F 89C3 mov bx,ax + 25866 00003071 B0FF mov al,0FFh 25867 - 25868 ;xchg al,[bx+18h] - 25869 00003073 864718 xchg al,[bx+PDB.JFN_TABLE] - 25870 00003076 A21800 mov [PDB.JFN_TABLE],al - 25871 00003079 C3 retn - 25872 - 25873 ; --------------------------------------------------------------------------- - 25874 - 25875 ; We had some kind of error on the redirection. Figure out what the - 25876 ; appropriate message should be; BX has the system call that failed + 25868 ; Mega sleaze!! We move the SFN from the new handle spot into the old stdin + 25869 ; spot. We invalidate the new JFN we got. + 25870 + 25871 ;xchg al,[bx+18h] + 25872 00003073 864718 xchg al,[bx+PDB.JFN_TABLE] + 25873 00003076 A21800 mov [PDB.JFN_TABLE],al + 25874 00003079 C3 retn + 25875 + 25876 ; --------------------------------------------------------------------------- 25877 - 25878 REDIRERR: - 25879 0000307A 0E push cs - 25880 0000307B 1F pop ds - 25881 0000307C E82E00 call TriageError ; MSDOS 6.0 - 25882 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 - 25883 - 25884 ; At this point, we have recognized the network-generated access denied error. - 25885 ; The correct message is in DX + 25878 ; We had some kind of error on the redirection. Figure out what the + 25879 ; appropriate message should be; BX has the system call that failed + 25880 + 25881 REDIRERR: + 25882 0000307A 0E push cs + 25883 0000307B 1F pop ds + 25884 0000307C E82E00 call TriageError ; MSDOS 6.0 + 25885 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 25886 - 25887 0000307F 83F841 cmp ax,65 - 25888 00003082 7408 je short _CERRORJ ;AC000; just issue message returned - 25889 00003084 80FF3D cmp bh,OPEN ; 3Dh - 25890 00003087 7406 je short OpenError - 25891 00003089 BA[F18F] mov dx,FULLDIR_PTR - 25892 _CERRORJ: - 25893 0000308C E997FC jmp cerror - 25894 - 25895 OpenError: - 25896 ; The system call was an OPEN. Report either file not found or path not found. + 25887 ; At this point, we have recognized the network-generated access denied error. + 25888 ; The correct message is in DX + 25889 + 25890 0000307F 83F841 cmp ax,65 + 25891 00003082 7408 je short _CERRORJ ;AC000; just issue message returned + 25892 00003084 80FF3D cmp bh,OPEN ; 3Dh + 25893 00003087 7406 je short OpenError + 25894 00003089 BA[F18F] mov dx,FULLDIR_PTR + 25895 _CERRORJ: + 25896 0000308C E997FC jmp cerror 25897 - 25898 ; 26/02/2023 - 25899 ; MSDOS 6.0 - 25900 ;mov byte [cs:msg_disp_class],1 - 25901 0000308F 2EC606[D58F]01 mov byte [cs:msg_disp_class],ext_msg_class - 25902 ;AN000; set up extended error msg class - 25903 00003095 BA[D78F] mov dx,extend_buf_ptr - 25904 ;AC000; get extended message pointer - 25905 00003098 2EA3[D78F] mov [cs:extend_buf_ptr],ax - 25906 ;AN000; get message number in control block - 25907 0000309C E987FC jmp cerror - 25908 - 25909 ; 26/02/2023 - 25910 ; MSDOS 3.3 - 25911 ;mov dx,FNOTFOUNDPTR - 25912 ;;cmp ax,2 - 25913 ;cmp ax,ERROR_FILE_NOT_FOUND - 25914 ;je short _CERRORJ - 25915 ;mov dx,ACCDENPTR - 25916 ;;cmp ax,5 ; Access denied error - 25917 ;cmp ax,ERROR_ACCESS_DENIED - 25918 ;je short _CERRORJ - 25919 ; ; ERROR_PATH_NOT_FOUND - 25920 ;mov dx,PNOTFOUNDPTR - 25921 ;jmp CERROR - 25922 - 25923 ; =============== S U B R O U T I N E ======================================= - 25924 - 25925 ; Compute length of string (including NUL) in DS:SI into CX. Change no other - 25926 ; registers + 25898 OpenError: + 25899 ; The system call was an OPEN. Report either file not found or path not found. + 25900 + 25901 ; 26/02/2023 + 25902 ; MSDOS 6.0 + 25903 ;mov byte [cs:msg_disp_class],1 + 25904 0000308F 2EC606[D58F]01 mov byte [cs:msg_disp_class],ext_msg_class + 25905 ;AN000; set up extended error msg class + 25906 00003095 BA[D78F] mov dx,extend_buf_ptr + 25907 ;AC000; get extended message pointer + 25908 00003098 2EA3[D78F] mov [cs:extend_buf_ptr],ax + 25909 ;AN000; get message number in control block + 25910 0000309C E987FC jmp cerror + 25911 + 25912 ; 26/02/2023 + 25913 ; MSDOS 3.3 + 25914 ;mov dx,FNOTFOUNDPTR + 25915 ;;cmp ax,2 + 25916 ;cmp ax,ERROR_FILE_NOT_FOUND + 25917 ;je short _CERRORJ + 25918 ;mov dx,ACCDENPTR + 25919 ;;cmp ax,5 ; Access denied error + 25920 ;cmp ax,ERROR_ACCESS_DENIED + 25921 ;je short _CERRORJ + 25922 ; ; ERROR_PATH_NOT_FOUND + 25923 ;mov dx,PNOTFOUNDPTR + 25924 ;jmp CERROR + 25925 + 25926 ; =============== S U B R O U T I N E ======================================= 25927 - 25928 ; 26/02/2023 - Retro DOS v4.0 COMMAND.COM - 25929 dstrlen: - 25930 0000309F 50 push ax - 25931 000030A0 31C9 xor cx,cx - 25932 000030A2 FC cld - 25933 dloop: - 25934 000030A3 AC lodsb - 25935 000030A4 41 inc cx - 25936 000030A5 08C0 or al,al - 25937 000030A7 75FA jnz short dloop - 25938 000030A9 29CE sub si,cx - 25939 000030AB 58 pop ax - 25940 TRIAGEERR_RETN: - 25941 000030AC C3 retn - 25942 - 25943 ; =============== S U B R O U T I N E ======================================= - 25944 - 25945 ;Break - 25946 - 25947 TriageError: ; MSDOS 6.0 - 25948 - 25949 ; TriageError will examine the return from a carry-set system call and - 25950 ; return the correct error if applicable. - 25951 ; - 25952 ; Inputs: outputs from a carry-settable system call - 25953 ; No system calls may be done in the interrim - 25954 ; Outputs: If carry was set on input - 25955 ; carry set on output - 25956 ; DX contains trangroup offset to printf message - 25957 ; else - 25958 ; No registers changed - 25959 - 25960 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1EEEh - 25961 - 25962 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 25963 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2D92h + 25928 ; Compute length of string (including NUL) in DS:SI into CX. Change no other + 25929 ; registers + 25930 + 25931 ; 26/02/2023 - Retro DOS v4.0 COMMAND.COM + 25932 dstrlen: + 25933 0000309F 50 push ax + 25934 000030A0 31C9 xor cx,cx + 25935 000030A2 FC cld + 25936 dloop: + 25937 000030A3 AC lodsb + 25938 000030A4 41 inc cx + 25939 000030A5 08C0 or al,al + 25940 000030A7 75FA jnz short dloop + 25941 000030A9 29CE sub si,cx + 25942 000030AB 58 pop ax + 25943 TRIAGEERR_RETN: + 25944 000030AC C3 retn + 25945 + 25946 ; =============== S U B R O U T I N E ======================================= + 25947 + 25948 ;Break + 25949 + 25950 TriageError: ; MSDOS 6.0 + 25951 + 25952 ; TriageError will examine the return from a carry-set system call and + 25953 ; return the correct error if applicable. + 25954 ; + 25955 ; Inputs: outputs from a carry-settable system call + 25956 ; No system calls may be done in the interrim + 25957 ; Outputs: If carry was set on input + 25958 ; carry set on output + 25959 ; DX contains trangroup offset to printf message + 25960 ; else + 25961 ; No registers changed + 25962 + 25963 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1EEEh 25964 - 25965 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 25966 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 333Ch + 25965 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 25966 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2D92h 25967 - 25968 GET_EXT_ERR_NUMBER: ; MSDOS 3.3 - 25969 000030AD 73FD jnc short TRIAGEERR_RETN ; no carry => do nothing... - 25970 000030AF 9C pushf - 25971 000030B0 53 push bx - 25972 000030B1 51 push cx - 25973 000030B2 56 push si - 25974 000030B3 57 push di - 25975 000030B4 55 push bp - 25976 000030B5 06 push es - 25977 000030B6 1E push ds - 25978 000030B7 50 push ax - 25979 000030B8 52 push dx - 25980 000030B9 B459 mov ah,59h - 25981 ;mov ah,GETEXTENDEDERROR - 25982 000030BB CD21 int 21h ; DOS - 3+ - GET EXTENDED ERROR CODE - 25983 ; BX = version code (0000h for DOS 3.x) - 25984 000030BD 59 pop cx - 25985 000030BE 5B pop bx ; restore original AX - 25986 000030BF BA[0090] mov dx,ACCDEN_PTR - 25987 000030C2 83F841 cmp ax,65 ; network access denied? - 25988 000030C5 7404 je short NoMove ; Yes, return it. - 25989 000030C7 89D8 mov ax,bx - 25990 000030C9 89CA mov dx,cx - 25991 NoMove: - 25992 000030CB 1F pop ds - 25993 000030CC 07 pop es - 25994 000030CD 5D pop bp - 25995 000030CE 5F pop di - 25996 000030CF 5E pop si - 25997 000030D0 59 pop cx - 25998 000030D1 5B pop bx - 25999 000030D2 9D popf - 26000 000030D3 C3 retn - 26001 - 26002 ; =============== S U B R O U T I N E ======================================= - 26003 - 26004 ; Far call from resident portion/segment of COMMAND.COM - 26005 - 26006 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1F15h - 26007 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2DB9h - 26008 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3363h - 26009 - 26010 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26011 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26012 Triage_Init: - 26013 000030D4 E8D6FF call TriageError ; MSDOS 6.0 - 26014 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 - 26015 000030D7 CB retf - 26016 - 26017 ; =============== S U B R O U T I N E ======================================= - 26018 - 26019 ; MSDOS 6.0 - 26020 - 26021 ; **************************************************************** - 26022 ; * - 26023 ; * ROUTINE: MOVE_TO_SRCBUF - 26024 ; * - 26025 ; * FUNCTION: Move ASCIIZ string from DS:SI to SRCBUF. Change - 26026 ; * terminating 0 to 0dH. Set PATHCNT to length of - 26027 ; * string. Set PATHPOS to start of SRCBUF. - 26028 ; * - 26029 ; * INPUT: DS:SI points to ASCIIZ string - 26030 ; * ES points to TRANGROUP + 25968 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 25969 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 333Ch + 25970 + 25971 GET_EXT_ERR_NUMBER: ; MSDOS 3.3 + 25972 000030AD 73FD jnc short TRIAGEERR_RETN ; no carry => do nothing... + 25973 000030AF 9C pushf + 25974 000030B0 53 push bx + 25975 000030B1 51 push cx + 25976 000030B2 56 push si + 25977 000030B3 57 push di + 25978 000030B4 55 push bp + 25979 000030B5 06 push es + 25980 000030B6 1E push ds + 25981 000030B7 50 push ax + 25982 000030B8 52 push dx + 25983 000030B9 B459 mov ah,59h + 25984 ;mov ah,GETEXTENDEDERROR + 25985 000030BB CD21 int 21h ; DOS - 3+ - GET EXTENDED ERROR CODE + 25986 ; BX = version code (0000h for DOS 3.x) + 25987 000030BD 59 pop cx + 25988 000030BE 5B pop bx ; restore original AX + 25989 000030BF BA[0090] mov dx,ACCDEN_PTR + 25990 000030C2 83F841 cmp ax,65 ; network access denied? + 25991 000030C5 7404 je short NoMove ; Yes, return it. + 25992 000030C7 89D8 mov ax,bx + 25993 000030C9 89CA mov dx,cx + 25994 NoMove: + 25995 000030CB 1F pop ds + 25996 000030CC 07 pop es + 25997 000030CD 5D pop bp + 25998 000030CE 5F pop di + 25999 000030CF 5E pop si + 26000 000030D0 59 pop cx + 26001 000030D1 5B pop bx + 26002 000030D2 9D popf + 26003 000030D3 C3 retn + 26004 + 26005 ; =============== S U B R O U T I N E ======================================= + 26006 + 26007 ; Far call from resident portion/segment of COMMAND.COM + 26008 + 26009 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1F15h + 26010 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2DB9h + 26011 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3363h + 26012 + 26013 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26014 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26015 Triage_Init: + 26016 000030D4 E8D6FF call TriageError ; MSDOS 6.0 + 26017 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 + 26018 000030D7 CB retf + 26019 + 26020 ; =============== S U B R O U T I N E ======================================= + 26021 + 26022 ; MSDOS 6.0 + 26023 + 26024 ; **************************************************************** + 26025 ; * + 26026 ; * ROUTINE: MOVE_TO_SRCBUF + 26027 ; * + 26028 ; * FUNCTION: Move ASCIIZ string from DS:SI to SRCBUF. Change + 26029 ; * terminating 0 to 0dH. Set PATHCNT to length of + 26030 ; * string. Set PATHPOS to start of SRCBUF. 26031 ; * - 26032 ; * OUTPUT: SRCBUF filled in with string terminated by 0dH - 26033 ; * PATHCNT set to length of string - 26034 ; * PATHPOS set to start of SRCBUF - 26035 ; * CX,AX changed - 26036 ; * - 26037 ; **************************************************************** - 26038 - 26039 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26040 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2CABh - 26041 Move_To_SrcBuf: - 26042 000030D8 56 push si ;AN000; save si,di - 26043 000030D9 57 push di ;AN000; - 26044 000030DA 51 push cx ;AN000; - 26045 000030DB BF[219E] mov di,SrcBuf ;AN000; set ES:DI to srcbuf - 26046 000030DE 31C9 xor cx,cx ;AN000; clear cx for counint - 26047 000030E0 89C8 mov ax,cx ;AN000; clear ax - 26048 000030E2 57 push di ;AN000; save start of srcbuf - 26049 000030E3 AC lodsb ;AN000; get a character from DS:SI - 26050 mts_get_chars: ;AN000; - 26051 ;cmp al,0 ;AN000; was it a null char? - 26052 000030E4 20C0 and al,al ; al = 0 ? - 26053 000030E6 7405 jz short mts_end_string ;AN000; yes - exit - 26054 000030E8 AA stosb ;AN000; no - store it in srcbuf - 26055 000030E9 41 inc cx ;AN000; increment length count - 26056 000030EA AC lodsb ;AN000; get a character from DS:SI - 26057 000030EB EBF7 jmp short mts_get_chars ;AN000; go check it - 26058 mts_end_string: ;AN000; we've reached the end of line - 26059 ;mov al,END_OF_LINE_IN ;AN000; store 0Dh in srcbuf - 26060 000030ED B00D mov al,0Dh - 26061 000030EF AA stosb ;AN000; - 26062 000030F0 5F pop di ;AN000; restore start of srcbuf - 26063 000030F1 0E push cs ;AN000; set DS to local segment - 26064 000030F2 1F pop ds ;AN000; - 26065 000030F3 890E[8D9D] mov [PathCnt],cx ;AN000; set patchcnt to length count - 26066 000030F7 893E[8F9D] mov [PathPos],di ;AN000; set pathpos to start of srcbuf - 26067 000030FB 59 pop cx ;AN000; restore cx,di,si - 26068 000030FC 5F pop di ;AN000; - 26069 000030FD 5E pop si ;AN000; - 26070 000030FE C3 retn ;AN000; exit - 26071 - 26072 ;============================================================================ - 26073 ; TPIPE.ASM, MSDOS 6.0, 1991 - 26074 ;============================================================================ - 26075 ; 03/10/2018 - Retro DOS v3.0 - 26076 - 26077 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1F19h - 26078 - 26079 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26080 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2DE4h + 26032 ; * INPUT: DS:SI points to ASCIIZ string + 26033 ; * ES points to TRANGROUP + 26034 ; * + 26035 ; * OUTPUT: SRCBUF filled in with string terminated by 0dH + 26036 ; * PATHCNT set to length of string + 26037 ; * PATHPOS set to start of SRCBUF + 26038 ; * CX,AX changed + 26039 ; * + 26040 ; **************************************************************** + 26041 + 26042 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26043 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2CABh + 26044 Move_To_SrcBuf: + 26045 000030D8 56 push si ;AN000; save si,di + 26046 000030D9 57 push di ;AN000; + 26047 000030DA 51 push cx ;AN000; + 26048 000030DB BF[219E] mov di,SrcBuf ;AN000; set ES:DI to srcbuf + 26049 000030DE 31C9 xor cx,cx ;AN000; clear cx for counint + 26050 000030E0 89C8 mov ax,cx ;AN000; clear ax + 26051 000030E2 57 push di ;AN000; save start of srcbuf + 26052 000030E3 AC lodsb ;AN000; get a character from DS:SI + 26053 mts_get_chars: ;AN000; + 26054 ;cmp al,0 ;AN000; was it a null char? + 26055 000030E4 20C0 and al,al ; al = 0 ? + 26056 000030E6 7405 jz short mts_end_string ;AN000; yes - exit + 26057 000030E8 AA stosb ;AN000; no - store it in srcbuf + 26058 000030E9 41 inc cx ;AN000; increment length count + 26059 000030EA AC lodsb ;AN000; get a character from DS:SI + 26060 000030EB EBF7 jmp short mts_get_chars ;AN000; go check it + 26061 mts_end_string: ;AN000; we've reached the end of line + 26062 ;mov al,END_OF_LINE_IN ;AN000; store 0Dh in srcbuf + 26063 000030ED B00D mov al,0Dh + 26064 000030EF AA stosb ;AN000; + 26065 000030F0 5F pop di ;AN000; restore start of srcbuf + 26066 000030F1 0E push cs ;AN000; set DS to local segment + 26067 000030F2 1F pop ds ;AN000; + 26068 000030F3 890E[8D9D] mov [PathCnt],cx ;AN000; set patchcnt to length count + 26069 000030F7 893E[8F9D] mov [PathPos],di ;AN000; set pathpos to start of srcbuf + 26070 000030FB 59 pop cx ;AN000; restore cx,di,si + 26071 000030FC 5F pop di ;AN000; + 26072 000030FD 5E pop si ;AN000; + 26073 000030FE C3 retn ;AN000; exit + 26074 + 26075 ;============================================================================ + 26076 ; TPIPE.ASM, MSDOS 6.0, 1991 + 26077 ;============================================================================ + 26078 ; 03/10/2018 - Retro DOS v3.0 + 26079 + 26080 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 1F19h 26081 - 26082 ; =============== S U B R O U T I N E ======================================= - 26083 - 26084 ; 26/02/2023 - 26085 SINGLETEST: - 26086 000030FF 1E push ds - 26087 00003100 2E8E1E[F59B] mov ds,[cs:RESSEG] - 26088 00003105 833E[A502]00 cmp word [SingleCom],0 - 26089 0000310A 7406 jz short TESTDONE - 26090 0000310C 813E[A502]FFEF cmp word [SingleCom],0EFFFh - 26091 TESTDONE: - 26092 00003112 1F pop ds - 26093 00003113 C3 retn - 26094 - 26095 ; =============== S U B R O U T I N E ======================================= - 26096 - 26097 ; 26/02/2023 - 26098 SetRest1: - 26099 00003114 B001 mov al,1 - 26100 - 26101 ; --------------------------------------------------------------------------- - 26102 - 26103 SETREST: - 26104 00003116 1E push ds - 26105 00003117 8E1E[F59B] mov ds,[RESSEG] - 26106 0000311B A2[A102] mov [RestDir],al - 26107 0000311E 1F pop ds - 26108 0000311F C3 retn - 26109 - 26110 ; =============== S U B R O U T I N E ======================================= - 26111 - 26112 ; Note that we need to handle the same thing that RestDir handles: the - 26113 ; requirement that we try only once to restore the user's environment after - 26114 ; and INT 24 or the like. If the condition that causes the INT 24 does not - 26115 ; disappear, we just give up. - 26116 - 26117 ; 26/02/2023 - Retro DOS v4.0 COMMAND.COM - 26118 ; - 26119 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26120 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:33AFh + 26082 ; 26/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26083 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 2DE4h + 26084 + 26085 ; =============== S U B R O U T I N E ======================================= + 26086 + 26087 ; 26/02/2023 + 26088 SINGLETEST: + 26089 000030FF 1E push ds + 26090 00003100 2E8E1E[F59B] mov ds,[cs:RESSEG] + 26091 00003105 833E[A502]00 cmp word [SingleCom],0 + 26092 0000310A 7406 jz short TESTDONE + 26093 0000310C 813E[A502]FFEF cmp word [SingleCom],0EFFFh + 26094 TESTDONE: + 26095 00003112 1F pop ds + 26096 00003113 C3 retn + 26097 + 26098 ; =============== S U B R O U T I N E ======================================= + 26099 + 26100 ; 26/02/2023 + 26101 SetRest1: + 26102 00003114 B001 mov al,1 + 26103 + 26104 ; --------------------------------------------------------------------------- + 26105 + 26106 SETREST: + 26107 00003116 1E push ds + 26108 00003117 8E1E[F59B] mov ds,[RESSEG] + 26109 0000311B A2[A102] mov [RestDir],al + 26110 0000311E 1F pop ds + 26111 0000311F C3 retn + 26112 + 26113 ; =============== S U B R O U T I N E ======================================= + 26114 + 26115 ; Note that we need to handle the same thing that RestDir handles: the + 26116 ; requirement that we try only once to restore the user's environment after + 26117 ; and INT 24 or the like. If the condition that causes the INT 24 does not + 26118 ; disappear, we just give up. + 26119 + 26120 ; 26/02/2023 - Retro DOS v4.0 COMMAND.COM 26121 ; - 26122 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 26123 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:324Fh - 26124 PIPEDEL: - 26125 00003120 1E push ds - 26126 00003121 52 push dx - 26127 00003122 2E8E1E[F59B] mov ds,[cs:RESSEG] - 26128 ;;;mov dx,320h ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2E0Ch - 26129 ;;mov dx,3EAh ; MSDOS 6.22 COMMAND.COM - TRANGROUP:33B1h - 26130 ;mov dx,41Eh ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3256h - 26131 ; Pipe1 = offset RESGROUP:EndInit - 26132 00003127 BA[1503] mov dx,Pipe1 ; Clean up in case ^C - 26133 ;mov ah,Unlink ; 41h - 26134 0000312A B441 mov ah,41h - 26135 ;int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) - 26136 ; DS:DX -> ASCIZ pathname of file to delete - 26137 ; (no wildcards allowed) - 26138 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26139 0000312C E88BD4 call int_21h_indirect - 26140 - 26141 ;;;mov dx,36Fh ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2E13h - 26142 ;;mov dx,439h ; MSDOS 6.22 COMMAND.COM - TRANGROUP:33BDh - 26143 ;mov dx,46Dh ; PCDOS 7.1 COMMAND.COM - TRANGROUP:325Eh - 26144 ; Pipe2 = offset RESGROUP:EndInit+79 - 26145 0000312F BA[6403] mov dx,Pipe2 - 26146 ;mov ah,Unlink ; 41h - 26147 00003132 B441 mov ah,41h - 26148 ;int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) - 26149 ; DS:DX -> ASCIZ pathname of file to delete - 26150 ; (no wildcards allowed) - 26151 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26152 00003134 E883D4 call int_21h_indirect - 26153 00003137 5A pop dx - 26154 00003138 E86C02 call PipeOff - 26155 0000313B C606[1403]00 mov byte [PipeFiles],0 - 26156 00003140 1F pop ds - 26157 00003141 C3 retn - 26158 - 26159 ; --------------------------------------------------------------------------- - 26160 - 26161 ; 26/02/2023 - 26162 PIPEERRSYN: - 26163 00003142 BA[AA90] mov dx,SYNTMES_PTR ; MSG_1030 ; 06/08/2024 - 26164 00003145 E8D8FF call PIPEDEL - 26165 00003148 0E push cs - 26166 00003149 1F pop ds - 26167 0000314A E9D9FB jmp cerror - 26168 - 26169 ; --------------------------------------------------------------------------- - 26170 - 26171 ; 26/02/2023 - 26172 PIPERR: - 26173 0000314D 9C pushf - 26174 0000314E E85CFF call TriageError - 26175 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 - 26176 00003151 50 push ax ; Save results from TriageError - 26177 00003152 52 push dx - 26178 00003153 BA[5D91] mov dx,PIPEEMES_PTR - 26179 00003156 E8C7FF call PIPEDEL - 26180 00003159 0E push cs - 26181 0000315A 1F pop ds - 26182 0000315B E8C222 call std_eprintf - 26183 0000315E 5A pop dx ; Restore results from TriageError - 26184 0000315F 58 pop ax - 26185 00003160 9D popf - 26186 00003161 83F841 cmp ax,65 ; network access denied - 26187 00003164 7503 jne short TCOMMANDJ - 26188 00003166 E9BDFB jmp cerror - 26189 - 26190 TCOMMANDJ: - 26191 00003169 E998CF jmp TCOMMAND + 26122 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26123 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:33AFh + 26124 ; + 26125 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 26126 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:324Fh + 26127 PIPEDEL: + 26128 00003120 1E push ds + 26129 00003121 52 push dx + 26130 00003122 2E8E1E[F59B] mov ds,[cs:RESSEG] + 26131 ;;;mov dx,320h ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2E0Ch + 26132 ;;mov dx,3EAh ; MSDOS 6.22 COMMAND.COM - TRANGROUP:33B1h + 26133 ;mov dx,41Eh ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3256h + 26134 ; Pipe1 = offset RESGROUP:EndInit + 26135 00003127 BA[1503] mov dx,Pipe1 ; Clean up in case ^C + 26136 ;mov ah,Unlink ; 41h + 26137 0000312A B441 mov ah,41h + 26138 ;int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) + 26139 ; DS:DX -> ASCIZ pathname of file to delete + 26140 ; (no wildcards allowed) + 26141 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26142 0000312C E88BD4 call int_21h_indirect + 26143 + 26144 ;;;mov dx,36Fh ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2E13h + 26145 ;;mov dx,439h ; MSDOS 6.22 COMMAND.COM - TRANGROUP:33BDh + 26146 ;mov dx,46Dh ; PCDOS 7.1 COMMAND.COM - TRANGROUP:325Eh + 26147 ; Pipe2 = offset RESGROUP:EndInit+79 + 26148 0000312F BA[6403] mov dx,Pipe2 + 26149 ;mov ah,Unlink ; 41h + 26150 00003132 B441 mov ah,41h + 26151 ;int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) + 26152 ; DS:DX -> ASCIZ pathname of file to delete + 26153 ; (no wildcards allowed) + 26154 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26155 00003134 E883D4 call int_21h_indirect + 26156 00003137 5A pop dx + 26157 00003138 E86C02 call PipeOff + 26158 0000313B C606[1403]00 mov byte [PipeFiles],0 + 26159 00003140 1F pop ds + 26160 00003141 C3 retn + 26161 + 26162 ; --------------------------------------------------------------------------- + 26163 + 26164 ; 26/02/2023 + 26165 PIPEERRSYN: + 26166 00003142 BA[AA90] mov dx,SYNTMES_PTR ; MSG_1030 ; 06/08/2024 + 26167 00003145 E8D8FF call PIPEDEL + 26168 00003148 0E push cs + 26169 00003149 1F pop ds + 26170 0000314A E9D9FB jmp cerror + 26171 + 26172 ; --------------------------------------------------------------------------- + 26173 + 26174 ; 26/02/2023 + 26175 PIPERR: + 26176 0000314D 9C pushf + 26177 0000314E E85CFF call TriageError + 26178 ;call GET_EXT_ERR_NUMBER ; MSDOS 3.3 + 26179 00003151 50 push ax ; Save results from TriageError + 26180 00003152 52 push dx + 26181 00003153 BA[5D91] mov dx,PIPEEMES_PTR + 26182 00003156 E8C7FF call PIPEDEL + 26183 00003159 0E push cs + 26184 0000315A 1F pop ds + 26185 0000315B E8C222 call std_eprintf + 26186 0000315E 5A pop dx ; Restore results from TriageError + 26187 0000315F 58 pop ax + 26188 00003160 9D popf + 26189 00003161 83F841 cmp ax,65 ; network access denied + 26190 00003164 7503 jne short TCOMMANDJ + 26191 00003166 E9BDFB jmp cerror 26192 - 26193 ; --------------------------------------------------------------------------- - 26194 - 26195 ; 27/02/2023 - Retro DOS v4.0 COMMAND.COM - 26196 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26197 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 26198 PIPEPROCSTRT: - 26199 0000316C 8E1E[F59B] mov ds,[RESSEG] - 26200 00003170 FE06[1403] inc byte [PipeFiles] ; Flag that the pipe files exist - 26201 - 26202 ; MSDOS 6.0 - 26203 00003174 06 push es - 26204 00003175 57 push di - 26205 00003176 1E push ds - 26206 00003177 56 push si - 26207 - 26208 00003178 1E push ds - 26209 00003179 06 push es - 26210 0000317A 1F pop ds ;ds = TRANGROUP - 26211 0000317B BE[7097] mov si,TempVarName ;ds:si = "TEMP=" - 26212 - 26213 ;Some hideous code in Find_Name_In_Environment. Expects ds = TRANGROUP and - 26214 ;so the routine is not really general + 26193 TCOMMANDJ: + 26194 00003169 E998CF jmp TCOMMAND + 26195 + 26196 ; --------------------------------------------------------------------------- + 26197 + 26198 ; 27/02/2023 - Retro DOS v4.0 COMMAND.COM + 26199 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26200 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 26201 PIPEPROCSTRT: + 26202 0000316C 8E1E[F59B] mov ds,[RESSEG] + 26203 00003170 FE06[1403] inc byte [PipeFiles] ; Flag that the pipe files exist + 26204 + 26205 ; MSDOS 6.0 + 26206 00003174 06 push es + 26207 00003175 57 push di + 26208 00003176 1E push ds + 26209 00003177 56 push si + 26210 + 26211 00003178 1E push ds + 26212 00003179 06 push es + 26213 0000317A 1F pop ds ;ds = TRANGROUP + 26214 0000317B BE[7097] mov si,TempVarName ;ds:si = "TEMP=" 26215 - 26216 0000317E E836F5 call find_name_in_environment - 26217 ;es:di points at path - 26218 00003181 1F pop ds ;ds = DATARES again - 26219 00003182 7220 jc short no_temp_path - 26220 - 26221 00003184 1E push ds - 26222 00003185 06 push es - 26223 00003186 1F pop ds - 26224 00003187 07 pop es ;swap ds and es - 26225 00003188 89FE mov si,di ;ds:si points at path - 26226 - 26227 0000318A E8B702 call skip_white ;skip white space chars - 26228 - 26229 ;This copies the path into both buffers -- Pipe1 & Pipe2 - 26230 - 26231 0000318D E8C002 call copy_pipe_path ;copy the pipe path - 26232 - 26233 ;Check if the TEMP path is valid - 26234 - 26235 00003190 06 push es - 26236 00003191 1F pop ds ;ds = DATARES - 26237 ;mov dx,offset DATARES:Pipe1 ;ds:dx = path to look for - 26238 ;;;mov dx,320h ; MSDOS 5.0 - offset EndInit - 26239 ;;mov dx,3EAh ; MSDOS 6.22 - offset EndInit - 26240 ;mov dx,41Eh ; PCDOS 7.1 COMMAND.COM - offset EndInit - 26241 00003192 BA[1503] mov dx,Pipe1 - 26242 ;mov ax,(CHMOD shl 8) or 0 - 26243 00003195 B80043 mov ax,4300h - 26244 ;int 21h - 26245 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26246 00003198 E81FD4 call int_21h_indirect - 26247 0000319B 7207 jc short no_temp_path - 26248 - 26249 0000319D F7C11000 test cx,10h ;is it a directory? - 26250 000031A1 7501 jnz short no_temp_path ;yes, continue (carry clear) + 26216 ;Some hideous code in Find_Name_In_Environment. Expects ds = TRANGROUP and + 26217 ;so the routine is not really general + 26218 + 26219 0000317E E836F5 call find_name_in_environment + 26220 ;es:di points at path + 26221 00003181 1F pop ds ;ds = DATARES again + 26222 00003182 7220 jc short no_temp_path + 26223 + 26224 00003184 1E push ds + 26225 00003185 06 push es + 26226 00003186 1F pop ds + 26227 00003187 07 pop es ;swap ds and es + 26228 00003188 89FE mov si,di ;ds:si points at path + 26229 + 26230 0000318A E8B702 call skip_white ;skip white space chars + 26231 + 26232 ;This copies the path into both buffers -- Pipe1 & Pipe2 + 26233 + 26234 0000318D E8C002 call copy_pipe_path ;copy the pipe path + 26235 + 26236 ;Check if the TEMP path is valid + 26237 + 26238 00003190 06 push es + 26239 00003191 1F pop ds ;ds = DATARES + 26240 ;mov dx,offset DATARES:Pipe1 ;ds:dx = path to look for + 26241 ;;;mov dx,320h ; MSDOS 5.0 - offset EndInit + 26242 ;;mov dx,3EAh ; MSDOS 6.22 - offset EndInit + 26243 ;mov dx,41Eh ; PCDOS 7.1 COMMAND.COM - offset EndInit + 26244 00003192 BA[1503] mov dx,Pipe1 + 26245 ;mov ax,(CHMOD shl 8) or 0 + 26246 00003195 B80043 mov ax,4300h + 26247 ;int 21h + 26248 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26249 00003198 E81FD4 call int_21h_indirect + 26250 0000319B 7207 jc short no_temp_path 26251 - 26252 000031A3 F9 stc ;no, indicate fail - 26253 no_temp_path: - 26254 000031A4 5E pop si - 26255 000031A5 1F pop ds - 26256 000031A6 5F pop di - 26257 000031A7 07 pop es - 26258 000031A8 730B jnc short crt_temp ;path found, create tempfiles - 26259 - 26260 ; 27/02/2023 - 26261 ; MSDOS 3.3 - 26262 ;mov ah,GET_DEFAULT_DRIVE ; 19h - 26263 ; ; Get current drive - 26264 ;int 21h ; DOS - GET DEFAULT DISK NUMBER - 26265 ;add al,[cs:CAPITAL_A] - 26266 ;mov byte [PIPE2],al ; Make pipe files in root of def drv - 26267 ;mov bx,PIPE1 - 26268 ;mov [bx],al - 26269 ;xor ah,ah ; nul terminate path names - 26270 ;mov byte [PIPE1+3],ah - 26271 ;mov byte [PIPE2+3],ah - 26272 - 26273 ; MSDOS 6.0 - 26274 ;SR; - 26275 ; We want to create temp files in the current directory rather than in the - 26276 ;root of the drive. This is because the number of files that can be present - 26277 ;in the root directory is fixed, whereas it is not so in subdirectories. - 26278 - 26279 ;mov ah,'.' - 26280 ;mov [Pipe1],ah ; = RESGROUP:EndInit - 26281 ;mov [Pipe2],ah ; = RESGROUP:EndInit+79 - 26282 ;xor ah,ah - 26283 ;mov [Pipe1+1],ah ; = RESGROUP:EndInit+1 - 26284 ;mov [Pipe2+1],ah ;create files in current dir - 26285 ; 27/02/2023 - 26286 000031AA B92E00 mov cx,002Eh - 26287 000031AD 890E[1503] mov [Pipe1],cx - 26288 000031B1 890E[6403] mov [Pipe2],cx - 26289 crt_temp: - 26290 ; MSDOS 6.0 - 26291 ;mov dx,offset DATARES:Pipe1 ; = RESGROUP:EndInit - 26292 ;;mov dx,320h ; MSDOS 5.0 COMMAND.COM - 26293 ;mov dx,3EAh ; MSDOS 6.22 COMMAND.COM - 26294 000031B5 BA[1503] mov dx,Pipe1 - 26295 ; MSDOS 3.3 - 26296 ;mov dx,bx - 26297 - 26298 ; MSDOS 3.3 (& MSDOS 6.0) - 26299 000031B8 31C9 xor cx,cx - 26300 ;mov ah,CREATETEMPFILE ; 5Ah ; the CreateTemp call - 26301 000031BA B45A mov ah,5Ah - 26302 ;int 21h - 26303 ; DOS - 3+ - CREATE UNIQUE FILE - 26304 ; DS:DX -> ASCIZ directory path name ending with a '' + 13 bytes - 26305 ; to receive generated filename - 26306 ; CX = file attributes (only bits 0,1,2,5 may be set) - 26307 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26308 000031BC E8FBD3 call int_21h_indirect - 26309 000031BF 728C jc short PIPERR ; Couldn't create - 26310 - 26311 000031C1 89C3 mov bx,ax - 26312 ;mov ah,CLOSE ; 3Eh ; Don't proliferate handles - 26313 000031C3 B43E mov ah,3Eh - 26314 000031C5 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 26315 ; BX = file handle - 26316 ;;;mov dx,PIPE2 - 26317 ;;;mov dx,36Fh ; MSDOS 5.0 COMMAND.COM - 26318 ;;mov dx,439h ; MSDOS 6.22 COMMAND.COM - 26319 ;mov dx,46Dh ; PCDOS 7.1 COMMAND.COM - 26320 000031C7 BA[6403] mov dx,Pipe2 - 26321 ;mov ah,CREATETEMPFILE ; 5Ah ; the CreateTemp call - 26322 000031CA B45A mov ah,5Ah - 26323 ;int 21h - 26324 ; DOS - 3+ - CREATE UNIQUE FILE - 26325 ; DS:DX -> ASCIZ directory path name ending with a '' + 13 bytes to - 26326 ; receive generated filename - 26327 ; CX = file attributes (only bits 0,1,2,5 may be set) - 26328 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26329 000031CC E8EBD3 call int_21h_indirect - 26330 ; 17/04/2023 - 26331 ;jc short PIPERR - 26332 ; 27/02/2023 - 26333 000031CF 7303 jnc short pps1 - 26334 000031D1 E979FF jmp PIPERR - 26335 pps1: - 26336 000031D4 89C3 mov bx,ax - 26337 000031D6 B43E mov ah,CLOSE ; 3Eh ; Don't proliferate handles - 26338 ;int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 26339 ; BX = file handle - 26340 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26341 000031D8 E8DFD3 call int_21h_indirect - 26342 ; - 26343 ;call near ptr TESTDOREIN ; Set up a redirection if specified - 26344 000031DB E879FE call TESTDOREIN - 26345 ;;mov si,[488h] ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 - 26346 ;mov si,[4BCh] ; PCDOS 7.1 COMMAND.COM ; 06/08/2024 - 26347 000031DE 8B36[B303] mov si,[PipePtr] ; offset RESGROUP:EndInit+158 - 26348 000031E2 833E[A502]FF cmp word [SingleCom],-1 ; 0FFFFh - 26349 000031E7 7506 jne short NOSINGP - 26350 000031E9 C706[A502]00F0 mov word [SingleCom],0F000h ; Flag single command pipe - 26351 NOSINGP: - 26352 000031EF EB2A jmp short FIRSTPIPE - 26353 - 26354 ; --------------------------------------------------------------------------- - 26355 - 26356 ; 27/02/2023 - Retro DOS v4.0 COMMAND.COM - 26357 ; 11/06/2026 - Retro DOS v4.2 COMMAND.COM - 26358 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 26359 PIPEPROC: - 26360 000031F1 8026[9D02]FE and byte [EchoFlag],0FEh ; force current echo to be off - 26361 ;;mov si,[488h] ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 - 26362 000031F6 8B36[B303] mov si,[PipePtr] ; offset RESGROUP:EndInit+158 - 26363 000031FA AC lodsb - 26364 ; 27/02/2023 - 26365 000031FB 3C7C cmp al,'|' - 26366 ;;cmp al,ALTPIPECHR ; Alternate pipe char? - 26367 ;je short ISPIPE1 ; Yes - 26368 ;cmp al,'|' - 26369 ;;cmp al,[cs:VBAR] - 26370 000031FD 7403 je short ISPIPE1 - 26371 000031FF E98600 jmp PIPEEND ; Pipe done - 26372 ISPIPE1: - 26373 00003202 8B16[3604] mov dx,[InPipePtr] ; Get the input file name - 26374 ;mov ax,OPEN*256 ; 3D00h - 26375 00003206 B8003D mov ax,3D00h - 26376 ;int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 26377 ; DS:DX -> ASCIZ filename - 26378 ; AL = access mode - 26379 ; 0 - read - 26380 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26381 00003209 E8AED3 call int_21h_indirect - 26382 PIPEERRJ: - 26383 0000320C 7303 jnc short NO_PIPEERR - 26384 0000320E E93CFF jmp PIPERR ; Lost the pipe file - 26385 NO_PIPEERR: - 26386 00003211 89C3 mov bx,ax - 26387 00003213 B0FF mov al,0FFh - 26388 ;xchg al,[bx+18h] - 26389 00003215 864718 xchg al,[bx+PDB.JFN_TABLE] - 26390 00003218 A21800 mov [PDB.JFN_TABLE],al ; Redirect - 26391 FIRSTPIPE: - 26392 0000321B BF[569A] mov di,COMBUF+2 - 26393 0000321E 31C9 xor cx,cx - 26394 00003220 803C0D cmp byte [si],0Dh ; '|' - 26395 00003223 7503 jne short PIPEOK1 - 26396 PIPEERRSYNJ: - 26397 00003225 E91AFF jmp PIPEERRSYN - 26398 PIPEOK1: - 26399 ;;;mov al,[cs:VBAR] - 26400 ; 27/02/2023 - 26401 ;;mov al,vbar - 26402 ;mov al,'|' - 26403 ;cmp [si],al ; '||' - 26404 ;je short PIPEERRSYNJ - 26405 00003228 803C7C cmp byte [si],'|' - 26406 ;cmp byte [si],ALTPIPECHR ; '##' or '|#'? - 26407 0000322B 74F8 je short PIPEERRSYNJ - 26408 PIPECOMLP: - 26409 0000322D AC lodsb - 26410 0000322E AA stosb - 26411 ; 27/02/2023 - 26412 0000322F E82FF5 call testkanj - 26413 00003232 7405 jz short NOTKANJ5 - 26414 00003234 A4 movsb - 26415 ; Added following 2 commands to the fix pipe bug. - 26416 00003235 41 inc cx ;AN000; 3/3/KK - 26417 00003236 41 inc cx ;AN000; 3/3/KK - 26418 00003237 EBF4 jmp short PIPECOMLP - 26419 NOTKANJ5: - 26420 00003239 3C0D cmp al,0Dh - 26421 0000323B 7439 je short LASTPIPE - 26422 0000323D 41 inc cx - 26423 ; 27/02/2023 - 26424 0000323E 3C7C cmp al,'|' - 26425 ;cmp al,ALTPIPECHR - 26426 ;je short ISPIPE2 - 26427 ;;cmp al,[cs:VBAR] - 26428 ;cmp al,vbar - 26429 00003240 75EB jne short PIPECOMLP - 26430 ISPIPE2: - 26431 00003242 26C645FF0D mov byte [es:di-1],0Dh - 26432 00003247 49 dec cx - 26433 ;mov [cs:COMBUF+1],cl - 26434 ; 27/02/2023 - 26435 00003248 26880E[559A] mov [es:COMBUF+1],cl - 26436 0000324D 4E dec si - 26437 ;;mov [3BEh],si ; MSDOS 5.0 COMMAND.COM - 26438 ; 11/06/2023 - MSDOS 6.22 COMMAND.COM - 26439 ;mov [488h],si ; [PipePtr] = [EndInit+158] - 26440 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26441 ;mov [4BCh],si ; [PipePtr] = [EndInit+158] - 26442 0000324E 8936[B303] mov [PipePtr],si ; On to next pipe element - 26443 ; mov [EndInit+158],si - 26444 00003252 8B16[3804] mov dx,[OutPipePtr] - 26445 00003256 51 push cx - 26446 00003257 31C9 xor cx,cx - 26447 ;mov ax,CREAT*256 ; 3C00h - 26448 00003259 B8003C mov ax,3C00h - 26449 ;int 21h ; DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT) - 26450 ; CX = attributes for file - 26451 ; DS:DX -> ASCIZ filename (may include drive and path) - 26452 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26453 0000325C E85BD3 call int_21h_indirect - 26454 0000325F 59 pop cx - 26455 00003260 72AA jc short PIPEERRJ ; Lost the file - 26456 00003262 89C3 mov bx,ax - 26457 00003264 B0FF mov al,0FFh - 26458 ;xchg al,[bx+18h] - 26459 00003266 864718 xchg al,[bx+PDB.JFN_TABLE] - 26460 00003269 A21900 mov [PDB.JFN_TABLE+1],al - 26461 0000326C 8716[3604] xchg dx,[InPipePtr] ; Swap for next element of pipe - 26462 00003270 8916[3804] mov [OutPipePtr],dx - 26463 00003274 EB0D jmp short PIPECOM - 26464 LASTPIPE: - 26465 ;mov [cs:COMBUF+1],cl - 26466 ; 27/02/2023 - 26467 00003276 26880E[559A] mov [es:COMBUF+1],cl - 26468 0000327B 4E dec si - 26469 ;;;mov [3BEh],si ; MSDOS 5.0 COMMAND.COM - 26470 ;;mov [488h],si ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 - 26471 ;mov [4BCh],si ; PCDOS 7.1 COMMAND.COM ; 06/08/2024 - 26472 0000327C 8936[B303] mov [PipePtr],si ; Point at the CR (anything not '|' will do) - 26473 ; mov [EndInit+158],si - 26474 00003280 E851FD call TESTDOREOUT ; Set up the redirection if specified - 26475 PIPECOM: - 26476 00003283 0E push cs - 26477 00003284 1F pop ds - 26478 00003285 E994D0 jmp NOPIPEPROC ; Process the pipe element - 26479 PIPEEND: - 26480 00003288 E895FE call PIPEDEL - 26481 0000328B 813E[A502]00F0 cmp word [SingleCom],0F000h - 26482 00003291 7506 jnz short NOSINGP2 - 26483 00003293 C706[A502]FFFF mov word [SingleCom],-1 ; 0FFFFh ; Make it return - 26484 NOSINGP2: - 26485 00003299 E968CE jmp TCOMMAND - 26486 - 26487 ; =============== S U B R O U T I N E ======================================= - 26488 - 26489 ; Date and time are set during initialization and use - 26490 ; this routines since they need to do a long return + 26252 0000319D F7C11000 test cx,10h ;is it a directory? + 26253 000031A1 7501 jnz short no_temp_path ;yes, continue (carry clear) + 26254 + 26255 000031A3 F9 stc ;no, indicate fail + 26256 no_temp_path: + 26257 000031A4 5E pop si + 26258 000031A5 1F pop ds + 26259 000031A6 5F pop di + 26260 000031A7 07 pop es + 26261 000031A8 730B jnc short crt_temp ;path found, create tempfiles + 26262 + 26263 ; 27/02/2023 + 26264 ; MSDOS 3.3 + 26265 ;mov ah,GET_DEFAULT_DRIVE ; 19h + 26266 ; ; Get current drive + 26267 ;int 21h ; DOS - GET DEFAULT DISK NUMBER + 26268 ;add al,[cs:CAPITAL_A] + 26269 ;mov byte [PIPE2],al ; Make pipe files in root of def drv + 26270 ;mov bx,PIPE1 + 26271 ;mov [bx],al + 26272 ;xor ah,ah ; nul terminate path names + 26273 ;mov byte [PIPE1+3],ah + 26274 ;mov byte [PIPE2+3],ah + 26275 + 26276 ; MSDOS 6.0 + 26277 ;SR; + 26278 ; We want to create temp files in the current directory rather than in the + 26279 ;root of the drive. This is because the number of files that can be present + 26280 ;in the root directory is fixed, whereas it is not so in subdirectories. + 26281 + 26282 ;mov ah,'.' + 26283 ;mov [Pipe1],ah ; = RESGROUP:EndInit + 26284 ;mov [Pipe2],ah ; = RESGROUP:EndInit+79 + 26285 ;xor ah,ah + 26286 ;mov [Pipe1+1],ah ; = RESGROUP:EndInit+1 + 26287 ;mov [Pipe2+1],ah ;create files in current dir + 26288 ; 27/02/2023 + 26289 000031AA B92E00 mov cx,002Eh + 26290 000031AD 890E[1503] mov [Pipe1],cx + 26291 000031B1 890E[6403] mov [Pipe2],cx + 26292 crt_temp: + 26293 ; MSDOS 6.0 + 26294 ;mov dx,offset DATARES:Pipe1 ; = RESGROUP:EndInit + 26295 ;;mov dx,320h ; MSDOS 5.0 COMMAND.COM + 26296 ;mov dx,3EAh ; MSDOS 6.22 COMMAND.COM + 26297 000031B5 BA[1503] mov dx,Pipe1 + 26298 ; MSDOS 3.3 + 26299 ;mov dx,bx + 26300 + 26301 ; MSDOS 3.3 (& MSDOS 6.0) + 26302 000031B8 31C9 xor cx,cx + 26303 ;mov ah,CREATETEMPFILE ; 5Ah ; the CreateTemp call + 26304 000031BA B45A mov ah,5Ah + 26305 ;int 21h + 26306 ; DOS - 3+ - CREATE UNIQUE FILE + 26307 ; DS:DX -> ASCIZ directory path name ending with a '' + 13 bytes + 26308 ; to receive generated filename + 26309 ; CX = file attributes (only bits 0,1,2,5 may be set) + 26310 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26311 000031BC E8FBD3 call int_21h_indirect + 26312 000031BF 728C jc short PIPERR ; Couldn't create + 26313 + 26314 000031C1 89C3 mov bx,ax + 26315 ;mov ah,CLOSE ; 3Eh ; Don't proliferate handles + 26316 000031C3 B43E mov ah,3Eh + 26317 000031C5 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 26318 ; BX = file handle + 26319 ;;;mov dx,PIPE2 + 26320 ;;;mov dx,36Fh ; MSDOS 5.0 COMMAND.COM + 26321 ;;mov dx,439h ; MSDOS 6.22 COMMAND.COM + 26322 ;mov dx,46Dh ; PCDOS 7.1 COMMAND.COM + 26323 000031C7 BA[6403] mov dx,Pipe2 + 26324 ;mov ah,CREATETEMPFILE ; 5Ah ; the CreateTemp call + 26325 000031CA B45A mov ah,5Ah + 26326 ;int 21h + 26327 ; DOS - 3+ - CREATE UNIQUE FILE + 26328 ; DS:DX -> ASCIZ directory path name ending with a '' + 13 bytes to + 26329 ; receive generated filename + 26330 ; CX = file attributes (only bits 0,1,2,5 may be set) + 26331 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26332 000031CC E8EBD3 call int_21h_indirect + 26333 ; 17/04/2023 + 26334 ;jc short PIPERR + 26335 ; 27/02/2023 + 26336 000031CF 7303 jnc short pps1 + 26337 000031D1 E979FF jmp PIPERR + 26338 pps1: + 26339 000031D4 89C3 mov bx,ax + 26340 000031D6 B43E mov ah,CLOSE ; 3Eh ; Don't proliferate handles + 26341 ;int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 26342 ; BX = file handle + 26343 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26344 000031D8 E8DFD3 call int_21h_indirect + 26345 ; + 26346 ;call near ptr TESTDOREIN ; Set up a redirection if specified + 26347 000031DB E879FE call TESTDOREIN + 26348 ;;mov si,[488h] ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 + 26349 ;mov si,[4BCh] ; PCDOS 7.1 COMMAND.COM ; 06/08/2024 + 26350 000031DE 8B36[B303] mov si,[PipePtr] ; offset RESGROUP:EndInit+158 + 26351 000031E2 833E[A502]FF cmp word [SingleCom],-1 ; 0FFFFh + 26352 000031E7 7506 jne short NOSINGP + 26353 000031E9 C706[A502]00F0 mov word [SingleCom],0F000h ; Flag single command pipe + 26354 NOSINGP: + 26355 000031EF EB2A jmp short FIRSTPIPE + 26356 + 26357 ; --------------------------------------------------------------------------- + 26358 + 26359 ; 27/02/2023 - Retro DOS v4.0 COMMAND.COM + 26360 ; 11/06/2026 - Retro DOS v4.2 COMMAND.COM + 26361 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 26362 PIPEPROC: + 26363 000031F1 8026[9D02]FE and byte [EchoFlag],0FEh ; force current echo to be off + 26364 ;;mov si,[488h] ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 + 26365 000031F6 8B36[B303] mov si,[PipePtr] ; offset RESGROUP:EndInit+158 + 26366 000031FA AC lodsb + 26367 ; 27/02/2023 + 26368 000031FB 3C7C cmp al,'|' + 26369 ;;cmp al,ALTPIPECHR ; Alternate pipe char? + 26370 ;je short ISPIPE1 ; Yes + 26371 ;cmp al,'|' + 26372 ;;cmp al,[cs:VBAR] + 26373 000031FD 7403 je short ISPIPE1 + 26374 000031FF E98600 jmp PIPEEND ; Pipe done + 26375 ISPIPE1: + 26376 00003202 8B16[3604] mov dx,[InPipePtr] ; Get the input file name + 26377 ;mov ax,OPEN*256 ; 3D00h + 26378 00003206 B8003D mov ax,3D00h + 26379 ;int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 26380 ; DS:DX -> ASCIZ filename + 26381 ; AL = access mode + 26382 ; 0 - read + 26383 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26384 00003209 E8AED3 call int_21h_indirect + 26385 PIPEERRJ: + 26386 0000320C 7303 jnc short NO_PIPEERR + 26387 0000320E E93CFF jmp PIPERR ; Lost the pipe file + 26388 NO_PIPEERR: + 26389 00003211 89C3 mov bx,ax + 26390 00003213 B0FF mov al,0FFh + 26391 ;xchg al,[bx+18h] + 26392 00003215 864718 xchg al,[bx+PDB.JFN_TABLE] + 26393 00003218 A21800 mov [PDB.JFN_TABLE],al ; Redirect + 26394 FIRSTPIPE: + 26395 0000321B BF[569A] mov di,COMBUF+2 + 26396 0000321E 31C9 xor cx,cx + 26397 00003220 803C0D cmp byte [si],0Dh ; '|' + 26398 00003223 7503 jne short PIPEOK1 + 26399 PIPEERRSYNJ: + 26400 00003225 E91AFF jmp PIPEERRSYN + 26401 PIPEOK1: + 26402 ;;;mov al,[cs:VBAR] + 26403 ; 27/02/2023 + 26404 ;;mov al,vbar + 26405 ;mov al,'|' + 26406 ;cmp [si],al ; '||' + 26407 ;je short PIPEERRSYNJ + 26408 00003228 803C7C cmp byte [si],'|' + 26409 ;cmp byte [si],ALTPIPECHR ; '##' or '|#'? + 26410 0000322B 74F8 je short PIPEERRSYNJ + 26411 PIPECOMLP: + 26412 0000322D AC lodsb + 26413 0000322E AA stosb + 26414 ; 27/02/2023 + 26415 0000322F E82FF5 call testkanj + 26416 00003232 7405 jz short NOTKANJ5 + 26417 00003234 A4 movsb + 26418 ; Added following 2 commands to the fix pipe bug. + 26419 00003235 41 inc cx ;AN000; 3/3/KK + 26420 00003236 41 inc cx ;AN000; 3/3/KK + 26421 00003237 EBF4 jmp short PIPECOMLP + 26422 NOTKANJ5: + 26423 00003239 3C0D cmp al,0Dh + 26424 0000323B 7439 je short LASTPIPE + 26425 0000323D 41 inc cx + 26426 ; 27/02/2023 + 26427 0000323E 3C7C cmp al,'|' + 26428 ;cmp al,ALTPIPECHR + 26429 ;je short ISPIPE2 + 26430 ;;cmp al,[cs:VBAR] + 26431 ;cmp al,vbar + 26432 00003240 75EB jne short PIPECOMLP + 26433 ISPIPE2: + 26434 00003242 26C645FF0D mov byte [es:di-1],0Dh + 26435 00003247 49 dec cx + 26436 ;mov [cs:COMBUF+1],cl + 26437 ; 27/02/2023 + 26438 00003248 26880E[559A] mov [es:COMBUF+1],cl + 26439 0000324D 4E dec si + 26440 ;;mov [3BEh],si ; MSDOS 5.0 COMMAND.COM + 26441 ; 11/06/2023 - MSDOS 6.22 COMMAND.COM + 26442 ;mov [488h],si ; [PipePtr] = [EndInit+158] + 26443 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26444 ;mov [4BCh],si ; [PipePtr] = [EndInit+158] + 26445 0000324E 8936[B303] mov [PipePtr],si ; On to next pipe element + 26446 ; mov [EndInit+158],si + 26447 00003252 8B16[3804] mov dx,[OutPipePtr] + 26448 00003256 51 push cx + 26449 00003257 31C9 xor cx,cx + 26450 ;mov ax,CREAT*256 ; 3C00h + 26451 00003259 B8003C mov ax,3C00h + 26452 ;int 21h ; DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT) + 26453 ; CX = attributes for file + 26454 ; DS:DX -> ASCIZ filename (may include drive and path) + 26455 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26456 0000325C E85BD3 call int_21h_indirect + 26457 0000325F 59 pop cx + 26458 00003260 72AA jc short PIPEERRJ ; Lost the file + 26459 00003262 89C3 mov bx,ax + 26460 00003264 B0FF mov al,0FFh + 26461 ;xchg al,[bx+18h] + 26462 00003266 864718 xchg al,[bx+PDB.JFN_TABLE] + 26463 00003269 A21900 mov [PDB.JFN_TABLE+1],al + 26464 0000326C 8716[3604] xchg dx,[InPipePtr] ; Swap for next element of pipe + 26465 00003270 8916[3804] mov [OutPipePtr],dx + 26466 00003274 EB0D jmp short PIPECOM + 26467 LASTPIPE: + 26468 ;mov [cs:COMBUF+1],cl + 26469 ; 27/02/2023 + 26470 00003276 26880E[559A] mov [es:COMBUF+1],cl + 26471 0000327B 4E dec si + 26472 ;;;mov [3BEh],si ; MSDOS 5.0 COMMAND.COM + 26473 ;;mov [488h],si ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 + 26474 ;mov [4BCh],si ; PCDOS 7.1 COMMAND.COM ; 06/08/2024 + 26475 0000327C 8936[B303] mov [PipePtr],si ; Point at the CR (anything not '|' will do) + 26476 ; mov [EndInit+158],si + 26477 00003280 E851FD call TESTDOREOUT ; Set up the redirection if specified + 26478 PIPECOM: + 26479 00003283 0E push cs + 26480 00003284 1F pop ds + 26481 00003285 E994D0 jmp NOPIPEPROC ; Process the pipe element + 26482 PIPEEND: + 26483 00003288 E895FE call PIPEDEL + 26484 0000328B 813E[A502]00F0 cmp word [SingleCom],0F000h + 26485 00003291 7506 jnz short NOSINGP2 + 26486 00003293 C706[A502]FFFF mov word [SingleCom],-1 ; 0FFFFh ; Make it return + 26487 NOSINGP2: + 26488 00003299 E968CE jmp TCOMMAND + 26489 + 26490 ; =============== S U B R O U T I N E ======================================= 26491 - 26492 ; 27/02/2023 - Retro DOS v4.0 COMMAND.COM - 26493 - 26494 DATINIT: - 26495 0000329C 2E8C1E[F59B] mov [cs:RESSEG],ds ; SetInitFlag needs resseg initialized - 26496 000032A1 06 push es - 26497 000032A2 1E push ds ; Going to use the previous stack - 26498 000032A3 8CC8 mov ax,cs ; Set up the appropriate segment registers - 26499 000032A5 8EC0 mov es,ax - 26500 000032A7 8ED8 mov ds,ax - 26501 000032A9 E85922 call TSYSLOADMSG ; MSDOS 6.0 ; AN000; preload messages - 26502 000032AC BA[9EA5] mov dx,INTERNATVARS - 26503 000032AF B80038 mov ax,3800h - 26504 ;mov ax,INTERNATIONAL*256 ; 3800h - 26505 ;int 21h ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION - 26506 ; get current-country info - 26507 ; DS:DX -> buffer for returned info - 26508 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26509 000032B2 E805D3 call int_21h_indirect - 26510 ; 20/10/2018 - 26511 000032B5 C70681000D00 mov word [81h],0Dh ; Want to prompt for date during initialization - 26512 000032BB C606[549A]80 mov byte [COMBUF],128 ; Init COMBUF - 26513 000032C0 C706[559A]010D mov word [COMBUF+1],0D01h - 26514 000032C6 E80600 call DATE - 26515 000032C9 E86300 call CTIME - 26516 000032CC 1F pop ds - 26517 000032CD 07 pop es - 26518 000032CE CB retf ; far return - 26519 - 26520 ; =============== S U B R O U T I N E ======================================= - 26521 - 26522 ; MSDOS 6.0 - 26523 - 26524 ; **************************************************************** - 26525 ; * - 26526 ; * ROUTINE: DATE - Set system date - 26527 ; * - 26528 ; * FUNCTION: If a date is specified, set the system date, - 26529 ; * otherwise display the current system date and - 26530 ; * prompt the user for a new date. If an invalid - 26531 ; * date is specified, issue an error message and - 26532 ; * prompt for a new date. If the user enters - 26533 ; * nothing when prompted for a date, terminate. - 26534 ; * - 26535 ; * INPUT: command line at offset 81H - 26536 ; * - 26537 ; * OUTPUT: none - 26538 ; * - 26539 ; **************************************************************** - 26540 - 26541 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26542 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2FC4h + 26492 ; Date and time are set during initialization and use + 26493 ; this routines since they need to do a long return + 26494 + 26495 ; 27/02/2023 - Retro DOS v4.0 COMMAND.COM + 26496 + 26497 DATINIT: + 26498 0000329C 2E8C1E[F59B] mov [cs:RESSEG],ds ; SetInitFlag needs resseg initialized + 26499 000032A1 06 push es + 26500 000032A2 1E push ds ; Going to use the previous stack + 26501 000032A3 8CC8 mov ax,cs ; Set up the appropriate segment registers + 26502 000032A5 8EC0 mov es,ax + 26503 000032A7 8ED8 mov ds,ax + 26504 000032A9 E85922 call TSYSLOADMSG ; MSDOS 6.0 ; AN000; preload messages + 26505 000032AC BA[9EA5] mov dx,INTERNATVARS + 26506 000032AF B80038 mov ax,3800h + 26507 ;mov ax,INTERNATIONAL*256 ; 3800h + 26508 ;int 21h ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION + 26509 ; get current-country info + 26510 ; DS:DX -> buffer for returned info + 26511 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26512 000032B2 E805D3 call int_21h_indirect + 26513 ; 20/10/2018 + 26514 000032B5 C70681000D00 mov word [81h],0Dh ; Want to prompt for date during initialization + 26515 000032BB C606[549A]80 mov byte [COMBUF],128 ; Init COMBUF + 26516 000032C0 C706[559A]010D mov word [COMBUF+1],0D01h + 26517 000032C6 E80600 call DATE + 26518 000032C9 E86300 call CTIME + 26519 000032CC 1F pop ds + 26520 000032CD 07 pop es + 26521 000032CE CB retf ; far return + 26522 + 26523 ; =============== S U B R O U T I N E ======================================= + 26524 + 26525 ; MSDOS 6.0 + 26526 + 26527 ; **************************************************************** + 26528 ; * + 26529 ; * ROUTINE: DATE - Set system date + 26530 ; * + 26531 ; * FUNCTION: If a date is specified, set the system date, + 26532 ; * otherwise display the current system date and + 26533 ; * prompt the user for a new date. If an invalid + 26534 ; * date is specified, issue an error message and + 26535 ; * prompt for a new date. If the user enters + 26536 ; * nothing when prompted for a date, terminate. + 26537 ; * + 26538 ; * INPUT: command line at offset 81H + 26539 ; * + 26540 ; * OUTPUT: none + 26541 ; * + 26542 ; **************************************************************** 26543 - 26544 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26545 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:356Eh + 26544 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26545 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:2FC4h 26546 - 26547 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 26548 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3417h - 26549 DATE: - 26550 000032CF BE8100 mov si,81h ; Accepting argument for date inline - 26551 000032D2 BF[5296] mov di,PARSE_DATE ;AN000; Get address of PARSE_DATE - 26552 000032D5 31C9 xor cx,cx ;AN000; clear counter for positionals - 26553 000032D7 31D2 xor dx,dx ;AN000; - 26554 000032D9 E89016 call cmd_parse ;AC000; call parser - 26555 - 26556 ; 27/02/2023 - 26557 ;cmp ax,-1 - 26558 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? - 26559 ;je short PRMTDAT ;AC000; yes - go ask for date - 26560 ;;cmp ax,0 - 26561 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? - 26562 ;;jne short DATERR ;AN000; yes - go issue message - 26563 ; 26/04/2023 - 26564 ;or ax,ax ; ax = 0 ? - 26565 ;jnz short DATERR - 26566 ;;jmp short COMDAT ;AC000; we have a date - 26567 ; 11/06/2023 - 26568 000032DC 40 inc ax ; cmp ax,-1 - 26569 000032DD 7429 jz short PRMTDAT ; 0FFFFh -> 0 - 26570 000032DF 48 dec ax ; cmp ax,0 - 26571 000032E0 7542 jnz short DATERR ; 1 -> 0 - 26572 ; ax = 0 - 26573 - 26574 ; 27/02/2023 - 26575 COMDAT: - 26576 000032E2 8B0E[F7A5] mov cx,[DATE_YEAR] ;AC000; get parts of date in - 26577 000032E6 8A36[F9A5] mov dh,[DATE_MONTH] ;AC000; cx and dx for set - 26578 000032EA 8A16[FAA5] mov dl,[DATE_DAY] ;AC000; date function call. - 26579 000032EE 51 push cx ;AC000; save date - 26580 000032EF 52 push dx ;AC000; - 26581 000032F0 B90100 mov cx,1 ;AC000; set 1 positional entered - 26582 000032F3 31D2 xor dx,dx ;AN029; - 26583 000032F5 E87416 call cmd_parse ;AN029; call parser - 26584 000032F8 3CFF cmp al,0FFh ; -1 - 26585 ;cmp al,END_OF_LINE ;AN029; Are we at end of line? - 26586 000032FA 5A pop dx ;AC000; retrieve date - 26587 000032FB 59 pop cx ;AC000; - 26588 000032FC 7526 jnz short DATERR ;AC000; extra stuff on line - try again - 26589 ; 26/04/2023 - 26590 ;mov ah,SET_DATE ;yes - set date - 26591 000032FE B42B mov ah,2Bh - 26592 ;int 21h - 26593 ; DOS - SET CURRENT DATE - 26594 ; DL = day, DH = month, CX = year - 26595 ; Return: AL = 00h if no error /= FFh if bad value sent to routine - 26596 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26597 00003300 E8B7D2 call int_21h_indirect - 26598 00003303 08C0 or al,al - 26599 00003305 751D jnz short DATERR - 26600 date_end: - 26601 00003307 C3 retn - 26602 - 26603 PRMTDAT: - 26604 ; Print "Current date is - 26605 00003308 E81808 call GetDate ;AN000; get date for output - 26606 - 26607 0000330B 86F2 xchg dh,dl ;AN000; switch month & day - 26608 0000330D 890E[C090] mov [CurDat_yr],cx ;AC000; put year into message control block - 26609 00003311 8916[C290] mov [CurDat_mo_day],dx ;AC000; put month and day into message control block - 26610 00003315 BA[B090] mov dx,CurDat_Ptr ;AC000; set up message for output - 26611 00003318 E80D21 call std_printf - 26612 - 26613 ;AD061; mov word [CurDat_yr],0 ;AC000; reset year, month and day - 26614 ;AD061; mov word [CurDat_mo_day],0 ;AC000; pointers in control block + 26547 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26548 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:356Eh + 26549 + 26550 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 26551 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3417h + 26552 DATE: + 26553 000032CF BE8100 mov si,81h ; Accepting argument for date inline + 26554 000032D2 BF[5296] mov di,PARSE_DATE ;AN000; Get address of PARSE_DATE + 26555 000032D5 31C9 xor cx,cx ;AN000; clear counter for positionals + 26556 000032D7 31D2 xor dx,dx ;AN000; + 26557 000032D9 E89016 call cmd_parse ;AC000; call parser + 26558 + 26559 ; 27/02/2023 + 26560 ;cmp ax,-1 + 26561 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? + 26562 ;je short PRMTDAT ;AC000; yes - go ask for date + 26563 ;;cmp ax,0 + 26564 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? + 26565 ;;jne short DATERR ;AN000; yes - go issue message + 26566 ; 26/04/2023 + 26567 ;or ax,ax ; ax = 0 ? + 26568 ;jnz short DATERR + 26569 ;;jmp short COMDAT ;AC000; we have a date + 26570 ; 11/06/2023 + 26571 000032DC 40 inc ax ; cmp ax,-1 + 26572 000032DD 7429 jz short PRMTDAT ; 0FFFFh -> 0 + 26573 000032DF 48 dec ax ; cmp ax,0 + 26574 000032E0 7542 jnz short DATERR ; 1 -> 0 + 26575 ; ax = 0 + 26576 + 26577 ; 27/02/2023 + 26578 COMDAT: + 26579 000032E2 8B0E[F7A5] mov cx,[DATE_YEAR] ;AC000; get parts of date in + 26580 000032E6 8A36[F9A5] mov dh,[DATE_MONTH] ;AC000; cx and dx for set + 26581 000032EA 8A16[FAA5] mov dl,[DATE_DAY] ;AC000; date function call. + 26582 000032EE 51 push cx ;AC000; save date + 26583 000032EF 52 push dx ;AC000; + 26584 000032F0 B90100 mov cx,1 ;AC000; set 1 positional entered + 26585 000032F3 31D2 xor dx,dx ;AN029; + 26586 000032F5 E87416 call cmd_parse ;AN029; call parser + 26587 000032F8 3CFF cmp al,0FFh ; -1 + 26588 ;cmp al,END_OF_LINE ;AN029; Are we at end of line? + 26589 000032FA 5A pop dx ;AC000; retrieve date + 26590 000032FB 59 pop cx ;AC000; + 26591 000032FC 7526 jnz short DATERR ;AC000; extra stuff on line - try again + 26592 ; 26/04/2023 + 26593 ;mov ah,SET_DATE ;yes - set date + 26594 000032FE B42B mov ah,2Bh + 26595 ;int 21h + 26596 ; DOS - SET CURRENT DATE + 26597 ; DL = day, DH = month, CX = year + 26598 ; Return: AL = 00h if no error /= FFh if bad value sent to routine + 26599 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26600 00003300 E8B7D2 call int_21h_indirect + 26601 00003303 08C0 or al,al + 26602 00003305 751D jnz short DATERR + 26603 date_end: + 26604 00003307 C3 retn + 26605 + 26606 PRMTDAT: + 26607 ; Print "Current date is + 26608 00003308 E81808 call GetDate ;AN000; get date for output + 26609 + 26610 0000330B 86F2 xchg dh,dl ;AN000; switch month & day + 26611 0000330D 890E[C090] mov [CurDat_yr],cx ;AC000; put year into message control block + 26612 00003311 8916[C290] mov [CurDat_mo_day],dx ;AC000; put month and day into message control block + 26613 00003315 BA[B090] mov dx,CurDat_Ptr ;AC000; set up message for output + 26614 00003318 E80D21 call std_printf 26615 - 26616 GET_NEW_DATE: ;AN000; - 26617 0000331B E8BF00 call GETDAT ;AC000; prompt user for date - 26618 - 26619 ; 11/06/2023 - 26620 ;cmp ax,0FFFFh ; -1 - 26621 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? - 26622 ;je short date_end ;AC000; yes - exit - 26623 ; 26/04/2023 - 26624 ;;cmp ax,0 - 26625 ;;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? - 26626 ;;;jnz short DATERR ;AN000; yes - go issue message - 26627 ;; 27/02/2023 - 26628 ;;jz short COMDAT - 26629 ; 26/04/2023 - 26630 ;and ax,ax ; 0 ? - 26631 ;jz short COMDAT - 26632 - 26633 ; 11/06/2023 - 26634 0000331E 40 inc ax ; cmp ax,-1 - 26635 0000331F 74E6 jz short date_end ; 0FFFFh -> 0 - 26636 00003321 48 dec ax ; cmp ax,0 - 26637 00003322 74BE jz short COMDAT ; 1 -> 0 - 26638 ; ax > 0 - 26639 - 26640 ;COMDAT: - 26641 ; .... - 26642 DATERR: - 26643 00003324 E852F6 call CRLF2 ;AN028; print out a blank line - 26644 00003327 BA[AD90] mov dx,BADDAT_PTR - 26645 0000332A E8FB20 call std_printf - 26646 0000332D EBEC jmp short GET_NEW_DATE ;AC000; get date again - 26647 - 26648 ; =============== S U B R O U T I N E ======================================= - 26649 - 26650 ; MSDOS 6.0 - 26651 - 26652 ; TIME gets and sets the time - 26653 - 26654 ; **************************************************************** - 26655 ; * - 26656 ; * ROUTINE: TIME - Set system time - 26657 ; * - 26658 ; * FUNCTION: If a time is specified, set the system time, - 26659 ; * otherwise display the current system time and - 26660 ; * prompt the user for a new time. If an invalid - 26661 ; * time is specified, issue an error message and - 26662 ; * prompt for a new time. If the user enters - 26663 ; * nothing when prompted for a time, terminate. - 26664 ; * - 26665 ; * INPUT: command line at offset 81H - 26666 ; * - 26667 ; * OUTPUT: none - 26668 ; * - 26669 ; **************************************************************** - 26670 - 26671 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26672 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:302Dh + 26616 ;AD061; mov word [CurDat_yr],0 ;AC000; reset year, month and day + 26617 ;AD061; mov word [CurDat_mo_day],0 ;AC000; pointers in control block + 26618 + 26619 GET_NEW_DATE: ;AN000; + 26620 0000331B E8BF00 call GETDAT ;AC000; prompt user for date + 26621 + 26622 ; 11/06/2023 + 26623 ;cmp ax,0FFFFh ; -1 + 26624 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? + 26625 ;je short date_end ;AC000; yes - exit + 26626 ; 26/04/2023 + 26627 ;;cmp ax,0 + 26628 ;;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? + 26629 ;;;jnz short DATERR ;AN000; yes - go issue message + 26630 ;; 27/02/2023 + 26631 ;;jz short COMDAT + 26632 ; 26/04/2023 + 26633 ;and ax,ax ; 0 ? + 26634 ;jz short COMDAT + 26635 + 26636 ; 11/06/2023 + 26637 0000331E 40 inc ax ; cmp ax,-1 + 26638 0000331F 74E6 jz short date_end ; 0FFFFh -> 0 + 26639 00003321 48 dec ax ; cmp ax,0 + 26640 00003322 74BE jz short COMDAT ; 1 -> 0 + 26641 ; ax > 0 + 26642 + 26643 ;COMDAT: + 26644 ; .... + 26645 DATERR: + 26646 00003324 E852F6 call CRLF2 ;AN028; print out a blank line + 26647 00003327 BA[AD90] mov dx,BADDAT_PTR + 26648 0000332A E8FB20 call std_printf + 26649 0000332D EBEC jmp short GET_NEW_DATE ;AC000; get date again + 26650 + 26651 ; =============== S U B R O U T I N E ======================================= + 26652 + 26653 ; MSDOS 6.0 + 26654 + 26655 ; TIME gets and sets the time + 26656 + 26657 ; **************************************************************** + 26658 ; * + 26659 ; * ROUTINE: TIME - Set system time + 26660 ; * + 26661 ; * FUNCTION: If a time is specified, set the system time, + 26662 ; * otherwise display the current system time and + 26663 ; * prompt the user for a new time. If an invalid + 26664 ; * time is specified, issue an error message and + 26665 ; * prompt for a new time. If the user enters + 26666 ; * nothing when prompted for a time, terminate. + 26667 ; * + 26668 ; * INPUT: command line at offset 81H + 26669 ; * + 26670 ; * OUTPUT: none + 26671 ; * + 26672 ; **************************************************************** 26673 - 26674 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26675 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:35D7h + 26674 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26675 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:302Dh 26676 - 26677 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 26678 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3481h - 26679 CTIME: - 26680 0000332F BE8100 mov si,81h ; Accepting argument for time inline - 26681 00003332 BF[6496] mov di,PARSE_TIME ;AN000; Get address of PARSE_time - 26682 00003335 31C9 xor cx,cx ;AN000; clear counter for positionals - 26683 00003337 31D2 xor dx,dx ;AN000; - 26684 00003339 E83016 call cmd_parse ;AC000; call parser - 26685 - 26686 ; 27/02/2023 - 26687 ;cmp ax,-1 - 26688 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? - 26689 ;je short PRMTTIM ;AC000; yes - prompt for time - 26690 ;;cmp ax,0 - 26691 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? - 26692 ;;jne short TIMERR ;AN000; yes - go issue message - 26693 ;and ax,ax ; ax = 0 ? - 26694 ;jnz short TIMERR - 26695 ;;jmp short COMTIM ;AC000; we have a time - 26696 ; 11/06/2023 - 26697 0000333C 40 inc ax ; cmp ax,-1 - 26698 0000333D 742D jz short PRMTTIM ; 0FFFFh -> 0 - 26699 0000333F 48 dec ax ; cmp ax,0 - 26700 00003340 754A jnz short TIMERR ; 1 -> 0 - 26701 ; ax = 0 - 26702 - 26703 ; 27/02/2023 - 26704 COMTIM: - 26705 00003342 8A2E[FFA5] mov ch,[TIME_HOUR] ;AC000; get parts of time in - 26706 00003346 8A0E[00A6] mov cl,[TIME_MINUTES] ;AC000; cx and dx for set - 26707 0000334A 8A36[01A6] mov dh,[TIME_SECONDS] ;AC000; time function call - 26708 0000334E 8A16[02A6] mov dl,[TIME_FRACTION] ;AC000; - 26709 00003352 51 push cx ;AC000; save time - 26710 00003353 52 push dx ;AC000; - 26711 00003354 B90100 mov cx,1 ;AC000; set 1 positional parm entered - 26712 00003357 31D2 xor dx,dx ;AN029; - 26713 00003359 E81016 call cmd_parse ;AN029; call parser - 26714 0000335C 3CFF cmp al, -1 - 26715 ;cmp al,END_OF_LINE ;AN029; Are we at end of line? - 26716 0000335E 5A pop dx ;AC000; retieve time - 26717 0000335F 59 pop cx ;AC000; - 26718 00003360 752A jnz short TIMERR ;AC000; extra stuff on line - try again - 26719 SAVTIM: - 26720 ;mov ah,SET_TIME - 26721 00003362 B42D mov ah,2Dh - 26722 ;int 21h - 26723 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26724 00003364 E853D2 call int_21h_indirect - 26725 00003367 08C0 or al,al - 26726 00003369 7521 jnz short TIMERR ;AC000; if an error occured, try again - 26727 time_end: - 26728 0000336B C3 retn - 26729 - 26730 PRMTTIM: - 26731 ;Printf "Current time is ... " + 26677 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26678 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:35D7h + 26679 + 26680 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 26681 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3481h + 26682 CTIME: + 26683 0000332F BE8100 mov si,81h ; Accepting argument for time inline + 26684 00003332 BF[6496] mov di,PARSE_TIME ;AN000; Get address of PARSE_time + 26685 00003335 31C9 xor cx,cx ;AN000; clear counter for positionals + 26686 00003337 31D2 xor dx,dx ;AN000; + 26687 00003339 E83016 call cmd_parse ;AC000; call parser + 26688 + 26689 ; 27/02/2023 + 26690 ;cmp ax,-1 + 26691 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? + 26692 ;je short PRMTTIM ;AC000; yes - prompt for time + 26693 ;;cmp ax,0 + 26694 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? + 26695 ;;jne short TIMERR ;AN000; yes - go issue message + 26696 ;and ax,ax ; ax = 0 ? + 26697 ;jnz short TIMERR + 26698 ;;jmp short COMTIM ;AC000; we have a time + 26699 ; 11/06/2023 + 26700 0000333C 40 inc ax ; cmp ax,-1 + 26701 0000333D 742D jz short PRMTTIM ; 0FFFFh -> 0 + 26702 0000333F 48 dec ax ; cmp ax,0 + 26703 00003340 754A jnz short TIMERR ; 1 -> 0 + 26704 ; ax = 0 + 26705 + 26706 ; 27/02/2023 + 26707 COMTIM: + 26708 00003342 8A2E[FFA5] mov ch,[TIME_HOUR] ;AC000; get parts of time in + 26709 00003346 8A0E[00A6] mov cl,[TIME_MINUTES] ;AC000; cx and dx for set + 26710 0000334A 8A36[01A6] mov dh,[TIME_SECONDS] ;AC000; time function call + 26711 0000334E 8A16[02A6] mov dl,[TIME_FRACTION] ;AC000; + 26712 00003352 51 push cx ;AC000; save time + 26713 00003353 52 push dx ;AC000; + 26714 00003354 B90100 mov cx,1 ;AC000; set 1 positional parm entered + 26715 00003357 31D2 xor dx,dx ;AN029; + 26716 00003359 E81016 call cmd_parse ;AN029; call parser + 26717 0000335C 3CFF cmp al, -1 + 26718 ;cmp al,END_OF_LINE ;AN029; Are we at end of line? + 26719 0000335E 5A pop dx ;AC000; retieve time + 26720 0000335F 59 pop cx ;AC000; + 26721 00003360 752A jnz short TIMERR ;AC000; extra stuff on line - try again + 26722 SAVTIM: + 26723 ;mov ah,SET_TIME + 26724 00003362 B42D mov ah,2Dh + 26725 ;int 21h + 26726 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26727 00003364 E853D2 call int_21h_indirect + 26728 00003367 08C0 or al,al + 26729 00003369 7521 jnz short TIMERR ;AC000; if an error occured, try again + 26730 time_end: + 26731 0000336B C3 retn 26732 - 26733 ;mov ah,Get_Time ;AC000; get the current time - 26734 0000336C B42C mov ah,2Ch - 26735 ;int 21h ;AC000; Get time in CX:DX - 26736 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 26737 0000336E E849D2 call int_21h_indirect - 26738 00003371 86E9 xchg ch,cl ;AN000; switch hours & minutes - 26739 00003373 86F2 xchg dh,dl ;AN000; switch seconds & hundredths - 26740 00003375 890E[E290] mov [CurTim_hr_min],cx ;AC000; put hours and minutes into message subst block - 26741 00003379 8916[E490] mov [CurTim_Sec_hn],dx ;AC000; put seconds and hundredths into message subst block - 26742 0000337D BA[DD90] mov dx,CurTim_Ptr ;AC000; set up message for output - 26743 00003380 E8A520 call std_printf - 26744 - 26745 ;AD061; mov word [CurTim_hr_min],0 ;AC000; reset hour, minutes, seconds, and hundredths - 26746 ;AD061; mov word [CurTim_Sec_hn],0 ;AC000; pointers in control block + 26733 PRMTTIM: + 26734 ;Printf "Current time is ... " + 26735 + 26736 ;mov ah,Get_Time ;AC000; get the current time + 26737 0000336C B42C mov ah,2Ch + 26738 ;int 21h ;AC000; Get time in CX:DX + 26739 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 26740 0000336E E849D2 call int_21h_indirect + 26741 00003371 86E9 xchg ch,cl ;AN000; switch hours & minutes + 26742 00003373 86F2 xchg dh,dl ;AN000; switch seconds & hundredths + 26743 00003375 890E[E290] mov [CurTim_hr_min],cx ;AC000; put hours and minutes into message subst block + 26744 00003379 8916[E490] mov [CurTim_Sec_hn],dx ;AC000; put seconds and hundredths into message subst block + 26745 0000337D BA[DD90] mov dx,CurTim_Ptr ;AC000; set up message for output + 26746 00003380 E8A520 call std_printf 26747 - 26748 GET_NEW_TIME: - 26749 00003383 E8B100 call GETTIM ;AC000; - 26750 - 26751 ; 11/06/2023 - 26752 ;cmp ax,-1 - 26753 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? - 26754 ;je short time_end ;AC000; - 26755 ;;cmp ax,0 - 26756 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? - 26757 ;;jne short TIMERR ;AN000; yes - go issue message - 26758 ;or ax,ax ; ax = 0 ? - 26759 ;;jnz short TIMERR - 26760 ; 27/02/2023 - 26761 ;jz short COMTIM - 26762 - 26763 ; 11/06/2023 - 26764 00003386 40 inc ax ; cmp ax,-1 - 26765 00003387 74E2 jz short time_end ; 0FFFFh -> 0 - 26766 00003389 48 dec ax ; cmp ax,0 - 26767 0000338A 74B6 jz short COMTIM ; 1 -> 0 - 26768 ; ax > 0 - 26769 - 26770 ;COMTIM: - 26771 ; .... - 26772 TIMERR: - 26773 0000338C E8EAF5 call CRLF2 ;AN028; print out a blank line - 26774 0000338F BA[DA90] mov dx,BadTim_Ptr - 26775 00003392 E89320 call std_printf ; Print error message - 26776 00003395 EBEC jmp short GET_NEW_TIME ;AC000; Try again - 26777 - 26778 ; =============== S U B R O U T I N E ======================================= - 26779 - 26780 ; MSDOS 6.0 - 26781 - 26782 ; Set the special flag in the INIT flag to the value in CX. - 26783 - 26784 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26785 SetInitFlag: - 26786 00003397 8E1E[F59B] mov ds,[RESSEG] - 26787 - 26788 0000339B 8026[1203]FD and byte [InitFlag],~INITSPECIAL ; 0FDh ; not initspecial - 26789 ;and byte [InitFlag],0FDh - 26790 000033A0 080E[1203] or byte [InitFlag],cl - 26791 000033A4 0E push cs - 26792 000033A5 1F pop ds - 26793 000033A6 C3 retn - 26794 - 26795 ; =============== S U B R O U T I N E ======================================= - 26796 - 26797 ; MSDOS 6.0 - 26798 - 26799 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26800 PipeOff: - 26801 000033A7 1E push ds - 26802 000033A8 50 push ax - 26803 000033A9 2E8E1E[F59B] mov ds,[cs:RESSEG] - 26804 000033AE 30C0 xor al,al - 26805 000033B0 8606[1303] xchg [PipeFlag],al - 26806 000033B4 08C0 or al,al - 26807 000033B6 7404 jz short PipeOffDone - 26808 000033B8 D02E[9D02] shr byte [EchoFlag],1 - 26809 PipeOffDone: - 26810 000033BC 58 pop ax - 26811 000033BD 1F pop ds - 26812 000033BE C3 retn - 26813 - 26814 ; =============== S U B R O U T I N E ======================================= - 26815 - 26816 ; MSDOS 6.0 - 26817 - 26818 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26819 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26820 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM - 26821 PRINT_TIME: - 26822 ;mov ah,Get_Time - 26823 000033BF B42C mov ah,2Ch - 26824 ;int 21h ; Get time in CX:DX - 26825 ; 08/08/2024 - PCDOS 7.1 COMMAND.COM - 26826 000033C1 E8F6D1 call int_21h_indirect - 26827 - 26828 000033C4 06 push es - 26829 000033C5 0E push cs - 26830 000033C6 07 pop es - 26831 000033C7 86E9 xchg ch,cl ;AN000; switch hours & minutes - 26832 000033C9 86F2 xchg dh,dl ;AN000; switch seconds & hundredths - 26833 000033CB 2E890E[2492] mov [cs:PromTim_hr_min],cx ;AC000; put hours and minutes into message subst block - 26834 000033D0 2E8916[2692] mov [cs:PromTim_Sec_hn],dx ;AC000; put seconds and hundredths into message subst block - 26835 000033D5 BA[1F92] mov dx,promtim_ptr ;AC000; set up message for output - 26836 000033D8 E84D20 call std_printf - 26837 - 26838 ;AD061; mov word [cs:PromTim_hr_min],0 - 26839 ;AC000; reset hour, minutes, seconds, and hundredths - 26840 ;AD061; mov word [cs:PromTim_Sec_hn],0 - 26841 ;AC000; pointers in control block - 26842 000033DB 07 pop es - 26843 000033DC C3 retn - 26844 - 26845 ; =============== S U B R O U T I N E ======================================= - 26846 - 26847 ; MSDOS 6.0 - 26848 - 26849 ; **************************************************************** - 26850 ; * - 26851 ; * ROUTINE: GETDAT - Prompt user for date - 26852 ; * - 26853 ; * FUNCTION: Gets the date format from the COUNTRY DEPENDENT - 26854 ; * INFORMATION and issues the "Enter new date" - 26855 ; * message with the proper date format. COMBUF - 26856 ; * is reset to get a date from the command line. - 26857 ; * The PARSE_DATE blocks are then reset and the - 26858 ; * PARSE function call is issued. - 26859 ; * - 26860 ; * INPUT: NONE - 26861 ; * - 26862 ; * OUTPUT: COMBUF - 26863 ; * PARSER RETURN CODES + 26748 ;AD061; mov word [CurTim_hr_min],0 ;AC000; reset hour, minutes, seconds, and hundredths + 26749 ;AD061; mov word [CurTim_Sec_hn],0 ;AC000; pointers in control block + 26750 + 26751 GET_NEW_TIME: + 26752 00003383 E8B100 call GETTIM ;AC000; + 26753 + 26754 ; 11/06/2023 + 26755 ;cmp ax,-1 + 26756 ;;cmp ax,END_OF_LINE ;AC000; are we at end of line? + 26757 ;je short time_end ;AC000; + 26758 ;;cmp ax,0 + 26759 ;;cmp ax,RESULT_NO_ERROR ;AN000; did we have an error? + 26760 ;;jne short TIMERR ;AN000; yes - go issue message + 26761 ;or ax,ax ; ax = 0 ? + 26762 ;;jnz short TIMERR + 26763 ; 27/02/2023 + 26764 ;jz short COMTIM + 26765 + 26766 ; 11/06/2023 + 26767 00003386 40 inc ax ; cmp ax,-1 + 26768 00003387 74E2 jz short time_end ; 0FFFFh -> 0 + 26769 00003389 48 dec ax ; cmp ax,0 + 26770 0000338A 74B6 jz short COMTIM ; 1 -> 0 + 26771 ; ax > 0 + 26772 + 26773 ;COMTIM: + 26774 ; .... + 26775 TIMERR: + 26776 0000338C E8EAF5 call CRLF2 ;AN028; print out a blank line + 26777 0000338F BA[DA90] mov dx,BadTim_Ptr + 26778 00003392 E89320 call std_printf ; Print error message + 26779 00003395 EBEC jmp short GET_NEW_TIME ;AC000; Try again + 26780 + 26781 ; =============== S U B R O U T I N E ======================================= + 26782 + 26783 ; MSDOS 6.0 + 26784 + 26785 ; Set the special flag in the INIT flag to the value in CX. + 26786 + 26787 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26788 SetInitFlag: + 26789 00003397 8E1E[F59B] mov ds,[RESSEG] + 26790 + 26791 0000339B 8026[1203]FD and byte [InitFlag],~INITSPECIAL ; 0FDh ; not initspecial + 26792 ;and byte [InitFlag],0FDh + 26793 000033A0 080E[1203] or byte [InitFlag],cl + 26794 000033A4 0E push cs + 26795 000033A5 1F pop ds + 26796 000033A6 C3 retn + 26797 + 26798 ; =============== S U B R O U T I N E ======================================= + 26799 + 26800 ; MSDOS 6.0 + 26801 + 26802 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26803 PipeOff: + 26804 000033A7 1E push ds + 26805 000033A8 50 push ax + 26806 000033A9 2E8E1E[F59B] mov ds,[cs:RESSEG] + 26807 000033AE 30C0 xor al,al + 26808 000033B0 8606[1303] xchg [PipeFlag],al + 26809 000033B4 08C0 or al,al + 26810 000033B6 7404 jz short PipeOffDone + 26811 000033B8 D02E[9D02] shr byte [EchoFlag],1 + 26812 PipeOffDone: + 26813 000033BC 58 pop ax + 26814 000033BD 1F pop ds + 26815 000033BE C3 retn + 26816 + 26817 ; =============== S U B R O U T I N E ======================================= + 26818 + 26819 ; MSDOS 6.0 + 26820 + 26821 ; 27/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26822 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26823 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM + 26824 PRINT_TIME: + 26825 ;mov ah,Get_Time + 26826 000033BF B42C mov ah,2Ch + 26827 ;int 21h ; Get time in CX:DX + 26828 ; 08/08/2024 - PCDOS 7.1 COMMAND.COM + 26829 000033C1 E8F6D1 call int_21h_indirect + 26830 + 26831 000033C4 06 push es + 26832 000033C5 0E push cs + 26833 000033C6 07 pop es + 26834 000033C7 86E9 xchg ch,cl ;AN000; switch hours & minutes + 26835 000033C9 86F2 xchg dh,dl ;AN000; switch seconds & hundredths + 26836 000033CB 2E890E[2492] mov [cs:PromTim_hr_min],cx ;AC000; put hours and minutes into message subst block + 26837 000033D0 2E8916[2692] mov [cs:PromTim_Sec_hn],dx ;AC000; put seconds and hundredths into message subst block + 26838 000033D5 BA[1F92] mov dx,promtim_ptr ;AC000; set up message for output + 26839 000033D8 E84D20 call std_printf + 26840 + 26841 ;AD061; mov word [cs:PromTim_hr_min],0 + 26842 ;AC000; reset hour, minutes, seconds, and hundredths + 26843 ;AD061; mov word [cs:PromTim_Sec_hn],0 + 26844 ;AC000; pointers in control block + 26845 000033DB 07 pop es + 26846 000033DC C3 retn + 26847 + 26848 ; =============== S U B R O U T I N E ======================================= + 26849 + 26850 ; MSDOS 6.0 + 26851 + 26852 ; **************************************************************** + 26853 ; * + 26854 ; * ROUTINE: GETDAT - Prompt user for date + 26855 ; * + 26856 ; * FUNCTION: Gets the date format from the COUNTRY DEPENDENT + 26857 ; * INFORMATION and issues the "Enter new date" + 26858 ; * message with the proper date format. COMBUF + 26859 ; * is reset to get a date from the command line. + 26860 ; * The PARSE_DATE blocks are then reset and the + 26861 ; * PARSE function call is issued. + 26862 ; * + 26863 ; * INPUT: NONE 26864 ; * - 26865 ; **************************************************************** - 26866 - 26867 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26868 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:30E2h + 26865 ; * OUTPUT: COMBUF + 26866 ; * PARSER RETURN CODES + 26867 ; * + 26868 ; **************************************************************** 26869 - 26870 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26871 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:368Ch + 26870 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26871 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:30E2h 26872 - 26873 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM - 26874 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3539h - 26875 GETDAT: - 26876 ;mov ax,(International SHL 8) - 26877 000033DD B80038 mov ax,3800h - 26878 ; Determine what format the date - 26879 000033E0 BA5C00 mov dx,5Ch ; should be entered in and - 26880 ;int 21h ; print a message describing it - 26881 ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION - 26882 ; get current-country info - 26883 ; DS:DX -> buffer for returned info - 26884 ; 08/08/2024 - PCDOS 7.1 COMMAND.COM - 26885 000033E3 E8D4D1 call int_21h_indirect - 26886 000033E6 89D6 mov si,dx - 26887 000033E8 AD lodsw - 26888 000033E9 2E8B16[FD91] mov dx,[cs:usadat_ptr] ;AC000; get mm-dd-yy - 26889 000033EE 48 dec ax - 26890 000033EF 780C js short printformat - 26891 000033F1 2E8B16[0092] mov dx,[cs:eurdat_ptr] ;AC000; get dd-mm-yy - 26892 000033F6 7405 jz short printformat - 26893 000033F8 2E8B16[0392] mov dx,[cs:japdat_ptr] ;AC000; get yy-mm-dd - 26894 printformat: - 26895 000033FD 89D0 mov ax,dx ;AN000; get message number of format - 26896 ;mov dh,util_msg_class ;AN000; this is a utility message - 26897 000033FF B6FF mov dh,-1 ; 0FFh - 26898 00003401 E80721 call TSYSGETMSG ;AN000; get the address of the message - 26899 00003404 2E8936[D190] mov [cs:NewDat_Format],si ;AN000; put the address in subst block - 26900 00003409 BA[CC90] mov dx,NewDat_Ptr ;AC000; get address of message to print - 26901 0000340C E81920 call std_printf - 26902 ;mov word [cs:NewDat_Format],no_subst - 26903 ;AN000; reset subst block - 26904 0000340F 2EC706[D190]0000 mov word [cs:NewDat_Format],0 - 26905 - 26906 ; 28/02/2023 - 26907 00003416 BF[5296] mov di,PARSE_DATE ;AN000; Get address of PARSE_DATE - 26908 ; 28/02/2023 - 26909 gettim_p: - 26910 ;mov ah,Std_Con_String_Input - 26911 00003419 B40A mov ah,0Ah - 26912 0000341B BA[549A] mov dx,COMBUF - 26913 0000341E B90200 mov cx,INITSPECIAL ; 2 ; Set bit in InitFlag that indicates - 26914 00003421 E873FF call SetInitFlag ; prompting for date. - 26915 ;int 21h ; Get input line - 26916 ; 08/08/2024 - PCDOS 7.1 COMMAND.COM - 26917 00003424 E893D1 call int_21h_indirect - 26918 00003427 31C9 xor cx,cx ; Reset bit in InitFlag that indicates - 26919 00003429 E86BFF call SetInitFlag ; prompting for date. - 26920 0000342C E84AF5 call CRLF2 - 26921 ; 28/02/2023 - 26922 ;mov di,PARSE_DATE ;AN000; Get address of PARSE_DATE - 26923 ;gettim_p: ; 28/02/2023 - 26924 0000342F BE[569A] mov si,COMBUF+2 - 26925 ;xor cx,cx ; cx = 0 ;AN000; clear counter for positionals - 26926 00003432 31D2 xor dx,dx ;AN000; - 26927 ;call cmd_parse ;AC000; call parser - 26928 ;retn - 26929 ; 28/02/2023 - 26930 00003434 E93515 jmp cmd_parse - 26931 - 26932 ; =============== S U B R O U T I N E ======================================= - 26933 - 26934 ; MSDOS 6.0 - 26935 - 26936 ; **************************************************************** - 26937 ; * - 26938 ; * ROUTINE: GETTIME - Prompt user for time - 26939 ; * - 26940 ; * FUNCTION: Gets the time format from the COUNTRY DEPENDENT - 26941 ; * INFORMATION and issues the "Enter new time" - 26942 ; * message. COMBUF is reset to get a time from the - 26943 ; * command line. The PARSE_TIME blocks are then - 26944 ; * reset and the PARSE function call is issued. - 26945 ; * - 26946 ; * INPUT: NONE - 26947 ; * - 26948 ; * OUTPUT: COMBUF - 26949 ; * PARSER RETURN CODES + 26873 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26874 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:368Ch + 26875 + 26876 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM + 26877 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3539h + 26878 GETDAT: + 26879 ;mov ax,(International SHL 8) + 26880 000033DD B80038 mov ax,3800h + 26881 ; Determine what format the date + 26882 000033E0 BA5C00 mov dx,5Ch ; should be entered in and + 26883 ;int 21h ; print a message describing it + 26884 ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION + 26885 ; get current-country info + 26886 ; DS:DX -> buffer for returned info + 26887 ; 08/08/2024 - PCDOS 7.1 COMMAND.COM + 26888 000033E3 E8D4D1 call int_21h_indirect + 26889 000033E6 89D6 mov si,dx + 26890 000033E8 AD lodsw + 26891 000033E9 2E8B16[FD91] mov dx,[cs:usadat_ptr] ;AC000; get mm-dd-yy + 26892 000033EE 48 dec ax + 26893 000033EF 780C js short printformat + 26894 000033F1 2E8B16[0092] mov dx,[cs:eurdat_ptr] ;AC000; get dd-mm-yy + 26895 000033F6 7405 jz short printformat + 26896 000033F8 2E8B16[0392] mov dx,[cs:japdat_ptr] ;AC000; get yy-mm-dd + 26897 printformat: + 26898 000033FD 89D0 mov ax,dx ;AN000; get message number of format + 26899 ;mov dh,util_msg_class ;AN000; this is a utility message + 26900 000033FF B6FF mov dh,-1 ; 0FFh + 26901 00003401 E80721 call TSYSGETMSG ;AN000; get the address of the message + 26902 00003404 2E8936[D190] mov [cs:NewDat_Format],si ;AN000; put the address in subst block + 26903 00003409 BA[CC90] mov dx,NewDat_Ptr ;AC000; get address of message to print + 26904 0000340C E81920 call std_printf + 26905 ;mov word [cs:NewDat_Format],no_subst + 26906 ;AN000; reset subst block + 26907 0000340F 2EC706[D190]0000 mov word [cs:NewDat_Format],0 + 26908 + 26909 ; 28/02/2023 + 26910 00003416 BF[5296] mov di,PARSE_DATE ;AN000; Get address of PARSE_DATE + 26911 ; 28/02/2023 + 26912 gettim_p: + 26913 ;mov ah,Std_Con_String_Input + 26914 00003419 B40A mov ah,0Ah + 26915 0000341B BA[549A] mov dx,COMBUF + 26916 0000341E B90200 mov cx,INITSPECIAL ; 2 ; Set bit in InitFlag that indicates + 26917 00003421 E873FF call SetInitFlag ; prompting for date. + 26918 ;int 21h ; Get input line + 26919 ; 08/08/2024 - PCDOS 7.1 COMMAND.COM + 26920 00003424 E893D1 call int_21h_indirect + 26921 00003427 31C9 xor cx,cx ; Reset bit in InitFlag that indicates + 26922 00003429 E86BFF call SetInitFlag ; prompting for date. + 26923 0000342C E84AF5 call CRLF2 + 26924 ; 28/02/2023 + 26925 ;mov di,PARSE_DATE ;AN000; Get address of PARSE_DATE + 26926 ;gettim_p: ; 28/02/2023 + 26927 0000342F BE[569A] mov si,COMBUF+2 + 26928 ;xor cx,cx ; cx = 0 ;AN000; clear counter for positionals + 26929 00003432 31D2 xor dx,dx ;AN000; + 26930 ;call cmd_parse ;AC000; call parser + 26931 ;retn + 26932 ; 28/02/2023 + 26933 00003434 E93515 jmp cmd_parse + 26934 + 26935 ; =============== S U B R O U T I N E ======================================= + 26936 + 26937 ; MSDOS 6.0 + 26938 + 26939 ; **************************************************************** + 26940 ; * + 26941 ; * ROUTINE: GETTIME - Prompt user for time + 26942 ; * + 26943 ; * FUNCTION: Gets the time format from the COUNTRY DEPENDENT + 26944 ; * INFORMATION and issues the "Enter new time" + 26945 ; * message. COMBUF is reset to get a time from the + 26946 ; * command line. The PARSE_TIME blocks are then + 26947 ; * reset and the PARSE function call is issued. + 26948 ; * + 26949 ; * INPUT: NONE 26950 ; * - 26951 ; **************************************************************** - 26952 - 26953 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 26954 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:313Dh + 26951 ; * OUTPUT: COMBUF + 26952 ; * PARSER RETURN CODES + 26953 ; * + 26954 ; **************************************************************** 26955 - 26956 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 26957 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:36E7h + 26956 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 26957 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:313Dh 26958 - 26959 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM - 26960 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3596h - 26961 GETTIM: - 26962 00003437 31C9 xor cx,cx ; Initialize hours and minutes to zero - 26963 00003439 BA[EB90] mov dx,NewTim_Ptr - 26964 0000343C E8E91F call std_printf - 26965 - 26966 ; 28/02/2023 - 26967 0000343F BF[6496] mov di,PARSE_TIME - 26968 00003442 EBD5 jmp short gettim_p - 26969 - 26970 ; 28/02/2023 - 26971 ; ;mov ah,Std_Con_String_Input - 26972 ; mov ah,0Ah - 26973 ; mov dx,COMBUF - 26974 ; mov cx,INITSPECIAL ; 2 ; Set bit in InitFlag that indicates - 26975 ; call SetInitFlag ; prompting for time. - 26976 ; int 21h ; Get input line - 26977 ; ; 28/02/2023 - 26978 ; xor cx,cx ; Reset bit in InitFlag that indicates - 26979 ; call SetInitFlag ; prompting for time. - 26980 ; call CRLF2 - 26981 ; ; 28/02/2023 - 26982 ; ;mov si,COMBUF+2 - 26983 ; ; 28/02/2023 - 26984 ; mov di,PARSE_TIME ;AN000; Get address of PARSE_TIME - 26985 ; ; 28/02/2023 - 26986 ; jmp short gettim_p - 26987 ; ; 28/02/2023 - 26988 ; ;;xor cx,cx ;AN000; clear counter for positionals - 26989 ; ;xor dx,dx ;AN000; - 26990 ; ;call cmd_parse ;AC000; call parser - 26991 ; ;retn - 26992 - 26993 - 26994 ; =============== S U B R O U T I N E ======================================= + 26959 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 26960 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:36E7h + 26961 + 26962 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM + 26963 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3596h + 26964 GETTIM: + 26965 00003437 31C9 xor cx,cx ; Initialize hours and minutes to zero + 26966 00003439 BA[EB90] mov dx,NewTim_Ptr + 26967 0000343C E8E91F call std_printf + 26968 + 26969 ; 28/02/2023 + 26970 0000343F BF[6496] mov di,PARSE_TIME + 26971 00003442 EBD5 jmp short gettim_p + 26972 + 26973 ; 28/02/2023 + 26974 ; ;mov ah,Std_Con_String_Input + 26975 ; mov ah,0Ah + 26976 ; mov dx,COMBUF + 26977 ; mov cx,INITSPECIAL ; 2 ; Set bit in InitFlag that indicates + 26978 ; call SetInitFlag ; prompting for time. + 26979 ; int 21h ; Get input line + 26980 ; ; 28/02/2023 + 26981 ; xor cx,cx ; Reset bit in InitFlag that indicates + 26982 ; call SetInitFlag ; prompting for time. + 26983 ; call CRLF2 + 26984 ; ; 28/02/2023 + 26985 ; ;mov si,COMBUF+2 + 26986 ; ; 28/02/2023 + 26987 ; mov di,PARSE_TIME ;AN000; Get address of PARSE_TIME + 26988 ; ; 28/02/2023 + 26989 ; jmp short gettim_p + 26990 ; ; 28/02/2023 + 26991 ; ;;xor cx,cx ;AN000; clear counter for positionals + 26992 ; ;xor dx,dx ;AN000; + 26993 ; ;call cmd_parse ;AC000; call parser + 26994 ; ;retn 26995 - 26996 ; MSDOS 6.0 - 26997 - 26998 ;Skip_white: Skips over the whitespace chars that could be present after - 26999 ;the '=' sign in the environment variable before the actual path. - 27000 ; - 27001 ; ENTRY: ds:si = arguments of the environment variable - 27002 ; - 27003 ; EXIT: ds:si = start of the path - 27004 ; - 27005 ; REGISTERS AFFECTED: ax - 27006 - 27007 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27008 skip_white: - 27009 00003444 FC cld - 27010 skw_lp: - 27011 00003445 AC lodsb - 27012 00003446 3C20 cmp al,' ' ;blank char? - 27013 00003448 74FB jz short skw_lp ;yes, skip it - 27014 0000344A 3C09 cmp al,9 ;tab char? - 27015 0000344C 74F7 jz short skw_lp ;yes, skip it - 27016 0000344E 4E dec si ;point at first non-white - 27017 0000344F C3 retn - 27018 - 27019 ; =============== S U B R O U T I N E ======================================= - 27020 - 27021 ; MSDOS 6.0 - 27022 - 27023 ;Copy_pipe_path: This routine copies the path from the TEMP environment - 27024 ;variable into the path buffers Pipe1 & Pipe2. - 27025 ; - 27026 ; ENTRY: ds:si = path to be copied - 27027 ; es = RESGROUP + 26996 + 26997 ; =============== S U B R O U T I N E ======================================= + 26998 + 26999 ; MSDOS 6.0 + 27000 + 27001 ;Skip_white: Skips over the whitespace chars that could be present after + 27002 ;the '=' sign in the environment variable before the actual path. + 27003 ; + 27004 ; ENTRY: ds:si = arguments of the environment variable + 27005 ; + 27006 ; EXIT: ds:si = start of the path + 27007 ; + 27008 ; REGISTERS AFFECTED: ax + 27009 + 27010 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27011 skip_white: + 27012 00003444 FC cld + 27013 skw_lp: + 27014 00003445 AC lodsb + 27015 00003446 3C20 cmp al,' ' ;blank char? + 27016 00003448 74FB jz short skw_lp ;yes, skip it + 27017 0000344A 3C09 cmp al,9 ;tab char? + 27018 0000344C 74F7 jz short skw_lp ;yes, skip it + 27019 0000344E 4E dec si ;point at first non-white + 27020 0000344F C3 retn + 27021 + 27022 ; =============== S U B R O U T I N E ======================================= + 27023 + 27024 ; MSDOS 6.0 + 27025 + 27026 ;Copy_pipe_path: This routine copies the path from the TEMP environment + 27027 ;variable into the path buffers Pipe1 & Pipe2. 27028 ; - 27029 ; EXIT: Path copied into Pipe1 and Pipe2. - 27030 ; - 27031 ; REGISTERS AFFECTED: si, di, cx, ax - 27032 - 27033 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27034 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3174h + 27029 ; ENTRY: ds:si = path to be copied + 27030 ; es = RESGROUP + 27031 ; + 27032 ; EXIT: Path copied into Pipe1 and Pipe2. + 27033 ; + 27034 ; REGISTERS AFFECTED: si, di, cx, ax 27035 - 27036 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM - 27037 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:371Eh + 27036 ; 28/02/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27037 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3174h 27038 - 27039 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM - 27040 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:35CEh - 27041 copy_pipe_path: - 27042 00003450 B9FFFF mov cx,0FFFFh ; 65535 - 27043 00003453 30C0 xor al,al - 27044 - 27045 00003455 89F7 mov di,si - 27046 00003457 06 push es ;save es - 27047 00003458 1E push ds - 27048 00003459 07 pop es ;es:di = path to be copied - 27049 - 27050 0000345A FC cld - 27051 0000345B 57 push di - 27052 0000345C F2AE repnz scasb ;look for the null char - 27053 0000345E 5F pop di - 27054 - 27055 0000345F 07 pop es ;es = RESGROUP again - 27056 - 27057 00003460 F7D1 not cx ;length including the null - 27058 - 27059 ;;;;mov di,320h ; MSDOS 5.0 COMMAND.COM ; (RESGROUP:EndInit) - 27060 ;;;mov di,3EAh ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 - 27061 ;;mov di,41Eh ; PCDOS 7.1 COMMAND.COM ; 08/08/2024 - 27062 ;mov di,offset DATARES:Pipe1 - 27063 00003462 BF[1503] mov di,Pipe1 ; (offset RESGROUP:EndInit) - 27064 00003465 57 push di - 27065 00003466 51 push cx - 27066 00003467 F3A4 rep movsb ;copy path into Pipe1 - 27067 00003469 59 pop cx - 27068 0000346A 5F pop di - 27069 - 27070 0000346B 1E push ds - 27071 0000346C 06 push es - 27072 0000346D 1F pop ds ;ds:si = Pipe1 - 27073 0000346E 89FE mov si,di - 27074 ;;;;mov di,36Fh ; MSDOS 5.0 COMMAND.COM ; (RESGROUP:EndInit+79) - 27075 ;;;mov di,439h ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 - 27076 ;;mov di,46Dh ; PCDOS 7.1 COMMAND.COM ; 08/08/2024 - 27077 ;mov di,offset DATARES:Pipe2 ;es:di = Pipe2 - 27078 00003470 BF[6403] mov di,Pipe2 ; (offset RESGROUP:EndInit+79) - 27079 00003473 F3A4 rep movsb ;copy path into Pipe2 - 27080 00003475 1F pop ds - 27081 00003476 C3 retn - 27082 - 27083 ;============================================================================ - 27084 ; PARSE2.ASM, MSDOS 6.0, 1991 - 27085 ;============================================================================ - 27086 ; 03/10/2018 - Retro DOS v3.0 - 27087 - 27088 ;---------------------------------------------------------------------------- - 27089 ; PARSELINE takes an MSDOS command line and maps it into a UNIX-style - 27090 ; argv[argvcnt] array. The most important difference between this array and - 27091 ; the tradition UNIX format is the extra cparse information included with - 27092 ; each argument element. - 27093 ;--------------- - 27094 ; ENTRY: - 27095 ; BL special delimiter for cparse -- not implemented) + 27039 ; 11/06/2023 - Retro DOS v4.2 COMMAND.COM + 27040 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:371Eh + 27041 + 27042 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM + 27043 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:35CEh + 27044 copy_pipe_path: + 27045 00003450 B9FFFF mov cx,0FFFFh ; 65535 + 27046 00003453 30C0 xor al,al + 27047 + 27048 00003455 89F7 mov di,si + 27049 00003457 06 push es ;save es + 27050 00003458 1E push ds + 27051 00003459 07 pop es ;es:di = path to be copied + 27052 + 27053 0000345A FC cld + 27054 0000345B 57 push di + 27055 0000345C F2AE repnz scasb ;look for the null char + 27056 0000345E 5F pop di + 27057 + 27058 0000345F 07 pop es ;es = RESGROUP again + 27059 + 27060 00003460 F7D1 not cx ;length including the null + 27061 + 27062 ;;;;mov di,320h ; MSDOS 5.0 COMMAND.COM ; (RESGROUP:EndInit) + 27063 ;;;mov di,3EAh ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 + 27064 ;;mov di,41Eh ; PCDOS 7.1 COMMAND.COM ; 08/08/2024 + 27065 ;mov di,offset DATARES:Pipe1 + 27066 00003462 BF[1503] mov di,Pipe1 ; (offset RESGROUP:EndInit) + 27067 00003465 57 push di + 27068 00003466 51 push cx + 27069 00003467 F3A4 rep movsb ;copy path into Pipe1 + 27070 00003469 59 pop cx + 27071 0000346A 5F pop di + 27072 + 27073 0000346B 1E push ds + 27074 0000346C 06 push es + 27075 0000346D 1F pop ds ;ds:si = Pipe1 + 27076 0000346E 89FE mov si,di + 27077 ;;;;mov di,36Fh ; MSDOS 5.0 COMMAND.COM ; (RESGROUP:EndInit+79) + 27078 ;;;mov di,439h ; MSDOS 6.22 COMMAND.COM ; 11/06/2023 + 27079 ;;mov di,46Dh ; PCDOS 7.1 COMMAND.COM ; 08/08/2024 + 27080 ;mov di,offset DATARES:Pipe2 ;es:di = Pipe2 + 27081 00003470 BF[6403] mov di,Pipe2 ; (offset RESGROUP:EndInit+79) + 27082 00003473 F3A4 rep movsb ;copy path into Pipe2 + 27083 00003475 1F pop ds + 27084 00003476 C3 retn + 27085 + 27086 ;============================================================================ + 27087 ; PARSE2.ASM, MSDOS 6.0, 1991 + 27088 ;============================================================================ + 27089 ; 03/10/2018 - Retro DOS v3.0 + 27090 + 27091 ;---------------------------------------------------------------------------- + 27092 ; PARSELINE takes an MSDOS command line and maps it into a UNIX-style + 27093 ; argv[argvcnt] array. The most important difference between this array and + 27094 ; the tradition UNIX format is the extra cparse information included with + 27095 ; each argument element. 27096 ;--------------- - 27097 ; EXIT: - 27098 ; CF set if error - 27099 ; AL error code (carry set). Note AH clobbered in any event. - 27100 ; argv[] array of cparse flags and pointers to arguments - 27101 ; argvcnt argument count - 27102 ;--------------- - 27103 ; NOTE(S): - 27104 ; * BL (special delimiter) is ignored, for now (set to space). - 27105 ; * Parseflags record contains cparse flags, as follows: - 27106 ; sw_flag -- was this arg a switch? - 27107 ; wildcard -- whether or not it contained a * or ? - 27108 ; path_sep -- maybe it was a pathname - 27109 ; unused -- for future expansion - 27110 ; special_delim -- was there an initial special delimiter? - 27111 ; * argv[] and argvcnt are undefined if CF/AL indicates an error. - 27112 ; * Relationship between input, cparse output, and comtail can be - 27113 ; found in the following chart. Despite the claim of the cparse - 27114 ; documentation that, "Token buffer always starts d: for non switch - 27115 ; tokens", such is not the case (see column two, row two). - 27116 ; Similarly, [STARTEL] is not null when the command line is one of - 27117 ; the forms, "d:", "d:\", or "d:/". In fact, *STARTEL (i.e., what - 27118 ; STARTEL addresses) will be null. This is clearly just a - 27119 ; documentation error. - 27120 ; * cparse also returns a switch code in BP for each switch it - 27121 ; recognizes on the command line. - 27122 ; * arglen for each token does NOT include the terminating null. - 27123 ; * Finally, note that interesting constructions like 'foodir/*.exe' - 27124 ; parse as three separate tokens, and the asterisk is NOT a wildcard. - 27125 ; For example, 'for %i in (foodir/*.exe) do echo %i' will first - 27126 ; echo 'foodir', then '*', then '.exe'. Using cparse for command- - 27127 ; line parsing may result in slightly different behavior than - 27128 ; previously observed with the old COMMAND.COM command-line parser. - 27129 ; - 27130 ; Input Cparse Command Line (80H) - 27131 ; \alan\foo.bat c:\alan\foo.bat \alan\foo.bat - 27132 ; alan\foo.bat alan\foo.bat alan\foo.bat - 27133 ; foo.bat foo.bat foo.bat - 27134 ; c:\alan\foo.bat c:\alan\foo.bat c:\alan\foo.bat - 27135 ; c:alan\foo.bat c:alan\foo.bat c:alan\foo.bat - 27136 ; c:foo.bat c:foo.bat c:foo.bat - 27137 - 27138 ; =============== S U B R O U T I N E ======================================= - 27139 - 27140 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 23D0h - 27141 - 27142 ; 01/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27143 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 319Bh + 27097 ; ENTRY: + 27098 ; BL special delimiter for cparse -- not implemented) + 27099 ;--------------- + 27100 ; EXIT: + 27101 ; CF set if error + 27102 ; AL error code (carry set). Note AH clobbered in any event. + 27103 ; argv[] array of cparse flags and pointers to arguments + 27104 ; argvcnt argument count + 27105 ;--------------- + 27106 ; NOTE(S): + 27107 ; * BL (special delimiter) is ignored, for now (set to space). + 27108 ; * Parseflags record contains cparse flags, as follows: + 27109 ; sw_flag -- was this arg a switch? + 27110 ; wildcard -- whether or not it contained a * or ? + 27111 ; path_sep -- maybe it was a pathname + 27112 ; unused -- for future expansion + 27113 ; special_delim -- was there an initial special delimiter? + 27114 ; * argv[] and argvcnt are undefined if CF/AL indicates an error. + 27115 ; * Relationship between input, cparse output, and comtail can be + 27116 ; found in the following chart. Despite the claim of the cparse + 27117 ; documentation that, "Token buffer always starts d: for non switch + 27118 ; tokens", such is not the case (see column two, row two). + 27119 ; Similarly, [STARTEL] is not null when the command line is one of + 27120 ; the forms, "d:", "d:\", or "d:/". In fact, *STARTEL (i.e., what + 27121 ; STARTEL addresses) will be null. This is clearly just a + 27122 ; documentation error. + 27123 ; * cparse also returns a switch code in BP for each switch it + 27124 ; recognizes on the command line. + 27125 ; * arglen for each token does NOT include the terminating null. + 27126 ; * Finally, note that interesting constructions like 'foodir/*.exe' + 27127 ; parse as three separate tokens, and the asterisk is NOT a wildcard. + 27128 ; For example, 'for %i in (foodir/*.exe) do echo %i' will first + 27129 ; echo 'foodir', then '*', then '.exe'. Using cparse for command- + 27130 ; line parsing may result in slightly different behavior than + 27131 ; previously observed with the old COMMAND.COM command-line parser. + 27132 ; + 27133 ; Input Cparse Command Line (80H) + 27134 ; \alan\foo.bat c:\alan\foo.bat \alan\foo.bat + 27135 ; alan\foo.bat alan\foo.bat alan\foo.bat + 27136 ; foo.bat foo.bat foo.bat + 27137 ; c:\alan\foo.bat c:\alan\foo.bat c:\alan\foo.bat + 27138 ; c:alan\foo.bat c:alan\foo.bat c:alan\foo.bat + 27139 ; c:foo.bat c:foo.bat c:foo.bat + 27140 + 27141 ; =============== S U B R O U T I N E ======================================= + 27142 + 27143 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 23D0h 27144 - 27145 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 27146 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3745h + 27145 ; 01/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27146 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 319Bh 27147 - 27148 ; 27/07/2024 - Retro DOS v4.0-v4.1-v4.2-v5.0 COMMAND.COM (PARSELINE) - 27149 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 35F5h + 27148 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 27149 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3745h 27150 - 27151 PARSELINE: - 27152 00003477 50 push ax ; most of these are clobbered - 27153 00003478 53 push bx ; by cparse... - 27154 00003479 51 push cx - 27155 0000347A 52 push dx - 27156 0000347B 57 push di - 27157 0000347C 56 push si - 27158 0000347D 9C pushf - 27159 ;mov byte [cpyflag],0 ; Turn "CPARSE called from COPY flag" off - 27160 0000347E C706[16A4]FFFF mov word [LASTARG],-1 ; last argument at which to accumulate - 27161 00003484 31C0 xor ax,ax - 27162 ;;mov cx,1348 - 27163 ; 27/07/2024 - 27164 ;mov cx,1092 ; PCDOS 7.1 COMMAND.COM - 27165 00003486 B94404 mov cx,ARG_UNIT.SIZE ; 1092 - 27166 00003489 A2[A49D] mov [cpyflag],al ; 0 ; 27/07/2024 - 27167 0000348C BF[509F] mov di,ARG - 27168 0000348F F3AA rep stosb - 27169 ;mov word [ARGBUF_PTR],ARG_ARGBUF - 27170 00003491 C706[94A3][14A2] mov word [ARGBUF_PTR],ARG+ARG_UNIT.argbuf - 27171 ;mov word [ARG_ARGSWINFO],0 ; switch information, and info to date - 27172 ;mov word [ARG+ARG_UNIT.argswinfo],0 - 27173 00003497 A3[12A2] mov [ARG+ARG_UNIT.argswinfo],ax ; 0 ; 27/07/2024 - 27174 ;mov word [ARG_ARGVCNT],0 ; initialize argvcnt/argv[] - 27175 ;mov word [ARG+ARG_UNIT.argvcnt],0 - 27176 0000349A A3[10A2] mov [ARG+ARG_UNIT.argvcnt],ax ; 0 ; 27/07/2024 - 27177 0000349D BE[569A] mov si,COMBUF+2 ; prescan leaves cooked input in combuf - 27178 - 27179 ; This next section of code (up to pcont:) makes sure that si is set up for - 27180 ; parsing. It should point at COMBUF if FORFLAG is set and arg.argforcombuf - 27181 ; otherwise. This is done so that commands can get arg pointers into their - 27182 ; original command line (or an exact copy of it) in arg_ocomptr. - 27183 ; Arg.argforcombuf is used so that the for loop processor will always be able - 27184 ; to get a hold of its original command line; even after COMBUF is blasted by - 27185 ; the command to be repeated or the transient part of command has been - 27186 ; reloaded. - 27187 - 27188 000034A0 1E push ds - 27189 000034A1 8E1E[F59B] mov ds,[RESSEG] - 27190 ;cmp byte [ForFlag],0 - 27191 000034A5 3806[AB02] cmp [ForFlag],al ; 0 ; 27/07/2024 - 27192 000034A9 1F pop ds - 27193 000034AA 7510 jnz short PCONT - 27194 ;mov di,ARG_ARGFORCOMBUF - 27195 000034AC BF[14A3] mov di,ARG+ARG_UNIT.argforcombuf - 27196 000034AF 30ED xor ch,ch - 27197 000034B1 8A0E[559A] mov cl,[COMBUF+1] - 27198 000034B5 FEC1 inc cl - 27199 000034B7 F3A4 rep movsb - 27200 ;mov si,ARG_ARGFORCOMBUF - 27201 000034B9 BE[14A3] mov si,ARG+ARG_UNIT.argforcombuf - 27202 PCONT: - 27203 000034BC BF[96A3] mov di,TPBUF ; destination is temporary token buffer - 27204 000034BF B320 mov bl,' ' ; no special delimiter, for now - 27205 PARSELOOP: - 27206 000034C1 8936[18A4] mov [COMPTR],si ; save ptr into original command buffer - 27207 000034C5 31ED xor bp,bp ; switch information put here by cparse - 27208 000034C7 C606[329F]00 mov byte [expand_star],0 ; don't expand *'s to ?'s - 27209 000034CC E8B7F4 call scanoff ; skip leading blanks... - 27210 000034CF E8D512 call cparse ; byte off a token (args in SI, DI, BL) - 27211 000034D2 730B jnb short MORE_PRSE - 27212 000034D4 09ED or bp,bp ; Check for trailing switch character - 27213 000034D6 7403 jz short PARSEDONE - 27214 000034D8 E81700 call newarg ; We hit CR but BP is non-zero. The - 27215 ; typical cause of this is that a - 27216 ; switch char IMMEDIATELY preceeds - 27217 ; the CR. We have an argument, but it - 27218 ; is sort of an error. - 27219 ;jmp short PARSEDONE ; We're done (found the CR). - 27220 ; 01/03/2023 - 27221 PARSEDONE: - 27222 000034DB 9D popf - 27223 000034DC F8 clc - 27224 000034DD EB0C jmp short PARSE_EXIT - 27225 - 27226 MORE_PRSE: - 27227 000034DF C606[A49D]02 mov byte [cpyflag],2 - 27228 ; tell CPARSE that 1st token is done - 27229 000034E4 E80B00 call newarg ; add to argv array (CX has char count) - 27230 000034E7 73D8 jnb short PARSELOOP ; was everything OK? - 27231 ;jmp short PARSE_ERROR ; NO, it wasn't -- bug out (CF set) - 27232 ; 01/03/2023 - 27233 ;PARSEDONE: - 27234 ;popf - 27235 ;clc - 27236 ;jmp short PARSE_EXIT - 27237 - 27238 PARSE_ERROR: ; error entry (er, exit) point - 27239 000034E9 9D popf - 27240 000034EA F9 stc - 27241 PARSE_EXIT: ; depend on not changing CF - 27242 000034EB 5E pop si - 27243 000034EC 5F pop di - 27244 000034ED 5A pop dx - 27245 000034EE 59 pop cx - 27246 000034EF 5B pop bx - 27247 000034F0 58 pop ax - 27248 000034F1 C3 retn - 27249 - 27250 ; =============== S U B R O U T I N E ======================================= - 27251 - 27252 ; NEWARG adds the supplied argstring and cparse data to arg.argv[]. - 27253 ; - 27254 ; ENTRY: - 27255 ; BH argflags - 27256 ; CX character count in argstring - 27257 ; DI pointer to argstring - 27258 ; comptr ptr to starting loc of current token in original command - 27259 ; [STARTEL] cparse's answer to where the last element starts - 27260 ; EXIT: - 27261 ; argbufptr points to next free section of argbuffer - 27262 ; arg.argbuf contains null-terminated argument strings - 27263 ; arg.argvcnt argument count - 27264 ; arg.argv[] array of flags and pointers - 27265 ; arg.arg_ocomptr ptr to starting loc of current token in original command - 27266 ; CF set if error - 27267 ; AL carry set: error code; otherwise, zero - 27268 - 27269 ; 01/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27270 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 27271 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 27272 newarg: - 27273 000034F2 53 push bx - 27274 000034F3 51 push cx - 27275 000034F4 52 push dx - 27276 000034F5 57 push di - 27277 000034F6 56 push si - 27278 000034F7 9C pushf - 27279 000034F8 E86200 call arg_switch ; if it's a switch, record switch info - 27280 ; LEAVE SWITCH ON COMMAND LINE!! - 27281 ;;;jc short newarg_done ; previous arg's switches -- and leave - 27282 - 27283 ;cmp word [ARG_ARGVCNT],64 ; check to ensure we've not - 27284 000034FB 833E[10A2]40 cmp word [ARG+ARG_UNIT.argvcnt],ARGMAX ; 64 - 27285 00003500 7D50 jge short to_many_args ; exceeded array limits - 27286 00003502 88FE mov dh,bh - 27287 ;mov bx,[ARG_ARGVCNT] ; save argflags - 27288 00003504 8B1E[10A2] mov bx,[ARG+ARG_UNIT.argvcnt] ; argv[argvcnt++] = arg data - 27289 ;inc word [ARG_ARGVCNT] - 27290 00003508 FF06[10A2] inc word [ARG+ARG_UNIT.argvcnt] - 27291 ;mov ax,ARG_ARGV - 27292 0000350C B8[509F] mov ax,ARG+ARG_UNIT.argv - 27293 0000350F E87E00 call argv_calc ; convert offset to pointer - 27294 ;mov [BX].argsw_word,0 ; no switch information, yet... - 27295 ;mov word [bx+7],0 - 27296 00003512 C747070000 mov word [bx+ARGV_ELE.argsw_word],0 - 27297 ;mov [BX].arglen,CX ; argv[argvcnt].arglen = arg length - 27298 ;mov [bx+5],cx - 27299 00003517 894F05 mov [bx+ARGV_ELE.arglen],cx - 27300 ;mov [BX].argflags,DH ; argv[argvcnt].argflags = cparse flags - 27301 ;mov [bx+2],dh - 27302 0000351A 887702 mov [bx+ARGV_ELE.argflags],dh - 27303 0000351D 8B36[94A3] mov si,[ARGBUF_PTR] - 27304 ;mov [BX].argpointer,SI ; argv[argvcnt].argpointer = [argbufptr] - 27305 ;mov [bx+ARGV_ELE.argpointer],si - 27306 00003521 8937 mov [bx],si - 27307 00003523 0336[F69E] add si,[STARTEL] ; save startel from new location - 27308 00003527 29FE sub si,di ; form pointer into argbuf - 27309 ;mov [BX].argstartel,SI ; argv[argvcnt].argstartel = new [STARTEL] - 27310 ;mov [bx+3],si - 27311 00003529 897703 mov [bx+ARGV_ELE.argstartel],si - 27312 0000352C 8B36[18A4] mov si,[COMPTR] - 27313 ;mov [BX].arg_ocomptr,si ; arg_ocomptr = ptr into original com line - 27314 ;mov [bx+9],si - 27315 00003530 897709 mov [bx+ARGV_ELE.arg_ocomptr],si - 27316 00003533 89FE mov si,di ; now save argstring in argbuffer - 27317 00003535 8B3E[94A3] mov di,[ARGBUF_PTR] ; load the argbuf pointer and make - 27318 - 27319 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 27320 ; PCDOS 7.1 COMMAND.COM - 27321 %if 0 - 27322 add di,cx ; sure we're not about to run off - 27323 ;cmp DI,OFFSET TRANGROUP:arg.argbuf+ARGBLEN-1 - 27324 ;;cmp di,ARG_ARGBUF+255 - 27325 ;cmp di,ARG+ARG_UNIT.argbuf+127 - 27326 cmp di,ARG+ARG_UNIT.argbuf+ARGBLEN-1 - 27327 jge short buf_oflow ; the end of the buffer (plus null byte) - 27328 sub di,cx - 27329 %else - 27330 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 27331 ;mov bx,ARG_ARGBUF+127 - 27332 00003539 BB[93A2] mov bx,ARG+ARG_UNIT.argbuf+ARGBLEN-1 - 27333 0000353C 29FB sub bx,di ; sure we're not about to run off - 27334 0000353E 39CB cmp bx,cx - 27335 00003540 7302 jnb short newarg_@ - 27336 00003542 89D9 mov cx,bx - 27337 %endif - 27338 - 27339 newarg_@: ; 27/07/2024 - 27340 00003544 FC cld - 27341 00003545 F3A4 rep movsb - 27342 00003547 B000 mov al,ANULL ; 0 ; tack a null byte on the end - 27343 00003549 AA stosb - 27344 0000354A 893E[94A3] mov [ARGBUF_PTR],di ; update argbufptr after copy - 27345 newarg_done: - 27346 0000354E 9D popf - 27347 0000354F F8 clc - 27348 00003550 EB05 jmp short newarg_exit - 27349 - 27350 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 27351 ; PCDOS 7.1 COMMAND.COM - 27352 %if 0 - 27353 to_many_args: - 27354 mov ax,1 - 27355 jmp short newarg_error - 27356 buf_oflow: - 27357 mov ax,2 - 27358 %else - 27359 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM - 27360 ;buf_oflow: - 27361 ; ; 27/07/2024 - 27362 ; ; PCDOS 7.1 COMMAND.COM - 27363 ; sub di,cx - 27364 ; ;mov cx,ARG_ARGBUF+7Fh - 27365 ; mov cx,ARG+ARG_UNIT.argbuf+ARGBLEN-1 - 27366 ; sub cx,di - 27367 ; jmp short newarg_@ - 27368 to_many_args: - 27369 00003552 B80100 mov ax,1 - 27370 %endif - 27371 - 27372 newarg_error: - 27373 00003555 9D popf - 27374 00003556 F9 stc - 27375 newarg_exit: - 27376 00003557 5E pop si - 27377 00003558 5F pop di - 27378 00003559 5A pop dx - 27379 0000355A 59 pop cx - 27380 0000355B 5B pop bx - 27381 0000355C C3 retn - 27382 - 27383 ; =============== S U B R O U T I N E ======================================= - 27384 - 27385 ; ARG_SWITCH decides if an argument might really be a switch. In the - 27386 ; event that it is, and we can recognize - 27387 ; - 27388 ; ENTRY: - 27389 ; As in . - 27390 ; EXIT: - 27391 ; CF -- clear (wasn't a switch); set (was a switch) - 27392 ; NOTE(S): - 27393 ; * The mechanism mapping a switch into a bit-value depends entirely - 27394 ; on the order of definition in the variable and the - 27395 ; values chosen to define the bits in CMDT:COMEQU.ASM. Change either - 27396 ; or the definitions in CMDT:COMEQU.ASM -- and rewrite - 27397 ; this mechanism. This code taken from CMDT:TCODE.ASM. - 27398 ; * The declared below is redundant to one declared in - 27399 ; TDATA.ASM, and used in TCODE.ASM. - 27400 ; * An ugly routine. - 27401 - 27402 ; 01/03/2023 - Retro DOS v4.0 COMMAND.COM - 27403 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 27404 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM - 27405 arg_switch: - 27406 0000355D 50 push ax - 27407 0000355E 53 push bx - 27408 0000355F 51 push cx - 27409 00003560 57 push di - 27410 00003561 9C pushf - 27411 00003562 F6C701 test bh,1 ; sw_flag ; is it a switch? (preserve flag word) - 27412 00003565 741C jz short arg_no_switch0 - 27413 00003567 833E[16A4]FF cmp word [LASTARG],-1 ; have we encountered any REAL args yet? - 27414 0000356C 741B je short arg_no_switch1 ; no, so leading switches don't matter - 27415 0000356E 8B1E[16A4] mov bx,[LASTARG] ; yes, add switch info to last REAL arg - 27416 ;mov ax,offset TRANGROUP:arg.argv - 27417 ;mov ax,ARG_ARGV - 27418 00003572 B8[509F] mov ax,ARG+ARG_UNIT.argv ; ARG+0 - 27419 00003575 E81800 call argv_calc - 27420 ;or [BX].argsw_word,BP - 27421 ;or [bx+7],bp - 27422 00003578 096F07 or [bx+ARGV_ELE.argsw_word],bp - 27423 ;or arg.argswinfo,BP - 27424 ;or [ARG_ARGSWINFO],bp - 27425 0000357B 092E[12A2] or [ARG+ARG_UNIT.argswinfo],bp - 27426 arg_yes_switch: - 27427 0000357F 9D popf - 27428 00003580 F9 stc - 27429 00003581 EB08 jmp short arg_switch_exit - 27430 - 27431 arg_no_switch0: - 27432 ;mov ax,[ARG_ARGVCNT] - 27433 00003583 A1[10A2] mov ax,[ARG+ARG_UNIT.argvcnt] - 27434 00003586 A3[16A4] mov [LASTARG],ax - 27435 arg_no_switch1: - 27436 00003589 9D popf - 27437 0000358A F8 clc - 27438 arg_switch_exit: - 27439 0000358B 5F pop di - 27440 0000358C 59 pop cx - 27441 0000358D 5B pop bx - 27442 0000358E 58 pop ax - 27443 0000358F C3 retn - 27444 - 27445 ; =============== S U B R O U T I N E ======================================= - 27446 - 27447 ; ARGV_CALC maps an array index into a byte-offset from the base of - 27448 ; the supplied array. Method used for computing the address is: - 27449 ; Array Index * Array Elt Size + Base Addr = Elt Addr - 27450 ; ENTRY: - 27451 ; AX -- base of array - 27452 ; BX -- array index - 27453 ; EXIT: - 27454 ; BX -- byte offset - 27455 - 27456 ; 01/03/2023 - Retro DOS v4.0 COMMAND.COM - 27457 argv_calc: - 27458 00003590 50 push ax ; Save base - 27459 00003591 88D8 mov al,bl ; al = array index - 27460 ;mov bl,11 - 27461 00003593 B30B mov bl,ARGV_ELE.SIZE ; bl = size of an argv element - 27462 00003595 F6E3 mul bl ; ax = base offset - 27463 00003597 5B pop bx ; Get base - 27464 00003598 01D8 add ax,bx ; Add in base offset - 27465 0000359A 93 xchg ax,bx ; Restore ax and put byte offset in bx - 27466 0000359B C3 retn - 27467 - 27468 ; --------------------------------------------------------------------------- - 27469 - 27470 ;db 0Ah dup(0) - 27471 ;times 10 db 0 - 27472 - 27473 0000359C 90 align 16 - 27474 - 27475 ;============================================================================ - 27476 ; PATH1.ASM, MSDOS 6.0, 1991 - 27477 ;============================================================================ - 27478 ; 03/10/2018 - Retro DOS v3.0 - 27479 - 27480 ;---------------------------------------------------------------------------- - 27481 ; PATH.ASM contains the routines to perform pathname incovation. Path and - 27482 ; Parse share a temporary buffer and argv[] definitions. , - 27483 ; given a pathname, attempts to find a corresponding executable or batch - 27484 ; file on disk. Directories specified in the user's search path will be - 27485 ; searched for a matching file, if a match is not found in the current - 27486 ; directory and if the pathname is actually only an MSDOS filename. - 27487 ; assumes that the parsed command name can be found in - 27488 ; argv[0] -- in other words, should be executed prior to - 27489 ; . Alternatively, the command name and appropriate - 27490 ; information could be placed in argv[0], or could be - 27491 ; (easily) modified to make no assumptions about where its input is found. - 27492 ; Please find enclosed yet another important routine, , which - 27493 ; places the entire arg/argv[]/argbuf structure on a piece of newly - 27494 ; allocated memory. This is handy for for-loop processing, and anything - 27495 ; else that wants to save the whole shebang and then process other command - 27496 ; lines. - 27497 ; - 27498 ; Alan L, OS/MSDOS August 15, 1983 - 27499 ; - 27500 ; ENTRY: - 27501 ; : argv[0]. - 27502 ; : bytes to allocate in addition to arg structure - 27503 ; EXIT: - 27504 ; : success flag, best pathname match in EXECPATH. - 27505 ; : success flag, segment address of new memory - 27506 ; NOTE(S): - 27507 ; * handily turns an array index into an absolute pointer. - 27508 ; The computation depends on the size of an argv[] element (arg_ele). - 27509 ; * calls for chunks of the command line. - 27510 ; does not function as specified; see for more details. - 27511 ; * now knows about the flags the internals of COMMAND.COM - 27512 ; need to know about. This extra information is stored in a switch_flag - 27513 ; word with each command-line argument; the switches themselves will not - 27514 ; appear in the resulting arg structure. - 27515 ; * With the exception of CARRY, flags are generally preserved across calls. - 27516 ;---------------------------------------------------------------------------- - 27517 - 27518 ; =============== S U B R O U T I N E ======================================= - 27519 - 27520 ; PATH_SEARCH tries to find the file it's given, somewhere. An initial value - 27521 ; of *argv[0].argstartel == 0 implies that there is no command (empty line - 27522 ; or 'd:' or 'd:/'). This check is done in strip; otherwise, strip formats - 27523 ; the filename/pathname into tpbuf. Search(tpbuf) is executed to see if we - 27524 ; have a match, either in the current working directory if we were handed - 27525 ; a filename, or in the specified directory, given a pathname. If this call - 27526 ; fails, and we were given a pathname, then Path_Search fails. Otherwise, - 27527 ; Path_Crunch is repeatedly invoked on tpbuf[STARTEL] (if there's a drive - 27528 ; prefix, we want to skip it) for each pathstring in userpath. Success on - 27529 ; either the first invocation of search or on one of the succeeding calls - 27530 ; sets up the appropriate information for copying the successful pathname - 27531 ; prefix (if any) into the result buffer, followed by the successful filename - 27532 ; match (from [search_best_buf]). The result is returned in in EXECPATH. - 27533 ; - 27534 ; ENTRY: - 27535 ; argv[0] -- command name and associated information - 27536 ; EXIT: - 27537 ; AX -- non-zero indicates type of file found - 27538 ; EXECPATH -- successful pathname (AX non-zero) - 27539 ; NOTE(S): - 27540 ; 1) Uses the temporary buffer, tpbuf, from the parse routines. - 27541 ; 2) Some files are more equal than others. See search: for rankings. - 27542 ; 3) Path_Search terminates as soon as a call to search succeeds, even - 27543 ; if search returns an .exe or .bat. - 27544 ; 5) Clobbers dma address. - 27545 - 27546 ;PBUFLEN EQU 128 ; length of EXECPATH - 27547 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 27548 PBUFLEN EQU 256 - 27549 PATH_SEP_CHAR EQU ';' - 27550 - 27551 ;parseflags RECORD special_delim:1, unused:4, path_sep:1, wildcard:1, sw_flag:1 - 27552 - 27553 ;special_delim equ 128 - 27554 ;path_sep equ 4 - 27555 ;wildcard equ 2 - 27556 ;sw_flag equ 1 - 27557 - 27558 ;---------------------------------------------------------------------------- - 27559 - 27560 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2510h - 27561 - 27562 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27563 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 32D1h + 27151 ; 27/07/2024 - Retro DOS v4.0-v4.1-v4.2-v5.0 COMMAND.COM (PARSELINE) + 27152 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 35F5h + 27153 + 27154 PARSELINE: + 27155 00003477 50 push ax ; most of these are clobbered + 27156 00003478 53 push bx ; by cparse... + 27157 00003479 51 push cx + 27158 0000347A 52 push dx + 27159 0000347B 57 push di + 27160 0000347C 56 push si + 27161 0000347D 9C pushf + 27162 ;mov byte [cpyflag],0 ; Turn "CPARSE called from COPY flag" off + 27163 0000347E C706[16A4]FFFF mov word [LASTARG],-1 ; last argument at which to accumulate + 27164 00003484 31C0 xor ax,ax + 27165 ;;mov cx,1348 + 27166 ; 27/07/2024 + 27167 ;mov cx,1092 ; PCDOS 7.1 COMMAND.COM + 27168 00003486 B94404 mov cx,ARG_UNIT.SIZE ; 1092 + 27169 00003489 A2[A49D] mov [cpyflag],al ; 0 ; 27/07/2024 + 27170 0000348C BF[509F] mov di,ARG + 27171 0000348F F3AA rep stosb + 27172 ;mov word [ARGBUF_PTR],ARG_ARGBUF + 27173 00003491 C706[94A3][14A2] mov word [ARGBUF_PTR],ARG+ARG_UNIT.argbuf + 27174 ;mov word [ARG_ARGSWINFO],0 ; switch information, and info to date + 27175 ;mov word [ARG+ARG_UNIT.argswinfo],0 + 27176 00003497 A3[12A2] mov [ARG+ARG_UNIT.argswinfo],ax ; 0 ; 27/07/2024 + 27177 ;mov word [ARG_ARGVCNT],0 ; initialize argvcnt/argv[] + 27178 ;mov word [ARG+ARG_UNIT.argvcnt],0 + 27179 0000349A A3[10A2] mov [ARG+ARG_UNIT.argvcnt],ax ; 0 ; 27/07/2024 + 27180 0000349D BE[569A] mov si,COMBUF+2 ; prescan leaves cooked input in combuf + 27181 + 27182 ; This next section of code (up to pcont:) makes sure that si is set up for + 27183 ; parsing. It should point at COMBUF if FORFLAG is set and arg.argforcombuf + 27184 ; otherwise. This is done so that commands can get arg pointers into their + 27185 ; original command line (or an exact copy of it) in arg_ocomptr. + 27186 ; Arg.argforcombuf is used so that the for loop processor will always be able + 27187 ; to get a hold of its original command line; even after COMBUF is blasted by + 27188 ; the command to be repeated or the transient part of command has been + 27189 ; reloaded. + 27190 + 27191 000034A0 1E push ds + 27192 000034A1 8E1E[F59B] mov ds,[RESSEG] + 27193 ;cmp byte [ForFlag],0 + 27194 000034A5 3806[AB02] cmp [ForFlag],al ; 0 ; 27/07/2024 + 27195 000034A9 1F pop ds + 27196 000034AA 7510 jnz short PCONT + 27197 ;mov di,ARG_ARGFORCOMBUF + 27198 000034AC BF[14A3] mov di,ARG+ARG_UNIT.argforcombuf + 27199 000034AF 30ED xor ch,ch + 27200 000034B1 8A0E[559A] mov cl,[COMBUF+1] + 27201 000034B5 FEC1 inc cl + 27202 000034B7 F3A4 rep movsb + 27203 ;mov si,ARG_ARGFORCOMBUF + 27204 000034B9 BE[14A3] mov si,ARG+ARG_UNIT.argforcombuf + 27205 PCONT: + 27206 000034BC BF[96A3] mov di,TPBUF ; destination is temporary token buffer + 27207 000034BF B320 mov bl,' ' ; no special delimiter, for now + 27208 PARSELOOP: + 27209 000034C1 8936[18A4] mov [COMPTR],si ; save ptr into original command buffer + 27210 000034C5 31ED xor bp,bp ; switch information put here by cparse + 27211 000034C7 C606[329F]00 mov byte [expand_star],0 ; don't expand *'s to ?'s + 27212 000034CC E8B7F4 call scanoff ; skip leading blanks... + 27213 000034CF E8D512 call cparse ; byte off a token (args in SI, DI, BL) + 27214 000034D2 730B jnb short MORE_PRSE + 27215 000034D4 09ED or bp,bp ; Check for trailing switch character + 27216 000034D6 7403 jz short PARSEDONE + 27217 000034D8 E81700 call newarg ; We hit CR but BP is non-zero. The + 27218 ; typical cause of this is that a + 27219 ; switch char IMMEDIATELY preceeds + 27220 ; the CR. We have an argument, but it + 27221 ; is sort of an error. + 27222 ;jmp short PARSEDONE ; We're done (found the CR). + 27223 ; 01/03/2023 + 27224 PARSEDONE: + 27225 000034DB 9D popf + 27226 000034DC F8 clc + 27227 000034DD EB0C jmp short PARSE_EXIT + 27228 + 27229 MORE_PRSE: + 27230 000034DF C606[A49D]02 mov byte [cpyflag],2 + 27231 ; tell CPARSE that 1st token is done + 27232 000034E4 E80B00 call newarg ; add to argv array (CX has char count) + 27233 000034E7 73D8 jnb short PARSELOOP ; was everything OK? + 27234 ;jmp short PARSE_ERROR ; NO, it wasn't -- bug out (CF set) + 27235 ; 01/03/2023 + 27236 ;PARSEDONE: + 27237 ;popf + 27238 ;clc + 27239 ;jmp short PARSE_EXIT + 27240 + 27241 PARSE_ERROR: ; error entry (er, exit) point + 27242 000034E9 9D popf + 27243 000034EA F9 stc + 27244 PARSE_EXIT: ; depend on not changing CF + 27245 000034EB 5E pop si + 27246 000034EC 5F pop di + 27247 000034ED 5A pop dx + 27248 000034EE 59 pop cx + 27249 000034EF 5B pop bx + 27250 000034F0 58 pop ax + 27251 000034F1 C3 retn + 27252 + 27253 ; =============== S U B R O U T I N E ======================================= + 27254 + 27255 ; NEWARG adds the supplied argstring and cparse data to arg.argv[]. + 27256 ; + 27257 ; ENTRY: + 27258 ; BH argflags + 27259 ; CX character count in argstring + 27260 ; DI pointer to argstring + 27261 ; comptr ptr to starting loc of current token in original command + 27262 ; [STARTEL] cparse's answer to where the last element starts + 27263 ; EXIT: + 27264 ; argbufptr points to next free section of argbuffer + 27265 ; arg.argbuf contains null-terminated argument strings + 27266 ; arg.argvcnt argument count + 27267 ; arg.argv[] array of flags and pointers + 27268 ; arg.arg_ocomptr ptr to starting loc of current token in original command + 27269 ; CF set if error + 27270 ; AL carry set: error code; otherwise, zero + 27271 + 27272 ; 01/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27273 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 27274 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 27275 newarg: + 27276 000034F2 53 push bx + 27277 000034F3 51 push cx + 27278 000034F4 52 push dx + 27279 000034F5 57 push di + 27280 000034F6 56 push si + 27281 000034F7 9C pushf + 27282 000034F8 E86200 call arg_switch ; if it's a switch, record switch info + 27283 ; LEAVE SWITCH ON COMMAND LINE!! + 27284 ;;;jc short newarg_done ; previous arg's switches -- and leave + 27285 + 27286 ;cmp word [ARG_ARGVCNT],64 ; check to ensure we've not + 27287 000034FB 833E[10A2]40 cmp word [ARG+ARG_UNIT.argvcnt],ARGMAX ; 64 + 27288 00003500 7D50 jge short to_many_args ; exceeded array limits + 27289 00003502 88FE mov dh,bh + 27290 ;mov bx,[ARG_ARGVCNT] ; save argflags + 27291 00003504 8B1E[10A2] mov bx,[ARG+ARG_UNIT.argvcnt] ; argv[argvcnt++] = arg data + 27292 ;inc word [ARG_ARGVCNT] + 27293 00003508 FF06[10A2] inc word [ARG+ARG_UNIT.argvcnt] + 27294 ;mov ax,ARG_ARGV + 27295 0000350C B8[509F] mov ax,ARG+ARG_UNIT.argv + 27296 0000350F E87E00 call argv_calc ; convert offset to pointer + 27297 ;mov [BX].argsw_word,0 ; no switch information, yet... + 27298 ;mov word [bx+7],0 + 27299 00003512 C747070000 mov word [bx+ARGV_ELE.argsw_word],0 + 27300 ;mov [BX].arglen,CX ; argv[argvcnt].arglen = arg length + 27301 ;mov [bx+5],cx + 27302 00003517 894F05 mov [bx+ARGV_ELE.arglen],cx + 27303 ;mov [BX].argflags,DH ; argv[argvcnt].argflags = cparse flags + 27304 ;mov [bx+2],dh + 27305 0000351A 887702 mov [bx+ARGV_ELE.argflags],dh + 27306 0000351D 8B36[94A3] mov si,[ARGBUF_PTR] + 27307 ;mov [BX].argpointer,SI ; argv[argvcnt].argpointer = [argbufptr] + 27308 ;mov [bx+ARGV_ELE.argpointer],si + 27309 00003521 8937 mov [bx],si + 27310 00003523 0336[F69E] add si,[STARTEL] ; save startel from new location + 27311 00003527 29FE sub si,di ; form pointer into argbuf + 27312 ;mov [BX].argstartel,SI ; argv[argvcnt].argstartel = new [STARTEL] + 27313 ;mov [bx+3],si + 27314 00003529 897703 mov [bx+ARGV_ELE.argstartel],si + 27315 0000352C 8B36[18A4] mov si,[COMPTR] + 27316 ;mov [BX].arg_ocomptr,si ; arg_ocomptr = ptr into original com line + 27317 ;mov [bx+9],si + 27318 00003530 897709 mov [bx+ARGV_ELE.arg_ocomptr],si + 27319 00003533 89FE mov si,di ; now save argstring in argbuffer + 27320 00003535 8B3E[94A3] mov di,[ARGBUF_PTR] ; load the argbuf pointer and make + 27321 + 27322 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 27323 ; PCDOS 7.1 COMMAND.COM + 27324 %if 0 + 27325 add di,cx ; sure we're not about to run off + 27326 ;cmp DI,OFFSET TRANGROUP:arg.argbuf+ARGBLEN-1 + 27327 ;;cmp di,ARG_ARGBUF+255 + 27328 ;cmp di,ARG+ARG_UNIT.argbuf+127 + 27329 cmp di,ARG+ARG_UNIT.argbuf+ARGBLEN-1 + 27330 jge short buf_oflow ; the end of the buffer (plus null byte) + 27331 sub di,cx + 27332 %else + 27333 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 27334 ;mov bx,ARG_ARGBUF+127 + 27335 00003539 BB[93A2] mov bx,ARG+ARG_UNIT.argbuf+ARGBLEN-1 + 27336 0000353C 29FB sub bx,di ; sure we're not about to run off + 27337 0000353E 39CB cmp bx,cx + 27338 00003540 7302 jnb short newarg_@ + 27339 00003542 89D9 mov cx,bx + 27340 %endif + 27341 + 27342 newarg_@: ; 27/07/2024 + 27343 00003544 FC cld + 27344 00003545 F3A4 rep movsb + 27345 00003547 B000 mov al,ANULL ; 0 ; tack a null byte on the end + 27346 00003549 AA stosb + 27347 0000354A 893E[94A3] mov [ARGBUF_PTR],di ; update argbufptr after copy + 27348 newarg_done: + 27349 0000354E 9D popf + 27350 0000354F F8 clc + 27351 00003550 EB05 jmp short newarg_exit + 27352 + 27353 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 27354 ; PCDOS 7.1 COMMAND.COM + 27355 %if 0 + 27356 to_many_args: + 27357 mov ax,1 + 27358 jmp short newarg_error + 27359 buf_oflow: + 27360 mov ax,2 + 27361 %else + 27362 ; 27/07/2024 - Retro DOS v5.0 COMMAND.COM + 27363 ;buf_oflow: + 27364 ; ; 27/07/2024 + 27365 ; ; PCDOS 7.1 COMMAND.COM + 27366 ; sub di,cx + 27367 ; ;mov cx,ARG_ARGBUF+7Fh + 27368 ; mov cx,ARG+ARG_UNIT.argbuf+ARGBLEN-1 + 27369 ; sub cx,di + 27370 ; jmp short newarg_@ + 27371 to_many_args: + 27372 00003552 B80100 mov ax,1 + 27373 %endif + 27374 + 27375 newarg_error: + 27376 00003555 9D popf + 27377 00003556 F9 stc + 27378 newarg_exit: + 27379 00003557 5E pop si + 27380 00003558 5F pop di + 27381 00003559 5A pop dx + 27382 0000355A 59 pop cx + 27383 0000355B 5B pop bx + 27384 0000355C C3 retn + 27385 + 27386 ; =============== S U B R O U T I N E ======================================= + 27387 + 27388 ; ARG_SWITCH decides if an argument might really be a switch. In the + 27389 ; event that it is, and we can recognize + 27390 ; + 27391 ; ENTRY: + 27392 ; As in . + 27393 ; EXIT: + 27394 ; CF -- clear (wasn't a switch); set (was a switch) + 27395 ; NOTE(S): + 27396 ; * The mechanism mapping a switch into a bit-value depends entirely + 27397 ; on the order of definition in the variable and the + 27398 ; values chosen to define the bits in CMDT:COMEQU.ASM. Change either + 27399 ; or the definitions in CMDT:COMEQU.ASM -- and rewrite + 27400 ; this mechanism. This code taken from CMDT:TCODE.ASM. + 27401 ; * The declared below is redundant to one declared in + 27402 ; TDATA.ASM, and used in TCODE.ASM. + 27403 ; * An ugly routine. + 27404 + 27405 ; 01/03/2023 - Retro DOS v4.0 COMMAND.COM + 27406 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 27407 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM + 27408 arg_switch: + 27409 0000355D 50 push ax + 27410 0000355E 53 push bx + 27411 0000355F 51 push cx + 27412 00003560 57 push di + 27413 00003561 9C pushf + 27414 00003562 F6C701 test bh,1 ; sw_flag ; is it a switch? (preserve flag word) + 27415 00003565 741C jz short arg_no_switch0 + 27416 00003567 833E[16A4]FF cmp word [LASTARG],-1 ; have we encountered any REAL args yet? + 27417 0000356C 741B je short arg_no_switch1 ; no, so leading switches don't matter + 27418 0000356E 8B1E[16A4] mov bx,[LASTARG] ; yes, add switch info to last REAL arg + 27419 ;mov ax,offset TRANGROUP:arg.argv + 27420 ;mov ax,ARG_ARGV + 27421 00003572 B8[509F] mov ax,ARG+ARG_UNIT.argv ; ARG+0 + 27422 00003575 E81800 call argv_calc + 27423 ;or [BX].argsw_word,BP + 27424 ;or [bx+7],bp + 27425 00003578 096F07 or [bx+ARGV_ELE.argsw_word],bp + 27426 ;or arg.argswinfo,BP + 27427 ;or [ARG_ARGSWINFO],bp + 27428 0000357B 092E[12A2] or [ARG+ARG_UNIT.argswinfo],bp + 27429 arg_yes_switch: + 27430 0000357F 9D popf + 27431 00003580 F9 stc + 27432 00003581 EB08 jmp short arg_switch_exit + 27433 + 27434 arg_no_switch0: + 27435 ;mov ax,[ARG_ARGVCNT] + 27436 00003583 A1[10A2] mov ax,[ARG+ARG_UNIT.argvcnt] + 27437 00003586 A3[16A4] mov [LASTARG],ax + 27438 arg_no_switch1: + 27439 00003589 9D popf + 27440 0000358A F8 clc + 27441 arg_switch_exit: + 27442 0000358B 5F pop di + 27443 0000358C 59 pop cx + 27444 0000358D 5B pop bx + 27445 0000358E 58 pop ax + 27446 0000358F C3 retn + 27447 + 27448 ; =============== S U B R O U T I N E ======================================= + 27449 + 27450 ; ARGV_CALC maps an array index into a byte-offset from the base of + 27451 ; the supplied array. Method used for computing the address is: + 27452 ; Array Index * Array Elt Size + Base Addr = Elt Addr + 27453 ; ENTRY: + 27454 ; AX -- base of array + 27455 ; BX -- array index + 27456 ; EXIT: + 27457 ; BX -- byte offset + 27458 + 27459 ; 01/03/2023 - Retro DOS v4.0 COMMAND.COM + 27460 argv_calc: + 27461 00003590 50 push ax ; Save base + 27462 00003591 88D8 mov al,bl ; al = array index + 27463 ;mov bl,11 + 27464 00003593 B30B mov bl,ARGV_ELE.SIZE ; bl = size of an argv element + 27465 00003595 F6E3 mul bl ; ax = base offset + 27466 00003597 5B pop bx ; Get base + 27467 00003598 01D8 add ax,bx ; Add in base offset + 27468 0000359A 93 xchg ax,bx ; Restore ax and put byte offset in bx + 27469 0000359B C3 retn + 27470 + 27471 ; --------------------------------------------------------------------------- + 27472 + 27473 ;db 0Ah dup(0) + 27474 ;times 10 db 0 + 27475 + 27476 0000359C 90 align 16 + 27477 + 27478 ;============================================================================ + 27479 ; PATH1.ASM, MSDOS 6.0, 1991 + 27480 ;============================================================================ + 27481 ; 03/10/2018 - Retro DOS v3.0 + 27482 + 27483 ;---------------------------------------------------------------------------- + 27484 ; PATH.ASM contains the routines to perform pathname incovation. Path and + 27485 ; Parse share a temporary buffer and argv[] definitions. , + 27486 ; given a pathname, attempts to find a corresponding executable or batch + 27487 ; file on disk. Directories specified in the user's search path will be + 27488 ; searched for a matching file, if a match is not found in the current + 27489 ; directory and if the pathname is actually only an MSDOS filename. + 27490 ; assumes that the parsed command name can be found in + 27491 ; argv[0] -- in other words, should be executed prior to + 27492 ; . Alternatively, the command name and appropriate + 27493 ; information could be placed in argv[0], or could be + 27494 ; (easily) modified to make no assumptions about where its input is found. + 27495 ; Please find enclosed yet another important routine, , which + 27496 ; places the entire arg/argv[]/argbuf structure on a piece of newly + 27497 ; allocated memory. This is handy for for-loop processing, and anything + 27498 ; else that wants to save the whole shebang and then process other command + 27499 ; lines. + 27500 ; + 27501 ; Alan L, OS/MSDOS August 15, 1983 + 27502 ; + 27503 ; ENTRY: + 27504 ; : argv[0]. + 27505 ; : bytes to allocate in addition to arg structure + 27506 ; EXIT: + 27507 ; : success flag, best pathname match in EXECPATH. + 27508 ; : success flag, segment address of new memory + 27509 ; NOTE(S): + 27510 ; * handily turns an array index into an absolute pointer. + 27511 ; The computation depends on the size of an argv[] element (arg_ele). + 27512 ; * calls for chunks of the command line. + 27513 ; does not function as specified; see for more details. + 27514 ; * now knows about the flags the internals of COMMAND.COM + 27515 ; need to know about. This extra information is stored in a switch_flag + 27516 ; word with each command-line argument; the switches themselves will not + 27517 ; appear in the resulting arg structure. + 27518 ; * With the exception of CARRY, flags are generally preserved across calls. + 27519 ;---------------------------------------------------------------------------- + 27520 + 27521 ; =============== S U B R O U T I N E ======================================= + 27522 + 27523 ; PATH_SEARCH tries to find the file it's given, somewhere. An initial value + 27524 ; of *argv[0].argstartel == 0 implies that there is no command (empty line + 27525 ; or 'd:' or 'd:/'). This check is done in strip; otherwise, strip formats + 27526 ; the filename/pathname into tpbuf. Search(tpbuf) is executed to see if we + 27527 ; have a match, either in the current working directory if we were handed + 27528 ; a filename, or in the specified directory, given a pathname. If this call + 27529 ; fails, and we were given a pathname, then Path_Search fails. Otherwise, + 27530 ; Path_Crunch is repeatedly invoked on tpbuf[STARTEL] (if there's a drive + 27531 ; prefix, we want to skip it) for each pathstring in userpath. Success on + 27532 ; either the first invocation of search or on one of the succeeding calls + 27533 ; sets up the appropriate information for copying the successful pathname + 27534 ; prefix (if any) into the result buffer, followed by the successful filename + 27535 ; match (from [search_best_buf]). The result is returned in in EXECPATH. + 27536 ; + 27537 ; ENTRY: + 27538 ; argv[0] -- command name and associated information + 27539 ; EXIT: + 27540 ; AX -- non-zero indicates type of file found + 27541 ; EXECPATH -- successful pathname (AX non-zero) + 27542 ; NOTE(S): + 27543 ; 1) Uses the temporary buffer, tpbuf, from the parse routines. + 27544 ; 2) Some files are more equal than others. See search: for rankings. + 27545 ; 3) Path_Search terminates as soon as a call to search succeeds, even + 27546 ; if search returns an .exe or .bat. + 27547 ; 5) Clobbers dma address. + 27548 + 27549 ;PBUFLEN EQU 128 ; length of EXECPATH + 27550 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 27551 PBUFLEN EQU 256 + 27552 PATH_SEP_CHAR EQU ';' + 27553 + 27554 ;parseflags RECORD special_delim:1, unused:4, path_sep:1, wildcard:1, sw_flag:1 + 27555 + 27556 ;special_delim equ 128 + 27557 ;path_sep equ 4 + 27558 ;wildcard equ 2 + 27559 ;sw_flag equ 1 + 27560 + 27561 ;---------------------------------------------------------------------------- + 27562 + 27563 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2510h 27564 - 27565 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 27566 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 387Bh + 27565 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27566 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 32D1h 27567 - 27568 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 27569 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 372Fh + 27568 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 27569 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 387Bh 27570 - 27571 path_search: - 27572 000035A0 53 push bx - 27573 000035A1 51 push cx - 27574 000035A2 52 push dx ; could use a "stack 'em" instruction - 27575 000035A3 56 push si - 27576 000035A4 57 push di - 27577 000035A5 55 push bp - 27578 000035A6 9C pushf - 27579 - 27580 ;test ds:arg.argv[0].argflags, (MASK wildcard) + (MASK sw_flag) - 27581 ;test byte [ARGV0_ARG_FLAGS],3 - 27582 000035A7 F606[529F]03 test byte [ARG+ARGV_ELE.argflags],3 ; wildcard+sw_flag - 27583 000035AC 7403 jz short path_search_ok - 27584 path_failure_jmp: - 27585 000035AE E9C100 jmp path_failure ; ambiguous commands not allowed - 27586 - 27587 path_search_ok: - 27588 000035B1 E85201 call STORE_PCHAR ; figure out the pathname separator - 27589 000035B4 BA[1AA4] mov dx,FBUF ; clobber old dma value with - 27590 000035B7 B8001A mov ax,Set_DMA*256 ; 1A00h ; a pointer to our dma buffer - 27591 000035BA CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 27592 ; DS:DX -> disk transfer buffer - 27593 000035BC 06 push es - 27594 000035BD E8EFF0 call find_path ; get a handle (ES:DI) on user path - 27595 000035C0 8C06[45A4] mov [pathinfo+0],es ; and squirrel it away - 27596 000035C4 893E[47A4] mov [pathinfo+2],di ; "old" pathstring pointer - 27597 000035C8 893E[49A4] mov [pathinfo+4],di ; "new" pathstring pointer - 27598 000035CC 07 pop es - 27599 - 27600 ;mov bx,PBUFLEN ; 128 ; copy/format argv[0] into temp buffer - 27601 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 27602 ;mov bx,256 - 27603 000035CD BB0001 mov bx,PBUFLEN ; 256 ; copy/format argv[0] into temp buffer - 27604 000035D0 BE[1D9B] mov si,EXECPATH - 27605 000035D3 E88002 call STRIP - 27606 000035D6 72D6 jc short path_failure_jmp ; if possible, of course - 27607 - 27608 000035D8 89F2 mov dx,si ; search (EXECPATH, error_message) - 27609 000035DA C706[9AA4][6E90] mov word [search_error],baddrv_ptr - 27610 000035E0 E89F01 call PSEARCH ; must do at least one search - 27611 000035E3 09C0 or ax,ax ; find anything? - 27612 000035E5 7469 jz short path_noinit - 27613 ; failure ... search farther - 27614 000035E7 89C5 mov bp,ax ; success... save filetype code - 27615 000035E9 BF[1D9B] mov di,EXECPATH - 27616 ;mov si,ds:arg.argv[0].argpointer - 27617 ;mov si,[ARG_ARGV] - 27618 000035EC 8B36[509F] mov si,[ARG+ARGV_ELE.argpointer] - 27619 ;mov cx,ds:arg.argv[0].argstartel - 27620 ;mov cx,[ARGV0_ARGSTARTEL] - 27621 000035F0 8B0E[539F] mov cx,[ARG+ARGV_ELE.argstartel] - 27622 000035F4 29F1 sub cx,si ; compute prefix bytes to copy - 27623 - 27624 ; We have the number of bytes in the prefix (up to the final component). - 27625 ; We need to form the complete pathname including leading drive and current - 27626 ; directory. - 27627 ; - 27628 ; Is there a drive letter present? - 27629 - 27630 000035F6 B43A mov ah,':' - 27631 000035F8 83F902 cmp cx,2 ; room for drive letter? - 27632 000035FB 7205 jb short adddrive ; no, stick it in - 27633 000035FD 386401 cmp [si+1], ah ; colon present? - 27634 00003600 7408 je short movedrive ; yes, just move it - 27635 adddrive: - 27636 00003602 A0[079C] mov al,[CURDRV] ; get current drive - 27637 00003605 0441 add al,'A' ; convert to uppercase letter - 27638 00003607 AB stosw ; store d: - 27639 00003608 EB05 jmp short checkpath - 27640 - 27641 movedrive: - 27642 0000360A AD lodsw ; move d: - 27643 0000360B AB stosw - 27644 0000360C 83E902 sub cx,2 ; 2 bytes less to move - 27645 checkpath: - 27646 0000360F 0C20 or al,20h - 27647 00003611 88C2 mov dl,al - 27648 ;sub dl,60h - 27649 00003613 80EA60 sub dl,'a'-1 ; convert to 1-based for current dir - 27650 - 27651 ; Stick in beginning path char - 27652 - 27653 00003616 A0[4BA4] mov al,[psep_char] - 27654 00003619 AA stosb + 27571 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 27572 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 372Fh + 27573 + 27574 path_search: + 27575 000035A0 53 push bx + 27576 000035A1 51 push cx + 27577 000035A2 52 push dx ; could use a "stack 'em" instruction + 27578 000035A3 56 push si + 27579 000035A4 57 push di + 27580 000035A5 55 push bp + 27581 000035A6 9C pushf + 27582 + 27583 ;test ds:arg.argv[0].argflags, (MASK wildcard) + (MASK sw_flag) + 27584 ;test byte [ARGV0_ARG_FLAGS],3 + 27585 000035A7 F606[529F]03 test byte [ARG+ARGV_ELE.argflags],3 ; wildcard+sw_flag + 27586 000035AC 7403 jz short path_search_ok + 27587 path_failure_jmp: + 27588 000035AE E9C100 jmp path_failure ; ambiguous commands not allowed + 27589 + 27590 path_search_ok: + 27591 000035B1 E85201 call STORE_PCHAR ; figure out the pathname separator + 27592 000035B4 BA[1AA4] mov dx,FBUF ; clobber old dma value with + 27593 000035B7 B8001A mov ax,Set_DMA*256 ; 1A00h ; a pointer to our dma buffer + 27594 000035BA CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 27595 ; DS:DX -> disk transfer buffer + 27596 000035BC 06 push es + 27597 000035BD E8EFF0 call find_path ; get a handle (ES:DI) on user path + 27598 000035C0 8C06[45A4] mov [pathinfo+0],es ; and squirrel it away + 27599 000035C4 893E[47A4] mov [pathinfo+2],di ; "old" pathstring pointer + 27600 000035C8 893E[49A4] mov [pathinfo+4],di ; "new" pathstring pointer + 27601 000035CC 07 pop es + 27602 + 27603 ;mov bx,PBUFLEN ; 128 ; copy/format argv[0] into temp buffer + 27604 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 27605 ;mov bx,256 + 27606 000035CD BB0001 mov bx,PBUFLEN ; 256 ; copy/format argv[0] into temp buffer + 27607 000035D0 BE[1D9B] mov si,EXECPATH + 27608 000035D3 E88002 call STRIP + 27609 000035D6 72D6 jc short path_failure_jmp ; if possible, of course + 27610 + 27611 000035D8 89F2 mov dx,si ; search (EXECPATH, error_message) + 27612 000035DA C706[9AA4][6E90] mov word [search_error],baddrv_ptr + 27613 000035E0 E89F01 call PSEARCH ; must do at least one search + 27614 000035E3 09C0 or ax,ax ; find anything? + 27615 000035E5 7469 jz short path_noinit + 27616 ; failure ... search farther + 27617 000035E7 89C5 mov bp,ax ; success... save filetype code + 27618 000035E9 BF[1D9B] mov di,EXECPATH + 27619 ;mov si,ds:arg.argv[0].argpointer + 27620 ;mov si,[ARG_ARGV] + 27621 000035EC 8B36[509F] mov si,[ARG+ARGV_ELE.argpointer] + 27622 ;mov cx,ds:arg.argv[0].argstartel + 27623 ;mov cx,[ARGV0_ARGSTARTEL] + 27624 000035F0 8B0E[539F] mov cx,[ARG+ARGV_ELE.argstartel] + 27625 000035F4 29F1 sub cx,si ; compute prefix bytes to copy + 27626 + 27627 ; We have the number of bytes in the prefix (up to the final component). + 27628 ; We need to form the complete pathname including leading drive and current + 27629 ; directory. + 27630 ; + 27631 ; Is there a drive letter present? + 27632 + 27633 000035F6 B43A mov ah,':' + 27634 000035F8 83F902 cmp cx,2 ; room for drive letter? + 27635 000035FB 7205 jb short adddrive ; no, stick it in + 27636 000035FD 386401 cmp [si+1], ah ; colon present? + 27637 00003600 7408 je short movedrive ; yes, just move it + 27638 adddrive: + 27639 00003602 A0[079C] mov al,[CURDRV] ; get current drive + 27640 00003605 0441 add al,'A' ; convert to uppercase letter + 27641 00003607 AB stosw ; store d: + 27642 00003608 EB05 jmp short checkpath + 27643 + 27644 movedrive: + 27645 0000360A AD lodsw ; move d: + 27646 0000360B AB stosw + 27647 0000360C 83E902 sub cx,2 ; 2 bytes less to move + 27648 checkpath: + 27649 0000360F 0C20 or al,20h + 27650 00003611 88C2 mov dl,al + 27651 ;sub dl,60h + 27652 00003613 80EA60 sub dl,'a'-1 ; convert to 1-based for current dir + 27653 + 27654 ; Stick in beginning path char 27655 - 27656 ; Is there a leading /? If so, then no current dir copy is necessary. - 27657 ; Otherwise, get current dir for DL. + 27656 00003616 A0[4BA4] mov al,[psep_char] + 27657 00003619 AA stosb 27658 - 27659 0000361A 83F901 cmp cx,1 ; is there room for path char? - 27660 0000361D 720A jb short addpath ; no, go add path - 27661 0000361F AC lodsb - 27662 00003620 49 dec cx - 27663 00003621 3A06[4BA4] cmp al,[psep_char] ; is there a path separator? - 27664 00003625 741C je short movepath ; yes, go move remainder of path - 27665 00003627 41 inc cx - 27666 00003628 4E dec si ; undo the lodsb - 27667 addpath: - 27668 00003629 56 push si - 27669 0000362A 89FE mov si,di ; remainder of buffer - 27670 0000362C B80047 mov ax,Current_Dir*256 ; 4700h - 27671 0000362F CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY - 27672 ; DL = drive (0=default,1=A,etc.) - 27673 ; DS:SI points to 64-byte buffer area - 27674 - 27675 ; The previous current dir will succeed a previous find_first already worked. - 27676 ; - 27677 ; Find end of string. - 27678 - 27679 00003631 89F7 mov di,si - 27680 00003633 5E pop si - 27681 00003634 A0[4BA4] mov al,[psep_char] - 27682 00003637 803D00 cmp byte [di],0 ; root (empty dir string)? - 27683 0000363A 7407 jz short movepath ; yes, no need for path char - 27684 scanend: - 27685 ;cmp byte [di],0 ; end of string? - 27686 ;jz short foundend - 27687 ;inc di - 27688 ;jmp short scanend - 27689 ; 18/03/2023 - Retro DOS v4.0 COMMAND.COM - 27690 0000363C 47 inc di - 27691 0000363D 803D00 cmp byte [di],0 - 27692 00003640 75FA jnz short scanend - 27693 - 27694 ; Stick in a trailing path char. - 27695 - 27696 foundend: - 27697 00003642 AA stosb + 27659 ; Is there a leading /? If so, then no current dir copy is necessary. + 27660 ; Otherwise, get current dir for DL. + 27661 + 27662 0000361A 83F901 cmp cx,1 ; is there room for path char? + 27663 0000361D 720A jb short addpath ; no, go add path + 27664 0000361F AC lodsb + 27665 00003620 49 dec cx + 27666 00003621 3A06[4BA4] cmp al,[psep_char] ; is there a path separator? + 27667 00003625 741C je short movepath ; yes, go move remainder of path + 27668 00003627 41 inc cx + 27669 00003628 4E dec si ; undo the lodsb + 27670 addpath: + 27671 00003629 56 push si + 27672 0000362A 89FE mov si,di ; remainder of buffer + 27673 0000362C B80047 mov ax,Current_Dir*256 ; 4700h + 27674 0000362F CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY + 27675 ; DL = drive (0=default,1=A,etc.) + 27676 ; DS:SI points to 64-byte buffer area + 27677 + 27678 ; The previous current dir will succeed a previous find_first already worked. + 27679 ; + 27680 ; Find end of string. + 27681 + 27682 00003631 89F7 mov di,si + 27683 00003633 5E pop si + 27684 00003634 A0[4BA4] mov al,[psep_char] + 27685 00003637 803D00 cmp byte [di],0 ; root (empty dir string)? + 27686 0000363A 7407 jz short movepath ; yes, no need for path char + 27687 scanend: + 27688 ;cmp byte [di],0 ; end of string? + 27689 ;jz short foundend + 27690 ;inc di + 27691 ;jmp short scanend + 27692 ; 18/03/2023 - Retro DOS v4.0 COMMAND.COM + 27693 0000363C 47 inc di + 27694 0000363D 803D00 cmp byte [di],0 + 27695 00003640 75FA jnz short scanend + 27696 + 27697 ; Stick in a trailing path char. 27698 - 27699 ; Move remaining part of path. Skip leading path char if present. - 27700 - 27701 movepath: - 27702 00003643 3804 cmp [si],al ; first char a path char? - 27703 00003645 7502 jne short copypath - 27704 ; 26/04/2023 - 27705 00003647 46 inc si ; move past leading char - 27706 00003648 49 dec cx ; drop from count - 27707 copypath: - 27708 00003649 E302 jcxz _copydone ; no chars to move! - 27709 0000364B F3A4 rep movsb - 27710 _copydone: - 27711 0000364D E9A100 jmp path_success - 27712 ; run off and form complete pathname - 27713 path_noinit: - 27714 ;test ds:arg.argv[0].argflags, MASK path_sep - 27715 ;test byte [ARGV0_ARG_FLAGS],4 - 27716 00003650 F606[529F]04 test byte [ARG+ARGV_ELE.argflags],4 ; path_sep - 27717 00003655 751B jnz short path_failure - 27718 ; complete pathname specified ==> fail - 27719 ;mov bh,';' - 27720 00003657 B73B mov bh,PATH_SEP_CHAR - 27721 ; semicolon terminates pathstring - 27722 ;mov dx,ds:arg.argv[0].argstartel - 27723 ; this is where the last element starts - 27724 ;mov dx,[ARGV0_ARGSTARTEL] - 27725 00003659 8B16[539F] mov dx,[ARG+ARGV_ELE.argstartel] - 27726 ;sub dx,ds:arg.argv[0].argpointer - 27727 ; form pointer into EXECPATH, - 27728 ;sub dx,[ARG_ARGV] - 27729 0000365D 2B16[509F] sub dx,[ARG+ARGV_ELE.argpointer] - 27730 00003661 81C2[1D9B] add dx,EXECPATH ; skipping over drive spec, if any - 27731 path_loop: - 27732 00003665 E8AD00 call path_crunch ; pcrunch (EXECPATH, pathinfo) - 27733 00003668 89C5 mov bp,ax ; save filetype code - 27734 0000366A 9F lahf ; save flags, just in case - 27735 0000366B 09ED or bp,bp ; did path_crunch find anything? - 27736 0000366D 7508 jnz short path_found - 27737 0000366F 9E sahf ; see? needed those flags, after all! - 27738 00003670 73F3 jnc short path_loop ; is there anything left to the path? - 27739 path_failure: - 27740 00003672 31C0 xor ax,ax - 27741 00003674 E98700 jmp path_exit - 27742 - 27743 path_found: ; pathinfo[] points to winner - 27744 00003677 BF[1D9B] mov di,EXECPATH - 27745 ;mov cx,pathinfo[4] - 27746 0000367A 8B0E[49A4] mov cx,[pathinfo+4] ; "new" pointer -- end of string - 27747 ;mov si,pathinfo[2] - 27748 0000367E 8B36[47A4] mov si,[pathinfo+2] ; "old" pointer -- beginning of string - 27749 - 27750 ; BAS Nov 20/84 - 27751 ; Look at the pathname and expand . and .. if they are the first element - 27752 ; in the pathname (after the drive letter) - 27753 - 27754 00003682 06 push es - 27755 ;push pathinfo[0] - 27756 00003683 FF36[45A4] push word [pathinfo+0] - 27757 00003687 07 pop es - 27758 ;SR; - 27759 ; Oops! Gets fooled if path= \;.. - 27760 ; We should also check if a drive letter is really present - 27761 ; - 27762 00003688 26807C022E cmp byte [es:si+2],'.' - 27763 ; Look for Current dir at start of path - 27764 0000368D 7534 jne short path_cpy - 27765 - 27766 ; 18/03/2023 - 27767 ; MSDOS 6.0 - 27768 0000368F 26807C013A cmp byte [es:si+1],':' - 27769 ; does path have drive letter? - 27770 00003694 752D jne short path_cpy ; no, copy the path string - 27771 - 27772 00003696 51 push cx ; Save pointer to end of string - 27773 ;mov al,[es:si] - 27774 ;mov [di],al ; Copy drive letter, :, and root char - 27775 ;mov al,[es:si+1] ; to EXECPATH - 27776 ;mov [di+1],al - 27777 ; 05/05/2023 - 27778 00003697 268B04 mov ax,[es:si] - 27779 0000369A 8905 mov [di],ax - 27780 0000369C A0[4BA4] mov al,[psep_char] - 27781 0000369F 884502 mov [di+2], al - 27782 000036A2 56 push si ; Save pointer to begining of string - 27783 000036A3 268A14 mov dl,[es:si] ; Convert device letter for cur dir - 27784 000036A6 80CA20 or dl,20h - 27785 ;sub dl,60h - 27786 000036A9 80EA60 sub dl,'a'-1 - 27787 000036AC 89FE mov si,di ; pointer to EXECPATH - 27788 000036AE 83C603 add si,3 ; Don't wipe out drive and root info - 27789 000036B1 B80047 mov ax,Current_Dir*256 ; 4700h - 27790 000036B4 CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY - 27791 ; DL = drive (0=default,1=A,etc.) - 27792 ; DS:SI points to 64-byte buffer area - 27793 000036B6 E8E6F9 call dstrlen ; Determine length of present info - 27794 000036B9 01CE add si,cx ; Don't copy over drive and root info - 27795 000036BB 4E dec si - 27796 000036BC 89F7 mov di,si ; Point to end of target string - 27797 000036BE 5E pop si ; Restore pointer to begining of string - 27798 000036BF 83C603 add si,3 ; Point past drive letter, :, . - 27799 000036C2 59 pop cx ; Restore pointer to end of string - 27800 path_cpy: - 27801 000036C3 07 pop es - 27802 000036C4 29F1 sub cx,si ; yields character count - 27803 000036C6 1E push ds ; time to switch segments - 27804 000036C7 FF36[45A4] push word [pathinfo+0] - 27805 ; string lives in this segment - 27806 000036CB 1F pop ds - 27807 000036CC FC cld - 27808 - 27809 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27810 ; MSDOS 5.0 (& MSDOS 5.0) - 27811 ;;rep movsb ; 3/3/KK ; copy the prefix path into EXECPATH - 27812 kloop: - 27813 000036CD AC lodsb ;AN000; 3/3/KK - 27814 000036CE AA stosb ;AN000; 3/3/KK - 27815 000036CF E88FF0 call testkanj ;AN000; 3/3/KK - 27816 000036D2 7410 jz short _notkanj1 ;AN000; 3/3/KK - 27817 000036D4 49 dec cx ;AN000; 3/3/KK - 27818 000036D5 E307 jcxz popdone ;AN000; Ignore boundary error 3/3/KK - 27819 000036D7 A4 movsb ;AN000; 3/3/KK - 27820 000036D8 49 dec cx ;AN000; 3/3/KK - 27821 000036D9 83F901 cmp cx,1 ;AN000; One char (the terminator) left ? 3/3/KK - 27822 000036DC 77EF ja short kloop ;AN000; no. 3/3/KK - 27823 popdone: ;AN000; 3/3/KK - 27824 000036DE 1F pop ds ;AN000; Yes ES:DI->terminator, last char is 3/3/KK - 27825 000036DF A0[4BA4] mov al,[psep_char] ;AN000; KANJI 3/3/KK - 27826 000036E2 EB0C jmp short path_store - 27827 ;AN000; 3/3/KK - 27828 _notkanj1: - 27829 ; 26/04/2023 - 27830 000036E4 E2E7 loop kloop - 27831 000036E6 1F pop ds ; return to our segment - 27832 000036E7 4F dec di ; overwrite terminator - 27833 000036E8 A0[4BA4] mov al,[psep_char] ; with a pathname separator - 27834 000036EB 3A45FF cmp al,[di-1] - 27835 000036EE 7401 je short path_success - 27836 path_store: - 27837 000036F0 AA stosb - 27838 path_success: - 27839 000036F1 BE[4DA4] mov si,search_best_buf - 27840 000036F4 31C9 xor cx,cx - 27841 path_succ_loop: - 27842 000036F6 AC lodsb ; append winning filename to path - 27843 000036F7 AA stosb ; (including terminating null) - 27844 000036F8 08C0 or al,al - 27845 000036FA 75FA jnz short path_succ_loop - 27846 000036FC 89E8 mov ax,bp ; retrieve filetype code - 27847 path_exit: - 27848 000036FE 9D popf - 27849 000036FF 5D pop bp - 27850 00003700 5F pop di - 27851 00003701 5E pop si ; chill out... - 27852 00003702 5A pop dx - 27853 00003703 59 pop cx - 27854 00003704 5B pop bx - 27855 00003705 C3 retn - 27856 - 27857 ; =============== S U B R O U T I N E ======================================= - 27858 - 27859 ; STORE_PCHAR determines the pathname-element separator and squirrels - 27860 ; it away. In other words, must we say '/bin/ls' or '\bin\ls'? - 27861 ; - 27862 ; ENTRY: - 27863 ; EXIT: - 27864 ; NOTE(S): - 27865 ; * Uses , defined in . - 27866 - 27867 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27868 STORE_PCHAR: - 27869 00003706 50 push ax - 27870 00003707 B02F mov al,'/' ; is the pathname-element separator - 27871 00003709 E808F3 call pathchrcmp ; a regular slash? - 27872 0000370C 7402 jz short STORE_SLASH - 27873 ; if yes, remember slash - 27874 0000370E B05C mov al,'\' - 27875 ; 18/03/2023 - 27876 ;mov [psep_char],al ; otherwise, remember back-slash - 27877 ;pop ax - 27878 ;retn - 27879 STORE_SLASH: - 27880 00003710 A2[4BA4] mov [psep_char],al - 27881 00003713 58 pop ax - 27882 00003714 C3 retn - 27883 - 27884 ; =============== S U B R O U T I N E ======================================= - 27885 - 27886 ; PATH_CRUNCH takes a prefix from a prefix string, and a suffix from - 27887 ; EXECPATH, and smooshes them into tpbuf. The caller may supply an - 27888 ; additional separator to use for breaking up the path-string. Null is the - 27889 ; default. Once the user-string has been formed, search is invoked to see - 27890 ; what's out there. - 27891 ; - 27892 ; ENTRY: - 27893 ; BH -- additional terminator character - 27894 ; SI -- pointer into pathstring to be dissected - 27895 ; DX -- pointer to stripped filename - 27896 ; EXIT: - 27897 ; AX -- non-zero (file type), zero (nothing found) - 27898 ; SI -- moves along pathstring from call to call - 27899 ; [search_best_buf] -- name of best file (AX non-zero) - 27900 ; [tpbuf] -- clobbered - 27901 ; NOTE(S): - 27902 ; * Implicit in this code is the ability to specify when to search - 27903 ; the current directory (if at all) through the PATH defined by - 27904 ; the user, a la UNIX (e.g., PATH=;c:\bin;c:\etc searches the - 27905 ; current directory before the bin and etc directories of drive c). - 27906 - 27907 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 27908 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3454h + 27699 foundend: + 27700 00003642 AA stosb + 27701 + 27702 ; Move remaining part of path. Skip leading path char if present. + 27703 + 27704 movepath: + 27705 00003643 3804 cmp [si],al ; first char a path char? + 27706 00003645 7502 jne short copypath + 27707 ; 26/04/2023 + 27708 00003647 46 inc si ; move past leading char + 27709 00003648 49 dec cx ; drop from count + 27710 copypath: + 27711 00003649 E302 jcxz _copydone ; no chars to move! + 27712 0000364B F3A4 rep movsb + 27713 _copydone: + 27714 0000364D E9A100 jmp path_success + 27715 ; run off and form complete pathname + 27716 path_noinit: + 27717 ;test ds:arg.argv[0].argflags, MASK path_sep + 27718 ;test byte [ARGV0_ARG_FLAGS],4 + 27719 00003650 F606[529F]04 test byte [ARG+ARGV_ELE.argflags],4 ; path_sep + 27720 00003655 751B jnz short path_failure + 27721 ; complete pathname specified ==> fail + 27722 ;mov bh,';' + 27723 00003657 B73B mov bh,PATH_SEP_CHAR + 27724 ; semicolon terminates pathstring + 27725 ;mov dx,ds:arg.argv[0].argstartel + 27726 ; this is where the last element starts + 27727 ;mov dx,[ARGV0_ARGSTARTEL] + 27728 00003659 8B16[539F] mov dx,[ARG+ARGV_ELE.argstartel] + 27729 ;sub dx,ds:arg.argv[0].argpointer + 27730 ; form pointer into EXECPATH, + 27731 ;sub dx,[ARG_ARGV] + 27732 0000365D 2B16[509F] sub dx,[ARG+ARGV_ELE.argpointer] + 27733 00003661 81C2[1D9B] add dx,EXECPATH ; skipping over drive spec, if any + 27734 path_loop: + 27735 00003665 E8AD00 call path_crunch ; pcrunch (EXECPATH, pathinfo) + 27736 00003668 89C5 mov bp,ax ; save filetype code + 27737 0000366A 9F lahf ; save flags, just in case + 27738 0000366B 09ED or bp,bp ; did path_crunch find anything? + 27739 0000366D 7508 jnz short path_found + 27740 0000366F 9E sahf ; see? needed those flags, after all! + 27741 00003670 73F3 jnc short path_loop ; is there anything left to the path? + 27742 path_failure: + 27743 00003672 31C0 xor ax,ax + 27744 00003674 E98700 jmp path_exit + 27745 + 27746 path_found: ; pathinfo[] points to winner + 27747 00003677 BF[1D9B] mov di,EXECPATH + 27748 ;mov cx,pathinfo[4] + 27749 0000367A 8B0E[49A4] mov cx,[pathinfo+4] ; "new" pointer -- end of string + 27750 ;mov si,pathinfo[2] + 27751 0000367E 8B36[47A4] mov si,[pathinfo+2] ; "old" pointer -- beginning of string + 27752 + 27753 ; BAS Nov 20/84 + 27754 ; Look at the pathname and expand . and .. if they are the first element + 27755 ; in the pathname (after the drive letter) + 27756 + 27757 00003682 06 push es + 27758 ;push pathinfo[0] + 27759 00003683 FF36[45A4] push word [pathinfo+0] + 27760 00003687 07 pop es + 27761 ;SR; + 27762 ; Oops! Gets fooled if path= \;.. + 27763 ; We should also check if a drive letter is really present + 27764 ; + 27765 00003688 26807C022E cmp byte [es:si+2],'.' + 27766 ; Look for Current dir at start of path + 27767 0000368D 7534 jne short path_cpy + 27768 + 27769 ; 18/03/2023 + 27770 ; MSDOS 6.0 + 27771 0000368F 26807C013A cmp byte [es:si+1],':' + 27772 ; does path have drive letter? + 27773 00003694 752D jne short path_cpy ; no, copy the path string + 27774 + 27775 00003696 51 push cx ; Save pointer to end of string + 27776 ;mov al,[es:si] + 27777 ;mov [di],al ; Copy drive letter, :, and root char + 27778 ;mov al,[es:si+1] ; to EXECPATH + 27779 ;mov [di+1],al + 27780 ; 05/05/2023 + 27781 00003697 268B04 mov ax,[es:si] + 27782 0000369A 8905 mov [di],ax + 27783 0000369C A0[4BA4] mov al,[psep_char] + 27784 0000369F 884502 mov [di+2], al + 27785 000036A2 56 push si ; Save pointer to begining of string + 27786 000036A3 268A14 mov dl,[es:si] ; Convert device letter for cur dir + 27787 000036A6 80CA20 or dl,20h + 27788 ;sub dl,60h + 27789 000036A9 80EA60 sub dl,'a'-1 + 27790 000036AC 89FE mov si,di ; pointer to EXECPATH + 27791 000036AE 83C603 add si,3 ; Don't wipe out drive and root info + 27792 000036B1 B80047 mov ax,Current_Dir*256 ; 4700h + 27793 000036B4 CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY + 27794 ; DL = drive (0=default,1=A,etc.) + 27795 ; DS:SI points to 64-byte buffer area + 27796 000036B6 E8E6F9 call dstrlen ; Determine length of present info + 27797 000036B9 01CE add si,cx ; Don't copy over drive and root info + 27798 000036BB 4E dec si + 27799 000036BC 89F7 mov di,si ; Point to end of target string + 27800 000036BE 5E pop si ; Restore pointer to begining of string + 27801 000036BF 83C603 add si,3 ; Point past drive letter, :, . + 27802 000036C2 59 pop cx ; Restore pointer to end of string + 27803 path_cpy: + 27804 000036C3 07 pop es + 27805 000036C4 29F1 sub cx,si ; yields character count + 27806 000036C6 1E push ds ; time to switch segments + 27807 000036C7 FF36[45A4] push word [pathinfo+0] + 27808 ; string lives in this segment + 27809 000036CB 1F pop ds + 27810 000036CC FC cld + 27811 + 27812 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27813 ; MSDOS 5.0 (& MSDOS 5.0) + 27814 ;;rep movsb ; 3/3/KK ; copy the prefix path into EXECPATH + 27815 kloop: + 27816 000036CD AC lodsb ;AN000; 3/3/KK + 27817 000036CE AA stosb ;AN000; 3/3/KK + 27818 000036CF E88FF0 call testkanj ;AN000; 3/3/KK + 27819 000036D2 7410 jz short _notkanj1 ;AN000; 3/3/KK + 27820 000036D4 49 dec cx ;AN000; 3/3/KK + 27821 000036D5 E307 jcxz popdone ;AN000; Ignore boundary error 3/3/KK + 27822 000036D7 A4 movsb ;AN000; 3/3/KK + 27823 000036D8 49 dec cx ;AN000; 3/3/KK + 27824 000036D9 83F901 cmp cx,1 ;AN000; One char (the terminator) left ? 3/3/KK + 27825 000036DC 77EF ja short kloop ;AN000; no. 3/3/KK + 27826 popdone: ;AN000; 3/3/KK + 27827 000036DE 1F pop ds ;AN000; Yes ES:DI->terminator, last char is 3/3/KK + 27828 000036DF A0[4BA4] mov al,[psep_char] ;AN000; KANJI 3/3/KK + 27829 000036E2 EB0C jmp short path_store + 27830 ;AN000; 3/3/KK + 27831 _notkanj1: + 27832 ; 26/04/2023 + 27833 000036E4 E2E7 loop kloop + 27834 000036E6 1F pop ds ; return to our segment + 27835 000036E7 4F dec di ; overwrite terminator + 27836 000036E8 A0[4BA4] mov al,[psep_char] ; with a pathname separator + 27837 000036EB 3A45FF cmp al,[di-1] + 27838 000036EE 7401 je short path_success + 27839 path_store: + 27840 000036F0 AA stosb + 27841 path_success: + 27842 000036F1 BE[4DA4] mov si,search_best_buf + 27843 000036F4 31C9 xor cx,cx + 27844 path_succ_loop: + 27845 000036F6 AC lodsb ; append winning filename to path + 27846 000036F7 AA stosb ; (including terminating null) + 27847 000036F8 08C0 or al,al + 27848 000036FA 75FA jnz short path_succ_loop + 27849 000036FC 89E8 mov ax,bp ; retrieve filetype code + 27850 path_exit: + 27851 000036FE 9D popf + 27852 000036FF 5D pop bp + 27853 00003700 5F pop di + 27854 00003701 5E pop si ; chill out... + 27855 00003702 5A pop dx + 27856 00003703 59 pop cx + 27857 00003704 5B pop bx + 27858 00003705 C3 retn + 27859 + 27860 ; =============== S U B R O U T I N E ======================================= + 27861 + 27862 ; STORE_PCHAR determines the pathname-element separator and squirrels + 27863 ; it away. In other words, must we say '/bin/ls' or '\bin\ls'? + 27864 ; + 27865 ; ENTRY: + 27866 ; EXIT: + 27867 ; NOTE(S): + 27868 ; * Uses , defined in . + 27869 + 27870 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27871 STORE_PCHAR: + 27872 00003706 50 push ax + 27873 00003707 B02F mov al,'/' ; is the pathname-element separator + 27874 00003709 E808F3 call pathchrcmp ; a regular slash? + 27875 0000370C 7402 jz short STORE_SLASH + 27876 ; if yes, remember slash + 27877 0000370E B05C mov al,'\' + 27878 ; 18/03/2023 + 27879 ;mov [psep_char],al ; otherwise, remember back-slash + 27880 ;pop ax + 27881 ;retn + 27882 STORE_SLASH: + 27883 00003710 A2[4BA4] mov [psep_char],al + 27884 00003713 58 pop ax + 27885 00003714 C3 retn + 27886 + 27887 ; =============== S U B R O U T I N E ======================================= + 27888 + 27889 ; PATH_CRUNCH takes a prefix from a prefix string, and a suffix from + 27890 ; EXECPATH, and smooshes them into tpbuf. The caller may supply an + 27891 ; additional separator to use for breaking up the path-string. Null is the + 27892 ; default. Once the user-string has been formed, search is invoked to see + 27893 ; what's out there. + 27894 ; + 27895 ; ENTRY: + 27896 ; BH -- additional terminator character + 27897 ; SI -- pointer into pathstring to be dissected + 27898 ; DX -- pointer to stripped filename + 27899 ; EXIT: + 27900 ; AX -- non-zero (file type), zero (nothing found) + 27901 ; SI -- moves along pathstring from call to call + 27902 ; [search_best_buf] -- name of best file (AX non-zero) + 27903 ; [tpbuf] -- clobbered + 27904 ; NOTE(S): + 27905 ; * Implicit in this code is the ability to specify when to search + 27906 ; the current directory (if at all) through the PATH defined by + 27907 ; the user, a la UNIX (e.g., PATH=;c:\bin;c:\etc searches the + 27908 ; current directory before the bin and etc directories of drive c). 27909 - 27910 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 27911 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:39FEh + 27910 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 27911 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3454h 27912 - 27913 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 27914 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:38B2h - 27915 path_crunch: - 27916 00003715 53 push bx - 27917 00003716 51 push cx - 27918 00003717 52 push dx - 27919 00003718 57 push di - 27920 00003719 56 push si - 27921 ;pushf ; ** ; 18/03/2023 - 27922 0000371A E8E9FF call STORE_PCHAR ; figure out pathname separator - 27923 0000371D BF[96A3] mov di,TPBUF ; destination of concatenated string - 27924 00003720 8B36[49A4] mov si,[pathinfo+4] ; "new" pointer to start with - 27925 00003724 8936[47A4] mov [pathinfo+2],si ; becomes "old" pointer - 27926 00003728 1E push ds ; save old segment pointer - 27927 00003729 FF36[45A4] push word [pathinfo+0] - 27928 ; replace with pointer to userpath's - 27929 0000372D 1F pop ds ; segment - 27930 ; 26/04/2023 - 27931 0000372E 30C9 xor cl,cl ;AN000; clear flag for later use 3/3/KK - 27932 path_cr_copy: - 27933 00003730 AC lodsb ; get a pathname byte - 27934 00003731 08C0 or al,al ; check for terminator(s) - 27935 00003733 7414 jz short path_seg ; null terminates segment & pathstring - 27936 00003735 38F8 cmp al,bh - 27937 00003737 7410 je short path_seg ; BH terminates a pathstring segment - 27938 ; - 27939 ; 18/03/2023 - 27940 ; MSDOS 6.0 (& 5.0) COMMAND.COM - 27941 00003739 E825F0 call testkanj ;AN000; 3/3/KK - 27942 0000373C 7406 jz short _notkanj2 ;AN000; 3/3/KK - 27943 0000373E AA stosb ;AN000; 3/3/KK - 27944 0000373F A4 movsb ;AN000; 3/3/KK - 27945 00003740 B101 mov cl,1 ; * ;AN000; CL=1 means latest stored char is DBCS 3/3/KK - 27946 00003742 EBEC jmp short path_cr_copy - 27947 _notkanj2: - 27948 00003744 30C9 xor cl,cl ; * ;AN000; CL=0 means latest stored char is SBCS 3/3/KK - 27949 ; - 27950 00003746 AA stosb - 27951 00003747 EBE7 jmp short path_cr_copy - 27952 - 27953 path_seg: - 27954 00003749 1F pop ds ; restore old data segment - 27955 0000374A 8936[49A4] mov [pathinfo+4],si ; save "new" pointer for next time - 27956 0000374E 88C3 mov bl,al ; remember if we saw null or not... - 27957 ;;; REMOVE NEXT 3 LINES FOR CURDIR SPEC - 27958 00003750 31C0 xor ax,ax ; in case nothing in pathstr... - 27959 00003752 81FF[96A3] cmp di,TPBUF ; was there really anything in pathstr? - 27960 00003756 7421 je short path_cr_leave - 27961 ; if nothing was copied, pathstr empty - 27962 path_cr_look: - 27963 00003758 A0[4BA4] mov al,[psep_char] ; form complete pathname - 27964 ; - 27965 ; 18/03/2023 - 27966 ; MSDOS 6.0 - 27967 0000375B 08C9 or cl,cl ; * ;AN000; 3/3/KK - 27968 0000375D 7505 jnz short path_cr_store - 27969 ;AN000; this is a trailing byte of ECS code 3/3/KK - 27970 ; - 27971 0000375F 3A45FF cmp al,[di-1] ; add pathname separator for suffix - 27972 00003762 7401 je short path_cr_l1 - 27973 path_cr_store: - 27974 00003764 AA stosb - 27975 path_cr_l1: - 27976 00003765 89D6 mov si,dx - 27977 path_cr_l2: - 27978 00003767 AC lodsb ; tack the stripped filename onto - 27979 00003768 AA stosb ; the end of the path, up to and - 27980 00003769 08C0 or al,al ; including the terminating null - 27981 0000376B 75FA jnz short path_cr_l2 - 27982 0000376D BA[96A3] mov dx,TPBUF ; and look for an appropriate file... - 27983 00003770 C706[9AA4][5491] mov word [search_error],BADPMES_PTR - 27984 ;invoke search - 27985 00003776 E80900 call PSEARCH ; results are in AX & search_best_buf - 27986 - 27987 ; 18/03/2023 - 27988 ;path_cr_leave: - 27989 ;or bl,bl ; did we finish off the pathstring? - 27990 ;jz short path_cr_empty - 27991 ; ; null in BL means all gone... - 27992 ;popf ; ** ; otherwise, plenty left - 27993 ;clc - 27994 ;jmp short path_cr_exit - 27995 ;path_cr_empty: - 27996 ;popf ; ** - 27997 ;stc - 27998 ;path_cr_exit: - 27999 - 28000 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28001 path_cr_leave: - 28002 ;popf ; ** ; 18/03/2023 - 28003 00003779 80FB01 cmp bl,1 ; if bl = 0 -> cf = 1 (path_cr_empty:) - 28004 - 28005 path_cr_exit: - 28006 0000377C 5E pop si - 28007 0000377D 5F pop di - 28008 0000377E 5A pop dx - 28009 0000377F 59 pop cx - 28010 00003780 5B pop bx - 28011 00003781 C3 retn - 28012 - 28013 ;============================================================================ - 28014 ; PATH2.ASM, MSDOS 6.0, 1991 - 28015 ;============================================================================ - 28016 ; 02/10/2018 - Retro DOS v3.0 - 28017 - 28018 ;---------------------------------------------------------------------------- - 28019 ; SEARCH, when given a pathname, attempts to find a file with - 28020 ; one of the following extensions: .com, .exe, .bat (highest to - 28021 ; lowest priority). Where conflicts arise, the extension with - 28022 ; the highest priority is favored. - 28023 ; ENTRY: - 28024 ; DX -- pointer to null-terminated pathname - 28025 ; fbuf -- dma buffer for findfirst/next - 28026 ; EXIT: - 28027 ; AX -- 8) file found with .com extension - 28028 ; 4) file found with .exe extension - 28029 ; 2) file found with .bat extension - 28030 ; 0) no such file to be found - 28031 ; (if AX is non-zero:) - 28032 ; [search_best] identical to AX - 28033 ; [search_best_buf] null-terminated filename - 28034 ; NOTES: - 28035 ; 1) Requires caller to have allocated a dma buffer and executed a setdma. - 28036 ;--------------- - 28037 ; CONSTANTS: - 28038 ;--------------- - 28039 SEARCH_FILE_NOT_FOUND EQU 0 - 28040 SEARCH_COM EQU 8 - 28041 SEARCH_EXE EQU 4 - 28042 SEARCH_BAT EQU 2 - 28043 FNAME_LEN EQU 8 - 28044 FNAME_MAX_LEN EQU 13 - 28045 DOT EQU '.' - 28046 WILDCHAR EQU '?' - 28047 - 28048 - 28049 ; =============== S U B R O U T I N E ======================================= + 27913 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 27914 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:39FEh + 27915 + 27916 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 27917 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:38B2h + 27918 path_crunch: + 27919 00003715 53 push bx + 27920 00003716 51 push cx + 27921 00003717 52 push dx + 27922 00003718 57 push di + 27923 00003719 56 push si + 27924 ;pushf ; ** ; 18/03/2023 + 27925 0000371A E8E9FF call STORE_PCHAR ; figure out pathname separator + 27926 0000371D BF[96A3] mov di,TPBUF ; destination of concatenated string + 27927 00003720 8B36[49A4] mov si,[pathinfo+4] ; "new" pointer to start with + 27928 00003724 8936[47A4] mov [pathinfo+2],si ; becomes "old" pointer + 27929 00003728 1E push ds ; save old segment pointer + 27930 00003729 FF36[45A4] push word [pathinfo+0] + 27931 ; replace with pointer to userpath's + 27932 0000372D 1F pop ds ; segment + 27933 ; 26/04/2023 + 27934 0000372E 30C9 xor cl,cl ;AN000; clear flag for later use 3/3/KK + 27935 path_cr_copy: + 27936 00003730 AC lodsb ; get a pathname byte + 27937 00003731 08C0 or al,al ; check for terminator(s) + 27938 00003733 7414 jz short path_seg ; null terminates segment & pathstring + 27939 00003735 38F8 cmp al,bh + 27940 00003737 7410 je short path_seg ; BH terminates a pathstring segment + 27941 ; + 27942 ; 18/03/2023 + 27943 ; MSDOS 6.0 (& 5.0) COMMAND.COM + 27944 00003739 E825F0 call testkanj ;AN000; 3/3/KK + 27945 0000373C 7406 jz short _notkanj2 ;AN000; 3/3/KK + 27946 0000373E AA stosb ;AN000; 3/3/KK + 27947 0000373F A4 movsb ;AN000; 3/3/KK + 27948 00003740 B101 mov cl,1 ; * ;AN000; CL=1 means latest stored char is DBCS 3/3/KK + 27949 00003742 EBEC jmp short path_cr_copy + 27950 _notkanj2: + 27951 00003744 30C9 xor cl,cl ; * ;AN000; CL=0 means latest stored char is SBCS 3/3/KK + 27952 ; + 27953 00003746 AA stosb + 27954 00003747 EBE7 jmp short path_cr_copy + 27955 + 27956 path_seg: + 27957 00003749 1F pop ds ; restore old data segment + 27958 0000374A 8936[49A4] mov [pathinfo+4],si ; save "new" pointer for next time + 27959 0000374E 88C3 mov bl,al ; remember if we saw null or not... + 27960 ;;; REMOVE NEXT 3 LINES FOR CURDIR SPEC + 27961 00003750 31C0 xor ax,ax ; in case nothing in pathstr... + 27962 00003752 81FF[96A3] cmp di,TPBUF ; was there really anything in pathstr? + 27963 00003756 7421 je short path_cr_leave + 27964 ; if nothing was copied, pathstr empty + 27965 path_cr_look: + 27966 00003758 A0[4BA4] mov al,[psep_char] ; form complete pathname + 27967 ; + 27968 ; 18/03/2023 + 27969 ; MSDOS 6.0 + 27970 0000375B 08C9 or cl,cl ; * ;AN000; 3/3/KK + 27971 0000375D 7505 jnz short path_cr_store + 27972 ;AN000; this is a trailing byte of ECS code 3/3/KK + 27973 ; + 27974 0000375F 3A45FF cmp al,[di-1] ; add pathname separator for suffix + 27975 00003762 7401 je short path_cr_l1 + 27976 path_cr_store: + 27977 00003764 AA stosb + 27978 path_cr_l1: + 27979 00003765 89D6 mov si,dx + 27980 path_cr_l2: + 27981 00003767 AC lodsb ; tack the stripped filename onto + 27982 00003768 AA stosb ; the end of the path, up to and + 27983 00003769 08C0 or al,al ; including the terminating null + 27984 0000376B 75FA jnz short path_cr_l2 + 27985 0000376D BA[96A3] mov dx,TPBUF ; and look for an appropriate file... + 27986 00003770 C706[9AA4][5491] mov word [search_error],BADPMES_PTR + 27987 ;invoke search + 27988 00003776 E80900 call PSEARCH ; results are in AX & search_best_buf + 27989 + 27990 ; 18/03/2023 + 27991 ;path_cr_leave: + 27992 ;or bl,bl ; did we finish off the pathstring? + 27993 ;jz short path_cr_empty + 27994 ; ; null in BL means all gone... + 27995 ;popf ; ** ; otherwise, plenty left + 27996 ;clc + 27997 ;jmp short path_cr_exit + 27998 ;path_cr_empty: + 27999 ;popf ; ** + 28000 ;stc + 28001 ;path_cr_exit: + 28002 + 28003 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28004 path_cr_leave: + 28005 ;popf ; ** ; 18/03/2023 + 28006 00003779 80FB01 cmp bl,1 ; if bl = 0 -> cf = 1 (path_cr_empty:) + 28007 + 28008 path_cr_exit: + 28009 0000377C 5E pop si + 28010 0000377D 5F pop di + 28011 0000377E 5A pop dx + 28012 0000377F 59 pop cx + 28013 00003780 5B pop bx + 28014 00003781 C3 retn + 28015 + 28016 ;============================================================================ + 28017 ; PATH2.ASM, MSDOS 6.0, 1991 + 28018 ;============================================================================ + 28019 ; 02/10/2018 - Retro DOS v3.0 + 28020 + 28021 ;---------------------------------------------------------------------------- + 28022 ; SEARCH, when given a pathname, attempts to find a file with + 28023 ; one of the following extensions: .com, .exe, .bat (highest to + 28024 ; lowest priority). Where conflicts arise, the extension with + 28025 ; the highest priority is favored. + 28026 ; ENTRY: + 28027 ; DX -- pointer to null-terminated pathname + 28028 ; fbuf -- dma buffer for findfirst/next + 28029 ; EXIT: + 28030 ; AX -- 8) file found with .com extension + 28031 ; 4) file found with .exe extension + 28032 ; 2) file found with .bat extension + 28033 ; 0) no such file to be found + 28034 ; (if AX is non-zero:) + 28035 ; [search_best] identical to AX + 28036 ; [search_best_buf] null-terminated filename + 28037 ; NOTES: + 28038 ; 1) Requires caller to have allocated a dma buffer and executed a setdma. + 28039 ;--------------- + 28040 ; CONSTANTS: + 28041 ;--------------- + 28042 SEARCH_FILE_NOT_FOUND EQU 0 + 28043 SEARCH_COM EQU 8 + 28044 SEARCH_EXE EQU 4 + 28045 SEARCH_BAT EQU 2 + 28046 FNAME_LEN EQU 8 + 28047 FNAME_MAX_LEN EQU 13 + 28048 DOT EQU '.' + 28049 WILDCHAR EQU '?' 28050 - 28051 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 26D6h - 28052 - 28053 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28054 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:34C9h + 28051 + 28052 ; =============== S U B R O U T I N E ======================================= + 28053 + 28054 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 26D6h 28055 - 28056 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 28057 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3A73h + 28056 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28057 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:34C9h 28058 - 28059 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 28060 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3927h - 28061 PSEARCH: - 28062 00003782 51 push cx - 28063 00003783 52 push dx - 28064 00003784 57 push di - 28065 00003785 56 push si - 28066 ;pushf ; ** ; 18/03/2023 - 28067 00003786 52 push dx ; check drivespec (save pname ptr) - 28068 00003787 89D7 mov di,dx ; working copy of pathname - 28069 00003789 BE[5AA4] mov si,search_curdir_buf - 28070 0000378C 31D2 xor dx,dx ; zero means current drive - 28071 0000378E 807D013A cmp byte [di+1],':' ; is there a drive spec? - 28072 00003792 7508 jne short SEARCH_DIR_CHECK - 28073 00003794 8A15 mov dl,[di] ; get the drive byte - 28074 00003796 80E2DF and dl,0DFh ; ~20h ; uppercase the sucker - 28075 00003799 80EA40 sub dl,'@' ; 40h ; and convert to drive number - 28076 SEARCH_DIR_CHECK: - 28077 0000379C B80047 mov ax,Current_Dir*256 ; 4700h - 28078 0000379F CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY - 28079 ; DL = drive (0=default,1=A,etc.) - 28080 ; DS:SI points to 64-byte buffer area - 28081 000037A1 5A pop dx ; directory? If we can't we'll - 28082 000037A2 724C jc short SEARCH_INVALID_DRIVE - 28083 ; assume it's a bad drive... - 28084 000037A4 B91300 mov cx,search_attr ; 13h - 28085 ; filetypes to search for - 28086 000037A7 B8004E mov ax,Find_First*256 ; 4E00h ; request first match, if any - 28087 000037AA CD21 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) - 28088 ; CX = search attributes - 28089 ; DS:DX -> ASCIZ filespec - 28090 ; (drive,path, and wildcards allowed) - 28091 000037AC 7249 jc short SEARCH_NO_FILE - 28092 000037AE C606[4CA4]00 mov byte [search_best],SEARCH_FILE_NOT_FOUND ; 0 - 28093 000037B3 C606[4DA4]00 mov byte [search_best_buf],ANULL - 28094 ; 0 ; nothing's been found, yet - 28095 SEARCH_LOOP: - 28096 000037B8 E84300 call SEARCH_FTYPE ; determine if .com, &c... - 28097 000037BB 3A06[4CA4] cmp al,[search_best] - 28098 ; better than what we've found so far? - 28099 000037BF 7E13 jle short SEARCH_NEXT - 28100 ; no, look for another - 28101 000037C1 A2[4CA4] mov [search_best],al - 28102 ; found something... save its code - 28103 ;mov si,offset TRANGROUP:fbuf.find_buf_pname - 28104 ;mov si,FBUF_PNAME - 28105 000037C4 BE[38A4] mov si,FBUF+FIND_BUF.PNAME ; FBUF+30 - 28106 000037C7 BF[4DA4] mov di,search_best_buf - 28107 000037CA B90D00 mov cx,FNAME_MAX_LEN ; 13 - 28108 000037CD FC cld - 28109 000037CE F3A4 rep movsb ; save complete pathname representation - 28110 000037D0 3C08 cmp al,SEARCH_COM ; 8 - 28111 ; have we found the best of all? - 28112 000037D2 740A je short SEARCH_DONE - 28113 SEARCH_NEXT: ; keep on looking - 28114 000037D4 B91300 mov cx,search_attr ; 13h - 28115 000037D7 B8004F mov ax,Find_Next*256 ; 4F00h ; next match - 28116 000037DA CD21 int 21h ; DOS - 2+ - FIND NEXT ASCIZ (FINDNEXT) - 28117 ; [DTA] = data block from - 28118 ; last AH = 4Eh/4Fh call - 28119 000037DC 73DA jnc short SEARCH_LOOP - 28120 SEARCH_DONE: ; it's all over with... - 28121 000037DE A0[4CA4] mov al,[search_best] - 28122 ; pick best to return with - 28123 ; 18/03/2023 - 28124 ; MSDOS 6.0 - 28125 000037E1 803E[069F]01 cmp byte [ext_entered],1 - 28126 ;AN005; Did user request a specific ext? - 28127 000037E6 7411 je short SEARCH_EXIT - 28128 ;AN005; no - exit - 28129 000037E8 A0[069F] mov al,[ext_entered] - 28130 ;AN005; yes - get the real file type back - 28131 000037EB A2[4CA4] mov [search_best],al - 28132 ;AN005; save the real file type - 28133 ; - 28134 000037EE EB09 jmp short SEARCH_EXIT - 28135 - 28136 SEARCH_INVALID_DRIVE: ; Tell the user path/drive - 28137 000037F0 8B16[9AA4] mov dx,[search_error] - 28138 ; appropriate error message - 28139 000037F4 E8311C call std_printf ; and pretend no file found - 28140 - 28141 SEARCH_NO_FILE: ; couldn't find a match - 28142 ;mov ax,SEARCH_FILE_NOT_FOUND ; 0 - 28143 ; 18/03/2023 - 28144 000037F7 31C0 xor ax,ax - 28145 SEARCH_EXIT: - 28146 ;popf ; ** ; 18/03/2023 - 28147 000037F9 5E pop si - 28148 000037FA 5F pop di - 28149 000037FB 5A pop dx - 28150 000037FC 59 pop cx - 28151 000037FD C3 retn - 28152 - 28153 ; =============== S U B R O U T I N E ======================================= - 28154 - 28155 ; SEARCH_FTYPE determines the type of a file by examining its extension. - 28156 ; - 28157 ; ENTRY: - 28158 ; fbuf -- dma buffer containing filename - 28159 ; EXIT: - 28160 ; AX -- file code, as given in search header - 28161 ; NOTE(S): - 28162 ; * Implicit assumption that NULL == search_file_not_found - 28163 - 28164 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28165 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28059 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28060 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3A73h + 28061 + 28062 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 28063 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3927h + 28064 PSEARCH: + 28065 00003782 51 push cx + 28066 00003783 52 push dx + 28067 00003784 57 push di + 28068 00003785 56 push si + 28069 ;pushf ; ** ; 18/03/2023 + 28070 00003786 52 push dx ; check drivespec (save pname ptr) + 28071 00003787 89D7 mov di,dx ; working copy of pathname + 28072 00003789 BE[5AA4] mov si,search_curdir_buf + 28073 0000378C 31D2 xor dx,dx ; zero means current drive + 28074 0000378E 807D013A cmp byte [di+1],':' ; is there a drive spec? + 28075 00003792 7508 jne short SEARCH_DIR_CHECK + 28076 00003794 8A15 mov dl,[di] ; get the drive byte + 28077 00003796 80E2DF and dl,0DFh ; ~20h ; uppercase the sucker + 28078 00003799 80EA40 sub dl,'@' ; 40h ; and convert to drive number + 28079 SEARCH_DIR_CHECK: + 28080 0000379C B80047 mov ax,Current_Dir*256 ; 4700h + 28081 0000379F CD21 int 21h ; DOS - 2+ - GET CURRENT DIRECTORY + 28082 ; DL = drive (0=default,1=A,etc.) + 28083 ; DS:SI points to 64-byte buffer area + 28084 000037A1 5A pop dx ; directory? If we can't we'll + 28085 000037A2 724C jc short SEARCH_INVALID_DRIVE + 28086 ; assume it's a bad drive... + 28087 000037A4 B91300 mov cx,search_attr ; 13h + 28088 ; filetypes to search for + 28089 000037A7 B8004E mov ax,Find_First*256 ; 4E00h ; request first match, if any + 28090 000037AA CD21 int 21h ; DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST) + 28091 ; CX = search attributes + 28092 ; DS:DX -> ASCIZ filespec + 28093 ; (drive,path, and wildcards allowed) + 28094 000037AC 7249 jc short SEARCH_NO_FILE + 28095 000037AE C606[4CA4]00 mov byte [search_best],SEARCH_FILE_NOT_FOUND ; 0 + 28096 000037B3 C606[4DA4]00 mov byte [search_best_buf],ANULL + 28097 ; 0 ; nothing's been found, yet + 28098 SEARCH_LOOP: + 28099 000037B8 E84300 call SEARCH_FTYPE ; determine if .com, &c... + 28100 000037BB 3A06[4CA4] cmp al,[search_best] + 28101 ; better than what we've found so far? + 28102 000037BF 7E13 jle short SEARCH_NEXT + 28103 ; no, look for another + 28104 000037C1 A2[4CA4] mov [search_best],al + 28105 ; found something... save its code + 28106 ;mov si,offset TRANGROUP:fbuf.find_buf_pname + 28107 ;mov si,FBUF_PNAME + 28108 000037C4 BE[38A4] mov si,FBUF+FIND_BUF.PNAME ; FBUF+30 + 28109 000037C7 BF[4DA4] mov di,search_best_buf + 28110 000037CA B90D00 mov cx,FNAME_MAX_LEN ; 13 + 28111 000037CD FC cld + 28112 000037CE F3A4 rep movsb ; save complete pathname representation + 28113 000037D0 3C08 cmp al,SEARCH_COM ; 8 + 28114 ; have we found the best of all? + 28115 000037D2 740A je short SEARCH_DONE + 28116 SEARCH_NEXT: ; keep on looking + 28117 000037D4 B91300 mov cx,search_attr ; 13h + 28118 000037D7 B8004F mov ax,Find_Next*256 ; 4F00h ; next match + 28119 000037DA CD21 int 21h ; DOS - 2+ - FIND NEXT ASCIZ (FINDNEXT) + 28120 ; [DTA] = data block from + 28121 ; last AH = 4Eh/4Fh call + 28122 000037DC 73DA jnc short SEARCH_LOOP + 28123 SEARCH_DONE: ; it's all over with... + 28124 000037DE A0[4CA4] mov al,[search_best] + 28125 ; pick best to return with + 28126 ; 18/03/2023 + 28127 ; MSDOS 6.0 + 28128 000037E1 803E[069F]01 cmp byte [ext_entered],1 + 28129 ;AN005; Did user request a specific ext? + 28130 000037E6 7411 je short SEARCH_EXIT + 28131 ;AN005; no - exit + 28132 000037E8 A0[069F] mov al,[ext_entered] + 28133 ;AN005; yes - get the real file type back + 28134 000037EB A2[4CA4] mov [search_best],al + 28135 ;AN005; save the real file type + 28136 ; + 28137 000037EE EB09 jmp short SEARCH_EXIT + 28138 + 28139 SEARCH_INVALID_DRIVE: ; Tell the user path/drive + 28140 000037F0 8B16[9AA4] mov dx,[search_error] + 28141 ; appropriate error message + 28142 000037F4 E8311C call std_printf ; and pretend no file found + 28143 + 28144 SEARCH_NO_FILE: ; couldn't find a match + 28145 ;mov ax,SEARCH_FILE_NOT_FOUND ; 0 + 28146 ; 18/03/2023 + 28147 000037F7 31C0 xor ax,ax + 28148 SEARCH_EXIT: + 28149 ;popf ; ** ; 18/03/2023 + 28150 000037F9 5E pop si + 28151 000037FA 5F pop di + 28152 000037FB 5A pop dx + 28153 000037FC 59 pop cx + 28154 000037FD C3 retn + 28155 + 28156 ; =============== S U B R O U T I N E ======================================= + 28157 + 28158 ; SEARCH_FTYPE determines the type of a file by examining its extension. + 28159 ; + 28160 ; ENTRY: + 28161 ; fbuf -- dma buffer containing filename + 28162 ; EXIT: + 28163 ; AX -- file code, as given in search header + 28164 ; NOTE(S): + 28165 ; * Implicit assumption that NULL == search_file_not_found 28166 - 28167 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM - 28168 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3927h - 28169 SEARCH_FTYPE: - 28170 000037FE 57 push di - 28171 000037FF 56 push si - 28172 ;mov ax,ANULL ; 0 ; find the end of the filename - 28173 ; 18/02/2023 - 28174 00003800 31C0 xor ax,ax ; ax = 0 - 28175 ;mov di,offset TRANGROUP:fbuf.find_buf_pname - 28176 ;mov di,FBUF_PNAME - 28177 00003802 BF[38A4] mov di,FBUF+FIND_BUF.PNAME ; FBUF+1Eh - 28178 00003805 B90D00 mov cx,FNAME_MAX_LEN ; 13 - 28179 00003808 FC cld - 28180 00003809 F2AE repnz scasb ; search for the terminating null - 28181 0000380B 7535 jnz short FTYPE_EXIT - 28182 ; weird... no null byte at end - 28183 0000380D 83EF05 sub di,5 ; . + E + X + T + NULL - 28184 - 28185 ; Compare .COM - 28186 - 28187 00003810 BE[C495] mov si,comext ; ".COM" - 28188 00003813 89F8 mov ax,di - 28189 00003815 A7 cmpsw - 28190 00003816 7508 jnz short FTYPE_EXE - 28191 00003818 A7 cmpsw - 28192 00003819 7505 jnz short FTYPE_EXE - 28193 ;mov ax,8 - 28194 0000381B B80800 mov ax,SEARCH_COM ; success! - 28195 0000381E EB22 jmp short FTYPE_EXIT - 28196 - 28197 ; Compare .EXE - 28198 FTYPE_EXE: ; still looking... now for '.exe' - 28199 00003820 89C7 mov di,ax - 28200 00003822 BE[C895] mov si,exeext ; ".EXE" - 28201 00003825 A7 cmpsw - 28202 00003826 7508 jnz short FTYPE_BAT - 28203 00003828 A7 cmpsw - 28204 00003829 7505 jnz short FTYPE_BAT - 28205 ;mov ax,4 - 28206 0000382B B80400 mov ax,SEARCH_EXE ; success! - 28207 0000382E EB12 jmp short FTYPE_EXIT - 28208 - 28209 ; Compare .BAT - 28210 FTYPE_BAT: ; still looking... now for '.bat' - 28211 00003830 89C7 mov di,ax - 28212 00003832 BE[CC95] mov si,batext ; ".BAT" - 28213 00003835 A7 cmpsw - 28214 00003836 7508 jnz short FTYPE_FAIL - 28215 00003838 A7 cmpsw - 28216 00003839 7505 jnz short FTYPE_FAIL - 28217 ;mov ax,2 - 28218 0000383B B80200 mov ax,SEARCH_BAT ; success! - 28219 0000383E EB02 jmp short FTYPE_EXIT - 28220 - 28221 FTYPE_FAIL: ; file doesn't match what we need - 28222 ;mov ax,ANULL ; 0 - 28223 ; 18/03/2023 - 28224 00003840 29C0 sub ax,ax ; ax = 0 - 28225 FTYPE_EXIT: + 28167 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28168 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28169 + 28170 ; 04/08/2024 - Retro DOS v5.0 COMMAND.COM + 28171 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3927h + 28172 SEARCH_FTYPE: + 28173 000037FE 57 push di + 28174 000037FF 56 push si + 28175 ;mov ax,ANULL ; 0 ; find the end of the filename + 28176 ; 18/02/2023 + 28177 00003800 31C0 xor ax,ax ; ax = 0 + 28178 ;mov di,offset TRANGROUP:fbuf.find_buf_pname + 28179 ;mov di,FBUF_PNAME + 28180 00003802 BF[38A4] mov di,FBUF+FIND_BUF.PNAME ; FBUF+1Eh + 28181 00003805 B90D00 mov cx,FNAME_MAX_LEN ; 13 + 28182 00003808 FC cld + 28183 00003809 F2AE repnz scasb ; search for the terminating null + 28184 0000380B 7535 jnz short FTYPE_EXIT + 28185 ; weird... no null byte at end + 28186 0000380D 83EF05 sub di,5 ; . + E + X + T + NULL + 28187 + 28188 ; Compare .COM + 28189 + 28190 00003810 BE[C495] mov si,comext ; ".COM" + 28191 00003813 89F8 mov ax,di + 28192 00003815 A7 cmpsw + 28193 00003816 7508 jnz short FTYPE_EXE + 28194 00003818 A7 cmpsw + 28195 00003819 7505 jnz short FTYPE_EXE + 28196 ;mov ax,8 + 28197 0000381B B80800 mov ax,SEARCH_COM ; success! + 28198 0000381E EB22 jmp short FTYPE_EXIT + 28199 + 28200 ; Compare .EXE + 28201 FTYPE_EXE: ; still looking... now for '.exe' + 28202 00003820 89C7 mov di,ax + 28203 00003822 BE[C895] mov si,exeext ; ".EXE" + 28204 00003825 A7 cmpsw + 28205 00003826 7508 jnz short FTYPE_BAT + 28206 00003828 A7 cmpsw + 28207 00003829 7505 jnz short FTYPE_BAT + 28208 ;mov ax,4 + 28209 0000382B B80400 mov ax,SEARCH_EXE ; success! + 28210 0000382E EB12 jmp short FTYPE_EXIT + 28211 + 28212 ; Compare .BAT + 28213 FTYPE_BAT: ; still looking... now for '.bat' + 28214 00003830 89C7 mov di,ax + 28215 00003832 BE[CC95] mov si,batext ; ".BAT" + 28216 00003835 A7 cmpsw + 28217 00003836 7508 jnz short FTYPE_FAIL + 28218 00003838 A7 cmpsw + 28219 00003839 7505 jnz short FTYPE_FAIL + 28220 ;mov ax,2 + 28221 0000383B B80200 mov ax,SEARCH_BAT ; success! + 28222 0000383E EB02 jmp short FTYPE_EXIT + 28223 + 28224 FTYPE_FAIL: ; file doesn't match what we need + 28225 ;mov ax,ANULL ; 0 28226 ; 18/03/2023 - 28227 ; MSDOS 6.0 - 28228 00003842 803E[069F]01 cmp byte [ext_entered],1 - 28229 ;AN005; was an extension entered? - 28230 00003847 740A jz short FTYPE_DONE - 28231 ;AN005; no - exit - 28232 ;cmp ax,ANULL ;AN005; was any match found - 28233 00003849 21C0 and ax,ax ; ax = 0 ? - 28234 0000384B 7406 jz short FTYPE_DONE - 28235 ;AN005; no - exit - 28236 0000384D A2[069F] mov [ext_entered],al - 28237 ;AN005; save the match type found - 28238 00003850 B80800 mov ax,SEARCH_COM ;AN005; send back best was found to stop search - 28239 FTYPE_DONE: - 28240 00003853 5E pop si - 28241 00003854 5F pop di - 28242 00003855 C3 retn - 28243 - 28244 ; =============== S U B R O U T I N E ======================================= - 28245 - 28246 ; STRIP copies the source string (argv[0]) into the destination buffer, - 28247 ; replacing any extension with wildcards. - 28248 ; - 28249 ; ENTRY: - 28250 ; BX -- maximum length of destination buffer - 28251 ; DS:SI -- address of destination buffer - 28252 ; argv[0] -- command name to be stripped - 28253 ; EXIT: - 28254 ; CF -- set if failure, clear if successful - 28255 ; NOTE(S): - 28256 - 28257 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28258 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 28259 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM - 28260 STRIP: - 28261 00003856 50 push ax - 28262 00003857 53 push bx - 28263 00003858 51 push cx - 28264 00003859 52 push dx - 28265 0000385A 57 push di - 28266 0000385B 56 push si - 28267 ;pushf ; ** ; 18/03/2023 - 28268 - 28269 ; 05/05/2023 - 28270 ; MSDOS 6.0 - 28271 0000385C C606[069F]01 mov byte [ext_entered],1 - 28272 ;AN005; assume no extension on file name - 28273 ; MSDOS 3.3 (& MSDOS 6.0) - 28274 ;mov dx,[ARG_ARGV] - 28275 ;mov dx,ds:arg.argv[0].argpointer - 28276 ; save pointer to beginning of argstring - 28277 ;mov dx,[ARGV0_ARGPOINTER] - 28278 00003861 8B16[509F] mov dx,[ARG+ARGV_ELE.argpointer] - 28279 ;mov di,ds:arg.argv[0].argstartel - 28280 ; beginning of last pathname element - 28281 ;mov di,[ARGV0_ARGSTARTEL] ; beginning of last pathname element - 28282 00003865 8B3E[539F] mov di,[ARG+ARGV_ELE.argstartel] - 28283 00003869 803D00 cmp byte [di],0 ; *STARTEL == NULL means no command - 28284 0000386C 743D je short STRIP_ERROR - 28285 0000386E 89D1 mov cx,dx ; compute where end of argstring lies - 28286 ;add cx,ds:arg.argv[0].arglen - 28287 ;add cx,[ARGV0_ARGLEN] - 28288 00003870 030E[559F] add cx,[ARG+ARGV_ELE.arglen] - 28289 00003874 29F9 sub cx,di ; and then find length of last element - 28290 00003876 41 inc cx ; include null as well - 28291 00003877 B02E mov al,'.' - 28292 ;mov al,DOT ; let's find the filetype extension - 28293 00003879 FC cld - 28294 0000387A F2AE repnz scasb ; wind up pointing to either null or dot - 28295 - 28296 ; 18/03/2023 - 28297 ; MSDOS 6.0 - 28298 0000387C E307 jcxz PROCESS_EXT ;AN005; if no extension found, just continue - 28299 0000387E B000 mov al,0 ; 18/03/2023 - 28300 ;mov byte [ext_entered],0 - 28301 00003880 A2[069F] mov [ext_entered],al - 28302 ;AN005; we found an extension - 28303 ;;mov al,ANULL ;AN005; continue scanning until the - 28304 ;mov al,0 - 28305 00003883 F2AE repnz scasb ;AN005; end of line is reached. - 28306 PROCESS_EXT: - 28307 ; MSDOS 3.3 (& MSDOS 6.0) - 28308 00003885 89F9 mov cx,di ; pointer to end of argstring yields - 28309 00003887 29D1 sub cx,dx ; number of bytes to be copied - 28310 00003889 83EB04 sub bx,4 ; can argstring fit into dest. buffer? - 28311 0000388C 39D9 cmp cx,bx - 28312 0000388E 7F1B jg short STRIP_ERROR - 28313 ; if not, we must have a bad pathname - 28314 00003890 89F7 mov di,si ; destination buffer - 28315 00003892 89D6 mov si,dx ; source is beginning of pathname - 28316 00003894 FC cld - 28317 00003895 F3A4 rep movsb ; SI=arg,DI=buffer,CX=argend-argbeg - 28318 - 28319 ; 18/03/2023 - 28320 ; MSDOS 6.0 - 28321 00003897 803E[069F]01 cmp byte [ext_entered],1 - 28322 ;AN005; if an extension was entered - 28323 0000389C 750A jne short SKIP_WILDS ; cf = 1 ; 12/06/2023 - 28324 ;AN005; don't set up wildcard ext. - 28325 - 28326 ; MSDOS 3.3 (& MSDOS 6.0) - 28327 0000389E 4F dec di ; overwrite null or dot - 28328 0000389F AA stosb ; with a dot - 28329 000038A0 B03F mov al,'?' - 28330 ;mov al,WILDCHAR ; now add wildcards - 28331 000038A2 AA stosb - 28332 000038A3 AA stosb - 28333 000038A4 AA stosb - 28334 000038A5 B000 mov al,0 - 28335 ;mov al,ANULL ; and a terminating null - 28336 000038A7 AA stosb - 28337 SKIP_WILDS: - 28338 ;popf ; ** ; 18/03/2023 - 28339 000038A8 F8 clc - 28340 000038A9 EB01 jmp short STRIP_EXIT ; chill out... - 28341 - 28342 STRIP_ERROR: - 28343 ;popf ; ** ; 18/03/2023 - 28344 000038AB F9 stc - 28345 STRIP_EXIT: - 28346 000038AC 5E pop si - 28347 000038AD 5F pop di - 28348 000038AE 5A pop dx - 28349 000038AF 59 pop cx - 28350 000038B0 5B pop bx - 28351 000038B1 58 pop ax - 28352 000038B2 C3 retn - 28353 - 28354 ; =============== S U B R O U T I N E ======================================= - 28355 - 28356 ; SAVE_ARGS attempts to preserve the existing argv[]/argvcnt/argbuffer - 28357 ; - 28358 ; structure in newly allocated memory. The argv[] structure is found at the - 28359 ; beginning of this area. The caller indicates how much extra space is - 28360 ; needed in the resulting structure; Save_Args returns a segment number and - 28361 ; an offset into that area, indicating where the caller may preserve its own - 28362 ; data. Note that can be found at . - 28363 ; ENTRY: - 28364 ; BX -- size (in bytes) of extra area to allocate - 28365 ; EXIT: - 28366 ; AX -- segment of new area. - 28367 ; CF -- set if unable to save a copy. - 28368 ; NOTE(S): - 28369 ; 1) The allocated area will be AT LEAST the size requested -- since - 28370 ; the underlying MSDOS call, returns an integral number of - 28371 ; paragraphs. - 28372 ; 2) It is an error if MSDOS can't allocate AT LEAST as much memory - 28373 ; as the caller of Save_Args requests. - 28374 ; 3) AX is undefined if CF indicates an error. - 28375 - 28376 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28377 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 28378 ; 09/08/2024 - Retro DOS v5.0 COMMAND.COM - 28379 SAVE_ARGS: - 28380 000038B3 53 push bx - 28381 000038B4 51 push cx - 28382 000038B5 52 push dx - 28383 000038B6 57 push di - 28384 000038B7 56 push si - 28385 000038B8 55 push bp - 28386 ; 01/05/2023 - 28387 ; 26/04/2023 - 28388 ;pushf ; ** - 28389 ;;add bx,1363 ; space for arg structure, round up - 28390 ; 09/08/2024 - PCDOS 7.1 COMMAND.COM - 28391 ;add bx,1107 ; 1092+15 - 28392 000038B9 81C35304 add bx,ARG_UNIT.SIZE+15 ; 1348+15 - 28393 000038BD B104 mov cl,4 ; to paragraph size and convert - 28394 000038BF D3EB shr bx,cl ; size in bytes to size in paragraphs - 28395 000038C1 B80048 mov ax,ALLOC*256 ; 4800h - 28396 000038C4 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY - 28397 ; BX = number of 16-byte paragraphs desired - 28398 000038C6 7241 jc short SAVE_ERROR ; *** - 28399 000038C8 89C5 mov bp,ax ; save segment id - 28400 000038CA 06 push es ; save TRANGROUP address - 28401 000038CB 8EC0 mov es,ax ; switch to new memory segment - 28402 ; assume es:nothing - 28403 ;mov cx,1348 ; get back structure size - 28404 000038CD B94404 mov cx,ARG_UNIT.SIZE ; 1092 ; 09/08/2024 - 28405 000038D0 31FF xor di,di ; destination is new memory area - 28406 ;mov si,ARG_ARGV - 28407 000038D2 BE[509F] mov si,ARG ; source is arg structure - 28408 ; 09/08/2024 - 28409 000038D5 56 push si - 28410 000038D6 F3A4 rep movsb ; move that sucker! - 28411 ;mov cx,arg.argvcnt ; adjust argv pointers - 28412 ;mov cx,[ARG_ARGVCNT] - 28413 000038D8 8B0E[10A2] mov cx,[ARG+ARG_UNIT.argvcnt] - 28414 000038DC 31C0 xor ax,ax ; base address for argv_calc - 28415 - 28416 ; Bugbug: What did they mean by this? - 28417 ; Note that the replacement line produces exactly the same code. - 28418 ;; mov SI, OFFSET TRANGROUP:arg.argbuf - OFFSET arg_unit.argbuf - 28419 ; mov SI, OFFSET TRANGROUP:arg - 28420 - 28421 ;;mov si,ARG_ARGV - 28422 ;mov si,ARG - 28423 ; 09/08/2024 - 28424 000038DE 5E pop si - 28425 SAVE_PTR_LOOP: - 28426 000038DF 49 dec cx ; exhausted all args? - 28427 000038E0 7C24 jl short SAVE_DONE - 28428 000038E2 89CB mov bx,cx ; get arg index and - 28429 000038E4 E8A9FC call argv_calc ; convert to a pointer - 28430 ;mov dx,ds:arg.argv[bx].argpointer - 28431 ;mov dx,[ARG_ARGV+bx] - 28432 000038E7 8B97[509F] mov dx,[ARG+ARGV_ELE.argpointer+bx] - 28433 000038EB 29F2 sub dx,si ; adjust argpointer - 28434 ;mov es:argv[BX].argpointer,dx - 28435 ;mov [es:bx+ARGV_ELE.argpointer],dx ; mov [es:bx+0],dx - 28436 000038ED 268917 mov [es:bx],dx - 28437 ;mov dx,ds:arg.argv[bx].argstartel - 28438 ;mov dx,[ARGV0_ARGSTARTEL+bx] - 28439 000038F0 8B97[539F] mov dx,[ARG+ARGV_ELE.argstartel+bx] - 28440 000038F4 29F2 sub dx,si ; and adjust argstartel - 28441 ;mov es:argv[bx].argstartel,dx - 28442 ;mov [es:bx+3],dx - 28443 000038F6 26895703 mov [es:bx+ARGV_ELE.argstartel],dx - 28444 ;mov dx,ds:arg.argv[bx].arg_ocomptr - 28445 ;mov dx,[ARGV0_OCOMPTR+bx] - 28446 000038FA 8B97[599F] mov dx,[ARG+ARGV_ELE.arg_ocomptr+bx] - 28447 000038FE 29F2 sub dx,si ; and adjust arg_ocomptr - 28448 ;mov es:argv[bx].arg_ocomptr,dx - 28449 ;mov [es:bx+9],dx - 28450 00003900 26895709 mov [es:bx+ARGV_ELE.arg_ocomptr],dx - 28451 00003904 EBD9 jmp short SAVE_PTR_LOOP - 28452 SAVE_DONE: - 28453 00003906 07 pop es ; back we go to TRANGROUP - 28454 ; assume es:nothing - 28455 00003907 89E8 mov ax,bp ; restore segment id - 28456 ; 26/04/2023 - 28457 ; cf = 0 ; * - 28458 ;jmp short SAVE_OK - 28459 - 28460 ; 26/04/2023 - 28461 ;SAVE_ERROR: - 28462 ; ; 26/04/2023 - 28463 ; ;popf ; ** - 28464 ; stc - 28465 ; jmp short SAVE_EXIT - 28466 - 28467 SAVE_OK: - 28468 ; 26/04/2023 - 28469 ;popf ; ** - 28470 ; 26/04/2023 - 28471 ; cf = 0 ; * - 28472 ;clc - 28473 SAVE_EXIT: - 28474 SAVE_ERROR: ; 26/04/2023 (cf=1) ; *** - 28475 00003909 5D pop bp - 28476 0000390A 5E pop si - 28477 0000390B 5F pop di - 28478 0000390C 5A pop dx - 28479 0000390D 59 pop cx - 28480 0000390E 5B pop bx - 28481 answ_no: ; 26/04/2023 - 28482 0000390F C3 retn - 28483 - 28484 ;============================================================================ - 28485 ; TUCODE.ASM, MSDOS 6.0, 1991 (1) - 28486 ;============================================================================ - 28487 ; 02/10/2018 - Retro DOS v3.0 - 28488 - 28489 ; Title COMMAND Language midifiable Code Transient - 28490 - 28491 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2843h - 28492 - 28493 ; =============== S U B R O U T I N E ======================================= - 28494 - 28495 ; **************************************************************** - 28496 ; * - 28497 ; * ROUTINE: NOTEST2 - execution of DEL/ERASE command - 28498 ; * - 28499 ; * FUNCTION: Delete files based on user parsed input. Prompt - 28500 ; * user for Y/N if necessary. If an error occurs, - 28501 ; * set up an error message and go to CERROR. - 28502 ; * - 28503 ; * INPUT: FCB at 5ch set up with filename(s) entered - 28504 ; * Current directory set to entered directory + 28227 00003840 29C0 sub ax,ax ; ax = 0 + 28228 FTYPE_EXIT: + 28229 ; 18/03/2023 + 28230 ; MSDOS 6.0 + 28231 00003842 803E[069F]01 cmp byte [ext_entered],1 + 28232 ;AN005; was an extension entered? + 28233 00003847 740A jz short FTYPE_DONE + 28234 ;AN005; no - exit + 28235 ;cmp ax,ANULL ;AN005; was any match found + 28236 00003849 21C0 and ax,ax ; ax = 0 ? + 28237 0000384B 7406 jz short FTYPE_DONE + 28238 ;AN005; no - exit + 28239 0000384D A2[069F] mov [ext_entered],al + 28240 ;AN005; save the match type found + 28241 00003850 B80800 mov ax,SEARCH_COM ;AN005; send back best was found to stop search + 28242 FTYPE_DONE: + 28243 00003853 5E pop si + 28244 00003854 5F pop di + 28245 00003855 C3 retn + 28246 + 28247 ; =============== S U B R O U T I N E ======================================= + 28248 + 28249 ; STRIP copies the source string (argv[0]) into the destination buffer, + 28250 ; replacing any extension with wildcards. + 28251 ; + 28252 ; ENTRY: + 28253 ; BX -- maximum length of destination buffer + 28254 ; DS:SI -- address of destination buffer + 28255 ; argv[0] -- command name to be stripped + 28256 ; EXIT: + 28257 ; CF -- set if failure, clear if successful + 28258 ; NOTE(S): + 28259 + 28260 ; 18/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28261 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28262 ; 08/08/2024 - Retro DOS v5.0 COMMAND.COM + 28263 STRIP: + 28264 00003856 50 push ax + 28265 00003857 53 push bx + 28266 00003858 51 push cx + 28267 00003859 52 push dx + 28268 0000385A 57 push di + 28269 0000385B 56 push si + 28270 ;pushf ; ** ; 18/03/2023 + 28271 + 28272 ; 05/05/2023 + 28273 ; MSDOS 6.0 + 28274 0000385C C606[069F]01 mov byte [ext_entered],1 + 28275 ;AN005; assume no extension on file name + 28276 ; MSDOS 3.3 (& MSDOS 6.0) + 28277 ;mov dx,[ARG_ARGV] + 28278 ;mov dx,ds:arg.argv[0].argpointer + 28279 ; save pointer to beginning of argstring + 28280 ;mov dx,[ARGV0_ARGPOINTER] + 28281 00003861 8B16[509F] mov dx,[ARG+ARGV_ELE.argpointer] + 28282 ;mov di,ds:arg.argv[0].argstartel + 28283 ; beginning of last pathname element + 28284 ;mov di,[ARGV0_ARGSTARTEL] ; beginning of last pathname element + 28285 00003865 8B3E[539F] mov di,[ARG+ARGV_ELE.argstartel] + 28286 00003869 803D00 cmp byte [di],0 ; *STARTEL == NULL means no command + 28287 0000386C 743D je short STRIP_ERROR + 28288 0000386E 89D1 mov cx,dx ; compute where end of argstring lies + 28289 ;add cx,ds:arg.argv[0].arglen + 28290 ;add cx,[ARGV0_ARGLEN] + 28291 00003870 030E[559F] add cx,[ARG+ARGV_ELE.arglen] + 28292 00003874 29F9 sub cx,di ; and then find length of last element + 28293 00003876 41 inc cx ; include null as well + 28294 00003877 B02E mov al,'.' + 28295 ;mov al,DOT ; let's find the filetype extension + 28296 00003879 FC cld + 28297 0000387A F2AE repnz scasb ; wind up pointing to either null or dot + 28298 + 28299 ; 18/03/2023 + 28300 ; MSDOS 6.0 + 28301 0000387C E307 jcxz PROCESS_EXT ;AN005; if no extension found, just continue + 28302 0000387E B000 mov al,0 ; 18/03/2023 + 28303 ;mov byte [ext_entered],0 + 28304 00003880 A2[069F] mov [ext_entered],al + 28305 ;AN005; we found an extension + 28306 ;;mov al,ANULL ;AN005; continue scanning until the + 28307 ;mov al,0 + 28308 00003883 F2AE repnz scasb ;AN005; end of line is reached. + 28309 PROCESS_EXT: + 28310 ; MSDOS 3.3 (& MSDOS 6.0) + 28311 00003885 89F9 mov cx,di ; pointer to end of argstring yields + 28312 00003887 29D1 sub cx,dx ; number of bytes to be copied + 28313 00003889 83EB04 sub bx,4 ; can argstring fit into dest. buffer? + 28314 0000388C 39D9 cmp cx,bx + 28315 0000388E 7F1B jg short STRIP_ERROR + 28316 ; if not, we must have a bad pathname + 28317 00003890 89F7 mov di,si ; destination buffer + 28318 00003892 89D6 mov si,dx ; source is beginning of pathname + 28319 00003894 FC cld + 28320 00003895 F3A4 rep movsb ; SI=arg,DI=buffer,CX=argend-argbeg + 28321 + 28322 ; 18/03/2023 + 28323 ; MSDOS 6.0 + 28324 00003897 803E[069F]01 cmp byte [ext_entered],1 + 28325 ;AN005; if an extension was entered + 28326 0000389C 750A jne short SKIP_WILDS ; cf = 1 ; 12/06/2023 + 28327 ;AN005; don't set up wildcard ext. + 28328 + 28329 ; MSDOS 3.3 (& MSDOS 6.0) + 28330 0000389E 4F dec di ; overwrite null or dot + 28331 0000389F AA stosb ; with a dot + 28332 000038A0 B03F mov al,'?' + 28333 ;mov al,WILDCHAR ; now add wildcards + 28334 000038A2 AA stosb + 28335 000038A3 AA stosb + 28336 000038A4 AA stosb + 28337 000038A5 B000 mov al,0 + 28338 ;mov al,ANULL ; and a terminating null + 28339 000038A7 AA stosb + 28340 SKIP_WILDS: + 28341 ;popf ; ** ; 18/03/2023 + 28342 000038A8 F8 clc + 28343 000038A9 EB01 jmp short STRIP_EXIT ; chill out... + 28344 + 28345 STRIP_ERROR: + 28346 ;popf ; ** ; 18/03/2023 + 28347 000038AB F9 stc + 28348 STRIP_EXIT: + 28349 000038AC 5E pop si + 28350 000038AD 5F pop di + 28351 000038AE 5A pop dx + 28352 000038AF 59 pop cx + 28353 000038B0 5B pop bx + 28354 000038B1 58 pop ax + 28355 000038B2 C3 retn + 28356 + 28357 ; =============== S U B R O U T I N E ======================================= + 28358 + 28359 ; SAVE_ARGS attempts to preserve the existing argv[]/argvcnt/argbuffer + 28360 ; + 28361 ; structure in newly allocated memory. The argv[] structure is found at the + 28362 ; beginning of this area. The caller indicates how much extra space is + 28363 ; needed in the resulting structure; Save_Args returns a segment number and + 28364 ; an offset into that area, indicating where the caller may preserve its own + 28365 ; data. Note that can be found at . + 28366 ; ENTRY: + 28367 ; BX -- size (in bytes) of extra area to allocate + 28368 ; EXIT: + 28369 ; AX -- segment of new area. + 28370 ; CF -- set if unable to save a copy. + 28371 ; NOTE(S): + 28372 ; 1) The allocated area will be AT LEAST the size requested -- since + 28373 ; the underlying MSDOS call, returns an integral number of + 28374 ; paragraphs. + 28375 ; 2) It is an error if MSDOS can't allocate AT LEAST as much memory + 28376 ; as the caller of Save_Args requests. + 28377 ; 3) AX is undefined if CF indicates an error. + 28378 + 28379 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28380 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28381 ; 09/08/2024 - Retro DOS v5.0 COMMAND.COM + 28382 SAVE_ARGS: + 28383 000038B3 53 push bx + 28384 000038B4 51 push cx + 28385 000038B5 52 push dx + 28386 000038B6 57 push di + 28387 000038B7 56 push si + 28388 000038B8 55 push bp + 28389 ; 01/05/2023 + 28390 ; 26/04/2023 + 28391 ;pushf ; ** + 28392 ;;add bx,1363 ; space for arg structure, round up + 28393 ; 09/08/2024 - PCDOS 7.1 COMMAND.COM + 28394 ;add bx,1107 ; 1092+15 + 28395 000038B9 81C35304 add bx,ARG_UNIT.SIZE+15 ; 1348+15 + 28396 000038BD B104 mov cl,4 ; to paragraph size and convert + 28397 000038BF D3EB shr bx,cl ; size in bytes to size in paragraphs + 28398 000038C1 B80048 mov ax,ALLOC*256 ; 4800h + 28399 000038C4 CD21 int 21h ; DOS - 2+ - ALLOCATE MEMORY + 28400 ; BX = number of 16-byte paragraphs desired + 28401 000038C6 7241 jc short SAVE_ERROR ; *** + 28402 000038C8 89C5 mov bp,ax ; save segment id + 28403 000038CA 06 push es ; save TRANGROUP address + 28404 000038CB 8EC0 mov es,ax ; switch to new memory segment + 28405 ; assume es:nothing + 28406 ;mov cx,1348 ; get back structure size + 28407 000038CD B94404 mov cx,ARG_UNIT.SIZE ; 1092 ; 09/08/2024 + 28408 000038D0 31FF xor di,di ; destination is new memory area + 28409 ;mov si,ARG_ARGV + 28410 000038D2 BE[509F] mov si,ARG ; source is arg structure + 28411 ; 09/08/2024 + 28412 000038D5 56 push si + 28413 000038D6 F3A4 rep movsb ; move that sucker! + 28414 ;mov cx,arg.argvcnt ; adjust argv pointers + 28415 ;mov cx,[ARG_ARGVCNT] + 28416 000038D8 8B0E[10A2] mov cx,[ARG+ARG_UNIT.argvcnt] + 28417 000038DC 31C0 xor ax,ax ; base address for argv_calc + 28418 + 28419 ; Bugbug: What did they mean by this? + 28420 ; Note that the replacement line produces exactly the same code. + 28421 ;; mov SI, OFFSET TRANGROUP:arg.argbuf - OFFSET arg_unit.argbuf + 28422 ; mov SI, OFFSET TRANGROUP:arg + 28423 + 28424 ;;mov si,ARG_ARGV + 28425 ;mov si,ARG + 28426 ; 09/08/2024 + 28427 000038DE 5E pop si + 28428 SAVE_PTR_LOOP: + 28429 000038DF 49 dec cx ; exhausted all args? + 28430 000038E0 7C24 jl short SAVE_DONE + 28431 000038E2 89CB mov bx,cx ; get arg index and + 28432 000038E4 E8A9FC call argv_calc ; convert to a pointer + 28433 ;mov dx,ds:arg.argv[bx].argpointer + 28434 ;mov dx,[ARG_ARGV+bx] + 28435 000038E7 8B97[509F] mov dx,[ARG+ARGV_ELE.argpointer+bx] + 28436 000038EB 29F2 sub dx,si ; adjust argpointer + 28437 ;mov es:argv[BX].argpointer,dx + 28438 ;mov [es:bx+ARGV_ELE.argpointer],dx ; mov [es:bx+0],dx + 28439 000038ED 268917 mov [es:bx],dx + 28440 ;mov dx,ds:arg.argv[bx].argstartel + 28441 ;mov dx,[ARGV0_ARGSTARTEL+bx] + 28442 000038F0 8B97[539F] mov dx,[ARG+ARGV_ELE.argstartel+bx] + 28443 000038F4 29F2 sub dx,si ; and adjust argstartel + 28444 ;mov es:argv[bx].argstartel,dx + 28445 ;mov [es:bx+3],dx + 28446 000038F6 26895703 mov [es:bx+ARGV_ELE.argstartel],dx + 28447 ;mov dx,ds:arg.argv[bx].arg_ocomptr + 28448 ;mov dx,[ARGV0_OCOMPTR+bx] + 28449 000038FA 8B97[599F] mov dx,[ARG+ARGV_ELE.arg_ocomptr+bx] + 28450 000038FE 29F2 sub dx,si ; and adjust arg_ocomptr + 28451 ;mov es:argv[bx].arg_ocomptr,dx + 28452 ;mov [es:bx+9],dx + 28453 00003900 26895709 mov [es:bx+ARGV_ELE.arg_ocomptr],dx + 28454 00003904 EBD9 jmp short SAVE_PTR_LOOP + 28455 SAVE_DONE: + 28456 00003906 07 pop es ; back we go to TRANGROUP + 28457 ; assume es:nothing + 28458 00003907 89E8 mov ax,bp ; restore segment id + 28459 ; 26/04/2023 + 28460 ; cf = 0 ; * + 28461 ;jmp short SAVE_OK + 28462 + 28463 ; 26/04/2023 + 28464 ;SAVE_ERROR: + 28465 ; ; 26/04/2023 + 28466 ; ;popf ; ** + 28467 ; stc + 28468 ; jmp short SAVE_EXIT + 28469 + 28470 SAVE_OK: + 28471 ; 26/04/2023 + 28472 ;popf ; ** + 28473 ; 26/04/2023 + 28474 ; cf = 0 ; * + 28475 ;clc + 28476 SAVE_EXIT: + 28477 SAVE_ERROR: ; 26/04/2023 (cf=1) ; *** + 28478 00003909 5D pop bp + 28479 0000390A 5E pop si + 28480 0000390B 5F pop di + 28481 0000390C 5A pop dx + 28482 0000390D 59 pop cx + 28483 0000390E 5B pop bx + 28484 answ_no: ; 26/04/2023 + 28485 0000390F C3 retn + 28486 + 28487 ;============================================================================ + 28488 ; TUCODE.ASM, MSDOS 6.0, 1991 (1) + 28489 ;============================================================================ + 28490 ; 02/10/2018 - Retro DOS v3.0 + 28491 + 28492 ; Title COMMAND Language midifiable Code Transient + 28493 + 28494 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2843h + 28495 + 28496 ; =============== S U B R O U T I N E ======================================= + 28497 + 28498 ; **************************************************************** + 28499 ; * + 28500 ; * ROUTINE: NOTEST2 - execution of DEL/ERASE command + 28501 ; * + 28502 ; * FUNCTION: Delete files based on user parsed input. Prompt + 28503 ; * user for Y/N if necessary. If an error occurs, + 28504 ; * set up an error message and go to CERROR. 28505 ; * - 28506 ; * OUTPUT: none - 28507 ; * - 28508 ; **************************************************************** - 28509 ; - 28510 ; ARE YOU SURE prompt when deleting *.* - 28511 - 28512 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28513 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 28514 notest2: - 28515 00003910 B90B00 mov cx,11 - 28516 00003913 BE5D00 mov si,FCB+1 ; 5Dh - 28517 ambspec: - 28518 00003916 AC lodsb - 28519 00003917 3C3F cmp al,'?' - 28520 00003919 7502 jne short allfil - 28521 0000391B E2F9 loop ambspec - 28522 allfil: - 28523 ; 19/03/2023 - 28524 ;cmp cx,0 - 28525 0000391D 09C9 or cx,cx - 28526 0000391F 752E jnz short noprmpt - 28527 askagn: - 28528 00003921 BA[F190] mov dx,SureMes_Ptr ; "Are you sure (Y/N)?" - 28529 00003924 E8011B call std_printf - 28530 00003927 BE8000 mov si,80h - 28531 0000392A 89F2 mov dx,si - 28532 0000392C C7047800 mov word [si],120 ; zero length - 28533 ;mov ax,0C0Ah - 28534 00003930 B80A0C mov ax,(STD_CON_INPUT_FLUSH<<8)|Std_Con_String_Input - 28535 00003933 CD21 int 21h ; DOS - CLEAR KEYBOARD BUFFER - 28536 ; AL must be 01h,06h,07h,08h or 0Ah. - 28537 00003935 AD lodsw - 28538 00003936 08E4 or ah,ah - 28539 00003938 74E7 jz short askagn - 28540 0000393A E849F0 call scanoff - 28541 ; 19/03/2023 - 28542 ; MSDOS 6.0 - 28543 0000393D E80C02 call char_in_xlat ; Convert to upper case - 28544 ;retc ; return if function not supported - 28545 ; 19/03/2023 - 28546 ;jnc short check_yn - 28547 ;answ_no: - 28548 ;retn - 28549 00003940 72CD jc short answ_no - 28550 - 28551 ; 19/03/2023 - 28552 ; AL = 0 if it was (country depended) NO character - 28553 ; AL = 1 if it was (country depenced) YES character - 28554 - 28555 ; MSDOS 3.3 - 28556 ;call UPCONV + 28506 ; * INPUT: FCB at 5ch set up with filename(s) entered + 28507 ; * Current directory set to entered directory + 28508 ; * + 28509 ; * OUTPUT: none + 28510 ; * + 28511 ; **************************************************************** + 28512 ; + 28513 ; ARE YOU SURE prompt when deleting *.* + 28514 + 28515 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28516 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28517 notest2: + 28518 00003910 B90B00 mov cx,11 + 28519 00003913 BE5D00 mov si,FCB+1 ; 5Dh + 28520 ambspec: + 28521 00003916 AC lodsb + 28522 00003917 3C3F cmp al,'?' + 28523 00003919 7502 jne short allfil + 28524 0000391B E2F9 loop ambspec + 28525 allfil: + 28526 ; 19/03/2023 + 28527 ;cmp cx,0 + 28528 0000391D 09C9 or cx,cx + 28529 0000391F 752E jnz short noprmpt + 28530 askagn: + 28531 00003921 BA[F190] mov dx,SureMes_Ptr ; "Are you sure (Y/N)?" + 28532 00003924 E8011B call std_printf + 28533 00003927 BE8000 mov si,80h + 28534 0000392A 89F2 mov dx,si + 28535 0000392C C7047800 mov word [si],120 ; zero length + 28536 ;mov ax,0C0Ah + 28537 00003930 B80A0C mov ax,(STD_CON_INPUT_FLUSH<<8)|Std_Con_String_Input + 28538 00003933 CD21 int 21h ; DOS - CLEAR KEYBOARD BUFFER + 28539 ; AL must be 01h,06h,07h,08h or 0Ah. + 28540 00003935 AD lodsw + 28541 00003936 08E4 or ah,ah + 28542 00003938 74E7 jz short askagn + 28543 0000393A E849F0 call scanoff + 28544 ; 19/03/2023 + 28545 ; MSDOS 6.0 + 28546 0000393D E80C02 call char_in_xlat ; Convert to upper case + 28547 ;retc ; return if function not supported + 28548 ; 19/03/2023 + 28549 ;jnc short check_yn + 28550 ;answ_no: + 28551 ;retn + 28552 00003940 72CD jc short answ_no + 28553 + 28554 ; 19/03/2023 + 28555 ; AL = 0 if it was (country depended) NO character + 28556 ; AL = 1 if it was (country depenced) YES character 28557 - 28558 ; 19/03/2023 - 28559 ; MSDOS 3.3 (& MSDOS 6.0) - 28560 ;cmp al,[CAPITAL_N] - 28561 ;jne short CHECK_Y - 28562 ;retn - 28563 ;CHECK_Y: - 28564 ;cmp al,[CAPITAL_Y] - 28565 ;pushf - 28566 ;call CRLF2 - 28567 ;popf - 28568 ;jne short ASKAGN - 28569 - 28570 check_yn: - 28571 ; 19/03/2023 - 28572 ;cmp al,0 ; NO character - 28573 00003942 08C0 or al,al - 28574 00003944 74C9 jz short answ_no - 28575 ;cmp al,1 ;YES character - 28576 00003946 FEC8 dec al ; 1 -> 0 --> zf = 1 - 28577 00003948 9C pushf - 28578 00003949 E82DF0 call CRLF2 - 28579 0000394C 9D popf - 28580 0000394D 75D2 jnz short askagn - 28581 noprmpt: - 28582 0000394F B413 mov ah,FCB_Delete ; 13h - 28583 00003951 BA5C00 mov dx,FCB ; 5Ch - 28584 00003954 CD21 int 21h ; DOS - DELETE FILE via FCB - 28585 ; DS:DX -> FCB with filename field filled with - 28586 ; template for deletion ('?' wildcard allowed,but not '*') - 28587 ; Return: AL = 00h file found,FFh file not found - 28588 00003956 FEC0 inc al - 28589 00003958 7403 jz short eraerr - 28590 ; 26/04/2023 - 28591 ;call RestUDir - 28592 ;answ_no: - 28593 ;retn - 28594 0000395A E9D3EE jmp RestUDir ; 26/04/2023 - 28595 - 28596 ; 19/03/2023 - 28597 ; MSDOS 6.0 - 28598 eraerr: - 28599 ;invoke set_ext_error_msg - 28600 ;AN022; set up the extended error - 28601 0000395D E8DBE6 call Set_Ext_Error_Msg - 28602 00003960 52 push dx ;AN022; save message - 28603 ;invoke RESTUDIR - 28604 00003961 E8CCEE call RestUDir - 28605 00003964 5A pop dx ;AN022; restore message - 28606 - 28607 00003965 833E[D78F]12 cmp word [extend_buf_ptr],ERROR_NO_MORE_FILES ; 18 - 28608 ;AN022; convert no more files to - 28609 0000396A 7506 jne short cerrorj2 ;AN022; file not found - 28610 0000396C C706[D78F]0200 mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND ; 2 - 28611 ;AN000; get message number in control block - 28612 cerrorj2: - 28613 00003972 E9B1F3 jmp cerror - 28614 - 28615 ; 19/03/2023 - 28616 ; MSDOS 3.3 - 28617 ;ERAERR: - 28618 ;mov ah,Set_DMA ; 1Ah - 28619 ;mov dx,FCB ; 5Ch - 28620 ;int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 28621 ; ; DS:DX -> disk transfer buffer - 28622 ;mov ah,Dir_Search_First ; 11h - 28623 ;int 21h ; DOS - SEARCH FIRST USING FCB - 28624 ; ; DS:DX -> FCB - 28625 ;push ax - 28626 ;call RESTUDIR - 28627 ;pop ax - 28628 ;mov dx,FNOTFOUNDPTR - 28629 ;inc al - 28630 ;jz short CERRORJ - 28631 ;mov dx,ACCDENPTR - 28632 ;jmp CERROR - 28633 - 28634 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28635 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:36D4h + 28558 ; MSDOS 3.3 + 28559 ;call UPCONV + 28560 + 28561 ; 19/03/2023 + 28562 ; MSDOS 3.3 (& MSDOS 6.0) + 28563 ;cmp al,[CAPITAL_N] + 28564 ;jne short CHECK_Y + 28565 ;retn + 28566 ;CHECK_Y: + 28567 ;cmp al,[CAPITAL_Y] + 28568 ;pushf + 28569 ;call CRLF2 + 28570 ;popf + 28571 ;jne short ASKAGN + 28572 + 28573 check_yn: + 28574 ; 19/03/2023 + 28575 ;cmp al,0 ; NO character + 28576 00003942 08C0 or al,al + 28577 00003944 74C9 jz short answ_no + 28578 ;cmp al,1 ;YES character + 28579 00003946 FEC8 dec al ; 1 -> 0 --> zf = 1 + 28580 00003948 9C pushf + 28581 00003949 E82DF0 call CRLF2 + 28582 0000394C 9D popf + 28583 0000394D 75D2 jnz short askagn + 28584 noprmpt: + 28585 0000394F B413 mov ah,FCB_Delete ; 13h + 28586 00003951 BA5C00 mov dx,FCB ; 5Ch + 28587 00003954 CD21 int 21h ; DOS - DELETE FILE via FCB + 28588 ; DS:DX -> FCB with filename field filled with + 28589 ; template for deletion ('?' wildcard allowed,but not '*') + 28590 ; Return: AL = 00h file found,FFh file not found + 28591 00003956 FEC0 inc al + 28592 00003958 7403 jz short eraerr + 28593 ; 26/04/2023 + 28594 ;call RestUDir + 28595 ;answ_no: + 28596 ;retn + 28597 0000395A E9D3EE jmp RestUDir ; 26/04/2023 + 28598 + 28599 ; 19/03/2023 + 28600 ; MSDOS 6.0 + 28601 eraerr: + 28602 ;invoke set_ext_error_msg + 28603 ;AN022; set up the extended error + 28604 0000395D E8DBE6 call Set_Ext_Error_Msg + 28605 00003960 52 push dx ;AN022; save message + 28606 ;invoke RESTUDIR + 28607 00003961 E8CCEE call RestUDir + 28608 00003964 5A pop dx ;AN022; restore message + 28609 + 28610 00003965 833E[D78F]12 cmp word [extend_buf_ptr],ERROR_NO_MORE_FILES ; 18 + 28611 ;AN022; convert no more files to + 28612 0000396A 7506 jne short cerrorj2 ;AN022; file not found + 28613 0000396C C706[D78F]0200 mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND ; 2 + 28614 ;AN000; get message number in control block + 28615 cerrorj2: + 28616 00003972 E9B1F3 jmp cerror + 28617 + 28618 ; 19/03/2023 + 28619 ; MSDOS 3.3 + 28620 ;ERAERR: + 28621 ;mov ah,Set_DMA ; 1Ah + 28622 ;mov dx,FCB ; 5Ch + 28623 ;int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 28624 ; ; DS:DX -> disk transfer buffer + 28625 ;mov ah,Dir_Search_First ; 11h + 28626 ;int 21h ; DOS - SEARCH FIRST USING FCB + 28627 ; ; DS:DX -> FCB + 28628 ;push ax + 28629 ;call RESTUDIR + 28630 ;pop ax + 28631 ;mov dx,FNOTFOUNDPTR + 28632 ;inc al + 28633 ;jz short CERRORJ + 28634 ;mov dx,ACCDENPTR + 28635 ;jmp CERROR 28636 - 28637 ; **************************************************************** - 28638 ; * - 28639 ; * ROUTINE: SLASHP_ERASE - execution of DEL/ERASE /P - 28640 ; * - 28641 ; * FUNCTION: Delete files based on user parsed input. Prompt - 28642 ; * user for Y/N where necessary. If an error occurs - 28643 ; * set up and error message and transfer control - 28644 ; * to CERROR. - 28645 ; * - 28646 ; * INPUT: FCB at 5Ch set up with filename(s) entered - 28647 ; * Current directory set to entered directory + 28637 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28638 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:36D4h + 28639 + 28640 ; **************************************************************** + 28641 ; * + 28642 ; * ROUTINE: SLASHP_ERASE - execution of DEL/ERASE /P + 28643 ; * + 28644 ; * FUNCTION: Delete files based on user parsed input. Prompt + 28645 ; * user for Y/N where necessary. If an error occurs + 28646 ; * set up and error message and transfer control + 28647 ; * to CERROR. 28648 ; * - 28649 ; * OUTPUT: none - 28650 ; * - 28651 ; **************************************************************** - 28652 - 28653 ; 19/03/2023 - 28654 slashp_erase: ;AN000; entry point - 28655 ;invoke build_dir_string ;AN000; set up current directory string for output - 28656 00003975 E885E8 call build_dir_string - 28657 - 28658 00003978 B41A mov ah,Set_DMA ; 1Ah ;AN000; issue set dta int 21h - 28659 ;mov dx,offset trangroup:destdir - 28660 0000397A BA[F69C] mov dx,DESTDIR ;AN000; use Destdir for target - 28661 0000397D CD21 int 21h ;AN000; - 28662 - 28663 ;mov ah,11h - 28664 0000397F B411 mov ah,Dir_Search_First ;AN000; do dir search first int 21h - 28665 00003981 BA5C00 mov dx,FCB ; 5Ch ;AN000; use FCB at 5Ch for target - 28666 00003984 CD21 int 21h ;AN000; - 28667 00003986 FEC0 inc al ;AN000; did an error occur - 28668 ;jz short eraerr ;AN022; go to error exit - 28669 ; 26/04/2023 - 28670 00003988 7502 jnz short delete_prompt_loop - 28671 + 28649 ; * INPUT: FCB at 5Ch set up with filename(s) entered + 28650 ; * Current directory set to entered directory + 28651 ; * + 28652 ; * OUTPUT: none + 28653 ; * + 28654 ; **************************************************************** + 28655 + 28656 ; 19/03/2023 + 28657 slashp_erase: ;AN000; entry point + 28658 ;invoke build_dir_string ;AN000; set up current directory string for output + 28659 00003975 E885E8 call build_dir_string + 28660 + 28661 00003978 B41A mov ah,Set_DMA ; 1Ah ;AN000; issue set dta int 21h + 28662 ;mov dx,offset trangroup:destdir + 28663 0000397A BA[F69C] mov dx,DESTDIR ;AN000; use Destdir for target + 28664 0000397D CD21 int 21h ;AN000; + 28665 + 28666 ;mov ah,11h + 28667 0000397F B411 mov ah,Dir_Search_First ;AN000; do dir search first int 21h + 28668 00003981 BA5C00 mov dx,FCB ; 5Ch ;AN000; use FCB at 5Ch for target + 28669 00003984 CD21 int 21h ;AN000; + 28670 00003986 FEC0 inc al ;AN000; did an error occur + 28671 ;jz short eraerr ;AN022; go to error exit 28672 ; 26/04/2023 - 28673 stop_del: - 28674 0000398A EBD1 jmp short eraerr ;AN022; go to error exit - need long jmp - 28675 - 28676 delete_prompt_loop: ;AN000; - 28677 ;mov si,offset trangroup:destdir+1 - 28678 0000398C BE[F79C] mov si,DESTDIR+1 ;AN000; set up FCB as source - 28679 ;mov di,offset trangroup:dest - 28680 0000398F BF[C69C] mov di,DEST ;AN000; set up dest as target - 28681 00003992 A0[FA9B] mov al,[DIRCHAR] ;AN000; store a "\" in the first char - 28682 00003995 AA stosb ;AN000; of DEST - 28683 ;invoke FCB_TO_ASCZ ;AN000; convert filename from FCB to ASCIIZ string - 28684 00003996 E80CF0 call FCB_TO_ASCZ - 28685 - 28686 slashp_askagn: ;AN000; - 28687 00003999 E8DDEF call CRLF2 ;AN000; print out carriage return, line feed - 28688 ;mov dx,offset trangroup:bwdbuf - 28689 0000399C BA[399D] mov dx,BWDBUF ;AN000; print out current directory string - 28690 0000399F 89D3 mov bx,dx ;AN000; get string pointer in bx - 28691 000039A1 807F0300 cmp byte [bx+3],END_OF_LINE_OUT ; 0 - 28692 ;AN000; see if only D:\,0 - 28693 000039A5 7504 jnz short not_del_root ;AN000; no continue - 28694 000039A7 C6470200 mov byte [bx+2],END_OF_LINE_OUT ; 0 - 28695 ;AN000; yes, get rid of \ ; - 28696 not_del_root: ;AN000; - 28697 000039AB 8916[A09D] mov [string_ptr_2],dx ;AN000; - 28698 ;mov dx,offset trangroup:string_buf_ptr - 28699 000039AF BA[DF91] mov dx,string_buf_ptr ;AN000; - 28700 ;invoke std_printf ;AN000; - 28701 000039B2 E8731A call std_printf - 28702 ;mov dx,offset trangroup:dest - 28703 000039B5 BA[C69C] mov dx,DEST ;AN000; print out file name string - 28704 000039B8 8916[A09D] mov [string_ptr_2],dx ;AN000; - 28705 ;mov dx,offset trangroup:string_buf_ptr - 28706 000039BC BA[DF91] mov dx,string_buf_ptr ;AN000; - 28707 ;invoke std_printf ;AN000; - 28708 000039BF E8661A call std_printf - 28709 ;mov dx,offset trangroup:Del_Y_N_Ptr - 28710 000039C2 BA[EE90] mov dx,Del_Y_N_Ptr ;AN000; issue ", Delete (Y/N)?" message - 28711 ;invoke std_printf ;AN000; - 28712 000039C5 E8601A call std_printf - 28713 - 28714 ;;M029 mov si,80H ;AN000; set up buffer for input - 28715 ;;M029 mov dx,si ;AN000; - 28716 ;;M029 mov word ptr [si],combuflen ;AN000; - 28717 ;;M029 mov ax,(std_con_input_flush shl 8) or std_con_string_input ;AN000; - 28718 ;;M029 int 21h ;AN000; get input from the user - 28719 ;;M029 lodsw ;AN000; - 28720 ;;M029 or ah,ah ;AN000; was a character entered? - 28721 ;;M029 jz short slashp_askagn ;AN000; no - ask again - 28722 ;;M029 invoke scanoff ;AN000; scan off leading delimiters - 28723 - 28724 ; Get a single character input. - 28725 - 28726 ;;mov ax,(STD_CON_INPUT_FLUSH shl 8) or STD_CON_INPUT ;M029 - 28727 ;mov ax,(STD_CON_INPUT_FLUSH<<8)|STD_CON_INPUT - 28728 000039C8 B8010C mov ax,0C01h - 28729 000039CB CD21 int 21h ;M029 - 28730 - 28731 000039CD E87C01 call char_in_xlat ;AN000; yes - upper case it - 28732 ;retc ;AN000; return if function not supported - 28733 ; 19/03/2023 - 28734 000039D0 7301 jnc short slashp_check_yn - 28735 slashp_ans_no: - 28736 000039D2 C3 retn - 28737 - 28738 slashp_check_yn: - 28739 ; 19/03/2023 - 28740 ; AL = 0 if it was (country depended) NO character - 28741 ; AL = 1 if it was (country depenced) YES character - 28742 - 28743 ;cmp al,capital_n ;AN000; was it no? - 28744 ;cmp al,0 - 28745 000039D3 20C0 and al,al ; 0 - 28746 000039D5 7420 jz short next_del_file ;AN000; yes - don't delete file - 28747 ;cmp al,capital_y ;AN000; was it yes? - 28748 ;cmp al,1 - 28749 000039D7 FEC8 dec al ; 1-> 0 --> zf = 1 - 28750 ;jz short delete_this_file ;AN000; yes - delete the file - 28751 ;jmp short slashp_askagn ;AN000; it was neither - ask again - 28752 ; 19/03/2023 - 28753 000039D9 75BE jnz short slashp_askagn - 28754 - 28755 delete_this_file: ;AN000; - 28756 000039DB B413 mov ah,FCB_Delete ; 13h ;AN000; delete the file - 28757 ;mov dx,offset trangroup:destdir - 28758 000039DD BA[F69C] mov dx,DESTDIR ;AN000; use Destdir for target - 28759 000039E0 CD21 int 21h ;AN000; - 28760 000039E2 FEC0 inc al ;AN000; did an error occur? - 28761 000039E4 7511 jnz short next_del_file ;AN000; no - get next file - 28762 ; - 28763 ;M041; Begin changes - 28764 ; We got an error deleting the file. If this is access denied, we can go on - 28765 ;to the next file after printing an error message. - 28766 ; - 28767 ;invoke Get_ext_error_number ;see what error we got - 28768 000039E6 E862E6 call get_ext_error_number - 28769 000039E9 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 - 28770 ;is it access denied? - 28771 000039EC 759C jne short stop_del ;no, some other error - 28772 ;invoke CrLf2 ;print a CR-LF - 28773 000039EE E888EF call CRLF2 - 28774 ;invoke set_ext_error_msg ;error message - 28775 000039F1 E847E6 call Set_Ext_Error_Msg - 28776 ;invoke std_eprintf ;"Access denied" - 28777 000039F4 E8291A call std_eprintf - 28778 ; 26/04/2023 - 28779 ;jmp short next_del_file ;try next file - 28780 ; 26/04/2023 - 28781 ;stop_del: - 28782 ;; - 28783 ;;M041; End changes - 28784 ;; - 28785 ; jmp eraerr ;AN022; go to error exit - need long jmp - 28786 - 28787 next_del_file: ;AN000; - 28788 ; - 28789 ; M050 - begin - 28790 ; Norton Utilities 5.0 has a bug. DiskMon when invoked - 28791 ; with /protect+ and /light+ makes it intercept all - 28792 ; deletes. This hook does not save and restore the DTA correctly. - 28793 ; They save the DWORD in a WORD by mistake! They save both the - 28794 ; segment and the offset in the SAME variable (WORD)!!! - 28795 ; - 28796 000039F7 B41A mov ah,Set_DMA ; 1Ah - 28797 ;mov dx,offset trangroup:destdir - 28798 000039F9 BA[F69C] mov dx,DESTDIR - 28799 000039FC CD21 int 21h - 28800 ; - 28801 ; M050 - end - 28802 - 28803 000039FE B412 mov ah,Dir_Search_Next ; 12h - 28804 ;AN000; search for another file - 28805 00003A00 BA5C00 mov dx,FCB ; 5Ch ;AN000; - 28806 00003A03 CD21 int 21h ;AN000; - 28807 00003A05 FEC0 inc al ;AN000; was a file found? - 28808 ;jz short slash_p_exit ;AN000; no - exit - 28809 ;jmp delete_prompt_loop ;AN000; yes - continue (need long jump) - 28810 ; 26/04/2023 - 28811 00003A07 7583 jnz short delete_prompt_loop - 28812 - 28813 slash_p_exit: - 28814 ;invoke get_ext_error_number ;AN022; get the extended error number - 28815 00003A09 E83FE6 call get_ext_error_number - 28816 00003A0C 83F812 cmp ax,ERROR_NO_MORE_FILES ;AN022; was error file not found? - 28817 00003A0F 7403 jz short good_erase_exit ;AN022; yes - clean exit - 28818 00003A11 E96CE3 jmp extend_setup ;AN022; go issue error message - 28819 - 28820 good_erase_exit: - 28821 ;invoke restudir ;AN000; we're finished - restore user's dir - 28822 00003A14 E819EE call RestUDir - 28823 ;call CRLF2 ;AN000; print out carriage return, line feed - 28824 ;retn ;AN000; exit - 28825 ; 19/03/2023 - 28826 00003A17 E95FEF jmp CRLF2 - 28827 - 28828 ; =============== S U B R O U T I N E ======================================= - 28829 - 28830 ; ECHO, BREAK, and VERIFY commands. Check for "ON" and "OFF" - 28831 - 28832 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 28833 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 28834 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM - 28835 _ECHO: - 28836 00003A1A E89900 call ON_OFF - 28837 00003A1D 7212 jb short DOEMES - 28838 00003A1F 8E1E[F59B] mov ds,[RESSEG] - 28839 00003A23 7506 jnz short ECH_OFF - 28840 00003A25 800E[9D02]01 or byte [EchoFlag],1 - 28841 00003A2A C3 retn - 28842 - 28843 ECH_OFF: - 28844 00003A2B 8026[9D02]FE and byte [EchoFlag],0FEh - 28845 00003A30 C3 retn - 28846 - 28847 ; 19/03/2023 - 28848 ; MSDOS 6.0 (& MSDOS 5.0) - 28849 ;CERRORJ: - 28850 ;jmp cerror - 28851 - 28852 ; There was no discrenable ON or OFF after the ECHO. If there is nothing but - 28853 ; delimiters on the command line, we issue the ECHO is ON/OFF message. + 28673 00003988 7502 jnz short delete_prompt_loop + 28674 + 28675 ; 26/04/2023 + 28676 stop_del: + 28677 0000398A EBD1 jmp short eraerr ;AN022; go to error exit - need long jmp + 28678 + 28679 delete_prompt_loop: ;AN000; + 28680 ;mov si,offset trangroup:destdir+1 + 28681 0000398C BE[F79C] mov si,DESTDIR+1 ;AN000; set up FCB as source + 28682 ;mov di,offset trangroup:dest + 28683 0000398F BF[C69C] mov di,DEST ;AN000; set up dest as target + 28684 00003992 A0[FA9B] mov al,[DIRCHAR] ;AN000; store a "\" in the first char + 28685 00003995 AA stosb ;AN000; of DEST + 28686 ;invoke FCB_TO_ASCZ ;AN000; convert filename from FCB to ASCIIZ string + 28687 00003996 E80CF0 call FCB_TO_ASCZ + 28688 + 28689 slashp_askagn: ;AN000; + 28690 00003999 E8DDEF call CRLF2 ;AN000; print out carriage return, line feed + 28691 ;mov dx,offset trangroup:bwdbuf + 28692 0000399C BA[399D] mov dx,BWDBUF ;AN000; print out current directory string + 28693 0000399F 89D3 mov bx,dx ;AN000; get string pointer in bx + 28694 000039A1 807F0300 cmp byte [bx+3],END_OF_LINE_OUT ; 0 + 28695 ;AN000; see if only D:\,0 + 28696 000039A5 7504 jnz short not_del_root ;AN000; no continue + 28697 000039A7 C6470200 mov byte [bx+2],END_OF_LINE_OUT ; 0 + 28698 ;AN000; yes, get rid of \ ; + 28699 not_del_root: ;AN000; + 28700 000039AB 8916[A09D] mov [string_ptr_2],dx ;AN000; + 28701 ;mov dx,offset trangroup:string_buf_ptr + 28702 000039AF BA[DF91] mov dx,string_buf_ptr ;AN000; + 28703 ;invoke std_printf ;AN000; + 28704 000039B2 E8731A call std_printf + 28705 ;mov dx,offset trangroup:dest + 28706 000039B5 BA[C69C] mov dx,DEST ;AN000; print out file name string + 28707 000039B8 8916[A09D] mov [string_ptr_2],dx ;AN000; + 28708 ;mov dx,offset trangroup:string_buf_ptr + 28709 000039BC BA[DF91] mov dx,string_buf_ptr ;AN000; + 28710 ;invoke std_printf ;AN000; + 28711 000039BF E8661A call std_printf + 28712 ;mov dx,offset trangroup:Del_Y_N_Ptr + 28713 000039C2 BA[EE90] mov dx,Del_Y_N_Ptr ;AN000; issue ", Delete (Y/N)?" message + 28714 ;invoke std_printf ;AN000; + 28715 000039C5 E8601A call std_printf + 28716 + 28717 ;;M029 mov si,80H ;AN000; set up buffer for input + 28718 ;;M029 mov dx,si ;AN000; + 28719 ;;M029 mov word ptr [si],combuflen ;AN000; + 28720 ;;M029 mov ax,(std_con_input_flush shl 8) or std_con_string_input ;AN000; + 28721 ;;M029 int 21h ;AN000; get input from the user + 28722 ;;M029 lodsw ;AN000; + 28723 ;;M029 or ah,ah ;AN000; was a character entered? + 28724 ;;M029 jz short slashp_askagn ;AN000; no - ask again + 28725 ;;M029 invoke scanoff ;AN000; scan off leading delimiters + 28726 + 28727 ; Get a single character input. + 28728 + 28729 ;;mov ax,(STD_CON_INPUT_FLUSH shl 8) or STD_CON_INPUT ;M029 + 28730 ;mov ax,(STD_CON_INPUT_FLUSH<<8)|STD_CON_INPUT + 28731 000039C8 B8010C mov ax,0C01h + 28732 000039CB CD21 int 21h ;M029 + 28733 + 28734 000039CD E87C01 call char_in_xlat ;AN000; yes - upper case it + 28735 ;retc ;AN000; return if function not supported + 28736 ; 19/03/2023 + 28737 000039D0 7301 jnc short slashp_check_yn + 28738 slashp_ans_no: + 28739 000039D2 C3 retn + 28740 + 28741 slashp_check_yn: + 28742 ; 19/03/2023 + 28743 ; AL = 0 if it was (country depended) NO character + 28744 ; AL = 1 if it was (country depenced) YES character + 28745 + 28746 ;cmp al,capital_n ;AN000; was it no? + 28747 ;cmp al,0 + 28748 000039D3 20C0 and al,al ; 0 + 28749 000039D5 7420 jz short next_del_file ;AN000; yes - don't delete file + 28750 ;cmp al,capital_y ;AN000; was it yes? + 28751 ;cmp al,1 + 28752 000039D7 FEC8 dec al ; 1-> 0 --> zf = 1 + 28753 ;jz short delete_this_file ;AN000; yes - delete the file + 28754 ;jmp short slashp_askagn ;AN000; it was neither - ask again + 28755 ; 19/03/2023 + 28756 000039D9 75BE jnz short slashp_askagn + 28757 + 28758 delete_this_file: ;AN000; + 28759 000039DB B413 mov ah,FCB_Delete ; 13h ;AN000; delete the file + 28760 ;mov dx,offset trangroup:destdir + 28761 000039DD BA[F69C] mov dx,DESTDIR ;AN000; use Destdir for target + 28762 000039E0 CD21 int 21h ;AN000; + 28763 000039E2 FEC0 inc al ;AN000; did an error occur? + 28764 000039E4 7511 jnz short next_del_file ;AN000; no - get next file + 28765 ; + 28766 ;M041; Begin changes + 28767 ; We got an error deleting the file. If this is access denied, we can go on + 28768 ;to the next file after printing an error message. + 28769 ; + 28770 ;invoke Get_ext_error_number ;see what error we got + 28771 000039E6 E862E6 call get_ext_error_number + 28772 000039E9 83F805 cmp ax,ERROR_ACCESS_DENIED ; 5 + 28773 ;is it access denied? + 28774 000039EC 759C jne short stop_del ;no, some other error + 28775 ;invoke CrLf2 ;print a CR-LF + 28776 000039EE E888EF call CRLF2 + 28777 ;invoke set_ext_error_msg ;error message + 28778 000039F1 E847E6 call Set_Ext_Error_Msg + 28779 ;invoke std_eprintf ;"Access denied" + 28780 000039F4 E8291A call std_eprintf + 28781 ; 26/04/2023 + 28782 ;jmp short next_del_file ;try next file + 28783 ; 26/04/2023 + 28784 ;stop_del: + 28785 ;; + 28786 ;;M041; End changes + 28787 ;; + 28788 ; jmp eraerr ;AN022; go to error exit - need long jmp + 28789 + 28790 next_del_file: ;AN000; + 28791 ; + 28792 ; M050 - begin + 28793 ; Norton Utilities 5.0 has a bug. DiskMon when invoked + 28794 ; with /protect+ and /light+ makes it intercept all + 28795 ; deletes. This hook does not save and restore the DTA correctly. + 28796 ; They save the DWORD in a WORD by mistake! They save both the + 28797 ; segment and the offset in the SAME variable (WORD)!!! + 28798 ; + 28799 000039F7 B41A mov ah,Set_DMA ; 1Ah + 28800 ;mov dx,offset trangroup:destdir + 28801 000039F9 BA[F69C] mov dx,DESTDIR + 28802 000039FC CD21 int 21h + 28803 ; + 28804 ; M050 - end + 28805 + 28806 000039FE B412 mov ah,Dir_Search_Next ; 12h + 28807 ;AN000; search for another file + 28808 00003A00 BA5C00 mov dx,FCB ; 5Ch ;AN000; + 28809 00003A03 CD21 int 21h ;AN000; + 28810 00003A05 FEC0 inc al ;AN000; was a file found? + 28811 ;jz short slash_p_exit ;AN000; no - exit + 28812 ;jmp delete_prompt_loop ;AN000; yes - continue (need long jump) + 28813 ; 26/04/2023 + 28814 00003A07 7583 jnz short delete_prompt_loop + 28815 + 28816 slash_p_exit: + 28817 ;invoke get_ext_error_number ;AN022; get the extended error number + 28818 00003A09 E83FE6 call get_ext_error_number + 28819 00003A0C 83F812 cmp ax,ERROR_NO_MORE_FILES ;AN022; was error file not found? + 28820 00003A0F 7403 jz short good_erase_exit ;AN022; yes - clean exit + 28821 00003A11 E96CE3 jmp extend_setup ;AN022; go issue error message + 28822 + 28823 good_erase_exit: + 28824 ;invoke restudir ;AN000; we're finished - restore user's dir + 28825 00003A14 E819EE call RestUDir + 28826 ;call CRLF2 ;AN000; print out carriage return, line feed + 28827 ;retn ;AN000; exit + 28828 ; 19/03/2023 + 28829 00003A17 E95FEF jmp CRLF2 + 28830 + 28831 ; =============== S U B R O U T I N E ======================================= + 28832 + 28833 ; ECHO, BREAK, and VERIFY commands. Check for "ON" and "OFF" + 28834 + 28835 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 28836 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 28837 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM + 28838 _ECHO: + 28839 00003A1A E89900 call ON_OFF + 28840 00003A1D 7212 jb short DOEMES + 28841 00003A1F 8E1E[F59B] mov ds,[RESSEG] + 28842 00003A23 7506 jnz short ECH_OFF + 28843 00003A25 800E[9D02]01 or byte [EchoFlag],1 + 28844 00003A2A C3 retn + 28845 + 28846 ECH_OFF: + 28847 00003A2B 8026[9D02]FE and byte [EchoFlag],0FEh + 28848 00003A30 C3 retn + 28849 + 28850 ; 19/03/2023 + 28851 ; MSDOS 6.0 (& MSDOS 5.0) + 28852 ;CERRORJ: + 28853 ;jmp cerror 28854 - 28855 DOEMES: - 28856 ; 19/03/2023 - 28857 ; MSDOS 6.0 - 28858 ;cmp cl,0 ;AC000; was anything on the line? - 28859 00003A31 20C9 and cl,cl - 28860 00003A33 7409 jz short PECHO ; just display current state. - 28861 00003A35 BA8200 mov dx,82h ; Skip one char after "ECHO" - 28862 00003A38 E897EF call CRPRINT - 28863 00003A3B E93BEF jmp CRLF2 - 28864 - 28865 ; 19/03/2023 - 28866 ; MSDOS 3.3 - 28867 ;call MOVE_TO_FIRST_ARG - 28868 ;jz short PECHO - 28869 ;mov dx,82h - 28870 ;call CRPRINT - 28871 ;jmp CRLF2 - 28872 - 28873 PECHO: - 28874 ; MSDOS 3.3 (& MSDOS 6.0) - 28875 00003A3E 8E1E[F59B] mov ds,[RESSEG] - 28876 00003A42 8A1E[9D02] mov bl,[EchoFlag] - 28877 00003A46 0E push cs - 28878 00003A47 1F pop ds - 28879 00003A48 80E301 and bl,1 - 28880 00003A4B BA[7F91] mov dx,EchoMes_Ptr - 28881 00003A4E EB24 jmp short PYN - 28882 - 28883 ; --------------------------------------------------------------------------- - 28884 - 28885 ; 19/03/2023 - 28886 ; MSDOS 3.3 - 28887 CERRORJ: - 28888 00003A50 E9D3F2 jmp cerror - 28889 - 28890 ; =============== S U B R O U T I N E ======================================= - 28891 - 28892 ; 19/03/2023 - 28893 ; MSDOS 3.3 - 28894 ;MOVE_TO_FIRST_ARG: - 28895 ;mov si,81h - 28896 ;call SCANOFF - 28897 ;cmp al,0Dh - 28898 ;retn - 28899 - 28900 ; =============== S U B R O U T I N E ======================================= - 28901 - 28902 CNTRLC: - 28903 00003A53 E86000 call ON_OFF - 28904 00003A56 B80133 mov ax,(Set_CTRL_C_Trapping<<8)|1 ; 3301h - 28905 00003A59 720C jc short PCNTRLC - 28906 00003A5B 7505 jnz short CNTRLC_OFF - 28907 00003A5D B201 mov dl,1 - 28908 00003A5F CD21 int 21h ; DOS - EXTENDED CONTROL-BREAK CHECKING - 28909 ; AL = 00h get state / 01h set state / 02h set AND get - 28910 ; DL = 00h for OFF or 01h for ON - 28911 00003A61 C3 retn - 28912 - 28913 ; --------------------------------------------------------------------------- - 28914 - 28915 CNTRLC_OFF: - 28916 00003A62 30D2 xor dl,dl - 28917 00003A64 CD21 int 21h ; Turn off ^C check - 28918 00003A66 C3 retn - 28919 - 28920 ; --------------------------------------------------------------------------- - 28921 - 28922 PCNTRLC: - 28923 ; 19/03/2023 - 28924 ; MSDOS 6.0 - 28925 ;cmp cl,0 ;AC000; rest of line blank? - 28926 00003A67 08C9 or cl,cl - 28927 00003A69 75E5 jnz short CERRORJ ; no, oops! - 28928 - 28929 ; 19/03/2023 - 28930 ; MSDOS 3.3 - 28931 ;call MOVE_TO_FIRST_ARG - 28932 ;jnz short CERRORJ - 28933 ;pccont: - 28934 ; MSDOS 3.3 (& MSDOS 6.0) - 28935 00003A6B 30C0 xor al,al - 28936 00003A6D CD21 int 21h ; get Ctrl-Break state (ah=33h) - 28937 00003A6F 88D3 mov bl,dl - 28938 00003A71 BA[6391] mov dx,CtrlcMes_Ptr - 28939 - 28940 ; --------------------------------------------------------------------------- - 28941 - 28942 PYN: ; write "ON" or "OFF" state - 28943 - 28944 ; 26/04/2023 - 28945 ; 19/03/2023 - 28946 ; MSDOS 3.3 - 28947 ;call STD_PRINTF - 28948 ;mov dx,ONMES_PTR ;AC000; get ON pointer - 28949 ;or bl,bl - 28950 ;jnz short PRINTVAL - 28951 ;mov dx,OFFMES_PTR ;AC000; get OFF pointer - 28952 - 28953 ; 26/04/2023 - 28954 ; 19/03/2023 - 28955 ; MSDOS 6.0 - 28956 00003A74 BE[9091] mov si,ONMES_PTR - 28957 00003A77 08DB or bl,bl - 28958 00003A79 7503 jnz short PRINTVAL - 28959 00003A7B BE[8D91] mov si,OFFMES_PTR - 28960 PRINTVAL: - 28961 ; 19/03/2023 - 28962 ; MSDOS 3.3 - 28963 ;jmp STD_PRINTF - 28964 - 28965 ; 19/03/2023 - 28966 ; MSDOS 6.0 - 28967 00003A7E 52 push dx ;AN000; save offset of message block - 28968 00003A7F 89D3 mov bx,dx ;AN000; save offset value - 28969 00003A81 AD lodsw ;AN000; get message number of on or off - 28970 00003A82 B6FF mov dh,util_msg_class ; -1 ; 0FFh - 28971 ;AN000; this is a utility message - 28972 00003A84 E8841A call TSYSGETMSG ;AN000; get the address of the message - 28973 ;add bx,5 - 28974 00003A87 83C305 add bx,Ptr_off_pos ;AN000; point to offset of ON/OFF - 28975 - 28976 00003A8A 8937 mov [bx],si ;AN000; put the offset in the message block - 28977 00003A8C 5A pop dx ;AN000; get message back - 28978 00003A8D E89819 call std_printf ;AC000; go print message - 28979 00003A90 C7070000 mov word [bx],0 ;AN000; zero out message pointer - 28980 00003A94 C3 retn ;AN000; exit - 28981 - 28982 ; =============== S U B R O U T I N E ======================================= - 28983 - 28984 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.CO - 28985 VERIFY: - 28986 00003A95 E81E00 call ON_OFF - 28987 00003A98 B8012E mov ax,(SET_VERIFY_ON_WRITE<<8)|1 ; 2E01h - 28988 00003A9B 720A jc short PVERIFY - 28989 00003A9D 7503 jnz short VER_OFF - 28990 00003A9F CD21 int 21h ; DOS - SET VERIFY FLAG - 28991 ; DL = 00h,AL = 01h VERIFY on / 00h VERIFY off - 28992 00003AA1 C3 retn - 28993 - 28994 ; --------------------------------------------------------------------------- - 28995 - 28996 VER_OFF: - 28997 00003AA2 FEC8 dec al - 28998 00003AA4 CD21 int 21h ; Turn off verify after write - 28999 00003AA6 C3 retn - 29000 - 29001 ; --------------------------------------------------------------------------- - 29002 - 29003 PVERIFY: - 29004 ; 19/03/2023 - 29005 ; MSDOS 6.0 - 29006 ;cmp cl,0 ;AC000; is rest of line blank? - 29007 00003AA7 20C9 and cl,cl - 29008 00003AA9 75A5 jnz short CERRORJ ; nope... - 29009 - 29010 ;19/03/2023 - 29011 ; MSDOS 3.3 - 29012 ;call MOVE_TO_FIRST_ARG - 29013 ;jnz short CERRORJ - 29014 - 29015 00003AAB B454 mov ah,Get_Verify_On_Write ; 54h - 29016 00003AAD CD21 int 21h ; DOS - 2+ - GET VERIFY FLAG - 29017 ; Return: AL = 00h if flag OFF - 29018 ; AL = 01h if flag ON - 29019 00003AAF 88C3 mov bl,al - 29020 00003AB1 BA[7191] mov dx,VeriMes_Ptr - 29021 00003AB4 EBBE jmp short PYN - 29022 - 29023 ; =============== S U B R O U T I N E ======================================= - 29024 - 29025 ; **************************************************************** - 29026 ; * - 29027 ; * ROUTINE: ON_OFF - 29028 ; * - 29029 ; * FUNCTION: Parse the command line for an optional ON or - 29030 ; * OFF string for the BREAK, VERIFY, and ECHO - 29031 ; * routines. - 29032 ; * - 29033 ; * INPUT: command line at offset 81H - 29034 ; * PARSE_BREAK control block + 28855 ; There was no discrenable ON or OFF after the ECHO. If there is nothing but + 28856 ; delimiters on the command line, we issue the ECHO is ON/OFF message. + 28857 + 28858 DOEMES: + 28859 ; 19/03/2023 + 28860 ; MSDOS 6.0 + 28861 ;cmp cl,0 ;AC000; was anything on the line? + 28862 00003A31 20C9 and cl,cl + 28863 00003A33 7409 jz short PECHO ; just display current state. + 28864 00003A35 BA8200 mov dx,82h ; Skip one char after "ECHO" + 28865 00003A38 E897EF call CRPRINT + 28866 00003A3B E93BEF jmp CRLF2 + 28867 + 28868 ; 19/03/2023 + 28869 ; MSDOS 3.3 + 28870 ;call MOVE_TO_FIRST_ARG + 28871 ;jz short PECHO + 28872 ;mov dx,82h + 28873 ;call CRPRINT + 28874 ;jmp CRLF2 + 28875 + 28876 PECHO: + 28877 ; MSDOS 3.3 (& MSDOS 6.0) + 28878 00003A3E 8E1E[F59B] mov ds,[RESSEG] + 28879 00003A42 8A1E[9D02] mov bl,[EchoFlag] + 28880 00003A46 0E push cs + 28881 00003A47 1F pop ds + 28882 00003A48 80E301 and bl,1 + 28883 00003A4B BA[7F91] mov dx,EchoMes_Ptr + 28884 00003A4E EB24 jmp short PYN + 28885 + 28886 ; --------------------------------------------------------------------------- + 28887 + 28888 ; 19/03/2023 + 28889 ; MSDOS 3.3 + 28890 CERRORJ: + 28891 00003A50 E9D3F2 jmp cerror + 28892 + 28893 ; =============== S U B R O U T I N E ======================================= + 28894 + 28895 ; 19/03/2023 + 28896 ; MSDOS 3.3 + 28897 ;MOVE_TO_FIRST_ARG: + 28898 ;mov si,81h + 28899 ;call SCANOFF + 28900 ;cmp al,0Dh + 28901 ;retn + 28902 + 28903 ; =============== S U B R O U T I N E ======================================= + 28904 + 28905 CNTRLC: + 28906 00003A53 E86000 call ON_OFF + 28907 00003A56 B80133 mov ax,(Set_CTRL_C_Trapping<<8)|1 ; 3301h + 28908 00003A59 720C jc short PCNTRLC + 28909 00003A5B 7505 jnz short CNTRLC_OFF + 28910 00003A5D B201 mov dl,1 + 28911 00003A5F CD21 int 21h ; DOS - EXTENDED CONTROL-BREAK CHECKING + 28912 ; AL = 00h get state / 01h set state / 02h set AND get + 28913 ; DL = 00h for OFF or 01h for ON + 28914 00003A61 C3 retn + 28915 + 28916 ; --------------------------------------------------------------------------- + 28917 + 28918 CNTRLC_OFF: + 28919 00003A62 30D2 xor dl,dl + 28920 00003A64 CD21 int 21h ; Turn off ^C check + 28921 00003A66 C3 retn + 28922 + 28923 ; --------------------------------------------------------------------------- + 28924 + 28925 PCNTRLC: + 28926 ; 19/03/2023 + 28927 ; MSDOS 6.0 + 28928 ;cmp cl,0 ;AC000; rest of line blank? + 28929 00003A67 08C9 or cl,cl + 28930 00003A69 75E5 jnz short CERRORJ ; no, oops! + 28931 + 28932 ; 19/03/2023 + 28933 ; MSDOS 3.3 + 28934 ;call MOVE_TO_FIRST_ARG + 28935 ;jnz short CERRORJ + 28936 ;pccont: + 28937 ; MSDOS 3.3 (& MSDOS 6.0) + 28938 00003A6B 30C0 xor al,al + 28939 00003A6D CD21 int 21h ; get Ctrl-Break state (ah=33h) + 28940 00003A6F 88D3 mov bl,dl + 28941 00003A71 BA[6391] mov dx,CtrlcMes_Ptr + 28942 + 28943 ; --------------------------------------------------------------------------- + 28944 + 28945 PYN: ; write "ON" or "OFF" state + 28946 + 28947 ; 26/04/2023 + 28948 ; 19/03/2023 + 28949 ; MSDOS 3.3 + 28950 ;call STD_PRINTF + 28951 ;mov dx,ONMES_PTR ;AC000; get ON pointer + 28952 ;or bl,bl + 28953 ;jnz short PRINTVAL + 28954 ;mov dx,OFFMES_PTR ;AC000; get OFF pointer + 28955 + 28956 ; 26/04/2023 + 28957 ; 19/03/2023 + 28958 ; MSDOS 6.0 + 28959 00003A74 BE[9091] mov si,ONMES_PTR + 28960 00003A77 08DB or bl,bl + 28961 00003A79 7503 jnz short PRINTVAL + 28962 00003A7B BE[8D91] mov si,OFFMES_PTR + 28963 PRINTVAL: + 28964 ; 19/03/2023 + 28965 ; MSDOS 3.3 + 28966 ;jmp STD_PRINTF + 28967 + 28968 ; 19/03/2023 + 28969 ; MSDOS 6.0 + 28970 00003A7E 52 push dx ;AN000; save offset of message block + 28971 00003A7F 89D3 mov bx,dx ;AN000; save offset value + 28972 00003A81 AD lodsw ;AN000; get message number of on or off + 28973 00003A82 B6FF mov dh,util_msg_class ; -1 ; 0FFh + 28974 ;AN000; this is a utility message + 28975 00003A84 E8841A call TSYSGETMSG ;AN000; get the address of the message + 28976 ;add bx,5 + 28977 00003A87 83C305 add bx,Ptr_off_pos ;AN000; point to offset of ON/OFF + 28978 + 28979 00003A8A 8937 mov [bx],si ;AN000; put the offset in the message block + 28980 00003A8C 5A pop dx ;AN000; get message back + 28981 00003A8D E89819 call std_printf ;AC000; go print message + 28982 00003A90 C7070000 mov word [bx],0 ;AN000; zero out message pointer + 28983 00003A94 C3 retn ;AN000; exit + 28984 + 28985 ; =============== S U B R O U T I N E ======================================= + 28986 + 28987 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.CO + 28988 VERIFY: + 28989 00003A95 E81E00 call ON_OFF + 28990 00003A98 B8012E mov ax,(SET_VERIFY_ON_WRITE<<8)|1 ; 2E01h + 28991 00003A9B 720A jc short PVERIFY + 28992 00003A9D 7503 jnz short VER_OFF + 28993 00003A9F CD21 int 21h ; DOS - SET VERIFY FLAG + 28994 ; DL = 00h,AL = 01h VERIFY on / 00h VERIFY off + 28995 00003AA1 C3 retn + 28996 + 28997 ; --------------------------------------------------------------------------- + 28998 + 28999 VER_OFF: + 29000 00003AA2 FEC8 dec al + 29001 00003AA4 CD21 int 21h ; Turn off verify after write + 29002 00003AA6 C3 retn + 29003 + 29004 ; --------------------------------------------------------------------------- + 29005 + 29006 PVERIFY: + 29007 ; 19/03/2023 + 29008 ; MSDOS 6.0 + 29009 ;cmp cl,0 ;AC000; is rest of line blank? + 29010 00003AA7 20C9 and cl,cl + 29011 00003AA9 75A5 jnz short CERRORJ ; nope... + 29012 + 29013 ;19/03/2023 + 29014 ; MSDOS 3.3 + 29015 ;call MOVE_TO_FIRST_ARG + 29016 ;jnz short CERRORJ + 29017 + 29018 00003AAB B454 mov ah,Get_Verify_On_Write ; 54h + 29019 00003AAD CD21 int 21h ; DOS - 2+ - GET VERIFY FLAG + 29020 ; Return: AL = 00h if flag OFF + 29021 ; AL = 01h if flag ON + 29022 00003AAF 88C3 mov bl,al + 29023 00003AB1 BA[7191] mov dx,VeriMes_Ptr + 29024 00003AB4 EBBE jmp short PYN + 29025 + 29026 ; =============== S U B R O U T I N E ======================================= + 29027 + 29028 ; **************************************************************** + 29029 ; * + 29030 ; * ROUTINE: ON_OFF + 29031 ; * + 29032 ; * FUNCTION: Parse the command line for an optional ON or + 29033 ; * OFF string for the BREAK, VERIFY, and ECHO + 29034 ; * routines. 29035 ; * - 29036 ; * OUTPUT: If carry is clear - 29037 ; * If ON is found - 29038 ; * Zero flag set - 29039 ; * If OFF is found - 29040 ; * Zero flag clear - 29041 ; * If carry set - 29042 ; * If nothing on command line - 29043 ; * CL set to zero - 29044 ; * If error - 29045 ; * CL contains error value from parse - 29046 ; * - 29047 ; **************************************************************** - 29048 - 29049 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29050 ON_OFF: - 29051 00003AB6 BE8100 mov si,81h - 29052 - 29053 ; 19/03/2023 - 29054 ; MSDOS 3.3 - 29055 ;call SCANOFF ; scan off leading blanks & equal - 29056 ;cmp al,0Dh ; are we at end of line? - 29057 ;je short BAD_ONF ; yes, return error - 29058 ;lodsw - 29059 ;or ax,2020h ; convert to lowercase - 29060 ;cmp ax,6E6Fh ;'on' - 29061 ;je short ON_CHECK - 29062 ;cmp ax,666Fh ;'of' - 29063 ;jne short BAD_ONF - 29064 ;lodsb - 29065 ;or al,20h ; convert to lowercase - 29066 ;cmp al,66h ; 'f' - 29067 ;jne short BAD_ONF - 29068 ;or al,66h ; or al,'f' - 29069 ;jmp short OFF_CHECK - 29070 ;ON_CHECK: - 29071 ;xor al,al - 29072 ;OFF_CHECK: - 29073 ;lahf - 29074 ;mov bx,ax - 29075 ;call SCANOFF ; scan off leading blanks & equal - 29076 ;cmp al,0Dh ; are we at end of line? - 29077 ;jne short BAD_ONF ; no, return error - 29078 ;mov ax,bx - 29079 ;sahf - 29080 ;clc - 29081 ;retn - 29082 - 29083 ; 19/03/2023 - 29084 ; MSDOS 6.0 - 29085 scan_on_off: ;AN032; scan off leading blanks & equal - 29086 00003AB9 AC lodsb ;AN032; get a char - 29087 ;cmp al,blank ;AN032; if whitespace - 29088 00003ABA 3C20 cmp al,20h - 29089 00003ABC 74FB je short scan_on_off - 29090 ;AN032; keep scanning - 29091 00003ABE 3C09 cmp al,tab_chr ;AN032; if tab - 29092 ;cmp al,09h - 29093 00003AC0 74F7 je short scan_on_off - 29094 ;AN032; keep scanning - 29095 ;cmp al,equal_chr ;AN032; if equal char - 29096 00003AC2 3C3D cmp al,'=' ; 3Dh - 29097 00003AC4 7401 je short parse_on_off - 29098 ;AN032; start parsing - 29099 00003AC6 4E dec si ;AN032; if none of above - back up - 29100 - 29101 parse_on_off: ;AN032; and start parsing - 29102 00003AC7 BF[1096] mov di,PARSE_BREAK ;AN000; Get address of PARSE_BREAK - 29103 00003ACA 31C9 xor cx,cx ;AN000; clear cx,dx - 29104 00003ACC 31D2 xor dx,dx ;AN000; - 29105 00003ACE E89B0E call cmd_parse ;AC000; call parser - 29106 ;cmp ax,-1 ; 0FFFFh - 29107 00003AD1 83F8FF cmp ax,END_OF_LINE ;AC000; are we at end of line? - 29108 00003AD4 742E je short BADONF ;AC000; yes, return error - 29109 ;cmp ax,RESULT_NO_ERROR ;AN000; did an error occur - 29110 ;cmp ax,0 - 29111 00003AD6 21C0 and ax,ax ; ax = 0 ? - 29112 00003AD8 7404 jz short on_off_there - 29113 ;AN000; no - continue - 29114 00003ADA 89C1 mov cx,ax ;AN000; yes - set cl to error code - 29115 00003ADC EB26 jmp short BADONF ;AN000; return error - 29116 - 29117 on_off_there: - 29118 00003ADE 803E[ECA5]FF cmp byte [PARSE1_CODE],-1 ; 0FFh - 29119 ;AN014; was a valid positional present? - 29120 00003AE3 7505 jnz short good_on_off - 29121 ;AN014; yes - continue - 29122 00003AE5 B90A00 mov cx,BadParm_Ptr ;AN014; something other than ON/OFF - 29123 ;mov cx,10 ; 0Ah - 29124 00003AE8 EB1A jmp short BADONF ;AN014; return error - 29125 - 29126 good_on_off: ;AN014; - 29127 00003AEA 31C0 xor ax,ax ;AC000; set up return code for - 29128 00003AEC 0A06[ECA5] or al,[PARSE1_CODE] - 29129 ;AC000; ON or OFF in AX - 29130 00003AF0 9C pushf ;AN000; save flags - 29131 00003AF1 BF[1096] mov di,PARSE_BREAK ;AN000; Get address of PARSE_BREAK - 29132 00003AF4 31D2 xor dx,dx ;AN000; - 29133 00003AF6 E8730E call cmd_parse ;AN000; call parser - 29134 00003AF9 83F8FF cmp ax,END_OF_LINE ;AN000; are we at end of line? - 29135 ;cmp ax,-1 ; 0FFFFh - 29136 00003AFC 7503 jne short BADONF_flags - 29137 ;AN000; NO, return error - 29138 00003AFE 9D popf ;AN000; restore flags - 29139 00003AFF F8 clc ;AC000; no error - 29140 ;jmp short on_off_end - 29141 ;AN000; return to caller - 29142 ; 26/04/2023 - 29143 00003B00 C3 retn - 29144 - 29145 BADONF_flags: - 29146 00003B01 89C1 mov cx,ax - 29147 00003B03 9D popf - 29148 - 29149 ; --------------------------------------------------------------------------- - 29150 - 29151 ; No discernable ON or OFF has been found. Put an error message pointer in DX - 29152 ; and return the error + 29036 ; * INPUT: command line at offset 81H + 29037 ; * PARSE_BREAK control block + 29038 ; * + 29039 ; * OUTPUT: If carry is clear + 29040 ; * If ON is found + 29041 ; * Zero flag set + 29042 ; * If OFF is found + 29043 ; * Zero flag clear + 29044 ; * If carry set + 29045 ; * If nothing on command line + 29046 ; * CL set to zero + 29047 ; * If error + 29048 ; * CL contains error value from parse + 29049 ; * + 29050 ; **************************************************************** + 29051 + 29052 ; 19/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29053 ON_OFF: + 29054 00003AB6 BE8100 mov si,81h + 29055 + 29056 ; 19/03/2023 + 29057 ; MSDOS 3.3 + 29058 ;call SCANOFF ; scan off leading blanks & equal + 29059 ;cmp al,0Dh ; are we at end of line? + 29060 ;je short BAD_ONF ; yes, return error + 29061 ;lodsw + 29062 ;or ax,2020h ; convert to lowercase + 29063 ;cmp ax,6E6Fh ;'on' + 29064 ;je short ON_CHECK + 29065 ;cmp ax,666Fh ;'of' + 29066 ;jne short BAD_ONF + 29067 ;lodsb + 29068 ;or al,20h ; convert to lowercase + 29069 ;cmp al,66h ; 'f' + 29070 ;jne short BAD_ONF + 29071 ;or al,66h ; or al,'f' + 29072 ;jmp short OFF_CHECK + 29073 ;ON_CHECK: + 29074 ;xor al,al + 29075 ;OFF_CHECK: + 29076 ;lahf + 29077 ;mov bx,ax + 29078 ;call SCANOFF ; scan off leading blanks & equal + 29079 ;cmp al,0Dh ; are we at end of line? + 29080 ;jne short BAD_ONF ; no, return error + 29081 ;mov ax,bx + 29082 ;sahf + 29083 ;clc + 29084 ;retn + 29085 + 29086 ; 19/03/2023 + 29087 ; MSDOS 6.0 + 29088 scan_on_off: ;AN032; scan off leading blanks & equal + 29089 00003AB9 AC lodsb ;AN032; get a char + 29090 ;cmp al,blank ;AN032; if whitespace + 29091 00003ABA 3C20 cmp al,20h + 29092 00003ABC 74FB je short scan_on_off + 29093 ;AN032; keep scanning + 29094 00003ABE 3C09 cmp al,tab_chr ;AN032; if tab + 29095 ;cmp al,09h + 29096 00003AC0 74F7 je short scan_on_off + 29097 ;AN032; keep scanning + 29098 ;cmp al,equal_chr ;AN032; if equal char + 29099 00003AC2 3C3D cmp al,'=' ; 3Dh + 29100 00003AC4 7401 je short parse_on_off + 29101 ;AN032; start parsing + 29102 00003AC6 4E dec si ;AN032; if none of above - back up + 29103 + 29104 parse_on_off: ;AN032; and start parsing + 29105 00003AC7 BF[1096] mov di,PARSE_BREAK ;AN000; Get address of PARSE_BREAK + 29106 00003ACA 31C9 xor cx,cx ;AN000; clear cx,dx + 29107 00003ACC 31D2 xor dx,dx ;AN000; + 29108 00003ACE E89B0E call cmd_parse ;AC000; call parser + 29109 ;cmp ax,-1 ; 0FFFFh + 29110 00003AD1 83F8FF cmp ax,END_OF_LINE ;AC000; are we at end of line? + 29111 00003AD4 742E je short BADONF ;AC000; yes, return error + 29112 ;cmp ax,RESULT_NO_ERROR ;AN000; did an error occur + 29113 ;cmp ax,0 + 29114 00003AD6 21C0 and ax,ax ; ax = 0 ? + 29115 00003AD8 7404 jz short on_off_there + 29116 ;AN000; no - continue + 29117 00003ADA 89C1 mov cx,ax ;AN000; yes - set cl to error code + 29118 00003ADC EB26 jmp short BADONF ;AN000; return error + 29119 + 29120 on_off_there: + 29121 00003ADE 803E[ECA5]FF cmp byte [PARSE1_CODE],-1 ; 0FFh + 29122 ;AN014; was a valid positional present? + 29123 00003AE3 7505 jnz short good_on_off + 29124 ;AN014; yes - continue + 29125 00003AE5 B90A00 mov cx,BadParm_Ptr ;AN014; something other than ON/OFF + 29126 ;mov cx,10 ; 0Ah + 29127 00003AE8 EB1A jmp short BADONF ;AN014; return error + 29128 + 29129 good_on_off: ;AN014; + 29130 00003AEA 31C0 xor ax,ax ;AC000; set up return code for + 29131 00003AEC 0A06[ECA5] or al,[PARSE1_CODE] + 29132 ;AC000; ON or OFF in AX + 29133 00003AF0 9C pushf ;AN000; save flags + 29134 00003AF1 BF[1096] mov di,PARSE_BREAK ;AN000; Get address of PARSE_BREAK + 29135 00003AF4 31D2 xor dx,dx ;AN000; + 29136 00003AF6 E8730E call cmd_parse ;AN000; call parser + 29137 00003AF9 83F8FF cmp ax,END_OF_LINE ;AN000; are we at end of line? + 29138 ;cmp ax,-1 ; 0FFFFh + 29139 00003AFC 7503 jne short BADONF_flags + 29140 ;AN000; NO, return error + 29141 00003AFE 9D popf ;AN000; restore flags + 29142 00003AFF F8 clc ;AC000; no error + 29143 ;jmp short on_off_end + 29144 ;AN000; return to caller + 29145 ; 26/04/2023 + 29146 00003B00 C3 retn + 29147 + 29148 BADONF_flags: + 29149 00003B01 89C1 mov cx,ax + 29150 00003B03 9D popf + 29151 + 29152 ; --------------------------------------------------------------------------- 29153 - 29154 BADONF: - 29155 00003B04 BA[4091] mov dx,bad_on_off_ptr - 29156 00003B07 F9 stc - 29157 on_off_end: - 29158 00003B08 C3 retn - 29159 - 29160 ;============================================================================ - 29161 ; TUCODE.ASM, MSDOS 6.0, 1991 (2) - 29162 ;============================================================================ - 29163 ; 02/10/2018 - Retro DOS v3.0 - 29164 - 29165 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 29BFh - 29166 - 29167 ; =============== S U B R O U T I N E ======================================= - 29168 - 29169 ; 20/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29170 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3876h - 29171 - 29172 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 29173 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3E20h - 29174 - 29175 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM - 29176 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3CD4h - 29177 PRINT_DATE: - 29178 ; 20/03/2023 - 29179 ; MSDOS 3.3 - 29180 ;push es - 29181 ;push di - 29182 ;push cs - 29183 ;pop es - 29184 ;mov di,ARG_BUF - 29185 ;mov ah,Get_Date ; 2Ah - 29186 ;int 21h ; DOS - GET CURRENT DATE - 29187 ; ; Return: DL = day,DH = month, CX = year - 29188 ; ; AL = day of the week (0=Sunday,1=Monday,etc.) - 29189 ;cbw - 29190 ;call GETDATE - 29191 ;call P_DATE - 29192 ;xor al,al - 29193 ;stosb - 29194 ;mov dx,ARG_BUF_PTR - 29195 ;call STD_PRINTF - 29196 ; 20/03/2023 (MSDOS 3.3 COMMAND.COM - TRANGROUP:29DAh) - 29197 ;pop es ; !!??!! - 29198 ;pop di - 29199 ;retn - 29200 - 29201 ; 20/03/2023 - 29202 ; MSDOS 6.0 - 29203 00003B09 06 push es - 29204 00003B0A 57 push di - 29205 00003B0B 0E push cs - 29206 00003B0C 07 pop es - 29207 00003B0D E81300 call GetDate ; get date - 29208 00003B10 86F2 xchg dh,dl ;AN000; switch month & day - 29209 00003B12 890E[1692] mov [promptDat_yr],cx ;AC000; put year into message control block - 29210 00003B16 8916[1892] mov [promptDat_moday],dx ;AC000; put month and day into message control block - 29211 00003B1A BA[0692] mov dx,promptdat_ptr ;AC000; set up message for output - 29212 00003B1D E80819 call std_printf - 29213 ;AD061; mov word [promptDat_yr],0 ;AC000; reset year, month and day - 29214 ;AD061; mov word [promptDat_moday],0 ;AC000; pointers in control block - 29215 00003B20 5F pop di ;AC000; restore di,es - 29216 00003B21 07 pop es ;AC000; - 29217 00003B22 C3 retn - 29218 - 29219 ; --------------------------------------------------------------------------- - 29220 - 29221 ; 21/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29222 - 29223 ;GETDATE: - 29224 ; 21/03/2023 - 29225 ; MSDOS 3.3 - 29226 ;mov si,ax - 29227 ;shl si,1 - 29228 ;add si,ax - 29229 ;add si,WEEKTAB ; "SunMonTueWedThuFriSat" - 29230 ;mov bx,cx - 29231 ;mov cx,3 - 29232 ;rep movsb - 29233 ;mov al,' ' - 29234 ;stosb - 29235 ;retn - 29236 - 29237 ; 21/03/2023 - 29238 ; MSDOS 6.0 + 29154 ; No discernable ON or OFF has been found. Put an error message pointer in DX + 29155 ; and return the error + 29156 + 29157 BADONF: + 29158 00003B04 BA[4091] mov dx,bad_on_off_ptr + 29159 00003B07 F9 stc + 29160 on_off_end: + 29161 00003B08 C3 retn + 29162 + 29163 ;============================================================================ + 29164 ; TUCODE.ASM, MSDOS 6.0, 1991 (2) + 29165 ;============================================================================ + 29166 ; 02/10/2018 - Retro DOS v3.0 + 29167 + 29168 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 29BFh + 29169 + 29170 ; =============== S U B R O U T I N E ======================================= + 29171 + 29172 ; 20/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29173 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3876h + 29174 + 29175 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 29176 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3E20h + 29177 + 29178 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM + 29179 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:3CD4h + 29180 PRINT_DATE: + 29181 ; 20/03/2023 + 29182 ; MSDOS 3.3 + 29183 ;push es + 29184 ;push di + 29185 ;push cs + 29186 ;pop es + 29187 ;mov di,ARG_BUF + 29188 ;mov ah,Get_Date ; 2Ah + 29189 ;int 21h ; DOS - GET CURRENT DATE + 29190 ; ; Return: DL = day,DH = month, CX = year + 29191 ; ; AL = day of the week (0=Sunday,1=Monday,etc.) + 29192 ;cbw + 29193 ;call GETDATE + 29194 ;call P_DATE + 29195 ;xor al,al + 29196 ;stosb + 29197 ;mov dx,ARG_BUF_PTR + 29198 ;call STD_PRINTF + 29199 ; 20/03/2023 (MSDOS 3.3 COMMAND.COM - TRANGROUP:29DAh) + 29200 ;pop es ; !!??!! + 29201 ;pop di + 29202 ;retn + 29203 + 29204 ; 20/03/2023 + 29205 ; MSDOS 6.0 + 29206 00003B09 06 push es + 29207 00003B0A 57 push di + 29208 00003B0B 0E push cs + 29209 00003B0C 07 pop es + 29210 00003B0D E81300 call GetDate ; get date + 29211 00003B10 86F2 xchg dh,dl ;AN000; switch month & day + 29212 00003B12 890E[1692] mov [promptDat_yr],cx ;AC000; put year into message control block + 29213 00003B16 8916[1892] mov [promptDat_moday],dx ;AC000; put month and day into message control block + 29214 00003B1A BA[0692] mov dx,promptdat_ptr ;AC000; set up message for output + 29215 00003B1D E80819 call std_printf + 29216 ;AD061; mov word [promptDat_yr],0 ;AC000; reset year, month and day + 29217 ;AD061; mov word [promptDat_moday],0 ;AC000; pointers in control block + 29218 00003B20 5F pop di ;AC000; restore di,es + 29219 00003B21 07 pop es ;AC000; + 29220 00003B22 C3 retn + 29221 + 29222 ; --------------------------------------------------------------------------- + 29223 + 29224 ; 21/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29225 + 29226 ;GETDATE: + 29227 ; 21/03/2023 + 29228 ; MSDOS 3.3 + 29229 ;mov si,ax + 29230 ;shl si,1 + 29231 ;add si,ax + 29232 ;add si,WEEKTAB ; "SunMonTueWedThuFriSat" + 29233 ;mov bx,cx + 29234 ;mov cx,3 + 29235 ;rep movsb + 29236 ;mov al,' ' + 29237 ;stosb + 29238 ;retn 29239 - 29240 ; Do GET DATE system call and set up 3 character day of week in ARG_BUF - 29241 ; for output. Date will be returned in CX,DX. + 29240 ; 21/03/2023 + 29241 ; MSDOS 6.0 29242 - 29243 GetDate: - 29244 00003B23 BF[96A3] mov di,Arg_Buf ;AC000; target for day of week - 29245 00003B26 B42A mov ah,Get_Date ;2Ah ;AC000; get current date - 29246 00003B28 CD21 int 21h ;AC000; Get date in CX:DX - 29247 00003B2A 98 cbw ;AC000; - 29248 00003B2B 51 push cx ;AN000; save date returned in - 29249 00003B2C 52 push dx ;AN000; CX:DX - 29250 00003B2D 89C6 mov si,ax - 29251 00003B2F D1E6 shl si,1 - 29252 00003B31 01C6 add si,ax ; SI=AX*3 - 29253 00003B33 89F1 mov cx,si ;AN000; save si - 29254 00003B35 A1[C990] mov ax,[WeekTab] ;AN000; get message number of weektab - 29255 00003B38 B6FF mov dh,util_msg_class ;0FFh ;AN000; this is a utility message - 29256 00003B3A 57 push di ;AN000; save argument buffer - 29257 00003B3B E8CD19 call TSYSGETMSG ;AN000; get the address of the message - 29258 00003B3E 5F pop di ;AN000; retrieve argument buffer - 29259 00003B3F 01CE add si,cx ;AC000; get day of week - 29260 00003B41 B90300 mov cx,3 - 29261 00003B44 F3A4 rep movsb - 29262 00003B46 B000 mov al,END_OF_LINE_OUT ; 0 ;AC000; terminate the string - 29263 00003B48 AA stosb - 29264 00003B49 5A pop dx ;AN000; get back date - 29265 00003B4A 59 pop cx ;AN000; - 29266 00003B4B C3 retn - 29267 - 29268 ; =============== S U B R O U T I N E ======================================= - 29269 - 29270 ; 21/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29271 - 29272 ; MSDOS 6.0 - 29273 - 29274 ; This routine determines whether the character in AL is a - 29275 ; Yes or No character. On return, if AL=0, the character is - 29276 ; No, if AL=1, the character is Yes. - 29277 - 29278 ; assume ds:trangroup - 29279 - 29280 char_in_xlat: ; proc near - 29281 ; 21/03/2023 - 29282 00003B4C 88C2 mov dl,al ;AC000; get character into DX - 29283 00003B4E 30F6 xor dh,dh ;AC000; - 29284 ;mov ax,(GetExtCntry<<8)+35 ;AC000; Yes/No char call - 29285 00003B50 B82365 mov ax,6523h - 29286 00003B53 CD21 int 21h ;AC000; - 29287 00003B55 C3 retn - 29288 - 29289 ;char_in_xlat endp - 29290 - 29291 ;============================================================================ - 29292 ; TENV.ASM, MSDOS 6.0, 1991 - 29293 ;============================================================================ - 29294 ; 02/10/2018 - Retro DOS v3.0 - 29295 - 29296 ; Environment utilities and misc. routines - 29297 - 29298 ; MSDOS 6.0 - 29299 ; **************************************************************** - 29300 ; * - 29301 ; * ROUTINE: UPCONV (ADDED BY EMG 4.00) - 29302 ; * - 29303 ; * FUNCTION: This routine returns the upper case equivalent of - 29304 ; * the character in AL from the file upper case table - 29305 ; * in DOS if character if above ascii 128, else - 29306 ; * subtracts 20H if between "a" and "z". - 29307 ; * - 29308 ; * INPUT: AL char to be upper cased - 29309 ; * FUCASE_ADDR set to the file upper case table + 29243 ; Do GET DATE system call and set up 3 character day of week in ARG_BUF + 29244 ; for output. Date will be returned in CX,DX. + 29245 + 29246 GetDate: + 29247 00003B23 BF[96A3] mov di,Arg_Buf ;AC000; target for day of week + 29248 00003B26 B42A mov ah,Get_Date ;2Ah ;AC000; get current date + 29249 00003B28 CD21 int 21h ;AC000; Get date in CX:DX + 29250 00003B2A 98 cbw ;AC000; + 29251 00003B2B 51 push cx ;AN000; save date returned in + 29252 00003B2C 52 push dx ;AN000; CX:DX + 29253 00003B2D 89C6 mov si,ax + 29254 00003B2F D1E6 shl si,1 + 29255 00003B31 01C6 add si,ax ; SI=AX*3 + 29256 00003B33 89F1 mov cx,si ;AN000; save si + 29257 00003B35 A1[C990] mov ax,[WeekTab] ;AN000; get message number of weektab + 29258 00003B38 B6FF mov dh,util_msg_class ;0FFh ;AN000; this is a utility message + 29259 00003B3A 57 push di ;AN000; save argument buffer + 29260 00003B3B E8CD19 call TSYSGETMSG ;AN000; get the address of the message + 29261 00003B3E 5F pop di ;AN000; retrieve argument buffer + 29262 00003B3F 01CE add si,cx ;AC000; get day of week + 29263 00003B41 B90300 mov cx,3 + 29264 00003B44 F3A4 rep movsb + 29265 00003B46 B000 mov al,END_OF_LINE_OUT ; 0 ;AC000; terminate the string + 29266 00003B48 AA stosb + 29267 00003B49 5A pop dx ;AN000; get back date + 29268 00003B4A 59 pop cx ;AN000; + 29269 00003B4B C3 retn + 29270 + 29271 ; =============== S U B R O U T I N E ======================================= + 29272 + 29273 ; 21/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29274 + 29275 ; MSDOS 6.0 + 29276 + 29277 ; This routine determines whether the character in AL is a + 29278 ; Yes or No character. On return, if AL=0, the character is + 29279 ; No, if AL=1, the character is Yes. + 29280 + 29281 ; assume ds:trangroup + 29282 + 29283 char_in_xlat: ; proc near + 29284 ; 21/03/2023 + 29285 00003B4C 88C2 mov dl,al ;AC000; get character into DX + 29286 00003B4E 30F6 xor dh,dh ;AC000; + 29287 ;mov ax,(GetExtCntry<<8)+35 ;AC000; Yes/No char call + 29288 00003B50 B82365 mov ax,6523h + 29289 00003B53 CD21 int 21h ;AC000; + 29290 00003B55 C3 retn + 29291 + 29292 ;char_in_xlat endp + 29293 + 29294 ;============================================================================ + 29295 ; TENV.ASM, MSDOS 6.0, 1991 + 29296 ;============================================================================ + 29297 ; 02/10/2018 - Retro DOS v3.0 + 29298 + 29299 ; Environment utilities and misc. routines + 29300 + 29301 ; MSDOS 6.0 + 29302 ; **************************************************************** + 29303 ; * + 29304 ; * ROUTINE: UPCONV (ADDED BY EMG 4.00) + 29305 ; * + 29306 ; * FUNCTION: This routine returns the upper case equivalent of + 29307 ; * the character in AL from the file upper case table + 29308 ; * in DOS if character if above ascii 128, else + 29309 ; * subtracts 20H if between "a" and "z". 29310 ; * - 29311 ; * OUTPUT: AL upper cased character - 29312 ; * - 29313 ; **************************************************************** - 29314 ; - 29315 ;assume ds:trangroup ;AN000; - 29316 ; - 29317 ;upconv proc near ;AN000; - 29318 ; - 29319 ; cmp al,80h ;AN000; see if char is > ascii 128 - 29320 ; jb oth_fucase ;AN000; no - upper case math - 29321 ; sub al,80h ;AN000; only upper 128 chars in table - 29322 ; push ds ;AN000; - 29323 ; push bx ;AN000; - 29324 ; mov ds,[resseg] ;AN000; get resident data segment - 29325 ;assume ds:resgroup ;AN000; - 29326 ; lds bx,dword ptr FUCase_Addr+1 ;AN000; get table address - 29327 ; add bx,2 ;AN000; skip over first word - 29328 ; xlat ds:byte ptr [bx] ;AN000; convert to upper case - 29329 ; pop bx ;AN000; - 29330 ; pop ds ;AN000; - 29331 ;assume ds:trangroup ;AN000; - 29332 ; jmp short upconv_end ;AN000; we finished - exit - 29333 ; - 29334 ;oth_fucase: ;AN000; - 29335 ; cmp al,small_a ;AC000; if between "a" and "z", - 29336 ; jb upconv_end ;AC000; subtract 20h to get - 29337 ; cmp al,small_z ;AC000; upper case equivalent. - 29338 ; ja upconv_end ;AC000; - 29339 ; sub al,20h ;AC000; Change lower-case to upper - 29340 ; - 29341 ;upconv_end: ;AN000; - 29342 ; ret + 29311 ; * INPUT: AL char to be upper cased + 29312 ; * FUCASE_ADDR set to the file upper case table + 29313 ; * + 29314 ; * OUTPUT: AL upper cased character + 29315 ; * + 29316 ; **************************************************************** + 29317 ; + 29318 ;assume ds:trangroup ;AN000; + 29319 ; + 29320 ;upconv proc near ;AN000; + 29321 ; + 29322 ; cmp al,80h ;AN000; see if char is > ascii 128 + 29323 ; jb oth_fucase ;AN000; no - upper case math + 29324 ; sub al,80h ;AN000; only upper 128 chars in table + 29325 ; push ds ;AN000; + 29326 ; push bx ;AN000; + 29327 ; mov ds,[resseg] ;AN000; get resident data segment + 29328 ;assume ds:resgroup ;AN000; + 29329 ; lds bx,dword ptr FUCase_Addr+1 ;AN000; get table address + 29330 ; add bx,2 ;AN000; skip over first word + 29331 ; xlat ds:byte ptr [bx] ;AN000; convert to upper case + 29332 ; pop bx ;AN000; + 29333 ; pop ds ;AN000; + 29334 ;assume ds:trangroup ;AN000; + 29335 ; jmp short upconv_end ;AN000; we finished - exit + 29336 ; + 29337 ;oth_fucase: ;AN000; + 29338 ; cmp al,small_a ;AC000; if between "a" and "z", + 29339 ; jb upconv_end ;AC000; subtract 20h to get + 29340 ; cmp al,small_z ;AC000; upper case equivalent. + 29341 ; ja upconv_end ;AC000; + 29342 ; sub al,20h ;AC000; Change lower-case to upper 29343 ; - 29344 ;upconv endp ;AN000; - 29345 - 29346 ;============================================================================ - 29347 ; COPY.ASM, MSDOS 6.0, 1991 - 29348 ;============================================================================ - 29349 ; 01/10/2018 - Retro DOS v3.0 - 29350 - 29351 ; title COMMAND COPY routines. - 29352 - 29353 ;/* - 29354 ; * Microsoft Confidential - 29355 ; * Copyright (C) Microsoft Corporation 1991 - 29356 ; * All Rights Reserved. - 29357 ; */ - 29358 - 29359 ;*** COPY.ASM - 29360 - 29361 ;Source files: copy.asm, copypr1.asm, copypr2.asm - 29362 + 29344 ;upconv_end: ;AN000; + 29345 ; ret + 29346 ; + 29347 ;upconv endp ;AN000; + 29348 + 29349 ;============================================================================ + 29350 ; COPY.ASM, MSDOS 6.0, 1991 + 29351 ;============================================================================ + 29352 ; 01/10/2018 - Retro DOS v3.0 + 29353 + 29354 ; title COMMAND COPY routines. + 29355 + 29356 ;/* + 29357 ; * Microsoft Confidential + 29358 ; * Copyright (C) Microsoft Corporation 1991 + 29359 ; * All Rights Reserved. + 29360 ; */ + 29361 + 29362 ;*** COPY.ASM 29363 - 29364 ;*** MODIFICATION HISTORY + 29364 ;Source files: copy.asm, copypr1.asm, copypr2.asm 29365 - 29366 ;11/01/83 EE Added a few lines at the end of SCANSRC2 to get multiple - 29367 ; file concatenations (eg copy a.*+b.*+c.*) to work properly. - 29368 ;11/02/83 EE Commented out the code in CPARSE which added drive designators - 29369 ; to tokens which begin with path characters so that PARSELINE - 29370 ; will work correctly. - 29371 ;11/04/83 EE Commented out the code in CPARSE that considered paren's to be - 29372 ; individual tokens. That distinction is no longer needed for - 29373 ; FOR loop processing. - 29374 ;11/17/83 EE CPARSE upper case conversion is now flag dependent. Flag is - 29375 ; 1 when Cparse is called from COPY. - 29376 ;11/17/83 EE Took out the comment chars around code described in 11/04/83 - 29377 ; mod. It now is conditional on flag like previous mod. - 29378 ;11/21/83 NP Added printf - 29379 ;12/09/83 EE CPARSE changed to use CPYFLAG to determine when a colon should - 29380 ; be added to a token. - 29381 ;05/30/84 MZ Initialize all copy variables. Fix confusion with destclosed - 29382 ; NOTE: DestHand is the destination handle. There are two - 29383 ; special values: -1 meaning destination was never opened and - 29384 ; 0 which means that the destination has been openned and - 29385 ; closed. - 29386 ;06/01/84 MZ Above reasoning totally specious. Returned things to normal - 29387 ;06/06/86 EG Change to fix problem of source switches /a and /b getting - 29388 ; lost on large and multiple file (wildcard) copies. - 29389 ;06/09/86 EG Change to use xnametrans call to verify that source and - 29390 ; destination are not equal. - 29391 ; - 29392 ;06/24/90 DO If the destination of a file concatenation is the same as - 29393 ; first source file AND we run out of disk space before - 29394 ; completing the concatenation, restore the first source - 29395 ; file as best we can. See SeekEnd and CopErr. Bug #859. - 29396 ; - 29397 ;M031 SR 10/11/90 Bug #3069. Use deny write sharing mode to open files - 29398 ; instead of compatibility mode. This gives lesser sharing - 29399 ; violations when files are opened for read on a copy. - 29400 - 29401 ; --------------------------------------------------------------------------- - 29402 ;*** COPY CODE - 29403 ; --------------------------------------------------------------------------- - 29404 - 29405 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2A15h - 29406 - 29407 ; 23/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29408 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 38C3h + 29366 + 29367 ;*** MODIFICATION HISTORY + 29368 + 29369 ;11/01/83 EE Added a few lines at the end of SCANSRC2 to get multiple + 29370 ; file concatenations (eg copy a.*+b.*+c.*) to work properly. + 29371 ;11/02/83 EE Commented out the code in CPARSE which added drive designators + 29372 ; to tokens which begin with path characters so that PARSELINE + 29373 ; will work correctly. + 29374 ;11/04/83 EE Commented out the code in CPARSE that considered paren's to be + 29375 ; individual tokens. That distinction is no longer needed for + 29376 ; FOR loop processing. + 29377 ;11/17/83 EE CPARSE upper case conversion is now flag dependent. Flag is + 29378 ; 1 when Cparse is called from COPY. + 29379 ;11/17/83 EE Took out the comment chars around code described in 11/04/83 + 29380 ; mod. It now is conditional on flag like previous mod. + 29381 ;11/21/83 NP Added printf + 29382 ;12/09/83 EE CPARSE changed to use CPYFLAG to determine when a colon should + 29383 ; be added to a token. + 29384 ;05/30/84 MZ Initialize all copy variables. Fix confusion with destclosed + 29385 ; NOTE: DestHand is the destination handle. There are two + 29386 ; special values: -1 meaning destination was never opened and + 29387 ; 0 which means that the destination has been openned and + 29388 ; closed. + 29389 ;06/01/84 MZ Above reasoning totally specious. Returned things to normal + 29390 ;06/06/86 EG Change to fix problem of source switches /a and /b getting + 29391 ; lost on large and multiple file (wildcard) copies. + 29392 ;06/09/86 EG Change to use xnametrans call to verify that source and + 29393 ; destination are not equal. + 29394 ; + 29395 ;06/24/90 DO If the destination of a file concatenation is the same as + 29396 ; first source file AND we run out of disk space before + 29397 ; completing the concatenation, restore the first source + 29398 ; file as best we can. See SeekEnd and CopErr. Bug #859. + 29399 ; + 29400 ;M031 SR 10/11/90 Bug #3069. Use deny write sharing mode to open files + 29401 ; instead of compatibility mode. This gives lesser sharing + 29402 ; violations when files are opened for read on a copy. + 29403 + 29404 ; --------------------------------------------------------------------------- + 29405 ;*** COPY CODE + 29406 ; --------------------------------------------------------------------------- + 29407 + 29408 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2A15h 29409 - 29410 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 29411 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3E6Dh + 29410 ; 23/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29411 ; MSDOS 5.0 - COMMAND.COM, transient portion/segment offset 38C3h 29412 - 29413 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM - 29414 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 3D1Eh + 29413 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 29414 ; MSDOS 6.22 - COMMAND.COM, transient portion/segment offset 3E6Dh 29415 - 29416 COPY: - 29417 ; Initialize internal variables. + 29416 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM + 29417 ; PCDOS 7.1 - COMMAND.COM, transient portion/segment offset 3D1Eh 29418 - 29419 00003B56 31C0 xor ax,ax ; AX = 0 - 29420 00003B58 A3[A29D] mov [Copy_num],ax ; # files copied (destinations) = 0 - 29421 00003B5B A3[D29E] mov [SRCPT],ax ; cmd line ptr for source scan = 0 - 29422 00003B5E A3[1E9E] mov [SrcTail],ax ; ptr to last element of source pathname = 0 - 29423 00003B61 A2[139C] mov [CFLAG],al ; 'destination file created' = false - 29424 00003B64 A3[199C] mov [NXTADD],ax ; ptr into TPA buffer = 0 - 29425 00003B67 A3[0F9C] mov [DestSwitch],ax ; destination switches = none - 29426 00003B6A A3[F69E] mov [STARTEL],ax ; CParse ptr to last pathname element = 0 - 29427 00003B6D A3[BB9D] mov [DestTail],ax ; ptr to last element of dest pathname = 0 - 29428 00003B70 A2[149C] mov [DestClosed],al ; 'destination file closed' = false - 29429 00003B73 A2[BA9D] mov [DestSiz],al ; length of destination pathname = 0 - 29430 00003B76 A2[1D9E] mov [SrcSiz],al ; length of source pathname = 0 - 29431 00003B79 A2[BD9D] mov [DestInfo],al ; destination pathname flags = none - 29432 00003B7C A2[209E] mov [SrcInfo],al ; source pathname flags = none - 29433 00003B7F A2[D49E] mov [INEXACT],al ; 'inexact copy' = false - 29434 00003B82 A2[B99D] mov [DestVars],al ; 'dest pathname is directory' = false ;*!* - 29435 00003B85 A2[1C9E] mov [SrcVars],al ; 'source pathname is directory' = false - 29436 00003B88 A2[D79A] mov [USERDIR1],al ; saved working directory = null - 29437 00003B8B A2[D59E] mov [NOWRITE],al ; 'no write' (source = dest) = false - 29438 00003B8E A2[069C] mov [RDEOF],al ; 'read end of file' = false - 29439 00003B91 A3[789E] mov [SRCHAND],ax ; source handle = 0 - 29440 00003B94 A3[DD9E] mov [CPDATE],ax ; copy date = 0 - 29441 00003B97 A3[DF9E] mov [CPTIME],ax ; copy time = 0 - 29442 00003B9A A2[7A9E] mov [SRCISDEV],al ; 'source is device' = false - 29443 ; 23/03/2023 - 29444 ; MSDOS 6.0 (& MSDOS 5.0) COMMAND.COM - 29445 00003B9D A2[E59E] mov [OCtrlZ],al ; 'Ctrl+Z removed from original' = false - 29446 ; mov [zflag],al ; PCDOS 7.1 ; 10/08/2024 - 29447 00003BA0 A3[E19E] mov [OFilePtr_Lo],ax - 29448 00003BA3 A3[E39E] mov [OFilePtr_Hi],ax ; original destination file ptr = null - 29449 00003BA6 A2[D99E] mov [TERMREAD],al ; 'terminate read' = false - 29450 00003BA9 A2[959D] mov [comma],al ; '"+,," found' = false - 29451 00003BAC A2[969D] mov [plus_comma],al ; '"+,," found last time' = false (?) - 29452 00003BAF A2[339F] mov [msg_flag],al ;AN022; 'non-utility msg issued' = false - 29453 00003BB2 A3[119C] mov [AllSwitch],ax ; all switches = none - 29454 00003BB5 A2[0A9C] mov [ArgC],al ; source/dest argument count = 0 - 29455 00003BB8 A2[DB9E] mov [PLUS],al ; '"+" in command line' = false - 29456 00003BBB A2[D69E] mov [BINARY],al ; 'binary copy' = false - 29457 00003BBE A2[DA9E] mov [ASCII],al ; 'ascii copy' = false - 29458 00003BC1 A3[209C] mov [FileCnt],ax ; # files copied (destinations) = 0 - 29459 00003BC4 A3[D79E] mov [WRITTEN],ax ; 'destination written to' = false - 29460 00003BC7 A2[089C] mov [Concat],al ; 'concatenating' = false - 29461 00003BCA A2[199E] mov [MELCOPY],al ; 'Mel Hallerman copy' = false - 29462 00003BCD A3[1A9E] mov [MELSTART],ax ; Mel Hallerman cmd line ptr = 0 - 29463 - 29464 ; 12/06/2023 - 29465 ; MSDOS 6.22 COMMAND.COM - 29466 ; (Disassembled source code by using Hex-Rays IDA disassembler) - 29467 00003BD0 A2[F29E] mov [cox_dest_file], al ; MSDOS 6.22 - 29468 00003BD3 A2[F39E] mov [cox_src_file], al ; MSDOS 6.22 - 29469 - 29470 ; Initialize buffers with double-nulls. - 29471 - 29472 00003BD6 A3[7B9E] mov [ScanBuf],ax - 29473 00003BD9 A3[BE9D] mov [DestBuf],ax - 29474 00003BDC A3[219E] mov [SrcBuf],ax - 29475 00003BDF A3[7F9D] mov [SDIRBUF],ax - 29476 00003BE2 A3[399D] mov [DIRBUF],ax - 29477 00003BE5 A3[F69C] mov [DestFcb],ax - 29478 - 29479 00003BE8 A2[DC9E] mov [objcnt],al ; # CParse cmd-line objects found = 0 - 29480 - 29481 00003BEB 48 dec ax ; -1 ; AX = 0FFFFh - 29482 00003BEC A3[159E] mov [DESTHAND],ax ; destination handle = 'never opened' - 29483 00003BEF A2[1B9C] mov [FRSTSRCH],al ; 'first search for source' = true - 29484 00003BF2 A2[189E] mov [FIRSTDEST],al ; 'first time for dest' = true - 29485 00003BF5 A2[B99D] mov [DestIsDir],al ; 'haven't analyzed destination' ; *!* - 29486 - 29487 ; 12/06/2023 - 29488 ; Retro DOS v4.2 COMMAND.COM - 29489 ; MSDOS 6.22 COMMAND.COM code only ! - 29490 ; (Disassembled source code by using Hex-Rays IDA disassembler) - 29491 ; - 29492 00003BF8 E8FB06 call init_copycmd_option ; MSDOS 6.22 - 29493 - 29494 00003BFB BE8100 mov si,81h ; SI = ptr to command line - 29495 ;mov bl,[PLUS_CHR] ; BL = special delimiter = "+" - 29496 ; 23/03/2023 - 29497 00003BFE B32B mov bl,'+' - 29498 00003C00 FE06[329F] inc byte [expand_star] ; CParse 'expand * to ?s' = true - 29499 00003C04 C606[A49D]01 mov byte [cpyflag],1 ; CParse 'called from COPY' = true - 29500 - 29501 ;* Scan the command line for destination information. - 29502 - 29503 DESTSCAN: - 29504 00003C09 31ED xor bp,bp ; BP = switch flag accumulator - 29505 00003C0B BF[7B9E] mov di,ScanBuf ; ES:DI = ptr to pathname buf - 29506 ; 23/03/2023 - 29507 00003C0E 8936[989D] mov [parse_last],si ;AN018; save cmd line ptr - 29508 00003C12 E8920B call cparse ; parse next object - 29509 00003C15 9C pushf ; (*) ; save CParse flags - 29510 00003C16 FE06[DC9E] inc byte [objcnt] ; count object - 29511 00003C1A F6C780 test bh,80h - 29512 00003C1D 7405 jz short NOCOPY ; no "+" delimiter - 29513 00003C1F C606[DB9E]01 mov byte [PLUS],1 ; "+" delimiter occurred - 29514 NOCOPY: - 29515 00003C24 F6C701 test bh,1 - 29516 00003C27 747D jz short TESTP2 ; not a switch - 29517 - 29518 ; Found a switch. - 29519 - 29520 ; 23/03/2023 - Retro DOS v4.0 COMMAND.COM - 29521 ; - 29522 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 29523 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3F43h - 29524 CHK_CP_SWITCH: - 29525 ; MSDOS 6.0 - 29526 00003C29 F7C51000 test bp,10h - 29527 ;test bp,SwitchV ; 10h ;AN038; Verify requested? - 29528 00003C2D 740B jz short NOT_SLASHV ;AN038; No - set the switch - 29529 ;test word [AllSwitch],10h - 29530 00003C2F F606[119C]10 test byte [AllSwitch],10h - 29531 ;test byte [AllSwitch],SwitchV ;AN038; Verify already entered? - 29532 00003C34 7404 jz short NOT_SLASHV ;AN038; No - set the switch - 29533 ;AD018; ;or word [AllSwitch],FBadSwitch ;AN038; Set up bad switch - 29534 ;or bp,FBadSwitch ;AN018; Set up bad switch - 29535 00003C36 81CD0040 or bp,4000h - 29536 NOT_SLASHV: - 29537 ; **************************************** - 29538 ; 12/06/2023 - 29539 ; Retro DOS v4.2 COMMAND.COM - 29540 ; MSDOS 6.22 COMMAND.COM code only ! - 29541 ; (Disassembled source code by using Hex-Rays IDA disassembler) - 29542 ; **************************************** - 29543 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3F55h - 29544 ; - 29545 00003C3A F7C54000 test bp,40h ; negative Y (-Y) switch flag - 29546 00003C3E 7417 jz short CHK_SLASHY0 + 29419 COPY: + 29420 ; Initialize internal variables. + 29421 + 29422 00003B56 31C0 xor ax,ax ; AX = 0 + 29423 00003B58 A3[A29D] mov [Copy_num],ax ; # files copied (destinations) = 0 + 29424 00003B5B A3[D29E] mov [SRCPT],ax ; cmd line ptr for source scan = 0 + 29425 00003B5E A3[1E9E] mov [SrcTail],ax ; ptr to last element of source pathname = 0 + 29426 00003B61 A2[139C] mov [CFLAG],al ; 'destination file created' = false + 29427 00003B64 A3[199C] mov [NXTADD],ax ; ptr into TPA buffer = 0 + 29428 00003B67 A3[0F9C] mov [DestSwitch],ax ; destination switches = none + 29429 00003B6A A3[F69E] mov [STARTEL],ax ; CParse ptr to last pathname element = 0 + 29430 00003B6D A3[BB9D] mov [DestTail],ax ; ptr to last element of dest pathname = 0 + 29431 00003B70 A2[149C] mov [DestClosed],al ; 'destination file closed' = false + 29432 00003B73 A2[BA9D] mov [DestSiz],al ; length of destination pathname = 0 + 29433 00003B76 A2[1D9E] mov [SrcSiz],al ; length of source pathname = 0 + 29434 00003B79 A2[BD9D] mov [DestInfo],al ; destination pathname flags = none + 29435 00003B7C A2[209E] mov [SrcInfo],al ; source pathname flags = none + 29436 00003B7F A2[D49E] mov [INEXACT],al ; 'inexact copy' = false + 29437 00003B82 A2[B99D] mov [DestVars],al ; 'dest pathname is directory' = false ;*!* + 29438 00003B85 A2[1C9E] mov [SrcVars],al ; 'source pathname is directory' = false + 29439 00003B88 A2[D79A] mov [USERDIR1],al ; saved working directory = null + 29440 00003B8B A2[D59E] mov [NOWRITE],al ; 'no write' (source = dest) = false + 29441 00003B8E A2[069C] mov [RDEOF],al ; 'read end of file' = false + 29442 00003B91 A3[789E] mov [SRCHAND],ax ; source handle = 0 + 29443 00003B94 A3[DD9E] mov [CPDATE],ax ; copy date = 0 + 29444 00003B97 A3[DF9E] mov [CPTIME],ax ; copy time = 0 + 29445 00003B9A A2[7A9E] mov [SRCISDEV],al ; 'source is device' = false + 29446 ; 23/03/2023 + 29447 ; MSDOS 6.0 (& MSDOS 5.0) COMMAND.COM + 29448 00003B9D A2[E59E] mov [OCtrlZ],al ; 'Ctrl+Z removed from original' = false + 29449 ; mov [zflag],al ; PCDOS 7.1 ; 10/08/2024 + 29450 00003BA0 A3[E19E] mov [OFilePtr_Lo],ax + 29451 00003BA3 A3[E39E] mov [OFilePtr_Hi],ax ; original destination file ptr = null + 29452 00003BA6 A2[D99E] mov [TERMREAD],al ; 'terminate read' = false + 29453 00003BA9 A2[959D] mov [comma],al ; '"+,," found' = false + 29454 00003BAC A2[969D] mov [plus_comma],al ; '"+,," found last time' = false (?) + 29455 00003BAF A2[339F] mov [msg_flag],al ;AN022; 'non-utility msg issued' = false + 29456 00003BB2 A3[119C] mov [AllSwitch],ax ; all switches = none + 29457 00003BB5 A2[0A9C] mov [ArgC],al ; source/dest argument count = 0 + 29458 00003BB8 A2[DB9E] mov [PLUS],al ; '"+" in command line' = false + 29459 00003BBB A2[D69E] mov [BINARY],al ; 'binary copy' = false + 29460 00003BBE A2[DA9E] mov [ASCII],al ; 'ascii copy' = false + 29461 00003BC1 A3[209C] mov [FileCnt],ax ; # files copied (destinations) = 0 + 29462 00003BC4 A3[D79E] mov [WRITTEN],ax ; 'destination written to' = false + 29463 00003BC7 A2[089C] mov [Concat],al ; 'concatenating' = false + 29464 00003BCA A2[199E] mov [MELCOPY],al ; 'Mel Hallerman copy' = false + 29465 00003BCD A3[1A9E] mov [MELSTART],ax ; Mel Hallerman cmd line ptr = 0 + 29466 + 29467 ; 12/06/2023 + 29468 ; MSDOS 6.22 COMMAND.COM + 29469 ; (Disassembled source code by using Hex-Rays IDA disassembler) + 29470 00003BD0 A2[F29E] mov [cox_dest_file], al ; MSDOS 6.22 + 29471 00003BD3 A2[F39E] mov [cox_src_file], al ; MSDOS 6.22 + 29472 + 29473 ; Initialize buffers with double-nulls. + 29474 + 29475 00003BD6 A3[7B9E] mov [ScanBuf],ax + 29476 00003BD9 A3[BE9D] mov [DestBuf],ax + 29477 00003BDC A3[219E] mov [SrcBuf],ax + 29478 00003BDF A3[7F9D] mov [SDIRBUF],ax + 29479 00003BE2 A3[399D] mov [DIRBUF],ax + 29480 00003BE5 A3[F69C] mov [DestFcb],ax + 29481 + 29482 00003BE8 A2[DC9E] mov [objcnt],al ; # CParse cmd-line objects found = 0 + 29483 + 29484 00003BEB 48 dec ax ; -1 ; AX = 0FFFFh + 29485 00003BEC A3[159E] mov [DESTHAND],ax ; destination handle = 'never opened' + 29486 00003BEF A2[1B9C] mov [FRSTSRCH],al ; 'first search for source' = true + 29487 00003BF2 A2[189E] mov [FIRSTDEST],al ; 'first time for dest' = true + 29488 00003BF5 A2[B99D] mov [DestIsDir],al ; 'haven't analyzed destination' ; *!* + 29489 + 29490 ; 12/06/2023 + 29491 ; Retro DOS v4.2 COMMAND.COM + 29492 ; MSDOS 6.22 COMMAND.COM code only ! + 29493 ; (Disassembled source code by using Hex-Rays IDA disassembler) + 29494 ; + 29495 00003BF8 E8FB06 call init_copycmd_option ; MSDOS 6.22 + 29496 + 29497 00003BFB BE8100 mov si,81h ; SI = ptr to command line + 29498 ;mov bl,[PLUS_CHR] ; BL = special delimiter = "+" + 29499 ; 23/03/2023 + 29500 00003BFE B32B mov bl,'+' + 29501 00003C00 FE06[329F] inc byte [expand_star] ; CParse 'expand * to ?s' = true + 29502 00003C04 C606[A49D]01 mov byte [cpyflag],1 ; CParse 'called from COPY' = true + 29503 + 29504 ;* Scan the command line for destination information. + 29505 + 29506 DESTSCAN: + 29507 00003C09 31ED xor bp,bp ; BP = switch flag accumulator + 29508 00003C0B BF[7B9E] mov di,ScanBuf ; ES:DI = ptr to pathname buf + 29509 ; 23/03/2023 + 29510 00003C0E 8936[989D] mov [parse_last],si ;AN018; save cmd line ptr + 29511 00003C12 E8920B call cparse ; parse next object + 29512 00003C15 9C pushf ; (*) ; save CParse flags + 29513 00003C16 FE06[DC9E] inc byte [objcnt] ; count object + 29514 00003C1A F6C780 test bh,80h + 29515 00003C1D 7405 jz short NOCOPY ; no "+" delimiter + 29516 00003C1F C606[DB9E]01 mov byte [PLUS],1 ; "+" delimiter occurred + 29517 NOCOPY: + 29518 00003C24 F6C701 test bh,1 + 29519 00003C27 747D jz short TESTP2 ; not a switch + 29520 + 29521 ; Found a switch. + 29522 + 29523 ; 23/03/2023 - Retro DOS v4.0 COMMAND.COM + 29524 ; + 29525 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 29526 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3F43h + 29527 CHK_CP_SWITCH: + 29528 ; MSDOS 6.0 + 29529 00003C29 F7C51000 test bp,10h + 29530 ;test bp,SwitchV ; 10h ;AN038; Verify requested? + 29531 00003C2D 740B jz short NOT_SLASHV ;AN038; No - set the switch + 29532 ;test word [AllSwitch],10h + 29533 00003C2F F606[119C]10 test byte [AllSwitch],10h + 29534 ;test byte [AllSwitch],SwitchV ;AN038; Verify already entered? + 29535 00003C34 7404 jz short NOT_SLASHV ;AN038; No - set the switch + 29536 ;AD018; ;or word [AllSwitch],FBadSwitch ;AN038; Set up bad switch + 29537 ;or bp,FBadSwitch ;AN018; Set up bad switch + 29538 00003C36 81CD0040 or bp,4000h + 29539 NOT_SLASHV: + 29540 ; **************************************** + 29541 ; 12/06/2023 + 29542 ; Retro DOS v4.2 COMMAND.COM + 29543 ; MSDOS 6.22 COMMAND.COM code only ! + 29544 ; (Disassembled source code by using Hex-Rays IDA disassembler) + 29545 ; **************************************** + 29546 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:3F55h 29547 ; - 29548 ;test word [AllSwitch],40h - 29549 00003C40 F606[119C]40 test byte [AllSwitch],40h ; [AllSwitch] negative (-Y) flag - 29550 00003C45 7507 jnz short NOT_SLASHY1 ; N flag - 29551 ;test word [AllSwitch],80h - 29552 00003C47 F606[119C]80 test byte [AllSwitch],80h ; [AllSwitch] SwitchY (Y) flag - 29553 00003C4C 7404 jz short NOT_SLASHY2 - 29554 NOT_SLASHY1: - 29555 00003C4E 81CD0040 or bp,4000h ; FBadSwitch (Repetitive) - 29556 NOT_SLASHY2: ; Set up bad switch - 29557 00003C52 C606[F19E]00 mov byte [cox_y_override],0 ; cox_y setting will be used - 29558 CHK_SLASHY0: - 29559 00003C57 F7C58000 test bp,80h - 29560 00003C5B 742B jz short CHK_SLASHY4 ; not a /Y switch - 29561 ; - 29562 00003C5D 8A04 mov al,[si] - 29563 00003C5F 3C79 cmp al,'y' - 29564 00003C61 740A je short CHK_SLASHY1 - 29565 00003C63 3C59 cmp al,'Y' - 29566 00003C65 7406 je short CHK_SLASHY1 - 29567 00003C67 81CD0040 or bp,4000h ; FBadSwitch - 29568 ; ; Set up bad switch - 29569 00003C6B EB1B jmp short CHK_SLASHY4 - 29570 CHK_SLASHY1: - 29571 00003C6D C60420 mov byte [si],20h ; ' ' - 29572 00003C70 46 inc si - 29573 ;test word [AllSwitch],40h - 29574 00003C71 F606[119C]40 test byte [AllSwitch],40h ; [AllSwitch] negative (-Y) flag - 29575 00003C76 7507 jnz short CHK_SLASHY2 ; N flag - 29576 ;test word [AllSwitch],80h - 29577 00003C78 F606[119C]80 test byte [AllSwitch],80h ; [AllSwitch] SwitchY (Y) flag - 29578 00003C7D 7404 jz short CHK_SLASHY3 - 29579 CHK_SLASHY2: - 29580 00003C7F 81CD0040 or bp,4000h ; FBadSwitch (Repetitive) - 29581 ; ; Set up bad switch - 29582 CHK_SLASHY3: - 29583 00003C83 C606[F19E]01 mov byte [cox_y_override],1 - 29584 CHK_SLASHY4: - 29585 ; **************************************** - 29586 ; 12/06/2023 - 29587 ;NOT_SLASHV: - 29588 ;or [DestSwitch],bp ; assume destination - 29589 ;or [AllSwitch],bp ; keep tabs on all switches - 29590 - 29591 ; 12/06/2023 - 29592 ; Retro DOS v4.2 COMMAND.COM - 29593 ; MSDOS 6.22 COMMAND.COM -TRANGROUP:3FA7h - 29594 00003C88 092E[0F9C] or [DestSwitch],bp ; set [DestSwitch] SwitchY flag to 1 - 29595 00003C8C 092E[119C] or [AllSwitch],bp ; set [AllSwitch] SwitchY flag to 1 - 29596 ;test bp,~SwitchCopy ; Bad switch? - 29597 00003C90 F7C5237F test bp,7F23h ; MSDOS 6.22 ; ~SwitchCopy ; not SwitchCopy - 29598 00003C94 740A jz short NOT_BAD_SWITCH ; Switches are okay - 29599 - 29600 ; 12/06/2023 - 29601 ; 23/03/2023 - 29602 ; MSDOS 6.0 - 29603 ;;test bp,not SwitchCopy ;AN018; Bad switch? - 29604 ;test bp,7FE3h ; test bp,~SwitchCopy - 29605 ;jz short NOT_BAD_SWITCH ;AN018; Switches are okay - 29606 - 29607 00003C96 9D popf ; (*) ;AN018; fix up stack - 29608 00003C97 B80300 mov ax,BadSwt_Ptr ; 3 ;AN018; get "Invalid switch" message number - 29609 00003C9A E8CDE8 call setup_parse_error_msg ;AN018; setup to print the message - 29610 00003C9D E986F0 jmp cerror ;AC018; exit - 29611 NOT_BAD_SWITCH: - 29612 00003CA0 9D popf ; restore CParse flags - 29613 00003CA1 7233 jc short CHECKDONE ; found CR - 29614 00003CA3 E963FF jmp DESTSCAN ; continue scanning for destination - 29615 TESTP2: - 29616 00003CA6 9D popf ; (*) ; restore CParse flags - 29617 00003CA7 722D jc short CHECKDONE ; found CR - 29618 00003CA9 F6C780 test bh,80h - 29619 00003CAC 7504 jnz short GOTPLUS ; found a "+pathname" argument - 29620 00003CAE FE06[0A9C] inc byte [ArgC] ; count independent pathname args - 29621 GOTPLUS: - 29622 00003CB2 56 push si ; save cmd line ptr - 29623 00003CB3 A1[F69E] mov ax,[STARTEL] ; AX = ptr to last path element - 29624 00003CB6 BE[7B9E] mov si,ScanBuf ; SI = ptr to path string - 29625 00003CB9 29F0 sub ax,si ; AX = offset of last element - 29626 00003CBB BF[BE9D] mov di,DestBuf ; DI = ptr to destination buf - 29627 00003CBE 01F8 add ax,di ; AX = ptr to last element in - 29628 ; destination path buffer - 29629 00003CC0 A3[BB9D] mov [DestTail],ax ; save ptr to last element - 29630 00003CC3 880E[BA9D] mov [DestSiz],cl ; save path string length - 29631 00003CC7 41 inc cx ; CX = mov length (incl null) - 29632 00003CC8 F3A4 rep movsb ; DestBuf = possible destination path - 29633 00003CCA 883E[BD9D] mov [DestInfo],bh ; save CParse info flags - 29634 ;mov word [DestSwitch],0 ; clear destination switches - 29635 ; 10/08/2024 - 29636 00003CCE 890E[0F9C] mov [DestSwitch],cx ; 0 - 29637 00003CD2 5E pop si ; SI = ptr into cmd line again - 29638 00003CD3 E933FF jmp DESTSCAN ;AC018; continue scanning for dest - 29639 - 29640 CHECKDONE: - 29641 ; We reached the CR. The destination scan is finished. + 29548 00003C3A F7C54000 test bp,40h ; negative Y (-Y) switch flag + 29549 00003C3E 7417 jz short CHK_SLASHY0 + 29550 ; + 29551 ;test word [AllSwitch],40h + 29552 00003C40 F606[119C]40 test byte [AllSwitch],40h ; [AllSwitch] negative (-Y) flag + 29553 00003C45 7507 jnz short NOT_SLASHY1 ; N flag + 29554 ;test word [AllSwitch],80h + 29555 00003C47 F606[119C]80 test byte [AllSwitch],80h ; [AllSwitch] SwitchY (Y) flag + 29556 00003C4C 7404 jz short NOT_SLASHY2 + 29557 NOT_SLASHY1: + 29558 00003C4E 81CD0040 or bp,4000h ; FBadSwitch (Repetitive) + 29559 NOT_SLASHY2: ; Set up bad switch + 29560 00003C52 C606[F19E]00 mov byte [cox_y_override],0 ; cox_y setting will be used + 29561 CHK_SLASHY0: + 29562 00003C57 F7C58000 test bp,80h + 29563 00003C5B 742B jz short CHK_SLASHY4 ; not a /Y switch + 29564 ; + 29565 00003C5D 8A04 mov al,[si] + 29566 00003C5F 3C79 cmp al,'y' + 29567 00003C61 740A je short CHK_SLASHY1 + 29568 00003C63 3C59 cmp al,'Y' + 29569 00003C65 7406 je short CHK_SLASHY1 + 29570 00003C67 81CD0040 or bp,4000h ; FBadSwitch + 29571 ; ; Set up bad switch + 29572 00003C6B EB1B jmp short CHK_SLASHY4 + 29573 CHK_SLASHY1: + 29574 00003C6D C60420 mov byte [si],20h ; ' ' + 29575 00003C70 46 inc si + 29576 ;test word [AllSwitch],40h + 29577 00003C71 F606[119C]40 test byte [AllSwitch],40h ; [AllSwitch] negative (-Y) flag + 29578 00003C76 7507 jnz short CHK_SLASHY2 ; N flag + 29579 ;test word [AllSwitch],80h + 29580 00003C78 F606[119C]80 test byte [AllSwitch],80h ; [AllSwitch] SwitchY (Y) flag + 29581 00003C7D 7404 jz short CHK_SLASHY3 + 29582 CHK_SLASHY2: + 29583 00003C7F 81CD0040 or bp,4000h ; FBadSwitch (Repetitive) + 29584 ; ; Set up bad switch + 29585 CHK_SLASHY3: + 29586 00003C83 C606[F19E]01 mov byte [cox_y_override],1 + 29587 CHK_SLASHY4: + 29588 ; **************************************** + 29589 ; 12/06/2023 + 29590 ;NOT_SLASHV: + 29591 ;or [DestSwitch],bp ; assume destination + 29592 ;or [AllSwitch],bp ; keep tabs on all switches + 29593 + 29594 ; 12/06/2023 + 29595 ; Retro DOS v4.2 COMMAND.COM + 29596 ; MSDOS 6.22 COMMAND.COM -TRANGROUP:3FA7h + 29597 00003C88 092E[0F9C] or [DestSwitch],bp ; set [DestSwitch] SwitchY flag to 1 + 29598 00003C8C 092E[119C] or [AllSwitch],bp ; set [AllSwitch] SwitchY flag to 1 + 29599 ;test bp,~SwitchCopy ; Bad switch? + 29600 00003C90 F7C5237F test bp,7F23h ; MSDOS 6.22 ; ~SwitchCopy ; not SwitchCopy + 29601 00003C94 740A jz short NOT_BAD_SWITCH ; Switches are okay + 29602 + 29603 ; 12/06/2023 + 29604 ; 23/03/2023 + 29605 ; MSDOS 6.0 + 29606 ;;test bp,not SwitchCopy ;AN018; Bad switch? + 29607 ;test bp,7FE3h ; test bp,~SwitchCopy + 29608 ;jz short NOT_BAD_SWITCH ;AN018; Switches are okay + 29609 + 29610 00003C96 9D popf ; (*) ;AN018; fix up stack + 29611 00003C97 B80300 mov ax,BadSwt_Ptr ; 3 ;AN018; get "Invalid switch" message number + 29612 00003C9A E8CDE8 call setup_parse_error_msg ;AN018; setup to print the message + 29613 00003C9D E986F0 jmp cerror ;AC018; exit + 29614 NOT_BAD_SWITCH: + 29615 00003CA0 9D popf ; restore CParse flags + 29616 00003CA1 7233 jc short CHECKDONE ; found CR + 29617 00003CA3 E963FF jmp DESTSCAN ; continue scanning for destination + 29618 TESTP2: + 29619 00003CA6 9D popf ; (*) ; restore CParse flags + 29620 00003CA7 722D jc short CHECKDONE ; found CR + 29621 00003CA9 F6C780 test bh,80h + 29622 00003CAC 7504 jnz short GOTPLUS ; found a "+pathname" argument + 29623 00003CAE FE06[0A9C] inc byte [ArgC] ; count independent pathname args + 29624 GOTPLUS: + 29625 00003CB2 56 push si ; save cmd line ptr + 29626 00003CB3 A1[F69E] mov ax,[STARTEL] ; AX = ptr to last path element + 29627 00003CB6 BE[7B9E] mov si,ScanBuf ; SI = ptr to path string + 29628 00003CB9 29F0 sub ax,si ; AX = offset of last element + 29629 00003CBB BF[BE9D] mov di,DestBuf ; DI = ptr to destination buf + 29630 00003CBE 01F8 add ax,di ; AX = ptr to last element in + 29631 ; destination path buffer + 29632 00003CC0 A3[BB9D] mov [DestTail],ax ; save ptr to last element + 29633 00003CC3 880E[BA9D] mov [DestSiz],cl ; save path string length + 29634 00003CC7 41 inc cx ; CX = mov length (incl null) + 29635 00003CC8 F3A4 rep movsb ; DestBuf = possible destination path + 29636 00003CCA 883E[BD9D] mov [DestInfo],bh ; save CParse info flags + 29637 ;mov word [DestSwitch],0 ; clear destination switches + 29638 ; 10/08/2024 + 29639 00003CCE 890E[0F9C] mov [DestSwitch],cx ; 0 + 29640 00003CD2 5E pop si ; SI = ptr into cmd line again + 29641 00003CD3 E933FF jmp DESTSCAN ;AC018; continue scanning for dest 29642 - 29643 ; Disallow "copy file1+" as file overwriting itself. - 29644 ; - 29645 ; (Note that "copy file1+file2+" will be accepted, and - 29646 ; equivalent to "copy file1+file2".) - 29647 - 29648 ; Bugbug: it looks like "copy /x file1+" would slip - 29649 ; through this check, since the switch would count - 29650 ; as another object in ObjCnt. - 29651 - 29652 00003CD6 803E[DB9E]01 cmp byte [PLUS],1 ; "+" with - 29653 00003CDB 7514 jnz short CDCONT - 29654 00003CDD 803E[0A9C]01 cmp byte [ArgC],1 ; one arg, - 29655 00003CE2 750D jnz short CDCONT - 29656 00003CE4 803E[DC9E]02 cmp byte [objcnt],2 ; two objects.. - 29657 00003CE9 7506 jnz short CDCONT - 29658 00003CEB BA[0390] mov dx,OVERWR_PTR - 29659 00003CEE E9D207 jmp COPYERR ; is file overwrite - 29660 - 29661 CDCONT: - 29662 00003CF1 A0[DB9E] mov al,[PLUS] ; AL = '"+" occurred' - 29663 00003CF4 A2[089C] mov [Concat],al ; if "+" occurred, we're concatenating - 29664 00003CF7 D0E0 shl al,1 - 29665 00003CF9 D0E0 shl al,1 - 29666 00003CFB A2[D49E] mov [INEXACT],al ; therefore making an inexact copy - 29667 ;mov dx,BADARGSPTR ; MSDOS 3.3 ; 18/04/2023 - 29668 00003CFE A0[0A9C] mov al,[ArgC] ; AL = # independent arguments - 29669 - 29670 ; 23/03/2023 - 29671 ; MSDOS 3.3 - 29672 ;or al,al - 29673 ;jz short CERROR4J - 29674 ; MSDOS 6.0 - 29675 00003D01 08C0 or al,al - 29676 00003D03 750B jnz short TRY_TOO_MANY ; more than 0 args; check if too many - 29677 - 29678 00003D05 BA[D78F] mov dx,extend_buf_ptr ; DX = ptr to msg block - 29679 00003D08 C706[D78F]0200 mov word [extend_buf_ptr],LessArgs_Ptr ; 2 - 29680 ;mov word [extend_buf_ptr],2 ; set msg # "param missing" - 29681 00003D0E EB0D jmp short CERROR_PARSEJ ; take parse error exit - 29682 - 29683 ; more than 0 args; check if too many - 29684 TRY_TOO_MANY: - 29685 00003D10 3C02 cmp al,2 - 29686 00003D12 7611 jbe short ACOUNTOK ; <= 2 arguments - ok - 29687 - 29688 ; 23/03/2023 - 29689 ; MSDOS 6.0 - 29690 00003D14 BA[D78F] mov dx,extend_buf_ptr ; DX = ptr to msg block - 29691 00003D17 C706[D78F]0100 mov word [extend_buf_ptr],MoreArgs_Ptr - 29692 ;mov word [extend_buf_ptr],1 ; set msg # "too many params" - 29693 CERROR_PARSEJ: - 29694 00003D1D C606[D58F]02 mov byte [msg_disp_class],parse_msg_class ; 2 - 29695 ; parse error message - 29696 CERROR4J: - 29697 00003D22 E901F0 jmp cerror - 29698 - 29699 ACOUNTOK: - 29700 00003D25 BD[B99D] mov bp,DestVars ; BP = base of dest variables + 29643 CHECKDONE: + 29644 ; We reached the CR. The destination scan is finished. + 29645 + 29646 ; Disallow "copy file1+" as file overwriting itself. + 29647 ; + 29648 ; (Note that "copy file1+file2+" will be accepted, and + 29649 ; equivalent to "copy file1+file2".) + 29650 + 29651 ; Bugbug: it looks like "copy /x file1+" would slip + 29652 ; through this check, since the switch would count + 29653 ; as another object in ObjCnt. + 29654 + 29655 00003CD6 803E[DB9E]01 cmp byte [PLUS],1 ; "+" with + 29656 00003CDB 7514 jnz short CDCONT + 29657 00003CDD 803E[0A9C]01 cmp byte [ArgC],1 ; one arg, + 29658 00003CE2 750D jnz short CDCONT + 29659 00003CE4 803E[DC9E]02 cmp byte [objcnt],2 ; two objects.. + 29660 00003CE9 7506 jnz short CDCONT + 29661 00003CEB BA[0390] mov dx,OVERWR_PTR + 29662 00003CEE E9D207 jmp COPYERR ; is file overwrite + 29663 + 29664 CDCONT: + 29665 00003CF1 A0[DB9E] mov al,[PLUS] ; AL = '"+" occurred' + 29666 00003CF4 A2[089C] mov [Concat],al ; if "+" occurred, we're concatenating + 29667 00003CF7 D0E0 shl al,1 + 29668 00003CF9 D0E0 shl al,1 + 29669 00003CFB A2[D49E] mov [INEXACT],al ; therefore making an inexact copy + 29670 ;mov dx,BADARGSPTR ; MSDOS 3.3 ; 18/04/2023 + 29671 00003CFE A0[0A9C] mov al,[ArgC] ; AL = # independent arguments + 29672 + 29673 ; 23/03/2023 + 29674 ; MSDOS 3.3 + 29675 ;or al,al + 29676 ;jz short CERROR4J + 29677 ; MSDOS 6.0 + 29678 00003D01 08C0 or al,al + 29679 00003D03 750B jnz short TRY_TOO_MANY ; more than 0 args; check if too many + 29680 + 29681 00003D05 BA[D78F] mov dx,extend_buf_ptr ; DX = ptr to msg block + 29682 00003D08 C706[D78F]0200 mov word [extend_buf_ptr],LessArgs_Ptr ; 2 + 29683 ;mov word [extend_buf_ptr],2 ; set msg # "param missing" + 29684 00003D0E EB0D jmp short CERROR_PARSEJ ; take parse error exit + 29685 + 29686 ; more than 0 args; check if too many + 29687 TRY_TOO_MANY: + 29688 00003D10 3C02 cmp al,2 + 29689 00003D12 7611 jbe short ACOUNTOK ; <= 2 arguments - ok + 29690 + 29691 ; 23/03/2023 + 29692 ; MSDOS 6.0 + 29693 00003D14 BA[D78F] mov dx,extend_buf_ptr ; DX = ptr to msg block + 29694 00003D17 C706[D78F]0100 mov word [extend_buf_ptr],MoreArgs_Ptr + 29695 ;mov word [extend_buf_ptr],1 ; set msg # "too many params" + 29696 CERROR_PARSEJ: + 29697 00003D1D C606[D58F]02 mov byte [msg_disp_class],parse_msg_class ; 2 + 29698 ; parse error message + 29699 CERROR4J: + 29700 00003D22 E901F0 jmp cerror 29701 - 29702 00003D28 3C01 cmp al,1 - 29703 00003D2A 7520 jnz short GOT2ARGS + 29702 ACOUNTOK: + 29703 00003D25 BD[B99D] mov bp,DestVars ; BP = base of dest variables 29704 - 29705 ; Only one independent pathname argument on command line. - 29706 ; Set destination to d:*.*, where d: is current drive. + 29705 00003D28 3C01 cmp al,1 + 29706 00003D2A 7520 jnz short GOT2ARGS 29707 - 29708 ; Bugbug: but is this appropriate for "copy x:file1+x:file2"? - 29709 ; The two files would be appended as d:file1, rather than x:file1. + 29708 ; Only one independent pathname argument on command line. + 29709 ; Set destination to d:*.*, where d: is current drive. 29710 - 29711 00003D2C A0[079C] mov al,[CURDRV] ; AL = current drive (0 = A) - 29712 ;add al,[CAPITAL_A] ; AL = current drive letter - 29713 ; 23/03/2023 - 29714 00003D2F 0441 add al,'A' - 29715 00003D31 B43A mov ah,':' ; AX = "d:" - 29716 ;mov byte [bp+1],2 - 29717 00003D33 C6460102 mov byte [bp+VARSTRUC.SIZ],2 ; pathname length = 2 - 29718 - 29719 00003D37 BF[BE9D] mov di,DestBuf ; ES:DI = ptr to dest path buf - 29720 00003D3A AB stosw ; store "d:" - 29721 - 29722 00003D3B C706[0F9C]0000 mov word [DestSwitch],0 ; clear destination switches - 29723 ;mov byte [bp+4],2 - 29724 00003D41 C6460402 mov byte [bp+VARSTRUC.INFO],2 ; mark destination 'wildcard present' - 29725 ;mov byte [bp+VARSTRUC.ISDIR],0 ; mark destination 'not a directory' - 29726 ;mov byte [bp+0],0 - 29727 00003D45 C6460000 mov byte [bp],0 - 29728 00003D49 E82C0A call SETSTARS ; add wildcards - 29729 GOT2ARGS: - 29730 ; If destination pathname is "d:", add full wildcard filename - 29731 - 29732 ;cmp byte [bp+1],2 - 29733 00003D4C 807E0102 cmp byte [bp+VARSTRUC.SIZ],2 - 29734 00003D50 7516 jnz short NOTSHORTDEST ; not two chars, can't be "d:" - 29735 00003D52 B03A mov al,':' ; 3Ah - 29736 00003D54 3806[BF9D] cmp byte [DestBuf+1],al - 29737 00003D58 750E jnz short NOTSHORTDEST ; it's just a 2-character filename - 29738 ;or byte [bp+4],2 - 29739 00003D5A 804E0402 or byte [bp+VARSTRUC.INFO],2 ; mark destination 'wildcard present' - 29740 00003D5E BF[C09D] mov di,DestBuf+2 ; ES:DI = ptr after "d:" - 29741 ;mov byte [bp+VARSTRUC.ISDIR],0 ; mark destination 'not a directory' - 29742 ;mov byte [bp+0],0 - 29743 00003D61 C6460000 mov byte [bp],0 - 29744 00003D65 E8100A call SETSTARS ; add wildcards - 29745 NOTSHORTDEST: - 29746 ; If destination pathname ends with "\", try to make - 29747 ; sure it's "d:\". - 29748 - 29749 ;mov di,[bp+2] - 29750 00003D68 8B7E02 mov di,[bp+VARSTRUC.TTAIL] ; DI = ptr to last path element - 29751 00003D6B 803D00 cmp byte [di],0 - 29752 00003D6E 7515 jnz short CHKSWTCHES ; not a null, so last char not "\" - 29753 - 29754 00003D70 BA[3791] mov dx,badcd_ptr - 29755 00003D73 B03A mov al,':' - 29756 00003D75 3845FE cmp [di-2],al - 29757 00003D78 75A8 jne short CERROR4J ; it's not "d:\", exit with error msg - 29758 ;mov byte [bp+0],2 - 29759 ;mov byte [bp+VARSTRUC.ISDIR],2 ; destination 'is a directory' - 29760 00003D7A C6460002 mov byte [bp],2 - 29761 ;or byte [bp+4],6 - 29762 00003D7E 804E0406 or byte [bp+VARSTRUC.INFO],6 ; destination wildcarded and contains - 29763 ; path character - 29764 00003D82 E8F309 call SETSTARS ; add wildcards - 29765 CHKSWTCHES: - 29766 ; We have enough information about the destination for now. - 29767 - 29768 ; Turn on verify if requested. Save the current verify flag. - 29769 - 29770 ; 23/03/2023 - 29771 ; MSDOS 6.0 (& MSDOS 5.0) COMMAND.COM - 29772 ;mov dx,BADPARMPTR - 29773 - 29774 00003D85 A1[119C] mov ax,[AllSwitch] ; AX = all switch flags - 29775 - 29776 ; 23/03/2023 - 29777 ; MSDOS 3.3 - 29778 ;;test ax,~SWITCHCOPY ; 7FE3h - 29779 ;test ax,NOT_SWITCHCOPY ; 7FE3h ; 13/10/2018 - 29780 ;jnz short CERROR4J - 29781 - 29782 ; 23/03/2023 - 29783 ; MSDOS 3.3 (& MSDOS 6.0) - 29784 ;test ax,SwitchV ; 10h - 29785 ; 18/04/2023 - 29786 ;test ax,10h - 29787 00003D88 A810 test al,10h ; test al,SwitchV - 29788 00003D8A 7414 jz short NOVERIF ; no /v, no verify - 29789 - 29790 00003D8C B454 mov ah,Get_Verify_On_Write ; 54h - 29791 00003D8E CD21 int 21h ; DOS - 2+ - GET VERIFY FLAG - 29792 ; Return: AL = 00h if flag OFF - 29793 ; AL = 01h if flag ON - 29794 00003D90 1E push ds - 29795 00003D91 8E1E[F59B] mov ds,[RESSEG] - 29796 00003D95 30E4 xor ah,ah - 29797 00003D97 A3[A702] mov [VerVal],ax ; save current verify flag - 29798 00003D9A 1F pop ds - 29799 00003D9B B8012E mov ax,(SET_VERIFY_ON_WRITE<<8)|1 ; 2E01h - 29800 00003D9E CD21 int 21h ; DOS - SET VERIFY FLAG - 29801 ; DL = 00h,AL = 01h VERIFY on / 00h VERIFY off - 29802 NOVERIF: - 29803 ;* Scan for first source. - 29804 - 29805 00003DA0 31ED xor bp,bp ; BP = switch flags accumulator - 29806 00003DA2 BE8100 mov si,81h ; SI = ptr into command line - 29807 ;mov bl,[PLUS_CHR] ; BL = special CParse delimiter = "+" - 29808 ; 23/03/2023 - 29809 00003DA5 B32B mov bl,'+' ; 2Bh - 29810 SCANFSRC: - 29811 00003DA7 BF[7B9E] mov di,ScanBuf ; DI = ptr to pathname buf - 29812 00003DAA E8FA09 call cparse ; parse first source pathname - 29813 00003DAD F6C701 test bh,1 ; switch? - 29814 00003DB0 75F5 jnz short SCANFSRC ; yes, try again - 29815 00003DB2 092E[0F9C] or [DestSwitch],bp ; include copy-wide switches on dest - 29816 - 29817 ; Set ascii copying mode if concatenating, unless /b is specified. - 29818 - 29819 ; 23/03/2023 - 29820 00003DB6 F7C50800 test bp,8 - 29821 ;test bp,SWITCHB - 29822 00003DBA 750C jnz short NOSETCASC ; /b - explicit binary copy - 29823 00003DBC 803E[089C]00 cmp byte [Concat],0 - 29824 00003DC1 7405 jz short NOSETCASC ; we're not concatenating - 29825 00003DC3 C606[DA9E]04 mov byte [ASCII],4 - 29826 ;mov byte [ASCII],SWITCHA ; set ascii copy - 29827 NOSETCASC: - 29828 00003DC8 E83004 call SOURCE_SET ; set source variables - 29829 00003DCB E84400 call FRSTSRC ; set up first source copy - 29830 00003DCE E99800 jmp FIRSTENT ; jump into the copy loop - 29831 - 29832 ; --------------------------------------------------------------------------- - 29833 - 29834 ; 24/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29835 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3AE9h - 29836 ENDCOPY: - 29837 ;* End of the road. Close destination, display # files - 29838 ; copied (meaning # destinations), and go back to main - 29839 ; transient COMMAND code. - 29840 - 29841 00003DD1 E83503 call CLOSEDEST - 29842 ENDCOPY2: - 29843 00003DD4 BA[0C90] mov dx,copied_ptr - 29844 00003DD7 8B36[209C] mov si,[FileCnt] - 29845 00003DDB 8936[A29D] mov [Copy_num],si - 29846 00003DDF E84616 call std_printf - 29847 00003DE2 E91FC3 jmp TCOMMAND ; stack could be messed up - 29848 - 29849 ; --------------------------------------------------------------------------- - 29850 - 29851 SRCNONEXIST: - 29852 ;* Source doesn't exist. If concatenating, ignore and continue. - 29853 ; Otherwise, say 'file not found' and quit. - 29854 - 29855 00003DE5 803E[089C]00 cmp byte [Concat],0 - 29856 00003DEA 7546 jne short NEXTSRC ; concatenating - go on to next source + 29711 ; Bugbug: but is this appropriate for "copy x:file1+x:file2"? + 29712 ; The two files would be appended as d:file1, rather than x:file1. + 29713 + 29714 00003D2C A0[079C] mov al,[CURDRV] ; AL = current drive (0 = A) + 29715 ;add al,[CAPITAL_A] ; AL = current drive letter + 29716 ; 23/03/2023 + 29717 00003D2F 0441 add al,'A' + 29718 00003D31 B43A mov ah,':' ; AX = "d:" + 29719 ;mov byte [bp+1],2 + 29720 00003D33 C6460102 mov byte [bp+VARSTRUC.SIZ],2 ; pathname length = 2 + 29721 + 29722 00003D37 BF[BE9D] mov di,DestBuf ; ES:DI = ptr to dest path buf + 29723 00003D3A AB stosw ; store "d:" + 29724 + 29725 00003D3B C706[0F9C]0000 mov word [DestSwitch],0 ; clear destination switches + 29726 ;mov byte [bp+4],2 + 29727 00003D41 C6460402 mov byte [bp+VARSTRUC.INFO],2 ; mark destination 'wildcard present' + 29728 ;mov byte [bp+VARSTRUC.ISDIR],0 ; mark destination 'not a directory' + 29729 ;mov byte [bp+0],0 + 29730 00003D45 C6460000 mov byte [bp],0 + 29731 00003D49 E82C0A call SETSTARS ; add wildcards + 29732 GOT2ARGS: + 29733 ; If destination pathname is "d:", add full wildcard filename + 29734 + 29735 ;cmp byte [bp+1],2 + 29736 00003D4C 807E0102 cmp byte [bp+VARSTRUC.SIZ],2 + 29737 00003D50 7516 jnz short NOTSHORTDEST ; not two chars, can't be "d:" + 29738 00003D52 B03A mov al,':' ; 3Ah + 29739 00003D54 3806[BF9D] cmp byte [DestBuf+1],al + 29740 00003D58 750E jnz short NOTSHORTDEST ; it's just a 2-character filename + 29741 ;or byte [bp+4],2 + 29742 00003D5A 804E0402 or byte [bp+VARSTRUC.INFO],2 ; mark destination 'wildcard present' + 29743 00003D5E BF[C09D] mov di,DestBuf+2 ; ES:DI = ptr after "d:" + 29744 ;mov byte [bp+VARSTRUC.ISDIR],0 ; mark destination 'not a directory' + 29745 ;mov byte [bp+0],0 + 29746 00003D61 C6460000 mov byte [bp],0 + 29747 00003D65 E8100A call SETSTARS ; add wildcards + 29748 NOTSHORTDEST: + 29749 ; If destination pathname ends with "\", try to make + 29750 ; sure it's "d:\". + 29751 + 29752 ;mov di,[bp+2] + 29753 00003D68 8B7E02 mov di,[bp+VARSTRUC.TTAIL] ; DI = ptr to last path element + 29754 00003D6B 803D00 cmp byte [di],0 + 29755 00003D6E 7515 jnz short CHKSWTCHES ; not a null, so last char not "\" + 29756 + 29757 00003D70 BA[3791] mov dx,badcd_ptr + 29758 00003D73 B03A mov al,':' + 29759 00003D75 3845FE cmp [di-2],al + 29760 00003D78 75A8 jne short CERROR4J ; it's not "d:\", exit with error msg + 29761 ;mov byte [bp+0],2 + 29762 ;mov byte [bp+VARSTRUC.ISDIR],2 ; destination 'is a directory' + 29763 00003D7A C6460002 mov byte [bp],2 + 29764 ;or byte [bp+4],6 + 29765 00003D7E 804E0406 or byte [bp+VARSTRUC.INFO],6 ; destination wildcarded and contains + 29766 ; path character + 29767 00003D82 E8F309 call SETSTARS ; add wildcards + 29768 CHKSWTCHES: + 29769 ; We have enough information about the destination for now. + 29770 + 29771 ; Turn on verify if requested. Save the current verify flag. + 29772 + 29773 ; 23/03/2023 + 29774 ; MSDOS 6.0 (& MSDOS 5.0) COMMAND.COM + 29775 ;mov dx,BADPARMPTR + 29776 + 29777 00003D85 A1[119C] mov ax,[AllSwitch] ; AX = all switch flags + 29778 + 29779 ; 23/03/2023 + 29780 ; MSDOS 3.3 + 29781 ;;test ax,~SWITCHCOPY ; 7FE3h + 29782 ;test ax,NOT_SWITCHCOPY ; 7FE3h ; 13/10/2018 + 29783 ;jnz short CERROR4J + 29784 + 29785 ; 23/03/2023 + 29786 ; MSDOS 3.3 (& MSDOS 6.0) + 29787 ;test ax,SwitchV ; 10h + 29788 ; 18/04/2023 + 29789 ;test ax,10h + 29790 00003D88 A810 test al,10h ; test al,SwitchV + 29791 00003D8A 7414 jz short NOVERIF ; no /v, no verify + 29792 + 29793 00003D8C B454 mov ah,Get_Verify_On_Write ; 54h + 29794 00003D8E CD21 int 21h ; DOS - 2+ - GET VERIFY FLAG + 29795 ; Return: AL = 00h if flag OFF + 29796 ; AL = 01h if flag ON + 29797 00003D90 1E push ds + 29798 00003D91 8E1E[F59B] mov ds,[RESSEG] + 29799 00003D95 30E4 xor ah,ah + 29800 00003D97 A3[A702] mov [VerVal],ax ; save current verify flag + 29801 00003D9A 1F pop ds + 29802 00003D9B B8012E mov ax,(SET_VERIFY_ON_WRITE<<8)|1 ; 2E01h + 29803 00003D9E CD21 int 21h ; DOS - SET VERIFY FLAG + 29804 ; DL = 00h,AL = 01h VERIFY on / 00h VERIFY off + 29805 NOVERIF: + 29806 ;* Scan for first source. + 29807 + 29808 00003DA0 31ED xor bp,bp ; BP = switch flags accumulator + 29809 00003DA2 BE8100 mov si,81h ; SI = ptr into command line + 29810 ;mov bl,[PLUS_CHR] ; BL = special CParse delimiter = "+" + 29811 ; 23/03/2023 + 29812 00003DA5 B32B mov bl,'+' ; 2Bh + 29813 SCANFSRC: + 29814 00003DA7 BF[7B9E] mov di,ScanBuf ; DI = ptr to pathname buf + 29815 00003DAA E8FA09 call cparse ; parse first source pathname + 29816 00003DAD F6C701 test bh,1 ; switch? + 29817 00003DB0 75F5 jnz short SCANFSRC ; yes, try again + 29818 00003DB2 092E[0F9C] or [DestSwitch],bp ; include copy-wide switches on dest + 29819 + 29820 ; Set ascii copying mode if concatenating, unless /b is specified. + 29821 + 29822 ; 23/03/2023 + 29823 00003DB6 F7C50800 test bp,8 + 29824 ;test bp,SWITCHB + 29825 00003DBA 750C jnz short NOSETCASC ; /b - explicit binary copy + 29826 00003DBC 803E[089C]00 cmp byte [Concat],0 + 29827 00003DC1 7405 jz short NOSETCASC ; we're not concatenating + 29828 00003DC3 C606[DA9E]04 mov byte [ASCII],4 + 29829 ;mov byte [ASCII],SWITCHA ; set ascii copy + 29830 NOSETCASC: + 29831 00003DC8 E83004 call SOURCE_SET ; set source variables + 29832 00003DCB E84400 call FRSTSRC ; set up first source copy + 29833 00003DCE E99800 jmp FIRSTENT ; jump into the copy loop + 29834 + 29835 ; --------------------------------------------------------------------------- + 29836 + 29837 ; 24/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29838 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3AE9h + 29839 ENDCOPY: + 29840 ;* End of the road. Close destination, display # files + 29841 ; copied (meaning # destinations), and go back to main + 29842 ; transient COMMAND code. + 29843 + 29844 00003DD1 E83503 call CLOSEDEST + 29845 ENDCOPY2: + 29846 00003DD4 BA[0C90] mov dx,copied_ptr + 29847 00003DD7 8B36[209C] mov si,[FileCnt] + 29848 00003DDB 8936[A29D] mov [Copy_num],si + 29849 00003DDF E84616 call std_printf + 29850 00003DE2 E91FC3 jmp TCOMMAND ; stack could be messed up + 29851 + 29852 ; --------------------------------------------------------------------------- + 29853 + 29854 SRCNONEXIST: + 29855 ;* Source doesn't exist. If concatenating, ignore and continue. + 29856 ; Otherwise, say 'file not found' and quit. 29857 - 29858 ; 24/03/2023 - 29859 ; MSDOS 3.3 - 29860 ;mov dx,SRCBUF - 29861 ;mov [STRING_PTR_1],dx - 29862 ;mov dx,STRINGBUF1PTR - 29863 ;call STD_PRINTF - 29864 ;mov dx,FNOTFOUNDPTR - 29865 ;jmp COPYERR - 29866 - 29867 ; 24/*03/2023 - 29868 ; MSDOS 6.0 - 29869 ; Set up error message. - 29870 00003DEC C606[D58F]01 mov byte [msg_disp_class],ext_msg_class ; 1 - 29871 ; extended error msg - 29872 00003DF1 BA[D78F] mov dx,extend_buf_ptr ; DX = ptr to msg block - 29873 00003DF4 C706[D78F]0200 mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND ; 2 - 29874 ; 'file not found' msg# - 29875 00003DFA C706[A09D][219E] mov word [string_ptr_2],SrcBuf - 29876 ; point at bad pathname - 29877 00003E00 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 - 29878 ; 1 substitution - 29879 00003E05 E9BB06 jmp COPYERR ; print msg and clean up - 29880 - 29881 ; --------------------------------------------------------------------------- - 29882 - 29883 SOURCEPROC: - 29884 - 29885 ;* Preparatory processing for each source file. - 29886 ; Called at FrstSrc for first source file. + 29858 00003DE5 803E[089C]00 cmp byte [Concat],0 + 29859 00003DEA 7546 jne short NEXTSRC ; concatenating - go on to next source + 29860 + 29861 ; 24/03/2023 + 29862 ; MSDOS 3.3 + 29863 ;mov dx,SRCBUF + 29864 ;mov [STRING_PTR_1],dx + 29865 ;mov dx,STRINGBUF1PTR + 29866 ;call STD_PRINTF + 29867 ;mov dx,FNOTFOUNDPTR + 29868 ;jmp COPYERR + 29869 + 29870 ; 24/*03/2023 + 29871 ; MSDOS 6.0 + 29872 ; Set up error message. + 29873 00003DEC C606[D58F]01 mov byte [msg_disp_class],ext_msg_class ; 1 + 29874 ; extended error msg + 29875 00003DF1 BA[D78F] mov dx,extend_buf_ptr ; DX = ptr to msg block + 29876 00003DF4 C706[D78F]0200 mov word [extend_buf_ptr],ERROR_FILE_NOT_FOUND ; 2 + 29877 ; 'file not found' msg# + 29878 00003DFA C706[A09D][219E] mov word [string_ptr_2],SrcBuf + 29879 ; point at bad pathname + 29880 00003E00 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 + 29881 ; 1 substitution + 29882 00003E05 E9BB06 jmp COPYERR ; print msg and clean up + 29883 + 29884 ; --------------------------------------------------------------------------- + 29885 + 29886 SOURCEPROC: 29887 - 29888 00003E08 E8F003 call SOURCE_SET ; set source variables & ascii/binary - 29889 00003E0B 803E[089C]00 cmp byte [Concat],0 - 29890 00003E10 750B jne short LEAVECFLAG ; concatenating - leave CFlag alone - 29891 - 29892 ; --------------------------------------------------------------------------- - 29893 - 29894 FRSTSRC: - 29895 00003E12 31C0 xor ax,ax - 29896 00003E14 A2[139C] mov [CFLAG],al ; 'destination not created' - 29897 00003E17 A3[199C] mov [NXTADD],ax ; copy buffer ptr = 0 - 29898 00003E1A A2[149C] mov [DestClosed],al ; 'destination not closed' - 29899 - 29900 LEAVECFLAG: - 29901 00003E1D 8936[D29E] mov [SRCPT],si ; save cmd-line ptr - 29902 00003E21 BF[D79A] mov di,USERDIR1 ; DI = ptr to buf for user's - 29903 ; current dir - 29904 00003E24 BD[1C9E] mov bp,SrcVars ; BP = base of source variables - 29905 - 29906 ; 10/08/2024 - PCDOS 7.1 COMMAND.COM - 29907 %if 1 - 29908 ;mov bx,deny_none|read_open_mode - 29909 00003E27 BB4000 mov bx,40h ; open mode for COPY ;M046 - 29910 %endif - 29911 00003E2A E8FE07 call BUILDPATH ; cd to source dir, figure - 29912 ; out stuff about source - 29913 00003E2D 8B36[1E9E] mov si,[SrcTail] ; SI = ptr to source filename - 29914 00003E31 C3 retn - 29915 - 29916 ; --------------------------------------------------------------------------- - 29917 - 29918 ; 25/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 29919 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 29920 NEXTSRC: - 29921 ;* Next source. Come here after handling each pathname. - 29922 ; We're done unless there are additional source pathnames - 29923 ; to be appended. - 29924 ; - 29925 ; Note that all files matching an ambiguous pathname - 29926 ; are processed before coming here. - 29927 - 29928 00003E32 803E[DB9E]00 cmp byte [PLUS],0 - 29929 ;jne short MORECP ; copying "+" sources - keep going - 29930 ; 26/04/2023 - 29931 ;ENDCOPYJ2: - 29932 ;jmp short ENDCOPY - 29933 00003E37 7498 je short ENDCOPY - 29934 MORECP: - 29935 00003E39 31ED xor bp,bp ; BP = switch flags accumulator - 29936 00003E3B 8B36[D29E] mov si,[SRCPT] ; SI = ptr to current pos'n in cmd line - 29937 ;mov bl,[PLUS_CHR] ; BL = special delimiter = "+" - 29938 00003E3F B32B mov bl,'+' ; 2Bh - 29939 SCANSRC: - 29940 00003E41 BF[7B9E] mov di,ScanBuf ; DI = ptr to pathname buf - 29941 00003E44 E86009 call cparse ; parse first source name - 29942 ;jb short ENDCOPYJ2 ; CR found - we're done - 29943 ; 26/04/2023 - 29944 00003E47 7288 jb short ENDCOPY - 29945 - 29946 00003E49 F6C780 test bh,80h - 29947 ;jz short ENDCOPYJ2 ; no "+" delimiter - we're done - 29948 ; 26/04/2023 - 29949 00003E4C 7483 jz short ENDCOPY - 29950 - 29951 00003E4E F6C701 test bh,1 - 29952 00003E51 75EE jnz short SCANSRC ; switch found - keep looking + 29888 ;* Preparatory processing for each source file. + 29889 ; Called at FrstSrc for first source file. + 29890 + 29891 00003E08 E8F003 call SOURCE_SET ; set source variables & ascii/binary + 29892 00003E0B 803E[089C]00 cmp byte [Concat],0 + 29893 00003E10 750B jne short LEAVECFLAG ; concatenating - leave CFlag alone + 29894 + 29895 ; --------------------------------------------------------------------------- + 29896 + 29897 FRSTSRC: + 29898 00003E12 31C0 xor ax,ax + 29899 00003E14 A2[139C] mov [CFLAG],al ; 'destination not created' + 29900 00003E17 A3[199C] mov [NXTADD],ax ; copy buffer ptr = 0 + 29901 00003E1A A2[149C] mov [DestClosed],al ; 'destination not closed' + 29902 + 29903 LEAVECFLAG: + 29904 00003E1D 8936[D29E] mov [SRCPT],si ; save cmd-line ptr + 29905 00003E21 BF[D79A] mov di,USERDIR1 ; DI = ptr to buf for user's + 29906 ; current dir + 29907 00003E24 BD[1C9E] mov bp,SrcVars ; BP = base of source variables + 29908 + 29909 ; 10/08/2024 - PCDOS 7.1 COMMAND.COM + 29910 %if 1 + 29911 ;mov bx,deny_none|read_open_mode + 29912 00003E27 BB4000 mov bx,40h ; open mode for COPY ;M046 + 29913 %endif + 29914 00003E2A E8FE07 call BUILDPATH ; cd to source dir, figure + 29915 ; out stuff about source + 29916 00003E2D 8B36[1E9E] mov si,[SrcTail] ; SI = ptr to source filename + 29917 00003E31 C3 retn + 29918 + 29919 ; --------------------------------------------------------------------------- + 29920 + 29921 ; 25/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 29922 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 29923 NEXTSRC: + 29924 ;* Next source. Come here after handling each pathname. + 29925 ; We're done unless there are additional source pathnames + 29926 ; to be appended. + 29927 ; + 29928 ; Note that all files matching an ambiguous pathname + 29929 ; are processed before coming here. + 29930 + 29931 00003E32 803E[DB9E]00 cmp byte [PLUS],0 + 29932 ;jne short MORECP ; copying "+" sources - keep going + 29933 ; 26/04/2023 + 29934 ;ENDCOPYJ2: + 29935 ;jmp short ENDCOPY + 29936 00003E37 7498 je short ENDCOPY + 29937 MORECP: + 29938 00003E39 31ED xor bp,bp ; BP = switch flags accumulator + 29939 00003E3B 8B36[D29E] mov si,[SRCPT] ; SI = ptr to current pos'n in cmd line + 29940 ;mov bl,[PLUS_CHR] ; BL = special delimiter = "+" + 29941 00003E3F B32B mov bl,'+' ; 2Bh + 29942 SCANSRC: + 29943 00003E41 BF[7B9E] mov di,ScanBuf ; DI = ptr to pathname buf + 29944 00003E44 E86009 call cparse ; parse first source name + 29945 ;jb short ENDCOPYJ2 ; CR found - we're done + 29946 ; 26/04/2023 + 29947 00003E47 7288 jb short ENDCOPY + 29948 + 29949 00003E49 F6C780 test bh,80h + 29950 ;jz short ENDCOPYJ2 ; no "+" delimiter - we're done + 29951 ; 26/04/2023 + 29952 00003E4C 7483 jz short ENDCOPY 29953 - 29954 ; ScanBuf contains the next source pathname. - 29955 - 29956 00003E53 E8B2FF call SOURCEPROC ; prepare this source - 29957 00003E56 803E[959D]01 cmp byte [comma],1 ; was +,, found last time? - 29958 00003E5B 7507 jnz short NOSTAMP ; no - try for a file - 29959 00003E5D C606[969D]01 mov byte [plus_comma],1 ; yes - set flag - 29960 00003E62 EB81 jmp short SRCNONEXIST ; we know we won't find it - 29961 - 29962 NOSTAMP: - 29963 00003E64 C606[969D]00 mov byte [plus_comma],0 ; reset +,, flag + 29954 00003E4E F6C701 test bh,1 + 29955 00003E51 75EE jnz short SCANSRC ; switch found - keep looking + 29956 + 29957 ; ScanBuf contains the next source pathname. + 29958 + 29959 00003E53 E8B2FF call SOURCEPROC ; prepare this source + 29960 00003E56 803E[959D]01 cmp byte [comma],1 ; was +,, found last time? + 29961 00003E5B 7507 jnz short NOSTAMP ; no - try for a file + 29962 00003E5D C606[969D]01 mov byte [plus_comma],1 ; yes - set flag + 29963 00003E62 EB81 jmp short SRCNONEXIST ; we know we won't find it 29964 - 29965 ; --------------------------------------------------------------------------- - 29966 - 29967 FIRSTENT: - 29968 - 29969 ;M047 - 29970 ; The only case we need to worry about is when the source is wildcarded and - 29971 ;the destination is not. For this case, ConCat is not yet set to indicate - 29972 ;concatenation. We check for this case. - 29973 ; - 29974 ;NB: This change has been backed out and replaced by M048. This is not the - 29975 ;right place to do this check. - 29976 - 29977 ; This is where we enter the loop with the first source. - 29978 - 29979 00003E69 BF5C00 mov di,FCB ; 5Ch ; DI = ptr to FCB - 29980 00003E6C B80029 mov ax,Parse_File_Descriptor*256 ; 2900h - 29981 00003E6F CD21 int 21h ; DOS - PARSE FILENAME - 29982 ; DS:SI -> string to parse - 29983 ; ES:DI -> buffer to fill with unopened FCB - 29984 ; AL = bit mask to control parsing - 29985 00003E71 803C00 cmp byte [si],0 ; did we parse the whole thing? - 29986 00003E74 7516 jne short SRCHDONE ; no, error, simulate 'not found' - 29987 00003E76 A1[219E] mov ax,[SrcBuf] ; AX = possible "d:" - 29988 00003E79 80FC3A cmp ah,':' - 29989 00003E7C 7402 je short DRVSPEC1 ; AX = definite "d:" - 29990 00003E7E B040 mov al,'@' ; 40h ; AL = drive 'letter' for current drive - 29991 DRVSPEC1: - 29992 00003E80 0C20 or al,20h ; AL = lowercase drive letter - 29993 00003E82 2C60 sub al,60h ; AL = drive id (0=current,1=A,..) - 29994 ;mov [5Ch],al - 29995 00003E84 A25C00 mov [FCB],al ; put drive id in FCB - 29996 - 29997 ; FCB contains drive and filename to search. - 29998 - 29999 00003E87 B411 mov ah,Dir_Search_First ; 11h ; AH = 'Find First File' - 30000 00003E89 E86D01 call SEARCH - 30001 SRCHDONE: - 30002 00003E8C 9C pushf ; save flags from Search - 30003 00003E8D E893E9 call RestUDir1 ; restore users current directory - 30004 00003E90 9D popf ; restore flags from search - 30005 00003E91 7403 jz short NEXTAMBIG0 ; found the source - continue - 30006 00003E93 E94FFF jmp SRCNONEXIST ; didn't find the source - 30007 - 30008 NEXTAMBIG0: - 30009 00003E96 30C0 xor al,al - 30010 00003E98 8606[1B9C] xchg al,[FRSTSRCH] - 30011 00003E9C 08C0 or al,al - 30012 00003E9E 740B jz short NEXTAMBIG - 30013 SETNMEL: - 30014 00003EA0 B90C00 mov cx,12 - 30015 00003EA3 BF[7F9D] mov di,SDIRBUF - 30016 00003EA6 BE[399D] mov si,DIRBUF - 30017 00003EA9 F3A4 rep movsb ; save very first source name - 30018 NEXTAMBIG: - 30019 00003EAB 30C0 xor al,al - 30020 00003EAD A2[D59E] mov [NOWRITE],al ; turn off nowrite - 30021 00003EB0 8B3E[1E9E] mov di,[SrcTail] - 30022 00003EB4 BE[3A9D] mov si,DIRBUF+1 - 30023 00003EB7 E8EBEA call FCB_TO_ASCZ ; SrcBuf has complete name - 30024 ;MELDO: - 30025 ; **************************************** - 30026 ; 12/06/2023 - 30027 ; Retro DOS v4.2 COMMAND.COM - 30028 ; MSDOS 6.22 COMMAND.COM code only ! - 30029 ; (Disassembled source code by using Hex-Rays IDA disassembler) - 30030 ; **************************************** - 30031 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:41DBh - 30032 MELDO0: - 30033 00003EBA 803E[F19E]00 cmp byte [cox_y_override],0 ; /Y switch override (question) enabled ? - 30034 00003EBF 746C jz short MELDO ; no - 30035 ; ---------------------- - 30036 ; yes - 30037 00003EC1 E87506 call BUILDDEST - 30038 00003EC4 BE[219E] mov si,SrcBuf - 30039 00003EC7 BF[2399] mov di,SRCXNAME - 30040 ;mov ah,60h - 30041 00003ECA B460 mov ah,xNameTrans ; 60h - 30042 00003ECC CD21 int 21h ; DOS - RESOLVE PATH STRING TO CANONICAL PATH STRING - 30043 ; DS:SI -> ASCIZ relative path string or directory name - 30044 ; ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name - 30045 00003ECE E8C308 call COMPNAME - 30046 00003ED1 7540 jnz short MELDO1 ; different file names - 30047 00003ED3 803E[089C]00 cmp byte [Concat],0 - 30048 00003ED8 7539 jnz short MELDO1 ; concatenating - 30049 ; "File cannot be copied onto itself" - 30050 00003EDA BA[A791] mov dx,file_name_ptr - 30051 00003EDD E84815 call std_printf - 30052 00003EE0 E896EA call CRLF2 - 30053 00003EE3 BA[0390] mov dx,OVERWR_PTR - 30054 00003EE6 E9DA05 jmp COPYERR - 30055 ;MELDO1: - 30056 ;cmp byte [CFLAG],0 ; destination file created flag - 30057 ;jnz short MELDO ; yes, new (created) file - 30058 ; ; no, overwrite question (must be confirmed) - 30059 ;call get_answer_YNA - 30060 ;jb short MELDO2 ; answer is no - 30061 ;cmp byte [Concat],0 - 30062 ;jnz short MELDO - 30063 ;cmp byte [cox_dest_file],0 ; is there a (valid) target file ? - 30064 ;jnz short DOREAD ; yes - 30065 ;jmp short MELDO ; no, destination/target file does not exist - 30066 MELDO2: - 30067 00003EE9 803E[199E]00 cmp byte [MELCOPY],0 ; is 'Mel Hallerman copy' false ? - 30068 00003EEE 7507 jnz short MELDO3 ; no (, it is true) - 30069 00003EF0 803E[089C]00 cmp byte [Concat],0 - 30070 00003EF5 7408 jz short MELDO4 - 30071 MELDO3: - 30072 00003EF7 C606[149C]01 mov byte [DestClosed],1 - 30073 00003EFC E9D2FE jmp ENDCOPY - 30074 MELDO4: - 30075 00003EFF E8EB00 call SEARCHNEXT - 30076 00003F02 74A7 jz short NEXTAMBIG - 30077 00003F04 803E[F39E]00 cmp byte [cox_src_file],0 - 30078 ;jz short MELDO5 - 30079 ;jmp NEXTSRC - 30080 ; 18/06/2023 - 30081 00003F09 7505 jnz short NEXTSRCJ - 30082 MELDO5: - 30083 00003F0B C606[149C]01 mov byte [DestClosed],1 - 30084 NEXTSRCJ: ; 18/06/2023 - 30085 00003F10 E91FFF jmp NEXTSRC - 30086 - 30087 ; 12/06/2023 - 30088 MELDO1: - 30089 00003F13 803E[139C]00 cmp byte [CFLAG],0 ; destination file created flag - 30090 00003F18 7513 jnz short MELDO ; yes, new (created) file - 30091 ; no, overwrite question (must be confirmed) - 30092 00003F1A E81F03 call get_answer_YNA - 30093 00003F1D 72CA jb short MELDO2 ; answer is no - 30094 00003F1F 803E[089C]00 cmp byte [Concat],0 - 30095 00003F24 7507 jnz short MELDO - 30096 00003F26 803E[F29E]00 cmp byte [cox_dest_file],0 ; is there a (valid) target file ? - 30097 00003F2B 7517 jnz short DOREAD ; yes - 30098 ; 12/06/2023 - 30099 ;jmp short MELDO ; no, destination/target file does not exist - 30100 - 30101 ; **************************************** - 30102 ; 12/06/2023 - 30103 MELDO: - 30104 00003F2D 803E[089C]00 cmp byte [Concat],0 - 30105 00003F32 7507 jnz short SHOWCPNAM ; concatenating - show name - 30106 00003F34 F606[209E]02 test byte [SrcInfo],2 ; wildcard - show name - 30107 00003F39 7409 jz short DOREAD - 30108 SHOWCPNAM: - 30109 ; 25/03/2023 - 30110 ; MSDOS 3.3 - 30111 ;mov dx,SRCBUF - 30112 ;mov [STRING_PTR_2],dx - 30113 ;mov dx,STRINGBUF2PTR - 30114 ;call STD_PRINTF - 30115 ;call CRLF2 - 30116 ; 25/03/2023 - Retro DOS 4.0 COMMAND.COM - 30117 ; MSDOS 6.0 (& MSDOS 5.0 - 30118 00003F3B BA[A791] mov dx,file_name_ptr - 30119 00003F3E E8E714 call std_printf - 30120 00003F41 E835EA call CRLF2 - 30121 DOREAD: - 30122 00003F44 E8C300 call DOCOPY - 30123 00003F47 803E[089C]00 cmp byte [Concat],0 - 30124 00003F4C 750A jnz short NODCLOSE ; concatenating - don't close dest - 30125 - 30126 00003F4E E8B801 call CLOSEDEST ; close current destination - 30127 00003F51 7205 jc short NODCLOSE ; concatenating - dest not closed + 29965 NOSTAMP: + 29966 00003E64 C606[969D]00 mov byte [plus_comma],0 ; reset +,, flag + 29967 + 29968 ; --------------------------------------------------------------------------- + 29969 + 29970 FIRSTENT: + 29971 + 29972 ;M047 + 29973 ; The only case we need to worry about is when the source is wildcarded and + 29974 ;the destination is not. For this case, ConCat is not yet set to indicate + 29975 ;concatenation. We check for this case. + 29976 ; + 29977 ;NB: This change has been backed out and replaced by M048. This is not the + 29978 ;right place to do this check. + 29979 + 29980 ; This is where we enter the loop with the first source. + 29981 + 29982 00003E69 BF5C00 mov di,FCB ; 5Ch ; DI = ptr to FCB + 29983 00003E6C B80029 mov ax,Parse_File_Descriptor*256 ; 2900h + 29984 00003E6F CD21 int 21h ; DOS - PARSE FILENAME + 29985 ; DS:SI -> string to parse + 29986 ; ES:DI -> buffer to fill with unopened FCB + 29987 ; AL = bit mask to control parsing + 29988 00003E71 803C00 cmp byte [si],0 ; did we parse the whole thing? + 29989 00003E74 7516 jne short SRCHDONE ; no, error, simulate 'not found' + 29990 00003E76 A1[219E] mov ax,[SrcBuf] ; AX = possible "d:" + 29991 00003E79 80FC3A cmp ah,':' + 29992 00003E7C 7402 je short DRVSPEC1 ; AX = definite "d:" + 29993 00003E7E B040 mov al,'@' ; 40h ; AL = drive 'letter' for current drive + 29994 DRVSPEC1: + 29995 00003E80 0C20 or al,20h ; AL = lowercase drive letter + 29996 00003E82 2C60 sub al,60h ; AL = drive id (0=current,1=A,..) + 29997 ;mov [5Ch],al + 29998 00003E84 A25C00 mov [FCB],al ; put drive id in FCB + 29999 + 30000 ; FCB contains drive and filename to search. + 30001 + 30002 00003E87 B411 mov ah,Dir_Search_First ; 11h ; AH = 'Find First File' + 30003 00003E89 E86D01 call SEARCH + 30004 SRCHDONE: + 30005 00003E8C 9C pushf ; save flags from Search + 30006 00003E8D E893E9 call RestUDir1 ; restore users current directory + 30007 00003E90 9D popf ; restore flags from search + 30008 00003E91 7403 jz short NEXTAMBIG0 ; found the source - continue + 30009 00003E93 E94FFF jmp SRCNONEXIST ; didn't find the source + 30010 + 30011 NEXTAMBIG0: + 30012 00003E96 30C0 xor al,al + 30013 00003E98 8606[1B9C] xchg al,[FRSTSRCH] + 30014 00003E9C 08C0 or al,al + 30015 00003E9E 740B jz short NEXTAMBIG + 30016 SETNMEL: + 30017 00003EA0 B90C00 mov cx,12 + 30018 00003EA3 BF[7F9D] mov di,SDIRBUF + 30019 00003EA6 BE[399D] mov si,DIRBUF + 30020 00003EA9 F3A4 rep movsb ; save very first source name + 30021 NEXTAMBIG: + 30022 00003EAB 30C0 xor al,al + 30023 00003EAD A2[D59E] mov [NOWRITE],al ; turn off nowrite + 30024 00003EB0 8B3E[1E9E] mov di,[SrcTail] + 30025 00003EB4 BE[3A9D] mov si,DIRBUF+1 + 30026 00003EB7 E8EBEA call FCB_TO_ASCZ ; SrcBuf has complete name + 30027 ;MELDO: + 30028 ; **************************************** + 30029 ; 12/06/2023 + 30030 ; Retro DOS v4.2 COMMAND.COM + 30031 ; MSDOS 6.22 COMMAND.COM code only ! + 30032 ; (Disassembled source code by using Hex-Rays IDA disassembler) + 30033 ; **************************************** + 30034 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:41DBh + 30035 MELDO0: + 30036 00003EBA 803E[F19E]00 cmp byte [cox_y_override],0 ; /Y switch override (question) enabled ? + 30037 00003EBF 746C jz short MELDO ; no + 30038 ; ---------------------- + 30039 ; yes + 30040 00003EC1 E87506 call BUILDDEST + 30041 00003EC4 BE[219E] mov si,SrcBuf + 30042 00003EC7 BF[2399] mov di,SRCXNAME + 30043 ;mov ah,60h + 30044 00003ECA B460 mov ah,xNameTrans ; 60h + 30045 00003ECC CD21 int 21h ; DOS - RESOLVE PATH STRING TO CANONICAL PATH STRING + 30046 ; DS:SI -> ASCIZ relative path string or directory name + 30047 ; ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name + 30048 00003ECE E8C308 call COMPNAME + 30049 00003ED1 7540 jnz short MELDO1 ; different file names + 30050 00003ED3 803E[089C]00 cmp byte [Concat],0 + 30051 00003ED8 7539 jnz short MELDO1 ; concatenating + 30052 ; "File cannot be copied onto itself" + 30053 00003EDA BA[A791] mov dx,file_name_ptr + 30054 00003EDD E84815 call std_printf + 30055 00003EE0 E896EA call CRLF2 + 30056 00003EE3 BA[0390] mov dx,OVERWR_PTR + 30057 00003EE6 E9DA05 jmp COPYERR + 30058 ;MELDO1: + 30059 ;cmp byte [CFLAG],0 ; destination file created flag + 30060 ;jnz short MELDO ; yes, new (created) file + 30061 ; ; no, overwrite question (must be confirmed) + 30062 ;call get_answer_YNA + 30063 ;jb short MELDO2 ; answer is no + 30064 ;cmp byte [Concat],0 + 30065 ;jnz short MELDO + 30066 ;cmp byte [cox_dest_file],0 ; is there a (valid) target file ? + 30067 ;jnz short DOREAD ; yes + 30068 ;jmp short MELDO ; no, destination/target file does not exist + 30069 MELDO2: + 30070 00003EE9 803E[199E]00 cmp byte [MELCOPY],0 ; is 'Mel Hallerman copy' false ? + 30071 00003EEE 7507 jnz short MELDO3 ; no (, it is true) + 30072 00003EF0 803E[089C]00 cmp byte [Concat],0 + 30073 00003EF5 7408 jz short MELDO4 + 30074 MELDO3: + 30075 00003EF7 C606[149C]01 mov byte [DestClosed],1 + 30076 00003EFC E9D2FE jmp ENDCOPY + 30077 MELDO4: + 30078 00003EFF E8EB00 call SEARCHNEXT + 30079 00003F02 74A7 jz short NEXTAMBIG + 30080 00003F04 803E[F39E]00 cmp byte [cox_src_file],0 + 30081 ;jz short MELDO5 + 30082 ;jmp NEXTSRC + 30083 ; 18/06/2023 + 30084 00003F09 7505 jnz short NEXTSRCJ + 30085 MELDO5: + 30086 00003F0B C606[149C]01 mov byte [DestClosed],1 + 30087 NEXTSRCJ: ; 18/06/2023 + 30088 00003F10 E91FFF jmp NEXTSRC + 30089 + 30090 ; 12/06/2023 + 30091 MELDO1: + 30092 00003F13 803E[139C]00 cmp byte [CFLAG],0 ; destination file created flag + 30093 00003F18 7513 jnz short MELDO ; yes, new (created) file + 30094 ; no, overwrite question (must be confirmed) + 30095 00003F1A E81F03 call get_answer_YNA + 30096 00003F1D 72CA jb short MELDO2 ; answer is no + 30097 00003F1F 803E[089C]00 cmp byte [Concat],0 + 30098 00003F24 7507 jnz short MELDO + 30099 00003F26 803E[F29E]00 cmp byte [cox_dest_file],0 ; is there a (valid) target file ? + 30100 00003F2B 7517 jnz short DOREAD ; yes + 30101 ; 12/06/2023 + 30102 ;jmp short MELDO ; no, destination/target file does not exist + 30103 + 30104 ; **************************************** + 30105 ; 12/06/2023 + 30106 MELDO: + 30107 00003F2D 803E[089C]00 cmp byte [Concat],0 + 30108 00003F32 7507 jnz short SHOWCPNAM ; concatenating - show name + 30109 00003F34 F606[209E]02 test byte [SrcInfo],2 ; wildcard - show name + 30110 00003F39 7409 jz short DOREAD + 30111 SHOWCPNAM: + 30112 ; 25/03/2023 + 30113 ; MSDOS 3.3 + 30114 ;mov dx,SRCBUF + 30115 ;mov [STRING_PTR_2],dx + 30116 ;mov dx,STRINGBUF2PTR + 30117 ;call STD_PRINTF + 30118 ;call CRLF2 + 30119 ; 25/03/2023 - Retro DOS 4.0 COMMAND.COM + 30120 ; MSDOS 6.0 (& MSDOS 5.0 + 30121 00003F3B BA[A791] mov dx,file_name_ptr + 30122 00003F3E E8E714 call std_printf + 30123 00003F41 E835EA call CRLF2 + 30124 DOREAD: + 30125 00003F44 E8C300 call DOCOPY + 30126 00003F47 803E[089C]00 cmp byte [Concat],0 + 30127 00003F4C 750A jnz short NODCLOSE ; concatenating - don't close dest 30128 - 30129 00003F53 C606[139C]00 mov byte [CFLAG],0 ; 'destination not created' - 30130 NODCLOSE: - 30131 00003F58 803E[089C]00 cmp byte [Concat],0 - 30132 00003F5D 740A jz short NOFLUSH - 30133 - 30134 ; Concatenating - flush output between source files so LostErr - 30135 ; stuff works correctly. + 30129 00003F4E E8B801 call CLOSEDEST ; close current destination + 30130 00003F51 7205 jc short NODCLOSE ; concatenating - dest not closed + 30131 + 30132 00003F53 C606[139C]00 mov byte [CFLAG],0 ; 'destination not created' + 30133 NODCLOSE: + 30134 00003F58 803E[089C]00 cmp byte [Concat],0 + 30135 00003F5D 740A jz short NOFLUSH 30136 - 30137 ;invoke FlshFil ; MSDOS 6.0 - 30138 ; 25/03/2023 - 30139 00003F5F E81204 call FlshFil - 30140 ;call FLUSHFIL ; MSDOS 3.3 - 30141 - 30142 00003F62 F606[199E]FF test byte [MELCOPY],0FFh - 30143 ;jz short NOFLUSH - 30144 ;jmp short DOMELCOPY - 30145 ; 25/03/2023 - 30146 00003F67 750D jnz short DOMELCOPY - 30147 NOFLUSH: - 30148 00003F69 E88100 call SEARCHNEXT ; try next match - 30149 00003F6C 75A2 jnz short NEXTSRCJ ; not found - finished with - 30150 ; this source spec - 30151 00003F6E C606[149C]00 mov byte [DestClosed],0 ; 'destination not closed' - 30152 00003F73 E935FF jmp NEXTAMBIG ; do next ambig match - 30153 - 30154 DOMELCOPY: - 30155 00003F76 803E[199E]FF cmp byte [MELCOPY],0FFh - 30156 00003F7B 740D je short CONTMEL - 30157 00003F7D 8B36[D29E] mov si,[SRCPT] - 30158 00003F81 8936[1A9E] mov [MELSTART],si - 30159 00003F85 C606[199E]FF mov byte [MELCOPY],0FFh - 30160 - 30161 CONTMEL: - 30162 00003F8A 31ED xor bp,bp - 30163 00003F8C 8B36[D29E] mov si,[SRCPT] - 30164 ;mov bl,[PLUS_CHR] - 30165 ; 25/03/2023 - 30166 00003F90 B32B mov bl,'+' - 30167 SCANSRC2: - 30168 00003F92 BF[7B9E] mov di,ScanBuf - 30169 00003F95 E80F08 call cparse - 30170 00003F98 F6C780 test bh,80h - 30171 00003F9B 742F jz short NEXTMEL ; no "+" - go back to start - 30172 00003F9D F6C701 test bh,1 - 30173 00003FA0 75F0 jnz short SCANSRC2 ; switch - keep scanning - 30174 00003FA2 E863FE call SOURCEPROC - 30175 00003FA5 E87BE8 call RestUDir1 - 30176 00003FA8 BF[BA9C] mov di,DESTFCB2 - 30177 00003FAB B80029 mov ax,Parse_File_Descriptor*256 ; 2900h - 30178 00003FAE CD21 int 21h ; DOS - PARSE FILENAME - 30179 ; DS:SI -> string to parse - 30180 ; ES:DI -> buffer to fill with unopened FCB - 30181 ; AL = bit mask to control parsing - 30182 00003FB0 BB[809D] mov bx,SDIRBUF+1 - 30183 00003FB3 BE[BB9C] mov si,DESTFCB2+1 - 30184 00003FB6 8B3E[1E9E] mov di,[SrcTail] - 30185 - 30186 00003FBA E83F06 call BUILDNAME - 30187 - 30188 00003FBD 803E[089C]00 cmp byte [Concat],0 - 30189 00003FC2 7405 je short MELDOJ ; not concatenating - continue + 30137 ; Concatenating - flush output between source files so LostErr + 30138 ; stuff works correctly. + 30139 + 30140 ;invoke FlshFil ; MSDOS 6.0 + 30141 ; 25/03/2023 + 30142 00003F5F E81204 call FlshFil + 30143 ;call FLUSHFIL ; MSDOS 3.3 + 30144 + 30145 00003F62 F606[199E]FF test byte [MELCOPY],0FFh + 30146 ;jz short NOFLUSH + 30147 ;jmp short DOMELCOPY + 30148 ; 25/03/2023 + 30149 00003F67 750D jnz short DOMELCOPY + 30150 NOFLUSH: + 30151 00003F69 E88100 call SEARCHNEXT ; try next match + 30152 00003F6C 75A2 jnz short NEXTSRCJ ; not found - finished with + 30153 ; this source spec + 30154 00003F6E C606[149C]00 mov byte [DestClosed],0 ; 'destination not closed' + 30155 00003F73 E935FF jmp NEXTAMBIG ; do next ambig match + 30156 + 30157 DOMELCOPY: + 30158 00003F76 803E[199E]FF cmp byte [MELCOPY],0FFh + 30159 00003F7B 740D je short CONTMEL + 30160 00003F7D 8B36[D29E] mov si,[SRCPT] + 30161 00003F81 8936[1A9E] mov [MELSTART],si + 30162 00003F85 C606[199E]FF mov byte [MELCOPY],0FFh + 30163 + 30164 CONTMEL: + 30165 00003F8A 31ED xor bp,bp + 30166 00003F8C 8B36[D29E] mov si,[SRCPT] + 30167 ;mov bl,[PLUS_CHR] + 30168 ; 25/03/2023 + 30169 00003F90 B32B mov bl,'+' + 30170 SCANSRC2: + 30171 00003F92 BF[7B9E] mov di,ScanBuf + 30172 00003F95 E80F08 call cparse + 30173 00003F98 F6C780 test bh,80h + 30174 00003F9B 742F jz short NEXTMEL ; no "+" - go back to start + 30175 00003F9D F6C701 test bh,1 + 30176 00003FA0 75F0 jnz short SCANSRC2 ; switch - keep scanning + 30177 00003FA2 E863FE call SOURCEPROC + 30178 00003FA5 E87BE8 call RestUDir1 + 30179 00003FA8 BF[BA9C] mov di,DESTFCB2 + 30180 00003FAB B80029 mov ax,Parse_File_Descriptor*256 ; 2900h + 30181 00003FAE CD21 int 21h ; DOS - PARSE FILENAME + 30182 ; DS:SI -> string to parse + 30183 ; ES:DI -> buffer to fill with unopened FCB + 30184 ; AL = bit mask to control parsing + 30185 00003FB0 BB[809D] mov bx,SDIRBUF+1 + 30186 00003FB3 BE[BB9C] mov si,DESTFCB2+1 + 30187 00003FB6 8B3E[1E9E] mov di,[SrcTail] + 30188 + 30189 00003FBA E83F06 call BUILDNAME 30190 - 30191 ; Yes, turn off nowrite because this part of the code - 30192 ; is only reached after the first file has been dealt with. + 30191 00003FBD 803E[089C]00 cmp byte [Concat],0 + 30192 00003FC2 7405 je short MELDOJ ; not concatenating - continue 30193 - 30194 00003FC4 C606[D59E]00 mov byte [NOWRITE],0 - 30195 MELDOJ: - 30196 00003FC9 E961FF jmp MELDO - 30197 ; 18/06/2023 - 30198 ;NEXTSRCJ: - 30199 ;jmp NEXTSRC - 30200 - 30201 NEXTMEL: - 30202 00003FCC E83A01 call CLOSEDEST - 30203 00003FCF 31C0 xor ax,ax - 30204 00003FD1 A2[139C] mov [CFLAG],al - 30205 00003FD4 A3[199C] mov [NXTADD],ax - 30206 00003FD7 A2[149C] mov [SPECDRV],al - 30207 00003FDA 8B36[1A9E] mov si,[MELSTART] - 30208 00003FDE 8936[D29E] mov [SRCPT],si - 30209 00003FE2 E80800 call SEARCHNEXT - 30210 00003FE5 7403 jz short SETNMELJ - 30211 00003FE7 E9EAFD jmp ENDCOPY2 - 30212 SETNMELJ: - 30213 00003FEA E9B3FE jmp SETNMEL - 30214 - 30215 ; --------------------------------------------------------------------------- - 30216 - 30217 SEARCHNEXT: - 30218 00003FED B412 mov ah,Dir_Search_Next ; 12h - 30219 00003FEF F606[209E]02 test byte [SrcInfo],2 - 30220 00003FF4 7503 jnz short SEARCH ; do search-next if ambig - 30221 00003FF6 08E4 or ah,ah ; reset zero flag - 30222 00003FF8 C3 retn - 30223 - 30224 ; --------------------------------------------------------------------------- - 30225 - 30226 SEARCH: - 30227 00003FF9 50 push ax - 30228 00003FFA B41A mov ah,Set_DMA ; 1Ah - 30229 00003FFC BA[399D] mov dx,DIRBUF ; put result of search in dirbuf - 30230 00003FFF CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS - 30231 ; DS:DX -> disk transfer buffer - 30232 00004001 58 pop ax ; restore search first/next command - 30233 00004002 BA5C00 mov dx,FCB ; 5Ch - 30234 00004005 CD21 int 21h ; Do the search - 30235 00004007 08C0 or al,al - 30236 00004009 C3 retn - 30237 - 30238 ; --------------------------------------------------------------------------- - 30239 - 30240 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 30241 - 30242 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30243 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4335h + 30194 ; Yes, turn off nowrite because this part of the code + 30195 ; is only reached after the first file has been dealt with. + 30196 + 30197 00003FC4 C606[D59E]00 mov byte [NOWRITE],0 + 30198 MELDOJ: + 30199 00003FC9 E961FF jmp MELDO + 30200 ; 18/06/2023 + 30201 ;NEXTSRCJ: + 30202 ;jmp NEXTSRC + 30203 + 30204 NEXTMEL: + 30205 00003FCC E83A01 call CLOSEDEST + 30206 00003FCF 31C0 xor ax,ax + 30207 00003FD1 A2[139C] mov [CFLAG],al + 30208 00003FD4 A3[199C] mov [NXTADD],ax + 30209 00003FD7 A2[149C] mov [SPECDRV],al + 30210 00003FDA 8B36[1A9E] mov si,[MELSTART] + 30211 00003FDE 8936[D29E] mov [SRCPT],si + 30212 00003FE2 E80800 call SEARCHNEXT + 30213 00003FE5 7403 jz short SETNMELJ + 30214 00003FE7 E9EAFD jmp ENDCOPY2 + 30215 SETNMELJ: + 30216 00003FEA E9B3FE jmp SETNMEL + 30217 + 30218 ; --------------------------------------------------------------------------- + 30219 + 30220 SEARCHNEXT: + 30221 00003FED B412 mov ah,Dir_Search_Next ; 12h + 30222 00003FEF F606[209E]02 test byte [SrcInfo],2 + 30223 00003FF4 7503 jnz short SEARCH ; do search-next if ambig + 30224 00003FF6 08E4 or ah,ah ; reset zero flag + 30225 00003FF8 C3 retn + 30226 + 30227 ; --------------------------------------------------------------------------- + 30228 + 30229 SEARCH: + 30230 00003FF9 50 push ax + 30231 00003FFA B41A mov ah,Set_DMA ; 1Ah + 30232 00003FFC BA[399D] mov dx,DIRBUF ; put result of search in dirbuf + 30233 00003FFF CD21 int 21h ; DOS - SET DISK TRANSFER AREA ADDRESS + 30234 ; DS:DX -> disk transfer buffer + 30235 00004001 58 pop ax ; restore search first/next command + 30236 00004002 BA5C00 mov dx,FCB ; 5Ch + 30237 00004005 CD21 int 21h ; Do the search + 30238 00004007 08C0 or al,al + 30239 00004009 C3 retn + 30240 + 30241 ; --------------------------------------------------------------------------- + 30242 + 30243 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 30244 - 30245 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30246 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:41E9h - 30247 DOCOPY: - 30248 0000400A BE[219E] mov si,SrcBuf ; do name translate of source - 30249 0000400D BF[2399] mov di,SRCXNAME ; save for name comparison - 30250 00004010 B460 mov ah,xNameTrans ; 60h - 30251 ;mov ah,60h - 30252 00004012 CD21 int 21h ; DOS - RESOLVE PATH STRING TO CANONICAL PATH STRING - 30253 ; DS:SI -> ASCIZ relative path string or directory name - 30254 ; ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name - 30255 00004014 C606[069C]00 mov byte [RDEOF],0 ; no EOF yet - 30256 - 30257 ; MSDOS 6.0 - 30258 ;mov ax,ExtOpen shl 8 ; open the file - 30259 ; 26/03/2023 - 30260 00004019 B8006C mov ax,6C00h - 30261 ;M046 - 30262 ; For reads, the sharing mode should be deny none so that any process can - 30263 ;open this file again in any other sharing mode. This is mainly to allow - 30264 ;multiple command.com's to access the same file without getting sharing - 30265 ;violations - 30266 ; - 30267 ;mov bx,deny_none|read_open_mode - 30268 0000401C BB4000 mov bx,40h ; open mode for COPY ;M046 - 30269 0000401F 31C9 xor cx,cx ; no special files - 30270 ;mov dx,read_open_flag ; set up open flags - 30271 00004021 BA0101 mov dx,101h - 30272 00004024 CD21 int 21h - 30273 ; 26/03/2023 - 30274 00004026 7230 jc short Error_On_Source - 30275 ;jnc short OPENOK - 30276 - 30277 ; Bogosity: IBM wants us to issue Access Denied in this case. - 30278 ; They asked for it... + 30245 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30246 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4335h + 30247 + 30248 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30249 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:41E9h + 30250 DOCOPY: + 30251 0000400A BE[219E] mov si,SrcBuf ; do name translate of source + 30252 0000400D BF[2399] mov di,SRCXNAME ; save for name comparison + 30253 00004010 B460 mov ah,xNameTrans ; 60h + 30254 ;mov ah,60h + 30255 00004012 CD21 int 21h ; DOS - RESOLVE PATH STRING TO CANONICAL PATH STRING + 30256 ; DS:SI -> ASCIZ relative path string or directory name + 30257 ; ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name + 30258 00004014 C606[069C]00 mov byte [RDEOF],0 ; no EOF yet + 30259 + 30260 ; MSDOS 6.0 + 30261 ;mov ax,ExtOpen shl 8 ; open the file + 30262 ; 26/03/2023 + 30263 00004019 B8006C mov ax,6C00h + 30264 ;M046 + 30265 ; For reads, the sharing mode should be deny none so that any process can + 30266 ;open this file again in any other sharing mode. This is mainly to allow + 30267 ;multiple command.com's to access the same file without getting sharing + 30268 ;violations + 30269 ; + 30270 ;mov bx,deny_none|read_open_mode + 30271 0000401C BB4000 mov bx,40h ; open mode for COPY ;M046 + 30272 0000401F 31C9 xor cx,cx ; no special files + 30273 ;mov dx,read_open_flag ; set up open flags + 30274 00004021 BA0101 mov dx,101h + 30275 00004024 CD21 int 21h + 30276 ; 26/03/2023 + 30277 00004026 7230 jc short Error_On_Source + 30278 ;jnc short OPENOK 30279 - 30280 ;jmp short Error_On_Source ;AC022; clean up and exit - 30281 - 30282 ; 26/03/2023 - 30283 ; MSDOS 3.3 - 30284 ;mov dx,SRCBUF - 30285 ;mov ax,OPEN*256 ; 3D00h - 30286 ;int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 30287 ; ; DS:DX -> ASCIZ filename - 30288 ; ; AL = access mode - 30289 ; ; 0 - read - 30290 ;jnc short OPENOK - 30291 ;call GET_EXT_ERR_NUMBER - 30292 ;pushf - 30293 ;cmp ax,65 - 30294 ;jnz short DOCOPY_ERR - 30295 ;mov dx,ACCDENPTR - 30296 ;call STD_PRINTF - 30297 ;DOCOPY_ERR: - 30298 ;popf - 30299 ;retn - 30300 - 30301 ; 26/03/2023 - 30302 ; MSDOS 3.3 (& MSDOS 6.0) - 30303 OPENOK: - 30304 00004028 89C3 mov bx,ax - 30305 0000402A 891E[789E] mov [SRCHAND],bx ; save handle - 30306 0000402E B80057 mov ax,File_Times*256 ; 5700h - 30307 00004031 CD21 int 21h ; DOS - 2+ - GET FILE'S DATE/TIME - 30308 ; BX = file handle - 30309 - 30310 00004033 7223 jc short Error_On_Source ; MSDOS 6.0 - 30311 - 30312 00004035 8916[DD9E] mov [CPDATE],dx ; save date - 30313 00004039 890E[DF9E] mov [CPTIME],cx ; save time + 30280 ; Bogosity: IBM wants us to issue Access Denied in this case. + 30281 ; They asked for it... + 30282 + 30283 ;jmp short Error_On_Source ;AC022; clean up and exit + 30284 + 30285 ; 26/03/2023 + 30286 ; MSDOS 3.3 + 30287 ;mov dx,SRCBUF + 30288 ;mov ax,OPEN*256 ; 3D00h + 30289 ;int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 30290 ; ; DS:DX -> ASCIZ filename + 30291 ; ; AL = access mode + 30292 ; ; 0 - read + 30293 ;jnc short OPENOK + 30294 ;call GET_EXT_ERR_NUMBER + 30295 ;pushf + 30296 ;cmp ax,65 + 30297 ;jnz short DOCOPY_ERR + 30298 ;mov dx,ACCDENPTR + 30299 ;call STD_PRINTF + 30300 ;DOCOPY_ERR: + 30301 ;popf + 30302 ;retn + 30303 + 30304 ; 26/03/2023 + 30305 ; MSDOS 3.3 (& MSDOS 6.0) + 30306 OPENOK: + 30307 00004028 89C3 mov bx,ax + 30308 0000402A 891E[789E] mov [SRCHAND],bx ; save handle + 30309 0000402E B80057 mov ax,File_Times*256 ; 5700h + 30310 00004031 CD21 int 21h ; DOS - 2+ - GET FILE'S DATE/TIME + 30311 ; BX = file handle + 30312 + 30313 00004033 7223 jc short Error_On_Source ; MSDOS 6.0 30314 - 30315 ; MSDOS 6.0 - 30316 ;jmp short No_Copy_Xa ; (xa copy code removed) - 30317 ; 26/04/2023 - 30318 No_Copy_Xa: - 30319 ; 26/03/2023 - 30320 ;mov bx,[SRCHAND] ;AN022; get handle back - 30321 - 30322 ; MSDOS 3.3 (& MSDOS 6.0) - 30323 0000403D B80044 mov ax,(IOCTL<<8) ; 4400h - 30324 00004040 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 30325 ; BX = file or device handle - 30326 ;and dl,devid_ISDEV ; 80h - 30327 ; 18/04/2023 - 30328 00004042 80E280 and dl,80h ; devid_ISDEV - 30329 00004045 8816[7A9E] mov [SRCISDEV],dl ; set source info - 30330 00004049 7436 jz short COPYLP ; source not a device - 30331 0000404B 803E[D69E]00 cmp byte [BINARY],0 - 30332 00004050 742F je short COPYLP ; ascii device ok - 30333 00004052 BA[6091] mov dx,INBDEV_PTR ; cannot do binary input - 30334 00004055 E96B04 jmp COPYERR - 30335 - 30336 Error_On_Source: ;AN022; we have a BAD error - 30337 00004058 E8E0DF call Set_Ext_Error_Msg ;AN022; set up the error message - 30338 0000405B C706[A09D][219E] mov word [string_ptr_2],SrcBuf - 30339 ;AN022; get address of failed string - 30340 00004061 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 - 30341 ;AN022; put number of subst in control block - 30342 00004066 E8B713 call std_eprintf ;AN022; print it - 30343 ; 26/03/2023 - Retro DOS v4.0 COMMAND.COM - 30344 00004069 8B1E[789E] mov bx,[SRCHAND] - 30345 ;cmp word [SRCHAND],0 ;AN022; did we open the file? - 30346 ;je short No_Close_Src ;AN022; no - don't close - 30347 0000406D 09DB or bx,bx - 30348 0000406F 7403 jz short No_Close_Src - 30349 ;call CLOSESRC ;AN022; clean up - 30350 ; 26/03/2023 - 30351 00004071 E89000 call CLOSESRC2 ; bx = [SRCHAND] - 30352 No_Close_Src: ;AN022; - 30353 00004074 803E[139C]00 cmp byte [CFLAG],0 ;AN022; was destination created? - 30354 00004079 7403 je short EndCopyJ3 ;AN022; no - just cleanup and exit - 30355 0000407B E953FD jmp ENDCOPY ;AN022; clean up concatenation and exit - 30356 EndCopyJ3: ;AN022; - 30357 0000407E E953FD jmp ENDCOPY2 ;AN022; - 30358 - 30359 ; 26/04/2023 - 30360 ;No_Copy_Xa: - 30361 ; ; 26/03/2023 - 30362 ; ;mov bx,[SRCHAND] ;AN022; get handle back - 30363 ; - 30364 ; ; MSDOS 3.3 (& MSDOS 6.0) - 30365 ; mov ax,(IOCTL<<8) ; 4400h - 30366 ; int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 30367 ; ; BX = file or device handle - 30368 ; ;and dl,devid_ISDEV ; 80h - 30369 ; ; 18/04/2023 - 30370 ; and dl,80h ; devid_ISDEV - 30371 ; mov [SRCISDEV],dl ; set source info - 30372 ; jz short COPYLP ; source not a device - 30373 ; cmp byte [BINARY],0 - 30374 ; je short COPYLP ; ascii device ok - 30375 ; mov dx,INBDEV_PTR ; cannot do binary input - 30376 ; jmp COPYERR - 30377 - 30378 COPYLP: - 30379 ; 26/03/2023 - 30380 00004081 8B1E[789E] mov bx,[SRCHAND] ; ? ; 26/03/2023 - 30381 00004085 8B0E[159C] mov cx,[BYTCNT] - 30382 00004089 8B16[199C] mov dx,[NXTADD] - 30383 0000408D 29D1 sub cx,dx ; compute available space - 30384 0000408F 750E jnz short GOTROOM - 30385 00004091 E8E002 call FlshFil ; MSDOS 6.0 - 30386 ;call FLUSHFIL ; MSDOS 3.3 - 30387 00004094 803E[D99E]00 cmp byte [TERMREAD],0 - 30388 00004099 7565 jne short CLOSESRC ; give up - 30389 0000409B 8B0E[159C] mov cx,[BYTCNT] - 30390 GOTROOM: - 30391 0000409F 1E push ds - 30392 000040A0 8E1E[F79B] mov ds,[TPA] - 30393 000040A4 B43F mov ah,READ ; 3Fh - 30394 000040A6 CD21 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE - 30395 ; BX = file handle,CX = number of bytes to read - 30396 ; DS:DX -> buffer - 30397 000040A8 1F pop ds - 30398 ;jc short CLOSESRC ; MSDOS 3.3 - 30399 ; 26/03/2023 - 30400 000040A9 72AD jc short Error_On_Source ; MSDOS 6.0 - 30401 000040AB 89C1 mov cx,ax ; get count - 30402 000040AD E351 jcxz CLOSESRC ; no more to read - 30403 000040AF 803E[7A9E]00 cmp byte [SRCISDEV],0 - 30404 000040B4 7507 jne short NOTESTA ; is a device, ascii mode - 30405 000040B6 803E[DA9E]00 cmp byte [ASCII],0 - 30406 000040BB 741B je short BINREAD - 30407 NOTESTA: - 30408 000040BD 89CA mov dx,cx - 30409 000040BF 8B3E[199C] mov di,[NXTADD] - 30410 000040C3 B01A mov al,1Ah - 30411 000040C5 06 push es - 30412 000040C6 8E06[F79B] mov es,[TPA] ; scan for EOF - 30413 000040CA F2AE repne scasb - 30414 000040CC 07 pop es - 30415 000040CD 7505 jnz short USEALL - 30416 000040CF FE06[069C] inc byte [RDEOF] - 30417 000040D3 41 inc cx - 30418 USEALL: - 30419 000040D4 29CA sub dx,cx - 30420 000040D6 89D1 mov cx,dx - 30421 BINREAD: - 30422 000040D8 030E[199C] add cx,[NXTADD] - 30423 000040DC 890E[199C] mov [NXTADD],cx - 30424 000040E0 3B0E[159C] cmp cx,[BYTCNT] ; is buffer full? - 30425 000040E4 720C jb short TESTDEV ; if not, we may have found eof - 30426 ; 26/03/2023 - 30427 000040E6 E88B02 call FlshFil - 30428 ;call FLUSHFIL - 30429 000040E9 803E[D99E]00 cmp byte [TERMREAD],0 - 30430 000040EE 7510 jne short CLOSESRC ; give up - 30431 000040F0 EB8F jmp short COPYLP - 30432 TESTDEV: - 30433 000040F2 803E[7A9E]00 cmp byte [SRCISDEV],0 ; if file then EOF - 30434 000040F7 7407 je short CLOSESRC - 30435 000040F9 803E[069C]00 cmp byte [RDEOF],0 - 30436 000040FE 7481 je short COPYLP ; on device, go till ^Z - 30437 CLOSESRC: - 30438 00004100 8B1E[789E] mov bx,[SRCHAND] - 30439 CLOSESRC2: - 30440 00004104 B43E mov ah,CLOSE ; 3Eh - 30441 00004106 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 30442 ; BX = file handle - 30443 CLOSESRCDEST_RETN: - 30444 00004108 C3 retn - 30445 - 30446 ; --------------------------------------------------------------------------- - 30447 - 30448 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 30449 CLOSEDEST: + 30315 00004035 8916[DD9E] mov [CPDATE],dx ; save date + 30316 00004039 890E[DF9E] mov [CPTIME],cx ; save time + 30317 + 30318 ; MSDOS 6.0 + 30319 ;jmp short No_Copy_Xa ; (xa copy code removed) + 30320 ; 26/04/2023 + 30321 No_Copy_Xa: + 30322 ; 26/03/2023 + 30323 ;mov bx,[SRCHAND] ;AN022; get handle back + 30324 + 30325 ; MSDOS 3.3 (& MSDOS 6.0) + 30326 0000403D B80044 mov ax,(IOCTL<<8) ; 4400h + 30327 00004040 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 30328 ; BX = file or device handle + 30329 ;and dl,devid_ISDEV ; 80h + 30330 ; 18/04/2023 + 30331 00004042 80E280 and dl,80h ; devid_ISDEV + 30332 00004045 8816[7A9E] mov [SRCISDEV],dl ; set source info + 30333 00004049 7436 jz short COPYLP ; source not a device + 30334 0000404B 803E[D69E]00 cmp byte [BINARY],0 + 30335 00004050 742F je short COPYLP ; ascii device ok + 30336 00004052 BA[6091] mov dx,INBDEV_PTR ; cannot do binary input + 30337 00004055 E96B04 jmp COPYERR + 30338 + 30339 Error_On_Source: ;AN022; we have a BAD error + 30340 00004058 E8E0DF call Set_Ext_Error_Msg ;AN022; set up the error message + 30341 0000405B C706[A09D][219E] mov word [string_ptr_2],SrcBuf + 30342 ;AN022; get address of failed string + 30343 00004061 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 + 30344 ;AN022; put number of subst in control block + 30345 00004066 E8B713 call std_eprintf ;AN022; print it + 30346 ; 26/03/2023 - Retro DOS v4.0 COMMAND.COM + 30347 00004069 8B1E[789E] mov bx,[SRCHAND] + 30348 ;cmp word [SRCHAND],0 ;AN022; did we open the file? + 30349 ;je short No_Close_Src ;AN022; no - don't close + 30350 0000406D 09DB or bx,bx + 30351 0000406F 7403 jz short No_Close_Src + 30352 ;call CLOSESRC ;AN022; clean up + 30353 ; 26/03/2023 + 30354 00004071 E89000 call CLOSESRC2 ; bx = [SRCHAND] + 30355 No_Close_Src: ;AN022; + 30356 00004074 803E[139C]00 cmp byte [CFLAG],0 ;AN022; was destination created? + 30357 00004079 7403 je short EndCopyJ3 ;AN022; no - just cleanup and exit + 30358 0000407B E953FD jmp ENDCOPY ;AN022; clean up concatenation and exit + 30359 EndCopyJ3: ;AN022; + 30360 0000407E E953FD jmp ENDCOPY2 ;AN022; + 30361 + 30362 ; 26/04/2023 + 30363 ;No_Copy_Xa: + 30364 ; ; 26/03/2023 + 30365 ; ;mov bx,[SRCHAND] ;AN022; get handle back + 30366 ; + 30367 ; ; MSDOS 3.3 (& MSDOS 6.0) + 30368 ; mov ax,(IOCTL<<8) ; 4400h + 30369 ; int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 30370 ; ; BX = file or device handle + 30371 ; ;and dl,devid_ISDEV ; 80h + 30372 ; ; 18/04/2023 + 30373 ; and dl,80h ; devid_ISDEV + 30374 ; mov [SRCISDEV],dl ; set source info + 30375 ; jz short COPYLP ; source not a device + 30376 ; cmp byte [BINARY],0 + 30377 ; je short COPYLP ; ascii device ok + 30378 ; mov dx,INBDEV_PTR ; cannot do binary input + 30379 ; jmp COPYERR + 30380 + 30381 COPYLP: + 30382 ; 26/03/2023 + 30383 00004081 8B1E[789E] mov bx,[SRCHAND] ; ? ; 26/03/2023 + 30384 00004085 8B0E[159C] mov cx,[BYTCNT] + 30385 00004089 8B16[199C] mov dx,[NXTADD] + 30386 0000408D 29D1 sub cx,dx ; compute available space + 30387 0000408F 750E jnz short GOTROOM + 30388 00004091 E8E002 call FlshFil ; MSDOS 6.0 + 30389 ;call FLUSHFIL ; MSDOS 3.3 + 30390 00004094 803E[D99E]00 cmp byte [TERMREAD],0 + 30391 00004099 7565 jne short CLOSESRC ; give up + 30392 0000409B 8B0E[159C] mov cx,[BYTCNT] + 30393 GOTROOM: + 30394 0000409F 1E push ds + 30395 000040A0 8E1E[F79B] mov ds,[TPA] + 30396 000040A4 B43F mov ah,READ ; 3Fh + 30397 000040A6 CD21 int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE + 30398 ; BX = file handle,CX = number of bytes to read + 30399 ; DS:DX -> buffer + 30400 000040A8 1F pop ds + 30401 ;jc short CLOSESRC ; MSDOS 3.3 + 30402 ; 26/03/2023 + 30403 000040A9 72AD jc short Error_On_Source ; MSDOS 6.0 + 30404 000040AB 89C1 mov cx,ax ; get count + 30405 000040AD E351 jcxz CLOSESRC ; no more to read + 30406 000040AF 803E[7A9E]00 cmp byte [SRCISDEV],0 + 30407 000040B4 7507 jne short NOTESTA ; is a device, ascii mode + 30408 000040B6 803E[DA9E]00 cmp byte [ASCII],0 + 30409 000040BB 741B je short BINREAD + 30410 NOTESTA: + 30411 000040BD 89CA mov dx,cx + 30412 000040BF 8B3E[199C] mov di,[NXTADD] + 30413 000040C3 B01A mov al,1Ah + 30414 000040C5 06 push es + 30415 000040C6 8E06[F79B] mov es,[TPA] ; scan for EOF + 30416 000040CA F2AE repne scasb + 30417 000040CC 07 pop es + 30418 000040CD 7505 jnz short USEALL + 30419 000040CF FE06[069C] inc byte [RDEOF] + 30420 000040D3 41 inc cx + 30421 USEALL: + 30422 000040D4 29CA sub dx,cx + 30423 000040D6 89D1 mov cx,dx + 30424 BINREAD: + 30425 000040D8 030E[199C] add cx,[NXTADD] + 30426 000040DC 890E[199C] mov [NXTADD],cx + 30427 000040E0 3B0E[159C] cmp cx,[BYTCNT] ; is buffer full? + 30428 000040E4 720C jb short TESTDEV ; if not, we may have found eof + 30429 ; 26/03/2023 + 30430 000040E6 E88B02 call FlshFil + 30431 ;call FLUSHFIL + 30432 000040E9 803E[D99E]00 cmp byte [TERMREAD],0 + 30433 000040EE 7510 jne short CLOSESRC ; give up + 30434 000040F0 EB8F jmp short COPYLP + 30435 TESTDEV: + 30436 000040F2 803E[7A9E]00 cmp byte [SRCISDEV],0 ; if file then EOF + 30437 000040F7 7407 je short CLOSESRC + 30438 000040F9 803E[069C]00 cmp byte [RDEOF],0 + 30439 000040FE 7481 je short COPYLP ; on device, go till ^Z + 30440 CLOSESRC: + 30441 00004100 8B1E[789E] mov bx,[SRCHAND] + 30442 CLOSESRC2: + 30443 00004104 B43E mov ah,CLOSE ; 3Eh + 30444 00004106 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 30445 ; BX = file handle + 30446 CLOSESRCDEST_RETN: + 30447 00004108 C3 retn + 30448 + 30449 ; --------------------------------------------------------------------------- 30450 - 30451 ; We are called to close the destination. - 30452 ; We need to note whether or not there is any internal data left - 30453 ; to be flushed out. - 30454 - 30455 00004109 803E[149C]00 cmp byte [DestClosed],0 - 30456 0000410E 75F8 jne short CLOSESRCDEST_RETN ; don't double close - 30457 00004110 A0[0F9C] mov al,[DestSwitch] - 30458 00004113 E80904 call SETASC ; check for b or a switch - 30459 00004116 742E jz short BINCLOS ; on destination - 30460 00004118 8B1E[199C] mov bx,[NXTADD] - 30461 ; - 30462 ;M048 -- TryFlush changes the state of ConCat flag. So, before we append a - 30463 ;^Z, let's always flush out. This way if the ConCat flag changes, we will - 30464 ;just return without appending a ^Z incorrectly for the first file (since we - 30465 ;are concatenating now). Also, in case it is a single file copy, we will - 30466 ;anyway write the ^Z out separately. The only drawback is that there is a - 30467 ;performance overhead on single ASCII file copies which now always involve - 30468 ;2 writes instead of 1 before. Is this really that important? - 30469 ; - 30470 ;M048; cmp bx,[BYTCNT] ; is memory full? - 30471 ;M048; jne short PutZ - 30472 - 30473 ; 26/03/2023 - 30474 ; MSDOS 3.3 - 30475 ;cmp bx,[BYTCNT] ; is memory full? - 30476 ;jne short PUTZ - 30477 - 30478 ; 26/03/2023 - 30479 0000411C E84802 call TRYFLUSH ; flush (and double-check for concat) - 30480 0000411F 7402 jz short NOCONC - 30481 CONCHNG: - 30482 00004121 F9 stc - 30483 00004122 C3 retn - 30484 - 30485 NOCONC: - 30486 00004123 31DB xor bx,bx - 30487 PUTZ: - 30488 00004125 1E push ds - 30489 00004126 8E1E[F79B] mov ds,[TPA] - 30490 0000412A C7071A00 mov word [bx],1Ah ; add EOF mark (ctrl-Z) - 30491 0000412E 1F pop ds - 30492 0000412F FF06[199C] inc word [NXTADD] ; make sure our ^z gets written - 30493 00004133 C606[D59E]00 mov byte [NOWRITE],0 - 30494 00004138 A1[D79E] mov ax,[WRITTEN] - 30495 0000413B 0306[199C] add ax,[NXTADD] - 30496 0000413F 7205 jc short BINCLOS ; > 1 - 30497 00004141 83F801 cmp ax,1 - 30498 00004144 740C je short FORGETITJ ; Written = 0 NxtAdd = 1 (the ^Z) - 30499 BINCLOS: - 30500 00004146 E81E02 call TRYFLUSH - 30501 00004149 75D6 jnz short CONCHNG - 30502 - 30503 ; 26/04/2023 - 30504 0000414B 833E[D79E]00 cmp word [WRITTEN],0 - 30505 ; 26/03/2023 - 30506 00004150 7503 jnz short NO_FORGET - 30507 FORGETITJ: - 30508 ;jz short FORGETIT ; never wrote nothing - 30509 ; 26/03/2023 - 30510 00004152 E98500 jmp FORGETIT ; 18/04/2023 - 30511 NO_FORGET: ; wrote something - 30512 00004155 8B1E[159E] mov bx,[DESTHAND] - 30513 00004159 8B0E[DF9E] mov cx,[CPTIME] - 30514 0000415D 8B16[DD9E] mov dx,[CPDATE] - 30515 00004161 803E[D49E]00 cmp byte [INEXACT],0 ; copy not exact? - 30516 00004166 7431 je short DODCLOSE ; if no, copy date & time - 30517 00004168 B42C mov ah,Get_Time ; 2Ch - 30518 0000416A CD21 int 21h ; DOS - GET CURRENT TIME - 30519 ; Return: CH = hours,CL = minutes,DH = seconds - 30520 ; DL = hundredths of seconds - 30521 0000416C D0E1 shl cl,1 - 30522 0000416E D0E1 shl cl,1 ; left justify min in cl - 30523 00004170 D1E1 shl cx,1 - 30524 00004172 D1E1 shl cx,1 - 30525 00004174 D1E1 shl cx,1 ; hours to high 5 bits, min to 5-10 - 30526 00004176 D0EE shr dh,1 ; divide seconds by 2 (now 5 bits) - 30527 00004178 08F1 or cl,dh ; and stick into low 5 bits of cx - 30528 0000417A 51 push cx ; save packed time - 30529 0000417B B42A mov ah,Get_Date ; 2Ah - 30530 0000417D CD21 int 21h ; DOS - GET CURRENT DATE - 30531 ; Return: DL = day,DH = month, CX = year - 30532 ; AL = day of the week (0=Sunday,1=Monday,etc.) - 30533 0000417F 81E9BC07 sub cx,1980 - 30534 00004183 86E9 xchg ch,cl - 30535 00004185 D1E1 shl cx,1 ; year to high 7 bits - 30536 00004187 D0E6 shl dh,1 ; month to high 3 bits - 30537 00004189 D0E6 shl dh,1 - 30538 0000418B D0E6 shl dh,1 - 30539 0000418D D0E6 shl dh,1 - 30540 0000418F D0E6 shl dh,1 ; most sig bit of month in carry - 30541 00004191 80D500 adc ch,0 ; put that bit next to year - 30542 00004194 08F2 or dl,dh ; or low three of month into day - 30543 00004196 88EE mov dh,ch ; get year and high bit of month - 30544 00004198 59 pop cx - 30545 DODCLOSE: - 30546 00004199 83FB00 cmp bx,0 - 30547 0000419C 7E36 jle short CLOSEDONE - 30548 0000419E B80157 mov ax,(File_Times<<8)|1 ; 5701h - 30549 000041A1 CD21 int 21h ; DOS - 2+ - SET FILE'S DATE/TIME - 30550 ; BX = file handle,CX = time to be set - 30551 ; DX = date to be set - 30552 ; 26/03/2023 - 30553 ; MSDOS 6.0 - 30554 000041A3 721A jc short Cleanup_Err ;AN022; handle error - 30555 - 30556 ; See if the destination has *anything* in it. - 30557 ; If not, just close and delete it. + 30451 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 30452 CLOSEDEST: + 30453 + 30454 ; We are called to close the destination. + 30455 ; We need to note whether or not there is any internal data left + 30456 ; to be flushed out. + 30457 + 30458 00004109 803E[149C]00 cmp byte [DestClosed],0 + 30459 0000410E 75F8 jne short CLOSESRCDEST_RETN ; don't double close + 30460 00004110 A0[0F9C] mov al,[DestSwitch] + 30461 00004113 E80904 call SETASC ; check for b or a switch + 30462 00004116 742E jz short BINCLOS ; on destination + 30463 00004118 8B1E[199C] mov bx,[NXTADD] + 30464 ; + 30465 ;M048 -- TryFlush changes the state of ConCat flag. So, before we append a + 30466 ;^Z, let's always flush out. This way if the ConCat flag changes, we will + 30467 ;just return without appending a ^Z incorrectly for the first file (since we + 30468 ;are concatenating now). Also, in case it is a single file copy, we will + 30469 ;anyway write the ^Z out separately. The only drawback is that there is a + 30470 ;performance overhead on single ASCII file copies which now always involve + 30471 ;2 writes instead of 1 before. Is this really that important? + 30472 ; + 30473 ;M048; cmp bx,[BYTCNT] ; is memory full? + 30474 ;M048; jne short PutZ + 30475 + 30476 ; 26/03/2023 + 30477 ; MSDOS 3.3 + 30478 ;cmp bx,[BYTCNT] ; is memory full? + 30479 ;jne short PUTZ + 30480 + 30481 ; 26/03/2023 + 30482 0000411C E84802 call TRYFLUSH ; flush (and double-check for concat) + 30483 0000411F 7402 jz short NOCONC + 30484 CONCHNG: + 30485 00004121 F9 stc + 30486 00004122 C3 retn + 30487 + 30488 NOCONC: + 30489 00004123 31DB xor bx,bx + 30490 PUTZ: + 30491 00004125 1E push ds + 30492 00004126 8E1E[F79B] mov ds,[TPA] + 30493 0000412A C7071A00 mov word [bx],1Ah ; add EOF mark (ctrl-Z) + 30494 0000412E 1F pop ds + 30495 0000412F FF06[199C] inc word [NXTADD] ; make sure our ^z gets written + 30496 00004133 C606[D59E]00 mov byte [NOWRITE],0 + 30497 00004138 A1[D79E] mov ax,[WRITTEN] + 30498 0000413B 0306[199C] add ax,[NXTADD] + 30499 0000413F 7205 jc short BINCLOS ; > 1 + 30500 00004141 83F801 cmp ax,1 + 30501 00004144 740C je short FORGETITJ ; Written = 0 NxtAdd = 1 (the ^Z) + 30502 BINCLOS: + 30503 00004146 E81E02 call TRYFLUSH + 30504 00004149 75D6 jnz short CONCHNG + 30505 + 30506 ; 26/04/2023 + 30507 0000414B 833E[D79E]00 cmp word [WRITTEN],0 + 30508 ; 26/03/2023 + 30509 00004150 7503 jnz short NO_FORGET + 30510 FORGETITJ: + 30511 ;jz short FORGETIT ; never wrote nothing + 30512 ; 26/03/2023 + 30513 00004152 E98500 jmp FORGETIT ; 18/04/2023 + 30514 NO_FORGET: ; wrote something + 30515 00004155 8B1E[159E] mov bx,[DESTHAND] + 30516 00004159 8B0E[DF9E] mov cx,[CPTIME] + 30517 0000415D 8B16[DD9E] mov dx,[CPDATE] + 30518 00004161 803E[D49E]00 cmp byte [INEXACT],0 ; copy not exact? + 30519 00004166 7431 je short DODCLOSE ; if no, copy date & time + 30520 00004168 B42C mov ah,Get_Time ; 2Ch + 30521 0000416A CD21 int 21h ; DOS - GET CURRENT TIME + 30522 ; Return: CH = hours,CL = minutes,DH = seconds + 30523 ; DL = hundredths of seconds + 30524 0000416C D0E1 shl cl,1 + 30525 0000416E D0E1 shl cl,1 ; left justify min in cl + 30526 00004170 D1E1 shl cx,1 + 30527 00004172 D1E1 shl cx,1 + 30528 00004174 D1E1 shl cx,1 ; hours to high 5 bits, min to 5-10 + 30529 00004176 D0EE shr dh,1 ; divide seconds by 2 (now 5 bits) + 30530 00004178 08F1 or cl,dh ; and stick into low 5 bits of cx + 30531 0000417A 51 push cx ; save packed time + 30532 0000417B B42A mov ah,Get_Date ; 2Ah + 30533 0000417D CD21 int 21h ; DOS - GET CURRENT DATE + 30534 ; Return: DL = day,DH = month, CX = year + 30535 ; AL = day of the week (0=Sunday,1=Monday,etc.) + 30536 0000417F 81E9BC07 sub cx,1980 + 30537 00004183 86E9 xchg ch,cl + 30538 00004185 D1E1 shl cx,1 ; year to high 7 bits + 30539 00004187 D0E6 shl dh,1 ; month to high 3 bits + 30540 00004189 D0E6 shl dh,1 + 30541 0000418B D0E6 shl dh,1 + 30542 0000418D D0E6 shl dh,1 + 30543 0000418F D0E6 shl dh,1 ; most sig bit of month in carry + 30544 00004191 80D500 adc ch,0 ; put that bit next to year + 30545 00004194 08F2 or dl,dh ; or low three of month into day + 30546 00004196 88EE mov dh,ch ; get year and high bit of month + 30547 00004198 59 pop cx + 30548 DODCLOSE: + 30549 00004199 83FB00 cmp bx,0 + 30550 0000419C 7E36 jle short CLOSEDONE + 30551 0000419E B80157 mov ax,(File_Times<<8)|1 ; 5701h + 30552 000041A1 CD21 int 21h ; DOS - 2+ - SET FILE'S DATE/TIME + 30553 ; BX = file handle,CX = time to be set + 30554 ; DX = date to be set + 30555 ; 26/03/2023 + 30556 ; MSDOS 6.0 + 30557 000041A3 721A jc short Cleanup_Err ;AN022; handle error 30558 - 30559 000041A5 B80242 mov ax,(LSEEK<<8)+2 ; 4202h ; seek to EOF - 30560 000041A8 31D2 xor dx,dx - 30561 000041AA 89D1 mov cx,dx - 30562 000041AC CD21 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) - 30563 ; AL = method: offset from end of file - 30564 ; DX:AX is file size - 30565 - 30566 000041AE 09C2 or dx,ax - 30567 000041B0 9C pushf - 30568 000041B1 B80044 mov ax,(IOCTL<<8)+0 ; 4400h ; get the destination attributes - 30569 000041B4 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 30570 ; BX = file or device handle - 30571 000041B6 52 push dx ; save them away - 30572 000041B7 B43E mov ah,CLOSE ; 3Eh - 30573 000041B9 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 30574 ; BX = file handle - 30575 000041BB 5A pop dx - 30576 - 30577 ; 26/03/2023 - Retro DOS v4.0 COMMAND.COM - 30578 ; MSDOS 6.0 - 30579 000041BC 730D jnc short Close_Cont ;AN022; handle error on close - 30580 000041BE 9D popf ;AN022; get the flags back - 30581 Cleanup_Err: ;AN022; - 30582 000041BF E86100 call CleanUpErr ;AN022; attempt to delete the target - 30583 ; 26/03/2023 - 30584 ;call DestDelete ;AN022; attempt to delete the target - 30585 ;jmp short FILECLOSED - 30586 ; ;AN022; close the file - 30587 ; 26/03/2023 - 30588 DestDel_fclosed: - 30589 000041C2 E82700 call DestDelete - 30590 FILECLOSED: - 30591 000041C5 FE06[149C] inc byte [DestClosed] - 30592 RET50: - 30593 000041C9 F8 clc - 30594 000041CA C3 retn - 30595 - 30596 Close_Cont: ;AN022; no error - co - 30597 ; MSDOS 3.3 (& MSDOS 6.0) - 30598 000041CB 9D popf - 30599 000041CC 7506 jnz short CLOSEDONE - 30600 000041CE F7C28000 test dx,80h ; is the destination a device? - 30601 ;jnz short CLOSEDONE ; yes, copy succeeded - 30602 ;call DestDelete - 30603 ;jmp short FILECLOSED - 30604 ; 26/03/2023 - 30605 000041D2 74EE jz short DestDel_fclosed - 30606 CLOSEDONE: - 30607 000041D4 FF06[209C] inc word [FileCnt] - 30608 ; 26/03/2023 - 30609 000041D8 EBEB jmp short FILECLOSED - 30610 - 30611 ;FILECLOSED: - 30612 ; inc byte [DestClosed] - 30613 ;RET50: - 30614 ;clc - 30615 ;retn - 30616 - 30617 FORGETIT: - 30618 000041DA 8B1E[159E] mov bx,[DESTHAND] - 30619 000041DE E8B8FF call DODCLOSE ; close the dest - 30620 000041E1 E80800 call DestDelete - 30621 000041E4 C706[209C]0000 mov word [FileCnt],0 ; no files transferred - 30622 000041EA EBDD jmp short RET50 - 30623 - 30624 ; --------------------------------------------------------------------------- - 30625 - 30626 ; 26/03/2023 - 30627 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30628 DestDelete: - 30629 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 30630 %if 1 - 30631 000041EC 803E[099C]01 cmp byte [notzerofile],1 ; destination file size > 0 - 30632 000041F1 74D6 je short RET50 ; yes, do not delete - 30633 %endif - 30634 000041F3 BA[BE9D] mov dx,DestBuf - 30635 000041F6 B441 mov ah,Unlink ; 41h - 30636 000041F8 CD21 int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) - 30637 ; DS:DX -> ASCIZ pathname of file to delete - 30638 ; (no wildcards allowed) - 30639 000041FA C3 retn - 30640 - 30641 ; --------------------------------------------------------------------------- - 30642 - 30643 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 30644 SOURCE_SET: - 30645 000041FB 56 push si - 30646 000041FC A1[F69E] mov ax,[STARTEL] - 30647 000041FF BE[7B9E] mov si,ScanBuf ; adjust to copy - 30648 00004202 29F0 sub ax,si - 30649 00004204 BF[219E] mov di,SrcBuf - 30650 00004207 01F8 add ax,di - 30651 00004209 A3[1E9E] mov [SrcTail],ax - 30652 0000420C 880E[1D9E] mov [SrcSiz],cl ; save its size - 30653 00004210 41 inc cx ; include the nul - 30654 00004211 F3A4 rep movsb ; save this source - 30655 00004213 883E[209E] mov [SrcInfo],bh ; save info about it - 30656 00004217 5E pop si - 30657 00004218 89E8 mov ax,bp ; switches so far - 30658 0000421A E80203 call SETASC ; set a,b switches accordingly - 30659 0000421D E824E9 call SWITCH ; get any more switches on this arg - 30660 ;call SETASC ; set - 30661 ;retn - 30662 ; 26/03/2023 - 30663 00004220 E9FC02 jmp SETASC - 30664 - 30665 ; =============== S U B R O U T I N E ======================================= - 30666 - 30667 ; MSDOS 6.0 - 30668 - 30669 ;**************************************************************** - 30670 ;* - 30671 ;* ROUTINE: CleanupErr - 30672 ;* - 30673 ;* FUNCTION: Issues extended error message for destination - 30674 ;* if not alreay issued + 30559 ; See if the destination has *anything* in it. + 30560 ; If not, just close and delete it. + 30561 + 30562 000041A5 B80242 mov ax,(LSEEK<<8)+2 ; 4202h ; seek to EOF + 30563 000041A8 31D2 xor dx,dx + 30564 000041AA 89D1 mov cx,dx + 30565 000041AC CD21 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) + 30566 ; AL = method: offset from end of file + 30567 ; DX:AX is file size + 30568 + 30569 000041AE 09C2 or dx,ax + 30570 000041B0 9C pushf + 30571 000041B1 B80044 mov ax,(IOCTL<<8)+0 ; 4400h ; get the destination attributes + 30572 000041B4 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 30573 ; BX = file or device handle + 30574 000041B6 52 push dx ; save them away + 30575 000041B7 B43E mov ah,CLOSE ; 3Eh + 30576 000041B9 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 30577 ; BX = file handle + 30578 000041BB 5A pop dx + 30579 + 30580 ; 26/03/2023 - Retro DOS v4.0 COMMAND.COM + 30581 ; MSDOS 6.0 + 30582 000041BC 730D jnc short Close_Cont ;AN022; handle error on close + 30583 000041BE 9D popf ;AN022; get the flags back + 30584 Cleanup_Err: ;AN022; + 30585 000041BF E86100 call CleanUpErr ;AN022; attempt to delete the target + 30586 ; 26/03/2023 + 30587 ;call DestDelete ;AN022; attempt to delete the target + 30588 ;jmp short FILECLOSED + 30589 ; ;AN022; close the file + 30590 ; 26/03/2023 + 30591 DestDel_fclosed: + 30592 000041C2 E82700 call DestDelete + 30593 FILECLOSED: + 30594 000041C5 FE06[149C] inc byte [DestClosed] + 30595 RET50: + 30596 000041C9 F8 clc + 30597 000041CA C3 retn + 30598 + 30599 Close_Cont: ;AN022; no error - co + 30600 ; MSDOS 3.3 (& MSDOS 6.0) + 30601 000041CB 9D popf + 30602 000041CC 7506 jnz short CLOSEDONE + 30603 000041CE F7C28000 test dx,80h ; is the destination a device? + 30604 ;jnz short CLOSEDONE ; yes, copy succeeded + 30605 ;call DestDelete + 30606 ;jmp short FILECLOSED + 30607 ; 26/03/2023 + 30608 000041D2 74EE jz short DestDel_fclosed + 30609 CLOSEDONE: + 30610 000041D4 FF06[209C] inc word [FileCnt] + 30611 ; 26/03/2023 + 30612 000041D8 EBEB jmp short FILECLOSED + 30613 + 30614 ;FILECLOSED: + 30615 ; inc byte [DestClosed] + 30616 ;RET50: + 30617 ;clc + 30618 ;retn + 30619 + 30620 FORGETIT: + 30621 000041DA 8B1E[159E] mov bx,[DESTHAND] + 30622 000041DE E8B8FF call DODCLOSE ; close the dest + 30623 000041E1 E80800 call DestDelete + 30624 000041E4 C706[209C]0000 mov word [FileCnt],0 ; no files transferred + 30625 000041EA EBDD jmp short RET50 + 30626 + 30627 ; --------------------------------------------------------------------------- + 30628 + 30629 ; 26/03/2023 + 30630 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30631 DestDelete: + 30632 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 30633 %if 1 + 30634 000041EC 803E[099C]01 cmp byte [notzerofile],1 ; destination file size > 0 + 30635 000041F1 74D6 je short RET50 ; yes, do not delete + 30636 %endif + 30637 000041F3 BA[BE9D] mov dx,DestBuf + 30638 000041F6 B441 mov ah,Unlink ; 41h + 30639 000041F8 CD21 int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) + 30640 ; DS:DX -> ASCIZ pathname of file to delete + 30641 ; (no wildcards allowed) + 30642 000041FA C3 retn + 30643 + 30644 ; --------------------------------------------------------------------------- + 30645 + 30646 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 30647 SOURCE_SET: + 30648 000041FB 56 push si + 30649 000041FC A1[F69E] mov ax,[STARTEL] + 30650 000041FF BE[7B9E] mov si,ScanBuf ; adjust to copy + 30651 00004202 29F0 sub ax,si + 30652 00004204 BF[219E] mov di,SrcBuf + 30653 00004207 01F8 add ax,di + 30654 00004209 A3[1E9E] mov [SrcTail],ax + 30655 0000420C 880E[1D9E] mov [SrcSiz],cl ; save its size + 30656 00004210 41 inc cx ; include the nul + 30657 00004211 F3A4 rep movsb ; save this source + 30658 00004213 883E[209E] mov [SrcInfo],bh ; save info about it + 30659 00004217 5E pop si + 30660 00004218 89E8 mov ax,bp ; switches so far + 30661 0000421A E80203 call SETASC ; set a,b switches accordingly + 30662 0000421D E824E9 call SWITCH ; get any more switches on this arg + 30663 ;call SETASC ; set + 30664 ;retn + 30665 ; 26/03/2023 + 30666 00004220 E9FC02 jmp SETASC + 30667 + 30668 ; =============== S U B R O U T I N E ======================================= + 30669 + 30670 ; MSDOS 6.0 + 30671 + 30672 ;**************************************************************** + 30673 ;* + 30674 ;* ROUTINE: CleanupErr 30675 ;* - 30676 ;* INPUT: return from INT 21 - 30677 ;* - 30678 ;* OUTPUT: none - 30679 ;* - 30680 ;**************************************************************** - 30681 - 30682 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 30683 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30684 ; MSDOS 6.0 (MSDOS 5.0) COMMAND.COM - 30685 CleanUpErr: ;proc near ;AN022; - 30686 - 30687 00004223 803E[339F]00 cmp byte [msg_flag],0 ;AN022; have we already issued a message? - 30688 00004228 7511 jnz short CleanupErr_Cont ;AN022; yes - don't issue duplicate error - 30689 0000422A E80EDE call Set_Ext_Error_Msg ;AN022; set up error message - 30690 0000422D C706[A09D][BE9D] mov word [string_ptr_2],DestBuf - 30691 ;AN022; get address of failed string - 30692 00004233 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 - 30693 ;AN022; put number of subst in control block - 30694 00004238 E8E511 call std_eprintf ;AN022; issue the error message - 30695 CleanupErr_Cont: ;AN022; - 30696 getansw_8: ; 12/06/2023 - 30697 0000423B C3 retn ;AN022; return to caller - 30698 - 30699 ;CleanUpErr endp ;AN022; - 30700 + 30676 ;* FUNCTION: Issues extended error message for destination + 30677 ;* if not alreay issued + 30678 ;* + 30679 ;* INPUT: return from INT 21 + 30680 ;* + 30681 ;* OUTPUT: none + 30682 ;* + 30683 ;**************************************************************** + 30684 + 30685 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 30686 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30687 ; MSDOS 6.0 (MSDOS 5.0) COMMAND.COM + 30688 CleanUpErr: ;proc near ;AN022; + 30689 + 30690 00004223 803E[339F]00 cmp byte [msg_flag],0 ;AN022; have we already issued a message? + 30691 00004228 7511 jnz short CleanupErr_Cont ;AN022; yes - don't issue duplicate error + 30692 0000422A E80EDE call Set_Ext_Error_Msg ;AN022; set up error message + 30693 0000422D C706[A09D][BE9D] mov word [string_ptr_2],DestBuf + 30694 ;AN022; get address of failed string + 30695 00004233 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 + 30696 ;AN022; put number of subst in control block + 30697 00004238 E8E511 call std_eprintf ;AN022; issue the error message + 30698 CleanupErr_Cont: ;AN022; + 30699 getansw_8: ; 12/06/2023 + 30700 0000423B C3 retn ;AN022; return to caller 30701 - 30702 ; 12/06/2023 - 30703 ; --------------------------------------------------------------------------- - 30704 ; MSDOS 6.2(2) COMMAND.COM procedure only ! - 30705 ; ----------------------------------------- - 30706 ; Hex-Rays IDA / disassembled source code ! modified for NASM by Erdogan Tan - 30707 ; --------------------------------------------------------------------------- - 30708 - 30709 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30710 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:456Dh + 30702 ;CleanUpErr endp ;AN022; + 30703 + 30704 + 30705 ; 12/06/2023 + 30706 ; --------------------------------------------------------------------------- + 30707 ; MSDOS 6.2(2) COMMAND.COM procedure only ! + 30708 ; ----------------------------------------- + 30709 ; Hex-Rays IDA / disassembled source code ! modified for NASM by Erdogan Tan + 30710 ; --------------------------------------------------------------------------- 30711 - 30712 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30713 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4427h + 30712 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30713 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:456Dh 30714 - 30715 get_answer_YNA: - 30716 0000423C C606[F29E]00 mov byte [cox_dest_file],0 ; clear validation flag - 30717 00004241 B80043 mov ax,4300h - 30718 00004244 BA[BE9D] mov dx,DestBuf - 30719 00004247 CD21 int 21h ; DOS - 2+ - GET FILE ATTRIBUTES - 30720 ; DS:DX -> ASCIZ file name or directory - 30721 ; name without trailing slash - 30722 ;jnc short getansw_1 - 30723 ;jmp getansw_5 - 30724 ; 12/06/2023 - 30725 00004249 F5 cmc - 30726 0000424A 73EF jnc short getansw_8 - 30727 getansw_1: - 30728 0000424C FE06[F29E] inc byte [cox_dest_file] ; valid destination file - 30729 00004250 8D36[E69E] lea si,cox_sublist_buff - 30730 00004254 C7040B00 mov word [si],11 ; sublist size, 11 bytes - 30731 00004258 C74402[BE9D] mov word [si+2],DestBuf ; sublist value (pointer) - 30732 0000425D 8C5C04 mov [si+4],ds ; sublist segment - 30733 ;mov byte [si+6],1 ; sub id (N of %N) - 30734 00004260 C6440710 mov byte [si+7],10h ; data type flags - 30735 ;mov byte [si+8],0 ; maximum length (chars) - 30736 ;mov byte [si+9],0 ; minimum length (chars) - 30737 ;mov byte [si+10],0 ; pad field character (0) - 30738 ; 12/06/2023 - 30739 00004264 31C9 xor cx,cx - 30740 00004266 894C08 mov [si+8],cx ; 0 - 30741 00004269 884C0A mov [si+10],cl ; 0 - 30742 0000426C FEC1 inc cl - 30743 0000426E 884C06 mov [si+6],cl ; 1 - 30744 - 30745 ; 12/06/2023 - 30746 ;lea si,cox_sublist_buff - 30747 00004271 B84F04 mov ax,1103 ; message number - 30748 ; 'Overwrite %1 (Yes/No/All)?' - 30749 00004274 BB0200 mov bx,2 ; std error (file handle = 2) - 30750 ; 12/06/2023 - 30751 ;mov cx,1 ; byte count - 30752 ; cx = 1 - 30753 ;mov dh,0FFh ; message class (utility) - 30754 ;xor dl,dl ; control flag = 0 - 30755 00004277 31D2 xor dx,dx - 30756 00004279 FECE dec dh ; dh = 0FFh - 30757 0000427B E87514 call SYSDISPMSG - 30758 ; 12/06/2023 - 30759 ;xor bx,bx - 30760 ; bh = 0 - 30761 getansw_2: - 30762 0000427E B8080C mov ax,0C08h - 30763 00004281 CD21 int 21h ; DOS - CLEAR KEYBOARD BUFFER - 30764 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. - 30765 ;cmp al,0 - 30766 ;jz short getansw_2 - 30767 ; 12/06/2023 - 30768 00004283 20C0 and al,al - 30769 00004285 74F7 jz short getansw_2 - 30770 00004287 3C0D cmp al,0Dh - 30771 00004289 743B je short getansw_4 - 30772 0000428B 88C3 mov bl,al - 30773 0000428D 88C2 mov dl,al - 30774 0000428F B82065 mov ax,6520h - 30775 00004292 CD21 int 21h ; DOS - 4.x internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION - 30776 ; AL = function - - 30777 00004294 3A16[8D6D] cmp dl,[_Y_es] ; 'Y' ? - 30778 00004298 740C je short getansw_3 - 30779 0000429A 3A16[8E6D] cmp dl,[_N_o] ; 'N' ? - 30780 0000429E 7406 je short getansw_3 - 30781 000042A0 3A16[8F6D] cmp dl,[_A_ll] ; 'A' ? - 30782 000042A4 75D8 jne short getansw_2 - 30783 getansw_3: - 30784 000042A6 88DF mov bh,bl - 30785 000042A8 53 push bx - 30786 000042A9 881E[8C6D] mov [MSG_1104],bl - 30787 000042AD B440 mov ah,40h - 30788 000042AF BB0200 mov bx,2 ; std error (file handle = 2) - 30789 000042B2 B90100 mov cx,1 ; byte count - 30790 000042B5 BA[8C6D] mov dx,MSG_1104 - 30791 000042B8 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 30792 ; BX = file handle, CX = number of bytes to write, DS:DX -> buffer - 30793 000042BA B440 mov ah,40h - 30794 000042BC C606[8C6D]08 mov byte [MSG_1104],8 ; backspace (move cursor to back) - 30795 000042C1 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 30796 ; BX = file handle, CX = number of bytes to write, DS:DX -> buffer - 30797 000042C3 5B pop bx - 30798 000042C4 EBB8 jmp short getansw_2 - 30799 getansw_4: - 30800 ;cmp bh,0 - 30801 ;jz short getansw_2 - 30802 ; 12/06/2023 - 30803 000042C6 08FF or bh,bh - 30804 000042C8 74B4 jz short getansw_2 - 30805 000042CA 88FA mov dl,bh - 30806 000042CC B82065 mov ax,6520h - 30807 000042CF CD21 int 21h ; DOS - 4.x internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION - 30808 ; AL = function - - 30809 000042D1 52 push dx - 30810 000042D2 B82E04 mov ax,1070 ; message number - 30811 000042D5 BB0200 mov bx,2 ; std error (file handle = 2) - 30812 000042D8 31C9 xor cx,cx - 30813 ;mov dh,0FFh ; message class (utility) - 30814 ;xor dl,dl - 30815 ; 12/06/2023 - 30816 000042DA 31D2 xor dx,dx - 30817 000042DC FECE dec dh ; dh = 0FFh - 30818 000042DE E81214 call SYSDISPMSG - 30819 000042E1 5A pop dx - 30820 000042E2 3A16[8D6D] cmp dl,[_Y_es] - 30821 000042E6 740B jz short getansw_5 - 30822 000042E8 3A16[8E6D] cmp dl,[_N_o] - 30823 000042EC 7406 jz short getansw_6 - 30824 000042EE C606[F19E]00 mov byte [cox_y_override],0 - 30825 ; 12/06/2023 - 30826 ;jmp short $+2 - 30827 getansw_5: + 30715 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30716 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4427h + 30717 + 30718 get_answer_YNA: + 30719 0000423C C606[F29E]00 mov byte [cox_dest_file],0 ; clear validation flag + 30720 00004241 B80043 mov ax,4300h + 30721 00004244 BA[BE9D] mov dx,DestBuf + 30722 00004247 CD21 int 21h ; DOS - 2+ - GET FILE ATTRIBUTES + 30723 ; DS:DX -> ASCIZ file name or directory + 30724 ; name without trailing slash + 30725 ;jnc short getansw_1 + 30726 ;jmp getansw_5 + 30727 ; 12/06/2023 + 30728 00004249 F5 cmc + 30729 0000424A 73EF jnc short getansw_8 + 30730 getansw_1: + 30731 0000424C FE06[F29E] inc byte [cox_dest_file] ; valid destination file + 30732 00004250 8D36[E69E] lea si,cox_sublist_buff + 30733 00004254 C7040B00 mov word [si],11 ; sublist size, 11 bytes + 30734 00004258 C74402[BE9D] mov word [si+2],DestBuf ; sublist value (pointer) + 30735 0000425D 8C5C04 mov [si+4],ds ; sublist segment + 30736 ;mov byte [si+6],1 ; sub id (N of %N) + 30737 00004260 C6440710 mov byte [si+7],10h ; data type flags + 30738 ;mov byte [si+8],0 ; maximum length (chars) + 30739 ;mov byte [si+9],0 ; minimum length (chars) + 30740 ;mov byte [si+10],0 ; pad field character (0) + 30741 ; 12/06/2023 + 30742 00004264 31C9 xor cx,cx + 30743 00004266 894C08 mov [si+8],cx ; 0 + 30744 00004269 884C0A mov [si+10],cl ; 0 + 30745 0000426C FEC1 inc cl + 30746 0000426E 884C06 mov [si+6],cl ; 1 + 30747 + 30748 ; 12/06/2023 + 30749 ;lea si,cox_sublist_buff + 30750 00004271 B84F04 mov ax,1103 ; message number + 30751 ; 'Overwrite %1 (Yes/No/All)?' + 30752 00004274 BB0200 mov bx,2 ; std error (file handle = 2) + 30753 ; 12/06/2023 + 30754 ;mov cx,1 ; byte count + 30755 ; cx = 1 + 30756 ;mov dh,0FFh ; message class (utility) + 30757 ;xor dl,dl ; control flag = 0 + 30758 00004277 31D2 xor dx,dx + 30759 00004279 FECE dec dh ; dh = 0FFh + 30760 0000427B E87514 call SYSDISPMSG + 30761 ; 12/06/2023 + 30762 ;xor bx,bx + 30763 ; bh = 0 + 30764 getansw_2: + 30765 0000427E B8080C mov ax,0C08h + 30766 00004281 CD21 int 21h ; DOS - CLEAR KEYBOARD BUFFER + 30767 ; AL must be 01h, 06h, 07h, 08h, or 0Ah. + 30768 ;cmp al,0 + 30769 ;jz short getansw_2 + 30770 ; 12/06/2023 + 30771 00004283 20C0 and al,al + 30772 00004285 74F7 jz short getansw_2 + 30773 00004287 3C0D cmp al,0Dh + 30774 00004289 743B je short getansw_4 + 30775 0000428B 88C3 mov bl,al + 30776 0000428D 88C2 mov dl,al + 30777 0000428F B82065 mov ax,6520h + 30778 00004292 CD21 int 21h ; DOS - 4.x internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION + 30779 ; AL = function - + 30780 00004294 3A16[8D6D] cmp dl,[_Y_es] ; 'Y' ? + 30781 00004298 740C je short getansw_3 + 30782 0000429A 3A16[8E6D] cmp dl,[_N_o] ; 'N' ? + 30783 0000429E 7406 je short getansw_3 + 30784 000042A0 3A16[8F6D] cmp dl,[_A_ll] ; 'A' ? + 30785 000042A4 75D8 jne short getansw_2 + 30786 getansw_3: + 30787 000042A6 88DF mov bh,bl + 30788 000042A8 53 push bx + 30789 000042A9 881E[8C6D] mov [MSG_1104],bl + 30790 000042AD B440 mov ah,40h + 30791 000042AF BB0200 mov bx,2 ; std error (file handle = 2) + 30792 000042B2 B90100 mov cx,1 ; byte count + 30793 000042B5 BA[8C6D] mov dx,MSG_1104 + 30794 000042B8 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 30795 ; BX = file handle, CX = number of bytes to write, DS:DX -> buffer + 30796 000042BA B440 mov ah,40h + 30797 000042BC C606[8C6D]08 mov byte [MSG_1104],8 ; backspace (move cursor to back) + 30798 000042C1 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 30799 ; BX = file handle, CX = number of bytes to write, DS:DX -> buffer + 30800 000042C3 5B pop bx + 30801 000042C4 EBB8 jmp short getansw_2 + 30802 getansw_4: + 30803 ;cmp bh,0 + 30804 ;jz short getansw_2 + 30805 ; 12/06/2023 + 30806 000042C6 08FF or bh,bh + 30807 000042C8 74B4 jz short getansw_2 + 30808 000042CA 88FA mov dl,bh + 30809 000042CC B82065 mov ax,6520h + 30810 000042CF CD21 int 21h ; DOS - 4.x internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION + 30811 ; AL = function - + 30812 000042D1 52 push dx + 30813 000042D2 B82E04 mov ax,1070 ; message number + 30814 000042D5 BB0200 mov bx,2 ; std error (file handle = 2) + 30815 000042D8 31C9 xor cx,cx + 30816 ;mov dh,0FFh ; message class (utility) + 30817 ;xor dl,dl + 30818 ; 12/06/2023 + 30819 000042DA 31D2 xor dx,dx + 30820 000042DC FECE dec dh ; dh = 0FFh + 30821 000042DE E81214 call SYSDISPMSG + 30822 000042E1 5A pop dx + 30823 000042E2 3A16[8D6D] cmp dl,[_Y_es] + 30824 000042E6 740B jz short getansw_5 + 30825 000042E8 3A16[8E6D] cmp dl,[_N_o] + 30826 000042EC 7406 jz short getansw_6 + 30827 000042EE C606[F19E]00 mov byte [cox_y_override],0 30828 ; 12/06/2023 - 30829 ;clc - 30830 ; cf = 0 - 30831 ;jmp short getansw_7 - 30832 ; 12/06/2023 - 30833 000042F3 C3 retn - 30834 getansw_6: - 30835 gcpcmdo_2: ; 12/06/2023 - 30836 gecpcmd_3: ; 12/06/2023 - 30837 000042F4 F9 stc - 30838 getansw_7: - 30839 000042F5 C3 retn - 30840 - 30841 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30842 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:463Ah + 30829 ;jmp short $+2 + 30830 getansw_5: + 30831 ; 12/06/2023 + 30832 ;clc + 30833 ; cf = 0 + 30834 ;jmp short getansw_7 + 30835 ; 12/06/2023 + 30836 000042F3 C3 retn + 30837 getansw_6: + 30838 gcpcmdo_2: ; 12/06/2023 + 30839 gecpcmd_3: ; 12/06/2023 + 30840 000042F4 F9 stc + 30841 getansw_7: + 30842 000042F5 C3 retn 30843 - 30844 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30845 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:44F1h - 30846 init_copycmd_option: - 30847 000042F6 C606[F19E]01 mov byte [cox_y_override],1 ; suppress copy overwrite confirmation - 30848 000042FB 06 push es - 30849 000042FC 8E06[F59B] mov es,[RESSEG] - 30850 - 30851 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 30852 %if 1 - 30853 00004300 26803E[FA01]63 cmp byte [es:cox_location],'c' ; "cox" - 30854 00004306 7520 jne short icpcmd_1 - 30855 %endif - 30856 00004308 268E06[3A04] mov es,[es:EnvirSeg] - 30857 0000430D 8D36[7697] lea si,copycmd ; "COPYCMD=" - 30858 00004311 B90800 mov cx,8 - 30859 00004314 E83500 call getenv_copycmd - 30860 00004317 7216 jc short icpcmd_3 - 30861 00004319 E82000 call get_copycmd_option ; copycmd=/Y or copycmd=/-Y - 30862 0000431C 720F jc short icpcmd_2 - 30863 0000431E 47 inc di ; skip '/' - 30864 0000431F 268A05 mov al,[es:di] - 30865 00004322 24DF and al,0DFh ; convert to uppercase - 30866 00004324 3C59 cmp al,'Y' - 30867 00004326 7505 jnz short icpcmd_2 - 30868 icpcmd_1: - 30869 00004328 C606[F19E]00 mov byte [cox_y_override],0 ; clear copy overwrite question/confirmation - 30870 ; (don't suppress) - 30871 icpcmd_2: - 30872 0000432D 07 pop es - 30873 0000432E C3 retn - 30874 icpcmd_3: ; ... - 30875 0000432F 8E06[F59B] mov es,[RESSEG] - 30876 00004333 803E[FD01]00 cmp byte [cox_Y_option],0 ; default (/Y) switch option (1 = enabled) - 30877 00004338 74F3 jz short icpcmd_2 - 30878 0000433A EBEC jmp short icpcmd_1 - 30879 - 30880 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30881 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4679h + 30844 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30845 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:463Ah + 30846 + 30847 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30848 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:44F1h + 30849 init_copycmd_option: + 30850 000042F6 C606[F19E]01 mov byte [cox_y_override],1 ; suppress copy overwrite confirmation + 30851 000042FB 06 push es + 30852 000042FC 8E06[F59B] mov es,[RESSEG] + 30853 + 30854 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 30855 %if 1 + 30856 00004300 26803E[FA01]63 cmp byte [es:cox_location],'c' ; "cox" + 30857 00004306 7520 jne short icpcmd_1 + 30858 %endif + 30859 00004308 268E06[3A04] mov es,[es:EnvirSeg] + 30860 0000430D 8D36[7697] lea si,copycmd ; "COPYCMD=" + 30861 00004311 B90800 mov cx,8 + 30862 00004314 E83500 call getenv_copycmd + 30863 00004317 7216 jc short icpcmd_3 + 30864 00004319 E82000 call get_copycmd_option ; copycmd=/Y or copycmd=/-Y + 30865 0000431C 720F jc short icpcmd_2 + 30866 0000431E 47 inc di ; skip '/' + 30867 0000431F 268A05 mov al,[es:di] + 30868 00004322 24DF and al,0DFh ; convert to uppercase + 30869 00004324 3C59 cmp al,'Y' + 30870 00004326 7505 jnz short icpcmd_2 + 30871 icpcmd_1: + 30872 00004328 C606[F19E]00 mov byte [cox_y_override],0 ; clear copy overwrite question/confirmation + 30873 ; (don't suppress) + 30874 icpcmd_2: + 30875 0000432D 07 pop es + 30876 0000432E C3 retn + 30877 icpcmd_3: ; ... + 30878 0000432F 8E06[F59B] mov es,[RESSEG] + 30879 00004333 803E[FD01]00 cmp byte [cox_Y_option],0 ; default (/Y) switch option (1 = enabled) + 30880 00004338 74F3 jz short icpcmd_2 + 30881 0000433A EBEC jmp short icpcmd_1 30882 - 30883 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30884 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4538h - 30885 get_copycmd_option: - 30886 0000433C 26803D00 cmp byte [es:di],0 - 30887 00004340 74B2 jz short gcpcmdo_2 - 30888 00004342 26803D2F cmp byte [es:di],'/' - 30889 00004346 7403 jz short gcpcmdo_1 - 30890 00004348 47 inc di - 30891 00004349 EBF1 jmp short get_copycmd_option - 30892 gcpcmdo_1: - 30893 ; 12/06/2023 - 30894 ;clc - 30895 ; cf = 0 - 30896 ;jmp short gcpcmdo_3 - 30897 ; 12/06/2023 - 30898 0000434B C3 retn - 30899 ; 12/06/2023 - 30900 ;gcpcmdo_2: - 30901 ; stc - 30902 ;gcpcmdo_3: - 30903 ; retn - 30904 - 30905 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30906 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:468Dh + 30883 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30884 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4679h + 30885 + 30886 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30887 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4538h + 30888 get_copycmd_option: + 30889 0000433C 26803D00 cmp byte [es:di],0 + 30890 00004340 74B2 jz short gcpcmdo_2 + 30891 00004342 26803D2F cmp byte [es:di],'/' + 30892 00004346 7403 jz short gcpcmdo_1 + 30893 00004348 47 inc di + 30894 00004349 EBF1 jmp short get_copycmd_option + 30895 gcpcmdo_1: + 30896 ; 12/06/2023 + 30897 ;clc + 30898 ; cf = 0 + 30899 ;jmp short gcpcmdo_3 + 30900 ; 12/06/2023 + 30901 0000434B C3 retn + 30902 ; 12/06/2023 + 30903 ;gcpcmdo_2: + 30904 ; stc + 30905 ;gcpcmdo_3: + 30906 ; retn 30907 - 30908 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30909 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:454Bh - 30910 getenv_copycmd: - 30911 0000434C 31FF xor di,di - 30912 0000434E 30C0 xor al,al - 30913 gecpcmd_1: - 30914 ;cmp byte [es:di],0 - 30915 ; 12/06/2023 - 30916 00004350 263805 cmp [es:di],al ; 0 - 30917 00004353 749F jz short gecpcmd_3 - 30918 00004355 51 push cx - 30919 00004356 56 push si - 30920 00004357 F3A6 repe cmpsb - 30921 00004359 5E pop si - 30922 0000435A 59 pop cx - 30923 0000435B 7409 jz short gecpcmd_2 ; cf = 0 - 30924 0000435D 51 push cx - 30925 0000435E B90080 mov cx,32768 - 30926 00004361 F2AE repne scasb ; al = 0 - 30927 00004363 59 pop cx - 30928 00004364 EBEA jmp short gecpcmd_1 - 30929 gecpcmd_2: - 30930 ;clc - 30931 ; 12/06/2023 - 30932 ; cf = 0 - 30933 ;jmp short gecpcmd_4 + 30908 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30909 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:468Dh + 30910 + 30911 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30912 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:454Bh + 30913 getenv_copycmd: + 30914 0000434C 31FF xor di,di + 30915 0000434E 30C0 xor al,al + 30916 gecpcmd_1: + 30917 ;cmp byte [es:di],0 + 30918 ; 12/06/2023 + 30919 00004350 263805 cmp [es:di],al ; 0 + 30920 00004353 749F jz short gecpcmd_3 + 30921 00004355 51 push cx + 30922 00004356 56 push si + 30923 00004357 F3A6 repe cmpsb + 30924 00004359 5E pop si + 30925 0000435A 59 pop cx + 30926 0000435B 7409 jz short gecpcmd_2 ; cf = 0 + 30927 0000435D 51 push cx + 30928 0000435E B90080 mov cx,32768 + 30929 00004361 F2AE repne scasb ; al = 0 + 30930 00004363 59 pop cx + 30931 00004364 EBEA jmp short gecpcmd_1 + 30932 gecpcmd_2: + 30933 ;clc 30934 ; 12/06/2023 - 30935 00004366 C3 retn - 30936 ; 12/06/2023 - 30937 ;gecpcmd_3: - 30938 ; stc - 30939 ;gecpcmd_4: - 30940 ; retn - 30941 - 30942 ;============================================================================ - 30943 ; COPYPR1.ASM, MSDOS 6.0, 1991 - 30944 ;============================================================================ - 30945 ; 01/10/2018 - Retro DOS v3.0 - 30946 - 30947 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2FBBh - 30948 - 30949 ; =============== S U B R O U T I N E ======================================= - 30950 - 30951 ;*** TryFlush - flush copy buffer, double-check for concatenation - 30952 ; - 30953 ; EXIT ZR set if concatenate flag unchanged - 30954 - 30955 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 30956 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3EEAh + 30935 ; cf = 0 + 30936 ;jmp short gecpcmd_4 + 30937 ; 12/06/2023 + 30938 00004366 C3 retn + 30939 ; 12/06/2023 + 30940 ;gecpcmd_3: + 30941 ; stc + 30942 ;gecpcmd_4: + 30943 ; retn + 30944 + 30945 ;============================================================================ + 30946 ; COPYPR1.ASM, MSDOS 6.0, 1991 + 30947 ;============================================================================ + 30948 ; 01/10/2018 - Retro DOS v3.0 + 30949 + 30950 ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 2FBBh + 30951 + 30952 ; =============== S U B R O U T I N E ======================================= + 30953 + 30954 ;*** TryFlush - flush copy buffer, double-check for concatenation + 30955 ; + 30956 ; EXIT ZR set if concatenate flag unchanged 30957 - 30958 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 30959 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:46ADh + 30958 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 30959 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3EEAh 30960 - 30961 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 30962 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:456Ah - 30963 TRYFLUSH: - 30964 00004367 A0[089C] mov al,[Concat] - 30965 0000436A 50 push ax - 30966 ;call FLUSHFIL - 30967 0000436B E80600 call FlshFil - 30968 0000436E 58 pop ax - 30969 0000436F 3A06[089C] cmp al,[Concat] - 30970 00004373 C3 retn - 30971 - 30972 ; =============== S U B R O U T I N E ======================================= - 30973 - 30974 ; 26/03/2023 - 30975 ; MSDOS 3.3 - 30976 ;FLUSHFIL: - 30977 ;mov al,[BINARY] - 30978 ;mov ah,[ASCII] - 30979 ;push ax - 30980 ;call FLSHFIL - 30981 ;pop ax - 30982 ;mov [ASCII],ah - 30983 ;mov [BINARY],al - 30984 ;retn - 30985 - 30986 ; =============== S U B R O U T I N E ======================================= - 30987 - 30988 ;*** Flshfil - write out any data remaining in copy buffer. - 30989 ; - 30990 ; Inputs: - 30991 ; [NXTADD] = No. of bytes to write - 30992 ; [CFLAG] <> 0 if file has been created - 30993 ; Outputs: - 30994 ; [NXTADD] = 0 - 30995 - 30996 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 30997 ; - 30998 ; 13/06/2023 - Retro DOS v4.2 COMMAND.COM - 30999 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:46BAh + 30961 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 30962 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:46ADh + 30963 + 30964 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 30965 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:456Ah + 30966 TRYFLUSH: + 30967 00004367 A0[089C] mov al,[Concat] + 30968 0000436A 50 push ax + 30969 ;call FLUSHFIL + 30970 0000436B E80600 call FlshFil + 30971 0000436E 58 pop ax + 30972 0000436F 3A06[089C] cmp al,[Concat] + 30973 00004373 C3 retn + 30974 + 30975 ; =============== S U B R O U T I N E ======================================= + 30976 + 30977 ; 26/03/2023 + 30978 ; MSDOS 3.3 + 30979 ;FLUSHFIL: + 30980 ;mov al,[BINARY] + 30981 ;mov ah,[ASCII] + 30982 ;push ax + 30983 ;call FLSHFIL + 30984 ;pop ax + 30985 ;mov [ASCII],ah + 30986 ;mov [BINARY],al + 30987 ;retn + 30988 + 30989 ; =============== S U B R O U T I N E ======================================= + 30990 + 30991 ;*** Flshfil - write out any data remaining in copy buffer. + 30992 ; + 30993 ; Inputs: + 30994 ; [NXTADD] = No. of bytes to write + 30995 ; [CFLAG] <> 0 if file has been created + 30996 ; Outputs: + 30997 ; [NXTADD] = 0 + 30998 + 30999 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM 31000 ; - 31001 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 31002 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4577h - 31003 FlshFil: - 31004 00004374 C606[D99E]00 mov byte [TERMREAD],0 - 31005 00004379 803E[139C]00 cmp byte [CFLAG],0 - 31006 0000437E 7403 jz short NotExists - 31007 00004380 E99600 jmp Exists - 31008 NotExists: - 31009 00004383 E8B301 call BUILDDEST ; find out all about the destination - 31010 00004386 E80B04 call COMPNAME ; source and dest. the same? - 31011 00004389 7519 jnz short ProcDest ; if not, go ahead - 31012 0000438B 803E[7A9E]00 cmp byte [SRCISDEV],0 - 31013 00004390 7512 jnz short ProcDest ; same name on device ok - 31014 00004392 803E[089C]00 cmp byte [Concat],0 ; concatenation? - 31015 00004397 BA[0390] mov dx,OVERWR_PTR - 31016 ;je short COPERR ; not concatenating - overwrite error - 31017 ; 26/03/2023 - 31018 0000439A 7503 jne short No_Concat_Err - 31019 0000439C E92401 jmp COPYERR - 31020 - 31021 No_Concat_Err: ; concatenating - 31022 0000439F C606[D59E]01 mov byte [NOWRITE],1 ; flag not writing (just seeking) - 31023 ProcDest: - 31024 ; MSDOS 6.0 - 31025 ;mov ax,(ExtOpen<<8) ; open the file - 31026 ; 26/03/2023 - 31027 000043A4 B8006C mov ax,6C00h - 31028 000043A7 BE[BE9D] mov si,DestBuf ; get file name - 31029 ;M046 - 31030 ; For writes, we want to deny writes by anyone else at the same time that we - 31031 ;are writing to it. For instance, on a network, 2 workstations could try - 31032 ;writing to the same file. Also, because we opened the source file with - 31033 ;DENY NONE, it is fine if the source and destination files are the same as - 31034 ;would happen when we append to an existing file. - 31035 - 31036 ; 26/03/2023 - 31037 ;mov bx,deny_write|write_open_mode - 31038 000043AA BB2100 mov bx,21h ; get open mode for copy; M046 - 31039 000043AD 31C9 xor cx,cx ; no special files - 31040 ;mov dx,write_open_flag ; set up open flags - 31041 000043AF BA0101 mov dx,101h - 31042 - 31043 000043B2 803E[D59E]00 cmp byte [NOWRITE],0 - 31044 000043B7 7503 jne short DoDestOpen ; don't actually create if nowrite set - 31045 ;mov dx,creat_open_flag ; set up create flags - 31046 000043B9 BA1201 mov dx,112h - 31047 - 31048 ; 26/03/2023 - 31049 ; MSDOS 3.3 - 31050 ;mov ax,(OPEN*256)+1 ; 3D01h ; open file, write access - 31051 ;cmp byte [NOWRITE],0 - 31052 ;jne short DODESTOPEN - 31053 ;mov ah,CREAT ; 3Ch - 31054 ;xor cx,cx - 31055 ;DODESTOPEN: - 31056 ;mov dx,DESTBUF - 31057 ;int 21h ; DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT) - 31058 ; ; CX = attributes for file - 31059 ; ; DS:DX -> ASCIZ filename (may include drive and path) - 31060 - 31061 ; 26/03/2023 - 31062 ; ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 301Ch - 31063 ; ;mov dx,FULDIRPTR - 31064 ; ;call GET_EXT_ERR_NUMBER - 31065 ; ;jc short COPERR - 31066 ; - 31067 ; ; 01/10/2018 - 31068 ; ;jnc short DEST_OPEN_OKAY - 31069 ; - 31070 ; ;mov dx,FULDIRPTR - 31071 ; ;call GET_EXT_ERR_NUMBER - 31072 ; ;jmp short COPERR - 31073 ; - 31074 ; jc short DEST_OPEN_ERROR - 31075 - 31076 ; 26/03/2023 - 31077 DoDestOpen: - 31078 000043BC CD21 int 21h ; DOS - 4.0 - EXTENDED OPEN/CREATE - 31079 ; BL = open mode as in AL for normal open (INT 21h/AH=3Dh) - 31080 ; BH = flags - 31081 ; CX = create attribute - 31082 ; DL = action if file exists/does not exists - 31083 ; DH = 00h (reserved), DS:SI -> ASCIZ file name - 31084 - 31085 ; We assume that the error is normal. - 31086 ; TriageError will correct the DX value appropriately. - 31087 - 31088 000043BE 7311 jnc short Dest_Open_Okay - 31089 Xa_Set_Error: ;AN030; error occurred on XA - 31090 000043C0 E878DC call Set_Ext_Error_Msg ;AN030; get extended error - 31091 - 31092 ; 26/04/2023 - Retro DOS v4.0 ( 4.1) COMMAND.COM - 31093 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3F46h - 31094 Ext_Err_Set: ;AN030; - 31095 000043C3 C706[A09D][BE9D] mov word [string_ptr_2],DestBuf - 31096 ;AN000; get address of failed string - 31097 000043C9 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 - 31098 ;AN030; put number of subst in control block - 31099 CopErrJ2: ;AN030; - 31100 000043CE E9F200 jmp COPYERR ;AN030; go issue message - 31101 - 31102 ;DEST_OPEN_OKAY: - 31103 ; 26/03/2023 - 31104 Dest_Open_Okay: - 31105 000043D1 A3[159E] mov [DESTHAND],ax ; save handle - 31106 000043D4 C606[139C]01 mov byte [CFLAG],1 ; destination now exists - 31107 000043D9 89C3 mov bx,ax - 31108 000043DB B80044 mov ax,IOCTL*256 ; 4400h ; get device stuff - 31109 000043DE CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 31110 ; BX = file or device handle - 31111 - 31112 000043E0 8816[179E] mov [DESTISDEV],dl ; set dest info - 31113 ; 18/04/2023 - 31114 000043E4 F6C280 test dl,80h - 31115 ;test dl,devid_ISDEV - 31116 000043E7 7430 jz short Exists ; Dest not a device - 31117 - 31118 ; Destination is device. - 31119 - 31120 000043E9 A0[0F9C] mov al,[DestSwitch] - 31121 ; 26/03/2023 - 31122 000043EC 240C and al,0Ch - 31123 ;and al,SWITCHA+SWITCHB ; 4+8 - 31124 000043EE 7509 jnz short TestBoth - 31125 000043F0 A0[DA9E] mov al,[ASCII] ; neither set, use current setting - 31126 000043F3 0A06[D69E] or al,[BINARY] - 31127 000043F7 7416 jz short ExSetA ; neither set, default to ascii - 31128 TestBoth: - 31129 000043F9 7A1E jpe short Exists ; both are set, ignore - 31130 000043FB A808 test al,8 - 31131 ;test al,SWITCHB - 31132 000043FD 741A jz short Exists - 31133 ;mov ax,(IOCTL shl 8) or 1 - 31134 000043FF B80144 mov ax,(IOCTL<<8)|1 ; 4401h - 31135 00004402 30F6 xor dh,dh - 31136 ; 18/04/2023 - 31137 00004404 80CA20 or dl,20h - 31138 ;or dl,devid_RAW - 31139 00004407 8816[179E] mov [DESTISDEV],dl - 31140 0000440B CD21 int 21h ; DOS - 2+ - IOCTL - SET DEVICE INFORMATION - 31141 ; BX = device handle,DH = 0 - 31142 ; DL = device information to set (bits 0-7 from function 0) - 31143 0000440D EB0A jmp short Exists - 31144 - 31145 ; 26/03/2023 - 31146 ; 01/10/2018 - Retro DOS v3.0 modification - 31147 ;DEST_OPEN_ERROR: - 31148 ;mov dx,FULDIRPTR - 31149 ;call GET_EXT_ERR_NUMBER - 31150 ;COPERR: - 31151 ; 26/03/2023 - 31152 ;CopyErrj: - 31153 ;jmp short COPYERR - 31154 - 31155 ExSetA: - 31156 ; What we read in may have been in binary mode, flag zapped write OK + 31001 ; 13/06/2023 - Retro DOS v4.2 COMMAND.COM + 31002 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:46BAh + 31003 ; + 31004 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 31005 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4577h + 31006 FlshFil: + 31007 00004374 C606[D99E]00 mov byte [TERMREAD],0 + 31008 00004379 803E[139C]00 cmp byte [CFLAG],0 + 31009 0000437E 7403 jz short NotExists + 31010 00004380 E99600 jmp Exists + 31011 NotExists: + 31012 00004383 E8B301 call BUILDDEST ; find out all about the destination + 31013 00004386 E80B04 call COMPNAME ; source and dest. the same? + 31014 00004389 7519 jnz short ProcDest ; if not, go ahead + 31015 0000438B 803E[7A9E]00 cmp byte [SRCISDEV],0 + 31016 00004390 7512 jnz short ProcDest ; same name on device ok + 31017 00004392 803E[089C]00 cmp byte [Concat],0 ; concatenation? + 31018 00004397 BA[0390] mov dx,OVERWR_PTR + 31019 ;je short COPERR ; not concatenating - overwrite error + 31020 ; 26/03/2023 + 31021 0000439A 7503 jne short No_Concat_Err + 31022 0000439C E92401 jmp COPYERR + 31023 + 31024 No_Concat_Err: ; concatenating + 31025 0000439F C606[D59E]01 mov byte [NOWRITE],1 ; flag not writing (just seeking) + 31026 ProcDest: + 31027 ; MSDOS 6.0 + 31028 ;mov ax,(ExtOpen<<8) ; open the file + 31029 ; 26/03/2023 + 31030 000043A4 B8006C mov ax,6C00h + 31031 000043A7 BE[BE9D] mov si,DestBuf ; get file name + 31032 ;M046 + 31033 ; For writes, we want to deny writes by anyone else at the same time that we + 31034 ;are writing to it. For instance, on a network, 2 workstations could try + 31035 ;writing to the same file. Also, because we opened the source file with + 31036 ;DENY NONE, it is fine if the source and destination files are the same as + 31037 ;would happen when we append to an existing file. + 31038 + 31039 ; 26/03/2023 + 31040 ;mov bx,deny_write|write_open_mode + 31041 000043AA BB2100 mov bx,21h ; get open mode for copy; M046 + 31042 000043AD 31C9 xor cx,cx ; no special files + 31043 ;mov dx,write_open_flag ; set up open flags + 31044 000043AF BA0101 mov dx,101h + 31045 + 31046 000043B2 803E[D59E]00 cmp byte [NOWRITE],0 + 31047 000043B7 7503 jne short DoDestOpen ; don't actually create if nowrite set + 31048 ;mov dx,creat_open_flag ; set up create flags + 31049 000043B9 BA1201 mov dx,112h + 31050 + 31051 ; 26/03/2023 + 31052 ; MSDOS 3.3 + 31053 ;mov ax,(OPEN*256)+1 ; 3D01h ; open file, write access + 31054 ;cmp byte [NOWRITE],0 + 31055 ;jne short DODESTOPEN + 31056 ;mov ah,CREAT ; 3Ch + 31057 ;xor cx,cx + 31058 ;DODESTOPEN: + 31059 ;mov dx,DESTBUF + 31060 ;int 21h ; DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT) + 31061 ; ; CX = attributes for file + 31062 ; ; DS:DX -> ASCIZ filename (may include drive and path) + 31063 + 31064 ; 26/03/2023 + 31065 ; ; MSDOS 3.3 - COMMAND.COM, transient portion/segment offset 301Ch + 31066 ; ;mov dx,FULDIRPTR + 31067 ; ;call GET_EXT_ERR_NUMBER + 31068 ; ;jc short COPERR + 31069 ; + 31070 ; ; 01/10/2018 + 31071 ; ;jnc short DEST_OPEN_OKAY + 31072 ; + 31073 ; ;mov dx,FULDIRPTR + 31074 ; ;call GET_EXT_ERR_NUMBER + 31075 ; ;jmp short COPERR + 31076 ; + 31077 ; jc short DEST_OPEN_ERROR + 31078 + 31079 ; 26/03/2023 + 31080 DoDestOpen: + 31081 000043BC CD21 int 21h ; DOS - 4.0 - EXTENDED OPEN/CREATE + 31082 ; BL = open mode as in AL for normal open (INT 21h/AH=3Dh) + 31083 ; BH = flags + 31084 ; CX = create attribute + 31085 ; DL = action if file exists/does not exists + 31086 ; DH = 00h (reserved), DS:SI -> ASCIZ file name + 31087 + 31088 ; We assume that the error is normal. + 31089 ; TriageError will correct the DX value appropriately. + 31090 + 31091 000043BE 7311 jnc short Dest_Open_Okay + 31092 Xa_Set_Error: ;AN030; error occurred on XA + 31093 000043C0 E878DC call Set_Ext_Error_Msg ;AN030; get extended error + 31094 + 31095 ; 26/04/2023 - Retro DOS v4.0 ( 4.1) COMMAND.COM + 31096 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:3F46h + 31097 Ext_Err_Set: ;AN030; + 31098 000043C3 C706[A09D][BE9D] mov word [string_ptr_2],DestBuf + 31099 ;AN000; get address of failed string + 31100 000043C9 C606[D98F]01 mov byte [extend_buf_sub],one_subst ; 1 + 31101 ;AN030; put number of subst in control block + 31102 CopErrJ2: ;AN030; + 31103 000043CE E9F200 jmp COPYERR ;AN030; go issue message + 31104 + 31105 ;DEST_OPEN_OKAY: + 31106 ; 26/03/2023 + 31107 Dest_Open_Okay: + 31108 000043D1 A3[159E] mov [DESTHAND],ax ; save handle + 31109 000043D4 C606[139C]01 mov byte [CFLAG],1 ; destination now exists + 31110 000043D9 89C3 mov bx,ax + 31111 000043DB B80044 mov ax,IOCTL*256 ; 4400h ; get device stuff + 31112 000043DE CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 31113 ; BX = file or device handle + 31114 + 31115 000043E0 8816[179E] mov [DESTISDEV],dl ; set dest info + 31116 ; 18/04/2023 + 31117 000043E4 F6C280 test dl,80h + 31118 ;test dl,devid_ISDEV + 31119 000043E7 7430 jz short Exists ; Dest not a device + 31120 + 31121 ; Destination is device. + 31122 + 31123 000043E9 A0[0F9C] mov al,[DestSwitch] + 31124 ; 26/03/2023 + 31125 000043EC 240C and al,0Ch + 31126 ;and al,SWITCHA+SWITCHB ; 4+8 + 31127 000043EE 7509 jnz short TestBoth + 31128 000043F0 A0[DA9E] mov al,[ASCII] ; neither set, use current setting + 31129 000043F3 0A06[D69E] or al,[BINARY] + 31130 000043F7 7416 jz short ExSetA ; neither set, default to ascii + 31131 TestBoth: + 31132 000043F9 7A1E jpe short Exists ; both are set, ignore + 31133 000043FB A808 test al,8 + 31134 ;test al,SWITCHB + 31135 000043FD 741A jz short Exists + 31136 ;mov ax,(IOCTL shl 8) or 1 + 31137 000043FF B80144 mov ax,(IOCTL<<8)|1 ; 4401h + 31138 00004402 30F6 xor dh,dh + 31139 ; 18/04/2023 + 31140 00004404 80CA20 or dl,20h + 31141 ;or dl,devid_RAW + 31142 00004407 8816[179E] mov [DESTISDEV],dl + 31143 0000440B CD21 int 21h ; DOS - 2+ - IOCTL - SET DEVICE INFORMATION + 31144 ; BX = device handle,DH = 0 + 31145 ; DL = device information to set (bits 0-7 from function 0) + 31146 0000440D EB0A jmp short Exists + 31147 + 31148 ; 26/03/2023 + 31149 ; 01/10/2018 - Retro DOS v3.0 modification + 31150 ;DEST_OPEN_ERROR: + 31151 ;mov dx,FULDIRPTR + 31152 ;call GET_EXT_ERR_NUMBER + 31153 ;COPERR: + 31154 ; 26/03/2023 + 31155 ;CopyErrj: + 31156 ;jmp short COPYERR 31157 - 31158 0000440F C606[DA9E]04 mov byte [ASCII],4 - 31159 ;mov byte [ASCII],SWITCHA ; set ascii mode - 31160 00004414 800E[D49E]04 or byte [INEXACT],4 - 31161 ;or byte [INEXACT],SWITCHA ; ascii -> inexact - 31162 Exists: - 31163 00004419 803E[D59E]00 cmp byte [NOWRITE],0 - 31164 0000441E 7524 jnz short NoChecking ; if nowrite don't bother with name check - 31165 00004420 803E[969D]01 cmp byte [plus_comma],1 ; don't check if just doing +,, - 31166 00004425 741D jz short NoChecking - 31167 00004427 E86A03 call COMPNAME ; source and dest. the same? - 31168 0000442A 7518 jnz short NoChecking ; if not, go ahead - 31169 0000442C 803E[7A9E]00 cmp byte [SRCISDEV],0 - 31170 00004431 7511 jne short NoChecking ; same name on device ok - 31171 - 31172 ; At this point we know in append (would have gotten overwrite error - 31173 ; on first destination create otherwise), and user trying to specify - 31174 ; destination which has been scribbled already (if dest had been named - 31175 ; first, NoWrite would be set). - 31176 - 31177 00004433 BA[0690] mov dx,LOSTERR_PTR ; tell him he's not going to get it - 31178 ;invoke Std_EprintF ;ac022; - 31179 ; 26/03/2023 - 31180 00004436 E8E70F call std_eprintf ; MSDOS 6.0 (& 5.0) - 31181 ;call STD_PRINTF ; MSDOS 3.3 - 31182 00004439 C706[199C]0000 mov word [NXTADD],0 ; set return - 31183 0000443F FE06[D99E] inc byte [TERMREAD] ; tell read to give up - 31184 Ret60: - 31185 00004443 C3 retn - 31186 - 31187 NoChecking: - 31188 00004444 8B1E[159E] mov bx,[DESTHAND] ; get handle - 31189 00004448 31C9 xor cx,cx - 31190 0000444A 870E[199C] xchg cx,[NXTADD] - 31191 0000444E E3F3 jcxz Ret60 ; if nothing to write, forget it - 31192 00004450 FF06[D79E] inc word [WRITTEN] ; flag that we wrote something - 31193 00004454 803E[D59E]00 cmp byte [NOWRITE],0 ; if nowrite set, just seek cx bytes - 31194 00004459 7514 jnz short SeekEnd - 31195 0000445B 31D2 xor dx,dx - 31196 0000445D 1E push ds - 31197 0000445E 8E1E[F79B] mov ds,[TPA] - 31198 00004462 B440 mov ah,Write ; 40h - 31199 00004464 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 31200 ; BX = file handle,CX = number of bytes to write,DS:DX -> buffer - 31201 00004466 1F pop ds - 31202 00004467 BA[EB8F] mov dx,NOSPACE_PTR - 31203 ;jc short COPERRP ; failure - 31204 ; 26/03/2023 - 31205 ; MSDOS 6.0 - 31206 0000446A 7338 jnc short NoChecking2 - 31207 0000446C E951FF jmp Xa_Set_Error - 31208 - 31209 ; 18/04/2023 - 31210 ; 26/03/2023 - 31211 SeekEnd: - 31212 0000446F 31D2 xor dx,dx - 31213 00004471 87D1 xchg dx,cx - 31214 ;mov ax,(LSEEK shl 8) or 1 - 31215 00004473 B80142 mov ax,(LSEEK<<8)|1 ; 4201h - 31216 00004476 CD21 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) - 31217 ; AL = method: offset from present location - 31218 - 31219 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 31220 %if 1 - 31221 00004478 C606[099C]01 mov byte [notzerofile],1 ; (existing) destination file size is not zero - 31222 0000447D 85C0 test ax,ax - 31223 0000447F 7509 jnz short SeekEnd_@ - 31224 00004481 85D2 test dx,dx - 31225 00004483 7505 jnz short SeekEnd_@ - 31226 00004485 C606[099C]00 mov byte [notzerofile],0 ; (existing) destination file size is zero - 31227 SeekEnd_@: - 31228 %endif - 31229 ; 26/03/2023 - 31230 ; MSDOS 6.0 - 31231 - 31232 ; Save the file pointer in DX:AX to restore the file - 31233 ; with in case the copy should fail. + 31158 ExSetA: + 31159 ; What we read in may have been in binary mode, flag zapped write OK + 31160 + 31161 0000440F C606[DA9E]04 mov byte [ASCII],4 + 31162 ;mov byte [ASCII],SWITCHA ; set ascii mode + 31163 00004414 800E[D49E]04 or byte [INEXACT],4 + 31164 ;or byte [INEXACT],SWITCHA ; ascii -> inexact + 31165 Exists: + 31166 00004419 803E[D59E]00 cmp byte [NOWRITE],0 + 31167 0000441E 7524 jnz short NoChecking ; if nowrite don't bother with name check + 31168 00004420 803E[969D]01 cmp byte [plus_comma],1 ; don't check if just doing +,, + 31169 00004425 741D jz short NoChecking + 31170 00004427 E86A03 call COMPNAME ; source and dest. the same? + 31171 0000442A 7518 jnz short NoChecking ; if not, go ahead + 31172 0000442C 803E[7A9E]00 cmp byte [SRCISDEV],0 + 31173 00004431 7511 jne short NoChecking ; same name on device ok + 31174 + 31175 ; At this point we know in append (would have gotten overwrite error + 31176 ; on first destination create otherwise), and user trying to specify + 31177 ; destination which has been scribbled already (if dest had been named + 31178 ; first, NoWrite would be set). + 31179 + 31180 00004433 BA[0690] mov dx,LOSTERR_PTR ; tell him he's not going to get it + 31181 ;invoke Std_EprintF ;ac022; + 31182 ; 26/03/2023 + 31183 00004436 E8E70F call std_eprintf ; MSDOS 6.0 (& 5.0) + 31184 ;call STD_PRINTF ; MSDOS 3.3 + 31185 00004439 C706[199C]0000 mov word [NXTADD],0 ; set return + 31186 0000443F FE06[D99E] inc byte [TERMREAD] ; tell read to give up + 31187 Ret60: + 31188 00004443 C3 retn + 31189 + 31190 NoChecking: + 31191 00004444 8B1E[159E] mov bx,[DESTHAND] ; get handle + 31192 00004448 31C9 xor cx,cx + 31193 0000444A 870E[199C] xchg cx,[NXTADD] + 31194 0000444E E3F3 jcxz Ret60 ; if nothing to write, forget it + 31195 00004450 FF06[D79E] inc word [WRITTEN] ; flag that we wrote something + 31196 00004454 803E[D59E]00 cmp byte [NOWRITE],0 ; if nowrite set, just seek cx bytes + 31197 00004459 7514 jnz short SeekEnd + 31198 0000445B 31D2 xor dx,dx + 31199 0000445D 1E push ds + 31200 0000445E 8E1E[F79B] mov ds,[TPA] + 31201 00004462 B440 mov ah,Write ; 40h + 31202 00004464 CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 31203 ; BX = file handle,CX = number of bytes to write,DS:DX -> buffer + 31204 00004466 1F pop ds + 31205 00004467 BA[EB8F] mov dx,NOSPACE_PTR + 31206 ;jc short COPERRP ; failure + 31207 ; 26/03/2023 + 31208 ; MSDOS 6.0 + 31209 0000446A 7338 jnc short NoChecking2 + 31210 0000446C E951FF jmp Xa_Set_Error + 31211 + 31212 ; 18/04/2023 + 31213 ; 26/03/2023 + 31214 SeekEnd: + 31215 0000446F 31D2 xor dx,dx + 31216 00004471 87D1 xchg dx,cx + 31217 ;mov ax,(LSEEK shl 8) or 1 + 31218 00004473 B80142 mov ax,(LSEEK<<8)|1 ; 4201h + 31219 00004476 CD21 int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK) + 31220 ; AL = method: offset from present location + 31221 + 31222 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 31223 %if 1 + 31224 00004478 C606[099C]01 mov byte [notzerofile],1 ; (existing) destination file size is not zero + 31225 0000447D 85C0 test ax,ax + 31226 0000447F 7509 jnz short SeekEnd_@ + 31227 00004481 85D2 test dx,dx + 31228 00004483 7505 jnz short SeekEnd_@ + 31229 00004485 C606[099C]00 mov byte [notzerofile],0 ; (existing) destination file size is zero + 31230 SeekEnd_@: + 31231 %endif + 31232 ; 26/03/2023 + 31233 ; MSDOS 6.0 31234 - 31235 0000448A A3[E19E] mov [OFilePtr_Lo],ax - 31236 0000448D 8916[E39E] mov [OFilePtr_Hi],dx + 31235 ; Save the file pointer in DX:AX to restore the file + 31236 ; with in case the copy should fail. 31237 - 31238 ; 26/03/2023 - 31239 ; MSDOS 3.3 MSDOS 6.0 + 31238 0000448A A3[E19E] mov [OFilePtr_Lo],ax + 31239 0000448D 8916[E39E] mov [OFilePtr_Hi],dx 31240 - 31241 00004491 803E[069C]00 cmp byte [RDEOF],0 - 31242 00004496 740B jz short Retz60 + 31241 ; 26/03/2023 + 31242 ; MSDOS 3.3 MSDOS 6.0 31243 - 31244 ; ^Z has been read - we must set the file size to the current - 31245 ; file pointer location + 31244 00004491 803E[069C]00 cmp byte [RDEOF],0 + 31245 00004496 740B jz short Retz60 31246 - 31247 00004498 B440 mov ah,Write ; 40h - 31248 0000449A CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 31249 ; BX = file handle,CX = number of bytes to write,DS:DX -> buffer - 31250 - 31251 ; 26/03/2023 - 31252 ; MSDOS 6.0 - 31253 0000449C 727E jc short Xa_Set_Error_Jmp ;AC022; failure - 31254 - 31255 ; Make note that ^Z was removed, in case the - 31256 ; copy should fail and we need to restore the file. + 31247 ; ^Z has been read - we must set the file size to the current + 31248 ; file pointer location + 31249 + 31250 00004498 B440 mov ah,Write ; 40h + 31251 0000449A CD21 int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 31252 ; BX = file handle,CX = number of bytes to write,DS:DX -> buffer + 31253 + 31254 ; 26/03/2023 + 31255 ; MSDOS 6.0 + 31256 0000449C 727E jc short Xa_Set_Error_Jmp ;AC022; failure 31257 - 31258 0000449E C606[E59E]1A mov byte [OCtrlZ],1Ah - 31259 Retz60: - 31260 000044A3 C3 retn - 31261 - 31262 NoChecking2: - 31263 000044A4 29C1 sub cx,ax - 31264 000044A6 749B jz short Ret60 ; wrote all supposed to - 31265 ; 18/04/2023 - 31266 000044A8 F606[179E]80 test byte [DESTISDEV],80h ; devid_ISDEV - 31267 ;test byte [DESTISDEV],devid_ISDEV ;80h - 31268 000044AD 7414 jz short COPYERR ; is a file, error - 31269 000044AF F606[179E]20 test byte [DESTISDEV],20h ; devid_RAW - 31270 ;test byte [DESTISDEV],devid_RAW ; 20h - 31271 000044B4 750A jnz short DevWrtErr ; is a raw device, error - 31272 000044B6 803E[D49E]00 cmp byte [INEXACT],0 - 31273 000044BB 7586 jnz short Ret60 ; inexact so ok - 31274 000044BD 49 dec cx - 31275 ;Retz60: - 31276 000044BE 7483 jz short Ret60 ; wrote one byte less (the ^z) - 31277 - 31278 DevWrtErr: - 31279 000044C0 BA[9391] mov dx,DEVWMES_PTR - 31280 ; 26/03/2023 - 31281 COPYERR: - 31282 ;invoke Std_EPrintF ;AC022; - 31283 000044C3 E85A0F call std_eprintf ; MSDOS 6.0 - 31284 ;call STD_PRINTF ; MSDOS 3.3 - 31285 CopErrP: - 31286 000044C6 FE06[149C] inc byte [DestClosed] - 31287 000044CA 803E[139C]00 cmp byte [CFLAG],0 - 31288 000044CF 7448 jz short EndCopyJ ; never actually got it open - 31289 000044D1 8B1E[159E] mov bx,[DESTHAND] - 31290 000044D5 83FB00 cmp bx,0 - 31291 000044D8 7E33 jle short NoClose - 31292 - 31293 ; Check to see if we should save part of the destination file. - 31294 - 31295 ; 26/03/2023 - 31296 ; MSDOS 6.0 - 31297 000044DA 8B0E[E39E] mov cx,[OFilePtr_Hi] ; CX = hi word of original file ptr - 31298 000044DE 8B16[E19E] mov dx,[OFilePtr_Lo] ; DX = lo word of original file ptr - 31299 - 31300 000044E2 89C8 mov ax,cx - 31301 000044E4 09D0 or ax,dx - 31302 000044E6 7421 jz short ceClose ; null file ptr means nothing to save - 31303 - 31304 ; Destination was also the first source. Do the best we can to - 31305 ; restore it. Truncate it back to the size we took from it (which - 31306 ; may have been due to a Ctrl-Z, so may not have included the whole - 31307 ; file). If a Ctrl-Z was originally read, put it back. - 31308 - 31309 000044E8 B80042 mov ax,(LSEEK<<8) ; 4200h - 31310 000044EB CD21 int 21h + 31258 ; Make note that ^Z was removed, in case the + 31259 ; copy should fail and we need to restore the file. + 31260 + 31261 0000449E C606[E59E]1A mov byte [OCtrlZ],1Ah + 31262 Retz60: + 31263 000044A3 C3 retn + 31264 + 31265 NoChecking2: + 31266 000044A4 29C1 sub cx,ax + 31267 000044A6 749B jz short Ret60 ; wrote all supposed to + 31268 ; 18/04/2023 + 31269 000044A8 F606[179E]80 test byte [DESTISDEV],80h ; devid_ISDEV + 31270 ;test byte [DESTISDEV],devid_ISDEV ;80h + 31271 000044AD 7414 jz short COPYERR ; is a file, error + 31272 000044AF F606[179E]20 test byte [DESTISDEV],20h ; devid_RAW + 31273 ;test byte [DESTISDEV],devid_RAW ; 20h + 31274 000044B4 750A jnz short DevWrtErr ; is a raw device, error + 31275 000044B6 803E[D49E]00 cmp byte [INEXACT],0 + 31276 000044BB 7586 jnz short Ret60 ; inexact so ok + 31277 000044BD 49 dec cx + 31278 ;Retz60: + 31279 000044BE 7483 jz short Ret60 ; wrote one byte less (the ^z) + 31280 + 31281 DevWrtErr: + 31282 000044C0 BA[9391] mov dx,DEVWMES_PTR + 31283 ; 26/03/2023 + 31284 COPYERR: + 31285 ;invoke Std_EPrintF ;AC022; + 31286 000044C3 E85A0F call std_eprintf ; MSDOS 6.0 + 31287 ;call STD_PRINTF ; MSDOS 3.3 + 31288 CopErrP: + 31289 000044C6 FE06[149C] inc byte [DestClosed] + 31290 000044CA 803E[139C]00 cmp byte [CFLAG],0 + 31291 000044CF 7448 jz short EndCopyJ ; never actually got it open + 31292 000044D1 8B1E[159E] mov bx,[DESTHAND] + 31293 000044D5 83FB00 cmp bx,0 + 31294 000044D8 7E33 jle short NoClose + 31295 + 31296 ; Check to see if we should save part of the destination file. + 31297 + 31298 ; 26/03/2023 + 31299 ; MSDOS 6.0 + 31300 000044DA 8B0E[E39E] mov cx,[OFilePtr_Hi] ; CX = hi word of original file ptr + 31301 000044DE 8B16[E19E] mov dx,[OFilePtr_Lo] ; DX = lo word of original file ptr + 31302 + 31303 000044E2 89C8 mov ax,cx + 31304 000044E4 09D0 or ax,dx + 31305 000044E6 7421 jz short ceClose ; null file ptr means nothing to save + 31306 + 31307 ; Destination was also the first source. Do the best we can to + 31308 ; restore it. Truncate it back to the size we took from it (which + 31309 ; may have been due to a Ctrl-Z, so may not have included the whole + 31310 ; file). If a Ctrl-Z was originally read, put it back. 31311 - 31312 000044ED 31C9 xor cx,cx ; CX = # bytes to write = 0 - 31313 000044EF B440 mov ah,Write ; 40h - 31314 000044F1 CD21 int 21h ; truncate file - 31315 - 31316 000044F3 803E[E59E]00 cmp byte [OCtrlZ],0 - 31317 000044F8 7408 je short ceClose0 ; no ctrl-z removed from original - 31318 000044FA 41 inc cx ; CX = # bytes to write = 1 - 31319 000044FB BA[E59E] mov dx,OCtrlZ ; DS:DX = ptr to original ctrl-z - 31320 000044FE B440 mov ah,Write ; 40h - 31321 00004500 CD21 int 21h ; write ctrl-z - 31322 ceClose0: - 31323 00004502 B43E mov ah,CLOSE ; 3Eh - 31324 00004504 CD21 int 21h ; close it - 31325 ;; ;mov byte [CFLAG],0 - 31326 00004506 E9C8F8 jmp ENDCOPY ; and go home - 31327 - 31328 ; MSDOS 3.3 (& MSDOS 6.0) - 31329 ceClose: - 31330 00004509 B43E mov ah,CLOSE ; 3Eh ; close the file - 31331 0000450B CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 31332 ; BX = file handle - 31333 NoClose: - 31334 0000450D BA[BE9D] mov dx,DestBuf - 31335 00004510 B441 mov ah,Unlink ; 41h ; and delete it - 31336 00004512 CD21 int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) - 31337 ; DS:DX -> ASCIZ pathname of file to delete (no wildcards allowed) - 31338 00004514 C606[139C]00 mov byte [CFLAG],0 - 31339 EndCopyJ: - 31340 00004519 E9B5F8 jmp ENDCOPY - 31341 - 31342 Xa_Set_Error_Jmp: ;AN022; go set up error message - 31343 0000451C E9A1FE jmp Xa_Set_Error + 31312 000044E8 B80042 mov ax,(LSEEK<<8) ; 4200h + 31313 000044EB CD21 int 21h + 31314 + 31315 000044ED 31C9 xor cx,cx ; CX = # bytes to write = 0 + 31316 000044EF B440 mov ah,Write ; 40h + 31317 000044F1 CD21 int 21h ; truncate file + 31318 + 31319 000044F3 803E[E59E]00 cmp byte [OCtrlZ],0 + 31320 000044F8 7408 je short ceClose0 ; no ctrl-z removed from original + 31321 000044FA 41 inc cx ; CX = # bytes to write = 1 + 31322 000044FB BA[E59E] mov dx,OCtrlZ ; DS:DX = ptr to original ctrl-z + 31323 000044FE B440 mov ah,Write ; 40h + 31324 00004500 CD21 int 21h ; write ctrl-z + 31325 ceClose0: + 31326 00004502 B43E mov ah,CLOSE ; 3Eh + 31327 00004504 CD21 int 21h ; close it + 31328 ;; ;mov byte [CFLAG],0 + 31329 00004506 E9C8F8 jmp ENDCOPY ; and go home + 31330 + 31331 ; MSDOS 3.3 (& MSDOS 6.0) + 31332 ceClose: + 31333 00004509 B43E mov ah,CLOSE ; 3Eh ; close the file + 31334 0000450B CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 31335 ; BX = file handle + 31336 NoClose: + 31337 0000450D BA[BE9D] mov dx,DestBuf + 31338 00004510 B441 mov ah,Unlink ; 41h ; and delete it + 31339 00004512 CD21 int 21h ; DOS - 2+ - DELETE A FILE (UNLINK) + 31340 ; DS:DX -> ASCIZ pathname of file to delete (no wildcards allowed) + 31341 00004514 C606[139C]00 mov byte [CFLAG],0 + 31342 EndCopyJ: + 31343 00004519 E9B5F8 jmp ENDCOPY 31344 - 31345 ;============================================================================ - 31346 ; COPYPR2.ASM, MSDOS 6.0, 1991 - 31347 ;============================================================================ - 31348 ; 01/10/2018 - Retro DOS v3.0 - 31349 - 31350 ; MSDOS 3.3 COMMAND.COM (1987) Transient portion offset 311Fh - 31351 - 31352 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31353 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4095h + 31345 Xa_Set_Error_Jmp: ;AN022; go set up error message + 31346 0000451C E9A1FE jmp Xa_Set_Error + 31347 + 31348 ;============================================================================ + 31349 ; COPYPR2.ASM, MSDOS 6.0, 1991 + 31350 ;============================================================================ + 31351 ; 01/10/2018 - Retro DOS v3.0 + 31352 + 31353 ; MSDOS 3.3 COMMAND.COM (1987) Transient portion offset 311Fh 31354 - 31355 ; =============== S U B R O U T I N E ======================================= - 31356 - 31357 ;*** SetAsc - set Ascii, Binary, Inexact flags based on switches - 31358 ; - 31359 ; Given switch vector in AX, - 31360 ; Set Ascii flag if /a is set - 31361 ; Clear Ascii flag if /b is set - 31362 ; Binary set if /b specified - 31363 ; Leave Ascii unchanged if neither or both are set - 31364 ; Also sets Inexact if Ascii is ever set. - 31365 ; AL = Ascii on exit, flags set - 31366 - 31367 ; 26/03/2023 - 31368 SETASC: - 31369 ;and al,SWITCHA+SWITCHB ; 0Ch ; AL = /a, /b flags - 31370 0000451F 240C and al,0Ch ; 4+8 - 31371 00004521 7A10 jpe short LOADSW ; even parity - both or neither - 31372 00004523 50 push ax - 31373 ;and al,SWITCHB ; 8 - 31374 00004524 2408 and al,8 - 31375 00004526 A2[D69E] mov [BINARY],al - 31376 00004529 58 pop ax - 31377 ;and al,SWITCHA - 31378 0000452A 2404 and al,4 - 31379 0000452C A2[DA9E] mov [ASCII],al - 31380 0000452F 0806[D49E] or [INEXACT],al - 31381 LOADSW: - 31382 00004533 A0[DA9E] mov al,[ASCII] - 31383 00004536 08C0 or al,al - 31384 00004538 C3 retn - 31385 - 31386 ; =============== S U B R O U T I N E ======================================= - 31387 - 31388 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31389 ; 13/06/2023 - Retro DOS v4.2 COMMAND.COM - 31390 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM - 31391 BUILDDEST: - 31392 00004539 803E[B99D]FF cmp byte [DestIsDir],-1 ; 0FFh - 31393 0000453E 750F jnz short KNOWABOUTDEST ; figuring already done - 31394 00004540 BF[D79A] mov di,USERDIR1 - 31395 00004543 BD[B99D] mov bp,DestVars - 31396 - 31397 ; 10/08/2024 - PCDOS 7.1 COMMAND.COM - 31398 %if 1 - 31399 ;mov bx,deny_none|write_open_mode - 31400 00004546 BB4100 mov bx,41h ; open mode for COPY ;M046 - 31401 %endif - 31402 - 31403 00004549 E8DF00 call BUILDPATH - 31404 0000454C E8D4E2 call RestUDir1 + 31355 ; 26/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31356 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4095h + 31357 + 31358 ; =============== S U B R O U T I N E ======================================= + 31359 + 31360 ;*** SetAsc - set Ascii, Binary, Inexact flags based on switches + 31361 ; + 31362 ; Given switch vector in AX, + 31363 ; Set Ascii flag if /a is set + 31364 ; Clear Ascii flag if /b is set + 31365 ; Binary set if /b specified + 31366 ; Leave Ascii unchanged if neither or both are set + 31367 ; Also sets Inexact if Ascii is ever set. + 31368 ; AL = Ascii on exit, flags set + 31369 + 31370 ; 26/03/2023 + 31371 SETASC: + 31372 ;and al,SWITCHA+SWITCHB ; 0Ch ; AL = /a, /b flags + 31373 0000451F 240C and al,0Ch ; 4+8 + 31374 00004521 7A10 jpe short LOADSW ; even parity - both or neither + 31375 00004523 50 push ax + 31376 ;and al,SWITCHB ; 8 + 31377 00004524 2408 and al,8 + 31378 00004526 A2[D69E] mov [BINARY],al + 31379 00004529 58 pop ax + 31380 ;and al,SWITCHA + 31381 0000452A 2404 and al,4 + 31382 0000452C A2[DA9E] mov [ASCII],al + 31383 0000452F 0806[D49E] or [INEXACT],al + 31384 LOADSW: + 31385 00004533 A0[DA9E] mov al,[ASCII] + 31386 00004536 08C0 or al,al + 31387 00004538 C3 retn + 31388 + 31389 ; =============== S U B R O U T I N E ======================================= + 31390 + 31391 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31392 ; 13/06/2023 - Retro DOS v4.2 COMMAND.COM + 31393 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM + 31394 BUILDDEST: + 31395 00004539 803E[B99D]FF cmp byte [DestIsDir],-1 ; 0FFh + 31396 0000453E 750F jnz short KNOWABOUTDEST ; figuring already done + 31397 00004540 BF[D79A] mov di,USERDIR1 + 31398 00004543 BD[B99D] mov bp,DestVars + 31399 + 31400 ; 10/08/2024 - PCDOS 7.1 COMMAND.COM + 31401 %if 1 + 31402 ;mov bx,deny_none|write_open_mode + 31403 00004546 BB4100 mov bx,41h ; open mode for COPY ;M046 + 31404 %endif 31405 - 31406 ; We now know all about the destination - 31407 - 31408 KNOWABOUTDEST: - 31409 0000454F 30C0 xor al,al - 31410 00004551 8606[189E] xchg al,[FIRSTDEST] - 31411 00004555 08C0 or al,al - 31412 00004557 7503 jnz short FIRSTDST - 31413 00004559 E98C00 jmp NOFIRSTDEST - 31414 - 31415 FIRSTDST: - 31416 ; Create an fcb of the original dest. + 31406 00004549 E8DF00 call BUILDPATH + 31407 0000454C E8D4E2 call RestUDir1 + 31408 + 31409 ; We now know all about the destination + 31410 + 31411 KNOWABOUTDEST: + 31412 0000454F 30C0 xor al,al + 31413 00004551 8606[189E] xchg al,[FIRSTDEST] + 31414 00004555 08C0 or al,al + 31415 00004557 7503 jnz short FIRSTDST + 31416 00004559 E98C00 jmp NOFIRSTDEST 31417 - 31418 0000455C 8B36[BB9D] mov si,[DestTail] - 31419 00004560 BF[F69C] mov di,DestFcb - 31420 00004563 B80029 mov ax,Parse_File_Descriptor*256 ; 2900h - 31421 00004566 CD21 int 21h ; DOS - PARSE FILENAME - 31422 ; DS:SI -> string to parse - 31423 ; ES:DI -> buffer to fill with unopened FCB - 31424 ; AL = bit mask to control parsing - 31425 00004568 803C00 cmp byte [si],0 - 31426 0000456B 7406 jz short GOODPARSE - 31427 - 31428 ; 27/03/2023 - 31429 ; MSDOS 6.0 - 31430 ;mov byte [di+1],"|" ;AD052; must be illegal file name character - 31431 - 31432 0000456D BA[F18F] mov dx,FULLDIR_PTR ;AN052; issue "file creation error" - 31433 00004570 E950FF jmp COPYERR ;AN052; - 31434 GOODPARSE: - 31435 00004573 A1[BE9D] mov ax,[DestBuf] ; AX = possible "d:" - 31436 00004576 80FC3A cmp ah,':' - 31437 00004579 7402 jz short DRVSPEC4 - 31438 0000457B B040 mov al,'@' ; 40h - 31439 DRVSPEC4: - 31440 ; AX = "d:" for following FCB drive computation - 31441 - 31442 0000457D 8A0E[DA9E] mov cl,[ASCII] ; CL = saved Ascii flag - 31443 00004581 0C20 or al,20h - 31444 00004583 2C60 sub al,60h - 31445 00004585 A2[F69C] mov [DestFcb],al ; store drive # in FCB - 31446 - 31447 ;* Figure out what copy mode we're in. - 31448 ; Letters stand for unambiguous, * for ambiguous pathnames. - 31449 ; +n stands for additional sources delimited by +'s. - 31450 ; - 31451 ; copy a b not concatenating - 31452 ; copy a * not concatenating - 31453 ; copy * a concatenating - 31454 ; copy * * not concatenating - 31455 ; copy a+n b concatenating - 31456 ; copy *+n a concatenating - 31457 ; copy *+n * concatenating, Mel Hallerman style - 31458 - 31459 ; Bugbug: copy *.a+a.b *.t picks up only 1st *.a file.. Why? - 31460 ; copy a.b+*.a *.t picks up all *.a files. + 31418 FIRSTDST: + 31419 ; Create an fcb of the original dest. + 31420 + 31421 0000455C 8B36[BB9D] mov si,[DestTail] + 31422 00004560 BF[F69C] mov di,DestFcb + 31423 00004563 B80029 mov ax,Parse_File_Descriptor*256 ; 2900h + 31424 00004566 CD21 int 21h ; DOS - PARSE FILENAME + 31425 ; DS:SI -> string to parse + 31426 ; ES:DI -> buffer to fill with unopened FCB + 31427 ; AL = bit mask to control parsing + 31428 00004568 803C00 cmp byte [si],0 + 31429 0000456B 7406 jz short GOODPARSE + 31430 + 31431 ; 27/03/2023 + 31432 ; MSDOS 6.0 + 31433 ;mov byte [di+1],"|" ;AD052; must be illegal file name character + 31434 + 31435 0000456D BA[F18F] mov dx,FULLDIR_PTR ;AN052; issue "file creation error" + 31436 00004570 E950FF jmp COPYERR ;AN052; + 31437 GOODPARSE: + 31438 00004573 A1[BE9D] mov ax,[DestBuf] ; AX = possible "d:" + 31439 00004576 80FC3A cmp ah,':' + 31440 00004579 7402 jz short DRVSPEC4 + 31441 0000457B B040 mov al,'@' ; 40h + 31442 DRVSPEC4: + 31443 ; AX = "d:" for following FCB drive computation + 31444 + 31445 0000457D 8A0E[DA9E] mov cl,[ASCII] ; CL = saved Ascii flag + 31446 00004581 0C20 or al,20h + 31447 00004583 2C60 sub al,60h + 31448 00004585 A2[F69C] mov [DestFcb],al ; store drive # in FCB + 31449 + 31450 ;* Figure out what copy mode we're in. + 31451 ; Letters stand for unambiguous, * for ambiguous pathnames. + 31452 ; +n stands for additional sources delimited by +'s. + 31453 ; + 31454 ; copy a b not concatenating + 31455 ; copy a * not concatenating + 31456 ; copy * a concatenating + 31457 ; copy * * not concatenating + 31458 ; copy a+n b concatenating + 31459 ; copy *+n a concatenating + 31460 ; copy *+n * concatenating, Mel Hallerman style 31461 - 31462 00004588 A0[BD9D] mov al,[DestInfo] ; AL = destination CParse flags - 31463 0000458B 8A26[209E] mov ah,[SrcInfo] ; AH = source CParse flags - 31464 0000458F 250202 and ax,202h ; AH,AL = source,dest wildcard flags - 31465 00004592 08C0 or al,al - 31466 00004594 7413 jz short NOTMELCOPY ; no destination wildcard - 31467 - 31468 ; Destination is wildcarded. - 31469 - 31470 00004596 38E0 cmp al,ah - 31471 00004598 750F jnz short NOTMELCOPY ; no source wildcard - 31472 - 31473 ; Source and destination are both wildcarded. - 31474 - 31475 0000459A 803E[DB9E]00 cmp byte [PLUS],0 - 31476 0000459F 7408 jz short NOTMELCOPY ; no +'s in source + 31462 ; Bugbug: copy *.a+a.b *.t picks up only 1st *.a file.. Why? + 31463 ; copy a.b+*.a *.t picks up all *.a files. + 31464 + 31465 00004588 A0[BD9D] mov al,[DestInfo] ; AL = destination CParse flags + 31466 0000458B 8A26[209E] mov ah,[SrcInfo] ; AH = source CParse flags + 31467 0000458F 250202 and ax,202h ; AH,AL = source,dest wildcard flags + 31468 00004592 08C0 or al,al + 31469 00004594 7413 jz short NOTMELCOPY ; no destination wildcard + 31470 + 31471 ; Destination is wildcarded. + 31472 + 31473 00004596 38E0 cmp al,ah + 31474 00004598 750F jnz short NOTMELCOPY ; no source wildcard + 31475 + 31476 ; Source and destination are both wildcarded. 31477 - 31478 ; Source and destination are wildcarded, and source includes +'s. - 31479 ; It's Mel Hallorman copy time. + 31478 0000459A 803E[DB9E]00 cmp byte [PLUS],0 + 31479 0000459F 7408 jz short NOTMELCOPY ; no +'s in source 31480 - 31481 000045A1 FE06[199E] inc byte [MELCOPY] ; 'Mel copy' = true - 31482 000045A5 30C0 xor al,al - 31483 000045A7 EB06 jmp short SETCONC - 31484 - 31485 NOTMELCOPY: - 31486 000045A9 3402 xor al,2 ; AL=0 -> ambiguous destination, 2 otherwise - 31487 000045AB 20E0 and al,ah - 31488 000045AD D0E8 shr al,1 ; AL=1 -> ambiguous source, unambiguous dest - 31489 ; (implies concatenation) - 31490 SETCONC: - 31491 000045AF 0A06[DB9E] or al,[PLUS] ; "+" always infers concatenation - 31492 - 31493 ; Whew. AL = 1 if concatenating, 0 if not. - 31494 - 31495 000045B3 A2[089C] mov [Concat],al - 31496 000045B6 D0E0 shl al,1 - 31497 000045B8 D0E0 shl al,1 - 31498 000045BA A2[D49E] mov [INEXACT],al ; concatenation -> inexact copy - 31499 000045BD 803E[D69E]00 cmp byte [BINARY],0 - 31500 000045C2 7524 jne short NOFIRSTDEST ; explicit binary copy - 31501 - 31502 ; 13/06/2023 - Retro DOS v4.2 COMMAND.COM - 31503 ; MSDOS 6.0 (MSDOS 5.0) - 31504 ;mov [ASCII],al ; otherwise, concatenate in ascii mode - 31505 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:48FAh - 31506 ;or [ASCII],al - 31507 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 31508 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:47C5h - 31509 000045C4 A2[DA9E] mov [ASCII],al - 31510 - 31511 000045C7 08C9 or cl,cl - 31512 000045C9 751D jnz short NOFIRSTDEST ; Ascii flag set before, data read correctly - 31513 000045CB 08C0 or al,al - 31514 000045CD 7419 jz short NOFIRSTDEST ; Ascii flag did not change state - 31515 - 31516 ; At this point there may already be binary read data in the read - 31517 ; buffer. We need to find the first ^Z (if there is one) and trim the - 31518 ; amount of data in the buffer correctly. - 31519 - 31520 000045CF 8B0E[199C] mov cx,[NXTADD] - 31521 000045D3 E313 jcxz NOFIRSTDEST ; no data, everything ok - 31522 000045D5 B01A mov al,1Ah - 31523 000045D7 06 push es - 31524 000045D8 31FF xor di,di - 31525 000045DA 8E06[F79B] mov es,[TPA] - 31526 000045DE F2AE repne scasb ; scan for EOF - 31527 000045E0 07 pop es - 31528 000045E1 7505 jnz short NOFIRSTDEST ; no ^z in buffer, everything ok - 31529 000045E3 4F dec di ; point at ^z - 31530 000045E4 893E[199C] mov [NXTADD],di ; new buffer length - 31531 - 31532 NOFIRSTDEST: - 31533 000045E8 BB[3A9D] mov bx,DIRBUF+1 ; Source of replacement chars - 31534 000045EB 803E[089C]00 cmp byte [Concat],0 - 31535 000045F0 7403 jz short GOTCHRSRC ; Not a concat - 31536 000045F2 BB[809D] mov bx,SDIRBUF+1 ; Source of replacement chars - 31537 GOTCHRSRC: - 31538 000045F5 BE[F79C] mov si,DestFcb+1 ; Original dest name - 31539 000045F8 8B3E[BB9D] mov di,[DestTail] ; Where to put result - 31540 - 31541 ; --------------- S U B R O U T I N E --------------------------------------- - 31542 - 31543 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31544 BUILDNAME: - 31545 000045FC B90800 mov cx,8 - 31546 BUILDMAIN: - 31547 000045FF AC lodsb - 31548 00004600 3C3F cmp al,'?' - 31549 00004602 7502 jne short NOTAMBIG - 31550 00004604 8A07 mov al,[bx] - 31551 NOTAMBIG: - 31552 00004606 3C20 cmp al,' ' - 31553 00004608 7401 je short NOSTORE - 31554 0000460A AA stosb - 31555 NOSTORE: - 31556 0000460B 43 inc bx - 31557 0000460C E2F1 loop BUILDMAIN - 31558 0000460E B103 mov cl,3 - 31559 ;mov al,' ' ; 20h - 31560 ;cmp [si],al - 31561 ; 27/03/2023 - 31562 00004610 803C20 cmp byte [si],20h ; ' ' - 31563 00004613 7412 je short ENDDEST ; No extension - 31564 ;mov al,[DOT_CHR] - 31565 ; 27/03/2023 - 31566 00004615 B02E mov al,'.' ; 2Eh ; dot_chr - 31567 00004617 AA stosb - 31568 BUILDEXT: - 31569 00004618 AC lodsb - 31570 00004619 3C3F cmp al,'?' - 31571 0000461B 7502 jne short NOTAMBIGE - 31572 0000461D 8A07 mov al,[bx] - 31573 NOTAMBIGE: - 31574 0000461F 3C20 cmp al,' ' - 31575 00004621 7401 je short NOSTOREE - 31576 00004623 AA stosb - 31577 NOSTOREE: - 31578 00004624 43 inc bx - 31579 00004625 E2F1 loop BUILDEXT - 31580 ENDDEST: - 31581 00004627 30C0 xor al,al - 31582 00004629 AA stosb ; NUL terminate - 31583 0000462A C3 retn - 31584 - 31585 ; =============== S U B R O U T I N E ======================================= - 31586 - 31587 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31588 ; 28/03/2023 - 31589 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 31590 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM - 31591 BUILDPATH: - 31592 0000462B F6460402 test byte [bp+VARSTRUC.INFO],2 ; test byte [bp+4],2 - 31593 0000462F 7540 jnz short NOTPFILE ; If ambig don't bother with open - 31594 00004631 89EA mov dx,bp ; Set DX to spec - 31595 00004633 83C205 add dx,VARSTRUC.BUF ; add dx,5 - 31596 - 31597 ; 27/03/2023 - 31598 ; MSDOS 6.0 - 31599 00004636 57 push di ;AN000; - 31600 00004637 B8006C mov ax,(ExtOpen<<8) ; 6C00h ;AC000; open the file - 31601 - 31602 ; 10/08/2024 - PCDOS 7.1 COMMAND.COM - 31603 %if 0 - 31604 ;mov bx,deny_none|read_open_mode - 31605 mov bx,40h ; open mode for COPY ;M046 - 31606 %endif - 31607 0000463A 31C9 xor cx,cx ;AN000; no special files - 31608 0000463C 89D6 mov si,dx ;AN030; get file name offset - 31609 ;mov dx,read_open_flag ;AN000; set up open flags - 31610 0000463E BA0101 mov dx,101h - 31611 00004641 CD21 INT 21h - 31612 00004643 5F pop di ;AN000; - 31613 00004644 7315 jnc short PURE_FILE ;AN022; is pure file - 31614 00004646 E802DA call get_ext_error_number ;AN022; get the extended error - 31615 ;cmp ax,2 - 31616 00004649 83F802 cmp ax,ERROR_FILE_NOT_FOUND ;AN022; if file not found - okay - 31617 0000464C 7423 jz short NOTPFILE ;AN022; - 31618 ;cmp ax,3 - 31619 0000464E 83F803 cmp ax,ERROR_PATH_NOT_FOUND ;AN022; if path not found - okay - 31620 00004651 741E jz short NOTPFILE ;AN022; - 31621 ;cmp ax,5 - 31622 00004653 83F805 cmp ax,ERROR_ACCESS_DENIED ;AN022; if access denied - okay - 31623 00004656 7419 jz short NOTPFILE ;AN022; - 31624 00004658 E925D7 jmp extend_setup ;AN022; exit with error - 31625 - 31626 ; 27/03/2023 - 31627 ; MSDOS 3.3 - 31628 ;mov ax,OPEN*256 ; 3D00h - 31629 ;int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE - 31630 ; ; DS:DX -> ASCIZ filename - 31631 ; ; AL = access mode - 31632 ; ; 0 - read - 31633 ;jc short NOTPFILE - 31634 - 31635 PURE_FILE: - 31636 0000465B 89C3 mov bx,ax - 31637 0000465D B80044 mov ax,IOCTL*256 ; 4400h - 31638 00004660 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION - 31639 ; BX = file or device handle - 31640 00004662 B43E mov ah,CLOSE ;3Eh - 31641 00004664 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE - 31642 ; BX = file handle - 31643 ; 18/04/2023 - 31644 00004666 F6C280 test dl,80h - 31645 ;test dl,devid_ISDEV ; test dl,80h - 31646 00004669 7553 jnz short ISADEV - 31647 0000466B F6460404 test byte [bp+VARSTRUC.INFO],4 ; test byte [bp+4],4 - 31648 0000466F 744D jz short ISADEV - 31649 NOTPFILE: - 31650 00004671 8B5605 mov dx,[bp+VARSTRUC.BUF] ; mov dx,[bp+5] - 31651 - 31652 ; 27/03/2023 - 31653 ; MSDOS 6.0 - 31654 00004674 80FA00 cmp dl,0 ;AN034; If no drive specified, get - 31655 00004677 7405 je short SET_DRIVE_SPEC ;AN034; default drive dir - 31656 - 31657 00004679 80FE3A cmp dh,':' - 31658 0000467C 7402 je short DRVSPEC5 - 31659 SET_DRIVE_SPEC: - 31660 0000467E B240 mov dl,'@' ; 40h - 31661 DRVSPEC5: - 31662 00004680 80CA20 or dl,20h - 31663 00004683 80EA60 sub dl,60h ; A = 1 - 31664 00004686 E8CCE2 call SAVUDIR1 - 31665 - 31666 ; 27/03/2023 - 31667 ; MSDOS 6.0 - 31668 00004689 7306 jnc short CURDIR_OK ;AN022; if error - exit - 31669 0000468B E8BDD9 call get_ext_error_number ;AN022; get the extended error - 31670 0000468E E9EFD6 jmp extend_setup ;AN022; exit with error - 31671 - 31672 CURDIR_OK: - 31673 00004691 89EA mov dx,bp - 31674 ;add dx,5 - 31675 00004693 83C205 add dx,VARSTRUC.BUF ; Set DX for upcomming CHDIRs - 31676 ;mov bh,[bp+4] - 31677 00004696 8A7E04 mov bh,[bp+VARSTRUC.INFO] - 31678 00004699 80E706 and bh,6 - 31679 0000469C 80FF06 cmp bh,6 ; Ambig and path ? - 31680 0000469F 7518 jne short CHECKAMB ; jmp if no - 31681 ;mov si,[bp+2] - 31682 000046A1 8B7602 mov si,[bp+VARSTRUC.TTAIL] - 31683 000046A4 B33A mov bl,':' - 31684 000046A6 385CFE cmp [si-2],bl - 31685 000046A9 7506 jne short KNOWNOTSPEC - 31686 ;mov byte [bp+VARSTRUC.ISDIR],2 - 31687 ; Know is d:/file - 31688 ;mov byte [bp+0],2 - 31689 000046AB C6460002 mov byte [bp],2 - 31690 000046AF EB05 jmp short DOPCDJ - 31691 KNOWNOTSPEC: - 31692 ;mov byte [bp+VARSTRUC.ISDIR],1 - 31693 ; Know is path/file - 31694 ;mov byte [bp+0],1 - 31695 000046B1 C6460001 mov byte [bp],1 - 31696 000046B5 4E dec si - 31697 DOPCDJ: - 31698 000046B6 E98300 jmp DOPCD - 31699 CHECKAMB: - 31700 000046B9 80FF02 cmp bh,2 - 31701 000046BC 7505 jnz short CHECKCD - 31702 ISSIMPFILE: - 31703 ISADEV: - 31704 ;mov byte [bp+VARSTRUC.ISDIR],0 - 31705 ;mov byte [bp+0],0 - 31706 000046BE C6460000 mov byte [bp],0 - 31707 000046C2 C3 retn - 31708 CHECKCD: - 31709 000046C3 E84EEA call SetRest1 - 31710 000046C6 B43B mov ah,CHDir ; 3Bh - 31711 000046C8 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 31712 ; DS:DX -> ASCIZ directory name (may include drive) - 31713 000046CA 7239 jb short NOTPDIR - 31714 000046CC 89D7 mov di,dx - 31715 000046CE 31C0 xor ax,ax - 31716 000046D0 89C1 mov cx,ax - 31717 000046D2 49 dec cx - 31718 ; 14/06/2023 - 31719 ;repne scasb ; MSDOS 3.3 - 31720 - 31721 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31722 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:424Ah) - 31723 ; MSDOS 6.0 - 31724 Kloop: ;AN000; 3/3/KK - 31725 000046D3 268A05 mov al,[es:di] ;AN000; 3/3/KK - 31726 000046D6 47 inc di ;AN000; 3/3/KK - 31727 000046D7 08C0 or al,al ;AN000; 3/3/KK - 31728 000046D9 740C jz short DONE ;AN000; 3/3/KK - 31729 000046DB 30E4 xor ah,ah ;AN000; 3/3/KK - 31730 000046DD E881E0 call testkanj ;AN000; 3/3/KK - 31731 000046E0 74F1 jz short Kloop ;AN000; 3/3/KK - 31732 000046E2 47 inc di ;AN000; 3/3/KK - 31733 000046E3 FEC4 inc ah ;AN000; 3/3/KK - 31734 000046E5 EBEC jmp short Kloop ;AN000; 3/3/KK - 31735 DONE: - 31736 000046E7 4F dec di - 31737 000046E8 A0[FA9B] mov al,[DIRCHAR] - 31738 ;mov byte [bp+VARSTRUC.ISDIR],2 ; assume d:/file - 31739 ;mov byte [bp+0],2 - 31740 000046EB C6460002 mov byte [bp],2 - 31741 ; 27/03/2023 - 31742 ; MSDOS 6.0 - 31743 000046EF 08E4 or ah,ah ;AN000; 3/3/KK - 31744 000046F1 7505 jnz short _STORE_PCHAR ;AN000; 3/3/KK - 31745 ;this is the trailing byte of ECS code - 31746 ; - 31747 000046F3 3A45FF cmp al,[di-1] - 31748 000046F6 7405 jz short GOTSRCSLSH - 31749 _STORE_PCHAR: - 31750 000046F8 AA stosb - 31751 ;mov byte [bp+VARSTRUC.ISDIR],1 ; know path/file - 31752 ;mov byte [bp+0],1 - 31753 000046F9 C6460001 mov byte [bp],1 - 31754 GOTSRCSLSH: - 31755 ;or byte [bp+4],6 - 31756 000046FD 804E0406 or byte [bp+VARSTRUC.INFO],6 - 31757 00004701 E87400 call SETSTARS - 31758 NOTPDIR_RETN: - 31759 00004704 C3 retn - 31760 - 31761 ; 28/03/2023 - 31762 NOTPDIR: - 31763 ; MSDOS 6.0 - 31764 00004705 E843D9 call get_ext_error_number ;AN022; get the extended error - 31765 ;cmp ax,3 - 31766 00004708 83F803 cmp ax,ERROR_PATH_NOT_FOUND ;AN022; if path not found - okay - 31767 0000470B 7405 je short NOTPDIR_TRY ;AN022; - 31768 ;cmp ax,5 - 31769 0000470D 83F805 cmp ax,ERROR_ACCESS_DENIED ;AN022; if access denied - okay - 31770 00004710 7560 jne short EXTEND_SETUPJ ;AN022; otherwise - exit error - 31771 NOTPDIR_TRY: - 31772 ; MSDOS 3.3 (& MSDOS 6.0) - 31773 ;mov byte [bp+VARSTRUC.ISDIR],0 - 31774 ;mov byte [bp+0],0 - 31775 00004712 C6460000 mov byte [bp],0 - 31776 ;mov bh,[bp+4] - 31777 00004716 8A7E04 mov bh,[bp+VARSTRUC.INFO] - 31778 00004719 F6C704 test bh,4 - 31779 0000471C 74E6 jz short NOTPDIR_RETN ; Know pure file, no path seps - 31780 ;mov byte [bp+VARSTRUC.ISDIR],2 ; assume d:/file - 31781 ;mov byte [bp+0],2 - 31782 0000471E C6460002 mov byte [bp],2 - 31783 ;mov si,[bp+2] - 31784 00004722 8B7602 mov si,[bp+VARSTRUC.TTAIL] - 31785 00004725 803C00 cmp byte [si],0 - 31786 00004728 744B je short BADCDERRJ2 ; Trailing '/' - 31787 ;mov bl,[DOT_CHR] - 31788 ; 28/03/2023 - Retro DOS v4.0 COMMAND.COM - 31789 ; MSDOS 6.0 (& 5.0) COMMAND.COM - 31790 0000472A B32E mov bl,'.' ; 2Eh ; dot_chr - 31791 0000472C 381C cmp [si],bl - 31792 0000472E 7445 je short BADCDERRJ2 ; If . or .. pure cd should have worked - 31793 00004730 B33A mov bl,':' ; 3Ah - 31794 00004732 385CFE cmp [si-2],bl - 31795 00004735 7405 je short DOPCD ; Know d:/file - 31796 ;mov byte [bp+VARSTRUC.ISDIR],1 - 31797 ; Know path/file - 31798 ;mov byte [bp+0],1 - 31799 00004737 C6460001 mov byte [bp],1 - 31800 0000473B 4E dec si ; Point at last '/' - 31801 DOPCD: - 31802 0000473C 30DB xor bl,bl - 31803 0000473E 861C xchg bl,[si] ; Stick in a NUL - 31804 00004740 E8D1E9 call SetRest1 - 31805 - 31806 ; 28/03/2023 - 31807 ; MSDOS 6.0 (& MSDOS 5.0) - 31808 00004743 39F2 cmp dx,si ;AN000; 3/3/KK - 31809 00004745 771B ja short LookBack ;AN000; 3/3/KK - 31810 00004747 56 push si ;AN000; 3/3/KK - 31811 00004748 51 push cx ;AN000; 3/3/KK - 31812 00004749 89F1 mov cx,si ;AN000; 3/3/KK - 31813 0000474B 89D6 mov si,dx ;AN000; 3/3/KK - 31814 Kloop2: ;AN000; 3/3/KK - 31815 0000474D AC lodsb ;AN000; 3/3/KK - 31816 0000474E E810E0 call testkanj ;AN000; 3/3/KK - 31817 00004751 7409 jz short NotKanj4 ;AN000; 3/3/KK - 31818 00004753 AC lodsb ;AN000; 3/3/KK - 31819 00004754 39CE cmp si,cx ;AN000; 3/3/KK - 31820 00004756 72F5 jb short Kloop2 ;AN000; 3/3/KK - 31821 00004758 59 pop cx ;AN000; 3/3/KK - 31822 00004759 5E pop si ;AN000; 3/3/KK - 31823 0000475A EB0B jmp short DoCdr ;AN000; 3/3/KK Last char is ECS code, don't check for - 31824 ; trailing path sep - 31825 NotKanj4: ;AN000; 3/3/KK - 31826 0000475C 39CE cmp si,cx ;AN000; 3/3/KK - 31827 0000475E 72ED jb short Kloop2 ;AN000; 3/3/KK - 31828 00004760 59 pop cx ;AN000; 3/3/KK - 31829 00004761 5E pop si ;AN000; 3/3/KK - 31830 LookBack: ;AN000; 3/3/KK - 31831 ; 28/03/2023 - 31832 ; MSDOS 3.3 & MSDOS 6.0 - 31833 00004762 3A5CFF cmp bl,[si-1] ; if double slash, then complain. - 31834 00004765 740E je short BADCDERRJ2 - 31835 DoCdr: - 31836 00004767 B43B mov ah,CHDir ; 3Bh - 31837 00004769 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) - 31838 ; DS:DX -> ASCIZ directory name (may include drive) - 31839 0000476B 861C xchg bl,[si] - 31840 0000476D 7395 jnc short NOTPDIR_RETN - 31841 - 31842 ; 28/03/2023 - 31843 ; MSDOS 3.3 - 31844 ;BADCDERRJ2: - 31845 ;stc - 31846 ;jmp BADCDERR - 31847 - 31848 ; 28/03/2023 - 31849 ; MSDOS 6.0 (& MSDOS 5.0) - 31850 0000476F E8D9D8 call get_ext_error_number ;AN022; get the extended error - 31851 EXTEND_SETUPJ: ;AN022; - 31852 00004772 E90BD6 jmp extend_setup ;AN022; go issue the error message - 31853 BADCDERRJ2: - 31854 00004775 E905D6 jmp badpath_err ;AC022; go issue path not found message - 31855 - 31856 ; =============== S U B R O U T I N E ======================================= - 31857 - 31858 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31859 SETSTARS: - 31860 ;mov [bp+2],di - 31861 00004778 897E02 mov [bp+VARSTRUC.TTAIL],di - 31862 ;add byte [bp+1],12 - 31863 0000477B 8046010C add byte [bp+VARSTRUC.SIZ],12 - 31864 ;;mov ax,[DOT_QMARK] ; '?.' (2E3Fh) - 31865 ; 28/03/2023 - 31866 ; MSDOS 6.0 - 31867 0000477F B83F2E mov ax,dot_qmark ; 2E3Fh - 31868 ;mov ax,'?.' ; dot_qmark - 31869 - 31870 00004782 B90800 mov cx,8 - 31871 00004785 F3AA rep stosb - 31872 00004787 86C4 xchg al,ah - 31873 00004789 AA stosb - 31874 0000478A 86C4 xchg al,ah - 31875 0000478C B103 mov cl,3 - 31876 0000478E F3AA rep stosb - 31877 00004790 30C0 xor al,al - 31878 00004792 AA stosb - 31879 00004793 C3 retn - 31880 - 31881 ; =============== S U B R O U T I N E ======================================= - 31882 - 31883 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31884 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM - 31885 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 31886 COMPNAME: - 31887 00004794 BE[BE9D] mov si,DestBuf ; do name translate of target - 31888 00004797 BF[7A99] mov di,TRGXNAME ; save for name comparison - 31889 0000479A B460 mov ah,xNameTrans ; 60h - 31890 ;mov ah,60h - 31891 0000479C CD21 int 21h ; DOS - RESOLVE PATH STRING TO CANONICAL PATH STRING - 31892 ; DS:SI -> ASCIZ relative path string or directory name - 31893 ; ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name - 31894 0000479E BE[2399] mov si,SRCXNAME ; get name translate of source - 31895 000047A1 BF[7A99] mov di,TRGXNAME ; get name translate of target - 31896 ;call STRCOMP - 31897 ;retn - 31898 ; 28/03/2023 - 31899 000047A4 E921E2 jmp STRCOMP - 31900 - 31901 ;============================================================================ - 31902 ; CPARSE.ASM, MSDOS 6.0, 1991 - 31903 ;============================================================================ - 31904 ; 30/09/2018 - Retro DOS v3.0 - 31905 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31906 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 31907 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 31908 - 31909 ;-----------------------------------------------------------------------; - 31910 ; ENTRY: ; - 31911 ; DS:SI Points input buffer ; - 31912 ; ES:DI Points to the token buffer ; - 31913 ; BL Special delimiter for this call ; - 31914 ; Always checked last ; - 31915 ; set it to space if there is no special delimiter ; - 31916 ; EXIT: ; - 31917 ; DS:SI Points to next char in the input buffer ; - 31918 ; ES:DI Points to the token buffer ; - 31919 ; [STARTEL] Points to start of last element of path in token ; - 31920 ; points to a NUL for no element strings 'd:' 'd:/' ; - 31921 ; CX Character count ; - 31922 ; BH Condition Code ; - 31923 ; Bit 1H of BH set if switch character ; - 31924 ; Token buffer contains char after ; - 31925 ; switch character ; - 31926 ; BP has switch bits set (ORing only) ; - 31927 ; Bit 2H of BH set if ? or * in token ; - 31928 ; if * found element ? filled ; - 31929 ; Bit 4H of BH set if path sep in token ; - 31930 ; Bit 80H of BH set if the special delimiter ; - 31931 ; was skipped at the start of this token ; - 31932 ; Token buffer always starts d: for non switch tokens ; - 31933 ; CARRY SET ; - 31934 ; if CR on input ; - 31935 ; token buffer not altered ; - 31936 ; ; - 31937 ; DOES NOT RETURN ON BAD PATH, OR TRAILING SWITCH CHAR ERROR ; - 31938 ; MODIFIES: ; - 31939 ; CX, SI, AX, BH, DX and the Carry Flag ; - 31940 ; ; - 31941 ;-----------------------------------------------------------------------; - 31942 - 31943 ; Modifications to cparse: recognition of right and left parentheses - 31944 ; as integral tokens, and removal of automatic upper-case conversion code. - 31945 ; - 31946 ; Both modifications were installed in the course of adding a coherent - 31947 ; command-line parser to COMMAND.COM which builds a UNIX-style argv[]/argc - 31948 ; structure for command-line arguments. This parser relies on cparse to - 31949 ; recognize individual tokens. - 31950 ; - 31951 ; To process for-loops correctly, parentheses must therefore be - 31952 ; recognized as tokens. The upper-case conversion code was removed so - 31953 ; that commands (such as for and echo) would be able to use the "original" - 31954 ; text of the command line. - 31955 ; - 31956 ; Note also the modification to prevent the automatic conversion of colons - 31957 ; into spaces WITHIN THE SOURCE TEXT! + 31481 ; Source and destination are wildcarded, and source includes +'s. + 31482 ; It's Mel Hallorman copy time. + 31483 + 31484 000045A1 FE06[199E] inc byte [MELCOPY] ; 'Mel copy' = true + 31485 000045A5 30C0 xor al,al + 31486 000045A7 EB06 jmp short SETCONC + 31487 + 31488 NOTMELCOPY: + 31489 000045A9 3402 xor al,2 ; AL=0 -> ambiguous destination, 2 otherwise + 31490 000045AB 20E0 and al,ah + 31491 000045AD D0E8 shr al,1 ; AL=1 -> ambiguous source, unambiguous dest + 31492 ; (implies concatenation) + 31493 SETCONC: + 31494 000045AF 0A06[DB9E] or al,[PLUS] ; "+" always infers concatenation + 31495 + 31496 ; Whew. AL = 1 if concatenating, 0 if not. + 31497 + 31498 000045B3 A2[089C] mov [Concat],al + 31499 000045B6 D0E0 shl al,1 + 31500 000045B8 D0E0 shl al,1 + 31501 000045BA A2[D49E] mov [INEXACT],al ; concatenation -> inexact copy + 31502 000045BD 803E[D69E]00 cmp byte [BINARY],0 + 31503 000045C2 7524 jne short NOFIRSTDEST ; explicit binary copy + 31504 + 31505 ; 13/06/2023 - Retro DOS v4.2 COMMAND.COM + 31506 ; MSDOS 6.0 (MSDOS 5.0) + 31507 ;mov [ASCII],al ; otherwise, concatenate in ascii mode + 31508 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:48FAh + 31509 ;or [ASCII],al + 31510 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 31511 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:47C5h + 31512 000045C4 A2[DA9E] mov [ASCII],al + 31513 + 31514 000045C7 08C9 or cl,cl + 31515 000045C9 751D jnz short NOFIRSTDEST ; Ascii flag set before, data read correctly + 31516 000045CB 08C0 or al,al + 31517 000045CD 7419 jz short NOFIRSTDEST ; Ascii flag did not change state + 31518 + 31519 ; At this point there may already be binary read data in the read + 31520 ; buffer. We need to find the first ^Z (if there is one) and trim the + 31521 ; amount of data in the buffer correctly. + 31522 + 31523 000045CF 8B0E[199C] mov cx,[NXTADD] + 31524 000045D3 E313 jcxz NOFIRSTDEST ; no data, everything ok + 31525 000045D5 B01A mov al,1Ah + 31526 000045D7 06 push es + 31527 000045D8 31FF xor di,di + 31528 000045DA 8E06[F79B] mov es,[TPA] + 31529 000045DE F2AE repne scasb ; scan for EOF + 31530 000045E0 07 pop es + 31531 000045E1 7505 jnz short NOFIRSTDEST ; no ^z in buffer, everything ok + 31532 000045E3 4F dec di ; point at ^z + 31533 000045E4 893E[199C] mov [NXTADD],di ; new buffer length + 31534 + 31535 NOFIRSTDEST: + 31536 000045E8 BB[3A9D] mov bx,DIRBUF+1 ; Source of replacement chars + 31537 000045EB 803E[089C]00 cmp byte [Concat],0 + 31538 000045F0 7403 jz short GOTCHRSRC ; Not a concat + 31539 000045F2 BB[809D] mov bx,SDIRBUF+1 ; Source of replacement chars + 31540 GOTCHRSRC: + 31541 000045F5 BE[F79C] mov si,DestFcb+1 ; Original dest name + 31542 000045F8 8B3E[BB9D] mov di,[DestTail] ; Where to put result + 31543 + 31544 ; --------------- S U B R O U T I N E --------------------------------------- + 31545 + 31546 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31547 BUILDNAME: + 31548 000045FC B90800 mov cx,8 + 31549 BUILDMAIN: + 31550 000045FF AC lodsb + 31551 00004600 3C3F cmp al,'?' + 31552 00004602 7502 jne short NOTAMBIG + 31553 00004604 8A07 mov al,[bx] + 31554 NOTAMBIG: + 31555 00004606 3C20 cmp al,' ' + 31556 00004608 7401 je short NOSTORE + 31557 0000460A AA stosb + 31558 NOSTORE: + 31559 0000460B 43 inc bx + 31560 0000460C E2F1 loop BUILDMAIN + 31561 0000460E B103 mov cl,3 + 31562 ;mov al,' ' ; 20h + 31563 ;cmp [si],al + 31564 ; 27/03/2023 + 31565 00004610 803C20 cmp byte [si],20h ; ' ' + 31566 00004613 7412 je short ENDDEST ; No extension + 31567 ;mov al,[DOT_CHR] + 31568 ; 27/03/2023 + 31569 00004615 B02E mov al,'.' ; 2Eh ; dot_chr + 31570 00004617 AA stosb + 31571 BUILDEXT: + 31572 00004618 AC lodsb + 31573 00004619 3C3F cmp al,'?' + 31574 0000461B 7502 jne short NOTAMBIGE + 31575 0000461D 8A07 mov al,[bx] + 31576 NOTAMBIGE: + 31577 0000461F 3C20 cmp al,' ' + 31578 00004621 7401 je short NOSTOREE + 31579 00004623 AA stosb + 31580 NOSTOREE: + 31581 00004624 43 inc bx + 31582 00004625 E2F1 loop BUILDEXT + 31583 ENDDEST: + 31584 00004627 30C0 xor al,al + 31585 00004629 AA stosb ; NUL terminate + 31586 0000462A C3 retn + 31587 + 31588 ; =============== S U B R O U T I N E ======================================= + 31589 + 31590 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31591 ; 28/03/2023 + 31592 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 31593 ; 10/08/2024 - Retro DOS v5.0 COMMAND.COM + 31594 BUILDPATH: + 31595 0000462B F6460402 test byte [bp+VARSTRUC.INFO],2 ; test byte [bp+4],2 + 31596 0000462F 7540 jnz short NOTPFILE ; If ambig don't bother with open + 31597 00004631 89EA mov dx,bp ; Set DX to spec + 31598 00004633 83C205 add dx,VARSTRUC.BUF ; add dx,5 + 31599 + 31600 ; 27/03/2023 + 31601 ; MSDOS 6.0 + 31602 00004636 57 push di ;AN000; + 31603 00004637 B8006C mov ax,(ExtOpen<<8) ; 6C00h ;AC000; open the file + 31604 + 31605 ; 10/08/2024 - PCDOS 7.1 COMMAND.COM + 31606 %if 0 + 31607 ;mov bx,deny_none|read_open_mode + 31608 mov bx,40h ; open mode for COPY ;M046 + 31609 %endif + 31610 0000463A 31C9 xor cx,cx ;AN000; no special files + 31611 0000463C 89D6 mov si,dx ;AN030; get file name offset + 31612 ;mov dx,read_open_flag ;AN000; set up open flags + 31613 0000463E BA0101 mov dx,101h + 31614 00004641 CD21 INT 21h + 31615 00004643 5F pop di ;AN000; + 31616 00004644 7315 jnc short PURE_FILE ;AN022; is pure file + 31617 00004646 E802DA call get_ext_error_number ;AN022; get the extended error + 31618 ;cmp ax,2 + 31619 00004649 83F802 cmp ax,ERROR_FILE_NOT_FOUND ;AN022; if file not found - okay + 31620 0000464C 7423 jz short NOTPFILE ;AN022; + 31621 ;cmp ax,3 + 31622 0000464E 83F803 cmp ax,ERROR_PATH_NOT_FOUND ;AN022; if path not found - okay + 31623 00004651 741E jz short NOTPFILE ;AN022; + 31624 ;cmp ax,5 + 31625 00004653 83F805 cmp ax,ERROR_ACCESS_DENIED ;AN022; if access denied - okay + 31626 00004656 7419 jz short NOTPFILE ;AN022; + 31627 00004658 E925D7 jmp extend_setup ;AN022; exit with error + 31628 + 31629 ; 27/03/2023 + 31630 ; MSDOS 3.3 + 31631 ;mov ax,OPEN*256 ; 3D00h + 31632 ;int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE + 31633 ; ; DS:DX -> ASCIZ filename + 31634 ; ; AL = access mode + 31635 ; ; 0 - read + 31636 ;jc short NOTPFILE + 31637 + 31638 PURE_FILE: + 31639 0000465B 89C3 mov bx,ax + 31640 0000465D B80044 mov ax,IOCTL*256 ; 4400h + 31641 00004660 CD21 int 21h ; DOS - 2+ - IOCTL - GET DEVICE INFORMATION + 31642 ; BX = file or device handle + 31643 00004662 B43E mov ah,CLOSE ;3Eh + 31644 00004664 CD21 int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE + 31645 ; BX = file handle + 31646 ; 18/04/2023 + 31647 00004666 F6C280 test dl,80h + 31648 ;test dl,devid_ISDEV ; test dl,80h + 31649 00004669 7553 jnz short ISADEV + 31650 0000466B F6460404 test byte [bp+VARSTRUC.INFO],4 ; test byte [bp+4],4 + 31651 0000466F 744D jz short ISADEV + 31652 NOTPFILE: + 31653 00004671 8B5605 mov dx,[bp+VARSTRUC.BUF] ; mov dx,[bp+5] + 31654 + 31655 ; 27/03/2023 + 31656 ; MSDOS 6.0 + 31657 00004674 80FA00 cmp dl,0 ;AN034; If no drive specified, get + 31658 00004677 7405 je short SET_DRIVE_SPEC ;AN034; default drive dir + 31659 + 31660 00004679 80FE3A cmp dh,':' + 31661 0000467C 7402 je short DRVSPEC5 + 31662 SET_DRIVE_SPEC: + 31663 0000467E B240 mov dl,'@' ; 40h + 31664 DRVSPEC5: + 31665 00004680 80CA20 or dl,20h + 31666 00004683 80EA60 sub dl,60h ; A = 1 + 31667 00004686 E8CCE2 call SAVUDIR1 + 31668 + 31669 ; 27/03/2023 + 31670 ; MSDOS 6.0 + 31671 00004689 7306 jnc short CURDIR_OK ;AN022; if error - exit + 31672 0000468B E8BDD9 call get_ext_error_number ;AN022; get the extended error + 31673 0000468E E9EFD6 jmp extend_setup ;AN022; exit with error + 31674 + 31675 CURDIR_OK: + 31676 00004691 89EA mov dx,bp + 31677 ;add dx,5 + 31678 00004693 83C205 add dx,VARSTRUC.BUF ; Set DX for upcomming CHDIRs + 31679 ;mov bh,[bp+4] + 31680 00004696 8A7E04 mov bh,[bp+VARSTRUC.INFO] + 31681 00004699 80E706 and bh,6 + 31682 0000469C 80FF06 cmp bh,6 ; Ambig and path ? + 31683 0000469F 7518 jne short CHECKAMB ; jmp if no + 31684 ;mov si,[bp+2] + 31685 000046A1 8B7602 mov si,[bp+VARSTRUC.TTAIL] + 31686 000046A4 B33A mov bl,':' + 31687 000046A6 385CFE cmp [si-2],bl + 31688 000046A9 7506 jne short KNOWNOTSPEC + 31689 ;mov byte [bp+VARSTRUC.ISDIR],2 + 31690 ; Know is d:/file + 31691 ;mov byte [bp+0],2 + 31692 000046AB C6460002 mov byte [bp],2 + 31693 000046AF EB05 jmp short DOPCDJ + 31694 KNOWNOTSPEC: + 31695 ;mov byte [bp+VARSTRUC.ISDIR],1 + 31696 ; Know is path/file + 31697 ;mov byte [bp+0],1 + 31698 000046B1 C6460001 mov byte [bp],1 + 31699 000046B5 4E dec si + 31700 DOPCDJ: + 31701 000046B6 E98300 jmp DOPCD + 31702 CHECKAMB: + 31703 000046B9 80FF02 cmp bh,2 + 31704 000046BC 7505 jnz short CHECKCD + 31705 ISSIMPFILE: + 31706 ISADEV: + 31707 ;mov byte [bp+VARSTRUC.ISDIR],0 + 31708 ;mov byte [bp+0],0 + 31709 000046BE C6460000 mov byte [bp],0 + 31710 000046C2 C3 retn + 31711 CHECKCD: + 31712 000046C3 E84EEA call SetRest1 + 31713 000046C6 B43B mov ah,CHDir ; 3Bh + 31714 000046C8 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 31715 ; DS:DX -> ASCIZ directory name (may include drive) + 31716 000046CA 7239 jb short NOTPDIR + 31717 000046CC 89D7 mov di,dx + 31718 000046CE 31C0 xor ax,ax + 31719 000046D0 89C1 mov cx,ax + 31720 000046D2 49 dec cx + 31721 ; 14/06/2023 + 31722 ;repne scasb ; MSDOS 3.3 + 31723 + 31724 ; 27/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31725 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:424Ah) + 31726 ; MSDOS 6.0 + 31727 Kloop: ;AN000; 3/3/KK + 31728 000046D3 268A05 mov al,[es:di] ;AN000; 3/3/KK + 31729 000046D6 47 inc di ;AN000; 3/3/KK + 31730 000046D7 08C0 or al,al ;AN000; 3/3/KK + 31731 000046D9 740C jz short DONE ;AN000; 3/3/KK + 31732 000046DB 30E4 xor ah,ah ;AN000; 3/3/KK + 31733 000046DD E881E0 call testkanj ;AN000; 3/3/KK + 31734 000046E0 74F1 jz short Kloop ;AN000; 3/3/KK + 31735 000046E2 47 inc di ;AN000; 3/3/KK + 31736 000046E3 FEC4 inc ah ;AN000; 3/3/KK + 31737 000046E5 EBEC jmp short Kloop ;AN000; 3/3/KK + 31738 DONE: + 31739 000046E7 4F dec di + 31740 000046E8 A0[FA9B] mov al,[DIRCHAR] + 31741 ;mov byte [bp+VARSTRUC.ISDIR],2 ; assume d:/file + 31742 ;mov byte [bp+0],2 + 31743 000046EB C6460002 mov byte [bp],2 + 31744 ; 27/03/2023 + 31745 ; MSDOS 6.0 + 31746 000046EF 08E4 or ah,ah ;AN000; 3/3/KK + 31747 000046F1 7505 jnz short _STORE_PCHAR ;AN000; 3/3/KK + 31748 ;this is the trailing byte of ECS code + 31749 ; + 31750 000046F3 3A45FF cmp al,[di-1] + 31751 000046F6 7405 jz short GOTSRCSLSH + 31752 _STORE_PCHAR: + 31753 000046F8 AA stosb + 31754 ;mov byte [bp+VARSTRUC.ISDIR],1 ; know path/file + 31755 ;mov byte [bp+0],1 + 31756 000046F9 C6460001 mov byte [bp],1 + 31757 GOTSRCSLSH: + 31758 ;or byte [bp+4],6 + 31759 000046FD 804E0406 or byte [bp+VARSTRUC.INFO],6 + 31760 00004701 E87400 call SETSTARS + 31761 NOTPDIR_RETN: + 31762 00004704 C3 retn + 31763 + 31764 ; 28/03/2023 + 31765 NOTPDIR: + 31766 ; MSDOS 6.0 + 31767 00004705 E843D9 call get_ext_error_number ;AN022; get the extended error + 31768 ;cmp ax,3 + 31769 00004708 83F803 cmp ax,ERROR_PATH_NOT_FOUND ;AN022; if path not found - okay + 31770 0000470B 7405 je short NOTPDIR_TRY ;AN022; + 31771 ;cmp ax,5 + 31772 0000470D 83F805 cmp ax,ERROR_ACCESS_DENIED ;AN022; if access denied - okay + 31773 00004710 7560 jne short EXTEND_SETUPJ ;AN022; otherwise - exit error + 31774 NOTPDIR_TRY: + 31775 ; MSDOS 3.3 (& MSDOS 6.0) + 31776 ;mov byte [bp+VARSTRUC.ISDIR],0 + 31777 ;mov byte [bp+0],0 + 31778 00004712 C6460000 mov byte [bp],0 + 31779 ;mov bh,[bp+4] + 31780 00004716 8A7E04 mov bh,[bp+VARSTRUC.INFO] + 31781 00004719 F6C704 test bh,4 + 31782 0000471C 74E6 jz short NOTPDIR_RETN ; Know pure file, no path seps + 31783 ;mov byte [bp+VARSTRUC.ISDIR],2 ; assume d:/file + 31784 ;mov byte [bp+0],2 + 31785 0000471E C6460002 mov byte [bp],2 + 31786 ;mov si,[bp+2] + 31787 00004722 8B7602 mov si,[bp+VARSTRUC.TTAIL] + 31788 00004725 803C00 cmp byte [si],0 + 31789 00004728 744B je short BADCDERRJ2 ; Trailing '/' + 31790 ;mov bl,[DOT_CHR] + 31791 ; 28/03/2023 - Retro DOS v4.0 COMMAND.COM + 31792 ; MSDOS 6.0 (& 5.0) COMMAND.COM + 31793 0000472A B32E mov bl,'.' ; 2Eh ; dot_chr + 31794 0000472C 381C cmp [si],bl + 31795 0000472E 7445 je short BADCDERRJ2 ; If . or .. pure cd should have worked + 31796 00004730 B33A mov bl,':' ; 3Ah + 31797 00004732 385CFE cmp [si-2],bl + 31798 00004735 7405 je short DOPCD ; Know d:/file + 31799 ;mov byte [bp+VARSTRUC.ISDIR],1 + 31800 ; Know path/file + 31801 ;mov byte [bp+0],1 + 31802 00004737 C6460001 mov byte [bp],1 + 31803 0000473B 4E dec si ; Point at last '/' + 31804 DOPCD: + 31805 0000473C 30DB xor bl,bl + 31806 0000473E 861C xchg bl,[si] ; Stick in a NUL + 31807 00004740 E8D1E9 call SetRest1 + 31808 + 31809 ; 28/03/2023 + 31810 ; MSDOS 6.0 (& MSDOS 5.0) + 31811 00004743 39F2 cmp dx,si ;AN000; 3/3/KK + 31812 00004745 771B ja short LookBack ;AN000; 3/3/KK + 31813 00004747 56 push si ;AN000; 3/3/KK + 31814 00004748 51 push cx ;AN000; 3/3/KK + 31815 00004749 89F1 mov cx,si ;AN000; 3/3/KK + 31816 0000474B 89D6 mov si,dx ;AN000; 3/3/KK + 31817 Kloop2: ;AN000; 3/3/KK + 31818 0000474D AC lodsb ;AN000; 3/3/KK + 31819 0000474E E810E0 call testkanj ;AN000; 3/3/KK + 31820 00004751 7409 jz short NotKanj4 ;AN000; 3/3/KK + 31821 00004753 AC lodsb ;AN000; 3/3/KK + 31822 00004754 39CE cmp si,cx ;AN000; 3/3/KK + 31823 00004756 72F5 jb short Kloop2 ;AN000; 3/3/KK + 31824 00004758 59 pop cx ;AN000; 3/3/KK + 31825 00004759 5E pop si ;AN000; 3/3/KK + 31826 0000475A EB0B jmp short DoCdr ;AN000; 3/3/KK Last char is ECS code, don't check for + 31827 ; trailing path sep + 31828 NotKanj4: ;AN000; 3/3/KK + 31829 0000475C 39CE cmp si,cx ;AN000; 3/3/KK + 31830 0000475E 72ED jb short Kloop2 ;AN000; 3/3/KK + 31831 00004760 59 pop cx ;AN000; 3/3/KK + 31832 00004761 5E pop si ;AN000; 3/3/KK + 31833 LookBack: ;AN000; 3/3/KK + 31834 ; 28/03/2023 + 31835 ; MSDOS 3.3 & MSDOS 6.0 + 31836 00004762 3A5CFF cmp bl,[si-1] ; if double slash, then complain. + 31837 00004765 740E je short BADCDERRJ2 + 31838 DoCdr: + 31839 00004767 B43B mov ah,CHDir ; 3Bh + 31840 00004769 CD21 int 21h ; DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR) + 31841 ; DS:DX -> ASCIZ directory name (may include drive) + 31842 0000476B 861C xchg bl,[si] + 31843 0000476D 7395 jnc short NOTPDIR_RETN + 31844 + 31845 ; 28/03/2023 + 31846 ; MSDOS 3.3 + 31847 ;BADCDERRJ2: + 31848 ;stc + 31849 ;jmp BADCDERR + 31850 + 31851 ; 28/03/2023 + 31852 ; MSDOS 6.0 (& MSDOS 5.0) + 31853 0000476F E8D9D8 call get_ext_error_number ;AN022; get the extended error + 31854 EXTEND_SETUPJ: ;AN022; + 31855 00004772 E90BD6 jmp extend_setup ;AN022; go issue the error message + 31856 BADCDERRJ2: + 31857 00004775 E905D6 jmp badpath_err ;AC022; go issue path not found message + 31858 + 31859 ; =============== S U B R O U T I N E ======================================= + 31860 + 31861 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31862 SETSTARS: + 31863 ;mov [bp+2],di + 31864 00004778 897E02 mov [bp+VARSTRUC.TTAIL],di + 31865 ;add byte [bp+1],12 + 31866 0000477B 8046010C add byte [bp+VARSTRUC.SIZ],12 + 31867 ;;mov ax,[DOT_QMARK] ; '?.' (2E3Fh) + 31868 ; 28/03/2023 + 31869 ; MSDOS 6.0 + 31870 0000477F B83F2E mov ax,dot_qmark ; 2E3Fh + 31871 ;mov ax,'?.' ; dot_qmark + 31872 + 31873 00004782 B90800 mov cx,8 + 31874 00004785 F3AA rep stosb + 31875 00004787 86C4 xchg al,ah + 31876 00004789 AA stosb + 31877 0000478A 86C4 xchg al,ah + 31878 0000478C B103 mov cl,3 + 31879 0000478E F3AA rep stosb + 31880 00004790 30C0 xor al,al + 31881 00004792 AA stosb + 31882 00004793 C3 retn + 31883 + 31884 ; =============== S U B R O U T I N E ======================================= + 31885 + 31886 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31887 ; 12/06/2023 - Retro DOS v4.2 COMMAND.COM + 31888 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 31889 COMPNAME: + 31890 00004794 BE[BE9D] mov si,DestBuf ; do name translate of target + 31891 00004797 BF[7A99] mov di,TRGXNAME ; save for name comparison + 31892 0000479A B460 mov ah,xNameTrans ; 60h + 31893 ;mov ah,60h + 31894 0000479C CD21 int 21h ; DOS - RESOLVE PATH STRING TO CANONICAL PATH STRING + 31895 ; DS:SI -> ASCIZ relative path string or directory name + 31896 ; ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name + 31897 0000479E BE[2399] mov si,SRCXNAME ; get name translate of source + 31898 000047A1 BF[7A99] mov di,TRGXNAME ; get name translate of target + 31899 ;call STRCOMP + 31900 ;retn + 31901 ; 28/03/2023 + 31902 000047A4 E921E2 jmp STRCOMP + 31903 + 31904 ;============================================================================ + 31905 ; CPARSE.ASM, MSDOS 6.0, 1991 + 31906 ;============================================================================ + 31907 ; 30/09/2018 - Retro DOS v3.0 + 31908 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31909 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 31910 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 31911 + 31912 ;-----------------------------------------------------------------------; + 31913 ; ENTRY: ; + 31914 ; DS:SI Points input buffer ; + 31915 ; ES:DI Points to the token buffer ; + 31916 ; BL Special delimiter for this call ; + 31917 ; Always checked last ; + 31918 ; set it to space if there is no special delimiter ; + 31919 ; EXIT: ; + 31920 ; DS:SI Points to next char in the input buffer ; + 31921 ; ES:DI Points to the token buffer ; + 31922 ; [STARTEL] Points to start of last element of path in token ; + 31923 ; points to a NUL for no element strings 'd:' 'd:/' ; + 31924 ; CX Character count ; + 31925 ; BH Condition Code ; + 31926 ; Bit 1H of BH set if switch character ; + 31927 ; Token buffer contains char after ; + 31928 ; switch character ; + 31929 ; BP has switch bits set (ORing only) ; + 31930 ; Bit 2H of BH set if ? or * in token ; + 31931 ; if * found element ? filled ; + 31932 ; Bit 4H of BH set if path sep in token ; + 31933 ; Bit 80H of BH set if the special delimiter ; + 31934 ; was skipped at the start of this token ; + 31935 ; Token buffer always starts d: for non switch tokens ; + 31936 ; CARRY SET ; + 31937 ; if CR on input ; + 31938 ; token buffer not altered ; + 31939 ; ; + 31940 ; DOES NOT RETURN ON BAD PATH, OR TRAILING SWITCH CHAR ERROR ; + 31941 ; MODIFIES: ; + 31942 ; CX, SI, AX, BH, DX and the Carry Flag ; + 31943 ; ; + 31944 ;-----------------------------------------------------------------------; + 31945 + 31946 ; Modifications to cparse: recognition of right and left parentheses + 31947 ; as integral tokens, and removal of automatic upper-case conversion code. + 31948 ; + 31949 ; Both modifications were installed in the course of adding a coherent + 31950 ; command-line parser to COMMAND.COM which builds a UNIX-style argv[]/argc + 31951 ; structure for command-line arguments. This parser relies on cparse to + 31952 ; recognize individual tokens. + 31953 ; + 31954 ; To process for-loops correctly, parentheses must therefore be + 31955 ; recognized as tokens. The upper-case conversion code was removed so + 31956 ; that commands (such as for and echo) would be able to use the "original" + 31957 ; text of the command line. 31958 ; - 31959 ; Also note that BP is also clobbered if cparse recognizes any switches - 31960 ; on the command line. + 31959 ; Note also the modification to prevent the automatic conversion of colons + 31960 ; into spaces WITHIN THE SOURCE TEXT! 31961 ; - 31962 ; Alan L, OS/MSDOS 14 August 1983 - 31963 - 31964 ; --------------------------------------------------------------------------- - 31965 - 31966 ; COMEQU.ASM (MSDOS 6.0, 1991) - 31967 - 31968 ;FSWITCH EQU 8000h - 31969 ;FBADSWITCH EQU 4000h + 31962 ; Also note that BP is also clobbered if cparse recognizes any switches + 31963 ; on the command line. + 31964 ; + 31965 ; Alan L, OS/MSDOS 14 August 1983 + 31966 + 31967 ; --------------------------------------------------------------------------- + 31968 + 31969 ; COMEQU.ASM (MSDOS 6.0, 1991) 31970 - 31971 ; MSDOS 3.3 COMMAND.COM (1987) Transient portion offset 3334h - 31972 - 31973 ; =============== S U B R O U T I N E ======================================= - 31974 - 31975 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 31976 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 431Fh - 31977 - 31978 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 31979 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 4AE3h + 31971 ;FSWITCH EQU 8000h + 31972 ;FBADSWITCH EQU 4000h + 31973 + 31974 ; MSDOS 3.3 COMMAND.COM (1987) Transient portion offset 3334h + 31975 + 31976 ; =============== S U B R O U T I N E ======================================= + 31977 + 31978 ; 28/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 31979 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 431Fh 31980 - 31981 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 31982 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 49ABh - 31983 cparse: - 31984 000047A7 31C0 xor ax,ax - 31985 000047A9 893E[F69E] mov [STARTEL],di ; No path element (Is DI correct?) - 31986 000047AD A2[F99E] mov [ELPOS],al ; Start in 8 char prefix - 31987 ; MSDOS 3.3 - 31988 ;mov [SOURCE],al - 31989 ; MSDOS 6.0 - 31990 000047B0 A2[FA9E] mov [SKPDEL], al ; No skip delimiter yet - 31991 000047B3 88C7 mov bh,al ; Init nothing - 31992 000047B5 9C pushf ; save flags - 31993 000047B6 57 push di ; save the token buffer addrss - 31994 000047B7 31C9 xor cx,cx ; no chars in token buffer - 31995 000047B9 880E[959D] mov [comma],cl ; reset comma flag - 31996 moredelim: - 31997 000047BD AC lodsb - 31998 000047BE E8CDE1 call DELIM - 31999 000047C1 751D jnz short SCANCDONE - 32000 000047C3 3C20 cmp al,' ' - 32001 000047C5 74F6 jz short moredelim - 32002 000047C7 3C09 cmp al,9 - 32003 000047C9 74F2 jz short moredelim - 32004 ;xchg al,[SOURCE] - 32005 ; 28/03/2023 - 32006 000047CB 8606[FA9E] xchg al,[SKPDEL] - 32007 000047CF 08C0 or al,al - 32008 000047D1 74EA jz short moredelim ; One non space/tab delimiter allowed - 32009 000047D3 F6C780 test bh,80h ; has a special char been found? - 32010 000047D6 7405 jz short no_comma ; no - just exit - 32011 000047D8 C606[959D]01 mov byte [comma],1 ; set comma flag - 32012 no_comma: - 32013 000047DD E92A01 jmp x_done ; Nul argument - 32014 - 32015 SCANCDONE: - 32016 ; 28/03/2023 - 32017 ; MSDOS 6.0 - 32018 ; ----------------------------------- - 32019 ; Mod to avoid upper-case conversion. - 32020 ; ----------------------------------- - 32021 ; MSDOS 3.3 - 32022 ;cmp byte [CPYFLAG],1 ; 3/3/KK - 32023 ;jnz short cpcont1 ; 3/3/KK - 32024 ;call UPCONV_MAPCALL ; 3/3/KK - 32025 cpcont1: - 32026 ; ----------------------------------- - 32027 ; 28/03/2023 - 32028 000047E0 38D8 cmp al,bl ; Special delimiter? - 32029 000047E2 7505 jne short nospec - 32030 000047E4 80CF80 or bh,80h - 32031 000047E7 EBD4 jmp short moredelim - 32032 nospec: - 32033 000047E9 3C0D cmp al,0Dh ; a CR? - 32034 000047EB 7503 jne short ncperror - 32035 000047ED E91501 jmp cperror - 32036 ncperror: - 32037 000047F0 3A06[F99B] cmp al,[SWITCHAR] ; is the char the switch char? - 32038 000047F4 7503 jne short na_switch ; yes, process... - 32039 000047F6 E91401 jmp a_switch - 32040 na_switch: - 32041 000047F9 B23A mov dl,':' - 32042 000047FB 3814 cmp [si],dl - 32043 000047FD 751D jne short anum_chard ; Drive not specified - 32044 ; 28/03/2023 - 32045 ; MSDOS 6.0 - 32046 000047FF 803E[A49D]01 cmp byte [cpyflag],1 ; 3/3/KK - 32047 00004804 7503 jne short cpcont2 ; 3/3/KK - 32048 00004806 E882DF call UPCONV ; 3/3/KK - 32049 cpcont2: - 32050 00004809 E85901 call move_char - 32051 0000480C AC lodsb ; Get the ':' - 32052 0000480D E85501 call move_char - 32053 00004810 893E[F69E] mov [STARTEL],di - 32054 00004814 C606[F89E]00 mov byte [ELCNT],0 - 32055 00004819 E9B300 jmp anum_test - 32056 anum_chard: - 32057 0000481C 893E[F69E] mov [STARTEL],di - 32058 00004820 C606[F89E]00 mov byte [ELCNT],0 ; Store of this char sets it to one - 32059 00004825 803E[A49D]01 cmp byte [cpyflag],1 ; Was CPARSE called from COPY? - 32060 0000482A 751D jnz short anum_char ; No, don't add drive spec. - 32061 0000482C E8E5E1 call pathchrcmp ; Starts with a pathchar? - 32062 0000482F 7518 jnz short anum_char ; no - 32063 00004831 50 push ax - 32064 00004832 A0[079C] mov al,[CURDRV] ; Insert drive spec - 32065 ;add al,[CAPITAL_A] - 32066 ; 28/03/2023 - 32067 ; MSDOS 6.0 - 32068 00004835 0441 add al,'A' ; 41h - 32069 00004837 E82B01 call move_char - 32070 0000483A B03A mov al,':' ; 3Ah - 32071 0000483C E82601 call move_char - 32072 0000483F 58 pop ax - 32073 00004840 893E[F69E] mov [STARTEL],di - 32074 00004844 C606[F89E]00 mov byte [ELCNT],0 - 32075 anum_char: - 32076 ; 28/03/2023 - 32077 ; MSDOS 6.0 - 32078 00004849 E815DF call testkanj ;AC048 - 32079 0000484C 7406 jz short NOTKANJ ;AC048; - 32080 0000484E E81401 call move_char - 32081 00004851 AC lodsb - 32082 00004852 EB78 jmp short notspecial - 32083 - 32084 NOTKANJ: ;AN048; If not kanji - 32085 00004854 803E[A49D]01 cmp byte [cpyflag],1 ;AN048; and if we're in COPY - 32086 00004859 7503 jne short TESTDOT ;AN048; - 32087 0000485B E82DDF call UPCONV ;AN048; upper case the char - 32088 TESTDOT: - 32089 ; 28/03/2023 - 32090 ;cmp al,dot_chr ; 2Eh - 32091 0000485E 3C2E cmp al,'.' - 32092 00004860 7509 jne short testquest - 32093 00004862 FE06[F99E] inc byte [ELPOS] ; flag in extension - 32094 00004866 C606[F89E]FF mov byte [ELCNT],0FFh ; Store of the '.' resets it to 0 - 32095 testquest: - 32096 0000486B 3C3F cmp al,'?' ; 3Fh - 32097 0000486D 7503 jnz short testsplat - 32098 0000486F 80CF02 or bh,2 - 32099 testsplat: - 32100 ;cmp al,[STAR] - 32101 00004872 3C2A cmp al,star ; 2Ah - 32102 ; 27/04/2023 - 32103 ;cmp al,'*' - 32104 00004874 7530 jne short testpath - 32105 00004876 80CF02 or bh,2 - 32106 00004879 803E[329F]00 cmp byte [expand_star],0 - 32107 0000487E 7504 jne short expand_filename - 32108 00004880 EB24 jmp short testpath - 32109 - 32110 BADPERR2J: - 32111 ;jmp BADPERR2 - 32112 ; 28/03/2023 - 32113 ; MSDOS 6.0 - 32114 00004882 EB75 jmp short BADPERR2 - 32115 - 32116 expand_filename: - 32117 00004884 B407 mov ah,7 - 32118 00004886 803E[F99E]00 cmp byte [ELPOS],0 - 32119 0000488B 7402 jz short gotelcnt - 32120 0000488D B402 mov ah,2 - 32121 gotelcnt: - 32122 0000488F B03F mov al,'?' - 32123 00004891 2A26[F89E] sub ah,[ELCNT] - 32124 00004895 72EB jb short BADPERR2J - 32125 00004897 86E1 xchg ah,cl - 32126 00004899 E309 jcxz testpathx - 32127 qmove: - 32128 0000489B 86E1 xchg ah,cl - 32129 0000489D E8C500 call move_char - 32130 000048A0 86E1 xchg ah,cl - 32131 000048A2 E2F7 loop qmove - 32132 testpathx: - 32133 000048A4 86E1 xchg ah,cl - 32134 testpath: - 32135 000048A6 E86BE1 call pathchrcmp - 32136 000048A9 7521 jnz short notspecial - 32137 000048AB 80CF04 or bh,4 - 32138 000048AE 803E[329F]00 cmp byte [expand_star],0 - 32139 000048B3 7405 jz short no_err_check - 32140 000048B5 F6C702 test bh,2 ; If just hit a '/', cannot have ? or * yet - 32141 000048B8 7545 jnz short BADPERR - 32142 no_err_check: - 32143 000048BA 893E[F69E] mov [STARTEL],di ; New element - 32144 000048BE FF06[F69E] inc word [STARTEL] ; Point to char after / - 32145 000048C2 C606[F89E]FF mov byte [ELCNT],0FFh ; Store of '/' sets it to 0 - 32146 000048C7 C606[F99E]00 mov byte [ELPOS],0 - 32147 notspecial: - 32148 000048CC E89600 call move_char ; just an alphanum string - 32149 anum_test: - 32150 000048CF AC lodsb - 32151 - 32152 ; 28/03/2023 - 32153 ; MSDOS 6.0 - 32154 ; ----------------------------------- - 32155 ; Mod to avoid upper-case conversion. - 32156 ; ----------------------------------- - 32157 ; MSDOS 3.3 - 32158 ;cmp byte [CPYFLAG],1 ; 3/3/KK - 32159 ;jnz short cpcont3 ; 3/3/KK - 32160 ;call UPCONV_MAPCALL ; 3/3/KK - 32161 cpcont3: - 32162 ; ----------------------------------- - 32163 - 32164 000048D0 E8BBE0 call DELIM - 32165 000048D3 7435 jz short x_done - 32166 000048D5 3C0D cmp al,0Dh - 32167 000048D7 7431 je short x_done - 32168 000048D9 3A06[F99B] cmp al,[SWITCHAR] - 32169 000048DD 742B je short x_done - 32170 000048DF 38D8 cmp al,bl - 32171 000048E1 7427 je short x_done - 32172 000048E3 3C3A cmp al,':' ; ':' allowed as trailer because of devices - 32173 ; 28/03/2023 - 32174 ; MSDOS 3.3 - 32175 ;jnz short ANUM_CHARJ - 32176 ; MSDOS 6.0 - 32177 000048E5 7403 je short FOO15 - 32178 000048E7 E95FFF jmp anum_char - 32179 - 32180 ; Modification made for parseline. - 32181 ; Why would it be necessary to change colons to spaces? In this - 32182 ; case, EVERY colon is changed to a space; e.g., 'f:' yields 'f ', - 32183 ; but so does 'echo foo:bar' yield 'echo foo bar'. - 32184 - 32185 FOO15: - 32186 000048EA 803E[A49D]02 cmp byte [cpyflag],2 - 32187 000048EF 7505 jnz short cpcont4 - 32188 000048F1 E87100 call move_char - 32189 000048F4 EBD9 jmp short anum_test - 32190 cpcont4: - 32191 000048F6 46 inc si ; Skip the ':' - 32192 000048F7 EB11 jmp short x_done - 32193 - 32194 ; 28/03/2023 - 32195 ;ANUM_CHARJ: - 32196 ;jmp anum_char - 32197 - 32198 BADPERR2: - 32199 000048F9 BA[E88F] mov dx,BADCPMES_PTR - 32200 000048FC E927E4 jmp cerror - 32201 - 32202 BADPERR: - 32203 ; 28/03/2023 - 32204 ;jmp BADCDERR ; MSDOS 3.3 - 32205 BADCDERR: - 32206 ; MSDOS 6.0 - 32207 000048FF BA[3791] mov dx,badcd_ptr ;AC022; Issue "Invalid Directory" - 32208 00004902 E921E4 jmp cerror ;AC022; message - 32209 - 32210 cperror: - 32211 00004905 4E dec si ; adjust the pointer - 32212 00004906 5F pop di ; retrieve token buffer address - 32213 00004907 9D popf ; restore flags - 32214 00004908 F9 stc ; set the carry bit - 32215 00004909 C3 retn - 32216 - 32217 x_done: - 32218 0000490A 4E dec si ; adjust for next round + 31981 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 31982 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 4AE3h + 31983 + 31984 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 31985 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 49ABh + 31986 cparse: + 31987 000047A7 31C0 xor ax,ax + 31988 000047A9 893E[F69E] mov [STARTEL],di ; No path element (Is DI correct?) + 31989 000047AD A2[F99E] mov [ELPOS],al ; Start in 8 char prefix + 31990 ; MSDOS 3.3 + 31991 ;mov [SOURCE],al + 31992 ; MSDOS 6.0 + 31993 000047B0 A2[FA9E] mov [SKPDEL], al ; No skip delimiter yet + 31994 000047B3 88C7 mov bh,al ; Init nothing + 31995 000047B5 9C pushf ; save flags + 31996 000047B6 57 push di ; save the token buffer addrss + 31997 000047B7 31C9 xor cx,cx ; no chars in token buffer + 31998 000047B9 880E[959D] mov [comma],cl ; reset comma flag + 31999 moredelim: + 32000 000047BD AC lodsb + 32001 000047BE E8CDE1 call DELIM + 32002 000047C1 751D jnz short SCANCDONE + 32003 000047C3 3C20 cmp al,' ' + 32004 000047C5 74F6 jz short moredelim + 32005 000047C7 3C09 cmp al,9 + 32006 000047C9 74F2 jz short moredelim + 32007 ;xchg al,[SOURCE] + 32008 ; 28/03/2023 + 32009 000047CB 8606[FA9E] xchg al,[SKPDEL] + 32010 000047CF 08C0 or al,al + 32011 000047D1 74EA jz short moredelim ; One non space/tab delimiter allowed + 32012 000047D3 F6C780 test bh,80h ; has a special char been found? + 32013 000047D6 7405 jz short no_comma ; no - just exit + 32014 000047D8 C606[959D]01 mov byte [comma],1 ; set comma flag + 32015 no_comma: + 32016 000047DD E92A01 jmp x_done ; Nul argument + 32017 + 32018 SCANCDONE: + 32019 ; 28/03/2023 + 32020 ; MSDOS 6.0 + 32021 ; ----------------------------------- + 32022 ; Mod to avoid upper-case conversion. + 32023 ; ----------------------------------- + 32024 ; MSDOS 3.3 + 32025 ;cmp byte [CPYFLAG],1 ; 3/3/KK + 32026 ;jnz short cpcont1 ; 3/3/KK + 32027 ;call UPCONV_MAPCALL ; 3/3/KK + 32028 cpcont1: + 32029 ; ----------------------------------- + 32030 ; 28/03/2023 + 32031 000047E0 38D8 cmp al,bl ; Special delimiter? + 32032 000047E2 7505 jne short nospec + 32033 000047E4 80CF80 or bh,80h + 32034 000047E7 EBD4 jmp short moredelim + 32035 nospec: + 32036 000047E9 3C0D cmp al,0Dh ; a CR? + 32037 000047EB 7503 jne short ncperror + 32038 000047ED E91501 jmp cperror + 32039 ncperror: + 32040 000047F0 3A06[F99B] cmp al,[SWITCHAR] ; is the char the switch char? + 32041 000047F4 7503 jne short na_switch ; yes, process... + 32042 000047F6 E91401 jmp a_switch + 32043 na_switch: + 32044 000047F9 B23A mov dl,':' + 32045 000047FB 3814 cmp [si],dl + 32046 000047FD 751D jne short anum_chard ; Drive not specified + 32047 ; 28/03/2023 + 32048 ; MSDOS 6.0 + 32049 000047FF 803E[A49D]01 cmp byte [cpyflag],1 ; 3/3/KK + 32050 00004804 7503 jne short cpcont2 ; 3/3/KK + 32051 00004806 E882DF call UPCONV ; 3/3/KK + 32052 cpcont2: + 32053 00004809 E85901 call move_char + 32054 0000480C AC lodsb ; Get the ':' + 32055 0000480D E85501 call move_char + 32056 00004810 893E[F69E] mov [STARTEL],di + 32057 00004814 C606[F89E]00 mov byte [ELCNT],0 + 32058 00004819 E9B300 jmp anum_test + 32059 anum_chard: + 32060 0000481C 893E[F69E] mov [STARTEL],di + 32061 00004820 C606[F89E]00 mov byte [ELCNT],0 ; Store of this char sets it to one + 32062 00004825 803E[A49D]01 cmp byte [cpyflag],1 ; Was CPARSE called from COPY? + 32063 0000482A 751D jnz short anum_char ; No, don't add drive spec. + 32064 0000482C E8E5E1 call pathchrcmp ; Starts with a pathchar? + 32065 0000482F 7518 jnz short anum_char ; no + 32066 00004831 50 push ax + 32067 00004832 A0[079C] mov al,[CURDRV] ; Insert drive spec + 32068 ;add al,[CAPITAL_A] + 32069 ; 28/03/2023 + 32070 ; MSDOS 6.0 + 32071 00004835 0441 add al,'A' ; 41h + 32072 00004837 E82B01 call move_char + 32073 0000483A B03A mov al,':' ; 3Ah + 32074 0000483C E82601 call move_char + 32075 0000483F 58 pop ax + 32076 00004840 893E[F69E] mov [STARTEL],di + 32077 00004844 C606[F89E]00 mov byte [ELCNT],0 + 32078 anum_char: + 32079 ; 28/03/2023 + 32080 ; MSDOS 6.0 + 32081 00004849 E815DF call testkanj ;AC048 + 32082 0000484C 7406 jz short NOTKANJ ;AC048; + 32083 0000484E E81401 call move_char + 32084 00004851 AC lodsb + 32085 00004852 EB78 jmp short notspecial + 32086 + 32087 NOTKANJ: ;AN048; If not kanji + 32088 00004854 803E[A49D]01 cmp byte [cpyflag],1 ;AN048; and if we're in COPY + 32089 00004859 7503 jne short TESTDOT ;AN048; + 32090 0000485B E82DDF call UPCONV ;AN048; upper case the char + 32091 TESTDOT: + 32092 ; 28/03/2023 + 32093 ;cmp al,dot_chr ; 2Eh + 32094 0000485E 3C2E cmp al,'.' + 32095 00004860 7509 jne short testquest + 32096 00004862 FE06[F99E] inc byte [ELPOS] ; flag in extension + 32097 00004866 C606[F89E]FF mov byte [ELCNT],0FFh ; Store of the '.' resets it to 0 + 32098 testquest: + 32099 0000486B 3C3F cmp al,'?' ; 3Fh + 32100 0000486D 7503 jnz short testsplat + 32101 0000486F 80CF02 or bh,2 + 32102 testsplat: + 32103 ;cmp al,[STAR] + 32104 00004872 3C2A cmp al,star ; 2Ah + 32105 ; 27/04/2023 + 32106 ;cmp al,'*' + 32107 00004874 7530 jne short testpath + 32108 00004876 80CF02 or bh,2 + 32109 00004879 803E[329F]00 cmp byte [expand_star],0 + 32110 0000487E 7504 jne short expand_filename + 32111 00004880 EB24 jmp short testpath + 32112 + 32113 BADPERR2J: + 32114 ;jmp BADPERR2 + 32115 ; 28/03/2023 + 32116 ; MSDOS 6.0 + 32117 00004882 EB75 jmp short BADPERR2 + 32118 + 32119 expand_filename: + 32120 00004884 B407 mov ah,7 + 32121 00004886 803E[F99E]00 cmp byte [ELPOS],0 + 32122 0000488B 7402 jz short gotelcnt + 32123 0000488D B402 mov ah,2 + 32124 gotelcnt: + 32125 0000488F B03F mov al,'?' + 32126 00004891 2A26[F89E] sub ah,[ELCNT] + 32127 00004895 72EB jb short BADPERR2J + 32128 00004897 86E1 xchg ah,cl + 32129 00004899 E309 jcxz testpathx + 32130 qmove: + 32131 0000489B 86E1 xchg ah,cl + 32132 0000489D E8C500 call move_char + 32133 000048A0 86E1 xchg ah,cl + 32134 000048A2 E2F7 loop qmove + 32135 testpathx: + 32136 000048A4 86E1 xchg ah,cl + 32137 testpath: + 32138 000048A6 E86BE1 call pathchrcmp + 32139 000048A9 7521 jnz short notspecial + 32140 000048AB 80CF04 or bh,4 + 32141 000048AE 803E[329F]00 cmp byte [expand_star],0 + 32142 000048B3 7405 jz short no_err_check + 32143 000048B5 F6C702 test bh,2 ; If just hit a '/', cannot have ? or * yet + 32144 000048B8 7545 jnz short BADPERR + 32145 no_err_check: + 32146 000048BA 893E[F69E] mov [STARTEL],di ; New element + 32147 000048BE FF06[F69E] inc word [STARTEL] ; Point to char after / + 32148 000048C2 C606[F89E]FF mov byte [ELCNT],0FFh ; Store of '/' sets it to 0 + 32149 000048C7 C606[F99E]00 mov byte [ELPOS],0 + 32150 notspecial: + 32151 000048CC E89600 call move_char ; just an alphanum string + 32152 anum_test: + 32153 000048CF AC lodsb + 32154 + 32155 ; 28/03/2023 + 32156 ; MSDOS 6.0 + 32157 ; ----------------------------------- + 32158 ; Mod to avoid upper-case conversion. + 32159 ; ----------------------------------- + 32160 ; MSDOS 3.3 + 32161 ;cmp byte [CPYFLAG],1 ; 3/3/KK + 32162 ;jnz short cpcont3 ; 3/3/KK + 32163 ;call UPCONV_MAPCALL ; 3/3/KK + 32164 cpcont3: + 32165 ; ----------------------------------- + 32166 + 32167 000048D0 E8BBE0 call DELIM + 32168 000048D3 7435 jz short x_done + 32169 000048D5 3C0D cmp al,0Dh + 32170 000048D7 7431 je short x_done + 32171 000048D9 3A06[F99B] cmp al,[SWITCHAR] + 32172 000048DD 742B je short x_done + 32173 000048DF 38D8 cmp al,bl + 32174 000048E1 7427 je short x_done + 32175 000048E3 3C3A cmp al,':' ; ':' allowed as trailer because of devices + 32176 ; 28/03/2023 + 32177 ; MSDOS 3.3 + 32178 ;jnz short ANUM_CHARJ + 32179 ; MSDOS 6.0 + 32180 000048E5 7403 je short FOO15 + 32181 000048E7 E95FFF jmp anum_char + 32182 + 32183 ; Modification made for parseline. + 32184 ; Why would it be necessary to change colons to spaces? In this + 32185 ; case, EVERY colon is changed to a space; e.g., 'f:' yields 'f ', + 32186 ; but so does 'echo foo:bar' yield 'echo foo bar'. + 32187 + 32188 FOO15: + 32189 000048EA 803E[A49D]02 cmp byte [cpyflag],2 + 32190 000048EF 7505 jnz short cpcont4 + 32191 000048F1 E87100 call move_char + 32192 000048F4 EBD9 jmp short anum_test + 32193 cpcont4: + 32194 000048F6 46 inc si ; Skip the ':' + 32195 000048F7 EB11 jmp short x_done + 32196 + 32197 ; 28/03/2023 + 32198 ;ANUM_CHARJ: + 32199 ;jmp anum_char + 32200 + 32201 BADPERR2: + 32202 000048F9 BA[E88F] mov dx,BADCPMES_PTR + 32203 000048FC E927E4 jmp cerror + 32204 + 32205 BADPERR: + 32206 ; 28/03/2023 + 32207 ;jmp BADCDERR ; MSDOS 3.3 + 32208 BADCDERR: + 32209 ; MSDOS 6.0 + 32210 000048FF BA[3791] mov dx,badcd_ptr ;AC022; Issue "Invalid Directory" + 32211 00004902 E921E4 jmp cerror ;AC022; message + 32212 + 32213 cperror: + 32214 00004905 4E dec si ; adjust the pointer + 32215 00004906 5F pop di ; retrieve token buffer address + 32216 00004907 9D popf ; restore flags + 32217 00004908 F9 stc ; set the carry bit + 32218 00004909 C3 retn 32219 - 32220 ; Mod to recognize right and left parens as integral tokens. - 32221 ;x_done2: - 32222 0000490B EB51 jmp short out_token - 32223 - 32224 a_switch: - 32225 0000490D 80CF01 or bh,1 ; Indicate switch - 32226 ;or bp,FSWITCH ; 8000h - 32227 ; 28/03/2023 - 32228 00004910 81CD0080 or bp,8000h - 32229 00004914 E86FE0 call scanoff - 32230 00004917 46 inc si - 32231 ; 28/03/2023 - 32232 ; MSDOS 6.0 - 32233 00004918 E846DE call testkanj ;AN057; See if DBCS lead byte - 32234 0000491B 740D jz short a_switch_notkanj ;AN057; no - continue processing - 32235 0000491D E84500 call move_char ;AN057; DBCS - store first byte - 32236 00004920 AC lodsb ;AN057; get second byte - 32237 00004921 E84100 call move_char ;AN057; store second byte - 32238 ;or bp,FBADSWITCH ; 4000h ;AN057; DBCS switch is invalid - 32239 00004924 81CD0040 or bp,4000h - 32240 00004928 EB34 jmp short out_token ;AN057; don't bother checking switch - 32241 a_switch_notkanj: ;AN057; - 32242 0000492A 3C0D cmp al,0Dh - 32243 0000492C 7509 jne short Store_swt - 32244 0000492E B000 mov al,0 - 32245 00004930 AA stosb - 32246 ;or bp,FBADSWITCH ; 4000h - 32247 00004931 81CD0040 or bp,4000h - 32248 00004935 EBCE jmp short cperror ; Trailing switch character error - 32249 ; BP = fSwitch but no switch - 32250 ; bit is set (unknown switch) - 32251 Store_swt: - 32252 00004937 E82B00 call move_char ; store the character - 32253 - 32254 ; This upconv call must stay. It is used to identify copy-switches - 32255 ; on the command line, and won't store anything into the output buffer. + 32220 x_done: + 32221 0000490A 4E dec si ; adjust for next round + 32222 + 32223 ; Mod to recognize right and left parens as integral tokens. + 32224 ;x_done2: + 32225 0000490B EB51 jmp short out_token + 32226 + 32227 a_switch: + 32228 0000490D 80CF01 or bh,1 ; Indicate switch + 32229 ;or bp,FSWITCH ; 8000h + 32230 ; 28/03/2023 + 32231 00004910 81CD0080 or bp,8000h + 32232 00004914 E86FE0 call scanoff + 32233 00004917 46 inc si + 32234 ; 28/03/2023 + 32235 ; MSDOS 6.0 + 32236 00004918 E846DE call testkanj ;AN057; See if DBCS lead byte + 32237 0000491B 740D jz short a_switch_notkanj ;AN057; no - continue processing + 32238 0000491D E84500 call move_char ;AN057; DBCS - store first byte + 32239 00004920 AC lodsb ;AN057; get second byte + 32240 00004921 E84100 call move_char ;AN057; store second byte + 32241 ;or bp,FBADSWITCH ; 4000h ;AN057; DBCS switch is invalid + 32242 00004924 81CD0040 or bp,4000h + 32243 00004928 EB34 jmp short out_token ;AN057; don't bother checking switch + 32244 a_switch_notkanj: ;AN057; + 32245 0000492A 3C0D cmp al,0Dh + 32246 0000492C 7509 jne short Store_swt + 32247 0000492E B000 mov al,0 + 32248 00004930 AA stosb + 32249 ;or bp,FBADSWITCH ; 4000h + 32250 00004931 81CD0040 or bp,4000h + 32251 00004935 EBCE jmp short cperror ; Trailing switch character error + 32252 ; BP = fSwitch but no switch + 32253 ; bit is set (unknown switch) + 32254 Store_swt: + 32255 00004937 E82B00 call move_char ; store the character 32256 - 32257 ;call UPCONV_MAPCALL ; MSDOS 3.3 (Retro DOS 3.0) - 32258 ; 28/03/2023 - 32259 0000493A E84EDE call UPCONV ; MSDOS 6.0 & MSDOS 5.0 (Retro DOS 4.0) - 32260 - 32261 0000493D 06 push es - 32262 0000493E 57 push di - 32263 0000493F 51 push cx - 32264 00004940 0E push cs - 32265 00004941 07 pop es - 32266 ; 28/03/2023 - 32267 ; MSDOS 3.3 - 32268 ;;mov di,SWITCH_LIST ; "VBAPW" - 32269 ; MSDOS 6.0 - 32270 ;mov di,switch_list ; "?VBAPW" - 32271 ; 14/06/*2023 - 32272 ; MSDOS 6.22 - 32273 00004942 BF[D095] mov di,switch_list ; "-Y?VBAPW" - 32274 - 32275 ; MSDOS 3.3 - 32276 ;mov cx,SWCOUNT ; 5 - 32277 ; MSDOS 6.0 - 32278 ;mov cx,6 ; SWCOUNT = 6 - 32279 ; 14/06/2023 - 32280 ; MSDOS 6.22 - 32281 00004945 B90800 mov cx,8 ; SWCOUNT = 8 - 32282 - 32283 ;or bp,FBADSWITCH ; 4000h - 32284 00004948 81CD0040 or bp,4000h - 32285 0000494C F2AE repne scasb - 32286 0000494E 750B jnz short out_tokenp - 32287 ;and bp,~FBADSWITCH ; 0BFFFh - 32288 00004950 81E5FFBF and bp,0BFFFh - 32289 00004954 B80100 mov ax,1 - 32290 00004957 D3E0 shl ax,cl - 32291 00004959 09C5 or bp,ax - 32292 out_tokenp: - 32293 0000495B 59 pop cx - 32294 0000495C 5F pop di - 32295 0000495D 07 pop es - 32296 out_token: - 32297 0000495E B000 mov al,0 ; null at the end - 32298 00004960 AA stosb - 32299 00004961 5F pop di ; restore token buffer pointer - 32300 00004962 9D popf - 32301 00004963 F8 clc ; clear carry flag - 32302 00004964 C3 retn - 32303 - 32304 ; =============== S U B R O U T I N E ======================================= - 32305 - 32306 ; 28/03/2023 - 32307 move_char: - 32308 00004965 AA stosb ; store char in token buffer - 32309 00004966 41 inc cx ; increment char count - 32310 00004967 FE06[F89E] inc byte [ELCNT] ; increment element count for * substi - 32311 0000496B C3 retn - 32312 - 32313 ;============================================================================ - 32314 ; PARSE.ASM, MSDOS 6.0, 1991 - 32315 ;============================================================================ - 32316 ; 29/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 32317 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 32318 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 32319 - 32320 ; ----------------------------- - 32321 ; (PSDATA.INC, MSDOS 6.0, 1991) - 32322 ; ----------------------------- - 32323 - 32324 ;**** Equation field - 32325 ;-------- Character code definition + 32257 ; This upconv call must stay. It is used to identify copy-switches + 32258 ; on the command line, and won't store anything into the output buffer. + 32259 + 32260 ;call UPCONV_MAPCALL ; MSDOS 3.3 (Retro DOS 3.0) + 32261 ; 28/03/2023 + 32262 0000493A E84EDE call UPCONV ; MSDOS 6.0 & MSDOS 5.0 (Retro DOS 4.0) + 32263 + 32264 0000493D 06 push es + 32265 0000493E 57 push di + 32266 0000493F 51 push cx + 32267 00004940 0E push cs + 32268 00004941 07 pop es + 32269 ; 28/03/2023 + 32270 ; MSDOS 3.3 + 32271 ;;mov di,SWITCH_LIST ; "VBAPW" + 32272 ; MSDOS 6.0 + 32273 ;mov di,switch_list ; "?VBAPW" + 32274 ; 14/06/*2023 + 32275 ; MSDOS 6.22 + 32276 00004942 BF[D095] mov di,switch_list ; "-Y?VBAPW" + 32277 + 32278 ; MSDOS 3.3 + 32279 ;mov cx,SWCOUNT ; 5 + 32280 ; MSDOS 6.0 + 32281 ;mov cx,6 ; SWCOUNT = 6 + 32282 ; 14/06/2023 + 32283 ; MSDOS 6.22 + 32284 00004945 B90800 mov cx,8 ; SWCOUNT = 8 + 32285 + 32286 ;or bp,FBADSWITCH ; 4000h + 32287 00004948 81CD0040 or bp,4000h + 32288 0000494C F2AE repne scasb + 32289 0000494E 750B jnz short out_tokenp + 32290 ;and bp,~FBADSWITCH ; 0BFFFh + 32291 00004950 81E5FFBF and bp,0BFFFh + 32292 00004954 B80100 mov ax,1 + 32293 00004957 D3E0 shl ax,cl + 32294 00004959 09C5 or bp,ax + 32295 out_tokenp: + 32296 0000495B 59 pop cx + 32297 0000495C 5F pop di + 32298 0000495D 07 pop es + 32299 out_token: + 32300 0000495E B000 mov al,0 ; null at the end + 32301 00004960 AA stosb + 32302 00004961 5F pop di ; restore token buffer pointer + 32303 00004962 9D popf + 32304 00004963 F8 clc ; clear carry flag + 32305 00004964 C3 retn + 32306 + 32307 ; =============== S U B R O U T I N E ======================================= + 32308 + 32309 ; 28/03/2023 + 32310 move_char: + 32311 00004965 AA stosb ; store char in token buffer + 32312 00004966 41 inc cx ; increment char count + 32313 00004967 FE06[F89E] inc byte [ELCNT] ; increment element count for * substi + 32314 0000496B C3 retn + 32315 + 32316 ;============================================================================ + 32317 ; PARSE.ASM, MSDOS 6.0, 1991 + 32318 ;============================================================================ + 32319 ; 29/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 32320 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 32321 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 32322 + 32323 ; ----------------------------- + 32324 ; (PSDATA.INC, MSDOS 6.0, 1991) + 32325 ; ----------------------------- 32326 - 32327 $P_DBSP1 equ 20h ; DB_SP_HI ;AN000; 1st byte of DBCS blank - 32328 $P_DBSP2 equ 20h ; DB_SP_LO ;AN000; 2nd byte of DBCS blank - 32329 $P_Period equ "." ;AN020; - 32330 $P_Slash equ "/" ;AN020; - 32331 $P_Space equ " " ;AN000; SBCS blank - 32332 $P_Comma equ "," ;AN000; - 32333 $P_Switch equ "/" ;AN000; - 32334 $P_Keyword equ "=" ;AN000; - 32335 $P_Colon equ ":" ;AN000; - 32336 $P_Plus equ "+" ;AN000; - 32337 $P_Minus equ "-" ;AN000; - 32338 $P_Rparen equ ")" ;AN000; - 32339 $P_Lparen equ "(" ;AN000; - 32340 ;(deleted ;AN025;) $P_SQuote equ "'" - 32341 $P_DQuote equ '"' ;AN000; - 32342 $P_NULL equ 0 ;AN000; - 32343 $P_TAB equ 9 ;AN000; - 32344 $P_CR equ 0Dh ;AN000; - 32345 $P_LF equ 0Ah ;AN000; - 32346 $P_ASCII80 equ 80h ;AN000; ASCII 80h character code - 32347 - 32348 $P_DOSTBL_File equ 4 ;AN000; get file uppercase table - 32349 $P_DOSTBL_Char equ 2 ;AN000; get character uppercase table + 32327 ;**** Equation field + 32328 ;-------- Character code definition + 32329 + 32330 $P_DBSP1 equ 20h ; DB_SP_HI ;AN000; 1st byte of DBCS blank + 32331 $P_DBSP2 equ 20h ; DB_SP_LO ;AN000; 2nd byte of DBCS blank + 32332 $P_Period equ "." ;AN020; + 32333 $P_Slash equ "/" ;AN020; + 32334 $P_Space equ " " ;AN000; SBCS blank + 32335 $P_Comma equ "," ;AN000; + 32336 $P_Switch equ "/" ;AN000; + 32337 $P_Keyword equ "=" ;AN000; + 32338 $P_Colon equ ":" ;AN000; + 32339 $P_Plus equ "+" ;AN000; + 32340 $P_Minus equ "-" ;AN000; + 32341 $P_Rparen equ ")" ;AN000; + 32342 $P_Lparen equ "(" ;AN000; + 32343 ;(deleted ;AN025;) $P_SQuote equ "'" + 32344 $P_DQuote equ '"' ;AN000; + 32345 $P_NULL equ 0 ;AN000; + 32346 $P_TAB equ 9 ;AN000; + 32347 $P_CR equ 0Dh ;AN000; + 32348 $P_LF equ 0Ah ;AN000; + 32349 $P_ASCII80 equ 80h ;AN000; ASCII 80h character code 32350 - 32351 $P_error_filespec equ 1 - 32352 - 32353 ;---------------------------------------------------------------------------- - 32354 ; PARMS LABEL BYTE - 32355 ; DW PARMSX - 32356 ; DB 2 ; NUMBER OF STRINGS (0, 1, 2) - 32357 ; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE - 32358 ; DB " .. " ; EXTRA DELIMITER LIST, - 32359 ; ; TYPICAL ARE ";", "=" - 32360 ; ; "," & WHITESPACE ALWAYS - 32361 ; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE - 32362 ; DB " .. " ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS - 32363 ;---------------------------------------------------------------------------- - 32364 - 32365 struc $P_PARMS_BLK ;AN000; - 32366 00000000 ???? .$P_PARMSX_Address: resw 1 ;AN000; Address of PARMSX - 32367 00000002 ?? .$P_Num_Extra: resb 1 ;AN000; Number of extra stuff - 32368 00000003 ?? .$P_Len_Extra_Delim: resb 1 ;AN000; Length of extra delimiter - 32369 endstruc ;AN000; - 32370 - 32371 $P_Len_PARMS equ 4 ;AN000; - 32372 $P_I_Use_Default equ 0 ;AN000; no extra stuff specified - 32373 $P_I_Have_Delim equ 1 ;AN000; extra delimiter specified - 32374 $P_I_Have_EOL equ 2 ;AN000; extra EOL specified - 32375 - 32376 ;---------------------------------------------------------------------------- - 32377 ; PARMSX LABEL BYTE - 32378 ; DB minp,maxp ; MIN, MAX POSITIONAL OPERANDS ALLOWED - 32379 ; DW CONTROL ; DESCRIPTION OF POSITIONAL 1 - 32380 ; : ; REPEATS maxp-1 TIMES - 32381 ; DB maxs ; # OF SWITCHES - 32382 ; DW CONTROL ; DESCRIPTION OF SWITCH 1 - 32383 ; : ; REPEATS maxs-1 TIMES - 32384 ; DB maxk ; # OF KEYWORD - 32385 ; DW CONTROL ; DESCRIPTION OF KEYWORD 1 - 32386 ; : ; REPEATS maxk-1 TIMES - 32387 ;---------------------------------------------------------------------------- - 32388 - 32389 struc $P_PARMSX_BLK ;AN000; - 32390 00000000 ?? .$P_MinP: resb 1 ; 27/04/2023 ;AN000; Minimum positional number - 32391 00000001 ?? .$P_MaxP: resb 1 ;AN000; Maximum positional number - 32392 00000002 ?? .$P_1st_Control: resb 1 ;AN000; Address of the 1st CONTROL block - 32393 endstruc ;AN000; - 32394 - 32395 ; 31/03/2023 - 32396 ;---------------------------------------------------------------------------- - 32397 ; << Control field definition >> - 32398 ; - 32399 ;CONTROL LABEL BYTE - 32400 ; DW MATCH_FLAGS ; CONTROLS TYPE MATCHED - 32401 ; ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED) - 32402 ; ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED) - 32403 ; ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED) - 32404 ; ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED) - 32405 ; ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED) - 32406 ; ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED) - 32407 ; ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED) - 32408 ; ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED) - 32409 ; ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED) - 32410 ; ; 0010H=IGNORE ":" AT END IN MATCH - 32411 ; ; 0002H=REPEATS ALLOWED - 32412 ; ; 0001H=OPTIONAL - 32413 ; DW FUNCTION_FLAGS - 32414 ; ; 0001H=CAP RESULT BY FILE TABLE - 32415 ; ; 0002H=CAP RESULT BY CHAR TABLE - 32416 ; ; 0010H=REMOVE ":" AT END - 32417 ; (tm10) ; 0020H=colon is not necessary for switch - 32418 ; - 32419 ; DW RESULT ; RESULT BUFFER - 32420 ; DW VALUES ; VALUE LISTS - 32421 ; DB nid ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST - 32422 ; DB "...",0 ; IF n >0, KEYWORD 1 - 32423 ; : - 32424 ; - 32425 ;Note: - 32426 ; - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and - 32427 ; DATE bit simalteniously. - 32428 ; - 32429 ; The parser examins each bit along with the following priority. - 32430 ; - 32431 ; COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE -> - 32432 ; FILE SPEC -> SIMPLE STRING. + 32351 $P_DOSTBL_File equ 4 ;AN000; get file uppercase table + 32352 $P_DOSTBL_Char equ 2 ;AN000; get character uppercase table + 32353 + 32354 $P_error_filespec equ 1 + 32355 + 32356 ;---------------------------------------------------------------------------- + 32357 ; PARMS LABEL BYTE + 32358 ; DW PARMSX + 32359 ; DB 2 ; NUMBER OF STRINGS (0, 1, 2) + 32360 ; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE + 32361 ; DB " .. " ; EXTRA DELIMITER LIST, + 32362 ; ; TYPICAL ARE ";", "=" + 32363 ; ; "," & WHITESPACE ALWAYS + 32364 ; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE + 32365 ; DB " .. " ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS + 32366 ;---------------------------------------------------------------------------- + 32367 + 32368 struc $P_PARMS_BLK ;AN000; + 32369 00000000 ???? .$P_PARMSX_Address: resw 1 ;AN000; Address of PARMSX + 32370 00000002 ?? .$P_Num_Extra: resb 1 ;AN000; Number of extra stuff + 32371 00000003 ?? .$P_Len_Extra_Delim: resb 1 ;AN000; Length of extra delimiter + 32372 endstruc ;AN000; + 32373 + 32374 $P_Len_PARMS equ 4 ;AN000; + 32375 $P_I_Use_Default equ 0 ;AN000; no extra stuff specified + 32376 $P_I_Have_Delim equ 1 ;AN000; extra delimiter specified + 32377 $P_I_Have_EOL equ 2 ;AN000; extra EOL specified + 32378 + 32379 ;---------------------------------------------------------------------------- + 32380 ; PARMSX LABEL BYTE + 32381 ; DB minp,maxp ; MIN, MAX POSITIONAL OPERANDS ALLOWED + 32382 ; DW CONTROL ; DESCRIPTION OF POSITIONAL 1 + 32383 ; : ; REPEATS maxp-1 TIMES + 32384 ; DB maxs ; # OF SWITCHES + 32385 ; DW CONTROL ; DESCRIPTION OF SWITCH 1 + 32386 ; : ; REPEATS maxs-1 TIMES + 32387 ; DB maxk ; # OF KEYWORD + 32388 ; DW CONTROL ; DESCRIPTION OF KEYWORD 1 + 32389 ; : ; REPEATS maxk-1 TIMES + 32390 ;---------------------------------------------------------------------------- + 32391 + 32392 struc $P_PARMSX_BLK ;AN000; + 32393 00000000 ?? .$P_MinP: resb 1 ; 27/04/2023 ;AN000; Minimum positional number + 32394 00000001 ?? .$P_MaxP: resb 1 ;AN000; Maximum positional number + 32395 00000002 ?? .$P_1st_Control: resb 1 ;AN000; Address of the 1st CONTROL block + 32396 endstruc ;AN000; + 32397 + 32398 ; 31/03/2023 + 32399 ;---------------------------------------------------------------------------- + 32400 ; << Control field definition >> + 32401 ; + 32402 ;CONTROL LABEL BYTE + 32403 ; DW MATCH_FLAGS ; CONTROLS TYPE MATCHED + 32404 ; ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED) + 32405 ; ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED) + 32406 ; ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED) + 32407 ; ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED) + 32408 ; ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED) + 32409 ; ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED) + 32410 ; ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED) + 32411 ; ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED) + 32412 ; ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED) + 32413 ; ; 0010H=IGNORE ":" AT END IN MATCH + 32414 ; ; 0002H=REPEATS ALLOWED + 32415 ; ; 0001H=OPTIONAL + 32416 ; DW FUNCTION_FLAGS + 32417 ; ; 0001H=CAP RESULT BY FILE TABLE + 32418 ; ; 0002H=CAP RESULT BY CHAR TABLE + 32419 ; ; 0010H=REMOVE ":" AT END + 32420 ; (tm10) ; 0020H=colon is not necessary for switch + 32421 ; + 32422 ; DW RESULT ; RESULT BUFFER + 32423 ; DW VALUES ; VALUE LISTS + 32424 ; DB nid ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST + 32425 ; DB "...",0 ; IF n >0, KEYWORD 1 + 32426 ; : + 32427 ; + 32428 ;Note: + 32429 ; - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and + 32430 ; DATE bit simalteniously. + 32431 ; + 32432 ; The parser examins each bit along with the following priority. 32433 ; - 32434 ; - 32435 ; - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer - 32436 ; in the result buffer is capitalized. + 32434 ; COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE -> + 32435 ; FILE SPEC -> SIMPLE STRING. + 32436 ; 32437 ; - 32438 ; - Match_Flags 0001H and 0002H have meaning only for the positional. - 32439 ; + 32438 ; - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer + 32439 ; in the result buffer is capitalized. 32440 ; - 32441 ; - The "...",0 (bottom most line) does require '=' or '/'. When you need a - 32442 ; switch, for example, '/A', then STRING points to; + 32441 ; - Match_Flags 0001H and 0002H have meaning only for the positional. + 32442 ; 32443 ; - 32444 ; DB 1 ; number of following synonyms - 32445 ; DB '/A',0 + 32444 ; - The "...",0 (bottom most line) does require '=' or '/'. When you need a + 32445 ; switch, for example, '/A', then STRING points to; 32446 ; - 32447 ; When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be; - 32448 ; - 32449 ; DB 1 ; number of following synonyms - 32450 ; DB 'CODEPAGE=',0 + 32447 ; DB 1 ; number of following synonyms + 32448 ; DB '/A',0 + 32449 ; + 32450 ; When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be; 32451 ; - 32452 ; - 32453 ; - "..." must consist of upper case characters only because the parser - 32454 ; performs pattern matching after converting input to upper case (by - 32455 ; using the current country upper case table) - 32456 ; - 32457 ; - 32458 ; - One "..." can contain only one switch or keyword. If you need, for - 32459 ; example /A and /B, the format will be; + 32452 ; DB 1 ; number of following synonyms + 32453 ; DB 'CODEPAGE=',0 + 32454 ; + 32455 ; + 32456 ; - "..." must consist of upper case characters only because the parser + 32457 ; performs pattern matching after converting input to upper case (by + 32458 ; using the current country upper case table) + 32459 ; 32460 ; - 32461 ; DB 2 ; number of following synonyms - 32462 ; DB '/A',0 - 32463 ; DB '/B',0 - 32464 ;---------------------------------------------------------------------------- - 32465 - 32466 ;**** Match_Flags - 32467 - 32468 $P_Num_Val equ 8000h ;AN000; Numeric Value - 32469 $P_SNum_Val equ 4000h ;AN000; Signed numeric value - 32470 $P_Simple_S equ 2000h ;AN000; Simple string - 32471 $P_Date_S equ 1000h ;AN000; Date string - 32472 $P_Time_S equ 0800h ;AN000; Time string - 32473 $P_Cmpx_S equ 0400h ;AN000; Complex string - 32474 $P_File_Spc equ 0200h ;AN000; File Spec - 32475 $P_Drv_Only equ 0100h ;AN000; Drive Only - 32476 $P_Qu_String equ 0080h ;AN000; Quoted string - 32477 $P_Ig_Colon equ 0010h ;AN000; Ignore colon at end in match - 32478 $P_Repeat equ 0002h ;AN000; Repeat allowed - 32479 $P_Optional equ 0001h ;AN000; Optional - 32480 - 32481 ;**** Function flags - 32482 - 32483 $P_CAP_File equ 0001h ;AN000; CAP result by file table - 32484 $P_CAP_Char equ 0002h ;AN000; CAP result by character table - 32485 $P_Rm_Colon equ 0010h ;AN000; Remove ":" at the end - 32486 $P_colon_is_not_necessary equ 0020h ;AN000;(tm10) /+10 and /+:10 - 32487 - 32488 ;-------------------------------- Control block structure - 32489 struc $P_CONTROL_BLK - 32490 00000000 ???? .$P_Match_Flag: resw 1 ;AN000; Controls type matched - 32491 00000002 ???? .$P_Function_Flag: resw 1 ;AN000; Function should be taken - 32492 00000004 ???? .$P_Result_Buf: resw 1 ;AN000; Result buffer address - 32493 00000006 ???? .$P_Value_List: resw 1 ;AN000; Value list address - 32494 00000008 ?? .$P_nid: resb 1 ;AN000; # of keyword/SW synonyms - 32495 00000009 ?? .$P_KEYorSW: resb 1 ;AN000; keyword or sw - 32496 endstruc - 32497 - 32498 ; 31/03/2023 - 32499 ;---------------------------------------------------------------------------- - 32500 ; - 32501 ;VALUES LABEL BYTE - 32502 ; DB nval ; NUMBER OF VALUE DEFINITIONS (0 - 3) - 32503 ; +- - 32504 ; | DB nrng ; NUMBER OF RANGES - 32505 ; | +DB ITEM_TAG ; RETURN VALUE IF RANGE MATCHED - 32506 ; | +DD X,Y ; RANGE OF VALUES - 32507 ; | : - 32508 ; | DB nnval ; NUMBER OF CHOICES - 32509 ; | +DB ITEM_TAG ; RETURN VALUE IF NUMBER CHOICE MATCHED - 32510 ; | +DD VALUE ; SPECIFIC CHOICE IF NUMBER - 32511 ; | : - 32512 ; | DB nstrval ; NUMBER OF CHOICES - 32513 ; | +DB ITEM_TAG ; RETURN VALUE IF STRING CHOICE MATCHED - 32514 ; | +DW STRING ; SPECIFIC CHOICE IF STING - 32515 ; +- : - 32516 ; - 32517 ;STRING DB "...",0 ; ASCIIZ STRING IMAGE - 32518 ; - 32519 ;Note: - 32520 ; - ITEM_TAG must not be 0FFH, which will be used in the result buffer - 32521 ; when no choice lists are provided. - 32522 ; - 32523 ; - STRING must consist of upper case characters only because the parser - 32524 ; performs pattern matching after converting input to upper case (by - 32525 ; using the current country upper case table) - 32526 ;---------------------------------------------------------------------------- - 32527 - 32528 $P_nval_None equ 0 ;AN000; no value list ID - 32529 $P_nval_Range equ 1 ;AN000; range list ID - 32530 $P_nval_Value equ 2 ;AN000; value list ID - 32531 $P_nval_String equ 3 ;AN000; string list ID - 32532 $P_Len_Range equ 9 ;AN000; Length of a range choice(two DD plus one DB) - 32533 $P_Len_Value equ 5 ;AN000; Length of a value choice(one DD plus one DB) - 32534 $P_Len_String equ 3 ;AN000; Length of a string choice(one DW plus one DB) - 32535 $P_No_nrng equ 0 ;AN000; (tm07) no nrng. nnval must not be 0. - 32536 - 32537 struc $P_VAL_LIST - 32538 00000000 ?? .$P_NumofList: resb 1 ;AN000; number of following choice - 32539 00000001 ???? .$P_Val_XL: resw 1 ;AN000; lower word of value - 32540 00000003 ???? .$P_Val_XH: resw 1 ;AN000; higher word of value - 32541 00000005 ???? .$P_Val_YL: resw 1 ;AN000; lower word of another value - 32542 00000007 ???? .$P_Val_YH: resw 1 ;AN000; higher word of another value - 32543 endstruc - 32544 - 32545 ; 31/03/2023 - 32546 ;---------------------------------------------------------------------------- - 32547 ; - 32548 ;RESULT LABEL BYTE ; BELOW FILLED IN FOR DEFAULTS - 32549 ; DB type ; TYPE RETURNED: 0=RESERVED, - 32550 ; ; 1=NUMBER, 2=LIST INDEX, - 32551 ; ; 3=STRING, 4=COMPLEX, - 32552 ; ; 5=FILESPEC, 6=DRIVE - 32553 ; ; 7=DATE, 8=TIME - 32554 ; ; 9=QUOTED STRING - 32555 ; DB ITEM_TAG ; MATCHED ITEM TAG - 32556 ; - 32557 ; dw synonym@ ; es:@ points to found SYNONYM if provided. - 32558 ; - 32559 ; +- - 32560 ; | DD n ; VALUE IF NUMBER - 32561 ; | or - 32562 ; | DW i ; INDEX (OFFSET) INTO VALUE LIST - 32563 ; | ; (ES presents Segment address) + 32461 ; - One "..." can contain only one switch or keyword. If you need, for + 32462 ; example /A and /B, the format will be; + 32463 ; + 32464 ; DB 2 ; number of following synonyms + 32465 ; DB '/A',0 + 32466 ; DB '/B',0 + 32467 ;---------------------------------------------------------------------------- + 32468 + 32469 ;**** Match_Flags + 32470 + 32471 $P_Num_Val equ 8000h ;AN000; Numeric Value + 32472 $P_SNum_Val equ 4000h ;AN000; Signed numeric value + 32473 $P_Simple_S equ 2000h ;AN000; Simple string + 32474 $P_Date_S equ 1000h ;AN000; Date string + 32475 $P_Time_S equ 0800h ;AN000; Time string + 32476 $P_Cmpx_S equ 0400h ;AN000; Complex string + 32477 $P_File_Spc equ 0200h ;AN000; File Spec + 32478 $P_Drv_Only equ 0100h ;AN000; Drive Only + 32479 $P_Qu_String equ 0080h ;AN000; Quoted string + 32480 $P_Ig_Colon equ 0010h ;AN000; Ignore colon at end in match + 32481 $P_Repeat equ 0002h ;AN000; Repeat allowed + 32482 $P_Optional equ 0001h ;AN000; Optional + 32483 + 32484 ;**** Function flags + 32485 + 32486 $P_CAP_File equ 0001h ;AN000; CAP result by file table + 32487 $P_CAP_Char equ 0002h ;AN000; CAP result by character table + 32488 $P_Rm_Colon equ 0010h ;AN000; Remove ":" at the end + 32489 $P_colon_is_not_necessary equ 0020h ;AN000;(tm10) /+10 and /+:10 + 32490 + 32491 ;-------------------------------- Control block structure + 32492 struc $P_CONTROL_BLK + 32493 00000000 ???? .$P_Match_Flag: resw 1 ;AN000; Controls type matched + 32494 00000002 ???? .$P_Function_Flag: resw 1 ;AN000; Function should be taken + 32495 00000004 ???? .$P_Result_Buf: resw 1 ;AN000; Result buffer address + 32496 00000006 ???? .$P_Value_List: resw 1 ;AN000; Value list address + 32497 00000008 ?? .$P_nid: resb 1 ;AN000; # of keyword/SW synonyms + 32498 00000009 ?? .$P_KEYorSW: resb 1 ;AN000; keyword or sw + 32499 endstruc + 32500 + 32501 ; 31/03/2023 + 32502 ;---------------------------------------------------------------------------- + 32503 ; + 32504 ;VALUES LABEL BYTE + 32505 ; DB nval ; NUMBER OF VALUE DEFINITIONS (0 - 3) + 32506 ; +- + 32507 ; | DB nrng ; NUMBER OF RANGES + 32508 ; | +DB ITEM_TAG ; RETURN VALUE IF RANGE MATCHED + 32509 ; | +DD X,Y ; RANGE OF VALUES + 32510 ; | : + 32511 ; | DB nnval ; NUMBER OF CHOICES + 32512 ; | +DB ITEM_TAG ; RETURN VALUE IF NUMBER CHOICE MATCHED + 32513 ; | +DD VALUE ; SPECIFIC CHOICE IF NUMBER + 32514 ; | : + 32515 ; | DB nstrval ; NUMBER OF CHOICES + 32516 ; | +DB ITEM_TAG ; RETURN VALUE IF STRING CHOICE MATCHED + 32517 ; | +DW STRING ; SPECIFIC CHOICE IF STING + 32518 ; +- : + 32519 ; + 32520 ;STRING DB "...",0 ; ASCIIZ STRING IMAGE + 32521 ; + 32522 ;Note: + 32523 ; - ITEM_TAG must not be 0FFH, which will be used in the result buffer + 32524 ; when no choice lists are provided. + 32525 ; + 32526 ; - STRING must consist of upper case characters only because the parser + 32527 ; performs pattern matching after converting input to upper case (by + 32528 ; using the current country upper case table) + 32529 ;---------------------------------------------------------------------------- + 32530 + 32531 $P_nval_None equ 0 ;AN000; no value list ID + 32532 $P_nval_Range equ 1 ;AN000; range list ID + 32533 $P_nval_Value equ 2 ;AN000; value list ID + 32534 $P_nval_String equ 3 ;AN000; string list ID + 32535 $P_Len_Range equ 9 ;AN000; Length of a range choice(two DD plus one DB) + 32536 $P_Len_Value equ 5 ;AN000; Length of a value choice(one DD plus one DB) + 32537 $P_Len_String equ 3 ;AN000; Length of a string choice(one DW plus one DB) + 32538 $P_No_nrng equ 0 ;AN000; (tm07) no nrng. nnval must not be 0. + 32539 + 32540 struc $P_VAL_LIST + 32541 00000000 ?? .$P_NumofList: resb 1 ;AN000; number of following choice + 32542 00000001 ???? .$P_Val_XL: resw 1 ;AN000; lower word of value + 32543 00000003 ???? .$P_Val_XH: resw 1 ;AN000; higher word of value + 32544 00000005 ???? .$P_Val_YL: resw 1 ;AN000; lower word of another value + 32545 00000007 ???? .$P_Val_YH: resw 1 ;AN000; higher word of another value + 32546 endstruc + 32547 + 32548 ; 31/03/2023 + 32549 ;---------------------------------------------------------------------------- + 32550 ; + 32551 ;RESULT LABEL BYTE ; BELOW FILLED IN FOR DEFAULTS + 32552 ; DB type ; TYPE RETURNED: 0=RESERVED, + 32553 ; ; 1=NUMBER, 2=LIST INDEX, + 32554 ; ; 3=STRING, 4=COMPLEX, + 32555 ; ; 5=FILESPEC, 6=DRIVE + 32556 ; ; 7=DATE, 8=TIME + 32557 ; ; 9=QUOTED STRING + 32558 ; DB ITEM_TAG ; MATCHED ITEM TAG + 32559 ; + 32560 ; dw synonym@ ; es:@ points to found SYNONYM if provided. + 32561 ; + 32562 ; +- + 32563 ; | DD n ; VALUE IF NUMBER 32564 ; | or - 32565 ; | DD STRING ; OFFSET OF STRING VALUE - 32566 ; | or - 32567 ; | DB drv ; DRIVE NUMBER (1-A, 2-B,..., 26-Z) - 32568 ; | or - 32569 ; | DW YEAR ;(1980-2099) IN CASE OF DATE - 32570 ; | DB MONTH ;(1-12) Note: Range check is not performed. - 32571 ; | DB DATE ;(1-31) 0 is filled when the corresponding field was not specified. - 32572 ; | or - 32573 ; | DB HOUR ;(0-23) IN CASE OF TIME - 32574 ; | DB MINUTES ;(0-59) Note: Range check is not performed . - 32575 ; | DB SECONDS ;(0-59) 0 is filled when the corresponding field was not specified . - 32576 ; | DB HUNDREDTHS ;(0-99) - 32577 ; +- - 32578 ; - 32579 ;Note: ITEM_TAG is 0FFH when the caller does not specify the choice - 32580 ; list. + 32565 ; | DW i ; INDEX (OFFSET) INTO VALUE LIST + 32566 ; | ; (ES presents Segment address) + 32567 ; | or + 32568 ; | DD STRING ; OFFSET OF STRING VALUE + 32569 ; | or + 32570 ; | DB drv ; DRIVE NUMBER (1-A, 2-B,..., 26-Z) + 32571 ; | or + 32572 ; | DW YEAR ;(1980-2099) IN CASE OF DATE + 32573 ; | DB MONTH ;(1-12) Note: Range check is not performed. + 32574 ; | DB DATE ;(1-31) 0 is filled when the corresponding field was not specified. + 32575 ; | or + 32576 ; | DB HOUR ;(0-23) IN CASE OF TIME + 32577 ; | DB MINUTES ;(0-59) Note: Range check is not performed . + 32578 ; | DB SECONDS ;(0-59) 0 is filled when the corresponding field was not specified . + 32579 ; | DB HUNDREDTHS ;(0-99) + 32580 ; +- 32581 ; - 32582 ; YEAR: If the input value for the year is less than 100, parser - 32583 ; adds 1900 to it. For example, when 87 is input to parser for - 32584 ; the year value, he returns 1987. - 32585 ;---------------------------------------------------------------------------- - 32586 - 32587 ;-------------------------------- Result block structure - 32588 struc $P_RESULT_BLK; - 32589 00000000 ?? .$P_Type: resb 1 ;AN000; Type returned - 32590 00000001 ?? .$P_Item_Tag: resb 1 ;AN000; Matched item tag - 32591 00000002 ???? .$P_SYNONYM_Ptr: resw 1 ;AN000; pointer to Synonym list returned - 32592 00000004 ???????? .$P_Picked_Val: resb 4 ;AN000; value - 32593 endstruc - 32594 - 32595 ;**** values for the type field in the result block - 32596 - 32597 $P_EOL equ 0 ;AN000; End of line - 32598 $P_Number equ 1 ;AN000; Number - 32599 $P_List_Idx equ 2 ;AN000; List Index - 32600 $P_String equ 3 ;AN000; String - 32601 $P_Complex equ 4 ;AN000; Complex - 32602 $P_File_Spec equ 5 ;AN000; File Spec - 32603 $P_Drive equ 6 ;AN000; Drive - 32604 $P_Date_F equ 7 ;AN000; Date - 32605 $P_Time_F equ 8 ;AN000; Time - 32606 $P_Quoted_String equ 9 ;AN000; Quoted String - 32607 - 32608 $P_No_Tag equ 0FFh ;AN000; No ITEM_TAG found - 32609 - 32610 ;**** Return code - 32611 ; - 32612 ; following return code will be returned in the AX register. - 32613 - 32614 $P_No_Error equ 0 ;AN000; No error - 32615 $P_Too_Many equ 1 ;AN000; Too many operands - 32616 $P_Op_Missing equ 2 ;AN000; Required operand missing - 32617 $P_Not_In_SW equ 3 ;AN000; Not in switch list provided - 32618 $P_Not_In_Key equ 4 ;AN000; Not in keyword list provided - 32619 $P_Out_Of_Range equ 6 ;AN000; Out of range specified - 32620 $P_Not_In_Val equ 7 ;AN000; Not in value list provided - 32621 $P_Not_In_Str equ 8 ;AN000; Not in string list provided - 32622 $P_Syntax equ 9 ;AN000; Syntax error - 32623 $P_RC_EOL equ -1 ;AN000; End of command line - 32624 - 32625 ;in second byte of $P_Flags, referenced as $P_Flags2: - 32626 $P_equ equ 01h ;AN000; "=" packed in string buffet - 32627 $P_Neg equ 02h ;AN000; Negative value - 32628 $P_Time12 equ 04h ;AN000; set when PM is specified - 32629 $P_Key_Cmp equ 08h ;AN000; set when keyword compare - 32630 $P_SW_Cmp equ 10h ;AN000; set when switch compare - 32631 $P_Extra equ 20h ;AN000; set when extra delimiter found - 32632 $P_SW equ 40h ;AN000; set when switch found (tm08) - 32633 $P_Signed equ 80h ;AN000; signed numeric specified - 32634 - 32635 ;-------- Masks - 32636 $P_Make_Lower equ 20h ;AN000; make lower case character - 32637 $P_Make_Upper equ 0FFh-$P_Make_Lower ;AN000; make upper case character - 32638 - 32639 ;------------- - 32640 - 32641 struc $P_DOS_TBL - 32642 00000000 ?? .$P_DOS_InfoID: resb 1 ;AN000; information id for the table - 32643 00000001 ???? .$P_DOS_TBL_Off: resw 1 ;AN000; offset address of the table - 32644 00000003 ???? .$P_DOS_TBL_Seg: resw 1 ;AN000; segment address of the table - 32645 endstruc - 32646 - 32647 $P_DOS_Get_TBL equ 65h ;AN000; get uppercase table call - 32648 ;AN000; following parameters are set - 32649 ;AN000; to get casemap table. - 32650 $P_DOSTBL_Def equ -1 ;AN000; get default - 32651 $P_DOSTBL_BL equ 5 ;AN000; buffer length for Tbl pointer - 32652 $P_DOSTBL_File equ 4 ;AN000; get file uppercase table - 32653 $P_DOSTBL_Char equ 2 ;AN000; get character uppercase table - 32654 ; By this call following information - 32655 ; is returned. - 32656 - 32657 ; 03/04/2023 - 32658 ;-------------------------------- country dependent information + 32582 ;Note: ITEM_TAG is 0FFH when the caller does not specify the choice + 32583 ; list. + 32584 ; + 32585 ; YEAR: If the input value for the year is less than 100, parser + 32586 ; adds 1900 to it. For example, when 87 is input to parser for + 32587 ; the year value, he returns 1987. + 32588 ;---------------------------------------------------------------------------- + 32589 + 32590 ;-------------------------------- Result block structure + 32591 struc $P_RESULT_BLK; + 32592 00000000 ?? .$P_Type: resb 1 ;AN000; Type returned + 32593 00000001 ?? .$P_Item_Tag: resb 1 ;AN000; Matched item tag + 32594 00000002 ???? .$P_SYNONYM_Ptr: resw 1 ;AN000; pointer to Synonym list returned + 32595 00000004 ???????? .$P_Picked_Val: resb 4 ;AN000; value + 32596 endstruc + 32597 + 32598 ;**** values for the type field in the result block + 32599 + 32600 $P_EOL equ 0 ;AN000; End of line + 32601 $P_Number equ 1 ;AN000; Number + 32602 $P_List_Idx equ 2 ;AN000; List Index + 32603 $P_String equ 3 ;AN000; String + 32604 $P_Complex equ 4 ;AN000; Complex + 32605 $P_File_Spec equ 5 ;AN000; File Spec + 32606 $P_Drive equ 6 ;AN000; Drive + 32607 $P_Date_F equ 7 ;AN000; Date + 32608 $P_Time_F equ 8 ;AN000; Time + 32609 $P_Quoted_String equ 9 ;AN000; Quoted String + 32610 + 32611 $P_No_Tag equ 0FFh ;AN000; No ITEM_TAG found + 32612 + 32613 ;**** Return code + 32614 ; + 32615 ; following return code will be returned in the AX register. + 32616 + 32617 $P_No_Error equ 0 ;AN000; No error + 32618 $P_Too_Many equ 1 ;AN000; Too many operands + 32619 $P_Op_Missing equ 2 ;AN000; Required operand missing + 32620 $P_Not_In_SW equ 3 ;AN000; Not in switch list provided + 32621 $P_Not_In_Key equ 4 ;AN000; Not in keyword list provided + 32622 $P_Out_Of_Range equ 6 ;AN000; Out of range specified + 32623 $P_Not_In_Val equ 7 ;AN000; Not in value list provided + 32624 $P_Not_In_Str equ 8 ;AN000; Not in string list provided + 32625 $P_Syntax equ 9 ;AN000; Syntax error + 32626 $P_RC_EOL equ -1 ;AN000; End of command line + 32627 + 32628 ;in second byte of $P_Flags, referenced as $P_Flags2: + 32629 $P_equ equ 01h ;AN000; "=" packed in string buffet + 32630 $P_Neg equ 02h ;AN000; Negative value + 32631 $P_Time12 equ 04h ;AN000; set when PM is specified + 32632 $P_Key_Cmp equ 08h ;AN000; set when keyword compare + 32633 $P_SW_Cmp equ 10h ;AN000; set when switch compare + 32634 $P_Extra equ 20h ;AN000; set when extra delimiter found + 32635 $P_SW equ 40h ;AN000; set when switch found (tm08) + 32636 $P_Signed equ 80h ;AN000; signed numeric specified + 32637 + 32638 ;-------- Masks + 32639 $P_Make_Lower equ 20h ;AN000; make lower case character + 32640 $P_Make_Upper equ 0FFh-$P_Make_Lower ;AN000; make upper case character + 32641 + 32642 ;------------- + 32643 + 32644 struc $P_DOS_TBL + 32645 00000000 ?? .$P_DOS_InfoID: resb 1 ;AN000; information id for the table + 32646 00000001 ???? .$P_DOS_TBL_Off: resw 1 ;AN000; offset address of the table + 32647 00000003 ???? .$P_DOS_TBL_Seg: resw 1 ;AN000; segment address of the table + 32648 endstruc + 32649 + 32650 $P_DOS_Get_TBL equ 65h ;AN000; get uppercase table call + 32651 ;AN000; following parameters are set + 32652 ;AN000; to get casemap table. + 32653 $P_DOSTBL_Def equ -1 ;AN000; get default + 32654 $P_DOSTBL_BL equ 5 ;AN000; buffer length for Tbl pointer + 32655 $P_DOSTBL_File equ 4 ;AN000; get file uppercase table + 32656 $P_DOSTBL_Char equ 2 ;AN000; get character uppercase table + 32657 ; By this call following information + 32658 ; is returned. 32659 - 32660 $P_DOS_Get_CDI equ 3800h - 32661 - 32662 struc $P_CDI - 32663 00000000 ???? .$P_CDI_DateF: resw 1 ;AN000; - 32664 00000002 ???????? .$P_CDI_Money: resb 4 ;AN000; - 32665 00000006 ???? .$P_CDI_1000: resb 2 ;AN000; - 32666 00000008 ???? .$P_CDI_Dec: resb 2 ;AN000; - 32667 0000000A ???? .$P_CDI_DateS: resb 2 ;AN000; - 32668 0000000C ???? .$P_CDI_TimeS: resb 2 ;AN000; - 32669 0000000E ?? resb 1 ;AN000; - 32670 0000000F ?? resb 1 ;AN000; - 32671 00000010 ?? .$P_CDI_TimeF: resb 1 ;AN000; - 32672 00000011 ???????? resw 2 ;AN000; - 32673 00000015 ???? resb 2 ;AN000; - 32674 00000017 resw 5 ;AN000; - 32675 endstruc - 32676 - 32677 $P_Date_MDY equ 0 ;AN000; - 32678 $P_Date_DMY equ 1 ;AN000; - 32679 $P_Date_YMD equ 2 ;AN000; - 32680 - 32681 ; ---------------------------- - 32682 ; (PARSE.ASM, MSDOS 6.0, 1991) - 32683 ; ---------------------------- - 32684 - 32685 ;*********************************************************************** - 32686 ; SysParse; - 32687 ; - 32688 ; Function : Parser Entry - 32689 ; - 32690 ; Input: DS:SI -> command line - 32691 ; ES:DI -> parameter block - 32692 ; psdata_seg -> psdata.inc - 32693 ; CX = operand ordinal - 32694 ; - 32695 ; Note: ES is the segment containing all the control blocks defined - 32696 ; by the caller, except for the DOS COMMAND line parms, which - 32697 ; is in DS. - 32698 ; - 32699 ; Output: CY = 1 error of caller, means invalid parameter block or - 32700 ; invalid value list. But this parser does NOT implement - 32701 ; this feature. Therefore CY always zero. - 32702 ; - 32703 ; CY = 0 AX = return code - 32704 ; BL = terminated delimiter code - 32705 ; CX = new operand ordinal - 32706 ; SI = set past scaned operand - 32707 ; DX = selected result buffer - 32708 ; - 32709 ; Use: $P_Skip_Delim, $P_Chk_EOL, $P_Chk_Delim, $P_Chk_DBCS - 32710 ; $P_Chk_Swtch, $P_Chk_Pos_Control, $P_Chk_Key_Control - 32711 ; $P_Chk_Sw_Control, $P_Fill_Result - 32712 ; - 32713 ; Vars: $P_Ordinal(RW), $P_RC(RW), $P_SI_Save(RW), $P_DX(R), $P_Terminator(R) - 32714 ; $P_SaveSI_Cmpx(W), $P_Flags(RW), $P_Found_SYNONYM(R), $P_Save_EOB(W) + 32660 ; 03/04/2023 + 32661 ;-------------------------------- country dependent information + 32662 + 32663 $P_DOS_Get_CDI equ 3800h + 32664 + 32665 struc $P_CDI + 32666 00000000 ???? .$P_CDI_DateF: resw 1 ;AN000; + 32667 00000002 ???????? .$P_CDI_Money: resb 4 ;AN000; + 32668 00000006 ???? .$P_CDI_1000: resb 2 ;AN000; + 32669 00000008 ???? .$P_CDI_Dec: resb 2 ;AN000; + 32670 0000000A ???? .$P_CDI_DateS: resb 2 ;AN000; + 32671 0000000C ???? .$P_CDI_TimeS: resb 2 ;AN000; + 32672 0000000E ?? resb 1 ;AN000; + 32673 0000000F ?? resb 1 ;AN000; + 32674 00000010 ?? .$P_CDI_TimeF: resb 1 ;AN000; + 32675 00000011 ???????? resw 2 ;AN000; + 32676 00000015 ???? resb 2 ;AN000; + 32677 00000017 resw 5 ;AN000; + 32678 endstruc + 32679 + 32680 $P_Date_MDY equ 0 ;AN000; + 32681 $P_Date_DMY equ 1 ;AN000; + 32682 $P_Date_YMD equ 2 ;AN000; + 32683 + 32684 ; ---------------------------- + 32685 ; (PARSE.ASM, MSDOS 6.0, 1991) + 32686 ; ---------------------------- + 32687 + 32688 ;*********************************************************************** + 32689 ; SysParse; + 32690 ; + 32691 ; Function : Parser Entry + 32692 ; + 32693 ; Input: DS:SI -> command line + 32694 ; ES:DI -> parameter block + 32695 ; psdata_seg -> psdata.inc + 32696 ; CX = operand ordinal + 32697 ; + 32698 ; Note: ES is the segment containing all the control blocks defined + 32699 ; by the caller, except for the DOS COMMAND line parms, which + 32700 ; is in DS. + 32701 ; + 32702 ; Output: CY = 1 error of caller, means invalid parameter block or + 32703 ; invalid value list. But this parser does NOT implement + 32704 ; this feature. Therefore CY always zero. + 32705 ; + 32706 ; CY = 0 AX = return code + 32707 ; BL = terminated delimiter code + 32708 ; CX = new operand ordinal + 32709 ; SI = set past scaned operand + 32710 ; DX = selected result buffer + 32711 ; + 32712 ; Use: $P_Skip_Delim, $P_Chk_EOL, $P_Chk_Delim, $P_Chk_DBCS + 32713 ; $P_Chk_Swtch, $P_Chk_Pos_Control, $P_Chk_Key_Control + 32714 ; $P_Chk_Sw_Control, $P_Fill_Result 32715 ; - 32716 ;-------- Modification History ----------------------------------------- - 32717 ; - 32718 ; 4/04/87 : Created by K. K, - 32719 ; 4/28/87 : $P_Val_YH assemble error (tm01) - 32720 ; : JMP SHORT assemble error (tm02) - 32721 ; 5/14/87 : Someone doesn't want to include psdata (tm03) - 32722 ; 6/12/87 : $P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or - 32723 ; DateSW equ 1) (tm04) - 32724 ; 6/12/87 : $P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1 - 32725 ; (tm05) in PSDATA.INC - 32726 ; 6/12/87 : $P_FileSp_Char and $P_FileSP_Len are missing - 32727 ; when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC - 32728 ; 6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same - 32729 ; value-list block (tm07) - 32730 ; 6/20/87 : Add $P_SW to check if there's an omiting parameter after - 32731 ; switch (keyword) or not. If there is, backup si for next call - 32732 ; (tm08) - 32733 ; 6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1 - 32734 ; and DateSW equ 0 and TimeSW equ 0 (tm09) - 32735 ; 6/24/87 : New function flag $P_colon_is_not_necessary for switch - 32736 ; /+15 and /+:15 are allowed for user (tm10) - 32737 ; 6/29/87 : ECS call changes DS register but it causes the address problem - 32738 ; in user's routines. $P_Chk_DBCS (tm11) - 32739 ; 7/10/87 : Switch with no_match flag (0x0000H) does not work correctly - 32740 ; (tm12) - 32741 ; 7/10/87 : Invalid switch/keyword does not work correctly - 32742 ; (tm13) - 32743 ; 7/10/87 : Drive_only breaks 3 bytes after the result buffer - 32744 ; (tm14) - 32745 ; 7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result - 32746 ; (tm15) - 32747 ; 7/24/87 : Negative lower bound on numeric ranges cause trouble - 32748 ; - 32749 ; 7/24/87 : Quoted strings being returned with quotes. - 32750 ; - 32751 ; 7/28/87 : Kerry S (;AN018;) - 32752 ; Non optional value on switch (match flags<>0 and <>1) not flagged - 32753 ; as an error when missing. Solution: return error 2. Modules - 32754 ; affected: $P_Chk_SW_Control. - 32755 ; - 32756 ; 7/29/87 : Kerry S (;AN019;) - 32757 ; Now allow the optional bit in match flags for switches. This - 32758 ; allows the switch to be encountered with a value or without a - 32759 ; value and no error is returned. - 32760 ; - 32761 ; - 32762 ; 8/28/87 : Ed K, Kerry S (;AN020;) - 32763 ; 9/14/87 In PROC $P_Get_DecNum, when checking for field separators - 32764 ; within a date response, instead of checking just for the one - 32765 ; character defined by the COUNTRY DEPENDENT INFO, check for - 32766 ; all three chars, "-", "/", and ".". Change $P_Chk_Switch to allow - 32767 ; slashes in date strings when DateSw (assembler switch) is set. - 32768 ; - 32769 ; 9/1/87 : Kerry S (;AN021) - 32770 ; In PROC $P_String_Comp, when comparing the switch or keyword on - 32771 ; the command line with the string in the control block the - 32772 ; comparing was stopping at a colon (switch) or equal (keyword) - 32773 ; on the command line and assuming a match. This allowed a shorter - 32774 ; string on the command line than in the synonym list in the control - 32775 ; block. I put in a test for a null in the control block so the - 32776 ; string in the control block must be the same length as the string - 32777 ; preceeding the colon or equal on the command line. - 32778 ; - 32779 ; 8/28/87 : Kerry S (;AN022;) - 32780 ; All references to data in PSDATA.INC had CS overrides. This caused - 32781 ; problems for people who included it themselves in a segment other - 32782 ; than CS. Added switch to allow including PSDATA.INC in any - 32783 ; segment. - 32784 ; - 32785 ; 9/16/87 : Ed K (;AN023;) PTM1040 - 32786 ; in $p_set_cdi PROC, it assumes CS points to psdata. Change Push CS - 32787 ; into PUSH PSDATA_SEG. In $P_Get_DecNum PROC, fix AN020 - 32788 ; forced both TIME and DATE to use the delims, "-","/",".". - 32789 ; Created FLag, in $P_time_Format PROC, to request the delim in - 32790 ; BL be used if TIME is being parsed. - 32791 ; - 32792 ; 9/24/87 : Ed K - 32793 ; Removed the include to STRUC.INC. Replaced the STRUC macro - 32794 ; invocations with their normally expanded code; made comments - 32795 ; out of the STRUC macro invocation statements to maintain readability. - 32796 ; - 32797 ; 9/24/87 : Ed K (;AN024;) PTM1222 - 32798 ; When no CONTROL for a keyword found, tried to fill in RESULT - 32799 ; pointed to by non-existant CONTROL. - 32800 ; - 32801 ; 10/15/87 : Ed K (;AN025;) PTM1672 - 32802 ; A quoted text string can be framed only by double quote. Remove - 32803 ; support to frame quoted text string with single quote. - 32804 ; (apostrophe) $P_SorD_Quote is removed from PSDATA.INC. - 32805 ; $P_SQuote EQU also removed from PSDATA.INC. Any references to - 32806 ; single quote in PROC prologues are left as is for history reasons. - 32807 ; - 32808 ; This fixes another bug, not mentioned in p1672, in that two - 32809 ; quote chars within a quoted string is supposed to be reported as - 32810 ; one quote character, but is reported as two quotes. This changed - 32811 ; two instructions in PROC $P_Quoted_Str. - 32812 ; - 32813 ; Also fixed are several JMP that caused a NOP, these changed to - 32814 ; have the SHORT operator to avoid the unneeded NOP. + 32716 ; Vars: $P_Ordinal(RW), $P_RC(RW), $P_SI_Save(RW), $P_DX(R), $P_Terminator(R) + 32717 ; $P_SaveSI_Cmpx(W), $P_Flags(RW), $P_Found_SYNONYM(R), $P_Save_EOB(W) + 32718 ; + 32719 ;-------- Modification History ----------------------------------------- + 32720 ; + 32721 ; 4/04/87 : Created by K. K, + 32722 ; 4/28/87 : $P_Val_YH assemble error (tm01) + 32723 ; : JMP SHORT assemble error (tm02) + 32724 ; 5/14/87 : Someone doesn't want to include psdata (tm03) + 32725 ; 6/12/87 : $P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or + 32726 ; DateSW equ 1) (tm04) + 32727 ; 6/12/87 : $P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1 + 32728 ; (tm05) in PSDATA.INC + 32729 ; 6/12/87 : $P_FileSp_Char and $P_FileSP_Len are missing + 32730 ; when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC + 32731 ; 6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same + 32732 ; value-list block (tm07) + 32733 ; 6/20/87 : Add $P_SW to check if there's an omiting parameter after + 32734 ; switch (keyword) or not. If there is, backup si for next call + 32735 ; (tm08) + 32736 ; 6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1 + 32737 ; and DateSW equ 0 and TimeSW equ 0 (tm09) + 32738 ; 6/24/87 : New function flag $P_colon_is_not_necessary for switch + 32739 ; /+15 and /+:15 are allowed for user (tm10) + 32740 ; 6/29/87 : ECS call changes DS register but it causes the address problem + 32741 ; in user's routines. $P_Chk_DBCS (tm11) + 32742 ; 7/10/87 : Switch with no_match flag (0x0000H) does not work correctly + 32743 ; (tm12) + 32744 ; 7/10/87 : Invalid switch/keyword does not work correctly + 32745 ; (tm13) + 32746 ; 7/10/87 : Drive_only breaks 3 bytes after the result buffer + 32747 ; (tm14) + 32748 ; 7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result + 32749 ; (tm15) + 32750 ; 7/24/87 : Negative lower bound on numeric ranges cause trouble + 32751 ; + 32752 ; 7/24/87 : Quoted strings being returned with quotes. + 32753 ; + 32754 ; 7/28/87 : Kerry S (;AN018;) + 32755 ; Non optional value on switch (match flags<>0 and <>1) not flagged + 32756 ; as an error when missing. Solution: return error 2. Modules + 32757 ; affected: $P_Chk_SW_Control. + 32758 ; + 32759 ; 7/29/87 : Kerry S (;AN019;) + 32760 ; Now allow the optional bit in match flags for switches. This + 32761 ; allows the switch to be encountered with a value or without a + 32762 ; value and no error is returned. + 32763 ; + 32764 ; + 32765 ; 8/28/87 : Ed K, Kerry S (;AN020;) + 32766 ; 9/14/87 In PROC $P_Get_DecNum, when checking for field separators + 32767 ; within a date response, instead of checking just for the one + 32768 ; character defined by the COUNTRY DEPENDENT INFO, check for + 32769 ; all three chars, "-", "/", and ".". Change $P_Chk_Switch to allow + 32770 ; slashes in date strings when DateSw (assembler switch) is set. + 32771 ; + 32772 ; 9/1/87 : Kerry S (;AN021) + 32773 ; In PROC $P_String_Comp, when comparing the switch or keyword on + 32774 ; the command line with the string in the control block the + 32775 ; comparing was stopping at a colon (switch) or equal (keyword) + 32776 ; on the command line and assuming a match. This allowed a shorter + 32777 ; string on the command line than in the synonym list in the control + 32778 ; block. I put in a test for a null in the control block so the + 32779 ; string in the control block must be the same length as the string + 32780 ; preceeding the colon or equal on the command line. + 32781 ; + 32782 ; 8/28/87 : Kerry S (;AN022;) + 32783 ; All references to data in PSDATA.INC had CS overrides. This caused + 32784 ; problems for people who included it themselves in a segment other + 32785 ; than CS. Added switch to allow including PSDATA.INC in any + 32786 ; segment. + 32787 ; + 32788 ; 9/16/87 : Ed K (;AN023;) PTM1040 + 32789 ; in $p_set_cdi PROC, it assumes CS points to psdata. Change Push CS + 32790 ; into PUSH PSDATA_SEG. In $P_Get_DecNum PROC, fix AN020 + 32791 ; forced both TIME and DATE to use the delims, "-","/",".". + 32792 ; Created FLag, in $P_time_Format PROC, to request the delim in + 32793 ; BL be used if TIME is being parsed. + 32794 ; + 32795 ; 9/24/87 : Ed K + 32796 ; Removed the include to STRUC.INC. Replaced the STRUC macro + 32797 ; invocations with their normally expanded code; made comments + 32798 ; out of the STRUC macro invocation statements to maintain readability. + 32799 ; + 32800 ; 9/24/87 : Ed K (;AN024;) PTM1222 + 32801 ; When no CONTROL for a keyword found, tried to fill in RESULT + 32802 ; pointed to by non-existant CONTROL. + 32803 ; + 32804 ; 10/15/87 : Ed K (;AN025;) PTM1672 + 32805 ; A quoted text string can be framed only by double quote. Remove + 32806 ; support to frame quoted text string with single quote. + 32807 ; (apostrophe) $P_SorD_Quote is removed from PSDATA.INC. + 32808 ; $P_SQuote EQU also removed from PSDATA.INC. Any references to + 32809 ; single quote in PROC prologues are left as is for history reasons. + 32810 ; + 32811 ; This fixes another bug, not mentioned in p1672, in that two + 32812 ; quote chars within a quoted string is supposed to be reported as + 32813 ; one quote character, but is reported as two quotes. This changed + 32814 ; two instructions in PROC $P_Quoted_Str. 32815 ; - 32816 ; The code and PSDATA.INC have been aligned for ease of reading. - 32817 ; - 32818 ; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to - 32819 ; psdata buffer should have psdata_seg. + 32816 ; Also fixed are several JMP that caused a NOP, these changed to + 32817 ; have the SHORT operator to avoid the unneeded NOP. + 32818 ; + 32819 ; The code and PSDATA.INC have been aligned for ease of reading. 32820 ; - 32821 ; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies - 32822 ; positional missing. + 32821 ; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to + 32822 ; psdata buffer should have psdata_seg. 32823 ; - 32824 ; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed - 32825 ; as a line delimiter, should use carriage return. - 32826 ; Define switch: LFEOLSW, if on, accept LF as end of line char. - 32827 ; - 32828 ; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=". - 32829 ; - 32830 ; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then - 32831 ; endless loop since SI is returned still pointing to start - 32832 ; of that parm. - 32833 ; - 32834 ; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values. - 32835 ; Vector to returned string has CS instead of Psdata_Seg, but - 32836 ; when tried to fix it on previous version, changed similar - 32837 ; but wrong place. - 32838 ; - 32839 ; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid - 32840 ; delimiters between hours, minutes, seconds for time. And period - 32841 ; and comma are valid delimiters between seconds and 100th second. - 32842 ; - 32843 ; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters - 32844 ; in a filespec, then flag an error. + 32824 ; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies + 32825 ; positional missing. + 32826 ; + 32827 ; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed + 32828 ; as a line delimiter, should use carriage return. + 32829 ; Define switch: LFEOLSW, if on, accept LF as end of line char. + 32830 ; + 32831 ; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=". + 32832 ; + 32833 ; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then + 32834 ; endless loop since SI is returned still pointing to start + 32835 ; of that parm. + 32836 ; + 32837 ; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values. + 32838 ; Vector to returned string has CS instead of Psdata_Seg, but + 32839 ; when tried to fix it on previous version, changed similar + 32840 ; but wrong place. + 32841 ; + 32842 ; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid + 32843 ; delimiters between hours, minutes, seconds for time. And period + 32844 ; and comma are valid delimiters between seconds and 100th second. 32845 ; - 32846 ; 12/22/87 : Bill L (;AN034;) All local data to parser is now - 32847 ; indexed off of the psdata_seg equate instead of the DS register. - 32848 ; Using this method, DS can point to the segment of PSP or to psdata - 32849 ; --> local parser data. Why were some references to local data changed - 32850 ; to do this before, but not all ????? - 32851 ; - 32852 ; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations. - 32853 ; - 32854 ; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED. - 32855 ; - 32856 ; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST. - 32857 ; - 32858 ; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error - 32859 ; - 32860 ; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal - 32861 ; separator in TIME before hundredths field. + 32846 ; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters + 32847 ; in a filespec, then flag an error. + 32848 ; + 32849 ; 12/22/87 : Bill L (;AN034;) All local data to parser is now + 32850 ; indexed off of the psdata_seg equate instead of the DS register. + 32851 ; Using this method, DS can point to the segment of PSP or to psdata + 32852 ; --> local parser data. Why were some references to local data changed + 32853 ; to do this before, but not all ????? + 32854 ; + 32855 ; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations. + 32856 ; + 32857 ; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED. + 32858 ; + 32859 ; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST. + 32860 ; + 32861 ; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error 32862 ; - 32863 ; 08/09/90 : SA M005 Prevented parser from recognizing '=' signs within - 32864 ; strings as keywords. + 32863 ; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal + 32864 ; separator in TIME before hundredths field. 32865 ; - 32866 ;*********************************************************************** - 32867 - 32868 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 32869 cmd_parse: - 32870 ;call sysparse - 32871 ;retn - 32872 - 32873 ; ----------------------------------- - 32874 - 32875 ; 29/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 32876 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:44E7h + 32866 ; 08/09/90 : SA M005 Prevented parser from recognizing '=' signs within + 32867 ; strings as keywords. + 32868 ; + 32869 ;*********************************************************************** + 32870 + 32871 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 32872 cmd_parse: + 32873 ;call sysparse + 32874 ;retn + 32875 + 32876 ; ----------------------------------- 32877 - 32878 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 32879 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4CABh + 32878 ; 29/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 32879 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:44E7h 32880 - 32881 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 32882 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4B73h - 32883 sysparse: - 32884 0000496C 2EC706[C597]0000 mov word [cs:$P_Flags],0 ;AC034; Clear all internal flags - 32885 00004973 2E890E[4F98] mov [cs:$P_ORIG_ORD],cx ;AN039; ORIGINAL ORDINAL FROM CX - 32886 00004978 2E8926[5198] mov [cs:$P_ORIG_STACK],sp ;AN039; ORIGINAL VALUE OF STACK FROM SP - 32887 0000497D 2E8936[5398] mov [cs:$P_ORIG_SI],si ;AN039; ORIGINAL START PARSE POINTER FROM SI - 32888 $P_Redo_Time: ;AN039; try to parse time again - 32889 00004982 FC cld ;AN000; confirm forward direction - 32890 00004983 2E890E[B897] mov [cs:$P_ORDINAL],cx ;AC034; save operand ordinal - 32891 ;mov word [cs:$P_RC],$P_No_Error - 32892 00004988 2EC706[BA97]0000 mov word [cs:$P_RC],0 ;AC034; Assume no error - 32893 0000498F 2EC706[CD97]0000 mov word [cs:$P_Found_SYNONYM],0 - 32894 ;AC034; initalize synonym pointer - 32895 00004996 2EC706[BE97]0000 mov word [cs:$P_DX],0 ;AC034; (tm15) - 32896 - 32897 ;M029 -- Begin changes - 32898 ; The table of special chars $P_FileSp_Char should be initialized on every - 32899 ;entry to SysParse. This is in the non-checksum region and any program that - 32900 ;corrupts this table but does not corrupt the checksum region will leave - 32901 ;command.com parsing in an inconsistent state. - 32902 ; NB: The special characters string has been hardcoded here. If any change - 32903 ;is made to it in psdata.inc, a corresponding change needs to be made here. - 32904 - 32905 0000499D 2EC706[8A98]5B5D mov word [cs:$P_FileSp_Char], '[]' ; "[]|<>+=;\"" - 32906 000049A4 2EC706[8C98]7C3C mov word [cs:$P_FileSp_Char+2], '|<' - 32907 000049AB 2EC706[8E98]3E2B mov word [cs:$P_FileSp_Char+4], '>+' - 32908 000049B2 2EC706[9098]3D3B mov word [cs:$P_FileSp_Char+6], '=;' - 32909 - 32910 ;M029 -- End of changes - 32911 - 32912 000049B9 E82809 call $P_Skip_Delim ;AN000; Move si to 1st non white space - 32913 000049BC 7312 jnc short $P_Start ;AN000; If EOL is not encountered, do parse + 32881 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 32882 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4CABh + 32883 + 32884 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 32885 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4B73h + 32886 sysparse: + 32887 0000496C 2EC706[C597]0000 mov word [cs:$P_Flags],0 ;AC034; Clear all internal flags + 32888 00004973 2E890E[4F98] mov [cs:$P_ORIG_ORD],cx ;AN039; ORIGINAL ORDINAL FROM CX + 32889 00004978 2E8926[5198] mov [cs:$P_ORIG_STACK],sp ;AN039; ORIGINAL VALUE OF STACK FROM SP + 32890 0000497D 2E8936[5398] mov [cs:$P_ORIG_SI],si ;AN039; ORIGINAL START PARSE POINTER FROM SI + 32891 $P_Redo_Time: ;AN039; try to parse time again + 32892 00004982 FC cld ;AN000; confirm forward direction + 32893 00004983 2E890E[B897] mov [cs:$P_ORDINAL],cx ;AC034; save operand ordinal + 32894 ;mov word [cs:$P_RC],$P_No_Error + 32895 00004988 2EC706[BA97]0000 mov word [cs:$P_RC],0 ;AC034; Assume no error + 32896 0000498F 2EC706[CD97]0000 mov word [cs:$P_Found_SYNONYM],0 + 32897 ;AC034; initalize synonym pointer + 32898 00004996 2EC706[BE97]0000 mov word [cs:$P_DX],0 ;AC034; (tm15) + 32899 + 32900 ;M029 -- Begin changes + 32901 ; The table of special chars $P_FileSp_Char should be initialized on every + 32902 ;entry to SysParse. This is in the non-checksum region and any program that + 32903 ;corrupts this table but does not corrupt the checksum region will leave + 32904 ;command.com parsing in an inconsistent state. + 32905 ; NB: The special characters string has been hardcoded here. If any change + 32906 ;is made to it in psdata.inc, a corresponding change needs to be made here. + 32907 + 32908 0000499D 2EC706[8A98]5B5D mov word [cs:$P_FileSp_Char], '[]' ; "[]|<>+=;\"" + 32909 000049A4 2EC706[8C98]7C3C mov word [cs:$P_FileSp_Char+2], '|<' + 32910 000049AB 2EC706[8E98]3E2B mov word [cs:$P_FileSp_Char+4], '>+' + 32911 000049B2 2EC706[9098]3D3B mov word [cs:$P_FileSp_Char+6], '=;' + 32912 + 32913 ;M029 -- End of changes 32914 - 32915 ;--------------------------- End of Line - 32916 ;mov ax,$P_RC_EOL ;AN000; set exit code to -1 - 32917 000049BE B8FFFF mov ax,0FFFFh - 32918 000049C1 53 push bx ;AN000; - 32919 ;mov bx,[es:di+$P_PARMS_BLK.$P_PARMSX_Address] - 32920 000049C2 268B1D mov bx,[es:di] ;AN000; Get the PARMSX address to - 32921 - 32922 ;cmp cl,[es:bx+$P_PARMSX_BLK.$P_MinP] - 32923 000049C5 263A0F cmp cl,[es:bx] ;AN000; check ORDINAL to see if the minimum - 32924 000049C8 7304 jae short $P_Fin ;AN000; positional found. - 32925 - 32926 ;mov ax,2 - 32927 000049CA B80200 mov ax,$P_Op_Missing ; 2 ;AN000; If no, set exit code to missing operand - 32928 ; 27/04/2023 - 32929 000049CD F8 clc - 32930 $P_Fin: ;AN000; - 32931 000049CE 5B pop bx ;AN000; - 32932 ;jmp $P_Single_Exit ;AN000; return to the caller - 32933 ; 27/04/2023 - 32934 ; cf = 0 - 32935 ;clc - 32936 000049CF C3 retn - 32937 - 32938 ;--------------------------- - 32939 $P_Start: ;AN000; - 32940 000049D0 2E8936[C797] mov [cs:$P_SaveSI_Cmpx],si ;AN000;AC034; save ptr to command line for later use by complex, - 32941 000049D5 53 push bx ;AN000; quoted string or file spec. - 32942 000049D6 57 push di ;AN000; - 32943 000049D7 55 push bp ;AN000; - 32944 000049D8 8D1E[CF97] lea bx,$P_STRING_BUF ;AC034; set buffer to copy from command string - 32945 000049DC 2EF606[C697]20 test byte [cs:$P_Flags2],$P_Extra ; 20h - 32946 ;test byte [cs:$P_Flags2],20h ;AC034; 3/9 extra delimiter encountered ? - 32947 000049E2 7543 jnz short $P_Pack_End ;AN000; 3/9 if yes, no need to copy - 32948 $P_Pack_Loop: ;AN000; - 32949 000049E4 AC lodsb ;AN000; Pick a operand from buffer - 32950 000049E5 E8AF09 call $P_Chk_Switch ;AN000; Check switch character - 32951 000049E8 723C jc short $P_Pack_End_BY_EOL ;AN020; if carry set found delimiter type slash, need backup si, else continue - 32952 - 32953 000049EA E81909 call $P_Chk_EOL ;AN000; Check EOL character - 32954 000049ED 7437 je short $P_Pack_End_BY_EOL ;AN000; need backup si + 32915 000049B9 E82809 call $P_Skip_Delim ;AN000; Move si to 1st non white space + 32916 000049BC 7312 jnc short $P_Start ;AN000; If EOL is not encountered, do parse + 32917 + 32918 ;--------------------------- End of Line + 32919 ;mov ax,$P_RC_EOL ;AN000; set exit code to -1 + 32920 000049BE B8FFFF mov ax,0FFFFh + 32921 000049C1 53 push bx ;AN000; + 32922 ;mov bx,[es:di+$P_PARMS_BLK.$P_PARMSX_Address] + 32923 000049C2 268B1D mov bx,[es:di] ;AN000; Get the PARMSX address to + 32924 + 32925 ;cmp cl,[es:bx+$P_PARMSX_BLK.$P_MinP] + 32926 000049C5 263A0F cmp cl,[es:bx] ;AN000; check ORDINAL to see if the minimum + 32927 000049C8 7304 jae short $P_Fin ;AN000; positional found. + 32928 + 32929 ;mov ax,2 + 32930 000049CA B80200 mov ax,$P_Op_Missing ; 2 ;AN000; If no, set exit code to missing operand + 32931 ; 27/04/2023 + 32932 000049CD F8 clc + 32933 $P_Fin: ;AN000; + 32934 000049CE 5B pop bx ;AN000; + 32935 ;jmp $P_Single_Exit ;AN000; return to the caller + 32936 ; 27/04/2023 + 32937 ; cf = 0 + 32938 ;clc + 32939 000049CF C3 retn + 32940 + 32941 ;--------------------------- + 32942 $P_Start: ;AN000; + 32943 000049D0 2E8936[C797] mov [cs:$P_SaveSI_Cmpx],si ;AN000;AC034; save ptr to command line for later use by complex, + 32944 000049D5 53 push bx ;AN000; quoted string or file spec. + 32945 000049D6 57 push di ;AN000; + 32946 000049D7 55 push bp ;AN000; + 32947 000049D8 8D1E[CF97] lea bx,$P_STRING_BUF ;AC034; set buffer to copy from command string + 32948 000049DC 2EF606[C697]20 test byte [cs:$P_Flags2],$P_Extra ; 20h + 32949 ;test byte [cs:$P_Flags2],20h ;AC034; 3/9 extra delimiter encountered ? + 32950 000049E2 7543 jnz short $P_Pack_End ;AN000; 3/9 if yes, no need to copy + 32951 $P_Pack_Loop: ;AN000; + 32952 000049E4 AC lodsb ;AN000; Pick a operand from buffer + 32953 000049E5 E8AF09 call $P_Chk_Switch ;AN000; Check switch character + 32954 000049E8 723C jc short $P_Pack_End_BY_EOL ;AN020; if carry set found delimiter type slash, need backup si, else continue 32955 - 32956 000049EF E84609 call $P_Chk_Delim ;AN000; Check delimiter - 32957 000049F2 7518 jne short $P_PL01 ;AN000; If no, process next byte + 32956 000049EA E81909 call $P_Chk_EOL ;AN000; Check EOL character + 32957 000049ED 7437 je short $P_Pack_End_BY_EOL ;AN000; need backup si 32958 - 32959 000049F4 2EF606[C697]20 test byte [cs:$P_Flags2],$P_Extra ; 20h - 32960 ;test byte [cs:$P_Flags2],20h ;AC034; 3/9 If yes and white spec, - 32961 000049FA 7505 jnz short $P_Pack_End_backup_si - 32962 ;AN000; (tm08) - 32963 000049FC E8E508 call $P_Skip_Delim ;AN000; skip subsequent white space,too - 32964 000049FF EB26 jmp short $P_Pack_End ;AN000; finish copy by placing NUL at end - 32965 - 32966 $P_Pack_End_backup_si: ;AN000; (tm08) - 32967 00004A01 2EF606[C697]41 test byte [cs:$P_Flags2],$P_SW+$P_equ ; 41h - 32968 ;test byte [cs:$P_Flags2],41h ;AN000;AC034; (tm08) - 32969 00004A07 741E jz short $P_Pack_End ;AN000; (tm08) - 32970 - 32971 00004A09 4E dec si ;AN000; (tm08) - 32972 00004A0A EB1B jmp short $P_Pack_End ;AN025; (tm08) - 32973 $P_PL01: ;AN000; - 32974 00004A0C 2E8807 mov [cs:bx],al ;AN000; move byte to STRING_BUF - 32975 ;cmp al,'=' - 32976 00004A0F 3C3D cmp al,$P_Keyword ; '=' ;AN000; if it is equal character, - 32977 00004A11 7506 jne short $P_PL00 ;AN000; then - 32978 - 32979 00004A13 2E800E[C697]01 or byte [cs:$P_Flags2],$P_equ - 32980 ;or byte [cs:$P_Flags_2],1 ;AC034; remember it in flag - 32981 $P_PL00: ;AN000; - 32982 00004A19 43 inc bx ;AN000; ready to see next byte - 32983 00004A1A E8A509 call $P_Chk_DBCS ;AN000; was it 1st byte of DBCS ? - 32984 00004A1D 73C5 jnc short $P_Pack_Loop ;AN000; if no, process to next byte - 32985 - 32986 00004A1F AC lodsb ;AN000; if yes, store - 32987 00004A20 2E8807 mov [cs:bx],al ;AN000; 2nd byte of DBCS - 32988 00004A23 43 inc bx ;AN000; update pointer - 32989 00004A24 EBBE jmp short $P_Pack_Loop ;AN000; process to next byte - 32990 - 32991 $P_Pack_End_BY_EOL: ;AN000; - 32992 00004A26 4E dec si ;AN000; backup si pointer - 32993 $P_Pack_End: ;AN000; - 32994 00004A27 2E8936[BC97] mov [cs:$P_SI_Save],si ;AC034; save next pointer, SI - 32995 ;mov byte [cs:bx],0 - 32996 00004A2C 2EC60700 mov byte [cs:bx],$P_NULL ;AN000; put NULL at the end - 32997 00004A30 2E891E[CB97] mov [cs:$P_Save_EOB],bx - 32998 ;AC034; 3/17/87 keep the address for later use of complex - 32999 ;mov bx,[es:di+$P_PARMS_BLK.$P_PARMSX_Address] - 33000 00004A35 268B1D mov bx,[es:di] ;AN000; get PARMSX address - 33001 00004A38 8D36[CF97] lea si,$P_STRING_BUF ;AC034; - 33002 ;cmp byte [cs:si],'/' - 33003 00004A3C 2E803C2F cmp byte [cs:si],$P_Switch ;AN000; the operand begins w/ switch char ? - 33004 00004A40 7442 je short $P_SW_Manager ;AN000; if yes, process as switch - 33005 - 33006 00004A42 2E803C22 cmp byte [cs:si],$P_DQuote ;M005;is it a string? - 33007 00004A46 7408 je short $P_Positional_Manager - 33008 ;M005;if so, process as one! - 33009 00004A48 2EF606[C697]01 test byte [cs:$P_Flags2],$P_equ - 33010 ;test byte [cs:$P_Flags2],1 ;AC034; the operand includes equal char ? - 33011 00004A4E 7556 jnz short $P_Key_Manager ;AN000; if yes, process as keyword - 33012 - 33013 $P_Positional_Manager: ;AN000; else process as positional - 33014 ;mov al,[es:bx+1] ;AN000; get maxp - 33015 00004A50 268A4701 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] - 33016 00004A54 30E4 xor ah,ah ;AN000; ax = maxp - 33017 00004A56 2E3906[B897] cmp [cs:$P_ORDINAL],ax ;AC034; too many positional ? - 33018 00004A5B 7312 jae short $P_Too_Many_Error ;AN000; if yes, set exit code to too many - 33019 - 33020 00004A5D 2EA1[B897] mov ax,[cs:$P_ORDINAL] ;AC034; see what the current ordinal - 33021 00004A61 D1E0 shl ax,1 ;AN000; ax = ax*2 - 33022 00004A63 43 inc bx ;AC035; add '2' to - 33023 00004A64 43 inc bx ;AC035; BX reg - 33024 ;AN000; now bx points to 1st CONTROL - 33025 00004A65 01C3 add bx,ax ;AN000; now bx points to specified CONTROL address - 33026 00004A67 268B1F mov bx,[es:bx] ;AN000; now bx points to specified CONTROL itself - 33027 00004A6A E88000 call $P_Chk_Pos_Control ;AN000; Do process for positional - 33028 00004A6D EB61 jmp short $P_Return_to_Caller - 33029 ;AN000; and return to the caller - 33030 $P_Too_Many_Error: ;AN000; - 33031 ;mov word [cs:$P_RC],1 - 33032 00004A6F 2EC706[BA97]0100 mov word [cs:$P_RC],$P_Too_Many - 33033 ;AC034; set exit code - 33034 00004A76 EB58 jmp short $P_Return_to_Caller - 33035 ;AN000; and return to the caller - 33036 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 33037 %if 0 - 33038 $P_SW_Manager: ;AN000; - 33039 ;mov al,[es:bx+1] ;AN000; get maxp - 33040 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] - 33041 xor ah,ah ;AN000; ax = maxp - 33042 inc ax ;AN000; - 33043 shl ax,1 ;AN000; ax = (ax+1)*2 - 33044 add bx,ax ;AN000; now bx points to maxs - 33045 mov cl,[es:bx] ;AN000; - 33046 xor ch,ch ;AN000; cx = maxs - 33047 or cx,cx ;AN000; at least one switch ? - 33048 jz short $P_SW_Not_Found ;AN000; - 33049 inc bx ;AN000; now bx points to 1st CONTROL address - 33050 %else - 33051 $P_get_max_ptr: - 33052 ;mov al,[es:bx+1] ; get maxp - 33053 00004A78 268A4701 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] - 33054 00004A7C 30E4 xor ah,ah ; ax = maxp - 33055 00004A7E 40 inc ax - 33056 00004A7F D1E0 shl ax,1 ; ax = (ax+1)*2 - 33057 00004A81 01C3 add bx,ax ; now bx points to maxs - 33058 00004A83 C3 retn - 33059 - 33060 $P_SW_Manager: - 33061 00004A84 E8F1FF call $P_get_max_ptr - 33062 00004A87 268A0F mov cl,[es:bx] - 33063 00004A8A 30ED xor ch,ch ; cx = maxs - 33064 ; at least one switch ? - 33065 00004A8C E30F jcxz $P_SW_Not_Found ; no - 33066 00004A8E 43 inc bx ; now bx points to 1st CONTROL address - 33067 %endif - 33068 - 33069 $P_SW_Mgr_Loop: ;AN000; - 33070 00004A8F 53 push bx ;AN000; - 33071 00004A90 268B1F mov bx,[es:bx] ;AN000; bx points to Switch CONTROL itself - 33072 00004A93 E8B700 call $P_Chk_SW_Control ;AN000; do process for switch - 33073 00004A96 5B pop bx ;AN000; - 33074 00004A97 7337 jnc short $P_Return_to_Caller - 33075 ;AN000; if the CONTROL is for the switch, exit - 33076 00004A99 43 inc bx ;AC035; add '2' to - 33077 00004A9A 43 inc bx ;AC035; BX reg - 33078 ;AN000; else bx points to the next CONTROL - 33079 00004A9B E2F2 loop $P_SW_Mgr_Loop ;AN000; and loop - 33080 $P_SW_Not_Found: ;AN000; - 33081 ;mov word [cs:$P_RC],3 - 33082 00004A9D 2EC706[BA97]0300 mov word [cs:$P_RC],$P_Not_In_SW - 33083 ;AC034; here no CONTROL for the switch has - 33084 00004AA4 EB2A jmp short $P_Return_to_Caller0 - 33085 ;AN000; not been found, means error. - 33086 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 33087 %if 0 - 33088 $P_Key_Manager: ;AN000; - 33089 ;mov al,[es:bx+1] ;AN000; get maxp - 33090 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] - 33091 xor ah,ah ;AN000; ax = maxp - 33092 inc ax ;AN000; - 33093 shl ax,1 ;AN000; ax = (ax+1)*2 - 33094 add bx,ax ;AN000; now bx points to maxs - 33095 mov al,[es:bx] ;AN000; - 33096 xor ah,ah ;AN000; ax = maxs - 33097 shl ax,1 ;AN000; - 33098 inc ax ;AN000; ax = ax*2+1 - 33099 add bx,ax ;AN000; now bx points to maxk - 33100 mov cl,[es:bx] ;AN000; - 33101 xor ch,ch ;AN000; cx = maxk - 33102 or cx,cx ;AN000; at least one keyword ? - 33103 jz short $P_Key_Not_Found ;AN000; - 33104 inc bx ;AN000; now bx points to 1st CONTROL - 33105 %else - 33106 $P_Key_Manager: - 33107 00004AA6 E8CFFF call $P_get_max_ptr - 33108 00004AA9 268A07 mov al,[es:bx] - 33109 00004AAC 30E4 xor ah,ah ; ax = maxs - 33110 00004AAE D1E0 shl ax,1 - 33111 00004AB0 40 inc ax ; ax = ax*2+1 - 33112 00004AB1 01C3 add bx,ax ; now bx points to maxk - 33113 00004AB3 268A0F mov cl,[es:bx] - 33114 00004AB6 30ED xor ch,ch ; cx = maxk - 33115 ; at least one keyword ? - 33116 00004AB8 E30F jcxz $P_Key_Not_Found - 33117 00004ABA 43 inc bx ; now bx points to 1st CONTROL - 33118 %endif - 33119 - 33120 $P_Key_Mgr_Loop: ;AN000; - 33121 00004ABB 53 push bx ;AN000; - 33122 00004ABC 268B1F mov bx,[es:bx] ;AN000; bx points to keyword CONTROL itself - 33123 00004ABF E85A00 call $P_Chk_Key_Control ;AN000; do process for keyword - 33124 00004AC2 5B pop bx ;AN000; - 33125 00004AC3 730B jnc short $P_Return_to_Caller - 33126 ;AN000; if the CONTROL is for the keyword, exit - 33127 00004AC5 43 inc bx ;AC035; add '2' to - 33128 00004AC6 43 inc bx ;AC035; BX reg - 33129 ;AN000; else bx points to the next CONTROL - 33130 00004AC7 E2F2 loop $P_Key_Mgr_Loop ;AN000; and loop - 33131 $P_Key_Not_Found: ;AN000; - 33132 ;mov word [cs:$P_RC],4 - 33133 00004AC9 2EC706[BA97]0400 mov word [cs:$P_RC],$P_Not_In_Key - 33134 ;AC034; here no CONTROL for the keyword has - 33135 $P_Return_to_Caller0: - 33136 $P_Return_to_Caller: ;AN000; not been found, means error. - 33137 00004AD0 5D pop bp ;AN000; - 33138 00004AD1 5F pop di ;AN000; - 33139 00004AD2 5B pop bx ;AN000; - 33140 00004AD3 2E8B0E[B897] mov cx,[cs:$P_ORDINAL] ;AC034; return next ordinal - 33141 00004AD8 2EA1[BA97] mov ax,[cs:$P_RC] ;AC034; return exit code - 33142 00004ADC 2E8B36[BC97] mov si,[cs:$P_SI_Save] ;AC034; return next operand pointer - 33143 00004AE1 2E8B16[BE97] mov dx,[cs:$P_DX] ;AC034; return result buffer address - 33144 00004AE6 2E8A1E[C097] mov bl,[cs:$P_Terminator] ;AC034; return delimiter code found - 33145 $P_Single_Exit: ;AN000; - 33146 00004AEB F8 clc ;AN000; - 33147 00004AEC C3 retn ;AN000; - 33148 - 33149 ;*********************************************************************** - 33150 ; $P_Chk_Pos_Control - 33151 ; - 33152 ; Function: Parse CONTROL block for a positional - 33153 ; - 33154 ; Input: ES:BX -> CONTROL block - 33155 ; psdata_seg:SI -> $P_STRING_BUF + 32959 000049EF E84609 call $P_Chk_Delim ;AN000; Check delimiter + 32960 000049F2 7518 jne short $P_PL01 ;AN000; If no, process next byte + 32961 + 32962 000049F4 2EF606[C697]20 test byte [cs:$P_Flags2],$P_Extra ; 20h + 32963 ;test byte [cs:$P_Flags2],20h ;AC034; 3/9 If yes and white spec, + 32964 000049FA 7505 jnz short $P_Pack_End_backup_si + 32965 ;AN000; (tm08) + 32966 000049FC E8E508 call $P_Skip_Delim ;AN000; skip subsequent white space,too + 32967 000049FF EB26 jmp short $P_Pack_End ;AN000; finish copy by placing NUL at end + 32968 + 32969 $P_Pack_End_backup_si: ;AN000; (tm08) + 32970 00004A01 2EF606[C697]41 test byte [cs:$P_Flags2],$P_SW+$P_equ ; 41h + 32971 ;test byte [cs:$P_Flags2],41h ;AN000;AC034; (tm08) + 32972 00004A07 741E jz short $P_Pack_End ;AN000; (tm08) + 32973 + 32974 00004A09 4E dec si ;AN000; (tm08) + 32975 00004A0A EB1B jmp short $P_Pack_End ;AN025; (tm08) + 32976 $P_PL01: ;AN000; + 32977 00004A0C 2E8807 mov [cs:bx],al ;AN000; move byte to STRING_BUF + 32978 ;cmp al,'=' + 32979 00004A0F 3C3D cmp al,$P_Keyword ; '=' ;AN000; if it is equal character, + 32980 00004A11 7506 jne short $P_PL00 ;AN000; then + 32981 + 32982 00004A13 2E800E[C697]01 or byte [cs:$P_Flags2],$P_equ + 32983 ;or byte [cs:$P_Flags_2],1 ;AC034; remember it in flag + 32984 $P_PL00: ;AN000; + 32985 00004A19 43 inc bx ;AN000; ready to see next byte + 32986 00004A1A E8A509 call $P_Chk_DBCS ;AN000; was it 1st byte of DBCS ? + 32987 00004A1D 73C5 jnc short $P_Pack_Loop ;AN000; if no, process to next byte + 32988 + 32989 00004A1F AC lodsb ;AN000; if yes, store + 32990 00004A20 2E8807 mov [cs:bx],al ;AN000; 2nd byte of DBCS + 32991 00004A23 43 inc bx ;AN000; update pointer + 32992 00004A24 EBBE jmp short $P_Pack_Loop ;AN000; process to next byte + 32993 + 32994 $P_Pack_End_BY_EOL: ;AN000; + 32995 00004A26 4E dec si ;AN000; backup si pointer + 32996 $P_Pack_End: ;AN000; + 32997 00004A27 2E8936[BC97] mov [cs:$P_SI_Save],si ;AC034; save next pointer, SI + 32998 ;mov byte [cs:bx],0 + 32999 00004A2C 2EC60700 mov byte [cs:bx],$P_NULL ;AN000; put NULL at the end + 33000 00004A30 2E891E[CB97] mov [cs:$P_Save_EOB],bx + 33001 ;AC034; 3/17/87 keep the address for later use of complex + 33002 ;mov bx,[es:di+$P_PARMS_BLK.$P_PARMSX_Address] + 33003 00004A35 268B1D mov bx,[es:di] ;AN000; get PARMSX address + 33004 00004A38 8D36[CF97] lea si,$P_STRING_BUF ;AC034; + 33005 ;cmp byte [cs:si],'/' + 33006 00004A3C 2E803C2F cmp byte [cs:si],$P_Switch ;AN000; the operand begins w/ switch char ? + 33007 00004A40 7442 je short $P_SW_Manager ;AN000; if yes, process as switch + 33008 + 33009 00004A42 2E803C22 cmp byte [cs:si],$P_DQuote ;M005;is it a string? + 33010 00004A46 7408 je short $P_Positional_Manager + 33011 ;M005;if so, process as one! + 33012 00004A48 2EF606[C697]01 test byte [cs:$P_Flags2],$P_equ + 33013 ;test byte [cs:$P_Flags2],1 ;AC034; the operand includes equal char ? + 33014 00004A4E 7556 jnz short $P_Key_Manager ;AN000; if yes, process as keyword + 33015 + 33016 $P_Positional_Manager: ;AN000; else process as positional + 33017 ;mov al,[es:bx+1] ;AN000; get maxp + 33018 00004A50 268A4701 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] + 33019 00004A54 30E4 xor ah,ah ;AN000; ax = maxp + 33020 00004A56 2E3906[B897] cmp [cs:$P_ORDINAL],ax ;AC034; too many positional ? + 33021 00004A5B 7312 jae short $P_Too_Many_Error ;AN000; if yes, set exit code to too many + 33022 + 33023 00004A5D 2EA1[B897] mov ax,[cs:$P_ORDINAL] ;AC034; see what the current ordinal + 33024 00004A61 D1E0 shl ax,1 ;AN000; ax = ax*2 + 33025 00004A63 43 inc bx ;AC035; add '2' to + 33026 00004A64 43 inc bx ;AC035; BX reg + 33027 ;AN000; now bx points to 1st CONTROL + 33028 00004A65 01C3 add bx,ax ;AN000; now bx points to specified CONTROL address + 33029 00004A67 268B1F mov bx,[es:bx] ;AN000; now bx points to specified CONTROL itself + 33030 00004A6A E88000 call $P_Chk_Pos_Control ;AN000; Do process for positional + 33031 00004A6D EB61 jmp short $P_Return_to_Caller + 33032 ;AN000; and return to the caller + 33033 $P_Too_Many_Error: ;AN000; + 33034 ;mov word [cs:$P_RC],1 + 33035 00004A6F 2EC706[BA97]0100 mov word [cs:$P_RC],$P_Too_Many + 33036 ;AC034; set exit code + 33037 00004A76 EB58 jmp short $P_Return_to_Caller + 33038 ;AN000; and return to the caller + 33039 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 33040 %if 0 + 33041 $P_SW_Manager: ;AN000; + 33042 ;mov al,[es:bx+1] ;AN000; get maxp + 33043 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] + 33044 xor ah,ah ;AN000; ax = maxp + 33045 inc ax ;AN000; + 33046 shl ax,1 ;AN000; ax = (ax+1)*2 + 33047 add bx,ax ;AN000; now bx points to maxs + 33048 mov cl,[es:bx] ;AN000; + 33049 xor ch,ch ;AN000; cx = maxs + 33050 or cx,cx ;AN000; at least one switch ? + 33051 jz short $P_SW_Not_Found ;AN000; + 33052 inc bx ;AN000; now bx points to 1st CONTROL address + 33053 %else + 33054 $P_get_max_ptr: + 33055 ;mov al,[es:bx+1] ; get maxp + 33056 00004A78 268A4701 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] + 33057 00004A7C 30E4 xor ah,ah ; ax = maxp + 33058 00004A7E 40 inc ax + 33059 00004A7F D1E0 shl ax,1 ; ax = (ax+1)*2 + 33060 00004A81 01C3 add bx,ax ; now bx points to maxs + 33061 00004A83 C3 retn + 33062 + 33063 $P_SW_Manager: + 33064 00004A84 E8F1FF call $P_get_max_ptr + 33065 00004A87 268A0F mov cl,[es:bx] + 33066 00004A8A 30ED xor ch,ch ; cx = maxs + 33067 ; at least one switch ? + 33068 00004A8C E30F jcxz $P_SW_Not_Found ; no + 33069 00004A8E 43 inc bx ; now bx points to 1st CONTROL address + 33070 %endif + 33071 + 33072 $P_SW_Mgr_Loop: ;AN000; + 33073 00004A8F 53 push bx ;AN000; + 33074 00004A90 268B1F mov bx,[es:bx] ;AN000; bx points to Switch CONTROL itself + 33075 00004A93 E8B700 call $P_Chk_SW_Control ;AN000; do process for switch + 33076 00004A96 5B pop bx ;AN000; + 33077 00004A97 7337 jnc short $P_Return_to_Caller + 33078 ;AN000; if the CONTROL is for the switch, exit + 33079 00004A99 43 inc bx ;AC035; add '2' to + 33080 00004A9A 43 inc bx ;AC035; BX reg + 33081 ;AN000; else bx points to the next CONTROL + 33082 00004A9B E2F2 loop $P_SW_Mgr_Loop ;AN000; and loop + 33083 $P_SW_Not_Found: ;AN000; + 33084 ;mov word [cs:$P_RC],3 + 33085 00004A9D 2EC706[BA97]0300 mov word [cs:$P_RC],$P_Not_In_SW + 33086 ;AC034; here no CONTROL for the switch has + 33087 00004AA4 EB2A jmp short $P_Return_to_Caller0 + 33088 ;AN000; not been found, means error. + 33089 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 33090 %if 0 + 33091 $P_Key_Manager: ;AN000; + 33092 ;mov al,[es:bx+1] ;AN000; get maxp + 33093 mov al,[es:bx+$P_PARMSX_BLK.$P_MaxP] + 33094 xor ah,ah ;AN000; ax = maxp + 33095 inc ax ;AN000; + 33096 shl ax,1 ;AN000; ax = (ax+1)*2 + 33097 add bx,ax ;AN000; now bx points to maxs + 33098 mov al,[es:bx] ;AN000; + 33099 xor ah,ah ;AN000; ax = maxs + 33100 shl ax,1 ;AN000; + 33101 inc ax ;AN000; ax = ax*2+1 + 33102 add bx,ax ;AN000; now bx points to maxk + 33103 mov cl,[es:bx] ;AN000; + 33104 xor ch,ch ;AN000; cx = maxk + 33105 or cx,cx ;AN000; at least one keyword ? + 33106 jz short $P_Key_Not_Found ;AN000; + 33107 inc bx ;AN000; now bx points to 1st CONTROL + 33108 %else + 33109 $P_Key_Manager: + 33110 00004AA6 E8CFFF call $P_get_max_ptr + 33111 00004AA9 268A07 mov al,[es:bx] + 33112 00004AAC 30E4 xor ah,ah ; ax = maxs + 33113 00004AAE D1E0 shl ax,1 + 33114 00004AB0 40 inc ax ; ax = ax*2+1 + 33115 00004AB1 01C3 add bx,ax ; now bx points to maxk + 33116 00004AB3 268A0F mov cl,[es:bx] + 33117 00004AB6 30ED xor ch,ch ; cx = maxk + 33118 ; at least one keyword ? + 33119 00004AB8 E30F jcxz $P_Key_Not_Found + 33120 00004ABA 43 inc bx ; now bx points to 1st CONTROL + 33121 %endif + 33122 + 33123 $P_Key_Mgr_Loop: ;AN000; + 33124 00004ABB 53 push bx ;AN000; + 33125 00004ABC 268B1F mov bx,[es:bx] ;AN000; bx points to keyword CONTROL itself + 33126 00004ABF E85A00 call $P_Chk_Key_Control ;AN000; do process for keyword + 33127 00004AC2 5B pop bx ;AN000; + 33128 00004AC3 730B jnc short $P_Return_to_Caller + 33129 ;AN000; if the CONTROL is for the keyword, exit + 33130 00004AC5 43 inc bx ;AC035; add '2' to + 33131 00004AC6 43 inc bx ;AC035; BX reg + 33132 ;AN000; else bx points to the next CONTROL + 33133 00004AC7 E2F2 loop $P_Key_Mgr_Loop ;AN000; and loop + 33134 $P_Key_Not_Found: ;AN000; + 33135 ;mov word [cs:$P_RC],4 + 33136 00004AC9 2EC706[BA97]0400 mov word [cs:$P_RC],$P_Not_In_Key + 33137 ;AC034; here no CONTROL for the keyword has + 33138 $P_Return_to_Caller0: + 33139 $P_Return_to_Caller: ;AN000; not been found, means error. + 33140 00004AD0 5D pop bp ;AN000; + 33141 00004AD1 5F pop di ;AN000; + 33142 00004AD2 5B pop bx ;AN000; + 33143 00004AD3 2E8B0E[B897] mov cx,[cs:$P_ORDINAL] ;AC034; return next ordinal + 33144 00004AD8 2EA1[BA97] mov ax,[cs:$P_RC] ;AC034; return exit code + 33145 00004ADC 2E8B36[BC97] mov si,[cs:$P_SI_Save] ;AC034; return next operand pointer + 33146 00004AE1 2E8B16[BE97] mov dx,[cs:$P_DX] ;AC034; return result buffer address + 33147 00004AE6 2E8A1E[C097] mov bl,[cs:$P_Terminator] ;AC034; return delimiter code found + 33148 $P_Single_Exit: ;AN000; + 33149 00004AEB F8 clc ;AN000; + 33150 00004AEC C3 retn ;AN000; + 33151 + 33152 ;*********************************************************************** + 33153 ; $P_Chk_Pos_Control + 33154 ; + 33155 ; Function: Parse CONTROL block for a positional 33156 ; - 33157 ; Output: None - 33158 ; - 33159 ; Use: $P_Fill_Result, $P_Check_Match_Flags - 33160 ; - 33161 ; Vars: $P_Ordinal(W), $P_RC(W) - 33162 ;*********************************************************************** - 33163 - 33164 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33165 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4671h + 33157 ; Input: ES:BX -> CONTROL block + 33158 ; psdata_seg:SI -> $P_STRING_BUF + 33159 ; + 33160 ; Output: None + 33161 ; + 33162 ; Use: $P_Fill_Result, $P_Check_Match_Flags + 33163 ; + 33164 ; Vars: $P_Ordinal(W), $P_RC(W) + 33165 ;*********************************************************************** 33166 - 33167 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33168 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4E35h + 33167 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33168 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4671h 33169 - 33170 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33171 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4CF5h - 33172 $P_Chk_Pos_Control: - 33173 00004AED 50 push ax ;AN000; - 33174 ;mov ax,[es:bx+$P_CONTROL_BLK.$P_Match_Flag] - 33175 00004AEE 268B07 mov ax,[es:bx] ;AN000; - 33176 ;test ax,2 - 33177 00004AF1 A90200 test ax,$P_Repeat ;AN000; repeat allowed ? - 33178 00004AF4 7505 jnz short $P_CPC00 ;AN000; then do not increment ORDINAL - 33179 - 33180 00004AF6 2EFF06[B897] inc word [cs:$P_ORDINAL] ;AC034; update the ordinal - 33181 $P_CPC00: ;AN000; - 33182 ;cmp byte [cs:si],0 - 33183 00004AFB 2E803C00 cmp byte [cs:si],$P_NULL ;AN000; no data ? - 33184 00004AFF 7516 jne short $P_CPC01 ;AN000; - 33185 - 33186 ;test ax,1 - 33187 00004B01 A90100 test ax,$P_Optional ;AN000; yes, then is it optional ? - 33188 00004B04 7509 jnz short $P_CPC02 ;AN000; - 33189 - 33190 00004B06 2EC706[BA97]0200 mov word [cs:$P_RC],$P_Op_Missing ; 2 - 33191 ;AC034; no, then error 3/17/87 - 33192 00004B0D EB0B jmp short $P_CPC_Exit ;AN000; - 33193 $P_CPC02: ;AN000; - 33194 ; 27/04/2023 - 33195 ;push ax ; * ;AN000; - 33196 ; - 33197 ;;mov al,3 - 33198 ;mov al,$P_String ;AN000; if it is optional return NULL - 33199 ;;mov ah,0FFh - 33200 ;mov ah,$P_No_Tag ;AN000; no item tag indication - 33201 ; 31/03/2023 - 33202 00004B0F B803FF mov ax,($P_No_Tag<<8)+$P_String - 33203 00004B12 E89500 call $P_Fill_Result ;AN000; - 33204 ; 27/04/2023 - 33205 ;pop ax ; * ;AN000; - 33206 00004B15 EB03 jmp short $P_CPC_Exit ;AN000; - 33207 $P_CPC01: ;AN000; - 33208 00004B17 E81101 call $P_Check_Match_Flags ;AN000; - 33209 $P_CPC_Exit: ;AN000; - 33210 00004B1A 58 pop ax ;AN000; - 33211 00004B1B C3 retn ;AN000; - 33212 - 33213 ;*********************************************************************** - 33214 ; $P_Chk_Key_Control - 33215 ; - 33216 ; Function: Parse CONTROL block for a keyword - 33217 ; - 33218 ; Input: ES:BX -> CONTROL block - 33219 ; psdata_seg:SI -> $P_STRING_BUF + 33170 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33171 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4E35h + 33172 + 33173 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33174 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4CF5h + 33175 $P_Chk_Pos_Control: + 33176 00004AED 50 push ax ;AN000; + 33177 ;mov ax,[es:bx+$P_CONTROL_BLK.$P_Match_Flag] + 33178 00004AEE 268B07 mov ax,[es:bx] ;AN000; + 33179 ;test ax,2 + 33180 00004AF1 A90200 test ax,$P_Repeat ;AN000; repeat allowed ? + 33181 00004AF4 7505 jnz short $P_CPC00 ;AN000; then do not increment ORDINAL + 33182 + 33183 00004AF6 2EFF06[B897] inc word [cs:$P_ORDINAL] ;AC034; update the ordinal + 33184 $P_CPC00: ;AN000; + 33185 ;cmp byte [cs:si],0 + 33186 00004AFB 2E803C00 cmp byte [cs:si],$P_NULL ;AN000; no data ? + 33187 00004AFF 7516 jne short $P_CPC01 ;AN000; + 33188 + 33189 ;test ax,1 + 33190 00004B01 A90100 test ax,$P_Optional ;AN000; yes, then is it optional ? + 33191 00004B04 7509 jnz short $P_CPC02 ;AN000; + 33192 + 33193 00004B06 2EC706[BA97]0200 mov word [cs:$P_RC],$P_Op_Missing ; 2 + 33194 ;AC034; no, then error 3/17/87 + 33195 00004B0D EB0B jmp short $P_CPC_Exit ;AN000; + 33196 $P_CPC02: ;AN000; + 33197 ; 27/04/2023 + 33198 ;push ax ; * ;AN000; + 33199 ; + 33200 ;;mov al,3 + 33201 ;mov al,$P_String ;AN000; if it is optional return NULL + 33202 ;;mov ah,0FFh + 33203 ;mov ah,$P_No_Tag ;AN000; no item tag indication + 33204 ; 31/03/2023 + 33205 00004B0F B803FF mov ax,($P_No_Tag<<8)+$P_String + 33206 00004B12 E89500 call $P_Fill_Result ;AN000; + 33207 ; 27/04/2023 + 33208 ;pop ax ; * ;AN000; + 33209 00004B15 EB03 jmp short $P_CPC_Exit ;AN000; + 33210 $P_CPC01: ;AN000; + 33211 00004B17 E81101 call $P_Check_Match_Flags ;AN000; + 33212 $P_CPC_Exit: ;AN000; + 33213 00004B1A 58 pop ax ;AN000; + 33214 00004B1B C3 retn ;AN000; + 33215 + 33216 ;*********************************************************************** + 33217 ; $P_Chk_Key_Control + 33218 ; + 33219 ; Function: Parse CONTROL block for a keyword 33220 ; - 33221 ; Output: CY = 1 : not match - 33222 ; - 33223 ; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags - 33224 ; - 33225 ; Vars: $P_RC(W), $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W) - 33226 ;*********************************************************************** - 33227 - 33228 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33229 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33230 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33231 $P_Chk_Key_Control: ;AN000; - 33232 00004B1C F9 stc ;AN000;this logic works when the KeySW - 33233 00004B1D C3 retn ;AN000;is reset. - 33234 - 33235 ;*********************************************************************** - 33236 ; $P_Search_KEYorSW: - 33237 ; - 33238 ; Function: Seach specified keyword or switch from CONTROL - 33239 ; - 33240 ; Input: ES:BX -> CONTROL block - 33241 ; psdata_seg:SI -> $P_STRING_BUF + 33221 ; Input: ES:BX -> CONTROL block + 33222 ; psdata_seg:SI -> $P_STRING_BUF + 33223 ; + 33224 ; Output: CY = 1 : not match + 33225 ; + 33226 ; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags + 33227 ; + 33228 ; Vars: $P_RC(W), $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W) + 33229 ;*********************************************************************** + 33230 + 33231 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33232 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33233 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33234 $P_Chk_Key_Control: ;AN000; + 33235 00004B1C F9 stc ;AN000;this logic works when the KeySW + 33236 00004B1D C3 retn ;AN000;is reset. + 33237 + 33238 ;*********************************************************************** + 33239 ; $P_Search_KEYorSW: + 33240 ; + 33241 ; Function: Seach specified keyword or switch from CONTROL 33242 ; - 33243 ; Output: CY = 1 : not match - 33244 ; - 33245 ; Use: $P_String_Comp, $P_MoveBP_NUL, $P_Found_SYNONYM - 33246 ;*********************************************************************** - 33247 - 33248 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33249 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33250 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33251 $P_Search_KEYorSW: - 33252 00004B1E 55 push bp ;AN000; - 33253 00004B1F 51 push cx ;AN000; - 33254 00004B20 268A4F08 mov cl,[es:bx+$P_CONTROL_BLK.$P_nid] - 33255 ;mov cl,[es:bx+8] ;AN000; Get synonym count - 33256 ; 14/06/2023 - 33257 ;xor ch,ch ;AN000; and set it to cx - 33258 ;or cx,cx ;AN000; No synonyms specified ? - 33259 00004B24 08C9 or cl,cl - 33260 00004B26 740E jz short $P_KEYorSW_Not_Found - 33261 ;AN000; then indicate not found by CY - 33262 00004B28 268D6F09 lea bp,[es:bx+$P_CONTROL_BLK.$P_KEYorSW] - 33263 ;lea bp,[es:bx+9] ;AN000; BP points to the 1st synonym - 33264 $P_KEYorSW_Loop: ;AN000; - 33265 00004B2C E8E703 call $P_String_Comp ;AN000; compare string in buffer w/ the synonym - 33266 00004B2F 7308 jnc short $P_KEYorSW_Found ;AN000; If match, set it to synonym pointer - 33267 00004B31 E80D00 call $P_MoveBP_NUL ;AN000; else, bp points to the next string - 33268 00004B34 E2F6 loop $P_KEYorSW_Loop ;AN000; loop nid times - 33269 $P_KEYorSW_Not_Found: ;AN000; - 33270 00004B36 F9 stc ;AN000; indicate not found in synonym list - 33271 00004B37 EB05 jmp short $P_KEYorSW_Exit ;AN000; and exit - 33272 $P_KEYorSW_Found: ;AN000; - 33273 00004B39 2E892E[CD97] mov [cs:$P_Found_SYNONYM],bp - 33274 ;AC034; set synonym pointer - 33275 ; 27/04/2023 - 33276 ; cf = 0 - 33277 ;clc ;AN000; indicate found - 33278 $P_KEYorSW_Exit: ;AN000; - 33279 00004B3E 59 pop cx ;AN000; - 33280 00004B3F 5D pop bp ;AN000; - 33281 00004B40 C3 retn ;AN000; - 33282 - 33283 ;*********************************************************************** - 33284 ; $P_MoveBP_NUL - 33285 ;*********************************************************************** - 33286 - 33287 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33288 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33289 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33290 $P_MoveBP_NUL: - 33291 $P_MBP_Loop: ;AN000; - 33292 ;cmp byte [es:bp+0],0 - 33293 00004B41 26807E0000 cmp byte [es:bp],$P_NULL ;AN000; Increment BP that points - 33294 00004B46 7403 je short $P_MBP_Exit ;AN000; to the synomym list - 33295 00004B48 45 inc bp ;AN000; until - 33296 00004B49 EBF6 jmp short $P_MBP_Loop ;AN000; NULL encountered. - 33297 $P_MBP_Exit: ;AN000; - 33298 00004B4B 45 inc bp ;AN000; bp points to next to NULL - 33299 00004B4C C3 retn ;AN000; - 33300 - 33301 ;*********************************************************************** - 33302 ; $P_Chk_SW_Control - 33303 ; - 33304 ; Function: Parse CONTROL block for a switch - 33305 ; - 33306 ; Input: ES:BX -> CONTROL block - 33307 ; psdata_seg:SI -> $P_STRING_BUF + 33243 ; Input: ES:BX -> CONTROL block + 33244 ; psdata_seg:SI -> $P_STRING_BUF + 33245 ; + 33246 ; Output: CY = 1 : not match + 33247 ; + 33248 ; Use: $P_String_Comp, $P_MoveBP_NUL, $P_Found_SYNONYM + 33249 ;*********************************************************************** + 33250 + 33251 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33252 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33253 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33254 $P_Search_KEYorSW: + 33255 00004B1E 55 push bp ;AN000; + 33256 00004B1F 51 push cx ;AN000; + 33257 00004B20 268A4F08 mov cl,[es:bx+$P_CONTROL_BLK.$P_nid] + 33258 ;mov cl,[es:bx+8] ;AN000; Get synonym count + 33259 ; 14/06/2023 + 33260 ;xor ch,ch ;AN000; and set it to cx + 33261 ;or cx,cx ;AN000; No synonyms specified ? + 33262 00004B24 08C9 or cl,cl + 33263 00004B26 740E jz short $P_KEYorSW_Not_Found + 33264 ;AN000; then indicate not found by CY + 33265 00004B28 268D6F09 lea bp,[es:bx+$P_CONTROL_BLK.$P_KEYorSW] + 33266 ;lea bp,[es:bx+9] ;AN000; BP points to the 1st synonym + 33267 $P_KEYorSW_Loop: ;AN000; + 33268 00004B2C E8E703 call $P_String_Comp ;AN000; compare string in buffer w/ the synonym + 33269 00004B2F 7308 jnc short $P_KEYorSW_Found ;AN000; If match, set it to synonym pointer + 33270 00004B31 E80D00 call $P_MoveBP_NUL ;AN000; else, bp points to the next string + 33271 00004B34 E2F6 loop $P_KEYorSW_Loop ;AN000; loop nid times + 33272 $P_KEYorSW_Not_Found: ;AN000; + 33273 00004B36 F9 stc ;AN000; indicate not found in synonym list + 33274 00004B37 EB05 jmp short $P_KEYorSW_Exit ;AN000; and exit + 33275 $P_KEYorSW_Found: ;AN000; + 33276 00004B39 2E892E[CD97] mov [cs:$P_Found_SYNONYM],bp + 33277 ;AC034; set synonym pointer + 33278 ; 27/04/2023 + 33279 ; cf = 0 + 33280 ;clc ;AN000; indicate found + 33281 $P_KEYorSW_Exit: ;AN000; + 33282 00004B3E 59 pop cx ;AN000; + 33283 00004B3F 5D pop bp ;AN000; + 33284 00004B40 C3 retn ;AN000; + 33285 + 33286 ;*********************************************************************** + 33287 ; $P_MoveBP_NUL + 33288 ;*********************************************************************** + 33289 + 33290 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33291 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33292 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33293 $P_MoveBP_NUL: + 33294 $P_MBP_Loop: ;AN000; + 33295 ;cmp byte [es:bp+0],0 + 33296 00004B41 26807E0000 cmp byte [es:bp],$P_NULL ;AN000; Increment BP that points + 33297 00004B46 7403 je short $P_MBP_Exit ;AN000; to the synomym list + 33298 00004B48 45 inc bp ;AN000; until + 33299 00004B49 EBF6 jmp short $P_MBP_Loop ;AN000; NULL encountered. + 33300 $P_MBP_Exit: ;AN000; + 33301 00004B4B 45 inc bp ;AN000; bp points to next to NULL + 33302 00004B4C C3 retn ;AN000; + 33303 + 33304 ;*********************************************************************** + 33305 ; $P_Chk_SW_Control + 33306 ; + 33307 ; Function: Parse CONTROL block for a switch 33308 ; - 33309 ; Output: CY = 1 : not match - 33310 ; - 33311 ; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags - 33312 ; - 33313 ; Vars: $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W) - 33314 ;*********************************************************************** - 33315 - 33316 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33317 ; - 33318 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33319 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4E9Ah - 33320 - 33321 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33322 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4D57h - 33323 $P_Chk_SW_Control: - 33324 00004B4D 2E800E[C697]10 or byte [cs:$P_Flags2],$P_SW_Cmp - 33325 ;or byte [cs:$P_Flags2],10h ;AC034; Indicate switch for later string comparison - 33326 00004B53 E8C8FF call $P_Search_KEYorSW ;AN000; Search the switch in the CONTROL block - 33327 00004B56 7251 jc short $P_Chk_SW_Err0 ;AN000; not found, then try next CONTROL - 33328 - 33329 00004B58 2E8026[C697]EF and byte [cs:$P_Flags2],0FFh-$P_SW_Cmp - 33330 ;and byte [cs:$P_Flags2],0EFh - 33331 ;AC034; reset the indicator previously set - 33332 00004B5E 50 push ax ;AN000; /switch: - 33333 00004B5F 2EA1[C997] mov ax,[cs:$P_KEYorSW_Ptr] ;AC034; ^ ^ - 33334 00004B63 29F0 sub ax,si ;AN000; SI KEYorSW - 33335 00004B65 2E0106[C797] add [cs:$P_SaveSI_Cmpx],ax ;AC034; update for complex list - 33336 00004B6A 58 pop ax ;AN000; - 33337 - 33338 00004B6B 2E8B36[C997] mov si,[cs:$P_KEYorSW_Ptr] ;AC034; set si at the end or colon - 33339 ;cmp byte [cs:si],0 - 33340 00004B70 2E803C00 cmp byte [cs:si],$P_NULL ;AN000; any data after colon - 33341 00004B74 7525 jne short $P_CSW00 ;AN000; if yes, process match flags - 33342 - 33343 ;cmp byte [cs:si],':' - 33344 00004B76 2E807CFF3A cmp byte [cs:si-1],$P_Colon - 33345 ;AN000; if no, the switch terminated by colon ? - 33346 00004B7B 7509 jne short $P_Chk_if_data_required - 33347 ;AN000; if yes, - 33348 - 33349 00004B7D 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax - 33350 ;mov word [cs:$P_RC],9 ;AC034; return syntax error - 33351 00004B84 EB1A jmp short $P_Chk_SW_Exit ;AN000; - 33352 - 33353 $P_Chk_if_data_required: ;AN018; no data, no colon - 33354 ;cmp word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],0 - 33355 ; 27/04/2023 - 33356 00004B86 26833F00 cmp word [es:bx],0 ;AN018; should have data? zero match flag means switch followed by nothing is OK - 33357 00004B8A 7414 je short $P_Chk_SW_Exit ;AN018; match flags not zero so should have something if optional bit is not on - 33358 - 33359 ;;test word [es:bx],1 ; $P_Optional - 33360 ;test byte [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Optional - 33361 00004B8C 26F60701 test byte [es:bx],$P_Optional - 33362 ;AN019; see if no value is valid - 33363 00004B90 750E jnz short $P_Chk_SW_Exit ;AN019; if so, then leave, else yell - 33364 - 33365 00004B92 2EC706[BA97]0200 mov word [cs:$P_RC],$P_Op_Missing - 33366 ;mov word [cs:$P_RC],2 ;AC034; return required operand missing - 33367 00004B99 EB05 jmp short $P_Chk_SW_Exit ;AN018; - 33368 - 33369 $P_CSW00: ;AN000; - 33370 00004B9B E88D00 call $P_Check_Match_Flags ;AN000; process match flag - 33371 00004B9E F8 clc ;AN000; indicate match - 33372 ;jmp short $P_Chk_SW_Single_Exit - 33373 00004B9F C3 retn ; 31/03/2023 ;AN000; - 33374 ; 31/03/2023 - 33375 ;$P_Chk_SW_Err0: ;AN000; - 33376 ; stc ;AN000; not found in switch synonym list - 33377 ; ;jmp short $P_Chk_SW_Single_Exit - 33378 ; retn ; 31/03/2023 ;AN000; - 33379 - 33380 $P_Chk_SW_Exit: ;AN000; - 33381 00004BA0 50 push ax ;AN000; - 33382 ; 31/03/2023 - 33383 00004BA1 B803FF mov ax,($P_No_Tag<<8)+$P_String - 33384 ;;mov al,3 - 33385 ;;mov ah,0FFh - 33386 ;mov al,$P_String ;AN000; set - 33387 ;mov ah,$P_No_Tag ;AN000; result - 33388 00004BA4 E80300 call $P_Fill_Result ;AN000; buffer - 33389 00004BA7 58 pop ax ;AN000; - 33390 00004BA8 F8 clc ;AN000; - 33391 ; 31/03/2023 - 33392 $P_Chk_SW_Err0: - 33393 $P_Chk_SW_Single_Exit: ;AN000; - 33394 00004BA9 C3 retn ;AN000; - 33395 - 33396 ;*********************************************************************** - 33397 ; $P_Fill_Result - 33398 ; - 33399 ; Function: Fill the result buffer - 33400 ; - 33401 ; Input: AH = Item tag - 33402 ; AL = type - 33403 ; AL = 1: CX,DX has 32bit number (CX = high) - 33404 ; AL = 2: DX has index(offset) into value list - 33405 ; AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z) - 33406 ; AL = 7: DX has year, CL has month and CH has date - 33407 ; AL = 8: DL has hours, DH has minutes, CL has secondsn, - 33408 ; amd CH has hundredths - 33409 ; AL = else: psdata_seg:SI points to returned string buffer - 33410 ; ES:BX -> CONTROL block - 33411 ; - 33412 ; Output: None - 33413 ; - 33414 ; Use: $P_Do_CAPS_String, $P_Remove_Colon, $P_Found_SYNONYM - 33415 ; - 33416 ; Vars: $P_DX(W) - 33417 ;*********************************************************************** - 33418 - 33419 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33420 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33421 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33422 $P_Fill_Result: - 33423 00004BAA 57 push di ;AN000; - 33424 00004BAB 268B7F04 mov di,[es:bx+$P_CONTROL_BLK.$P_Result_Buf] - 33425 ;mov di,[es:bx+4] ;AN000; di points to result buffer - 33426 00004BAF 2E893E[BE97] mov [cs:$P_DX],di ;AC034; set returned result address - 33427 ;mov [es:di+$P_RESULT_BLK.$P_Type],al - 33428 ;;mov [es:di],al ;AN000; store type - 33429 ;mov [es:di+$P_RESULT_BLK.$P_Item_Tag],ah - 33430 ;;mov [es:di+1],ah ;AN000; store item tag - 33431 ; 31/03/2023 - 33432 00004BB4 268905 mov [es:di],ax - 33433 00004BB7 50 push ax ;AN000; - 33434 00004BB8 2EA1[CD97] mov ax,[cs:$P_Found_SYNONYM] - 33435 ;AC034; if yes, - 33436 00004BBC 26894502 mov [es:di+$P_RESULT_BLK.$P_SYNONYM_Ptr],ax - 33437 ;mov [es:di+2],ax ;AN000; then set it to the result - 33438 00004BC0 58 pop ax ;AN000; - 33439 $P_RLT04: ;AN000; - 33440 ;cmp al,1 - 33441 00004BC1 3C01 cmp al,$P_Number ;AN000; if number - 33442 00004BC3 750A jne short $P_RLT00 ;AN000; - 33443 $P_RLT02: ;AN000; - 33444 00004BC5 26895504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],dx - 33445 ;mov [es:di+4],dx ;AN000; then store 32bit - 33446 00004BC9 26894D06 mov [es:di+2+$P_RESULT_BLK.$P_Picked_Val],cx - 33447 ;mov [es:di+6],cx ;AN000; number - 33448 00004BCD EB5A jmp short $P_RLT_Exit ;AN000; - 33449 $P_RLT00: ;AN000; - 33450 ;cmp al,2 - 33451 00004BCF 3C02 cmp al,$P_List_Idx ;AN000; if list index - 33452 00004BD1 7506 jne short $P_RLT01 ;AN000; - 33453 00004BD3 26895504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],dx - 33454 ;mov [es:di+4],dx ;AN000; then store list index - 33455 00004BD7 EB50 jmp short $P_RLT_Exit ;AN000; - 33456 $P_RLT01: ;AN000; - 33457 ;cmp al,7 - 33458 00004BD9 3C07 cmp al,$P_Date_F ; 7 ;AN000; Date format ? - 33459 00004BDB 74E8 je short $P_RLT02 ;AN000; - 33460 ;cmp al,8 - 33461 00004BDD 3C08 cmp al,$P_Time_F ; 8 ;AN000; Time format ? - 33462 00004BDF 74E4 je short $P_RLT02 ;AN000; - 33463 ;cmp al,6 - 33464 00004BE1 3C06 cmp al,$P_Drive ; 6 ;AN000; drive format ? - 33465 00004BE3 7506 jne short $P_RLT03 ;AN000; - 33466 - 33467 00004BE5 26885504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],dl - 33468 ;mov [es:di+4],dl ;AN000; store drive number - 33469 00004BE9 EB3E jmp short $P_RLT_Exit ;AN000; - 33470 - 33471 $P_RLT03: ;AN000; - 33472 ;cmp al,4 - 33473 00004BEB 3C04 cmp al,$P_Complex ;AN000; complex format ? - 33474 00004BED 750F jne short $P_RLT05 ;AN000; - 33475 - 33476 00004BEF 2EA1[C797] mov ax,[cs:$P_SaveSI_Cmpx] ;AC034; then get pointer in command buffer - 33477 00004BF3 40 inc ax ;AN000; skip left Parentheses - 33478 00004BF4 26894504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],ax - 33479 ;mov [es:di+4],ax ;AN000; store offset - 33480 00004BF8 268C5D06 mov [es:di+2+$P_RESULT_BLK.$P_Picked_Val],ds - 33481 ;mov [es:di+6],ds ;AN000; store segment - 33482 00004BFC EB2B jmp short $P_RLT_Exit ;AN000; - 33483 - 33484 $P_RLT05: ;AN000; - 33485 ;------------------------ AL = 3, 5, or 9 - 33486 00004BFE 26897504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],si - 33487 ;mov [es:di+4],si ;AN000; store offset of STRING_BUF - 33488 00004C02 268C4D06 mov [es:di+2+$P_RESULT_BLK.$P_Picked_Val],cs - 33489 ;mov [es:di+6],cs ;AN031; store segment of STRING_BUF - 33490 - 33491 00004C06 50 push ax ;AN000; - 33492 00004C07 26F6470201 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_CAP_File - 33493 ;test byte [es:bx+2],1 ;AN000; need CAPS by file table? - 33494 00004C0C 7404 jz short $P_RLT_CAP00 ;AN000; - 33495 - 33496 ;mov al,4 - 33497 00004C0E B004 mov al,$P_DOSTBL_File ; 4 ;AN000; use file upper case table - 33498 00004C10 EB09 jmp short $P_RLT_CAP02 ;AN000; - 33499 - 33500 $P_RLT_CAP00: ;AN000; - 33501 00004C12 26F6470202 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_CAP_Char - 33502 ;test byte [es:bx+2],2 ;AN000; need CAPS by char table ? - 33503 00004C17 7405 jz short $P_RLT_CAP01 ;AN000; - 33504 - 33505 ;mov al,2 - 33506 00004C19 B002 mov al,$P_DOSTBL_Char ; 2 ;AN000; use character upper case table - 33507 $P_RLT_CAP02: ;AN000; - 33508 00004C1B E80C01 call $P_Do_CAPS_String ;AN000; process CAPS along the table - 33509 $P_RLT_CAP01: ;AN000; - 33510 00004C1E 58 pop ax ;AN000; - 33511 00004C1F 26F6470210 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_Rm_Colon - 33512 ;test byte [es:bx+2],10h ;AN000; removing colon at end ? - 33513 00004C24 7403 jz short $P_RLT_Exit ;AN000; - 33514 - 33515 00004C26 E8DD00 call $P_Remove_Colon ;AN000; then process it. - 33516 $P_RLT_Exit: ;AN000; - 33517 00004C29 5F pop di ;AN000; - 33518 00004C2A C3 retn ;AN000; - 33519 - 33520 ;*********************************************************************** - 33521 ; $P_Check_Match_Flags - 33522 ; - 33523 ; Function: Check the mutch_flags and make the exit code and set the - 33524 ; result buffer + 33309 ; Input: ES:BX -> CONTROL block + 33310 ; psdata_seg:SI -> $P_STRING_BUF + 33311 ; + 33312 ; Output: CY = 1 : not match + 33313 ; + 33314 ; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags + 33315 ; + 33316 ; Vars: $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W) + 33317 ;*********************************************************************** + 33318 + 33319 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33320 ; + 33321 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33322 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:4E9Ah + 33323 + 33324 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33325 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4D57h + 33326 $P_Chk_SW_Control: + 33327 00004B4D 2E800E[C697]10 or byte [cs:$P_Flags2],$P_SW_Cmp + 33328 ;or byte [cs:$P_Flags2],10h ;AC034; Indicate switch for later string comparison + 33329 00004B53 E8C8FF call $P_Search_KEYorSW ;AN000; Search the switch in the CONTROL block + 33330 00004B56 7251 jc short $P_Chk_SW_Err0 ;AN000; not found, then try next CONTROL + 33331 + 33332 00004B58 2E8026[C697]EF and byte [cs:$P_Flags2],0FFh-$P_SW_Cmp + 33333 ;and byte [cs:$P_Flags2],0EFh + 33334 ;AC034; reset the indicator previously set + 33335 00004B5E 50 push ax ;AN000; /switch: + 33336 00004B5F 2EA1[C997] mov ax,[cs:$P_KEYorSW_Ptr] ;AC034; ^ ^ + 33337 00004B63 29F0 sub ax,si ;AN000; SI KEYorSW + 33338 00004B65 2E0106[C797] add [cs:$P_SaveSI_Cmpx],ax ;AC034; update for complex list + 33339 00004B6A 58 pop ax ;AN000; + 33340 + 33341 00004B6B 2E8B36[C997] mov si,[cs:$P_KEYorSW_Ptr] ;AC034; set si at the end or colon + 33342 ;cmp byte [cs:si],0 + 33343 00004B70 2E803C00 cmp byte [cs:si],$P_NULL ;AN000; any data after colon + 33344 00004B74 7525 jne short $P_CSW00 ;AN000; if yes, process match flags + 33345 + 33346 ;cmp byte [cs:si],':' + 33347 00004B76 2E807CFF3A cmp byte [cs:si-1],$P_Colon + 33348 ;AN000; if no, the switch terminated by colon ? + 33349 00004B7B 7509 jne short $P_Chk_if_data_required + 33350 ;AN000; if yes, + 33351 + 33352 00004B7D 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax + 33353 ;mov word [cs:$P_RC],9 ;AC034; return syntax error + 33354 00004B84 EB1A jmp short $P_Chk_SW_Exit ;AN000; + 33355 + 33356 $P_Chk_if_data_required: ;AN018; no data, no colon + 33357 ;cmp word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],0 + 33358 ; 27/04/2023 + 33359 00004B86 26833F00 cmp word [es:bx],0 ;AN018; should have data? zero match flag means switch followed by nothing is OK + 33360 00004B8A 7414 je short $P_Chk_SW_Exit ;AN018; match flags not zero so should have something if optional bit is not on + 33361 + 33362 ;;test word [es:bx],1 ; $P_Optional + 33363 ;test byte [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Optional + 33364 00004B8C 26F60701 test byte [es:bx],$P_Optional + 33365 ;AN019; see if no value is valid + 33366 00004B90 750E jnz short $P_Chk_SW_Exit ;AN019; if so, then leave, else yell + 33367 + 33368 00004B92 2EC706[BA97]0200 mov word [cs:$P_RC],$P_Op_Missing + 33369 ;mov word [cs:$P_RC],2 ;AC034; return required operand missing + 33370 00004B99 EB05 jmp short $P_Chk_SW_Exit ;AN018; + 33371 + 33372 $P_CSW00: ;AN000; + 33373 00004B9B E88D00 call $P_Check_Match_Flags ;AN000; process match flag + 33374 00004B9E F8 clc ;AN000; indicate match + 33375 ;jmp short $P_Chk_SW_Single_Exit + 33376 00004B9F C3 retn ; 31/03/2023 ;AN000; + 33377 ; 31/03/2023 + 33378 ;$P_Chk_SW_Err0: ;AN000; + 33379 ; stc ;AN000; not found in switch synonym list + 33380 ; ;jmp short $P_Chk_SW_Single_Exit + 33381 ; retn ; 31/03/2023 ;AN000; + 33382 + 33383 $P_Chk_SW_Exit: ;AN000; + 33384 00004BA0 50 push ax ;AN000; + 33385 ; 31/03/2023 + 33386 00004BA1 B803FF mov ax,($P_No_Tag<<8)+$P_String + 33387 ;;mov al,3 + 33388 ;;mov ah,0FFh + 33389 ;mov al,$P_String ;AN000; set + 33390 ;mov ah,$P_No_Tag ;AN000; result + 33391 00004BA4 E80300 call $P_Fill_Result ;AN000; buffer + 33392 00004BA7 58 pop ax ;AN000; + 33393 00004BA8 F8 clc ;AN000; + 33394 ; 31/03/2023 + 33395 $P_Chk_SW_Err0: + 33396 $P_Chk_SW_Single_Exit: ;AN000; + 33397 00004BA9 C3 retn ;AN000; + 33398 + 33399 ;*********************************************************************** + 33400 ; $P_Fill_Result + 33401 ; + 33402 ; Function: Fill the result buffer + 33403 ; + 33404 ; Input: AH = Item tag + 33405 ; AL = type + 33406 ; AL = 1: CX,DX has 32bit number (CX = high) + 33407 ; AL = 2: DX has index(offset) into value list + 33408 ; AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z) + 33409 ; AL = 7: DX has year, CL has month and CH has date + 33410 ; AL = 8: DL has hours, DH has minutes, CL has secondsn, + 33411 ; amd CH has hundredths + 33412 ; AL = else: psdata_seg:SI points to returned string buffer + 33413 ; ES:BX -> CONTROL block + 33414 ; + 33415 ; Output: None + 33416 ; + 33417 ; Use: $P_Do_CAPS_String, $P_Remove_Colon, $P_Found_SYNONYM + 33418 ; + 33419 ; Vars: $P_DX(W) + 33420 ;*********************************************************************** + 33421 + 33422 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33423 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33424 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33425 $P_Fill_Result: + 33426 00004BAA 57 push di ;AN000; + 33427 00004BAB 268B7F04 mov di,[es:bx+$P_CONTROL_BLK.$P_Result_Buf] + 33428 ;mov di,[es:bx+4] ;AN000; di points to result buffer + 33429 00004BAF 2E893E[BE97] mov [cs:$P_DX],di ;AC034; set returned result address + 33430 ;mov [es:di+$P_RESULT_BLK.$P_Type],al + 33431 ;;mov [es:di],al ;AN000; store type + 33432 ;mov [es:di+$P_RESULT_BLK.$P_Item_Tag],ah + 33433 ;;mov [es:di+1],ah ;AN000; store item tag + 33434 ; 31/03/2023 + 33435 00004BB4 268905 mov [es:di],ax + 33436 00004BB7 50 push ax ;AN000; + 33437 00004BB8 2EA1[CD97] mov ax,[cs:$P_Found_SYNONYM] + 33438 ;AC034; if yes, + 33439 00004BBC 26894502 mov [es:di+$P_RESULT_BLK.$P_SYNONYM_Ptr],ax + 33440 ;mov [es:di+2],ax ;AN000; then set it to the result + 33441 00004BC0 58 pop ax ;AN000; + 33442 $P_RLT04: ;AN000; + 33443 ;cmp al,1 + 33444 00004BC1 3C01 cmp al,$P_Number ;AN000; if number + 33445 00004BC3 750A jne short $P_RLT00 ;AN000; + 33446 $P_RLT02: ;AN000; + 33447 00004BC5 26895504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],dx + 33448 ;mov [es:di+4],dx ;AN000; then store 32bit + 33449 00004BC9 26894D06 mov [es:di+2+$P_RESULT_BLK.$P_Picked_Val],cx + 33450 ;mov [es:di+6],cx ;AN000; number + 33451 00004BCD EB5A jmp short $P_RLT_Exit ;AN000; + 33452 $P_RLT00: ;AN000; + 33453 ;cmp al,2 + 33454 00004BCF 3C02 cmp al,$P_List_Idx ;AN000; if list index + 33455 00004BD1 7506 jne short $P_RLT01 ;AN000; + 33456 00004BD3 26895504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],dx + 33457 ;mov [es:di+4],dx ;AN000; then store list index + 33458 00004BD7 EB50 jmp short $P_RLT_Exit ;AN000; + 33459 $P_RLT01: ;AN000; + 33460 ;cmp al,7 + 33461 00004BD9 3C07 cmp al,$P_Date_F ; 7 ;AN000; Date format ? + 33462 00004BDB 74E8 je short $P_RLT02 ;AN000; + 33463 ;cmp al,8 + 33464 00004BDD 3C08 cmp al,$P_Time_F ; 8 ;AN000; Time format ? + 33465 00004BDF 74E4 je short $P_RLT02 ;AN000; + 33466 ;cmp al,6 + 33467 00004BE1 3C06 cmp al,$P_Drive ; 6 ;AN000; drive format ? + 33468 00004BE3 7506 jne short $P_RLT03 ;AN000; + 33469 + 33470 00004BE5 26885504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],dl + 33471 ;mov [es:di+4],dl ;AN000; store drive number + 33472 00004BE9 EB3E jmp short $P_RLT_Exit ;AN000; + 33473 + 33474 $P_RLT03: ;AN000; + 33475 ;cmp al,4 + 33476 00004BEB 3C04 cmp al,$P_Complex ;AN000; complex format ? + 33477 00004BED 750F jne short $P_RLT05 ;AN000; + 33478 + 33479 00004BEF 2EA1[C797] mov ax,[cs:$P_SaveSI_Cmpx] ;AC034; then get pointer in command buffer + 33480 00004BF3 40 inc ax ;AN000; skip left Parentheses + 33481 00004BF4 26894504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],ax + 33482 ;mov [es:di+4],ax ;AN000; store offset + 33483 00004BF8 268C5D06 mov [es:di+2+$P_RESULT_BLK.$P_Picked_Val],ds + 33484 ;mov [es:di+6],ds ;AN000; store segment + 33485 00004BFC EB2B jmp short $P_RLT_Exit ;AN000; + 33486 + 33487 $P_RLT05: ;AN000; + 33488 ;------------------------ AL = 3, 5, or 9 + 33489 00004BFE 26897504 mov [es:di+$P_RESULT_BLK.$P_Picked_Val],si + 33490 ;mov [es:di+4],si ;AN000; store offset of STRING_BUF + 33491 00004C02 268C4D06 mov [es:di+2+$P_RESULT_BLK.$P_Picked_Val],cs + 33492 ;mov [es:di+6],cs ;AN031; store segment of STRING_BUF + 33493 + 33494 00004C06 50 push ax ;AN000; + 33495 00004C07 26F6470201 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_CAP_File + 33496 ;test byte [es:bx+2],1 ;AN000; need CAPS by file table? + 33497 00004C0C 7404 jz short $P_RLT_CAP00 ;AN000; + 33498 + 33499 ;mov al,4 + 33500 00004C0E B004 mov al,$P_DOSTBL_File ; 4 ;AN000; use file upper case table + 33501 00004C10 EB09 jmp short $P_RLT_CAP02 ;AN000; + 33502 + 33503 $P_RLT_CAP00: ;AN000; + 33504 00004C12 26F6470202 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_CAP_Char + 33505 ;test byte [es:bx+2],2 ;AN000; need CAPS by char table ? + 33506 00004C17 7405 jz short $P_RLT_CAP01 ;AN000; + 33507 + 33508 ;mov al,2 + 33509 00004C19 B002 mov al,$P_DOSTBL_Char ; 2 ;AN000; use character upper case table + 33510 $P_RLT_CAP02: ;AN000; + 33511 00004C1B E80C01 call $P_Do_CAPS_String ;AN000; process CAPS along the table + 33512 $P_RLT_CAP01: ;AN000; + 33513 00004C1E 58 pop ax ;AN000; + 33514 00004C1F 26F6470210 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_Rm_Colon + 33515 ;test byte [es:bx+2],10h ;AN000; removing colon at end ? + 33516 00004C24 7403 jz short $P_RLT_Exit ;AN000; + 33517 + 33518 00004C26 E8DD00 call $P_Remove_Colon ;AN000; then process it. + 33519 $P_RLT_Exit: ;AN000; + 33520 00004C29 5F pop di ;AN000; + 33521 00004C2A C3 retn ;AN000; + 33522 + 33523 ;*********************************************************************** + 33524 ; $P_Check_Match_Flags 33525 ; - 33526 ; Check for types in this order: - 33527 ; Complex - 33528 ; Date - 33529 ; Time - 33530 ; Drive - 33531 ; Filespec - 33532 ; Quoted String - 33533 ; Simple String - 33534 ; - 33535 ; Input: psdata_seg:SI -> $P_STRING_BUF - 33536 ; ES:BX -> CONTROL block + 33526 ; Function: Check the mutch_flags and make the exit code and set the + 33527 ; result buffer + 33528 ; + 33529 ; Check for types in this order: + 33530 ; Complex + 33531 ; Date + 33532 ; Time + 33533 ; Drive + 33534 ; Filespec + 33535 ; Quoted String + 33536 ; Simple String 33537 ; - 33538 ; Output: None - 33539 ; - 33540 ; Use: $P_Value, P$_SValue, $P_Simple_String, $P_Date_Format - 33541 ; $P_Time_Format, $P_Complex_Format, $P_File_Foemat - 33542 ; $P_Drive_Format - 33543 ;*********************************************************************** - 33544 - 33545 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33546 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33547 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33548 $P_Check_Match_Flags: - 33549 00004C2B 2EC606[9398]00 mov byte [cs:$P_err_flag],$P_NULL ; 0 - 33550 ;AN033;AC034;; clear filespec error flag. - 33551 00004C31 50 push ax ;AN000; - 33552 ;mov ax,[es:bx+$P_CONTROL_BLK.$P_Match_Flag] - 33553 00004C32 268B07 mov ax,[es:bx] ;AN000; load match flag(16bit) to ax - 33554 00004C35 09C0 or ax,ax ;AC035; test ax for zero - 33555 00004C37 7518 jnz short $P_Mat ;AN000; (tm12) - 33556 00004C39 50 push ax ;AN000; (tm12) - 33557 00004C3A 53 push bx ;AN000; (tm12) - 33558 00004C3B 52 push dx ;AN000; (tm12) - 33559 00004C3C 57 push di ;AN000; (tm12) - 33560 00004C3D 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax - 33561 ;mov word [cs:$P_RC],9 ;AC034; (tm12) - 33562 ; 31/03/2023 - 33563 00004C44 B803FF mov ax,($P_No_Tag<<8)+$P_String - 33564 ;mov ah,$P_No_Tag ; 0FFh ;AN000; (tm12) - 33565 ;mov al,$P_String ; 3 ;AN000; (tm12) - 33566 00004C47 E860FF call $P_Fill_Result ;AN000; (tm12) - 33567 00004C4A 5F pop di ;AN000; (tm12) - 33568 00004C4B 5A pop dx ;AN000; (tm12) - 33569 00004C4C 5B pop bx ;AN000; (tm12) - 33570 00004C4D 58 pop ax ;AN000; (tm12) - 33571 ;jmp short $P_Bridge ;AC035; (tm12) - 33572 ; 31/03/2023 - 33573 $P_Bridge: ; 18/04/2023 ;AN000; - 33574 00004C4E E99C00 jmp $P_Match_Exit ;AN000; (tm02) - 33575 $P_Mat: ;AN000; (tm12) - 33576 $P_Match01: ;AN000; - 33577 ;test ax,1000h - 33578 00004C51 A90010 test ax,$P_Date_S ;AN000; Date string - 33579 00004C54 7412 jz short $P_Match02 ;AN000; - 33580 00004C56 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33581 ;mov word [cs:$P_RC],0 ;AC034; assume no error - 33582 00004C5D E85403 call $P_Date_Format ;AN000; do process - 33583 00004C60 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax - 33584 ;cmp word [cs:$P_RC],9 ;AC034; if error, examine the next type - 33585 ; 18/04/2023 - 33586 00004C66 75E6 jne short $P_Bridge ;AN000; - 33587 $P_Match02: ;AN000; - 33588 ;test ax,800h - 33589 00004C68 A90008 test ax,$P_Time_S ;AN000; Time string - 33590 00004C6B 7412 jz short $P_Match03 ;AN000; - 33591 00004C6D 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33592 ;mov word [cs:$P_RC],0 ;AC034; assume no error - 33593 00004C74 E85A04 call $P_Time_Format ;AN000; do process - 33594 00004C77 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax - 33595 ;cmp word [cs:$P_RC],9 ;AC034; if error, examine the next type - 33596 ;jne short $P_Bridge ;AN000; (tm09) - 33597 ;jmp short $P_Match03 ;AN025; (tm09) - 33598 ; 31/03/2023 - 33599 00004C7D 756E jne short $P_Match_Exit - 33600 ;$P_Bridge: ;AN000; - 33601 ;jmp short $P_Match_Exit ;AN000; (tm02) - 33602 $P_Match03: ;AN000; - 33603 ;test ax,8000h - 33604 00004C7F A90080 test ax,$P_Num_Val ;AN000; Numeric value - 33605 00004C82 7412 jz short $P_Match04 ;AN000; - 33606 00004C84 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33607 ;mov word [cs:$P_RC],0 ;AC034; assume no error - 33608 00004C8B E82701 call $P_Value ;AN000; do process - 33609 00004C8E 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax - 33610 ;cmp word [cs:$P_RC],9 ;AC034; if error, examine the next type - 33611 00004C94 7557 jne short $P_Match_Exit ;AN000; - 33612 $P_Match04: ;AN000; - 33613 ;test ax,4000h - 33614 00004C96 A90040 test ax,$P_SNum_Val ;AN000; Signed numeric value - 33615 00004C99 7412 jz short $P_Match05 ;AN000; - 33616 00004C9B 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33617 ;AC034; assume no error - 33618 00004CA2 E8EC00 call $P_SValue ;AN000; do process - 33619 00004CA5 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax - 33620 ;AC034; if error, examine the next type - 33621 00004CAB 7540 jne short $P_Match_Exit ;AN000; - 33622 $P_Match05: ;AN000; - 33623 ;test ax,100h - 33624 00004CAD A90001 test ax,$P_Drv_Only ;AN000; Drive only - 33625 00004CB0 7415 jz short $P_Match06 ;AN000; - 33626 00004CB2 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33627 ;AC034; assume no error - 33628 00004CB9 E86205 call $P_File_Format ;AN000; 1st, call file format - 33629 00004CBC E8E305 call $P_Drive_Format ;AN000; check drive format, next - 33630 00004CBF 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax - 33631 ;AC034; if error, examinee the next type - 33632 00004CC5 7526 jne short $P_Match_Exit ;AN000; - 33633 $P_Match06: ;AN000; - 33634 ;test ax,200h - 33635 00004CC7 A90002 test ax,$P_File_Spc ;AN000; File spec - 33636 00004CCA 7412 jz short $P_Match07 ;AN000; - 33637 00004CCC 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33638 ;AC034; assume no error - 33639 00004CD3 E84805 call $P_File_Format ;AN000; do process - 33640 00004CD6 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax - 33641 ;AC034; if error, examine the next type - 33642 00004CDC 750F jne short $P_Match_Exit ;AN000; - 33643 $P_Match07: ;AN000; - 33644 $P_Match08: ;AN000; - 33645 ;test ax,2000h - 33646 00004CDE A90020 test ax,$P_Simple_S ;AN000; Simple string - 33647 00004CE1 740A jz short $P_Match09 ;AN000; - 33648 00004CE3 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error - 33649 ;AC034; assume no error - 33650 00004CEA E8C501 call $P_Simple_String ;AN000; do process - 33651 $P_Match09: ;AN000; - 33652 $P_Match_Exit: ;AN000; - 33653 00004CED 2E833E[9398]01 cmp word [cs:$P_err_flag],$P_error_filespec - 33654 ;cmp word [cs:$P_err_flag],1 ;AC034; bad filespec ? - 33655 00004CF3 750F jne short $P_Match2_Exit ;AN033; no, continue - 33656 00004CF5 2E833E[BA97]00 cmp word [cs:$P_RC],$P_No_Error - 33657 ;cmp word [cs:$P_RC],0 ;AN033;AC034;; check for other errors ? - 33658 00004CFB 7507 jne short $P_Match2_Exit ;AN033; no, continue - 33659 00004CFD 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax - 33660 ;mov word [cs:$P_RC],9 ;AN033;AC034;; set error flag - 33661 $P_Match2_Exit: ;AN033; - 33662 00004D04 58 pop ax ;AN000; - 33663 00004D05 C3 retn - 33664 - 33665 ;*********************************************************************** - 33666 ; $P_Remove_Colon; - 33667 ; - 33668 ; Function: Remove colon at end - 33669 ; - 33670 ; Input: psdata_seg:SI points to string buffer to be examineed - 33671 ; - 33672 ; Output: None - 33673 ; - 33674 ; Use: $P_Chk_DBCS - 33675 ;*********************************************************************** - 33676 - 33677 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33678 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33679 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33680 $P_Remove_Colon: - 33681 00004D06 50 push ax ;AN000; - 33682 00004D07 56 push si ;AN000; - 33683 $P_RCOL_Loop: ;AN000; - 33684 00004D08 2E8A04 mov al,[cs:si] ;AN000; get character - 33685 00004D0B 08C0 or al,al ;AN000; end of string ? - 33686 00004D0D 740F jz short $P_RCOL_Exit ;AN000; if yes, just exit - 33687 - 33688 00004D0F 3C3A cmp al,$P_Colon ; ':' ; 3Ah ;AN000; is it colon ? - 33689 00004D11 750E jne short $P_RCOL00 ;AN000; + 33538 ; Input: psdata_seg:SI -> $P_STRING_BUF + 33539 ; ES:BX -> CONTROL block + 33540 ; + 33541 ; Output: None + 33542 ; + 33543 ; Use: $P_Value, P$_SValue, $P_Simple_String, $P_Date_Format + 33544 ; $P_Time_Format, $P_Complex_Format, $P_File_Foemat + 33545 ; $P_Drive_Format + 33546 ;*********************************************************************** + 33547 + 33548 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33549 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33550 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33551 $P_Check_Match_Flags: + 33552 00004C2B 2EC606[9398]00 mov byte [cs:$P_err_flag],$P_NULL ; 0 + 33553 ;AN033;AC034;; clear filespec error flag. + 33554 00004C31 50 push ax ;AN000; + 33555 ;mov ax,[es:bx+$P_CONTROL_BLK.$P_Match_Flag] + 33556 00004C32 268B07 mov ax,[es:bx] ;AN000; load match flag(16bit) to ax + 33557 00004C35 09C0 or ax,ax ;AC035; test ax for zero + 33558 00004C37 7518 jnz short $P_Mat ;AN000; (tm12) + 33559 00004C39 50 push ax ;AN000; (tm12) + 33560 00004C3A 53 push bx ;AN000; (tm12) + 33561 00004C3B 52 push dx ;AN000; (tm12) + 33562 00004C3C 57 push di ;AN000; (tm12) + 33563 00004C3D 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax + 33564 ;mov word [cs:$P_RC],9 ;AC034; (tm12) + 33565 ; 31/03/2023 + 33566 00004C44 B803FF mov ax,($P_No_Tag<<8)+$P_String + 33567 ;mov ah,$P_No_Tag ; 0FFh ;AN000; (tm12) + 33568 ;mov al,$P_String ; 3 ;AN000; (tm12) + 33569 00004C47 E860FF call $P_Fill_Result ;AN000; (tm12) + 33570 00004C4A 5F pop di ;AN000; (tm12) + 33571 00004C4B 5A pop dx ;AN000; (tm12) + 33572 00004C4C 5B pop bx ;AN000; (tm12) + 33573 00004C4D 58 pop ax ;AN000; (tm12) + 33574 ;jmp short $P_Bridge ;AC035; (tm12) + 33575 ; 31/03/2023 + 33576 $P_Bridge: ; 18/04/2023 ;AN000; + 33577 00004C4E E99C00 jmp $P_Match_Exit ;AN000; (tm02) + 33578 $P_Mat: ;AN000; (tm12) + 33579 $P_Match01: ;AN000; + 33580 ;test ax,1000h + 33581 00004C51 A90010 test ax,$P_Date_S ;AN000; Date string + 33582 00004C54 7412 jz short $P_Match02 ;AN000; + 33583 00004C56 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33584 ;mov word [cs:$P_RC],0 ;AC034; assume no error + 33585 00004C5D E85403 call $P_Date_Format ;AN000; do process + 33586 00004C60 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax + 33587 ;cmp word [cs:$P_RC],9 ;AC034; if error, examine the next type + 33588 ; 18/04/2023 + 33589 00004C66 75E6 jne short $P_Bridge ;AN000; + 33590 $P_Match02: ;AN000; + 33591 ;test ax,800h + 33592 00004C68 A90008 test ax,$P_Time_S ;AN000; Time string + 33593 00004C6B 7412 jz short $P_Match03 ;AN000; + 33594 00004C6D 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33595 ;mov word [cs:$P_RC],0 ;AC034; assume no error + 33596 00004C74 E85A04 call $P_Time_Format ;AN000; do process + 33597 00004C77 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax + 33598 ;cmp word [cs:$P_RC],9 ;AC034; if error, examine the next type + 33599 ;jne short $P_Bridge ;AN000; (tm09) + 33600 ;jmp short $P_Match03 ;AN025; (tm09) + 33601 ; 31/03/2023 + 33602 00004C7D 756E jne short $P_Match_Exit + 33603 ;$P_Bridge: ;AN000; + 33604 ;jmp short $P_Match_Exit ;AN000; (tm02) + 33605 $P_Match03: ;AN000; + 33606 ;test ax,8000h + 33607 00004C7F A90080 test ax,$P_Num_Val ;AN000; Numeric value + 33608 00004C82 7412 jz short $P_Match04 ;AN000; + 33609 00004C84 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33610 ;mov word [cs:$P_RC],0 ;AC034; assume no error + 33611 00004C8B E82701 call $P_Value ;AN000; do process + 33612 00004C8E 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax + 33613 ;cmp word [cs:$P_RC],9 ;AC034; if error, examine the next type + 33614 00004C94 7557 jne short $P_Match_Exit ;AN000; + 33615 $P_Match04: ;AN000; + 33616 ;test ax,4000h + 33617 00004C96 A90040 test ax,$P_SNum_Val ;AN000; Signed numeric value + 33618 00004C99 7412 jz short $P_Match05 ;AN000; + 33619 00004C9B 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33620 ;AC034; assume no error + 33621 00004CA2 E8EC00 call $P_SValue ;AN000; do process + 33622 00004CA5 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax + 33623 ;AC034; if error, examine the next type + 33624 00004CAB 7540 jne short $P_Match_Exit ;AN000; + 33625 $P_Match05: ;AN000; + 33626 ;test ax,100h + 33627 00004CAD A90001 test ax,$P_Drv_Only ;AN000; Drive only + 33628 00004CB0 7415 jz short $P_Match06 ;AN000; + 33629 00004CB2 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33630 ;AC034; assume no error + 33631 00004CB9 E86205 call $P_File_Format ;AN000; 1st, call file format + 33632 00004CBC E8E305 call $P_Drive_Format ;AN000; check drive format, next + 33633 00004CBF 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax + 33634 ;AC034; if error, examinee the next type + 33635 00004CC5 7526 jne short $P_Match_Exit ;AN000; + 33636 $P_Match06: ;AN000; + 33637 ;test ax,200h + 33638 00004CC7 A90002 test ax,$P_File_Spc ;AN000; File spec + 33639 00004CCA 7412 jz short $P_Match07 ;AN000; + 33640 00004CCC 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33641 ;AC034; assume no error + 33642 00004CD3 E84805 call $P_File_Format ;AN000; do process + 33643 00004CD6 2E833E[BA97]09 cmp word [cs:$P_RC],$P_Syntax + 33644 ;AC034; if error, examine the next type + 33645 00004CDC 750F jne short $P_Match_Exit ;AN000; + 33646 $P_Match07: ;AN000; + 33647 $P_Match08: ;AN000; + 33648 ;test ax,2000h + 33649 00004CDE A90020 test ax,$P_Simple_S ;AN000; Simple string + 33650 00004CE1 740A jz short $P_Match09 ;AN000; + 33651 00004CE3 2EC706[BA97]0000 mov word [cs:$P_RC],$P_No_Error + 33652 ;AC034; assume no error + 33653 00004CEA E8C501 call $P_Simple_String ;AN000; do process + 33654 $P_Match09: ;AN000; + 33655 $P_Match_Exit: ;AN000; + 33656 00004CED 2E833E[9398]01 cmp word [cs:$P_err_flag],$P_error_filespec + 33657 ;cmp word [cs:$P_err_flag],1 ;AC034; bad filespec ? + 33658 00004CF3 750F jne short $P_Match2_Exit ;AN033; no, continue + 33659 00004CF5 2E833E[BA97]00 cmp word [cs:$P_RC],$P_No_Error + 33660 ;cmp word [cs:$P_RC],0 ;AN033;AC034;; check for other errors ? + 33661 00004CFB 7507 jne short $P_Match2_Exit ;AN033; no, continue + 33662 00004CFD 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax + 33663 ;mov word [cs:$P_RC],9 ;AN033;AC034;; set error flag + 33664 $P_Match2_Exit: ;AN033; + 33665 00004D04 58 pop ax ;AN000; + 33666 00004D05 C3 retn + 33667 + 33668 ;*********************************************************************** + 33669 ; $P_Remove_Colon; + 33670 ; + 33671 ; Function: Remove colon at end + 33672 ; + 33673 ; Input: psdata_seg:SI points to string buffer to be examineed + 33674 ; + 33675 ; Output: None + 33676 ; + 33677 ; Use: $P_Chk_DBCS + 33678 ;*********************************************************************** + 33679 + 33680 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33681 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33682 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33683 $P_Remove_Colon: + 33684 00004D06 50 push ax ;AN000; + 33685 00004D07 56 push si ;AN000; + 33686 $P_RCOL_Loop: ;AN000; + 33687 00004D08 2E8A04 mov al,[cs:si] ;AN000; get character + 33688 00004D0B 08C0 or al,al ;AN000; end of string ? + 33689 00004D0D 740F jz short $P_RCOL_Exit ;AN000; if yes, just exit 33690 - 33691 ;cmp byte [cs:si+1],0 - 33692 00004D13 2E807C0100 cmp byte [cs:si+1],$P_NULL ;AN000; if so, next is NULL ? - 33693 00004D18 7507 jne short $P_RCOL00 ;AN000; no, then next char - 33694 - 33695 00004D1A 2EC60400 mov byte [cs:si],$P_NULL ;AN000; yes, remove colon - 33696 ; 31/03/2023 - 33697 ;jmp short $P_RCOL_Exit ;AN000; and exit. - 33698 $P_RCOL_Exit: - 33699 00004D1E 5E pop si - 33700 00004D1F 58 pop ax - 33701 00004D20 C3 retn - 33702 - 33703 $P_RCOL00: ;AN000; - 33704 00004D21 E89E06 call $P_Chk_DBCS ;AN000; if not colon, then check if - 33705 00004D24 7301 jnc short $P_RCOL01 ;AN000; DBCS leading byte. - 33706 - 33707 00004D26 46 inc si ;AN000; if yes, skip trailing byte - 33708 $P_RCOL01: ;AN000; - 33709 00004D27 46 inc si ;AN000; si points to next byte - 33710 00004D28 EBDE jmp short $P_RCOL_Loop ;AN000; loop until NULL encountered - 33711 - 33712 ; 31/03/2023 - 33713 ;$P_RCOL_Exit: ;AN000; - 33714 ;pop si ;AN000; - 33715 ;pop ax ;AN000; - 33716 ;retn - 33717 - 33718 ;*********************************************************************** - 33719 ; $P_Do_CAPS_String; - 33720 ; - 33721 ; Function: Perform capitalization along with the file case map table - 33722 ; or character case map table. + 33691 00004D0F 3C3A cmp al,$P_Colon ; ':' ; 3Ah ;AN000; is it colon ? + 33692 00004D11 750E jne short $P_RCOL00 ;AN000; + 33693 + 33694 ;cmp byte [cs:si+1],0 + 33695 00004D13 2E807C0100 cmp byte [cs:si+1],$P_NULL ;AN000; if so, next is NULL ? + 33696 00004D18 7507 jne short $P_RCOL00 ;AN000; no, then next char + 33697 + 33698 00004D1A 2EC60400 mov byte [cs:si],$P_NULL ;AN000; yes, remove colon + 33699 ; 31/03/2023 + 33700 ;jmp short $P_RCOL_Exit ;AN000; and exit. + 33701 $P_RCOL_Exit: + 33702 00004D1E 5E pop si + 33703 00004D1F 58 pop ax + 33704 00004D20 C3 retn + 33705 + 33706 $P_RCOL00: ;AN000; + 33707 00004D21 E89E06 call $P_Chk_DBCS ;AN000; if not colon, then check if + 33708 00004D24 7301 jnc short $P_RCOL01 ;AN000; DBCS leading byte. + 33709 + 33710 00004D26 46 inc si ;AN000; if yes, skip trailing byte + 33711 $P_RCOL01: ;AN000; + 33712 00004D27 46 inc si ;AN000; si points to next byte + 33713 00004D28 EBDE jmp short $P_RCOL_Loop ;AN000; loop until NULL encountered + 33714 + 33715 ; 31/03/2023 + 33716 ;$P_RCOL_Exit: ;AN000; + 33717 ;pop si ;AN000; + 33718 ;pop ax ;AN000; + 33719 ;retn + 33720 + 33721 ;*********************************************************************** + 33722 ; $P_Do_CAPS_String; 33723 ; - 33724 ; Input: AL = 2 : Use character table - 33725 ; AL = 4 : Use file table - 33726 ; psdata_seg:SI points to string buffer to be capitalized - 33727 ; - 33728 ; Output: None - 33729 ; - 33730 ; Use: $P_Do_CAPS_Char, $P_Chk_DBCS - 33731 ;*********************************************************************** - 33732 - 33733 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33734 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33735 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33736 $P_Do_CAPS_String: - 33737 00004D2A 56 push si ;AN000; - 33738 00004D2B 52 push dx ;AN000; - 33739 00004D2C 88C2 mov dl,al ;AN000; save info id - 33740 $P_DCS_Loop: ;AN000; - 33741 00004D2E 2E8A04 mov al,[cs:si] ;AN000; load character and - 33742 00004D31 E88E06 call $P_Chk_DBCS ;AN000; check if DBCS leading byte - 33743 00004D34 720C jc short $P_DCS00 ;AN000; if yes, do not need CAPS - 33744 - 33745 00004D36 08C0 or al,al ;AN000; end of string ? - 33746 00004D38 740C jz short $P_DCS_Exit ;AN000; then exit. + 33724 ; Function: Perform capitalization along with the file case map table + 33725 ; or character case map table. + 33726 ; + 33727 ; Input: AL = 2 : Use character table + 33728 ; AL = 4 : Use file table + 33729 ; psdata_seg:SI points to string buffer to be capitalized + 33730 ; + 33731 ; Output: None + 33732 ; + 33733 ; Use: $P_Do_CAPS_Char, $P_Chk_DBCS + 33734 ;*********************************************************************** + 33735 + 33736 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33737 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33738 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33739 $P_Do_CAPS_String: + 33740 00004D2A 56 push si ;AN000; + 33741 00004D2B 52 push dx ;AN000; + 33742 00004D2C 88C2 mov dl,al ;AN000; save info id + 33743 $P_DCS_Loop: ;AN000; + 33744 00004D2E 2E8A04 mov al,[cs:si] ;AN000; load character and + 33745 00004D31 E88E06 call $P_Chk_DBCS ;AN000; check if DBCS leading byte + 33746 00004D34 720C jc short $P_DCS00 ;AN000; if yes, do not need CAPS 33747 - 33748 00004D3A E80C00 call $P_Do_CAPS_Char ;AN000; Here a SBCS char need to be CAPS - 33749 00004D3D 2E8804 mov [cs:si],al ;AN000; stored upper case char to buffer - 33750 00004D40 EB01 jmp short $P_DCS01 ;AN000; process nexit - 33751 $P_DCS00: ;AN000; - 33752 00004D42 46 inc si ;AN000; skip DBCS leading and trailing byte - 33753 $P_DCS01: ;AN000; - 33754 00004D43 46 inc si ;AN000; si point to next byte - 33755 00004D44 EBE8 jmp short $P_DCS_Loop ;AN000; loop until NULL encountered - 33756 $P_DCS_Exit: ;AN000; - 33757 00004D46 5A pop dx ;AN000; - 33758 00004D47 5E pop si ;AN000; - 33759 00004D48 C3 retn - 33760 - 33761 ;*********************************************************************** - 33762 ; $P_Do_CAPS_Char; - 33763 ; - 33764 ; Function: Perform capitalization along with the file case map table - 33765 ; or character case map table. + 33748 00004D36 08C0 or al,al ;AN000; end of string ? + 33749 00004D38 740C jz short $P_DCS_Exit ;AN000; then exit. + 33750 + 33751 00004D3A E80C00 call $P_Do_CAPS_Char ;AN000; Here a SBCS char need to be CAPS + 33752 00004D3D 2E8804 mov [cs:si],al ;AN000; stored upper case char to buffer + 33753 00004D40 EB01 jmp short $P_DCS01 ;AN000; process nexit + 33754 $P_DCS00: ;AN000; + 33755 00004D42 46 inc si ;AN000; skip DBCS leading and trailing byte + 33756 $P_DCS01: ;AN000; + 33757 00004D43 46 inc si ;AN000; si point to next byte + 33758 00004D44 EBE8 jmp short $P_DCS_Loop ;AN000; loop until NULL encountered + 33759 $P_DCS_Exit: ;AN000; + 33760 00004D46 5A pop dx ;AN000; + 33761 00004D47 5E pop si ;AN000; + 33762 00004D48 C3 retn + 33763 + 33764 ;*********************************************************************** + 33765 ; $P_Do_CAPS_Char; 33766 ; - 33767 ; Input: DL = 2 : Use character table - 33768 ; DL = 4 : Use file table - 33769 ; AL = character to be capitalized - 33770 ; - 33771 ; Output: None - 33772 ; - 33773 ; Use: INT 21h /w AH=65h - 33774 ;*********************************************************************** - 33775 - 33776 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33777 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33778 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33779 $P_Do_CAPS_Char: - 33780 00004D49 3C80 cmp al,$P_ASCII80 ; 80h ;AN000; need upper case table ? - 33781 00004D4B 730B jae short $P_DCC_Go ;AN000; - 33782 - 33783 00004D4D 3C61 cmp al,"a" ; 61h ;AN000; if no, - 33784 00004D4F 723F jb short $P_CAPS_Ret ;AN000; check if "a" <= AL <= "z" + 33767 ; Function: Perform capitalization along with the file case map table + 33768 ; or character case map table. + 33769 ; + 33770 ; Input: DL = 2 : Use character table + 33771 ; DL = 4 : Use file table + 33772 ; AL = character to be capitalized + 33773 ; + 33774 ; Output: None + 33775 ; + 33776 ; Use: INT 21h /w AH=65h + 33777 ;*********************************************************************** + 33778 + 33779 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33780 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33781 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33782 $P_Do_CAPS_Char: + 33783 00004D49 3C80 cmp al,$P_ASCII80 ; 80h ;AN000; need upper case table ? + 33784 00004D4B 730B jae short $P_DCC_Go ;AN000; 33785 - 33786 00004D51 3C7A cmp al,"z" ; 7Ah ;AN000; - 33787 00004D53 773B ja short $P_CAPS_Ret ;AN000; if yes, make CAPS + 33786 00004D4D 3C61 cmp al,"a" ; 61h ;AN000; if no, + 33787 00004D4F 723F jb short $P_CAPS_Ret ;AN000; check if "a" <= AL <= "z" 33788 - 33789 00004D55 24DF and al,$P_Make_Upper ; 0DFh ;AN000; else do nothing. - 33790 ;jmp short $P_CAPS_Ret ;AN000; - 33791 ; 18/04/2023 - 33792 00004D57 C3 retn - 33793 - 33794 $P_DCC_Go: ;AN000; - 33795 00004D58 53 push bx ;AN000; - 33796 00004D59 06 push es ;AN000; - 33797 00004D5A 57 push di ;AN000; - 33798 ; 18/04/2023 - 33799 00004D5B 8D3E[8598] lea di,$P_File_CAP_Ptr ;AC034; - 33800 00004D5F 80FA04 cmp dl,$P_DOSTBL_File ; 4 ;AN000; Use file CAPS table ? - 33801 00004D62 7404 je short $P_DCC00 ;AN000; - 33802 ; 27/04/2023 - 33803 00004D64 8D3E[8098] lea di,$P_Char_CAP_Ptr ;AC034; or use char CAPS table ? - 33804 $P_DCC00: ;AN000; - 33805 00004D68 2E3815 cmp [cs:di],dl ;AN000; already got table address ? - 33806 00004D6B 7416 je short $P_DCC01 ;AN000; if no, - 33807 - 33808 ;In this next section, ES will be used to pass a 5 byte workarea to INT 21h, - 33809 ; the GET COUNTYRY INFO call. This usage of ES is required by the function - 33810 ; call, regardless of what base register is currently be defined as PSDATA_SEG. - 33811 - 33812 00004D6D 50 push ax ;AN000; get CAPS table thru DOS call - 33813 00004D6E 51 push cx ;AN000; - 33814 00004D6F 52 push dx ;AN000; - 33815 00004D70 0E push cs ;AC036; pass current base seg into - 33816 ;(Note: this used to push CS. BUG... - 33817 00004D71 07 pop es ;AN000; ES reg, required for - 33818 ;get extended country information - 33819 ; 31/03/2023 - 33820 00004D72 B465 mov ah,$P_DOS_Get_TBL ; 65h ;AN000; get extended CDI - 33821 ;mov ah,65h - 33822 00004D74 88D0 mov al,dl ;AN000; upper case table - 33823 ;mov bx,-1 ; 0FFFFh - 33824 ;mov cx,5 - 33825 ;mov dx,-1 - 33826 00004D76 BBFFFF mov bx,$P_DOSTBL_Def ; -1 ;AN000; get active CON - 33827 00004D79 B90500 mov cx,$P_DOSTBL_BL ; 5 ;AN000; buffer length - 33828 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 33829 00004D7C 89DA mov dx,bx - 33830 ;mov dx,$P_DOSTBL_Def ; -1 ;AN000; get for default code page - 33831 ;DI already set to point to buffer - 33832 00004D7E CD21 int 21h ;AN000; es:di point to buffer that - 33833 ;now has been filled in with info - 33834 00004D80 5A pop dx ;AN000; - 33835 00004D81 59 pop cx ;AN000; - 33836 00004D82 58 pop ax ;AN000; - 33837 - 33838 $P_DCC01: ;AN000; - 33839 - 33840 ;In this next section, ES will be used as the base of the XLAT table, provided - 33841 ; by the previous GET COUNTRY INFO DOS call. This usage of ES is made - 33842 ; regardless of which base reg is currently the PSDATA_SEG reg. - 33843 - 33844 ;mov bx,[cs:di+$P_DOS_TBL.$P_DOS_TBL_Off] - 33845 ;;mov bx,[cs:di+1] ;AN000; get offset of table - 33846 ;mov es,[cs:di+$P_DOS_TBL.$P_DOS_TBL_Seg] - 33847 ;;mov es,[cs:di+3] ;AN000; get segment of table - 33848 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 33849 ;les bx,[cs:di+1] - 33850 00004D83 2EC45D01 les bx,[cs:di+$P_DOS_TBL.$P_DOS_TBL_Off] - 33851 ; - 33852 00004D87 43 inc bx ;AC035; add '2' to - 33853 00004D88 43 inc bx ;AC035; BX reg - 33854 ;AN000; skip length field - 33855 00004D89 2C80 sub al,$P_ASCII80 ; 80h ;AN000; make char to index - 33856 ;xlat es:[bx] ;AN000; perform case map - 33857 ; 31/03/2023 - 33858 00004D8B 26D7 es xlat - 33859 - 33860 00004D8D 5F pop di ;AN000; - 33861 00004D8E 07 pop es ;AN000; - 33862 00004D8F 5B pop bx ;AN000; - 33863 $P_CAPS_Ret: ;AN000; - 33864 00004D90 C3 retn - 33865 - 33866 ;*********************************************************************** - 33867 ; $P_Value / $P_SValue - 33868 ; - 33869 ; Function: Make 32bit value from psdata_seg:SI and see value list - 33870 ; and make result buffer. - 33871 ; $P_SValue is an entry point for the signed value - 33872 ; and this will simply call $P_Value after the handling - 33873 ; of the sign character, "+" or "-" - 33874 ; - 33875 ; Input: psdata_seg:SI -> $P_STRING_BUF - 33876 ; ES:BX -> CONTROL block + 33789 00004D51 3C7A cmp al,"z" ; 7Ah ;AN000; + 33790 00004D53 773B ja short $P_CAPS_Ret ;AN000; if yes, make CAPS + 33791 + 33792 00004D55 24DF and al,$P_Make_Upper ; 0DFh ;AN000; else do nothing. + 33793 ;jmp short $P_CAPS_Ret ;AN000; + 33794 ; 18/04/2023 + 33795 00004D57 C3 retn + 33796 + 33797 $P_DCC_Go: ;AN000; + 33798 00004D58 53 push bx ;AN000; + 33799 00004D59 06 push es ;AN000; + 33800 00004D5A 57 push di ;AN000; + 33801 ; 18/04/2023 + 33802 00004D5B 8D3E[8598] lea di,$P_File_CAP_Ptr ;AC034; + 33803 00004D5F 80FA04 cmp dl,$P_DOSTBL_File ; 4 ;AN000; Use file CAPS table ? + 33804 00004D62 7404 je short $P_DCC00 ;AN000; + 33805 ; 27/04/2023 + 33806 00004D64 8D3E[8098] lea di,$P_Char_CAP_Ptr ;AC034; or use char CAPS table ? + 33807 $P_DCC00: ;AN000; + 33808 00004D68 2E3815 cmp [cs:di],dl ;AN000; already got table address ? + 33809 00004D6B 7416 je short $P_DCC01 ;AN000; if no, + 33810 + 33811 ;In this next section, ES will be used to pass a 5 byte workarea to INT 21h, + 33812 ; the GET COUNTYRY INFO call. This usage of ES is required by the function + 33813 ; call, regardless of what base register is currently be defined as PSDATA_SEG. + 33814 + 33815 00004D6D 50 push ax ;AN000; get CAPS table thru DOS call + 33816 00004D6E 51 push cx ;AN000; + 33817 00004D6F 52 push dx ;AN000; + 33818 00004D70 0E push cs ;AC036; pass current base seg into + 33819 ;(Note: this used to push CS. BUG... + 33820 00004D71 07 pop es ;AN000; ES reg, required for + 33821 ;get extended country information + 33822 ; 31/03/2023 + 33823 00004D72 B465 mov ah,$P_DOS_Get_TBL ; 65h ;AN000; get extended CDI + 33824 ;mov ah,65h + 33825 00004D74 88D0 mov al,dl ;AN000; upper case table + 33826 ;mov bx,-1 ; 0FFFFh + 33827 ;mov cx,5 + 33828 ;mov dx,-1 + 33829 00004D76 BBFFFF mov bx,$P_DOSTBL_Def ; -1 ;AN000; get active CON + 33830 00004D79 B90500 mov cx,$P_DOSTBL_BL ; 5 ;AN000; buffer length + 33831 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 33832 00004D7C 89DA mov dx,bx + 33833 ;mov dx,$P_DOSTBL_Def ; -1 ;AN000; get for default code page + 33834 ;DI already set to point to buffer + 33835 00004D7E CD21 int 21h ;AN000; es:di point to buffer that + 33836 ;now has been filled in with info + 33837 00004D80 5A pop dx ;AN000; + 33838 00004D81 59 pop cx ;AN000; + 33839 00004D82 58 pop ax ;AN000; + 33840 + 33841 $P_DCC01: ;AN000; + 33842 + 33843 ;In this next section, ES will be used as the base of the XLAT table, provided + 33844 ; by the previous GET COUNTRY INFO DOS call. This usage of ES is made + 33845 ; regardless of which base reg is currently the PSDATA_SEG reg. + 33846 + 33847 ;mov bx,[cs:di+$P_DOS_TBL.$P_DOS_TBL_Off] + 33848 ;;mov bx,[cs:di+1] ;AN000; get offset of table + 33849 ;mov es,[cs:di+$P_DOS_TBL.$P_DOS_TBL_Seg] + 33850 ;;mov es,[cs:di+3] ;AN000; get segment of table + 33851 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 33852 ;les bx,[cs:di+1] + 33853 00004D83 2EC45D01 les bx,[cs:di+$P_DOS_TBL.$P_DOS_TBL_Off] + 33854 ; + 33855 00004D87 43 inc bx ;AC035; add '2' to + 33856 00004D88 43 inc bx ;AC035; BX reg + 33857 ;AN000; skip length field + 33858 00004D89 2C80 sub al,$P_ASCII80 ; 80h ;AN000; make char to index + 33859 ;xlat es:[bx] ;AN000; perform case map + 33860 ; 31/03/2023 + 33861 00004D8B 26D7 es xlat + 33862 + 33863 00004D8D 5F pop di ;AN000; + 33864 00004D8E 07 pop es ;AN000; + 33865 00004D8F 5B pop bx ;AN000; + 33866 $P_CAPS_Ret: ;AN000; + 33867 00004D90 C3 retn + 33868 + 33869 ;*********************************************************************** + 33870 ; $P_Value / $P_SValue + 33871 ; + 33872 ; Function: Make 32bit value from psdata_seg:SI and see value list + 33873 ; and make result buffer. + 33874 ; $P_SValue is an entry point for the signed value + 33875 ; and this will simply call $P_Value after the handling + 33876 ; of the sign character, "+" or "-" 33877 ; - 33878 ; Output: None - 33879 ; - 33880 ; Use: $P_Fill_Result, $P_Check_OVF - 33881 ; - 33882 ; Vars: $P_RC(W), $P_Flags(RW) - 33883 ;*********************************************************************** - 33884 - 33885 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33886 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33887 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33888 $P_SValue: - 33889 00004D91 50 push ax ;AN000; - 33890 ;or byte [cs:$P_Flags2],80h - 33891 00004D92 2E800E[C697]80 or byte [cs:$P_Flags2],$P_Signed - 33892 ;AC034; indicate a signed numeric - 33893 ;and byte [cs:$P_Flags2],0FDh - 33894 00004D98 2E8026[C697]FD and byte [cs:$P_Flags2],0FFh-$P_Neg - 33895 ;AC034; assume positive value - 33896 00004D9E 2E8A04 mov al,[cs:si] ;AN000; get sign - 33897 00004DA1 3C2B cmp al,'+' ; 2Bh - 33898 ;cmp al,$P_Plus ; '+' ;AN000; "+" ? - 33899 00004DA3 740A je short $P_SVal00 ;AN000; - 33900 - 33901 00004DA5 3C2D cmp al,'-' ; 2Dh - 33902 ;cmp al,$P_Minus ; '-' ;AN000; "-" ? - 33903 00004DA7 7507 jne short $P_Sval01 ;AN000; else - 33904 - 33905 00004DA9 2E800E[C697]02 or byte [cs:$P_Flags2],$P_Neg ; 2 - 33906 ;AC034; set this is negative value - 33907 $P_SVal00: ;AN000; - 33908 00004DAF 46 inc si ;AN000; skip sign char - 33909 $P_Sval01: ;AN000; - 33910 00004DB0 E80200 call $P_Value ;AN000; and process value - 33911 00004DB3 58 pop ax ;AN000; - 33912 $P_Check_OVF_ok: ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33913 00004DB4 C3 retn ;AN000; - 33914 - 33915 ;*********************************************************************** - 33916 - 33917 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 33918 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4955h + 33878 ; Input: psdata_seg:SI -> $P_STRING_BUF + 33879 ; ES:BX -> CONTROL block + 33880 ; + 33881 ; Output: None + 33882 ; + 33883 ; Use: $P_Fill_Result, $P_Check_OVF + 33884 ; + 33885 ; Vars: $P_RC(W), $P_Flags(RW) + 33886 ;*********************************************************************** + 33887 + 33888 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33889 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33890 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33891 $P_SValue: + 33892 00004D91 50 push ax ;AN000; + 33893 ;or byte [cs:$P_Flags2],80h + 33894 00004D92 2E800E[C697]80 or byte [cs:$P_Flags2],$P_Signed + 33895 ;AC034; indicate a signed numeric + 33896 ;and byte [cs:$P_Flags2],0FDh + 33897 00004D98 2E8026[C697]FD and byte [cs:$P_Flags2],0FFh-$P_Neg + 33898 ;AC034; assume positive value + 33899 00004D9E 2E8A04 mov al,[cs:si] ;AN000; get sign + 33900 00004DA1 3C2B cmp al,'+' ; 2Bh + 33901 ;cmp al,$P_Plus ; '+' ;AN000; "+" ? + 33902 00004DA3 740A je short $P_SVal00 ;AN000; + 33903 + 33904 00004DA5 3C2D cmp al,'-' ; 2Dh + 33905 ;cmp al,$P_Minus ; '-' ;AN000; "-" ? + 33906 00004DA7 7507 jne short $P_Sval01 ;AN000; else + 33907 + 33908 00004DA9 2E800E[C697]02 or byte [cs:$P_Flags2],$P_Neg ; 2 + 33909 ;AC034; set this is negative value + 33910 $P_SVal00: ;AN000; + 33911 00004DAF 46 inc si ;AN000; skip sign char + 33912 $P_Sval01: ;AN000; + 33913 00004DB0 E80200 call $P_Value ;AN000; and process value + 33914 00004DB3 58 pop ax ;AN000; + 33915 $P_Check_OVF_ok: ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33916 00004DB4 C3 retn ;AN000; + 33917 + 33918 ;*********************************************************************** 33919 - 33920 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 33921 ; MSDOS 6.2 COMMAND.COM - TRANGROUP:5119h + 33920 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 33921 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4955h 33922 - 33923 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 33924 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4FCCh - 33925 $P_Value: - 33926 00004DB5 50 push ax ;AN000; - 33927 00004DB6 51 push cx ;AN000; - 33928 00004DB7 52 push dx ;AN000; - 33929 00004DB8 56 push si ;AN000; - 33930 00004DB9 31C9 xor cx,cx ;AN000; cx = higher 16 bits - 33931 00004DBB 31D2 xor dx,dx ;AN000; dx = lower 16 bits - 33932 00004DBD 53 push bx ;AN000; save control pointer - 33933 - 33934 $P_Value_Loop: ;AN000; - 33935 00004DBE 2E8A04 mov al,[cs:si] ;AN000; get character - 33936 00004DC1 08C0 or al,al ;AN000; end of line ? - 33937 00004DC3 7436 jz short $P_Value00 ;AN000; - 33938 - 33939 00004DC5 E8DF00 call $P_0099 ;AN000; make asc(0..9) to bin(0..9) - 33940 00004DC8 722D jc short $P_Value_Err0 ;AN000; + 33923 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 33924 ; MSDOS 6.2 COMMAND.COM - TRANGROUP:5119h + 33925 + 33926 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 33927 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:4FCCh + 33928 $P_Value: + 33929 00004DB5 50 push ax ;AN000; + 33930 00004DB6 51 push cx ;AN000; + 33931 00004DB7 52 push dx ;AN000; + 33932 00004DB8 56 push si ;AN000; + 33933 00004DB9 31C9 xor cx,cx ;AN000; cx = higher 16 bits + 33934 00004DBB 31D2 xor dx,dx ;AN000; dx = lower 16 bits + 33935 00004DBD 53 push bx ;AN000; save control pointer + 33936 + 33937 $P_Value_Loop: ;AN000; + 33938 00004DBE 2E8A04 mov al,[cs:si] ;AN000; get character + 33939 00004DC1 08C0 or al,al ;AN000; end of line ? + 33940 00004DC3 7436 jz short $P_Value00 ;AN000; 33941 - 33942 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 33943 %if 0 - 33944 xor ah,ah ;AN000; - 33945 mov bp,ax ;AN000; save binary number - 33946 shl dx,1 ;AN000; to have 2*x - 33947 rcl cx,1 ;AN000; shift left w/ carry - 33948 call $P_Check_OVF ;AN000; Overflow occurred ? - 33949 jc short $P_Value_Err0 ;AN000; then error, exit - 33950 - 33951 mov bx,dx ;AN000; save low(2*x) - 33952 mov ax,cx ;AN000; save high(2*x) - 33953 shl dx,1 ;AN000; to have 4*x - 33954 rcl cx,1 ;AN000; shift left w/ carry - 33955 call $P_Check_OVF ;AN000; Overflow occurred ? - 33956 jc short $P_Value_Err0 ;AN000; then error, exit - 33957 - 33958 shl dx,1 ;AN000; to have 8*x - 33959 rcl cx,1 ;AN000; shift left w/ carry - 33960 call $P_Check_OVF ;AN000; Overflow occurred ? - 33961 jc short $P_Value_Err0 ;AN000; then error, exit - 33962 - 33963 add dx,bx ;AN000; now have 10*x - 33964 adc cx,ax ;AN000; 32bit ADD - 33965 call $P_Check_OVF ;AN000; Overflow occurred ? - 33966 jc short $P_Value_Err0 ;AN000; then error, exit - 33967 - 33968 add dx,bp ;AN000; Add the current one degree decimal - 33969 adc cx,0 ;AN000; if carry, add 1 to high 16bit - 33970 call $P_Check_OVF ;AN000; Overflow occurred ? - 33971 jc short $P_Value_Err0 ;AN000; then error, exit - 33972 - 33973 inc si ;AN000; update pointer - 33974 jmp short $P_Value_Loop ;AN000; loop until NULL encountered - 33975 %else - 33976 00004DCA 30E4 xor ah,ah - 33977 00004DCC 89C5 mov bp,ax ; save binary number - 33978 00004DCE E81C00 call $P_Check_OVF_shl32 ; check Overflow (after shl32) - 33979 00004DD1 89D3 mov bx,dx ; save low(2*x) - 33980 00004DD3 89C8 mov ax,cx ; save high(2*x) - 33981 00004DD5 E81500 call $P_Check_OVF_shl32 ; check OverFlow (after shl32) - 33982 00004DD8 E81200 call $P_Check_OVF_shl32 ; check OverFlow (after shl32) - 33983 00004DDB 01DA add dx,bx ; now have 10*x - 33984 00004DDD 11C1 adc cx,ax ; 32bit ADD - 33985 00004DDF E80F00 call $P_Check_OVF_@ ; check OverFlow - 33986 00004DE2 01EA add dx,bp ; Add the current one degree decimal - 33987 00004DE4 83D100 adc cx,0 ; if carry, add 1 to high 16bit - 33988 00004DE7 E80700 call $P_Check_OVF_@ ; check Overflow - 33989 00004DEA 46 inc si ; update pointer - 33990 00004DEB EBD1 jmp short $P_Value_Loop ; loop until NULL encountered - 33991 - 33992 $P_Check_OVF_shl32: - 33993 00004DED D1E2 shl dx,1 - 33994 00004DEF D1D1 rcl cx,1 - 33995 $P_Check_OVF_@: - 33996 00004DF1 E8A100 call $P_Check_OVF - 33997 ;jc short $P_Value_Err0_@ - 33998 ;retn - 33999 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34000 00004DF4 73BE jnc short $P_Check_OVF_ok - 34001 - 34002 $P_Value_Err0_@: - 34003 ;inc sp - 34004 ;inc sp - 34005 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34006 00004DF6 5B pop bx - 34007 %endif - 34008 - 34009 $P_Value_Err0: ;AN000; - 34010 00004DF7 5B pop bx ;AN000; - 34011 00004DF8 E98800 jmp $P_Value_Err ;AN000; Bridge - 34012 - 34013 $P_Value00: ;AN000; - 34014 00004DFB 5B pop bx ;AN000; restore control pointer - 34015 00004DFC 2EF606[C697]02 test byte [cs:$P_Flags2],$P_Neg ; 2 - 34016 ;AC034; here cx,dx = 32bit value - 34017 00004E02 740A jz short $P_Value01 ;AN000; was it negative ? - 34018 - 34019 00004E04 F7D1 not cx ;AN000; + - 34020 00004E06 F7D2 not dx ;AN000; |- Make 2's complement - 34021 00004E08 83C201 add dx,1 ;AN000; | - 34022 00004E0B 83D100 adc cx,0 ;AN000; + - 34023 $P_Value01: ;AN000; / nval =0 - 34024 00004E0E 268B7706 mov si,[es:bx+$P_CONTROL_BLK.$P_Value_List] - 34025 ;mov si,[es:bx+6] ;AN000; si points to value list - 34026 00004E12 268A04 mov al,[es:si] ;AN000; get nval - 34027 00004E15 3C00 cmp al,$P_nval_None ; 0 ;AN000; no value list ? - 34028 00004E17 7505 jne short $P_Value02 ;AN000; - 34029 - 34030 ;mov al,$P_Number ; 1 ;AN000; Set type - 34031 ;mov ah,$P_No_Tag ; 0FFh ;AN000; No ITEM_TAG set - 34032 ; 31/03/2023 - 34033 00004E19 B801FF mov ax,($P_No_Tag<<8)+$P_Number - 34034 00004E1C EB6F jmp short $P_Value_Exit ;AN000; - 34035 - 34036 $P_Value02: ;AN000; / nval = 1 - 34037 00004E1E 46 inc si ;AN000; - 34038 00004E1F 268A04 mov al,[es:si] ;AN000; al = number of range - 34039 00004E22 3C00 cmp al,$P_No_nrng ; 0 ;AN000; (tm07) - 34040 00004E24 745D je short $P_Value03 ;AN000; (tm07) - 34041 - 34042 00004E26 46 inc si ;AN000; si points to 1st item_tag - 34043 $P_Val02_Loop: ;AN000; - 34044 00004E27 2EF606[C697]80 test byte [cs:$P_Flags2],$P_Signed ; 80h - 34045 ;test byte [cs:$P_Flags2],80h ;AC034; - 34046 00004E2D 751E jnz short $P_Val02_Sign ;AN000; - 34047 - 34048 00004E2F 263B4C03 cmp cx,[es:si+$P_VAL_LIST.$P_Val_XH] - 34049 ;cmp cx,[es:si+3] ;AN000; comp cx with XH - 34050 00004E33 723B jb short $P_Val02_Next ;AN000; - 34051 00004E35 7706 ja short $P_Val_In ;AN000; - 34052 - 34053 00004E37 263B5401 cmp dx,[es:si+$P_VAL_LIST.$P_Val_XL] - 34054 ;cmp dx,[es:si+1] ;AN000; comp dx with XL - 34055 00004E3B 7233 jb short $P_Val02_Next ;AN000; - 34056 - 34057 $P_Val_In: ;AN000; - 34058 00004E3D 263B4C07 cmp cx,[es:si+$P_VAL_LIST.$P_Val_YH] - 34059 ;cmp cx,[es:si+7] ;AN000; comp cx with YH (tm01) - 34060 00004E41 772D ja short $P_Val02_Next ;AN000; - 34061 00004E43 7224 jb short $P_Val_Found ;AN000; - 34062 - 34063 00004E45 263B5405 cmp dx,[es:si+$P_VAL_LIST.$P_Val_YL] - 34064 ;cmp dx,[es:si+5] ;AN000; comp dx with YL - 34065 00004E49 7725 ja short $P_Val02_Next ;AN000; - 34066 - 34067 00004E4B EB1C jmp short $P_Val_Found ;AN000; - 34068 - 34069 $P_Val02_Sign: ;AN000; - 34070 00004E4D 263B4C03 cmp cx,[es:si+$P_VAL_LIST.$P_Val_XH] - 34071 ;cmp cx,[es:si+3] ;AN000; comp cx with XH - 34072 00004E51 7C1D jl short $P_Val02_Next ;AN000; - 34073 00004E53 7F06 jg short $P_SVal_In ;AN000; - 34074 - 34075 00004E55 263B5401 cmp dx,[es:si+$P_VAL_LIST.$P_Val_XL] - 34076 ;cmp dx,[es:si+1] ;AN000; comp dx with XL - 34077 00004E59 7C15 jl short $P_Val02_Next ;AN000; - 34078 - 34079 $P_SVal_In: ;AN000; - 34080 00004E5B 263B4C07 cmp cx,[es:si+$P_VAL_LIST.$P_Val_YH] - 34081 ;cmp cx,[es:si+7] ;AN000; comp cx with YH - 34082 00004E5F 7F0F jg short $P_Val02_Next ;AN000; - 34083 00004E61 7C06 jl short $P_Val_Found ;AN000; - 34084 - 34085 00004E63 263B5405 cmp dx,[es:si+$P_VAL_LIST.$P_Val_YL] - 34086 ;cmp dx,[es:si+5] ;AN000; comp dx with YL - 34087 00004E67 7F07 jg short $P_Val02_Next ;AN000; - 34088 - 34089 ;jmp short $P_Val_Found ;AN000; - 34090 ; 27/04/2023 - 34091 $P_Val_Found: ;AN000; - 34092 00004E69 B001 mov al,$P_Number ; 1 ;AN000; - 34093 00004E6B 268A24 mov ah,[es:si] ;AN000; found ITEM_TAG set - 34094 00004E6E EB1D jmp short $P_Value_Exit ;AN000; - 34095 - 34096 $P_Val02_Next: ;AN000; - 34097 00004E70 83C609 add si,$P_Len_Range ; 9 ;AN000; - 34098 00004E73 FEC8 dec al ;AN000; loop nrng times in AL - 34099 00004E75 75B0 jnz short $P_Val02_Loop ;AN000; - 34100 ; / Not found - 34101 00004E77 2EC706[BA97]0600 mov word [cs:$P_RC],$P_Out_Of_Range - 34102 ;mov word [cs:$P_RC],6 ;AC034; - 34103 - 34104 ;mov al,$P_Number ; 1 ;AN000; - 34105 ;mov ah,$P_No_Tag ; 0FFh ;AN000; No ITEM_TAG set - 34106 ; 31/03/2023 - 34107 00004E7E B801FF mov ax,($P_No_Tag<<8)+$P_Number - 34108 00004E81 EB0A jmp short $P_Value_Exit ;AN000; - 34109 - 34110 ; 27/04/2023 - 34111 ;$P_Val_Found: ;AN000; - 34112 ;mov al,$P_Number ; 1 ;AN000; - 34113 ;mov ah,[es:si] ;AN000; found ITEM_TAG set - 34114 ;jmp short $P_Value_Exit ;AN000; - 34115 - 34116 $P_Value03: ;AN000; / nval = 2 - 34117 $P_Value04: ;AN000; / nval = 3 or else - 34118 $P_Value_Err: ;AN000; - 34119 00004E83 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax ; 9 - 34120 ;AC034; - 34121 ;mov al,$P_String ; 3 ;AN000; Set type - 34122 ;mov ah,$P_No_Tag ;AN000; No ITEM_TAG set - 34123 ; 31/03/2023 - 34124 00004E8A B803FF mov ax,($P_No_Tag<<8)+$P_String - 34125 $P_Value_Exit: ;AN000; - 34126 00004E8D E81AFD call $P_Fill_Result ;AN000; - 34127 00004E90 5E pop si ;AN000; - 34128 00004E91 5A pop dx ;AN000; - 34129 00004E92 59 pop cx ;AN000; - 34130 00004E93 58 pop ax ;AN000; - 34131 00004E94 C3 retn ;AN000; - 34132 - 34133 ;*********************************************************************** - 34134 ; $P_Check_OVF - 34135 ; - 34136 ; Function: Check if overflow is occurred with consideration of - 34137 ; signed or un-signed numeric value + 33942 00004DC5 E8DF00 call $P_0099 ;AN000; make asc(0..9) to bin(0..9) + 33943 00004DC8 722D jc short $P_Value_Err0 ;AN000; + 33944 + 33945 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 33946 %if 0 + 33947 xor ah,ah ;AN000; + 33948 mov bp,ax ;AN000; save binary number + 33949 shl dx,1 ;AN000; to have 2*x + 33950 rcl cx,1 ;AN000; shift left w/ carry + 33951 call $P_Check_OVF ;AN000; Overflow occurred ? + 33952 jc short $P_Value_Err0 ;AN000; then error, exit + 33953 + 33954 mov bx,dx ;AN000; save low(2*x) + 33955 mov ax,cx ;AN000; save high(2*x) + 33956 shl dx,1 ;AN000; to have 4*x + 33957 rcl cx,1 ;AN000; shift left w/ carry + 33958 call $P_Check_OVF ;AN000; Overflow occurred ? + 33959 jc short $P_Value_Err0 ;AN000; then error, exit + 33960 + 33961 shl dx,1 ;AN000; to have 8*x + 33962 rcl cx,1 ;AN000; shift left w/ carry + 33963 call $P_Check_OVF ;AN000; Overflow occurred ? + 33964 jc short $P_Value_Err0 ;AN000; then error, exit + 33965 + 33966 add dx,bx ;AN000; now have 10*x + 33967 adc cx,ax ;AN000; 32bit ADD + 33968 call $P_Check_OVF ;AN000; Overflow occurred ? + 33969 jc short $P_Value_Err0 ;AN000; then error, exit + 33970 + 33971 add dx,bp ;AN000; Add the current one degree decimal + 33972 adc cx,0 ;AN000; if carry, add 1 to high 16bit + 33973 call $P_Check_OVF ;AN000; Overflow occurred ? + 33974 jc short $P_Value_Err0 ;AN000; then error, exit + 33975 + 33976 inc si ;AN000; update pointer + 33977 jmp short $P_Value_Loop ;AN000; loop until NULL encountered + 33978 %else + 33979 00004DCA 30E4 xor ah,ah + 33980 00004DCC 89C5 mov bp,ax ; save binary number + 33981 00004DCE E81C00 call $P_Check_OVF_shl32 ; check Overflow (after shl32) + 33982 00004DD1 89D3 mov bx,dx ; save low(2*x) + 33983 00004DD3 89C8 mov ax,cx ; save high(2*x) + 33984 00004DD5 E81500 call $P_Check_OVF_shl32 ; check OverFlow (after shl32) + 33985 00004DD8 E81200 call $P_Check_OVF_shl32 ; check OverFlow (after shl32) + 33986 00004DDB 01DA add dx,bx ; now have 10*x + 33987 00004DDD 11C1 adc cx,ax ; 32bit ADD + 33988 00004DDF E80F00 call $P_Check_OVF_@ ; check OverFlow + 33989 00004DE2 01EA add dx,bp ; Add the current one degree decimal + 33990 00004DE4 83D100 adc cx,0 ; if carry, add 1 to high 16bit + 33991 00004DE7 E80700 call $P_Check_OVF_@ ; check Overflow + 33992 00004DEA 46 inc si ; update pointer + 33993 00004DEB EBD1 jmp short $P_Value_Loop ; loop until NULL encountered + 33994 + 33995 $P_Check_OVF_shl32: + 33996 00004DED D1E2 shl dx,1 + 33997 00004DEF D1D1 rcl cx,1 + 33998 $P_Check_OVF_@: + 33999 00004DF1 E8A100 call $P_Check_OVF + 34000 ;jc short $P_Value_Err0_@ + 34001 ;retn + 34002 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34003 00004DF4 73BE jnc short $P_Check_OVF_ok + 34004 + 34005 $P_Value_Err0_@: + 34006 ;inc sp + 34007 ;inc sp + 34008 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34009 00004DF6 5B pop bx + 34010 %endif + 34011 + 34012 $P_Value_Err0: ;AN000; + 34013 00004DF7 5B pop bx ;AN000; + 34014 00004DF8 E98800 jmp $P_Value_Err ;AN000; Bridge + 34015 + 34016 $P_Value00: ;AN000; + 34017 00004DFB 5B pop bx ;AN000; restore control pointer + 34018 00004DFC 2EF606[C697]02 test byte [cs:$P_Flags2],$P_Neg ; 2 + 34019 ;AC034; here cx,dx = 32bit value + 34020 00004E02 740A jz short $P_Value01 ;AN000; was it negative ? + 34021 + 34022 00004E04 F7D1 not cx ;AN000; + + 34023 00004E06 F7D2 not dx ;AN000; |- Make 2's complement + 34024 00004E08 83C201 add dx,1 ;AN000; | + 34025 00004E0B 83D100 adc cx,0 ;AN000; + + 34026 $P_Value01: ;AN000; / nval =0 + 34027 00004E0E 268B7706 mov si,[es:bx+$P_CONTROL_BLK.$P_Value_List] + 34028 ;mov si,[es:bx+6] ;AN000; si points to value list + 34029 00004E12 268A04 mov al,[es:si] ;AN000; get nval + 34030 00004E15 3C00 cmp al,$P_nval_None ; 0 ;AN000; no value list ? + 34031 00004E17 7505 jne short $P_Value02 ;AN000; + 34032 + 34033 ;mov al,$P_Number ; 1 ;AN000; Set type + 34034 ;mov ah,$P_No_Tag ; 0FFh ;AN000; No ITEM_TAG set + 34035 ; 31/03/2023 + 34036 00004E19 B801FF mov ax,($P_No_Tag<<8)+$P_Number + 34037 00004E1C EB6F jmp short $P_Value_Exit ;AN000; + 34038 + 34039 $P_Value02: ;AN000; / nval = 1 + 34040 00004E1E 46 inc si ;AN000; + 34041 00004E1F 268A04 mov al,[es:si] ;AN000; al = number of range + 34042 00004E22 3C00 cmp al,$P_No_nrng ; 0 ;AN000; (tm07) + 34043 00004E24 745D je short $P_Value03 ;AN000; (tm07) + 34044 + 34045 00004E26 46 inc si ;AN000; si points to 1st item_tag + 34046 $P_Val02_Loop: ;AN000; + 34047 00004E27 2EF606[C697]80 test byte [cs:$P_Flags2],$P_Signed ; 80h + 34048 ;test byte [cs:$P_Flags2],80h ;AC034; + 34049 00004E2D 751E jnz short $P_Val02_Sign ;AN000; + 34050 + 34051 00004E2F 263B4C03 cmp cx,[es:si+$P_VAL_LIST.$P_Val_XH] + 34052 ;cmp cx,[es:si+3] ;AN000; comp cx with XH + 34053 00004E33 723B jb short $P_Val02_Next ;AN000; + 34054 00004E35 7706 ja short $P_Val_In ;AN000; + 34055 + 34056 00004E37 263B5401 cmp dx,[es:si+$P_VAL_LIST.$P_Val_XL] + 34057 ;cmp dx,[es:si+1] ;AN000; comp dx with XL + 34058 00004E3B 7233 jb short $P_Val02_Next ;AN000; + 34059 + 34060 $P_Val_In: ;AN000; + 34061 00004E3D 263B4C07 cmp cx,[es:si+$P_VAL_LIST.$P_Val_YH] + 34062 ;cmp cx,[es:si+7] ;AN000; comp cx with YH (tm01) + 34063 00004E41 772D ja short $P_Val02_Next ;AN000; + 34064 00004E43 7224 jb short $P_Val_Found ;AN000; + 34065 + 34066 00004E45 263B5405 cmp dx,[es:si+$P_VAL_LIST.$P_Val_YL] + 34067 ;cmp dx,[es:si+5] ;AN000; comp dx with YL + 34068 00004E49 7725 ja short $P_Val02_Next ;AN000; + 34069 + 34070 00004E4B EB1C jmp short $P_Val_Found ;AN000; + 34071 + 34072 $P_Val02_Sign: ;AN000; + 34073 00004E4D 263B4C03 cmp cx,[es:si+$P_VAL_LIST.$P_Val_XH] + 34074 ;cmp cx,[es:si+3] ;AN000; comp cx with XH + 34075 00004E51 7C1D jl short $P_Val02_Next ;AN000; + 34076 00004E53 7F06 jg short $P_SVal_In ;AN000; + 34077 + 34078 00004E55 263B5401 cmp dx,[es:si+$P_VAL_LIST.$P_Val_XL] + 34079 ;cmp dx,[es:si+1] ;AN000; comp dx with XL + 34080 00004E59 7C15 jl short $P_Val02_Next ;AN000; + 34081 + 34082 $P_SVal_In: ;AN000; + 34083 00004E5B 263B4C07 cmp cx,[es:si+$P_VAL_LIST.$P_Val_YH] + 34084 ;cmp cx,[es:si+7] ;AN000; comp cx with YH + 34085 00004E5F 7F0F jg short $P_Val02_Next ;AN000; + 34086 00004E61 7C06 jl short $P_Val_Found ;AN000; + 34087 + 34088 00004E63 263B5405 cmp dx,[es:si+$P_VAL_LIST.$P_Val_YL] + 34089 ;cmp dx,[es:si+5] ;AN000; comp dx with YL + 34090 00004E67 7F07 jg short $P_Val02_Next ;AN000; + 34091 + 34092 ;jmp short $P_Val_Found ;AN000; + 34093 ; 27/04/2023 + 34094 $P_Val_Found: ;AN000; + 34095 00004E69 B001 mov al,$P_Number ; 1 ;AN000; + 34096 00004E6B 268A24 mov ah,[es:si] ;AN000; found ITEM_TAG set + 34097 00004E6E EB1D jmp short $P_Value_Exit ;AN000; + 34098 + 34099 $P_Val02_Next: ;AN000; + 34100 00004E70 83C609 add si,$P_Len_Range ; 9 ;AN000; + 34101 00004E73 FEC8 dec al ;AN000; loop nrng times in AL + 34102 00004E75 75B0 jnz short $P_Val02_Loop ;AN000; + 34103 ; / Not found + 34104 00004E77 2EC706[BA97]0600 mov word [cs:$P_RC],$P_Out_Of_Range + 34105 ;mov word [cs:$P_RC],6 ;AC034; + 34106 + 34107 ;mov al,$P_Number ; 1 ;AN000; + 34108 ;mov ah,$P_No_Tag ; 0FFh ;AN000; No ITEM_TAG set + 34109 ; 31/03/2023 + 34110 00004E7E B801FF mov ax,($P_No_Tag<<8)+$P_Number + 34111 00004E81 EB0A jmp short $P_Value_Exit ;AN000; + 34112 + 34113 ; 27/04/2023 + 34114 ;$P_Val_Found: ;AN000; + 34115 ;mov al,$P_Number ; 1 ;AN000; + 34116 ;mov ah,[es:si] ;AN000; found ITEM_TAG set + 34117 ;jmp short $P_Value_Exit ;AN000; + 34118 + 34119 $P_Value03: ;AN000; / nval = 2 + 34120 $P_Value04: ;AN000; / nval = 3 or else + 34121 $P_Value_Err: ;AN000; + 34122 00004E83 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax ; 9 + 34123 ;AC034; + 34124 ;mov al,$P_String ; 3 ;AN000; Set type + 34125 ;mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + 34126 ; 31/03/2023 + 34127 00004E8A B803FF mov ax,($P_No_Tag<<8)+$P_String + 34128 $P_Value_Exit: ;AN000; + 34129 00004E8D E81AFD call $P_Fill_Result ;AN000; + 34130 00004E90 5E pop si ;AN000; + 34131 00004E91 5A pop dx ;AN000; + 34132 00004E92 59 pop cx ;AN000; + 34133 00004E93 58 pop ax ;AN000; + 34134 00004E94 C3 retn ;AN000; + 34135 + 34136 ;*********************************************************************** + 34137 ; $P_Check_OVF 34138 ; - 34139 ; Input: Flag register - 34140 ; - 34141 ; Output: CY = 1 : Overflow - 34142 ; - 34143 ; Vars: $P_Flags(R) - 34144 ;*********************************************************************** - 34145 - 34146 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34147 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34148 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34149 $P_Check_OVF: - 34150 00004E95 9C pushf ;AN000; - 34151 00004E96 2EF606[C697]02 test byte [cs:$P_Flags2],$P_Neg ; 2 - 34152 ;AC034; is it negative value ? - 34153 00004E9C 7502 jnz short $P_COVF ;AN000; if no, check overflow - 34154 00004E9E 9D popf ;AN000; by the CY bit - 34155 00004E9F C3 retn ;AN000; - 34156 $P_COVF: ;AN000; - 34157 00004EA0 9D popf ;AN000; else, - 34158 00004EA1 7002 jo short $P_COVF00 ;AN000; check overflow by the OF - 34159 00004EA3 F8 clc ;AN000; indicate it with CY bit - 34160 00004EA4 C3 retn ;AN000; CY=0 means no overflow - 34161 $P_0099Err: ; 31/03/2023 - 34162 $P_COVF00: ;AN000; - 34163 00004EA5 F9 stc ;AN000; and CY=1 means overflow - 34164 $P_0099Err2: ; 31/03/2023 - 34165 00004EA6 C3 retn ;AN000; - 34166 - 34167 ;*********************************************************************** - 34168 ; $P_0099; - 34169 ; - 34170 ; Function: Make ASCII 0-9 to Binary 0-9 - 34171 ; - 34172 ; Input: AL = character code - 34173 ; - 34174 ; Output: CY = 1 : AL is not number - 34175 ; CY = 0 : AL contains binary value - 34176 ;*********************************************************************** - 34177 - 34178 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34179 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34180 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34181 $P_0099: - 34182 00004EA7 3C30 cmp al,"0" ;AN000; - 34183 ;jb short $P_0099Err ;AN000; must be 0 =< al =< 9 - 34184 ; 31/03/2023 - 34185 00004EA9 72FB jb short $P_0099Err2 - 34186 - 34187 00004EAB 3C39 cmp al,"9" ;AN000; - 34188 00004EAD 77F6 ja short $P_0099Err ;AN000; must be 0 =< al =< 9 + 34139 ; Function: Check if overflow is occurred with consideration of + 34140 ; signed or un-signed numeric value + 34141 ; + 34142 ; Input: Flag register + 34143 ; + 34144 ; Output: CY = 1 : Overflow + 34145 ; + 34146 ; Vars: $P_Flags(R) + 34147 ;*********************************************************************** + 34148 + 34149 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34150 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34151 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34152 $P_Check_OVF: + 34153 00004E95 9C pushf ;AN000; + 34154 00004E96 2EF606[C697]02 test byte [cs:$P_Flags2],$P_Neg ; 2 + 34155 ;AC034; is it negative value ? + 34156 00004E9C 7502 jnz short $P_COVF ;AN000; if no, check overflow + 34157 00004E9E 9D popf ;AN000; by the CY bit + 34158 00004E9F C3 retn ;AN000; + 34159 $P_COVF: ;AN000; + 34160 00004EA0 9D popf ;AN000; else, + 34161 00004EA1 7002 jo short $P_COVF00 ;AN000; check overflow by the OF + 34162 00004EA3 F8 clc ;AN000; indicate it with CY bit + 34163 00004EA4 C3 retn ;AN000; CY=0 means no overflow + 34164 $P_0099Err: ; 31/03/2023 + 34165 $P_COVF00: ;AN000; + 34166 00004EA5 F9 stc ;AN000; and CY=1 means overflow + 34167 $P_0099Err2: ; 31/03/2023 + 34168 00004EA6 C3 retn ;AN000; + 34169 + 34170 ;*********************************************************************** + 34171 ; $P_0099; + 34172 ; + 34173 ; Function: Make ASCII 0-9 to Binary 0-9 + 34174 ; + 34175 ; Input: AL = character code + 34176 ; + 34177 ; Output: CY = 1 : AL is not number + 34178 ; CY = 0 : AL contains binary value + 34179 ;*********************************************************************** + 34180 + 34181 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34182 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34183 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34184 $P_0099: + 34185 00004EA7 3C30 cmp al,"0" ;AN000; + 34186 ;jb short $P_0099Err ;AN000; must be 0 =< al =< 9 + 34187 ; 31/03/2023 + 34188 00004EA9 72FB jb short $P_0099Err2 34189 - 34190 00004EAF 2C30 sub al,"0" ;AN000; make char -> bin - 34191 ; 31/03/2023 - 34192 ;clc ;AN000; indicate no error - 34193 00004EB1 C3 retn ;AN000; - 34194 ;31/03/2023 - 34195 ;$P_0099Err: ;AN000; - 34196 ; stc ;AN000; indicate error - 34197 ; retn ;AN000; - 34198 - 34199 ;*********************************************************************** - 34200 ; $P_Simple_String - 34201 ; - 34202 ; Function: See value list for the simple string - 34203 ; and make result buffer. + 34190 00004EAB 3C39 cmp al,"9" ;AN000; + 34191 00004EAD 77F6 ja short $P_0099Err ;AN000; must be 0 =< al =< 9 + 34192 + 34193 00004EAF 2C30 sub al,"0" ;AN000; make char -> bin + 34194 ; 31/03/2023 + 34195 ;clc ;AN000; indicate no error + 34196 00004EB1 C3 retn ;AN000; + 34197 ;31/03/2023 + 34198 ;$P_0099Err: ;AN000; + 34199 ; stc ;AN000; indicate error + 34200 ; retn ;AN000; + 34201 + 34202 ;*********************************************************************** + 34203 ; $P_Simple_String 34204 ; - 34205 ; Input: psdata_seg:SI -> $P_STRING_BUF - 34206 ; ES:BX -> CONTROL block + 34205 ; Function: See value list for the simple string + 34206 ; and make result buffer. 34207 ; - 34208 ; Output: None - 34209 ; - 34210 ; Use: $P_Fill_Result, $P_String_Comp - 34211 ; - 34212 ; Vars: $P_RC(W) - 34213 ;*********************************************************************** - 34214 - 34215 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34216 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34217 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34218 $P_Simple_String: - 34219 00004EB2 50 push ax ;AN000; - 34220 00004EB3 53 push bx ;AN000; - 34221 00004EB4 52 push dx ;AN000; - 34222 00004EB5 57 push di ;AN000; - 34223 00004EB6 268B7F06 mov di,[es:bx+$P_CONTROL_BLK.$P_Value_List] - 34224 ;mov di,[es:bx+6] ;AN000; di points to value list - 34225 00004EBA 268A05 mov al,[es:di] ;AN000; get nval - 34226 00004EBD 08C0 or al,al ;AN000; no value list ? - 34227 00004EBF 7502 jnz short $P_Sim00 ;AN000; then - 34228 ; 31/03/2023 - 34229 ;mov ah,$P_No_Tag ;AN000; No ITEM_TAG set - 34230 00004EC1 EB48 jmp short $P_Sim_Exit ;AN000; and set result buffer - 34231 $P_Sim00: ;AN000; - 34232 00004EC3 3C03 cmp al,$P_nval_String ; 3 ;AN000; String choice list provided ? - 34233 00004EC5 753D jne short $P_Sim01 ;AN000; if no, syntax error - 34234 - 34235 00004EC7 47 inc di ;AN000; - 34236 00004EC8 268A05 mov al,[es:di] ;AN000; al = nrng - 34237 00004ECB B409 mov ah,$P_Len_Range ; 9 ;AN000; - 34238 00004ECD F6E4 mul ah ;AN000; Skip nrng field - 34239 00004ECF 40 inc ax ;AN000; ax = (nrng*9)+1 - 34240 00004ED0 01C7 add di,ax ;AN000; di points to nnval - 34241 00004ED2 268A05 mov al,[es:di] ;AN000; get nnval - 34242 00004ED5 B405 mov ah,$P_Len_Value ; 5 ;AN000; - 34243 00004ED7 F6E4 mul ah ;AN000; Skip nnval field - 34244 00004ED9 40 inc ax ;AN000; ax = (nnval*5)+1 - 34245 00004EDA 01C7 add di,ax ;AN000; di points to nstrval - 34246 00004EDC 268A05 mov al,[es:di] ;AN000; get nstrval - 34247 00004EDF 47 inc di ;AC035; add '2' to - 34248 00004EE0 47 inc di ;AC035; DI reg - 34249 ;AN000; di points to 1st string in list - 34250 $P_Sim_Loop: ;AN000; - 34251 00004EE1 268B2D mov bp,[es:di] ;AN000; get string pointer - 34252 00004EE4 E82F00 call $P_String_Comp ;AN000; compare it with operand - 34253 00004EE7 7310 jnc short $P_Sim_Found ;AN000; found on list ? - 34254 - 34255 00004EE9 83C703 add di,$P_Len_String ; 3 ;AN000; if no, point to next choice - 34256 00004EEC FEC8 dec al ;AN000; loop nstval times in AL - 34257 00004EEE 75F1 jnz short $P_Sim_Loop ;AN000; - 34258 ;AN000; / Not found - 34259 00004EF0 2EC706[BA97]0800 mov word [cs:$P_RC],$P_Not_In_Str - 34260 ;mov [cs:$P_RC],8 ;AC034; - 34261 ; 31/03/2023 - 34262 ;mov ah,$P_No_Tag ;AN000; No ITEM_TAG set - 34263 00004EF7 EB12 jmp short $P_Sim_Exit ;AN000; - 34264 $P_Sim_Found: ;AN000; - 34265 00004EF9 268A65FF mov ah,[es:di-1] ;AN000; set item_tag - 34266 00004EFD B002 mov al,$P_List_Idx ; 2 ;AN000; - 34267 00004EFF 268B15 mov dx,[es:di] ;AN000; get address of STRING - 34268 00004F02 EB0A jmp short $P_Sim_Exit0 ;AN000; - 34269 $P_Sim01: ;AN000; - 34270 00004F04 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax - 34271 ;mov word [cs:$P_RC],9 ;AC034; - 34272 $P_Sim_Exit: - 34273 ;mov ah,$P_No_Tag ; 0FFh ;AN000; No ITEM_TAG set - 34274 ;$P_Sim_Exit: ;AN000; - 34275 ;mov al,$P_String ; 3 ;AN000; Set type - 34276 ; 31/03/2023 - 34277 00004F0B B803FF mov ax,($P_No_Tag<<8)+$P_String - 34278 $P_Sim_Exit0: ;AN000; - 34279 00004F0E E899FC call $P_Fill_Result ;AN000; - 34280 00004F11 5F pop di ;AN000; - 34281 00004F12 5A pop dx ;AN000; - 34282 00004F13 5B pop bx ;AN000; - 34283 00004F14 58 pop ax ;AN000; - 34284 00004F15 C3 retn ;AN000; - 34285 - 34286 ;*********************************************************************** - 34287 ; $P_String_Comp: - 34288 ; - 34289 ; Function: Compare two string - 34290 ; - 34291 ; Input: psdata_seg:SI -> 1st string - 34292 ; ES:BP -> 2nd string (Must be upper case) - 34293 ; ES:BX -> CONTROL block - 34294 ; - 34295 ; Output: CY = 1 if not match - 34296 ; - 34297 ; Use: $P_Chk_DBCS, $P_Do_CAPS_Char - 34298 ; - 34299 ; Vars: $P_KEYor_SW_Ptr(W), $P_Flags(R). $P_KEYorSW_Ptr - 34300 ;*********************************************************************** - 34301 - 34302 ; 01/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34303 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34304 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34305 $P_String_Comp: - 34306 00004F16 50 push ax ;AN000; - 34307 00004F17 55 push bp ;AN000; - 34308 00004F18 52 push dx ;AN000; - 34309 00004F19 56 push si ;AN000; - 34310 00004F1A B202 mov dl,$P_DOSTBL_Char ; 2 ;AN000; use character case map table - 34311 $P_SCOM_Loop: ;AN000; - 34312 00004F1C 2E8A04 mov al,[cs:si] ;AN000; get command character - 34313 00004F1F E8A004 call $P_Chk_DBCS ;AN000; DBCS ? - 34314 00004F22 723C jc short $P_SCOM00 ;AN000; yes,DBCS - 34315 - 34316 00004F24 E822FE call $P_Do_CAPS_Char ;AN000; else, upper case map before comparison - 34317 - 34318 00004F27 2EF606[C697]08 test byte [cs:$P_Flags2],$P_Key_Cmp ; 8 - 34319 ;AC034; keyword search ? - 34320 00004F2D 740D jz short $P_SCOM04 ;AN000; - 34321 - 34322 ;cmp al,'=' ; 3Dh - 34323 00004F2F 3C3D cmp al,$P_Keyword ;'=' ;AN000; "=" is delimiter - 34324 00004F31 751F jne short $P_SCOM03 ;AN000;IF "=" on command line AND (bp+1=> char after the "=" in synonym list) - 34325 - 34326 00004F33 26807E0100 cmp byte [es:bp+1],$P_NULL ;AN021; at end of keyword string in the control block THEN - 34327 00004F38 7562 jne short $P_SCOM_Differ ;AN021; + 34208 ; Input: psdata_seg:SI -> $P_STRING_BUF + 34209 ; ES:BX -> CONTROL block + 34210 ; + 34211 ; Output: None + 34212 ; + 34213 ; Use: $P_Fill_Result, $P_String_Comp + 34214 ; + 34215 ; Vars: $P_RC(W) + 34216 ;*********************************************************************** + 34217 + 34218 ; 31/03/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34219 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34220 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34221 $P_Simple_String: + 34222 00004EB2 50 push ax ;AN000; + 34223 00004EB3 53 push bx ;AN000; + 34224 00004EB4 52 push dx ;AN000; + 34225 00004EB5 57 push di ;AN000; + 34226 00004EB6 268B7F06 mov di,[es:bx+$P_CONTROL_BLK.$P_Value_List] + 34227 ;mov di,[es:bx+6] ;AN000; di points to value list + 34228 00004EBA 268A05 mov al,[es:di] ;AN000; get nval + 34229 00004EBD 08C0 or al,al ;AN000; no value list ? + 34230 00004EBF 7502 jnz short $P_Sim00 ;AN000; then + 34231 ; 31/03/2023 + 34232 ;mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + 34233 00004EC1 EB48 jmp short $P_Sim_Exit ;AN000; and set result buffer + 34234 $P_Sim00: ;AN000; + 34235 00004EC3 3C03 cmp al,$P_nval_String ; 3 ;AN000; String choice list provided ? + 34236 00004EC5 753D jne short $P_Sim01 ;AN000; if no, syntax error + 34237 + 34238 00004EC7 47 inc di ;AN000; + 34239 00004EC8 268A05 mov al,[es:di] ;AN000; al = nrng + 34240 00004ECB B409 mov ah,$P_Len_Range ; 9 ;AN000; + 34241 00004ECD F6E4 mul ah ;AN000; Skip nrng field + 34242 00004ECF 40 inc ax ;AN000; ax = (nrng*9)+1 + 34243 00004ED0 01C7 add di,ax ;AN000; di points to nnval + 34244 00004ED2 268A05 mov al,[es:di] ;AN000; get nnval + 34245 00004ED5 B405 mov ah,$P_Len_Value ; 5 ;AN000; + 34246 00004ED7 F6E4 mul ah ;AN000; Skip nnval field + 34247 00004ED9 40 inc ax ;AN000; ax = (nnval*5)+1 + 34248 00004EDA 01C7 add di,ax ;AN000; di points to nstrval + 34249 00004EDC 268A05 mov al,[es:di] ;AN000; get nstrval + 34250 00004EDF 47 inc di ;AC035; add '2' to + 34251 00004EE0 47 inc di ;AC035; DI reg + 34252 ;AN000; di points to 1st string in list + 34253 $P_Sim_Loop: ;AN000; + 34254 00004EE1 268B2D mov bp,[es:di] ;AN000; get string pointer + 34255 00004EE4 E82F00 call $P_String_Comp ;AN000; compare it with operand + 34256 00004EE7 7310 jnc short $P_Sim_Found ;AN000; found on list ? + 34257 + 34258 00004EE9 83C703 add di,$P_Len_String ; 3 ;AN000; if no, point to next choice + 34259 00004EEC FEC8 dec al ;AN000; loop nstval times in AL + 34260 00004EEE 75F1 jnz short $P_Sim_Loop ;AN000; + 34261 ;AN000; / Not found + 34262 00004EF0 2EC706[BA97]0800 mov word [cs:$P_RC],$P_Not_In_Str + 34263 ;mov [cs:$P_RC],8 ;AC034; + 34264 ; 31/03/2023 + 34265 ;mov ah,$P_No_Tag ;AN000; No ITEM_TAG set + 34266 00004EF7 EB12 jmp short $P_Sim_Exit ;AN000; + 34267 $P_Sim_Found: ;AN000; + 34268 00004EF9 268A65FF mov ah,[es:di-1] ;AN000; set item_tag + 34269 00004EFD B002 mov al,$P_List_Idx ; 2 ;AN000; + 34270 00004EFF 268B15 mov dx,[es:di] ;AN000; get address of STRING + 34271 00004F02 EB0A jmp short $P_Sim_Exit0 ;AN000; + 34272 $P_Sim01: ;AN000; + 34273 00004F04 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax + 34274 ;mov word [cs:$P_RC],9 ;AC034; + 34275 $P_Sim_Exit: + 34276 ;mov ah,$P_No_Tag ; 0FFh ;AN000; No ITEM_TAG set + 34277 ;$P_Sim_Exit: ;AN000; + 34278 ;mov al,$P_String ; 3 ;AN000; Set type + 34279 ; 31/03/2023 + 34280 00004F0B B803FF mov ax,($P_No_Tag<<8)+$P_String + 34281 $P_Sim_Exit0: ;AN000; + 34282 00004F0E E899FC call $P_Fill_Result ;AN000; + 34283 00004F11 5F pop di ;AN000; + 34284 00004F12 5A pop dx ;AN000; + 34285 00004F13 5B pop bx ;AN000; + 34286 00004F14 58 pop ax ;AN000; + 34287 00004F15 C3 retn ;AN000; + 34288 + 34289 ;*********************************************************************** + 34290 ; $P_String_Comp: + 34291 ; + 34292 ; Function: Compare two string + 34293 ; + 34294 ; Input: psdata_seg:SI -> 1st string + 34295 ; ES:BP -> 2nd string (Must be upper case) + 34296 ; ES:BX -> CONTROL block + 34297 ; + 34298 ; Output: CY = 1 if not match + 34299 ; + 34300 ; Use: $P_Chk_DBCS, $P_Do_CAPS_Char + 34301 ; + 34302 ; Vars: $P_KEYor_SW_Ptr(W), $P_Flags(R). $P_KEYorSW_Ptr + 34303 ;*********************************************************************** + 34304 + 34305 ; 01/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34306 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34307 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34308 $P_String_Comp: + 34309 00004F16 50 push ax ;AN000; + 34310 00004F17 55 push bp ;AN000; + 34311 00004F18 52 push dx ;AN000; + 34312 00004F19 56 push si ;AN000; + 34313 00004F1A B202 mov dl,$P_DOSTBL_Char ; 2 ;AN000; use character case map table + 34314 $P_SCOM_Loop: ;AN000; + 34315 00004F1C 2E8A04 mov al,[cs:si] ;AN000; get command character + 34316 00004F1F E8A004 call $P_Chk_DBCS ;AN000; DBCS ? + 34317 00004F22 723C jc short $P_SCOM00 ;AN000; yes,DBCS + 34318 + 34319 00004F24 E822FE call $P_Do_CAPS_Char ;AN000; else, upper case map before comparison + 34320 + 34321 00004F27 2EF606[C697]08 test byte [cs:$P_Flags2],$P_Key_Cmp ; 8 + 34322 ;AC034; keyword search ? + 34323 00004F2D 740D jz short $P_SCOM04 ;AN000; + 34324 + 34325 ;cmp al,'=' ; 3Dh + 34326 00004F2F 3C3D cmp al,$P_Keyword ;'=' ;AN000; "=" is delimiter + 34327 00004F31 751F jne short $P_SCOM03 ;AN000;IF "=" on command line AND (bp+1=> char after the "=" in synonym list) 34328 - 34329 00004F3A EB13 jmp short $P_SCOM05 ;AN000; keyword found in synonym list - 34330 - 34331 $P_SCOM04: ;AN000; - 34332 00004F3C 2EF606[C697]10 test byte [cs:$P_Flags2],$P_SW_Cmp ; 10h - 34333 ;AC034; switch search ? - 34334 00004F42 740E jz short $P_SCOM03 ;AN000; - 34335 - 34336 00004F44 3C3A cmp al,$P_Colon ; ':' ; 3Ah ;AN000; ":" is delimiter, at end of switch on command line - 34337 00004F46 750A jne short $P_SCOM03 ;AN000; continue compares + 34329 00004F33 26807E0100 cmp byte [es:bp+1],$P_NULL ;AN021; at end of keyword string in the control block THEN + 34330 00004F38 7562 jne short $P_SCOM_Differ ;AN021; + 34331 + 34332 00004F3A EB13 jmp short $P_SCOM05 ;AN000; keyword found in synonym list + 34333 + 34334 $P_SCOM04: ;AN000; + 34335 00004F3C 2EF606[C697]10 test byte [cs:$P_Flags2],$P_SW_Cmp ; 10h + 34336 ;AC034; switch search ? + 34337 00004F42 740E jz short $P_SCOM03 ;AN000; 34338 - 34339 00004F48 26807E0000 cmp byte [es:bp],$P_NULL ;AN021; IF at end of switch on command AND - 34340 00004F4D 754D jne short $P_SCOM_Differ ;AN021; at end of switch string in the control block THEN + 34339 00004F44 3C3A cmp al,$P_Colon ; ':' ; 3Ah ;AN000; ":" is delimiter, at end of switch on command line + 34340 00004F46 750A jne short $P_SCOM03 ;AN000; continue compares 34341 - 34342 $P_SCOM05: ;AN000; found a match - 34343 00004F4F 46 inc si ;AN000; si points to just after "=" or ":" - 34344 00004F50 EB58 jmp short $P_SCOM_Same ;AN000; exit - 34345 - 34346 $P_SCOM03: ;AN000; - 34347 00004F52 263A4600 cmp al,[es:bp] ;AN000; compare operand w/ a synonym - 34348 00004F56 751D jne short $P_SCOM_Differ0 ;AN000; if different, check ignore colon option - 34349 - 34350 00004F58 08C0 or al,al ;AN000; end of line - 34351 00004F5A 744E jz short $P_SCOM_Same ;AN000; if so, exit + 34342 00004F48 26807E0000 cmp byte [es:bp],$P_NULL ;AN021; IF at end of switch on command AND + 34343 00004F4D 754D jne short $P_SCOM_Differ ;AN021; at end of switch string in the control block THEN + 34344 + 34345 $P_SCOM05: ;AN000; found a match + 34346 00004F4F 46 inc si ;AN000; si points to just after "=" or ":" + 34347 00004F50 EB58 jmp short $P_SCOM_Same ;AN000; exit + 34348 + 34349 $P_SCOM03: ;AN000; + 34350 00004F52 263A4600 cmp al,[es:bp] ;AN000; compare operand w/ a synonym + 34351 00004F56 751D jne short $P_SCOM_Differ0 ;AN000; if different, check ignore colon option 34352 - 34353 00004F5C 46 inc si ;AN000; update operand pointer - 34354 00004F5D 45 inc bp ;AN000; and synonym pointer - 34355 00004F5E EB13 jmp short $P_SCOM01 ;AN000; loop until NULL or "=" or ":" found in case - 34356 - 34357 $P_SCOM00: ;AN000; Here al is DBCS leading byte - 34358 00004F60 263A4600 cmp al,[es:bp] ;AN000; compare leading byte - 34359 00004F64 7536 jne short $P_SCOM_Differ ;AN000; if not match, say different - 34360 - 34361 00004F66 46 inc si ;AN000; else, load next byte - 34362 00004F67 2E8A04 mov al,[cs:si] ;AN000; and - 34363 00004F6A 45 inc bp ;AN000; - 34364 00004F6B 263A4600 cmp al,[es:bp] ;AN000; compare 2nd byte - 34365 00004F6F 752B jne short $P_SCOM_Differ ;AN000; if not match, say different, too - 34366 - 34367 00004F71 46 inc si ;AN000; else update operand pointer - 34368 00004F72 45 inc bp ;AN000; and synonym pointer - 34369 $P_SCOM01: ;AN000; - 34370 00004F73 EBA7 jmp short $P_SCOM_Loop ;AN000; loop until NULL or "=" or "/" found in case - 34371 - 34372 $P_SCOM_Differ0: ;AN000; - 34373 00004F75 2EF606[C697]40 test byte [cs:$P_Flags2],$P_SW ; 40h - 34374 ;test byte [cs:$P_Flags2],40h ;AC034;(tm10) - 34375 00004F7B 740E jz short $P_not_applicable ;AN000;(tm10) - 34376 - 34377 ;test word [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_colon_is_not_necessary - 34378 ;;test word [es:bx+2],20h ;AN000;(tm10) - 34379 ; 03/04/2023 - 34380 00004F7D 26F6470220 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_colon_is_not_necessary - 34381 00004F82 7407 jz short $P_not_applicable ;AN000;(tm10) - 34382 - 34383 00004F84 26807E0000 cmp byte [es:bp],$P_NULL ;AN000;(tm10) - 34384 00004F89 741F je short $P_SCOM_Same ;AN025;(tm10) + 34353 00004F58 08C0 or al,al ;AN000; end of line + 34354 00004F5A 744E jz short $P_SCOM_Same ;AN000; if so, exit + 34355 + 34356 00004F5C 46 inc si ;AN000; update operand pointer + 34357 00004F5D 45 inc bp ;AN000; and synonym pointer + 34358 00004F5E EB13 jmp short $P_SCOM01 ;AN000; loop until NULL or "=" or ":" found in case + 34359 + 34360 $P_SCOM00: ;AN000; Here al is DBCS leading byte + 34361 00004F60 263A4600 cmp al,[es:bp] ;AN000; compare leading byte + 34362 00004F64 7536 jne short $P_SCOM_Differ ;AN000; if not match, say different + 34363 + 34364 00004F66 46 inc si ;AN000; else, load next byte + 34365 00004F67 2E8A04 mov al,[cs:si] ;AN000; and + 34366 00004F6A 45 inc bp ;AN000; + 34367 00004F6B 263A4600 cmp al,[es:bp] ;AN000; compare 2nd byte + 34368 00004F6F 752B jne short $P_SCOM_Differ ;AN000; if not match, say different, too + 34369 + 34370 00004F71 46 inc si ;AN000; else update operand pointer + 34371 00004F72 45 inc bp ;AN000; and synonym pointer + 34372 $P_SCOM01: ;AN000; + 34373 00004F73 EBA7 jmp short $P_SCOM_Loop ;AN000; loop until NULL or "=" or "/" found in case + 34374 + 34375 $P_SCOM_Differ0: ;AN000; + 34376 00004F75 2EF606[C697]40 test byte [cs:$P_Flags2],$P_SW ; 40h + 34377 ;test byte [cs:$P_Flags2],40h ;AC034;(tm10) + 34378 00004F7B 740E jz short $P_not_applicable ;AN000;(tm10) + 34379 + 34380 ;test word [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_colon_is_not_necessary + 34381 ;;test word [es:bx+2],20h ;AN000;(tm10) + 34382 ; 03/04/2023 + 34383 00004F7D 26F6470220 test byte [es:bx+$P_CONTROL_BLK.$P_Function_Flag],$P_colon_is_not_necessary + 34384 00004F82 7407 jz short $P_not_applicable ;AN000;(tm10) 34385 - 34386 $P_not_applicable: ;AN000;(tm10) - 34387 ;test word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Ig_Colon - 34388 ;;test word [es:bx],10h ;AN000; ignore colon option specified ? - 34389 ; 03/04/2023 - 34390 00004F8B 26F60710 test byte [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Ig_Colon - 34391 00004F8F 740B jz short $P_SCOM_Differ ;AN000; if no, say different. - 34392 - 34393 00004F91 3C3A cmp al,$P_Colon ; ':' ; 3Ah ;AN000; End up with ":" and - 34394 00004F93 750A jne short $P_SCOM02 ;AN000; subseqently + 34386 00004F84 26807E0000 cmp byte [es:bp],$P_NULL ;AN000;(tm10) + 34387 00004F89 741F je short $P_SCOM_Same ;AN025;(tm10) + 34388 + 34389 $P_not_applicable: ;AN000;(tm10) + 34390 ;test word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Ig_Colon + 34391 ;;test word [es:bx],10h ;AN000; ignore colon option specified ? + 34392 ; 03/04/2023 + 34393 00004F8B 26F60710 test byte [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Ig_Colon + 34394 00004F8F 740B jz short $P_SCOM_Differ ;AN000; if no, say different. 34395 - 34396 00004F95 26807E0000 cmp byte [es:bp],$P_NULL ;AN000; NULL ? - 34397 ;jne short $P_SCOM_Differ ;AN000; if no, say different - 34398 ;jmp short $P_SCOM_Same ;AN000; else, say same - 34399 ; 01/04/2023 - 34400 00004F9A 740E je short $P_SCOM_Same - 34401 $P_SCOM_Differ: - 34402 00004F9C F9 stc - 34403 00004F9D EB10 jmp short $P_SCOM_Exit - 34404 - 34405 $P_SCOM02: ;AN000; - 34406 00004F9F 3C00 cmp al,$P_NULL ; 0 ;AN000; end up NULL and : - 34407 00004FA1 75F9 jne short $P_SCOM_Differ ;AN000; - 34408 - 34409 ;cmp byte [es:bp],':' - 34410 00004FA3 26807E003A cmp byte [es:bp],$P_Colon ;AN000; if no, say different - 34411 ;je short $p_SCOM_Same ;AN000; else, say same - 34412 ; 01/04/2023 - 34413 00004FA8 75F2 jne short $P_SCOM_Differ - 34414 ;$P_SCOM_Differ: ;AN000; - 34415 ;stc ;AN000; indicate not found - 34416 ;jmp short $P_SCOM_Exit ;AN000; - 34417 - 34418 $P_SCOM_Same: ;AN000; - 34419 00004FAA 2E8936[C997] mov [cs:$P_KEYorSW_Ptr],si ;AC034; for later use by keyword or switch - 34420 ; 01/04/2023 - 34421 ;clc - 34422 ; cf = 0 ;AN000; indicate found - 34423 $P_SCOM_Exit: ;AN000; - 34424 00004FAF 5E pop si ;AN000; - 34425 00004FB0 5A pop dx ;AN000; - 34426 00004FB1 5D pop bp ;AN000; - 34427 00004FB2 58 pop ax ;AN000; - 34428 00004FB3 C3 retn ;AN000; - 34429 - 34430 ;*********************************************************************** - 34431 ; $P_Date_Format - 34432 ; - 34433 ; Function: Convert a date string to DOS date format for int 21h - 34434 ; with format validation. + 34396 00004F91 3C3A cmp al,$P_Colon ; ':' ; 3Ah ;AN000; End up with ":" and + 34397 00004F93 750A jne short $P_SCOM02 ;AN000; subseqently + 34398 + 34399 00004F95 26807E0000 cmp byte [es:bp],$P_NULL ;AN000; NULL ? + 34400 ;jne short $P_SCOM_Differ ;AN000; if no, say different + 34401 ;jmp short $P_SCOM_Same ;AN000; else, say same + 34402 ; 01/04/2023 + 34403 00004F9A 740E je short $P_SCOM_Same + 34404 $P_SCOM_Differ: + 34405 00004F9C F9 stc + 34406 00004F9D EB10 jmp short $P_SCOM_Exit + 34407 + 34408 $P_SCOM02: ;AN000; + 34409 00004F9F 3C00 cmp al,$P_NULL ; 0 ;AN000; end up NULL and : + 34410 00004FA1 75F9 jne short $P_SCOM_Differ ;AN000; + 34411 + 34412 ;cmp byte [es:bp],':' + 34413 00004FA3 26807E003A cmp byte [es:bp],$P_Colon ;AN000; if no, say different + 34414 ;je short $p_SCOM_Same ;AN000; else, say same + 34415 ; 01/04/2023 + 34416 00004FA8 75F2 jne short $P_SCOM_Differ + 34417 ;$P_SCOM_Differ: ;AN000; + 34418 ;stc ;AN000; indicate not found + 34419 ;jmp short $P_SCOM_Exit ;AN000; + 34420 + 34421 $P_SCOM_Same: ;AN000; + 34422 00004FAA 2E8936[C997] mov [cs:$P_KEYorSW_Ptr],si ;AC034; for later use by keyword or switch + 34423 ; 01/04/2023 + 34424 ;clc + 34425 ; cf = 0 ;AN000; indicate found + 34426 $P_SCOM_Exit: ;AN000; + 34427 00004FAF 5E pop si ;AN000; + 34428 00004FB0 5A pop dx ;AN000; + 34429 00004FB1 5D pop bp ;AN000; + 34430 00004FB2 58 pop ax ;AN000; + 34431 00004FB3 C3 retn ;AN000; + 34432 + 34433 ;*********************************************************************** + 34434 ; $P_Date_Format 34435 ; - 34436 ; Input: psdata_seg:SI -> $P_STRING_BUF - 34437 ; ES:BX -> CONTROL block + 34436 ; Function: Convert a date string to DOS date format for int 21h + 34437 ; with format validation. 34438 ; - 34439 ; Output: None - 34440 ; - 34441 ; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum - 34442 ; - 34443 ; Vars: $P_RC(W), $P_1st_Val(RW), $P_2nd_Val(RW), $P_3rd_Val(RW) - 34444 ;*********************************************************************** - 34445 - 34446 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34447 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34448 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34449 $P_Date_Format: - 34450 00004FB4 50 push ax ;AN000; - 34451 00004FB5 51 push cx ;AN000; - 34452 00004FB6 52 push dx ;AN000; - 34453 00004FB7 56 push si ;AN000; - 34454 00004FB8 53 push bx ;AN000; - 34455 00004FB9 56 push si ;AN000; - 34456 00004FBA E8AA00 call $P_Set_CDI ;AN000; set country dependent information before process - 34457 - 34458 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 34459 %if 0 - 34460 ; 03/04/2023 - 34461 ;pop si ;AN000; - 34462 ;mov word [cs:$P_1st_Val],0 ;AC034; set initial value - 34463 ;mov word [cs:$P_2nd_Val],0 ;AC034; set initial value - 34464 ;mov word [cs:$P_3rd_Val],0 ;AC034; set initial value - 34465 xor si,si - 34466 mov [cs:$P_1st_Val],si ; 0 ;AC034; set initial value - 34467 mov [cs:$P_2nd_Val],si ; 0 ;AC034; set initial value - 34468 ; 11/08/2024 - 34469 mov [cs:$P_3rd_Val],si ; 0 ;AC034; set initial value - 34470 pop si - 34471 %else - 34472 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 34473 00004FBD 5E pop si - 34474 00004FBE B8FFFF mov ax,0FFFFh ; -1 - 34475 00004FC1 2EA3[7898] mov [cs:$P_1st_Val],ax ; -1 ; set initial value - 34476 00004FC5 2EA3[7A98] mov [cs:$P_2nd_Val],ax ; -1 ; set initial value - 34477 00004FC9 2EA3[7C98] mov [cs:$P_3rd_Val],ax ; -1 ; set initial value - 34478 %endif - 34479 00004FCD E8B100 call $P_Get_DecNum ;AN000; get 1st number - 34480 ;jc short $P_DateF_Err0 ;AN000;-----------------------+ - 34481 ; 11/08/2024 - 34482 00004FD0 724E jc short $P_DateF_Error ; ----------------------------+ - 34483 00004FD2 2EA3[7898] mov [cs:$P_1st_Val],ax ;AC034; | - 34484 00004FD6 08DB or bl,bl ;AN000; end of line ? | - 34485 00004FD8 741A jz short $P_DateF_YMD ;AN000; | - 34486 00004FDA E8A400 call $P_Get_DecNum ;AN000; get 2nd number | - 34487 00004FDD 7241 jc short $P_DateF_Error ;AN000; | - 34488 00004FDF 2EA3[7A98] mov [cs:$P_2nd_Val],ax ;AC034; | - 34489 00004FE3 08DB or bl,bl ;AN000; end of line ? | - 34490 00004FE5 740D jz short $P_DateF_YMD ;AN000; | - 34491 00004FE7 E89700 call $P_Get_DecNum ;AN000; get 3rd number | - 34492 $P_DateF_Err0: ;AN000; Bridge <-----------+ - 34493 00004FEA 7234 jc short $P_DateF_Error ;AN000; - 34494 00004FEC 2EA3[7C98] mov [cs:$P_3rd_Val],ax ;AC034; - 34495 00004FF0 08DB or bl,bl ;AN000; end of line ? - 34496 00004FF2 752C jnz short $P_DateF_Error ;AN000; - 34497 $P_DateF_YMD: ;AN000; - 34498 00004FF4 2E8B1E[5698] mov bx,[cs:$P_Country_Info+$P_CDI.$P_CDI_DateF] - 34499 ;mov bx,[cs:$P_Country_Info] ;AC034; get date format - 34500 00004FF9 83FB02 cmp bx,$P_Date_YMD ; 2 ;AN000; - 34501 00004FFC 7435 je short $P_DateF00 ;AN000; - 34502 00004FFE 2EA1[7898] mov ax,[cs:$P_1st_Val] ;AC034; - 34503 00005002 08E4 or ah,ah ;AN000; - 34504 00005004 751A jnz short $P_DateF_Error ;AN000; - 34505 00005006 88C1 mov cl,al ;AN000; set month - 34506 00005008 2EA1[7A98] mov ax,[cs:$P_2nd_Val] ;AC034; - 34507 0000500C 08E4 or ah,ah ;AN000; if overflow, error. - 34508 0000500E 7510 jnz short $P_DateF_Error ;AN000; - 34509 00005010 88C5 mov ch,al ;AN000; set date - 34510 00005012 2E8B16[7C98] mov dx,[cs:$P_3rd_Val] ;AC034; set year - 34511 00005017 83FB01 cmp bx,$P_Date_DMY ; 1 ;AN000; from here format = MDY - 34512 0000501A 7502 jne short $P_DateF01 ;AN000; if it is DMY - 34513 0000501C 86E9 xchg ch,cl ;AN000; then swap M <-> D - 34514 $P_DateF01: ;AN000; - 34515 0000501E EB2C jmp short $P_DateF02 ;AN000; - 34516 - 34517 $P_DateF_Error: ;AN000; - 34518 00005020 5B pop bx ;AN000; recover CONTROL block - 34519 00005021 5E pop si ;AN000; recover string pointer - 34520 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set - 34521 ;mov al,$P_String ; 3 ;AN000; result - 34522 ; 03/04/2023 - 34523 00005022 B803FF mov ax,($P_No_Tag<<8)+$P_String - 34524 00005025 E882FB call $P_Fill_Result ;AN000; buffer - 34525 ;AN000; to string - 34526 00005028 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax ; 9 - 34527 ;AC034; indicate syntax error - 34528 $P_Date_Format_Exit: ;AN000; - 34529 0000502F 5A pop dx ;AN000; - 34530 00005030 59 pop cx ;AN000; - 34531 00005031 58 pop ax ;AN000; - 34532 00005032 C3 retn ;AN000; - 34533 - 34534 $P_DateF00: ;AN000; / here format = YMD - 34535 00005033 2E8B16[7898] mov dx,[cs:$P_1st_Val] ;AC034; set year - 34536 00005038 2EA1[7A98] mov ax,[cs:$P_2nd_Val] ;AC034; - 34537 0000503C 08E4 or ah,ah ;AN000; if overflow, error - 34538 0000503E 75E0 jnz short $P_DateF_Error ;AN000; - 34539 - 34540 00005040 88C1 mov cl,al ;AN000; set month - 34541 00005042 2EA1[7C98] mov ax,[cs:$P_3rd_Val] ;AC034; - 34542 00005046 08E4 or ah,ah ;AN000; if overflow, error - 34543 00005048 75D6 jnz short $P_DateF_Error ;AN000; - 34544 0000504A 88C5 mov ch,al ;AN000; set date - 34545 $P_DateF02: ;AN000; - 34546 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 34547 %if 0 - 34548 cmp dx,100 ;AN000; year is less that 100 ? - 34549 jae short $P_DateF03 ;AN000; - 34550 add dx,1900 ;AN000; set year 19xx - 34551 %else - 34552 0000504C 83FA64 cmp dx,100 - 34553 0000504F 730C jnb short $P_DateF03 - 34554 00005051 83FA50 cmp dx,80 - 34555 00005054 7303 jnb short $P_DateF02_@ - 34556 00005056 83C264 add dx,100 - 34557 $P_DateF02_@: - 34558 00005059 81C26C07 add dx,1900 - 34559 %endif - 34560 $P_DateF03: ;AN000; - 34561 0000505D 5B pop bx ;AN000; recover CONTROL block - 34562 0000505E 5E pop si ;AN000; recover string pointer - 34563 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set - 34564 ;mov al,$P_Date_F ; 7 ;AN000; result - 34565 ; 03/04/2023 - 34566 0000505F B807FF mov ax,($P_No_Tag<<8)+$P_Date_F - 34567 00005062 E845FB call $P_Fill_Result ;AN000; buffer - 34568 00005065 EBC8 jmp short $P_Date_Format_Exit - 34569 ;AN000; to Date - 34570 - 34571 ;*********************************************************************** - 34572 ; $P_Set_CDI: - 34573 ; - 34574 ; Function: Read CDI from DOS if it has not been read yet - 34575 ; - 34576 ; Input: None - 34577 ; - 34578 ; Output: psdata_seg:SI -> CDI - 34579 ; - 34580 ; Use: INT 21h w/ AH = 38h - 34581 ;*********************************************************************** - 34582 - 34583 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34584 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34585 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34586 $P_Set_CDI: - 34587 ; 18/04/2023 - 34588 00005067 8D36[5698] lea si,$P_Country_Info ;AC034; - 34589 ;cmp word [cs:si+$P_CDI.$P_CDI_DateF],-1 ; $P_NeedToBeRead - 34590 0000506B 2E833CFF cmp word [cs:si],-1 ; $P_NeedToBeRead ; 0FFFFh - 34591 ;AN000; already read ? - 34592 ;je short $P_Read_CDI ;AN000; - 34593 ;jmp short $P_Set_CDI_Exit ;AN000; then do nothing - 34594 ; 03/04/2023 - 34595 0000506F 750F jne short $P_Set_CDI_Exit - 34596 $P_Read_CDI: ;AN000; else read CDI thru DOS - 34597 00005071 1E push ds ;AN000; - 34598 00005072 52 push dx ;AN000; - 34599 00005073 50 push ax ;AN000; - 34600 00005074 0E push cs ;AC023; - 34601 00005075 1F pop ds ;AN000; set segment register - 34602 ;mov ax,3800h - 34603 00005076 B80038 mov ax,$P_DOS_Get_CDI ;AN000; get country information - 34604 00005079 89F2 mov dx,si ;AN000; set offset of CDI in local data area - 34605 0000507B CD21 int 21h ;AN000; - 34606 0000507D 58 pop ax ;AN000; - 34607 0000507E 5A pop dx ;AN000; - 34608 0000507F 1F pop ds ;AN000; - 34609 $P_Set_CDI_Exit: ;AN000; - 34610 00005080 C3 retn ;AN000; - 34611 - 34612 ;*********************************************************************** - 34613 ; $P_Get_DecNum: - 34614 ; - 34615 ; Function: Read a character code from psdata_seg:SI until specified delimiter - 34616 ; or NULL encountered. And make a decimal number. + 34439 ; Input: psdata_seg:SI -> $P_STRING_BUF + 34440 ; ES:BX -> CONTROL block + 34441 ; + 34442 ; Output: None + 34443 ; + 34444 ; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum + 34445 ; + 34446 ; Vars: $P_RC(W), $P_1st_Val(RW), $P_2nd_Val(RW), $P_3rd_Val(RW) + 34447 ;*********************************************************************** + 34448 + 34449 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34450 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34451 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34452 $P_Date_Format: + 34453 00004FB4 50 push ax ;AN000; + 34454 00004FB5 51 push cx ;AN000; + 34455 00004FB6 52 push dx ;AN000; + 34456 00004FB7 56 push si ;AN000; + 34457 00004FB8 53 push bx ;AN000; + 34458 00004FB9 56 push si ;AN000; + 34459 00004FBA E8AA00 call $P_Set_CDI ;AN000; set country dependent information before process + 34460 + 34461 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 34462 %if 0 + 34463 ; 03/04/2023 + 34464 ;pop si ;AN000; + 34465 ;mov word [cs:$P_1st_Val],0 ;AC034; set initial value + 34466 ;mov word [cs:$P_2nd_Val],0 ;AC034; set initial value + 34467 ;mov word [cs:$P_3rd_Val],0 ;AC034; set initial value + 34468 xor si,si + 34469 mov [cs:$P_1st_Val],si ; 0 ;AC034; set initial value + 34470 mov [cs:$P_2nd_Val],si ; 0 ;AC034; set initial value + 34471 ; 11/08/2024 + 34472 mov [cs:$P_3rd_Val],si ; 0 ;AC034; set initial value + 34473 pop si + 34474 %else + 34475 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 34476 00004FBD 5E pop si + 34477 00004FBE B8FFFF mov ax,0FFFFh ; -1 + 34478 00004FC1 2EA3[7898] mov [cs:$P_1st_Val],ax ; -1 ; set initial value + 34479 00004FC5 2EA3[7A98] mov [cs:$P_2nd_Val],ax ; -1 ; set initial value + 34480 00004FC9 2EA3[7C98] mov [cs:$P_3rd_Val],ax ; -1 ; set initial value + 34481 %endif + 34482 00004FCD E8B100 call $P_Get_DecNum ;AN000; get 1st number + 34483 ;jc short $P_DateF_Err0 ;AN000;-----------------------+ + 34484 ; 11/08/2024 + 34485 00004FD0 724E jc short $P_DateF_Error ; ----------------------------+ + 34486 00004FD2 2EA3[7898] mov [cs:$P_1st_Val],ax ;AC034; | + 34487 00004FD6 08DB or bl,bl ;AN000; end of line ? | + 34488 00004FD8 741A jz short $P_DateF_YMD ;AN000; | + 34489 00004FDA E8A400 call $P_Get_DecNum ;AN000; get 2nd number | + 34490 00004FDD 7241 jc short $P_DateF_Error ;AN000; | + 34491 00004FDF 2EA3[7A98] mov [cs:$P_2nd_Val],ax ;AC034; | + 34492 00004FE3 08DB or bl,bl ;AN000; end of line ? | + 34493 00004FE5 740D jz short $P_DateF_YMD ;AN000; | + 34494 00004FE7 E89700 call $P_Get_DecNum ;AN000; get 3rd number | + 34495 $P_DateF_Err0: ;AN000; Bridge <-----------+ + 34496 00004FEA 7234 jc short $P_DateF_Error ;AN000; + 34497 00004FEC 2EA3[7C98] mov [cs:$P_3rd_Val],ax ;AC034; + 34498 00004FF0 08DB or bl,bl ;AN000; end of line ? + 34499 00004FF2 752C jnz short $P_DateF_Error ;AN000; + 34500 $P_DateF_YMD: ;AN000; + 34501 00004FF4 2E8B1E[5698] mov bx,[cs:$P_Country_Info+$P_CDI.$P_CDI_DateF] + 34502 ;mov bx,[cs:$P_Country_Info] ;AC034; get date format + 34503 00004FF9 83FB02 cmp bx,$P_Date_YMD ; 2 ;AN000; + 34504 00004FFC 7435 je short $P_DateF00 ;AN000; + 34505 00004FFE 2EA1[7898] mov ax,[cs:$P_1st_Val] ;AC034; + 34506 00005002 08E4 or ah,ah ;AN000; + 34507 00005004 751A jnz short $P_DateF_Error ;AN000; + 34508 00005006 88C1 mov cl,al ;AN000; set month + 34509 00005008 2EA1[7A98] mov ax,[cs:$P_2nd_Val] ;AC034; + 34510 0000500C 08E4 or ah,ah ;AN000; if overflow, error. + 34511 0000500E 7510 jnz short $P_DateF_Error ;AN000; + 34512 00005010 88C5 mov ch,al ;AN000; set date + 34513 00005012 2E8B16[7C98] mov dx,[cs:$P_3rd_Val] ;AC034; set year + 34514 00005017 83FB01 cmp bx,$P_Date_DMY ; 1 ;AN000; from here format = MDY + 34515 0000501A 7502 jne short $P_DateF01 ;AN000; if it is DMY + 34516 0000501C 86E9 xchg ch,cl ;AN000; then swap M <-> D + 34517 $P_DateF01: ;AN000; + 34518 0000501E EB2C jmp short $P_DateF02 ;AN000; + 34519 + 34520 $P_DateF_Error: ;AN000; + 34521 00005020 5B pop bx ;AN000; recover CONTROL block + 34522 00005021 5E pop si ;AN000; recover string pointer + 34523 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set + 34524 ;mov al,$P_String ; 3 ;AN000; result + 34525 ; 03/04/2023 + 34526 00005022 B803FF mov ax,($P_No_Tag<<8)+$P_String + 34527 00005025 E882FB call $P_Fill_Result ;AN000; buffer + 34528 ;AN000; to string + 34529 00005028 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax ; 9 + 34530 ;AC034; indicate syntax error + 34531 $P_Date_Format_Exit: ;AN000; + 34532 0000502F 5A pop dx ;AN000; + 34533 00005030 59 pop cx ;AN000; + 34534 00005031 58 pop ax ;AN000; + 34535 00005032 C3 retn ;AN000; + 34536 + 34537 $P_DateF00: ;AN000; / here format = YMD + 34538 00005033 2E8B16[7898] mov dx,[cs:$P_1st_Val] ;AC034; set year + 34539 00005038 2EA1[7A98] mov ax,[cs:$P_2nd_Val] ;AC034; + 34540 0000503C 08E4 or ah,ah ;AN000; if overflow, error + 34541 0000503E 75E0 jnz short $P_DateF_Error ;AN000; + 34542 + 34543 00005040 88C1 mov cl,al ;AN000; set month + 34544 00005042 2EA1[7C98] mov ax,[cs:$P_3rd_Val] ;AC034; + 34545 00005046 08E4 or ah,ah ;AN000; if overflow, error + 34546 00005048 75D6 jnz short $P_DateF_Error ;AN000; + 34547 0000504A 88C5 mov ch,al ;AN000; set date + 34548 $P_DateF02: ;AN000; + 34549 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 34550 %if 0 + 34551 cmp dx,100 ;AN000; year is less that 100 ? + 34552 jae short $P_DateF03 ;AN000; + 34553 add dx,1900 ;AN000; set year 19xx + 34554 %else + 34555 0000504C 83FA64 cmp dx,100 + 34556 0000504F 730C jnb short $P_DateF03 + 34557 00005051 83FA50 cmp dx,80 + 34558 00005054 7303 jnb short $P_DateF02_@ + 34559 00005056 83C264 add dx,100 + 34560 $P_DateF02_@: + 34561 00005059 81C26C07 add dx,1900 + 34562 %endif + 34563 $P_DateF03: ;AN000; + 34564 0000505D 5B pop bx ;AN000; recover CONTROL block + 34565 0000505E 5E pop si ;AN000; recover string pointer + 34566 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set + 34567 ;mov al,$P_Date_F ; 7 ;AN000; result + 34568 ; 03/04/2023 + 34569 0000505F B807FF mov ax,($P_No_Tag<<8)+$P_Date_F + 34570 00005062 E845FB call $P_Fill_Result ;AN000; buffer + 34571 00005065 EBC8 jmp short $P_Date_Format_Exit + 34572 ;AN000; to Date + 34573 + 34574 ;*********************************************************************** + 34575 ; $P_Set_CDI: + 34576 ; + 34577 ; Function: Read CDI from DOS if it has not been read yet + 34578 ; + 34579 ; Input: None + 34580 ; + 34581 ; Output: psdata_seg:SI -> CDI + 34582 ; + 34583 ; Use: INT 21h w/ AH = 38h + 34584 ;*********************************************************************** + 34585 + 34586 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34587 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34588 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34589 $P_Set_CDI: + 34590 ; 18/04/2023 + 34591 00005067 8D36[5698] lea si,$P_Country_Info ;AC034; + 34592 ;cmp word [cs:si+$P_CDI.$P_CDI_DateF],-1 ; $P_NeedToBeRead + 34593 0000506B 2E833CFF cmp word [cs:si],-1 ; $P_NeedToBeRead ; 0FFFFh + 34594 ;AN000; already read ? + 34595 ;je short $P_Read_CDI ;AN000; + 34596 ;jmp short $P_Set_CDI_Exit ;AN000; then do nothing + 34597 ; 03/04/2023 + 34598 0000506F 750F jne short $P_Set_CDI_Exit + 34599 $P_Read_CDI: ;AN000; else read CDI thru DOS + 34600 00005071 1E push ds ;AN000; + 34601 00005072 52 push dx ;AN000; + 34602 00005073 50 push ax ;AN000; + 34603 00005074 0E push cs ;AC023; + 34604 00005075 1F pop ds ;AN000; set segment register + 34605 ;mov ax,3800h + 34606 00005076 B80038 mov ax,$P_DOS_Get_CDI ;AN000; get country information + 34607 00005079 89F2 mov dx,si ;AN000; set offset of CDI in local data area + 34608 0000507B CD21 int 21h ;AN000; + 34609 0000507D 58 pop ax ;AN000; + 34610 0000507E 5A pop dx ;AN000; + 34611 0000507F 1F pop ds ;AN000; + 34612 $P_Set_CDI_Exit: ;AN000; + 34613 00005080 C3 retn ;AN000; + 34614 + 34615 ;*********************************************************************** + 34616 ; $P_Get_DecNum: 34617 ; - 34618 ; Input: psdata_seg:SI -> $P_STRING_BUF - 34619 ; - 34620 ; Output: BL = delimiter code or NULL - 34621 ; AX = Decimal number - 34622 ; SI advanced to the next number - 34623 ; CY = 1 : Syntax error, AL = Latest examineed number - 34624 ; - 34625 ; Use: $P_0099 - 34626 ;*********************************************************************** - 34627 - 34628 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34629 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34630 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM - 34631 $P_Get_DecNum: - 34632 00005081 51 push cx ;AN000; - 34633 00005082 52 push dx ;AN000; - 34634 00005083 31C9 xor cx,cx ;AN000; cx will have final value - 34635 $P_GetNum_Loop: ;AN000; - 34636 00005085 2E8A04 mov al,[cs:si] ;AN000; load character - 34637 00005088 08C0 or al,al ;AN000; end of line ? - 34638 0000508A 7438 jz short $P_GetNum00 ;AN000; if yes, exit - 34639 0000508C 2E803E[5598]00 cmp byte [cs:$P_Got_Time],0 ;AC034; is this numeric in a time field? ;AC023 - 34640 00005092 740B je short $P_Do_Date_Delims ;AN000; no, go check out Date delimiters ;AC023 - 34641 - 34642 ; Determine which delimiter(s) to check for. Colon & period or period only - 34643 ;cmp bl,$P_colon_period - 34644 00005094 80FB01 cmp bl,1 ; $P_colon_period ;AN032; ;Time - 34645 00005097 750E jne short $P_Do_Time_Delim1 ;AN032; ;only check for period - 34646 - 34647 00005099 3C3A cmp al,$P_Colon ; ':' ;AN032; ;Is this a valid delimiter ? - 34648 0000509B 742B je short $P_GetNum01 ;AN032; ;yes, exit + 34618 ; Function: Read a character code from psdata_seg:SI until specified delimiter + 34619 ; or NULL encountered. And make a decimal number. + 34620 ; + 34621 ; Input: psdata_seg:SI -> $P_STRING_BUF + 34622 ; + 34623 ; Output: BL = delimiter code or NULL + 34624 ; AX = Decimal number + 34625 ; SI advanced to the next number + 34626 ; CY = 1 : Syntax error, AL = Latest examineed number + 34627 ; + 34628 ; Use: $P_0099 + 34629 ;*********************************************************************** + 34630 + 34631 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34632 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34633 ; 11/08/2024 - Retro DOS v5.0 COMMAND.COM + 34634 $P_Get_DecNum: + 34635 00005081 51 push cx ;AN000; + 34636 00005082 52 push dx ;AN000; + 34637 00005083 31C9 xor cx,cx ;AN000; cx will have final value + 34638 $P_GetNum_Loop: ;AN000; + 34639 00005085 2E8A04 mov al,[cs:si] ;AN000; load character + 34640 00005088 08C0 or al,al ;AN000; end of line ? + 34641 0000508A 7438 jz short $P_GetNum00 ;AN000; if yes, exit + 34642 0000508C 2E803E[5598]00 cmp byte [cs:$P_Got_Time],0 ;AC034; is this numeric in a time field? ;AC023 + 34643 00005092 740B je short $P_Do_Date_Delims ;AN000; no, go check out Date delimiters ;AC023 + 34644 + 34645 ; Determine which delimiter(s) to check for. Colon & period or period only + 34646 ;cmp bl,$P_colon_period + 34647 00005094 80FB01 cmp bl,1 ; $P_colon_period ;AN032; ;Time + 34648 00005097 750E jne short $P_Do_Time_Delim1 ;AN032; ;only check for period 34649 - 34650 ; 03/04/2023 - 34651 0000509D EB08 jmp short $P_Do_Time_Delim1 - 34652 ;$P_Do_Time_Delim1: ;AN000; - 34653 ;cmp al,$P_Period ; '.' ;;AC032;;AC023;Is this a valid delimiter ? - 34654 ;je short $P_GetNum01 ;AC023; yes, exit - 34655 ; - 34656 ;jmp short $P_Neither_Delims ;AN023; - 34657 - 34658 $P_Do_Date_Delims: ;AN000; - 34659 ;Regardless of the date delimiter character specified in the country - 34660 ;dependent information, check for the presence of any one of these - 34661 ;three field delimiters: "-", "/", or ".". - 34662 0000509F 3C2D cmp al,$P_Minus ;'-' ;AN020;is this a date delimiter character? - 34663 000050A1 7425 je short $P_GetNum01 ;AN020;if yes, exit - 34664 - 34665 000050A3 3C2F cmp al,$P_Slash ; '/' ;AN020;is this a date delimiter character? - 34666 000050A5 7421 je short $P_GetNum01 ;AN020;if yes, exit + 34650 00005099 3C3A cmp al,$P_Colon ; ':' ;AN032; ;Is this a valid delimiter ? + 34651 0000509B 742B je short $P_GetNum01 ;AN032; ;yes, exit + 34652 + 34653 ; 03/04/2023 + 34654 0000509D EB08 jmp short $P_Do_Time_Delim1 + 34655 ;$P_Do_Time_Delim1: ;AN000; + 34656 ;cmp al,$P_Period ; '.' ;;AC032;;AC023;Is this a valid delimiter ? + 34657 ;je short $P_GetNum01 ;AC023; yes, exit + 34658 ; + 34659 ;jmp short $P_Neither_Delims ;AN023; + 34660 + 34661 $P_Do_Date_Delims: ;AN000; + 34662 ;Regardless of the date delimiter character specified in the country + 34663 ;dependent information, check for the presence of any one of these + 34664 ;three field delimiters: "-", "/", or ".". + 34665 0000509F 3C2D cmp al,$P_Minus ;'-' ;AN020;is this a date delimiter character? + 34666 000050A1 7425 je short $P_GetNum01 ;AN020;if yes, exit 34667 - 34668 $P_Do_Time_Delim1: ; 03/04/2023 - 34669 000050A7 3C2E cmp al,$P_Period ; '.' ;AN020;is this a date delimiter character? - 34670 000050A9 741D je short $P_GetNum01 ;AN000; if yes, exit - 34671 - 34672 $P_Neither_Delims: ;AN023; - 34673 000050AB E8F9FD call $P_0099 ;AN000; convert it to binary - 34674 000050AE 721C jc short $P_GetNum_Exit ;AN000; if error exit - 34675 - 34676 000050B0 B400 mov ah,0 ;AN000; - 34677 000050B2 91 xchg ax,cx ;AN000; - 34678 000050B3 BA0A00 mov dx,10 ;AN000; - 34679 000050B6 F7E2 mul dx ;AN000; ax = ax * 10 - 34680 000050B8 09D2 or dx,dx ;AN000; overflow - 34681 000050BA 750F jnz short $P_GetNum02 ;AN000; then exit - 34682 - 34683 000050BC 01C8 add ax,cx ;AN000; - 34684 000050BE 720C jc short $P_GetNum_Exit ;AN000; + 34668 000050A3 3C2F cmp al,$P_Slash ; '/' ;AN020;is this a date delimiter character? + 34669 000050A5 7421 je short $P_GetNum01 ;AN020;if yes, exit + 34670 + 34671 $P_Do_Time_Delim1: ; 03/04/2023 + 34672 000050A7 3C2E cmp al,$P_Period ; '.' ;AN020;is this a date delimiter character? + 34673 000050A9 741D je short $P_GetNum01 ;AN000; if yes, exit + 34674 + 34675 $P_Neither_Delims: ;AN023; + 34676 000050AB E8F9FD call $P_0099 ;AN000; convert it to binary + 34677 000050AE 721C jc short $P_GetNum_Exit ;AN000; if error exit + 34678 + 34679 000050B0 B400 mov ah,0 ;AN000; + 34680 000050B2 91 xchg ax,cx ;AN000; + 34681 000050B3 BA0A00 mov dx,10 ;AN000; + 34682 000050B6 F7E2 mul dx ;AN000; ax = ax * 10 + 34683 000050B8 09D2 or dx,dx ;AN000; overflow + 34684 000050BA 750F jnz short $P_GetNum02 ;AN000; then exit 34685 - 34686 000050C0 91 xchg ax,cx ;AN000; - 34687 000050C1 46 inc si ;AN000; - 34688 000050C2 EBC1 jmp short $P_GetNum_Loop ;AN000; - 34689 - 34690 $P_GetNum00: ;AN000; - 34691 000050C4 88C3 mov bl,al ;AN000; set bl to NULL - 34692 ;03/04/2023 - 34693 ; cf=0 - 34694 ;clc ;AN000; indicate no error - 34695 000050C6 EB04 jmp short $P_GetNum_Exit ;AN000; - 34696 - 34697 $P_GetNum01: ;AN000; - 34698 000050C8 46 inc si ;AN000; si points to next number - 34699 ;03/04/2023 - 34700 ; cf=0 - 34701 ;clc ;AN000; indicate no error - 34702 000050C9 EB01 jmp short $P_GetNum_Exit ;AN000; - 34703 - 34704 $P_GetNum02: ;AN000; - 34705 000050CB F9 stc ;AN000; indicate error - 34706 $P_GetNum_Exit: ;AN000; - 34707 000050CC 89C8 mov ax,cx ;AN000;return value - 34708 000050CE 5A pop dx ;AN000; - 34709 000050CF 59 pop cx ;AN000; - 34710 000050D0 C3 retn ;AN000; - 34711 - 34712 ;*********************************************************************** - 34713 ; $P_Time_Format - 34714 ; - 34715 ; Function: Convert a time string to DOS time format for int 21h - 34716 ; with format validation. + 34686 000050BC 01C8 add ax,cx ;AN000; + 34687 000050BE 720C jc short $P_GetNum_Exit ;AN000; + 34688 + 34689 000050C0 91 xchg ax,cx ;AN000; + 34690 000050C1 46 inc si ;AN000; + 34691 000050C2 EBC1 jmp short $P_GetNum_Loop ;AN000; + 34692 + 34693 $P_GetNum00: ;AN000; + 34694 000050C4 88C3 mov bl,al ;AN000; set bl to NULL + 34695 ;03/04/2023 + 34696 ; cf=0 + 34697 ;clc ;AN000; indicate no error + 34698 000050C6 EB04 jmp short $P_GetNum_Exit ;AN000; + 34699 + 34700 $P_GetNum01: ;AN000; + 34701 000050C8 46 inc si ;AN000; si points to next number + 34702 ;03/04/2023 + 34703 ; cf=0 + 34704 ;clc ;AN000; indicate no error + 34705 000050C9 EB01 jmp short $P_GetNum_Exit ;AN000; + 34706 + 34707 $P_GetNum02: ;AN000; + 34708 000050CB F9 stc ;AN000; indicate error + 34709 $P_GetNum_Exit: ;AN000; + 34710 000050CC 89C8 mov ax,cx ;AN000;return value + 34711 000050CE 5A pop dx ;AN000; + 34712 000050CF 59 pop cx ;AN000; + 34713 000050D0 C3 retn ;AN000; + 34714 + 34715 ;*********************************************************************** + 34716 ; $P_Time_Format 34717 ; - 34718 ; Input: psdata_seg:SI -> $P_STRING_BUF - 34719 ; ES:BX -> CONTROL block + 34718 ; Function: Convert a time string to DOS time format for int 21h + 34719 ; with format validation. 34720 ; - 34721 ; Output: None - 34722 ; - 34723 ; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum, $P_Time_2412 - 34724 ; - 34725 ; Vars: $P_RC(W), $P_Flags(R), $P_1st_Val(RW), $P_2nd_Val(RW) - 34726 ; $P_3rd_Val(RW), $P_4th_Val(RW) - 34727 ;*********************************************************************** - 34728 - 34729 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34730 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34731 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 34732 $P_Time_Format: ;AN000; - 34733 000050D1 50 push ax ;AN000; - 34734 000050D2 51 push cx ;AN000; - 34735 000050D3 52 push dx ;AN000; - 34736 000050D4 56 push si ;AN000; - 34737 000050D5 53 push bx ;AN000; - 34738 000050D6 56 push si ;AN000; - 34739 000050D7 E88DFF call $P_Set_CDI ;AN000; Set country independent - 34740 ; information before process - 34741 ;test byte [cs:si+11h], 1 - 34742 000050DA 2EF6441001 test byte [cs:si+$P_CDI.$P_CDI_TimeF],1 - 34743 ;AN000; 24 hour system - 34744 000050DF 5E pop si ;AN000; - 34745 000050E0 7503 jnz short $P_TimeF00 ;AN000; if no, means 12 hour system - 34746 000050E2 E8F800 call $P_Time_2412 ;AN000; this routine handle "am" "pm" - 34747 $P_TimeF00: ;AN000; - 34748 ;mov word [cs:$P_1st_Val],0 ;AC034; set initial value - 34749 ;mov word [cs:$P_2nd_Val],0 ;AC034; set initial value - 34750 ;mov word [cs:$P_3rd_Val],0 ;AC034; set initial value - 34751 ;mov word [cs:$P_4th_Val],0 ;AC034; set initial value - 34752 ;mov byte [cs:$P_Got_Time],1 ;AN023;AC034;; use time delimiter - 34753 ; 03/04/2023 - 34754 000050E5 31DB xor bx,bx - 34755 000050E7 2E891E[7898] mov [cs:$P_1st_Val],bx ; 0 - 34756 000050EC 2E891E[7A98] mov [cs:$P_2nd_Val],bx ; 0 - 34757 000050F1 2E891E[7C98] mov [cs:$P_3rd_Val],bx ; 0 - 34758 000050F6 2E891E[7E98] mov [cs:$P_4th_Val],bx ; 0 - 34759 ;inc bl - 34760 ;mov [cs:$P_Got_Time],bl ; 1 - 34761 - 34762 ;mov bl,$P_colon_period - 34763 ;mov bl,1 ; $P_colon_period ;AN032; flag, indicates use of - 34764 ; delimiters between hours, - 34765 ; minutes,seconds - 34766 ; 03/04/2023 - Retro DOS v4.0 COMMAND.COM - 34767 000050FB FEC3 inc bl ; bl = 1 - 34768 000050FD 2E881E[5598] mov [cs:$P_Got_Time],bl ; 1 - 34769 ; - 34770 00005102 E87CFF call $P_Get_DecNum ;AN000; get 1st number - 34771 ;jc short $P_TimeF_Err0 ;AN000; - 34772 ; 12/08/2024 - 34773 00005105 725A jc short $P_TimeF_Error - 34774 00005107 2EA3[7898] mov [cs:$P_1st_Val],ax ;AC034; - 34775 0000510B 08DB or bl,bl ;AN000; end of line ? - 34776 0000510D 7478 jz short $P_TimeF_Rlt ;AN000; - 34777 0000510F E86FFF call $P_Get_DecNum ;AN000; get 2nd number - 34778 ;jc short $P_TimeF_Err0 ;AC038; if OK - 34779 ; 12/08/2024 - 34780 00005112 724D jc short $P_TimeF_Error - 34781 00005114 2EA3[7A98] mov [cs:$P_2nd_Val],ax ;AC034; - 34782 00005118 08DB or bl,bl ;AN000; end of line ? - 34783 0000511A 746B jz short $P_TimeF_Rlt ;AN000; - 34784 0000511C B302 mov bl,2 ; $P_period_only ;AN032; flag, which to decimal separator - 34785 0000511E E860FF call $P_Get_DecNum ;AN000; get 3rd number - 34786 ;jc short $P_TimeF_Err0 ;AC039; if problem, bridge to error - 34787 ; 12/08/2024 - 34788 00005121 723E jc short $P_TimeF_Error - 34789 00005123 2EA3[7C98] mov [cs:$P_3rd_Val],ax ;AC034; - 34790 00005127 08DB or bl,bl ;AN000; end of line ? - 34791 00005129 754F jnz short $P_Time_4 ;AN039; NOT END OF LINE, - 34792 ;AN039; GO TO 4TH NUMBER - 34793 ;test byte [cs:$P_Flags1],$P_Time_Again ; 2 - 34794 0000512B 2EF606[C597]02 test byte [cs:$P_Flags1],2 ;AN039; HAS TIME PARSE - 34795 ;AN039; BEEN REPEATED? - 34796 00005131 7554 jnz short $P_TimeF_Rlt ;AN039; yes, this is really - 34797 ;AN039; the end of line - 34798 ;AN039; no, time has not been repeated - 34799 00005133 2E8B36[BC97] mov si,[cs:$P_SI_Save] ;AN039; get where parser quit - 34800 ;AN039; in command line - 34801 00005138 807CFF2C cmp byte [si-1],$P_Comma ; ',' - 34802 ;AN039; look at delimiter - 34803 ;AN039; from command line - 34804 0000513C 7549 jne short $P_TimeF_Rlt ;AN039; was not a comma, this is - 34805 ;AN039; really end of line - 34806 ;AN039; is comma before hundredths, - 34807 ;AN039; redo TIME - 34808 0000513E C644FF2E mov byte [si-1],$P_Period ; '.' - 34809 ;AN039; change that ambiguous - 34810 ;AN039; comma to a decimal point - 34811 ;AN039; parse can understand - 34812 00005142 2EC706[C597]0000 mov word [cs:$P_Flags],0 ;AN039; Clear all internal flags - 34813 ;or byte [cs:$P_Flags1],$P_Time_Again - 34814 00005149 2E800E[C597]02 or byte [cs:$P_Flags1],2 ;AN039; indicate TIME - 34815 ;AN039; is being repeated - 34816 0000514F 2E8B0E[4F98] mov cx,[cs:$P_ORIG_ORD] ;AN039; ORIGINAL ORDINAL FROM CX - 34817 00005154 2E8B26[5198] mov sp,[cs:$P_ORIG_STACK] ;AN039; ORIGINAL VALUE - 34818 ;AN039; OF STACK FROM SP - 34819 00005159 2E8B36[5398] mov si,[cs:$P_ORIG_SI] ;AN039; ORIGINAL START - 34820 ;AN039; PARSE POINTER FROM SI - 34821 0000515E E921F8 jmp $P_Redo_Time ;AN039; go try TIME again - 34822 - 34823 ; 12/08/2024 - 34824 $P_TimeF_Error: ;AN000; - 34825 $P_TimeF_Err: ;AN000; - 34826 00005161 5B pop bx ;AN000; recover CONTROL block - 34827 00005162 5E pop si ;AN000; recover string pointer - 34828 ;mov ah,$P_No_Tag ;AN000; set - 34829 ;mov al,$P_String ;AN000; result - 34830 ; 03/04/2023 - 34831 00005163 B803FF mov ax,($P_No_Tag<<8)+$P_String - 34832 00005166 E841FA call $P_Fill_Result ;AN000; buffer - 34833 ;AN000; to string - 34834 00005169 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax ; 9 - 34835 ;AC034; return syntax error - 34836 $P_Time_Format_Exit: ;AN000; - 34837 00005170 2EC606[5598]00 mov byte [cs:$P_Got_Time],0 ;AN023;AC034; finished with this time field - 34838 00005176 5A pop dx ;AN000; - 34839 00005177 59 pop cx ;AN000; - 34840 00005178 58 pop ax ;AN000; - 34841 00005179 C3 retn - 34842 - 34843 $P_Time_4: ;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER - 34844 0000517A E804FF call $P_Get_DecNum ;AN000; get 4th number - 34845 $P_TimeF_Err0: ;AN000; Bridge - 34846 0000517D 72E2 jc short $P_TimeF_Error ;AN000; - 34847 ; - 34848 0000517F 2EA3[7E98] mov [cs:$P_4th_Val],ax ;AC034; - 34849 00005183 08DB or bl,bl ;AN000; After hundredth, no data allowed - 34850 00005185 75DA jnz short $P_TimeF_Error ;AN000; if some, then error - 34851 $P_TimeF_Rlt: ;AN000; - 34852 00005187 2EA1[7898] mov ax,[cs:$P_1st_Val] ;AC034; - 34853 0000518B 08E4 or ah,ah ;AN000; if overflow then error - 34854 0000518D 75D2 jnz short $P_TimeF_Err ;AN000; - 34855 ;test byte [cs:$P_Flags1],$P_Time12am ; 1 - 34856 0000518F 2EF606[C597]01 test byte [cs:$P_Flags1],1 ;AN038;if "am" specified - 34857 00005195 7408 jz short $P_Time_notAM ;AN038;skip if no "AM" specified - 34858 ;since "AM" was specified, - 34859 00005197 3C0C cmp al,12 ;AN038: if hour specified as later than noon - 34860 00005199 77C6 ja short $P_TimeF_Err ;AN038; error if "AM" on more than noon - 34861 0000519B 7502 jne short $P_Time_notAM ;AN038; for noon exactly, - 34862 0000519D 30C0 xor al,al ;AN038; set hour = zero - 34863 $P_Time_notAM: ;AN038; - 34864 ;test byte [cs:$P_Flags2],$P_Time12 - 34865 0000519F 2EF606[C697]04 test byte [cs:$P_Flags2],4 ;AC034; if 12 hour system and pm is specified - 34866 000051A5 740C jz short $P_TimeSkip00 ;AN000; then - 34867 000051A7 3C0C cmp al,12 ;AN038; if 12:00 o'clock already - 34868 000051A9 7408 je short $P_TimeSkip00 ;AN038; it is PM already - 34869 000051AB 040C add al,12 ;AN000; add 12 hours to make it afternoon - 34870 000051AD 72B2 jc short $P_TimeF_Err ;AN000; if overflow then error - 34871 000051AF 3C18 cmp al,24 ;AN038; after adding 12, now cannot be >24 - 34872 000051B1 77AE ja short $P_TimeF_Err ;AN038; if too big, error - 34873 $P_TimeSkip00: ;AN000; - 34874 000051B3 88C2 mov dl,al ;AN000; set hour - 34875 000051B5 2EA1[7A98] mov ax,[cs:$P_2nd_Val] ;AC034; - 34876 000051B9 08E4 or ah,ah ;AN000; if overflow then error - 34877 000051BB 75A4 jnz short $P_TimeF_Err ;AN000; - 34878 000051BD 88C6 mov dh,al ;AN000; set minute - 34879 000051BF 2EA1[7C98] mov ax,[cs:$P_3rd_Val] ;AC034; - 34880 000051C3 08E4 or ah,ah ;AN000; if overflow then error - 34881 000051C5 759A jnz short $P_TimeF_Err ;AN000; - 34882 000051C7 88C1 mov cl,al ;AN000; set second - 34883 000051C9 2EA1[7E98] mov ax,[cs:$P_4th_Val] ;AC034; - 34884 000051CD 08E4 or ah,ah ;AN000; if overflow then error - 34885 000051CF 7590 jnz short $P_TimeF_Err ;AN000; - 34886 000051D1 88C5 mov ch,al ;AN000; set hundredth - 34887 000051D3 5B pop bx ;AN000; recover CONTROL block - 34888 000051D4 5E pop si ;AN000; recover string pointer - 34889 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set - 34890 ;mov al,$P_Time_F ; 8 ;AN000; result - 34891 ; 03/04/2023 - 34892 000051D5 B808FF mov ax,($P_No_Tag<<8)+$P_Time_F - 34893 000051D8 E8CFF9 call $P_Fill_Result ;AN000; buffer - 34894 000051DB EB93 jmp short $P_Time_Format_Exit - 34895 ;AN000; to time - 34896 - 34897 ;*********************************************************************** - 34898 ; $P_Time_2412: - 34899 ; - 34900 ; Function: Remove "a", "p", "am", or "pm" from the end of stinrg - 34901 ; - 34902 ; Input: psdata_seg:SI -> $P_STRING_BUF - 34903 ; - 34904 ; Output: Set $P_Time12 flag when the string is terminated by "p" - 34905 ; or "pm" + 34721 ; Input: psdata_seg:SI -> $P_STRING_BUF + 34722 ; ES:BX -> CONTROL block + 34723 ; + 34724 ; Output: None + 34725 ; + 34726 ; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum, $P_Time_2412 + 34727 ; + 34728 ; Vars: $P_RC(W), $P_Flags(R), $P_1st_Val(RW), $P_2nd_Val(RW) + 34729 ; $P_3rd_Val(RW), $P_4th_Val(RW) + 34730 ;*********************************************************************** + 34731 + 34732 ; 03/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34733 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34734 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 34735 $P_Time_Format: ;AN000; + 34736 000050D1 50 push ax ;AN000; + 34737 000050D2 51 push cx ;AN000; + 34738 000050D3 52 push dx ;AN000; + 34739 000050D4 56 push si ;AN000; + 34740 000050D5 53 push bx ;AN000; + 34741 000050D6 56 push si ;AN000; + 34742 000050D7 E88DFF call $P_Set_CDI ;AN000; Set country independent + 34743 ; information before process + 34744 ;test byte [cs:si+11h], 1 + 34745 000050DA 2EF6441001 test byte [cs:si+$P_CDI.$P_CDI_TimeF],1 + 34746 ;AN000; 24 hour system + 34747 000050DF 5E pop si ;AN000; + 34748 000050E0 7503 jnz short $P_TimeF00 ;AN000; if no, means 12 hour system + 34749 000050E2 E8F800 call $P_Time_2412 ;AN000; this routine handle "am" "pm" + 34750 $P_TimeF00: ;AN000; + 34751 ;mov word [cs:$P_1st_Val],0 ;AC034; set initial value + 34752 ;mov word [cs:$P_2nd_Val],0 ;AC034; set initial value + 34753 ;mov word [cs:$P_3rd_Val],0 ;AC034; set initial value + 34754 ;mov word [cs:$P_4th_Val],0 ;AC034; set initial value + 34755 ;mov byte [cs:$P_Got_Time],1 ;AN023;AC034;; use time delimiter + 34756 ; 03/04/2023 + 34757 000050E5 31DB xor bx,bx + 34758 000050E7 2E891E[7898] mov [cs:$P_1st_Val],bx ; 0 + 34759 000050EC 2E891E[7A98] mov [cs:$P_2nd_Val],bx ; 0 + 34760 000050F1 2E891E[7C98] mov [cs:$P_3rd_Val],bx ; 0 + 34761 000050F6 2E891E[7E98] mov [cs:$P_4th_Val],bx ; 0 + 34762 ;inc bl + 34763 ;mov [cs:$P_Got_Time],bl ; 1 + 34764 + 34765 ;mov bl,$P_colon_period + 34766 ;mov bl,1 ; $P_colon_period ;AN032; flag, indicates use of + 34767 ; delimiters between hours, + 34768 ; minutes,seconds + 34769 ; 03/04/2023 - Retro DOS v4.0 COMMAND.COM + 34770 000050FB FEC3 inc bl ; bl = 1 + 34771 000050FD 2E881E[5598] mov [cs:$P_Got_Time],bl ; 1 + 34772 ; + 34773 00005102 E87CFF call $P_Get_DecNum ;AN000; get 1st number + 34774 ;jc short $P_TimeF_Err0 ;AN000; + 34775 ; 12/08/2024 + 34776 00005105 725A jc short $P_TimeF_Error + 34777 00005107 2EA3[7898] mov [cs:$P_1st_Val],ax ;AC034; + 34778 0000510B 08DB or bl,bl ;AN000; end of line ? + 34779 0000510D 7478 jz short $P_TimeF_Rlt ;AN000; + 34780 0000510F E86FFF call $P_Get_DecNum ;AN000; get 2nd number + 34781 ;jc short $P_TimeF_Err0 ;AC038; if OK + 34782 ; 12/08/2024 + 34783 00005112 724D jc short $P_TimeF_Error + 34784 00005114 2EA3[7A98] mov [cs:$P_2nd_Val],ax ;AC034; + 34785 00005118 08DB or bl,bl ;AN000; end of line ? + 34786 0000511A 746B jz short $P_TimeF_Rlt ;AN000; + 34787 0000511C B302 mov bl,2 ; $P_period_only ;AN032; flag, which to decimal separator + 34788 0000511E E860FF call $P_Get_DecNum ;AN000; get 3rd number + 34789 ;jc short $P_TimeF_Err0 ;AC039; if problem, bridge to error + 34790 ; 12/08/2024 + 34791 00005121 723E jc short $P_TimeF_Error + 34792 00005123 2EA3[7C98] mov [cs:$P_3rd_Val],ax ;AC034; + 34793 00005127 08DB or bl,bl ;AN000; end of line ? + 34794 00005129 754F jnz short $P_Time_4 ;AN039; NOT END OF LINE, + 34795 ;AN039; GO TO 4TH NUMBER + 34796 ;test byte [cs:$P_Flags1],$P_Time_Again ; 2 + 34797 0000512B 2EF606[C597]02 test byte [cs:$P_Flags1],2 ;AN039; HAS TIME PARSE + 34798 ;AN039; BEEN REPEATED? + 34799 00005131 7554 jnz short $P_TimeF_Rlt ;AN039; yes, this is really + 34800 ;AN039; the end of line + 34801 ;AN039; no, time has not been repeated + 34802 00005133 2E8B36[BC97] mov si,[cs:$P_SI_Save] ;AN039; get where parser quit + 34803 ;AN039; in command line + 34804 00005138 807CFF2C cmp byte [si-1],$P_Comma ; ',' + 34805 ;AN039; look at delimiter + 34806 ;AN039; from command line + 34807 0000513C 7549 jne short $P_TimeF_Rlt ;AN039; was not a comma, this is + 34808 ;AN039; really end of line + 34809 ;AN039; is comma before hundredths, + 34810 ;AN039; redo TIME + 34811 0000513E C644FF2E mov byte [si-1],$P_Period ; '.' + 34812 ;AN039; change that ambiguous + 34813 ;AN039; comma to a decimal point + 34814 ;AN039; parse can understand + 34815 00005142 2EC706[C597]0000 mov word [cs:$P_Flags],0 ;AN039; Clear all internal flags + 34816 ;or byte [cs:$P_Flags1],$P_Time_Again + 34817 00005149 2E800E[C597]02 or byte [cs:$P_Flags1],2 ;AN039; indicate TIME + 34818 ;AN039; is being repeated + 34819 0000514F 2E8B0E[4F98] mov cx,[cs:$P_ORIG_ORD] ;AN039; ORIGINAL ORDINAL FROM CX + 34820 00005154 2E8B26[5198] mov sp,[cs:$P_ORIG_STACK] ;AN039; ORIGINAL VALUE + 34821 ;AN039; OF STACK FROM SP + 34822 00005159 2E8B36[5398] mov si,[cs:$P_ORIG_SI] ;AN039; ORIGINAL START + 34823 ;AN039; PARSE POINTER FROM SI + 34824 0000515E E921F8 jmp $P_Redo_Time ;AN039; go try TIME again + 34825 + 34826 ; 12/08/2024 + 34827 $P_TimeF_Error: ;AN000; + 34828 $P_TimeF_Err: ;AN000; + 34829 00005161 5B pop bx ;AN000; recover CONTROL block + 34830 00005162 5E pop si ;AN000; recover string pointer + 34831 ;mov ah,$P_No_Tag ;AN000; set + 34832 ;mov al,$P_String ;AN000; result + 34833 ; 03/04/2023 + 34834 00005163 B803FF mov ax,($P_No_Tag<<8)+$P_String + 34835 00005166 E841FA call $P_Fill_Result ;AN000; buffer + 34836 ;AN000; to string + 34837 00005169 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax ; 9 + 34838 ;AC034; return syntax error + 34839 $P_Time_Format_Exit: ;AN000; + 34840 00005170 2EC606[5598]00 mov byte [cs:$P_Got_Time],0 ;AN023;AC034; finished with this time field + 34841 00005176 5A pop dx ;AN000; + 34842 00005177 59 pop cx ;AN000; + 34843 00005178 58 pop ax ;AN000; + 34844 00005179 C3 retn + 34845 + 34846 $P_Time_4: ;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER + 34847 0000517A E804FF call $P_Get_DecNum ;AN000; get 4th number + 34848 $P_TimeF_Err0: ;AN000; Bridge + 34849 0000517D 72E2 jc short $P_TimeF_Error ;AN000; + 34850 ; + 34851 0000517F 2EA3[7E98] mov [cs:$P_4th_Val],ax ;AC034; + 34852 00005183 08DB or bl,bl ;AN000; After hundredth, no data allowed + 34853 00005185 75DA jnz short $P_TimeF_Error ;AN000; if some, then error + 34854 $P_TimeF_Rlt: ;AN000; + 34855 00005187 2EA1[7898] mov ax,[cs:$P_1st_Val] ;AC034; + 34856 0000518B 08E4 or ah,ah ;AN000; if overflow then error + 34857 0000518D 75D2 jnz short $P_TimeF_Err ;AN000; + 34858 ;test byte [cs:$P_Flags1],$P_Time12am ; 1 + 34859 0000518F 2EF606[C597]01 test byte [cs:$P_Flags1],1 ;AN038;if "am" specified + 34860 00005195 7408 jz short $P_Time_notAM ;AN038;skip if no "AM" specified + 34861 ;since "AM" was specified, + 34862 00005197 3C0C cmp al,12 ;AN038: if hour specified as later than noon + 34863 00005199 77C6 ja short $P_TimeF_Err ;AN038; error if "AM" on more than noon + 34864 0000519B 7502 jne short $P_Time_notAM ;AN038; for noon exactly, + 34865 0000519D 30C0 xor al,al ;AN038; set hour = zero + 34866 $P_Time_notAM: ;AN038; + 34867 ;test byte [cs:$P_Flags2],$P_Time12 + 34868 0000519F 2EF606[C697]04 test byte [cs:$P_Flags2],4 ;AC034; if 12 hour system and pm is specified + 34869 000051A5 740C jz short $P_TimeSkip00 ;AN000; then + 34870 000051A7 3C0C cmp al,12 ;AN038; if 12:00 o'clock already + 34871 000051A9 7408 je short $P_TimeSkip00 ;AN038; it is PM already + 34872 000051AB 040C add al,12 ;AN000; add 12 hours to make it afternoon + 34873 000051AD 72B2 jc short $P_TimeF_Err ;AN000; if overflow then error + 34874 000051AF 3C18 cmp al,24 ;AN038; after adding 12, now cannot be >24 + 34875 000051B1 77AE ja short $P_TimeF_Err ;AN038; if too big, error + 34876 $P_TimeSkip00: ;AN000; + 34877 000051B3 88C2 mov dl,al ;AN000; set hour + 34878 000051B5 2EA1[7A98] mov ax,[cs:$P_2nd_Val] ;AC034; + 34879 000051B9 08E4 or ah,ah ;AN000; if overflow then error + 34880 000051BB 75A4 jnz short $P_TimeF_Err ;AN000; + 34881 000051BD 88C6 mov dh,al ;AN000; set minute + 34882 000051BF 2EA1[7C98] mov ax,[cs:$P_3rd_Val] ;AC034; + 34883 000051C3 08E4 or ah,ah ;AN000; if overflow then error + 34884 000051C5 759A jnz short $P_TimeF_Err ;AN000; + 34885 000051C7 88C1 mov cl,al ;AN000; set second + 34886 000051C9 2EA1[7E98] mov ax,[cs:$P_4th_Val] ;AC034; + 34887 000051CD 08E4 or ah,ah ;AN000; if overflow then error + 34888 000051CF 7590 jnz short $P_TimeF_Err ;AN000; + 34889 000051D1 88C5 mov ch,al ;AN000; set hundredth + 34890 000051D3 5B pop bx ;AN000; recover CONTROL block + 34891 000051D4 5E pop si ;AN000; recover string pointer + 34892 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set + 34893 ;mov al,$P_Time_F ; 8 ;AN000; result + 34894 ; 03/04/2023 + 34895 000051D5 B808FF mov ax,($P_No_Tag<<8)+$P_Time_F + 34896 000051D8 E8CFF9 call $P_Fill_Result ;AN000; buffer + 34897 000051DB EB93 jmp short $P_Time_Format_Exit + 34898 ;AN000; to time + 34899 + 34900 ;*********************************************************************** + 34901 ; $P_Time_2412: + 34902 ; + 34903 ; Function: Remove "a", "p", "am", or "pm" from the end of stinrg + 34904 ; + 34905 ; Input: psdata_seg:SI -> $P_STRING_BUF 34906 ; - 34907 ; Vars: $P_Flags(W) - 34908 ;*********************************************************************** - 34909 - 34910 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34911 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34912 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 34913 $P_Time_2412: ;AN000; - 34914 000051DD 50 push ax ;AN000; - 34915 000051DE 56 push si ;AN000; - 34916 $P_T12_Loop: ;AN000; - 34917 000051DF 2E8A04 mov al,[cs:si] ;AN000; Move - 34918 000051E2 46 inc si ;AN000; si - 34919 000051E3 08C0 or al,al ;AN000; to - 34920 000051E5 75F8 jnz short $P_T12_Loop ;AN000; end of string - 34921 - 34922 000051E7 2E8A44FE mov al,[cs:si-2] ;AN000; get char just before NULL - 34923 ;or al,20h - 34924 000051EB 0C20 or al,$P_Make_Lower ; 20h ;AN000; lower case map - 34925 000051ED 3C70 cmp al,"p" ;AN000; only "p" of "pm" ? - 34926 000051EF 7425 je short $P_T1200 ;AN000; - 34927 - 34928 000051F1 3C61 cmp al,"a" ;AN000; only "a" of "am" ? - 34929 000051F3 7413 je short $P_T1201 ;AN000; + 34907 ; Output: Set $P_Time12 flag when the string is terminated by "p" + 34908 ; or "pm" + 34909 ; + 34910 ; Vars: $P_Flags(W) + 34911 ;*********************************************************************** + 34912 + 34913 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34914 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34915 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 34916 $P_Time_2412: ;AN000; + 34917 000051DD 50 push ax ;AN000; + 34918 000051DE 56 push si ;AN000; + 34919 $P_T12_Loop: ;AN000; + 34920 000051DF 2E8A04 mov al,[cs:si] ;AN000; Move + 34921 000051E2 46 inc si ;AN000; si + 34922 000051E3 08C0 or al,al ;AN000; to + 34923 000051E5 75F8 jnz short $P_T12_Loop ;AN000; end of string + 34924 + 34925 000051E7 2E8A44FE mov al,[cs:si-2] ;AN000; get char just before NULL + 34926 ;or al,20h + 34927 000051EB 0C20 or al,$P_Make_Lower ; 20h ;AN000; lower case map + 34928 000051ED 3C70 cmp al,"p" ;AN000; only "p" of "pm" ? + 34929 000051EF 7425 je short $P_T1200 ;AN000; 34930 - 34931 000051F5 3C6D cmp al,"m" ;AN000; "m" of "am" or "pm" - 34932 000051F7 751A jne short $P_T12_Exit ;AN000; + 34931 000051F1 3C61 cmp al,"a" ;AN000; only "a" of "am" ? + 34932 000051F3 7413 je short $P_T1201 ;AN000; 34933 - 34934 000051F9 4E dec si ;AN000; - 34935 000051FA 2E8A44FE mov al,[cs:si-2] ;AN000; - 34936 ;or al,20h - 34937 000051FE 0C20 or al,$P_Make_Lower ; 20h ;AN000; lower case map - 34938 00005200 3C70 cmp al,"p" ;AN000; "p" of "pm" ? - 34939 00005202 7412 je short $P_T1200 ;AN000; - 34940 - 34941 00005204 3C61 cmp al,"a" ;AN000; "a" of "am" ? - 34942 ;je short $P_T1201 ;AN000; go process "a" - 34943 ;jmp short $P_T12_Exit ;AN000; no special chars found - 34944 ; 05/04/2023 - 34945 00005206 750B jne short $P_T12_Exit - 34946 - 34947 ;$P_T1200: ;AN000; "P" found - 34948 ;;or byte [cs:$P_Flags2],$P_Time12 - 34949 ;or byte [cs:$P_Flags2],4 ;AC034; flag "PM" found - 34950 ;jmp short $P_Tclr_chr ;AN038; go clear the special char - 34951 - 34952 $P_T1201: ;AN000; "A" found - 34953 ;or byte [cs:$P_Flags1],$P_Time12AM - 34954 00005208 2E800E[C597]01 or byte [cs:$P_Flags1],1 ;AN038; flag "AM" found - 34955 $P_Tclr_chr: ;AN038; - 34956 0000520E 2EC644FE00 mov byte [cs:si-2],$P_NULL ;AN000; null out special char - 34957 $P_T12_Exit: ;AN000; - 34958 00005213 5E pop si ;AN000; - 34959 00005214 58 pop ax ;AN000; - 34960 00005215 C3 retn ;AN000; - 34961 - 34962 ; 05/04/2023 - 34963 $P_T1200: ;AN000; "P" found - 34964 ;or byte [cs:$P_Flags2],$P_Time12 - 34965 00005216 2E800E[C697]04 or byte [cs:$P_Flags2],4 ;AC034; flag "PM" found - 34966 0000521C EBF0 jmp short $P_Tclr_chr ;AN038; go clear the special char - 34967 - 34968 ;*********************************************************************** - 34969 ; $P_File_Format; - 34970 ; - 34971 ; Function: Check if the input string is valid file spec format. - 34972 ; And set the result buffer. + 34934 000051F5 3C6D cmp al,"m" ;AN000; "m" of "am" or "pm" + 34935 000051F7 751A jne short $P_T12_Exit ;AN000; + 34936 + 34937 000051F9 4E dec si ;AN000; + 34938 000051FA 2E8A44FE mov al,[cs:si-2] ;AN000; + 34939 ;or al,20h + 34940 000051FE 0C20 or al,$P_Make_Lower ; 20h ;AN000; lower case map + 34941 00005200 3C70 cmp al,"p" ;AN000; "p" of "pm" ? + 34942 00005202 7412 je short $P_T1200 ;AN000; + 34943 + 34944 00005204 3C61 cmp al,"a" ;AN000; "a" of "am" ? + 34945 ;je short $P_T1201 ;AN000; go process "a" + 34946 ;jmp short $P_T12_Exit ;AN000; no special chars found + 34947 ; 05/04/2023 + 34948 00005206 750B jne short $P_T12_Exit + 34949 + 34950 ;$P_T1200: ;AN000; "P" found + 34951 ;;or byte [cs:$P_Flags2],$P_Time12 + 34952 ;or byte [cs:$P_Flags2],4 ;AC034; flag "PM" found + 34953 ;jmp short $P_Tclr_chr ;AN038; go clear the special char + 34954 + 34955 $P_T1201: ;AN000; "A" found + 34956 ;or byte [cs:$P_Flags1],$P_Time12AM + 34957 00005208 2E800E[C597]01 or byte [cs:$P_Flags1],1 ;AN038; flag "AM" found + 34958 $P_Tclr_chr: ;AN038; + 34959 0000520E 2EC644FE00 mov byte [cs:si-2],$P_NULL ;AN000; null out special char + 34960 $P_T12_Exit: ;AN000; + 34961 00005213 5E pop si ;AN000; + 34962 00005214 58 pop ax ;AN000; + 34963 00005215 C3 retn ;AN000; + 34964 + 34965 ; 05/04/2023 + 34966 $P_T1200: ;AN000; "P" found + 34967 ;or byte [cs:$P_Flags2],$P_Time12 + 34968 00005216 2E800E[C697]04 or byte [cs:$P_Flags2],4 ;AC034; flag "PM" found + 34969 0000521C EBF0 jmp short $P_Tclr_chr ;AN038; go clear the special char + 34970 + 34971 ;*********************************************************************** + 34972 ; $P_File_Format; 34973 ; - 34974 ; Input: psdata_seg:SI -> $P_STRING_BUF - 34975 ; ES:BX -> CONTROL block + 34974 ; Function: Check if the input string is valid file spec format. + 34975 ; And set the result buffer. 34976 ; - 34977 ; Output: None - 34978 ; - 34979 ; Use: $P_Fill_Result, $P_Chk_DBCS, $P_FileSp_Chk - 34980 ; - 34981 ; Vars: $P_RC(W), $P_SI_Save(W), $P_Terminator(W), $P_SaveSI_Cmpx(R) - 34982 ; $P_SaveSI_Cmpx(R) - 34983 ;*********************************************************************** - 34984 - 34985 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 34986 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4DF0h + 34977 ; Input: psdata_seg:SI -> $P_STRING_BUF + 34978 ; ES:BX -> CONTROL block + 34979 ; + 34980 ; Output: None + 34981 ; + 34982 ; Use: $P_Fill_Result, $P_Chk_DBCS, $P_FileSp_Chk + 34983 ; + 34984 ; Vars: $P_RC(W), $P_SI_Save(W), $P_Terminator(W), $P_SaveSI_Cmpx(R) + 34985 ; $P_SaveSI_Cmpx(R) + 34986 ;*********************************************************************** 34987 - 34988 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 34989 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:55B4h + 34988 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 34989 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4DF0h 34990 - 34991 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 34992 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:544Ah - 34993 $P_File_Format: - 34994 0000521E 50 push ax ;AN000; - 34995 0000521F 57 push di ;AN000; - 34996 00005220 56 push si ;AN000; - 34997 00005221 2E8B3E[C797] mov di,[cs:$P_SaveSI_Cmpx] ;AC034; get user buffer address - 34998 00005226 2E8A04 mov al,[cs:si] ;AN000; load character - 34999 00005229 08C0 or al,al ;AN000; end of line ? - 35000 0000522B 7413 je short $P_FileF_Err ;AN000; if yes, error exit - 35001 0000522D E85D00 call $P_FileSp_Chk ;AN000; else, check if file special character - 35002 00005230 7523 jne short $P_FileF03 ;AN000; if yes, - 35003 00005232 2EC606[9398]01 mov byte [cs:$P_err_flag],$P_error_filespec ; 1 - 35004 ;AN033;AC034;; set error flag- bad char. - 35005 00005238 5E pop si ;AN033; - 35006 00005239 2EC60400 mov byte [cs:si],$P_NULL ;AN033; - 35007 0000523D 5F pop di ;AN033; - 35008 0000523E EB3E jmp short $P_FileF02 ;AN033; - 35009 $P_FileF_Err: ;AN000; - 35010 00005240 5E pop si ;AN000; - 35011 00005241 2EC60400 mov byte [cs:si],$P_NULL ;AN000; - 35012 00005245 5F pop di ;AN000; - 35013 ;test word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Optional - 35014 ;test word [es:bx],1 ;AN000; is it optional ? - 35015 00005246 26F60701 test byte [es:bx],$P_Optional ; 1 - 35016 0000524A 7532 jnz short $P_FileF02 ;AN000; - 35017 0000524C 2EC706[BA97]0200 mov word [cs:$P_RC],$P_Op_Missing - 35018 ;mov word [cs:$P_RC],2 ;AC034; 3/17/87 - 35019 00005253 EB29 jmp short $P_FileF02 ;AN000; - 35020 $P_FileF03: ;AN000; - 35021 00005255 58 pop ax ;AN000; discard save si - 35022 00005256 56 push si ;AN000; save new si - 35023 $P_FileF_Loop1: ;AN000; - 35024 00005257 2E8A04 mov al,[cs:si] ;AN000; load character (not special char) - 35025 0000525A 08C0 or al,al ;AN000; end of line ? - 35026 0000525C 741E jz short $P_FileF_RLT ;AN000; - 35027 0000525E E82C00 call $P_FileSp_Chk ;AN000; File special character ? - 35028 00005261 740B jz short $P_FileF00 ;AN000; - 35029 00005263 E85C01 call $P_Chk_DBCS ;AN000; no, then DBCS ? - 35030 00005266 7302 jnc short $P_FileF01 ;AN000; - 35031 00005268 47 inc di ;AN000; if yes, skip next byte - 35032 00005269 46 inc si ;AN000; - 35033 $P_FileF01: ;AN000; - 35034 0000526A 47 inc di ;AN000; - 35035 0000526B 46 inc si ;AN000; - 35036 0000526C EBE9 jmp short $P_FileF_Loop1 ;AN000; - 35037 $P_FileF00: ;AN000; - 35038 0000526E 2EA2[C097] mov [cs:$P_Terminator],al ;AC034; - 35039 00005272 2EC60400 mov byte [cs:si],$P_NULL ;AN000; update end of string - 35040 00005276 47 inc di ;AN000; - 35041 00005277 2E893E[BC97] mov [cs:$P_SI_Save],di ;AC034; update next pointer in command line - 35042 $P_FileF_RLT: ;AN000; - 35043 0000527C 5E pop si ;AN000; - 35044 0000527D 5F pop di ;AN000; - 35045 $P_FileF02: ;AN000; - 35046 0000527E 58 pop ax ;AN000; (tm14) - 35047 ;;test ax,200h - 35048 ;test ax,$P_File_Spc ;AN000; (tm14) - 35049 ; 05/04/2023 - 35050 0000527F F6C402 test ah,($P_File_Spc>>8) - 35051 00005282 7408 jz short $P_Drv_Only_Exit ;AN000; (tm14) - 35052 00005284 50 push ax ;AN000; (tm14) - 35053 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set - 35054 ;mov al,$P_File_Spec ; 5 ;AN000; result - 35055 ; 05/04/2023 - 35056 00005285 B805FF mov ax,($P_No_Tag<<8)+$P_File_Spec - 35057 00005288 E81FF9 call $P_Fill_Result ;AN000; buffer to file spec - 35058 0000528B 58 pop ax ;AN000; - 35059 $P_Drv_Only_Exit: ;AN000; (tm14) - 35060 0000528C C3 retn ;AN000; - 35061 - 35062 ;*********************************************************************** - 35063 ; $P_FileSp_Chk - 35064 ; - 35065 ; Function: Check if the input byte is one of file special characters - 35066 ; - 35067 ; Input: psdata_seg:SI -> $P_STRING_BUF - 35068 ; AL = character code to be examineed + 34991 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 34992 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:55B4h + 34993 + 34994 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 34995 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:544Ah + 34996 $P_File_Format: + 34997 0000521E 50 push ax ;AN000; + 34998 0000521F 57 push di ;AN000; + 34999 00005220 56 push si ;AN000; + 35000 00005221 2E8B3E[C797] mov di,[cs:$P_SaveSI_Cmpx] ;AC034; get user buffer address + 35001 00005226 2E8A04 mov al,[cs:si] ;AN000; load character + 35002 00005229 08C0 or al,al ;AN000; end of line ? + 35003 0000522B 7413 je short $P_FileF_Err ;AN000; if yes, error exit + 35004 0000522D E85D00 call $P_FileSp_Chk ;AN000; else, check if file special character + 35005 00005230 7523 jne short $P_FileF03 ;AN000; if yes, + 35006 00005232 2EC606[9398]01 mov byte [cs:$P_err_flag],$P_error_filespec ; 1 + 35007 ;AN033;AC034;; set error flag- bad char. + 35008 00005238 5E pop si ;AN033; + 35009 00005239 2EC60400 mov byte [cs:si],$P_NULL ;AN033; + 35010 0000523D 5F pop di ;AN033; + 35011 0000523E EB3E jmp short $P_FileF02 ;AN033; + 35012 $P_FileF_Err: ;AN000; + 35013 00005240 5E pop si ;AN000; + 35014 00005241 2EC60400 mov byte [cs:si],$P_NULL ;AN000; + 35015 00005245 5F pop di ;AN000; + 35016 ;test word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Optional + 35017 ;test word [es:bx],1 ;AN000; is it optional ? + 35018 00005246 26F60701 test byte [es:bx],$P_Optional ; 1 + 35019 0000524A 7532 jnz short $P_FileF02 ;AN000; + 35020 0000524C 2EC706[BA97]0200 mov word [cs:$P_RC],$P_Op_Missing + 35021 ;mov word [cs:$P_RC],2 ;AC034; 3/17/87 + 35022 00005253 EB29 jmp short $P_FileF02 ;AN000; + 35023 $P_FileF03: ;AN000; + 35024 00005255 58 pop ax ;AN000; discard save si + 35025 00005256 56 push si ;AN000; save new si + 35026 $P_FileF_Loop1: ;AN000; + 35027 00005257 2E8A04 mov al,[cs:si] ;AN000; load character (not special char) + 35028 0000525A 08C0 or al,al ;AN000; end of line ? + 35029 0000525C 741E jz short $P_FileF_RLT ;AN000; + 35030 0000525E E82C00 call $P_FileSp_Chk ;AN000; File special character ? + 35031 00005261 740B jz short $P_FileF00 ;AN000; + 35032 00005263 E85C01 call $P_Chk_DBCS ;AN000; no, then DBCS ? + 35033 00005266 7302 jnc short $P_FileF01 ;AN000; + 35034 00005268 47 inc di ;AN000; if yes, skip next byte + 35035 00005269 46 inc si ;AN000; + 35036 $P_FileF01: ;AN000; + 35037 0000526A 47 inc di ;AN000; + 35038 0000526B 46 inc si ;AN000; + 35039 0000526C EBE9 jmp short $P_FileF_Loop1 ;AN000; + 35040 $P_FileF00: ;AN000; + 35041 0000526E 2EA2[C097] mov [cs:$P_Terminator],al ;AC034; + 35042 00005272 2EC60400 mov byte [cs:si],$P_NULL ;AN000; update end of string + 35043 00005276 47 inc di ;AN000; + 35044 00005277 2E893E[BC97] mov [cs:$P_SI_Save],di ;AC034; update next pointer in command line + 35045 $P_FileF_RLT: ;AN000; + 35046 0000527C 5E pop si ;AN000; + 35047 0000527D 5F pop di ;AN000; + 35048 $P_FileF02: ;AN000; + 35049 0000527E 58 pop ax ;AN000; (tm14) + 35050 ;;test ax,200h + 35051 ;test ax,$P_File_Spc ;AN000; (tm14) + 35052 ; 05/04/2023 + 35053 0000527F F6C402 test ah,($P_File_Spc>>8) + 35054 00005282 7408 jz short $P_Drv_Only_Exit ;AN000; (tm14) + 35055 00005284 50 push ax ;AN000; (tm14) + 35056 ;mov ah,$P_No_Tag ; 0FFh ;AN000; set + 35057 ;mov al,$P_File_Spec ; 5 ;AN000; result + 35058 ; 05/04/2023 + 35059 00005285 B805FF mov ax,($P_No_Tag<<8)+$P_File_Spec + 35060 00005288 E81FF9 call $P_Fill_Result ;AN000; buffer to file spec + 35061 0000528B 58 pop ax ;AN000; + 35062 $P_Drv_Only_Exit: ;AN000; (tm14) + 35063 0000528C C3 retn ;AN000; + 35064 + 35065 ;*********************************************************************** + 35066 ; $P_FileSp_Chk + 35067 ; + 35068 ; Function: Check if the input byte is one of file special characters 35069 ; - 35070 ; Output: ZF = 1 , AL is one of special characters - 35071 ;*********************************************************************** - 35072 - 35073 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35074 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35075 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35076 $P_FileSp_Chk: - 35077 0000528D 53 push bx ;AN000; - 35078 0000528E 51 push cx ;AN000; - 35079 ;lea bx,[cs:$P_FileSp_Char] ;AC034; special character table - 35080 0000528F 8D1E[8A98] lea bx,$P_FileSp_Char ; '[]|<>+=;"' - 35081 00005293 B90900 mov cx,$P_FileSp_Len ; 9 - 35082 ;mov cx,9 ;AN000; load length of it - 35083 $P_FileSp_Loop: ;AN000; - 35084 00005296 2E3A07 cmp al,[cs:bx] ;AN000; is it one of special character ? - 35085 00005299 7404 je short $P_FileSp_Exit ;AN000; - 35086 0000529B 43 inc bx ;AN000; - 35087 0000529C E2F8 loop $P_FileSp_Loop ;AN000; - 35088 0000529E 41 inc cx ;AN000; reset ZF - 35089 $P_FileSp_Exit: ;AN000; - 35090 0000529F 59 pop cx ;AN000; - 35091 000052A0 5B pop bx ;AN000; - 35092 000052A1 C3 retn ;AN000; - 35093 - 35094 ;*********************************************************************** - 35095 ; $P_Drive_Format; - 35096 ; - 35097 ; Function: Check if the input string is valid drive only format. - 35098 ; And set the result buffer. + 35070 ; Input: psdata_seg:SI -> $P_STRING_BUF + 35071 ; AL = character code to be examineed + 35072 ; + 35073 ; Output: ZF = 1 , AL is one of special characters + 35074 ;*********************************************************************** + 35075 + 35076 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35077 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35078 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35079 $P_FileSp_Chk: + 35080 0000528D 53 push bx ;AN000; + 35081 0000528E 51 push cx ;AN000; + 35082 ;lea bx,[cs:$P_FileSp_Char] ;AC034; special character table + 35083 0000528F 8D1E[8A98] lea bx,$P_FileSp_Char ; '[]|<>+=;"' + 35084 00005293 B90900 mov cx,$P_FileSp_Len ; 9 + 35085 ;mov cx,9 ;AN000; load length of it + 35086 $P_FileSp_Loop: ;AN000; + 35087 00005296 2E3A07 cmp al,[cs:bx] ;AN000; is it one of special character ? + 35088 00005299 7404 je short $P_FileSp_Exit ;AN000; + 35089 0000529B 43 inc bx ;AN000; + 35090 0000529C E2F8 loop $P_FileSp_Loop ;AN000; + 35091 0000529E 41 inc cx ;AN000; reset ZF + 35092 $P_FileSp_Exit: ;AN000; + 35093 0000529F 59 pop cx ;AN000; + 35094 000052A0 5B pop bx ;AN000; + 35095 000052A1 C3 retn ;AN000; + 35096 + 35097 ;*********************************************************************** + 35098 ; $P_Drive_Format; 35099 ; - 35100 ; Input: psdata_seg:SI -> $P_STRING_BUF - 35101 ; ES:BX -> CONTROL block + 35100 ; Function: Check if the input string is valid drive only format. + 35101 ; And set the result buffer. 35102 ; - 35103 ; Output: None - 35104 ; - 35105 ; Use: $P_Fill_Result, $P_Chk_DBCS - 35106 ; - 35107 ; Vars: $P_RC(W) - 35108 ;*********************************************************************** - 35109 - 35110 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35111 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35112 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35113 $P_Drive_Format: - 35114 000052A2 50 push ax ;AN000; - 35115 000052A3 52 push dx ;AN000; - 35116 000052A4 2E8A04 mov al,[cs:si] ;AN000; - 35117 000052A7 08C0 or al,al ;AN000; if null string - 35118 000052A9 7436 jz short $P_Drv_Exit ;AN000; do nothing - 35119 000052AB E81401 call $P_Chk_DBCS ;AN000; is it leading byte ? - 35120 000052AE 722A jc short $P_Drv_Err ;AN000; - 35121 ;cmp word [cs:si+1],3Ah ; $P_Colon ; ':' - 35122 000052B0 2E837C013A cmp word [cs:si+1],$P_Colon ;AN000; "d", ":", 0 ? - 35123 000052B5 740D je short $P_DrvF00 ;AN000; - 35124 ;test word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Ig_Colon - 35125 ;test word [es:bx],10h ;AN000; colon can be ignored? - 35126 000052B7 26F60710 test byte [es:bx],$P_Ig_Colon ; 10h - 35127 000052BB 741D jz short $P_Drv_Err ;AN000; - 35128 000052BD 2E807C0100 cmp byte [cs:si+1],$P_NULL ;AN000; "d", 0 ? - 35129 000052C2 7516 jne short $P_Drv_Err ;AN000; - 35130 $P_DrvF00: ;AN000; - 35131 000052C4 0C20 or al,$P_Make_Lower ; 20h ;AN000; lower case - 35132 000052C6 3C61 cmp al,"a" ; 61h ;AN000; drive letter must - 35133 000052C8 7210 jb short $P_Drv_Err ;AN000; in range of - 35134 000052CA 3C7A cmp al,"z" ; 7Ah ;AN000; "a" - "z" - 35135 000052CC 770C ja short $P_Drv_Err ;AN000; if no, error - 35136 000052CE 2C60 sub al,"a"-1 ; 60h ;AN000; make text drive to binary drive - 35137 000052D0 88C2 mov dl,al ;AN000; set - 35138 ;mov ah,$P_No_Tag ; 0FFh ;AN000; result - 35139 ;mov al,$P_Drive ; 6 ;AN000; buffer - 35140 ; 05/04/2023 - 35141 000052D2 B806FF mov ax,($P_No_Tag<<8)+$P_Drive ; 06FFh - 35142 000052D5 E8D2F8 call $P_Fill_Result ;AN000; to drive - 35143 000052D8 EB07 jmp short $P_Drv_Exit ;AN000; - 35144 $P_Drv_Err: ;AN000; - 35145 000052DA 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax - 35146 ;mov word [cs:$P_RC],9 ;AC034; - 35147 $P_Drv_Exit: ;AN000; - 35148 000052E1 5A pop dx ;AN000; - 35149 000052E2 58 pop ax ;AN000; - 35150 000052E3 C3 retn ;AN000; - 35151 - 35152 ;*********************************************************************** - 35153 ; $P_Skip_Delim; - 35154 ; - 35155 ; Function: Skip delimiters specified in the PARMS list, white space - 35156 ; and comma. + 35103 ; Input: psdata_seg:SI -> $P_STRING_BUF + 35104 ; ES:BX -> CONTROL block + 35105 ; + 35106 ; Output: None + 35107 ; + 35108 ; Use: $P_Fill_Result, $P_Chk_DBCS + 35109 ; + 35110 ; Vars: $P_RC(W) + 35111 ;*********************************************************************** + 35112 + 35113 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35114 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35115 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35116 $P_Drive_Format: + 35117 000052A2 50 push ax ;AN000; + 35118 000052A3 52 push dx ;AN000; + 35119 000052A4 2E8A04 mov al,[cs:si] ;AN000; + 35120 000052A7 08C0 or al,al ;AN000; if null string + 35121 000052A9 7436 jz short $P_Drv_Exit ;AN000; do nothing + 35122 000052AB E81401 call $P_Chk_DBCS ;AN000; is it leading byte ? + 35123 000052AE 722A jc short $P_Drv_Err ;AN000; + 35124 ;cmp word [cs:si+1],3Ah ; $P_Colon ; ':' + 35125 000052B0 2E837C013A cmp word [cs:si+1],$P_Colon ;AN000; "d", ":", 0 ? + 35126 000052B5 740D je short $P_DrvF00 ;AN000; + 35127 ;test word [es:bx+$P_CONTROL_BLK.$P_Match_Flag],$P_Ig_Colon + 35128 ;test word [es:bx],10h ;AN000; colon can be ignored? + 35129 000052B7 26F60710 test byte [es:bx],$P_Ig_Colon ; 10h + 35130 000052BB 741D jz short $P_Drv_Err ;AN000; + 35131 000052BD 2E807C0100 cmp byte [cs:si+1],$P_NULL ;AN000; "d", 0 ? + 35132 000052C2 7516 jne short $P_Drv_Err ;AN000; + 35133 $P_DrvF00: ;AN000; + 35134 000052C4 0C20 or al,$P_Make_Lower ; 20h ;AN000; lower case + 35135 000052C6 3C61 cmp al,"a" ; 61h ;AN000; drive letter must + 35136 000052C8 7210 jb short $P_Drv_Err ;AN000; in range of + 35137 000052CA 3C7A cmp al,"z" ; 7Ah ;AN000; "a" - "z" + 35138 000052CC 770C ja short $P_Drv_Err ;AN000; if no, error + 35139 000052CE 2C60 sub al,"a"-1 ; 60h ;AN000; make text drive to binary drive + 35140 000052D0 88C2 mov dl,al ;AN000; set + 35141 ;mov ah,$P_No_Tag ; 0FFh ;AN000; result + 35142 ;mov al,$P_Drive ; 6 ;AN000; buffer + 35143 ; 05/04/2023 + 35144 000052D2 B806FF mov ax,($P_No_Tag<<8)+$P_Drive ; 06FFh + 35145 000052D5 E8D2F8 call $P_Fill_Result ;AN000; to drive + 35146 000052D8 EB07 jmp short $P_Drv_Exit ;AN000; + 35147 $P_Drv_Err: ;AN000; + 35148 000052DA 2EC706[BA97]0900 mov word [cs:$P_RC],$P_Syntax + 35149 ;mov word [cs:$P_RC],9 ;AC034; + 35150 $P_Drv_Exit: ;AN000; + 35151 000052E1 5A pop dx ;AN000; + 35152 000052E2 58 pop ax ;AN000; + 35153 000052E3 C3 retn ;AN000; + 35154 + 35155 ;*********************************************************************** + 35156 ; $P_Skip_Delim; 35157 ; - 35158 ; Input: DS:SI -> Command String - 35159 ; ES:DI -> Parameter List + 35158 ; Function: Skip delimiters specified in the PARMS list, white space + 35159 ; and comma. 35160 ; - 35161 ; Output: CY = 1 if the end of line encounterd - 35162 ; CY = 0 then SI move to 1st non-delimiter character - 35163 ; AL = Last examineed character - 35164 ; - 35165 ; Use: $P_Chk_EOL, $P_Chk_Delim, - 35166 ; - 35167 ; Vars: $P_Flags(R) - 35168 ;*********************************************************************** - 35169 - 35170 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35171 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35172 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35173 $P_Skip_Delim: ;AN000; - 35174 $P_Skip_Delim_Loop: ;AN000; - 35175 000052E4 AC lodsb ;AN000; - 35176 000052E5 E81E00 call $P_Chk_EOL ;AN000; is it EOL character ? - 35177 000052E8 7416 je short $P_Skip_Delim_CY ;AN000; if yes, exit w/ CY on - 35178 - 35179 000052EA E84B00 call $P_Chk_Delim ;AN000; is it one of delimiters ? - 35180 000052ED 7514 jne short $P_Skip_Delim_NCY ;AN000; if no, exit w/ CY off + 35161 ; Input: DS:SI -> Command String + 35162 ; ES:DI -> Parameter List + 35163 ; + 35164 ; Output: CY = 1 if the end of line encounterd + 35165 ; CY = 0 then SI move to 1st non-delimiter character + 35166 ; AL = Last examineed character + 35167 ; + 35168 ; Use: $P_Chk_EOL, $P_Chk_Delim, + 35169 ; + 35170 ; Vars: $P_Flags(R) + 35171 ;*********************************************************************** + 35172 + 35173 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35174 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35175 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35176 $P_Skip_Delim: ;AN000; + 35177 $P_Skip_Delim_Loop: ;AN000; + 35178 000052E4 AC lodsb ;AN000; + 35179 000052E5 E81E00 call $P_Chk_EOL ;AN000; is it EOL character ? + 35180 000052E8 7416 je short $P_Skip_Delim_CY ;AN000; if yes, exit w/ CY on 35181 - 35182 000052EF 2EF606[C697]20 test byte [cs:$P_Flags2],$P_Extra - 35183 ;test byte [cs:$P_Flags2],20h ;AC034; extra delim or comma found ? - 35184 000052F5 74ED jz short $P_Skip_Delim_Loop - 35185 ;AN000; if no, loop - 35186 000052F7 2EF606[C697]41 test byte [cs:$P_Flags2],$P_SW+$P_equ - 35187 ;;test byte [cs:$P_Flags2],41h ;AC034; /x , or xxx=zzz , (tm08) - 35188 ;jz short $P_Exit_At_Extra ;AN000; no switch, no keyword (tm08) - 35189 ;dec si ; * ;AN000; backup si for next call (tm08) - 35190 ;;jmp short $P_Exit_At_Extra ;AN000; else exit w/ CY off - 35191 ; 05/04/2023 - 35192 000052FD 7505 jnz short $P_Skip_Delim_Exit ; cf = 0 - 35193 $P_Exit_At_Extra: ;AN000; - 35194 ; cf = 0 - 35195 ;clc ;AN000; indicate extra delim - 35196 000052FF C3 retn ;AN000; - 35197 - 35198 $P_Skip_Delim_CY: ;AN000; - 35199 00005300 F9 stc ;AN000; indicate EOL - 35200 00005301 EB01 jmp short $P_Skip_Delim_Exit - 35201 ;AN000; - 35202 $P_Skip_Delim_NCY: ;AN000; - 35203 00005303 F8 clc ;AN000; indicate non delim - 35204 $P_Skip_Delim_Exit: ;AN000; in this case, need - 35205 00005304 4E dec si ; * ;AN000; backup index pointer - 35206 00005305 C3 retn ;AN000; - 35207 ; 05/04/2023 - 35208 ;$P_Exit_At_Extra: ;AN000; - 35209 ;clc ;AN000; indicate extra delim - 35210 ;retn ;AN000; - 35211 - 35212 ;*********************************************************************** - 35213 ; $P_Chk_EOL; - 35214 ; - 35215 ; Function: Check if AL is one of End of Line characters. - 35216 ; - 35217 ; Input: AL = character code - 35218 ; ES:DI -> Parameter List + 35182 000052EA E84B00 call $P_Chk_Delim ;AN000; is it one of delimiters ? + 35183 000052ED 7514 jne short $P_Skip_Delim_NCY ;AN000; if no, exit w/ CY off + 35184 + 35185 000052EF 2EF606[C697]20 test byte [cs:$P_Flags2],$P_Extra + 35186 ;test byte [cs:$P_Flags2],20h ;AC034; extra delim or comma found ? + 35187 000052F5 74ED jz short $P_Skip_Delim_Loop + 35188 ;AN000; if no, loop + 35189 000052F7 2EF606[C697]41 test byte [cs:$P_Flags2],$P_SW+$P_equ + 35190 ;;test byte [cs:$P_Flags2],41h ;AC034; /x , or xxx=zzz , (tm08) + 35191 ;jz short $P_Exit_At_Extra ;AN000; no switch, no keyword (tm08) + 35192 ;dec si ; * ;AN000; backup si for next call (tm08) + 35193 ;;jmp short $P_Exit_At_Extra ;AN000; else exit w/ CY off + 35194 ; 05/04/2023 + 35195 000052FD 7505 jnz short $P_Skip_Delim_Exit ; cf = 0 + 35196 $P_Exit_At_Extra: ;AN000; + 35197 ; cf = 0 + 35198 ;clc ;AN000; indicate extra delim + 35199 000052FF C3 retn ;AN000; + 35200 + 35201 $P_Skip_Delim_CY: ;AN000; + 35202 00005300 F9 stc ;AN000; indicate EOL + 35203 00005301 EB01 jmp short $P_Skip_Delim_Exit + 35204 ;AN000; + 35205 $P_Skip_Delim_NCY: ;AN000; + 35206 00005303 F8 clc ;AN000; indicate non delim + 35207 $P_Skip_Delim_Exit: ;AN000; in this case, need + 35208 00005304 4E dec si ; * ;AN000; backup index pointer + 35209 00005305 C3 retn ;AN000; + 35210 ; 05/04/2023 + 35211 ;$P_Exit_At_Extra: ;AN000; + 35212 ;clc ;AN000; indicate extra delim + 35213 ;retn ;AN000; + 35214 + 35215 ;*********************************************************************** + 35216 ; $P_Chk_EOL; + 35217 ; + 35218 ; Function: Check if AL is one of End of Line characters. 35219 ; - 35220 ; Output: ZF = 1 if one of End of Line characters - 35221 ;*********************************************************************** - 35222 - 35223 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35224 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35225 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35226 $P_Chk_EOL: - 35227 00005306 53 push bx ;AN000; - 35228 00005307 51 push cx ;AN000; - 35229 00005308 3C0D cmp al,$P_CR ; 0Dh ;AN000; Carriage return ? - 35230 0000530A 7429 je short $P_Chk_EOL_Exit ;AN000; - 35231 0000530C 3C00 cmp al,$P_NULL ; 0 ;AN000; zero ? - 35232 0000530E 7425 je short $P_Chk_EOL_Exit ;AN000; - 35233 00005310 26807D0202 cmp byte [es:di+$P_PARMS_BLK.$P_Num_Extra],$P_I_Have_EOL - 35234 ;cmp byte [es:di+2],2 ;AN000; EOL character specified ? - 35235 00005315 721E jb short $P_Chk_EOL_Exit ;AN000; - 35236 00005317 31DB xor bx,bx ;AN000; - 35237 00005319 268A5D03 mov bl,[es:di+$P_PARMS_BLK.$P_Len_Extra_Delim] - 35238 ;mov bl,[es:di+3] ;AN000; get length of delimiter list - 35239 0000531D 83C304 add bx,$P_Len_PARMS; 4 ;AN000; skip it - 35240 00005320 26803900 cmp byte [es:bx+di],$P_I_Use_Default - 35241 ;cmp byte [es:bx+di],0 ;AN000; No extra EOL character ? - 35242 00005324 740D je short $P_Chk_EOL_NZ ;AN000; - 35243 00005326 31C9 xor cx,cx ;AN000; Get number of extra chcracter - 35244 00005328 268A09 mov cl,[es:bx+di] ;AN000; - 35245 $P_Chk_EOL_Loop: ;AN000; - 35246 0000532B 43 inc bx ;AN000; - 35247 0000532C 263A01 cmp al,[es:bx+di] ;AN000; Check extra EOL character - 35248 0000532F 7404 je short $P_Chk_EOL_Exit ;AN000; - 35249 00005331 E2F8 loop $P_Chk_EOL_Loop ;AN000; - 35250 $P_Chk_EOL_NZ: ;AN000; - 35251 00005333 3C0D cmp al,$P_CR ; 0Dh ;AN000; reset ZF - 35252 $P_Chk_EOL_Exit: ;AN000; - 35253 00005335 59 pop cx ;AN000; - 35254 00005336 5B pop bx ;AN000; - 35255 00005337 C3 retn ;AN000; - 35256 - 35257 ;*********************************************************************** - 35258 ; $P_Chk_Delim; - 35259 ; - 35260 ; Function: Check if AL is one of delimiter characters. - 35261 ; if AL+[si] is DBCS blank, it is replaced with two SBCS - 35262 ; blanks. - 35263 ; - 35264 ; Input: AL = character code - 35265 ; DS:SI -> Next Character - 35266 ; ES:DI -> Parameter List - 35267 ; - 35268 ; Output: ZF = 1 if one of delimiter characters - 35269 ; SI points to the next character - 35270 ; Vars: $P_Terminator(W), $P_Flags(W) - 35271 ;*********************************************************************** - 35272 - 35273 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35274 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35275 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35276 $P_Chk_Delim: - 35277 00005338 53 push bx ;AN000; - 35278 00005339 51 push cx ;AN000; - 35279 0000533A 2EC606[C097]20 mov byte [cs:$P_Terminator],$P_Space ; 20h - 35280 ;AC034; Assume terminated by space - 35281 00005340 2E8026[C697]DF and byte [cs:$P_Flags2],0FFh-$P_Extra ; 0DFh - 35282 ;AC034; - 35283 00005346 3C20 cmp al,$P_Space ; 20h ; ' ' ;AN000; Space ? - 35284 00005348 7434 je short $P_Chk_Delim_Exit ;AN000; - 35285 - 35286 0000534A 3C09 cmp al,$P_TAB ; 09h ;AN000; TAB ? - 35287 0000534C 7430 je short $P_Chk_Delim_Exit ;AN000; + 35220 ; Input: AL = character code + 35221 ; ES:DI -> Parameter List + 35222 ; + 35223 ; Output: ZF = 1 if one of End of Line characters + 35224 ;*********************************************************************** + 35225 + 35226 ; 05/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35227 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35228 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35229 $P_Chk_EOL: + 35230 00005306 53 push bx ;AN000; + 35231 00005307 51 push cx ;AN000; + 35232 00005308 3C0D cmp al,$P_CR ; 0Dh ;AN000; Carriage return ? + 35233 0000530A 7429 je short $P_Chk_EOL_Exit ;AN000; + 35234 0000530C 3C00 cmp al,$P_NULL ; 0 ;AN000; zero ? + 35235 0000530E 7425 je short $P_Chk_EOL_Exit ;AN000; + 35236 00005310 26807D0202 cmp byte [es:di+$P_PARMS_BLK.$P_Num_Extra],$P_I_Have_EOL + 35237 ;cmp byte [es:di+2],2 ;AN000; EOL character specified ? + 35238 00005315 721E jb short $P_Chk_EOL_Exit ;AN000; + 35239 00005317 31DB xor bx,bx ;AN000; + 35240 00005319 268A5D03 mov bl,[es:di+$P_PARMS_BLK.$P_Len_Extra_Delim] + 35241 ;mov bl,[es:di+3] ;AN000; get length of delimiter list + 35242 0000531D 83C304 add bx,$P_Len_PARMS; 4 ;AN000; skip it + 35243 00005320 26803900 cmp byte [es:bx+di],$P_I_Use_Default + 35244 ;cmp byte [es:bx+di],0 ;AN000; No extra EOL character ? + 35245 00005324 740D je short $P_Chk_EOL_NZ ;AN000; + 35246 00005326 31C9 xor cx,cx ;AN000; Get number of extra chcracter + 35247 00005328 268A09 mov cl,[es:bx+di] ;AN000; + 35248 $P_Chk_EOL_Loop: ;AN000; + 35249 0000532B 43 inc bx ;AN000; + 35250 0000532C 263A01 cmp al,[es:bx+di] ;AN000; Check extra EOL character + 35251 0000532F 7404 je short $P_Chk_EOL_Exit ;AN000; + 35252 00005331 E2F8 loop $P_Chk_EOL_Loop ;AN000; + 35253 $P_Chk_EOL_NZ: ;AN000; + 35254 00005333 3C0D cmp al,$P_CR ; 0Dh ;AN000; reset ZF + 35255 $P_Chk_EOL_Exit: ;AN000; + 35256 00005335 59 pop cx ;AN000; + 35257 00005336 5B pop bx ;AN000; + 35258 00005337 C3 retn ;AN000; + 35259 + 35260 ;*********************************************************************** + 35261 ; $P_Chk_Delim; + 35262 ; + 35263 ; Function: Check if AL is one of delimiter characters. + 35264 ; if AL+[si] is DBCS blank, it is replaced with two SBCS + 35265 ; blanks. + 35266 ; + 35267 ; Input: AL = character code + 35268 ; DS:SI -> Next Character + 35269 ; ES:DI -> Parameter List + 35270 ; + 35271 ; Output: ZF = 1 if one of delimiter characters + 35272 ; SI points to the next character + 35273 ; Vars: $P_Terminator(W), $P_Flags(W) + 35274 ;*********************************************************************** + 35275 + 35276 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35277 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35278 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35279 $P_Chk_Delim: + 35280 00005338 53 push bx ;AN000; + 35281 00005339 51 push cx ;AN000; + 35282 0000533A 2EC606[C097]20 mov byte [cs:$P_Terminator],$P_Space ; 20h + 35283 ;AC034; Assume terminated by space + 35284 00005340 2E8026[C697]DF and byte [cs:$P_Flags2],0FFh-$P_Extra ; 0DFh + 35285 ;AC034; + 35286 00005346 3C20 cmp al,$P_Space ; 20h ; ' ' ;AN000; Space ? + 35287 00005348 7434 je short $P_Chk_Delim_Exit ;AN000; 35288 - 35289 0000534E 3C2C cmp al,$P_Comma ; ',' ;AN000; Comma ? - 35290 00005350 742F je short $P_Chk_Delim_Exit0 - 35291 ;AN000; - 35292 $P_Chk_Delim00: ;AN000; - 35293 00005352 3C20 cmp al,20h ; $P_DBSP1 ;AN000; 1st byte of DBCS Space ? - 35294 00005354 750C jne short $P_Chk_Delim01 ;AN000; - 35295 00005356 803C20 cmp byte [si],20h ; $P_DBSP2 - 35296 ;AN000; 2nd byte of DBCS Space ? - 35297 00005359 7507 jne short $P_Chk_Delim01 ;AN000; - 35298 0000535B B020 mov al,$P_Space ; 20h ;AN000; - 35299 0000535D 46 inc si ;AN000; make si point to next character - 35300 0000535E 38C0 cmp al,al ;AN000; Set ZF - 35301 00005360 EB1C jmp short $P_Chk_Delim_Exit ;AN000; - 35302 - 35303 $P_Chk_Delim01: ;AN000; - 35304 ;cmp byte [es:di+$P_PARMS_BLK.$P_Num_Extra],$P_I_Have_Delim - 35305 00005362 26807D0201 cmp byte [es:di+$P_PARMS_BLK.$P_Num_Extra],1 - 35306 ;cmp byte [es:di+2],1 ;AN000; delimiter character specified ? - 35307 00005367 7215 jb short $P_Chk_Delim_Exit ;AN000; - 35308 - 35309 00005369 31C9 xor cx,cx ;AN000; - 35310 0000536B 268A4D03 mov cl,[es:di+$P_PARMS_BLK.$P_Len_Extra_Delim] - 35311 ;mov cl,[esi:di+3] ;AN000; get length of delimiter list - 35312 ;or cx,cx ;AN000; No extra Delim character ? - 35313 ;jz short $P_Chk_Delim_NZ ;AN000; - 35314 ; 12/08/2024 - PCDOS 7.1 COMMAND.COM - 35315 0000536F E30B jcxz $P_Chk_Delim_NZ - 35316 - 35317 00005371 BB0300 mov bx,$P_Len_PARMS-1 ; 3 ;AN000; set bx to 1st extra delimiter - 35318 $P_Chk_Delim_Loop: ;AN000; - 35319 00005374 43 inc bx ;AN000; - 35320 00005375 263A01 cmp al,[es:bx+di] ;AN000; Check extra Delim character - 35321 00005378 7407 je short $P_Chk_Delim_Exit0 - 35322 ;AN000; - 35323 0000537A E2F8 loop $P_Chk_Delim_Loop ;AN000; examine all extra delimiter - 35324 - 35325 $P_Chk_Delim_NZ: ;AN000; - 35326 0000537C 3C20 cmp al,$P_Space ; 20h ;AN000; reset ZF - 35327 $P_Chk_Delim_Exit: ;AN000; - 35328 0000537E 59 pop cx ;AN000; - 35329 0000537F 5B pop bx ;AN000; - 35330 00005380 C3 retn ;AN000; - 35331 - 35332 $P_Chk_Delim_Exit0: ;AN000; - 35333 00005381 2EA2[C097] mov [cs:$P_Terminator],al ;AC034; keep terminated delimiter - 35334 00005385 2EF606[C697]01 test byte [cs:$P_Flags2],$P_equ - 35335 ;test byte [cs:$P_Flags2],1 ;AN027;AC034;; if terminating a key= - 35336 0000538B 7506 jnz short $P_No_Set_Extra ;AN027; then do not set the EXTRA bit - 35337 - 35338 0000538D 2E800E[C697]20 or byte [cs:$P_Flags2],$P_Extra ; 20h - 35339 ;or byte [cs:$P_Flags2],20h ;AC034; flag terminated extra delimiter or comma - 35340 $P_No_Set_Extra: ;AN027; - 35341 00005393 38C0 cmp al,al ;AN000; set ZF - 35342 00005395 EBE7 jmp short $P_Chk_Delim_Exit ;AN000; - 35343 - 35344 ;*********************************************************************** - 35345 ; $P_Chk_Switch; - 35346 ; - 35347 ; Function: Check if AL is the switch character not in first position of - 35348 ; $P_STRING_BUF + 35289 0000534A 3C09 cmp al,$P_TAB ; 09h ;AN000; TAB ? + 35290 0000534C 7430 je short $P_Chk_Delim_Exit ;AN000; + 35291 + 35292 0000534E 3C2C cmp al,$P_Comma ; ',' ;AN000; Comma ? + 35293 00005350 742F je short $P_Chk_Delim_Exit0 + 35294 ;AN000; + 35295 $P_Chk_Delim00: ;AN000; + 35296 00005352 3C20 cmp al,20h ; $P_DBSP1 ;AN000; 1st byte of DBCS Space ? + 35297 00005354 750C jne short $P_Chk_Delim01 ;AN000; + 35298 00005356 803C20 cmp byte [si],20h ; $P_DBSP2 + 35299 ;AN000; 2nd byte of DBCS Space ? + 35300 00005359 7507 jne short $P_Chk_Delim01 ;AN000; + 35301 0000535B B020 mov al,$P_Space ; 20h ;AN000; + 35302 0000535D 46 inc si ;AN000; make si point to next character + 35303 0000535E 38C0 cmp al,al ;AN000; Set ZF + 35304 00005360 EB1C jmp short $P_Chk_Delim_Exit ;AN000; + 35305 + 35306 $P_Chk_Delim01: ;AN000; + 35307 ;cmp byte [es:di+$P_PARMS_BLK.$P_Num_Extra],$P_I_Have_Delim + 35308 00005362 26807D0201 cmp byte [es:di+$P_PARMS_BLK.$P_Num_Extra],1 + 35309 ;cmp byte [es:di+2],1 ;AN000; delimiter character specified ? + 35310 00005367 7215 jb short $P_Chk_Delim_Exit ;AN000; + 35311 + 35312 00005369 31C9 xor cx,cx ;AN000; + 35313 0000536B 268A4D03 mov cl,[es:di+$P_PARMS_BLK.$P_Len_Extra_Delim] + 35314 ;mov cl,[esi:di+3] ;AN000; get length of delimiter list + 35315 ;or cx,cx ;AN000; No extra Delim character ? + 35316 ;jz short $P_Chk_Delim_NZ ;AN000; + 35317 ; 12/08/2024 - PCDOS 7.1 COMMAND.COM + 35318 0000536F E30B jcxz $P_Chk_Delim_NZ + 35319 + 35320 00005371 BB0300 mov bx,$P_Len_PARMS-1 ; 3 ;AN000; set bx to 1st extra delimiter + 35321 $P_Chk_Delim_Loop: ;AN000; + 35322 00005374 43 inc bx ;AN000; + 35323 00005375 263A01 cmp al,[es:bx+di] ;AN000; Check extra Delim character + 35324 00005378 7407 je short $P_Chk_Delim_Exit0 + 35325 ;AN000; + 35326 0000537A E2F8 loop $P_Chk_Delim_Loop ;AN000; examine all extra delimiter + 35327 + 35328 $P_Chk_Delim_NZ: ;AN000; + 35329 0000537C 3C20 cmp al,$P_Space ; 20h ;AN000; reset ZF + 35330 $P_Chk_Delim_Exit: ;AN000; + 35331 0000537E 59 pop cx ;AN000; + 35332 0000537F 5B pop bx ;AN000; + 35333 00005380 C3 retn ;AN000; + 35334 + 35335 $P_Chk_Delim_Exit0: ;AN000; + 35336 00005381 2EA2[C097] mov [cs:$P_Terminator],al ;AC034; keep terminated delimiter + 35337 00005385 2EF606[C697]01 test byte [cs:$P_Flags2],$P_equ + 35338 ;test byte [cs:$P_Flags2],1 ;AN027;AC034;; if terminating a key= + 35339 0000538B 7506 jnz short $P_No_Set_Extra ;AN027; then do not set the EXTRA bit + 35340 + 35341 0000538D 2E800E[C697]20 or byte [cs:$P_Flags2],$P_Extra ; 20h + 35342 ;or byte [cs:$P_Flags2],20h ;AC034; flag terminated extra delimiter or comma + 35343 $P_No_Set_Extra: ;AN027; + 35344 00005393 38C0 cmp al,al ;AN000; set ZF + 35345 00005395 EBE7 jmp short $P_Chk_Delim_Exit ;AN000; + 35346 + 35347 ;*********************************************************************** + 35348 ; $P_Chk_Switch; 35349 ; - 35350 ; Input: AL = character code - 35351 ; BX = current pointer within $P_String_Buf - 35352 ; SI =>next char on command line (following the one in AL) - 35353 ; - 35354 ; Output: CF = 1 (set)if AL is switch character, and not in first - 35355 ; position, and has no chance of being part of a date string, - 35356 ; i.e. should be treated as a delimiter. - 35357 ; - 35358 ; CF = 0 (reset, cleared) if AL is not a switch char, is in the first - 35359 ; position, or is a slash but may be part of a date string, i.e. - 35360 ; should not be treated as a delimiter. - 35361 ; - 35362 ; Vars: $P_Terminator(W) - 35363 ; - 35364 ; Use: $P_0099 - 35365 ;*********************************************************************** - 35366 - 35367 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35368 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35369 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35370 $P_Chk_Switch: - 35371 ; 18/04/2023 - 35372 00005397 8D2E[CF97] lea bp,$P_STRING_BUF ;AN020;AC034; BP=OFFSET of $P_String_Buf even in group addressing - 35373 - 35374 0000539B 39EB cmp bx,bp ;AN000; - 35375 0000539D 7418 je short $P_STRUC_L2 ;AN000; + 35350 ; Function: Check if AL is the switch character not in first position of + 35351 ; $P_STRING_BUF + 35352 ; + 35353 ; Input: AL = character code + 35354 ; BX = current pointer within $P_String_Buf + 35355 ; SI =>next char on command line (following the one in AL) + 35356 ; + 35357 ; Output: CF = 1 (set)if AL is switch character, and not in first + 35358 ; position, and has no chance of being part of a date string, + 35359 ; i.e. should be treated as a delimiter. + 35360 ; + 35361 ; CF = 0 (reset, cleared) if AL is not a switch char, is in the first + 35362 ; position, or is a slash but may be part of a date string, i.e. + 35363 ; should not be treated as a delimiter. + 35364 ; + 35365 ; Vars: $P_Terminator(W) + 35366 ; + 35367 ; Use: $P_0099 + 35368 ;*********************************************************************** + 35369 + 35370 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35371 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35372 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35373 $P_Chk_Switch: + 35374 ; 18/04/2023 + 35375 00005397 8D2E[CF97] lea bp,$P_STRING_BUF ;AN020;AC034; BP=OFFSET of $P_String_Buf even in group addressing 35376 - 35377 0000539F 3C2F cmp al,$P_Switch ; '/' ;AN000; - 35378 000053A1 7512 jne short $P_STRUC_L5 ;AN000; + 35377 0000539B 39EB cmp bx,bp ;AN000; + 35378 0000539D 7418 je short $P_STRUC_L2 ;AN000; 35379 - 35380 000053A3 F9 stc ;AN020;not in first position and is slash, now see if might be in date string - 35381 000053A4 50 push ax ;AN020;save input char - 35382 000053A5 2E8A47FF mov al,[cs:bx-1] ;AN026;AL=char before the current char - 35383 000053A9 E8FBFA call $P_0099 ;AN020;return carry set if not numeric - 35384 000053AC 7205 jc short $P_STRUC_L7 ;AN000; - 35385 - 35386 000053AE 8A04 mov al,[si] ;AN020;AL=char after the current char - 35387 000053B0 E8F4FA call $P_0099 ;AN020;return carry set if not numeric - 35388 $P_STRUC_L7: ;AN000; - 35389 000053B3 58 pop ax ;AN020;restore AL to input char - 35390 ;jmp short $P_STRUC_L1 ;AN000; - 35391 ; 18/04/2023 - 35392 000053B4 C3 retn - 35393 - 35394 $P_STRUC_L5: ;AN000; - 35395 000053B5 F8 clc ;AN020;not a slash - 35396 ;jmp short $P_STRUC_L1 ;AN000; - 35397 ;18/04/2023 - 35398 000053B6 C3 retn - 35399 - 35400 $P_STRUC_L2: ;AN000; - 35401 000053B7 3C2F cmp al,$P_Switch ; '/' ;AN000; - 35402 ;jne short $P_STRUC_L12 ;AN000; - 35403 ; 18/04/2023 - 35404 000053B9 75FA jne short $P_STRUC_L5 - 35405 - 35406 000053BB 2E800E[C697]40 or byte [cs:$P_Flags2],$P_SW - 35407 ;or byte [cs:$P_Flags2],40h ;AN020;AC034;;could be valid switch, first char and is slash - 35408 ; 18/04/2023 - 35409 ;$P_STRUC_L12: ;AN000; - 35410 ;clc ;AN020;CF=0 indicating first char - 35411 $P_STRUC_L1: ;AN000; - 35412 000053C1 C3 retn ;AN000; - 35413 - 35414 ;************************************************************************** - 35415 ; $P_Chk_DBCS: - 35416 ; - 35417 ; Function: Check if a specified byte is in ranges of the DBCS lead bytes - 35418 ; - 35419 ; Input: - 35420 ; AL = Code to be examineed + 35380 0000539F 3C2F cmp al,$P_Switch ; '/' ;AN000; + 35381 000053A1 7512 jne short $P_STRUC_L5 ;AN000; + 35382 + 35383 000053A3 F9 stc ;AN020;not in first position and is slash, now see if might be in date string + 35384 000053A4 50 push ax ;AN020;save input char + 35385 000053A5 2E8A47FF mov al,[cs:bx-1] ;AN026;AL=char before the current char + 35386 000053A9 E8FBFA call $P_0099 ;AN020;return carry set if not numeric + 35387 000053AC 7205 jc short $P_STRUC_L7 ;AN000; + 35388 + 35389 000053AE 8A04 mov al,[si] ;AN020;AL=char after the current char + 35390 000053B0 E8F4FA call $P_0099 ;AN020;return carry set if not numeric + 35391 $P_STRUC_L7: ;AN000; + 35392 000053B3 58 pop ax ;AN020;restore AL to input char + 35393 ;jmp short $P_STRUC_L1 ;AN000; + 35394 ; 18/04/2023 + 35395 000053B4 C3 retn + 35396 + 35397 $P_STRUC_L5: ;AN000; + 35398 000053B5 F8 clc ;AN020;not a slash + 35399 ;jmp short $P_STRUC_L1 ;AN000; + 35400 ;18/04/2023 + 35401 000053B6 C3 retn + 35402 + 35403 $P_STRUC_L2: ;AN000; + 35404 000053B7 3C2F cmp al,$P_Switch ; '/' ;AN000; + 35405 ;jne short $P_STRUC_L12 ;AN000; + 35406 ; 18/04/2023 + 35407 000053B9 75FA jne short $P_STRUC_L5 + 35408 + 35409 000053BB 2E800E[C697]40 or byte [cs:$P_Flags2],$P_SW + 35410 ;or byte [cs:$P_Flags2],40h ;AN020;AC034;;could be valid switch, first char and is slash + 35411 ; 18/04/2023 + 35412 ;$P_STRUC_L12: ;AN000; + 35413 ;clc ;AN020;CF=0 indicating first char + 35414 $P_STRUC_L1: ;AN000; + 35415 000053C1 C3 retn ;AN000; + 35416 + 35417 ;************************************************************************** + 35418 ; $P_Chk_DBCS: + 35419 ; + 35420 ; Function: Check if a specified byte is in ranges of the DBCS lead bytes 35421 ; - 35422 ; Output: - 35423 ; If CF is on then a lead byte of DBCS + 35422 ; Input: + 35423 ; AL = Code to be examineed 35424 ; - 35425 ; Use: INT 21h w/AH=63 - 35426 ; - 35427 ; Vars: $P_DBCSEV_Seg(RW), $P_DBCSEV_Off(RW) - 35428 ;*************************************************************************** - 35429 - 35430 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35431 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35432 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35433 $P_Chk_DBCS: - 35434 000053C2 1E push ds ;AN000; - 35435 000053C3 56 push si ;AN000; - 35436 000053C4 53 push bx ;AN000; (tm11) - 35437 000053C5 2E833E[C397]00 cmp word [cs:$P_DBCSEV_SEG],0 - 35438 ;AC034; ALREADY SET ? - 35439 000053CB 7527 jne short $P_DBCS00 ;AN000; - 35440 000053CD 50 push ax ;AN000; - 35441 000053CE 1E push ds ;AN000; (tm11) - 35442 000053CF 51 push cx ;AN000; - 35443 000053D0 52 push dx ;AN000; - 35444 000053D1 57 push di ;AN000; - 35445 000053D2 55 push bp ;AN000; - 35446 000053D3 06 push es ;AN000; - 35447 000053D4 31F6 xor si,si ;AN000; - 35448 000053D6 8EDE mov ds,si ;AN000; - 35449 ;mov ax,$P_DOS_GetEV ;AN000; GET DBCS EV CALL - 35450 000053D8 B80063 mov ax,6300h - 35451 000053DB CD21 int 21h ;AN000; - 35452 000053DD 8CDB mov bx,ds ;AN000; (tm11) - 35453 000053DF 09DB or bx,bx ;AN000; (tm11) - 35454 000053E1 07 pop es ;AN000; - 35455 000053E2 5D pop bp ;AN000; - 35456 000053E3 5F pop di ;AN000; - 35457 000053E4 5A pop dx ;AN000; - 35458 000053E5 59 pop cx ;AN000; - 35459 000053E6 1F pop ds ;AN000; (tm11) - 35460 000053E7 58 pop ax ;AN000; - 35461 000053E8 7424 jz short $P_NON_DBCS ;AN000; - 35462 $P_DBCS02: ;AN000; - 35463 000053EA 2E8936[C197] mov [cs:$P_DBCSEV_OFF],si ;AC034; save EV offset - 35464 000053EF 2E891E[C397] mov [cs:$P_DBCSEV_SEG],bx ;AC034; save EV segment (tm11) - 35465 $P_DBCS00: ;AN000; - 35466 ;mov si,[cs:$P_DBCSEV_OFF] ;AC034; load EV offset - 35467 ;mov ds,[cs:$P_DBCSEV_SEG] ;AC034; and segment - 35468 ; 12/08/2024 - PCDOS 7.1 COMMAND.COM - 35469 000053F4 2EC536[C197] lds si,[cs:$P_DBCSEV_OFF] - 35470 $P_DBCS_LOOP: ;AN000; - 35471 000053F9 833C00 cmp word [si],0 ;AN000; zero vector ? - 35472 000053FC 7410 je short $P_NON_DBCS ;AN000; then exit - 35473 000053FE 3A04 cmp al,[si] ;AN000; - 35474 00005400 7208 jb short $P_DBCS01 ;AN000; Check if AL is in - 35475 00005402 3A4401 cmp al,[si+1] ;AN000; range of - 35476 00005405 7703 ja short $P_DBCS01 ;AN000; the vector - 35477 00005407 F9 stc ;AN000; if yes, indicate DBCS and exit - 35478 00005408 EB04 jmp short $P_DBCS_EXIT ;AN000; - 35479 $P_DBCS01: ;AN000; - 35480 0000540A 46 inc si ;AC035; add '2' to - 35481 0000540B 46 inc si ;AC035; SI reg - 35482 ;AN000; get next vector - 35483 0000540C EBEB jmp short $P_DBCS_LOOP ;AN000; loop until zero vector found - 35484 - 35485 $P_NON_DBCS: ;AN000; - 35486 ; 18/04/2023 - 35487 ; cf=0 - 35488 ;clc ;AN000; indicate SBCS - 35489 $P_DBCS_EXIT: ;AN000; - 35490 0000540E 5B pop bx ;AN000; (tm11) - 35491 0000540F 5E pop si ;AN000; - 35492 00005410 1F pop ds ;AN000; - 35493 00005411 C3 retn ;AN000; - 35494 - 35495 ;============================================================================ - 35496 ; TPARSE.ASM, MSDOS 6.0, 1991 - 35497 ;============================================================================ - 35498 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35499 - 35500 ; **************************************************************** - 35501 ; * - 35502 ; * ROUTINE: CMD_PARSE - 35503 ; * - 35504 ; * FUNCTION: Interface for transient COMMAND to invoke - 35505 ; * SYSPARSE. + 35425 ; Output: + 35426 ; If CF is on then a lead byte of DBCS + 35427 ; + 35428 ; Use: INT 21h w/AH=63 + 35429 ; + 35430 ; Vars: $P_DBCSEV_Seg(RW), $P_DBCSEV_Off(RW) + 35431 ;*************************************************************************** + 35432 + 35433 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35434 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35435 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35436 $P_Chk_DBCS: + 35437 000053C2 1E push ds ;AN000; + 35438 000053C3 56 push si ;AN000; + 35439 000053C4 53 push bx ;AN000; (tm11) + 35440 000053C5 2E833E[C397]00 cmp word [cs:$P_DBCSEV_SEG],0 + 35441 ;AC034; ALREADY SET ? + 35442 000053CB 7527 jne short $P_DBCS00 ;AN000; + 35443 000053CD 50 push ax ;AN000; + 35444 000053CE 1E push ds ;AN000; (tm11) + 35445 000053CF 51 push cx ;AN000; + 35446 000053D0 52 push dx ;AN000; + 35447 000053D1 57 push di ;AN000; + 35448 000053D2 55 push bp ;AN000; + 35449 000053D3 06 push es ;AN000; + 35450 000053D4 31F6 xor si,si ;AN000; + 35451 000053D6 8EDE mov ds,si ;AN000; + 35452 ;mov ax,$P_DOS_GetEV ;AN000; GET DBCS EV CALL + 35453 000053D8 B80063 mov ax,6300h + 35454 000053DB CD21 int 21h ;AN000; + 35455 000053DD 8CDB mov bx,ds ;AN000; (tm11) + 35456 000053DF 09DB or bx,bx ;AN000; (tm11) + 35457 000053E1 07 pop es ;AN000; + 35458 000053E2 5D pop bp ;AN000; + 35459 000053E3 5F pop di ;AN000; + 35460 000053E4 5A pop dx ;AN000; + 35461 000053E5 59 pop cx ;AN000; + 35462 000053E6 1F pop ds ;AN000; (tm11) + 35463 000053E7 58 pop ax ;AN000; + 35464 000053E8 7424 jz short $P_NON_DBCS ;AN000; + 35465 $P_DBCS02: ;AN000; + 35466 000053EA 2E8936[C197] mov [cs:$P_DBCSEV_OFF],si ;AC034; save EV offset + 35467 000053EF 2E891E[C397] mov [cs:$P_DBCSEV_SEG],bx ;AC034; save EV segment (tm11) + 35468 $P_DBCS00: ;AN000; + 35469 ;mov si,[cs:$P_DBCSEV_OFF] ;AC034; load EV offset + 35470 ;mov ds,[cs:$P_DBCSEV_SEG] ;AC034; and segment + 35471 ; 12/08/2024 - PCDOS 7.1 COMMAND.COM + 35472 000053F4 2EC536[C197] lds si,[cs:$P_DBCSEV_OFF] + 35473 $P_DBCS_LOOP: ;AN000; + 35474 000053F9 833C00 cmp word [si],0 ;AN000; zero vector ? + 35475 000053FC 7410 je short $P_NON_DBCS ;AN000; then exit + 35476 000053FE 3A04 cmp al,[si] ;AN000; + 35477 00005400 7208 jb short $P_DBCS01 ;AN000; Check if AL is in + 35478 00005402 3A4401 cmp al,[si+1] ;AN000; range of + 35479 00005405 7703 ja short $P_DBCS01 ;AN000; the vector + 35480 00005407 F9 stc ;AN000; if yes, indicate DBCS and exit + 35481 00005408 EB04 jmp short $P_DBCS_EXIT ;AN000; + 35482 $P_DBCS01: ;AN000; + 35483 0000540A 46 inc si ;AC035; add '2' to + 35484 0000540B 46 inc si ;AC035; SI reg + 35485 ;AN000; get next vector + 35486 0000540C EBEB jmp short $P_DBCS_LOOP ;AN000; loop until zero vector found + 35487 + 35488 $P_NON_DBCS: ;AN000; + 35489 ; 18/04/2023 + 35490 ; cf=0 + 35491 ;clc ;AN000; indicate SBCS + 35492 $P_DBCS_EXIT: ;AN000; + 35493 0000540E 5B pop bx ;AN000; (tm11) + 35494 0000540F 5E pop si ;AN000; + 35495 00005410 1F pop ds ;AN000; + 35496 00005411 C3 retn ;AN000; + 35497 + 35498 ;============================================================================ + 35499 ; TPARSE.ASM, MSDOS 6.0, 1991 + 35500 ;============================================================================ + 35501 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35502 + 35503 ; **************************************************************** + 35504 ; * + 35505 ; * ROUTINE: CMD_PARSE 35506 ; * - 35507 ; * INPUT: inputs to SYSPARSE - 35508 ; * - 35509 ; * OUTPUT: outputs from SYSPARSE - 35510 ; * - 35511 ; **************************************************************** - 35512 - 35513 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35514 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4FF7h - 35515 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM - 35516 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:57BBh - 35517 - 35518 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35519 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5647h - 35520 ;cmd_parse: - 35521 ;call sysparse ;AN000; - 35522 ;retn ;AN000; - 35523 ; 06/04/2023 - 35524 ;jmp sysparse - 35525 - 35526 append_parse: - 35527 00005412 E857F5 call sysparse ;AN010; - 35528 00005415 CB retf ;AN010; - 35529 - 35530 ;============================================================================ - 35531 ; TPRINTF.ASM, MSDOS 6.0, 1991 - 35532 ;============================================================================ - 35533 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35534 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 35535 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35536 - 35537 ; ---------------------------- - 35538 ; MSDOS 6.0, MSGSERV.ASM, 1991 - 35539 ; ---------------------------- - 35540 - 35541 ;; Replacable parameters are described by a sublist structure - 35542 - 35543 struc $M_SUBLIST_STRUC ;;AN000;; - 35544 00000000 ?? .$M_S_SIZE: resb 1 ;;AN000;; SUBLIST size (PTR to next SUBLIST) - 35545 00000001 ?? .$M_S_RESV: resb 1 ;;AN000;; RESERVED - 35546 00000002 ???????? .$M_S_VALUE: resd 1 ;;AN000;; Time, Date or PTR to data item - 35547 00000006 ?? .$M_S_ID: resb 1 ;;AN000;; n of %n - 35548 00000007 ?? .$M_S_FLAG: resb 1 ;;AN000;; Data-type flags - 35549 00000008 ?? .$M_S_MAXW: resb 1 ;;AN000;; Maximum field width - 35550 00000009 ?? .$M_S_MINW: resb 1 ;;AN000;; Minimum field width - 35551 0000000A ?? .$M_S_PAD: resb 1 ;;AN000;; Character for Pad field - 35552 endstruc - 35553 - 35554 ; --------------------------------------------------------------------------- - 35555 ; --------------------------------------------------------------------------- + 35507 ; * FUNCTION: Interface for transient COMMAND to invoke + 35508 ; * SYSPARSE. + 35509 ; * + 35510 ; * INPUT: inputs to SYSPARSE + 35511 ; * + 35512 ; * OUTPUT: outputs from SYSPARSE + 35513 ; * + 35514 ; **************************************************************** + 35515 + 35516 ; 06/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35517 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:4FF7h + 35518 ; 14/06/2023 - Retro DOS v4.2 COMMAND.COM + 35519 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:57BBh + 35520 + 35521 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35522 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5647h + 35523 ;cmd_parse: + 35524 ;call sysparse ;AN000; + 35525 ;retn ;AN000; + 35526 ; 06/04/2023 + 35527 ;jmp sysparse + 35528 + 35529 append_parse: + 35530 00005412 E857F5 call sysparse ;AN010; + 35531 00005415 CB retf ;AN010; + 35532 + 35533 ;============================================================================ + 35534 ; TPRINTF.ASM, MSDOS 6.0, 1991 + 35535 ;============================================================================ + 35536 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35537 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 35538 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35539 + 35540 ; ---------------------------- + 35541 ; MSDOS 6.0, MSGSERV.ASM, 1991 + 35542 ; ---------------------------- + 35543 + 35544 ;; Replacable parameters are described by a sublist structure + 35545 + 35546 struc $M_SUBLIST_STRUC ;;AN000;; + 35547 00000000 ?? .$M_S_SIZE: resb 1 ;;AN000;; SUBLIST size (PTR to next SUBLIST) + 35548 00000001 ?? .$M_S_RESV: resb 1 ;;AN000;; RESERVED + 35549 00000002 ???????? .$M_S_VALUE: resd 1 ;;AN000;; Time, Date or PTR to data item + 35550 00000006 ?? .$M_S_ID: resb 1 ;;AN000;; n of %n + 35551 00000007 ?? .$M_S_FLAG: resb 1 ;;AN000;; Data-type flags + 35552 00000008 ?? .$M_S_MAXW: resb 1 ;;AN000;; Maximum field width + 35553 00000009 ?? .$M_S_MINW: resb 1 ;;AN000;; Minimum field width + 35554 0000000A ?? .$M_S_PAD: resb 1 ;;AN000;; Character for Pad field + 35555 endstruc 35556 - 35557 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35558 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 4FFFh + 35557 ; --------------------------------------------------------------------------- + 35558 ; --------------------------------------------------------------------------- 35559 - 35560 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 35561 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 57C3h + 35560 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35561 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 4FFFh 35562 - 35563 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35564 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 564Fh + 35563 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 35564 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 57C3h 35565 - 35566 Printf_Init: - 35567 00005416 E80F00 call std_printf - 35568 00005419 CB retf - 35569 - 35570 Printf_Crlf: - 35571 0000541A E80B00 call std_printf - 35572 ;call CRLF2 - 35573 ;retn - 35574 ; 07/04/2023 - 35575 0000541D E959D5 jmp CRLF2 - 35576 - 35577 ;**************************************************************** - 35578 ;* - 35579 ;* ROUTINE: STD_PRINTF/STD_EPRINTF - 35580 ;* - 35581 ;* FUNCTION: Set up to print out a message using SYSDISPMSG. - 35582 ;* Set up substitutions if utility message. Make - 35583 ;* sure any changes to message variables in TDATA - 35584 ;* are reset to avoid reloading the transient. - 35585 ;* - 35586 ;* INPUT: Msg_Disp_Class - set to message class - 35587 ;* Msg_Cont_Flag - set to control flags - 35588 ;* DS points to transient segment - 35589 ;* - 35590 ;* if utility message: - 35591 ;* DX points to a block with message number - 35592 ;* (word), number of substitutions (byte), - 35593 ;* followed by substitution list if there - 35594 ;* are substitutions. If substitutions - 35595 ;* are not in transient segment they must - 35596 ;* be set. - 35597 ;* else - 35598 ;* AX set to message number - 35599 ;* - 35600 ;* OUTPUT: none - 35601 ;* - 35602 ;**************************************************************** - 35603 - 35604 std_eprintf: - 35605 00005420 C706[2199]0200 mov word [PRINTF_HANDLE],2 ;AC000;Print to STDERR - 35606 00005426 EB06 jmp short new_printf ;AC000; - 35607 - 35608 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35609 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 5012h + 35566 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35567 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 564Fh + 35568 + 35569 Printf_Init: + 35570 00005416 E80F00 call std_printf + 35571 00005419 CB retf + 35572 + 35573 Printf_Crlf: + 35574 0000541A E80B00 call std_printf + 35575 ;call CRLF2 + 35576 ;retn + 35577 ; 07/04/2023 + 35578 0000541D E959D5 jmp CRLF2 + 35579 + 35580 ;**************************************************************** + 35581 ;* + 35582 ;* ROUTINE: STD_PRINTF/STD_EPRINTF + 35583 ;* + 35584 ;* FUNCTION: Set up to print out a message using SYSDISPMSG. + 35585 ;* Set up substitutions if utility message. Make + 35586 ;* sure any changes to message variables in TDATA + 35587 ;* are reset to avoid reloading the transient. + 35588 ;* + 35589 ;* INPUT: Msg_Disp_Class - set to message class + 35590 ;* Msg_Cont_Flag - set to control flags + 35591 ;* DS points to transient segment + 35592 ;* + 35593 ;* if utility message: + 35594 ;* DX points to a block with message number + 35595 ;* (word), number of substitutions (byte), + 35596 ;* followed by substitution list if there + 35597 ;* are substitutions. If substitutions + 35598 ;* are not in transient segment they must + 35599 ;* be set. + 35600 ;* else + 35601 ;* AX set to message number + 35602 ;* + 35603 ;* OUTPUT: none + 35604 ;* + 35605 ;**************************************************************** + 35606 + 35607 std_eprintf: + 35608 00005420 C706[2199]0200 mov word [PRINTF_HANDLE],2 ;AC000;Print to STDERR + 35609 00005426 EB06 jmp short new_printf ;AC000; 35610 - 35611 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 35612 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 57D6h + 35611 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35612 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 5012h 35613 - 35614 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35615 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 5662h + 35614 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 35615 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 57D6h 35616 - 35617 std_printf: - 35618 00005428 C706[2199]0100 mov word [PRINTF_HANDLE],1 ;AC000;Print to STDOUT + 35617 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35618 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 5662h 35619 - 35620 new_printf: - 35621 0000542E 50 push ax ;AN000;save registers - 35622 0000542F 53 push bx ;AN000; - 35623 00005430 51 push cx ;AN000; - 35624 00005431 06 push es ;AN000;get local ES - 35625 00005432 1E push ds ;AN000; - 35626 00005433 07 pop es ;AN000; - 35627 00005434 57 push di ;AN000; - 35628 00005435 56 push si ;AN000; - 35629 00005436 52 push dx ;AN000; - 35630 - 35631 ; 07/04/2023 - 35632 ;mov word [print_err_flag],0 ;AN000; - 35633 00005437 31C9 xor cx,cx - 35634 00005439 890E[379F] mov [print_err_flag],cx ; 0 - 35635 - 35636 0000543D 89D6 mov si,dx ;AN000;Get offset of message number - 35637 0000543F AD lodsw ;AN000;load message number - 35638 ; 15/06/2023 - 35639 ;push ax ;AN000;save it - 35640 ;lodsb ;AN000;get number of substitutions - 35641 ;mov cl,al ;AN000;set up CX as # of subst - 35642 ;; 07/04/2023 - 35643 ;;xor ch,ch ;AN000;SI now points to subst list - 35644 ;pop ax ;AN000;get message number back - 35645 ; 15/06/2023 - 35646 00005440 8A0C mov cl,[si] - 35647 00005442 46 inc si - 35648 - 35649 ;cmp cx,0 ;AN000;Any substitutions? - 35650 ; 07/04/2023 - 35651 ;and cx,cx - 35652 ;jz short ready_to_print ;AN000;No - continue - 35653 ; 12/08/2024 - 35654 00005443 E35C jcxz ready_to_print - 35655 - 35656 00005445 BF[399F] mov di,subst_buffer ;AN061; Get address of message subst buffer - 35657 00005448 57 push di ;AN061; save it - 35658 00005449 51 push cx ;AN061; save number of subst - 35659 - 35660 move_subst: - 35661 0000544A 51 push cx ;AN061;save number of subst - 35662 0000544B 89F3 mov bx,si ;AN061;save start of sublist - 35663 ;mov cx,parm_block_size ; 11 ;AN061;get size of sublist - 35664 ; 07/04/2023 - 35665 0000544D B10B mov cl,parm_block_size ; 11 - 35666 0000544F F3A4 rep movsb ;AN061;move sublist - 35667 ;test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],date_type - 35668 00005451 F6470704 test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],4 - 35669 ;test byte [bx+7],4 ;AN061;are we doing date/time? - 35670 00005455 7406 jz short move_subst_cont ;AN061;no - no need to reset - 35671 ;mov word [bx+$M_SUBLIST_STRUC.$M_S_VALUE],0 - 35672 ;mov word [bx+2],0 ;AN061;reset original date or time to 0 - 35673 00005457 894F02 mov [bx+$M_SUBLIST_STRUC.$M_S_VALUE],cx ; 0 - 35674 ;mov word [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],0 - 35675 ;mov word [bx+4],0 ;AN061; - 35676 0000545A 894F04 mov [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],cx ; 0 - 35677 - 35678 move_subst_cont: ;AN061; - 35679 0000545D 59 pop cx ;AN061;get number of subst back - 35680 0000545E E2EA loop move_subst ;AN061;move cx sublists - 35681 - 35682 00005460 59 pop cx ;AN061;get number of subst - 35683 00005461 50 push ax ;AN061;save message number - 35684 00005462 803E[D58F]FF cmp byte [msg_disp_class],util_msg_class - 35685 ;cmp byte [msg_disp_class],0FFh ;AN061;Is this a utility message - 35686 00005467 740C je short check_fix ;AN061;YES - go see if substitutions - 35687 ;mov byte [msg_flag],1 ; ext_msg_class - 35688 00005469 C606[339F]01 mov byte [msg_flag],ext_msg_class ;AN061;set message flag - 35689 0000546E BF[D78F] mov di,extend_buf_ptr ;AN061; Get address of extended message block - 35690 00005471 31C0 xor ax,ax ;AN061;clear ax register - 35691 00005473 AB stosw ;AN061;clear out message number - 35692 00005474 AA stosb ;AN061;clear out subst count - 35693 - 35694 check_fix: ;AN061; - 35695 00005475 58 pop ax ;AN061;get message number back - 35696 00005476 5F pop di ;AN061;get start of sublists - 35697 00005477 89FE mov si,di ;AN061;get into SI for msgserv - 35698 00005479 89F3 mov bx,si ;AN061;get into BX for addressing - 35699 0000547B 51 push cx ;AN061;save number of subst - 35700 - 35701 set_subst: ;AN061;store the segment of the subst - 35702 0000547C 837F0400 cmp word [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],0 - 35703 ;cmp word [bx+4],0 ;AN061;was it set already? - 35704 00005480 7509 jnz short subst_seg_set ;AN061;if not 0, don't replace it - 35705 00005482 F6470704 test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],4 - 35706 ;test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],date_type - 35707 ;test byte [bx+7],4 ;AN061;don't replace if date or time - 35708 00005486 7503 jnz short subst_seg_set ;AN061;yes - skip it - 35709 00005488 8C4F04 mov word [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],cs - 35710 ;mov word [bx+4],cs ;AN061;set segment value - 35711 - 35712 subst_seg_set: ;AN061; - 35713 0000548B 83C30B add bx,parm_block_size ; add bx,11 ;AN061;go to next sublist - 35714 0000548E E2EC loop set_subst ;AN061;loop CX times - 35715 00005490 59 pop cx ;AN061;get number of subst back - 35716 - 35717 00005491 89F3 mov bx,si ;AN061;get start of sublist to BX - 35718 00005493 817F02[A09D] cmp word [bx+$M_SUBLIST_STRUC.$M_S_VALUE],string_ptr_2 - 35719 ;cmp word [bx+2],string_ptr_2 ;AN061;are we using double indirection? - 35720 00005498 7507 jne short ready_to_print ;AN061;no - we already have address - 35721 ; 01/05/2023 - 35722 0000549A 8B16[A09D] mov dx,[string_ptr_2] ;AN061;get address in string_ptr_2 - 35723 0000549E 895702 mov [bx+$M_SUBLIST_STRUC.$M_S_VALUE],dx - 35724 ;AN061;put it into the subst block - 35725 ;mov [bx+2],dx - 35726 - 35727 ready_to_print: - 35728 000054A1 8B1E[2199] mov bx,[PRINTF_HANDLE] ;AN000;get print handle - 35729 000054A5 8A16[D68F] mov dl,[msg_cont_flag] ;AN000;set up control flag - 35730 000054A9 8A36[D58F] mov dh,[msg_disp_class] ;AN000;set up display class - 35731 000054AD C606[D68F]00 mov byte [msg_cont_flag],0 ; no_cont_flag - 35732 ;AN061;reset flags to avoid - 35733 000054B2 C606[D58F]FF mov byte [msg_disp_class],util_msg_class - 35734 ;mov byte [msg_disp_class],0FFh ;AN061; transient reload - 35735 - 35736 000054B7 1E push ds ;AN026; - 35737 000054B8 06 push es ;AN026; + 35620 std_printf: + 35621 00005428 C706[2199]0100 mov word [PRINTF_HANDLE],1 ;AC000;Print to STDOUT + 35622 + 35623 new_printf: + 35624 0000542E 50 push ax ;AN000;save registers + 35625 0000542F 53 push bx ;AN000; + 35626 00005430 51 push cx ;AN000; + 35627 00005431 06 push es ;AN000;get local ES + 35628 00005432 1E push ds ;AN000; + 35629 00005433 07 pop es ;AN000; + 35630 00005434 57 push di ;AN000; + 35631 00005435 56 push si ;AN000; + 35632 00005436 52 push dx ;AN000; + 35633 + 35634 ; 07/04/2023 + 35635 ;mov word [print_err_flag],0 ;AN000; + 35636 00005437 31C9 xor cx,cx + 35637 00005439 890E[379F] mov [print_err_flag],cx ; 0 + 35638 + 35639 0000543D 89D6 mov si,dx ;AN000;Get offset of message number + 35640 0000543F AD lodsw ;AN000;load message number + 35641 ; 15/06/2023 + 35642 ;push ax ;AN000;save it + 35643 ;lodsb ;AN000;get number of substitutions + 35644 ;mov cl,al ;AN000;set up CX as # of subst + 35645 ;; 07/04/2023 + 35646 ;;xor ch,ch ;AN000;SI now points to subst list + 35647 ;pop ax ;AN000;get message number back + 35648 ; 15/06/2023 + 35649 00005440 8A0C mov cl,[si] + 35650 00005442 46 inc si + 35651 + 35652 ;cmp cx,0 ;AN000;Any substitutions? + 35653 ; 07/04/2023 + 35654 ;and cx,cx + 35655 ;jz short ready_to_print ;AN000;No - continue + 35656 ; 12/08/2024 + 35657 00005443 E35C jcxz ready_to_print + 35658 + 35659 00005445 BF[399F] mov di,subst_buffer ;AN061; Get address of message subst buffer + 35660 00005448 57 push di ;AN061; save it + 35661 00005449 51 push cx ;AN061; save number of subst + 35662 + 35663 move_subst: + 35664 0000544A 51 push cx ;AN061;save number of subst + 35665 0000544B 89F3 mov bx,si ;AN061;save start of sublist + 35666 ;mov cx,parm_block_size ; 11 ;AN061;get size of sublist + 35667 ; 07/04/2023 + 35668 0000544D B10B mov cl,parm_block_size ; 11 + 35669 0000544F F3A4 rep movsb ;AN061;move sublist + 35670 ;test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],date_type + 35671 00005451 F6470704 test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],4 + 35672 ;test byte [bx+7],4 ;AN061;are we doing date/time? + 35673 00005455 7406 jz short move_subst_cont ;AN061;no - no need to reset + 35674 ;mov word [bx+$M_SUBLIST_STRUC.$M_S_VALUE],0 + 35675 ;mov word [bx+2],0 ;AN061;reset original date or time to 0 + 35676 00005457 894F02 mov [bx+$M_SUBLIST_STRUC.$M_S_VALUE],cx ; 0 + 35677 ;mov word [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],0 + 35678 ;mov word [bx+4],0 ;AN061; + 35679 0000545A 894F04 mov [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],cx ; 0 + 35680 + 35681 move_subst_cont: ;AN061; + 35682 0000545D 59 pop cx ;AN061;get number of subst back + 35683 0000545E E2EA loop move_subst ;AN061;move cx sublists + 35684 + 35685 00005460 59 pop cx ;AN061;get number of subst + 35686 00005461 50 push ax ;AN061;save message number + 35687 00005462 803E[D58F]FF cmp byte [msg_disp_class],util_msg_class + 35688 ;cmp byte [msg_disp_class],0FFh ;AN061;Is this a utility message + 35689 00005467 740C je short check_fix ;AN061;YES - go see if substitutions + 35690 ;mov byte [msg_flag],1 ; ext_msg_class + 35691 00005469 C606[339F]01 mov byte [msg_flag],ext_msg_class ;AN061;set message flag + 35692 0000546E BF[D78F] mov di,extend_buf_ptr ;AN061; Get address of extended message block + 35693 00005471 31C0 xor ax,ax ;AN061;clear ax register + 35694 00005473 AB stosw ;AN061;clear out message number + 35695 00005474 AA stosb ;AN061;clear out subst count + 35696 + 35697 check_fix: ;AN061; + 35698 00005475 58 pop ax ;AN061;get message number back + 35699 00005476 5F pop di ;AN061;get start of sublists + 35700 00005477 89FE mov si,di ;AN061;get into SI for msgserv + 35701 00005479 89F3 mov bx,si ;AN061;get into BX for addressing + 35702 0000547B 51 push cx ;AN061;save number of subst + 35703 + 35704 set_subst: ;AN061;store the segment of the subst + 35705 0000547C 837F0400 cmp word [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],0 + 35706 ;cmp word [bx+4],0 ;AN061;was it set already? + 35707 00005480 7509 jnz short subst_seg_set ;AN061;if not 0, don't replace it + 35708 00005482 F6470704 test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],4 + 35709 ;test byte [bx+$M_SUBLIST_STRUC.$M_S_FLAG],date_type + 35710 ;test byte [bx+7],4 ;AN061;don't replace if date or time + 35711 00005486 7503 jnz short subst_seg_set ;AN061;yes - skip it + 35712 00005488 8C4F04 mov word [bx+$M_SUBLIST_STRUC.$M_S_VALUE+2],cs + 35713 ;mov word [bx+4],cs ;AN061;set segment value + 35714 + 35715 subst_seg_set: ;AN061; + 35716 0000548B 83C30B add bx,parm_block_size ; add bx,11 ;AN061;go to next sublist + 35717 0000548E E2EC loop set_subst ;AN061;loop CX times + 35718 00005490 59 pop cx ;AN061;get number of subst back + 35719 + 35720 00005491 89F3 mov bx,si ;AN061;get start of sublist to BX + 35721 00005493 817F02[A09D] cmp word [bx+$M_SUBLIST_STRUC.$M_S_VALUE],string_ptr_2 + 35722 ;cmp word [bx+2],string_ptr_2 ;AN061;are we using double indirection? + 35723 00005498 7507 jne short ready_to_print ;AN061;no - we already have address + 35724 ; 01/05/2023 + 35725 0000549A 8B16[A09D] mov dx,[string_ptr_2] ;AN061;get address in string_ptr_2 + 35726 0000549E 895702 mov [bx+$M_SUBLIST_STRUC.$M_S_VALUE],dx + 35727 ;AN061;put it into the subst block + 35728 ;mov [bx+2],dx + 35729 + 35730 ready_to_print: + 35731 000054A1 8B1E[2199] mov bx,[PRINTF_HANDLE] ;AN000;get print handle + 35732 000054A5 8A16[D68F] mov dl,[msg_cont_flag] ;AN000;set up control flag + 35733 000054A9 8A36[D58F] mov dh,[msg_disp_class] ;AN000;set up display class + 35734 000054AD C606[D68F]00 mov byte [msg_cont_flag],0 ; no_cont_flag + 35735 ;AN061;reset flags to avoid + 35736 000054B2 C606[D58F]FF mov byte [msg_disp_class],util_msg_class + 35737 ;mov byte [msg_disp_class],0FFh ;AN061; transient reload 35738 - 35739 000054B9 E83702 call SYSDISPMSG ;AN000;call Rod - 35740 - 35741 000054BC 07 pop es ;AN026; restore registers - 35742 000054BD 1F pop ds ;AN026; + 35739 000054B7 1E push ds ;AN026; + 35740 000054B8 06 push es ;AN026; + 35741 + 35742 000054B9 E83702 call SYSDISPMSG ;AN000;call Rod 35743 - 35744 000054BE 7303 jnc short print_success ;AN000; everything went okay - 35745 000054C0 A3[379F] mov [print_err_flag],ax ;AN000; + 35744 000054BC 07 pop es ;AN026; restore registers + 35745 000054BD 1F pop ds ;AN026; 35746 - 35747 print_success: - 35748 000054C3 5A pop dx ;AN061;restore dx - 35749 000054C4 5E pop si ;AN000;restore registers - 35750 000054C5 5F pop di ;AN000; - 35751 000054C6 07 pop es ;AN000;restore registers - 35752 000054C7 59 pop cx ;AN000; - 35753 000054C8 5B pop bx ;AN000; - 35754 000054C9 58 pop ax ;AN000; - 35755 000054CA 833E[379F]00 cmp word [print_err_flag],0 ;AN000; if an error occurred - handle it - 35756 000054CF 7501 jnz short print_err ;AN000; - 35757 - 35758 000054D1 C3 retn ;AC000; - 35759 - 35760 print_err: - 35761 000054D2 0E push cs - 35762 000054D3 07 pop es - 35763 000054D4 833E[2199]02 cmp word [PRINTF_HANDLE],2 ;AN026;Print to STDERR? - 35764 000054D9 7503 jne short not_stderr ;AN026;no - continue - 35765 000054DB E926AC jmp TCOMMAND ;AN026;Yes - hopless - just exit - 35766 - 35767 not_stderr: - 35768 000054DE A1[379F] mov ax,[print_err_flag] ;AN026;get extended error number back - 35769 000054E1 8E06[F59B] mov es,[RESSEG] ; No, set up for error, load the - 35770 ; right error msg, and jmp to cerror. - 35771 000054E5 26F606[1303]FF test byte [es:PipeFlag],-1 ; 0FFh - 35772 000054EB 7408 jz short _go_to_error - 35773 000054ED E8B7DE call PipeOff - 35774 000054F0 BA[5D91] mov dx,PIPEEMES_PTR - 35775 000054F3 EB0B jmp short print_err_exit ;AC000; - 35776 - 35777 _go_to_error: - 35778 000054F5 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class - 35779 ;mov byte [msg_disp_class],1 ;AN000; set up extended error msg class - 35780 000054FA BA[D78F] mov dx,extend_buf_ptr ;AC000; get extended message pointer - 35781 000054FD A3[D78F] mov [extend_buf_ptr],ax ;AN000; get message number in control block - 35782 - 35783 print_err_exit: ;AC000; - 35784 00005500 0E push cs - 35785 00005501 07 pop es - 35786 00005502 E921D8 jmp cerror - 35787 - 35788 ;**************************************************************** - 35789 ;* - 35790 ;* ROUTINE: TSYSLOADMSG - 35791 ;* - 35792 ;* FUNCTION: Interface to call SYSLOADMSG to avoid duplicate - 35793 ;* names since these routines are also used in the - 35794 ;* resident. - 35795 ;* - 35796 ;* INPUT: Inputs to SYSLOADMSG - 35797 ;* - 35798 ;* OUTPUT: Outputs from SYSLOADMSG - 35799 ;* - 35800 ;**************************************************************** - 35801 - 35802 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35803 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 35804 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35805 TSYSLOADMSG: - 35806 00005505 53 push bx ;AN000; - 35807 00005506 E80800 call SYSLOADMSG ;AN000; call routine - 35808 00005509 5B pop bx ;AN000; - 35809 0000550A C3 retn ;AN000; exit - 35810 - 35811 ;**************************************************************** - 35812 ;* - 35813 ;* ROUTINE: TSYSGETMSG - 35814 ;* - 35815 ;* FUNCTION: Interface to call SYSGETMSG to avoid duplicate - 35816 ;* names since these routines are also used in the - 35817 ;* resident. - 35818 ;* - 35819 ;* INPUT: Inputs to SYSGETMSG - 35820 ;* - 35821 ;* OUTPUT: Outputs from SYSGETMSG - 35822 ;* - 35823 ;**************************************************************** - 35824 - 35825 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35826 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 35827 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 35828 TSYSGETMSG: - 35829 0000550B 51 push cx ;AN000; - 35830 0000550C E8B500 call SYSGETMSG ;AN000; call routine - 35831 0000550F 59 pop cx ;AN000; - 35832 00005510 C3 retn ;AN000; exit - 35833 - 35834 ;============================================================================ - 35835 ; MSGSERV.ASM, MSDOS 6.0, 1991 - 35836 ;============================================================================ - 35837 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35838 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 35839 - 35840 ; --------------------------------------------------------------------------- - 35841 ; MODULE NAME: MSGSERV.SAL - 35842 ; - 35843 ; DESCRIPTIVE NAME: Message Services SALUT file - 35844 ; - 35845 ; FUNCTION: This module incorporates all the messages services and - 35846 ; is called upon at build time to INCLUDE the code requested - 35847 ; by a utility. Code is requested using the macro MSG_SERVICES. - 35848 ; - 35849 ; ENTRY POINT: Since this a collection of subroutines, entry point is at - 35850 ; requested procedure. + 35747 000054BE 7303 jnc short print_success ;AN000; everything went okay + 35748 000054C0 A3[379F] mov [print_err_flag],ax ;AN000; + 35749 + 35750 print_success: + 35751 000054C3 5A pop dx ;AN061;restore dx + 35752 000054C4 5E pop si ;AN000;restore registers + 35753 000054C5 5F pop di ;AN000; + 35754 000054C6 07 pop es ;AN000;restore registers + 35755 000054C7 59 pop cx ;AN000; + 35756 000054C8 5B pop bx ;AN000; + 35757 000054C9 58 pop ax ;AN000; + 35758 000054CA 833E[379F]00 cmp word [print_err_flag],0 ;AN000; if an error occurred - handle it + 35759 000054CF 7501 jnz short print_err ;AN000; + 35760 + 35761 000054D1 C3 retn ;AC000; + 35762 + 35763 print_err: + 35764 000054D2 0E push cs + 35765 000054D3 07 pop es + 35766 000054D4 833E[2199]02 cmp word [PRINTF_HANDLE],2 ;AN026;Print to STDERR? + 35767 000054D9 7503 jne short not_stderr ;AN026;no - continue + 35768 000054DB E926AC jmp TCOMMAND ;AN026;Yes - hopless - just exit + 35769 + 35770 not_stderr: + 35771 000054DE A1[379F] mov ax,[print_err_flag] ;AN026;get extended error number back + 35772 000054E1 8E06[F59B] mov es,[RESSEG] ; No, set up for error, load the + 35773 ; right error msg, and jmp to cerror. + 35774 000054E5 26F606[1303]FF test byte [es:PipeFlag],-1 ; 0FFh + 35775 000054EB 7408 jz short _go_to_error + 35776 000054ED E8B7DE call PipeOff + 35777 000054F0 BA[5D91] mov dx,PIPEEMES_PTR + 35778 000054F3 EB0B jmp short print_err_exit ;AC000; + 35779 + 35780 _go_to_error: + 35781 000054F5 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class + 35782 ;mov byte [msg_disp_class],1 ;AN000; set up extended error msg class + 35783 000054FA BA[D78F] mov dx,extend_buf_ptr ;AC000; get extended message pointer + 35784 000054FD A3[D78F] mov [extend_buf_ptr],ax ;AN000; get message number in control block + 35785 + 35786 print_err_exit: ;AC000; + 35787 00005500 0E push cs + 35788 00005501 07 pop es + 35789 00005502 E921D8 jmp cerror + 35790 + 35791 ;**************************************************************** + 35792 ;* + 35793 ;* ROUTINE: TSYSLOADMSG + 35794 ;* + 35795 ;* FUNCTION: Interface to call SYSLOADMSG to avoid duplicate + 35796 ;* names since these routines are also used in the + 35797 ;* resident. + 35798 ;* + 35799 ;* INPUT: Inputs to SYSLOADMSG + 35800 ;* + 35801 ;* OUTPUT: Outputs from SYSLOADMSG + 35802 ;* + 35803 ;**************************************************************** + 35804 + 35805 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35806 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 35807 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35808 TSYSLOADMSG: + 35809 00005505 53 push bx ;AN000; + 35810 00005506 E80800 call SYSLOADMSG ;AN000; call routine + 35811 00005509 5B pop bx ;AN000; + 35812 0000550A C3 retn ;AN000; exit + 35813 + 35814 ;**************************************************************** + 35815 ;* + 35816 ;* ROUTINE: TSYSGETMSG + 35817 ;* + 35818 ;* FUNCTION: Interface to call SYSGETMSG to avoid duplicate + 35819 ;* names since these routines are also used in the + 35820 ;* resident. + 35821 ;* + 35822 ;* INPUT: Inputs to SYSGETMSG + 35823 ;* + 35824 ;* OUTPUT: Outputs from SYSGETMSG + 35825 ;* + 35826 ;**************************************************************** + 35827 + 35828 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35829 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 35830 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 35831 TSYSGETMSG: + 35832 0000550B 51 push cx ;AN000; + 35833 0000550C E8B500 call SYSGETMSG ;AN000; call routine + 35834 0000550F 59 pop cx ;AN000; + 35835 00005510 C3 retn ;AN000; exit + 35836 + 35837 ;============================================================================ + 35838 ; MSGSERV.ASM, MSDOS 6.0, 1991 + 35839 ;============================================================================ + 35840 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35841 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 35842 + 35843 ; --------------------------------------------------------------------------- + 35844 ; MODULE NAME: MSGSERV.SAL + 35845 ; + 35846 ; DESCRIPTIVE NAME: Message Services SALUT file + 35847 ; + 35848 ; FUNCTION: This module incorporates all the messages services and + 35849 ; is called upon at build time to INCLUDE the code requested + 35850 ; by a utility. Code is requested using the macro MSG_SERVICES. 35851 ; - 35852 ; INPUT: Since this a collection of subroutines, input is dependent on - 35853 ; function requested. + 35852 ; ENTRY POINT: Since this a collection of subroutines, entry point is at + 35853 ; requested procedure. 35854 ; - 35855 ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 - 35856 ; - 35857 ; EXIT-ERROR: In all cases, CARRY FLAG = 1 - 35858 ; - 35859 ; INTERNAL REFERENCES: (list of included subroutines) - 35860 ; - 35861 ; - SYSLOADMSG - 35862 ; - SYSDISPMSG - 35863 ; - SYSGETMSG - 35864 ; - 35865 ; EXTERNAL REFERENCES: None - 35866 ; - 35867 ; NOTES: At build time, some modules must be included. These are only included - 35868 ; once using assembler switches. Other logic is included at the request - 35869 ; of the utility. - 35870 ; - 35871 ; COMR and COMT are assembler switches to conditionally assemble code - 35872 ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident - 35873 ; storage and multiple EQUates. - 35874 ; - 35875 ; REVISION HISTORY: Created MAY 1987 - 35876 ; - 35877 ; Label: DOS - - Message Retriever - 35878 ; (c) Copyright 1988 Microsoft - 35879 ; --------------------------------------------------------------------------- - 35880 - 35881 ; Revision History - 35882 ; ================ - 35883 ; - 35884 ; M007 SR 08/24/90 Fixed bug #1818 -- changed - 35885 ; $M_DISPLAY_H_STRING to properly - 35886 ; handle Ctrl-Z being passed - 35887 ; - 35888 ; M013 SR 9/12/90 Make SETSTDIO flag false so that all - 35889 ; these routines are no longer assembled. + 35855 ; INPUT: Since this a collection of subroutines, input is dependent on + 35856 ; function requested. + 35857 ; + 35858 ; EXIT-NORMAL: In all cases, CARRY FLAG = 0 + 35859 ; + 35860 ; EXIT-ERROR: In all cases, CARRY FLAG = 1 + 35861 ; + 35862 ; INTERNAL REFERENCES: (list of included subroutines) + 35863 ; + 35864 ; - SYSLOADMSG + 35865 ; - SYSDISPMSG + 35866 ; - SYSGETMSG + 35867 ; + 35868 ; EXTERNAL REFERENCES: None + 35869 ; + 35870 ; NOTES: At build time, some modules must be included. These are only included + 35871 ; once using assembler switches. Other logic is included at the request + 35872 ; of the utility. + 35873 ; + 35874 ; COMR and COMT are assembler switches to conditionally assemble code + 35875 ; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident + 35876 ; storage and multiple EQUates. + 35877 ; + 35878 ; REVISION HISTORY: Created MAY 1987 + 35879 ; + 35880 ; Label: DOS - - Message Retriever + 35881 ; (c) Copyright 1988 Microsoft + 35882 ; --------------------------------------------------------------------------- + 35883 + 35884 ; Revision History + 35885 ; ================ + 35886 ; + 35887 ; M007 SR 08/24/90 Fixed bug #1818 -- changed + 35888 ; $M_DISPLAY_H_STRING to properly + 35889 ; handle Ctrl-Z being passed 35890 ; - 35891 ; M016 SR 10/14/90 Bug #3380. Changed SYSLOADMSG so that - 35892 ; CR-LF string also gets reinitialized - 35893 ; on every cycle. - 35894 ; - 35895 ; M020 SR 10/26/90 Bug #3380 again. Initialize $M_DIVISOR - 35896 ; & $_MSG_NUM also in SYSLOADMSG. - 35897 - 35898 ; --------------------------------------------------------------------------- - 35899 - 35900 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 35901 - 35902 ;;; Replacable parameters are described by a sublist structure - 35903 ; - 35904 ;struc $M_SUBLIST_STRUC ;;AN000;; - 35905 ; .$M_S_SIZE: resb 1 ;;AN000;; SUBLIST size (PTR to next SUBLIST) - 35906 ; .$M_S_RESV: resb 1 ;;AN000;; RESERVED - 35907 ; .$M_S_VALUE: resd 1 ;;AN000;; Time, Date or PTR to data item - 35908 ; .$M_S_ID: resb 1 ;;AN000;; n of %n - 35909 ; .$M_S_FLAG: resb 1 ;;AN000;; Data-type flags - 35910 ; .$M_S_MAXW: resb 1 ;;AN000;; Maximum field width - 35911 ; .$M_S_MINW: resb 1 ;;AN000;; Minimum field width - 35912 ; .$M_S_PAD: resb 1 ;;AN000;; Character for Pad field - 35913 ;endstruc - 35914 - 35915 ;; Each class will be defined by this structure. - 35916 - 35917 struc $M_CLASS_ID ;;AN000;; - 35918 00000000 ?? .$M_CLS_ID: resb 1 ;;AN000;; Class identifer - 35919 00000001 ???? .$M_COMMAND_VER: resw 1 ;;AN003;; COMMAND.COM version check - 35920 00000003 ?? .$M_NUM_CLS_MSG: resb 1 ;;AN000;; Total number of message in class - 35921 .size: - 35922 endstruc - 35923 - 35924 $M_CLASS_ID_SZ EQU $M_CLASS_ID.size ;;AN000;; - 35925 - 35926 ;; Each message will be defined by this structure. - 35927 - 35928 struc $M_ID ;;AN000;; - 35929 00000000 ???? .$M_NUM: resw 1 ;;AN000;; Message Number - 35930 00000002 ???? .$M_TXT_PTR: resw 1 ;;AN000;; Pointer to message text - 35931 .size: - 35932 endstruc - 35933 - 35934 $M_ID_SZ EQU $M_ID.size ;;AN000;; - 35935 - 35936 ; --------------------------- - 35937 ; MSDOS 6.0, SYSMSG.INC, 1991 - 35938 ; --------------------------- - 35939 $M_TEMP_BUF_SZ EQU 64 ;; Size of temporary buffer ;AN003; - 35940 - 35941 ; --------------------------- - 35942 - 35943 ; 07/04/2023 - 35944 $M_NUM_CLS equ 3 + 35891 ; M013 SR 9/12/90 Make SETSTDIO flag false so that all + 35892 ; these routines are no longer assembled. + 35893 ; + 35894 ; M016 SR 10/14/90 Bug #3380. Changed SYSLOADMSG so that + 35895 ; CR-LF string also gets reinitialized + 35896 ; on every cycle. + 35897 ; + 35898 ; M020 SR 10/26/90 Bug #3380 again. Initialize $M_DIVISOR + 35899 ; & $_MSG_NUM also in SYSLOADMSG. + 35900 + 35901 ; --------------------------------------------------------------------------- + 35902 + 35903 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 35904 + 35905 ;;; Replacable parameters are described by a sublist structure + 35906 ; + 35907 ;struc $M_SUBLIST_STRUC ;;AN000;; + 35908 ; .$M_S_SIZE: resb 1 ;;AN000;; SUBLIST size (PTR to next SUBLIST) + 35909 ; .$M_S_RESV: resb 1 ;;AN000;; RESERVED + 35910 ; .$M_S_VALUE: resd 1 ;;AN000;; Time, Date or PTR to data item + 35911 ; .$M_S_ID: resb 1 ;;AN000;; n of %n + 35912 ; .$M_S_FLAG: resb 1 ;;AN000;; Data-type flags + 35913 ; .$M_S_MAXW: resb 1 ;;AN000;; Maximum field width + 35914 ; .$M_S_MINW: resb 1 ;;AN000;; Minimum field width + 35915 ; .$M_S_PAD: resb 1 ;;AN000;; Character for Pad field + 35916 ;endstruc + 35917 + 35918 ;; Each class will be defined by this structure. + 35919 + 35920 struc $M_CLASS_ID ;;AN000;; + 35921 00000000 ?? .$M_CLS_ID: resb 1 ;;AN000;; Class identifer + 35922 00000001 ???? .$M_COMMAND_VER: resw 1 ;;AN003;; COMMAND.COM version check + 35923 00000003 ?? .$M_NUM_CLS_MSG: resb 1 ;;AN000;; Total number of message in class + 35924 .size: + 35925 endstruc + 35926 + 35927 $M_CLASS_ID_SZ EQU $M_CLASS_ID.size ;;AN000;; + 35928 + 35929 ;; Each message will be defined by this structure. + 35930 + 35931 struc $M_ID ;;AN000;; + 35932 00000000 ???? .$M_NUM: resw 1 ;;AN000;; Message Number + 35933 00000002 ???? .$M_TXT_PTR: resw 1 ;;AN000;; Pointer to message text + 35934 .size: + 35935 endstruc + 35936 + 35937 $M_ID_SZ EQU $M_ID.size ;;AN000;; + 35938 + 35939 ; --------------------------- + 35940 ; MSDOS 6.0, SYSMSG.INC, 1991 + 35941 ; --------------------------- + 35942 $M_TEMP_BUF_SZ EQU 64 ;; Size of temporary buffer ;AN003; + 35943 + 35944 ; --------------------------- 35945 - 35946 ;; Resident data area definition of variables - 35947 - 35948 struc $M_RES_ADDRS ;;AN000;; - 35949 00000000 ???????? .$M_EXT_ERR_ADDRS: resd 1 ;;AN000;; Allow pointers to THREE Extended error locations - 35950 00000004 ???????? .$M_EXT_FILE: resd 1 ;;AN001;; - 35951 00000008 ???????? .$M_EXT_COMMAND: resd 1 ;;AN000;; - 35952 0000000C ???????? .$M_EXT_TERM: resd 1 ;;AN000;; - 35953 00000010 ???????? .$M_PARSE_COMMAND: resd 1 ;;AN000;; - 35954 00000014 ???????? .$M_PARSE_ADDRS: resd 1 ;;AN000;; Allow pointers to TWO Parse error locations - 35955 00000018 ???????? .$M_PARSE_TERM: resd 1 ;;AN000;; - 35956 0000001C ???????? .$M_CRIT_ADDRS: resd 1 ;;AN000;; Allow pointers to TWO Critical error locations - 35957 00000020 ???????? .$M_CRIT_COMMAND: resd 1 ;;AN000;; - 35958 00000024 ???????? .$M_CRIT_TERM: resd 1 ;;AN000;; - 35959 00000028 ???????? .$M_DISK_PROC_ADDR: resd 1 ;;AN004;; Address of READ_DISK_PROC - 35960 0000002C .$M_CLASS_ADDRS: resd $M_NUM_CLS ; 3 ;;AN000;; Allow pointers to specified classes - 35961 00000038 ???????? .$M_CLS_TERM: resd 1 ;;AN000;; - 35962 0000003C ???????? .$M_DBCS_VEC: resd 1 ;;AN000;; Save DBCS vector - 35963 00000040 ???? .$M_HANDLE: resw 1 ;;AN000;; - 35964 00000042 ?? .$M_SIZE: resb 1 ;;AN000;; - 35965 00000043 ???? .$M_CRLF: resb 2 ;;AN004;; CR LF message - 35966 00000045 ?? .$M_CLASS: resb 1 ;;AN004;; Saved class - 35967 00000046 ???? .$M_RETURN_ADDR: resw 1 ;;AN000;; - 35968 00000048 ???? .$M_MSG_NUM: resw 1 ;;AN000;; - 35969 0000004A ???? .$M_DIVISOR: resw 1 ;;AN000;; Default = 10 (must be a WORD for division) - 35970 0000004C .$M_TEMP_BUF: resb $M_TEMP_BUF_SZ ;;AN000;; Temporary buffer - 35971 0000008C ?? .$M_BUF_TERM: resb 1 ;;AN000;; - 35972 .size: - 35973 endstruc ;;AN000;; - 35974 - 35975 $M_RES_ADDRS_SZ EQU $M_RES_ADDRS.size ;;AN000;; - 35976 - 35977 ;; Important fields of the Get Country Information call - 35978 - 35979 struc $M_COUNTRY_INFO ;;AN000;; Expected Country infomation - 35980 00000000 .$M_HEADER: resb $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 - 35981 ;;AN000;; Go past first part of struc - 35982 0000004C ???? .$M_DATE_FORMAT: resw 1 ;;AN000;; <------- Date Format - 35983 0000004E ?????????? .$M_CURR_SEPARA: resb 5 ;;AN000;; - 35984 00000053 ???? .$M_THOU_SEPARA: resb 2 ;;AN000;; <------- Thou Separator - 35985 00000055 ???? .$M_DECI_SEPARA: resb 2 ;;AN000;; <------- Decimal Separator - 35986 00000057 ???? .$M_DATE_SEPARA: resb 2 ;;AN000;; <------- Date Separator - 35987 00000059 ???? .$M_TIME_SEPARA: resb 2 ;;AN000;; <------- Time Separator - 35988 0000005B ?? .$M_CURR_FORMAT: resb 1 ;;AN000;; - 35989 0000005C ?? .$M_SIG_DIGS_CU: resb 1 ;;AN000;; - 35990 0000005D ?? .$M_TIME_FORMAT: resb 1 ;;AN000;; <------- Time Format - 35991 endstruc ;;AN000;; - 35992 - 35993 ; --------------------------------------------------------------------------- - 35994 - 35995 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 35996 ;; - 35997 ;; PROC NAME: SYSLOADMSG - 35998 ;; - 35999 ;; FUNCTION: - 36000 ;; INPUTS: + 35946 ; 07/04/2023 + 35947 $M_NUM_CLS equ 3 + 35948 + 35949 ;; Resident data area definition of variables + 35950 + 35951 struc $M_RES_ADDRS ;;AN000;; + 35952 00000000 ???????? .$M_EXT_ERR_ADDRS: resd 1 ;;AN000;; Allow pointers to THREE Extended error locations + 35953 00000004 ???????? .$M_EXT_FILE: resd 1 ;;AN001;; + 35954 00000008 ???????? .$M_EXT_COMMAND: resd 1 ;;AN000;; + 35955 0000000C ???????? .$M_EXT_TERM: resd 1 ;;AN000;; + 35956 00000010 ???????? .$M_PARSE_COMMAND: resd 1 ;;AN000;; + 35957 00000014 ???????? .$M_PARSE_ADDRS: resd 1 ;;AN000;; Allow pointers to TWO Parse error locations + 35958 00000018 ???????? .$M_PARSE_TERM: resd 1 ;;AN000;; + 35959 0000001C ???????? .$M_CRIT_ADDRS: resd 1 ;;AN000;; Allow pointers to TWO Critical error locations + 35960 00000020 ???????? .$M_CRIT_COMMAND: resd 1 ;;AN000;; + 35961 00000024 ???????? .$M_CRIT_TERM: resd 1 ;;AN000;; + 35962 00000028 ???????? .$M_DISK_PROC_ADDR: resd 1 ;;AN004;; Address of READ_DISK_PROC + 35963 0000002C .$M_CLASS_ADDRS: resd $M_NUM_CLS ; 3 ;;AN000;; Allow pointers to specified classes + 35964 00000038 ???????? .$M_CLS_TERM: resd 1 ;;AN000;; + 35965 0000003C ???????? .$M_DBCS_VEC: resd 1 ;;AN000;; Save DBCS vector + 35966 00000040 ???? .$M_HANDLE: resw 1 ;;AN000;; + 35967 00000042 ?? .$M_SIZE: resb 1 ;;AN000;; + 35968 00000043 ???? .$M_CRLF: resb 2 ;;AN004;; CR LF message + 35969 00000045 ?? .$M_CLASS: resb 1 ;;AN004;; Saved class + 35970 00000046 ???? .$M_RETURN_ADDR: resw 1 ;;AN000;; + 35971 00000048 ???? .$M_MSG_NUM: resw 1 ;;AN000;; + 35972 0000004A ???? .$M_DIVISOR: resw 1 ;;AN000;; Default = 10 (must be a WORD for division) + 35973 0000004C .$M_TEMP_BUF: resb $M_TEMP_BUF_SZ ;;AN000;; Temporary buffer + 35974 0000008C ?? .$M_BUF_TERM: resb 1 ;;AN000;; + 35975 .size: + 35976 endstruc ;;AN000;; + 35977 + 35978 $M_RES_ADDRS_SZ EQU $M_RES_ADDRS.size ;;AN000;; + 35979 + 35980 ;; Important fields of the Get Country Information call + 35981 + 35982 struc $M_COUNTRY_INFO ;;AN000;; Expected Country infomation + 35983 00000000 .$M_HEADER: resb $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 + 35984 ;;AN000;; Go past first part of struc + 35985 0000004C ???? .$M_DATE_FORMAT: resw 1 ;;AN000;; <------- Date Format + 35986 0000004E ?????????? .$M_CURR_SEPARA: resb 5 ;;AN000;; + 35987 00000053 ???? .$M_THOU_SEPARA: resb 2 ;;AN000;; <------- Thou Separator + 35988 00000055 ???? .$M_DECI_SEPARA: resb 2 ;;AN000;; <------- Decimal Separator + 35989 00000057 ???? .$M_DATE_SEPARA: resb 2 ;;AN000;; <------- Date Separator + 35990 00000059 ???? .$M_TIME_SEPARA: resb 2 ;;AN000;; <------- Time Separator + 35991 0000005B ?? .$M_CURR_FORMAT: resb 1 ;;AN000;; + 35992 0000005C ?? .$M_SIG_DIGS_CU: resb 1 ;;AN000;; + 35993 0000005D ?? .$M_TIME_FORMAT: resb 1 ;;AN000;; <------- Time Format + 35994 endstruc ;;AN000;; + 35995 + 35996 ; --------------------------------------------------------------------------- + 35997 + 35998 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 35999 ;; + 36000 ;; PROC NAME: SYSLOADMSG 36001 ;; - 36002 ;; OUTPUTS: - 36003 ;; - 36004 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36005 - 36006 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36007 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5107h + 36002 ;; FUNCTION: + 36003 ;; INPUTS: + 36004 ;; + 36005 ;; OUTPUTS: + 36006 ;; + 36007 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 36008 - 36009 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36010 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:58CBh + 36009 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36010 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5107h 36011 - 36012 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36013 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5757h - 36014 SYSLOADMSG: - 36015 00005511 50 push ax ;;AN000; - 36016 00005512 53 push bx ;;AN000; - 36017 00005513 52 push dx ;;AN000; - 36018 00005514 06 push es ;;AN000; - 36019 00005515 57 push di ;;AN000; - 36020 00005516 31C9 xor cx,cx ;;AN000; Reset to zero - 36021 00005518 8EC1 mov es,cx ;;AN000; - 36022 0000551A 31FF xor di,di ;;AN000; - 36023 0000551C B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface - 36024 0000551F B200 mov dl,0 ; DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM - 36025 00005521 CD2F int 2Fh ;;AN000;; Private interface - 36026 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES - 36027 ; DL = subfunction - get standard DOS error table (errors 00h-12h,50h-5Bh) - 36028 ; Return: ES:DI -> error table - 36029 - 36030 00005523 8C06[9E98] mov [$M_RT+$M_RES_ADDRS.$M_EXT_COMMAND+2],es - 36031 ;mov [$M_RT+10],es ;;AN000;; Move into first avaliable table location - 36032 00005527 893E[9C98] mov [$M_RT+$M_RES_ADDRS.$M_EXT_COMMAND],di - 36033 ;mov [$M_RT+8],di ;;AN000;; - 36034 - 36035 0000552B B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface - 36036 0000552E B202 mov dl,2 ; DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM - 36037 00005530 CD2F int 2Fh ;;AN000;; Private interface - 36038 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES - 36039 ; DL = subfunction - get critical/SHARE error table (errors 13h-2Bh) - 36040 ; ES:DI -> error table - 36041 - 36042 00005532 8C06[A698] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_COMMAND+2],es - 36043 ;mov [$M_RT+18],es ;;AN000;; Move into first avaliable table location - 36044 00005536 893E[A498] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_COMMAND],di - 36045 ;mov [$M_RT+16],di ;;AN000;; - 36046 - 36047 0000553A B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface - 36048 0000553D B204 mov dl,4 ; DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM - 36049 0000553F CD2F int 2Fh ;;AN000;; Private interface - 36050 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES - 36051 ; DL = subfunction - get ??? error table - 36052 ; ES:DI -> error table - 36053 - 36054 00005541 8C06[B698] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_COMMAND+2],es - 36055 ;mov [$M_RT+34],es ;;AN000;; Move into first avaliable table location - 36056 00005545 893E[B498] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_COMMAND],di - 36057 ;mov [$M_RT+32],di ;;AN000;; - 36058 - 36059 00005549 B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface - 36060 0000554C B206 mov dl,6 ; DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE - 36061 0000554E CD2F int 2Fh ;;AN001;; Private interface - 36062 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES - 36063 ; DL = subfunction - get ??? error table - 36064 ; ES:DI -> error table - 36065 - 36066 00005550 8C06[9A98] mov [$M_RT+$M_RES_ADDRS.$M_EXT_FILE+2],es - 36067 ;mov [$M_RT+6],es ;;AN001;; Move into first avaliable table location - 36068 00005554 893E[9898] mov [$M_RT+$M_RES_ADDRS.$M_EXT_FILE],di - 36069 ;mov [$M_RT+4],di ;;AN001;; - 36070 - 36071 00005558 E8553A call $M_MSGSERV_1 ;;AN000;; Get addressibility to MSGSERV CLASS 1 (EXTENDED Errors) - 36072 ;;AN000;; - 36073 0000555B 8C06[9698] mov [$M_RT+$M_RES_ADDRS.$M_EXT_ERR_ADDRS+2],es - 36074 ;mov [$M_RT+2],es ;;AN000;; Move into first avaliable table location - 36075 0000555F 893E[9498] mov [$M_RT+$M_RES_ADDRS.$M_EXT_ERR_ADDRS],di - 36076 ;mov [$M_RT+0],di ;;AN000;; - 36077 00005563 8C06[B298] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_ADDRS+2],es - 36078 ;mov [$M_RT+30],es ;;AN000;; Move into first avaliable table location - 36079 00005567 893E[B098] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_ADDRS],di - 36080 ;mov [$M_RT+28],di ;;AN000;; - 36081 - 36082 0000556B E8603A call $M_MSGSERV_2 ;;AN000;; Get addressibility to MSGSERV CLASS 2 (PARSE Errors) - 36083 - 36084 0000556E 8C06[AA98] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_ADDRS+2],es - 36085 ;mov [$M_RT+22],es ;;AN000;; Move into first avaliable table location - 36086 00005572 893E[A898] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_ADDRS],di - 36087 ;mov [$M_RT+20],di ;;AN000;; - 36088 - 36089 00005576 B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface - 36090 00005579 B208 mov dl,8 ; DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM - 36091 0000557B CD2F int 2Fh ;;AN001;; Private interface - 36092 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES - 36093 ; DL = subfunction - get ??? error table - 36094 ; ES:DI -> error table - 36095 - 36096 0000557D 8C06[BE98] mov [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR+2],es - 36097 ;mov [$M_RT+42],es ;;AN001;; Move into first avaliable table location - 36098 00005581 893E[BC98] mov [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR],di - 36099 ;mov [$M_RT+40],di ;;AN001;; - 36100 - 36101 ;M016; M020 - 36102 ; Reinitialize the CR-LF string. Also, reinit the buffer terminator just to - 36103 ;be safe. Initialize $M_MSG_NUM and $M_DIVISOR also. - 36104 - 36105 00005585 C706[D798]0D0A mov word [$M_RT+$M_RES_ADDRS.$M_CRLF],0A0Dh - 36106 ;mov word [$M_RT+67],0A0Dh ; Reinit CR-LF ;M016 - 36107 0000558B C606[2099]24 mov byte [$M_RT+$M_RES_ADDRS.$M_BUF_TERM],'$' - 36108 ;mov word [$M_RT+140],'$' ; Reinit buffer end;M016 - 36109 00005590 C706[DC98]0000 mov word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL - 36110 ;mov word [$M_RT+72],0 ; M020 - 36111 00005596 C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 36112 ;mov word [$M_RT+74],10 ; M020 - 36113 - 36114 ; 07/04/2023 - Retro DOS v4.0 COMMAND.COM - 36115 ; -------------------------- - 36116 ; MSDOS 6.0 SYSMSG.INC, 1991 - 36117 ; -------------------------- - 36118 ; MSDOS 5.0 COMMAND.COM - TRANGROUP5192h - 36119 - 36120 ;$M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes - 36121 0000559C E8AE39 call $M_CLS_3 ; Get addressibility to class F - 36122 0000559F 893E[C098] mov [$M_RT+$M_RES_ADDRS.$M_CLASS_ADDRS],di - 36123 ;mov [$M_RT+44],di - 36124 - 36125 000055A3 E80600 CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector - 36126 - 36127 ; 15/04/2023 - 36128 ;clc ;;AN000;; Make sure carry is clear - 36129 ;jc short $MIF20 - 36130 - 36131 000055A6 5F pop di ;;AN000;; Restore REGS - 36132 000055A7 07 pop es ;;AN000;; - 36133 000055A8 5A pop dx ;;AN000;; - 36134 000055A9 5B pop bx ;;AN000;; - 36135 000055AA 58 pop ax ;;AN000;; - 36136 ;jmp short $MEN20 - 36137 ; 15/04/2023 - 36138 000055AB C3 retn - 36139 + 36012 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36013 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:58CBh + 36014 + 36015 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36016 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5757h + 36017 SYSLOADMSG: + 36018 00005511 50 push ax ;;AN000; + 36019 00005512 53 push bx ;;AN000; + 36020 00005513 52 push dx ;;AN000; + 36021 00005514 06 push es ;;AN000; + 36022 00005515 57 push di ;;AN000; + 36023 00005516 31C9 xor cx,cx ;;AN000; Reset to zero + 36024 00005518 8EC1 mov es,cx ;;AN000; + 36025 0000551A 31FF xor di,di ;;AN000; + 36026 0000551C B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface + 36027 0000551F B200 mov dl,0 ; DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM + 36028 00005521 CD2F int 2Fh ;;AN000;; Private interface + 36029 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES + 36030 ; DL = subfunction - get standard DOS error table (errors 00h-12h,50h-5Bh) + 36031 ; Return: ES:DI -> error table + 36032 + 36033 00005523 8C06[9E98] mov [$M_RT+$M_RES_ADDRS.$M_EXT_COMMAND+2],es + 36034 ;mov [$M_RT+10],es ;;AN000;; Move into first avaliable table location + 36035 00005527 893E[9C98] mov [$M_RT+$M_RES_ADDRS.$M_EXT_COMMAND],di + 36036 ;mov [$M_RT+8],di ;;AN000;; + 36037 + 36038 0000552B B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface + 36039 0000552E B202 mov dl,2 ; DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM + 36040 00005530 CD2F int 2Fh ;;AN000;; Private interface + 36041 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES + 36042 ; DL = subfunction - get critical/SHARE error table (errors 13h-2Bh) + 36043 ; ES:DI -> error table + 36044 + 36045 00005532 8C06[A698] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_COMMAND+2],es + 36046 ;mov [$M_RT+18],es ;;AN000;; Move into first avaliable table location + 36047 00005536 893E[A498] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_COMMAND],di + 36048 ;mov [$M_RT+16],di ;;AN000;; + 36049 + 36050 0000553A B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface + 36051 0000553D B204 mov dl,4 ; DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM + 36052 0000553F CD2F int 2Fh ;;AN000;; Private interface + 36053 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES + 36054 ; DL = subfunction - get ??? error table + 36055 ; ES:DI -> error table + 36056 + 36057 00005541 8C06[B698] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_COMMAND+2],es + 36058 ;mov [$M_RT+34],es ;;AN000;; Move into first avaliable table location + 36059 00005545 893E[B498] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_COMMAND],di + 36060 ;mov [$M_RT+32],di ;;AN000;; + 36061 + 36062 00005549 B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface + 36063 0000554C B206 mov dl,6 ; DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE + 36064 0000554E CD2F int 2Fh ;;AN001;; Private interface + 36065 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES + 36066 ; DL = subfunction - get ??? error table + 36067 ; ES:DI -> error table + 36068 + 36069 00005550 8C06[9A98] mov [$M_RT+$M_RES_ADDRS.$M_EXT_FILE+2],es + 36070 ;mov [$M_RT+6],es ;;AN001;; Move into first avaliable table location + 36071 00005554 893E[9898] mov [$M_RT+$M_RES_ADDRS.$M_EXT_FILE],di + 36072 ;mov [$M_RT+4],di ;;AN001;; + 36073 + 36074 00005558 E8553A call $M_MSGSERV_1 ;;AN000;; Get addressibility to MSGSERV CLASS 1 (EXTENDED Errors) + 36075 ;;AN000;; + 36076 0000555B 8C06[9698] mov [$M_RT+$M_RES_ADDRS.$M_EXT_ERR_ADDRS+2],es + 36077 ;mov [$M_RT+2],es ;;AN000;; Move into first avaliable table location + 36078 0000555F 893E[9498] mov [$M_RT+$M_RES_ADDRS.$M_EXT_ERR_ADDRS],di + 36079 ;mov [$M_RT+0],di ;;AN000;; + 36080 00005563 8C06[B298] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_ADDRS+2],es + 36081 ;mov [$M_RT+30],es ;;AN000;; Move into first avaliable table location + 36082 00005567 893E[B098] mov [$M_RT+$M_RES_ADDRS.$M_CRIT_ADDRS],di + 36083 ;mov [$M_RT+28],di ;;AN000;; + 36084 + 36085 0000556B E8603A call $M_MSGSERV_2 ;;AN000;; Get addressibility to MSGSERV CLASS 2 (PARSE Errors) + 36086 + 36087 0000556E 8C06[AA98] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_ADDRS+2],es + 36088 ;mov [$M_RT+22],es ;;AN000;; Move into first avaliable table location + 36089 00005572 893E[A898] mov [$M_RT+$M_RES_ADDRS.$M_PARSE_ADDRS],di + 36090 ;mov [$M_RT+20],di ;;AN000;; + 36091 + 36092 00005576 B82E12 mov ax,122Eh ; DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface + 36093 00005579 B208 mov dl,8 ; DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM + 36094 0000557B CD2F int 2Fh ;;AN001;; Private interface + 36095 ; Multiplex - DOS 3+ internal - GET OR SET ERROR TABLE ADDRESSES + 36096 ; DL = subfunction - get ??? error table + 36097 ; ES:DI -> error table + 36098 + 36099 0000557D 8C06[BE98] mov [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR+2],es + 36100 ;mov [$M_RT+42],es ;;AN001;; Move into first avaliable table location + 36101 00005581 893E[BC98] mov [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR],di + 36102 ;mov [$M_RT+40],di ;;AN001;; + 36103 + 36104 ;M016; M020 + 36105 ; Reinitialize the CR-LF string. Also, reinit the buffer terminator just to + 36106 ;be safe. Initialize $M_MSG_NUM and $M_DIVISOR also. + 36107 + 36108 00005585 C706[D798]0D0A mov word [$M_RT+$M_RES_ADDRS.$M_CRLF],0A0Dh + 36109 ;mov word [$M_RT+67],0A0Dh ; Reinit CR-LF ;M016 + 36110 0000558B C606[2099]24 mov byte [$M_RT+$M_RES_ADDRS.$M_BUF_TERM],'$' + 36111 ;mov word [$M_RT+140],'$' ; Reinit buffer end;M016 + 36112 00005590 C706[DC98]0000 mov word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL + 36113 ;mov word [$M_RT+72],0 ; M020 + 36114 00005596 C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 36115 ;mov word [$M_RT+74],10 ; M020 + 36116 + 36117 ; 07/04/2023 - Retro DOS v4.0 COMMAND.COM + 36118 ; -------------------------- + 36119 ; MSDOS 6.0 SYSMSG.INC, 1991 + 36120 ; -------------------------- + 36121 ; MSDOS 5.0 COMMAND.COM - TRANGROUP5192h + 36122 + 36123 ;$M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes + 36124 0000559C E8AE39 call $M_CLS_3 ; Get addressibility to class F + 36125 0000559F 893E[C098] mov [$M_RT+$M_RES_ADDRS.$M_CLASS_ADDRS],di + 36126 ;mov [$M_RT+44],di + 36127 + 36128 000055A3 E80600 CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector + 36129 + 36130 ; 15/04/2023 + 36131 ;clc ;;AN000;; Make sure carry is clear + 36132 ;jc short $MIF20 + 36133 + 36134 000055A6 5F pop di ;;AN000;; Restore REGS + 36135 000055A7 07 pop es ;;AN000;; + 36136 000055A8 5A pop dx ;;AN000;; + 36137 000055A9 5B pop bx ;;AN000;; + 36138 000055AA 58 pop ax ;;AN000;; + 36139 ;jmp short $MEN20 36140 ; 15/04/2023 - 36141 ;$MIF20: - 36142 ;add sp,10 ;;AN000;; - 36143 ;stc ;;AN000;; Reset carry flag - 36144 ;$MEN20: - 36145 ;retn ;;AN000;; - 36146 - 36147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36148 ;; - 36149 ;; Proc Name: $M_GET_DBCS_VEC - 36150 ;; - 36151 ;; Function: Get the DBCS vector and save it for later use - 36152 ;; - 36153 ;; Inputs: None - 36154 ;; - 36155 ;; Outputs: None - 36156 ;; - 36157 ;; Regs Changed: - 36158 ;; - 36159 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36160 - 36161 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36162 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36163 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36164 $M_GET_DBCS_VEC: - 36165 000055AC 50 push ax ;;AN000;; Save character to check - 36166 000055AD 56 push si ;;AN000;; - 36167 000055AE 1E push ds ;;AN000;; - 36168 000055AF B80063 mov ax,6300h ;DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment - 36169 000055B2 CD21 int 21h ;;AN000;; Get environment pointer - 36170 000055B4 1E push ds ;;AN000;; Get environment pointer - 36171 000055B5 07 pop es ;;AN000;; Get environment pointer - 36172 000055B6 1F pop ds ;;AN000;; Get environment pointer - 36173 000055B7 7208 jc short $MIF23 - 36174 - 36175 000055B9 8936[D098] mov word [$M_RT+$M_RES_ADDRS.$M_DBCS_VEC],si - 36176 ;mov word [$M_RT+60],si ;;AN000;; Save DBCS Vector - 36177 000055BD 8C06[D298] mov word [$M_RT+$M_RES_ADDRS.$M_DBCS_VEC+2],es - 36178 ;mov word [$M_RT+62],es ;;AN000;; - 36179 $MIF23: - 36180 000055C1 5E pop si ;;AN000;; - 36181 000055C2 58 pop ax ;;AN000;; Retrieve character to check - 36182 000055C3 C3 retn ;;AN000;; Return - 36183 - 36184 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36185 ;; - 36186 ;; Proc Name: SYSGETMSG - 36187 ;; - 36188 ;; Function: The GET service returns the segment, offset and size of the - 36189 ;; message text to the caller based on a message number. - 36190 ;; The GET function will not display the message thus assumes - 36191 ;; caller will handle replaceable parameters. - 36192 ;; - 36193 ;; Inputs: - 36194 ;; - 36195 ;; Outputs: - 36196 ;; - 36197 ;; Psuedocode: - 36198 ;; Call $M_GET_MSG_ADDRESS - 36199 ;; IF MSG_NUM exists THEN - 36200 ;; Set DS:SI = MSG_TXT_PTR + 1 - 36201 ;; CARRY_FLAG = 0 - 36202 ;; ELSE - 36203 ;; CARRY_FLAG = 1 - 36204 ;; ENDIF - 36205 ;; - 36206 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36207 - 36208 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36209 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36210 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36211 - 36212 utility_msg_class equ 0FFh ; 18/04/2023 - 36213 - 36214 SYSGETMSG: - 36215 ;; Save registers needed later - 36216 000055C4 50 push ax ;;AN000;; Save changed regs - 36217 000055C5 06 push es ;;AN000;; - 36218 000055C6 57 push di ;;AN000;; - 36219 000055C7 55 push bp ;;AN000;; - 36220 - 36221 000055C8 E81400 call $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message - 36222 000055CB 720D jc short $MIF31 - 36223 - 36224 000055CD 80FEFF cmp dh,utility_msg_class ; 0FFh ;;AN000;; Were utility messages requested? - 36225 ;clc ;;AN000;; - 36226 000055D0 7404 je short $MIF32 ;;AN000;; - 36227 ; 15/06/2023 - 36228 000055D2 F8 clc - 36229 - 36230 000055D3 06 push es ;;AN000;; - 36231 ;pop ds ;;AN000;; - 36232 000055D4 EB01 jmp short $MEN32 - 36233 $MIF32: - 36234 000055D6 0E push cs ;;AN000;; - 36235 ;pop ds ;;AN000;; - 36236 $MEN32: - 36237 ; 07/04/2023 - 36238 000055D7 1F pop ds - 36239 000055D8 89FE mov si,di ;;AN000;; Return message in DS:SI - 36240 $MIF31: - 36241 000055DA 5D pop bp ;;AN000;; Restore changed regs - 36242 000055DB 5F pop di ;;AN000;; - 36243 000055DC 07 pop es ;;AN000;; - 36244 000055DD 58 pop ax ;;AN000;; - 36245 000055DE C3 retn ;;AN000;; Return - 36246 - 36247 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36248 ;; - 36249 ;; PROC NAME: $M_GET_MSG_ADDRESS - 36250 ;; - 36251 ;; FUNCTION: To scan thru classes to return pointer to the message header - 36252 ;; INPUTS: Access to $M_RES_ADDRESSES - 36253 ;; OUTPUTS: IF CX = 0 THEN Message was not found - 36254 ;; IF CX > 1 THEN ES:DI points to the specified message - 36255 ;; REGS CHANGED: ES,DI,CX - 36256 ;; - 36257 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36258 - 36259 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36260 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36261 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36262 $M_GET_MSG_ADDRESS: - 36263 000055DF 56 push si ;;AN000;; - 36264 000055E0 53 push bx ;;AN000;; - 36265 000055E1 31F6 xor si,si ;;AN000;; Use SI as an index - 36266 000055E3 31C9 xor cx,cx ;;AN000;; Use CX as an size - 36267 $MDO36: - 36268 000055E5 80FEFF cmp dh,utility_msg_class ; -1 ;;AN000;; Were utility messages requested? - 36269 000055E8 7508 jne short $MIF37 ;;AN000;; No - 36270 - 36271 ; 07/04/2023 - 36272 ;;mov di,[si+89CAh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) - 36273 000055EA 8BBC[C098] mov di,[si+$M_RT+$M_RES_ADDRS.$M_CLASS_ADDRS] - 36274 ;mov di,[si+$M_RT+44] ;;AN000;; Get address of class - 36275 000055EE 89FB mov bx,di ;;AN000;; - 36276 000055F0 EB21 jmp short $MEN37 - 36277 $MIF37: - 36278 000055F2 F6C602 test dh,2 ; parse_err_class ;;AN000;; Were parse errors requested? - 36279 000055F5 7406 jz short $MIF39 - 36280 - 36281 ; 07/04/2023 - 36282 ;;les di,[si+89AEh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) - 36283 000055F7 C4BC[A498] les di,[si+$M_RT+$M_RES_ADDRS.$M_PARSE_COMMAND] - 36284 ;les di,[si+$M_RT+16] ;;AN000;; Get address of class - 36285 - 36286 ; 07/04/2023 - 36287 ;mov bx,es ; * ;;AN000;; - 36288 000055FB EB14 jmp short $MEN39 - 36289 $MIF39: - 36290 000055FD 83F813 cmp ax,19 ; $M_CRIT_LO ;;AN000;; Is this a critical error? - 36291 00005600 720B jnae short $MIF41 ; jb short $MIF41 ;;AN000;; - 36292 - 36293 00005602 83F827 cmp ax,39 ; $M_CRIT_HI ;;AN000;; - 36294 00005605 7706 jnbe short $MIF41 ; ja short $MIF41 ;;AN000;; + 36141 000055AB C3 retn + 36142 + 36143 ; 15/04/2023 + 36144 ;$MIF20: + 36145 ;add sp,10 ;;AN000;; + 36146 ;stc ;;AN000;; Reset carry flag + 36147 ;$MEN20: + 36148 ;retn ;;AN000;; + 36149 + 36150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36151 ;; + 36152 ;; Proc Name: $M_GET_DBCS_VEC + 36153 ;; + 36154 ;; Function: Get the DBCS vector and save it for later use + 36155 ;; + 36156 ;; Inputs: None + 36157 ;; + 36158 ;; Outputs: None + 36159 ;; + 36160 ;; Regs Changed: + 36161 ;; + 36162 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36163 + 36164 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36165 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36166 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36167 $M_GET_DBCS_VEC: + 36168 000055AC 50 push ax ;;AN000;; Save character to check + 36169 000055AD 56 push si ;;AN000;; + 36170 000055AE 1E push ds ;;AN000;; + 36171 000055AF B80063 mov ax,6300h ;DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment + 36172 000055B2 CD21 int 21h ;;AN000;; Get environment pointer + 36173 000055B4 1E push ds ;;AN000;; Get environment pointer + 36174 000055B5 07 pop es ;;AN000;; Get environment pointer + 36175 000055B6 1F pop ds ;;AN000;; Get environment pointer + 36176 000055B7 7208 jc short $MIF23 + 36177 + 36178 000055B9 8936[D098] mov word [$M_RT+$M_RES_ADDRS.$M_DBCS_VEC],si + 36179 ;mov word [$M_RT+60],si ;;AN000;; Save DBCS Vector + 36180 000055BD 8C06[D298] mov word [$M_RT+$M_RES_ADDRS.$M_DBCS_VEC+2],es + 36181 ;mov word [$M_RT+62],es ;;AN000;; + 36182 $MIF23: + 36183 000055C1 5E pop si ;;AN000;; + 36184 000055C2 58 pop ax ;;AN000;; Retrieve character to check + 36185 000055C3 C3 retn ;;AN000;; Return + 36186 + 36187 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36188 ;; + 36189 ;; Proc Name: SYSGETMSG + 36190 ;; + 36191 ;; Function: The GET service returns the segment, offset and size of the + 36192 ;; message text to the caller based on a message number. + 36193 ;; The GET function will not display the message thus assumes + 36194 ;; caller will handle replaceable parameters. + 36195 ;; + 36196 ;; Inputs: + 36197 ;; + 36198 ;; Outputs: + 36199 ;; + 36200 ;; Psuedocode: + 36201 ;; Call $M_GET_MSG_ADDRESS + 36202 ;; IF MSG_NUM exists THEN + 36203 ;; Set DS:SI = MSG_TXT_PTR + 1 + 36204 ;; CARRY_FLAG = 0 + 36205 ;; ELSE + 36206 ;; CARRY_FLAG = 1 + 36207 ;; ENDIF + 36208 ;; + 36209 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36210 + 36211 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36212 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36213 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36214 + 36215 utility_msg_class equ 0FFh ; 18/04/2023 + 36216 + 36217 SYSGETMSG: + 36218 ;; Save registers needed later + 36219 000055C4 50 push ax ;;AN000;; Save changed regs + 36220 000055C5 06 push es ;;AN000;; + 36221 000055C6 57 push di ;;AN000;; + 36222 000055C7 55 push bp ;;AN000;; + 36223 + 36224 000055C8 E81400 call $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message + 36225 000055CB 720D jc short $MIF31 + 36226 + 36227 000055CD 80FEFF cmp dh,utility_msg_class ; 0FFh ;;AN000;; Were utility messages requested? + 36228 ;clc ;;AN000;; + 36229 000055D0 7404 je short $MIF32 ;;AN000;; + 36230 ; 15/06/2023 + 36231 000055D2 F8 clc + 36232 + 36233 000055D3 06 push es ;;AN000;; + 36234 ;pop ds ;;AN000;; + 36235 000055D4 EB01 jmp short $MEN32 + 36236 $MIF32: + 36237 000055D6 0E push cs ;;AN000;; + 36238 ;pop ds ;;AN000;; + 36239 $MEN32: + 36240 ; 07/04/2023 + 36241 000055D7 1F pop ds + 36242 000055D8 89FE mov si,di ;;AN000;; Return message in DS:SI + 36243 $MIF31: + 36244 000055DA 5D pop bp ;;AN000;; Restore changed regs + 36245 000055DB 5F pop di ;;AN000;; + 36246 000055DC 07 pop es ;;AN000;; + 36247 000055DD 58 pop ax ;;AN000;; + 36248 000055DE C3 retn ;;AN000;; Return + 36249 + 36250 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36251 ;; + 36252 ;; PROC NAME: $M_GET_MSG_ADDRESS + 36253 ;; + 36254 ;; FUNCTION: To scan thru classes to return pointer to the message header + 36255 ;; INPUTS: Access to $M_RES_ADDRESSES + 36256 ;; OUTPUTS: IF CX = 0 THEN Message was not found + 36257 ;; IF CX > 1 THEN ES:DI points to the specified message + 36258 ;; REGS CHANGED: ES,DI,CX + 36259 ;; + 36260 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36261 + 36262 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36263 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36264 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36265 $M_GET_MSG_ADDRESS: + 36266 000055DF 56 push si ;;AN000;; + 36267 000055E0 53 push bx ;;AN000;; + 36268 000055E1 31F6 xor si,si ;;AN000;; Use SI as an index + 36269 000055E3 31C9 xor cx,cx ;;AN000;; Use CX as an size + 36270 $MDO36: + 36271 000055E5 80FEFF cmp dh,utility_msg_class ; -1 ;;AN000;; Were utility messages requested? + 36272 000055E8 7508 jne short $MIF37 ;;AN000;; No + 36273 + 36274 ; 07/04/2023 + 36275 ;;mov di,[si+89CAh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) + 36276 000055EA 8BBC[C098] mov di,[si+$M_RT+$M_RES_ADDRS.$M_CLASS_ADDRS] + 36277 ;mov di,[si+$M_RT+44] ;;AN000;; Get address of class + 36278 000055EE 89FB mov bx,di ;;AN000;; + 36279 000055F0 EB21 jmp short $MEN37 + 36280 $MIF37: + 36281 000055F2 F6C602 test dh,2 ; parse_err_class ;;AN000;; Were parse errors requested? + 36282 000055F5 7406 jz short $MIF39 + 36283 + 36284 ; 07/04/2023 + 36285 ;;les di,[si+89AEh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) + 36286 000055F7 C4BC[A498] les di,[si+$M_RT+$M_RES_ADDRS.$M_PARSE_COMMAND] + 36287 ;les di,[si+$M_RT+16] ;;AN000;; Get address of class + 36288 + 36289 ; 07/04/2023 + 36290 ;mov bx,es ; * ;;AN000;; + 36291 000055FB EB14 jmp short $MEN39 + 36292 $MIF39: + 36293 000055FD 83F813 cmp ax,19 ; $M_CRIT_LO ;;AN000;; Is this a critical error? + 36294 00005600 720B jnae short $MIF41 ; jb short $MIF41 ;;AN000;; 36295 - 36296 ; 07/04/2023 - 36297 ;;les di,[si+89BAh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) - 36298 00005607 C4BC[B098] les di,[si+$M_RT+$M_RES_ADDRS.$M_CRIT_ADDRS] - 36299 ;les di,[si+$M_RT+28] ;;AN000;; Get address of class - 36300 - 36301 ; 07/04/2023 - 36302 ;mov bx,es ; * ;;AN000;; - 36303 0000560B EB04 jmp short $MEN41 - 36304 $MIF41: - 36305 ; 07/04/2023 - 36306 ;;les di,[si+899Eh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) - 36307 0000560D C4BC[9498] les di,[si+$M_RT+$M_RES_ADDRS.$M_EXT_ERR_ADDRS] - 36308 ;les di,[si+$M_RT+0] ;;AN000;; Get address of class - 36309 - 36310 ; 07/04/2023 - 36311 ;mov bx,es ; * ;;AN000;; - 36312 $MEN41: - 36313 $MEN39: - 36314 ; 07/04/2023 - 36315 00005611 8CC3 mov bx,es ; * - 36316 $MEN37: ;;AN000;; - 36317 00005613 83FBFF cmp bx,-1 ; $M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? - 36318 00005616 7515 jne short $MIF46 ;;AN000;; No - 36319 - 36320 00005618 80FEFF cmp dh,utility_msg_class ; -1 ;;AN000;; Was it a UTILITY class? - 36321 0000561B 7503 jne short $MIF47 ;;AN000;; No - 36322 0000561D F9 stc ; **- ;;AN000;; Set the carry flag - 36323 ; 07/04/2023 - 36324 ;jmp short $MEN47 ; **- - 36325 0000561E EB1B jmp short $MEN36 ; **- - 36326 $MIF47: - 36327 00005620 A3[DC98] mov [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],ax - 36328 ;mov [$M_RT+72],ax ;;AN000;; Save message number - 36329 00005623 B8FFFF mov ax,0FFFFh ; $M_SPECIAL_MSG_NUM ;;AN000;; Set special message number - 36330 00005626 BD0100 mov bp,1 ; $M_ONE_REPLACE ;;AN000;; Set one replace in message - 36331 00005629 31F6 xor si,si ;;AN000;; Reset the SI index to start again - 36332 ; 28/04/2023 - 36333 ; 07/04/2023 - 36334 ;clc ; **+ ;;AN000;; - 36335 ;$MEN47: - 36336 ;jmp short $MEN46 ; *** - 36337 0000562B EB0A jmp short $MEN47 ; *** - 36338 $MIF46: - 36339 ;cmp bx,0 ; $M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? - 36340 0000562D 21DB and bx,bx ; 0 ? - 36341 0000562F 7403 jz short $MIF51 ;;AN000;; No - 36342 - 36343 00005631 E84D00 call $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message - 36344 $MIF51: - 36345 00005634 83C604 add si,4 ; $M_ADDR_SZ_FAR ;;AN000;; Get next class - 36346 ; 07/04/2023 - 36347 ;clc ;;AN000;; - 36348 ;$MEN46: - 36349 ;jc short $MEN36 ; **- ; **+ ;;AN000;; - 36350 $MEN47: ; 07/04/2023 ; **+ - 36351 00005637 09C9 or cx,cx ;;AN000;; Was the message found? - 36352 ;jnz short $MXL2 ;;AN000;; Yes - 36353 ;jmp short $MDO36 - 36354 ; 07/04/2023 - 36355 00005639 74AA jz short $MDO36 - 36356 $MXL2: - 36357 $MEN36: - 36358 0000563B 9C pushf ;;AN006;; Save the flag state - 36359 - 36360 0000563C 80FE01 cmp dh,1 ; EXT_ERR_CLASS ;;AN006;; Was an extended error requested? - 36361 ;jne short $MIF56 ;;AN006;; No - 36362 ; 28/04/2023 - 36363 0000563F 752A jne short $M_MYRET - 36364 - 36365 00005641 52 push dx ;;AN006;; Save all needed registers - 36366 00005642 55 push bp ;;AN006;; - 36367 00005643 51 push cx ;;AN006;; - 36368 00005644 06 push es ;;AN006;; - 36369 00005645 57 push di ;;AN006;; - 36370 00005646 50 push ax ;;AN006;; - 36371 - 36372 00005647 B80005 mov ax,500h ; IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed - 36373 0000564A CD2F int 2Fh ;;AN006;; - 36374 ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - INSTALLATION CHECK - 36375 ; Return: AL = 00h not installed, OK to install - 36376 ; 01h not installed, can't install - 36377 ; FFh installed - 36378 - 36379 0000564C 3CFF cmp al,0FFh ; IFSFUNC_INSTALLED ;;AN006;; Is it installed? - 36380 0000564E 58 pop ax ;;AN006;; Restore msg number - 36381 0000564F 7513 jne short $MIF57 ;;AN006;; No (not installed) - 36382 - 36383 00005651 89C3 mov bx,ax ;;AN006;; BX is the extended error number - 36384 00005653 B80205 mov ax,502h ; IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number - 36385 00005656 CD2F int 2Fh ;;AN006;; Call IFSFUNC - 36386 ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - 36387 - 36388 ;jmp short $MEN57 ;;AN006;; - 36389 ; 28/04/2023 - 36390 00005658 720B jc short $MEN57 - 36391 $MIF60: - 36392 0000565A 83C406 add sp,6 ;;AN006;; Throw away old pointer - 36393 0000565D E81200 call $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string - 36394 $MEN60: - 36395 00005660 5D pop bp ;;AN006;; Restore other Regs - 36396 00005661 5A pop dx ;;AN006;; - 36397 $MIF56: - 36398 ; 07/04/2023 - 36399 ;$M_POPF ; macro in 'sysmsg.inc' (MSDOS 6.0) - 36400 00005662 EB07 jmp short $M_MYRET ;;AN006;; Restore the flag state - 36401 - 36402 $MIF57: - 36403 00005664 F9 stc ;;AN006;; Carry conditon - 36404 $MEN57: - 36405 ; 28/04/2023 - 36406 ;jnc short $MIF60 ;;AN006;; - 36407 - 36408 00005665 5F pop di ;;AN006;; - 36409 00005666 07 pop es ;;AN006;; Restore old pointer - 36410 00005667 59 pop cx ;;AN006;; - 36411 00005668 EBF6 jmp short $MEN60 - 36412 - 36413 ;$MIF60: - 36414 ; add sp,6 ;;AN006;; Throw away old pointer - 36415 ; call $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string - 36416 ;$MEN60: - 36417 ; pop bp ;;AN006;; Restore other Regs - 36418 ; pop dx ;;AN006;; - 36419 ;$MIF56: - 36420 ; ; 07/04/2023 - 36421 ; ;$M_POPF ; macro in 'sysmsg.inc' (MSDOS 6.0) - 36422 ; jmp short $M_MYRET ;;AN006;; Restore the flag state - 36423 - 36424 ; 07/04/2023 - 36425 ; --------------------------- - 36426 ; MSDOS 6.0, SYSMSG.INC, 1991 - 36427 ; --------------------------- - 36428 ; $M_POPF macro - 36429 ;jmp short $+3 - 36430 m_popf_iret: - 36431 0000566A CF iret - 36432 $M_MYRET: - 36433 0000566B 0E push cs - 36434 0000566C E8FBFF call m_popf_iret - 36435 ;;; end macro - 36436 ; --------------------------- - 36437 - 36438 0000566F 5B pop bx ;;AN000;; - 36439 00005670 5E pop si ;;AN000;; - 36440 00005671 C3 retn ;;AN000;; Return ES:DI pointing to the message - 36441 - 36442 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36443 - 36444 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36445 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36446 $M_SET_LEN_IN_CX: - 36447 00005672 57 push di ;;AN006;; Save position - 36448 00005673 50 push ax ;;AN006;; - 36449 00005674 B9FFFF mov cx,-1 ; 65535 ; 0FFFFh ;;AN006;; Set CX for decrements - 36450 00005677 30C0 xor al,al ;;AN006;; Prepare compare register - 36451 00005679 F2AE repne scasb ;;AN006;; Scan for zero - 36452 0000567B F7D1 not cx ;;AN006;; Change decrement into number - 36453 0000567D 49 dec cx ;;AN006;; Don't include the zero - 36454 0000567E 58 pop ax ;;AN006;; - 36455 0000567F 5F pop di ;;AN006;; Restore position - 36456 00005680 C3 retn ;;AN006;; - 36457 - 36458 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36459 ;; - 36460 ;; PROC NAME: $M_FIND_SPECIFIED_MSG - 36461 ;; - 36462 ;; FUNCTION: To scan thru message headers until message is found - 36463 ;; INPUTS: ES:DI points to beginning of msg headers - 36464 ;; CX contains the number of messages in class - 36465 ;; DH contains the message class - 36466 ;; OUPUTS: IF CX = 0 THEN Message was not found - 36467 ;; IF CX > 1 THEN ES:DI points to header of specified message - 36468 ;; - 36469 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36470 - 36471 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36472 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36473 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36474 $M_FIND_SPECIFIED_MSG: - 36475 00005681 83FB01 cmp bx,1 ;;AN004;; Do we have an address to CALL? - 36476 00005684 751F jne short $MIF64 - 36477 00005686 833E[BC98]FF cmp word [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR],-1 - 36478 ;cmp word [$M_RT+40],-1 ; 0FFFFh ;;AN004;; Do we have an address to CALL? - 36479 ; 15/06/2023 - 36480 0000568B 7418 je short $MIF64 - 36481 - 36482 0000568D 83F8FF cmp ax,0FFFFh ; $M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? - 36483 00005690 750B jne short $MIF65 - 36484 - 36485 00005692 50 push ax ;;AN004;; Reset the special message number - 36486 00005693 A1[DC98] mov ax,[$M_RT+$M_RES_ADDRS.$M_MSG_NUM] - 36487 ;mov ax,[$M_RT+72] ;;AN004;; Get the old message number - 36488 00005696 FF1E[BC98] call far [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR] - 36489 ;;AN004;; Call the READ_DISK_PROC to get error text - 36490 0000569A 58 pop ax ;;AN004;; Reset the special message number - 36491 ; 28/04/2023 - 36492 0000569B EB04 jmp short $MEN65 - 36493 ; 18/04/2023 - 36494 ;jmp short $MEN64 - 36495 $MIF65: - 36496 0000569D FF1E[BC98] call far [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR] - 36497 ;;AN004;; Call the READ_DISK_PROC to get error text - 36498 $MEN65: - 36499 ; 28/04/2023 - 36500 000056A1 7344 jnc short $MIF75 - 36501 ; - 36502 000056A3 EB19 jmp short $MEN64 ; $MDO76 ;;AN004;; - 36503 $MIF64: - 36504 000056A5 31C9 xor cx,cx ;;AN002;; CX = 0 will allow us to - 36505 000056A7 80FEFF cmp dh,utility_msg_class ; -1 ;;AN001;; - 36506 000056AA 7406 je short $MIF69 - 36507 - 36508 000056AC 268A4D03 mov cl,[es:di+$M_CLASS_ID.$M_NUM_CLS_MSG] - 36509 ;mov cl,[es:di+3] ;;AN001;; Get number of messages in class - 36510 000056B0 EB09 jmp short $MEN69 - 36511 $MIF69: - 36512 ;cmp [cs:di+$M_CLASS_ID.$M_CLS_ID],dh - 36513 ;cmp [cs:di+0],dh - 36514 000056B2 2E3835 cmp [cs:di],dh ;;AN002;; Check if class still exists at - 36515 000056B5 7504 jne short $MIF71 - 36516 - 36517 000056B7 2E8A4D03 mov cl,[cs:di+$M_CLASS_ID.$M_NUM_CLS_MSG] - 36518 ;mov cl,[cs:di+3] ;;AN000;; Get number of messages in class - 36519 $MIF71: ;;AN001;; - 36520 $MEN69: - 36521 000056BB 83C704 add di,$M_CLASS_ID_SZ ; add di,4 ;;AN000;; Point past the class header - 36522 ; 02/05/2023 - 36523 ;stc ;;AN004;; Flag that we haven't found anything yet - 36524 $MEN64: - 36525 ;jnc short $MIF75 - 36526 ; 28/04/2023 - 36527 ; (or instruction clears carry flag) - 36528 ;clc ;;AN004;; No, reset carry - 36529 $MDO76: - 36530 000056BE 09C9 or cx,cx ;;AN000;; Do we have any to check? - 36531 000056C0 7417 jz short $MEN76 - 36532 - 36533 000056C2 80FEFF cmp dh,utility_msg_class ; -1 ;;AN001;; - 36534 000056C5 7405 je short $MIF78 + 36296 00005602 83F827 cmp ax,39 ; $M_CRIT_HI ;;AN000;; + 36297 00005605 7706 jnbe short $MIF41 ; ja short $MIF41 ;;AN000;; + 36298 + 36299 ; 07/04/2023 + 36300 ;;les di,[si+89BAh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) + 36301 00005607 C4BC[B098] les di,[si+$M_RT+$M_RES_ADDRS.$M_CRIT_ADDRS] + 36302 ;les di,[si+$M_RT+28] ;;AN000;; Get address of class + 36303 + 36304 ; 07/04/2023 + 36305 ;mov bx,es ; * ;;AN000;; + 36306 0000560B EB04 jmp short $MEN41 + 36307 $MIF41: + 36308 ; 07/04/2023 + 36309 ;;les di,[si+899Eh] ; MSDOS 5.0 COMMAND.COM ($M_RT at offset 899Eh) + 36310 0000560D C4BC[9498] les di,[si+$M_RT+$M_RES_ADDRS.$M_EXT_ERR_ADDRS] + 36311 ;les di,[si+$M_RT+0] ;;AN000;; Get address of class + 36312 + 36313 ; 07/04/2023 + 36314 ;mov bx,es ; * ;;AN000;; + 36315 $MEN41: + 36316 $MEN39: + 36317 ; 07/04/2023 + 36318 00005611 8CC3 mov bx,es ; * + 36319 $MEN37: ;;AN000;; + 36320 00005613 83FBFF cmp bx,-1 ; $M_TERMINATING_FLAG ;;AN000;; Are we finished all classes? + 36321 00005616 7515 jne short $MIF46 ;;AN000;; No + 36322 + 36323 00005618 80FEFF cmp dh,utility_msg_class ; -1 ;;AN000;; Was it a UTILITY class? + 36324 0000561B 7503 jne short $MIF47 ;;AN000;; No + 36325 0000561D F9 stc ; **- ;;AN000;; Set the carry flag + 36326 ; 07/04/2023 + 36327 ;jmp short $MEN47 ; **- + 36328 0000561E EB1B jmp short $MEN36 ; **- + 36329 $MIF47: + 36330 00005620 A3[DC98] mov [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],ax + 36331 ;mov [$M_RT+72],ax ;;AN000;; Save message number + 36332 00005623 B8FFFF mov ax,0FFFFh ; $M_SPECIAL_MSG_NUM ;;AN000;; Set special message number + 36333 00005626 BD0100 mov bp,1 ; $M_ONE_REPLACE ;;AN000;; Set one replace in message + 36334 00005629 31F6 xor si,si ;;AN000;; Reset the SI index to start again + 36335 ; 28/04/2023 + 36336 ; 07/04/2023 + 36337 ;clc ; **+ ;;AN000;; + 36338 ;$MEN47: + 36339 ;jmp short $MEN46 ; *** + 36340 0000562B EB0A jmp short $MEN47 ; *** + 36341 $MIF46: + 36342 ;cmp bx,0 ; $M_CLASS_NOT_EXIST ;;AN000;; Does this class exist? + 36343 0000562D 21DB and bx,bx ; 0 ? + 36344 0000562F 7403 jz short $MIF51 ;;AN000;; No + 36345 + 36346 00005631 E84D00 call $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message + 36347 $MIF51: + 36348 00005634 83C604 add si,4 ; $M_ADDR_SZ_FAR ;;AN000;; Get next class + 36349 ; 07/04/2023 + 36350 ;clc ;;AN000;; + 36351 ;$MEN46: + 36352 ;jc short $MEN36 ; **- ; **+ ;;AN000;; + 36353 $MEN47: ; 07/04/2023 ; **+ + 36354 00005637 09C9 or cx,cx ;;AN000;; Was the message found? + 36355 ;jnz short $MXL2 ;;AN000;; Yes + 36356 ;jmp short $MDO36 + 36357 ; 07/04/2023 + 36358 00005639 74AA jz short $MDO36 + 36359 $MXL2: + 36360 $MEN36: + 36361 0000563B 9C pushf ;;AN006;; Save the flag state + 36362 + 36363 0000563C 80FE01 cmp dh,1 ; EXT_ERR_CLASS ;;AN006;; Was an extended error requested? + 36364 ;jne short $MIF56 ;;AN006;; No + 36365 ; 28/04/2023 + 36366 0000563F 752A jne short $M_MYRET + 36367 + 36368 00005641 52 push dx ;;AN006;; Save all needed registers + 36369 00005642 55 push bp ;;AN006;; + 36370 00005643 51 push cx ;;AN006;; + 36371 00005644 06 push es ;;AN006;; + 36372 00005645 57 push di ;;AN006;; + 36373 00005646 50 push ax ;;AN006;; + 36374 + 36375 00005647 B80005 mov ax,500h ; IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed + 36376 0000564A CD2F int 2Fh ;;AN006;; + 36377 ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER - INSTALLATION CHECK + 36378 ; Return: AL = 00h not installed, OK to install + 36379 ; 01h not installed, can't install + 36380 ; FFh installed + 36381 + 36382 0000564C 3CFF cmp al,0FFh ; IFSFUNC_INSTALLED ;;AN006;; Is it installed? + 36383 0000564E 58 pop ax ;;AN006;; Restore msg number + 36384 0000564F 7513 jne short $MIF57 ;;AN006;; No (not installed) + 36385 + 36386 00005651 89C3 mov bx,ax ;;AN006;; BX is the extended error number + 36387 00005653 B80205 mov ax,502h ; IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number + 36388 00005656 CD2F int 2Fh ;;AN006;; Call IFSFUNC + 36389 ; Multiplex - DOS 3+ CRITICAL ERROR HANDLER + 36390 + 36391 ;jmp short $MEN57 ;;AN006;; + 36392 ; 28/04/2023 + 36393 00005658 720B jc short $MEN57 + 36394 $MIF60: + 36395 0000565A 83C406 add sp,6 ;;AN006;; Throw away old pointer + 36396 0000565D E81200 call $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string + 36397 $MEN60: + 36398 00005660 5D pop bp ;;AN006;; Restore other Regs + 36399 00005661 5A pop dx ;;AN006;; + 36400 $MIF56: + 36401 ; 07/04/2023 + 36402 ;$M_POPF ; macro in 'sysmsg.inc' (MSDOS 6.0) + 36403 00005662 EB07 jmp short $M_MYRET ;;AN006;; Restore the flag state + 36404 + 36405 $MIF57: + 36406 00005664 F9 stc ;;AN006;; Carry conditon + 36407 $MEN57: + 36408 ; 28/04/2023 + 36409 ;jnc short $MIF60 ;;AN006;; + 36410 + 36411 00005665 5F pop di ;;AN006;; + 36412 00005666 07 pop es ;;AN006;; Restore old pointer + 36413 00005667 59 pop cx ;;AN006;; + 36414 00005668 EBF6 jmp short $MEN60 + 36415 + 36416 ;$MIF60: + 36417 ; add sp,6 ;;AN006;; Throw away old pointer + 36418 ; call $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string + 36419 ;$MEN60: + 36420 ; pop bp ;;AN006;; Restore other Regs + 36421 ; pop dx ;;AN006;; + 36422 ;$MIF56: + 36423 ; ; 07/04/2023 + 36424 ; ;$M_POPF ; macro in 'sysmsg.inc' (MSDOS 6.0) + 36425 ; jmp short $M_MYRET ;;AN006;; Restore the flag state + 36426 + 36427 ; 07/04/2023 + 36428 ; --------------------------- + 36429 ; MSDOS 6.0, SYSMSG.INC, 1991 + 36430 ; --------------------------- + 36431 ; $M_POPF macro + 36432 ;jmp short $+3 + 36433 m_popf_iret: + 36434 0000566A CF iret + 36435 $M_MYRET: + 36436 0000566B 0E push cs + 36437 0000566C E8FBFF call m_popf_iret + 36438 ;;; end macro + 36439 ; --------------------------- + 36440 + 36441 0000566F 5B pop bx ;;AN000;; + 36442 00005670 5E pop si ;;AN000;; + 36443 00005671 C3 retn ;;AN000;; Return ES:DI pointing to the message + 36444 + 36445 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36446 + 36447 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36448 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36449 $M_SET_LEN_IN_CX: + 36450 00005672 57 push di ;;AN006;; Save position + 36451 00005673 50 push ax ;;AN006;; + 36452 00005674 B9FFFF mov cx,-1 ; 65535 ; 0FFFFh ;;AN006;; Set CX for decrements + 36453 00005677 30C0 xor al,al ;;AN006;; Prepare compare register + 36454 00005679 F2AE repne scasb ;;AN006;; Scan for zero + 36455 0000567B F7D1 not cx ;;AN006;; Change decrement into number + 36456 0000567D 49 dec cx ;;AN006;; Don't include the zero + 36457 0000567E 58 pop ax ;;AN006;; + 36458 0000567F 5F pop di ;;AN006;; Restore position + 36459 00005680 C3 retn ;;AN006;; + 36460 + 36461 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36462 ;; + 36463 ;; PROC NAME: $M_FIND_SPECIFIED_MSG + 36464 ;; + 36465 ;; FUNCTION: To scan thru message headers until message is found + 36466 ;; INPUTS: ES:DI points to beginning of msg headers + 36467 ;; CX contains the number of messages in class + 36468 ;; DH contains the message class + 36469 ;; OUPUTS: IF CX = 0 THEN Message was not found + 36470 ;; IF CX > 1 THEN ES:DI points to header of specified message + 36471 ;; + 36472 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36473 + 36474 ; 07/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36475 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36476 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36477 $M_FIND_SPECIFIED_MSG: + 36478 00005681 83FB01 cmp bx,1 ;;AN004;; Do we have an address to CALL? + 36479 00005684 751F jne short $MIF64 + 36480 00005686 833E[BC98]FF cmp word [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR],-1 + 36481 ;cmp word [$M_RT+40],-1 ; 0FFFFh ;;AN004;; Do we have an address to CALL? + 36482 ; 15/06/2023 + 36483 0000568B 7418 je short $MIF64 + 36484 + 36485 0000568D 83F8FF cmp ax,0FFFFh ; $M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err? + 36486 00005690 750B jne short $MIF65 + 36487 + 36488 00005692 50 push ax ;;AN004;; Reset the special message number + 36489 00005693 A1[DC98] mov ax,[$M_RT+$M_RES_ADDRS.$M_MSG_NUM] + 36490 ;mov ax,[$M_RT+72] ;;AN004;; Get the old message number + 36491 00005696 FF1E[BC98] call far [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR] + 36492 ;;AN004;; Call the READ_DISK_PROC to get error text + 36493 0000569A 58 pop ax ;;AN004;; Reset the special message number + 36494 ; 28/04/2023 + 36495 0000569B EB04 jmp short $MEN65 + 36496 ; 18/04/2023 + 36497 ;jmp short $MEN64 + 36498 $MIF65: + 36499 0000569D FF1E[BC98] call far [$M_RT+$M_RES_ADDRS.$M_DISK_PROC_ADDR] + 36500 ;;AN004;; Call the READ_DISK_PROC to get error text + 36501 $MEN65: + 36502 ; 28/04/2023 + 36503 000056A1 7344 jnc short $MIF75 + 36504 ; + 36505 000056A3 EB19 jmp short $MEN64 ; $MDO76 ;;AN004;; + 36506 $MIF64: + 36507 000056A5 31C9 xor cx,cx ;;AN002;; CX = 0 will allow us to + 36508 000056A7 80FEFF cmp dh,utility_msg_class ; -1 ;;AN001;; + 36509 000056AA 7406 je short $MIF69 + 36510 + 36511 000056AC 268A4D03 mov cl,[es:di+$M_CLASS_ID.$M_NUM_CLS_MSG] + 36512 ;mov cl,[es:di+3] ;;AN001;; Get number of messages in class + 36513 000056B0 EB09 jmp short $MEN69 + 36514 $MIF69: + 36515 ;cmp [cs:di+$M_CLASS_ID.$M_CLS_ID],dh + 36516 ;cmp [cs:di+0],dh + 36517 000056B2 2E3835 cmp [cs:di],dh ;;AN002;; Check if class still exists at + 36518 000056B5 7504 jne short $MIF71 + 36519 + 36520 000056B7 2E8A4D03 mov cl,[cs:di+$M_CLASS_ID.$M_NUM_CLS_MSG] + 36521 ;mov cl,[cs:di+3] ;;AN000;; Get number of messages in class + 36522 $MIF71: ;;AN001;; + 36523 $MEN69: + 36524 000056BB 83C704 add di,$M_CLASS_ID_SZ ; add di,4 ;;AN000;; Point past the class header + 36525 ; 02/05/2023 + 36526 ;stc ;;AN004;; Flag that we haven't found anything yet + 36527 $MEN64: + 36528 ;jnc short $MIF75 + 36529 ; 28/04/2023 + 36530 ; (or instruction clears carry flag) + 36531 ;clc ;;AN004;; No, reset carry + 36532 $MDO76: + 36533 000056BE 09C9 or cx,cx ;;AN000;; Do we have any to check? + 36534 000056C0 7417 jz short $MEN76 36535 - 36536 ;cmp ax,[es:di+$M_ID.$M_NUM] ;;AN001;; Is this the message requested? - 36537 000056C7 263B05 cmp ax,[es:di] - 36538 000056CA EB03 jmp short $MEN78 - 36539 $MIF78: - 36540 ;cmp ax,[cs:di+$M_ID.$M_NUM] ;;AN000;; Is this the message requested? - 36541 000056CC 2E3B05 cmp ax,[cs:di] - 36542 $MEN78: - 36543 ;jne short $MIF76 - 36544 ;jmp short $MSR76 - 36545 ; 07/04/2023 - 36546 000056CF 740B je short $MSR76 ; * - 36547 $MIF76: - 36548 000056D1 49 dec cx ;;AN000;; No, well do we have more to check? - 36549 000056D2 7405 jz short $MEN76 - 36550 - 36551 000056D4 83C704 add di,$M_ID_SZ ; add di,4 ;;AN000;; Yes, skip past msg header - 36552 000056D7 EBE5 jmp short $MDO76 ;;AN000;; - 36553 $MEN76: - 36554 000056D9 F9 stc ;;AN000;; - 36555 ;$MSR76: ; 07/04/2023 - 36556 ;jc short $MIF86 ;;AN000;; - 36557 ; 07/04/2023 - 36558 ;jc short $MIF91 - 36559 000056DA EB11 jmp short $MIF91 ;* - 36560 $MSR76: ; 07/04/2023 ; * - 36561 000056DC 80FEFF cmp dh,utility_msg_class ; -1 ;;AN001;; Yes, is it a utility message? - 36562 ; 07/04/2023 - 36563 ;clc ;;AN001;; - 36564 000056DF 7502 jne short $MIF87 - 36565 - 36566 000056E1 0E push cs ;;AN000;; - 36567 000056E2 07 pop es ;;AN000;; Return ES:DI pointing to the message - 36568 $MIF87: - 36569 ;add di,[es:di+2] - 36570 000056E3 26037D02 add di,[es:di+$M_ID.$M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message - 36571 $MIF86: - 36572 ;$MIF75: - 36573 ; 02/05/2023 - 36574 ;jc short $MIF91 - 36575 $MIF75: ; 28/04/2023 - 36576 000056E7 30ED xor ch,ch ;;AN000;; - 36577 000056E9 268A0D mov cl,[es:di] ;;AN000;; Move size into CX - 36578 000056EC 47 inc di ;;AN000;; Increment past length - 36579 $MIF91: - 36580 000056ED C606[D698]00 mov byte [$M_RT+$M_RES_ADDRS.$M_SIZE],0 ; $M_NULL - 36581 ;mov byte [$M_RT+66],0 ;;AN004;; Reset variable - 36582 000056F2 C3 retn ;;AN000;; Return - 36583 - 36584 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36585 ;; - 36586 ;; Proc Name: SYSDISPMSG - 36587 ;; - 36588 ;; Function: The DISPLAY service will output a defined message to a handle - 36589 ;; requested by the caller. It also provides function to display - 36590 ;; messages when handles are not applicable (ie. DOS function calls - 36591 ;; 00h to 0Ah) Replaceable parameters are allowed and are - 36592 ;; defined previous to entry. - 36593 ;; - 36594 ;; It is assumes that a PRELOAD function has already determined - 36595 ;; the addressibilty internally to the message retriever services. - 36596 ;; Inputs: - 36597 ;; - 36598 ;; Outputs: - 36599 ;; - 36600 ;; Psuedocode: - 36601 ;; Save registers needed later - 36602 ;; Get address of the message requested - 36603 ;; IF Message number exists THEN - 36604 ;; IF replacable parameters were specified THEN - 36605 ;; Display message with replacable parms - 36606 ;; ELSE - 36607 ;; Display string without replacable parms - 36608 ;; ENDIF - 36609 ;; IF character input was requested THEN - 36610 ;; Wait for character input + 36536 000056C2 80FEFF cmp dh,utility_msg_class ; -1 ;;AN001;; + 36537 000056C5 7405 je short $MIF78 + 36538 + 36539 ;cmp ax,[es:di+$M_ID.$M_NUM] ;;AN001;; Is this the message requested? + 36540 000056C7 263B05 cmp ax,[es:di] + 36541 000056CA EB03 jmp short $MEN78 + 36542 $MIF78: + 36543 ;cmp ax,[cs:di+$M_ID.$M_NUM] ;;AN000;; Is this the message requested? + 36544 000056CC 2E3B05 cmp ax,[cs:di] + 36545 $MEN78: + 36546 ;jne short $MIF76 + 36547 ;jmp short $MSR76 + 36548 ; 07/04/2023 + 36549 000056CF 740B je short $MSR76 ; * + 36550 $MIF76: + 36551 000056D1 49 dec cx ;;AN000;; No, well do we have more to check? + 36552 000056D2 7405 jz short $MEN76 + 36553 + 36554 000056D4 83C704 add di,$M_ID_SZ ; add di,4 ;;AN000;; Yes, skip past msg header + 36555 000056D7 EBE5 jmp short $MDO76 ;;AN000;; + 36556 $MEN76: + 36557 000056D9 F9 stc ;;AN000;; + 36558 ;$MSR76: ; 07/04/2023 + 36559 ;jc short $MIF86 ;;AN000;; + 36560 ; 07/04/2023 + 36561 ;jc short $MIF91 + 36562 000056DA EB11 jmp short $MIF91 ;* + 36563 $MSR76: ; 07/04/2023 ; * + 36564 000056DC 80FEFF cmp dh,utility_msg_class ; -1 ;;AN001;; Yes, is it a utility message? + 36565 ; 07/04/2023 + 36566 ;clc ;;AN001;; + 36567 000056DF 7502 jne short $MIF87 + 36568 + 36569 000056E1 0E push cs ;;AN000;; + 36570 000056E2 07 pop es ;;AN000;; Return ES:DI pointing to the message + 36571 $MIF87: + 36572 ;add di,[es:di+2] + 36573 000056E3 26037D02 add di,[es:di+$M_ID.$M_TXT_PTR] ;;AN000;; Prepare ES:DI pointing to the message + 36574 $MIF86: + 36575 ;$MIF75: + 36576 ; 02/05/2023 + 36577 ;jc short $MIF91 + 36578 $MIF75: ; 28/04/2023 + 36579 000056E7 30ED xor ch,ch ;;AN000;; + 36580 000056E9 268A0D mov cl,[es:di] ;;AN000;; Move size into CX + 36581 000056EC 47 inc di ;;AN000;; Increment past length + 36582 $MIF91: + 36583 000056ED C606[D698]00 mov byte [$M_RT+$M_RES_ADDRS.$M_SIZE],0 ; $M_NULL + 36584 ;mov byte [$M_RT+66],0 ;;AN004;; Reset variable + 36585 000056F2 C3 retn ;;AN000;; Return + 36586 + 36587 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36588 ;; + 36589 ;; Proc Name: SYSDISPMSG + 36590 ;; + 36591 ;; Function: The DISPLAY service will output a defined message to a handle + 36592 ;; requested by the caller. It also provides function to display + 36593 ;; messages when handles are not applicable (ie. DOS function calls + 36594 ;; 00h to 0Ah) Replaceable parameters are allowed and are + 36595 ;; defined previous to entry. + 36596 ;; + 36597 ;; It is assumes that a PRELOAD function has already determined + 36598 ;; the addressibilty internally to the message retriever services. + 36599 ;; Inputs: + 36600 ;; + 36601 ;; Outputs: + 36602 ;; + 36603 ;; Psuedocode: + 36604 ;; Save registers needed later + 36605 ;; Get address of the message requested + 36606 ;; IF Message number exists THEN + 36607 ;; IF replacable parameters were specified THEN + 36608 ;; Display message with replacable parms + 36609 ;; ELSE + 36610 ;; Display string without replacable parms 36611 ;; ENDIF - 36612 ;; Clear CARRY FLAG - 36613 ;; ELSE - 36614 ;; Set CARRY FLAG - 36615 ;; ENDIF - 36616 ;; Return - 36617 ;; - 36618 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36619 - 36620 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36621 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5307h - 36622 ; - 36623 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36624 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5ACBh - 36625 - 36626 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36627 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5955h - 36628 SYSDISPMSG: - 36629 ;; Save registers and values needed later - 36630 000056F3 50 push ax ;;AN000;; Save changed REGs - 36631 000056F4 53 push bx ;;AN000;; - 36632 000056F5 51 push cx ;;AN000;; - 36633 000056F6 55 push bp ;;AN000;; - 36634 000056F7 57 push di ;;AN000;; Save pointer to input buffer (offset) - 36635 000056F8 06 push es ;;AN000;; Save pointer to input buffer (segment) - 36636 000056F9 52 push dx ;;AN000;; Save Input/Class request - 36637 - 36638 000056FA 89CD mov bp,cx ;;AN000;; Use BP to hold replace count - 36639 000056FC 891E[D498] mov [$M_RT+$M_RES_ADDRS.$M_HANDLE],bx - 36640 ;mov [$M_RT+64],bx ;;AN000;; Save handle - 36641 00005700 8836[D998] mov [$M_RT+$M_RES_ADDRS.$M_CLASS],dh - 36642 ;mov [$M_RT+69],dh ;;AN004;; Save class - 36643 - 36644 ;; Get address of the message requested - 36645 00005704 E8D8FE call $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message + 36612 ;; IF character input was requested THEN + 36613 ;; Wait for character input + 36614 ;; ENDIF + 36615 ;; Clear CARRY FLAG + 36616 ;; ELSE + 36617 ;; Set CARRY FLAG + 36618 ;; ENDIF + 36619 ;; Return + 36620 ;; + 36621 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36622 + 36623 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36624 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5307h + 36625 ; + 36626 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36627 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5ACBh + 36628 + 36629 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36630 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5955h + 36631 SYSDISPMSG: + 36632 ;; Save registers and values needed later + 36633 000056F3 50 push ax ;;AN000;; Save changed REGs + 36634 000056F4 53 push bx ;;AN000;; + 36635 000056F5 51 push cx ;;AN000;; + 36636 000056F6 55 push bp ;;AN000;; + 36637 000056F7 57 push di ;;AN000;; Save pointer to input buffer (offset) + 36638 000056F8 06 push es ;;AN000;; Save pointer to input buffer (segment) + 36639 000056F9 52 push dx ;;AN000;; Save Input/Class request + 36640 + 36641 000056FA 89CD mov bp,cx ;;AN000;; Use BP to hold replace count + 36642 000056FC 891E[D498] mov [$M_RT+$M_RES_ADDRS.$M_HANDLE],bx + 36643 ;mov [$M_RT+64],bx ;;AN000;; Save handle + 36644 00005700 8836[D998] mov [$M_RT+$M_RES_ADDRS.$M_CLASS],dh + 36645 ;mov [$M_RT+69],dh ;;AN004;; Save class 36646 - 36647 00005707 09C9 or cx,cx ;;AN000;; Was message found? - 36648 00005709 7427 jz short $MIF93 - 36649 ;;AN000;; Yes, Message address in ES:DI - 36650 - 36651 ;; Test if replacable parameters were specified - 36652 0000570B 09ED or bp,bp ;;AN000;; Were replacable parameters requested - 36653 0000570D 7505 jnz short $MIF94 - 36654 - 36655 ;; Display string without replacable parms - 36656 0000570F E82800 call $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message - 36657 00005712 EB03 jmp short $MEN94 - 36658 $MIF94: - 36659 ;; Display message with replacable parms - 36660 00005714 E88B01 call $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions - 36661 $MEN94: - 36662 00005717 7214 jc short $MIF97 - 36663 00005719 5A pop dx ;;AN000;; Get Input/Class request - 36664 0000571A E8FC00 call $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. - 36665 0000571D 07 pop es ;;AN000;; Get location of input buffer (if specified) - 36666 0000571E 5F pop di ;;AN000;; - 36667 - 36668 ; 15/06/2023 - MSDOS 5.0 - 36669 ; ;jmp short $MEN97 ; *** - 36670 ; ; 08/04/2023 - 36671 ; ;jmp short $MEN93 ; ** - 36672 ; + 36647 ;; Get address of the message requested + 36648 00005704 E8D8FE call $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message + 36649 + 36650 00005707 09C9 or cx,cx ;;AN000;; Was message found? + 36651 00005709 7427 jz short $MIF93 + 36652 ;;AN000;; Yes, Message address in ES:DI + 36653 + 36654 ;; Test if replacable parameters were specified + 36655 0000570B 09ED or bp,bp ;;AN000;; Were replacable parameters requested + 36656 0000570D 7505 jnz short $MIF94 + 36657 + 36658 ;; Display string without replacable parms + 36659 0000570F E82800 call $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message + 36660 00005712 EB03 jmp short $MEN94 + 36661 $MIF94: + 36662 ;; Display message with replacable parms + 36663 00005714 E88B01 call $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions + 36664 $MEN94: + 36665 00005717 7214 jc short $MIF97 + 36666 00005719 5A pop dx ;;AN000;; Get Input/Class request + 36667 0000571A E8FC00 call $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars. + 36668 0000571D 07 pop es ;;AN000;; Get location of input buffer (if specified) + 36669 0000571E 5F pop di ;;AN000;; + 36670 + 36671 ; 15/06/2023 - MSDOS 5.0 + 36672 ; ;jmp short $MEN97 ; *** 36673 ; ; 08/04/2023 - 36674 ;;$MEN93: - 36675 ; jc short $MIF104 - 36676 - 36677 ; 15/06/2023 Retro DOS v4.2 COMMAND.COM - 36678 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5AF7h + 36674 ; ;jmp short $MEN93 ; ** + 36675 ; + 36676 ; ; 08/04/2023 + 36677 ;;$MEN93: + 36678 ; jc short $MIF104 36679 - 36680 ; MSDOS 6.0 (MSDOS 6.22) - 36681 ; Test if character input was requested ;;AN000;; - 36682 0000571F 08D2 or dl,dl - 36683 00005721 7403 jz short $MIF98 - 36684 ;jz short $MEN98 ; * - 36685 - 36686 00005723 E88B05 call $M_WAIT_FOR_INPUT ; MSDOS 6.0 (to 6.22) - 36687 ; cf = 0 ; * - 36688 $MIF98: - 36689 ;jmp short $MEN97 - 36690 ;;jc short $MIF104 ; * - 36691 $MEN98: - 36692 ;$MEN97: - 36693 00005726 5D pop bp ;;AN000;; - 36694 00005727 59 pop cx ;;AN000;; - 36695 00005728 5B pop bx ;;AN000;; - 36696 ; 15/06/2023 - 36697 ;pop ax ; MSDOS 5.0 ;;AN000;; - 36698 00005729 83C402 add sp,2 ; MSDOS 6.0 (to 6.22) - 36699 0000572C C3 retn - 36700 - 36701 $MIF97: - 36702 ; 08/04/2023 - 36703 ;add sp,6 ;;AN000;; - 36704 ;stc ;;AN000;; Reset carry flag - 36705 ;$MEN97: ; *** - 36706 ;jmp short $MEN93 - 36707 ; 08/04/2023 - 36708 ;jmp short $MIF104 - 36709 ; 08/04/2023 - 36710 0000572D 83C40E add sp,14 ; 6+8 - 36711 00005730 F9 stc - 36712 00005731 C3 retn - 36713 $MIF93: - 36714 ; 08/04/2023 - 15/06/2023 - 36715 ; (wrong pops ?) - correct order: pop dx, pop es, pop di - - 36716 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:533Bh - 36717 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5B06h - 36718 00005732 07 pop es ;;AN000;; Get pointer to input buffer (segment) - 36719 00005733 5F pop di ;;AN000;; Get base pointer to first sublist (offset) - 36720 00005734 5A pop dx ;;AN000;; Get base pointer to first sublist (segment) - 36721 ;stc ; * ;;AN000;; Set carry flag - 36722 ; 08/04/2023 - 36723 ;jmp short $MIF104 ; * - 36724 - 36725 ;$MEN93: ; ** - 36726 ; jc short $MIF104 - 36727 ;$MEN97: ; 08/04/2023 - 36728 ; pop bp ;;AN000;; - 36729 ; pop cx ;;AN000;; - 36730 ; pop bx ;;AN000;; - 36731 ; pop ax ;;AN000;; - 36732 ; ;jmp short $MEN104 - 36733 ; ; 08/04/2023 - 36734 ; retn - 36735 - 36736 $MIF104: ; * - 36737 00005735 83C408 add sp,8 ;;AN000;; Eliminate from stack - 36738 00005738 F9 stc ;;AN000;; - 36739 $MEN104: - 36740 00005739 C3 retn ;;AN000;; Return - 36741 - 36742 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36743 ;; - 36744 ;; PROC NAME: $M_DISPLAY_STRING - 36745 ;; - 36746 ;; FUNCTION: Will display or write string - 36747 ;; INPUTS: ES:DI points to beginning of message - 36748 ;; CX contains the length of string to write (if applicable) - 36749 ;; OUTPUTS: None - 36750 ;; REGS Revised: None - 36751 ;; - 36752 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36753 - 36754 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36755 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36756 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36757 $M_DISPLAY_STRING: - 36758 0000573A 50 push ax ;;AN000;; - 36759 0000573B 53 push bx ;;AN000;; - 36760 0000573C 52 push dx ;;AN000;; - 36761 0000573D 8B1E[D498] mov bx,[$M_RT+$M_RES_ADDRS.$M_HANDLE] - 36762 ;mov bx,[$M_RT+64] ;;AN000;; Retrieve handle - 36763 - 36764 00005741 83FBFF cmp bx,0FFFFh ; $M_NO_HANDLE ;;AN000;; Was there a handle specified? - 36765 00005744 7505 jne short $MIF107 - 36766 - 36767 00005746 E82600 call $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string - 36768 00005749 EB03 jmp short $MEN107 - 36769 $MIF107: - 36770 0000574B E86E00 call $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle - 36771 $MEN107: - 36772 0000574E 730D jnc short $MIF110 - 36773 - 36774 00005750 B459 mov ah,59h ; DOS_GET_EXT_ERROR ;;AN000;; - 36775 ;mov bx,0 ; DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error - 36776 ; 08/04/2023 - 36777 00005752 31DB xor bx,bx - 36778 00005754 CD21 int 21h ;;AN000;; - 36779 ; DOS - 3+ - GET EXTENDED ERROR CODE - 36780 ; BX = version code (0000h for DOS 3.x) - 36781 00005756 30E4 xor ah,ah ;;AN000;; Clear AH - 36782 $MEN110: ; 08/04/2023 ; *** - 36783 00005758 83C406 add sp,6 ;;AN000;; Clean up stack - 36784 0000575B F9 stc ;;AN000;; Flag that there was an error - 36785 ;jmp short $MEN110 ; **** - 36786 ; 08/04/2023 - 36787 0000575C C3 retn - 36788 $MIF110: - 36789 ;cmp bx,$M_NO_HANDLE - 36790 0000575D 83FBFF cmp bx,0FFFFh ; $M_NO_HANDLE ;;AN000;; Was there a handle specified? - 36791 00005760 7409 je short $MIF112 ; * ; cf = 0 - 36792 00005762 39C8 cmp ax,cx ;;AN001;; Was it ALL written? - 36793 00005764 7405 je short $MIF113 ; ** ; cf = 0 - 36794 00005766 E8A700 call $M_GET_EXT_ERR_39 ;;AN001;; Set Extended error - 36795 ;add sp,6 ;;AN001;; Clean up stack - 36796 ;stc ;;AN001;; Flag that there was an error - 36797 ; 08/04/2023 - 36798 00005769 EBED jmp short $MEN110 ; *** - 36799 ; 08/04/2023 - 36800 ;$MIF112: - 36801 ;$MEN110: ; **** - 36802 ;jc short $MIF117 - 36803 $MIF112: ; 08/04/2023 ; * - 36804 $MIF113: ; ** - 36805 0000576B 5A pop dx ;;AN000;; Restore regs - 36806 0000576C 5B pop bx ;;AN000;; - 36807 0000576D 58 pop ax ;;AN000;; - 36808 $MIF117: - 36809 0000576E C3 retn - 36810 - 36811 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36812 ;; - 36813 ;; PROC NAME: $M_DISPLAY_$_STRING - 36814 ;; - 36815 ;; FUNCTION: Will display a $ terminated string - 36816 ;; INPUTS: ES:DI points to beginning of message text (not the length) - 36817 ;; OUTPUTS: None - 36818 ;; REGS USED: AX,DX - 36819 ;; - 36820 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36821 - 36822 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36823 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36824 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36825 $M_DISPLAY_$_STRING: - 36826 0000576F 1E push ds ;;AN000;; - 36827 00005770 06 push es ;;AN000;; - 36828 00005771 1F pop ds ;;AN000;; Set DS to segment of message text - 36829 - 36830 ; 08/04/2023 - 36831 00005772 B402 mov ah,2 ; DOS_DISP_CHAR + 36680 ; 15/06/2023 Retro DOS v4.2 COMMAND.COM + 36681 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5AF7h + 36682 + 36683 ; MSDOS 6.0 (MSDOS 6.22) + 36684 ; Test if character input was requested ;;AN000;; + 36685 0000571F 08D2 or dl,dl + 36686 00005721 7403 jz short $MIF98 + 36687 ;jz short $MEN98 ; * + 36688 + 36689 00005723 E88B05 call $M_WAIT_FOR_INPUT ; MSDOS 6.0 (to 6.22) + 36690 ; cf = 0 ; * + 36691 $MIF98: + 36692 ;jmp short $MEN97 + 36693 ;;jc short $MIF104 ; * + 36694 $MEN98: + 36695 ;$MEN97: + 36696 00005726 5D pop bp ;;AN000;; + 36697 00005727 59 pop cx ;;AN000;; + 36698 00005728 5B pop bx ;;AN000;; + 36699 ; 15/06/2023 + 36700 ;pop ax ; MSDOS 5.0 ;;AN000;; + 36701 00005729 83C402 add sp,2 ; MSDOS 6.0 (to 6.22) + 36702 0000572C C3 retn + 36703 + 36704 $MIF97: + 36705 ; 08/04/2023 + 36706 ;add sp,6 ;;AN000;; + 36707 ;stc ;;AN000;; Reset carry flag + 36708 ;$MEN97: ; *** + 36709 ;jmp short $MEN93 + 36710 ; 08/04/2023 + 36711 ;jmp short $MIF104 + 36712 ; 08/04/2023 + 36713 0000572D 83C40E add sp,14 ; 6+8 + 36714 00005730 F9 stc + 36715 00005731 C3 retn + 36716 $MIF93: + 36717 ; 08/04/2023 - 15/06/2023 + 36718 ; (wrong pops ?) - correct order: pop dx, pop es, pop di - + 36719 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:533Bh + 36720 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5B06h + 36721 00005732 07 pop es ;;AN000;; Get pointer to input buffer (segment) + 36722 00005733 5F pop di ;;AN000;; Get base pointer to first sublist (offset) + 36723 00005734 5A pop dx ;;AN000;; Get base pointer to first sublist (segment) + 36724 ;stc ; * ;;AN000;; Set carry flag + 36725 ; 08/04/2023 + 36726 ;jmp short $MIF104 ; * + 36727 + 36728 ;$MEN93: ; ** + 36729 ; jc short $MIF104 + 36730 ;$MEN97: ; 08/04/2023 + 36731 ; pop bp ;;AN000;; + 36732 ; pop cx ;;AN000;; + 36733 ; pop bx ;;AN000;; + 36734 ; pop ax ;;AN000;; + 36735 ; ;jmp short $MEN104 + 36736 ; ; 08/04/2023 + 36737 ; retn + 36738 + 36739 $MIF104: ; * + 36740 00005735 83C408 add sp,8 ;;AN000;; Eliminate from stack + 36741 00005738 F9 stc ;;AN000;; + 36742 $MEN104: + 36743 00005739 C3 retn ;;AN000;; Return + 36744 + 36745 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36746 ;; + 36747 ;; PROC NAME: $M_DISPLAY_STRING + 36748 ;; + 36749 ;; FUNCTION: Will display or write string + 36750 ;; INPUTS: ES:DI points to beginning of message + 36751 ;; CX contains the length of string to write (if applicable) + 36752 ;; OUTPUTS: None + 36753 ;; REGS Revised: None + 36754 ;; + 36755 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36756 + 36757 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36758 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36759 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36760 $M_DISPLAY_STRING: + 36761 0000573A 50 push ax ;;AN000;; + 36762 0000573B 53 push bx ;;AN000;; + 36763 0000573C 52 push dx ;;AN000;; + 36764 0000573D 8B1E[D498] mov bx,[$M_RT+$M_RES_ADDRS.$M_HANDLE] + 36765 ;mov bx,[$M_RT+64] ;;AN000;; Retrieve handle + 36766 + 36767 00005741 83FBFF cmp bx,0FFFFh ; $M_NO_HANDLE ;;AN000;; Was there a handle specified? + 36768 00005744 7505 jne short $MIF107 + 36769 + 36770 00005746 E82600 call $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string + 36771 00005749 EB03 jmp short $MEN107 + 36772 $MIF107: + 36773 0000574B E86E00 call $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle + 36774 $MEN107: + 36775 0000574E 730D jnc short $MIF110 + 36776 + 36777 00005750 B459 mov ah,59h ; DOS_GET_EXT_ERROR ;;AN000;; + 36778 ;mov bx,0 ; DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error + 36779 ; 08/04/2023 + 36780 00005752 31DB xor bx,bx + 36781 00005754 CD21 int 21h ;;AN000;; + 36782 ; DOS - 3+ - GET EXTENDED ERROR CODE + 36783 ; BX = version code (0000h for DOS 3.x) + 36784 00005756 30E4 xor ah,ah ;;AN000;; Clear AH + 36785 $MEN110: ; 08/04/2023 ; *** + 36786 00005758 83C406 add sp,6 ;;AN000;; Clean up stack + 36787 0000575B F9 stc ;;AN000;; Flag that there was an error + 36788 ;jmp short $MEN110 ; **** + 36789 ; 08/04/2023 + 36790 0000575C C3 retn + 36791 $MIF110: + 36792 ;cmp bx,$M_NO_HANDLE + 36793 0000575D 83FBFF cmp bx,0FFFFh ; $M_NO_HANDLE ;;AN000;; Was there a handle specified? + 36794 00005760 7409 je short $MIF112 ; * ; cf = 0 + 36795 00005762 39C8 cmp ax,cx ;;AN001;; Was it ALL written? + 36796 00005764 7405 je short $MIF113 ; ** ; cf = 0 + 36797 00005766 E8A700 call $M_GET_EXT_ERR_39 ;;AN001;; Set Extended error + 36798 ;add sp,6 ;;AN001;; Clean up stack + 36799 ;stc ;;AN001;; Flag that there was an error + 36800 ; 08/04/2023 + 36801 00005769 EBED jmp short $MEN110 ; *** + 36802 ; 08/04/2023 + 36803 ;$MIF112: + 36804 ;$MEN110: ; **** + 36805 ;jc short $MIF117 + 36806 $MIF112: ; 08/04/2023 ; * + 36807 $MIF113: ; ** + 36808 0000576B 5A pop dx ;;AN000;; Restore regs + 36809 0000576C 5B pop bx ;;AN000;; + 36810 0000576D 58 pop ax ;;AN000;; + 36811 $MIF117: + 36812 0000576E C3 retn + 36813 + 36814 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36815 ;; + 36816 ;; PROC NAME: $M_DISPLAY_$_STRING + 36817 ;; + 36818 ;; FUNCTION: Will display a $ terminated string + 36819 ;; INPUTS: ES:DI points to beginning of message text (not the length) + 36820 ;; OUTPUTS: None + 36821 ;; REGS USED: AX,DX + 36822 ;; + 36823 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36824 + 36825 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36826 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36827 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36828 $M_DISPLAY_$_STRING: + 36829 0000576F 1E push ds ;;AN000;; + 36830 00005770 06 push es ;;AN000;; + 36831 00005771 1F pop ds ;;AN000;; Set DS to segment of message text 36832 - 36833 ;cmp cx,$M_SINGLE_CHAR ;;AN000;; Is this a single character? - 36834 00005774 83F901 cmp cx,1 ; $M_SINGLE_CHAR - 36835 00005777 7518 jne short $MIF119 ;;AN000;; No - 36836 - 36837 ;mov ah,2 ; DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER - 36838 00005779 268A15 mov dl,[es:di] ;;AN000;; Get the character - 36839 0000577C CD21 int 21h ;;AN000;; Write character - 36840 ; DOS - DISPLAY OUTPUT - 36841 ; DL = character to send to standard output - 36842 0000577E 1F pop ds ;;AN000;; - 36843 0000577F 88D0 mov al,dl ;;AN000;; Get the character in AL - 36844 00005781 E8AC00 call $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character - 36845 00005784 1E push ds ;;AN000;; - 36846 00005785 06 push es ;;AN000;; - 36847 00005786 1F pop ds ;;AN000;; Set DS to segment of message text - 36848 00005787 7316 jnc short $MIF120 ; * - 36849 - 36850 00005789 268A5501 mov dl,[es:di+1] ;;AN000;; Get the next character - 36851 0000578D CD21 int 21h ;;AN000;; Write character - 36852 ; DOS - DISPLAY OUTPUT - 36853 ; DL = character to send to standard output - 36854 ; 08/04/2023 - 36855 ;clc ;;AN000;; Clear the DBCS indicator - 36856 ;$MIF120: - 36857 0000578F EB0D jmp short $MEN119 - 36858 $MIF119: - 36859 ; 08/04/2023 - 36860 ;mov ah,2 ; DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER - 36861 ;$MDO123: - 36862 00005791 09C9 or cx,cx ;;AN002;; Are there any left to display? - 36863 ;jz short $MEN123 - 36864 ; 18/04/2023 - 36865 00005793 740A jz short $MIF120 ; cf = 0 - 36866 $MDO123: ; 08/04/2023 - 36867 00005795 268A15 mov dl,[es:di] ;;AN002;; Get the character - 36868 00005798 CD21 int 21h ;;AN002;; Display the character - 36869 ; DOS - DISPLAY OUTPUT - 36870 ; DL = character to send to standard output - 36871 0000579A 47 inc di ;;AN002;; Set pointer to next character - 36872 0000579B 49 dec cx ;;AN002;; Count this character - 36873 0000579C 75F7 jnz short $MDO123 - 36874 ;$MEN123: - 36875 $MEN119: - 36876 0000579E F8 clc ;;AN000;;Char functions used don't return carry as error - 36877 $MIF120: ; 08/04/2023 ; * - 36878 0000579F 1F pop ds ;;AN000;; - 36879 000057A0 C3 retn - 36880 - 36881 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36882 ;; - 36883 ;; Scan_ctrlZ: This routine looks through the string to be printed and - 36884 ;; truncates it at the Ctrl-Z if any present. + 36833 ; 08/04/2023 + 36834 00005772 B402 mov ah,2 ; DOS_DISP_CHAR + 36835 + 36836 ;cmp cx,$M_SINGLE_CHAR ;;AN000;; Is this a single character? + 36837 00005774 83F901 cmp cx,1 ; $M_SINGLE_CHAR + 36838 00005777 7518 jne short $MIF119 ;;AN000;; No + 36839 + 36840 ;mov ah,2 ; DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER + 36841 00005779 268A15 mov dl,[es:di] ;;AN000;; Get the character + 36842 0000577C CD21 int 21h ;;AN000;; Write character + 36843 ; DOS - DISPLAY OUTPUT + 36844 ; DL = character to send to standard output + 36845 0000577E 1F pop ds ;;AN000;; + 36846 0000577F 88D0 mov al,dl ;;AN000;; Get the character in AL + 36847 00005781 E8AC00 call $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character + 36848 00005784 1E push ds ;;AN000;; + 36849 00005785 06 push es ;;AN000;; + 36850 00005786 1F pop ds ;;AN000;; Set DS to segment of message text + 36851 00005787 7316 jnc short $MIF120 ; * + 36852 + 36853 00005789 268A5501 mov dl,[es:di+1] ;;AN000;; Get the next character + 36854 0000578D CD21 int 21h ;;AN000;; Write character + 36855 ; DOS - DISPLAY OUTPUT + 36856 ; DL = character to send to standard output + 36857 ; 08/04/2023 + 36858 ;clc ;;AN000;; Clear the DBCS indicator + 36859 ;$MIF120: + 36860 0000578F EB0D jmp short $MEN119 + 36861 $MIF119: + 36862 ; 08/04/2023 + 36863 ;mov ah,2 ; DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER + 36864 ;$MDO123: + 36865 00005791 09C9 or cx,cx ;;AN002;; Are there any left to display? + 36866 ;jz short $MEN123 + 36867 ; 18/04/2023 + 36868 00005793 740A jz short $MIF120 ; cf = 0 + 36869 $MDO123: ; 08/04/2023 + 36870 00005795 268A15 mov dl,[es:di] ;;AN002;; Get the character + 36871 00005798 CD21 int 21h ;;AN002;; Display the character + 36872 ; DOS - DISPLAY OUTPUT + 36873 ; DL = character to send to standard output + 36874 0000579A 47 inc di ;;AN002;; Set pointer to next character + 36875 0000579B 49 dec cx ;;AN002;; Count this character + 36876 0000579C 75F7 jnz short $MDO123 + 36877 ;$MEN123: + 36878 $MEN119: + 36879 0000579E F8 clc ;;AN000;;Char functions used don't return carry as error + 36880 $MIF120: ; 08/04/2023 ; * + 36881 0000579F 1F pop ds ;;AN000;; + 36882 000057A0 C3 retn + 36883 + 36884 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 36885 ;; - 36886 ;; ENTRY: ds:dx = String to be displayed - 36887 ;; cx = number of chars to be displayed + 36886 ;; Scan_ctrlZ: This routine looks through the string to be printed and + 36887 ;; truncates it at the Ctrl-Z if any present. 36888 ;; - 36889 ;; EXIT: cx = number of chars to be displayed - 36890 ;; - 36891 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36892 - 36893 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36894 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36895 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36896 scan_ctrlz: - 36897 000057A1 57 push di - 36898 000057A2 50 push ax - 36899 000057A3 06 push es - 36900 000057A4 53 push bx - 36901 - 36902 000057A5 89D7 mov di,dx - 36903 000057A7 1E push ds - 36904 000057A8 07 pop es ;es:di points at string - 36905 - 36906 000057A9 89CB mov bx,cx ;save current count - 36907 - 36908 000057AB B01A mov al,1Ah ; Ctrl-Z - 36909 000057AD FC cld - 36910 000057AE F2AE repne scasb ;find first Ctrl-Z - 36911 000057B0 7503 jnz short noCtrlZ ;no CtrlZ found in string - 36912 - 36913 000057B2 29CB sub bx,cx - 36914 000057B4 4B dec bx ;bx = new count to display - 36915 noCtrlZ: - 36916 000057B5 89D9 mov cx,bx ;cx = actual display count - 36917 - 36918 000057B7 5B pop bx - 36919 000057B8 07 pop es - 36920 000057B9 58 pop ax - 36921 000057BA 5F pop di - 36922 $MIF127: ; 08/04/2023 - 36923 000057BB C3 retn - 36924 - 36925 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36926 ;; - 36927 ;; PROC NAME: $M_DISPLAY_H_STRING - 36928 ;; - 36929 ;; FUNCTION: Will display a string to a specified handle - 36930 ;; INPUTS: ES:DI points to beginning of message - 36931 ;; CX contains the number of bytes to write - 36932 ;; BX contains the handle to write to - 36933 ;; OUPUTS: None - 36934 ;; REGS USED: AX,DX - 36935 ;; - 36936 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 36937 - 36938 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 36939 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 36940 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 36941 $M_DISPLAY_H_STRING: - 36942 000057BC 31C0 xor ax,ax ;;AN002;; Set number of bytes written to 0 - 36943 000057BE 09C9 or cx,cx ;;AN002;; For performance, don't write if not necessary - 36944 000057C0 74F9 jz short $MIF127 - 36945 - 36946 000057C2 1E push ds ;;AN000;; - 36947 000057C3 06 push es ;;AN000;; - 36948 000057C4 1F pop ds ;;AN000;; Set DS to segment of message text - 36949 - 36950 000057C5 B440 mov ah,40h ; DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle - 36951 000057C7 89FA mov dx,di ;;AN000;; Pointer to data to write - 36952 - 36953 000057C9 83F901 cmp cx,1 ; $M_SINGLE_CHAR ;;AN000;; Is this a single character? - 36954 000057CC 7528 jne short $MIF128 ;;AN000;; No + 36889 ;; ENTRY: ds:dx = String to be displayed + 36890 ;; cx = number of chars to be displayed + 36891 ;; + 36892 ;; EXIT: cx = number of chars to be displayed + 36893 ;; + 36894 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36895 + 36896 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36897 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36898 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36899 scan_ctrlz: + 36900 000057A1 57 push di + 36901 000057A2 50 push ax + 36902 000057A3 06 push es + 36903 000057A4 53 push bx + 36904 + 36905 000057A5 89D7 mov di,dx + 36906 000057A7 1E push ds + 36907 000057A8 07 pop es ;es:di points at string + 36908 + 36909 000057A9 89CB mov bx,cx ;save current count + 36910 + 36911 000057AB B01A mov al,1Ah ; Ctrl-Z + 36912 000057AD FC cld + 36913 000057AE F2AE repne scasb ;find first Ctrl-Z + 36914 000057B0 7503 jnz short noCtrlZ ;no CtrlZ found in string + 36915 + 36916 000057B2 29CB sub bx,cx + 36917 000057B4 4B dec bx ;bx = new count to display + 36918 noCtrlZ: + 36919 000057B5 89D9 mov cx,bx ;cx = actual display count + 36920 + 36921 000057B7 5B pop bx + 36922 000057B8 07 pop es + 36923 000057B9 58 pop ax + 36924 000057BA 5F pop di + 36925 $MIF127: ; 08/04/2023 + 36926 000057BB C3 retn + 36927 + 36928 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36929 ;; + 36930 ;; PROC NAME: $M_DISPLAY_H_STRING + 36931 ;; + 36932 ;; FUNCTION: Will display a string to a specified handle + 36933 ;; INPUTS: ES:DI points to beginning of message + 36934 ;; CX contains the number of bytes to write + 36935 ;; BX contains the handle to write to + 36936 ;; OUPUTS: None + 36937 ;; REGS USED: AX,DX + 36938 ;; + 36939 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 36940 + 36941 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 36942 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 36943 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 36944 $M_DISPLAY_H_STRING: + 36945 000057BC 31C0 xor ax,ax ;;AN002;; Set number of bytes written to 0 + 36946 000057BE 09C9 or cx,cx ;;AN002;; For performance, don't write if not necessary + 36947 000057C0 74F9 jz short $MIF127 + 36948 + 36949 000057C2 1E push ds ;;AN000;; + 36950 000057C3 06 push es ;;AN000;; + 36951 000057C4 1F pop ds ;;AN000;; Set DS to segment of message text + 36952 + 36953 000057C5 B440 mov ah,40h ; DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle + 36954 000057C7 89FA mov dx,di ;;AN000;; Pointer to data to write 36955 - 36956 000057CE CD21 int 21h ;;AN000;; Write character - 36957 ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 36958 ; BX = file handle, CX = number of bytes to writ - 36959 - 36960 000057D0 1F pop ds ;;AN000;; Set DS to segment of message text - 36961 000057D1 50 push ax ;;AN000;; - 36962 000057D2 268A05 mov al,[es:di] ;;AN000;; Get the character - 36963 000057D5 E85800 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character - 36964 000057D8 58 pop ax ;;AN000;; - 36965 000057D9 1E push ds ;;AN000;; - 36966 000057DA 06 push es ;;AN000;; - 36967 000057DB 1F pop ds ;;AN000;; Set DS to segment of message text - 36968 000057DC 7306 jnc short $MIF129 - 36969 - 36970 000057DE F8 clc ;;AN000;; Clear the DBCS indicator - 36971 000057DF B440 mov ah,40h ; DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle - 36972 000057E1 42 inc dx ;;AN000;; Point to next character - 36973 000057E2 CD21 int 21h ;;AN000;; Write character - 36974 ; DOS - 2+ - WRITE TO FILE WITH HANDLE - 36975 ; BX = file handle, CX = number of bytes to write, - 36976 $MIF129: - 36977 ;SR; - 36978 ; If the single char happened to be a Ctrl-Z, the dos write would return - 36979 ;0 chars written making the caller think there was an error writing. To - 36980 ;avoid this, we check if the single char was a Ctrl-Z and if so, return that - 36981 ;the char was written, thus fooling the caller. - 36982 - 36983 000057E4 9C pushf ;save flags - 36984 000057E5 26803D1A cmp byte [es:di],1Ah ;is char a Ctrl-Z? - 36985 000057E9 7502 jne short m_popf_j ;no, continue - 36986 - 36987 000057EB 89C8 mov ax,cx ;yes, fake as if it was written - 36988 m_popf_j: - 36989 ; 08/04/2023 - 36990 ;$M_POPF ; macro in 'sysmsg.inc' (MSDOS 6.0) - 36991 000057ED EB01 jmp short m_popf ;restore flags - 36992 - 36993 ; 07/04/2023 - 36994 ; --------------------------- - 36995 ; MSDOS 6.0, SYSMSG.INC, 1991 - 36996 ; --------------------------- - 36997 ; $M_POPF macro - 36998 ;jmp short $+3 - 36999 intret: - 37000 000057EF CF iret - 37001 m_popf: - 37002 000057F0 0E push cs - 37003 000057F1 E8FBFF call intret - 37004 ;;; end macro - 37005 ; --------------------------- - 37006 - 37007 000057F4 EB18 jmp short $MEN128 - 37008 - 37009 $MIF128: - 37010 ;SR; - 37011 ; Prescan the string looking for Ctrl-Z. We terminate the message the moment - 37012 ;we hit a Ctrl-Z. cx will contain the number of characters to be printed. - 37013 - 37014 000057F6 55 push bp ; M007 - 37015 000057F7 51 push cx - 37016 000057F8 E8A6FF call scan_ctrlz ;cx = count without Ctrl-Z - 37017 000057FB 89CD mov bp,cx ;store no ^Z count in bp ;M007 - 37018 000057FD 59 pop cx ;get old count back ;M007 - 37019 - 37020 000057FE CD21 int 21h ;;AN000;; Write String at DS:SI to handle - 37021 ;jnc short chk_count ;no error, adjust return count - 37022 ;jmp short m_cnt_ok ;error, return with carry set;M007 - 37023 ; 08/04/2023 - 37024 00005800 720B jc short m_cnt_ok - 37025 ;M007 - 37026 ; If we are writing to con and there is a Ctrl-Z in the string, the - 37027 ;return count will be much less and if this returns to the caller we can get - 37028 ;spurious error messages. We check here if the count returned is same as - 37029 ;original count or same as the count if we stop at Ctrl-Z. In the second - 37030 ;case, we fake it as if all bytes have been written. If the return count - 37031 ;does not match either count, then we had some other disk error (such as - 37032 ;insufficient disk space) and we pass it through - 37033 - 37034 chk_count: - 37035 00005802 39C1 cmp cx,ax ;have all bytes been written?;M007 - 37036 00005804 7407 je short m_cnt_ok ;there was an error writing ;M007 - 37037 00005806 39C5 cmp bp,ax ;count = Ctrl-Z count? ;M007 - 37038 00005808 F8 clc ;no error either way ;M007 - 37039 00005809 7502 jne short m_cnt_ok ;no, pass it through ;M007 - 37040 0000580B 89C8 mov ax,cx ;return old count ;M007 - 37041 m_cnt_ok: ; M007 - 37042 0000580D 5D pop bp ; M007 - 37043 $MEN128: - 37044 0000580E 1F pop ds ;;AN000;; - 37045 ;$MIF127: ; 08/04/2023 - 37046 0000580F C3 retn - 37047 - 37048 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37049 ;; - 37050 ;; PROC NAME: $M_GET_EXT_ERR_39 - 37051 ;; - 37052 ;; FUNCTION: Will set registers for extended error #39 - 37053 ;; INPUTS: None - 37054 ;; OUPUTS: AX,BX,CX set - 37055 ;; REGS USED: - 37056 ;; - 37057 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37058 - 37059 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37060 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:542Dh + 36956 000057C9 83F901 cmp cx,1 ; $M_SINGLE_CHAR ;;AN000;; Is this a single character? + 36957 000057CC 7528 jne short $MIF128 ;;AN000;; No + 36958 + 36959 000057CE CD21 int 21h ;;AN000;; Write character + 36960 ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 36961 ; BX = file handle, CX = number of bytes to writ + 36962 + 36963 000057D0 1F pop ds ;;AN000;; Set DS to segment of message text + 36964 000057D1 50 push ax ;;AN000;; + 36965 000057D2 268A05 mov al,[es:di] ;;AN000;; Get the character + 36966 000057D5 E85800 CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character + 36967 000057D8 58 pop ax ;;AN000;; + 36968 000057D9 1E push ds ;;AN000;; + 36969 000057DA 06 push es ;;AN000;; + 36970 000057DB 1F pop ds ;;AN000;; Set DS to segment of message text + 36971 000057DC 7306 jnc short $MIF129 + 36972 + 36973 000057DE F8 clc ;;AN000;; Clear the DBCS indicator + 36974 000057DF B440 mov ah,40h ; DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle + 36975 000057E1 42 inc dx ;;AN000;; Point to next character + 36976 000057E2 CD21 int 21h ;;AN000;; Write character + 36977 ; DOS - 2+ - WRITE TO FILE WITH HANDLE + 36978 ; BX = file handle, CX = number of bytes to write, + 36979 $MIF129: + 36980 ;SR; + 36981 ; If the single char happened to be a Ctrl-Z, the dos write would return + 36982 ;0 chars written making the caller think there was an error writing. To + 36983 ;avoid this, we check if the single char was a Ctrl-Z and if so, return that + 36984 ;the char was written, thus fooling the caller. + 36985 + 36986 000057E4 9C pushf ;save flags + 36987 000057E5 26803D1A cmp byte [es:di],1Ah ;is char a Ctrl-Z? + 36988 000057E9 7502 jne short m_popf_j ;no, continue + 36989 + 36990 000057EB 89C8 mov ax,cx ;yes, fake as if it was written + 36991 m_popf_j: + 36992 ; 08/04/2023 + 36993 ;$M_POPF ; macro in 'sysmsg.inc' (MSDOS 6.0) + 36994 000057ED EB01 jmp short m_popf ;restore flags + 36995 + 36996 ; 07/04/2023 + 36997 ; --------------------------- + 36998 ; MSDOS 6.0, SYSMSG.INC, 1991 + 36999 ; --------------------------- + 37000 ; $M_POPF macro + 37001 ;jmp short $+3 + 37002 intret: + 37003 000057EF CF iret + 37004 m_popf: + 37005 000057F0 0E push cs + 37006 000057F1 E8FBFF call intret + 37007 ;;; end macro + 37008 ; --------------------------- + 37009 + 37010 000057F4 EB18 jmp short $MEN128 + 37011 + 37012 $MIF128: + 37013 ;SR; + 37014 ; Prescan the string looking for Ctrl-Z. We terminate the message the moment + 37015 ;we hit a Ctrl-Z. cx will contain the number of characters to be printed. + 37016 + 37017 000057F6 55 push bp ; M007 + 37018 000057F7 51 push cx + 37019 000057F8 E8A6FF call scan_ctrlz ;cx = count without Ctrl-Z + 37020 000057FB 89CD mov bp,cx ;store no ^Z count in bp ;M007 + 37021 000057FD 59 pop cx ;get old count back ;M007 + 37022 + 37023 000057FE CD21 int 21h ;;AN000;; Write String at DS:SI to handle + 37024 ;jnc short chk_count ;no error, adjust return count + 37025 ;jmp short m_cnt_ok ;error, return with carry set;M007 + 37026 ; 08/04/2023 + 37027 00005800 720B jc short m_cnt_ok + 37028 ;M007 + 37029 ; If we are writing to con and there is a Ctrl-Z in the string, the + 37030 ;return count will be much less and if this returns to the caller we can get + 37031 ;spurious error messages. We check here if the count returned is same as + 37032 ;original count or same as the count if we stop at Ctrl-Z. In the second + 37033 ;case, we fake it as if all bytes have been written. If the return count + 37034 ;does not match either count, then we had some other disk error (such as + 37035 ;insufficient disk space) and we pass it through + 37036 + 37037 chk_count: + 37038 00005802 39C1 cmp cx,ax ;have all bytes been written?;M007 + 37039 00005804 7407 je short m_cnt_ok ;there was an error writing ;M007 + 37040 00005806 39C5 cmp bp,ax ;count = Ctrl-Z count? ;M007 + 37041 00005808 F8 clc ;no error either way ;M007 + 37042 00005809 7502 jne short m_cnt_ok ;no, pass it through ;M007 + 37043 0000580B 89C8 mov ax,cx ;return old count ;M007 + 37044 m_cnt_ok: ; M007 + 37045 0000580D 5D pop bp ; M007 + 37046 $MEN128: + 37047 0000580E 1F pop ds ;;AN000;; + 37048 ;$MIF127: ; 08/04/2023 + 37049 0000580F C3 retn + 37050 + 37051 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37052 ;; + 37053 ;; PROC NAME: $M_GET_EXT_ERR_39 + 37054 ;; + 37055 ;; FUNCTION: Will set registers for extended error #39 + 37056 ;; INPUTS: None + 37057 ;; OUPUTS: AX,BX,CX set + 37058 ;; REGS USED: + 37059 ;; + 37060 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37061 - 37062 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37063 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5BFAh + 37062 ; 08/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37063 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:542Dh 37064 - 37065 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37066 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5A81h - 37067 $M_GET_EXT_ERR_39: - 37068 00005810 B82700 mov ax,27h ; EXT_ERR_39 ;AN001; Set AX=39 - 37069 ;mov bx,(ERROR_CLASS_39 SHR 8) + ACTION_39 - 37070 00005813 BB0400 mov bx,4 ;AN001; Set BH=1 BL=4 - 37071 ;mov ch,LOCUS_39 ;AN001; Set CH=1 - 37072 00005816 B501 mov ch,1 ;AN001; - 37073 00005818 C3 retn ;AN001; - 37074 - 37075 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37076 ;; - 37077 ;; PROC NAME: $M_ADD_CRLF - 37078 ;; - 37079 ;; FUNCTION: Will decide whether to display a CRLF - 37080 ;; INPUTS: DX contains the Input/Class requested - 37081 ;; OUTPUTS: None - 37082 ;; REGS Revised: CX,ES,DI - 37083 ;; - 37084 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37085 - 37086 ; 09/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37087 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37088 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37089 $M_ADD_CRLF: - 37090 ;cmp dh,0FFh - 37091 00005819 80FEFF cmp dh,utility_msg_class ;;AN004;; Is it a utility message? - 37092 0000581C 7411 je short $MIF134 ;;AN004;; Yes - 37093 0000581E F6C680 test dh,80h ; $M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? - 37094 00005821 750C jnz short $MIF135 - 37095 ;;AN004;; No - 37096 00005823 1E push ds ;;AN004;; - 37097 00005824 07 pop es ;;AN004;; Set ES to data segment - 37098 00005825 8D3E[D798] lea di,[$M_RT+$M_RES_ADDRS.$M_CRLF] - 37099 ;lea di,[$M_RT+67] ;;AN004;; Point at CRLF message - 37100 00005829 B90200 mov cx,2 ; $M_CRLF_SIZE ;;AN004;; Set the message size - 37101 0000582C E80BFF call $M_DISPLAY_STRING ;;AN004;; Display the CRLF - 37102 $MIF135: - 37103 $MIF134: - 37104 0000582F C3 retn ;;AN004;; Return - 37105 - 37106 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37107 ;; - 37108 ;; PROC NAME: $M_IS_IT_DBCS - 37109 ;; - 37110 ;; FUNCTION: Will decide whether character is Single or Double Byte - 37111 ;; INPUTS: AL contains the byte to be checked - 37112 ;; OUTPUTS: Carry flag = 0 if byte is NOT in DBCS range - 37113 ;; Carry flag = 1 if byte IS in DBCS range - 37114 ;; REGS USED: All restored - 37115 ;; - 37116 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37117 - 37118 ; 09/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37119 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37120 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37121 $M_IS_IT_DBCS: - 37122 00005830 06 push es ;;AN000;; Save Extra Segment register - 37123 00005831 57 push di ;;AN000;; Save DI register - 37124 - 37125 00005832 C43E[D098] les di,[$M_RT+$M_RES_ADDRS.$M_DBCS_VEC] - 37126 ;les di,[$M_RT+60] ;;AN000;; - 37127 00005836 09FF or di,di ;;AN000;; Was the DBCS vector set? - 37128 00005838 7417 jz short $MIF138 ;;AN000;; No - 37129 $MDO139: - 37130 0000583A 26833D00 cmp word [es:di],0 ; $M_DBCS_TERM - 37131 ;;AN000;; Is this the terminating flag? - 37132 0000583E F8 clc ;;AN000;; - 37133 0000583F 7410 jz short $MEN139 - 37134 ;;AN000;; No - 37135 00005841 263A05 cmp al,[es:di] ;;AN000;; Does the character fall in the DBCS range? - 37136 00005844 7207 jnae short $MIF141 ; jb ;;AN000;; No - 37137 00005846 263A4501 cmp al,[es:di+1] ;;AN000;; Does the character fall in the DBCS range? - 37138 0000584A 7701 jnbe short $MIF141 ; ja ;;AN000;; No - 37139 ;;AN000;; Yes - 37140 0000584C F9 stc ;;AN000;; Set carry flag - 37141 $MIF141: - 37142 0000584D 47 inc di ;;AN000;; - 37143 0000584E 47 inc di ;;AN000;; - 37144 0000584F EBE9 jmp short $MDO139 ;;AN000;; Go to next vector - 37145 $MEN139: - 37146 $MIF138: - 37147 00005851 5F pop di ;;AN000;; Restore DI register - 37148 00005852 07 pop es ;;AN000;; Restore Extra Segment register - 37149 00005853 C3 retn ;;AN000;; Return - 37150 - 37151 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37152 ;; - 37153 ;; PROC NAME: $M_CONVERT2ASC - 37154 ;; - 37155 ;; FUNCTION: Convert a binary number to a ASCII string - 37156 ;; INPUTS: DX:AX contains the number to be converted - 37157 ;; $M_RT_DIVISOR contains the divisor - 37158 ;; OUTPUTS: CX contains the number of characters - 37159 ;; Top of stack --> Last character - 37160 ;; . . . - 37161 ;; Bot of stack --> First character - 37162 ;; REGS USED: - 37163 ;; - 37164 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37165 - 37166 ; 09/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37167 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37168 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37169 $M_CONVERT2ASC: - 37170 00005854 8F06[DA98] pop word [$M_RT+$M_RES_ADDRS.$M_RETURN_ADDR] - 37171 ;pop word [$M_RT+70] ;;AN000;; Save Return Address - 37172 - 37173 00005858 31DB xor bx,bx ;;AN000;; Use BX as a swapping register - 37174 0000585A 93 xchg bx,ax ;;AN000;; Initialize - Low Word in BX - 37175 0000585B 92 xchg ax,dx ;;AN000;; - High Word in AX - 37176 $MDO145: ;;AN000;; DO UNTIL Low Word becomes zero - 37177 0000585C F736[DE98] div word [$M_RT+$M_RES_ADDRS.$M_DIVISOR] - 37178 ;div word [$M_RT+74] ;;AN000;; Divide High Word by divisor - 37179 00005860 93 xchg bx,ax ;;AN000;; Setup to divide Low Word using remainder - 37180 ;;AN000;; and save reduced High Word in BX - 37181 00005861 F736[DE98] div word [$M_RT+$M_RES_ADDRS.$M_DIVISOR] - 37182 ;div word [$M_RT+74] ;;AN000;; Divide Low Word by divisor - 37183 - 37184 00005865 83FA09 cmp dx,9 ;;AN000;; Make a digit of the remainder - 37185 00005868 7605 jna short $MIF146 ;;AN000;; 0-9 - 37186 0000586A 80C237 add dl,55 ; add dl,37h ;;AN000;; Make A to F ASCII - 37187 0000586D EB03 jmp short $MEN146 - 37188 $MIF146: - 37189 0000586F 80C230 add dl,'0' ;;AN000;; Make 0 to 9 ASCII - 37190 $MEN146: - 37191 00005872 52 push dx ;;AN000;; Save the digit on the stack - 37192 00005873 41 inc cx ;;AN000;; Count that digit - 37193 00005874 09C0 or ax,ax ;;AN000;; Are we done? - 37194 00005876 7504 jnz short $MLL149 ;;AN000;; No - 37195 00005878 09DB or bx,bx ;;AN000;; AX and BX must be ZERO!! - 37196 0000587A 741F jz short $MEN145 ; * ; ax = 0 ;;AN000;; Yes - 37197 $MLL149: - 37198 0000587C 83F903 cmp cx,3 ; $M_FIRST_THOU ;;AN000;; Are we at the first thousands mark - 37199 ; 28/04/2023 - 37200 0000587F 740A je short $MIF153 - 37201 ; jne short $MIF150 ;;AN000;; No - 37202 ; ;cmp $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? - 37203 ; cmp byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' - 37204 ; ;cmp byte [si+0Ah],',' ; $M_COMMA - 37205 ; ;jne short $MIF151 - 37206 ; ; 09/04/2023 - 37207 ; jne short $MEN150 - 37208 ; ;;AN000;; Yes - 37209 ; push word [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA] - 37210 ; ;push word [$M_RT+83] ;;AN000;; Insert a thousand separator - 37211 ; inc cx ;;AN000;; - 37212 ;$MIF151: - 37213 ; jmp short $MEN150 - 37214 - 37215 $MIF150: - 37216 ; 15/06/2023 (6) - 37217 ; MSDOS 6.0 - 37218 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:54ABh - 37219 ;cmp cx,6 ; $M_SECOND_THOU ;;AN000;; Are we at the first thousands mark - 37220 ; 15/06/2023 (7) - 37221 ; MSDOS 6.22 - 37222 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5C78h - 37223 00005881 83F907 cmp cx,7 ; $M_SECOND_THOU ;;AN000;; Are we at the first thousands mark - 37224 - 37225 ; 28/04/2023 - 37226 00005884 7405 je short $MIF153 - 37227 ; jne short $MIF154 ;;AN000;; No - 37228 ; ;cmp $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? - 37229 ; cmp byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' - 37230 ; ;cmp byte [si+0Ah],',' ; $M_COMMA - 37231 ; ;jne short $MIF155 ;;AN000;; No - 37232 ; ; 09/04/2023 - 37233 ; jne short $MEN154 - 37234 ; ;;AN000;; Yes - 37235 ; push word [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA] - 37236 ; ;push word [$M_RT+83] ;;AN000;; Insert a thousand separator - 37237 ; inc cx ;;AN000;; - 37238 ;$MIF155: - 37239 ; jmp short $MEN154 - 37240 - 37241 $MIF154: - 37242 ; 15/06/2023 (9) - 37243 ; MSDOS 6.0 - 37244 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:54BDh - 37245 ;cmp cx,9 ; $M_THIRD_THOU ;;AN000;; Are we at the first thousands mark - 37246 ; 15/06/2023 (11) - 37247 ; MSDOS 6.22 - 37248 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5C8Ah - 37249 00005886 83F90B cmp cx,11 ; $M_THIRD_THOU ;;AN000;; Are we at the first thousands mark - 37250 00005889 750B jne short $MIF158 ;;AN000;; No - 37251 ; 28/04/2023 - 37252 $MIF153: - 37253 ;cmp $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? - 37254 0000588B 807C0A2C cmp byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' - 37255 ;cmp byte [si+0Ah],',' ; $M_COMMA - 37256 0000588F 7505 jne short $MIF159 ;;AN000;; No - 37257 ;;AN000;; Yes - 37258 00005891 FF36[E798] push word [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA] - 37259 ;push word [$M_RT+83] ;;AN000;; Insert a thousand separator - 37260 00005895 41 inc cx ;;AN000;; - 37261 $MIF159: - 37262 $MIF158: - 37263 $MEN154: - 37264 $MEN150: ;;AN000;; - 37265 00005896 93 xchg ax,bx ;;AN000;; Setup to divide the reduced High Word - 37266 ;;AN000;; and Revised Low Word - 37267 00005897 31D2 xor dx,dx ;;AN000;; Reset remainder - 37268 ; 28/04/2023 - 37269 00005899 EBC1 jmp short $MDO145 - 37270 ;$MEN145: + 37065 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37066 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5BFAh + 37067 + 37068 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37069 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5A81h + 37070 $M_GET_EXT_ERR_39: + 37071 00005810 B82700 mov ax,27h ; EXT_ERR_39 ;AN001; Set AX=39 + 37072 ;mov bx,(ERROR_CLASS_39 SHR 8) + ACTION_39 + 37073 00005813 BB0400 mov bx,4 ;AN001; Set BH=1 BL=4 + 37074 ;mov ch,LOCUS_39 ;AN001; Set CH=1 + 37075 00005816 B501 mov ch,1 ;AN001; + 37076 00005818 C3 retn ;AN001; + 37077 + 37078 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37079 ;; + 37080 ;; PROC NAME: $M_ADD_CRLF + 37081 ;; + 37082 ;; FUNCTION: Will decide whether to display a CRLF + 37083 ;; INPUTS: DX contains the Input/Class requested + 37084 ;; OUTPUTS: None + 37085 ;; REGS Revised: CX,ES,DI + 37086 ;; + 37087 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37088 + 37089 ; 09/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37090 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37091 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37092 $M_ADD_CRLF: + 37093 ;cmp dh,0FFh + 37094 00005819 80FEFF cmp dh,utility_msg_class ;;AN004;; Is it a utility message? + 37095 0000581C 7411 je short $MIF134 ;;AN004;; Yes + 37096 0000581E F6C680 test dh,80h ; $M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF? + 37097 00005821 750C jnz short $MIF135 + 37098 ;;AN004;; No + 37099 00005823 1E push ds ;;AN004;; + 37100 00005824 07 pop es ;;AN004;; Set ES to data segment + 37101 00005825 8D3E[D798] lea di,[$M_RT+$M_RES_ADDRS.$M_CRLF] + 37102 ;lea di,[$M_RT+67] ;;AN004;; Point at CRLF message + 37103 00005829 B90200 mov cx,2 ; $M_CRLF_SIZE ;;AN004;; Set the message size + 37104 0000582C E80BFF call $M_DISPLAY_STRING ;;AN004;; Display the CRLF + 37105 $MIF135: + 37106 $MIF134: + 37107 0000582F C3 retn ;;AN004;; Return + 37108 + 37109 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37110 ;; + 37111 ;; PROC NAME: $M_IS_IT_DBCS + 37112 ;; + 37113 ;; FUNCTION: Will decide whether character is Single or Double Byte + 37114 ;; INPUTS: AL contains the byte to be checked + 37115 ;; OUTPUTS: Carry flag = 0 if byte is NOT in DBCS range + 37116 ;; Carry flag = 1 if byte IS in DBCS range + 37117 ;; REGS USED: All restored + 37118 ;; + 37119 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37120 + 37121 ; 09/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37122 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37123 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37124 $M_IS_IT_DBCS: + 37125 00005830 06 push es ;;AN000;; Save Extra Segment register + 37126 00005831 57 push di ;;AN000;; Save DI register + 37127 + 37128 00005832 C43E[D098] les di,[$M_RT+$M_RES_ADDRS.$M_DBCS_VEC] + 37129 ;les di,[$M_RT+60] ;;AN000;; + 37130 00005836 09FF or di,di ;;AN000;; Was the DBCS vector set? + 37131 00005838 7417 jz short $MIF138 ;;AN000;; No + 37132 $MDO139: + 37133 0000583A 26833D00 cmp word [es:di],0 ; $M_DBCS_TERM + 37134 ;;AN000;; Is this the terminating flag? + 37135 0000583E F8 clc ;;AN000;; + 37136 0000583F 7410 jz short $MEN139 + 37137 ;;AN000;; No + 37138 00005841 263A05 cmp al,[es:di] ;;AN000;; Does the character fall in the DBCS range? + 37139 00005844 7207 jnae short $MIF141 ; jb ;;AN000;; No + 37140 00005846 263A4501 cmp al,[es:di+1] ;;AN000;; Does the character fall in the DBCS range? + 37141 0000584A 7701 jnbe short $MIF141 ; ja ;;AN000;; No + 37142 ;;AN000;; Yes + 37143 0000584C F9 stc ;;AN000;; Set carry flag + 37144 $MIF141: + 37145 0000584D 47 inc di ;;AN000;; + 37146 0000584E 47 inc di ;;AN000;; + 37147 0000584F EBE9 jmp short $MDO139 ;;AN000;; Go to next vector + 37148 $MEN139: + 37149 $MIF138: + 37150 00005851 5F pop di ;;AN000;; Restore DI register + 37151 00005852 07 pop es ;;AN000;; Restore Extra Segment register + 37152 00005853 C3 retn ;;AN000;; Return + 37153 + 37154 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37155 ;; + 37156 ;; PROC NAME: $M_CONVERT2ASC + 37157 ;; + 37158 ;; FUNCTION: Convert a binary number to a ASCII string + 37159 ;; INPUTS: DX:AX contains the number to be converted + 37160 ;; $M_RT_DIVISOR contains the divisor + 37161 ;; OUTPUTS: CX contains the number of characters + 37162 ;; Top of stack --> Last character + 37163 ;; . . . + 37164 ;; Bot of stack --> First character + 37165 ;; REGS USED: + 37166 ;; + 37167 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37168 + 37169 ; 09/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37170 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37171 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37172 $M_CONVERT2ASC: + 37173 00005854 8F06[DA98] pop word [$M_RT+$M_RES_ADDRS.$M_RETURN_ADDR] + 37174 ;pop word [$M_RT+70] ;;AN000;; Save Return Address + 37175 + 37176 00005858 31DB xor bx,bx ;;AN000;; Use BX as a swapping register + 37177 0000585A 93 xchg bx,ax ;;AN000;; Initialize - Low Word in BX + 37178 0000585B 92 xchg ax,dx ;;AN000;; - High Word in AX + 37179 $MDO145: ;;AN000;; DO UNTIL Low Word becomes zero + 37180 0000585C F736[DE98] div word [$M_RT+$M_RES_ADDRS.$M_DIVISOR] + 37181 ;div word [$M_RT+74] ;;AN000;; Divide High Word by divisor + 37182 00005860 93 xchg bx,ax ;;AN000;; Setup to divide Low Word using remainder + 37183 ;;AN000;; and save reduced High Word in BX + 37184 00005861 F736[DE98] div word [$M_RT+$M_RES_ADDRS.$M_DIVISOR] + 37185 ;div word [$M_RT+74] ;;AN000;; Divide Low Word by divisor + 37186 + 37187 00005865 83FA09 cmp dx,9 ;;AN000;; Make a digit of the remainder + 37188 00005868 7605 jna short $MIF146 ;;AN000;; 0-9 + 37189 0000586A 80C237 add dl,55 ; add dl,37h ;;AN000;; Make A to F ASCII + 37190 0000586D EB03 jmp short $MEN146 + 37191 $MIF146: + 37192 0000586F 80C230 add dl,'0' ;;AN000;; Make 0 to 9 ASCII + 37193 $MEN146: + 37194 00005872 52 push dx ;;AN000;; Save the digit on the stack + 37195 00005873 41 inc cx ;;AN000;; Count that digit + 37196 00005874 09C0 or ax,ax ;;AN000;; Are we done? + 37197 00005876 7504 jnz short $MLL149 ;;AN000;; No + 37198 00005878 09DB or bx,bx ;;AN000;; AX and BX must be ZERO!! + 37199 0000587A 741F jz short $MEN145 ; * ; ax = 0 ;;AN000;; Yes + 37200 $MLL149: + 37201 0000587C 83F903 cmp cx,3 ; $M_FIRST_THOU ;;AN000;; Are we at the first thousands mark + 37202 ; 28/04/2023 + 37203 0000587F 740A je short $MIF153 + 37204 ; jne short $MIF150 ;;AN000;; No + 37205 ; ;cmp $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? + 37206 ; cmp byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' + 37207 ; ;cmp byte [si+0Ah],',' ; $M_COMMA + 37208 ; ;jne short $MIF151 + 37209 ; ; 09/04/2023 + 37210 ; jne short $MEN150 + 37211 ; ;;AN000;; Yes + 37212 ; push word [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA] + 37213 ; ;push word [$M_RT+83] ;;AN000;; Insert a thousand separator + 37214 ; inc cx ;;AN000;; + 37215 ;$MIF151: + 37216 ; jmp short $MEN150 + 37217 + 37218 $MIF150: + 37219 ; 15/06/2023 (6) + 37220 ; MSDOS 6.0 + 37221 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:54ABh + 37222 ;cmp cx,6 ; $M_SECOND_THOU ;;AN000;; Are we at the first thousands mark + 37223 ; 15/06/2023 (7) + 37224 ; MSDOS 6.22 + 37225 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5C78h + 37226 00005881 83F907 cmp cx,7 ; $M_SECOND_THOU ;;AN000;; Are we at the first thousands mark + 37227 + 37228 ; 28/04/2023 + 37229 00005884 7405 je short $MIF153 + 37230 ; jne short $MIF154 ;;AN000;; No + 37231 ; ;cmp $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? + 37232 ; cmp byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' + 37233 ; ;cmp byte [si+0Ah],',' ; $M_COMMA + 37234 ; ;jne short $MIF155 ;;AN000;; No + 37235 ; ; 09/04/2023 + 37236 ; jne short $MEN154 + 37237 ; ;;AN000;; Yes + 37238 ; push word [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA] + 37239 ; ;push word [$M_RT+83] ;;AN000;; Insert a thousand separator + 37240 ; inc cx ;;AN000;; + 37241 ;$MIF155: + 37242 ; jmp short $MEN154 + 37243 + 37244 $MIF154: + 37245 ; 15/06/2023 (9) + 37246 ; MSDOS 6.0 + 37247 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:54BDh + 37248 ;cmp cx,9 ; $M_THIRD_THOU ;;AN000;; Are we at the first thousands mark + 37249 ; 15/06/2023 (11) + 37250 ; MSDOS 6.22 + 37251 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5C8Ah + 37252 00005886 83F90B cmp cx,11 ; $M_THIRD_THOU ;;AN000;; Are we at the first thousands mark + 37253 00005889 750B jne short $MIF158 ;;AN000;; No + 37254 ; 28/04/2023 + 37255 $MIF153: + 37256 ;cmp $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma? + 37257 0000588B 807C0A2C cmp byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' + 37258 ;cmp byte [si+0Ah],',' ; $M_COMMA + 37259 0000588F 7505 jne short $MIF159 ;;AN000;; No + 37260 ;;AN000;; Yes + 37261 00005891 FF36[E798] push word [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA] + 37262 ;push word [$M_RT+83] ;;AN000;; Insert a thousand separator + 37263 00005895 41 inc cx ;;AN000;; + 37264 $MIF159: + 37265 $MIF158: + 37266 $MEN154: + 37267 $MEN150: ;;AN000;; + 37268 00005896 93 xchg ax,bx ;;AN000;; Setup to divide the reduced High Word + 37269 ;;AN000;; and Revised Low Word + 37270 00005897 31D2 xor dx,dx ;;AN000;; Reset remainder 37271 ; 28/04/2023 - 37272 ;xor ax,ax ;;AN000;; Reset remainder - 37273 $MEN145: ; 09/04/2023 ; * ; ax = 0 - 37274 0000589B 31D2 xor dx,dx ;;AN000;; Reset remainder - 37275 0000589D FF36[DA98] push word [$M_RT+$M_RES_ADDRS.$M_RETURN_ADDR] - 37276 ;push word [$M_RT+70] ;;AN000;; Restore Return Address - 37277 000058A1 C3 retn ;;AN000;; Return - 37278 - 37279 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37280 ;; - 37281 ;; PROC NAME: $M_DISPLAY_MESSAGE - 37282 ;; - 37283 ;; FUNCTION: Will display or write entire message (with replacable parameters) - 37284 ;; INPUTS: ES:DI points to beginning of message - 37285 ;; DS:SI points to first sublist structure in chain - 37286 ;; BX contains the handle to write to (if applicable) - 37287 ;; CX contains the length of string to write (before substitutions) - 37288 ;; BP contains the count of replacables - 37289 ;; - 37290 ;; OUTPUTS: - 37291 ;; REGS USED: All + 37272 00005899 EBC1 jmp short $MDO145 + 37273 ;$MEN145: + 37274 ; 28/04/2023 + 37275 ;xor ax,ax ;;AN000;; Reset remainder + 37276 $MEN145: ; 09/04/2023 ; * ; ax = 0 + 37277 0000589B 31D2 xor dx,dx ;;AN000;; Reset remainder + 37278 0000589D FF36[DA98] push word [$M_RT+$M_RES_ADDRS.$M_RETURN_ADDR] + 37279 ;push word [$M_RT+70] ;;AN000;; Restore Return Address + 37280 000058A1 C3 retn ;;AN000;; Return + 37281 + 37282 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37283 ;; + 37284 ;; PROC NAME: $M_DISPLAY_MESSAGE + 37285 ;; + 37286 ;; FUNCTION: Will display or write entire message (with replacable parameters) + 37287 ;; INPUTS: ES:DI points to beginning of message + 37288 ;; DS:SI points to first sublist structure in chain + 37289 ;; BX contains the handle to write to (if applicable) + 37290 ;; CX contains the length of string to write (before substitutions) + 37291 ;; BP contains the count of replacables 37292 ;; - 37293 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37294 - 37295 ; 10/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37296 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:54DBh + 37293 ;; OUTPUTS: + 37294 ;; REGS USED: All + 37295 ;; + 37296 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37297 - 37298 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37299 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:54DBh + 37298 ; 10/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37299 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:54DBh 37300 - 37301 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37302 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5B2Eh + 37301 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37302 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:54DBh 37303 - 37304 $M_DISPLAY_MESSAGE: - 37305 ; $DO ;;AN000;; Note: DS:SI -> message - 37306 $MDO165: - 37307 000058A2 31D2 xor dx,dx ;;AN000;; Set size = 0 - 37308 000058A4 09C9 or cx,cx ;;AN000;; Are we finished the message yet? - 37309 ;; $IF NZ ;;AN000;; No - 37310 000058A6 741F jz short $MIF166 ;;AN000;; Yes - 37311 ;mov ah,"%" ;;AN000;; Prepare to scan for % - 37312 ;mov al,0 ;;AN004;; - 37313 ; 12/08/2024 - 37314 000058A8 B80025 mov ax,2500h - 37315 ;; $DO ;;AN000;; Scan through string until % - 37316 $MDO167: - 37317 000058AB 263825 cmp byte [es:di],ah ;;AN000;; Is this character NOT a % - 37318 ;; $LEAVE E,AND ;;AN000;; No - 37319 000058AE 750A jne short $MLL168 - 37320 000058B0 26386501 cmp byte [es:di+1],ah ;;AN000;; Is the next character also a % - 37321 ;; $LEAVE NE,AND ;;AN000;; No - 37322 000058B4 7404 je short $MLL168 - 37323 - 37324 000058B6 38E0 cmp al,ah ;;AN000;; Was the character before a % - 37325 ;; $LEAVE NE ;;AN000;; No, GREAT found it - 37326 000058B8 750D jne short $MEN167 ; 12/08/2024 - 37327 $MLL168: - 37328 000058BA 268A05 mov al,[es:di] ;;AN004;; Yes, (to any of the above) - 37329 000058BD E870FF call $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? - 37330 ;;; $IF C ;;AN004;; Yes - 37331 000058C0 7301 jnc short $MIF169 - 37332 000058C2 47 inc di ;;AN004;; Increment past second part - 37333 ;;; $ENDIF ;;AN004;; - 37334 $MIF169: - 37335 000058C3 47 inc di ;;AN000;; Next character in string - 37336 000058C4 42 inc dx ;;AN000;; Size = Size + 1 - 37337 ;dec cx ;;AN000;; Decrement total size - 37338 ;; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line - 37339 ;jnz short $MDO167 - 37340 ; 12/08/2024 - 37341 000058C5 E2E4 loop $MDO167 - 37342 $MEN167: - 37343 ;; $ENDIF ;;AN000;; - 37344 $MIF166: - 37345 000058C7 56 push si ;;AN000;; Save beginning of sublists - 37346 000058C8 87CA xchg cx,dx ;;AN000;; Get size of message to display (tot sz in DX) - 37347 000058CA 09ED or bp,bp ;;AN000;; Do we have any replacables to do? - 37348 ;; $IF NZ ;;AN000;; Yes - 37349 000058CC 7431 jz short $MIF173 - 37350 000058CE 4D dec bp ;;AN000;; Decrement number of replacables - 37351 - 37352 ;; Search through sublists to find applicable one - 37353 - 37354 000058CF 833E[DC98]00 cmp word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL - 37355 ;cmp word [$M_RT+72],0 ;;AN000;; Is this an Extended/Parse case - 37356 ;;; $IF E ;;AN000;; No - 37357 000058D4 7529 jne short $MIF174 - 37358 ;;; $SEARCH ;;AN000;; - 37359 $MDO175: - 37360 ;mov al,$M_SL.$M_S_ID ;$M_SL=DS:[SI] ;;AN000;; Get ID byte - 37361 000058D6 8A4406 mov al,[si+$M_SUBLIST_STRUC.$M_S_ID] - 37362 ;mov al,[si+6] - 37363 000058D9 0430 add al,30h ;;AN000;; Convert to ASCII - 37364 ; 28/04/2023 - 37365 000058DB 263A4501 cmp al,[es:di+1] ;;AN000;; Is this the right sublist? - 37366 ;;; $EXITIF E ;;AN000;; - 37367 ;jne short $MIF175 - 37368 ;;; $ORELSE ;;AN000;; No - 37369 ;jmp short $MSR175 - 37370 ; 28/04/2023 - 37371 000058DF 741E je short $MSR175 - 37372 $MIF175: - 37373 000058E1 3C30 cmp al,30h ; $M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 - 37374 ;;; $LEAVE E,AND ;;AN000;; Yes - 37375 000058E3 7504 jne short $MLL178 - 37376 000058E5 09D2 or dx,dx ;;AN000;; Are we at the end of the message? - 37377 ;;; $LEAVE Z ;;AN000;; No - 37378 000058E7 7404 jz short $MEN175 - 37379 $MLL178: - 37380 ;add si,$M_SL.$M_S_SIZE ;;AN000;; Next SUBLIST - 37381 ;add si,[si+$M_SUBLIST_STRUC.$M_S_SIZE] ; [si+0] - 37382 ;;add si,[si+0] - 37383 000058E9 0334 add si,[si] - 37384 ;;; ENDLOOP ;;AN000;; Yes - 37385 000058EB EBE9 jmp short $MDO175 - 37386 $MEN175: - 37387 000058ED 803E[D998]FF cmp byte [$M_RT+$M_RES_ADDRS.$M_CLASS],utility_msg_class - 37388 ;cmp byte [$M_RT+69],0FFh ;;AN004;; Is it a utility message? - 37389 ;;;; $IF E ;;AN004;; Yes - 37390 000058F2 7508 jne short $MIF180 - 37391 000058F4 42 inc dx ;;AN000;; Remember to display CR,LF - 37392 000058F5 42 inc dx ;;AN000;; at the end of the message - 37393 000058F6 49 dec cx ;;AN000;; Adjust message length - 37394 000058F7 49 dec cx ;;AN000;; - 37395 000058F8 4F dec di ;;AN000;; Adjust ending address of message - 37396 000058F9 4F dec di ;;AN000;; - 37397 ;;;; $ELSE ;;AN004;; No - 37398 000058FA EB03 jmp short $MEN180 - 37399 $MIF180: - 37400 000058FC BAFFFF mov dx,-1 ;;AN004;; Set special case - 37401 ;;;; $ENDIF ;;AN004;; - 37402 $MEN180: - 37403 ;;; $ENDSRCH ;;AN000;; - 37404 $MSR175: - 37405 ;; $ENDIF ;;AN000;; - 37406 $MIF174: - 37407 ; $ENDIF ;;AN000;; - 37408 $MIF173: - 37409 ;; Prepare and display this part of message - 37410 - 37411 000058FF 57 push di ;;AN000;; Save pointer to replace number - 37412 00005900 29CF sub di,cx ;;AN000;; Determine beginning of string - 37413 00005902 E835FE call $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) - 37414 00005905 5F pop di ;;AN000;; Get back pointer to replace number - 37415 00005906 59 pop cx ;;AN000;; Clean up stack in case error - 37416 ; $LEAVE C,LONG ;;AN000;; Fail if carry was set - 37417 ;jnc short $MXL3 - 37418 ;jmp $MEN165 - 37419 ; 02/05/2023 - 37420 00005907 7214 jc short $MEN165 - 37421 $MXL3: - 37422 00005909 51 push cx ;;AN000;; - 37423 - 37424 ;; Save and reset pointer registers - 37425 - 37426 0000590A 89D1 mov cx,dx ;;AN000;; Get the size of the rest of the message - 37427 ;cmp $M_SL.$M_S_ID,$M_SPECIAL_CASE-30h - 37428 0000590C 807C0600 cmp byte [si+$M_SUBLIST_STRUC.$M_S_ID],0 ; $M_SPECIAL_CASE-30h - 37429 ;cmp byte [si+6],0 ;;AN000;; Is this the %0 case? - 37430 ; $IF NE ;;AN000;; No - 37431 00005910 7412 je short $MIF187 ;;AN000;; Yes - 37432 00005912 09C9 or cx,cx ;;AN000;; Are we finished the whole message? - 37433 ;; $IF NZ ;;AN000;; No - 37434 00005914 7406 jz short $MIF188 ;;AN000;; Yes - 37435 00005916 49 dec cx ;;AN000;; Decrement total size (%) - 37436 00005917 49 dec cx ;;AN000;; Decrement total size (#) - 37437 00005918 47 inc di ;;AN000;; Go past % - 37438 00005919 47 inc di ;;AN000;; Go past replace number - 37439 ;; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) - 37440 ;jmp short $MEN188 - 37441 ; 28/04/2023 - 37442 0000591A EB15 jmp short $MEN187 - 37443 $MIF188: - 37444 0000591C 5E pop si ;;AN000;; Get back pointer to beginning of SUBLISTs - 37445 ;; $ENDIF ;;AN000;; Yes, Note this will not leave because INC - 37446 $MEN188: - 37447 ; $ELSE ;;AN000;; - 37448 ;jmp short $MEN187 - 37449 ; 28/04/2023 - 37450 ; zf = 1 - 37451 ;jmp short $MEN165 - 37452 - 37453 ; 28/04/2023 - 37454 $MXL4: - 37455 $MLL214: - 37456 $MEN165: - 37457 0000591D C706[DC98]0000 mov word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 - 37458 ;mov word [$M_RT+72],0 ;;AN000;; IF there was an error displaying then EXIT - 37459 ;;AN000;; Reset message number to null - 37460 00005923 C3 retn ;;AN000;; Return - 37461 - 37462 $MIF187: - 37463 00005924 09C9 or cx,cx ;;AN000;; Are we finished the whole message? - 37464 ;; $IF Z ;;AN004;; No - 37465 ;jnz short $MIF192 - 37466 ;pop si ;;AN000;; Get back pointer to beginning of SUBLISTs - 37467 ;; $ELSE ;;AN000;; No - 37468 ;jmp short $MEN192 - 37469 ; 28/04/2023 - 37470 00005926 74F4 jz short $MIF188 - 37471 $MIF192: - 37472 00005928 83F9FF cmp cx,-1 ;;AN004;; Are we at the end of the message? - 37473 ;;; $IF Z ;;AN004;; No - 37474 0000592B 7502 jnz short $MIF194 - 37475 0000592D 31C9 xor cx,cx ;;AN004;; - 37476 ;;; $ENDIF ;;AN000;; - 37477 $MIF194: - 37478 0000592F 09FF or di,di ;;AN004;; Turn ZF off - 37479 ;; $ENDIF ;;AN000;; - 37480 $MEN192: - 37481 ; $ENDIF ;;AN000;; Note this will not leave because INC - 37482 $MEN187: - 37483 ; $LEAVE Z ;;AN000;; - 37484 00005931 74EA jz short $MEN165 - 37485 ; - 37486 00005933 55 push bp ;;AN000;; Save the replace count - 37487 00005934 57 push di ;;AN000;; Save location to complete message - 37488 00005935 06 push es ;;AN000;; - 37489 00005936 51 push cx ;;AN000;; Save size of the rest of the message - 37490 00005937 31C9 xor cx,cx ;;AN000;; Reset CX used for character count - 37491 - 37492 ;; Determine what action is required on parameter - 37493 - 37494 00005939 833E[DC98]00 cmp word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL - 37495 ;cmp word [$M_RT+72],0 ;;AN000;; Is this an Extended/Parse case - 37496 ; $IF E ;;AN000;; - 37497 0000593E 753B jne short $MIF199 - 37498 - 37499 ;test byte ptr $M_SL.$M_S_FLAG,not Char_Type and $M_TYPE_MASK - 37500 00005940 F644070F test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Fh - 37501 ;test byte [si+7],0Fh ;;AN000;; - 37502 ;; $IF Z ;;AN000;; - 37503 00005944 7508 jnz short $MIF200 - 37504 - 37505 ;; Character type requested - 37506 - 37507 ;les di,dword ptr $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter - 37508 00005946 C47C02 les di,[si+$M_SUBLIST_STRUC.$M_S_VALUE] - 37509 ;les di,[si+2] - 37510 00005949 E84801 call $M_CHAR_REPLACE ;;AN000;; - 37511 ;; $ELSE ;;AN000;; Get the rest of the message to display - 37512 0000594C EB28 jmp short $MEN200 - 37513 $MIF200: - 37514 ;; ENDIF ;;AN000;; - 37515 ;test byte ptr $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK - 37516 0000594E F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh - 37517 ;test byte [si+7],0Dh ;;AN000;; - 37518 ;; $IF Z,OR ;;AN000;; - 37519 00005952 740C jz short $MLL202 - 37520 ;test byte ptr $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK - 37521 00005954 F644070E test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh - 37522 ;test byte [si+7],0Eh ;;AN000;; - 37523 ;;; $IF Z,OR ;;AN000;; - 37524 00005958 7406 jz short $MLL202 - 37525 ;test byte ptr $M_SL.$M_S_FLAG,not Bin_Hex_Type and $M_TYPE_MASK - 37526 0000595A F644070C test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Ch - 37527 ;test byte [si+7],0Ch ;;AN000;; - 37528 ;;;; $IF Z ;;AN000;; - 37529 0000595E 7508 jnz short $MIF202 - 37530 $MLL202: - 37531 - 37532 ;; Numeric type requested - 37533 - 37534 ;les di,dword ptr $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter - 37535 00005960 C47C02 les di,[si+$M_SUBLIST_STRUC.$M_S_VALUE] - 37536 ;les di,[si+2] - 37537 00005963 E85601 call $M_BIN2ASC_REPLACE ;;AN000;; - 37538 ;;;; $ELSE ;;AN000;; Get the rest of the message to display - 37539 00005966 EB0E jmp short $MEN202 - 37540 $MIF202: - 37541 ;;;; ENDIF ;;AN000;; - 37542 ;test byte ptr $M_SL.$M_S_FLAG,not Date_Type and $M_TYPE_MASK - 37543 00005968 F644070B test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Bh - 37544 ;test byte [si+7],0Bh ;;AN000;; - 37545 ;;;; $IF E ;;AN000;; - 37546 0000596C 7505 jnz short $MIF204 - 37547 - 37548 ;; Date type requested - 37549 - 37550 0000596E E8EC01 call $M_DATE_REPLACE ;;AN000;; - 37551 ;;;; $ELSE ;;AN000;; Get the rest of the message to display - 37552 00005971 EB03 jmp short $MEN204 - 37553 $MIF204: ;;AN000;; - 37554 - 37555 ;; Time type requested (Default if we have not matched until here) - 37556 - 37557 00005973 E89E02 call $M_TIME_REPLACE ;;AN000;; - 37558 - 37559 ;;;; $ENDIF ;;AN000;; - 37560 $MEN204: - 37561 ;;; $ENDIF ;;AN000;; - 37562 $MEN202: - 37563 ;; $ENDIF ;;AN000;; - 37564 $MEN200: - 37565 - 37566 ;; With the replace information of the Stack, display the replaceable field - 37567 - 37568 00005976 E85F00 call $M_DISPLAY_REPLACE ;;AN000;; Display the replace - 37569 - 37570 ;; None of the above - Extended/Parse replace - 37571 ; $ELSE ;;AN000;; - 37572 00005979 EB03 jmp short $MEN199 - 37573 $MIF199: - 37574 0000597B E81600 call $M_EXT_PAR_REPLACE ;;AN000;; - 37575 ; $ENDIF ;;AN000;; - 37576 $MEN199: - 37577 - 37578 ;; We must go back and complete the message after the replacable parameter if there is any left - 37579 - 37580 ; $IF NC ;;AN000;; IF there was an error displaying then EXIT - 37581 0000597E 7207 jc short $MIF211 - 37582 ; - 37583 00005980 59 pop cx ;;AN000;; Get size of the rest of the message - 37584 00005981 07 pop es ;;AN000;; Get address of the rest of the message - 37585 00005982 5F pop di ;;AN000;; - 37586 00005983 5D pop bp ;;AN000;; Get replacment count - 37587 00005984 5E pop si ;;AN000;; ELSE get address of first sublist structure - 37588 ; $ELSE ;;AN000;; - 37589 00005985 EB03 jmp short $MEN211 - 37590 $MIF211: - 37591 00005987 83C40A add sp,10 ;;AN000;; Clean up stack if error - 37592 ; 28/04/2023 - 37593 ;stc ;;AN000;; - 37594 ; $ENDIF ;;AN000;; - 37595 $MEN211: - 37596 0000598A 833E[DC98]00 cmp word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL - 37597 ;cmp word [$M_RT+72],0 ;;AN000;; Is this an Extended/Parse case - 37598 ; $ENDDO NE,OR ;;AN000;; - 37599 0000598F 758C jne short $MLL214 - 37600 ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message - 37601 ; 10/04/2023 - 37602 ;jc short $MXL4 - 37603 00005991 E90EFF jmp $MDO165 - 37604 - 37605 ; 28/04/2023 - 37606 ;$MXL4: - 37607 ;$MLL214: - 37608 ;$MEN165: - 37609 ; mov word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 - 37610 ; ;mov word [$M_RT+72],0 ;;AN000;; IF there was an error displaying then EXIT - 37611 ; ;;AN000;; Reset message number to null - 37612 ; retn ;;AN000;; Return - 37613 - 37614 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37615 ;; - 37616 ;; PROC NAME: $M_EXT_PAR_REPLACE - 37617 ;; - 37618 ;; FUNCTION: - 37619 ;; INPUTS: - 37620 ;; OUPUTS: - 37621 ;; - 37622 ;; REGS USED: - 37623 ;; - 37624 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37625 - 37626 ; 11/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37627 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37628 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37629 - 37630 $M_EXT_PAR_REPLACE: - 37631 00005994 31D2 xor dx,dx ;;AN000;; Prepare for get binary value (HIGH) - 37632 00005996 A1[DC98] mov ax,[$M_RT+$M_RES_ADDRS.$M_MSG_NUM] - 37633 ;mov ax,[$M_RT+72] ;;AN000;; Prepare for get binary value (LOW) - 37634 00005999 C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 37635 ;mov word [$M_RT+74],10 ; $M_BASE10 ;;AN000;; Set default divisor - 37636 0000599F E8B2FE call $M_CONVERT2ASC ;;AN000;; - 37637 $MDO215: - 37638 000059A2 58 pop ax ;;AN000;; Get character in register - 37639 000059A3 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al - 37640 ;mov [bx+$M_RT+76],al ;;AN000;; Move char into the buffer - 37641 000059A7 43 inc bx ;;AN000;; Increase buffer count - 37642 000059A8 83FB40 cmp bx,$M_TEMP_BUF_SZ ; cmp bx,64 ;;AN000;; Is buffer full? - 37643 000059AB 7503 jne short $MIF216 ;;AN000;; No - 37644 000059AD E80D00 call $M_FLUSH_BUF ;;AN000;; Flush the buffer - 37645 $MIF216: - 37646 000059B0 FEC9 dec cl ;;AN000;; Have we completed replace? - 37647 000059B2 75EE jnz short $MDO215 - 37648 - 37649 000059B4 B80D0A mov ax,0A0Dh ; mov ax,$M_CR_LF ;;AN000;; Move char into the buffer - 37650 000059B7 8987[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],ax - 37651 ;;mov [bx+$M_RT+76],ax ;;AN000;; Move char into the buffer - 37652 000059BB 43 inc bx ;;AN000;; Increase buffer count - 37653 000059BC 43 inc bx ;;AN000;; Increase buffer count - 37654 ;call $M_FLUSH_BUF ;;AN000;; Flush the buffer - 37655 ;retn ;;AN000:: - 37656 ; 11/04/2023 - 37657 ;jmp $M_FLUSH_BUF - 37658 - 37659 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37660 ;; - 37661 ;; PROC NAME: $M_FLUSH_BUFFER - 37662 ;; - 37663 ;; FUNCTION: Display the contents of the temporary buffer - 37664 ;; INPUTS: DI contains the number of bytes to display - 37665 ;; OUTPUTS: BX reset to zero - 37666 ;; - 37667 ;; REGS USED: - 37668 ;; - 37669 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37670 - 37671 ; 11/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37672 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:56C8h - 37673 - 37674 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37675 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5E95h + 37304 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37305 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5B2Eh + 37306 + 37307 $M_DISPLAY_MESSAGE: + 37308 ; $DO ;;AN000;; Note: DS:SI -> message + 37309 $MDO165: + 37310 000058A2 31D2 xor dx,dx ;;AN000;; Set size = 0 + 37311 000058A4 09C9 or cx,cx ;;AN000;; Are we finished the message yet? + 37312 ;; $IF NZ ;;AN000;; No + 37313 000058A6 741F jz short $MIF166 ;;AN000;; Yes + 37314 ;mov ah,"%" ;;AN000;; Prepare to scan for % + 37315 ;mov al,0 ;;AN004;; + 37316 ; 12/08/2024 + 37317 000058A8 B80025 mov ax,2500h + 37318 ;; $DO ;;AN000;; Scan through string until % + 37319 $MDO167: + 37320 000058AB 263825 cmp byte [es:di],ah ;;AN000;; Is this character NOT a % + 37321 ;; $LEAVE E,AND ;;AN000;; No + 37322 000058AE 750A jne short $MLL168 + 37323 000058B0 26386501 cmp byte [es:di+1],ah ;;AN000;; Is the next character also a % + 37324 ;; $LEAVE NE,AND ;;AN000;; No + 37325 000058B4 7404 je short $MLL168 + 37326 + 37327 000058B6 38E0 cmp al,ah ;;AN000;; Was the character before a % + 37328 ;; $LEAVE NE ;;AN000;; No, GREAT found it + 37329 000058B8 750D jne short $MEN167 ; 12/08/2024 + 37330 $MLL168: + 37331 000058BA 268A05 mov al,[es:di] ;;AN004;; Yes, (to any of the above) + 37332 000058BD E870FF call $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS? + 37333 ;;; $IF C ;;AN004;; Yes + 37334 000058C0 7301 jnc short $MIF169 + 37335 000058C2 47 inc di ;;AN004;; Increment past second part + 37336 ;;; $ENDIF ;;AN004;; + 37337 $MIF169: + 37338 000058C3 47 inc di ;;AN000;; Next character in string + 37339 000058C4 42 inc dx ;;AN000;; Size = Size + 1 + 37340 ;dec cx ;;AN000;; Decrement total size + 37341 ;; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line + 37342 ;jnz short $MDO167 + 37343 ; 12/08/2024 + 37344 000058C5 E2E4 loop $MDO167 + 37345 $MEN167: + 37346 ;; $ENDIF ;;AN000;; + 37347 $MIF166: + 37348 000058C7 56 push si ;;AN000;; Save beginning of sublists + 37349 000058C8 87CA xchg cx,dx ;;AN000;; Get size of message to display (tot sz in DX) + 37350 000058CA 09ED or bp,bp ;;AN000;; Do we have any replacables to do? + 37351 ;; $IF NZ ;;AN000;; Yes + 37352 000058CC 7431 jz short $MIF173 + 37353 000058CE 4D dec bp ;;AN000;; Decrement number of replacables + 37354 + 37355 ;; Search through sublists to find applicable one + 37356 + 37357 000058CF 833E[DC98]00 cmp word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL + 37358 ;cmp word [$M_RT+72],0 ;;AN000;; Is this an Extended/Parse case + 37359 ;;; $IF E ;;AN000;; No + 37360 000058D4 7529 jne short $MIF174 + 37361 ;;; $SEARCH ;;AN000;; + 37362 $MDO175: + 37363 ;mov al,$M_SL.$M_S_ID ;$M_SL=DS:[SI] ;;AN000;; Get ID byte + 37364 000058D6 8A4406 mov al,[si+$M_SUBLIST_STRUC.$M_S_ID] + 37365 ;mov al,[si+6] + 37366 000058D9 0430 add al,30h ;;AN000;; Convert to ASCII + 37367 ; 28/04/2023 + 37368 000058DB 263A4501 cmp al,[es:di+1] ;;AN000;; Is this the right sublist? + 37369 ;;; $EXITIF E ;;AN000;; + 37370 ;jne short $MIF175 + 37371 ;;; $ORELSE ;;AN000;; No + 37372 ;jmp short $MSR175 + 37373 ; 28/04/2023 + 37374 000058DF 741E je short $MSR175 + 37375 $MIF175: + 37376 000058E1 3C30 cmp al,30h ; $M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0 + 37377 ;;; $LEAVE E,AND ;;AN000;; Yes + 37378 000058E3 7504 jne short $MLL178 + 37379 000058E5 09D2 or dx,dx ;;AN000;; Are we at the end of the message? + 37380 ;;; $LEAVE Z ;;AN000;; No + 37381 000058E7 7404 jz short $MEN175 + 37382 $MLL178: + 37383 ;add si,$M_SL.$M_S_SIZE ;;AN000;; Next SUBLIST + 37384 ;add si,[si+$M_SUBLIST_STRUC.$M_S_SIZE] ; [si+0] + 37385 ;;add si,[si+0] + 37386 000058E9 0334 add si,[si] + 37387 ;;; ENDLOOP ;;AN000;; Yes + 37388 000058EB EBE9 jmp short $MDO175 + 37389 $MEN175: + 37390 000058ED 803E[D998]FF cmp byte [$M_RT+$M_RES_ADDRS.$M_CLASS],utility_msg_class + 37391 ;cmp byte [$M_RT+69],0FFh ;;AN004;; Is it a utility message? + 37392 ;;;; $IF E ;;AN004;; Yes + 37393 000058F2 7508 jne short $MIF180 + 37394 000058F4 42 inc dx ;;AN000;; Remember to display CR,LF + 37395 000058F5 42 inc dx ;;AN000;; at the end of the message + 37396 000058F6 49 dec cx ;;AN000;; Adjust message length + 37397 000058F7 49 dec cx ;;AN000;; + 37398 000058F8 4F dec di ;;AN000;; Adjust ending address of message + 37399 000058F9 4F dec di ;;AN000;; + 37400 ;;;; $ELSE ;;AN004;; No + 37401 000058FA EB03 jmp short $MEN180 + 37402 $MIF180: + 37403 000058FC BAFFFF mov dx,-1 ;;AN004;; Set special case + 37404 ;;;; $ENDIF ;;AN004;; + 37405 $MEN180: + 37406 ;;; $ENDSRCH ;;AN000;; + 37407 $MSR175: + 37408 ;; $ENDIF ;;AN000;; + 37409 $MIF174: + 37410 ; $ENDIF ;;AN000;; + 37411 $MIF173: + 37412 ;; Prepare and display this part of message + 37413 + 37414 000058FF 57 push di ;;AN000;; Save pointer to replace number + 37415 00005900 29CF sub di,cx ;;AN000;; Determine beginning of string + 37416 00005902 E835FE call $M_DISPLAY_STRING ;;AN000;; Display string until % (or end) + 37417 00005905 5F pop di ;;AN000;; Get back pointer to replace number + 37418 00005906 59 pop cx ;;AN000;; Clean up stack in case error + 37419 ; $LEAVE C,LONG ;;AN000;; Fail if carry was set + 37420 ;jnc short $MXL3 + 37421 ;jmp $MEN165 + 37422 ; 02/05/2023 + 37423 00005907 7214 jc short $MEN165 + 37424 $MXL3: + 37425 00005909 51 push cx ;;AN000;; + 37426 + 37427 ;; Save and reset pointer registers + 37428 + 37429 0000590A 89D1 mov cx,dx ;;AN000;; Get the size of the rest of the message + 37430 ;cmp $M_SL.$M_S_ID,$M_SPECIAL_CASE-30h + 37431 0000590C 807C0600 cmp byte [si+$M_SUBLIST_STRUC.$M_S_ID],0 ; $M_SPECIAL_CASE-30h + 37432 ;cmp byte [si+6],0 ;;AN000;; Is this the %0 case? + 37433 ; $IF NE ;;AN000;; No + 37434 00005910 7412 je short $MIF187 ;;AN000;; Yes + 37435 00005912 09C9 or cx,cx ;;AN000;; Are we finished the whole message? + 37436 ;; $IF NZ ;;AN000;; No + 37437 00005914 7406 jz short $MIF188 ;;AN000;; Yes + 37438 00005916 49 dec cx ;;AN000;; Decrement total size (%) + 37439 00005917 49 dec cx ;;AN000;; Decrement total size (#) + 37440 00005918 47 inc di ;;AN000;; Go past % + 37441 00005919 47 inc di ;;AN000;; Go past replace number + 37442 ;; $ELSE ;;AN000;; Yes, (Note this will not leave because INC) + 37443 ;jmp short $MEN188 + 37444 ; 28/04/2023 + 37445 0000591A EB15 jmp short $MEN187 + 37446 $MIF188: + 37447 0000591C 5E pop si ;;AN000;; Get back pointer to beginning of SUBLISTs + 37448 ;; $ENDIF ;;AN000;; Yes, Note this will not leave because INC + 37449 $MEN188: + 37450 ; $ELSE ;;AN000;; + 37451 ;jmp short $MEN187 + 37452 ; 28/04/2023 + 37453 ; zf = 1 + 37454 ;jmp short $MEN165 + 37455 + 37456 ; 28/04/2023 + 37457 $MXL4: + 37458 $MLL214: + 37459 $MEN165: + 37460 0000591D C706[DC98]0000 mov word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 + 37461 ;mov word [$M_RT+72],0 ;;AN000;; IF there was an error displaying then EXIT + 37462 ;;AN000;; Reset message number to null + 37463 00005923 C3 retn ;;AN000;; Return + 37464 + 37465 $MIF187: + 37466 00005924 09C9 or cx,cx ;;AN000;; Are we finished the whole message? + 37467 ;; $IF Z ;;AN004;; No + 37468 ;jnz short $MIF192 + 37469 ;pop si ;;AN000;; Get back pointer to beginning of SUBLISTs + 37470 ;; $ELSE ;;AN000;; No + 37471 ;jmp short $MEN192 + 37472 ; 28/04/2023 + 37473 00005926 74F4 jz short $MIF188 + 37474 $MIF192: + 37475 00005928 83F9FF cmp cx,-1 ;;AN004;; Are we at the end of the message? + 37476 ;;; $IF Z ;;AN004;; No + 37477 0000592B 7502 jnz short $MIF194 + 37478 0000592D 31C9 xor cx,cx ;;AN004;; + 37479 ;;; $ENDIF ;;AN000;; + 37480 $MIF194: + 37481 0000592F 09FF or di,di ;;AN004;; Turn ZF off + 37482 ;; $ENDIF ;;AN000;; + 37483 $MEN192: + 37484 ; $ENDIF ;;AN000;; Note this will not leave because INC + 37485 $MEN187: + 37486 ; $LEAVE Z ;;AN000;; + 37487 00005931 74EA jz short $MEN165 + 37488 ; + 37489 00005933 55 push bp ;;AN000;; Save the replace count + 37490 00005934 57 push di ;;AN000;; Save location to complete message + 37491 00005935 06 push es ;;AN000;; + 37492 00005936 51 push cx ;;AN000;; Save size of the rest of the message + 37493 00005937 31C9 xor cx,cx ;;AN000;; Reset CX used for character count + 37494 + 37495 ;; Determine what action is required on parameter + 37496 + 37497 00005939 833E[DC98]00 cmp word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL + 37498 ;cmp word [$M_RT+72],0 ;;AN000;; Is this an Extended/Parse case + 37499 ; $IF E ;;AN000;; + 37500 0000593E 753B jne short $MIF199 + 37501 + 37502 ;test byte ptr $M_SL.$M_S_FLAG,not Char_Type and $M_TYPE_MASK + 37503 00005940 F644070F test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Fh + 37504 ;test byte [si+7],0Fh ;;AN000;; + 37505 ;; $IF Z ;;AN000;; + 37506 00005944 7508 jnz short $MIF200 + 37507 + 37508 ;; Character type requested + 37509 + 37510 ;les di,dword ptr $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter + 37511 00005946 C47C02 les di,[si+$M_SUBLIST_STRUC.$M_S_VALUE] + 37512 ;les di,[si+2] + 37513 00005949 E84801 call $M_CHAR_REPLACE ;;AN000;; + 37514 ;; $ELSE ;;AN000;; Get the rest of the message to display + 37515 0000594C EB28 jmp short $MEN200 + 37516 $MIF200: + 37517 ;; ENDIF ;;AN000;; + 37518 ;test byte ptr $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK + 37519 0000594E F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh + 37520 ;test byte [si+7],0Dh ;;AN000;; + 37521 ;; $IF Z,OR ;;AN000;; + 37522 00005952 740C jz short $MLL202 + 37523 ;test byte ptr $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK + 37524 00005954 F644070E test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh + 37525 ;test byte [si+7],0Eh ;;AN000;; + 37526 ;;; $IF Z,OR ;;AN000;; + 37527 00005958 7406 jz short $MLL202 + 37528 ;test byte ptr $M_SL.$M_S_FLAG,not Bin_Hex_Type and $M_TYPE_MASK + 37529 0000595A F644070C test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Ch + 37530 ;test byte [si+7],0Ch ;;AN000;; + 37531 ;;;; $IF Z ;;AN000;; + 37532 0000595E 7508 jnz short $MIF202 + 37533 $MLL202: + 37534 + 37535 ;; Numeric type requested + 37536 + 37537 ;les di,dword ptr $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter + 37538 00005960 C47C02 les di,[si+$M_SUBLIST_STRUC.$M_S_VALUE] + 37539 ;les di,[si+2] + 37540 00005963 E85601 call $M_BIN2ASC_REPLACE ;;AN000;; + 37541 ;;;; $ELSE ;;AN000;; Get the rest of the message to display + 37542 00005966 EB0E jmp short $MEN202 + 37543 $MIF202: + 37544 ;;;; ENDIF ;;AN000;; + 37545 ;test byte ptr $M_SL.$M_S_FLAG,not Date_Type and $M_TYPE_MASK + 37546 00005968 F644070B test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Bh + 37547 ;test byte [si+7],0Bh ;;AN000;; + 37548 ;;;; $IF E ;;AN000;; + 37549 0000596C 7505 jnz short $MIF204 + 37550 + 37551 ;; Date type requested + 37552 + 37553 0000596E E8EC01 call $M_DATE_REPLACE ;;AN000;; + 37554 ;;;; $ELSE ;;AN000;; Get the rest of the message to display + 37555 00005971 EB03 jmp short $MEN204 + 37556 $MIF204: ;;AN000;; + 37557 + 37558 ;; Time type requested (Default if we have not matched until here) + 37559 + 37560 00005973 E89E02 call $M_TIME_REPLACE ;;AN000;; + 37561 + 37562 ;;;; $ENDIF ;;AN000;; + 37563 $MEN204: + 37564 ;;; $ENDIF ;;AN000;; + 37565 $MEN202: + 37566 ;; $ENDIF ;;AN000;; + 37567 $MEN200: + 37568 + 37569 ;; With the replace information of the Stack, display the replaceable field + 37570 + 37571 00005976 E85F00 call $M_DISPLAY_REPLACE ;;AN000;; Display the replace + 37572 + 37573 ;; None of the above - Extended/Parse replace + 37574 ; $ELSE ;;AN000;; + 37575 00005979 EB03 jmp short $MEN199 + 37576 $MIF199: + 37577 0000597B E81600 call $M_EXT_PAR_REPLACE ;;AN000;; + 37578 ; $ENDIF ;;AN000;; + 37579 $MEN199: + 37580 + 37581 ;; We must go back and complete the message after the replacable parameter if there is any left + 37582 + 37583 ; $IF NC ;;AN000;; IF there was an error displaying then EXIT + 37584 0000597E 7207 jc short $MIF211 + 37585 ; + 37586 00005980 59 pop cx ;;AN000;; Get size of the rest of the message + 37587 00005981 07 pop es ;;AN000;; Get address of the rest of the message + 37588 00005982 5F pop di ;;AN000;; + 37589 00005983 5D pop bp ;;AN000;; Get replacment count + 37590 00005984 5E pop si ;;AN000;; ELSE get address of first sublist structure + 37591 ; $ELSE ;;AN000;; + 37592 00005985 EB03 jmp short $MEN211 + 37593 $MIF211: + 37594 00005987 83C40A add sp,10 ;;AN000;; Clean up stack if error + 37595 ; 28/04/2023 + 37596 ;stc ;;AN000;; + 37597 ; $ENDIF ;;AN000;; + 37598 $MEN211: + 37599 0000598A 833E[DC98]00 cmp word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 ; $M_NULL + 37600 ;cmp word [$M_RT+72],0 ;;AN000;; Is this an Extended/Parse case + 37601 ; $ENDDO NE,OR ;;AN000;; + 37602 0000598F 758C jne short $MLL214 + 37603 ; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message + 37604 ; 10/04/2023 + 37605 ;jc short $MXL4 + 37606 00005991 E90EFF jmp $MDO165 + 37607 + 37608 ; 28/04/2023 + 37609 ;$MXL4: + 37610 ;$MLL214: + 37611 ;$MEN165: + 37612 ; mov word [$M_RT+$M_RES_ADDRS.$M_MSG_NUM],0 + 37613 ; ;mov word [$M_RT+72],0 ;;AN000;; IF there was an error displaying then EXIT + 37614 ; ;;AN000;; Reset message number to null + 37615 ; retn ;;AN000;; Return + 37616 + 37617 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37618 ;; + 37619 ;; PROC NAME: $M_EXT_PAR_REPLACE + 37620 ;; + 37621 ;; FUNCTION: + 37622 ;; INPUTS: + 37623 ;; OUPUTS: + 37624 ;; + 37625 ;; REGS USED: + 37626 ;; + 37627 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37628 + 37629 ; 11/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37630 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37631 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37632 + 37633 $M_EXT_PAR_REPLACE: + 37634 00005994 31D2 xor dx,dx ;;AN000;; Prepare for get binary value (HIGH) + 37635 00005996 A1[DC98] mov ax,[$M_RT+$M_RES_ADDRS.$M_MSG_NUM] + 37636 ;mov ax,[$M_RT+72] ;;AN000;; Prepare for get binary value (LOW) + 37637 00005999 C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 37638 ;mov word [$M_RT+74],10 ; $M_BASE10 ;;AN000;; Set default divisor + 37639 0000599F E8B2FE call $M_CONVERT2ASC ;;AN000;; + 37640 $MDO215: + 37641 000059A2 58 pop ax ;;AN000;; Get character in register + 37642 000059A3 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al + 37643 ;mov [bx+$M_RT+76],al ;;AN000;; Move char into the buffer + 37644 000059A7 43 inc bx ;;AN000;; Increase buffer count + 37645 000059A8 83FB40 cmp bx,$M_TEMP_BUF_SZ ; cmp bx,64 ;;AN000;; Is buffer full? + 37646 000059AB 7503 jne short $MIF216 ;;AN000;; No + 37647 000059AD E80D00 call $M_FLUSH_BUF ;;AN000;; Flush the buffer + 37648 $MIF216: + 37649 000059B0 FEC9 dec cl ;;AN000;; Have we completed replace? + 37650 000059B2 75EE jnz short $MDO215 + 37651 + 37652 000059B4 B80D0A mov ax,0A0Dh ; mov ax,$M_CR_LF ;;AN000;; Move char into the buffer + 37653 000059B7 8987[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],ax + 37654 ;;mov [bx+$M_RT+76],ax ;;AN000;; Move char into the buffer + 37655 000059BB 43 inc bx ;;AN000;; Increase buffer count + 37656 000059BC 43 inc bx ;;AN000;; Increase buffer count + 37657 ;call $M_FLUSH_BUF ;;AN000;; Flush the buffer + 37658 ;retn ;;AN000:: + 37659 ; 11/04/2023 + 37660 ;jmp $M_FLUSH_BUF + 37661 + 37662 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37663 ;; + 37664 ;; PROC NAME: $M_FLUSH_BUFFER + 37665 ;; + 37666 ;; FUNCTION: Display the contents of the temporary buffer + 37667 ;; INPUTS: DI contains the number of bytes to display + 37668 ;; OUTPUTS: BX reset to zero + 37669 ;; + 37670 ;; REGS USED: + 37671 ;; + 37672 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37673 + 37674 ; 11/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37675 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:56C8h 37676 - 37677 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37678 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5D1Bh - 37679 $M_FLUSH_BUF: - 37680 000059BD 51 push cx ;;AN000;; Save changed regs - 37681 000059BE 06 push es ;;AN000;; - 37682 000059BF 57 push di ;;AN000;; - 37683 000059C0 1E push ds ;;AN000;; Set ES pointing to buffer - 37684 000059C1 07 pop es ;;AN000;; - 37685 000059C2 89D9 mov cx,bx ;;AN000;; Set number of bytes to display - 37686 000059C4 31DB xor bx,bx ;;AN000;; Reset buffer counter - 37687 000059C6 8D3E[E098] lea di,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 37688 ;lea di,[$M_RT+76] ;;AN000;; Reset buffer location pointer - 37689 000059CA E86DFD call $M_DISPLAY_STRING ;;AN000;; Display the buffer - 37690 000059CD 7204 jc short $MIF314 - 37691 000059CF 5F pop di ;;AN000;; No, Restore changed regs - 37692 000059D0 07 pop es ;;AN000;; - 37693 000059D1 59 pop cx ;;AN000;; - 37694 ;jmp short $MEN314 - 37695 ; 11/04/2023 - 37696 000059D2 C3 retn - 37697 $MIF314: - 37698 000059D3 83C406 add sp,6 ;;AN000;; Fix stack - 37699 000059D6 F9 stc ;;AN000;; - 37700 $MEN314: - 37701 000059D7 C3 retn ;;AN000;; Return - 37702 - 37703 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37704 ;; - 37705 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37706 - 37707 ; 11/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37708 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5609h + 37677 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37678 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5E95h + 37679 + 37680 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37681 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5D1Bh + 37682 $M_FLUSH_BUF: + 37683 000059BD 51 push cx ;;AN000;; Save changed regs + 37684 000059BE 06 push es ;;AN000;; + 37685 000059BF 57 push di ;;AN000;; + 37686 000059C0 1E push ds ;;AN000;; Set ES pointing to buffer + 37687 000059C1 07 pop es ;;AN000;; + 37688 000059C2 89D9 mov cx,bx ;;AN000;; Set number of bytes to display + 37689 000059C4 31DB xor bx,bx ;;AN000;; Reset buffer counter + 37690 000059C6 8D3E[E098] lea di,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 37691 ;lea di,[$M_RT+76] ;;AN000;; Reset buffer location pointer + 37692 000059CA E86DFD call $M_DISPLAY_STRING ;;AN000;; Display the buffer + 37693 000059CD 7204 jc short $MIF314 + 37694 000059CF 5F pop di ;;AN000;; No, Restore changed regs + 37695 000059D0 07 pop es ;;AN000;; + 37696 000059D1 59 pop cx ;;AN000;; + 37697 ;jmp short $MEN314 + 37698 ; 11/04/2023 + 37699 000059D2 C3 retn + 37700 $MIF314: + 37701 000059D3 83C406 add sp,6 ;;AN000;; Fix stack + 37702 000059D6 F9 stc ;;AN000;; + 37703 $MEN314: + 37704 000059D7 C3 retn ;;AN000;; Return + 37705 + 37706 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37707 ;; + 37708 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37709 - 37710 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37711 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5DD6h + 37710 ; 11/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37711 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5609h 37712 - 37713 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37714 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5C5Ch - 37715 $M_DISPLAY_REPLACE: - 37716 000059D8 31DB xor bx,bx ;;AN000;; Use BX for buffer count - 37717 ;;cmp $M_SL.$M_S_ID,$M_SPECIAL_CASE-30h ; 0 - 37718 000059DA 807C0600 cmp byte [si+$M_SUBLIST_STRUC.$M_S_ID],0 - 37719 ;cmp byte [si+6],0 ;;AN000;; Is this the special case (convert to ASCII) - 37720 000059DE 7511 jne short $MIF276 - 37721 - 37722 000059E0 C787[E098]202D mov word [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],2D20h ; $M_SPACE_HYP - 37723 ;mov word [bx+$M_RT+76],2D20h ;;AN000;; Move in a " -" + 37713 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37714 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5DD6h + 37715 + 37716 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37717 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5C5Ch + 37718 $M_DISPLAY_REPLACE: + 37719 000059D8 31DB xor bx,bx ;;AN000;; Use BX for buffer count + 37720 ;;cmp $M_SL.$M_S_ID,$M_SPECIAL_CASE-30h ; 0 + 37721 000059DA 807C0600 cmp byte [si+$M_SUBLIST_STRUC.$M_S_ID],0 + 37722 ;cmp byte [si+6],0 ;;AN000;; Is this the special case (convert to ASCII) + 37723 000059DE 7511 jne short $MIF276 37724 - 37725 000059E6 43 inc bx ;;AN000;; Increment count - 37726 000059E7 43 inc bx ;;AN000;; Increment count + 37725 000059E0 C787[E098]202D mov word [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],2D20h ; $M_SPACE_HYP + 37726 ;mov word [bx+$M_RT+76],2D20h ;;AN000;; Move in a " -" 37727 - 37728 000059E8 C687[E098]20 mov byte [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],20h ; $M_SPACE - 37729 ;mov byte [bx+$M_RT+76],20h ;;AN000;; Move in a " " + 37728 000059E6 43 inc bx ;;AN000;; Increment count + 37729 000059E7 43 inc bx ;;AN000;; Increment count 37730 - 37731 000059ED 43 inc bx ;;AN000;; Increment count - 37732 000059EE E8CCFF call $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case - 37733 $MIF276: - 37734 000059F1 5D pop bp ;;AN000;; Remember the return address - 37735 000059F2 31DB xor bx,bx ;;AN000;; Use BX for buffer count - 37736 000059F4 31D2 xor dx,dx ;;AN000;; Use DX for count of parms taken off the stack - 37737 - 37738 000059F6 880E[D698] mov [$M_RT+$M_RES_ADDRS.$M_SIZE],cl ;;AN000;; Save size to later clear stack - 37739 ;mov [$M_RT+66],cl - 37740 - 37741 ;mov al,byte ptr $M_SL.$M_S_MINW ;;AN000;; Get the minimum width - 37742 000059FA 8A4409 mov al,[si+$M_SUBLIST_STRUC.$M_S_MINW] - 37743 ;mov al,[si+9] - 37744 - 37745 000059FD 38C8 cmp al,cl ;;AN000;; Do we need pad chars added? - 37746 000059FF 761E jna short $MIF278 - 37747 00005A01 28C8 sub al,cl ;;AN000;; Calculate how many pad chars are needed. - 37748 00005A03 88C6 mov dh,al ;;AN000;; Save the number of pad characters - 37749 - 37750 ;test byte ptr $M_SL.$M_S_FLAG,Right_Align - 37751 00005A05 F6440780 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],80h - 37752 ;test byte [si+7],80h ;;AN000;; Was replaceable parm to be right aligned? - 37753 00005A09 7414 jz short $MIF279 ;;AN000;; No - 37754 $MDO280: - 37755 ;mov al,byte ptr $M_SL.$M_S_PAD ;;AN000;; - 37756 00005A0B 8A440A mov al,[si+$M_SUBLIST_STRUC.$M_S_PAD] - 37757 ;mov al,[si+0Ah] - 37758 00005A0E 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al - 37759 ;mov [bx+$M_RT+76],al ;;AN000;; Move in a pad char - 37760 - 37761 00005A12 43 inc bx ;;AN000;; - 37762 00005A13 83FB40 cmp bx,$M_TEMP_BUF_SZ ; 64 ;;AN000;; Is buffer full? - 37763 00005A16 7503 jne short $MIF281 - 37764 00005A18 E8A2FF call $M_FLUSH_BUF ;;AN000;; Flush the buffer - 37765 $MIF281: - 37766 00005A1B FECE dec dh ;;AN000;; Have we filled with enough pad chars? - 37767 00005A1D 75EC jnz short $MDO280 - 37768 $MIF279: - 37769 $MIF278: - 37770 ;cmp byte ptr $M_SL.$M_S_MAXW,$M_UNLIM_W - 37771 00005A1F 807C0800 cmp byte [si+$M_SUBLIST_STRUC.$M_S_MAXW],0 ; $M_UNLIM_W - 37772 ;cmp byte [si+8],0 ;;AN000;; Is maximum width unlimited - 37773 00005A23 740C je short $MIF286 - 37774 - 37775 ;cmp byte ptr $M_SL.$M_S_MAXW,CL ;;AN000;; Will we exceed maximum width? - 37776 00005A25 384C08 cmp byte [si+$M_SUBLIST_STRUC.$M_S_MAXW],cl - 37777 ;;cmp byte [si+8],cl - 37778 00005A28 7307 jnb short $MIF287 - 37779 - 37780 ; 03/05/2023 - 37781 ;;sub cl,byte ptr $M_SL.$M_S_MAXW ;;AN000;; Calculate how many extra chars - 37782 ;sub cl,[si+$M_SUBLIST_STRUC.$M_S_MAXW] - 37783 ;;sub cl,[si+8] - 37784 00005A2A 88CA mov dl,cl ;;AN000;; Remember how many chars to pop off - 37785 ;;mov cl,byte ptr $M_SL.$M_S_MAXW ;;AN000;; Set new string length - 37786 ;mov cl,[si+$M_SUBLIST_STRUC.$M_S_MAXW] - 37787 ;;mov cl,[si+8] - 37788 ; 03/05/2023 - 37789 00005A2C 8A4C08 mov cl,[si+$M_SUBLIST_STRUC.$M_S_MAXW] - 37790 00005A2F 28CA sub dl,cl - 37791 $MIF287: - 37792 $MIF286: - 37793 00005A31 09C9 or cx,cx ;;AN000;; - 37794 00005A33 7424 jz short $MIF290 ;;AN000;; - 37795 $MDO291: - 37796 ;test byte ptr $M_SL.$M_S_FLAG,not Char_Type not $M_TYPE_MASK - 37797 00005A35 F644070F test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Fh - 37798 ;test byte [si+7],0Fh ;;AN000;; - 37799 00005A39 750C jnz short $MIF292 - 37800 - 37801 ;test $M_SL.$M_S_FLAG,Char_field_ASCIIZ and $M_SIZE_MASK - 37802 00005A3B F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h - 37803 ;test byte [si+7],10h ;;AN000;; Is this replace a ASCIIZ string? - 37804 00005A3F 7406 jz short $MIF292 ;;AN000;; No - 37805 - 37806 00005A41 268A05 mov al,[es:di] ;;AN000;; Get first character from string - 37807 00005A44 47 inc di ;;AN000;; Next character in string - 37808 00005A45 EB01 jmp short $MEN292 - 37809 $MIF292: - 37810 00005A47 58 pop ax ;;AN000;; Get character in register - 37811 $MEN292: - 37812 ;mov byte ptr $M_RT.$M_TEMP_BUF[bx],al - 37813 00005A48 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al - 37814 ;mov [bx+$M_RT+76],al ;;AN000;; Move char into the buffer - 37815 ; 03/05/2023 - 37816 00005A4C 43 inc bx ;;AN000;; Increase buffer count - 37817 00005A4D 83FB40 cmp bx,$M_TEMP_BUF_SZ ; cmp bx,64 ;;AN000;; Is buffer full? - 37818 00005A50 7503 jne short $MIF295 ;;AN000;; - 37819 00005A52 E868FF call $M_FLUSH_BUF ;;AN000;; Flush the buffer - 37820 $MIF295: - 37821 00005A55 FEC9 dec cl ;;AN000;; Have we completed replace? - 37822 00005A57 75DC jnz short $MDO291 - 37823 $MIF290: - 37824 ;test byte ptr $M_SL.$M_S_FLAG,Right_Align - 37825 00005A59 F6440780 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],80h - 37826 ;test byte [si+7],80h ;;AN000;; Was replaceable parm to be left aligned? - 37827 00005A5D 7518 jnz short $MIF299 ;;AN000;; Yes - 37828 00005A5F 08F6 or dh,dh ;;AN000;; Do we need pad chars added? - 37829 00005A61 7414 jz short $MIF300 - 37830 $MDO301: - 37831 ;mov al,byte ptr $M_SL.$M_S_PAD ;;AN000;; - 37832 00005A63 8A440A mov al,[si+$M_SUBLIST_STRUC.$M_S_PAD] - 37833 ;mov al,[si+0Ah] - 37834 - 37835 ;mov byte ptr $M_RT.$M_TEMP_BUF[bx],al - 37836 00005A66 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al - 37837 ; 03/05/2023 - 37838 ;mov [bx+$M_RT+76],al ;;AN000;; Move in a pad char - 37839 - 37840 00005A6A 43 inc bx ;;AN000;; - 37841 00005A6B 83FB40 cmp bx,$M_TEMP_BUF_SZ ; 64 ;;AN000;; Is buffer full? - 37842 00005A6E 7503 jne short $MIF302 ;;AN000;; No - 37843 ;;AN000;; Yes - 37844 00005A70 E84AFF call $M_FLUSH_BUF ;;AN000;; Flush the buffer - 37845 $MIF302: - 37846 00005A73 FECE dec dh ;;AN000;; Have we filled with enough pad chars? - 37847 00005A75 75EC jnz short $MDO301 ;;AN000;; - 37848 $MIF300: - 37849 $MIF299: - 37850 ;test byte ptr $M_SL.$M_S_FLAG,not Char_Type and $M_TYPE_MASK - 37851 00005A77 F644070F test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Fh - 37852 ;test byte [si+7],0Fh ;;AN000;; - 37853 00005A7B 7506 jnz short $MIF307 - 37854 - 37855 ;test $M_SL.$M_S_FLAG,Char_field_ASCIIZ and $M_SIZE_MASK - 37856 00005A7D F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h - 37857 ;test byte [si+7],10h ;;AN000;; Is this replace a ASCIIZ string? - 37858 ; 11/04/2023 - 37859 ;jz short $MIF307 ;;AN000;; - 37860 ;jmp short $MEN307 ;;AN000;; - 37861 00005A81 750C jnz short $MEN307 - 37862 $MIF307: - 37863 00005A83 08D2 or dl,dl ;;AN000;; - 37864 00005A85 7408 jz short $MIF309 ;;AN000;; - 37865 $MDO310: - 37866 00005A87 8F06[DA98] pop word [$M_RT+$M_RES_ADDRS.$M_RETURN_ADDR] - 37867 ;pop word [$M_RT+70] ;;AN000;; Clean Up stack using spare variable - 37868 00005A8B FECA dec dl ;;AN000;; Are we done? - 37869 00005A8D 75F8 jnz short $MDO310 - 37870 $MIF309: - 37871 $MEN307: - 37872 00005A8F E82BFF call $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time - 37873 00005A92 55 push bp ;;AN000;; Restore the return address - 37874 00005A93 C3 retn ;;AN000;; - 37875 - 37876 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37877 ;; - 37878 ;; PROC NAME: $M_CHAR_REPLACE - 37879 ;; - 37880 ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace - 37881 ;; INPUTS: DS:SI points at corresponding SUBLIST - 37882 ;; ES:DI contains the VALUE from SUBLIST - 37883 ;; OUTPUTS: CX contains number of characters on stack - 37884 ;; Top of stack --> Last character - 37885 ;; . . . - 37886 ;; Bot of stack --> First character - 37887 ;; - 37888 ;; OTHER REGS Revised: AX - 37889 ;; - 37890 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37891 - 37892 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37893 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37894 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37895 $M_CHAR_REPLACE: - 37896 00005A94 5D pop bp ;;AN000;; Save return address - 37897 ;test $M_SL.$M_S_FLAG,not Char_Field_Char and $M_SIZE_MASK - 37898 00005A95 F6440730 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],30h - 37899 ;test byte [si+7],30h ;;AN000;; Was Character specified? - 37900 00005A99 7512 jnz short $MIF317 ;;AN000;; No - 37901 00005A9B 268A05 mov al,[es:di] ;;AN000;; Get the character - 37902 00005A9E 50 push ax ;;AN000;; Put it on the stack - 37903 00005A9F 41 inc cx ;;AN000;; Increase the count - 37904 00005AA0 E88DFD call $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character - 37905 00005AA3 7306 jnc short $MIF318 - 37906 00005AA5 268A4501 mov al,[es:di+1] ;;AN000;; Get the next character - 37907 00005AA9 50 push ax ;;AN000;; Put it on the stack - 37908 00005AAA F8 clc ;;AN000;; Clear the carry - 37909 $MIF318: - 37910 00005AAB EB0D jmp short $MEN317 - 37911 $MIF317: - 37912 $MDO321: - 37913 00005AAD 268A05 mov al,[es:di] ;;AN000;; Get the character - 37914 00005AB0 08C0 or al,al ;;AN000;; Is it the NULL? - 37915 00005AB2 7404 jz short $MEN321 ;;AN000;; Yes - 37916 00005AB4 47 inc di ;;AN000;; Next character - 37917 00005AB5 41 inc cx ;;AN000;; Increment the count - 37918 00005AB6 EBF5 jmp short $MDO321 - 37919 $MEN321: - 37920 00005AB8 29CF sub di,cx ;;AN000;; Set DI at the beginning of the string - 37921 $MEN317: - 37922 00005ABA 55 push bp ;;AN000;; Restore return address - 37923 00005ABB C3 retn ;;AN000;; - 37924 - 37925 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37926 ;; - 37927 ;; PROC NAME: $M_BIN2ASC_REPLACE - 37928 ;; - 37929 ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string - 37930 ;; and prepare to display - 37931 ;; INPUTS: DS:SI points at corresponding SUBLIST - 37932 ;; ES:DI contains the VALUE from SUBLIST - 37933 ;; OUTPUTS: CX contains number of characters on stack - 37934 ;; Top of stack --> Last character - 37935 ;; . . . - 37936 ;; Bot of stack --> First character - 37937 ;; OTHER REGS Revised: BX,DX,AX - 37938 ;; - 37939 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 37940 - 37941 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 37942 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 37943 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM - 37944 $M_BIN2ASC_REPLACE: - 37945 00005ABC 5D pop bp ;;AN000;; Save return address - 37946 00005ABD 31D2 xor dx,dx ;;AN000;; Prepare for get binary value (HIGH) - 37947 00005ABF 31C0 xor ax,ax ;;AN000;; Prepare for get binary value (LOW) - 37948 00005AC1 C706[DE98]1000 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],16 ; $M_BASE16 - 37949 ;mov word [$M_RT+74],16 ; $M_BASE16 ;;AN000;; Set default divisor - 37950 - 37951 00005AC7 31DB xor bx,bx ;;AN000;; Use BX as the NEG flag (if applicable) - 37952 - 37953 ;test $M_SL.$M_S_FLAG,not $M_BYTE and $M_SIZE_MASK - 37954 00005AC9 F6440720 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],20h - 37955 ;test byte [si+7],20h ;;AN000;; Was BYTE specified? - 37956 00005ACD 7511 jnz short $MIF325 ;;AN000;; No - 37957 - 37958 00005ACF 268A05 mov al,[es:di] ;;AN000;; Setup byte in AL - 37959 - 37960 ;test $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK - 37961 00005AD2 F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh - 37962 ;test byte [si+7],0Dh ;;AN000;; Was Signed binary specified? - 37963 00005AD6 753D jnz short $MIF326 ;;AN000;; No - 37964 - 37965 00005AD8 A880 test al,10000000b ; 80h ;;AN000;; Is this number negative? - 37966 00005ADA 7433 jz short $MIF327 ;;AN000;; No - 37967 ;;AN000;; Yes - 37968 ; 12/04/2023 - 37969 ;inc bx ;;AN000;; Remember that it was negative - 37970 00005ADC 247F and al,01111111b ;;AN000;; Make it positive - 37971 - 37972 ; 12/04/2023 - Retrop DOS v4.0 COMMAND.COM - 37973 ;jmp short $MIF327 - 37974 00005ADE EB2E jmp short $MIF350 ; inc bx - 37975 - 37976 ; 12/04/2023 - 37977 %if 0 - 37978 $MIF327: - 37979 $MIF335: ; 12/04/2023 - 37980 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 37981 ;mov word [$M_RT+74],10 ;;AN000;; - 37982 $MIF326: - 37983 ;test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK - 37984 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh - 37985 ;test byte [si+7],0Eh ;;AN000;; Was Signed binary specified? - 37986 jnz short $MIF330 ;;AN000;; No - 37987 ;;AN000;; Yes - 37988 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 37989 ;mov word [$M_RT+74],10 ;;AN000;; - 37990 $MIF330: - 37991 jmp short $MEN325 - 37992 - 37993 %endif - 37994 - 37995 $MIF325: - 37996 ;test $M_SL.$M_S_FLAG,not $M_WORD and $M_SIZE_MASK - 37997 00005AE0 F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h - 37998 ;test byte [si+7],10h ;;AN000;; Was WORD specified? - 37999 00005AE4 7513 jnz short $MIF333 ;;AN000;; No - 38000 ;;AN000;; Yes - 38001 00005AE6 268B05 mov ax,[es:di] ;;AN000;; Setup byte in AL - 38002 - 38003 ;test $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK - 38004 00005AE9 F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh - 38005 ;test byte [si+7],0Dh ;;AN000;; Was Signed binary specified? - 38006 00005AED 7526 jnz short $MIF334 ;;AN000;; No - 38007 ;;AN000;; Yes - 38008 00005AEF F6C480 test ah,10000000b ; 80h ;;AN000;; Is this number negative? - 38009 00005AF2 741B jz short $MIF335 ;;AN000;; No + 37731 000059E8 C687[E098]20 mov byte [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],20h ; $M_SPACE + 37732 ;mov byte [bx+$M_RT+76],20h ;;AN000;; Move in a " " + 37733 + 37734 000059ED 43 inc bx ;;AN000;; Increment count + 37735 000059EE E8CCFF call $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case + 37736 $MIF276: + 37737 000059F1 5D pop bp ;;AN000;; Remember the return address + 37738 000059F2 31DB xor bx,bx ;;AN000;; Use BX for buffer count + 37739 000059F4 31D2 xor dx,dx ;;AN000;; Use DX for count of parms taken off the stack + 37740 + 37741 000059F6 880E[D698] mov [$M_RT+$M_RES_ADDRS.$M_SIZE],cl ;;AN000;; Save size to later clear stack + 37742 ;mov [$M_RT+66],cl + 37743 + 37744 ;mov al,byte ptr $M_SL.$M_S_MINW ;;AN000;; Get the minimum width + 37745 000059FA 8A4409 mov al,[si+$M_SUBLIST_STRUC.$M_S_MINW] + 37746 ;mov al,[si+9] + 37747 + 37748 000059FD 38C8 cmp al,cl ;;AN000;; Do we need pad chars added? + 37749 000059FF 761E jna short $MIF278 + 37750 00005A01 28C8 sub al,cl ;;AN000;; Calculate how many pad chars are needed. + 37751 00005A03 88C6 mov dh,al ;;AN000;; Save the number of pad characters + 37752 + 37753 ;test byte ptr $M_SL.$M_S_FLAG,Right_Align + 37754 00005A05 F6440780 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],80h + 37755 ;test byte [si+7],80h ;;AN000;; Was replaceable parm to be right aligned? + 37756 00005A09 7414 jz short $MIF279 ;;AN000;; No + 37757 $MDO280: + 37758 ;mov al,byte ptr $M_SL.$M_S_PAD ;;AN000;; + 37759 00005A0B 8A440A mov al,[si+$M_SUBLIST_STRUC.$M_S_PAD] + 37760 ;mov al,[si+0Ah] + 37761 00005A0E 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al + 37762 ;mov [bx+$M_RT+76],al ;;AN000;; Move in a pad char + 37763 + 37764 00005A12 43 inc bx ;;AN000;; + 37765 00005A13 83FB40 cmp bx,$M_TEMP_BUF_SZ ; 64 ;;AN000;; Is buffer full? + 37766 00005A16 7503 jne short $MIF281 + 37767 00005A18 E8A2FF call $M_FLUSH_BUF ;;AN000;; Flush the buffer + 37768 $MIF281: + 37769 00005A1B FECE dec dh ;;AN000;; Have we filled with enough pad chars? + 37770 00005A1D 75EC jnz short $MDO280 + 37771 $MIF279: + 37772 $MIF278: + 37773 ;cmp byte ptr $M_SL.$M_S_MAXW,$M_UNLIM_W + 37774 00005A1F 807C0800 cmp byte [si+$M_SUBLIST_STRUC.$M_S_MAXW],0 ; $M_UNLIM_W + 37775 ;cmp byte [si+8],0 ;;AN000;; Is maximum width unlimited + 37776 00005A23 740C je short $MIF286 + 37777 + 37778 ;cmp byte ptr $M_SL.$M_S_MAXW,CL ;;AN000;; Will we exceed maximum width? + 37779 00005A25 384C08 cmp byte [si+$M_SUBLIST_STRUC.$M_S_MAXW],cl + 37780 ;;cmp byte [si+8],cl + 37781 00005A28 7307 jnb short $MIF287 + 37782 + 37783 ; 03/05/2023 + 37784 ;;sub cl,byte ptr $M_SL.$M_S_MAXW ;;AN000;; Calculate how many extra chars + 37785 ;sub cl,[si+$M_SUBLIST_STRUC.$M_S_MAXW] + 37786 ;;sub cl,[si+8] + 37787 00005A2A 88CA mov dl,cl ;;AN000;; Remember how many chars to pop off + 37788 ;;mov cl,byte ptr $M_SL.$M_S_MAXW ;;AN000;; Set new string length + 37789 ;mov cl,[si+$M_SUBLIST_STRUC.$M_S_MAXW] + 37790 ;;mov cl,[si+8] + 37791 ; 03/05/2023 + 37792 00005A2C 8A4C08 mov cl,[si+$M_SUBLIST_STRUC.$M_S_MAXW] + 37793 00005A2F 28CA sub dl,cl + 37794 $MIF287: + 37795 $MIF286: + 37796 00005A31 09C9 or cx,cx ;;AN000;; + 37797 00005A33 7424 jz short $MIF290 ;;AN000;; + 37798 $MDO291: + 37799 ;test byte ptr $M_SL.$M_S_FLAG,not Char_Type not $M_TYPE_MASK + 37800 00005A35 F644070F test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Fh + 37801 ;test byte [si+7],0Fh ;;AN000;; + 37802 00005A39 750C jnz short $MIF292 + 37803 + 37804 ;test $M_SL.$M_S_FLAG,Char_field_ASCIIZ and $M_SIZE_MASK + 37805 00005A3B F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h + 37806 ;test byte [si+7],10h ;;AN000;; Is this replace a ASCIIZ string? + 37807 00005A3F 7406 jz short $MIF292 ;;AN000;; No + 37808 + 37809 00005A41 268A05 mov al,[es:di] ;;AN000;; Get first character from string + 37810 00005A44 47 inc di ;;AN000;; Next character in string + 37811 00005A45 EB01 jmp short $MEN292 + 37812 $MIF292: + 37813 00005A47 58 pop ax ;;AN000;; Get character in register + 37814 $MEN292: + 37815 ;mov byte ptr $M_RT.$M_TEMP_BUF[bx],al + 37816 00005A48 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al + 37817 ;mov [bx+$M_RT+76],al ;;AN000;; Move char into the buffer + 37818 ; 03/05/2023 + 37819 00005A4C 43 inc bx ;;AN000;; Increase buffer count + 37820 00005A4D 83FB40 cmp bx,$M_TEMP_BUF_SZ ; cmp bx,64 ;;AN000;; Is buffer full? + 37821 00005A50 7503 jne short $MIF295 ;;AN000;; + 37822 00005A52 E868FF call $M_FLUSH_BUF ;;AN000;; Flush the buffer + 37823 $MIF295: + 37824 00005A55 FEC9 dec cl ;;AN000;; Have we completed replace? + 37825 00005A57 75DC jnz short $MDO291 + 37826 $MIF290: + 37827 ;test byte ptr $M_SL.$M_S_FLAG,Right_Align + 37828 00005A59 F6440780 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],80h + 37829 ;test byte [si+7],80h ;;AN000;; Was replaceable parm to be left aligned? + 37830 00005A5D 7518 jnz short $MIF299 ;;AN000;; Yes + 37831 00005A5F 08F6 or dh,dh ;;AN000;; Do we need pad chars added? + 37832 00005A61 7414 jz short $MIF300 + 37833 $MDO301: + 37834 ;mov al,byte ptr $M_SL.$M_S_PAD ;;AN000;; + 37835 00005A63 8A440A mov al,[si+$M_SUBLIST_STRUC.$M_S_PAD] + 37836 ;mov al,[si+0Ah] + 37837 + 37838 ;mov byte ptr $M_RT.$M_TEMP_BUF[bx],al + 37839 00005A66 8887[E098] mov [bx+$M_RT+$M_RES_ADDRS.$M_TEMP_BUF],al + 37840 ; 03/05/2023 + 37841 ;mov [bx+$M_RT+76],al ;;AN000;; Move in a pad char + 37842 + 37843 00005A6A 43 inc bx ;;AN000;; + 37844 00005A6B 83FB40 cmp bx,$M_TEMP_BUF_SZ ; 64 ;;AN000;; Is buffer full? + 37845 00005A6E 7503 jne short $MIF302 ;;AN000;; No + 37846 ;;AN000;; Yes + 37847 00005A70 E84AFF call $M_FLUSH_BUF ;;AN000;; Flush the buffer + 37848 $MIF302: + 37849 00005A73 FECE dec dh ;;AN000;; Have we filled with enough pad chars? + 37850 00005A75 75EC jnz short $MDO301 ;;AN000;; + 37851 $MIF300: + 37852 $MIF299: + 37853 ;test byte ptr $M_SL.$M_S_FLAG,not Char_Type and $M_TYPE_MASK + 37854 00005A77 F644070F test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Fh + 37855 ;test byte [si+7],0Fh ;;AN000;; + 37856 00005A7B 7506 jnz short $MIF307 + 37857 + 37858 ;test $M_SL.$M_S_FLAG,Char_field_ASCIIZ and $M_SIZE_MASK + 37859 00005A7D F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h + 37860 ;test byte [si+7],10h ;;AN000;; Is this replace a ASCIIZ string? + 37861 ; 11/04/2023 + 37862 ;jz short $MIF307 ;;AN000;; + 37863 ;jmp short $MEN307 ;;AN000;; + 37864 00005A81 750C jnz short $MEN307 + 37865 $MIF307: + 37866 00005A83 08D2 or dl,dl ;;AN000;; + 37867 00005A85 7408 jz short $MIF309 ;;AN000;; + 37868 $MDO310: + 37869 00005A87 8F06[DA98] pop word [$M_RT+$M_RES_ADDRS.$M_RETURN_ADDR] + 37870 ;pop word [$M_RT+70] ;;AN000;; Clean Up stack using spare variable + 37871 00005A8B FECA dec dl ;;AN000;; Are we done? + 37872 00005A8D 75F8 jnz short $MDO310 + 37873 $MIF309: + 37874 $MEN307: + 37875 00005A8F E82BFF call $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time + 37876 00005A92 55 push bp ;;AN000;; Restore the return address + 37877 00005A93 C3 retn ;;AN000;; + 37878 + 37879 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37880 ;; + 37881 ;; PROC NAME: $M_CHAR_REPLACE + 37882 ;; + 37883 ;; FUNCTION: Will prepare a single char or ASCIIZ string for replace + 37884 ;; INPUTS: DS:SI points at corresponding SUBLIST + 37885 ;; ES:DI contains the VALUE from SUBLIST + 37886 ;; OUTPUTS: CX contains number of characters on stack + 37887 ;; Top of stack --> Last character + 37888 ;; . . . + 37889 ;; Bot of stack --> First character + 37890 ;; + 37891 ;; OTHER REGS Revised: AX + 37892 ;; + 37893 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37894 + 37895 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37896 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37897 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37898 $M_CHAR_REPLACE: + 37899 00005A94 5D pop bp ;;AN000;; Save return address + 37900 ;test $M_SL.$M_S_FLAG,not Char_Field_Char and $M_SIZE_MASK + 37901 00005A95 F6440730 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],30h + 37902 ;test byte [si+7],30h ;;AN000;; Was Character specified? + 37903 00005A99 7512 jnz short $MIF317 ;;AN000;; No + 37904 00005A9B 268A05 mov al,[es:di] ;;AN000;; Get the character + 37905 00005A9E 50 push ax ;;AN000;; Put it on the stack + 37906 00005A9F 41 inc cx ;;AN000;; Increase the count + 37907 00005AA0 E88DFD call $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character + 37908 00005AA3 7306 jnc short $MIF318 + 37909 00005AA5 268A4501 mov al,[es:di+1] ;;AN000;; Get the next character + 37910 00005AA9 50 push ax ;;AN000;; Put it on the stack + 37911 00005AAA F8 clc ;;AN000;; Clear the carry + 37912 $MIF318: + 37913 00005AAB EB0D jmp short $MEN317 + 37914 $MIF317: + 37915 $MDO321: + 37916 00005AAD 268A05 mov al,[es:di] ;;AN000;; Get the character + 37917 00005AB0 08C0 or al,al ;;AN000;; Is it the NULL? + 37918 00005AB2 7404 jz short $MEN321 ;;AN000;; Yes + 37919 00005AB4 47 inc di ;;AN000;; Next character + 37920 00005AB5 41 inc cx ;;AN000;; Increment the count + 37921 00005AB6 EBF5 jmp short $MDO321 + 37922 $MEN321: + 37923 00005AB8 29CF sub di,cx ;;AN000;; Set DI at the beginning of the string + 37924 $MEN317: + 37925 00005ABA 55 push bp ;;AN000;; Restore return address + 37926 00005ABB C3 retn ;;AN000;; + 37927 + 37928 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37929 ;; + 37930 ;; PROC NAME: $M_BIN2ASC_REPLACE + 37931 ;; + 37932 ;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string + 37933 ;; and prepare to display + 37934 ;; INPUTS: DS:SI points at corresponding SUBLIST + 37935 ;; ES:DI contains the VALUE from SUBLIST + 37936 ;; OUTPUTS: CX contains number of characters on stack + 37937 ;; Top of stack --> Last character + 37938 ;; . . . + 37939 ;; Bot of stack --> First character + 37940 ;; OTHER REGS Revised: BX,DX,AX + 37941 ;; + 37942 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 37943 + 37944 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 37945 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 37946 ; 12/08/2024 - Retro DOS v5.0 COMMAND.COM + 37947 $M_BIN2ASC_REPLACE: + 37948 00005ABC 5D pop bp ;;AN000;; Save return address + 37949 00005ABD 31D2 xor dx,dx ;;AN000;; Prepare for get binary value (HIGH) + 37950 00005ABF 31C0 xor ax,ax ;;AN000;; Prepare for get binary value (LOW) + 37951 00005AC1 C706[DE98]1000 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],16 ; $M_BASE16 + 37952 ;mov word [$M_RT+74],16 ; $M_BASE16 ;;AN000;; Set default divisor + 37953 + 37954 00005AC7 31DB xor bx,bx ;;AN000;; Use BX as the NEG flag (if applicable) + 37955 + 37956 ;test $M_SL.$M_S_FLAG,not $M_BYTE and $M_SIZE_MASK + 37957 00005AC9 F6440720 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],20h + 37958 ;test byte [si+7],20h ;;AN000;; Was BYTE specified? + 37959 00005ACD 7511 jnz short $MIF325 ;;AN000;; No + 37960 + 37961 00005ACF 268A05 mov al,[es:di] ;;AN000;; Setup byte in AL + 37962 + 37963 ;test $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK + 37964 00005AD2 F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh + 37965 ;test byte [si+7],0Dh ;;AN000;; Was Signed binary specified? + 37966 00005AD6 753D jnz short $MIF326 ;;AN000;; No + 37967 + 37968 00005AD8 A880 test al,10000000b ; 80h ;;AN000;; Is this number negative? + 37969 00005ADA 7433 jz short $MIF327 ;;AN000;; No + 37970 ;;AN000;; Yes + 37971 ; 12/04/2023 + 37972 ;inc bx ;;AN000;; Remember that it was negative + 37973 00005ADC 247F and al,01111111b ;;AN000;; Make it positive + 37974 + 37975 ; 12/04/2023 - Retrop DOS v4.0 COMMAND.COM + 37976 ;jmp short $MIF327 + 37977 00005ADE EB2E jmp short $MIF350 ; inc bx + 37978 + 37979 ; 12/04/2023 + 37980 %if 0 + 37981 $MIF327: + 37982 $MIF335: ; 12/04/2023 + 37983 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 37984 ;mov word [$M_RT+74],10 ;;AN000;; + 37985 $MIF326: + 37986 ;test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK + 37987 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh + 37988 ;test byte [si+7],0Eh ;;AN000;; Was Signed binary specified? + 37989 jnz short $MIF330 ;;AN000;; No + 37990 ;;AN000;; Yes + 37991 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 37992 ;mov word [$M_RT+74],10 ;;AN000;; + 37993 $MIF330: + 37994 jmp short $MEN325 + 37995 + 37996 %endif + 37997 + 37998 $MIF325: + 37999 ;test $M_SL.$M_S_FLAG,not $M_WORD and $M_SIZE_MASK + 38000 00005AE0 F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h + 38001 ;test byte [si+7],10h ;;AN000;; Was WORD specified? + 38002 00005AE4 7513 jnz short $MIF333 ;;AN000;; No + 38003 ;;AN000;; Yes + 38004 00005AE6 268B05 mov ax,[es:di] ;;AN000;; Setup byte in AL + 38005 + 38006 ;test $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK + 38007 00005AE9 F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh + 38008 ;test byte [si+7],0Dh ;;AN000;; Was Signed binary specified? + 38009 00005AED 7526 jnz short $MIF334 ;;AN000;; No 38010 ;;AN000;; Yes - 38011 ; 12/04/2023 - 38012 ;inc bx ;;AN000;; Remember that it was negative - 38013 00005AF4 80E47F and ah,01111111b ;;AN000;; Make it positive - 38014 - 38015 ; 12/04/2023 - Retro DOS v4.0 COMMAND.COM - 38016 ;jmp short $MIF335 - 38017 00005AF7 EB15 jmp short $MIF350 ; inc bx - 38018 - 38019 ; 12/04/2023 - 38020 %if 0 - 38021 $MIF335: - 38022 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 38023 ;mov word [$M_RT+74],10 ;;AN000;; - 38024 $MIF334: - 38025 test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK ;;AN000;; Was Signed binary specified? - 38026 jnz short $MIF338 - 38027 - 38028 ;test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK - 38029 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh - 38030 ;test byte [si+7],0Eh ;;AN000;; Was Signed binary specified? - 38031 jnz short $MIF338 ;;AN000;; No - 38032 ;;AN000;; Yes - 38033 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 38034 ;mov word [$M_RT+74],10 ;;AN000;; - 38035 $MIF338: - 38036 jmp short $MEN333 ;;AN000;; - 38037 %endif - 38038 - 38039 $MIF333: - 38040 00005AF9 268B05 mov ax,[es:di] ;;AN000;; Setup Double word in DX:AX - 38041 00005AFC 268B5502 mov dx,[es:di+2] ;;AN000;; - 38042 - 38043 ;test $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK - 38044 00005B00 F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh - 38045 ;test byte [si+7],0Dh ;;AN000;; Was Signed binary specified? - 38046 00005B04 750F jnz short $MIF341 ;;AN000;; No - 38047 ;;AN000;; Yes - 38048 00005B06 F6C680 test dh,10000000b ; 80h ;;AN000;; Is this number negative? - 38049 00005B09 7404 jz short $MIF342 ;;AN000;; No + 38011 00005AEF F6C480 test ah,10000000b ; 80h ;;AN000;; Is this number negative? + 38012 00005AF2 741B jz short $MIF335 ;;AN000;; No + 38013 ;;AN000;; Yes + 38014 ; 12/04/2023 + 38015 ;inc bx ;;AN000;; Remember that it was negative + 38016 00005AF4 80E47F and ah,01111111b ;;AN000;; Make it positive + 38017 + 38018 ; 12/04/2023 - Retro DOS v4.0 COMMAND.COM + 38019 ;jmp short $MIF335 + 38020 00005AF7 EB15 jmp short $MIF350 ; inc bx + 38021 + 38022 ; 12/04/2023 + 38023 %if 0 + 38024 $MIF335: + 38025 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 38026 ;mov word [$M_RT+74],10 ;;AN000;; + 38027 $MIF334: + 38028 test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK ;;AN000;; Was Signed binary specified? + 38029 jnz short $MIF338 + 38030 + 38031 ;test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK + 38032 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh + 38033 ;test byte [si+7],0Eh ;;AN000;; Was Signed binary specified? + 38034 jnz short $MIF338 ;;AN000;; No + 38035 ;;AN000;; Yes + 38036 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 38037 ;mov word [$M_RT+74],10 ;;AN000;; + 38038 $MIF338: + 38039 jmp short $MEN333 ;;AN000;; + 38040 %endif + 38041 + 38042 $MIF333: + 38043 00005AF9 268B05 mov ax,[es:di] ;;AN000;; Setup Double word in DX:AX + 38044 00005AFC 268B5502 mov dx,[es:di+2] ;;AN000;; + 38045 + 38046 ;test $M_SL.$M_S_FLAG,not Sgn_Bin_Type and $M_TYPE_MASK + 38047 00005B00 F644070D test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Dh + 38048 ;test byte [si+7],0Dh ;;AN000;; Was Signed binary specified? + 38049 00005B04 750F jnz short $MIF341 ;;AN000;; No 38050 ;;AN000;; Yes - 38051 ; 12/04/2023 - 38052 ;inc bx ;;AN000;; Remember that it was negative - 38053 00005B0B 80E67F and dh,01111111b ;;AN000;; Make it positive - 38054 - 38055 ; 12/04/2023 - Retro DOS v4.0 COMMAND.COM - 38056 $MIF350: - 38057 00005B0E 43 inc bx - 38058 $MIF342: - 38059 ; 12/04/2023 - 38060 $MIF327: - 38061 $MIF335: - 38062 00005B0F C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 38063 ;mov word [$M_RT+74],10 ;;AN000;; - 38064 $MIF341: - 38065 $MIF326: - 38066 ; 18/04/2023 - 38067 $MIF334: - 38068 ;test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK - 38069 00005B15 F644070E test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh - 38070 ;test byte [si+7],0Eh ;;AN000;; Was Signed binary specified? - 38071 00005B19 7506 jnz short $MIF345 ;;AN000;; No - 38072 ;;AN000;; Yes - 38073 00005B1B C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 38074 ;mov word [$M_RT+74],10 ;;AN000;; - 38075 - 38076 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38077 ; **************************************** - 38078 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5F64h - 38079 $MIF345: - 38080 ; *** (Disassembled MSDOS 6.22 COMMAND.COM source code.) - 38081 $MEN333: - 38082 00005B21 F6440740 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],40h - 38083 ;test byte [si+7],40h ; MSDOS 6.22 - 38084 ; (Custom/International flag for thousand separator) - 38085 00005B25 7428 jz short $MEN325 - 38086 00005B27 50 push ax ; MSDOS 6.22 - 38087 00005B28 52 push dx - 38088 00005B29 B438 mov ah,38h ; International - 38089 00005B2B 30C0 xor al,al - 38090 00005B2D 8D16[E098] lea dx,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38091 00005B31 CD21 int 21h ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION - 38092 ; get current-country info - 38093 ; DS:DX -> buffer for returned info - 38094 00005B33 7305 jnb short $MEN341 ; (use country depended thousand separator) - 38095 00005B35 C606[E798]2C mov byte [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA],',' - 38096 $MEN341: - 38097 00005B3A 8A440A mov al,[si+$M_SUBLIST_STRUC.$M_S_PAD] - 38098 ;mov al,[si+0Ah] ; (save pad character) - 38099 00005B3D 89C7 mov di,ax - 38100 00005B3F 5A pop dx - 38101 00005B40 58 pop ax - 38102 00005B41 C6440A2C mov byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' ; $M_COMMA - 38103 ;mov byte [si+0Ah],',' ; (comma is needed for converting procedure) - 38104 00005B45 E80CFD call $M_CONVERT2ASC - 38105 00005B48 89F8 mov ax,di - 38106 00005B4A 88440A mov [si+$M_SUBLIST_STRUC.$M_S_PAD],al - 38107 ;mov [si+0Ah],al ; (restore pad character) - 38108 00005B4D EB03 jmp short $MEN345 ; MSDOS 6.22 - 38109 ; *** (end of disassembled MSDOS 6.22 COMMAND.COM source code porehion) - 38110 ; **************************************** - 38111 ;$MIF345: - 38112 ;$MEN333: - 38113 $MEN325: - 38114 00005B4F E802FD call $M_CONVERT2ASC ;;AN000;; Convert to ASCII string - 38115 $MEN345: ; 15/06/2023 - MSDOS 6.22 - 38116 00005B52 09DB or bx,bx ;;AN000;; Was number negative? - 38117 00005B54 7405 jz short $MIF349 ;;AN000;; No - 38118 ;;AN000;; Yes - 38119 00005B56 31D2 xor dx,dx ;;AN000;; - 38120 00005B58 B22D mov dl,'-' ; $M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number - 38121 00005B5A 52 push dx ;;AN000;; - 38122 $MIF349: - 38123 00005B5B 55 push bp ;;AN000;; Restore return address - 38124 00005B5C C3 retn ;;AN000;; Return - 38125 - 38126 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38127 ;; - 38128 ;; PROC NAME: $M_DATE_REPLACE - 38129 ;; - 38130 ;; FUNCTION: Convert a date to a decimal ASCII string using current - 38131 ;; country format and prepare to display - 38132 ;; INPUTS: DS:SI points at corresponding SUBLIST - 38133 ;; ES:DI points at VALUE from SUBLIST - 38134 ;; OUTPUTS: CX contains number of characters on stack - 38135 ;; Top of stack --> Last character - 38136 ;; . . . - 38137 ;; Bot of stack --> First character - 38138 ;; OTHER REGS Revised: DX,AX - 38139 ;; - 38140 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38141 - 38142 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38143 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38144 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38145 $M_DATE_REPLACE: - 38146 00005B5D 5D pop bp ;;AN000;; Save return address - 38147 - 38148 00005B5E C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 38149 ;mov word [$M_RT+74],10 ;;AN000;; Set default divisor - 38150 - 38151 00005B64 E86700 call $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT - 38152 ;;AN000;; All O.K.? - 38153 00005B67 31D2 xor dx,dx ;;AN000;; Reset DX value - 38154 ; 12/04/2023 - 38155 ;xor ax,ax ;;AN000;; Reset AX value - 38156 - 38157 ;cmp word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],0 - 38158 ;;cmp word [$M_RT+76],0 ;;AN000;; USA Date Format - 38159 ;jne short $MIF351 - 38160 ; 12/04/2023 - 38161 00005B69 A1[E098] mov ax,[$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] ; * - 38162 00005B6C 09C0 or ax,ax - 38163 00005B6E 751D jnz short $MIF351 - 38164 - 38165 00005B70 E87200 call $M_YEAR ;;AN000;; Get Year - 38166 00005B73 E88100 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38051 00005B06 F6C680 test dh,10000000b ; 80h ;;AN000;; Is this number negative? + 38052 00005B09 7404 jz short $MIF342 ;;AN000;; No + 38053 ;;AN000;; Yes + 38054 ; 12/04/2023 + 38055 ;inc bx ;;AN000;; Remember that it was negative + 38056 00005B0B 80E67F and dh,01111111b ;;AN000;; Make it positive + 38057 + 38058 ; 12/04/2023 - Retro DOS v4.0 COMMAND.COM + 38059 $MIF350: + 38060 00005B0E 43 inc bx + 38061 $MIF342: + 38062 ; 12/04/2023 + 38063 $MIF327: + 38064 $MIF335: + 38065 00005B0F C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 38066 ;mov word [$M_RT+74],10 ;;AN000;; + 38067 $MIF341: + 38068 $MIF326: + 38069 ; 18/04/2023 + 38070 $MIF334: + 38071 ;test $M_SL.$M_S_FLAG,not Unsgn_Bin_Type and $M_TYPE_MASK + 38072 00005B15 F644070E test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],0Eh + 38073 ;test byte [si+7],0Eh ;;AN000;; Was Signed binary specified? + 38074 00005B19 7506 jnz short $MIF345 ;;AN000;; No + 38075 ;;AN000;; Yes + 38076 00005B1B C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 38077 ;mov word [$M_RT+74],10 ;;AN000;; + 38078 + 38079 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38080 ; **************************************** + 38081 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:5F64h + 38082 $MIF345: + 38083 ; *** (Disassembled MSDOS 6.22 COMMAND.COM source code.) + 38084 $MEN333: + 38085 00005B21 F6440740 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],40h + 38086 ;test byte [si+7],40h ; MSDOS 6.22 + 38087 ; (Custom/International flag for thousand separator) + 38088 00005B25 7428 jz short $MEN325 + 38089 00005B27 50 push ax ; MSDOS 6.22 + 38090 00005B28 52 push dx + 38091 00005B29 B438 mov ah,38h ; International + 38092 00005B2B 30C0 xor al,al + 38093 00005B2D 8D16[E098] lea dx,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38094 00005B31 CD21 int 21h ; DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION + 38095 ; get current-country info + 38096 ; DS:DX -> buffer for returned info + 38097 00005B33 7305 jnb short $MEN341 ; (use country depended thousand separator) + 38098 00005B35 C606[E798]2C mov byte [$M_RT+$M_COUNTRY_INFO.$M_THOU_SEPARA],',' + 38099 $MEN341: + 38100 00005B3A 8A440A mov al,[si+$M_SUBLIST_STRUC.$M_S_PAD] + 38101 ;mov al,[si+0Ah] ; (save pad character) + 38102 00005B3D 89C7 mov di,ax + 38103 00005B3F 5A pop dx + 38104 00005B40 58 pop ax + 38105 00005B41 C6440A2C mov byte [si+$M_SUBLIST_STRUC.$M_S_PAD],',' ; $M_COMMA + 38106 ;mov byte [si+0Ah],',' ; (comma is needed for converting procedure) + 38107 00005B45 E80CFD call $M_CONVERT2ASC + 38108 00005B48 89F8 mov ax,di + 38109 00005B4A 88440A mov [si+$M_SUBLIST_STRUC.$M_S_PAD],al + 38110 ;mov [si+0Ah],al ; (restore pad character) + 38111 00005B4D EB03 jmp short $MEN345 ; MSDOS 6.22 + 38112 ; *** (end of disassembled MSDOS 6.22 COMMAND.COM source code porehion) + 38113 ; **************************************** + 38114 ;$MIF345: + 38115 ;$MEN333: + 38116 $MEN325: + 38117 00005B4F E802FD call $M_CONVERT2ASC ;;AN000;; Convert to ASCII string + 38118 $MEN345: ; 15/06/2023 - MSDOS 6.22 + 38119 00005B52 09DB or bx,bx ;;AN000;; Was number negative? + 38120 00005B54 7405 jz short $MIF349 ;;AN000;; No + 38121 ;;AN000;; Yes + 38122 00005B56 31D2 xor dx,dx ;;AN000;; + 38123 00005B58 B22D mov dl,'-' ; $M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number + 38124 00005B5A 52 push dx ;;AN000;; + 38125 $MIF349: + 38126 00005B5B 55 push bp ;;AN000;; Restore return address + 38127 00005B5C C3 retn ;;AN000;; Return + 38128 + 38129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38130 ;; + 38131 ;; PROC NAME: $M_DATE_REPLACE + 38132 ;; + 38133 ;; FUNCTION: Convert a date to a decimal ASCII string using current + 38134 ;; country format and prepare to display + 38135 ;; INPUTS: DS:SI points at corresponding SUBLIST + 38136 ;; ES:DI points at VALUE from SUBLIST + 38137 ;; OUTPUTS: CX contains number of characters on stack + 38138 ;; Top of stack --> Last character + 38139 ;; . . . + 38140 ;; Bot of stack --> First character + 38141 ;; OTHER REGS Revised: DX,AX + 38142 ;; + 38143 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38144 + 38145 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38146 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38147 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38148 $M_DATE_REPLACE: + 38149 00005B5D 5D pop bp ;;AN000;; Save return address + 38150 + 38151 00005B5E C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 38152 ;mov word [$M_RT+74],10 ;;AN000;; Set default divisor + 38153 + 38154 00005B64 E86700 call $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT + 38155 ;;AN000;; All O.K.? + 38156 00005B67 31D2 xor dx,dx ;;AN000;; Reset DX value + 38157 ; 12/04/2023 + 38158 ;xor ax,ax ;;AN000;; Reset AX value + 38159 + 38160 ;cmp word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],0 + 38161 ;;cmp word [$M_RT+76],0 ;;AN000;; USA Date Format + 38162 ;jne short $MIF351 + 38163 ; 12/04/2023 + 38164 00005B69 A1[E098] mov ax,[$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] ; * + 38165 00005B6C 09C0 or ax,ax + 38166 00005B6E 751D jnz short $MIF351 38167 - 38168 00005B76 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] - 38169 ;push word [$M_RT+87] ;;AN000;; - 38170 - 38171 00005B7A 41 inc cx ;;AN000;; Increment count - 38172 00005B7B 31C0 xor ax,ax ;;AN000;; Reset AX value - 38173 - 38174 00005B7D 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] - 38175 ;mov al,[si+5] ;;AN000;; Get Day - 38176 00005B80 E87400 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string - 38177 - 38178 00005B83 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] - 38179 ;push word [$M_RT+87] ;;AN000;; - 38180 - 38181 00005B87 41 inc cx ;;AN000;; Increment count - 38182 00005B88 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] - 38183 ;mov al,[si+4] ;;AN000;; Get Month - 38184 ; 12/04/2023 - 38185 ;call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string - 38186 00005B8B EB3C jmp short $MIF354 ; ** - 38187 $MIF351: - 38188 ;cmp word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],1 - 38189 ;;cmp word [$M_RT+76],1 ;;AN000;; EUROPE Date Format - 38190 ;jne short $MIF353 - 38191 ; 12/04/2023 - 38192 ; ax = [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] ; * - 38193 00005B8D 48 dec ax - 38194 00005B8E 751D jnz short $MIF352 ; word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] <> 1 - 38195 - 38196 00005B90 E85200 call $M_YEAR ;;AN000;; Get Year - 38197 00005B93 E86100 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38168 00005B70 E87200 call $M_YEAR ;;AN000;; Get Year + 38169 00005B73 E88100 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38170 + 38171 00005B76 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] + 38172 ;push word [$M_RT+87] ;;AN000;; + 38173 + 38174 00005B7A 41 inc cx ;;AN000;; Increment count + 38175 00005B7B 31C0 xor ax,ax ;;AN000;; Reset AX value + 38176 + 38177 00005B7D 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] + 38178 ;mov al,[si+5] ;;AN000;; Get Day + 38179 00005B80 E87400 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38180 + 38181 00005B83 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] + 38182 ;push word [$M_RT+87] ;;AN000;; + 38183 + 38184 00005B87 41 inc cx ;;AN000;; Increment count + 38185 00005B88 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] + 38186 ;mov al,[si+4] ;;AN000;; Get Month + 38187 ; 12/04/2023 + 38188 ;call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38189 00005B8B EB3C jmp short $MIF354 ; ** + 38190 $MIF351: + 38191 ;cmp word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],1 + 38192 ;;cmp word [$M_RT+76],1 ;;AN000;; EUROPE Date Format + 38193 ;jne short $MIF353 + 38194 ; 12/04/2023 + 38195 ; ax = [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] ; * + 38196 00005B8D 48 dec ax + 38197 00005B8E 751D jnz short $MIF352 ; word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] <> 1 38198 - 38199 00005B96 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] - 38200 ;push word [$M_RT+87] ;;AN000;; - 38201 - 38202 00005B9A 41 inc cx ;;AN000;; Increment count - 38203 00005B9B 31C0 xor ax,ax ;;AN000;; Reset AX - 38204 - 38205 00005B9D 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] - 38206 ;mov al,[si+4] ;;AN000;; Get Month - 38207 00005BA0 E85400 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string - 38208 - 38209 00005BA3 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] - 38210 ;push word [$M_RT+87] ;;AN000;; + 38199 00005B90 E85200 call $M_YEAR ;;AN000;; Get Year + 38200 00005B93 E86100 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38201 + 38202 00005B96 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] + 38203 ;push word [$M_RT+87] ;;AN000;; + 38204 + 38205 00005B9A 41 inc cx ;;AN000;; Increment count + 38206 00005B9B 31C0 xor ax,ax ;;AN000;; Reset AX + 38207 + 38208 00005B9D 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] + 38209 ;mov al,[si+4] ;;AN000;; Get Month + 38210 00005BA0 E85400 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 38211 - 38212 00005BA7 41 inc cx ;;AN000;; - 38213 - 38214 00005BA8 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] - 38215 ;mov al,[si+5] ;;AN000;; Get Day - 38216 - 38217 ; 12/04/2023 - 38218 ;call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string - 38219 00005BAB EB1C jmp short $MIF354 ; ** + 38212 00005BA3 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] + 38213 ;push word [$M_RT+87] ;;AN000;; + 38214 + 38215 00005BA7 41 inc cx ;;AN000;; + 38216 + 38217 00005BA8 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] + 38218 ;mov al,[si+5] ;;AN000;; Get Day + 38219 38220 ; 12/04/2023 - 38221 $MIF352: - 38222 ; ax = [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT]-1 ; * - 38223 00005BAD 48 dec ax - 38224 ;jz short $MIF353 ; word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] = 2 - 38225 ;xor ax,ax - 38226 ;jmp short $MIF355 - 38227 ; 12/04/2023 - 38228 00005BAE 751C jnz short $MIF355 - 38229 $MIF353: - 38230 ;cmp word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],2 - 38231 ;;cmp word [$M_RT+76],2 ;;AN000;; JAPAN Date Format - 38232 ;jne short $MIF355 - 38233 - 38234 00005BB0 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] - 38235 ;mov al,[si+5] ;;AN000;; Get Day - 38236 00005BB3 E84100 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string - 38237 - 38238 00005BB6 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] - 38239 ;push word [$M_RT+87] ;;AN000;; - 38240 - 38241 00005BBA 41 inc cx ;;AN000;; - 38242 - 38243 00005BBB 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] - 38244 ;mov al,[si+4] ;;AN000;; Get Month - 38245 00005BBE E83600 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string - 38246 - 38247 00005BC1 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] - 38248 ;push word [$M_RT+87] ;;AN000;; + 38221 ;call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38222 00005BAB EB1C jmp short $MIF354 ; ** + 38223 ; 12/04/2023 + 38224 $MIF352: + 38225 ; ax = [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT]-1 ; * + 38226 00005BAD 48 dec ax + 38227 ;jz short $MIF353 ; word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT] = 2 + 38228 ;xor ax,ax + 38229 ;jmp short $MIF355 + 38230 ; 12/04/2023 + 38231 00005BAE 751C jnz short $MIF355 + 38232 $MIF353: + 38233 ;cmp word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],2 + 38234 ;;cmp word [$M_RT+76],2 ;;AN000;; JAPAN Date Format + 38235 ;jne short $MIF355 + 38236 + 38237 00005BB0 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] + 38238 ;mov al,[si+5] ;;AN000;; Get Day + 38239 00005BB3 E84100 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string + 38240 + 38241 00005BB6 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] + 38242 ;push word [$M_RT+87] ;;AN000;; + 38243 + 38244 00005BBA 41 inc cx ;;AN000;; + 38245 + 38246 00005BBB 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] + 38247 ;mov al,[si+4] ;;AN000;; Get Month + 38248 00005BBE E83600 call $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string 38249 - 38250 00005BC5 41 inc cx ;;AN000;; - 38251 - 38252 00005BC6 E81C00 call $M_YEAR ;;AN000;; Get Year - 38253 ; 12/04/2023 - 38254 $MIF354: - 38255 00005BC9 E82B00 call $M_CONVERTDATE ; ** ;;AN000;; Convert it to an ASCII string - 38256 $MIF355: - 38257 00005BCC 55 push bp ;;AN000;; Restore return address - 38258 00005BCD C3 retn ;;AN000;; Return - 38259 - 38260 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38261 ;; - 38262 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38263 - 38264 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38265 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38266 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38267 $M_GET_DATE: - 38268 ;mov ah,38h ; DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info - 38269 ;mov al,0 ;;AN000;; Get current country info - 38270 ; 12/04/2023 - 38271 00005BCE B80038 mov ax,3800h - 38272 ; - 38273 00005BD1 8D16[E098] lea dx,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38274 ;lea dx,[$M_RT+76] ;;AN000;; Set up addressibility to buffer - 38275 00005BD5 CD21 int 21h ;;AN000;; - 38276 00005BD7 730B jnc short $MIF357 - 38277 ; - 38278 00005BD9 C706[E098]0000 mov word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],0 ; $M_DEF_DATE_FORM - 38279 ;mov word [$M_RT+76+0],0 ;;AN000;; Set default date format (BH) - 38280 00005BDF C606[EB98]2D mov byte [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA],'-' ; $M_DEF_DATE_SEP - 38281 ;mov byte [$M_RT+87],'-' ;;AN000;; Set default date separator (BL) - 38282 $MIF357: - 38283 00005BE4 C3 retn ;;AN000;; - 38284 - 38285 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38286 ;; - 38287 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38288 - 38289 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38290 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38291 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38292 $M_YEAR: - 38293 00005BE5 8B4402 mov ax,[si+$M_SUBLIST_STRUC.$M_S_VALUE] - 38294 ;mov ax,[si+2] ;;AN000;; Get Year - 38295 - 38296 ;test $M_SL.$M_S_FLAG,Date_MDY_4 and $M_DATE_MASK - 38297 00005BE8 F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h - 38298 ;test byte [si+7],10h ;;AN000;; Was Month/Day/Year (2 Digits) specified? - 38299 00005BEC 7508 jnz short $MIF359 ;;AN000;; No - 38300 ;;AN000;; Yes - 38301 00005BEE 83F863 cmp ax,99 ; $M_MAX_2_YEAR ;;AN000;; - 38302 00005BF1 7603 jna short $MIF360 ;;AN000;; - 38303 00005BF3 B86300 mov ax,99 ; $M_MAX_2_YEAR ;;AN000;; - 38304 $MIF360: - 38305 $MIF359: - 38306 00005BF6 C3 retn ;;AN000;; - 38307 - 38308 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38309 ;; - 38310 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38311 - 38312 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38313 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38314 $M_CONVERTDATE: - 38315 $M_CONVERTTIME: ; *!*! ; 12/04/2023 - 38316 00005BF7 8F06[E098] pop word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38317 ;pop word [$M_RT+76] ;;AN000;; Save return address - 38318 00005BFB 880E[D698] mov [$M_RT+$M_RES_ADDRS.$M_SIZE],cl - 38319 ;mov [$M_RT+66],cl ;;AN000;; Save the size before conversion - 38320 00005BFF E852FC call $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string - 38321 00005C02 49 dec cx ;;AN000;; Test if size only grew by 1 - 38322 00005C03 3A0E[D698] cmp cl,[$M_RT+$M_RES_ADDRS.$M_SIZE] ;;AN000;; Did size only grow by one? - 38323 00005C07 7505 jne short $MIF363 ;;AN000;; No - 38324 00005C09 B83000 mov ax,'0' ; $M_TIMEDATE_PAD ; 30h ;;AN000;; Get a pad character (0) - 38325 00005C0C 50 push ax ;;AN000;; Save it - 38326 00005C0D 41 inc cx ;;AN000;; Count it - 38327 $MIF363: - 38328 00005C0E 41 inc cx ;;AN000;; Restore CX - 38329 00005C0F FF36[E098] push word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38330 ;push word [$M_RT+76] ;;AN000;; Restore return address - 38331 00005C13 C3 retn - 38332 - 38333 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38334 ;; - 38335 ;; PROC NAME: $M_TIME_REPLACE - 38336 ;; - 38337 ;; FUNCTION: Convert a time to a decimal ASCII string - 38338 ;; and prepare to display - 38339 ;; INPUTS: DS:SI points at corresponding SUBLIST - 38340 ;; ES:DI points at VALUE from SUBLIST - 38341 ;; OUTPUTS: CX contains number of characters on stack - 38342 ;; Top of stack --> Last character - 38343 ;; . . . - 38344 ;; Bot of stack --> First character - 38345 ;; REGS USED: BP,CX,AX - 38346 ;; - 38347 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38348 - 38349 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38350 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38351 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM ;; - 38352 $M_TIME_REPLACE: - 38353 00005C14 5D pop bp ;;AN000;; Save return address - 38354 - 38355 00005C15 C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 - 38356 ;mov word [$M_RT+74],10 ;;AN000;; Set default divisor + 38250 00005BC1 FF36[EB98] push word [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA] + 38251 ;push word [$M_RT+87] ;;AN000;; + 38252 + 38253 00005BC5 41 inc cx ;;AN000;; + 38254 + 38255 00005BC6 E81C00 call $M_YEAR ;;AN000;; Get Year + 38256 ; 12/04/2023 + 38257 $MIF354: + 38258 00005BC9 E82B00 call $M_CONVERTDATE ; ** ;;AN000;; Convert it to an ASCII string + 38259 $MIF355: + 38260 00005BCC 55 push bp ;;AN000;; Restore return address + 38261 00005BCD C3 retn ;;AN000;; Return + 38262 + 38263 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38264 ;; + 38265 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38266 + 38267 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38268 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38269 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38270 $M_GET_DATE: + 38271 ;mov ah,38h ; DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info + 38272 ;mov al,0 ;;AN000;; Get current country info + 38273 ; 12/04/2023 + 38274 00005BCE B80038 mov ax,3800h + 38275 ; + 38276 00005BD1 8D16[E098] lea dx,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38277 ;lea dx,[$M_RT+76] ;;AN000;; Set up addressibility to buffer + 38278 00005BD5 CD21 int 21h ;;AN000;; + 38279 00005BD7 730B jnc short $MIF357 + 38280 ; + 38281 00005BD9 C706[E098]0000 mov word [$M_RT+$M_COUNTRY_INFO.$M_DATE_FORMAT],0 ; $M_DEF_DATE_FORM + 38282 ;mov word [$M_RT+76+0],0 ;;AN000;; Set default date format (BH) + 38283 00005BDF C606[EB98]2D mov byte [$M_RT+$M_COUNTRY_INFO.$M_DATE_SEPARA],'-' ; $M_DEF_DATE_SEP + 38284 ;mov byte [$M_RT+87],'-' ;;AN000;; Set default date separator (BL) + 38285 $MIF357: + 38286 00005BE4 C3 retn ;;AN000;; + 38287 + 38288 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38289 ;; + 38290 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38291 + 38292 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38293 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38294 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38295 $M_YEAR: + 38296 00005BE5 8B4402 mov ax,[si+$M_SUBLIST_STRUC.$M_S_VALUE] + 38297 ;mov ax,[si+2] ;;AN000;; Get Year + 38298 + 38299 ;test $M_SL.$M_S_FLAG,Date_MDY_4 and $M_DATE_MASK + 38300 00005BE8 F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h + 38301 ;test byte [si+7],10h ;;AN000;; Was Month/Day/Year (2 Digits) specified? + 38302 00005BEC 7508 jnz short $MIF359 ;;AN000;; No + 38303 ;;AN000;; Yes + 38304 00005BEE 83F863 cmp ax,99 ; $M_MAX_2_YEAR ;;AN000;; + 38305 00005BF1 7603 jna short $MIF360 ;;AN000;; + 38306 00005BF3 B86300 mov ax,99 ; $M_MAX_2_YEAR ;;AN000;; + 38307 $MIF360: + 38308 $MIF359: + 38309 00005BF6 C3 retn ;;AN000;; + 38310 + 38311 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38312 ;; + 38313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38314 + 38315 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38316 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38317 $M_CONVERTDATE: + 38318 $M_CONVERTTIME: ; *!*! ; 12/04/2023 + 38319 00005BF7 8F06[E098] pop word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38320 ;pop word [$M_RT+76] ;;AN000;; Save return address + 38321 00005BFB 880E[D698] mov [$M_RT+$M_RES_ADDRS.$M_SIZE],cl + 38322 ;mov [$M_RT+66],cl ;;AN000;; Save the size before conversion + 38323 00005BFF E852FC call $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string + 38324 00005C02 49 dec cx ;;AN000;; Test if size only grew by 1 + 38325 00005C03 3A0E[D698] cmp cl,[$M_RT+$M_RES_ADDRS.$M_SIZE] ;;AN000;; Did size only grow by one? + 38326 00005C07 7505 jne short $MIF363 ;;AN000;; No + 38327 00005C09 B83000 mov ax,'0' ; $M_TIMEDATE_PAD ; 30h ;;AN000;; Get a pad character (0) + 38328 00005C0C 50 push ax ;;AN000;; Save it + 38329 00005C0D 41 inc cx ;;AN000;; Count it + 38330 $MIF363: + 38331 00005C0E 41 inc cx ;;AN000;; Restore CX + 38332 00005C0F FF36[E098] push word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38333 ;push word [$M_RT+76] ;;AN000;; Restore return address + 38334 00005C13 C3 retn + 38335 + 38336 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38337 ;; + 38338 ;; PROC NAME: $M_TIME_REPLACE + 38339 ;; + 38340 ;; FUNCTION: Convert a time to a decimal ASCII string + 38341 ;; and prepare to display + 38342 ;; INPUTS: DS:SI points at corresponding SUBLIST + 38343 ;; ES:DI points at VALUE from SUBLIST + 38344 ;; OUTPUTS: CX contains number of characters on stack + 38345 ;; Top of stack --> Last character + 38346 ;; . . . + 38347 ;; Bot of stack --> First character + 38348 ;; REGS USED: BP,CX,AX + 38349 ;; + 38350 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38351 + 38352 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38353 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38354 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM ;; + 38355 $M_TIME_REPLACE: + 38356 00005C14 5D pop bp ;;AN000;; Save return address 38357 - 38358 00005C1B E87700 call $M_GET_TIME ;;AN000;; All O.K.? - 38359 - 38360 ;test $M_SL.$M_S_FLAG,Time_Cty_Type and $M_TIME_MASK - 38361 00005C1E F6440701 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],1 - 38362 ;test byte [si+7],1 ;;AN000;; Is this a request for current country info? - 38363 00005C22 741A jz short $MIF365 ;;AN000;; No - 38364 ;;AN000;; Yes - 38365 00005C24 803E[F198]00 cmp byte [$M_RT+$M_COUNTRY_INFO.$M_TIME_FORMAT],0 - 38366 ;cmp byte [$M_RT+93],0 ;;AN000;; Is the current country format 12 Hour? - 38367 00005C29 7513 jne short $MIF366 ;;AN000;; No - 38368 ;;AN000;; Yes - 38369 00005C2B 8A4402 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE] - 38370 ;mov al,[si+2] ;;AN000;; Get Hours - 38371 00005C2E 3C0C cmp al,12 ;;AN000;; Is hour 12 or less? - 38372 00005C30 7C04 jl short $MLL367 ; jnge ;;AN000;; Yes - 38373 00005C32 3C17 cmp al,23 ;;AN000;; Is hour 24 or greater? - 38374 00005C34 7E04 jng short $MIF367 ; jle ;;AN000;; No - 38375 $MLL367: - 38376 00005C36 B061 mov al,'a' ; $M_AM ;;AN000;; - 38377 ;push ax ;;AN000;; Push an "a" to represent AM. - 38378 ;inc cx ;;AN000;; - 38379 ;jmp short $MEN367 ;;AN000;; - 38380 ; 12/04/2023 - 38381 00005C38 EB02 jmp short $MEN367 ; * - 38382 $MIF367: - 38383 00005C3A B070 mov al,'p' ; $M_PM ;;AN000;; - 38384 $MEN367: ; * ; 12/04/2023 - 38385 00005C3C 50 push ax ;;AN000;; Push an "p" to represent PM. - 38386 00005C3D 41 inc cx ;;AN000;; - 38387 ;$MEN367: - 38388 $MIF366: - 38389 $MIF365: ;;AN000;; - 38390 00005C3E 31C0 xor ax,ax ;;AN000;; - 38391 ;xor dx,dx ;;AN000;; - 38392 ; 13/08/2024 - 38393 00005C40 99 cwd ; PCDOS 7.1 COMMAND.COM - 38394 - 38395 ;test $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty and $M_SIZE_MASK - 38396 00005C41 F6440720 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],20h - 38397 ;test byte [si+7],20h ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? - 38398 00005C45 740B jz short $MIF372 ;;AN000;; - 38399 - 38400 00005C47 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] - 38401 ;mov al,[si+5] ;;AN000;; Get Hundreds - 38402 00005C4A E8AAFF call $M_CONVERTTIME ;;AN000;; - 38403 - 38404 00005C4D FF36[E998] push word [$M_RT+$M_COUNTRY_INFO.$M_DECI_SEPARA] - 38405 ;push word [$M_RT+85] ;;AN000;; - 38406 00005C51 41 inc cx ;;AN000;; - 38407 $MIF372: - 38408 ;test $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty and $M_SIZE_MASK - 38409 00005C52 F6440720 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],20h - 38410 ;test byte [si+7],20h ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? - 38411 00005C56 7506 jnz short $MLL374 ;;AN000;; No - 38412 - 38413 ;test $M_SL.$M_S_FLAG,Time_HHMMSS_Cty AND $M_SIZE_MASK - 38414 00005C58 F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h - 38415 ;test byte [si+7],10h ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? - 38416 00005C5C 740B jz short $MIF374 ;;AN000;; No - 38417 $MLL374: - 38418 00005C5E 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] - 38419 ;mov al,[si+4] ;;AN000;; Get Seconds - 38420 00005C61 E893FF call $M_CONVERTTIME ;;AN000;; - 38421 - 38422 00005C64 FF36[ED98] push word [$M_RT+$M_COUNTRY_INFO.$M_TIME_SEPARA] - 38423 ;push word [$M_RT+89] ;;AN000;; - 38424 00005C68 41 inc cx ;;AN000;; - 38425 $MIF374: ;; Do Hour/Min (12 Hour) - 38426 00005C69 8A4403 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+1] - 38427 ;mov al,[si+3] ;;AN000;; Get Minutes - 38428 00005C6C E888FF call $M_CONVERTTIME ;;AN000;; - 38429 - 38430 00005C6F FF36[ED98] push word [$M_RT+$M_COUNTRY_INFO.$M_TIME_SEPARA] - 38431 ;push word [$M_RT+89] ;;AN000;; - 38432 00005C73 41 inc cx ;;AN000;; - 38433 - 38434 00005C74 8A4402 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE] - 38435 ;mov al,[si+2] ;;AN000;; Get Hours + 38358 00005C15 C706[DE98]0A00 mov word [$M_RT+$M_RES_ADDRS.$M_DIVISOR],10 ; $M_BASE10 + 38359 ;mov word [$M_RT+74],10 ;;AN000;; Set default divisor + 38360 + 38361 00005C1B E87700 call $M_GET_TIME ;;AN000;; All O.K.? + 38362 + 38363 ;test $M_SL.$M_S_FLAG,Time_Cty_Type and $M_TIME_MASK + 38364 00005C1E F6440701 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],1 + 38365 ;test byte [si+7],1 ;;AN000;; Is this a request for current country info? + 38366 00005C22 741A jz short $MIF365 ;;AN000;; No + 38367 ;;AN000;; Yes + 38368 00005C24 803E[F198]00 cmp byte [$M_RT+$M_COUNTRY_INFO.$M_TIME_FORMAT],0 + 38369 ;cmp byte [$M_RT+93],0 ;;AN000;; Is the current country format 12 Hour? + 38370 00005C29 7513 jne short $MIF366 ;;AN000;; No + 38371 ;;AN000;; Yes + 38372 00005C2B 8A4402 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE] + 38373 ;mov al,[si+2] ;;AN000;; Get Hours + 38374 00005C2E 3C0C cmp al,12 ;;AN000;; Is hour 12 or less? + 38375 00005C30 7C04 jl short $MLL367 ; jnge ;;AN000;; Yes + 38376 00005C32 3C17 cmp al,23 ;;AN000;; Is hour 24 or greater? + 38377 00005C34 7E04 jng short $MIF367 ; jle ;;AN000;; No + 38378 $MLL367: + 38379 00005C36 B061 mov al,'a' ; $M_AM ;;AN000;; + 38380 ;push ax ;;AN000;; Push an "a" to represent AM. + 38381 ;inc cx ;;AN000;; + 38382 ;jmp short $MEN367 ;;AN000;; + 38383 ; 12/04/2023 + 38384 00005C38 EB02 jmp short $MEN367 ; * + 38385 $MIF367: + 38386 00005C3A B070 mov al,'p' ; $M_PM ;;AN000;; + 38387 $MEN367: ; * ; 12/04/2023 + 38388 00005C3C 50 push ax ;;AN000;; Push an "p" to represent PM. + 38389 00005C3D 41 inc cx ;;AN000;; + 38390 ;$MEN367: + 38391 $MIF366: + 38392 $MIF365: ;;AN000;; + 38393 00005C3E 31C0 xor ax,ax ;;AN000;; + 38394 ;xor dx,dx ;;AN000;; + 38395 ; 13/08/2024 + 38396 00005C40 99 cwd ; PCDOS 7.1 COMMAND.COM + 38397 + 38398 ;test $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty and $M_SIZE_MASK + 38399 00005C41 F6440720 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],20h + 38400 ;test byte [si+7],20h ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? + 38401 00005C45 740B jz short $MIF372 ;;AN000;; + 38402 + 38403 00005C47 8A4405 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+3] + 38404 ;mov al,[si+5] ;;AN000;; Get Hundreds + 38405 00005C4A E8AAFF call $M_CONVERTTIME ;;AN000;; + 38406 + 38407 00005C4D FF36[E998] push word [$M_RT+$M_COUNTRY_INFO.$M_DECI_SEPARA] + 38408 ;push word [$M_RT+85] ;;AN000;; + 38409 00005C51 41 inc cx ;;AN000;; + 38410 $MIF372: + 38411 ;test $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty and $M_SIZE_MASK + 38412 00005C52 F6440720 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],20h + 38413 ;test byte [si+7],20h ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified? + 38414 00005C56 7506 jnz short $MLL374 ;;AN000;; No + 38415 + 38416 ;test $M_SL.$M_S_FLAG,Time_HHMMSS_Cty AND $M_SIZE_MASK + 38417 00005C58 F6440710 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],10h + 38418 ;test byte [si+7],10h ;;AN000;; Was Hour/Min/Sec (12 Hour) specified? + 38419 00005C5C 740B jz short $MIF374 ;;AN000;; No + 38420 $MLL374: + 38421 00005C5E 8A4404 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+2] + 38422 ;mov al,[si+4] ;;AN000;; Get Seconds + 38423 00005C61 E893FF call $M_CONVERTTIME ;;AN000;; + 38424 + 38425 00005C64 FF36[ED98] push word [$M_RT+$M_COUNTRY_INFO.$M_TIME_SEPARA] + 38426 ;push word [$M_RT+89] ;;AN000;; + 38427 00005C68 41 inc cx ;;AN000;; + 38428 $MIF374: ;; Do Hour/Min (12 Hour) + 38429 00005C69 8A4403 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE+1] + 38430 ;mov al,[si+3] ;;AN000;; Get Minutes + 38431 00005C6C E888FF call $M_CONVERTTIME ;;AN000;; + 38432 + 38433 00005C6F FF36[ED98] push word [$M_RT+$M_COUNTRY_INFO.$M_TIME_SEPARA] + 38434 ;push word [$M_RT+89] ;;AN000;; + 38435 00005C73 41 inc cx ;;AN000;; 38436 - 38437 ;test $M_SL.$M_S_FLAG,Time_Cty_Type and $M_TIME_MASK - 38438 00005C77 F6440701 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],1 - 38439 ;test byte [si+7],1 ;;AN000;; Is this a request for current country info? - 38440 00005C7B 7413 jz short $MIF376 ;;AN000;; No - 38441 - 38442 00005C7D 803E[F198]00 cmp byte [$M_RT+$M_COUNTRY_INFO.$M_TIME_FORMAT],0 - 38443 ;cmp byte [$M_RT+93],0 ;;AN000;; Is the current country format 12 Hour? - 38444 00005C82 750C jne short $MIF377 ;;AN000;; No - 38445 - 38446 00005C84 3C0D cmp al,13 ;;AN000;; Is hour less than 12? - 38447 00005C86 7C02 jnge short $MIF378 ; jl - 38448 00005C88 2C0C sub al,12 ;;AN000;; Set to a 12 hour value - 38449 $MIF378: - 38450 ;cmp al,0 ;;AN000;; Is hour less than 12? - 38451 ;jne short $MIF380 ;;AN000;; No - 38452 ; 12/04/2023 - 38453 00005C8A 20C0 and al,al - 38454 00005C8C 7502 jnz short $MIF380 - 38455 00005C8E B00C mov al,12 ;;AN000;; Set to a 12 hour value - 38456 $MIF380: - 38457 $MIF377: - 38458 $MIF376: - 38459 00005C90 E8C1FB call $M_CONVERT2ASC ;;AN000;; Convert it to ASCII - 38460 00005C93 55 push bp ;;AN000;; Restore return address - 38461 00005C94 C3 retn ;;AN000;; Return - 38462 - 38463 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38464 ;; - 38465 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38466 - 38467 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38468 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38469 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38470 $M_GET_TIME: - 38471 ;mov ah,38h ; DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info - 38472 ;mov al,0 ;;AN000;; Get current country info - 38473 ; 12/04/2023 - 38474 00005C95 B80038 mov ax,3800h - 38475 ; - 38476 00005C98 8D16[E098] lea dx,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38477 ;lea dx,[$M_RT+76] ;;AN000;; Set up addressibility to buffer - 38478 00005C9C CD21 int 21h ;;AN000;; - 38479 00005C9E 7310 jnc short $MIF384 - 38480 - 38481 00005CA0 C706[F198]0100 mov word [$M_RT+$M_COUNTRY_INFO.$M_TIME_FORMAT],1 ; $M_DEF_TIME_FORM - 38482 ;mov word [$M_RT+93],1 ;;AN000;; Set default time format (BH) - 38483 00005CA6 C606[ED98]3A mov byte [$M_RT+$M_COUNTRY_INFO.$M_TIME_SEPARA],':' ; $M_DEF_TIME_SEP - 38484 ;mov byte [$M_RT+89],':' ;;AN000;; Set default time separator (BL) - 38485 00005CAB C606[E998]2E mov byte [$M_RT+$M_COUNTRY_INFO.$M_DECI_SEPARA],'.' ; $M_DEF_DECI_SEP - 38486 ;mov byte [$M_RT+85],'.' ;;AN000;; Set default time separator (BL) - 38487 $MIF384: - 38488 00005CB0 C3 retn ;;AN000;; - 38489 - 38490 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38491 ;; - 38492 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38493 - 38494 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 38495 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38496 ; 12/04/2023 - 38497 ;; ($M_CONVERTTIME is same with $M_CONVERTDATE) - 38498 %if 0 - 38499 $M_CONVERTTIME: - 38500 $M_CONVERTDATE: ; *!*! ; 12/04/2023 - 38501 pop word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38502 ;pop word [$M_RT+76] ;;AN000;; Save return address - 38503 mov [$M_RT+$M_RES_ADDRS.$M_SIZE],cl - 38504 ;mov [$M_RT+66],cl ;;AN000;; Save the size before conversion - 38505 call $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string - 38506 dec cx ;;AN000;; Test if size only grew by 1 - 38507 cmp cl,[$M_RT+$M_RES_ADDRS.$M_SIZE] ;;AN000;; Did size only grow by one? - 38508 jne short $MIF386 ;;AN000;; No - 38509 mov ax,'0' ; $M_TIMEDATE_PAD ; 30h ;;AN000;; Get a pad character (0) - 38510 push ax ;;AN000;; Save it - 38511 inc cx ;;AN000;; Count itount it - 38512 $MIF386: - 38513 inc cx ;;AN000;; Restore CX - 38514 push word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] - 38515 ;push word [$M_RT+76] ;;AN000;; Restore return address - 38516 retn - 38517 %endif - 38518 - 38519 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38520 ;; - 38521 ;; PROC NAME: $M_WAIT_FOR_INPUT - 38522 ;; - 38523 ;; FUNCTION: To accept keyed input and return extended key value - 38524 ;; in AX register - 38525 ;; INPUTS: DL contains the DOS function requested for input - 38526 ;; OUTPUTS: AX contains the extended key value that was read - 38527 ;; REGS USED: - 38528 ;; - 38529 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 38530 - 38531 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38532 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6123h + 38437 00005C74 8A4402 mov al,[si+$M_SUBLIST_STRUC.$M_S_VALUE] + 38438 ;mov al,[si+2] ;;AN000;; Get Hours + 38439 + 38440 ;test $M_SL.$M_S_FLAG,Time_Cty_Type and $M_TIME_MASK + 38441 00005C77 F6440701 test byte [si+$M_SUBLIST_STRUC.$M_S_FLAG],1 + 38442 ;test byte [si+7],1 ;;AN000;; Is this a request for current country info? + 38443 00005C7B 7413 jz short $MIF376 ;;AN000;; No + 38444 + 38445 00005C7D 803E[F198]00 cmp byte [$M_RT+$M_COUNTRY_INFO.$M_TIME_FORMAT],0 + 38446 ;cmp byte [$M_RT+93],0 ;;AN000;; Is the current country format 12 Hour? + 38447 00005C82 750C jne short $MIF377 ;;AN000;; No + 38448 + 38449 00005C84 3C0D cmp al,13 ;;AN000;; Is hour less than 12? + 38450 00005C86 7C02 jnge short $MIF378 ; jl + 38451 00005C88 2C0C sub al,12 ;;AN000;; Set to a 12 hour value + 38452 $MIF378: + 38453 ;cmp al,0 ;;AN000;; Is hour less than 12? + 38454 ;jne short $MIF380 ;;AN000;; No + 38455 ; 12/04/2023 + 38456 00005C8A 20C0 and al,al + 38457 00005C8C 7502 jnz short $MIF380 + 38458 00005C8E B00C mov al,12 ;;AN000;; Set to a 12 hour value + 38459 $MIF380: + 38460 $MIF377: + 38461 $MIF376: + 38462 00005C90 E8C1FB call $M_CONVERT2ASC ;;AN000;; Convert it to ASCII + 38463 00005C93 55 push bp ;;AN000;; Restore return address + 38464 00005C94 C3 retn ;;AN000;; Return + 38465 + 38466 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38467 ;; + 38468 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38469 + 38470 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38471 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38472 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38473 $M_GET_TIME: + 38474 ;mov ah,38h ; DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info + 38475 ;mov al,0 ;;AN000;; Get current country info + 38476 ; 12/04/2023 + 38477 00005C95 B80038 mov ax,3800h + 38478 ; + 38479 00005C98 8D16[E098] lea dx,[$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38480 ;lea dx,[$M_RT+76] ;;AN000;; Set up addressibility to buffer + 38481 00005C9C CD21 int 21h ;;AN000;; + 38482 00005C9E 7310 jnc short $MIF384 + 38483 + 38484 00005CA0 C706[F198]0100 mov word [$M_RT+$M_COUNTRY_INFO.$M_TIME_FORMAT],1 ; $M_DEF_TIME_FORM + 38485 ;mov word [$M_RT+93],1 ;;AN000;; Set default time format (BH) + 38486 00005CA6 C606[ED98]3A mov byte [$M_RT+$M_COUNTRY_INFO.$M_TIME_SEPARA],':' ; $M_DEF_TIME_SEP + 38487 ;mov byte [$M_RT+89],':' ;;AN000;; Set default time separator (BL) + 38488 00005CAB C606[E998]2E mov byte [$M_RT+$M_COUNTRY_INFO.$M_DECI_SEPARA],'.' ; $M_DEF_DECI_SEP + 38489 ;mov byte [$M_RT+85],'.' ;;AN000;; Set default time separator (BL) + 38490 $MIF384: + 38491 00005CB0 C3 retn ;;AN000;; + 38492 + 38493 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38494 ;; + 38495 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38496 + 38497 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 38498 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38499 ; 12/04/2023 + 38500 ;; ($M_CONVERTTIME is same with $M_CONVERTDATE) + 38501 %if 0 + 38502 $M_CONVERTTIME: + 38503 $M_CONVERTDATE: ; *!*! ; 12/04/2023 + 38504 pop word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38505 ;pop word [$M_RT+76] ;;AN000;; Save return address + 38506 mov [$M_RT+$M_RES_ADDRS.$M_SIZE],cl + 38507 ;mov [$M_RT+66],cl ;;AN000;; Save the size before conversion + 38508 call $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string + 38509 dec cx ;;AN000;; Test if size only grew by 1 + 38510 cmp cl,[$M_RT+$M_RES_ADDRS.$M_SIZE] ;;AN000;; Did size only grow by one? + 38511 jne short $MIF386 ;;AN000;; No + 38512 mov ax,'0' ; $M_TIMEDATE_PAD ; 30h ;;AN000;; Get a pad character (0) + 38513 push ax ;;AN000;; Save it + 38514 inc cx ;;AN000;; Count itount it + 38515 $MIF386: + 38516 inc cx ;;AN000;; Restore CX + 38517 push word [$M_RT+$M_RES_ADDRS.$M_TEMP_BUF] + 38518 ;push word [$M_RT+76] ;;AN000;; Restore return address + 38519 retn + 38520 %endif + 38521 + 38522 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 38523 ;; + 38524 ;; PROC NAME: $M_WAIT_FOR_INPUT + 38525 ;; + 38526 ;; FUNCTION: To accept keyed input and return extended key value + 38527 ;; in AX register + 38528 ;; INPUTS: DL contains the DOS function requested for input + 38529 ;; OUTPUTS: AX contains the extended key value that was read + 38530 ;; REGS USED: + 38531 ;; + 38532 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 38533 - 38534 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38535 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5FA1h - 38536 $M_WAIT_FOR_INPUT: - 38537 00005CB1 51 push cx ;;AN000;; Save CX - 38538 00005CB2 52 push dx ;;AN000;; Save DX - 38539 00005CB3 1E push ds ;;AN000;; Save Data segment - 38540 - 38541 00005CB4 80FAC0 cmp dl,0C0h ; DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? - 38542 00005CB7 7608 jna short $MIF388 ; jbe ;;AN001;; No, - 38543 ;;AN001;; Yes, - 38544 00005CB9 88D0 mov al,dl ;;AN001;; Mov function into AL - 38545 00005CBB 240F and al,0Fh ; LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble - 38546 00005CBD B40C mov ah,0Ch ; DOS_CLR_KEYB_BUF ;;AN001;; Set input function - 38547 00005CBF EB02 jmp short $MEN388 - 38548 $MIF388: - 38549 00005CC1 88D4 mov ah,dl ;;AN000;; Put DOS function in AH - 38550 $MEN388: - 38551 00005CC3 06 push es ;;AN000;; Get output buffer segment - 38552 00005CC4 1F pop ds ;;AN000;; - 38553 00005CC5 89FA mov dx,di ;;AN000;; Get output buffer offset in case needed - 38554 00005CC7 CD21 int 21h ;;AN000;; Get keyboard input - 38555 00005CC9 1F pop ds ;;AN000;; - 38556 00005CCA 80FA0A cmp dl,0Ah ; DOS_BUF_KEYB_INP ;;AN000;; - 38557 ;clc ;;AN000;; - 38558 00005CCD 7412 je short $MIF391 - 38559 00005CCF E85EFB call $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? - 38560 00005CD2 730B jnc short $MIF392 - 38561 00005CD4 88C1 mov cl,al ;;AN000;; Save first character - 38562 00005CD6 88D4 mov ah,dl ;;AN001;; Get back function - 38563 00005CD8 CD21 int 21h ;;AN000;; Get keyboard input - 38564 00005CDA 88CC mov ah,cl ;;AN000;; Retrieve first character AX = xxxx - 38565 00005CDC F8 clc ;;AN000;; Clear carry condition - 38566 00005CDD EB02 jmp short $MEN392 - 38567 $MIF392: - 38568 00005CDF B400 mov ah,0 ;;AN000;; AX = 00xx where xx is SBCS - 38569 $MEN392: - 38570 $MIF391: - 38571 ;jc short $MIF396 ; 15/06/2023 - 38572 00005CE1 5A pop dx ;;AN000;; - 38573 00005CE2 59 pop cx ;;AN000;; - 38574 ;jmp short $MEN396 - 38575 00005CE3 C3 retn - 38576 - 38577 ; 15/06/2023 - 38578 ;$MIF396: - 38579 ;add sp,4 ;;AN000;; - 38580 ;stc ;;AN000;; Reset carry flag - 38581 ;$MEN396: - 38582 ;retn ;;AN000;; Return - 38583 - 38584 ; ---------------------------- - 38585 ; MSDOS 6.0, TPRINTF.ASM, 1991 - 38586 ; ---------------------------- - 38587 ; include msgdcl.inc - 38588 ; ---------------------------- - 38589 - 38590 ;============================================================================ - 38591 ; HIGHLOAD.INC, MSDOS 6.0, 1992 - 38592 ;============================================================================ - 38593 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM - 38594 - 38595 ;**************************************************************************** - 38596 ; - 38597 ; This file contains routines needed to parse and implement user-given - 38598 ; command-line options of the form "/S/L:3,0x500;2;7,127;0x0BE4". InitVar() - 38599 ; and Parsevar() are used to parse this data and place it in encoded form into - 38600 ; the variables in highvar.inc, for use by the rest of the routines. - 38601 ; - 38602 ; DeviceHigh accepts this command-line (handled in sysconf.asm, not here): - 38603 ; DEVICEHIGH SIZE=hhhhhh module opts - 38604 ; Or, DeviceHigh and LoadHigh accept any of the following: - 38605 ; DH/LH module opts - 38606 ; DH/LH [/S][/L:umb[,size][;umb[,size]]*] module opts - 38607 ; DH/LH [/L:umb[,size][;umb[,size]]*][/S] module opts - 38608 ; The initial UMB,SIZE pair designates the module's load address; the remainder - 38609 ; of the UMB and SIZE pairs are used to indicate specific UMBs to be left - 38610 ; available during the load. - 38611 ; - 38612 ; When an actual load is ready to be performed, a call to HideUMBs() will - 38613 ; temporarily allocate (as owner 8+"HIDDEN ") all free elements in any - 38614 ; upper-memory block which was not specified by the user... in addition, if - 38615 ; UMBs were marked to shrink (/S option) to a certain size ("umb,size"), any - 38616 ; elements in that umb SAVE the lower-half of the newly-shrunken one are also - 38617 ; allocated. After the load, the function UnHideUMBs() (in highexit.inc) will - 38618 ; free any UMBs so allocated. - 38619 ; - 38620 ; When a device driver loads, there is the additional problem of allocating its - 38621 ; initial load site; this should be restricted to the first UMB specified on - 38622 ; the command-line. The function FreezeUM temporarily allocates all remaining - 38623 ; free upper-memory elements (as owner 8+"FROZEN "), except those in the load - 38624 ; UMB. Then the initial allocation may be made, and a call to UnFreeze will - 38625 ; return any so-allocated memory elements to FREE, for the true load. Note - 38626 ; that UnFreeze leaves HIDDEN elements allocated; it only frees FROZEN ones. - 38627 ; - 38628 ;**************************************************************************** - 38629 - 38630 ;___PROCEDURES_______________________________________________________________ - 38631 ; - 38632 ; AddrToUmb - converts a segment address in AX to its appropriate UMB # - 38633 ; BigFree - makes ES:0 point to the largest free MCB in UMB given as AL - 38634 ; FixMem - scans the UM chain and concatenates adjacent free MCBs - 38635 ; FreezeUM - Marks FROZEN all UM elements now FREE, save those in load UMB - 38636 ; GetLoadSize - Returns the load UMB minimum size (0 if not specified) - 38637 ; GetLoadUMB - Returns the load UMB number in AL (-1 if not specified) - 38638 ; GetSize - Returns the UMB in AL's minimum size (0 if not specified) - 38639 ; GetXNum - reads a 32-bit ASCII number at ES:SI and returns it in DX:AX - 38640 ; HideUMBs - links UMBs and hides upper-memory as appropriate - 38641 ; InitVar - initializes all the variables used in ParseVar and HideUMBs - 38642 ; NextMCB - moves an MCB pointer forward to the next MCB - 38643 ; ParseVar - parses [/S][/L:umb[,size][;umb[,size]]*] and builds the table - 38644 ; PrTable - produces a printout of the variables in highvar.inc - 38645 ; StoLoadSize - Overrides the load UMB minimum size with what's in AX - 38646 ; StoLoadUMB - Overrides the load UMB number with what's in AL - 38647 ; UmbHead - returns in AX the address of the first UMB block (0x9FFF) - 38648 ; UnFreeze - Marks FROZEN elements as FREE - 38649 ; - 38650 ;___VARIABLES________________________________________________________________ - 38651 ; - 38652 ; gnradix - After a call to GetXNum, is 16 or 10, depending on the # read - 38653 ; - 38654 ; Internal: - 38655 ;___PROCEDURES_______________________________________________________________ + 38534 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38535 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6123h + 38536 + 38537 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38538 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5FA1h + 38539 $M_WAIT_FOR_INPUT: + 38540 00005CB1 51 push cx ;;AN000;; Save CX + 38541 00005CB2 52 push dx ;;AN000;; Save DX + 38542 00005CB3 1E push ds ;;AN000;; Save Data segment + 38543 + 38544 00005CB4 80FAC0 cmp dl,0C0h ; DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer? + 38545 00005CB7 7608 jna short $MIF388 ; jbe ;;AN001;; No, + 38546 ;;AN001;; Yes, + 38547 00005CB9 88D0 mov al,dl ;;AN001;; Mov function into AL + 38548 00005CBB 240F and al,0Fh ; LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble + 38549 00005CBD B40C mov ah,0Ch ; DOS_CLR_KEYB_BUF ;;AN001;; Set input function + 38550 00005CBF EB02 jmp short $MEN388 + 38551 $MIF388: + 38552 00005CC1 88D4 mov ah,dl ;;AN000;; Put DOS function in AH + 38553 $MEN388: + 38554 00005CC3 06 push es ;;AN000;; Get output buffer segment + 38555 00005CC4 1F pop ds ;;AN000;; + 38556 00005CC5 89FA mov dx,di ;;AN000;; Get output buffer offset in case needed + 38557 00005CC7 CD21 int 21h ;;AN000;; Get keyboard input + 38558 00005CC9 1F pop ds ;;AN000;; + 38559 00005CCA 80FA0A cmp dl,0Ah ; DOS_BUF_KEYB_INP ;;AN000;; + 38560 ;clc ;;AN000;; + 38561 00005CCD 7412 je short $MIF391 + 38562 00005CCF E85EFB call $M_IS_IT_DBCS ;;AN000;; Is this character DBCS? + 38563 00005CD2 730B jnc short $MIF392 + 38564 00005CD4 88C1 mov cl,al ;;AN000;; Save first character + 38565 00005CD6 88D4 mov ah,dl ;;AN001;; Get back function + 38566 00005CD8 CD21 int 21h ;;AN000;; Get keyboard input + 38567 00005CDA 88CC mov ah,cl ;;AN000;; Retrieve first character AX = xxxx + 38568 00005CDC F8 clc ;;AN000;; Clear carry condition + 38569 00005CDD EB02 jmp short $MEN392 + 38570 $MIF392: + 38571 00005CDF B400 mov ah,0 ;;AN000;; AX = 00xx where xx is SBCS + 38572 $MEN392: + 38573 $MIF391: + 38574 ;jc short $MIF396 ; 15/06/2023 + 38575 00005CE1 5A pop dx ;;AN000;; + 38576 00005CE2 59 pop cx ;;AN000;; + 38577 ;jmp short $MEN396 + 38578 00005CE3 C3 retn + 38579 + 38580 ; 15/06/2023 + 38581 ;$MIF396: + 38582 ;add sp,4 ;;AN000;; + 38583 ;stc ;;AN000;; Reset carry flag + 38584 ;$MEN396: + 38585 ;retn ;;AN000;; Return + 38586 + 38587 ; ---------------------------- + 38588 ; MSDOS 6.0, TPRINTF.ASM, 1991 + 38589 ; ---------------------------- + 38590 ; include msgdcl.inc + 38591 ; ---------------------------- + 38592 + 38593 ;============================================================================ + 38594 ; HIGHLOAD.INC, MSDOS 6.0, 1992 + 38595 ;============================================================================ + 38596 ; 15/06/2023 - Retro DOS v4.2 COMMAND.COM + 38597 + 38598 ;**************************************************************************** + 38599 ; + 38600 ; This file contains routines needed to parse and implement user-given + 38601 ; command-line options of the form "/S/L:3,0x500;2;7,127;0x0BE4". InitVar() + 38602 ; and Parsevar() are used to parse this data and place it in encoded form into + 38603 ; the variables in highvar.inc, for use by the rest of the routines. + 38604 ; + 38605 ; DeviceHigh accepts this command-line (handled in sysconf.asm, not here): + 38606 ; DEVICEHIGH SIZE=hhhhhh module opts + 38607 ; Or, DeviceHigh and LoadHigh accept any of the following: + 38608 ; DH/LH module opts + 38609 ; DH/LH [/S][/L:umb[,size][;umb[,size]]*] module opts + 38610 ; DH/LH [/L:umb[,size][;umb[,size]]*][/S] module opts + 38611 ; The initial UMB,SIZE pair designates the module's load address; the remainder + 38612 ; of the UMB and SIZE pairs are used to indicate specific UMBs to be left + 38613 ; available during the load. + 38614 ; + 38615 ; When an actual load is ready to be performed, a call to HideUMBs() will + 38616 ; temporarily allocate (as owner 8+"HIDDEN ") all free elements in any + 38617 ; upper-memory block which was not specified by the user... in addition, if + 38618 ; UMBs were marked to shrink (/S option) to a certain size ("umb,size"), any + 38619 ; elements in that umb SAVE the lower-half of the newly-shrunken one are also + 38620 ; allocated. After the load, the function UnHideUMBs() (in highexit.inc) will + 38621 ; free any UMBs so allocated. + 38622 ; + 38623 ; When a device driver loads, there is the additional problem of allocating its + 38624 ; initial load site; this should be restricted to the first UMB specified on + 38625 ; the command-line. The function FreezeUM temporarily allocates all remaining + 38626 ; free upper-memory elements (as owner 8+"FROZEN "), except those in the load + 38627 ; UMB. Then the initial allocation may be made, and a call to UnFreeze will + 38628 ; return any so-allocated memory elements to FREE, for the true load. Note + 38629 ; that UnFreeze leaves HIDDEN elements allocated; it only frees FROZEN ones. + 38630 ; + 38631 ;**************************************************************************** + 38632 + 38633 ;___PROCEDURES_______________________________________________________________ + 38634 ; + 38635 ; AddrToUmb - converts a segment address in AX to its appropriate UMB # + 38636 ; BigFree - makes ES:0 point to the largest free MCB in UMB given as AL + 38637 ; FixMem - scans the UM chain and concatenates adjacent free MCBs + 38638 ; FreezeUM - Marks FROZEN all UM elements now FREE, save those in load UMB + 38639 ; GetLoadSize - Returns the load UMB minimum size (0 if not specified) + 38640 ; GetLoadUMB - Returns the load UMB number in AL (-1 if not specified) + 38641 ; GetSize - Returns the UMB in AL's minimum size (0 if not specified) + 38642 ; GetXNum - reads a 32-bit ASCII number at ES:SI and returns it in DX:AX + 38643 ; HideUMBs - links UMBs and hides upper-memory as appropriate + 38644 ; InitVar - initializes all the variables used in ParseVar and HideUMBs + 38645 ; NextMCB - moves an MCB pointer forward to the next MCB + 38646 ; ParseVar - parses [/S][/L:umb[,size][;umb[,size]]*] and builds the table + 38647 ; PrTable - produces a printout of the variables in highvar.inc + 38648 ; StoLoadSize - Overrides the load UMB minimum size with what's in AX + 38649 ; StoLoadUMB - Overrides the load UMB number with what's in AL + 38650 ; UmbHead - returns in AX the address of the first UMB block (0x9FFF) + 38651 ; UnFreeze - Marks FROZEN elements as FREE + 38652 ; + 38653 ;___VARIABLES________________________________________________________________ + 38654 ; + 38655 ; gnradix - After a call to GetXNum, is 16 or 10, depending on the # read 38656 ; - 38657 ; convUMB - checks after GetXNum to convert an address to a UMB number - 38658 ; findUMB - makes ES:0 point to the first MCB in UMB given as AL - 38659 ; fm_link - links UMBs not already linked in - 38660 ; fm_unlink - unlinks UMBs if fm_umb is set to 0 - 38661 ; frezMCB - marks as 8+FROZEN the MCB at ES:0 - 38662 ; hideMCB - marks as HIDDEN the MCB at ES:0 - 38663 ; hideUMB - marks as HIDDEN all FREE elements in UMB passed as AL - 38664 ; hideUMB? - hides as appropriate the UMB in CL - 38665 ; hl_unlink - unlinks UMBs if fm_umb is set to 0; restores strategy too - 38666 ; incArgc - increments fm_argc, for use with LH command-line parsing - 38667 ; isEOL - returns with ZF set iff AL contains CR or LF, or 0 - 38668 ; isFreeMCB - returns with ZF set if current MCB (ES:0) is FREE - 38669 ; isFrozMCB - returns with ZF set if current MCB (ES:0) is FROZEN - 38670 ; isSpecified - sets ZF if UMB in AL wasn't specified in DH/LH line. - 38671 ; isSysMCB - sets ZF iff ES points to an MCB owned by "SC" + (8 or 9) - 38672 ; isTiny - returns with ZF set if user didn't specify /S - 38673 ; isWhite - returns with ZF set iff AL contains whitespace (or "=") - 38674 ; loadLow - returns AL==0 if UMB0 == 0, else AL==1 - 38675 ; mul32 - multiplies the number in DX:AX by gnradix - 38676 ; parseL - parses ":nnnn[,nnnn][;nnnn[,nnnn]]*" for ParseVar - 38677 ; setUMBs - links umbs and sets allocation strategy for a load - 38678 ; shrinkMCB - breaks an MCB into two pieces, the lowest one's size==AX - 38679 ; stowSiz - marks a given UMB as having a given minimum size - 38680 ; stowUMB - marks a given UMB as used, if it hasn't been so marked before - 38681 ; toDigit - converts a character-digit to its binary counterpart - 38682 ; toPara - divides DX:AX by 16; result in AX only - 38683 ; toUpper - accepts one argument (probly a register), and upper-cases it. - 38684 ; unHideMCB - marks as FREE the MCB at ES:0 - 38685 ; unMarkUMB - marks a given UMB as unused, even if previously marked used - 38686 ; - 38687 ;**************************************************************************** - 38688 - 38689 ;DOS_CHECK_STRATEGY equ 5800h ; Int 21h, Func 58h, Svc 0 = check alloc strat - 38690 ;DOS_SET_STRATEGY equ 5801h ; Int 21h, Func 58h, Svc 1 = set alloc strategy - 38691 ;DOS_CHECK_UMBLINK equ 5802h ; Int 21h, Func 58h, Svc 2 = check link state - 38692 ;DOS_SET_UMBLINK equ 5803h ; Int 21h, Func 58h, Svc 3 = set link state - 38693 ;DOS_GET_DOS_LISTS equ 52h ; Int 21h, Func 52h = return list of lists - 38694 ;DOS_UMB_HEAD equ 8Ch ; Offset from ES (after func52h) to get UMBHead - 38695 - 38696 ; ----------------------------------------------------------------------------- - 38697 ;*** InitVar - initializes all the variables used in ParseVar and HideUMBs - 38698 ; ----------------------------------------------------------------------------- - 38699 ; ENTRY: None - 38700 ; EXIT: Variables listed in highvar.inc are initialized - 38701 ; ERROR EXIT: None - 38702 ; USES: Flags, variables in highvar.inc - 38703 ; ----------------------------------------------------------------------------- - 38704 ; Note that element 0 references UMB 0 (conventional), not UMB 1. Its contents - 38705 ; are largely ignored, but it is initialized nonetheless. + 38657 ; Internal: + 38658 ;___PROCEDURES_______________________________________________________________ + 38659 ; + 38660 ; convUMB - checks after GetXNum to convert an address to a UMB number + 38661 ; findUMB - makes ES:0 point to the first MCB in UMB given as AL + 38662 ; fm_link - links UMBs not already linked in + 38663 ; fm_unlink - unlinks UMBs if fm_umb is set to 0 + 38664 ; frezMCB - marks as 8+FROZEN the MCB at ES:0 + 38665 ; hideMCB - marks as HIDDEN the MCB at ES:0 + 38666 ; hideUMB - marks as HIDDEN all FREE elements in UMB passed as AL + 38667 ; hideUMB? - hides as appropriate the UMB in CL + 38668 ; hl_unlink - unlinks UMBs if fm_umb is set to 0; restores strategy too + 38669 ; incArgc - increments fm_argc, for use with LH command-line parsing + 38670 ; isEOL - returns with ZF set iff AL contains CR or LF, or 0 + 38671 ; isFreeMCB - returns with ZF set if current MCB (ES:0) is FREE + 38672 ; isFrozMCB - returns with ZF set if current MCB (ES:0) is FROZEN + 38673 ; isSpecified - sets ZF if UMB in AL wasn't specified in DH/LH line. + 38674 ; isSysMCB - sets ZF iff ES points to an MCB owned by "SC" + (8 or 9) + 38675 ; isTiny - returns with ZF set if user didn't specify /S + 38676 ; isWhite - returns with ZF set iff AL contains whitespace (or "=") + 38677 ; loadLow - returns AL==0 if UMB0 == 0, else AL==1 + 38678 ; mul32 - multiplies the number in DX:AX by gnradix + 38679 ; parseL - parses ":nnnn[,nnnn][;nnnn[,nnnn]]*" for ParseVar + 38680 ; setUMBs - links umbs and sets allocation strategy for a load + 38681 ; shrinkMCB - breaks an MCB into two pieces, the lowest one's size==AX + 38682 ; stowSiz - marks a given UMB as having a given minimum size + 38683 ; stowUMB - marks a given UMB as used, if it hasn't been so marked before + 38684 ; toDigit - converts a character-digit to its binary counterpart + 38685 ; toPara - divides DX:AX by 16; result in AX only + 38686 ; toUpper - accepts one argument (probly a register), and upper-cases it. + 38687 ; unHideMCB - marks as FREE the MCB at ES:0 + 38688 ; unMarkUMB - marks a given UMB as unused, even if previously marked used + 38689 ; + 38690 ;**************************************************************************** + 38691 + 38692 ;DOS_CHECK_STRATEGY equ 5800h ; Int 21h, Func 58h, Svc 0 = check alloc strat + 38693 ;DOS_SET_STRATEGY equ 5801h ; Int 21h, Func 58h, Svc 1 = set alloc strategy + 38694 ;DOS_CHECK_UMBLINK equ 5802h ; Int 21h, Func 58h, Svc 2 = check link state + 38695 ;DOS_SET_UMBLINK equ 5803h ; Int 21h, Func 58h, Svc 3 = set link state + 38696 ;DOS_GET_DOS_LISTS equ 52h ; Int 21h, Func 52h = return list of lists + 38697 ;DOS_UMB_HEAD equ 8Ch ; Offset from ES (after func52h) to get UMBHead + 38698 + 38699 ; ----------------------------------------------------------------------------- + 38700 ;*** InitVar - initializes all the variables used in ParseVar and HideUMBs + 38701 ; ----------------------------------------------------------------------------- + 38702 ; ENTRY: None + 38703 ; EXIT: Variables listed in highvar.inc are initialized + 38704 ; ERROR EXIT: None + 38705 ; USES: Flags, variables in highvar.inc 38706 ; ----------------------------------------------------------------------------- - 38707 - 38708 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 38709 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:615Fh + 38707 ; Note that element 0 references UMB 0 (conventional), not UMB 1. Its contents + 38708 ; are largely ignored, but it is initialized nonetheless. + 38709 ; ----------------------------------------------------------------------------- 38710 - 38711 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38712 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5FDCh - 38713 InitVar: ; proc near - 38714 ;push ax - 38715 ;push cx - 38716 ;push di - 38717 00005CE4 06 push es ; * es = ds - 38718 00005CE5 8E06[F59B] mov es,[RESSEG] ;Point ES into appropriate data segment - 38719 00005CE9 31C0 xor ax,ax - 38720 ;mov [es:fUmbTiny],al ;Shrink UMBs? (made 1 if /S given) - 38721 ;mov [es:fInHigh],al ;Set to 1 when DH/LH has been called - 38722 00005CEB 26A3[3005] mov [es:fInHigh],ax ; 16/06/2023 - 38723 00005CEF 26A3[3205] mov [es:SegLoad],ax ;Load Address (seg), used for DH only - 38724 00005CF3 26C606[3405]FF mov byte [es:UmbLoad],0FFh ;UNSPECIFIED - 38725 ;Later is the # of the 1st spec'd UMB - 38726 00005CF9 26A2[3705] mov [es:fm_argc],al ;Start with zero args having been read - 38727 - 38728 00005CFD FC cld - 38729 - 38730 00005CFE B91000 mov cx,16 ; MAXUMB ;For each entry - 38731 00005D01 BF[5E04] mov di,UmbUsed ;on the UmbUsed array, - 38732 00005D04 F3AA rep stosb ; Store 0 - 38733 - 38734 ;mov cx,16 ; MAXUMB ;Okay... for each entry - 38735 00005D06 B110 mov cl,16 - 38736 00005D08 BF[6E04] mov di,UmbSize ;on the UmbSize array, - 38737 00005D0B F3AB rep stosw ; Store 0 - 38738 - 38739 00005D0D 07 pop es ; * es = ds - 38740 ;pop di - 38741 ;pop cx - 38742 ;pop ax - 38743 00005D0E C3 retn - 38744 - 38745 ;InitVar endp - 38746 - 38747 ; ----------------------------------------------------------------------------- - 38748 ;*** FixMem - scans the upper memory chain and concatenates adjacent free MCBs - 38749 ; ----------------------------------------------------------------------------- - 38750 ; ENTRY : None - 38751 ; EXIT : None - 38752 ; ERROR : None - 38753 ; USES : Flags, fm_umb, fm_strat - 38754 ; ----------------------------------------------------------------------------- - 38755 - 38756 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 38757 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38758 FixMem: - 38759 ;push ax - 38760 ;push bx - 38761 ;push cx - 38762 ;push dx - 38763 00005D0F 06 push es - 38764 - 38765 00005D10 E84900 call fm_link ; Link in UMBs - 38766 - 38767 00005D13 E82302 call UmbHead ; Get first upper-memory MCB address (0x9FFF) - 38768 00005D16 723F jc short fmX ; (if couldn't get it, leave now). + 38711 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 38712 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:615Fh + 38713 + 38714 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38715 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:5FDCh + 38716 InitVar: ; proc near + 38717 ;push ax + 38718 ;push cx + 38719 ;push di + 38720 00005CE4 06 push es ; * es = ds + 38721 00005CE5 8E06[F59B] mov es,[RESSEG] ;Point ES into appropriate data segment + 38722 00005CE9 31C0 xor ax,ax + 38723 ;mov [es:fUmbTiny],al ;Shrink UMBs? (made 1 if /S given) + 38724 ;mov [es:fInHigh],al ;Set to 1 when DH/LH has been called + 38725 00005CEB 26A3[3005] mov [es:fInHigh],ax ; 16/06/2023 + 38726 00005CEF 26A3[3205] mov [es:SegLoad],ax ;Load Address (seg), used for DH only + 38727 00005CF3 26C606[3405]FF mov byte [es:UmbLoad],0FFh ;UNSPECIFIED + 38728 ;Later is the # of the 1st spec'd UMB + 38729 00005CF9 26A2[3705] mov [es:fm_argc],al ;Start with zero args having been read + 38730 + 38731 00005CFD FC cld + 38732 + 38733 00005CFE B91000 mov cx,16 ; MAXUMB ;For each entry + 38734 00005D01 BF[5E04] mov di,UmbUsed ;on the UmbUsed array, + 38735 00005D04 F3AA rep stosb ; Store 0 + 38736 + 38737 ;mov cx,16 ; MAXUMB ;Okay... for each entry + 38738 00005D06 B110 mov cl,16 + 38739 00005D08 BF[6E04] mov di,UmbSize ;on the UmbSize array, + 38740 00005D0B F3AB rep stosw ; Store 0 + 38741 + 38742 00005D0D 07 pop es ; * es = ds + 38743 ;pop di + 38744 ;pop cx + 38745 ;pop ax + 38746 00005D0E C3 retn + 38747 + 38748 ;InitVar endp + 38749 + 38750 ; ----------------------------------------------------------------------------- + 38751 ;*** FixMem - scans the upper memory chain and concatenates adjacent free MCBs + 38752 ; ----------------------------------------------------------------------------- + 38753 ; ENTRY : None + 38754 ; EXIT : None + 38755 ; ERROR : None + 38756 ; USES : Flags, fm_umb, fm_strat + 38757 ; ----------------------------------------------------------------------------- + 38758 + 38759 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 38760 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38761 FixMem: + 38762 ;push ax + 38763 ;push bx + 38764 ;push cx + 38765 ;push dx + 38766 00005D0F 06 push es + 38767 + 38768 00005D10 E84900 call fm_link ; Link in UMBs 38769 - 38770 00005D18 8EC0 mov es,ax ; It returns in AX, so move it to ES. - 38771 - 38772 ; - Walk MCB Chain ------------------------------------------------------------ - 38773 - 38774 00005D1A 31D2 xor dx,dx ; We're keeping the address of the last MCB - 38775 00005D1C 89D1 mov cx,dx ; in CX... and the last owner - 38776 00005D1E 42 inc dx ; in dx as we go through the loop: - 38777 - 38778 ; ------------------------------------------ - 38779 ; FM10--DX = last MCB's owner's PSP address - 38780 ; CX = last MCB's address (segment) + 38770 00005D13 E82302 call UmbHead ; Get first upper-memory MCB address (0x9FFF) + 38771 00005D16 723F jc short fmX ; (if couldn't get it, leave now). + 38772 + 38773 00005D18 8EC0 mov es,ax ; It returns in AX, so move it to ES. + 38774 + 38775 ; - Walk MCB Chain ------------------------------------------------------------ + 38776 + 38777 00005D1A 31D2 xor dx,dx ; We're keeping the address of the last MCB + 38778 00005D1C 89D1 mov cx,dx ; in CX... and the last owner + 38779 00005D1E 42 inc dx ; in dx as we go through the loop: + 38780 38781 ; ------------------------------------------ - 38782 - 38783 fm10: - 38784 00005D1F 26A00000 mov al,[es:arena_signature] ; if 'Z', don't repeat loop - 38785 ;mov al,[es:0] - 38786 00005D23 268B1E0100 mov bx,[es:arena_owner] ; if not zero, do nothing - 38787 ;mov bx,[es:1] - 38788 00005D28 09D3 or bx,dx ; dx was owner of previous MCB - 38789 00005D2A 7516 jnz short fm30 ; If not both zero, don't cat. - 38790 - 38791 ; - Coalesce memory blocks at ES:00 and CX:00 --------------------------------- - 38792 - 38793 fm20: - 38794 00005D2C 268B1E0300 mov bx,[es:arena_size] ; Grab this block's Size, - 38795 ;mov bx,[es:3] - 38796 00005D31 8EC1 mov es,cx ; Go back to prev MCB's address - 38797 00005D33 26A20000 mov [es:arena_signature], al ; & move the SECOND sig here - 38798 ;mov [es:0],al - 38799 - 38800 00005D37 26031E0300 add bx,[es:arena_size] ; Size += first MCB's size - 38801 ;add bx,1 ; And add one for the header - 38802 00005D3C 43 inc bx - 38803 00005D3D 26891E0300 mov [es:arena_size],bx ; Write the size - 38804 - 38805 ; --------------------------------------------------------------------- - 38806 fm30: - 38807 00005D42 8CC1 mov cx,es ; Put this address on the stack - 38808 00005D44 268B160100 mov dx,[es:arena_owner] ; And remember its owner - 38809 ;mov dx,[es:1] - 38810 - 38811 ;NextMCB es,bx ; Move to the next MCB - 38812 - 38813 00005D49 8CC3 mov bx,es - 38814 ;add bx,[es:3] - 38815 00005D4B 26031E0300 add bx,[es:arena_size] - 38816 00005D50 43 inc bx - 38817 00005D51 8EC3 mov es,bx - 38818 - 38819 ;cmp al,'Z' ; cmp al,5Ah - 38820 00005D53 3C5A cmp al,arena_signature_end - 38821 00005D55 75C8 jnz short fm10 ; If signature != 'Z', there are more. - 38822 fmX: - 38823 00005D57 E81900 call fm_unlink ; Unlink UMBs - 38824 - 38825 00005D5A 07 pop es - 38826 ;pop dx - 38827 ;pop cx - 38828 ;pop bx - 38829 ;pop ax - 38830 00005D5B C3 retn - 38831 - 38832 ; ----------------------------------------------------------------------------- - 38833 ; 16/06/2023 + 38782 ; FM10--DX = last MCB's owner's PSP address + 38783 ; CX = last MCB's address (segment) + 38784 ; ------------------------------------------ + 38785 + 38786 fm10: + 38787 00005D1F 26A00000 mov al,[es:arena_signature] ; if 'Z', don't repeat loop + 38788 ;mov al,[es:0] + 38789 00005D23 268B1E0100 mov bx,[es:arena_owner] ; if not zero, do nothing + 38790 ;mov bx,[es:1] + 38791 00005D28 09D3 or bx,dx ; dx was owner of previous MCB + 38792 00005D2A 7516 jnz short fm30 ; If not both zero, don't cat. + 38793 + 38794 ; - Coalesce memory blocks at ES:00 and CX:00 --------------------------------- + 38795 + 38796 fm20: + 38797 00005D2C 268B1E0300 mov bx,[es:arena_size] ; Grab this block's Size, + 38798 ;mov bx,[es:3] + 38799 00005D31 8EC1 mov es,cx ; Go back to prev MCB's address + 38800 00005D33 26A20000 mov [es:arena_signature], al ; & move the SECOND sig here + 38801 ;mov [es:0],al + 38802 + 38803 00005D37 26031E0300 add bx,[es:arena_size] ; Size += first MCB's size + 38804 ;add bx,1 ; And add one for the header + 38805 00005D3C 43 inc bx + 38806 00005D3D 26891E0300 mov [es:arena_size],bx ; Write the size + 38807 + 38808 ; --------------------------------------------------------------------- + 38809 fm30: + 38810 00005D42 8CC1 mov cx,es ; Put this address on the stack + 38811 00005D44 268B160100 mov dx,[es:arena_owner] ; And remember its owner + 38812 ;mov dx,[es:1] + 38813 + 38814 ;NextMCB es,bx ; Move to the next MCB + 38815 + 38816 00005D49 8CC3 mov bx,es + 38817 ;add bx,[es:3] + 38818 00005D4B 26031E0300 add bx,[es:arena_size] + 38819 00005D50 43 inc bx + 38820 00005D51 8EC3 mov es,bx + 38821 + 38822 ;cmp al,'Z' ; cmp al,5Ah + 38823 00005D53 3C5A cmp al,arena_signature_end + 38824 00005D55 75C8 jnz short fm10 ; If signature != 'Z', there are more. + 38825 fmX: + 38826 00005D57 E81900 call fm_unlink ; Unlink UMBs + 38827 + 38828 00005D5A 07 pop es + 38829 ;pop dx + 38830 ;pop cx + 38831 ;pop bx + 38832 ;pop ax + 38833 00005D5B C3 retn 38834 - 38835 ;INT 21h - DOS 5+ - GET OR SET UMB LINK STATE - 38836 ; ....................................................... - 38837 ; AH = 58h - 38838 ; AL = subfunction - 38839 ; 02h get UMB link state - 38840 ; Return: - 38841 ; AL = current link state - 38842 ; 00h - UMBs not part of DOS memory chain - 38843 ; 01h - UMBs in DOS memory chain - 38844 ; 03h set UMB link state - 38845 ; BX = new link state - 38846 ; 0000h - remove UMBs from DOS memory chain - 38847 ; 0001h - add UMBs to DOS memory chain - 38848 ; - 38849 ;Return: CF clear if successful - 38850 ; CF set on error - 38851 ; AX = error code (01h) (see #01680) - 38852 ; ....................................................... - 38853 - 38854 ; ----------------------------------------------------------------------------- - 38855 ;*** fm_link - links UMBs not already linked in - 38856 ; ----------------------------------------------------------------------------- - 38857 ; ENTRY: None - 38858 ; EXIT: fm_umb == 0 if not linked in previously, 1 if already linked in - 38859 ; ERROR: None - 38860 ; USES: AX, BX, fm_umb - 38861 ; ----------------------------------------------------------------------------- - 38862 - 38863 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 38864 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38865 fm_link: - 38866 00005D5C B80258 mov ax,5802h ; DOS_CHECK_UMBLINK - 38867 00005D5F CD21 int 21h ; Current link-state is now in al - 38868 - 38869 ;putdata fm_umb,al ; So store it in fm_umb for later - 38870 - 38871 ;push es - 38872 ;mov es,[RESSEG] - 38873 ;mov [es:fm_umb],al - 38874 ;pop es - 38875 00005D61 1E push ds - 38876 00005D62 8E1E[F59B] mov ds,[RESSEG] - 38877 00005D66 A2[3505] mov [fm_umb],al - 38878 00005D69 1F pop ds - 38879 - 38880 00005D6A B80358 mov ax,5803h ; DOS_SET_UMBLINK - 38881 00005D6D BB0100 mov bx,1 - 38882 00005D70 CD21 int 21h - 38883 00005D72 C3 retn - 38884 - 38885 ; ----------------------------------------------------------------------------- - 38886 ;*** fm_unlink - unlinks UMBs if fm_umb is set to 0 - 38887 ; ----------------------------------------------------------------------------- - 38888 ; ENTRY: fm_umb == 1 : leave linked, else unlink - 38889 ; EXIT: None - 38890 ; ERROR: None - 38891 ; USES: AX, BX - 38892 ; ----------------------------------------------------------------------------- - 38893 - 38894 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 38895 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38896 fm_unlink: - 38897 00005D73 31DB xor bx,bx - 38898 - 38899 ;getdata bl,fm_umb ; fm_umb already has the old link-state - 38900 - 38901 00005D75 1E push ds - 38902 00005D76 8E1E[F59B] mov ds,[RESSEG] - 38903 00005D7A 8A1E[3505] mov bl,[fm_umb] - 38904 00005D7E 1F pop ds - 38905 - 38906 00005D7F B80358 mov ax,5803h ; DOS_SET_UMBLINK - 38907 00005D82 CD21 int 21h ; so just use that, and call int 21h - 38908 00005D84 C3 retn - 38909 - 38910 ; ----------------------------------------------------------------------------- - 38911 ;*** ParseVar - parses [/S][/L:umb[,size][;umb[,size]]*] and builds the table - 38912 ; laid out in highvar.inc + 38835 ; ----------------------------------------------------------------------------- + 38836 ; 16/06/2023 + 38837 + 38838 ;INT 21h - DOS 5+ - GET OR SET UMB LINK STATE + 38839 ; ....................................................... + 38840 ; AH = 58h + 38841 ; AL = subfunction + 38842 ; 02h get UMB link state + 38843 ; Return: + 38844 ; AL = current link state + 38845 ; 00h - UMBs not part of DOS memory chain + 38846 ; 01h - UMBs in DOS memory chain + 38847 ; 03h set UMB link state + 38848 ; BX = new link state + 38849 ; 0000h - remove UMBs from DOS memory chain + 38850 ; 0001h - add UMBs to DOS memory chain + 38851 ; + 38852 ;Return: CF clear if successful + 38853 ; CF set on error + 38854 ; AX = error code (01h) (see #01680) + 38855 ; ....................................................... + 38856 + 38857 ; ----------------------------------------------------------------------------- + 38858 ;*** fm_link - links UMBs not already linked in + 38859 ; ----------------------------------------------------------------------------- + 38860 ; ENTRY: None + 38861 ; EXIT: fm_umb == 0 if not linked in previously, 1 if already linked in + 38862 ; ERROR: None + 38863 ; USES: AX, BX, fm_umb + 38864 ; ----------------------------------------------------------------------------- + 38865 + 38866 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 38867 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38868 fm_link: + 38869 00005D5C B80258 mov ax,5802h ; DOS_CHECK_UMBLINK + 38870 00005D5F CD21 int 21h ; Current link-state is now in al + 38871 + 38872 ;putdata fm_umb,al ; So store it in fm_umb for later + 38873 + 38874 ;push es + 38875 ;mov es,[RESSEG] + 38876 ;mov [es:fm_umb],al + 38877 ;pop es + 38878 00005D61 1E push ds + 38879 00005D62 8E1E[F59B] mov ds,[RESSEG] + 38880 00005D66 A2[3505] mov [fm_umb],al + 38881 00005D69 1F pop ds + 38882 + 38883 00005D6A B80358 mov ax,5803h ; DOS_SET_UMBLINK + 38884 00005D6D BB0100 mov bx,1 + 38885 00005D70 CD21 int 21h + 38886 00005D72 C3 retn + 38887 + 38888 ; ----------------------------------------------------------------------------- + 38889 ;*** fm_unlink - unlinks UMBs if fm_umb is set to 0 + 38890 ; ----------------------------------------------------------------------------- + 38891 ; ENTRY: fm_umb == 1 : leave linked, else unlink + 38892 ; EXIT: None + 38893 ; ERROR: None + 38894 ; USES: AX, BX + 38895 ; ----------------------------------------------------------------------------- + 38896 + 38897 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 38898 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38899 fm_unlink: + 38900 00005D73 31DB xor bx,bx + 38901 + 38902 ;getdata bl,fm_umb ; fm_umb already has the old link-state + 38903 + 38904 00005D75 1E push ds + 38905 00005D76 8E1E[F59B] mov ds,[RESSEG] + 38906 00005D7A 8A1E[3505] mov bl,[fm_umb] + 38907 00005D7E 1F pop ds + 38908 + 38909 00005D7F B80358 mov ax,5803h ; DOS_SET_UMBLINK + 38910 00005D82 CD21 int 21h ; so just use that, and call int 21h + 38911 00005D84 C3 retn + 38912 38913 ; ----------------------------------------------------------------------------- - 38914 ; ENTRY: ES:SI points to command tail of LoadHigh/DeviceHigh (whitespace ok) - 38915 ; EXIT: ES:SI points to first character in child program name - 38916 ; ERROR: ES:SI points to character which caused error, carry set, AX == code - 38917 ; USES: ES:SI, AX, flags, variables in highvar.inc - 38918 ; ----------------------------------------------------------------------------- - 38919 ; Error codes (in AX if carry set on return): - 38920 ; - 38921 - 38922 ;PV_InvArg equ 1 ; Invalid argument passed - 38923 ;PV_BadUMB equ 2 ; Bad UMB number passed (duplicate?) - 38924 ;PV_InvSwt equ 3 ; Unrecognized switch passed - 38925 - 38926 ; - 38927 ; This routine exects ES:SI to point to a string much like the following: - 38928 ; "/S/L:1,200;2 module options" - 38929 ; Optionally, the string can begin with whitespace; neither /S nor /L is - 38930 ; required, though that's what this routine is supposed to parse. - 38931 ; - 38932 - 38933 ;optS equ 'S' ; /S - 38934 ;optL equ 'L' ; /L:... + 38914 ;*** ParseVar - parses [/S][/L:umb[,size][;umb[,size]]*] and builds the table + 38915 ; laid out in highvar.inc + 38916 ; ----------------------------------------------------------------------------- + 38917 ; ENTRY: ES:SI points to command tail of LoadHigh/DeviceHigh (whitespace ok) + 38918 ; EXIT: ES:SI points to first character in child program name + 38919 ; ERROR: ES:SI points to character which caused error, carry set, AX == code + 38920 ; USES: ES:SI, AX, flags, variables in highvar.inc + 38921 ; ----------------------------------------------------------------------------- + 38922 ; Error codes (in AX if carry set on return): + 38923 ; + 38924 + 38925 ;PV_InvArg equ 1 ; Invalid argument passed + 38926 ;PV_BadUMB equ 2 ; Bad UMB number passed (duplicate?) + 38927 ;PV_InvSwt equ 3 ; Unrecognized switch passed + 38928 + 38929 ; + 38930 ; This routine exects ES:SI to point to a string much like the following: + 38931 ; "/S/L:1,200;2 module options" + 38932 ; Optionally, the string can begin with whitespace; neither /S nor /L is + 38933 ; required, though that's what this routine is supposed to parse. + 38934 ; 38935 - 38936 ; - 38937 ; ----------------------------------------------------------------------------- - 38938 ; LoadHigh has a list of arguments, returned by cparse, which is used to create - 38939 ; a command-line for spawning a child process. For a typical LH command, say, - 38940 ; lh /l:1,1000;2 print/d:lpt2 - 38941 ; the arguments would look like (one per line): - 38942 ; lh - 38943 ; /l - 38944 ; 1 - 38945 ; 1000 - 38946 ; 2 - 38947 ; print - 38948 ; /d - 38949 ; :lpt2 - 38950 ; In short, if "print" were, say, "43", there'd be no way to determine which - 38951 ; arg was the filename. So, inside this routine, we keep a running counter - 38952 ; of the number of arguments LH will need to skip in order to get to the - 38953 ; program name. The "lh" is implicit--it'll always have to skip that. So if - 38954 ; there's no "/l" or "/s", fm_argc will be 0 ... other than that, 1 is added - 38955 ; for: - 38956 ; Each /L - 38957 ; Each /S (there should be only one) - 38958 ; Each UMB number (they follow ":" or ";") - 38959 ; Each UMB size (they follow ",") - 38960 ; So, in the above example, fm_argc would be 4-- and LH would skip right to - 38961 ; "print". Note that InitVar initializes fm_argc to zero. - 38962 ; ----------------------------------------------------------------------------- - 38963 - 38964 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 38965 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6216h + 38936 ;optS equ 'S' ; /S + 38937 ;optL equ 'L' ; /L:... + 38938 + 38939 ; + 38940 ; ----------------------------------------------------------------------------- + 38941 ; LoadHigh has a list of arguments, returned by cparse, which is used to create + 38942 ; a command-line for spawning a child process. For a typical LH command, say, + 38943 ; lh /l:1,1000;2 print/d:lpt2 + 38944 ; the arguments would look like (one per line): + 38945 ; lh + 38946 ; /l + 38947 ; 1 + 38948 ; 1000 + 38949 ; 2 + 38950 ; print + 38951 ; /d + 38952 ; :lpt2 + 38953 ; In short, if "print" were, say, "43", there'd be no way to determine which + 38954 ; arg was the filename. So, inside this routine, we keep a running counter + 38955 ; of the number of arguments LH will need to skip in order to get to the + 38956 ; program name. The "lh" is implicit--it'll always have to skip that. So if + 38957 ; there's no "/l" or "/s", fm_argc will be 0 ... other than that, 1 is added + 38958 ; for: + 38959 ; Each /L + 38960 ; Each /S (there should be only one) + 38961 ; Each UMB number (they follow ":" or ";") + 38962 ; Each UMB size (they follow ",") + 38963 ; So, in the above example, fm_argc would be 4-- and LH would skip right to + 38964 ; "print". Note that InitVar initializes fm_argc to zero. + 38965 ; ----------------------------------------------------------------------------- 38966 - 38967 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 38968 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6093h + 38967 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 38968 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6216h 38969 - 38970 ParseVar: ; proc near - 38971 ;push di - 38972 ;push ds ; * - 38973 ;push es - 38974 ; - 38975 ; 16/06/2023 - 38976 ; es = ds (from 'ParseLhCmd') - 38977 ;push es ; Make DS:SI point to it, as well as ES:SI - 38978 ;pop ds ; (regardless if we're in devhigh or loadhigh) - 38979 - 38980 00005D85 FC cld - 38981 - 38982 ; ------------------------------------------------ - 38983 ; PV10--ES:SI = any whitespace on the command-line - 38984 ; ------------------------------------------------ - 38985 - 38986 pv10: - 38987 00005D86 AC lodsb ; here, ES:SI==" /L..."--must eat whitespace - 38988 00005D87 E8A800 call isWhite - 38989 00005D8A 74FA jz short pv10 ; ES:SI==" /L..."--keep eating. - 38990 00005D8C 3C2F cmp al,'/' ; SWTCH - 38991 00005D8E 7404 je short pv20 ; ES:SI=="/L..."--go process a switch - 38992 - 38993 00005D90 4E dec si ; Backup--it's now "odule options", and we need - 38994 00005D91 F8 clc ; that "m" we just read (or whatever it is). - 38995 00005D92 EB2C jmp short pvX ; Then return with carry clear == we're done. - 38996 pv20: - 38997 00005D94 AC lodsb ; Just read 'S' or 'L', hopefully - 38998 - 38999 ;toUpper al ; So we make it upper-case, and... - 39000 00005D95 24DF and al,0DFh + 38970 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 38971 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6093h + 38972 + 38973 ParseVar: ; proc near + 38974 ;push di + 38975 ;push ds ; * + 38976 ;push es + 38977 ; + 38978 ; 16/06/2023 + 38979 ; es = ds (from 'ParseLhCmd') + 38980 ;push es ; Make DS:SI point to it, as well as ES:SI + 38981 ;pop ds ; (regardless if we're in devhigh or loadhigh) + 38982 + 38983 00005D85 FC cld + 38984 + 38985 ; ------------------------------------------------ + 38986 ; PV10--ES:SI = any whitespace on the command-line + 38987 ; ------------------------------------------------ + 38988 + 38989 pv10: + 38990 00005D86 AC lodsb ; here, ES:SI==" /L..."--must eat whitespace + 38991 00005D87 E8A800 call isWhite + 38992 00005D8A 74FA jz short pv10 ; ES:SI==" /L..."--keep eating. + 38993 00005D8C 3C2F cmp al,'/' ; SWTCH + 38994 00005D8E 7404 je short pv20 ; ES:SI=="/L..."--go process a switch + 38995 + 38996 00005D90 4E dec si ; Backup--it's now "odule options", and we need + 38997 00005D91 F8 clc ; that "m" we just read (or whatever it is). + 38998 00005D92 EB2C jmp short pvX ; Then return with carry clear == we're done. + 38999 pv20: + 39000 00005D94 AC lodsb ; Just read 'S' or 'L', hopefully 39001 - 39002 00005D97 3C53 cmp al,'S' ; optS ; just read 'S'? - 39003 00005D99 7510 jne short pv30 + 39002 ;toUpper al ; So we make it upper-case, and... + 39003 00005D95 24DF and al,0DFh 39004 - 39005 00005D9B E87E00 call incArgc ; If it's /S, it's another arg for LH to skip. - 39006 - 39007 ;putdata fUmbTiny,1 ; /S, so ES:SI==" /L..." or " module opts", or - 39008 - 39009 ;push es - 39010 ;mov es,[RESSEG] - 39011 ;mov byte [es:fUmbTiny],1 - 39012 ;pop es - 39013 00005D9E 1E push ds - 39014 00005D9F 8E1E[F59B] mov ds,[RESSEG] - 39015 00005DA3 C606[3105]01 mov byte [fUmbTiny],1 - 39016 00005DA8 1F pop ds - 39017 - 39018 00005DA9 EBDB jmp short pv10 ; possibly even "/L...". - 39019 pv30: - 39020 00005DAB 3C4C cmp al,'L' ; optL ; If it's not 'L' either, then it's a bad - 39021 00005DAD 750B jne short pvE1 ; switch! - 39022 - 39023 00005DAF E86A00 call incArgc ; If it's /L, it's another arg for LH to skip. - 39024 - 39025 00005DB2 E80C00 call parseL - 39026 00005DB5 73CF jnc short pv10 ; If no carry, go back and look for more + 39005 00005D97 3C53 cmp al,'S' ; optS ; just read 'S'? + 39006 00005D99 7510 jne short pv30 + 39007 + 39008 00005D9B E87E00 call incArgc ; If it's /S, it's another arg for LH to skip. + 39009 + 39010 ;putdata fUmbTiny,1 ; /S, so ES:SI==" /L..." or " module opts", or + 39011 + 39012 ;push es + 39013 ;mov es,[RESSEG] + 39014 ;mov byte [es:fUmbTiny],1 + 39015 ;pop es + 39016 00005D9E 1E push ds + 39017 00005D9F 8E1E[F59B] mov ds,[RESSEG] + 39018 00005DA3 C606[3105]01 mov byte [fUmbTiny],1 + 39019 00005DA8 1F pop ds + 39020 + 39021 00005DA9 EBDB jmp short pv10 ; possibly even "/L...". + 39022 pv30: + 39023 00005DAB 3C4C cmp al,'L' ; optL ; If it's not 'L' either, then it's a bad + 39024 00005DAD 750B jne short pvE1 ; switch! + 39025 + 39026 00005DAF E86A00 call incArgc ; If it's /L, it's another arg for LH to skip. 39027 - 39028 00005DB7 4E dec si ; Else, back up and exit. - 39029 00005DB8 EB03 jmp short pvErr ; AX has already been set by parseL - 39030 pvE1: - 39031 00005DBA B80300 mov ax,3 ; PV_InvSwt - 39032 ; Unrecognized switch passed - 39033 pvErr: - 39034 00005DBD 4E dec si - 39035 00005DBE 4E dec si - 39036 00005DBF F9 stc - 39037 pvX: - 39038 ;pop es - 39039 ;pop ds ; * - 39040 ;pop di - 39041 00005DC0 C3 retn - 39042 - 39043 ;ParseVar endp - 39044 - 39045 ; ----------------------------------------------------------------------------- - 39046 ;*** parseL - parses ":nnnn[,nnnn][;nnnn[,nnnn]]*" for ParseVar - 39047 ; ----------------------------------------------------------------------------- - 39048 ; ENTRY: ES:SI points to colon - 39049 ; EXIT: ES:SI points to first character not parsed - 39050 ; ERROR: Carry set; rewind three characters and return (see ParseVar) - 39051 ; USES: ES:SI, flags, AX, CX, DX, variables in highvar.inc - 39052 ; ----------------------------------------------------------------------------- - 39053 ; If the string here is terminated with anything other than whitespace or a - 39054 ; switchchar (perhaps it's /S or another /L:... ), then we return with carry - 39055 ; set, indicating that they've screwed up the syntax. The 3-character rewind - 39056 ; makes sure the app /L: is reported as being the culprit. - 39057 ; ----------------------------------------------------------------------------- - 39058 - 39059 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39060 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39061 parseL: - 39062 00005DC1 AC lodsb - 39063 00005DC2 3C3A cmp al,':' ; Make sure they did /L: - 39064 00005DC4 754A jne short plE1 ; If they didn't, return with carry set. - 39065 - 39066 ; ------------------------------------------ - 39067 ; PL10--ES:SI = a UMB number, after /L: or ; - 39068 ; ------------------------------------------ - 39069 - 39070 pl10: - 39071 00005DC6 E8FD00 call GetXNum ; After this, 'tis ",size" or ";umb" or " mod" - 39072 00005DC9 724B jc short plE2 ; And error if it's a bad number. - 39073 00005DCB E8C801 call convUMB ; Convert any address to a UMB number - 39074 - 39075 00005DCE 88C1 mov cl,al ; !* ; Remember the UMB number - 39076 00005DD0 E88300 call stowUMB ; Mark this UMB # as used; - 39077 00005DD3 7241 jc short plE2 ; If it was already marked, it'll error - 39078 - 39079 00005DD5 E84400 call incArgc ; Each UMB number is another arg for LH to skip - 39080 - 39081 00005DD8 AC lodsb - 39082 00005DD9 3C3B cmp al,';' ; Did "umb;" ? - 39083 00005DDB 74E9 je short pl10 ; Yep: go back and get another UMB. - 39084 - 39085 00005DDD E85200 call isWhite ; Did "umb " ? - 39086 00005DE0 7439 jz short plX ; Yep: return (it'll go back to whitespace) + 39028 00005DB2 E80C00 call parseL + 39029 00005DB5 73CF jnc short pv10 ; If no carry, go back and look for more + 39030 + 39031 00005DB7 4E dec si ; Else, back up and exit. + 39032 00005DB8 EB03 jmp short pvErr ; AX has already been set by parseL + 39033 pvE1: + 39034 00005DBA B80300 mov ax,3 ; PV_InvSwt + 39035 ; Unrecognized switch passed + 39036 pvErr: + 39037 00005DBD 4E dec si + 39038 00005DBE 4E dec si + 39039 00005DBF F9 stc + 39040 pvX: + 39041 ;pop es + 39042 ;pop ds ; * + 39043 ;pop di + 39044 00005DC0 C3 retn + 39045 + 39046 ;ParseVar endp + 39047 + 39048 ; ----------------------------------------------------------------------------- + 39049 ;*** parseL - parses ":nnnn[,nnnn][;nnnn[,nnnn]]*" for ParseVar + 39050 ; ----------------------------------------------------------------------------- + 39051 ; ENTRY: ES:SI points to colon + 39052 ; EXIT: ES:SI points to first character not parsed + 39053 ; ERROR: Carry set; rewind three characters and return (see ParseVar) + 39054 ; USES: ES:SI, flags, AX, CX, DX, variables in highvar.inc + 39055 ; ----------------------------------------------------------------------------- + 39056 ; If the string here is terminated with anything other than whitespace or a + 39057 ; switchchar (perhaps it's /S or another /L:... ), then we return with carry + 39058 ; set, indicating that they've screwed up the syntax. The 3-character rewind + 39059 ; makes sure the app /L: is reported as being the culprit. + 39060 ; ----------------------------------------------------------------------------- + 39061 + 39062 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39063 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39064 parseL: + 39065 00005DC1 AC lodsb + 39066 00005DC2 3C3A cmp al,':' ; Make sure they did /L: + 39067 00005DC4 754A jne short plE1 ; If they didn't, return with carry set. + 39068 + 39069 ; ------------------------------------------ + 39070 ; PL10--ES:SI = a UMB number, after /L: or ; + 39071 ; ------------------------------------------ + 39072 + 39073 pl10: + 39074 00005DC6 E8FD00 call GetXNum ; After this, 'tis ",size" or ";umb" or " mod" + 39075 00005DC9 724B jc short plE2 ; And error if it's a bad number. + 39076 00005DCB E8C801 call convUMB ; Convert any address to a UMB number + 39077 + 39078 00005DCE 88C1 mov cl,al ; !* ; Remember the UMB number + 39079 00005DD0 E88300 call stowUMB ; Mark this UMB # as used; + 39080 00005DD3 7241 jc short plE2 ; If it was already marked, it'll error + 39081 + 39082 00005DD5 E84400 call incArgc ; Each UMB number is another arg for LH to skip + 39083 + 39084 00005DD8 AC lodsb + 39085 00005DD9 3C3B cmp al,';' ; Did "umb;" ? + 39086 00005DDB 74E9 je short pl10 ; Yep: go back and get another UMB. 39087 - 39088 00005DE2 E84200 call isEOL ; Did "umb" ? - 39089 00005DE5 7433 jz short plSwX ; If so, backup and exit like everything's ok + 39088 00005DDD E85200 call isWhite ; Did "umb " ? + 39089 00005DE0 7439 jz short plX ; Yep: return (it'll go back to whitespace) 39090 - 39091 00005DE7 3C2F cmp al,'/' ; SWTCH ; Did "umb/" ? (as in, "/L:1,100;2/S") - 39092 00005DE9 742F je short plSwX ; If so, back up ES:SI one character and return + 39091 00005DE2 E84200 call isEOL ; Did "umb" ? + 39092 00005DE5 7433 jz short plSwX ; If so, backup and exit like everything's ok 39093 - 39094 00005DEB 3C2C cmp al,',' ; Did "umb," ? - 39095 00005DED 7521 jne short plE1 ; Just what the heck DID they do? Return error. + 39094 00005DE7 3C2F cmp al,'/' ; SWTCH ; Did "umb/" ? (as in, "/L:1,100;2/S") + 39095 00005DE9 742F je short plSwX ; If so, back up ES:SI one character and return 39096 - 39097 ; --- Read a size ------------------------------------------------------------- - 39098 - 39099 00005DEF E8D400 call GetXNum ; Stop on "size;" or "size " or anything else - 39100 00005DF2 721C jc short plE1 ; And error if it's a bad size. + 39097 00005DEB 3C2C cmp al,',' ; Did "umb," ? + 39098 00005DED 7521 jne short plE1 ; Just what the heck DID they do? Return error. + 39099 + 39100 ; --- Read a size ------------------------------------------------------------- 39101 - 39102 00005DF4 E83401 call toPara ; Convert from bytes to paragraphs - 39103 - 39104 00005DF7 E88600 call stowSiz ; CL still has the UMB number for this routine - 39105 - 39106 00005DFA E81F00 call incArgc ; Each UMB size is another arg for LH to skip - 39107 - 39108 00005DFD AC lodsb - 39109 00005DFE 3C3B cmp al,';' ; They did "umb,size;", so get another UMB. - 39110 00005E00 74C4 je short pl10 ; - 39111 - 39112 00005E02 E82D00 call isWhite ; Did it end with whitespace? - 39113 00005E05 7414 jz short plX ; If so, we're done here--go back. + 39102 00005DEF E8D400 call GetXNum ; Stop on "size;" or "size " or anything else + 39103 00005DF2 721C jc short plE1 ; And error if it's a bad size. + 39104 + 39105 00005DF4 E83401 call toPara ; Convert from bytes to paragraphs + 39106 + 39107 00005DF7 E88600 call stowSiz ; CL still has the UMB number for this routine + 39108 + 39109 00005DFA E81F00 call incArgc ; Each UMB size is another arg for LH to skip + 39110 + 39111 00005DFD AC lodsb + 39112 00005DFE 3C3B cmp al,';' ; They did "umb,size;", so get another UMB. + 39113 00005E00 74C4 je short pl10 ; 39114 - 39115 00005E07 E81D00 call isEOL ; Did they do "umb,size" and end??? (stupid) - 39116 00005E0A 740E jz short plSwX ; If so, backup and exit like everything's ok + 39115 00005E02 E82D00 call isWhite ; Did it end with whitespace? + 39116 00005E05 7414 jz short plX ; If so, we're done here--go back. 39117 - 39118 00005E0C 3C2F cmp al,'/' ; SWTCH ; Did they do "umb,size/" ? - 39119 00005E0E 740A je short plSwX ; If so, again, we're done here. - 39120 plE1: - 39121 00005E10 B80100 mov ax,1 ; PV_InvArg - 39122 ; If not, we don't know WHAT they did... - 39123 00005E13 4E dec si - 39124 00005E14 F9 stc - 39125 00005E15 C3 retn - 39126 plE2: - 39127 ; cf = 1 - 39128 00005E16 B80200 mov ax,2 ; PV_BadUMB - 39129 ; In this case, they've specified a UMB twice - 39130 ;stc - 39131 00005E19 C3 retn - 39132 plSwX: - 39133 00005E1A 4E dec si ; If we hit a '/' character, back up one char - 39134 ; so the whitespace checker will see it too. - 39135 plX: - 39136 ; cf = 0 - 39137 ;clc ; Then just return with carry clear, so - 39138 00005E1B C3 retn ; ParseVar will go about its business. - 39139 - 39140 ; ----------------------------------------------------------------------------- - 39141 ;*** incArgc - increments fm_argc, for use with LoadHigh command-line parsing - 39142 ; ----------------------------------------------------------------------------- - 39143 ; ENTRY: None - 39144 ; EXIT: None - 39145 ; ERROR: None - 39146 ; USES: fm_argc, flags - 39147 ; ----------------------------------------------------------------------------- - 39148 - 39149 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39150 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39151 incArgc: - 39152 ;push ax - 39153 - 39154 ;;getdata al,fm_argc ; Obtain previous value of fm_argc, - 39155 ; - 39156 ;push ds ; getdata (macro) - 39157 ; ; getdata al, fm_argc - 39158 ;mov ds,[RESSEG] - 39159 ;mov al,[fm_argc] ; Obtain previous value of fm_argc, - 39160 ;pop ds - 39161 ; - 39162 ;inc al ; Increment it, - 39163 ; - 39164 ;;putdata fm_argc,al ; And store it right back. - 39165 ; - 39166 ;push es ; putdata (macro) - 39167 ; ; putdata fm_argc, al - 39168 ;mov es,[RESSEG] - 39169 ;mov [es:fm_argc],al ; and store it right back. - 39170 ;pop es - 39171 - 39172 ; 16/06/2023 - 39173 00005E1C 1E push ds - 39174 00005E1D 8E1E[F59B] mov ds,[RESSEG] - 39175 00005E21 FE06[3705] inc byte [fm_argc] ; increment fm_argc - 39176 00005E25 1F pop ds - 39177 - 39178 ;pop ax - 39179 00005E26 C3 retn + 39118 00005E07 E81D00 call isEOL ; Did they do "umb,size" and end??? (stupid) + 39119 00005E0A 740E jz short plSwX ; If so, backup and exit like everything's ok + 39120 + 39121 00005E0C 3C2F cmp al,'/' ; SWTCH ; Did they do "umb,size/" ? + 39122 00005E0E 740A je short plSwX ; If so, again, we're done here. + 39123 plE1: + 39124 00005E10 B80100 mov ax,1 ; PV_InvArg + 39125 ; If not, we don't know WHAT they did... + 39126 00005E13 4E dec si + 39127 00005E14 F9 stc + 39128 00005E15 C3 retn + 39129 plE2: + 39130 ; cf = 1 + 39131 00005E16 B80200 mov ax,2 ; PV_BadUMB + 39132 ; In this case, they've specified a UMB twice + 39133 ;stc + 39134 00005E19 C3 retn + 39135 plSwX: + 39136 00005E1A 4E dec si ; If we hit a '/' character, back up one char + 39137 ; so the whitespace checker will see it too. + 39138 plX: + 39139 ; cf = 0 + 39140 ;clc ; Then just return with carry clear, so + 39141 00005E1B C3 retn ; ParseVar will go about its business. + 39142 + 39143 ; ----------------------------------------------------------------------------- + 39144 ;*** incArgc - increments fm_argc, for use with LoadHigh command-line parsing + 39145 ; ----------------------------------------------------------------------------- + 39146 ; ENTRY: None + 39147 ; EXIT: None + 39148 ; ERROR: None + 39149 ; USES: fm_argc, flags + 39150 ; ----------------------------------------------------------------------------- + 39151 + 39152 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39153 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39154 incArgc: + 39155 ;push ax + 39156 + 39157 ;;getdata al,fm_argc ; Obtain previous value of fm_argc, + 39158 ; + 39159 ;push ds ; getdata (macro) + 39160 ; ; getdata al, fm_argc + 39161 ;mov ds,[RESSEG] + 39162 ;mov al,[fm_argc] ; Obtain previous value of fm_argc, + 39163 ;pop ds + 39164 ; + 39165 ;inc al ; Increment it, + 39166 ; + 39167 ;;putdata fm_argc,al ; And store it right back. + 39168 ; + 39169 ;push es ; putdata (macro) + 39170 ; ; putdata fm_argc, al + 39171 ;mov es,[RESSEG] + 39172 ;mov [es:fm_argc],al ; and store it right back. + 39173 ;pop es + 39174 + 39175 ; 16/06/2023 + 39176 00005E1C 1E push ds + 39177 00005E1D 8E1E[F59B] mov ds,[RESSEG] + 39178 00005E21 FE06[3705] inc byte [fm_argc] ; increment fm_argc + 39179 00005E25 1F pop ds 39180 - 39181 ; ----------------------------------------------------------------------------- - 39182 ;*** isEOL - returns with ZF set iff AL contains CR or LF, or 0 - 39183 ; ----------------------------------------------------------------------------- - 39184 ; ENTRY: AL contains character to test - 39185 ; EXIT: ZF set if AL contains CR or LF, or 0 - 39186 ; ERROR: None - 39187 ; USES: ZF - 39188 ; ----------------------------------------------------------------------------- - 39189 - 39190 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39191 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39192 isEOL: - 39193 ;cmp al,0 ; Null-terminator - 39194 00005E27 20C0 and al,al - 39195 00005E29 7406 jz short ieX - 39196 00005E2B 3C0D cmp al,0Dh ; CR ; Carriage Return - 39197 00005E2D 7402 je short ieX - 39198 00005E2F 3C0A cmp al,0Ah ; LF ; LineFeed - 39199 ieX: - 39200 00005E31 C3 retn - 39201 - 39202 - 39203 ; ----------------------------------------------------------------------------- - 39204 ;*** isWhite - returns with ZF set iff AL contains whitespace (or "=") - 39205 ; ----------------------------------------------------------------------------- - 39206 ; ENTRY: AL contains character to test - 39207 ; EXIT: ZF set if AL contains space, tab, or equals - 39208 ; ERROR: None - 39209 ; USES: ZF - 39210 ; ----------------------------------------------------------------------------- - 39211 - 39212 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39213 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39214 isWhite: - 39215 00005E32 3C20 cmp al,' ' ; Space - 39216 00005E34 7406 je short iwX - 39217 00005E36 3C3D cmp al,'=' ; Equals (treat as whitespace) - 39218 00005E38 7402 je short iwX - 39219 00005E3A 3C09 cmp al,09h ; TAB ; Tab - 39220 iwX: - 39221 00005E3C C3 retn - 39222 - 39223 ; ----------------------------------------------------------------------------- - 39224 ;*** unMarkUMB - marks a given UMB as unused, even if previously marked used - 39225 ; ----------------------------------------------------------------------------- - 39226 ; ENTRY: AL contains UMB number - 39227 ; EXIT: None - 39228 ; ERROR: None - 39229 ; USES: Flags, variables in highvar.inc - 39230 ; ----------------------------------------------------------------------------- - 39231 - 39232 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39233 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39234 unMarkUMB: - 39235 ;;pushreg - 39236 ;push ax ; *** - 39237 - 39238 ;push bx ; ** - 39239 - 39240 ;push di - 39241 ;push es - 39242 00005E3D 1E push ds ; * - 39243 - 39244 ;;dataseg es - 39245 ;mov es,[RESSEG] + 39181 ;pop ax + 39182 00005E26 C3 retn + 39183 + 39184 ; ----------------------------------------------------------------------------- + 39185 ;*** isEOL - returns with ZF set iff AL contains CR or LF, or 0 + 39186 ; ----------------------------------------------------------------------------- + 39187 ; ENTRY: AL contains character to test + 39188 ; EXIT: ZF set if AL contains CR or LF, or 0 + 39189 ; ERROR: None + 39190 ; USES: ZF + 39191 ; ----------------------------------------------------------------------------- + 39192 + 39193 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39194 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39195 isEOL: + 39196 ;cmp al,0 ; Null-terminator + 39197 00005E27 20C0 and al,al + 39198 00005E29 7406 jz short ieX + 39199 00005E2B 3C0D cmp al,0Dh ; CR ; Carriage Return + 39200 00005E2D 7402 je short ieX + 39201 00005E2F 3C0A cmp al,0Ah ; LF ; LineFeed + 39202 ieX: + 39203 00005E31 C3 retn + 39204 + 39205 + 39206 ; ----------------------------------------------------------------------------- + 39207 ;*** isWhite - returns with ZF set iff AL contains whitespace (or "=") + 39208 ; ----------------------------------------------------------------------------- + 39209 ; ENTRY: AL contains character to test + 39210 ; EXIT: ZF set if AL contains space, tab, or equals + 39211 ; ERROR: None + 39212 ; USES: ZF + 39213 ; ----------------------------------------------------------------------------- + 39214 + 39215 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39216 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39217 isWhite: + 39218 00005E32 3C20 cmp al,' ' ; Space + 39219 00005E34 7406 je short iwX + 39220 00005E36 3C3D cmp al,'=' ; Equals (treat as whitespace) + 39221 00005E38 7402 je short iwX + 39222 00005E3A 3C09 cmp al,09h ; TAB ; Tab + 39223 iwX: + 39224 00005E3C C3 retn + 39225 + 39226 ; ----------------------------------------------------------------------------- + 39227 ;*** unMarkUMB - marks a given UMB as unused, even if previously marked used + 39228 ; ----------------------------------------------------------------------------- + 39229 ; ENTRY: AL contains UMB number + 39230 ; EXIT: None + 39231 ; ERROR: None + 39232 ; USES: Flags, variables in highvar.inc + 39233 ; ----------------------------------------------------------------------------- + 39234 + 39235 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39236 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39237 unMarkUMB: + 39238 ;;pushreg + 39239 ;push ax ; *** + 39240 + 39241 ;push bx ; ** + 39242 + 39243 ;push di + 39244 ;push es + 39245 00005E3D 1E push ds ; * 39246 - 39247 00005E3E 8E1E[F59B] mov ds,[RESSEG] ; * - 39248 - 39249 ;xor ah,ah ; 0 - 39250 ;mov bx,ax - 39251 ;mov byte [es:bx+UmbUsed],0 - 39252 ;mov [bx+UmbUsed],ah ; marks the UMB as unused - 39253 00005E42 88C3 mov bl,al - 39254 00005E44 30FF xor bh,bh ; 0 - 39255 00005E46 88BF[5E04] mov [bx+UmbUsed],bh ; 0 ; ** - 39256 - 39257 ;cmp [es:UmbLoad],al - 39258 ;jnz short umu10 - 39259 00005E4A 3806[3405] cmp [UmbLoad],al - 39260 00005E4E 7504 jne short umu10 - 39261 - 39262 ;mov byte [es:UmbLoad],0 - 39263 ;mov [UmbLoad],ah ; If unmarked the load UMB, load into convent. - 39264 00005E50 883E[3405] mov [UmbLoad],bh ; 0 ; ** - 39265 umu10: - 39266 00005E54 1F pop ds ; * - 39267 ;;popreg - 39268 ;pop es - 39269 ;pop di - 39270 - 39271 ;pop bx ; ** - 39272 - 39273 ;pop ax ; *** - 39274 - 39275 ;;normseg es - 39276 - 39277 00005E55 C3 retn - 39278 - 39279 ; ----------------------------------------------------------------------------- - 39280 ;*** stowUMB - marks a given UMB as used, if it hasn't been so marked before - 39281 ; -- accepts a UMB # in AL, and makes sure it hasn't yet been - 39282 ; listed in the /L:... chain. If it's the first one specified, it sets UmbLoad - 39283 ; to that UMB #... and in any case, it marks the UMB as specified. - 39284 ; ----------------------------------------------------------------------------- - 39285 ; ENTRY: AL contains UMB number, as specified by the user - 39286 ; EXIT: None - 39287 ; ERROR: Carry set if UMB # is less than 0 or >= MAXUMB (see highvar.inc) - 39288 ; USES: AX, Flags, variables in highvar.inc - 39289 ; ----------------------------------------------------------------------------- - 39290 - 39291 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39292 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39293 stowUMB: - 39294 00005E56 3C10 cmp al,16 ; MAXUMB - 39295 00005E58 7202 jb short su10 - 39296 00005E5A F9 stc - 39297 00005E5B C3 retn ; Ooops-- UMB>=MAXUMB - 39298 su10: - 39299 ;pushreg - 39300 ;dataseg es ; Point ES into appropriate data segment - 39301 ;dataseg ds ; Point DS into appropriate data segment - 39302 - 39303 ;push bx ; ** - 39304 - 39305 ;push di - 39306 ;push si - 39307 - 39308 00005E5C 1E push ds ; * - 39309 - 39310 ;push es - 39311 ;mov es,[RESSEG] - 39312 00005E5D 8E1E[F59B] mov ds,[RESSEG] - 39313 - 39314 00005E61 803E[3405]FF cmp byte [UmbLoad],0FFh ; UNSPECIFIED - 39315 ; If this, we haven't been here before - 39316 00005E66 7503 jne short su20 - 39317 00005E68 A2[3405] mov [UmbLoad],al ; So remember this UMB as the load UMB slot. - 39318 su20: - 39319 00005E6B 08C0 or al,al ; If they gave UMB 0, there's really nothing - 39320 00005E6D 740F jz short su30 ; that we should do here. - 39321 - 39322 ;mov bl,al - 39323 ;xor bh,bh - 39324 ;mov ax,1 ; Now, AX = 1, and BX = UMB Number - 39325 00005E6F 30E4 xor ah,ah - 39326 00005E71 89C3 mov bx,ax - 39327 00005E73 B001 mov al,1 - 39328 - 39329 ;xchg [es:bx+UmbUsed],al - 39330 00005E75 8687[5E04] xchg [bx+UmbUsed],al + 39247 ;;dataseg es + 39248 ;mov es,[RESSEG] + 39249 + 39250 00005E3E 8E1E[F59B] mov ds,[RESSEG] ; * + 39251 + 39252 ;xor ah,ah ; 0 + 39253 ;mov bx,ax + 39254 ;mov byte [es:bx+UmbUsed],0 + 39255 ;mov [bx+UmbUsed],ah ; marks the UMB as unused + 39256 00005E42 88C3 mov bl,al + 39257 00005E44 30FF xor bh,bh ; 0 + 39258 00005E46 88BF[5E04] mov [bx+UmbUsed],bh ; 0 ; ** + 39259 + 39260 ;cmp [es:UmbLoad],al + 39261 ;jnz short umu10 + 39262 00005E4A 3806[3405] cmp [UmbLoad],al + 39263 00005E4E 7504 jne short umu10 + 39264 + 39265 ;mov byte [es:UmbLoad],0 + 39266 ;mov [UmbLoad],ah ; If unmarked the load UMB, load into convent. + 39267 00005E50 883E[3405] mov [UmbLoad],bh ; 0 ; ** + 39268 umu10: + 39269 00005E54 1F pop ds ; * + 39270 ;;popreg + 39271 ;pop es + 39272 ;pop di + 39273 + 39274 ;pop bx ; ** + 39275 + 39276 ;pop ax ; *** + 39277 + 39278 ;;normseg es + 39279 + 39280 00005E55 C3 retn + 39281 + 39282 ; ----------------------------------------------------------------------------- + 39283 ;*** stowUMB - marks a given UMB as used, if it hasn't been so marked before + 39284 ; -- accepts a UMB # in AL, and makes sure it hasn't yet been + 39285 ; listed in the /L:... chain. If it's the first one specified, it sets UmbLoad + 39286 ; to that UMB #... and in any case, it marks the UMB as specified. + 39287 ; ----------------------------------------------------------------------------- + 39288 ; ENTRY: AL contains UMB number, as specified by the user + 39289 ; EXIT: None + 39290 ; ERROR: Carry set if UMB # is less than 0 or >= MAXUMB (see highvar.inc) + 39291 ; USES: AX, Flags, variables in highvar.inc + 39292 ; ----------------------------------------------------------------------------- + 39293 + 39294 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39295 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39296 stowUMB: + 39297 00005E56 3C10 cmp al,16 ; MAXUMB + 39298 00005E58 7202 jb short su10 + 39299 00005E5A F9 stc + 39300 00005E5B C3 retn ; Ooops-- UMB>=MAXUMB + 39301 su10: + 39302 ;pushreg + 39303 ;dataseg es ; Point ES into appropriate data segment + 39304 ;dataseg ds ; Point DS into appropriate data segment + 39305 + 39306 ;push bx ; ** + 39307 + 39308 ;push di + 39309 ;push si + 39310 + 39311 00005E5C 1E push ds ; * + 39312 + 39313 ;push es + 39314 ;mov es,[RESSEG] + 39315 00005E5D 8E1E[F59B] mov ds,[RESSEG] + 39316 + 39317 00005E61 803E[3405]FF cmp byte [UmbLoad],0FFh ; UNSPECIFIED + 39318 ; If this, we haven't been here before + 39319 00005E66 7503 jne short su20 + 39320 00005E68 A2[3405] mov [UmbLoad],al ; So remember this UMB as the load UMB slot. + 39321 su20: + 39322 00005E6B 08C0 or al,al ; If they gave UMB 0, there's really nothing + 39323 00005E6D 740F jz short su30 ; that we should do here. + 39324 + 39325 ;mov bl,al + 39326 ;xor bh,bh + 39327 ;mov ax,1 ; Now, AX = 1, and BX = UMB Number + 39328 00005E6F 30E4 xor ah,ah + 39329 00005E71 89C3 mov bx,ax + 39330 00005E73 B001 mov al,1 39331 - 39332 00005E79 08C0 or al,al ; If it was already 1, then al==1... and that - 39333 00005E7B 7401 jz short su30 ; means an error. + 39332 ;xchg [es:bx+UmbUsed],al + 39333 00005E75 8687[5E04] xchg [bx+UmbUsed],al 39334 - 39335 00005E7D F9 stc ; OOOPS! This one's been used before. :( - 39336 su30: - 39337 ;popreg - 39338 ;normseg ds - 39339 ;normseg es - 39340 ;retn - 39341 - 39342 ;pop es - 39343 - 39344 00005E7E 1F pop ds ; * - 39345 - 39346 ;pop si - 39347 ;pop di + 39335 00005E79 08C0 or al,al ; If it was already 1, then al==1... and that + 39336 00005E7B 7401 jz short su30 ; means an error. + 39337 + 39338 00005E7D F9 stc ; OOOPS! This one's been used before. :( + 39339 su30: + 39340 ;popreg + 39341 ;normseg ds + 39342 ;normseg es + 39343 ;retn + 39344 + 39345 ;pop es + 39346 + 39347 00005E7E 1F pop ds ; * 39348 - 39349 ;pop bx ; ** - 39350 - 39351 00005E7F C3 retn - 39352 - 39353 ; ----------------------------------------------------------------------------- - 39354 ;*** stowSiz - marks a given UMB as having a given minimum size - 39355 ; ----------------------------------------------------------------------------- - 39356 ; ENTRY: CL contains UMB number, AX contains size - 39357 ; EXIT: None - 39358 ; ERROR: None - 39359 ; USES: AX, DX, Flags, variables in highvar.inc - 39360 ; ----------------------------------------------------------------------------- - 39361 - 39362 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39363 stowSiz: - 39364 ;pushreg - 39365 ;dataseg es ; Point ES into appropriate data seg - 39366 - 39367 ;push bx ; ** - 39368 - 39369 ;push di - 39370 ;push es - 39371 ;mov es,[RESSEG] - 39372 00005E80 1E push ds ; * - 39373 00005E81 8E1E[F59B] mov ds,[RESSEG] - 39374 - 39375 00005E85 88CB mov bl,cl ; Now bl==UMB number, AX==size - 39376 00005E87 B700 mov bh,0 ; bx==UMB number, AX==size - 39377 00005E89 D0E3 shl bl,1 ; bx==offset into array, AX=size - 39378 ;mov [es:bx+UmbSize],ax - 39379 00005E8B 8987[6E04] mov [bx+UmbSize],ax ; Store the size - 39380 - 39381 00005E8F 1F pop ds ; * - 39382 - 39383 ;popreg - 39384 ;normseg es ; Return ES to where it was + 39349 ;pop si + 39350 ;pop di + 39351 + 39352 ;pop bx ; ** + 39353 + 39354 00005E7F C3 retn + 39355 + 39356 ; ----------------------------------------------------------------------------- + 39357 ;*** stowSiz - marks a given UMB as having a given minimum size + 39358 ; ----------------------------------------------------------------------------- + 39359 ; ENTRY: CL contains UMB number, AX contains size + 39360 ; EXIT: None + 39361 ; ERROR: None + 39362 ; USES: AX, DX, Flags, variables in highvar.inc + 39363 ; ----------------------------------------------------------------------------- + 39364 + 39365 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39366 stowSiz: + 39367 ;pushreg + 39368 ;dataseg es ; Point ES into appropriate data seg + 39369 + 39370 ;push bx ; ** + 39371 + 39372 ;push di + 39373 ;push es + 39374 ;mov es,[RESSEG] + 39375 00005E80 1E push ds ; * + 39376 00005E81 8E1E[F59B] mov ds,[RESSEG] + 39377 + 39378 00005E85 88CB mov bl,cl ; Now bl==UMB number, AX==size + 39379 00005E87 B700 mov bh,0 ; bx==UMB number, AX==size + 39380 00005E89 D0E3 shl bl,1 ; bx==offset into array, AX=size + 39381 ;mov [es:bx+UmbSize],ax + 39382 00005E8B 8987[6E04] mov [bx+UmbSize],ax ; Store the size + 39383 + 39384 00005E8F 1F pop ds ; * 39385 - 39386 ;pop es - 39387 ;pop di - 39388 - 39389 ;pop bx ; ** - 39390 - 39391 00005E90 C3 retn - 39392 - 39393 ; ----------------------------------------------------------------------------- - 39394 ;*** toDigit - converts a character-digit to its binary counterpart - 39395 ; -- verifies that CL contains a valid character-digit; if so, it - 39396 ; changes CL to its counterpart binary digit ((CL-'0') or (CL-'A'+10)). A-F - 39397 ; are considered valid iff gnradix is 16. - 39398 ; ----------------------------------------------------------------------------- - 39399 ; ENTRY: CL contains a digit ('0' to '9' or, if gnradix==16, 'A' to 'F') - 39400 ; EXIT: CL contains digit in binary (0 to 9 or, if gnradix==16, 0 to 15) - 39401 ; ERROR: Carry set indicates invalid digit; carry clear indicates good digit - 39402 ; USES: CL, Flags - 39403 ; ----------------------------------------------------------------------------- - 39404 ; If the string is preceeded with "0x", the value is read as hexadecimal; else, - 39405 ; as decimal. After a read, you may check the radix by examining gnradix--it - 39406 ; will be 10 or 16. - 39407 ; ----------------------------------------------------------------------------- - 39408 - 39409 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39410 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6358h - 39411 gnradix: - 39412 00005E91 0000 dw 0 ; Must be a word--16x16 multiplication - 39413 - 39414 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39415 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:635Ah + 39386 ;popreg + 39387 ;normseg es ; Return ES to where it was + 39388 + 39389 ;pop es + 39390 ;pop di + 39391 + 39392 ;pop bx ; ** + 39393 + 39394 00005E90 C3 retn + 39395 + 39396 ; ----------------------------------------------------------------------------- + 39397 ;*** toDigit - converts a character-digit to its binary counterpart + 39398 ; -- verifies that CL contains a valid character-digit; if so, it + 39399 ; changes CL to its counterpart binary digit ((CL-'0') or (CL-'A'+10)). A-F + 39400 ; are considered valid iff gnradix is 16. + 39401 ; ----------------------------------------------------------------------------- + 39402 ; ENTRY: CL contains a digit ('0' to '9' or, if gnradix==16, 'A' to 'F') + 39403 ; EXIT: CL contains digit in binary (0 to 9 or, if gnradix==16, 0 to 15) + 39404 ; ERROR: Carry set indicates invalid digit; carry clear indicates good digit + 39405 ; USES: CL, Flags + 39406 ; ----------------------------------------------------------------------------- + 39407 ; If the string is preceeded with "0x", the value is read as hexadecimal; else, + 39408 ; as decimal. After a read, you may check the radix by examining gnradix--it + 39409 ; will be 10 or 16. + 39410 ; ----------------------------------------------------------------------------- + 39411 + 39412 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39413 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6358h + 39414 gnradix: + 39415 00005E91 0000 dw 0 ; Must be a word--16x16 multiplication 39416 - 39417 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39418 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:61D7h - 39419 toDigit: - 39420 ;cmp word [gnradix],16 - 39421 00005E93 803E[915E]10 cmp byte [gnradix],16 - 39422 00005E98 751C jne short td20 ; Don't check hex digits if radix isn't 16 - 39423 - 39424 00005E9A 80F961 cmp cl,'a' - 39425 00005E9D 7209 jb short td10 - 39426 00005E9F 80F966 cmp cl,'f' - 39427 00005EA2 7720 ja short tdE ; Nothing valid above 'z' at all... - 39428 00005EA4 80E957 sub cl,'a'-10 ; 57h ; Make 'a'==10 and return. - 39429 ; clc ; <- CLC is implicit from last SUB - 39430 00005EA7 C3 retn - 39431 td10: - 39432 00005EA8 80F941 cmp cl,'A' - 39433 00005EAB 7209 jb short td20 ; Below 'A'? Not a letter... - 39434 00005EAD 80F946 cmp cl,'F' - 39435 00005EB0 7712 ja short tdE ; Above 'F'? Not a digit. - 39436 00005EB2 80E937 sub cl,'A'-10 ; 37h ; Make 'A'==10 and return. - 39437 ; clc ; <- CLC is implicit from last SUB - 39438 tdErr: - 39439 00005EB5 C3 retn - 39440 td20: - 39441 00005EB6 80F930 cmp cl,'0' ; If less than zero, - 39442 ;jb short tdE ; Done. - 39443 00005EB9 72FA jb short tdErr ; cf = 1 - 39444 00005EBB 80F939 cmp cl,'9' ; Or, if greater than nine, - 39445 00005EBE 7704 ja short tdE ; Done. - 39446 00005EC0 80E930 sub cl,'0' ; 30h ; Okay--make '0'==0 and return. - 39447 ; clc ; <- CLC is implicit from last SUB - 39448 00005EC3 C3 retn - 39449 tdE: - 39450 00005EC4 F9 stc - 39451 00005EC5 C3 retn - 39452 - 39453 ; ----------------------------------------------------------------------------- - 39454 ;*** GetXNum - reads a 32-bit ASCII number at ES:SI and returns it in DX:AX - 39455 ; ----------------------------------------------------------------------------- - 39456 ; ENTRY: ES:SI points to an ascii string to scan - 39457 ; EXIT: ES:SI moved to first invalid digit, DX:AX contains value read - 39458 ; ERROR: Carry set if # is too big, or has no digits (EOL possibly) - 39459 ; USES: ES:SI, DX, AX, Flags, gnradix - 39460 ; ----------------------------------------------------------------------------- - 39461 ; If the string is preceeded with "0x", the value is read as hexadecimal; else, - 39462 ; as decimal. After a read, you may check the radix by examining gnradix--it - 39463 ; will be 10 or 16. - 39464 ; ----------------------------------------------------------------------------- - 39465 - 39466 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 39467 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39468 GetXNum: - 39469 ;pushreg - 39470 - 39471 ;push bx ; ** - 39472 00005EC6 51 push cx ; * + 39417 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39418 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:635Ah + 39419 + 39420 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39421 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:61D7h + 39422 toDigit: + 39423 ;cmp word [gnradix],16 + 39424 00005E93 803E[915E]10 cmp byte [gnradix],16 + 39425 00005E98 751C jne short td20 ; Don't check hex digits if radix isn't 16 + 39426 + 39427 00005E9A 80F961 cmp cl,'a' + 39428 00005E9D 7209 jb short td10 + 39429 00005E9F 80F966 cmp cl,'f' + 39430 00005EA2 7720 ja short tdE ; Nothing valid above 'z' at all... + 39431 00005EA4 80E957 sub cl,'a'-10 ; 57h ; Make 'a'==10 and return. + 39432 ; clc ; <- CLC is implicit from last SUB + 39433 00005EA7 C3 retn + 39434 td10: + 39435 00005EA8 80F941 cmp cl,'A' + 39436 00005EAB 7209 jb short td20 ; Below 'A'? Not a letter... + 39437 00005EAD 80F946 cmp cl,'F' + 39438 00005EB0 7712 ja short tdE ; Above 'F'? Not a digit. + 39439 00005EB2 80E937 sub cl,'A'-10 ; 37h ; Make 'A'==10 and return. + 39440 ; clc ; <- CLC is implicit from last SUB + 39441 tdErr: + 39442 00005EB5 C3 retn + 39443 td20: + 39444 00005EB6 80F930 cmp cl,'0' ; If less than zero, + 39445 ;jb short tdE ; Done. + 39446 00005EB9 72FA jb short tdErr ; cf = 1 + 39447 00005EBB 80F939 cmp cl,'9' ; Or, if greater than nine, + 39448 00005EBE 7704 ja short tdE ; Done. + 39449 00005EC0 80E930 sub cl,'0' ; 30h ; Okay--make '0'==0 and return. + 39450 ; clc ; <- CLC is implicit from last SUB + 39451 00005EC3 C3 retn + 39452 tdE: + 39453 00005EC4 F9 stc + 39454 00005EC5 C3 retn + 39455 + 39456 ; ----------------------------------------------------------------------------- + 39457 ;*** GetXNum - reads a 32-bit ASCII number at ES:SI and returns it in DX:AX + 39458 ; ----------------------------------------------------------------------------- + 39459 ; ENTRY: ES:SI points to an ascii string to scan + 39460 ; EXIT: ES:SI moved to first invalid digit, DX:AX contains value read + 39461 ; ERROR: Carry set if # is too big, or has no digits (EOL possibly) + 39462 ; USES: ES:SI, DX, AX, Flags, gnradix + 39463 ; ----------------------------------------------------------------------------- + 39464 ; If the string is preceeded with "0x", the value is read as hexadecimal; else, + 39465 ; as decimal. After a read, you may check the radix by examining gnradix--it + 39466 ; will be 10 or 16. + 39467 ; ----------------------------------------------------------------------------- + 39468 + 39469 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 39470 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39471 GetXNum: + 39472 ;pushreg 39473 - 39474 ;push ds - 39475 - 39476 00005EC7 FC cld - 39477 00005EC8 31C0 xor ax,ax - 39478 00005ECA 31DB xor bx,bx - 39479 00005ECC 31C9 xor cx,cx - 39480 00005ECE 31D2 xor dx,dx ; Start with 0 (makes sense) - 39481 - 39482 ;mov word [gnradix],10 ; And default to a radix of 10 (dec) - 39483 00005ED0 C606[915E]0A mov byte [gnradix],10 + 39474 ;push bx ; ** + 39475 00005EC6 51 push cx ; * + 39476 + 39477 ;push ds + 39478 + 39479 00005EC7 FC cld + 39480 00005EC8 31C0 xor ax,ax + 39481 00005ECA 31DB xor bx,bx + 39482 00005ECC 31C9 xor cx,cx + 39483 00005ECE 31D2 xor dx,dx ; Start with 0 (makes sense) 39484 - 39485 00005ED5 268A0C mov cl,[es:si] ; Now AX=0, BX=0, CH=0/CL=char, DX=0 - 39486 00005ED8 E8B8FF call toDigit - 39487 00005EDB 722D jc short gxnE ; If it's not a digit, leave now. - 39488 - 39489 00005EDD 08C9 or cl,cl - 39490 00005EDF 7515 jnz short gxn20 ; Doesn't have '0x' - 39491 00005EE1 268A4C01 mov cl,[es:si+1] - 39492 00005EE5 80F978 cmp cl,'x' ; Either 'x'... - 39493 00005EE8 7405 je short gxn10 - 39494 00005EEA 80F958 cmp cl,'X' ; ...or 'X' means it's hexadecimal - 39495 00005EED 7507 jne short gxn20 - 39496 - 39497 gxn10: - 39498 ;mov word [gnradix],16 - 39499 00005EEF C606[915E]10 mov byte [gnradix],16 - 39500 00005EF4 46 inc si ; Since we read "0x", march over it. - 39501 00005EF5 46 inc si - 39502 - 39503 ; ------------------------------------------------------ - 39504 ; GXN20--ES:SI = a digit in a number; if not, we're done - 39505 ; DX:AX = current total - 39506 ; BX = 0 - 39507 ; CH = 0 - 39508 ; ------------------------------------------------------ - 39509 - 39510 gxn20: - 39511 00005EF6 268A0C mov cl,[es:si] ; Now DX:AX=current total, CH=0/CL=char - 39512 00005EF9 46 inc si - 39513 - 39514 00005EFA E896FF call toDigit ; Accepts only valid digits, A-F -> 10-16 - 39515 00005EFD 720D jc short gxnQ ; <- Ah... wasn't a digit. Stop. + 39485 ;mov word [gnradix],10 ; And default to a radix of 10 (dec) + 39486 00005ED0 C606[915E]0A mov byte [gnradix],10 + 39487 + 39488 00005ED5 268A0C mov cl,[es:si] ; Now AX=0, BX=0, CH=0/CL=char, DX=0 + 39489 00005ED8 E8B8FF call toDigit + 39490 00005EDB 722D jc short gxnE ; If it's not a digit, leave now. + 39491 + 39492 00005EDD 08C9 or cl,cl + 39493 00005EDF 7515 jnz short gxn20 ; Doesn't have '0x' + 39494 00005EE1 268A4C01 mov cl,[es:si+1] + 39495 00005EE5 80F978 cmp cl,'x' ; Either 'x'... + 39496 00005EE8 7405 je short gxn10 + 39497 00005EEA 80F958 cmp cl,'X' ; ...or 'X' means it's hexadecimal + 39498 00005EED 7507 jne short gxn20 + 39499 + 39500 gxn10: + 39501 ;mov word [gnradix],16 + 39502 00005EEF C606[915E]10 mov byte [gnradix],16 + 39503 00005EF4 46 inc si ; Since we read "0x", march over it. + 39504 00005EF5 46 inc si + 39505 + 39506 ; ------------------------------------------------------ + 39507 ; GXN20--ES:SI = a digit in a number; if not, we're done + 39508 ; DX:AX = current total + 39509 ; BX = 0 + 39510 ; CH = 0 + 39511 ; ------------------------------------------------------ + 39512 + 39513 gxn20: + 39514 00005EF6 268A0C mov cl,[es:si] ; Now DX:AX=current total, CH=0/CL=char + 39515 00005EF9 46 inc si 39516 - 39517 00005EFF E80E00 call mul32 ; Multiply DX:AX by gnradix - 39518 00005F02 7206 jc short gxnX ; (if it's too big, error out) + 39517 00005EFA E896FF call toDigit ; Accepts only valid digits, A-F -> 10-16 + 39518 00005EFD 720D jc short gxnQ ; <- Ah... wasn't a digit. Stop. 39519 - 39520 00005F04 01C8 add ax,cx ; Add the digit - 39521 00005F06 11DA adc dx,bx ; (BX is 0!)--Adds 1 if last add wrapped - 39522 ;jc short gxnX ; If _that_ wrapped, it's too big. - 39523 ;jmp short gxn20 - 39524 00005F08 73EC jnc short gxn20 - 39525 gxnE: - 39526 ; cf = 1 - 39527 ;stc ; In this case, we need to set the carry - 39528 ;jmp short gxnX ; and leave--there were no digits given. - 39529 ;gxnQ: - 39530 ;dec si ; Don't read in the offensive character. - 39531 ;clc ; And clear carry, so they know it's okay. - 39532 gxnX: - 39533 ;popreg - 39534 - 39535 ;pop ds - 39536 - 39537 00005F0A 59 pop cx ; * - 39538 ;pop bx ; ** + 39520 00005EFF E80E00 call mul32 ; Multiply DX:AX by gnradix + 39521 00005F02 7206 jc short gxnX ; (if it's too big, error out) + 39522 + 39523 00005F04 01C8 add ax,cx ; Add the digit + 39524 00005F06 11DA adc dx,bx ; (BX is 0!)--Adds 1 if last add wrapped + 39525 ;jc short gxnX ; If _that_ wrapped, it's too big. + 39526 ;jmp short gxn20 + 39527 00005F08 73EC jnc short gxn20 + 39528 gxnE: + 39529 ; cf = 1 + 39530 ;stc ; In this case, we need to set the carry + 39531 ;jmp short gxnX ; and leave--there were no digits given. + 39532 ;gxnQ: + 39533 ;dec si ; Don't read in the offensive character. + 39534 ;clc ; And clear carry, so they know it's okay. + 39535 gxnX: + 39536 ;popreg + 39537 + 39538 ;pop ds 39539 - 39540 00005F0B C3 retn - 39541 gxnQ: - 39542 00005F0C 4E dec si - 39543 00005F0D F8 clc - 39544 00005F0E EBFA jmp short gxnX - 39545 - 39546 ; ----------------------------------------------------------------------------- - 39547 ;*** mul32 - multiplies the number in DX:AX by gnradix - 39548 ; ----------------------------------------------------------------------------- - 39549 ; ENTRY: DX:AX = the number to be multiplied, BX = 0, gnradix = multiplier - 39550 ; EXIT: DX:AX has been multiplied by gnradix if carry clear; BX still 0 - 39551 ; ERROR: Carry set if number was too large - 39552 ; USES: Flags, AX, DX - 39553 ; ----------------------------------------------------------------------------- - 39554 - 39555 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39556 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39557 mul32: - 39558 00005F10 50 push ax ; DX=old:hi, AX=old:lo, TOS=old:lo, BX=0 - 39559 00005F11 89D0 mov ax,dx ; DX=old:hi, AX=old:hi, TOS=old:lo, BX=0 - 39560 00005F13 F726[915E] mul word [gnradix] ; DX=?, AX=new:hi, TOS=old:lo, BX=0 - 39561 00005F17 7210 jc short m32E ; Too big? - 39562 - 39563 00005F19 89C2 mov dx,ax ; DX=new:hi, AX=new:hi, TOS=old:lo, BX=0 - 39564 00005F1B 58 pop ax ; DX=new:hi, AX=old:lo, TOS=orig, BX=0 + 39540 00005F0A 59 pop cx ; * + 39541 ;pop bx ; ** + 39542 + 39543 00005F0B C3 retn + 39544 gxnQ: + 39545 00005F0C 4E dec si + 39546 00005F0D F8 clc + 39547 00005F0E EBFA jmp short gxnX + 39548 + 39549 ; ----------------------------------------------------------------------------- + 39550 ;*** mul32 - multiplies the number in DX:AX by gnradix + 39551 ; ----------------------------------------------------------------------------- + 39552 ; ENTRY: DX:AX = the number to be multiplied, BX = 0, gnradix = multiplier + 39553 ; EXIT: DX:AX has been multiplied by gnradix if carry clear; BX still 0 + 39554 ; ERROR: Carry set if number was too large + 39555 ; USES: Flags, AX, DX + 39556 ; ----------------------------------------------------------------------------- + 39557 + 39558 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39559 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39560 mul32: + 39561 00005F10 50 push ax ; DX=old:hi, AX=old:lo, TOS=old:lo, BX=0 + 39562 00005F11 89D0 mov ax,dx ; DX=old:hi, AX=old:hi, TOS=old:lo, BX=0 + 39563 00005F13 F726[915E] mul word [gnradix] ; DX=?, AX=new:hi, TOS=old:lo, BX=0 + 39564 00005F17 7210 jc short m32E ; Too big? 39565 - 39566 00005F1C 87D3 xchg dx,bx ; DX=0, AX=old:lo, TOS=orig, BX=new:hi - 39567 00005F1E F726[915E] mul word [gnradix] ; DX=carry, AX=new:lo, TOS=orig, BX=new:hi - 39568 00005F22 87D3 xchg dx,bx ; DX=new:hi, AX=new:lo, TOS=orig, BX=carry - 39569 00005F24 01DA add dx,bx ; DX=new:hi, AX=new:lo, TOS=orig, BX=carry - 39570 00005F26 31DB xor bx,bx ; DX=new:hi, AX=new:lo, TOS=orig, BX=0 - 39571 00005F28 C3 retn - 39572 m32E: - 39573 00005F29 58 pop ax - 39574 00005F2A C3 retn - 39575 - 39576 ; ----------------------------------------------------------------------------- - 39577 ;*** toPara - divides DX:AX by 16; result in AX only (discards extra DX data) - 39578 ; ----------------------------------------------------------------------------- - 39579 ; ENTRY: DX:AX = the number to be divided - 39580 ; EXIT: Interpereting DX:AX as bytes, AX=paragraph equivalent, 0xFFFF max - 39581 ; ERROR: None - 39582 ; USES: Flags, AX, DX - 39583 ; ----------------------------------------------------------------------------- - 39584 ; Note: The 386 has a 32-bit SHR, which would work perfectly for this... but we - 39585 ; can't ensure a 386 host machine. Sorry. + 39566 00005F19 89C2 mov dx,ax ; DX=new:hi, AX=new:hi, TOS=old:lo, BX=0 + 39567 00005F1B 58 pop ax ; DX=new:hi, AX=old:lo, TOS=orig, BX=0 + 39568 + 39569 00005F1C 87D3 xchg dx,bx ; DX=0, AX=old:lo, TOS=orig, BX=new:hi + 39570 00005F1E F726[915E] mul word [gnradix] ; DX=carry, AX=new:lo, TOS=orig, BX=new:hi + 39571 00005F22 87D3 xchg dx,bx ; DX=new:hi, AX=new:lo, TOS=orig, BX=carry + 39572 00005F24 01DA add dx,bx ; DX=new:hi, AX=new:lo, TOS=orig, BX=carry + 39573 00005F26 31DB xor bx,bx ; DX=new:hi, AX=new:lo, TOS=orig, BX=0 + 39574 00005F28 C3 retn + 39575 m32E: + 39576 00005F29 58 pop ax + 39577 00005F2A C3 retn + 39578 + 39579 ; ----------------------------------------------------------------------------- + 39580 ;*** toPara - divides DX:AX by 16; result in AX only (discards extra DX data) + 39581 ; ----------------------------------------------------------------------------- + 39582 ; ENTRY: DX:AX = the number to be divided + 39583 ; EXIT: Interpereting DX:AX as bytes, AX=paragraph equivalent, 0xFFFF max + 39584 ; ERROR: None + 39585 ; USES: Flags, AX, DX 39586 ; ----------------------------------------------------------------------------- - 39587 - 39588 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39589 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39590 toPara: - 39591 00005F2B 51 push cx ; DX:AX=HHHH hhhh hhhh hhhh:LLLL llll llll llll - 39592 - 39593 00005F2C B104 mov cl,4 ; - 39594 00005F2E D3E8 shr ax,cl ; DX:AX=HHHH hhhh hhhh hhhh:0000 LLLL llll llll - 39595 00005F30 92 xchg ax,dx ; DX:AX=0000 LLLL llll llll:HHHH hhhh hhhh hhhh - 39596 00005F31 B10C mov cl,12 - 39597 00005F33 D3E0 shl ax,cl ; DX:AX=0000 LLLL llll llll:hhhh 0000 0000 0000 - 39598 00005F35 09D0 or ax,dx ; AX=hhhh LLLL llll llll - 39599 - 39600 00005F37 59 pop cx - 39601 00005F38 C3 retn + 39587 ; Note: The 386 has a 32-bit SHR, which would work perfectly for this... but we + 39588 ; can't ensure a 386 host machine. Sorry. + 39589 ; ----------------------------------------------------------------------------- + 39590 + 39591 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39592 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39593 toPara: + 39594 00005F2B 51 push cx ; DX:AX=HHHH hhhh hhhh hhhh:LLLL llll llll llll + 39595 + 39596 00005F2C B104 mov cl,4 ; + 39597 00005F2E D3E8 shr ax,cl ; DX:AX=HHHH hhhh hhhh hhhh:0000 LLLL llll llll + 39598 00005F30 92 xchg ax,dx ; DX:AX=0000 LLLL llll llll:HHHH hhhh hhhh hhhh + 39599 00005F31 B10C mov cl,12 + 39600 00005F33 D3E0 shl ax,cl ; DX:AX=0000 LLLL llll llll:hhhh 0000 0000 0000 + 39601 00005F35 09D0 or ax,dx ; AX=hhhh LLLL llll llll 39602 - 39603 ; ----------------------------------------------------------------------------- - 39604 ;*** UmbHead - returns in AX the address of the first UMB block (0x9FFF) - 39605 ; ----------------------------------------------------------------------------- - 39606 ; ENTRY: Nothing - 39607 ; EXIT: AX contains 0x9FFF for most systems - 39608 ; ERROR: Carry set if pointer is 0xFFFF (if not set up yet--DH runs into this) - 39609 ; USES: Flags, AX - 39610 ; ----------------------------------------------------------------------------- - 39611 ; Early in the boot-cycle, the pointer used to obtain this value isn't set up; - 39612 ; to be precise, before a UMB provider is around. In this event, the pointer - 39613 ; is always set to 0xFFFF; it changes once a provider is around. On most - 39614 ; machines (all of 'em I've seen), it changes to 0x9FFF at that point. - 39615 ; ----------------------------------------------------------------------------- - 39616 - 39617 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39618 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39619 UmbHead: - 39620 ;pushreg - 39621 - 39622 ;push si - 39623 ;push ds - 39624 ;push es - 39625 - 39626 00005F39 B452 mov ah,52h ; DOS_GET_DOS_LISTS - 39627 ; Call int 21h, function 52h... - 39628 00005F3B CD21 int 21h - 39629 ; DOS - 2+ internal - GET LIST OF LISTS - 39630 ; Return: ES:BX -> DOS list of lists - 39631 - 39632 ;mov ax,[es:DOS_UMB_HEAD] ; And read what's in ES:[008C] - 39633 00005F3D 26A18C00 mov ax,[es:8Ch] - 39634 00005F41 83F8FF cmp ax,0FFFFh - 39635 ;je short uhE ; If it's 0xFFFF, it's an error... - 39636 - 39637 ;clc ; Else, it isn't (CLC done by prev cmp) - 39638 ;jmp short uhX - 39639 ; 17/06/2023 - 39640 00005F44 F5 cmc ; cf = 0 <--> cf = 1 - 39641 uhE: - 39642 ;stc - 39643 uhX: - 39644 ;popreg - 39645 - 39646 ;pop es - 39647 ;pop ds - 39648 ;pop si - 39649 - 39650 00005F45 C3 retn - 39651 - 39652 ; ----------------------------------------------------------------------------- - 39653 ;*** isSysMCB - sets ZF iff ES points to an MCB owned by "SC" + (8 or 9) - 39654 ; ----------------------------------------------------------------------------- - 39655 ; ENTRY: ES:0 should point to a valid MCB - 39656 ; EXIT: ZF set if owned by SC+8 or SC+9 (for japan) - 39657 ; USES: Flags - 39658 ; ----------------------------------------------------------------------------- - 39659 - 39660 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39661 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39662 isSysMCB: - 39663 ;push ax - 39664 - 39665 ;mov ax,[es:1] - 39666 00005F46 26A10100 mov ax,[es:arena_owner] ; Check the owner... - 39667 00005F4A 83F808 cmp ax,8 ; SystemPSPOwner ; 8 (for US OR Japan) is valid - 39668 00005F4D 7405 jz short ism10 - 39669 00005F4F 83F809 cmp ax,9 ; JapanPSPOwner ; 9 (for Japan) is valid - 39670 ;jz short ism10 - 39671 ;jmp short ismX ; Anything else isn't. - 39672 00005F52 7507 jnz short ismX - 39673 ism10: - 39674 ;mov ax,[es:8] - 39675 00005F54 26A10800 mov ax,[es:arena_name] ; Check the name... - 39676 00005F58 3D5343 cmp ax,'SC' ; cmp ax,4353h - 39677 ismX: - 39678 ;pop ax - 39679 00005F5B C3 retn - 39680 - 39681 ; ----------------------------------------------------------------------------- - 39682 ;*** AddrToUmb - converts a segment address in AX to its appropriate UMB number - 39683 ; ----------------------------------------------------------------------------- - 39684 ; ENTRY: AX contains a segment address - 39685 ; EXIT: AX will contain the UMB number which contains the address (0==conv) - 39686 ; ERROR: If the address is above UM Range, AX will return as FFFF. - 39687 ; USES: Flags, AX - 39688 ; ----------------------------------------------------------------------------- - 39689 ; An address in the following areas is treated as: - 39690 ; 0 <-> umbhead (0x9FFF) = Conventional memory - 39691 ; 0x9FFF <-> addr of first UM sys MCB = UMB #1 - 39692 ; ... - 39693 ; addr of last UM sys MCB <-> TOM = invalid; returns #0xFFFF - 39694 ; ----------------------------------------------------------------------------- - 39695 - 39696 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39697 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39698 AddrToUmb: - 39699 ;pushreg - 39700 - 39701 ;push cx - 39702 ;push dx - 39703 00005F5C 06 push es - 39704 - 39705 00005F5D 89C2 mov dx,ax ; DX = address to search for - 39706 - 39707 00005F5F E8D7FF call UmbHead ; AX = first segment - 39708 00005F62 722B jc short atuE ; If it couldn't get it, error out. + 39603 00005F37 59 pop cx + 39604 00005F38 C3 retn + 39605 + 39606 ; ----------------------------------------------------------------------------- + 39607 ;*** UmbHead - returns in AX the address of the first UMB block (0x9FFF) + 39608 ; ----------------------------------------------------------------------------- + 39609 ; ENTRY: Nothing + 39610 ; EXIT: AX contains 0x9FFF for most systems + 39611 ; ERROR: Carry set if pointer is 0xFFFF (if not set up yet--DH runs into this) + 39612 ; USES: Flags, AX + 39613 ; ----------------------------------------------------------------------------- + 39614 ; Early in the boot-cycle, the pointer used to obtain this value isn't set up; + 39615 ; to be precise, before a UMB provider is around. In this event, the pointer + 39616 ; is always set to 0xFFFF; it changes once a provider is around. On most + 39617 ; machines (all of 'em I've seen), it changes to 0x9FFF at that point. + 39618 ; ----------------------------------------------------------------------------- + 39619 + 39620 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39621 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39622 UmbHead: + 39623 ;pushreg + 39624 + 39625 ;push si + 39626 ;push ds + 39627 ;push es + 39628 + 39629 00005F39 B452 mov ah,52h ; DOS_GET_DOS_LISTS + 39630 ; Call int 21h, function 52h... + 39631 00005F3B CD21 int 21h + 39632 ; DOS - 2+ internal - GET LIST OF LISTS + 39633 ; Return: ES:BX -> DOS list of lists + 39634 + 39635 ;mov ax,[es:DOS_UMB_HEAD] ; And read what's in ES:[008C] + 39636 00005F3D 26A18C00 mov ax,[es:8Ch] + 39637 00005F41 83F8FF cmp ax,0FFFFh + 39638 ;je short uhE ; If it's 0xFFFF, it's an error... + 39639 + 39640 ;clc ; Else, it isn't (CLC done by prev cmp) + 39641 ;jmp short uhX + 39642 ; 17/06/2023 + 39643 00005F44 F5 cmc ; cf = 0 <--> cf = 1 + 39644 uhE: + 39645 ;stc + 39646 uhX: + 39647 ;popreg + 39648 + 39649 ;pop es + 39650 ;pop ds + 39651 ;pop si + 39652 + 39653 00005F45 C3 retn + 39654 + 39655 ; ----------------------------------------------------------------------------- + 39656 ;*** isSysMCB - sets ZF iff ES points to an MCB owned by "SC" + (8 or 9) + 39657 ; ----------------------------------------------------------------------------- + 39658 ; ENTRY: ES:0 should point to a valid MCB + 39659 ; EXIT: ZF set if owned by SC+8 or SC+9 (for japan) + 39660 ; USES: Flags + 39661 ; ----------------------------------------------------------------------------- + 39662 + 39663 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39664 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39665 isSysMCB: + 39666 ;push ax + 39667 + 39668 ;mov ax,[es:1] + 39669 00005F46 26A10100 mov ax,[es:arena_owner] ; Check the owner... + 39670 00005F4A 83F808 cmp ax,8 ; SystemPSPOwner ; 8 (for US OR Japan) is valid + 39671 00005F4D 7405 jz short ism10 + 39672 00005F4F 83F809 cmp ax,9 ; JapanPSPOwner ; 9 (for Japan) is valid + 39673 ;jz short ism10 + 39674 ;jmp short ismX ; Anything else isn't. + 39675 00005F52 7507 jnz short ismX + 39676 ism10: + 39677 ;mov ax,[es:8] + 39678 00005F54 26A10800 mov ax,[es:arena_name] ; Check the name... + 39679 00005F58 3D5343 cmp ax,'SC' ; cmp ax,4353h + 39680 ismX: + 39681 ;pop ax + 39682 00005F5B C3 retn + 39683 + 39684 ; ----------------------------------------------------------------------------- + 39685 ;*** AddrToUmb - converts a segment address in AX to its appropriate UMB number + 39686 ; ----------------------------------------------------------------------------- + 39687 ; ENTRY: AX contains a segment address + 39688 ; EXIT: AX will contain the UMB number which contains the address (0==conv) + 39689 ; ERROR: If the address is above UM Range, AX will return as FFFF. + 39690 ; USES: Flags, AX + 39691 ; ----------------------------------------------------------------------------- + 39692 ; An address in the following areas is treated as: + 39693 ; 0 <-> umbhead (0x9FFF) = Conventional memory + 39694 ; 0x9FFF <-> addr of first UM sys MCB = UMB #1 + 39695 ; ... + 39696 ; addr of last UM sys MCB <-> TOM = invalid; returns #0xFFFF + 39697 ; ----------------------------------------------------------------------------- + 39698 + 39699 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39700 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39701 AddrToUmb: + 39702 ;pushreg + 39703 + 39704 ;push cx + 39705 ;push dx + 39706 00005F5C 06 push es + 39707 + 39708 00005F5D 89C2 mov dx,ax ; DX = address to search for 39709 - 39710 ;mov es,ax ; * ; ES = first UMB segment - 39711 00005F64 31C9 xor cx,cx ; Pretend we're on UMB 0 for now... (cx = UMB#) + 39710 00005F5F E8D7FF call UmbHead ; AX = first segment + 39711 00005F62 722B jc short atuE ; If it couldn't get it, error out. 39712 - 39713 ; ---------------------------------------- - 39714 ; ATU10--ES - Current MCB address - 39715 ; DX - Address given for conversion - 39716 ; CX - Current UMB # - 39717 ; ---------------------------------------- - 39718 - 39719 ; 17/06/2023 - 39720 atu10: - 39721 00005F66 8EC0 mov es,ax ; * - 39722 ;atu10: - 39723 ;mov ax,es - 39724 00005F68 39D0 cmp ax,dx ; Present segment >= given segment? - 39725 00005F6A 7326 jae short atuX ; Yep--done. - 39726 - 39727 00005F6C E8D7FF call isSysMCB ; Returns with ZF set if this is a system MCB - 39728 00005F6F 7501 jnz short atu20 + 39713 ;mov es,ax ; * ; ES = first UMB segment + 39714 00005F64 31C9 xor cx,cx ; Pretend we're on UMB 0 for now... (cx = UMB#) + 39715 + 39716 ; ---------------------------------------- + 39717 ; ATU10--ES - Current MCB address + 39718 ; DX - Address given for conversion + 39719 ; CX - Current UMB # + 39720 ; ---------------------------------------- + 39721 + 39722 ; 17/06/2023 + 39723 atu10: + 39724 00005F66 8EC0 mov es,ax ; * + 39725 ;atu10: + 39726 ;mov ax,es + 39727 00005F68 39D0 cmp ax,dx ; Present segment >= given segment? + 39728 00005F6A 7326 jae short atuX ; Yep--done. 39729 - 39730 00005F71 41 inc cx ; If it _was_ a system MCB, we're in a new UMB. - 39731 atu20: - 39732 ;mov al,[es:0] - 39733 00005F72 26A00000 mov al,[es:arena_signature] - 39734 ;cmp al,'Z' ; 5Ah - 39735 00005F76 3C5A cmp al,arena_signature_end - 39736 00005F78 740A je short atu30 ; 'Z' means this was the last MCB... that's it. - 39737 - 39738 ;NextMCB es,ax - 39739 00005F7A 8CC0 mov ax,es - 39740 ;add ax,[es:3] ; NextMCB (macro) - 39741 00005F7C 2603060300 add ax,[es:arena_size] - 39742 00005F81 40 inc ax - 39743 ;mov es,ax ; * ; 17/06/2023 - 39744 00005F82 EBE2 jmp short atu10 - 39745 - 39746 ; ----------------------------------------------------------------------------- - 39747 ; if we get to atu30, they specified a number that was past the last MCB. - 39748 ; make sure it's not _inside_ that MCB before we return an error condition. + 39730 00005F6C E8D7FF call isSysMCB ; Returns with ZF set if this is a system MCB + 39731 00005F6F 7501 jnz short atu20 + 39732 + 39733 00005F71 41 inc cx ; If it _was_ a system MCB, we're in a new UMB. + 39734 atu20: + 39735 ;mov al,[es:0] + 39736 00005F72 26A00000 mov al,[es:arena_signature] + 39737 ;cmp al,'Z' ; 5Ah + 39738 00005F76 3C5A cmp al,arena_signature_end + 39739 00005F78 740A je short atu30 ; 'Z' means this was the last MCB... that's it. + 39740 + 39741 ;NextMCB es,ax + 39742 00005F7A 8CC0 mov ax,es + 39743 ;add ax,[es:3] ; NextMCB (macro) + 39744 00005F7C 2603060300 add ax,[es:arena_size] + 39745 00005F81 40 inc ax + 39746 ;mov es,ax ; * ; 17/06/2023 + 39747 00005F82 EBE2 jmp short atu10 + 39748 39749 ; ----------------------------------------------------------------------------- - 39750 - 39751 atu30: - 39752 00005F84 8CC0 mov ax,es - 39753 ;add ax,[es:3] - 39754 00005F86 2603060300 add ax,[es:arena_size] - 39755 00005F8B 39D0 cmp ax,dx ; Present >= given? - 39756 00005F8D 7303 jae short atuX ; Yep! It _was_ inside. - 39757 atuE: - 39758 00005F8F 31C9 xor cx,cx ; Else, fall through with UMB # == -1 - 39759 00005F91 49 dec cx ; (that makes it return 0xFFFF and sets CF) - 39760 atuX: - 39761 00005F92 89C8 mov ax,cx ; Return the UMB number in AX - 39762 - 39763 ;popreg - 39764 - 39765 00005F94 07 pop es - 39766 ;pop dx - 39767 ;pop cx - 39768 - 39769 00005F95 C3 retn - 39770 - 39771 ; ----------------------------------------------------------------------------- - 39772 ;*** convUMB - checks after GetXNum to convert an address to a UMB number - 39773 ; -- if GetXNum read a hex number, we interperete that as a segment - 39774 ; address rather than a UMB number... and use that address to look up a UMB. - 39775 ; This routine checks for that condition and calls AddrToUmb if necessary. - 39776 ; ----------------------------------------------------------------------------- - 39777 ; ENTRY: AX contains a UMB number or segment, gnradix has been set by GetXNum - 39778 ; EXIT: AX will contain a UMB number - 39779 ; ERROR: None - 39780 ; USES: Flags, AX - 39781 ; ----------------------------------------------------------------------------- - 39782 - 39783 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39784 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39785 convUMB: - 39786 ;cmp word [gnradix],16 - 39787 00005F96 803E[915E]10 cmp byte [gnradix],16 - 39788 00005F9B 7509 jne short cu10 ; If it didn't read in hex, it's not an address - 39789 00005F9D E8BCFF call AddrToUmb ; Else, convert the address to a UMB number - 39790 00005FA0 83F8FF cmp ax,0FFFFh - 39791 00005FA3 7501 jne short cu10 - 39792 00005FA5 40 inc ax ; ax = 0 ; If too high, ignore it (make it conventional) - 39793 cu10: - 39794 00005FA6 C3 retn - 39795 - 39796 ; ----------------------------------------------------------------------------- - 39797 ;*** setUMBs - links umbs and sets allocation strategy for a load - 39798 ; -- if LoadHigh, the allocation strategy MAY be LOW_FIRST instead - 39799 ; of the usual HIGH_FIRST. See the code. - 39800 ; ----------------------------------------------------------------------------- - 39801 ; ENTRY: None - 39802 ; EXIT: None - 39803 ; ERROR: None - 39804 ; USES: Flags, fm_umb, fm_strat - 39805 ; ----------------------------------------------------------------------------- - 39806 - 39807 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39808 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39809 setUMBs: - 39810 ;pushreg - 39811 - 39812 ;push ax - 39813 ;push bx - 39814 - 39815 00005FA7 E8B2FD call fm_link - 39816 - 39817 00005FAA B80058 mov ax,5800h ; DOS_CHECK_STRATEGY - 39818 00005FAD CD21 int 21h + 39750 ; if we get to atu30, they specified a number that was past the last MCB. + 39751 ; make sure it's not _inside_ that MCB before we return an error condition. + 39752 ; ----------------------------------------------------------------------------- + 39753 + 39754 atu30: + 39755 00005F84 8CC0 mov ax,es + 39756 ;add ax,[es:3] + 39757 00005F86 2603060300 add ax,[es:arena_size] + 39758 00005F8B 39D0 cmp ax,dx ; Present >= given? + 39759 00005F8D 7303 jae short atuX ; Yep! It _was_ inside. + 39760 atuE: + 39761 00005F8F 31C9 xor cx,cx ; Else, fall through with UMB # == -1 + 39762 00005F91 49 dec cx ; (that makes it return 0xFFFF and sets CF) + 39763 atuX: + 39764 00005F92 89C8 mov ax,cx ; Return the UMB number in AX + 39765 + 39766 ;popreg + 39767 + 39768 00005F94 07 pop es + 39769 ;pop dx + 39770 ;pop cx + 39771 + 39772 00005F95 C3 retn + 39773 + 39774 ; ----------------------------------------------------------------------------- + 39775 ;*** convUMB - checks after GetXNum to convert an address to a UMB number + 39776 ; -- if GetXNum read a hex number, we interperete that as a segment + 39777 ; address rather than a UMB number... and use that address to look up a UMB. + 39778 ; This routine checks for that condition and calls AddrToUmb if necessary. + 39779 ; ----------------------------------------------------------------------------- + 39780 ; ENTRY: AX contains a UMB number or segment, gnradix has been set by GetXNum + 39781 ; EXIT: AX will contain a UMB number + 39782 ; ERROR: None + 39783 ; USES: Flags, AX + 39784 ; ----------------------------------------------------------------------------- + 39785 + 39786 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39787 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39788 convUMB: + 39789 ;cmp word [gnradix],16 + 39790 00005F96 803E[915E]10 cmp byte [gnradix],16 + 39791 00005F9B 7509 jne short cu10 ; If it didn't read in hex, it's not an address + 39792 00005F9D E8BCFF call AddrToUmb ; Else, convert the address to a UMB number + 39793 00005FA0 83F8FF cmp ax,0FFFFh + 39794 00005FA3 7501 jne short cu10 + 39795 00005FA5 40 inc ax ; ax = 0 ; If too high, ignore it (make it conventional) + 39796 cu10: + 39797 00005FA6 C3 retn + 39798 + 39799 ; ----------------------------------------------------------------------------- + 39800 ;*** setUMBs - links umbs and sets allocation strategy for a load + 39801 ; -- if LoadHigh, the allocation strategy MAY be LOW_FIRST instead + 39802 ; of the usual HIGH_FIRST. See the code. + 39803 ; ----------------------------------------------------------------------------- + 39804 ; ENTRY: None + 39805 ; EXIT: None + 39806 ; ERROR: None + 39807 ; USES: Flags, fm_umb, fm_strat + 39808 ; ----------------------------------------------------------------------------- + 39809 + 39810 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39811 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39812 setUMBs: + 39813 ;pushreg + 39814 + 39815 ;push ax + 39816 ;push bx + 39817 + 39818 00005FA7 E8B2FD call fm_link 39819 - 39820 ;putdata fm_strat,al ; Store the current strategy for later restore - 39821 - 39822 ;push es - 39823 ;mov es,[RESSEG] - 39824 ;mov [es:fm_strat],al ; store the current strategy - 39825 ;pop es - 39826 00005FAF 1E push ds ; * - 39827 00005FB0 8E1E[F59B] mov ds,[RESSEG] - 39828 00005FB4 A2[3605] mov [fm_strat],al - 39829 ;pop ds ; * - 39830 - 39831 00005FB7 83E07F and ax,007Fh ; 0000.0000.0111.1111 == All that other stuff - 39832 00005FBA 50 push ax ; ** ; Watch this carefully... + 39820 00005FAA B80058 mov ax,5800h ; DOS_CHECK_STRATEGY + 39821 00005FAD CD21 int 21h + 39822 + 39823 ;putdata fm_strat,al ; Store the current strategy for later restore + 39824 + 39825 ;push es + 39826 ;mov es,[RESSEG] + 39827 ;mov [es:fm_strat],al ; store the current strategy + 39828 ;pop es + 39829 00005FAF 1E push ds ; * + 39830 00005FB0 8E1E[F59B] mov ds,[RESSEG] + 39831 00005FB4 A2[3605] mov [fm_strat],al + 39832 ;pop ds ; * 39833 - 39834 00005FBB E80C00 call loadLow ; returns al==0 if load low, al==1 if loadhigh - 39835 00005FBE D0C8 ror al,1 ; Shift that to al==0 or al==0x80 + 39834 00005FB7 83E07F and ax,007Fh ; 0000.0000.0111.1111 == All that other stuff + 39835 00005FBA 50 push ax ; ** ; Watch this carefully... 39836 - 39837 00005FC0 5B pop bx ; ** ; ...pushed as AX above - 39838 - 39839 00005FC1 1F pop ds ; * - 39840 - 39841 00005FC2 08C3 or bl,al ; Now we have 0000.0000.?111.1111 in BX; - 39842 - 39843 00005FC4 B80158 mov ax,5801h ; DOS_SET_STRATEGY - 39844 ; with ? ==1 if load highfirst. Perfect! - 39845 00005FC7 CD21 int 21h - 39846 - 39847 ;popreg - 39848 - 39849 ;pop bx - 39850 ;pop ax + 39837 00005FBB E80C00 call loadLow ; returns al==0 if load low, al==1 if loadhigh + 39838 00005FBE D0C8 ror al,1 ; Shift that to al==0 or al==0x80 + 39839 + 39840 00005FC0 5B pop bx ; ** ; ...pushed as AX above + 39841 + 39842 00005FC1 1F pop ds ; * + 39843 + 39844 00005FC2 08C3 or bl,al ; Now we have 0000.0000.?111.1111 in BX; + 39845 + 39846 00005FC4 B80158 mov ax,5801h ; DOS_SET_STRATEGY + 39847 ; with ? ==1 if load highfirst. Perfect! + 39848 00005FC7 CD21 int 21h + 39849 + 39850 ;popreg 39851 - 39852 00005FC9 C3 retn - 39853 - 39854 ; ----------------------------------------------------------------------------- - 39855 ;*** loadLow - returns AL==0 if UMB0 == 0, else AL==1 - 39856 ; ----------------------------------------------------------------------------- - 39857 ; ENTRY: None - 39858 ; EXIT: AL==0 if mem strategy should be set to LOW_FIRST, else AL==1 - 39859 ; Carry set if UMB0 not specified (_NOT_ an error) - 39860 ; ERROR: None - 39861 ; USES: Flags, fm_strat, fm_umb - 39862 ; ----------------------------------------------------------------------------- - 39863 ; We want to set the memory strategy to LOW_FIRST if the user specified a - 39864 ; load UMB, and it is 0. That 0 can be either from the user having _specified_ - 39865 ; zero (/L:0;...), or from having specified a too-big min size (/L:1,99999999) - 39866 ; such that the load UMB is too small, and shouldn't be used. - 39867 ; ----------------------------------------------------------------------------- - 39868 - 39869 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39870 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39871 loadLow: - 39872 ;push ds ; * - 39873 - 39874 ;dataseg ds ; Point DS into appropriate data segment - 39875 ;mov ds,[RESSEG] - 39876 - 39877 ; * ; ds = [RESSEG] from 'setUMBs') ; 17/06/2023 - 39878 - 39879 00005FCA A0[3405] mov al,[UmbLoad] - 39880 00005FCD 3CFF cmp al,0FFh ; UNSPECIFIED - 39881 00005FCF 7503 jne short ll10 - 39882 - 39883 ;mov al,1 ; Return with AL==1 && STC if no UMBs specified - 39884 00005FD1 F9 stc - 39885 ;jmp short llX - 39886 00005FD2 EB04 jmp short lly ; 17/06/2023 - 39887 ll10: - 39888 00005FD4 08C0 or al,al ; AL=the load UMB: Is it == 0? - 39889 00005FD6 7402 jz short llX ; Yep... CF==0 (from OR) && AL=0, so just exit - 39890 ; cf= 0 - 39891 - 39892 ;mov al,1 - 39893 ;clc - 39894 lly: ; 17/06/2023 - 39895 00005FD8 B001 mov al,1 - 39896 llX: - 39897 ;pop ds ; * ; Return DS to where it was - 39898 - 39899 ;normseg ds ; - 39900 - 39901 00005FDA C3 retn - 39902 - 39903 ; ----------------------------------------------------------------------------- - 39904 ;*** HideUMBs - links UMBs and hides upper-memory as appropriate - 39905 ; ----------------------------------------------------------------------------- - 39906 ; ENTRY: None - 39907 ; EXIT: None - 39908 ; ERROR: None - 39909 ; USES: Flags, fm_strat, fm_umb - 39910 ; ----------------------------------------------------------------------------- - 39911 - 39912 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39913 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:64D0h + 39852 ;pop bx + 39853 ;pop ax + 39854 + 39855 00005FC9 C3 retn + 39856 + 39857 ; ----------------------------------------------------------------------------- + 39858 ;*** loadLow - returns AL==0 if UMB0 == 0, else AL==1 + 39859 ; ----------------------------------------------------------------------------- + 39860 ; ENTRY: None + 39861 ; EXIT: AL==0 if mem strategy should be set to LOW_FIRST, else AL==1 + 39862 ; Carry set if UMB0 not specified (_NOT_ an error) + 39863 ; ERROR: None + 39864 ; USES: Flags, fm_strat, fm_umb + 39865 ; ----------------------------------------------------------------------------- + 39866 ; We want to set the memory strategy to LOW_FIRST if the user specified a + 39867 ; load UMB, and it is 0. That 0 can be either from the user having _specified_ + 39868 ; zero (/L:0;...), or from having specified a too-big min size (/L:1,99999999) + 39869 ; such that the load UMB is too small, and shouldn't be used. + 39870 ; ----------------------------------------------------------------------------- + 39871 + 39872 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39873 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39874 loadLow: + 39875 ;push ds ; * + 39876 + 39877 ;dataseg ds ; Point DS into appropriate data segment + 39878 ;mov ds,[RESSEG] + 39879 + 39880 ; * ; ds = [RESSEG] from 'setUMBs') ; 17/06/2023 + 39881 + 39882 00005FCA A0[3405] mov al,[UmbLoad] + 39883 00005FCD 3CFF cmp al,0FFh ; UNSPECIFIED + 39884 00005FCF 7503 jne short ll10 + 39885 + 39886 ;mov al,1 ; Return with AL==1 && STC if no UMBs specified + 39887 00005FD1 F9 stc + 39888 ;jmp short llX + 39889 00005FD2 EB04 jmp short lly ; 17/06/2023 + 39890 ll10: + 39891 00005FD4 08C0 or al,al ; AL=the load UMB: Is it == 0? + 39892 00005FD6 7402 jz short llX ; Yep... CF==0 (from OR) && AL=0, so just exit + 39893 ; cf= 0 + 39894 + 39895 ;mov al,1 + 39896 ;clc + 39897 lly: ; 17/06/2023 + 39898 00005FD8 B001 mov al,1 + 39899 llX: + 39900 ;pop ds ; * ; Return DS to where it was + 39901 + 39902 ;normseg ds ; + 39903 + 39904 00005FDA C3 retn + 39905 + 39906 ; ----------------------------------------------------------------------------- + 39907 ;*** HideUMBs - links UMBs and hides upper-memory as appropriate + 39908 ; ----------------------------------------------------------------------------- + 39909 ; ENTRY: None + 39910 ; EXIT: None + 39911 ; ERROR: None + 39912 ; USES: Flags, fm_strat, fm_umb + 39913 ; ----------------------------------------------------------------------------- 39914 - 39915 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39916 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:634Dh - 39917 HideUMBs: - 39918 ;pushreg - 39919 - 39920 ;push ax - 39921 ;push cx - 39922 ;push ds - 39923 ;push es - 39924 - 39925 00005FDB E8EF01 call UmbTest ; See if we REALLY linked in anything... - 39926 00005FDE 7236 jc short husX ; ...if not, there's nothing for us to do. + 39915 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39916 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:64D0h + 39917 + 39918 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39919 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:634Dh + 39920 HideUMBs: + 39921 ;pushreg + 39922 + 39923 ;push ax + 39924 ;push cx + 39925 ;push ds + 39926 ;push es 39927 - 39928 00005FE0 E82CFD call FixMem ; Concatenate adjacent free MCBs in upper mem - 39929 00005FE3 E8C1FF call setUMBs ; Link UMBs and set memory-allocation strategy + 39928 00005FDB E8EF01 call UmbTest ; See if we REALLY linked in anything... + 39929 00005FDE 7236 jc short husX ; ...if not, there's nothing for us to do. 39930 - 39931 ;putdata fInHigh,1 ; Remember that we're now running high - 39932 ;push es - 39933 ;mov es,[RESSEG] - 39934 ;mov byte [es:fInHigh], 1 - 39935 ; ; remember that we're now running high - 39936 ;pop es - 39937 00005FE6 1E push ds - 39938 00005FE7 8E1E[F59B] mov ds,[RESSEG] - 39939 00005FEB C606[3005]01 mov byte [fInHigh], 1 - 39940 00005FF0 1F pop ds - 39941 - 39942 00005FF1 E82300 call GetLoadUMB ; See if they gave us a list to leave free - 39943 00005FF4 3CFF cmp al,0FFh ; UNSPECIFIED - 39944 ; If they didn't, - 39945 00005FF6 741E je short husX ; then we shouldn't do this loop: - 39946 - 39947 00005FF8 31C9 xor cx,cx - 39948 - 39949 ; ----------------------------------------------- - 39950 ; HUS10-CX - UMB number (after inc, 1==first UMB) - 39951 ; ----------------------------------------------- - 39952 - 39953 hus10: - 39954 00005FFA 41 inc cx ; For each UMB: - 39955 00005FFB 83F910 cmp cx,16 ; MAXUMB - 39956 00005FFE 730C jae short hus20 - 39957 - 39958 00006000 88C8 mov al,cl ; (stopping as soon as we're outside of the - 39959 ; 17/06/2023 - 39960 ;push es - 39961 00006002 E8A900 call findumb ; valid range of UMBs) - 39962 ;pop es ; push/pop: trash what findumb finds. :-) - 39963 00006005 7205 jc short hus20 - 39964 - 39965 00006007 E87901 call hideUMB? ; hide what we need to hide. - 39966 - 39967 0000600A EBEE jmp short hus10 - 39968 hus20: - 39969 0000600C E80800 call GetLoadUMB ; Now check if they offered /L:0 - 39970 0000600F 08C0 or al,al ; --Is the load UMB 0? (-1==unspecified) - 39971 00006011 7503 jnz short husX ; If not, we're done. - 39972 - 39973 00006013 E8E701 call hl_unlink ; If so, however, fix UMBs and strategy. - 39974 husX: - 39975 ;popreg - 39976 - 39977 ;pop es - 39978 ;pop ds - 39979 ;pop cx - 39980 ;pop ax - 39981 - 39982 00006016 C3 retn - 39983 - 39984 ; ----------------------------------------------------------------------------- - 39985 ;*** GetLoadUMB - Returns the load UMB number in AL (-1 if not specified) - 39986 ; ----------------------------------------------------------------------------- - 39987 ; ENTRY: None - 39988 ; EXIT: AL == load UMB - 39989 ; ERROR: None - 39990 ; USES: Flags, AX - 39991 ; ----------------------------------------------------------------------------- - 39992 - 39993 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 39994 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 39995 GetLoadUMB: - 39996 ;getdata al,UmbLoad - 39997 - 39998 00006017 1E push ds - 39999 00006018 8E1E[F59B] mov ds,[RESSEG] ; getdata (macro) - 40000 0000601C A0[3405] mov al,[UmbLoad] - 40001 0000601F 1F pop ds - 40002 - 40003 00006020 C3 retn - 40004 - 40005 ; ----------------------------------------------------------------------------- - 40006 ;*** GetSize - Returns the UMB in AL's minimum size (0 if not specified) - 40007 ; ----------------------------------------------------------------------------- - 40008 ; ENTRY: AL == a UMB number - 40009 ; EXIT: AX == UMB minimum size, as specified by the user - 40010 ; ERROR: None - 40011 ; USES: Flags, AX - 40012 ; ----------------------------------------------------------------------------- - 40013 - 40014 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40015 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40016 GetSize: - 40017 ;pushreg - 40018 ;push bx - 40019 ;push si - 40020 00006021 1E push ds - 40021 - 40022 ;dataseg ds - 40023 00006022 8E1E[F59B] mov ds,[RESSEG] - 40024 - 40025 00006026 30E4 xor ah,ah ; ax==UMB - 40026 ;mov bx,offset UmbSize - 40027 00006028 BB[6E04] mov bx,UmbSize ; bx==array - 40028 0000602B D0E0 shl al,1 ; ax==offset - 40029 ;add ax,bx ; ax==element index - 40030 ;mov si,ax ; ds:si==element index - 40031 ;lodsw ; ax==size - 40032 0000602D 01C3 add bx,ax - 40033 0000602F 8B07 mov ax,[bx] - 40034 - 40035 ;popreg - 40036 00006031 1F pop ds - 40037 ;pop si - 40038 ;pop bx - 40039 - 40040 ;normseg ds - 40041 00006032 C3 retn + 39931 00005FE0 E82CFD call FixMem ; Concatenate adjacent free MCBs in upper mem + 39932 00005FE3 E8C1FF call setUMBs ; Link UMBs and set memory-allocation strategy + 39933 + 39934 ;putdata fInHigh,1 ; Remember that we're now running high + 39935 ;push es + 39936 ;mov es,[RESSEG] + 39937 ;mov byte [es:fInHigh], 1 + 39938 ; ; remember that we're now running high + 39939 ;pop es + 39940 00005FE6 1E push ds + 39941 00005FE7 8E1E[F59B] mov ds,[RESSEG] + 39942 00005FEB C606[3005]01 mov byte [fInHigh], 1 + 39943 00005FF0 1F pop ds + 39944 + 39945 00005FF1 E82300 call GetLoadUMB ; See if they gave us a list to leave free + 39946 00005FF4 3CFF cmp al,0FFh ; UNSPECIFIED + 39947 ; If they didn't, + 39948 00005FF6 741E je short husX ; then we shouldn't do this loop: + 39949 + 39950 00005FF8 31C9 xor cx,cx + 39951 + 39952 ; ----------------------------------------------- + 39953 ; HUS10-CX - UMB number (after inc, 1==first UMB) + 39954 ; ----------------------------------------------- + 39955 + 39956 hus10: + 39957 00005FFA 41 inc cx ; For each UMB: + 39958 00005FFB 83F910 cmp cx,16 ; MAXUMB + 39959 00005FFE 730C jae short hus20 + 39960 + 39961 00006000 88C8 mov al,cl ; (stopping as soon as we're outside of the + 39962 ; 17/06/2023 + 39963 ;push es + 39964 00006002 E8A900 call findumb ; valid range of UMBs) + 39965 ;pop es ; push/pop: trash what findumb finds. :-) + 39966 00006005 7205 jc short hus20 + 39967 + 39968 00006007 E87901 call hideUMB? ; hide what we need to hide. + 39969 + 39970 0000600A EBEE jmp short hus10 + 39971 hus20: + 39972 0000600C E80800 call GetLoadUMB ; Now check if they offered /L:0 + 39973 0000600F 08C0 or al,al ; --Is the load UMB 0? (-1==unspecified) + 39974 00006011 7503 jnz short husX ; If not, we're done. + 39975 + 39976 00006013 E8E701 call hl_unlink ; If so, however, fix UMBs and strategy. + 39977 husX: + 39978 ;popreg + 39979 + 39980 ;pop es + 39981 ;pop ds + 39982 ;pop cx + 39983 ;pop ax + 39984 + 39985 00006016 C3 retn + 39986 + 39987 ; ----------------------------------------------------------------------------- + 39988 ;*** GetLoadUMB - Returns the load UMB number in AL (-1 if not specified) + 39989 ; ----------------------------------------------------------------------------- + 39990 ; ENTRY: None + 39991 ; EXIT: AL == load UMB + 39992 ; ERROR: None + 39993 ; USES: Flags, AX + 39994 ; ----------------------------------------------------------------------------- + 39995 + 39996 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 39997 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 39998 GetLoadUMB: + 39999 ;getdata al,UmbLoad + 40000 + 40001 00006017 1E push ds + 40002 00006018 8E1E[F59B] mov ds,[RESSEG] ; getdata (macro) + 40003 0000601C A0[3405] mov al,[UmbLoad] + 40004 0000601F 1F pop ds + 40005 + 40006 00006020 C3 retn + 40007 + 40008 ; ----------------------------------------------------------------------------- + 40009 ;*** GetSize - Returns the UMB in AL's minimum size (0 if not specified) + 40010 ; ----------------------------------------------------------------------------- + 40011 ; ENTRY: AL == a UMB number + 40012 ; EXIT: AX == UMB minimum size, as specified by the user + 40013 ; ERROR: None + 40014 ; USES: Flags, AX + 40015 ; ----------------------------------------------------------------------------- + 40016 + 40017 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40018 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40019 GetSize: + 40020 ;pushreg + 40021 ;push bx + 40022 ;push si + 40023 00006021 1E push ds + 40024 + 40025 ;dataseg ds + 40026 00006022 8E1E[F59B] mov ds,[RESSEG] + 40027 + 40028 00006026 30E4 xor ah,ah ; ax==UMB + 40029 ;mov bx,offset UmbSize + 40030 00006028 BB[6E04] mov bx,UmbSize ; bx==array + 40031 0000602B D0E0 shl al,1 ; ax==offset + 40032 ;add ax,bx ; ax==element index + 40033 ;mov si,ax ; ds:si==element index + 40034 ;lodsw ; ax==size + 40035 0000602D 01C3 add bx,ax + 40036 0000602F 8B07 mov ax,[bx] + 40037 + 40038 ;popreg + 40039 00006031 1F pop ds + 40040 ;pop si + 40041 ;pop bx 40042 - 40043 ; ----------------------------------------------------------------------------- - 40044 ;*** hideUMB - marks as HIDDEN all FREE elements in UMB passed as AL - 40045 ; ----------------------------------------------------------------------------- - 40046 ; ENTRY: AL must indicate a valid UMB; 0==conv && is invalid. - 40047 ; EXIT: None; free elements in UMB marked as hidden - 40048 ; ERROR: None - 40049 ; USES: Flags - 40050 ; ----------------------------------------------------------------------------- - 40051 - 40052 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40053 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40054 hideUMB: - 40055 ;pushreg - 40056 - 40057 ;push ax - 40058 ;push es - 40059 - 40060 00006033 E87800 call findumb ; Returns with carry if err, else ES == MCB - 40061 00006036 7221 jc short huX + 40043 ;normseg ds + 40044 00006032 C3 retn + 40045 + 40046 ; ----------------------------------------------------------------------------- + 40047 ;*** hideUMB - marks as HIDDEN all FREE elements in UMB passed as AL + 40048 ; ----------------------------------------------------------------------------- + 40049 ; ENTRY: AL must indicate a valid UMB; 0==conv && is invalid. + 40050 ; EXIT: None; free elements in UMB marked as hidden + 40051 ; ERROR: None + 40052 ; USES: Flags + 40053 ; ----------------------------------------------------------------------------- + 40054 + 40055 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40056 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40057 hideUMB: + 40058 ;pushreg + 40059 + 40060 ;push ax + 40061 ;push es 40062 - 40063 ; ------------------------------------------------ - 40064 ; HU10--ES - MCB inside UMB; if it's a system MCB, - 40065 ; we're not in the same UMB, so exit. + 40063 00006033 E87800 call findumb ; Returns with carry if err, else ES == MCB + 40064 00006036 7221 jc short huX + 40065 40066 ; ------------------------------------------------ - 40067 - 40068 hu10: - 40069 00006038 E80BFF call isSysMCB ; Returns with ZF set if owner is SYSTEM - 40070 0000603B 741C jz short huX ; If it is, we've finished the UMB. - 40071 0000603D E82800 call isFreeMCB ; Returns with ZF set if owner is 0 - 40072 00006040 7503 jnz short hu20 - 40073 - 40074 00006042 E82A00 call hideMCB - 40075 hu20: - 40076 ;mov al,[es:0] - 40077 00006045 26A00000 mov al,[es:arena_signature] - 40078 ;cmp al,'Z' - 40079 00006049 3C5A cmp al,arena_signature_end - 40080 0000604B 740C je short huX ; 'Z' means this was the last MCB... that's it. - 40081 - 40082 ;NextMCB es,ax ; Go on forward. - 40083 - 40084 0000604D 8CC0 mov ax,es ; NextMCB (macro) - 40085 ;add ax,[es:3] - 40086 0000604F 2603060300 add ax,[es:arena_size] - 40087 00006054 40 inc ax - 40088 00006055 8EC0 mov es,ax - 40089 - 40090 00006057 EBDF jmp short hu10 - 40091 huX: - 40092 ;popreg - 40093 - 40094 ;pop es - 40095 ;pop ax - 40096 - 40097 00006059 C3 retn - 40098 - 40099 ; ----------------------------------------------------------------------------- - 40100 ;*** isTiny - returns with ZF set if user didn't specify /S - 40101 ; ----------------------------------------------------------------------------- - 40102 ; ENTRY: None - 40103 ; EXIT: ZF set if user DIDN'T specify /S - 40104 ; ERROR: None - 40105 ; USES: Flags - 40106 ; ----------------------------------------------------------------------------- - 40107 - 40108 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40109 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40110 isTiny: - 40111 0000605A 50 push ax - 40112 - 40113 ;getdata al,fUmbTiny - 40114 0000605B 1E push ds - 40115 0000605C 8E1E[F59B] mov ds,[RESSEG] ; getdata (macro) - 40116 00006060 A0[3105] mov al,[fUmbTiny] - 40117 00006063 1F pop ds - 40118 - 40119 00006064 08C0 or al,al - 40120 00006066 58 pop ax - 40121 00006067 C3 retn - 40122 - 40123 ; ----------------------------------------------------------------------------- - 40124 ;*** isFreeMCB - returns with ZF set if current MCB (ES:0) is FREE - 40125 ; ----------------------------------------------------------------------------- - 40126 ; ENTRY: ES:0 should point to an MCB - 40127 ; EXIT: ZF set if MCB is free, else !ZF - 40128 ; ERROR: None - 40129 ; USES: Flags - 40130 ; ----------------------------------------------------------------------------- - 40131 - 40132 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40133 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40134 isFreeMCB: - 40135 ;or word [es:1],0 - 40136 00006068 26830E010000 or word [es:arena_owner],0 - 40137 0000606E C3 retn - 40138 - 40139 ; ----------------------------------------------------------------------------- - 40140 ;*** hideMCB - marks as HIDDEN the MCB at ES:0 - 40141 ; ----------------------------------------------------------------------------- - 40142 ; ENTRY: ES:0 should point to an MCB - 40143 ; EXIT: None; MCB marked as HIDDEN - 40144 ; ERROR: None - 40145 ; USES: None - 40146 ; ----------------------------------------------------------------------------- - 40147 - 40148 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40149 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40150 hideMCB: - 40151 ;mov word [es:1],8 - 40152 0000606F 26C70601000800 mov word [es:arena_owner],8 ; SystemPSPOwner - 40153 ;mov word [es:8],4948h ; 'HIDDEN ' - 40154 00006076 26C70608004849 mov word [es:arena_name+0], 'HI' ; 4948h - 40155 0000607D 26C7060A004444 mov word [es:arena_name+2], 'DD' ; 4444h - 40156 00006084 26C7060C00454E mov word [es:arena_name+4], 'EN' ; 4E45h - 40157 ;mov word [es:14],2020h - 40158 0000608B 26C7060E002020 mov word [es:arena_name+6], ' ' ; 2020h - 40159 00006092 C3 retn - 40160 - 40161 ; ----------------------------------------------------------------------------- - 40162 ;*** unHideMCB - marks as FREE the MCB at ES:0 - 40163 ; ----------------------------------------------------------------------------- - 40164 ; ENTRY: ES:0 should point to an MCB - 40165 ; EXIT: None; MCB marked as FREE - 40166 ; ERROR: None - 40167 ; USES: None - 40168 ; ----------------------------------------------------------------------------- - 40169 - 40170 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40171 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40172 unHideMCB: - 40173 ;push ax - 40174 ;mov word [es:1],0 - 40175 00006093 26C70601000000 mov word [es:arena_owner],0 ; FreePSPOwner - 40176 0000609A B82020 mov ax, ' ' ; mov ax,2020h - 40177 ;mov [es:8],ax - 40178 0000609D 26A30800 mov [es:arena_name+0],ax - 40179 000060A1 26A30A00 mov [es:arena_name+2],ax - 40180 000060A5 26A30C00 mov [es:arena_name+4],ax - 40181 ;mov [es:14],ax - 40182 000060A9 26A30E00 mov [es:arena_name+6],ax - 40183 ;pop ax - 40184 000060AD C3 retn - 40185 - 40186 ; ----------------------------------------------------------------------------- - 40187 ;*** findUMB - makes ES:0 point to the first MCB in UMB given as AL - 40188 ; -- returns UmbHEAD pointer (0x9FFF) if passed AL==0 + 40067 ; HU10--ES - MCB inside UMB; if it's a system MCB, + 40068 ; we're not in the same UMB, so exit. + 40069 ; ------------------------------------------------ + 40070 + 40071 hu10: + 40072 00006038 E80BFF call isSysMCB ; Returns with ZF set if owner is SYSTEM + 40073 0000603B 741C jz short huX ; If it is, we've finished the UMB. + 40074 0000603D E82800 call isFreeMCB ; Returns with ZF set if owner is 0 + 40075 00006040 7503 jnz short hu20 + 40076 + 40077 00006042 E82A00 call hideMCB + 40078 hu20: + 40079 ;mov al,[es:0] + 40080 00006045 26A00000 mov al,[es:arena_signature] + 40081 ;cmp al,'Z' + 40082 00006049 3C5A cmp al,arena_signature_end + 40083 0000604B 740C je short huX ; 'Z' means this was the last MCB... that's it. + 40084 + 40085 ;NextMCB es,ax ; Go on forward. + 40086 + 40087 0000604D 8CC0 mov ax,es ; NextMCB (macro) + 40088 ;add ax,[es:3] + 40089 0000604F 2603060300 add ax,[es:arena_size] + 40090 00006054 40 inc ax + 40091 00006055 8EC0 mov es,ax + 40092 + 40093 00006057 EBDF jmp short hu10 + 40094 huX: + 40095 ;popreg + 40096 + 40097 ;pop es + 40098 ;pop ax + 40099 + 40100 00006059 C3 retn + 40101 + 40102 ; ----------------------------------------------------------------------------- + 40103 ;*** isTiny - returns with ZF set if user didn't specify /S + 40104 ; ----------------------------------------------------------------------------- + 40105 ; ENTRY: None + 40106 ; EXIT: ZF set if user DIDN'T specify /S + 40107 ; ERROR: None + 40108 ; USES: Flags + 40109 ; ----------------------------------------------------------------------------- + 40110 + 40111 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40112 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40113 isTiny: + 40114 0000605A 50 push ax + 40115 + 40116 ;getdata al,fUmbTiny + 40117 0000605B 1E push ds + 40118 0000605C 8E1E[F59B] mov ds,[RESSEG] ; getdata (macro) + 40119 00006060 A0[3105] mov al,[fUmbTiny] + 40120 00006063 1F pop ds + 40121 + 40122 00006064 08C0 or al,al + 40123 00006066 58 pop ax + 40124 00006067 C3 retn + 40125 + 40126 ; ----------------------------------------------------------------------------- + 40127 ;*** isFreeMCB - returns with ZF set if current MCB (ES:0) is FREE + 40128 ; ----------------------------------------------------------------------------- + 40129 ; ENTRY: ES:0 should point to an MCB + 40130 ; EXIT: ZF set if MCB is free, else !ZF + 40131 ; ERROR: None + 40132 ; USES: Flags + 40133 ; ----------------------------------------------------------------------------- + 40134 + 40135 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40136 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40137 isFreeMCB: + 40138 ;or word [es:1],0 + 40139 00006068 26830E010000 or word [es:arena_owner],0 + 40140 0000606E C3 retn + 40141 + 40142 ; ----------------------------------------------------------------------------- + 40143 ;*** hideMCB - marks as HIDDEN the MCB at ES:0 + 40144 ; ----------------------------------------------------------------------------- + 40145 ; ENTRY: ES:0 should point to an MCB + 40146 ; EXIT: None; MCB marked as HIDDEN + 40147 ; ERROR: None + 40148 ; USES: None + 40149 ; ----------------------------------------------------------------------------- + 40150 + 40151 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40152 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40153 hideMCB: + 40154 ;mov word [es:1],8 + 40155 0000606F 26C70601000800 mov word [es:arena_owner],8 ; SystemPSPOwner + 40156 ;mov word [es:8],4948h ; 'HIDDEN ' + 40157 00006076 26C70608004849 mov word [es:arena_name+0], 'HI' ; 4948h + 40158 0000607D 26C7060A004444 mov word [es:arena_name+2], 'DD' ; 4444h + 40159 00006084 26C7060C00454E mov word [es:arena_name+4], 'EN' ; 4E45h + 40160 ;mov word [es:14],2020h + 40161 0000608B 26C7060E002020 mov word [es:arena_name+6], ' ' ; 2020h + 40162 00006092 C3 retn + 40163 + 40164 ; ----------------------------------------------------------------------------- + 40165 ;*** unHideMCB - marks as FREE the MCB at ES:0 + 40166 ; ----------------------------------------------------------------------------- + 40167 ; ENTRY: ES:0 should point to an MCB + 40168 ; EXIT: None; MCB marked as FREE + 40169 ; ERROR: None + 40170 ; USES: None + 40171 ; ----------------------------------------------------------------------------- + 40172 + 40173 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40174 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40175 unHideMCB: + 40176 ;push ax + 40177 ;mov word [es:1],0 + 40178 00006093 26C70601000000 mov word [es:arena_owner],0 ; FreePSPOwner + 40179 0000609A B82020 mov ax, ' ' ; mov ax,2020h + 40180 ;mov [es:8],ax + 40181 0000609D 26A30800 mov [es:arena_name+0],ax + 40182 000060A1 26A30A00 mov [es:arena_name+2],ax + 40183 000060A5 26A30C00 mov [es:arena_name+4],ax + 40184 ;mov [es:14],ax + 40185 000060A9 26A30E00 mov [es:arena_name+6],ax + 40186 ;pop ax + 40187 000060AD C3 retn + 40188 40189 ; ----------------------------------------------------------------------------- - 40190 ; ENTRY: AL should be to a valid UMB number - 40191 ; EXIT: ES:0 points to first MCB in UMB (_not_ the 8+SC MCB that heads it) - 40192 ; ERROR: Carry set if couldn't reach UMB (too high) - 40193 ; USES: Flags, ES - 40194 ; ----------------------------------------------------------------------------- - 40195 - 40196 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40197 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40198 findumb: - 40199 ;pushreg - 40200 - 40201 ;push ax - 40202 000060AE 51 push cx - 40203 000060AF 52 push dx - 40204 - 40205 000060B0 30E4 xor ah,ah ; Zap ah, so al==ax - 40206 - 40207 000060B2 89C2 mov dx,ax ; Store the to-be-found UMB number in DX - 40208 - 40209 000060B4 E882FE call UmbHead ; Returns first UMB segment in AX - 40210 - 40211 000060B7 8EC0 mov es,ax - 40212 000060B9 31C9 xor cx,cx ; Pretend we're on UMB 0 for now... + 40190 ;*** findUMB - makes ES:0 point to the first MCB in UMB given as AL + 40191 ; -- returns UmbHEAD pointer (0x9FFF) if passed AL==0 + 40192 ; ----------------------------------------------------------------------------- + 40193 ; ENTRY: AL should be to a valid UMB number + 40194 ; EXIT: ES:0 points to first MCB in UMB (_not_ the 8+SC MCB that heads it) + 40195 ; ERROR: Carry set if couldn't reach UMB (too high) + 40196 ; USES: Flags, ES + 40197 ; ----------------------------------------------------------------------------- + 40198 + 40199 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40200 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40201 findumb: + 40202 ;pushreg + 40203 + 40204 ;push ax + 40205 000060AE 51 push cx + 40206 000060AF 52 push dx + 40207 + 40208 000060B0 30E4 xor ah,ah ; Zap ah, so al==ax + 40209 + 40210 000060B2 89C2 mov dx,ax ; Store the to-be-found UMB number in DX + 40211 + 40212 000060B4 E882FE call UmbHead ; Returns first UMB segment in AX 40213 - 40214 ; --------------------------------------------- - 40215 ; FU10--CX - This UMB number; 0 == conventional - 40216 ; DX - The UMB number they're looking for - 40217 ; ES - The current MCB address - 40218 ; --------------------------------------------- - 40219 - 40220 fu10: - 40221 000060BB 39D1 cmp cx,dx ; If CX==DX, we've found the UMB we're - 40222 000060BD 741B je short fuX ; searching for--so exit. - 40223 - 40224 000060BF E884FE call isSysMCB ; Returns with ZF set if owner is SYSTEM - 40225 000060C2 7501 jnz short fu20 + 40214 000060B7 8EC0 mov es,ax + 40215 000060B9 31C9 xor cx,cx ; Pretend we're on UMB 0 for now... + 40216 + 40217 ; --------------------------------------------- + 40218 ; FU10--CX - This UMB number; 0 == conventional + 40219 ; DX - The UMB number they're looking for + 40220 ; ES - The current MCB address + 40221 ; --------------------------------------------- + 40222 + 40223 fu10: + 40224 000060BB 39D1 cmp cx,dx ; If CX==DX, we've found the UMB we're + 40225 000060BD 741B je short fuX ; searching for--so exit. 40226 - 40227 000060C4 41 inc cx ; If it _was_ SYSTEM, we're in a new UMB. - 40228 fu20: - 40229 ;mov al,[es:0] - 40230 000060C5 26A00000 mov al,[es:arena_signature] - 40231 ;cmp al,'Z' - 40232 000060C9 3C5A cmp al,arena_signature_end - 40233 000060CB 740C je short fuE ; 'Z' means this was the last MCB... that's it. - 40234 - 40235 ;NextMCB es,ax ; Go on forward. - 40236 - 40237 000060CD 8CC0 mov ax,es ; NextMCB (macro) - 40238 ;add ax,[es:3] - 40239 000060CF 2603060300 add ax,[es:arena_size] - 40240 000060D4 40 inc ax - 40241 000060D5 8EC0 mov es,ax - 40242 - 40243 000060D7 EBE2 jmp short fu10 - 40244 fuE: - 40245 000060D9 F9 stc - 40246 fuX: - 40247 ;popreg ; The address is already in ES. - 40248 - 40249 000060DA 5A pop dx - 40250 000060DB 59 pop cx + 40227 000060BF E884FE call isSysMCB ; Returns with ZF set if owner is SYSTEM + 40228 000060C2 7501 jnz short fu20 + 40229 + 40230 000060C4 41 inc cx ; If it _was_ SYSTEM, we're in a new UMB. + 40231 fu20: + 40232 ;mov al,[es:0] + 40233 000060C5 26A00000 mov al,[es:arena_signature] + 40234 ;cmp al,'Z' + 40235 000060C9 3C5A cmp al,arena_signature_end + 40236 000060CB 740C je short fuE ; 'Z' means this was the last MCB... that's it. + 40237 + 40238 ;NextMCB es,ax ; Go on forward. + 40239 + 40240 000060CD 8CC0 mov ax,es ; NextMCB (macro) + 40241 ;add ax,[es:3] + 40242 000060CF 2603060300 add ax,[es:arena_size] + 40243 000060D4 40 inc ax + 40244 000060D5 8EC0 mov es,ax + 40245 + 40246 000060D7 EBE2 jmp short fu10 + 40247 fuE: + 40248 000060D9 F9 stc + 40249 fuX: + 40250 ;popreg ; The address is already in ES. 40251 - 40252 ;pop ax - 40253 000060DC C3 retn - 40254 - 40255 ; ----------------------------------------------------------------------------- - 40256 ;*** BigFree - makes ES:0 point to the largest free MCB in UMB given as AL - 40257 ; ----------------------------------------------------------------------------- - 40258 ; ENTRY: AL should be to a valid UMB number - 40259 ; EXIT: ES:0 points to largest free MCB in UMB, AX returns its size - 40260 ; ERROR: Carry set if couldn't reach UMB (0 or too high) - 40261 ; USES: Flags, ES - 40262 ; ----------------------------------------------------------------------------- - 40263 - 40264 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40265 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6624h + 40252 000060DA 5A pop dx + 40253 000060DB 59 pop cx + 40254 + 40255 ;pop ax + 40256 000060DC C3 retn + 40257 + 40258 ; ----------------------------------------------------------------------------- + 40259 ;*** BigFree - makes ES:0 point to the largest free MCB in UMB given as AL + 40260 ; ----------------------------------------------------------------------------- + 40261 ; ENTRY: AL should be to a valid UMB number + 40262 ; EXIT: ES:0 points to largest free MCB in UMB, AX returns its size + 40263 ; ERROR: Carry set if couldn't reach UMB (0 or too high) + 40264 ; USES: Flags, ES + 40265 ; ----------------------------------------------------------------------------- 40266 - 40267 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40268 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:64A1h - 40269 BigFree: - 40270 ;pushreg - 40271 - 40272 ;push bx - 40273 000060DD 51 push cx - 40274 - 40275 000060DE E8CDFF call findumb ; Returns with CF if err, else ES==MCB - 40276 000060E1 7239 jc short bfX ; (would be "jc bfE"; it just does stc) + 40267 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40268 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6624h + 40269 + 40270 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40271 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:64A1h + 40272 BigFree: + 40273 ;pushreg + 40274 + 40275 ;push bx + 40276 000060DD 51 push cx 40277 - 40278 000060E3 31DB xor bx,bx ; Segment address of largest free MCB - 40279 000060E5 31C9 xor cx,cx ; Size of largest free MCB + 40278 000060DE E8CDFF call findumb ; Returns with CF if err, else ES==MCB + 40279 000060E1 7239 jc short bfX ; (would be "jc bfE"; it just does stc) 40280 - 40281 ; --------------------------------------------- - 40282 ; BF10--ES - Current MCB address - 40283 ; BX - Address of largest free MCB so far - 40284 ; CX - Size of largest free MCB so far - 40285 ; --------------------------------------------- - 40286 - 40287 bf10: - 40288 000060E7 E85CFE call isSysMCB ; If we've left the MCB, we're done. - 40289 000060EA 7427 jz short bf30 - 40290 - 40291 000060EC E879FF call isFreeMCB ; Returns with ZF set if owner is 0 - 40292 000060EF 750E jnz short bf20 + 40281 000060E3 31DB xor bx,bx ; Segment address of largest free MCB + 40282 000060E5 31C9 xor cx,cx ; Size of largest free MCB + 40283 + 40284 ; --------------------------------------------- + 40285 ; BF10--ES - Current MCB address + 40286 ; BX - Address of largest free MCB so far + 40287 ; CX - Size of largest free MCB so far + 40288 ; --------------------------------------------- + 40289 + 40290 bf10: + 40291 000060E7 E85CFE call isSysMCB ; If we've left the MCB, we're done. + 40292 000060EA 7427 jz short bf30 40293 - 40294 ;cmp cx,[es:3] - 40295 000060F1 263B0E0300 cmp cx,[es:arena_size] ; Compare sizes... - 40296 000060F6 7F07 jg short bf20 ; Unless we're bigger, - 40297 - 40298 000060F8 8CC3 mov bx,es ; Store this new element's address, - 40299 ;mov cx,[es:3] - 40300 000060FA 268B0E0300 mov cx,[es:arena_size] ; and its size. - 40301 bf20: - 40302 ;mov al,[es:0] - 40303 000060FF 26A00000 mov al,[es:arena_signature] - 40304 ;cmp al,'Z' ; 5Ah - 40305 00006103 3C5A cmp al,arena_signature_end - 40306 00006105 740C je short bf30 ; 'Z' means this was the last MCB. - 40307 - 40308 ;NextMCB es,ax ; Go on forward. - 40309 - 40310 00006107 8CC0 mov ax,es - 40311 ;add ax,[es:3] - 40312 00006109 2603060300 add ax,[es:arena_size] - 40313 0000610E 40 inc ax - 40314 0000610F 8EC0 mov es,ax - 40315 - 40316 00006111 EBD4 jmp short bf10 - 40317 bf30: - 40318 00006113 8EC3 mov es,bx ; Return the address - 40319 00006115 89C8 mov ax,cx ; Return the size - 40320 00006117 09DB or bx,bx - 40321 00006119 7501 jnz short bfX ; (if size==0, there's nothing free) - 40322 bfE: - 40323 0000611B F9 stc - 40324 bfX: - 40325 ;popreg - 40326 - 40327 0000611C 59 pop cx - 40328 ;pop bx + 40294 000060EC E879FF call isFreeMCB ; Returns with ZF set if owner is 0 + 40295 000060EF 750E jnz short bf20 + 40296 + 40297 ;cmp cx,[es:3] + 40298 000060F1 263B0E0300 cmp cx,[es:arena_size] ; Compare sizes... + 40299 000060F6 7F07 jg short bf20 ; Unless we're bigger, + 40300 + 40301 000060F8 8CC3 mov bx,es ; Store this new element's address, + 40302 ;mov cx,[es:3] + 40303 000060FA 268B0E0300 mov cx,[es:arena_size] ; and its size. + 40304 bf20: + 40305 ;mov al,[es:0] + 40306 000060FF 26A00000 mov al,[es:arena_signature] + 40307 ;cmp al,'Z' ; 5Ah + 40308 00006103 3C5A cmp al,arena_signature_end + 40309 00006105 740C je short bf30 ; 'Z' means this was the last MCB. + 40310 + 40311 ;NextMCB es,ax ; Go on forward. + 40312 + 40313 00006107 8CC0 mov ax,es + 40314 ;add ax,[es:3] + 40315 00006109 2603060300 add ax,[es:arena_size] + 40316 0000610E 40 inc ax + 40317 0000610F 8EC0 mov es,ax + 40318 + 40319 00006111 EBD4 jmp short bf10 + 40320 bf30: + 40321 00006113 8EC3 mov es,bx ; Return the address + 40322 00006115 89C8 mov ax,cx ; Return the size + 40323 00006117 09DB or bx,bx + 40324 00006119 7501 jnz short bfX ; (if size==0, there's nothing free) + 40325 bfE: + 40326 0000611B F9 stc + 40327 bfX: + 40328 ;popreg 40329 - 40330 0000611D C3 retn - 40331 - 40332 ; ----------------------------------------------------------------------------- - 40333 ;*** isSpecified - sets ZF if UMB in AL wasn't specified in DH/LH line. - 40334 ; ----------------------------------------------------------------------------- - 40335 ; ENTRY: AL should be to a valid UMB number - 40336 ; EXIT: ZF set if UMB wasn't specified, ZF clear if it was - 40337 ; ERROR: None - 40338 ; USES: Flags - 40339 ; ----------------------------------------------------------------------------- - 40340 - 40341 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40342 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40343 isSpecified: - 40344 ;push ax - 40345 - 40346 0000611E 30FF xor bh,bh - 40347 00006120 88C3 mov bl,al + 40330 0000611C 59 pop cx + 40331 ;pop bx + 40332 + 40333 0000611D C3 retn + 40334 + 40335 ; ----------------------------------------------------------------------------- + 40336 ;*** isSpecified - sets ZF if UMB in AL wasn't specified in DH/LH line. + 40337 ; ----------------------------------------------------------------------------- + 40338 ; ENTRY: AL should be to a valid UMB number + 40339 ; EXIT: ZF set if UMB wasn't specified, ZF clear if it was + 40340 ; ERROR: None + 40341 ; USES: Flags + 40342 ; ----------------------------------------------------------------------------- + 40343 + 40344 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40345 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40346 isSpecified: + 40347 ;push ax 40348 - 40349 ;getdata al,DS:UmbUsed[bx] - 40350 - 40351 00006122 1E push ds - 40352 00006123 8E1E[F59B] mov ds,[RESSEG] - 40353 00006127 8A87[5E04] mov al,[bx+UmbUsed] - 40354 0000612B 1F pop ds - 40355 - 40356 0000612C 08C0 or al,al ; Sets ZF if al==0 (ie, if unspecified) - 40357 - 40358 ;pop ax - 40359 0000612E C3 retn + 40349 0000611E 30FF xor bh,bh + 40350 00006120 88C3 mov bl,al + 40351 + 40352 ;getdata al,DS:UmbUsed[bx] + 40353 + 40354 00006122 1E push ds + 40355 00006123 8E1E[F59B] mov ds,[RESSEG] + 40356 00006127 8A87[5E04] mov al,[bx+UmbUsed] + 40357 0000612B 1F pop ds + 40358 + 40359 0000612C 08C0 or al,al ; Sets ZF if al==0 (ie, if unspecified) 40360 - 40361 ; ----------------------------------------------------------------------------- - 40362 ;*** shrinkMCB - breaks an MCB into two pieces, the lowest one's size==AX - 40363 ; ----------------------------------------------------------------------------- - 40364 ; ENTRY: AX == new size, ES:0 == current MCB - 40365 ; EXIT: None; MCB broken if carry clear - 40366 ; ERROR: Carry set if MCB isn't as large as AX+0x20 (not a useful split) - 40367 ; USES: Flags - 40368 ; ----------------------------------------------------------------------------- - 40369 ; If the size of the to-be-split MCB isn't at least 0x20 bytes greater than - 40370 ; the specified new size, the split is useless; if it's onnly 0x10 bytes, that - 40371 ; 0x10 will be used to make a header that mentions a 0-byte free space, and - 40372 ; that just sucks up 0x10 bytes for nothing. So we make 0x20 bytes the - 40373 ; minimum for performing a split. - 40374 ; ----------------------------------------------------------------------------- - 40375 - 40376 ;MIN_SPLIT_SIZE equ 20h - 40377 - 40378 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40379 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:667Ah + 40361 ;pop ax + 40362 0000612E C3 retn + 40363 + 40364 ; ----------------------------------------------------------------------------- + 40365 ;*** shrinkMCB - breaks an MCB into two pieces, the lowest one's size==AX + 40366 ; ----------------------------------------------------------------------------- + 40367 ; ENTRY: AX == new size, ES:0 == current MCB + 40368 ; EXIT: None; MCB broken if carry clear + 40369 ; ERROR: Carry set if MCB isn't as large as AX+0x20 (not a useful split) + 40370 ; USES: Flags + 40371 ; ----------------------------------------------------------------------------- + 40372 ; If the size of the to-be-split MCB isn't at least 0x20 bytes greater than + 40373 ; the specified new size, the split is useless; if it's onnly 0x10 bytes, that + 40374 ; 0x10 will be used to make a header that mentions a 0-byte free space, and + 40375 ; that just sucks up 0x10 bytes for nothing. So we make 0x20 bytes the + 40376 ; minimum for performing a split. + 40377 ; ----------------------------------------------------------------------------- + 40378 + 40379 ;MIN_SPLIT_SIZE equ 20h 40380 - 40381 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40382 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:64F7h - 40383 shrinkMCB: - 40384 ;pushreg - 40385 - 40386 ;push bx - 40387 0000612F 51 push cx ; * - 40388 00006130 26 psuh es ; ** - 40389 - 40390 00006131 89C3 mov bx,ax ; Move things around... and - 40391 00006133 8CC0 mov ax,es ; save this one for later. + 40381 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40382 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:667Ah + 40383 + 40384 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40385 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:64F7h + 40386 shrinkMCB: + 40387 ;pushreg + 40388 + 40389 ;push bx + 40390 0000612F 51 push cx ; * + 40391 00006130 26 psuh es ; ** 40392 - 40393 00006135 268B0E0300 mov cx,[es:arena_size] - 40394 0000613A 83E920 sub cx,32 ; sub cx,MIN_SPLIT_SIZE - 40395 ;cmp bx,cx ; {New size} vs {Current Size-20h} - 40396 ;ja short smE ; if wanted_size > cur-20h, abort. - 40397 0000613D 39D9 cmp cx,bx - 40398 0000613F 723E jb short smE ; cf = 1 (***) - 40399 - 40400 ;mov dl,[es:0] - 40401 00006141 268A160000 mov dl,[es:arena_signature] + 40393 00006131 89C3 mov bx,ax ; Move things around... and + 40394 00006133 8CC0 mov ax,es ; save this one for later. + 40395 + 40396 00006135 268B0E0300 mov cx,[es:arena_size] + 40397 0000613A 83E920 sub cx,32 ; sub cx,MIN_SPLIT_SIZE + 40398 ;cmp bx,cx ; {New size} vs {Current Size-20h} + 40399 ;ja short smE ; if wanted_size > cur-20h, abort. + 40400 0000613D 39D9 cmp cx,bx + 40401 0000613F 723E jb short smE ; cf = 1 (***) 40402 - 40403 ;;mov cx,[es:3] - 40404 ;mov cx,[es:arena_size] ; *! + 40403 ;mov dl,[es:0] + 40404 00006141 268A160000 mov dl,[es:arena_signature] 40405 - 40406 00006146 26891E0300 mov [es:arena_size],bx - 40407 ;mov byte [es:0],'M' ; 4Dh - 40408 0000614B 26C60600004D mov byte [es:arena_signature],'M' - 40409 - 40410 00006151 01D8 add ax,bx - 40411 00006153 40 inc ax - 40412 00006154 8EC0 mov es,ax ; Move to new arena area - 40413 - 40414 ;mov ax,cx ; !* - 40415 00006156 26A10300 mov ax,[es:arena_size] ; *! - 40416 0000615A 29D8 sub ax,bx - 40417 0000615C 48 dec ax ; And prepare the new size - 40418 - 40419 ;mov [es:0],dl - 40420 0000615D 2688160000 mov [es:arena_signature],dl - 40421 ;;mov word [es:1],0 - 40422 ;mov word [es:arena_owner],0 - 40423 ;mov [es:3],ax - 40424 00006162 26A30300 mov [es:arena_size],ax - 40425 00006166 B82020 mov ax,' ' ; mov ax,2020h - 40426 ;mov [es:8],ax - 40427 00006169 26A30800 mov [es:arena_name+0],ax - 40428 0000616D 26A30A00 mov [es:arena_name+2],ax - 40429 00006171 26A30C00 mov [es:arena_name+4],ax - 40430 ;mov [es:14],ax - 40431 00006175 26A30E00 mov [es:arena_name+6],ax - 40432 - 40433 ;clc - 40434 00006179 31C0 xor ax,ax - 40435 0000617B 26A30100 mov [es:arena_owner],ax ; 0 - 40436 ; cf = 0 - 40437 ;jmp short smX - 40438 smE: - 40439 ;stc ; cf = 1 (***) - 40440 smX: - 40441 ;popreg - 40442 0000617F 07 pop es ; ** - 40443 00006180 59 pop cx ; * - 40444 00006181 5B pop bx - 40445 - 40446 00006182 C3 retn - 40447 - 40448 ; ----------------------------------------------------------------------------- - 40449 ;*** hideUMB? - hides as appropriate the UMB in CL - 40450 ; ----------------------------------------------------------------------------- - 40451 ; ENTRY: CL should be to a valid UMB number, and AX to its address (findUMB) - 40452 ; EXIT: None; UMB is hidden as necessary - 40453 ; ERROR: None - 40454 ; USES: Flags, AX, CX - 40455 ; ----------------------------------------------------------------------------- - 40456 ; PRIMARY LOGIC: - 40457 ; - 40458 ; If the UMB is specified in the DH/LH statement, then: - 40459 ; If the largest free segment is too small (check specified size), then: - 40460 ; Pretend it wasn't ever specified, and fall out of this IF. - 40461 ; Else, if largest free segment is LARGER than specified size, then: - 40462 ; If /S was given on the command-line, then: - 40463 ; Break that element into two pieces - 40464 ; Set a flag that we're shrinking - 40465 ; Endif - 40466 ; Endif - 40467 ; Endif - 40468 ; If the UMB is NOT specified (or was removed by the above): - 40469 ; Hide all free elements in the UMB - 40470 ; If the flag that we're shrinking was set, then: - 40471 ; UN-hide the lower portion of the shrunken UMB - 40472 ; ENDIF - 40473 ; ENDIF - 40474 ; ----------------------------------------------------------------------------- - 40475 - 40476 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40477 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:66D7h + 40406 ;;mov cx,[es:3] + 40407 ;mov cx,[es:arena_size] ; *! + 40408 + 40409 00006146 26891E0300 mov [es:arena_size],bx + 40410 ;mov byte [es:0],'M' ; 4Dh + 40411 0000614B 26C60600004D mov byte [es:arena_signature],'M' + 40412 + 40413 00006151 01D8 add ax,bx + 40414 00006153 40 inc ax + 40415 00006154 8EC0 mov es,ax ; Move to new arena area + 40416 + 40417 ;mov ax,cx ; !* + 40418 00006156 26A10300 mov ax,[es:arena_size] ; *! + 40419 0000615A 29D8 sub ax,bx + 40420 0000615C 48 dec ax ; And prepare the new size + 40421 + 40422 ;mov [es:0],dl + 40423 0000615D 2688160000 mov [es:arena_signature],dl + 40424 ;;mov word [es:1],0 + 40425 ;mov word [es:arena_owner],0 + 40426 ;mov [es:3],ax + 40427 00006162 26A30300 mov [es:arena_size],ax + 40428 00006166 B82020 mov ax,' ' ; mov ax,2020h + 40429 ;mov [es:8],ax + 40430 00006169 26A30800 mov [es:arena_name+0],ax + 40431 0000616D 26A30A00 mov [es:arena_name+2],ax + 40432 00006171 26A30C00 mov [es:arena_name+4],ax + 40433 ;mov [es:14],ax + 40434 00006175 26A30E00 mov [es:arena_name+6],ax + 40435 + 40436 ;clc + 40437 00006179 31C0 xor ax,ax + 40438 0000617B 26A30100 mov [es:arena_owner],ax ; 0 + 40439 ; cf = 0 + 40440 ;jmp short smX + 40441 smE: + 40442 ;stc ; cf = 1 (***) + 40443 smX: + 40444 ;popreg + 40445 0000617F 07 pop es ; ** + 40446 00006180 59 pop cx ; * + 40447 00006181 5B pop bx + 40448 + 40449 00006182 C3 retn + 40450 + 40451 ; ----------------------------------------------------------------------------- + 40452 ;*** hideUMB? - hides as appropriate the UMB in CL + 40453 ; ----------------------------------------------------------------------------- + 40454 ; ENTRY: CL should be to a valid UMB number, and AX to its address (findUMB) + 40455 ; EXIT: None; UMB is hidden as necessary + 40456 ; ERROR: None + 40457 ; USES: Flags, AX, CX + 40458 ; ----------------------------------------------------------------------------- + 40459 ; PRIMARY LOGIC: + 40460 ; + 40461 ; If the UMB is specified in the DH/LH statement, then: + 40462 ; If the largest free segment is too small (check specified size), then: + 40463 ; Pretend it wasn't ever specified, and fall out of this IF. + 40464 ; Else, if largest free segment is LARGER than specified size, then: + 40465 ; If /S was given on the command-line, then: + 40466 ; Break that element into two pieces + 40467 ; Set a flag that we're shrinking + 40468 ; Endif + 40469 ; Endif + 40470 ; Endif + 40471 ; If the UMB is NOT specified (or was removed by the above): + 40472 ; Hide all free elements in the UMB + 40473 ; If the flag that we're shrinking was set, then: + 40474 ; UN-hide the lower portion of the shrunken UMB + 40475 ; ENDIF + 40476 ; ENDIF + 40477 ; ----------------------------------------------------------------------------- 40478 - 40479 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40480 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6554h - 40481 hideUMB?: - 40482 ;pushreg - 40483 - 40484 ;push bx - 40485 ;push dx - 40486 ;push es - 40487 - 40488 00006183 88C8 mov al,cl - 40489 00006185 E896FF call isSpecified ; Returns ZF set if al's umb was NOT specified - 40490 ;jz short hu?20 - 40491 ; 17/06/2023 - 40492 00006188 7432 jz short hu?25 ; * - 40493 - 40494 0000618A 88C8 mov al,cl ; Retrieve the size of the largest - 40495 0000618C E84EFF call BigFree ; free element in AX; put its address in ES - 40496 ;jc short hu?20 ; Oops. Errors mean skip this part. - 40497 ; 17/06/2023 - 40498 0000618F 723B jc short hu?X ; ** - 40499 - 40500 00006191 50 push ax ; TOS==size of BigFree in UMB (popped as BX) - 40501 00006192 88C8 mov al,cl ; Retrieve the user's specified - 40502 00006194 E88AFE call GetSize ; minimum size for this umb (into AX) - 40503 00006197 5B pop bx ; Now BX==BigFree, AX==Specified Size - 40504 - 40505 00006198 09C0 or ax,ax ; If they didn't specify one, - 40506 ;jz short hu?20 ; Skip over all this. - 40507 ; 17/06/2023 - 40508 0000619A 7530 jnz short hu?X ; ** - 40509 - 40510 0000619C 39D8 cmp ax,bx ; Ah... if (specified > max free) - 40511 0000619E 7607 jbe short hu?10 + 40479 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40480 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:66D7h + 40481 + 40482 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40483 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6554h + 40484 hideUMB?: + 40485 ;pushreg + 40486 + 40487 ;push bx + 40488 ;push dx + 40489 ;push es + 40490 + 40491 00006183 88C8 mov al,cl + 40492 00006185 E896FF call isSpecified ; Returns ZF set if al's umb was NOT specified + 40493 ;jz short hu?20 + 40494 ; 17/06/2023 + 40495 00006188 7432 jz short hu?25 ; * + 40496 + 40497 0000618A 88C8 mov al,cl ; Retrieve the size of the largest + 40498 0000618C E84EFF call BigFree ; free element in AX; put its address in ES + 40499 ;jc short hu?20 ; Oops. Errors mean skip this part. + 40500 ; 17/06/2023 + 40501 0000618F 723B jc short hu?X ; ** + 40502 + 40503 00006191 50 push ax ; TOS==size of BigFree in UMB (popped as BX) + 40504 00006192 88C8 mov al,cl ; Retrieve the user's specified + 40505 00006194 E88AFE call GetSize ; minimum size for this umb (into AX) + 40506 00006197 5B pop bx ; Now BX==BigFree, AX==Specified Size + 40507 + 40508 00006198 09C0 or ax,ax ; If they didn't specify one, + 40509 ;jz short hu?20 ; Skip over all this. + 40510 ; 17/06/2023 + 40511 0000619A 7530 jnz short hu?X ; ** 40512 - 40513 000061A0 88C8 mov al,cl ; Then mark that UMB as unused. Nya nya. - 40514 000061A2 E898FC call unMarkUMB - 40515 ;jmp short hu?20 ; *** - 40516 ; 17/06/2023 - 40517 ; ('isSpecified' would return with ZF=1) ; *** - 40518 000061A5 EB15 jmp short hu?25 - 40519 hu?10: - 40520 000061A7 E8B0FE call isTiny ; Returns ZF clear if user specified /S - 40521 ;jz short hu?20 - 40522 ; 17/06/2023 - 40523 ; ('isSpecified' would return with ZF=0) ; ** - 40524 000061AA 7420 jz short hu?X - 40525 - 40526 000061AC E880FF call shrinkMCB ; They specified /S, so shrink the MCB to AX - 40527 ;jc short hu?20 ; Ah... if didn't shrink after all, skip this: - 40528 ; 17/06/2023 - 40529 ; ('isSpecified' would return with ZF=0) ; ** - 40530 000061AF 721B jc short hu?X - 40531 - 40532 000061B1 8CC2 mov dx,es - 40533 000061B3 EB09 jmp short hu?30 ; Skip the spec check.. we wanna hide this one. - 40534 hu?20: - 40535 ;mov al,cl - 40536 000061B5 89C8 mov ax,cx - 40537 000061B7 E864FF call isSpecified ; If they specified this UMB, we're done... - 40538 000061BA 7510 jnz short hu?X ; ** ; so leave. - 40539 hu?25: ; 17/06/2023 ; * - 40540 000061BC 31D2 xor dx,dx - 40541 hu?30: - 40542 000061BE 88C8 mov al,cl - 40543 - 40544 000061C0 E870FE call hideUMB ; Hides everything in UMB #al - 40545 - 40546 000061C3 09D2 or dx,dx ; Did we shrink a UMB? If not, DX==0, - 40547 000061C5 7405 jz short hu?X ; So we should leave. + 40513 0000619C 39D8 cmp ax,bx ; Ah... if (specified > max free) + 40514 0000619E 7607 jbe short hu?10 + 40515 + 40516 000061A0 88C8 mov al,cl ; Then mark that UMB as unused. Nya nya. + 40517 000061A2 E898FC call unMarkUMB + 40518 ;jmp short hu?20 ; *** + 40519 ; 17/06/2023 + 40520 ; ('isSpecified' would return with ZF=1) ; *** + 40521 000061A5 EB15 jmp short hu?25 + 40522 hu?10: + 40523 000061A7 E8B0FE call isTiny ; Returns ZF clear if user specified /S + 40524 ;jz short hu?20 + 40525 ; 17/06/2023 + 40526 ; ('isSpecified' would return with ZF=0) ; ** + 40527 000061AA 7420 jz short hu?X + 40528 + 40529 000061AC E880FF call shrinkMCB ; They specified /S, so shrink the MCB to AX + 40530 ;jc short hu?20 ; Ah... if didn't shrink after all, skip this: + 40531 ; 17/06/2023 + 40532 ; ('isSpecified' would return with ZF=0) ; ** + 40533 000061AF 721B jc short hu?X + 40534 + 40535 000061B1 8CC2 mov dx,es + 40536 000061B3 EB09 jmp short hu?30 ; Skip the spec check.. we wanna hide this one. + 40537 hu?20: + 40538 ;mov al,cl + 40539 000061B5 89C8 mov ax,cx + 40540 000061B7 E864FF call isSpecified ; If they specified this UMB, we're done... + 40541 000061BA 7510 jnz short hu?X ; ** ; so leave. + 40542 hu?25: ; 17/06/2023 ; * + 40543 000061BC 31D2 xor dx,dx + 40544 hu?30: + 40545 000061BE 88C8 mov al,cl + 40546 + 40547 000061C0 E870FE call hideUMB ; Hides everything in UMB #al 40548 - 40549 000061C7 8EC2 mov es,dx ; Ah, but if it isn't, DX==the MCB's address; - 40550 000061C9 E8C7FE call unHideMCB ; Un-hides the lower portion of that MCB. - 40551 hu?X: - 40552 ;popreg - 40553 - 40554 ;pop es - 40555 ;pop dx - 40556 ;pop bx - 40557 - 40558 000061CC C3 retn - 40559 - 40560 ; ----------------------------------------------------------------------------- - 40561 ;*** UmbTest - returns with carry set if UMBs are not available, else CF==false - 40562 ; ----------------------------------------------------------------------------- - 40563 ; ENTRY: None - 40564 ; EXIT: Carry is clear if UMBs are available, or set if they are not - 40565 ; ERROR: None - 40566 ; USES: CF (AX,BX,DS,ES pushed 'cause they're used by others) - 40567 ; ----------------------------------------------------------------------------- - 40568 - 40569 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40570 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40571 UmbTest: - 40572 ;pushreg - 40573 - 40574 ;push ax - 40575 ;push bx - 40576 ;push ds - 40577 ;push es - 40578 - 40579 000061CD E88CFB call fm_link ; Link in UMBs (if not already linked) - 40580 000061D0 E80600 call WalkMem ; Check to see if they're really linked - 40581 000061D3 9C pushf ; And remember what we found out - 40582 000061D4 E89CFB call fm_unlink ; Unlink UMBs (if WE have linked 'em) - 40583 000061D7 9D popf ; And restore what we found out. - 40584 - 40585 ;popreg - 40586 - 40587 ;pop es - 40588 ;pop ds - 40589 ;pop bx - 40590 ;pop ax - 40591 - 40592 000061D8 C3 retn - 40593 - 40594 ; ----------------------------------------------------------------------------- - 40595 ;*** WalkMem - travels memory chain and returns carry clear iff UMBs are linked - 40596 ; ----------------------------------------------------------------------------- - 40597 ; ENTRY: None - 40598 ; EXIT: Carry SET if MCB chain stops before 9FFF, CLEAR if stops >= 9FFF. - 40599 ; ERROR: None - 40600 ; USES: Flags - 40601 ; ----------------------------------------------------------------------------- - 40602 - 40603 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40604 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40605 WalkMem: - 40606 ;pushreg - 40607 - 40608 ;push ax - 40609 ;push bx - 40610 000061D9 06 push es - 40611 - 40612 000061DA B452 mov ah,52h ; DOS_GET_DOS_LISTS - 40613 ; Call int 21h, function 52h... - 40614 000061DC CD21 int 21h - 40615 - 40616 000061DE 268B47FE mov ax,[es:bx-2] - 40617 ;mov es,ax ; * + 40549 000061C3 09D2 or dx,dx ; Did we shrink a UMB? If not, DX==0, + 40550 000061C5 7405 jz short hu?X ; So we should leave. + 40551 + 40552 000061C7 8EC2 mov es,dx ; Ah, but if it isn't, DX==the MCB's address; + 40553 000061C9 E8C7FE call unHideMCB ; Un-hides the lower portion of that MCB. + 40554 hu?X: + 40555 ;popreg + 40556 + 40557 ;pop es + 40558 ;pop dx + 40559 ;pop bx + 40560 + 40561 000061CC C3 retn + 40562 + 40563 ; ----------------------------------------------------------------------------- + 40564 ;*** UmbTest - returns with carry set if UMBs are not available, else CF==false + 40565 ; ----------------------------------------------------------------------------- + 40566 ; ENTRY: None + 40567 ; EXIT: Carry is clear if UMBs are available, or set if they are not + 40568 ; ERROR: None + 40569 ; USES: CF (AX,BX,DS,ES pushed 'cause they're used by others) + 40570 ; ----------------------------------------------------------------------------- + 40571 + 40572 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40573 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40574 UmbTest: + 40575 ;pushreg + 40576 + 40577 ;push ax + 40578 ;push bx + 40579 ;push ds + 40580 ;push es + 40581 + 40582 000061CD E88CFB call fm_link ; Link in UMBs (if not already linked) + 40583 000061D0 E80600 call WalkMem ; Check to see if they're really linked + 40584 000061D3 9C pushf ; And remember what we found out + 40585 000061D4 E89CFB call fm_unlink ; Unlink UMBs (if WE have linked 'em) + 40586 000061D7 9D popf ; And restore what we found out. + 40587 + 40588 ;popreg + 40589 + 40590 ;pop es + 40591 ;pop ds + 40592 ;pop bx + 40593 ;pop ax + 40594 + 40595 000061D8 C3 retn + 40596 + 40597 ; ----------------------------------------------------------------------------- + 40598 ;*** WalkMem - travels memory chain and returns carry clear iff UMBs are linked + 40599 ; ----------------------------------------------------------------------------- + 40600 ; ENTRY: None + 40601 ; EXIT: Carry SET if MCB chain stops before 9FFF, CLEAR if stops >= 9FFF. + 40602 ; ERROR: None + 40603 ; USES: Flags + 40604 ; ----------------------------------------------------------------------------- + 40605 + 40606 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40607 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40608 WalkMem: + 40609 ;pushreg + 40610 + 40611 ;push ax + 40612 ;push bx + 40613 000061D9 06 push es + 40614 + 40615 000061DA B452 mov ah,52h ; DOS_GET_DOS_LISTS + 40616 ; Call int 21h, function 52h... + 40617 000061DC CD21 int 21h 40618 - 40619 ; ------------------------------ - 40620 ; UM10: ES = Current MCB pointer - 40621 ; ------------------------------ - 40622 - 40623 um10: - 40624 000061E2 8EC0 mov es,ax ; * + 40619 000061DE 268B47FE mov ax,[es:bx-2] + 40620 ;mov es,ax ; * + 40621 + 40622 ; ------------------------------ + 40623 ; UM10: ES = Current MCB pointer + 40624 ; ------------------------------ 40625 - 40626 ;mov al,[es:0] - 40627 000061E4 26A00000 mov al,[es:arena_signature] - 40628 ;cmp al,'Z' ; 5Ah - 40629 000061E8 3C5A cmp al,arena_signature_end - 40630 000061EA 740A je short um20 ; If signature == 'Z', hay no more. - 40631 - 40632 ;NextMCB es,bx ; Move to the next MCB - 40633 - 40634 ;mov bx,es - 40635 ;;add bx,[es:3] - 40636 ;add bx,[es:arena_size] - 40637 ;inc bx - 40638 ;mov es,bx - 40639 000061EC 8CC0 mov ax,es - 40640 000061EE 2603060300 add ax,[es:arena_size] - 40641 000061F3 40 inc ax - 40642 ;mov es,ax ; * - 40643 - 40644 000061F4 EBEC jmp short um10 ; And restart the loop. - 40645 um20: - 40646 000061F6 8CC0 mov ax,es - 40647 000061F8 3DFF9F cmp ax,9FFFh ; This sets CF if ax < 9FFF. - 40648 - 40649 ;popreg - 40650 000061FB 07 pop es - 40651 ;pop bx - 40652 ;pop ax - 40653 - 40654 000061FC C3 retn - 40655 - 40656 ; ----------------------------------------------------------------------------- - 40657 ;*** hl_unlink - unlinks UMBs if fm_umb is set to 0; restores strategy too - 40658 ; ----------------------------------------------------------------------------- - 40659 ; ENTRY: fm_umb == 1 : leave linked, else unlink - 40660 ; EXIT: None - 40661 ; ERROR: None - 40662 ; USES: AX, BX - 40663 ; ----------------------------------------------------------------------------- - 40664 - 40665 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 40666 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:681Ch + 40626 um10: + 40627 000061E2 8EC0 mov es,ax ; * + 40628 + 40629 ;mov al,[es:0] + 40630 000061E4 26A00000 mov al,[es:arena_signature] + 40631 ;cmp al,'Z' ; 5Ah + 40632 000061E8 3C5A cmp al,arena_signature_end + 40633 000061EA 740A je short um20 ; If signature == 'Z', hay no more. + 40634 + 40635 ;NextMCB es,bx ; Move to the next MCB + 40636 + 40637 ;mov bx,es + 40638 ;;add bx,[es:3] + 40639 ;add bx,[es:arena_size] + 40640 ;inc bx + 40641 ;mov es,bx + 40642 000061EC 8CC0 mov ax,es + 40643 000061EE 2603060300 add ax,[es:arena_size] + 40644 000061F3 40 inc ax + 40645 ;mov es,ax ; * + 40646 + 40647 000061F4 EBEC jmp short um10 ; And restart the loop. + 40648 um20: + 40649 000061F6 8CC0 mov ax,es + 40650 000061F8 3DFF9F cmp ax,9FFFh ; This sets CF if ax < 9FFF. + 40651 + 40652 ;popreg + 40653 000061FB 07 pop es + 40654 ;pop bx + 40655 ;pop ax + 40656 + 40657 000061FC C3 retn + 40658 + 40659 ; ----------------------------------------------------------------------------- + 40660 ;*** hl_unlink - unlinks UMBs if fm_umb is set to 0; restores strategy too + 40661 ; ----------------------------------------------------------------------------- + 40662 ; ENTRY: fm_umb == 1 : leave linked, else unlink + 40663 ; EXIT: None + 40664 ; ERROR: None + 40665 ; USES: AX, BX + 40666 ; ----------------------------------------------------------------------------- 40667 - 40668 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40669 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6699h - 40670 hl_unlink: - 40671 000061FD 1E push ds ; * - 40672 - 40673 000061FE 30FF xor bh,bh - 40674 ;getdata bl,fm_umb ; Restore original link-state + 40668 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 40669 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:681Ch + 40670 + 40671 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40672 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6699h + 40673 hl_unlink: + 40674 000061FD 1E push ds ; * 40675 - 40676 ;push ds - 40677 00006200 8E1E[F59B] mov ds,[RESSEG] - 40678 00006204 8A1E[3505] mov bl,[fm_umb] ; Restore original link-state - 40679 ;pop ds - 40680 - 40681 00006208 B80358 mov ax,5803h ; DOS_SET_UMBLINK - 40682 0000620B CD21 int 21h - 40683 - 40684 0000620D 30FF xor bh,bh - 40685 - 40686 ;getdata bl,fm_strat ; Restore original mem-alloc strategy - 40687 - 40688 ;push ds - 40689 ;mov ds,[RESSEG] - 40690 0000620F 8A1E[3605] mov bl,[fm_strat] ;Restore original mem-alloc strategy - 40691 ;pop ds - 40692 - 40693 00006213 B80158 mov ax,5801h ; DOS_SET_STRATEGY - 40694 00006216 CD21 int 21h + 40676 000061FE 30FF xor bh,bh + 40677 ;getdata bl,fm_umb ; Restore original link-state + 40678 + 40679 ;push ds + 40680 00006200 8E1E[F59B] mov ds,[RESSEG] + 40681 00006204 8A1E[3505] mov bl,[fm_umb] ; Restore original link-state + 40682 ;pop ds + 40683 + 40684 00006208 B80358 mov ax,5803h ; DOS_SET_UMBLINK + 40685 0000620B CD21 int 21h + 40686 + 40687 0000620D 30FF xor bh,bh + 40688 + 40689 ;getdata bl,fm_strat ; Restore original mem-alloc strategy + 40690 + 40691 ;push ds + 40692 ;mov ds,[RESSEG] + 40693 0000620F 8A1E[3605] mov bl,[fm_strat] ;Restore original mem-alloc strategy + 40694 ;pop ds 40695 - 40696 00006218 1F pop ds ; * - 40697 - 40698 00006219 C3 retn - 40699 - 40700 ;============================================================================ - 40701 ; LOADHIGH.ASM, MSDOS 6.0, 1991 - 40702 ;============================================================================ - 40703 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 40704 - 40705 ; This is a new module added to support loading programs into UMBs provided - 40706 ; by DOS 5.0. - 40707 ; --------------------------------------------------------------------------- - 40708 ; Usage: - 40709 ; - 40710 ; LOADHIGH [/L:umb[,size][;umb[,size]]*] - 40711 ; - 40712 ; has to be a filename that is not wildcarded. - 40713 - 40714 ; --------------------------------------------------------------------------- - 40715 ; - 40716 ; Revision History - 40717 ; ================ + 40696 00006213 B80158 mov ax,5801h ; DOS_SET_STRATEGY + 40697 00006216 CD21 int 21h + 40698 + 40699 00006218 1F pop ds ; * + 40700 + 40701 00006219 C3 retn + 40702 + 40703 ;============================================================================ + 40704 ; LOADHIGH.ASM, MSDOS 6.0, 1991 + 40705 ;============================================================================ + 40706 ; 12/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 40707 + 40708 ; This is a new module added to support loading programs into UMBs provided + 40709 ; by DOS 5.0. + 40710 ; --------------------------------------------------------------------------- + 40711 ; Usage: + 40712 ; + 40713 ; LOADHIGH [/L:umb[,size][;umb[,size]]*] + 40714 ; + 40715 ; has to be a filename that is not wildcarded. + 40716 + 40717 ; --------------------------------------------------------------------------- 40718 ; - 40719 ; M009 SR 08/01/90 Set flags to indicate that we are - 40720 ; loading and high and also remember - 40721 ; current UMB state. - 40722 ; - 40723 ; M016 SR 08/09/90 Give special error message on attempt - 40724 ; to loadhigh batch files and invalid - 40725 ; filename on Loadhigh command line. - 40726 ; - 40727 ; M039 SR 11/19/90 Bug #4270. Copy all the whitespaces - 40728 ; after the program name also as part - 40729 ; of the command line being passed to - 40730 ; the program to be invoked. - 40731 ; - 40732 ; --------------------------------------------------------------------------- - 40733 - 40734 ; --------------------------------------------------------------------------- - 40735 ; - 40736 ; include highload.inc ; Grab code for ParseVar and such - 40737 - 40738 iCmdLine equ 81h ; PSP:81h points to command-line - 40739 - 40740 ; - 40741 ; --------------------------------------------------------------------------- + 40719 ; Revision History + 40720 ; ================ + 40721 ; + 40722 ; M009 SR 08/01/90 Set flags to indicate that we are + 40723 ; loading and high and also remember + 40724 ; current UMB state. + 40725 ; + 40726 ; M016 SR 08/09/90 Give special error message on attempt + 40727 ; to loadhigh batch files and invalid + 40728 ; filename on Loadhigh command line. + 40729 ; + 40730 ; M039 SR 11/19/90 Bug #4270. Copy all the whitespaces + 40731 ; after the program name also as part + 40732 ; of the command line being passed to + 40733 ; the program to be invoked. + 40734 ; + 40735 ; --------------------------------------------------------------------------- + 40736 + 40737 ; --------------------------------------------------------------------------- + 40738 ; + 40739 ; include highload.inc ; Grab code for ParseVar and such + 40740 + 40741 iCmdLine equ 81h ; PSP:81h points to command-line 40742 - 40743 ;**** LoadHigh -- Main routine for Loadhigh command - 40744 ; - 40745 ; ENTRY Command line tail is at PSP:iCmdLine terminated by 0dh - 40746 ; CS = DS = SS = TRANGROUP + 40743 ; + 40744 ; --------------------------------------------------------------------------- + 40745 + 40746 ;**** LoadHigh -- Main routine for Loadhigh command 40747 ; - 40748 ; EXIT None - 40749 ; - 40750 ; USED ax, bx, cx, dx, si, di, es - 40751 ; - 40752 ; ERROR EXITS - 40753 ; Message pointers are setup at the error locations and then - 40754 ; we jump back to CERROR which is the transient error recycle point. - 40755 ; Apart from parse errors, the other errors handled are too many - 40756 ; switches anf invalid filenames. - 40757 ; - 40758 ; EFFECTS - 40759 ; The allocation strategy and the state of the arena chain are - 40760 ; put in the requested state according to the given options. If a - 40761 ; filename is also given, it is executed as well. - 40762 ; --------------------------------------------------------------------------- - 40763 - 40764 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 40765 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5927h + 40748 ; ENTRY Command line tail is at PSP:iCmdLine terminated by 0dh + 40749 ; CS = DS = SS = TRANGROUP + 40750 ; + 40751 ; EXIT None + 40752 ; + 40753 ; USED ax, bx, cx, dx, si, di, es + 40754 ; + 40755 ; ERROR EXITS + 40756 ; Message pointers are setup at the error locations and then + 40757 ; we jump back to CERROR which is the transient error recycle point. + 40758 ; Apart from parse errors, the other errors handled are too many + 40759 ; switches anf invalid filenames. + 40760 ; + 40761 ; EFFECTS + 40762 ; The allocation strategy and the state of the arena chain are + 40763 ; put in the requested state according to the given options. If a + 40764 ; filename is also given, it is executed as well. + 40765 ; --------------------------------------------------------------------------- 40766 - 40767 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 40768 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:683Fh + 40767 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 40768 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5927h 40769 - 40770 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40771 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:66BCh - 40772 LoadHigh: - 40773 0000621A 1E push ds - 40774 0000621B 07 pop es - 40775 - 40776 ; 16/06/2023 - 40777 ;call SkipLhDelims ; MSDOS 5.0 ! - 40778 - 40779 ;Get command tail to be passed to the program. This includes any whitespace - 40780 ;chars between the program name and its parameters as well. - 40781 ;On return, ds:si points at the start of the command tail. - 40782 - 40783 ; 16/06/2023 - 40784 ;push si ; MSDOS 5.0 ! - 40785 0000621C E81300 call ParseLhCmd - 40786 ;pop si ; MSDOS 5.0 ! - 40787 0000621F 720E jc short LhErr - 40788 - 40789 00006221 E86500 call SetupCmdLine ;setup pgm's command line - 40790 - 40791 00006224 E88700 call SetupPath ;setup path for file - 40792 00006227 7206 jc short LhErr ;file not found + 40770 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 40771 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:683Fh + 40772 + 40773 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40774 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:66BCh + 40775 LoadHigh: + 40776 0000621A 1E push ds + 40777 0000621B 07 pop es + 40778 + 40779 ; 16/06/2023 + 40780 ;call SkipLhDelims ; MSDOS 5.0 ! + 40781 + 40782 ;Get command tail to be passed to the program. This includes any whitespace + 40783 ;chars between the program name and its parameters as well. + 40784 ;On return, ds:si points at the start of the command tail. + 40785 + 40786 ; 16/06/2023 + 40787 ;push si ; MSDOS 5.0 ! + 40788 0000621C E81300 call ParseLhCmd + 40789 ;pop si ; MSDOS 5.0 ! + 40790 0000621F 720E jc short LhErr + 40791 + 40792 00006221 E86500 call SetupCmdLine ;setup pgm's command line 40793 - 40794 ;Set allocation strategy to HighFirst and link in UMBs for exec. This will - 40795 ;be reset after return from the Exec - 40796 ;We will also set a resident flag to indicate that UMBs were activated for - 40797 ;the Exec. On return from the Exec, this flag will be used to deactivate UMBs - 40798 - 40799 00006229 E8AFFD call HideUMBs ;prepare upper-memory for load - 40800 - 40801 0000622C E900CB jmp LH_EXECUTE ;go and exec file ;M051 - 40802 - 40803 LhErr: - 40804 ;The error message has been setup at this stage + 40794 00006224 E88700 call SetupPath ;setup path for file + 40795 00006227 7206 jc short LhErr ;file not found + 40796 + 40797 ;Set allocation strategy to HighFirst and link in UMBs for exec. This will + 40798 ;be reset after return from the Exec + 40799 ;We will also set a resident flag to indicate that UMBs were activated for + 40800 ;the Exec. On return from the Exec, this flag will be used to deactivate UMBs + 40801 + 40802 00006229 E8AFFD call HideUMBs ;prepare upper-memory for load + 40803 + 40804 0000622C E900CB jmp LH_EXECUTE ;go and exec file ;M051 40805 - 40806 0000622F E9F4CA jmp cerror ;print error message and recycle - 40807 - 40808 ; --------------------------------------------------------------------------- - 40809 - 40810 ;*** ParseLhCmd - parses any command-line options - 40811 ; - 40812 ; ENTRY None - 40813 ; - 40814 ; EXIT Carry clear -- command line parsed successfully - 40815 ; Carry set -- appropriate error message setup + 40806 LhErr: + 40807 ;The error message has been setup at this stage + 40808 + 40809 0000622F E9F4CA jmp cerror ;print error message and recycle + 40810 + 40811 ; --------------------------------------------------------------------------- + 40812 + 40813 ;*** ParseLhCmd - parses any command-line options + 40814 ; + 40815 ; ENTRY None 40816 ; - 40817 ; USED ax, si - 40818 ; - 40819 ; EFFECTS - 40820 ; Options set up (see highvar.inc) - 40821 ; Filename to be executed setup - 40822 ; - 40823 ; ParseLhCmd calls InitVar to initialize data filled in by ParseVar, - 40824 ; then calls ParseVar itself to actually parse the commmand-line. On - 40825 ; return from ParseVar, DS:SI will point to the beginning of the child - 40826 ; module's name on the command-line; thus it calls LhCopyFilename to - 40827 ; prepare the command-line for that program. - 40828 ; --------------------------------------------------------------------------- - 40829 - 40830 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 40831 %if 0 - 40832 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 40833 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5944h - 40834 ; MSDOS 5.0 COMMAND.COM only ! (MSDOS 6.0 code is different) - 40835 ; 11/06/2023 - 40836 ParseLhCmd: - 40837 ;mov si,81h - 40838 mov si,iCmdLine ;ds:si points at command line - 40839 - 40840 mov word [COMSW],0 - 40841 mov di,Parse_LoadHi - 40842 xor cx,cx - 40843 call Parse_With_Msg - 40844 - 40845 ; 11/06/2023 - 40846 ;cmp ax,0FFFFh ; -1 - 40847 ;jz short PLhCmd2 - 40848 ;cmp ax,0 - 40849 ;jnz short PLhCmd1 - 40850 ; 11/06/2023 - 40851 inc ax ; cmp ax,-1 - 40852 jz short PLhCmd2 ; 0FFFFh -> 0 - 40853 dec ax ; cmp ax,0 - 40854 jnz short PLhCmd1 ; 1 -> 0 - 40855 ; ax = 0 - 40856 - 40857 mov bx,dx - 40858 ; 14/04/2023 - 40859 ;call LhCopyFilename - 40860 ;; 13/04/2023 - 40861 ;;;jc short PLhCmd2 ; !!! jmp short PLhCmd2 !!! - 40862 ;;jmp short PLhCmd2 - 40863 ;retn - 40864 ; 14/04/2023 - 40865 jmp short LhCopyFilename - 40866 PLhCmd1: - 40867 stc - 40868 PLhCmd2: - 40869 retn - 40870 %endif - 40871 - 40872 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 40873 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6857h - 40874 ; MSDOS 6.0 - 40875 - 40876 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 40877 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:66D4h - 40878 ParseLhCmd: - 40879 ;assume ds:TRANGROUP, es:TRANGROUP - 40880 - 40881 ;mov si,81h - 40882 00006232 BE8100 mov si,iCmdLine ;ds:si points at command line - 40883 - 40884 ; es = ds (from 'LoadHigh') - 40885 ;push es ;Store ES 'cause we're gonna change it: + 40817 ; EXIT Carry clear -- command line parsed successfully + 40818 ; Carry set -- appropriate error message setup + 40819 ; + 40820 ; USED ax, si + 40821 ; + 40822 ; EFFECTS + 40823 ; Options set up (see highvar.inc) + 40824 ; Filename to be executed setup + 40825 ; + 40826 ; ParseLhCmd calls InitVar to initialize data filled in by ParseVar, + 40827 ; then calls ParseVar itself to actually parse the commmand-line. On + 40828 ; return from ParseVar, DS:SI will point to the beginning of the child + 40829 ; module's name on the command-line; thus it calls LhCopyFilename to + 40830 ; prepare the command-line for that program. + 40831 ; --------------------------------------------------------------------------- + 40832 + 40833 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 40834 %if 0 + 40835 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 40836 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5944h + 40837 ; MSDOS 5.0 COMMAND.COM only ! (MSDOS 6.0 code is different) + 40838 ; 11/06/2023 + 40839 ParseLhCmd: + 40840 ;mov si,81h + 40841 mov si,iCmdLine ;ds:si points at command line + 40842 + 40843 mov word [COMSW],0 + 40844 mov di,Parse_LoadHi + 40845 xor cx,cx + 40846 call Parse_With_Msg + 40847 + 40848 ; 11/06/2023 + 40849 ;cmp ax,0FFFFh ; -1 + 40850 ;jz short PLhCmd2 + 40851 ;cmp ax,0 + 40852 ;jnz short PLhCmd1 + 40853 ; 11/06/2023 + 40854 inc ax ; cmp ax,-1 + 40855 jz short PLhCmd2 ; 0FFFFh -> 0 + 40856 dec ax ; cmp ax,0 + 40857 jnz short PLhCmd1 ; 1 -> 0 + 40858 ; ax = 0 + 40859 + 40860 mov bx,dx + 40861 ; 14/04/2023 + 40862 ;call LhCopyFilename + 40863 ;; 13/04/2023 + 40864 ;;;jc short PLhCmd2 ; !!! jmp short PLhCmd2 !!! + 40865 ;;jmp short PLhCmd2 + 40866 ;retn + 40867 ; 14/04/2023 + 40868 jmp short LhCopyFilename + 40869 PLhCmd1: + 40870 stc + 40871 PLhCmd2: + 40872 retn + 40873 %endif + 40874 + 40875 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 40876 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6857h + 40877 ; MSDOS 6.0 + 40878 + 40879 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 40880 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:66D4h + 40881 ParseLhCmd: + 40882 ;assume ds:TRANGROUP, es:TRANGROUP + 40883 + 40884 ;mov si,81h + 40885 00006232 BE8100 mov si,iCmdLine ;ds:si points at command line 40886 - 40887 ;push ds - 40888 ;pop es ;Make sure es:si points to cmd line as well + 40887 ; es = ds (from 'LoadHigh') + 40888 ;push es ;Store ES 'cause we're gonna change it: 40889 - 40890 00006235 E8ACFA call InitVar ;Initialize data for ParseVar - 40891 - 40892 00006238 E84AFB call ParseVar ;And parse the command line - 40893 - 40894 ;pop es ;Restore ES now; we're done with it. - 40895 - 40896 0000623B 7317 jnc short plcC ;If no error, continue on our way. - 40897 - 40898 0000623D 83F802 cmp ax,2 ; PV_BadUMB - 40899 ;Bad UMB passed? - 40900 00006240 7505 jne short plc10 - 40901 ;mov dx,offset TRANGROUP:LhBadUMB_Ptr - 40902 00006242 BA[D292] mov dx,LhBadUMB_Ptr - 40903 00006245 F9 stc - 40904 00006246 C3 retn - 40905 plc10: - 40906 ;mov dx,offset TRANGROUP:LhInvSwt_Ptr - 40907 00006247 BA[CF92] mov dx,LhInvSwt_Ptr - 40908 0000624A 83F803 cmp ax,3 ; PV_InvSwt - 40909 ;Unrecognized switch passed? - 40910 0000624D 7403 je short plc20 - 40911 ;mov dx,offset TRANGROUP:LhInvArg_Ptr - 40912 0000624F BA[C992] mov dx,LhInvArg_Ptr - 40913 plc20: - 40914 00006252 F9 stc - 40915 00006253 C3 retn - 40916 plcC: - 40917 ;call LhCopyFilename ;copy filename into our buffer - 40918 ;retn ;Return-- carry=status - 40919 ; 16/06/2023 - 40920 ;jmp short LhCopyFilename - 40921 - 40922 ; --------------------------------------------------------------------------- - 40923 - 40924 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 40925 - 40926 ; --------------------------------------------------------------------------- - 40927 ; HIGHLOAD.INC, MSDOS 6.0, 1992 - 40928 ; --------------------------------------------------------------------------- - 40929 - 40930 ; 13/04/2023 - 40931 ; MSDOS 5.0 COMMAND.COM only ! - 40932 ; (Procedure names are not from original Microsoft source code!) - 40933 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:596Ah - 40934 ;set_strategy: - 40935 ;mov ax,5800h ; DOS_CHECK_STRATEGY - 40936 ;int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 40937 ; ; AL = function code: get allocation strategy - 40938 ;mov bx,ax - 40939 ;or bx,80h - 40940 ;mov ax,5801h ; DOS_SET_STRATEGY - 40941 ;int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 40942 ; ; AL = function code: set allocation strategy - 40943 ;retn - 40944 - 40945 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:597Bh - 40946 ;set_umblink: - 40947 ;mov ax,5803h ; DOS_SET_UMBLINK - 40948 ;mov bx,1 - 40949 ;int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 40950 ; ; AL = function code: (DOS 5beta) set UMB link state - 40951 ;retn - 40952 - 40953 ; --------------------------------------------------------------------------- - 40954 - 40955 ;*** LhCopyFilename -- copy filename from command line to buffer - 40956 ; - 40957 ; ENTRY ds:si points at primary argument (filename) - 40958 ; - 40959 ; EXIT Carry set -- filename has wildcards. In this event, DX will - 40960 ; already contain an appropriate error number. - 40961 ; Carry clear -- filename has been copied as needed; DS:SI - 40962 ; points to first character (most likely space) - 40963 ; after filename. - 40964 ; - 40965 ; USED ax, si - 40966 ; - 40967 ; EFFECTS - 40968 ; ExecPath contains the filename + 40890 ;push ds + 40891 ;pop es ;Make sure es:si points to cmd line as well + 40892 + 40893 00006235 E8ACFA call InitVar ;Initialize data for ParseVar + 40894 + 40895 00006238 E84AFB call ParseVar ;And parse the command line + 40896 + 40897 ;pop es ;Restore ES now; we're done with it. + 40898 + 40899 0000623B 7317 jnc short plcC ;If no error, continue on our way. + 40900 + 40901 0000623D 83F802 cmp ax,2 ; PV_BadUMB + 40902 ;Bad UMB passed? + 40903 00006240 7505 jne short plc10 + 40904 ;mov dx,offset TRANGROUP:LhBadUMB_Ptr + 40905 00006242 BA[D292] mov dx,LhBadUMB_Ptr + 40906 00006245 F9 stc + 40907 00006246 C3 retn + 40908 plc10: + 40909 ;mov dx,offset TRANGROUP:LhInvSwt_Ptr + 40910 00006247 BA[CF92] mov dx,LhInvSwt_Ptr + 40911 0000624A 83F803 cmp ax,3 ; PV_InvSwt + 40912 ;Unrecognized switch passed? + 40913 0000624D 7403 je short plc20 + 40914 ;mov dx,offset TRANGROUP:LhInvArg_Ptr + 40915 0000624F BA[C992] mov dx,LhInvArg_Ptr + 40916 plc20: + 40917 00006252 F9 stc + 40918 00006253 C3 retn + 40919 plcC: + 40920 ;call LhCopyFilename ;copy filename into our buffer + 40921 ;retn ;Return-- carry=status + 40922 ; 16/06/2023 + 40923 ;jmp short LhCopyFilename + 40924 + 40925 ; --------------------------------------------------------------------------- + 40926 + 40927 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 40928 + 40929 ; --------------------------------------------------------------------------- + 40930 ; HIGHLOAD.INC, MSDOS 6.0, 1992 + 40931 ; --------------------------------------------------------------------------- + 40932 + 40933 ; 13/04/2023 + 40934 ; MSDOS 5.0 COMMAND.COM only ! + 40935 ; (Procedure names are not from original Microsoft source code!) + 40936 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:596Ah + 40937 ;set_strategy: + 40938 ;mov ax,5800h ; DOS_CHECK_STRATEGY + 40939 ;int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 40940 ; ; AL = function code: get allocation strategy + 40941 ;mov bx,ax + 40942 ;or bx,80h + 40943 ;mov ax,5801h ; DOS_SET_STRATEGY + 40944 ;int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 40945 ; ; AL = function code: set allocation strategy + 40946 ;retn + 40947 + 40948 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:597Bh + 40949 ;set_umblink: + 40950 ;mov ax,5803h ; DOS_SET_UMBLINK + 40951 ;mov bx,1 + 40952 ;int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 40953 ; ; AL = function code: (DOS 5beta) set UMB link state + 40954 ;retn + 40955 + 40956 ; --------------------------------------------------------------------------- + 40957 + 40958 ;*** LhCopyFilename -- copy filename from command line to buffer + 40959 ; + 40960 ; ENTRY ds:si points at primary argument (filename) + 40961 ; + 40962 ; EXIT Carry set -- filename has wildcards. In this event, DX will + 40963 ; already contain an appropriate error number. + 40964 ; Carry clear -- filename has been copied as needed; DS:SI + 40965 ; points to first character (most likely space) + 40966 ; after filename. + 40967 ; + 40968 ; USED ax, si 40969 ; - 40970 ; If there are any wildcards in the filename, then we have an error - 40971 ; --------------------------------------------------------------------------- - 40972 - 40973 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 40974 %if 0 - 40975 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 40976 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5984h - 40977 ; MSDOS 5.0 COMMAND.COM only ! (MSDOS 6.0 code is different) - 40978 LhCopyFilename: - 40979 push ds - 40980 push si - 40981 push di - 40982 lds si,[bx+4] - 40983 mov di,EXECPATH - 40984 lhcpfn1: - 40985 lodsb - 40986 cmp al,2Ah ; '*' - 40987 jz short lhfilerr - 40988 cmp al,3Fh ; '?' - 40989 jz short lhfilerr - 40990 stosb - 40991 or al,al - 40992 jnz short lhcpfn1 - 40993 ; 14/04/2023 - 40994 ; cf = 0 - 40995 ;clc - 40996 lhfilerr2: - 40997 pop di - 40998 pop si - 40999 pop ds - 41000 retn - 41001 lhfilerr: - 41002 mov dx,LhInvFil_Ptr - 41003 stc - 41004 jmp short lhfilerr2 - 41005 - 41006 %endif - 41007 - 41008 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM - 41009 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6881h - 41010 ; MSDOS 6.0 - 41011 - 41012 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 41013 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:66FEh - 41014 LhCopyFilename: - 41015 ;assume ds:TRANGROUP, es:TRANGROUP - 41016 - 41017 ;mov di,offset TRANGROUP:ExecPath - 41018 00006254 BF[1D9B] mov di,EXECPATH + 40970 ; EFFECTS + 40971 ; ExecPath contains the filename + 40972 ; + 40973 ; If there are any wildcards in the filename, then we have an error + 40974 ; --------------------------------------------------------------------------- + 40975 + 40976 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 40977 %if 0 + 40978 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 40979 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5984h + 40980 ; MSDOS 5.0 COMMAND.COM only ! (MSDOS 6.0 code is different) + 40981 LhCopyFilename: + 40982 push ds + 40983 push si + 40984 push di + 40985 lds si,[bx+4] + 40986 mov di,EXECPATH + 40987 lhcpfn1: + 40988 lodsb + 40989 cmp al,2Ah ; '*' + 40990 jz short lhfilerr + 40991 cmp al,3Fh ; '?' + 40992 jz short lhfilerr + 40993 stosb + 40994 or al,al + 40995 jnz short lhcpfn1 + 40996 ; 14/04/2023 + 40997 ; cf = 0 + 40998 ;clc + 40999 lhfilerr2: + 41000 pop di + 41001 pop si + 41002 pop ds + 41003 retn + 41004 lhfilerr: + 41005 mov dx,LhInvFil_Ptr + 41006 stc + 41007 jmp short lhfilerr2 + 41008 + 41009 %endif + 41010 + 41011 ; 16/06/2023 - Retro DOS v4.2 COMMAND.COM + 41012 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6881h + 41013 ; MSDOS 6.0 + 41014 + 41015 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 41016 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:66FEh + 41017 LhCopyFilename: + 41018 ;assume ds:TRANGROUP, es:TRANGROUP 41019 - 41020 ;mov cx,0 ; Copied zero characters - 41021 00006257 29C9 sub cx,cx - 41022 ;@@: - 41023 lhcpfn1: - 41024 00006259 AC lodsb - 41025 0000625A 3C2A cmp al,'*' ;wildcard? - 41026 0000625C 7421 je short lhfilerr ;yes, error - 41027 0000625E 3C3F cmp al,'?' ;wildcard? - 41028 00006260 741D je short lhfilerr ;yes, error - 41029 - 41030 00006262 3C0D cmp al,0Dh ;carriage return? - 41031 ;jz @f - 41032 00006264 7410 je short lhcpfn2 - 41033 00006266 3C2F cmp al,'/' ; SwitChar ;'/'? + 41020 ;mov di,offset TRANGROUP:ExecPath + 41021 00006254 BF[1D9B] mov di,EXECPATH + 41022 + 41023 ;mov cx,0 ; Copied zero characters + 41024 00006257 29C9 sub cx,cx + 41025 ;@@: + 41026 lhcpfn1: + 41027 00006259 AC lodsb + 41028 0000625A 3C2A cmp al,'*' ;wildcard? + 41029 0000625C 7421 je short lhfilerr ;yes, error + 41030 0000625E 3C3F cmp al,'?' ;wildcard? + 41031 00006260 741D je short lhfilerr ;yes, error + 41032 + 41033 00006262 3C0D cmp al,0Dh ;carriage return? 41034 ;jz @f - 41035 00006268 740C je short lhcpfn2 - 41036 0000626A 08C0 or al,al ;EOS? + 41035 00006264 7410 je short lhcpfn2 + 41036 00006266 3C2F cmp al,'/' ; SwitChar ;'/'? 41037 ;jz @f - 41038 0000626C 7408 jz short lhcpfn2 - 41039 0000626E 3C20 cmp al,' ' ;Space? + 41038 00006268 740C je short lhcpfn2 + 41039 0000626A 08C0 or al,al ;EOS? 41040 ;jz @f - 41041 00006270 7404 je short lhcpfn2 - 41042 - 41043 ;or al,al - 41044 ;;jz @f - 41045 ;je short lhcpfn2 - 41046 - 41047 00006272 AA stosb ;store char - 41048 00006273 41 inc cx ;And remember that we did one more - 41049 ;jmp short @b - 41050 00006274 EBE3 jmp short lhcpfn1 - 41051 ;@@: - 41052 lhcpfn2: - 41053 00006276 30C0 xor al,al ;Indicate EOS reached - 41054 00006278 AA stosb ;store char - 41055 - 41056 00006279 09C9 or cx,cx ;If we didn't copy any characters, - 41057 0000627B 7407 jz short lhmissing ; they didn't give a filename. + 41041 0000626C 7408 jz short lhcpfn2 + 41042 0000626E 3C20 cmp al,' ' ;Space? + 41043 ;jz @f + 41044 00006270 7404 je short lhcpfn2 + 41045 + 41046 ;or al,al + 41047 ;;jz @f + 41048 ;je short lhcpfn2 + 41049 + 41050 00006272 AA stosb ;store char + 41051 00006273 41 inc cx ;And remember that we did one more + 41052 ;jmp short @b + 41053 00006274 EBE3 jmp short lhcpfn1 + 41054 ;@@: + 41055 lhcpfn2: + 41056 00006276 30C0 xor al,al ;Indicate EOS reached + 41057 00006278 AA stosb ;store char 41058 - 41059 0000627D 4E dec si ;Move back to the delimiting character - 41060 ; cf = 0 - 41061 ;clc ;And indicate no error occurred - 41062 0000627E C3 retn - 41063 lhfilerr: - 41064 ;mov dx,offset TRANGROUP:LhInvFil_Ptr - 41065 0000627F BA[C392] mov dx,LhInvFil_Ptr ;"Invalid Filename" ; M016 - 41066 00006282 F9 stc - 41067 00006283 C3 retn - 41068 lhmissing: - 41069 ;mov dx,offset TRANGROUP:ReqParmMiss - 41070 00006284 BA[CC92] mov dx,ReqParmMiss ;"Required parm missing" - 41071 00006287 F9 stc - 41072 00006288 C3 retn - 41073 - 41074 ; --------------------------------------------------------------------------- - 41075 - 41076 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41077 %if 0 - 41078 ; 14/04/2023 - 41079 ; 13/04/2023 - 41080 ; MSDOS 5.0 COMMAND.COM only ! - 41081 ; (Procedure name is not from original Microsoft source code!) - 41082 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:596Ah - 41083 set_strategy: - 41084 mov ax,5800h ; DOS_CHECK_STRATEGY - 41085 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 41086 ; AL = function code: get allocation strategy - 41087 mov bx,ax - 41088 or bx,80h - 41089 mov ax,5801h ; DOS_SET_STRATEGY - 41090 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 41091 ; AL = function code: set allocation strategy - 41092 retn - 41093 - 41094 ; --------------------------------------------------------------------------- - 41095 - 41096 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41097 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59A6h - 41098 ; MSDOS 5.0 COMMAND.COM only ! - 41099 ; (Procedure name is not from original Microsoft source code!) - 41100 SkipLhDelims: - 41101 mov si,81h - 41102 call scanoff - 41103 stfn1: - 41104 lodsb - 41105 call DELIM - 41106 jz short stfn2 - 41107 cmp al,0Dh - 41108 jz short stfn2 - 41109 cmp al,[SWITCHAR] - 41110 jnz short stfn1 - 41111 stfn2: - 41112 dec si - 41113 retn - 41114 - 41115 %endif - 41116 - 41117 ; --------------------------------------------------------------------------- - 41118 - 41119 ;*** SetupCmdLine -- prepare command line for the program - 41120 ; - 41121 ; ENTRY {es/ds}:si = points just after the end of the child program - 41122 ; - 41123 ; EXIT None - 41124 ; - 41125 ; USED - 41126 ; - 41127 ; EFFECTS - 41128 ; The rest of the command line following the pgm name is - 41129 ; moved to the top of the command line buffer (at TRANGROUP:81h) - 41130 ; and a new command line length is put in - 41131 ; --------------------------------------------------------------------------- - 41132 - 41133 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41134 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59BEh + 41059 00006279 09C9 or cx,cx ;If we didn't copy any characters, + 41060 0000627B 7407 jz short lhmissing ; they didn't give a filename. + 41061 + 41062 0000627D 4E dec si ;Move back to the delimiting character + 41063 ; cf = 0 + 41064 ;clc ;And indicate no error occurred + 41065 0000627E C3 retn + 41066 lhfilerr: + 41067 ;mov dx,offset TRANGROUP:LhInvFil_Ptr + 41068 0000627F BA[C392] mov dx,LhInvFil_Ptr ;"Invalid Filename" ; M016 + 41069 00006282 F9 stc + 41070 00006283 C3 retn + 41071 lhmissing: + 41072 ;mov dx,offset TRANGROUP:ReqParmMiss + 41073 00006284 BA[CC92] mov dx,ReqParmMiss ;"Required parm missing" + 41074 00006287 F9 stc + 41075 00006288 C3 retn + 41076 + 41077 ; --------------------------------------------------------------------------- + 41078 + 41079 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41080 %if 0 + 41081 ; 14/04/2023 + 41082 ; 13/04/2023 + 41083 ; MSDOS 5.0 COMMAND.COM only ! + 41084 ; (Procedure name is not from original Microsoft source code!) + 41085 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:596Ah + 41086 set_strategy: + 41087 mov ax,5800h ; DOS_CHECK_STRATEGY + 41088 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 41089 ; AL = function code: get allocation strategy + 41090 mov bx,ax + 41091 or bx,80h + 41092 mov ax,5801h ; DOS_SET_STRATEGY + 41093 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 41094 ; AL = function code: set allocation strategy + 41095 retn + 41096 + 41097 ; --------------------------------------------------------------------------- + 41098 + 41099 ; 13/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41100 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59A6h + 41101 ; MSDOS 5.0 COMMAND.COM only ! + 41102 ; (Procedure name is not from original Microsoft source code!) + 41103 SkipLhDelims: + 41104 mov si,81h + 41105 call scanoff + 41106 stfn1: + 41107 lodsb + 41108 call DELIM + 41109 jz short stfn2 + 41110 cmp al,0Dh + 41111 jz short stfn2 + 41112 cmp al,[SWITCHAR] + 41113 jnz short stfn1 + 41114 stfn2: + 41115 dec si + 41116 retn + 41117 + 41118 %endif + 41119 + 41120 ; --------------------------------------------------------------------------- + 41121 + 41122 ;*** SetupCmdLine -- prepare command line for the program + 41123 ; + 41124 ; ENTRY {es/ds}:si = points just after the end of the child program + 41125 ; + 41126 ; EXIT None + 41127 ; + 41128 ; USED + 41129 ; + 41130 ; EFFECTS + 41131 ; The rest of the command line following the pgm name is + 41132 ; moved to the top of the command line buffer (at TRANGROUP:81h) + 41133 ; and a new command line length is put in + 41134 ; --------------------------------------------------------------------------- 41135 - 41136 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41137 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:68BEh + 41136 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41137 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59BEh 41138 - 41139 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 41140 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:673Bh - 41141 SetupCmdLine: - 41142 ;mov di,81h - 41143 00006289 BF8100 mov di,iCmdLine - 41144 0000628C 30C9 xor cl,cl - 41145 0000628E FEC9 dec cl ;just CR means count = 0 - 41146 SetCmdL1: - 41147 00006290 AC lodsb - 41148 00006291 AA stosb - 41149 00006292 FEC1 inc cl ;update count - 41150 - 41151 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41152 ; MSDOS 6.0 - 41153 ; 14/04/2023 - 41154 ; * ; MSDOS 6.0 only ! - 41155 00006294 08C0 or al,al ; * - 41156 00006296 7404 jz short SetCmdL2 ; * - 41157 - 41158 00006298 3C0D cmp al,0Dh ;carriage return? - 41159 0000629A 75F4 jnz short SetCmdL1 ;no, continue storing - 41160 SetCmdL2: - 41161 0000629C 26880E8000 mov [es:80h],cl ;store new cmd line length - 41162 000062A1 C3 retn - 41163 - 41164 ; --------------------------------------------------------------------------- - 41165 - 41166 ;*** LhSetupErrMsg -- Sets up error messages - 41167 ; - 41168 ; ENTRY ax = error message number - 41169 ; - 41170 ; EXIT None - 41171 ; - 41172 ; USED dx - 41173 ; - 41174 ; EFFECTS - 41175 ; Everything setup to display error message - 41176 ; --------------------------------------------------------------------------- - 41177 - 41178 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41179 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41180 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 41181 LhSetupErrMsg: - 41182 000062A2 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class ; 1 - 41183 000062A7 BA[D78F] mov dx,extend_buf_ptr - 41184 000062AA A3[D78F] mov [extend_buf_ptr],ax - 41185 000062AD C3 retn - 41186 - 41187 ; --------------------------------------------------------------------------- - 41188 - 41189 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41190 %if 0 - 41191 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41192 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59DFh - 41193 ; MSDOS 5.0 COMMAND.COM only ! - 41194 ; (Procedure name is not from original Microsoft source code!) - 41195 check_umblink: - 41196 mov ax,5800h ; DOS_CHECK_STRATEGY - 41197 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 41198 ; AL = function code: get allocation strategy - 41199 mov bl,al - 41200 mov ax,5802h ; DOS_CHECK_UMBLINK - 41201 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 41202 ; AL = function code: (DOS 5beta) get UMB link state - 41203 mov bh,al - 41204 xchg ax,bx - 41205 rol al,1 - 41206 and al,1 - 41207 shl ah,1 - 41208 or al,ah - 41209 retn - 41210 - 41211 ; --------------------------------------------------------------------------- - 41212 - 41213 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41214 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59F7h - 41215 ; MSDOS 5.0 COMMAND.COM only ! (MSDOS 6.0 code is different) - 41216 HideUMBs: - 41217 push ds - 41218 call check_umblink - 41219 mov ds,[RESSEG] - 41220 mov [fInHigh],al - 41221 or byte [fInHigh],80h - 41222 pop ds - 41223 call set_strategy - 41224 ;call set_umblink - 41225 ;retn - 41226 ; 14/04/023 - 41227 ;jmp short set_umblink - 41228 - 41229 ; --------------------------------------------------------------------------- - 41230 - 41231 ; 14/04/2023 - 41232 ; 13/04/2023 - 41233 ; MSDOS 5.0 COMMAND.COM only ! - 41234 ; (Procedure name is not from original Microsoft source code!) - 41235 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:597Bh - 41236 set_umblink: - 41237 mov ax,5803h ; DOS_SET_UMBLINK - 41238 mov bx,1 - 41239 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY - 41240 ; AL = function code: (DOS 5beta) set UMB link state - 41241 retn - 41242 %endif - 41243 - 41244 ; --------------------------------------------------------------------------- - 41245 - 41246 ;*** SetupPath -- Do path search for the file to be executed - 41247 ; - 41248 ; ENTRY None - 41249 ; - 41250 ; EXIT Carry set if file not found or not executable file - 41251 ; - 41252 ; EFFECTS - 41253 ; ExecPath contains the full path of the file to be executed - 41254 ; --------------------------------------------------------------------------- - 41255 - 41256 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41257 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5A0Fh + 41139 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41140 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:68BEh + 41141 + 41142 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 41143 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:673Bh + 41144 SetupCmdLine: + 41145 ;mov di,81h + 41146 00006289 BF8100 mov di,iCmdLine + 41147 0000628C 30C9 xor cl,cl + 41148 0000628E FEC9 dec cl ;just CR means count = 0 + 41149 SetCmdL1: + 41150 00006290 AC lodsb + 41151 00006291 AA stosb + 41152 00006292 FEC1 inc cl ;update count + 41153 + 41154 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41155 ; MSDOS 6.0 + 41156 ; 14/04/2023 + 41157 ; * ; MSDOS 6.0 only ! + 41158 00006294 08C0 or al,al ; * + 41159 00006296 7404 jz short SetCmdL2 ; * + 41160 + 41161 00006298 3C0D cmp al,0Dh ;carriage return? + 41162 0000629A 75F4 jnz short SetCmdL1 ;no, continue storing + 41163 SetCmdL2: + 41164 0000629C 26880E8000 mov [es:80h],cl ;store new cmd line length + 41165 000062A1 C3 retn + 41166 + 41167 ; --------------------------------------------------------------------------- + 41168 + 41169 ;*** LhSetupErrMsg -- Sets up error messages + 41170 ; + 41171 ; ENTRY ax = error message number + 41172 ; + 41173 ; EXIT None + 41174 ; + 41175 ; USED dx + 41176 ; + 41177 ; EFFECTS + 41178 ; Everything setup to display error message + 41179 ; --------------------------------------------------------------------------- + 41180 + 41181 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41182 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41183 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 41184 LhSetupErrMsg: + 41185 000062A2 C606[D58F]01 mov byte [msg_disp_class],ext_msg_class ; 1 + 41186 000062A7 BA[D78F] mov dx,extend_buf_ptr + 41187 000062AA A3[D78F] mov [extend_buf_ptr],ax + 41188 000062AD C3 retn + 41189 + 41190 ; --------------------------------------------------------------------------- + 41191 + 41192 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41193 %if 0 + 41194 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41195 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59DFh + 41196 ; MSDOS 5.0 COMMAND.COM only ! + 41197 ; (Procedure name is not from original Microsoft source code!) + 41198 check_umblink: + 41199 mov ax,5800h ; DOS_CHECK_STRATEGY + 41200 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 41201 ; AL = function code: get allocation strategy + 41202 mov bl,al + 41203 mov ax,5802h ; DOS_CHECK_UMBLINK + 41204 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 41205 ; AL = function code: (DOS 5beta) get UMB link state + 41206 mov bh,al + 41207 xchg ax,bx + 41208 rol al,1 + 41209 and al,1 + 41210 shl ah,1 + 41211 or al,ah + 41212 retn + 41213 + 41214 ; --------------------------------------------------------------------------- + 41215 + 41216 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41217 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:59F7h + 41218 ; MSDOS 5.0 COMMAND.COM only ! (MSDOS 6.0 code is different) + 41219 HideUMBs: + 41220 push ds + 41221 call check_umblink + 41222 mov ds,[RESSEG] + 41223 mov [fInHigh],al + 41224 or byte [fInHigh],80h + 41225 pop ds + 41226 call set_strategy + 41227 ;call set_umblink + 41228 ;retn + 41229 ; 14/04/023 + 41230 ;jmp short set_umblink + 41231 + 41232 ; --------------------------------------------------------------------------- + 41233 + 41234 ; 14/04/2023 + 41235 ; 13/04/2023 + 41236 ; MSDOS 5.0 COMMAND.COM only ! + 41237 ; (Procedure name is not from original Microsoft source code!) + 41238 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:597Bh + 41239 set_umblink: + 41240 mov ax,5803h ; DOS_SET_UMBLINK + 41241 mov bx,1 + 41242 int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY + 41243 ; AL = function code: (DOS 5beta) set UMB link state + 41244 retn + 41245 %endif + 41246 + 41247 ; --------------------------------------------------------------------------- + 41248 + 41249 ;*** SetupPath -- Do path search for the file to be executed + 41250 ; + 41251 ; ENTRY None + 41252 ; + 41253 ; EXIT Carry set if file not found or not executable file + 41254 ; + 41255 ; EFFECTS + 41256 ; ExecPath contains the full path of the file to be executed + 41257 ; --------------------------------------------------------------------------- 41258 - 41259 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41260 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:68E3h + 41259 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41260 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5A0Fh 41261 - 41262 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 41263 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6760h - 41264 SetupPath: - 41265 - 41266 ;Juggle around the argv pointers to make argv[1] into argv[0]. This is - 41267 ;because the path search routine that we are about to invoke expects the - 41268 ;filename to search for to be argv[0]. - 41269 ; - 41270 ;If our new argv[0] starts with a switcharacter, it's an option... skip right - 41271 ;over it by doing the whole move again (smaller, of course, this time). - 41272 - 41273 ;mov ax,arg.argvcnt ;total number of arguments - 41274 ; 14/04/2023 - 41275 ;mov ax,[ARG_ARGVCNT] - 41276 000062AE A1[10A2] mov ax,[ARG+ARG_UNIT.argvcnt] - 41277 - 41278 000062B1 48 dec ax ;less one - skip "LoadHigh" - 41279 ;mov bx,SIZE Argv_ele - 41280 000062B2 BB0B00 mov bx,ARGV_ELE.SIZE ; 11 - 41281 ;mov bx,11 - 41282 000062B5 F7E3 mul bx ;dx:ax = size of argument lists - 41283 - 41284 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM - 41285 ; -------------------------------------- - 41286 ; MSDOS 6.0 - 41287 - 41288 ;getdata cl,fm_argc ;CL = number of arguments to skip - 41289 000062B7 1E push ds ; getdata (macro) - 41290 000062B8 8E1E[F59B] mov ds,[RESSEG] - 41291 000062BC 8A0E[3705] mov cl,[fm_argc] - 41292 000062C0 1F pop ds - 41293 - 41294 000062C1 FEC1 inc cl ;Skip one arg, to get over "lh" - 41295 - 41296 ;Move argv[1]..argv[n] to argv[0]..argv[n-1]. Here, AX == the overall size - 41297 ;of the argument lists. + 41262 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41263 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:68E3h + 41264 + 41265 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 41266 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6760h + 41267 SetupPath: + 41268 + 41269 ;Juggle around the argv pointers to make argv[1] into argv[0]. This is + 41270 ;because the path search routine that we are about to invoke expects the + 41271 ;filename to search for to be argv[0]. + 41272 ; + 41273 ;If our new argv[0] starts with a switcharacter, it's an option... skip right + 41274 ;over it by doing the whole move again (smaller, of course, this time). + 41275 + 41276 ;mov ax,arg.argvcnt ;total number of arguments + 41277 ; 14/04/2023 + 41278 ;mov ax,[ARG_ARGVCNT] + 41279 000062AE A1[10A2] mov ax,[ARG+ARG_UNIT.argvcnt] + 41280 + 41281 000062B1 48 dec ax ;less one - skip "LoadHigh" + 41282 ;mov bx,SIZE Argv_ele + 41283 000062B2 BB0B00 mov bx,ARGV_ELE.SIZE ; 11 + 41284 ;mov bx,11 + 41285 000062B5 F7E3 mul bx ;dx:ax = size of argument lists + 41286 + 41287 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM + 41288 ; -------------------------------------- + 41289 ; MSDOS 6.0 + 41290 + 41291 ;getdata cl,fm_argc ;CL = number of arguments to skip + 41292 000062B7 1E push ds ; getdata (macro) + 41293 000062B8 8E1E[F59B] mov ds,[RESSEG] + 41294 000062BC 8A0E[3705] mov cl,[fm_argc] + 41295 000062C0 1F pop ds + 41296 + 41297 000062C1 FEC1 inc cl ;Skip one arg, to get over "lh" 41298 - 41299 argloop: - 41300 000062C3 E31B jcxz argdone ;If we've finished copying args, leave. + 41299 ;Move argv[1]..argv[n] to argv[0]..argv[n-1]. Here, AX == the overall size + 41300 ;of the argument lists. 41301 - 41302 000062C5 49 dec cx ;One less time we'll go through this. - 41303 - 41304 000062C6 50 push ax ;Copy ( size of remaining list ) bytes - 41305 000062C7 51 push cx ;And remember how many args there were + 41302 argloop: + 41303 000062C3 E31B jcxz argdone ;If we've finished copying args, leave. + 41304 + 41305 000062C5 49 dec cx ;One less time we'll go through this. 41306 - 41307 ; -------------------------------------- - 41308 - 41309 ; 14/04/2023 - 41310 000062C8 89C1 mov cx,ax ;size to move + 41307 000062C6 50 push ax ;Copy ( size of remaining list ) bytes + 41308 000062C7 51 push cx ;And remember how many args there were + 41309 + 41310 ; -------------------------------------- 41311 - 41312 ;mov di,offset TRANGROUP:Arg ;Copy TO argv[0] - 41313 ;mov di,ARG_ARGV ;mov di,[ARG+ARG_UNIT.argv] ; mov di,[ARG] - 41314 000062CA BF[509F] mov di,ARG - 41315 000062CD 89FE mov si,di ; - 41316 ;add si,SIZE Argv_ele ;Copy FROM argv[1] - 41317 000062CF 83C60B add si,ARGV_ELE.SIZE ; 11 - 41318 - 41319 ; 14/04/2023 - 41320 ;mov cx,ax - 41321 - 41322 000062D2 FC cld - 41323 000062D3 F3A4 rep movsb ;Move the argument list - 41324 - 41325 ;dec arg.argvcnt ;Fake one less argument, and - 41326 ;dec word [ARG_ARGVCNT] - 41327 000062D5 FF0E[10A2] dec word [ARG+ARG_UNIT.argvcnt] - 41328 - 41329 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM - 41330 ; -------------------------------------- - 41331 ; MSDOS 6.0 - 41332 - 41333 ;sub ax,ARGV_ELE.SIZE ; 11 ;there's one argument we don't copy. - 41334 - 41335 000062D9 59 pop cx - 41336 000062DA 58 pop ax ;Restore the size of the arg list - 41337 ; 17/06/2023 - 41338 ;jmp short argloop - 41339 - 41340 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41341 000062DB 83E80B sub ax,ARGV_ELE.SIZE ; 11 - 41342 000062DE 77E3 ja short argloop - 41343 ; -------------------------------------- - 41344 - 41345 ; Done moving... argv[0] is now the child program's name, and [1] its first arg - 41346 - 41347 ; 17/06/2023 - 41348 argdone: - 41349 000062E0 E8BDD2 call path_search ;look in the path - 41350 - 41351 ;ax = 0, no file found - 41352 ;ax < 4, batch file found -- cant be executed - 41353 ;ax = 4,8 => .com or .exe file found - 41354 - 41355 000062E3 09C0 or ax,ax ;any file found? - 41356 000062E5 740B jz short no_exec_file ;no, error + 41312 ; 14/04/2023 + 41313 000062C8 89C1 mov cx,ax ;size to move + 41314 + 41315 ;mov di,offset TRANGROUP:Arg ;Copy TO argv[0] + 41316 ;mov di,ARG_ARGV ;mov di,[ARG+ARG_UNIT.argv] ; mov di,[ARG] + 41317 000062CA BF[509F] mov di,ARG + 41318 000062CD 89FE mov si,di ; + 41319 ;add si,SIZE Argv_ele ;Copy FROM argv[1] + 41320 000062CF 83C60B add si,ARGV_ELE.SIZE ; 11 + 41321 + 41322 ; 14/04/2023 + 41323 ;mov cx,ax + 41324 + 41325 000062D2 FC cld + 41326 000062D3 F3A4 rep movsb ;Move the argument list + 41327 + 41328 ;dec arg.argvcnt ;Fake one less argument, and + 41329 ;dec word [ARG_ARGVCNT] + 41330 000062D5 FF0E[10A2] dec word [ARG+ARG_UNIT.argvcnt] + 41331 + 41332 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM + 41333 ; -------------------------------------- + 41334 ; MSDOS 6.0 + 41335 + 41336 ;sub ax,ARGV_ELE.SIZE ; 11 ;there's one argument we don't copy. + 41337 + 41338 000062D9 59 pop cx + 41339 000062DA 58 pop ax ;Restore the size of the arg list + 41340 ; 17/06/2023 + 41341 ;jmp short argloop + 41342 + 41343 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41344 000062DB 83E80B sub ax,ARGV_ELE.SIZE ; 11 + 41345 000062DE 77E3 ja short argloop + 41346 ; -------------------------------------- + 41347 + 41348 ; Done moving... argv[0] is now the child program's name, and [1] its first arg + 41349 + 41350 ; 17/06/2023 + 41351 argdone: + 41352 000062E0 E8BDD2 call path_search ;look in the path + 41353 + 41354 ;ax = 0, no file found + 41355 ;ax < 4, batch file found -- cant be executed + 41356 ;ax = 4,8 => .com or .exe file found 41357 - 41358 000062E7 83F804 cmp ax,4 ;executable file? - 41359 ;jl short no_exec_bat ;no, indicate fail ; M016 - 41360 ;clc - 41361 ;retn - 41362 ; 14/04/2023 - 41363 000062EA 7201 jb short no_exec_bat - 41364 000062EC C3 retn - 41365 - 41366 no_exec_bat: - 41367 000062ED BA[C092] mov dx,NoExecBat_Ptr ;Setup message ptr ; M016 - 41368 000062F0 EB06 jmp short lhsp_errret ;return error; M016 - 41369 - 41370 no_exec_file: - 41371 000062F2 B80200 mov ax,ERROR_FILE_NOT_FOUND ; 2 - 41372 000062F5 E8AAFF call LhSetupErrMsg ;setup error message - 41373 lhsp_errret: ; M016 - 41374 000062F8 F9 stc - 41375 000062F9 C3 retn - 41376 - 41377 ;============================================================================ - 41378 ; COMMAND.SKL (MESSAGE.SKL), BUILDMSG.C, MSDOS 6.0, 1991 - 41379 ;============================================================================ - 41380 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41381 - 41382 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5A44h - 41383 - 41384 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41385 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6930h + 41358 000062E3 09C0 or ax,ax ;any file found? + 41359 000062E5 740B jz short no_exec_file ;no, error + 41360 + 41361 000062E7 83F804 cmp ax,4 ;executable file? + 41362 ;jl short no_exec_bat ;no, indicate fail ; M016 + 41363 ;clc + 41364 ;retn + 41365 ; 14/04/2023 + 41366 000062EA 7201 jb short no_exec_bat + 41367 000062EC C3 retn + 41368 + 41369 no_exec_bat: + 41370 000062ED BA[C092] mov dx,NoExecBat_Ptr ;Setup message ptr ; M016 + 41371 000062F0 EB06 jmp short lhsp_errret ;return error; M016 + 41372 + 41373 no_exec_file: + 41374 000062F2 B80200 mov ax,ERROR_FILE_NOT_FOUND ; 2 + 41375 000062F5 E8AAFF call LhSetupErrMsg ;setup error message + 41376 lhsp_errret: ; M016 + 41377 000062F8 F9 stc + 41378 000062F9 C3 retn + 41379 + 41380 ;============================================================================ + 41381 ; COMMAND.SKL (MESSAGE.SKL), BUILDMSG.C, MSDOS 6.0, 1991 + 41382 ;============================================================================ + 41383 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41384 + 41385 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5A44h 41386 - 41387 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM - 41388 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:67ADh + 41387 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41388 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6930h 41389 - 41390 ; --------------------------------------------------------------------------- - 41391 ; Class 3 message table/structure - 41392 ; --------------------------------------------------------------------------- - 41393 - 41394 $M_CLASS_3_STRUC: - 41395 000062FA FF db 0FFh ; $M_CLASS_ID (Class identifer) - 41396 ;dw 5 ; $M_COMMAND_VER (COMMAND.COM version) - 41397 ;db 162 ; Total number of messages - 41398 ; 17/06/2023 - 41399 ;dw 1606h ; MSDOS 6.22 COMMAND.COM (hb=22,lb=6) - 41400 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM - 41401 000062FB 070A dw 0A07h ; PCDOS 7.1 COMMAND.COM - 41402 ;db 187 ; Total number of messages - 41403 ; 02/08/2024 - 41404 000062FD B7 db 183 ; PCDOS 7.1 COMMAND.COM - 41405 $M_ID_3_1: - 41406 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:5A48h) - 41407 000062FE FC03 dw 1020 ; Message Number = 1020 - 41408 ;dw MSG_1020-$+2 ; 288h ; Message offset from message number (5A48h+0288h=5CD0h) - 41409 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41410 00006300 DC02 dw MSG_1020-$+2 ; 2ECh ; Message offset from message number (6934h+02ECh=6C20h) - 41411 ; 732 ; 67B1h+2DCh=6A8Dh ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 41412 $M_ID_3_2: - 41413 00006302 F703 dw 1015 ; Message Number = 1015 - 41414 ;dw MSG_1015-$+2 ; 294h ; Message offset from message number (5A4Ch+0294h=5CE0h) - 41415 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41416 00006304 E802 dw MSG_1015-$+2 ; 2F8h ; Message offset from message number (6938h+02F8h=6C30h) - 41417 ; 744 ; 67B5h+2E8h=6A9Dh ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 41418 $M_ID_3_3: ; 26/04/2023 - 41419 ; 17/06/2023 - 41420 ; 06/08/2024 - 41421 00006306 EC030803 dw 1004,MSG_1004-$ ; 776 - 41422 0000630A 02041E03 dw 1026,MSG_1026-$ ; 798 - 41423 0000630E 07042E03 dw 1031,MSG_1031-$ ; 814 - 41424 00006312 0B043903 dw 1035,MSG_1035-$ ; 825 - 41425 00006316 26044403 dw 1062,MSG_1062-$ ; 836 - 41426 0000631A 04044F03 dw 1028,MSG_1028-$ ; 847 - 41427 0000631E 15046D03 dw 1045,MSG_1045-$ ; 877 - 41428 00006322 11048603 dw 1041,MSG_1041-$ ; 902 - 41429 00006326 1204A403 dw 1042,MSG_1042-$ ; 932 - 41430 $M_ID_3_12: - 41431 0000632A 1304BB03 dw 1043,MSG_1043-$ ; 955 - 41432 0000632E EA03D703 dw 1002,MSG_1002-$ ; 983 - 41433 00006332 EB03FB03 dw 1003,MSG_1003-$ ; 1019 - 41434 00006336 EF031304 dw 1007,MSG_1007-$ ; 1043 - 41435 0000633A F0032A04 dw 1008,MSG_1008-$ ; 1066 - 41436 0000633E F1033C04 dw 1009,MSG_1009-$ ; 1084 - 41437 00006342 F2034D04 dw 1010,MSG_1010-$ ; 1101 - 41438 00006346 F3036904 dw 1011,MSG_1011-$ ; 1129 - 41439 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 41440 %if 1 - 41441 0000634A F4038004 dw 1012,MSG_1012-$ ; 1152 - 41442 %endif - 41443 0000634E F6039904 dw 1014,MSG_1014-$ ; 1177 - 41444 00006352 F803A604 dw 1016,MSG_1016-$ ; 1190 - 41445 00006356 F903CC04 dw 1017,MSG_1017-$ ; 1228 - 41446 0000635A FA03ED04 dw 1018,MSG_1018-$ ; 1261 - 41447 $M_ID_3_24: - 41448 0000635E FB03FD04 dw 1019,MSG_1019-$ ; 1277 - 41449 00006362 FD030505 dw 1021,MSG_1021-$ ; 1285 - 41450 00006366 FE031F05 dw 1022,MSG_1022-$ ; 1311 - 41451 0000636A FF034205 dw 1023,MSG_1023-$ ; 1346 - 41452 0000636E 00046A05 dw 1024,MSG_1024-$ ; 1386 - 41453 00006372 01047D05 dw 1025,MSG_1025-$ ; 1405 - 41454 00006376 03049105 dw 1027,MSG_1027-$ ; 1425 - 41455 0000637A 0504AE05 dw 1029,MSG_1029-$ ; 1454 - 41456 0000637E 0604BC05 dw 1030,MSG_1030-$ ; 1468 - 41457 00006382 0804C705 dw 1032,MSG_1032-$ ; 1479 - 41458 00006386 0904DB05 dw 1033,MSG_1033-$ ; 1499 - 41459 0000638A 0A04ED05 dw 1034,MSG_1034-$ ; 1517 - 41460 0000638E 0C04FF05 dw 1036,MSG_1036-$ ; 1535 - 41461 00006392 0D041006 dw 1037,MSG_1037-$ ; 1552 - 41462 00006396 0E041D06 dw 1038,MSG_1038-$ ; 1565 - 41463 0000639A 0F042C06 dw 1039,MSG_1039-$ ; 1580 - 41464 $M_ID_3_40: - 41465 0000639E 10046506 dw 1040,MSG_1040-$ ; 1637 - 41466 000063A2 14047406 dw 1044,MSG_1044-$ ; 1652 - 41467 000063A6 16048406 dw 1046,MSG_1046-$ ; 1668 - 41468 000063AA 1704B706 dw 1047,MSG_1047-$ ; 1719 - 41469 000063AE 1804CC06 dw 1048,MSG_1048-$ ; 1740 - 41470 000063B2 1904DA06 dw 1049,MSG_1049-$ ; 1754 - 41471 000063B6 1A04E006 dw 1050,MSG_1050-$ ; 1760 - 41472 000063BA 1B04FB06 dw 1051,MSG_1051-$ ; 1787 - 41473 000063BE 1C040807 dw 1052,MSG_1052-$ ; 1800 - 41474 000063C2 1D041B07 dw 1053,MSG_1053-$ ; 1819 - 41475 000063C6 1E043D07 dw 1054,MSG_1054-$ ; 1853 - 41476 $M_ID_3_51: - 41477 000063CA 1F046007 dw 1055,MSG_1055-$ ; 1888 - 41478 000063CE 20046A07 dw 1056,MSG_1056-$ ; 1898 - 41479 000063D2 21047507 dw 1057,MSG_1057-$ ; 1909 - 41480 000063D6 23047E07 dw 1059,MSG_1059-$ ; 1918 - 41481 000063DA 24047F07 dw 1060,MSG_1060-$ ; 1919 - 41482 000063DE 25047F07 dw 1061,MSG_1061-$ ; 1919 - 41483 000063E2 27049507 dw 1063,MSG_1063-$ ; 1941 - 41484 000063E6 28049407 dw 1064,MSG_1064-$ ; 1940 - 41485 000063EA 29049307 dw 1065,MSG_1065-$ ; 1939 - 41486 000063EE 2A049207 dw 1066,MSG_1066-$ ; 1938 - 41487 000063F2 2B049107 dw 1067,MSG_1067-$ ; 1937 - 41488 000063F6 2C048F07 dw 1068,MSG_1068-$ ; 1935 - 41489 000063FA 2D049807 dw 1069,MSG_1069-$ ; 1944 - 41490 000063FE 2E049807 dw 1070,MSG_1070-$ ; 1944 - 41491 00006402 2F049707 dw 1071,MSG_1071-$ ; 1943 - 41492 00006406 30049607 dw 1072,MSG_1072-$ ; 1942 - 41493 $M_ID_3_67: - 41494 0000640A 31049C07 dw 1073,MSG_1073-$ ; 1948 - 41495 0000640E 3204A207 dw 1074,MSG_1074-$ ; 1954 - 41496 00006412 3304A807 dw 1075,MSG_1075-$ ; 1960 - 41497 00006416 3404AA07 dw 1076,MSG_1076-$ ; 1962 - 41498 0000641A 3504A907 dw 1077,MSG_1077-$ ; 1961 - 41499 0000641E 3604AD07 dw 1078,MSG_1078-$ ; 1965 - 41500 00006422 3704C407 dw 1079,MSG_1079-$ ; 1988 - 41501 00006426 3804CB07 dw 1080,MSG_1080-$ ; 1995 - 41502 0000642A 3904DD07 dw 1081,MSG_1081-$ ; 2013 - 41503 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41504 0000642E 3A040408 dw 1082,MSG_1082-$ ; 2052 - 41505 00006432 3B040C08 dw 1083,MSG_1083-$ ; 2060 - 41506 ; - 41507 00006436 3C040B08 dw 1084,MSG_1084-$ ; 2059 - 41508 0000643A 42041708 dw 1090,MSG_1090-$ ; 2071 - 41509 0000643E 43042108 dw 1091,MSG_1091-$ ; 2081 - 41510 00006442 44042B08 dw 1092,MSG_1092-$ ; 2091 - 41511 00006446 45043508 dw 1093,MSG_1093-$ ; 2101 - 41512 0000644A 46044608 dw 1094,MSG_1094-$ ; 2118 - 41513 0000644E 47045F08 dw 1095,MSG_1095-$ ; 2143 - 41514 00006452 48047808 dw 1096,MSG_1096-$ ; 2168 - 41515 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41516 00006456 4904A508 dw 1097,MSG_1097-$ ; 2213 - 41517 0000645A 4A04BE08 dw 1098,MSG_1098-$ ; 2238 - 41518 0000645E 4B04D708 dw 1099,MSG_1099-$ ; 2263 - 41519 00006462 4C04E908 dw 1100,MSG_1100-$ ; 2281 - 41520 - 41521 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM - 41522 %if 0 - 41523 dw 1101,MSG_1101-$ ; 2302 - 41524 dw 1102,MSG_1102-$ ; 2313 - 41525 %endif - 41526 00006466 4F040B09 dw 1103,MSG_1103-$ ; 2315 - 41527 0000646A 50042209 dw 1104,MSG_1104-$ ; 2338 - 41528 - 41529 ; TRANGROUP:6AA8h ; MSDOS 6.22 - 41530 ; TRANGROUP:6921h ; PCDOS 7.1 + 41390 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM + 41391 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:67ADh + 41392 + 41393 ; --------------------------------------------------------------------------- + 41394 ; Class 3 message table/structure + 41395 ; --------------------------------------------------------------------------- + 41396 + 41397 $M_CLASS_3_STRUC: + 41398 000062FA FF db 0FFh ; $M_CLASS_ID (Class identifer) + 41399 ;dw 5 ; $M_COMMAND_VER (COMMAND.COM version) + 41400 ;db 162 ; Total number of messages + 41401 ; 17/06/2023 + 41402 ;dw 1606h ; MSDOS 6.22 COMMAND.COM (hb=22,lb=6) + 41403 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM + 41404 000062FB 070A dw 0A07h ; PCDOS 7.1 COMMAND.COM + 41405 ;db 187 ; Total number of messages + 41406 ; 02/08/2024 + 41407 000062FD B7 db 183 ; PCDOS 7.1 COMMAND.COM + 41408 $M_ID_3_1: + 41409 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:5A48h) + 41410 000062FE FC03 dw 1020 ; Message Number = 1020 + 41411 ;dw MSG_1020-$+2 ; 288h ; Message offset from message number (5A48h+0288h=5CD0h) + 41412 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41413 00006300 DC02 dw MSG_1020-$+2 ; 2ECh ; Message offset from message number (6934h+02ECh=6C20h) + 41414 ; 732 ; 67B1h+2DCh=6A8Dh ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 41415 $M_ID_3_2: + 41416 00006302 F703 dw 1015 ; Message Number = 1015 + 41417 ;dw MSG_1015-$+2 ; 294h ; Message offset from message number (5A4Ch+0294h=5CE0h) + 41418 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41419 00006304 E802 dw MSG_1015-$+2 ; 2F8h ; Message offset from message number (6938h+02F8h=6C30h) + 41420 ; 744 ; 67B5h+2E8h=6A9Dh ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 41421 $M_ID_3_3: ; 26/04/2023 + 41422 ; 17/06/2023 + 41423 ; 06/08/2024 + 41424 00006306 EC030803 dw 1004,MSG_1004-$ ; 776 + 41425 0000630A 02041E03 dw 1026,MSG_1026-$ ; 798 + 41426 0000630E 07042E03 dw 1031,MSG_1031-$ ; 814 + 41427 00006312 0B043903 dw 1035,MSG_1035-$ ; 825 + 41428 00006316 26044403 dw 1062,MSG_1062-$ ; 836 + 41429 0000631A 04044F03 dw 1028,MSG_1028-$ ; 847 + 41430 0000631E 15046D03 dw 1045,MSG_1045-$ ; 877 + 41431 00006322 11048603 dw 1041,MSG_1041-$ ; 902 + 41432 00006326 1204A403 dw 1042,MSG_1042-$ ; 932 + 41433 $M_ID_3_12: + 41434 0000632A 1304BB03 dw 1043,MSG_1043-$ ; 955 + 41435 0000632E EA03D703 dw 1002,MSG_1002-$ ; 983 + 41436 00006332 EB03FB03 dw 1003,MSG_1003-$ ; 1019 + 41437 00006336 EF031304 dw 1007,MSG_1007-$ ; 1043 + 41438 0000633A F0032A04 dw 1008,MSG_1008-$ ; 1066 + 41439 0000633E F1033C04 dw 1009,MSG_1009-$ ; 1084 + 41440 00006342 F2034D04 dw 1010,MSG_1010-$ ; 1101 + 41441 00006346 F3036904 dw 1011,MSG_1011-$ ; 1129 + 41442 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 41443 %if 1 + 41444 0000634A F4038004 dw 1012,MSG_1012-$ ; 1152 + 41445 %endif + 41446 0000634E F6039904 dw 1014,MSG_1014-$ ; 1177 + 41447 00006352 F803A604 dw 1016,MSG_1016-$ ; 1190 + 41448 00006356 F903CC04 dw 1017,MSG_1017-$ ; 1228 + 41449 0000635A FA03ED04 dw 1018,MSG_1018-$ ; 1261 + 41450 $M_ID_3_24: + 41451 0000635E FB03FD04 dw 1019,MSG_1019-$ ; 1277 + 41452 00006362 FD030505 dw 1021,MSG_1021-$ ; 1285 + 41453 00006366 FE031F05 dw 1022,MSG_1022-$ ; 1311 + 41454 0000636A FF034205 dw 1023,MSG_1023-$ ; 1346 + 41455 0000636E 00046A05 dw 1024,MSG_1024-$ ; 1386 + 41456 00006372 01047D05 dw 1025,MSG_1025-$ ; 1405 + 41457 00006376 03049105 dw 1027,MSG_1027-$ ; 1425 + 41458 0000637A 0504AE05 dw 1029,MSG_1029-$ ; 1454 + 41459 0000637E 0604BC05 dw 1030,MSG_1030-$ ; 1468 + 41460 00006382 0804C705 dw 1032,MSG_1032-$ ; 1479 + 41461 00006386 0904DB05 dw 1033,MSG_1033-$ ; 1499 + 41462 0000638A 0A04ED05 dw 1034,MSG_1034-$ ; 1517 + 41463 0000638E 0C04FF05 dw 1036,MSG_1036-$ ; 1535 + 41464 00006392 0D041006 dw 1037,MSG_1037-$ ; 1552 + 41465 00006396 0E041D06 dw 1038,MSG_1038-$ ; 1565 + 41466 0000639A 0F042C06 dw 1039,MSG_1039-$ ; 1580 + 41467 $M_ID_3_40: + 41468 0000639E 10046506 dw 1040,MSG_1040-$ ; 1637 + 41469 000063A2 14047406 dw 1044,MSG_1044-$ ; 1652 + 41470 000063A6 16048406 dw 1046,MSG_1046-$ ; 1668 + 41471 000063AA 1704B706 dw 1047,MSG_1047-$ ; 1719 + 41472 000063AE 1804CC06 dw 1048,MSG_1048-$ ; 1740 + 41473 000063B2 1904DA06 dw 1049,MSG_1049-$ ; 1754 + 41474 000063B6 1A04E006 dw 1050,MSG_1050-$ ; 1760 + 41475 000063BA 1B04FB06 dw 1051,MSG_1051-$ ; 1787 + 41476 000063BE 1C040807 dw 1052,MSG_1052-$ ; 1800 + 41477 000063C2 1D041B07 dw 1053,MSG_1053-$ ; 1819 + 41478 000063C6 1E043D07 dw 1054,MSG_1054-$ ; 1853 + 41479 $M_ID_3_51: + 41480 000063CA 1F046007 dw 1055,MSG_1055-$ ; 1888 + 41481 000063CE 20046A07 dw 1056,MSG_1056-$ ; 1898 + 41482 000063D2 21047507 dw 1057,MSG_1057-$ ; 1909 + 41483 000063D6 23047E07 dw 1059,MSG_1059-$ ; 1918 + 41484 000063DA 24047F07 dw 1060,MSG_1060-$ ; 1919 + 41485 000063DE 25047F07 dw 1061,MSG_1061-$ ; 1919 + 41486 000063E2 27049507 dw 1063,MSG_1063-$ ; 1941 + 41487 000063E6 28049407 dw 1064,MSG_1064-$ ; 1940 + 41488 000063EA 29049307 dw 1065,MSG_1065-$ ; 1939 + 41489 000063EE 2A049207 dw 1066,MSG_1066-$ ; 1938 + 41490 000063F2 2B049107 dw 1067,MSG_1067-$ ; 1937 + 41491 000063F6 2C048F07 dw 1068,MSG_1068-$ ; 1935 + 41492 000063FA 2D049807 dw 1069,MSG_1069-$ ; 1944 + 41493 000063FE 2E049807 dw 1070,MSG_1070-$ ; 1944 + 41494 00006402 2F049707 dw 1071,MSG_1071-$ ; 1943 + 41495 00006406 30049607 dw 1072,MSG_1072-$ ; 1942 + 41496 $M_ID_3_67: + 41497 0000640A 31049C07 dw 1073,MSG_1073-$ ; 1948 + 41498 0000640E 3204A207 dw 1074,MSG_1074-$ ; 1954 + 41499 00006412 3304A807 dw 1075,MSG_1075-$ ; 1960 + 41500 00006416 3404AA07 dw 1076,MSG_1076-$ ; 1962 + 41501 0000641A 3504A907 dw 1077,MSG_1077-$ ; 1961 + 41502 0000641E 3604AD07 dw 1078,MSG_1078-$ ; 1965 + 41503 00006422 3704C407 dw 1079,MSG_1079-$ ; 1988 + 41504 00006426 3804CB07 dw 1080,MSG_1080-$ ; 1995 + 41505 0000642A 3904DD07 dw 1081,MSG_1081-$ ; 2013 + 41506 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41507 0000642E 3A040408 dw 1082,MSG_1082-$ ; 2052 + 41508 00006432 3B040C08 dw 1083,MSG_1083-$ ; 2060 + 41509 ; + 41510 00006436 3C040B08 dw 1084,MSG_1084-$ ; 2059 + 41511 0000643A 42041708 dw 1090,MSG_1090-$ ; 2071 + 41512 0000643E 43042108 dw 1091,MSG_1091-$ ; 2081 + 41513 00006442 44042B08 dw 1092,MSG_1092-$ ; 2091 + 41514 00006446 45043508 dw 1093,MSG_1093-$ ; 2101 + 41515 0000644A 46044608 dw 1094,MSG_1094-$ ; 2118 + 41516 0000644E 47045F08 dw 1095,MSG_1095-$ ; 2143 + 41517 00006452 48047808 dw 1096,MSG_1096-$ ; 2168 + 41518 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41519 00006456 4904A508 dw 1097,MSG_1097-$ ; 2213 + 41520 0000645A 4A04BE08 dw 1098,MSG_1098-$ ; 2238 + 41521 0000645E 4B04D708 dw 1099,MSG_1099-$ ; 2263 + 41522 00006462 4C04E908 dw 1100,MSG_1100-$ ; 2281 + 41523 + 41524 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM + 41525 %if 0 + 41526 dw 1101,MSG_1101-$ ; 2302 + 41527 dw 1102,MSG_1102-$ ; 2313 + 41528 %endif + 41529 00006466 4F040B09 dw 1103,MSG_1103-$ ; 2315 + 41530 0000646A 50042209 dw 1104,MSG_1104-$ ; 2338 41531 - 41532 0000646E 51042209 dw 1105,MSG_1105-$ ; 2338 ; TRANGROUP:7243h ; PCDOS 7.1 - 41533 - 41534 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM - 41535 %if 1 - 41536 00006472 52042909 dw 1106,MSG_1106-$ ; 2345 - 41537 %endif - 41538 - 41539 ;$M_ID_3_84: - 41540 $M_ID_3_95: ; 17/06/2023 - 41541 00006476 B0043709 dw 1200,MSG_1200-$ ; 2359 - 41542 0000647A 14053409 dw 1300,MSG_1300-$ ; 2356 - 41543 0000647E 2805B709 dw 1320,MSG_1320-$ ; 2487 - 41544 00006482 2905F309 dw 1321,MSG_1321-$ ; 2547 - 41545 00006486 3C05600A dw 1340,MSG_1340-$ ; 2656 - 41546 0000648A 3D05B80A dw 1341,MSG_1341-$ ; 2744 - 41547 0000648E 3E05170B dw 1342,MSG_1342-$ ; 2839 - 41548 00006492 5005A50B dw 1360,MSG_1360-$ ; 2981 - 41549 00006496 7805BD0B dw 1400,MSG_1400-$ ; 3005 - 41550 0000649A 7905560C dw 1401,MSG_1401-$ ; 3158 - 41551 0000649E 7A05BB0C dw 1402,MSG_1402-$ ; 3259 - 41552 000064A2 7B052E0D dw 1403,MSG_1403-$ ; 3374 - 41553 000064A6 7C056A0D dw 1404,MSG_1404-$ ; 3434 ; TRANGROUP:6ADCh ; MSDOS 6.22 - 41554 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41555 000064AA 7D05DB0D dw 1405,MSG_1405-$ ; 3547 ; TRANGROUP:6AE0h ; MSDOS 6.22 - 41556 ; 06/08/2024 ; TRANGROUP:695Dh ; PCDOS 7.1 - 41557 000064AE 7E054A0E dw 1406,MSG_1406-$ ; 3658 - 41558 000064B2 7F05890E dw 1407,MSG_1407-$ ; 3721 ; (MSG_1404 for MSDOS 5.0 COMMAND.COM) - 41559 ; - 41560 000064B6 8C050D0F dw 1420,MSG_1420-$ ; 3853 - 41561 000064BA A005940F dw 1440,MSG_1440-$ ; 3988 - 41562 000064BE A105B70F dw 1441,MSG_1441-$ ; 4023 - 41563 ;$M_ID_3_100: - 41564 $M_ID_3_114: ; 17/06/2023 - 41565 000064C2 B4053710 dw 1460,MSG_1460-$ ; 4151 - 41566 000064C6 B5059810 dw 1461,MSG_1461-$ ; 4248 - 41567 000064CA B6051811 dw 1462,MSG_1462-$ ; 4376 - 41568 000064CE C8056411 dw 1480,MSG_1480-$ ; 4452 - 41569 000064D2 C9050012 dw 1481,MSG_1481-$ ; 4608 - 41570 000064D6 CA054A12 dw 1482,MSG_1482-$ ; 4682 - 41571 000064DA CB05A212 dw 1483,MSG_1483-$ ; 4770 - 41572 000064DE CC051D13 dw 1484,MSG_1484-$ ; 4893 - 41573 000064E2 CD059613 dw 1485,MSG_1485-$ ; 5014 - 41574 000064E6 CE052814 dw 1486,MSG_1486-$ ; 5160 - 41575 000064EA CF05B414 dw 1487,MSG_1487-$ ; 5300 - 41576 000064EE D0050F15 dw 1488,MSG_1488-$ ; 5391 - 41577 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41578 000064F2 D1059E15 dw 1489,MSG_1489-$ ; 5534 - 41579 - 41580 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM - 41581 %if 0 - 41582 dw 1490,MSG_1490-$ ; 5505 - 41583 dw 1491,MSG_1491-$ ; 5529 - 41584 dw 1492,MSG_1492-$ ; 5608 - 41585 dw 1493,MSG_1493-$ ; 5751 - 41586 dw 1494,MSG_1494-$ ; 5770 - 41587 %endif - 41588 - 41589 ;$M_ID_3_112: - 41590 $M_ID_3_132: ; 17/06/2023 - 41591 000064F6 DC05EB15 dw 1500,MSG_1500-$ ; 5611 - 41592 000064FA F0052616 dw 1520,MSG_1520-$ ; 5670 - 41593 000064FE 04066016 dw 1540,MSG_1540-$ ; 5728 - 41594 00006502 0506BA16 dw 1541,MSG_1541-$ ; 5818 - 41595 00006506 06062217 dw 1542,MSG_1542-$ ; 5922 - 41596 0000650A 18065A17 dw 1560,MSG_1560-$ ; 5978 - 41597 0000650E 19068E17 dw 1561,MSG_1561-$ ; 6030 - 41598 00006512 1A060718 dw 1562,MSG_1562-$ ; 6151 - 41599 00006516 1B063318 dw 1563,MSG_1563-$ ; 6195 - 41600 0000651A 1C065A18 dw 1564,MSG_1564-$ ; 6234 - 41601 0000651E 1D069418 dw 1565,MSG_1565-$ ; 6292 - 41602 00006522 1E06C518 dw 1566,MSG_1566-$ ; 6341 - 41603 00006526 1F06EE18 dw 1567,MSG_1567-$ ; 6382 - 41604 0000652A 20066419 dw 1568,MSG_1568-$ ; 6500 - 41605 0000652E 2C06AD19 dw 1580,MSG_1580-$ ; 6573 - 41606 ;$M_ID_3_127: - 41607 $M_ID_3_147: ; 17/06/2023 - 41608 00006532 4006F119 dw 1600,MSG_1600-$ ; 6641 - 41609 00006536 41060A1A dw 1601,MSG_1601-$ ; 6666 - 41610 0000653A 42065A1A dw 1602,MSG_1602-$ ; 6746 - 41611 0000653E 5406F71A dw 1620,MSG_1620-$ ; 6903 - 41612 00006542 55064B1B dw 1621,MSG_1621-$ ; 6987 - 41613 00006546 5606C91B dw 1622,MSG_1622-$ ; 7113 - 41614 0000654A 6806111C dw 1640,MSG_1640-$ ; 7185 - 41615 0000654E 6906421C dw 1641,MSG_1641-$ ; 7234 - 41616 00006552 7C06C21C dw 1660,MSG_1660-$ ; 7362 - 41617 00006556 9006051D dw 1680,MSG_1680-$ ; 7429 - 41618 0000655A A406271D dw 1700,MSG_1700-$ ; 7463 - 41619 0000655E B806D51D dw 1720,MSG_1720-$ ; 7637 - 41620 00006562 CC06241E dw 1740,MSG_1740-$ ; 7716 - 41621 00006566 CD067C1E dw 1741,MSG_1741-$ ; 7804 - 41622 0000656A E006EB1E dw 1760,MSG_1760-$ ; 7915 - 41623 0000656E F406341F dw 1780,MSG_1780-$ ; 7988 - 41624 ;$M_ID_3_143: - 41625 $M_ID_3_163: ; 17/06/2023 - 41626 00006572 08079C1F dw 1800,MSG_1800-$ ; 8092 - 41627 00006576 0907E61F dw 1801,MSG_1801-$ ; 8166 - 41628 0000657A 1C073A20 dw 1820,MSG_1820-$ ; 8250 - 41629 0000657E 1D077E20 dw 1821,MSG_1821-$ ; 8318 - 41630 00006582 30070521 dw 1840,MSG_1840-$ ; 8453 - 41631 00006586 44074C21 dw 1860,MSG_1860-$ ; 8524 - 41632 0000658A 4507A321 dw 1861,MSG_1861-$ ; 8611 - 41633 0000658E 4607E621 dw 1862,MSG_1862-$ ; 8678 - 41634 00006592 47076022 dw 1863,MSG_1863-$ ; 8800 - 41635 00006596 4807FF22 dw 1864,MSG_1864-$ ; 9959 - 41636 0000659A 49076223 dw 1865,MSG_1865-$ ; 9058 - 41637 0000659E 4A07C923 dw 1866,MSG_1866-$ ; 9161 - 41638 000065A2 58072D24 dw 1880,MSG_1880-$ ; 9261 - 41639 000065A6 5907A124 dw 1881,MSG_1881-$ ; 9377 - 41640 000065AA 5A071B25 dw 1882,MSG_1882-$ ; 9499 - 41641 000065AE 5B076E25 dw 1883,MSG_1883-$ ; 9582 - 41642 000065B2 6C070D26 dw 1900,MSG_1900-$ ; 9741 - 41643 000065B6 80075226 dw 1920,MSG_1920-$ ; 9810 - 41644 000065BA 81077E26 dw 1921,MSG_1921-$ ; 9854 - 41645 ;$M_ID_3_162: - 41646 $M_ID_3_182: ; 17/06/2023 - 41647 000065BE 82071327 dw 1922,MSG_1922-$ ; 10003 - 41648 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 41649 000065C2 8307C627 dw 1923,MSG_1923-$ ; 10182 - 41650 000065C6 84074828 dw 1924,MSG_1924-$ ; 10312 - 41651 000065CA 8507C028 dw 1925,MSG_1925-$ ; 10432 - 41652 000065CE 8607BF28 dw 1926,MSG_1926-$ ; 10431 - 41653 $M_ID_3_187: ; 17/06/2023 - 41654 000065D2 8707 dw 1927 ; 19/06/2023 ; Message Number = 1927 - 41655 000065D4 1329 dw MSG_1927-$+2 ; 10515 ; Message offset from message number - 41656 ; MSDOS 6.22 ; (Msg addr: 6C1Ch+2A1Eh = TRANGROUP:963Ah) - 41657 ; 06/08/2024 ; PCDOS 7.1 ; (Msg addr: 6A85h+2913h = TRANGROUP:9398h) - 41658 - 41659 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM - 41660 %if 1 - 41661 $M_ID_3_183: - 41662 000065D6 53046A29 dw 1107,MSG_1107-$ ; 10602 * - 41663 ; (Msg addr: 6A89h+296Ah = TRANGROUP:96F3h) - 41664 %endif - 41665 - 41666 ; --------------------------------------------------------------------------- - 41667 ; Class 3 messages - 41668 ; --------------------------------------------------------------------------- - 41669 - 41670 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 41671 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5CD0h - 41672 - 41673 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41674 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6C20h + 41532 ; TRANGROUP:6AA8h ; MSDOS 6.22 + 41533 ; TRANGROUP:6921h ; PCDOS 7.1 + 41534 + 41535 0000646E 51042209 dw 1105,MSG_1105-$ ; 2338 ; TRANGROUP:7243h ; PCDOS 7.1 + 41536 + 41537 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM + 41538 %if 1 + 41539 00006472 52042909 dw 1106,MSG_1106-$ ; 2345 + 41540 %endif + 41541 + 41542 ;$M_ID_3_84: + 41543 $M_ID_3_95: ; 17/06/2023 + 41544 00006476 B0043709 dw 1200,MSG_1200-$ ; 2359 + 41545 0000647A 14053409 dw 1300,MSG_1300-$ ; 2356 + 41546 0000647E 2805B709 dw 1320,MSG_1320-$ ; 2487 + 41547 00006482 2905F309 dw 1321,MSG_1321-$ ; 2547 + 41548 00006486 3C05600A dw 1340,MSG_1340-$ ; 2656 + 41549 0000648A 3D05B80A dw 1341,MSG_1341-$ ; 2744 + 41550 0000648E 3E05170B dw 1342,MSG_1342-$ ; 2839 + 41551 00006492 5005A50B dw 1360,MSG_1360-$ ; 2981 + 41552 00006496 7805BD0B dw 1400,MSG_1400-$ ; 3005 + 41553 0000649A 7905560C dw 1401,MSG_1401-$ ; 3158 + 41554 0000649E 7A05BB0C dw 1402,MSG_1402-$ ; 3259 + 41555 000064A2 7B052E0D dw 1403,MSG_1403-$ ; 3374 + 41556 000064A6 7C056A0D dw 1404,MSG_1404-$ ; 3434 ; TRANGROUP:6ADCh ; MSDOS 6.22 + 41557 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41558 000064AA 7D05DB0D dw 1405,MSG_1405-$ ; 3547 ; TRANGROUP:6AE0h ; MSDOS 6.22 + 41559 ; 06/08/2024 ; TRANGROUP:695Dh ; PCDOS 7.1 + 41560 000064AE 7E054A0E dw 1406,MSG_1406-$ ; 3658 + 41561 000064B2 7F05890E dw 1407,MSG_1407-$ ; 3721 ; (MSG_1404 for MSDOS 5.0 COMMAND.COM) + 41562 ; + 41563 000064B6 8C050D0F dw 1420,MSG_1420-$ ; 3853 + 41564 000064BA A005940F dw 1440,MSG_1440-$ ; 3988 + 41565 000064BE A105B70F dw 1441,MSG_1441-$ ; 4023 + 41566 ;$M_ID_3_100: + 41567 $M_ID_3_114: ; 17/06/2023 + 41568 000064C2 B4053710 dw 1460,MSG_1460-$ ; 4151 + 41569 000064C6 B5059810 dw 1461,MSG_1461-$ ; 4248 + 41570 000064CA B6051811 dw 1462,MSG_1462-$ ; 4376 + 41571 000064CE C8056411 dw 1480,MSG_1480-$ ; 4452 + 41572 000064D2 C9050012 dw 1481,MSG_1481-$ ; 4608 + 41573 000064D6 CA054A12 dw 1482,MSG_1482-$ ; 4682 + 41574 000064DA CB05A212 dw 1483,MSG_1483-$ ; 4770 + 41575 000064DE CC051D13 dw 1484,MSG_1484-$ ; 4893 + 41576 000064E2 CD059613 dw 1485,MSG_1485-$ ; 5014 + 41577 000064E6 CE052814 dw 1486,MSG_1486-$ ; 5160 + 41578 000064EA CF05B414 dw 1487,MSG_1487-$ ; 5300 + 41579 000064EE D0050F15 dw 1488,MSG_1488-$ ; 5391 + 41580 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41581 000064F2 D1059E15 dw 1489,MSG_1489-$ ; 5534 + 41582 + 41583 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM + 41584 %if 0 + 41585 dw 1490,MSG_1490-$ ; 5505 + 41586 dw 1491,MSG_1491-$ ; 5529 + 41587 dw 1492,MSG_1492-$ ; 5608 + 41588 dw 1493,MSG_1493-$ ; 5751 + 41589 dw 1494,MSG_1494-$ ; 5770 + 41590 %endif + 41591 + 41592 ;$M_ID_3_112: + 41593 $M_ID_3_132: ; 17/06/2023 + 41594 000064F6 DC05EB15 dw 1500,MSG_1500-$ ; 5611 + 41595 000064FA F0052616 dw 1520,MSG_1520-$ ; 5670 + 41596 000064FE 04066016 dw 1540,MSG_1540-$ ; 5728 + 41597 00006502 0506BA16 dw 1541,MSG_1541-$ ; 5818 + 41598 00006506 06062217 dw 1542,MSG_1542-$ ; 5922 + 41599 0000650A 18065A17 dw 1560,MSG_1560-$ ; 5978 + 41600 0000650E 19068E17 dw 1561,MSG_1561-$ ; 6030 + 41601 00006512 1A060718 dw 1562,MSG_1562-$ ; 6151 + 41602 00006516 1B063318 dw 1563,MSG_1563-$ ; 6195 + 41603 0000651A 1C065A18 dw 1564,MSG_1564-$ ; 6234 + 41604 0000651E 1D069418 dw 1565,MSG_1565-$ ; 6292 + 41605 00006522 1E06C518 dw 1566,MSG_1566-$ ; 6341 + 41606 00006526 1F06EE18 dw 1567,MSG_1567-$ ; 6382 + 41607 0000652A 20066419 dw 1568,MSG_1568-$ ; 6500 + 41608 0000652E 2C06AD19 dw 1580,MSG_1580-$ ; 6573 + 41609 ;$M_ID_3_127: + 41610 $M_ID_3_147: ; 17/06/2023 + 41611 00006532 4006F119 dw 1600,MSG_1600-$ ; 6641 + 41612 00006536 41060A1A dw 1601,MSG_1601-$ ; 6666 + 41613 0000653A 42065A1A dw 1602,MSG_1602-$ ; 6746 + 41614 0000653E 5406F71A dw 1620,MSG_1620-$ ; 6903 + 41615 00006542 55064B1B dw 1621,MSG_1621-$ ; 6987 + 41616 00006546 5606C91B dw 1622,MSG_1622-$ ; 7113 + 41617 0000654A 6806111C dw 1640,MSG_1640-$ ; 7185 + 41618 0000654E 6906421C dw 1641,MSG_1641-$ ; 7234 + 41619 00006552 7C06C21C dw 1660,MSG_1660-$ ; 7362 + 41620 00006556 9006051D dw 1680,MSG_1680-$ ; 7429 + 41621 0000655A A406271D dw 1700,MSG_1700-$ ; 7463 + 41622 0000655E B806D51D dw 1720,MSG_1720-$ ; 7637 + 41623 00006562 CC06241E dw 1740,MSG_1740-$ ; 7716 + 41624 00006566 CD067C1E dw 1741,MSG_1741-$ ; 7804 + 41625 0000656A E006EB1E dw 1760,MSG_1760-$ ; 7915 + 41626 0000656E F406341F dw 1780,MSG_1780-$ ; 7988 + 41627 ;$M_ID_3_143: + 41628 $M_ID_3_163: ; 17/06/2023 + 41629 00006572 08079C1F dw 1800,MSG_1800-$ ; 8092 + 41630 00006576 0907E61F dw 1801,MSG_1801-$ ; 8166 + 41631 0000657A 1C073A20 dw 1820,MSG_1820-$ ; 8250 + 41632 0000657E 1D077E20 dw 1821,MSG_1821-$ ; 8318 + 41633 00006582 30070521 dw 1840,MSG_1840-$ ; 8453 + 41634 00006586 44074C21 dw 1860,MSG_1860-$ ; 8524 + 41635 0000658A 4507A321 dw 1861,MSG_1861-$ ; 8611 + 41636 0000658E 4607E621 dw 1862,MSG_1862-$ ; 8678 + 41637 00006592 47076022 dw 1863,MSG_1863-$ ; 8800 + 41638 00006596 4807FF22 dw 1864,MSG_1864-$ ; 9959 + 41639 0000659A 49076223 dw 1865,MSG_1865-$ ; 9058 + 41640 0000659E 4A07C923 dw 1866,MSG_1866-$ ; 9161 + 41641 000065A2 58072D24 dw 1880,MSG_1880-$ ; 9261 + 41642 000065A6 5907A124 dw 1881,MSG_1881-$ ; 9377 + 41643 000065AA 5A071B25 dw 1882,MSG_1882-$ ; 9499 + 41644 000065AE 5B076E25 dw 1883,MSG_1883-$ ; 9582 + 41645 000065B2 6C070D26 dw 1900,MSG_1900-$ ; 9741 + 41646 000065B6 80075226 dw 1920,MSG_1920-$ ; 9810 + 41647 000065BA 81077E26 dw 1921,MSG_1921-$ ; 9854 + 41648 ;$M_ID_3_162: + 41649 $M_ID_3_182: ; 17/06/2023 + 41650 000065BE 82071327 dw 1922,MSG_1922-$ ; 10003 + 41651 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 41652 000065C2 8307C627 dw 1923,MSG_1923-$ ; 10182 + 41653 000065C6 84074828 dw 1924,MSG_1924-$ ; 10312 + 41654 000065CA 8507C028 dw 1925,MSG_1925-$ ; 10432 + 41655 000065CE 8607BF28 dw 1926,MSG_1926-$ ; 10431 + 41656 $M_ID_3_187: ; 17/06/2023 + 41657 000065D2 8707 dw 1927 ; 19/06/2023 ; Message Number = 1927 + 41658 000065D4 1329 dw MSG_1927-$+2 ; 10515 ; Message offset from message number + 41659 ; MSDOS 6.22 ; (Msg addr: 6C1Ch+2A1Eh = TRANGROUP:963Ah) + 41660 ; 06/08/2024 ; PCDOS 7.1 ; (Msg addr: 6A85h+2913h = TRANGROUP:9398h) + 41661 + 41662 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM + 41663 %if 1 + 41664 $M_ID_3_183: + 41665 000065D6 53046A29 dw 1107,MSG_1107-$ ; 10602 * + 41666 ; (Msg addr: 6A89h+296Ah = TRANGROUP:96F3h) + 41667 %endif + 41668 + 41669 ; --------------------------------------------------------------------------- + 41670 ; Class 3 messages + 41671 ; --------------------------------------------------------------------------- + 41672 + 41673 ; 14/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 41674 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:5CD0h 41675 - 41676 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM - 41677 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6A8Dh + 41676 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41677 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:6C20h 41678 - 41679 MSG_1020: ; COMMON4 - 41680 000065DA 0F db 15 ; (MSG_1015-MSG_1020)-1 - 41681 000065DB 253120627974657320- db '%1 bytes free',0Dh,0Ah - 41681 000065E4 667265650D0A - 41682 MSG_1015: ; COMMON18 - 41683 000065EA 23 db 35 - 41684 000065EB 46696C652063616E6E- db 'File cannot be copied onto itself',0Dh,0Ah - 41684 000065F4 6F7420626520636F70- - 41684 000065FD 696564206F6E746F20- - 41684 00006606 697473656C660D0A - 41685 MSG_1004: ; COMMON20 - 41686 0000660E 19 db 25 - 41687 0000660F 496E73756666696369- db 'Insufficient disk space',0Dh,0Ah - 41687 00006618 656E74206469736B20- - 41687 00006621 73706163650D0A - 41688 MSG_1026: ; COMMON22 - 41689 00006628 13 db 19 - 41690 00006629 496E76616C69642063- db 'Invalid code page',0Dh,0Ah - 41690 00006632 6F646520706167650D- - 41690 0000663B 0A - 41691 MSG_1031: ; COMMON23 - 41692 0000663C 0E db 14 - 41693 0000663D 496E76616C69642064- db 'Invalid date',0Dh,0Ah - 41693 00006646 6174650D0A - 41694 MSG_1035: ; COMMON24 - 41695 0000664B 0E db 14 - 41696 0000664C 496E76616C69642074- db 'Invalid time',0Dh,0Ah - 41696 00006655 696D650D0A - 41697 MSG_1062: ; COMMON25 - 41698 0000665A 0E db 14 - 41699 0000665B 496E76616C69642070- db 'Invalid path',0Dh,0Ah - 41699 00006664 6174680D0A - 41700 MSG_1028: ; COMMON28 - 41701 00006669 21 db 33 - 41702 0000666A 507265737320616E79- db 'Press any key to continue . . .',0Dh,0Ah - 41702 00006673 206B657920746F2063- - 41702 0000667C 6F6E74696E7565202E- - 41702 00006685 202E202E0D0A - 41703 MSG_1045: ; COMMON32 - 41704 0000668B 1C db 28 - 41705 0000668C 556E61626C6520746F- db 'Unable to create directory',0Dh,0Ah - 41705 00006695 206372656174652064- - 41705 0000669E 69726563746F72790D- - 41705 000066A7 0A - 41706 MSG_1041: ; COMMON33 - 41707 000066A8 21 db 33 - 41708 000066A9 566F6C756D6520696E- db 'Volume in drive %1 has no label',0Dh,0Ah - 41708 000066B2 206472697665202531- - 41708 000066BB 20686173206E6F206C- - 41708 000066C4 6162656C0D0A - 41709 MSG_1042: ; COMMON34 - 41710 000066CA 1A db 26 - 41711 000066CB 566F6C756D6520696E- db 'Volume in drive %1 is %2',0Dh,0Ah - 41711 000066D4 206472697665202531- - 41711 000066DD 2069732025320D0A - 41712 MSG_1043: ; COMMON36 - 41713 000066E5 1F db 31 ; (MSG_1002-MSG_1043)-1 - 41714 000066E6 566F6C756D65205365- db 'Volume Serial Number is %1-%2',0Dh,0Ah - 41714 000066EF 7269616C204E756D62- - 41714 000066F8 65722069732025312D- - 41714 00006701 25320D0A - 41715 MSG_1002: - 41716 00006705 27 db 39 - 41717 00006706 4475706C6963617465- db 'Duplicate file name or file not found',0Dh,0Ah - 41717 0000670F 2066696C65206E616D- - 41717 00006718 65206F722066696C65- - 41717 00006721 206E6F7420666F756E- - 41717 0000672A 640D0A - 41718 MSG_1003: - 41719 0000672D 1B db 27 - 41720 0000672E 496E76616C69642070- db 'Invalid path or file name',0Dh,0Ah - 41720 00006737 617468206F72206669- - 41720 00006740 6C65206E616D650D0A - 41721 MSG_1007: - 41722 00006749 1A db 26 - 41723 0000674A 4F7574206F6620656E- db 'Out of environment space',0Dh,0Ah - 41723 00006753 7669726F6E6D656E74- - 41723 0000675C 2073706163650D0A - 41724 MSG_1008: - 41725 00006764 15 db 21 - 41726 00006765 46696C652063726561- db 'File creation error',0Dh,0Ah - 41726 0000676E 74696F6E206572726F- - 41726 00006777 720D0A - 41727 MSG_1009: - 41728 0000677A 14 db 20 ; (MSG_1010-MSG_1009)-1 - 41729 0000677B 42617463682066696C- db 'Batch file missing',0Dh,0Ah - 41729 00006784 65206D697373696E67- - 41729 0000678D 0D0A - 41730 MSG_1010: - 41731 0000678F 1F db 31 - 41732 00006790 0D0A db 0Dh,0Ah - 41733 00006792 496E73657274206469- db 'Insert disk with batch file',0Dh,0Ah - 41733 0000679B 736B20776974682062- - 41733 000067A4 617463682066696C65- - 41733 000067AD 0D0A - 41734 MSG_1011: - 41735 000067AF 1A db 26 - 41736 000067B0 42616420636F6D6D61- db 'Bad command or file name',0Dh,0Ah - 41736 000067B9 6E64206F722066696C- - 41736 000067C2 65206E616D650D0A - 41737 - 41738 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 41739 %if 1 - 41740 MSG_1012: - 41741 000067CA 1C db 28 - 41742 000067CB 5245585820696E7465- db 'REXX interpreter not found',0Dh,0Ah - 41742 000067D4 72707265746572206E- - 41742 000067DD 6F7420666F756E640D- - 41742 000067E6 0A - 41743 %endif - 41744 - 41745 MSG_1014: ; EXTEND5 - 41746 000067E7 10 db 16 - 41747 000067E8 416363657373206465- db 'Access denied ',0Dh,0Ah - 41747 000067F1 6E696564200D0A - 41748 MSG_1016: - 41749 000067F8 29 db 41 - 41750 000067F9 436F6E74656E74206F- db 'Content of destination lost before copy',0Dh,0Ah - 41750 00006802 662064657374696E61- - 41750 0000680B 74696F6E206C6F7374- - 41750 00006814 206265666F72652063- - 41750 0000681D 6F70790D0A - 41751 MSG_1017: - 41752 00006822 24 db 36 - 41753 00006823 496E76616C69642066- db 'Invalid filename or file not found',0Dh,0Ah - 41753 0000682C 696C656E616D65206F- - 41753 00006835 722066696C65206E6F- - 41753 0000683E 7420666F756E640D0A - 41754 MSG_1018: - 41755 00006847 13 db 19 - 41756 00006848 25312066696C652873- db '%1 file(s) copied',0Dh,0Ah - 41756 00006851 2920636F706965640D- - 41756 0000685A 0A - 41757 MSG_1019: - 41758 0000685B 0B db 11 - 41759 0000685C 25312066696C652873- db '%1 file(s) ' - 41759 00006865 2920 - 41760 MSG_1021: ; EXTEND15 - 41761 00006867 1D db 29 - 41762 00006868 496E76616C69642064- db 'Invalid drive specification',0Dh,0Ah - 41762 00006871 726976652073706563- - 41762 0000687A 696669636174696F6E- - 41762 00006883 0D0A - 41763 MSG_1022: - 41764 00006885 26 db 38 - 41765 00006886 436F64652070616765- db 'Code page %1 not prepared for system',0Dh,0Ah - 41765 0000688F 202531206E6F742070- - 41765 00006898 726570617265642066- - 41765 000068A1 6F722073797374656D- - 41765 000068AA 0D0A - 41766 MSG_1023: - 41767 000068AC 2B db 43 - 41768 000068AD 436F64652070616765- db 'Code page %1 not prepared for all devices',0Dh,0Ah - 41768 000068B6 202531206E6F742070- - 41768 000068BF 726570617265642066- - 41768 000068C8 6F7220616C6C206465- - 41768 000068D1 76696365730D0A - 41769 MSG_1024: - 41770 000068D8 16 db 22 - 41771 000068D9 41637469766520636F- db 'Active code page: %1',0Dh,0Ah - 41771 000068E2 646520706167653A20- - 41771 000068EB 25310D0A - 41772 MSG_1025: - 41773 000068EF 17 db 23 - 41774 000068F0 4E4C5346554E43206E- db 'NLSFUNC not installed',0Dh,0Ah - 41774 000068F9 6F7420696E7374616C- - 41774 00006902 6C65640D0A - 41775 MSG_1027: - 41776 00006907 20 db 32 - 41777 00006908 43757272656E742064- db 'Current drive is no longer valid' - 41777 00006911 72697665206973206E- - 41777 0000691A 6F206C6F6E67657220- - 41777 00006923 76616C6964 - 41778 MSG_1029: - 41779 00006928 11 db 17 - 41780 00006929 4C6162656C206E6F74- db 'Label not found',0Dh,0Ah - 41780 00006932 20666F756E640D0A - 41781 MSG_1030: - 41782 0000693A 0E db 14 - 41783 0000693B 53796E746178206572- db 'Syntax error',0Dh,0Ah - 41783 00006944 726F720D0A - 41784 MSG_1032: - 41785 00006949 17 db 23 - 41786 0000694A 43757272656E742064- db 'Current date is %1 %2',0Dh,0Ah - 41786 00006953 617465206973202531- - 41786 0000695C 2025320D0A - 41787 MSG_1033: - 41788 00006961 15 db 21 - 41789 00006962 53756E4D6F6E547565- db 'SunMonTueWedThuFriSat' - 41789 0000696B 576564546875467269- - 41789 00006974 536174 - 41790 MSG_1034: - 41791 00006977 15 db 21 - 41792 00006978 456E746572206E6577- db 'Enter new date (%1): ' - 41792 00006981 206461746520282531- - 41792 0000698A 293A20 - 41793 MSG_1036: - 41794 0000698D 14 db 20 - 41795 0000698E 43757272656E742074- db 'Current time is %1',0Dh,0Ah - 41795 00006997 696D65206973202531- - 41795 000069A0 0D0A - 41796 MSG_1037: - 41797 000069A2 10 db 16 - 41798 000069A3 456E746572206E6577- db 'Enter new time: ' - 41798 000069AC 2074696D653A20 - 41799 MSG_1038: - 41800 000069B3 12 db 18 - 41801 000069B4 2C2020202044656C65- db ', Delete (Y/N)?' - 41801 000069BD 74652028592F4E293F - 41802 MSG_1039: - 41803 000069C6 3C db 60 - 41804 000069C7 416C6C2066696C6573- db 'All files in directory will be deleted!',0Dh,0Ah - 41804 000069D0 20696E206469726563- - 41804 000069D9 746F72792077696C6C- - 41804 000069E2 2062652064656C6574- - 41804 000069EB 6564210D0A - 41805 000069F0 41726520796F752073- db 'Are you sure (Y/N)?' - 41805 000069F9 7572652028592F4E29- - 41805 00006A02 3F - 41806 - 41807 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 41808 %if 0 - 41809 MSG_1040: - 41810 db 20 - 41811 db 'MS-DOS Version %1.%2' - 41812 %else - 41813 MSG_1040: - 41814 00006A03 12 db 18 - 41815 00006A04 504320444F53205665- db 'PC DOS Version 7.1' - 41815 00006A0D 7273696F6E20372E31 - 41816 %endif - 41817 - 41818 MSG_1044: - 41819 00006A16 13 db 19 - 41820 00006A17 496E76616C69642064- db 'Invalid directory',0Dh,0Ah - 41820 00006A20 69726563746F72790D- - 41820 00006A29 0A - 41821 MSG_1046: - 41822 00006A2A 36 db 54 - 41823 00006A2B 496E76616C69642070- db 'Invalid path, not directory,',0Dh,0Ah - 41823 00006A34 6174682C206E6F7420- - 41823 00006A3D 6469726563746F7279- - 41823 00006A46 2C0D0A - 41824 00006A49 6F7220646972656374- db 'or directory not empty',0Dh,0Ah - 41824 00006A52 6F7279206E6F742065- - 41824 00006A5B 6D7074790D0A - 41825 MSG_1047: - 41826 00006A61 18 db 24 - 41827 00006A62 4D7573742073706563- db 'Must specify ON or OFF',0Dh,0Ah - 41827 00006A6B 696679204F4E206F72- - 41827 00006A74 204F46460D0A - 41828 MSG_1048: - 41829 00006A7A 11 db 17 - 41830 00006A7B 4469726563746F7279- db 'Directory of %1',0Dh,0Ah - 41830 00006A84 206F662025310D0A - 41831 MSG_1049: - 41832 00006A8C 09 db 9 - 41833 00006A8D 4E6F20506174680D0A db 'No Path',0Dh,0Ah - 41834 MSG_1050: - 41835 00006A96 1E db 30 - 41836 00006A97 496E76616C69642064- db 'Invalid drive in search path',0Dh,0Ah - 41836 00006AA0 7269766520696E2073- - 41836 00006AA9 656172636820706174- - 41836 00006AB2 680D0A - 41837 MSG_1051: - 41838 00006AB5 10 db 16 - 41839 00006AB6 496E76616C69642064- db 'Invalid device',0Dh,0Ah - 41839 00006ABF 65766963650D0A - 41840 MSG_1052: - 41841 00006AC6 16 db 22 - 41842 00006AC7 464F522063616E6E6F- db 'FOR cannot be nested',0Dh,0Ah - 41842 00006AD0 74206265206E657374- - 41842 00006AD9 65640D0A - 41843 MSG_1053: - 41844 00006ADD 25 db 37 - 41845 00006ADE 496E7465726D656469- db 'Intermediate file error during pipe',0Dh,0Ah - 41845 00006AE7 6174652066696C6520- - 41845 00006AF0 6572726F7220647572- - 41845 00006AF9 696E6720706970650D- - 41845 00006B02 0A - 41846 MSG_1054: - 41847 00006B03 26 db 38 - 41848 00006B04 43616E6E6F7420646F- db 'Cannot do binary reads from a device',0Dh,0Ah - 41848 00006B0D 2062696E6172792072- - 41848 00006B16 656164732066726F6D- - 41848 00006B1F 206120646576696365- - 41848 00006B28 0D0A - 41849 - 41850 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:6205h) - 41851 ; 17/06/2023 - 41852 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7155h) - 41853 ; 06/08/2024 - 41854 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:6FDDh) - 41855 MSG_1055: - 41856 00006B2A 0D db 13 - 41857 00006B2B 425245414B20697320- db 'BREAK is %1',0Dh,0Ah - 41857 00006B34 25310D0A - 41858 MSG_1056: - 41859 00006B38 0E db 14 - 41860 00006B39 564552494659206973- db 'VERIFY is %1',0Dh,0Ah - 41860 00006B42 2025310D0A - 41861 MSG_1057: - 41862 00006B47 0C db 12 - 41863 00006B48 4543484F2069732025- db 'ECHO is %1',0Dh,0Ah - 41863 00006B51 310D0A - 41864 MSG_1059: - 41865 00006B54 04 db 4 - 41866 00006B55 6F666600 db 'off',0 - 41867 MSG_1060: - 41868 00006B59 03 db 3 - 41869 00006B5A 6F6E00 db 'on',0 - 41870 MSG_1061: - 41871 00006B5D 19 db 25 - 41872 00006B5E 4572726F7220777269- db 'Error writing to device',0Dh,0Ah - 41872 00006B67 74696E6720746F2064- - 41872 00006B70 65766963650D0A - 41873 MSG_1063: - 41874 00006B77 02 db 2 - 41875 00006B78 2531 db '%1' - 41876 MSG_1064: - 41877 00006B7A 02 db 2 - 41878 00006B7B 2531 db '%1' - 41879 MSG_1065: - 41880 00006B7D 02 db 2 - 41881 00006B7E 2531 db '%1' - 41882 MSG_1066: - 41883 00006B80 02 db 2 - 41884 00006B81 2531 db '%1' - 41885 MSG_1067: - 41886 00006B83 01 db 1 - 41887 00006B84 09 db 9 - 41888 MSG_1068: - 41889 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 41890 %if 0 - 41891 db 10 - 41892 db ' ' - 41893 %else - 41894 00006B85 0C db 12 - 41895 00006B86 203C4449523E202020- db ' ' - 41895 00006B8F 202020 - 41896 %endif - 41897 MSG_1069: - 41898 00006B92 03 db 3 - 41899 00006B93 082008 db 8, 20h, 8 - 41900 MSG_1070: ; CRLF - 41901 00006B96 02 db 2 - 41902 00006B97 0D db 0Dh - 41903 00006B98 0A db 0Ah - 41904 MSG_1071: - 41905 00006B99 02 db 2 - 41906 00006B9A 2531 db '%1' - 41907 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM - 41908 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:71C5h - 41909 MSG_1072: - 41910 ;db 8 - 41911 ;db 'mm-dd-yy' - 41912 00006B9C 09 db 9 - 41913 00006B9D 6D6D2D64642D797900 db 'mm-dd-yy',0 - 41914 MSG_1073: - 41915 ;db 8 - 41916 ;db 'dd-mm-yy' - 41917 00006BA6 09 db 9 - 41918 00006BA7 64642D6D6D2D797900 db 'dd-mm-yy',0 - 41919 MSG_1074: - 41920 ;db 8 - 41921 ;db 'yy-mm-dd' - 41922 00006BB0 09 db 9 - 41923 00006BB1 79792D6D6D2D646400 db 'yy-mm-dd',0 - 41924 MSG_1075: - 41925 00006BBA 05 db 5 - 41926 00006BBB 2531202532 db '%1 %2' - 41927 MSG_1076: - 41928 00006BC0 02 db 2 - 41929 00006BC1 2531 db '%1' - 41930 MSG_1077: - 41931 00006BC3 07 db 7 - 41932 00006BC4 20253120202532 db ' %1 %2' - 41933 MSG_1078: - 41934 00006BCB 1A db 26 - 41935 00006BCC 4469726563746F7279- db 'Directory already exists',0Dh,0Ah - 41935 00006BD5 20616C726561647920- - 41935 00006BDE 6578697374730D0A - 41936 MSG_1079: - 41937 00006BE6 0A db 10 - 41938 00006BE7 25312062797465730D- db '%1 bytes',0Dh,0Ah - 41938 00006BF0 0A - 41939 MSG_1080: - 41940 00006BF1 15 db 21 - 41941 00006BF2 546F74616C2066696C- db 'Total files listed:',0Dh,0Ah - 41941 00006BFB 6573206C6973746564- - 41941 00006C04 3A0D0A - 41942 MSG_1081: - 41943 00006C07 2A db 42 - 41944 00006C08 284572726F72206F63- db '(Error occurred in environment variable)',0Dh,0Ah - 41944 00006C11 63757272656420696E- - 41944 00006C1A 20656E7669726F6E6D- - 41944 00006C23 656E74207661726961- - 41944 00006C2C 626C65290D0A - 41945 ; - 41946 ; 06/08/2024 -Retro DOS 5.0 COMMAND.COM - 41947 %if 0 - 41948 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM - 41949 MSG_1082: - 41950 db 7 - 41951 db ' [Y/N]?' - 41952 %else - 41953 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 41954 MSG_1082: - 41955 00006C32 0B db 11 - 41956 00006C33 205B592C4E2C455343- db ' [Y,N,ESC]?' - 41956 00006C3C 5D3F - 41957 %endif - 41958 ; - 41959 MSG_1083: - 41960 00006C3E 02 db 2 - 41961 00006C3F 594E db 'YN' - 41962 ; - 41963 MSG_1084: - 41964 00006C41 0F db 15 - 41965 00006C42 28636F6E74696E7569- db '(continuing %1)' - 41965 00006C4B 6E6720253129 - 41966 MSG_1090: - 41967 00006C51 0D db 13 - 41968 00006C52 5265766973696F6E20- db 'Revision %1',0Dh,0Ah - 41968 00006C5B 25310D0A - 41969 MSG_1091: - 41970 00006C5F 0D db 13 - 41971 00006C60 444F5320697320696E- db 'DOS is in ROM' - 41971 00006C69 20524F4D - 41972 MSG_1092: - 41973 00006C6D 0D db 13 - 41974 00006C6E 444F5320697320696E- db 'DOS is in HMA' - 41974 00006C77 20484D41 - 41975 MSG_1093: - 41976 00006C7B 14 db 20 - 41977 00006C7C 444F5320697320696E- db 'DOS is in low memory' - 41977 00006C85 206C6F77206D656D6F- - 41977 00006C8E 7279 - 41978 MSG_1094: - 41979 00006C90 1C db 28 - 41980 00006C91 43616E6E6F74204C6F- db 'Cannot Loadhigh batch file',0Dh,0Ah - 41980 00006C9A 616468696768206261- - 41980 00006CA3 7463682066696C650D- - 41980 00006CAC 0A - 41981 MSG_1095: - 41982 00006CAD 1C db 28 - 41983 00006CAE 4C6F6164486967683A- db 'LoadHigh: Invalid filename',0Dh,0Ah - 41983 00006CB7 20496E76616C696420- - 41983 00006CC0 66696C656E616D650D- - 41983 00006CC9 0A - 41984 MSG_1096: - 41985 00006CCA 30 db 48 - 41986 00006CCB 43616E6E6F74206F70- db 'Cannot open specified country information file',0Dh,0Ah - 41986 00006CD4 656E20737065636966- - 41986 00006CDD 69656420636F756E74- - 41986 00006CE6 727920696E666F726D- - 41986 00006CEF 6174696F6E2066696C- - 41986 00006CF8 650D0A - 41987 - 41988 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 41989 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:7320h - 41990 MSG_1097: - 41991 00006CFB 1C db 28 - 41992 00006CFC 4C6F6164486967683A- db 'LoadHigh: Invalid argument',0Dh,0Ah - 41992 00006D05 20496E76616C696420- - 41992 00006D0E 617267756D656E740D- - 41992 00006D17 0A - 41993 MSG_1098: - 41994 00006D18 1C db 28 - 41995 00006D19 526571756972656420- db 'Required parameter missing',0Dh,0Ah - 41995 00006D22 706172616D65746572- - 41995 00006D2B 206D697373696E670D- - 41995 00006D34 0A - 41996 MSG_1099: - 41997 00006D35 15 db 21 - 41998 00006D36 556E7265636F676E69- db 'Unrecognized switch',0Dh,0Ah - 41998 00006D3F 7A6564207377697463- - 41998 00006D48 680D0A - 41999 MSG_1100: - 42000 00006D4B 25 db 37 - 42001 00006D4C 412062616420554D42- db 'A bad UMB number has been specified',0Dh,0Ah - 42001 00006D55 206E756D6265722068- - 42001 00006D5E 6173206265656E2073- - 42001 00006D67 70656369666965640D- - 42001 00006D70 0A - 42002 - 42003 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM - 42004 %if 0 - 42005 MSG_1101: - 42006 db 14 - 42007 db ' %1.%2 to 1.0' - 42008 MSG_1102: - 42009 db 57 - 42010 db ' %1.%2 to 1.0 average compression ratio',0Dh,0Ah - 42011 %endif - 42012 - 42013 MSG_1103: - 42014 00006D71 1A db 26 - 42015 00006D72 4F7665727772697465- db 'Overwrite %1 (Yes/No/All)?' - 42015 00006D7B 20253120285965732F- - 42015 00006D84 4E6F2F416C6C293F - 42016 MSG_1104: - 42017 00006D8C 03 db 3 - 42018 00006D8D 59 _Y_es: db 'Y' - 42019 00006D8E 4E _N_o: db 'N' - 42020 00006D8F 41 _A_ll: db 'A' - 42021 - 42022 ; 02/08/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 42023 %if 0 - 42024 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:73FEh) - 42025 MSG_1105: - 42026 db 4 - 42027 db ' ' - 42028 %else - 42029 ; 03/08/2024 - 42030 MSG_1105: - 42031 00006D90 0A db 10 - 42032 00006D91 203C4449523E202020- db ' ' - 42032 00006D9A 20 - 42033 - 42034 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:724Eh) - 42035 MSG_1106: - 42036 00006D9B 11 db 17 - 42037 00006D9C 2531204B2062797465- db '%1 K bytes free',0Dh,0Ah - 42037 00006DA5 7320667265650D0A - 42038 %endif - 42039 - 42040 ; ((MSDOS 5.0 COMMAND.COM - TRANGROUP:63C2h)) - 42041 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7403h) - 42042 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:7260h - 42043 MSG_1200: - 42044 00006DAD 00 db 0 ; /? unimplemented - 42045 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7404h) - 42046 MSG_1300: - 42047 00006DAE 86 db 134 - 42048 00006DAF 53657473206F722063- db 'Sets or clears extended CTRL+C checking.',0Dh,0Ah - 42048 00006DB8 6C6561727320657874- - 42048 00006DC1 656E64656420435452- - 42048 00006DCA 4C2B4320636865636B- - 42048 00006DD3 696E672E0D0A - 42049 00006DD9 0D0A db 0Dh,0Ah - 42050 00006DDB 425245414B205B4F4E- db 'BREAK [ON | OFF]',0Dh,0Ah - 42050 00006DE4 207C204F46465D0D0A - 42051 00006DED 0D0A db 0Dh,0Ah - 42052 00006DEF 547970652042524541- db 'Type BREAK without a parameter to display the current BREAK setting.',0Dh,0Ah - 42052 00006DF8 4B20776974686F7574- - 42052 00006E01 206120706172616D65- - 42052 00006E0A 74657220746F206469- - 42052 00006E13 73706C617920746865- - 42052 00006E1C 2063757272656E7420- - 42052 00006E25 425245414B20736574- - 42052 00006E2E 74696E672E0D0A - 42053 MSG_1320: - 42054 00006E35 3F db 63 - 42055 00006E36 446973706C61797320- db 'Displays or sets the active code page number.',0Dh,0Ah - 42055 00006E3F 6F7220736574732074- - 42055 00006E48 686520616374697665- - 42055 00006E51 20636F646520706167- - 42055 00006E5A 65206E756D6265722E- - 42055 00006E63 0D0A - 42056 00006E65 0D0A db 0Dh,0Ah - 42057 00006E67 43484350205B6E6E6E- db 'CHCP [nnn]',0Dh,0Ah - 42057 00006E70 5D0D0A - 42058 00006E73 0D0A db 0Dh,0Ah - 42059 MSG_1321: - 42060 00006E75 70 db 112 - 42061 00006E76 20206E6E6E20202053- db ' nnn Specifies a code page number.',0Dh,0Ah - 42061 00006E7F 706563696669657320- - 42061 00006E88 6120636F6465207061- - 42061 00006E91 6765206E756D626572- - 42061 00006E9A 2E0D0A - 42062 00006E9D 0D0A db 0Dh,0Ah - 42063 00006E9F 547970652043484350- db 'Type CHCP without a parameter to display the active code page number.',0Dh,0Ah - 42063 00006EA8 20776974686F757420- - 42063 00006EB1 6120706172616D6574- - 42063 00006EBA 657220746F20646973- - 42063 00006EC3 706C61792074686520- - 42063 00006ECC 61637469766520636F- - 42063 00006ED5 64652070616765206E- - 42063 00006EDE 756D6265722E0D0A - 42064 MSG_1340: - 42065 00006EE6 5B db 91 - 42066 00006EE7 446973706C61797320- db 'Displays the name of or changes the current directory.',0Dh,0Ah - 42066 00006EF0 746865206E616D6520- - 42066 00006EF9 6F66206F7220636861- - 42066 00006F02 6E6765732074686520- - 42066 00006F0B 63757272656E742064- - 42066 00006F14 69726563746F72792E- - 42066 00006F1D 0D0A - 42067 00006F1F 0D0A db 0Dh,0Ah - 42068 00006F21 4348444952205B6472- db 'CHDIR [drive:][path]',0Dh,0Ah - 42068 00006F2A 6976653A5D5B706174- - 42068 00006F33 685D0D0A - 42069 00006F37 43484449525B2E2E5D- db 'CHDIR[..]',0Dh,0Ah - 42069 00006F40 0D0A - 42070 MSG_1341: - 42071 00006F42 62 db 98 - 42072 00006F43 4344205B6472697665- db 'CD [drive:][path]',0Dh,0Ah - 42072 00006F4C 3A5D5B706174685D0D- - 42072 00006F55 0A - 42073 00006F56 43445B2E2E5D0D0A db 'CD[..]',0Dh,0Ah - 42074 00006F5E 0D0A db 0Dh,0Ah - 42075 00006F60 20202E2E2020205370- db ' .. Specifies that you want to change to the parent directory.' - 42075 00006F69 656369666965732074- - 42075 00006F72 68617420796F752077- - 42075 00006F7B 616E7420746F206368- - 42075 00006F84 616E676520746F2074- - 42075 00006F8D 686520706172656E74- - 42075 00006F96 206469726563746F72- - 42075 00006F9F 792E - 42076 00006FA1 0D0A db 0Dh,0Ah - 42077 00006FA3 0D0A db 0Dh,0Ah - 42078 MSG_1342: - 42079 00006FA5 91 db 145 - 42080 00006FA6 547970652043442064- db 'Type CD drive: to display the current directory in the specified ' - 42080 00006FAF 726976653A20746F20- - 42080 00006FB8 646973706C61792074- - 42080 00006FC1 68652063757272656E- - 42080 00006FCA 74206469726563746F- - 42080 00006FD3 727920696E20746865- - 42080 00006FDC 207370656369666965- - 42080 00006FE5 6420 - 42081 00006FE7 64726976652E0D0A db 'drive.',0Dh,0Ah - 42082 00006FEF 547970652043442077- db 'Type CD without parameters to display the current drive and directory.',0Dh,0Ah - 42082 00006FF8 6974686F7574207061- - 42082 00007001 72616D657465727320- - 42082 0000700A 746F20646973706C61- - 42082 00007013 792074686520637572- - 42082 0000701C 72656E742064726976- - 42082 00007025 6520616E6420646972- - 42082 0000702E 6563746F72792E0D0A - 42083 MSG_1360: - 42084 00007037 1B db 27 - 42085 00007038 436C65617273207468- db 'Clears the screen.',0Dh,0Ah - 42085 00007041 652073637265656E2E- - 42085 0000704A 0D0A - 42086 0000704C 0D0A db 0Dh,0Ah - 42087 0000704E 434C530D0A db 'CLS',0Dh,0Ah - 42088 MSG_1400: - 42089 ;db 145 - 42090 ;db 'Copies one or more files to another location.',0Dh,0Ah - 42091 ;db 0Dh,0Ah - 42092 ;db 'COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination',0Dh,0Ah - 42093 ;db ' [/A | /B]] [/V]',0Dh,0Ah + 41679 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM + 41680 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:6A8Dh + 41681 + 41682 MSG_1020: ; COMMON4 + 41683 000065DA 0F db 15 ; (MSG_1015-MSG_1020)-1 + 41684 000065DB 253120627974657320- db '%1 bytes free',0Dh,0Ah + 41684 000065E4 667265650D0A + 41685 MSG_1015: ; COMMON18 + 41686 000065EA 23 db 35 + 41687 000065EB 46696C652063616E6E- db 'File cannot be copied onto itself',0Dh,0Ah + 41687 000065F4 6F7420626520636F70- + 41687 000065FD 696564206F6E746F20- + 41687 00006606 697473656C660D0A + 41688 MSG_1004: ; COMMON20 + 41689 0000660E 19 db 25 + 41690 0000660F 496E73756666696369- db 'Insufficient disk space',0Dh,0Ah + 41690 00006618 656E74206469736B20- + 41690 00006621 73706163650D0A + 41691 MSG_1026: ; COMMON22 + 41692 00006628 13 db 19 + 41693 00006629 496E76616C69642063- db 'Invalid code page',0Dh,0Ah + 41693 00006632 6F646520706167650D- + 41693 0000663B 0A + 41694 MSG_1031: ; COMMON23 + 41695 0000663C 0E db 14 + 41696 0000663D 496E76616C69642064- db 'Invalid date',0Dh,0Ah + 41696 00006646 6174650D0A + 41697 MSG_1035: ; COMMON24 + 41698 0000664B 0E db 14 + 41699 0000664C 496E76616C69642074- db 'Invalid time',0Dh,0Ah + 41699 00006655 696D650D0A + 41700 MSG_1062: ; COMMON25 + 41701 0000665A 0E db 14 + 41702 0000665B 496E76616C69642070- db 'Invalid path',0Dh,0Ah + 41702 00006664 6174680D0A + 41703 MSG_1028: ; COMMON28 + 41704 00006669 21 db 33 + 41705 0000666A 507265737320616E79- db 'Press any key to continue . . .',0Dh,0Ah + 41705 00006673 206B657920746F2063- + 41705 0000667C 6F6E74696E7565202E- + 41705 00006685 202E202E0D0A + 41706 MSG_1045: ; COMMON32 + 41707 0000668B 1C db 28 + 41708 0000668C 556E61626C6520746F- db 'Unable to create directory',0Dh,0Ah + 41708 00006695 206372656174652064- + 41708 0000669E 69726563746F72790D- + 41708 000066A7 0A + 41709 MSG_1041: ; COMMON33 + 41710 000066A8 21 db 33 + 41711 000066A9 566F6C756D6520696E- db 'Volume in drive %1 has no label',0Dh,0Ah + 41711 000066B2 206472697665202531- + 41711 000066BB 20686173206E6F206C- + 41711 000066C4 6162656C0D0A + 41712 MSG_1042: ; COMMON34 + 41713 000066CA 1A db 26 + 41714 000066CB 566F6C756D6520696E- db 'Volume in drive %1 is %2',0Dh,0Ah + 41714 000066D4 206472697665202531- + 41714 000066DD 2069732025320D0A + 41715 MSG_1043: ; COMMON36 + 41716 000066E5 1F db 31 ; (MSG_1002-MSG_1043)-1 + 41717 000066E6 566F6C756D65205365- db 'Volume Serial Number is %1-%2',0Dh,0Ah + 41717 000066EF 7269616C204E756D62- + 41717 000066F8 65722069732025312D- + 41717 00006701 25320D0A + 41718 MSG_1002: + 41719 00006705 27 db 39 + 41720 00006706 4475706C6963617465- db 'Duplicate file name or file not found',0Dh,0Ah + 41720 0000670F 2066696C65206E616D- + 41720 00006718 65206F722066696C65- + 41720 00006721 206E6F7420666F756E- + 41720 0000672A 640D0A + 41721 MSG_1003: + 41722 0000672D 1B db 27 + 41723 0000672E 496E76616C69642070- db 'Invalid path or file name',0Dh,0Ah + 41723 00006737 617468206F72206669- + 41723 00006740 6C65206E616D650D0A + 41724 MSG_1007: + 41725 00006749 1A db 26 + 41726 0000674A 4F7574206F6620656E- db 'Out of environment space',0Dh,0Ah + 41726 00006753 7669726F6E6D656E74- + 41726 0000675C 2073706163650D0A + 41727 MSG_1008: + 41728 00006764 15 db 21 + 41729 00006765 46696C652063726561- db 'File creation error',0Dh,0Ah + 41729 0000676E 74696F6E206572726F- + 41729 00006777 720D0A + 41730 MSG_1009: + 41731 0000677A 14 db 20 ; (MSG_1010-MSG_1009)-1 + 41732 0000677B 42617463682066696C- db 'Batch file missing',0Dh,0Ah + 41732 00006784 65206D697373696E67- + 41732 0000678D 0D0A + 41733 MSG_1010: + 41734 0000678F 1F db 31 + 41735 00006790 0D0A db 0Dh,0Ah + 41736 00006792 496E73657274206469- db 'Insert disk with batch file',0Dh,0Ah + 41736 0000679B 736B20776974682062- + 41736 000067A4 617463682066696C65- + 41736 000067AD 0D0A + 41737 MSG_1011: + 41738 000067AF 1A db 26 + 41739 000067B0 42616420636F6D6D61- db 'Bad command or file name',0Dh,0Ah + 41739 000067B9 6E64206F722066696C- + 41739 000067C2 65206E616D650D0A + 41740 + 41741 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 41742 %if 1 + 41743 MSG_1012: + 41744 000067CA 1C db 28 + 41745 000067CB 5245585820696E7465- db 'REXX interpreter not found',0Dh,0Ah + 41745 000067D4 72707265746572206E- + 41745 000067DD 6F7420666F756E640D- + 41745 000067E6 0A + 41746 %endif + 41747 + 41748 MSG_1014: ; EXTEND5 + 41749 000067E7 10 db 16 + 41750 000067E8 416363657373206465- db 'Access denied ',0Dh,0Ah + 41750 000067F1 6E696564200D0A + 41751 MSG_1016: + 41752 000067F8 29 db 41 + 41753 000067F9 436F6E74656E74206F- db 'Content of destination lost before copy',0Dh,0Ah + 41753 00006802 662064657374696E61- + 41753 0000680B 74696F6E206C6F7374- + 41753 00006814 206265666F72652063- + 41753 0000681D 6F70790D0A + 41754 MSG_1017: + 41755 00006822 24 db 36 + 41756 00006823 496E76616C69642066- db 'Invalid filename or file not found',0Dh,0Ah + 41756 0000682C 696C656E616D65206F- + 41756 00006835 722066696C65206E6F- + 41756 0000683E 7420666F756E640D0A + 41757 MSG_1018: + 41758 00006847 13 db 19 + 41759 00006848 25312066696C652873- db '%1 file(s) copied',0Dh,0Ah + 41759 00006851 2920636F706965640D- + 41759 0000685A 0A + 41760 MSG_1019: + 41761 0000685B 0B db 11 + 41762 0000685C 25312066696C652873- db '%1 file(s) ' + 41762 00006865 2920 + 41763 MSG_1021: ; EXTEND15 + 41764 00006867 1D db 29 + 41765 00006868 496E76616C69642064- db 'Invalid drive specification',0Dh,0Ah + 41765 00006871 726976652073706563- + 41765 0000687A 696669636174696F6E- + 41765 00006883 0D0A + 41766 MSG_1022: + 41767 00006885 26 db 38 + 41768 00006886 436F64652070616765- db 'Code page %1 not prepared for system',0Dh,0Ah + 41768 0000688F 202531206E6F742070- + 41768 00006898 726570617265642066- + 41768 000068A1 6F722073797374656D- + 41768 000068AA 0D0A + 41769 MSG_1023: + 41770 000068AC 2B db 43 + 41771 000068AD 436F64652070616765- db 'Code page %1 not prepared for all devices',0Dh,0Ah + 41771 000068B6 202531206E6F742070- + 41771 000068BF 726570617265642066- + 41771 000068C8 6F7220616C6C206465- + 41771 000068D1 76696365730D0A + 41772 MSG_1024: + 41773 000068D8 16 db 22 + 41774 000068D9 41637469766520636F- db 'Active code page: %1',0Dh,0Ah + 41774 000068E2 646520706167653A20- + 41774 000068EB 25310D0A + 41775 MSG_1025: + 41776 000068EF 17 db 23 + 41777 000068F0 4E4C5346554E43206E- db 'NLSFUNC not installed',0Dh,0Ah + 41777 000068F9 6F7420696E7374616C- + 41777 00006902 6C65640D0A + 41778 MSG_1027: + 41779 00006907 20 db 32 + 41780 00006908 43757272656E742064- db 'Current drive is no longer valid' + 41780 00006911 72697665206973206E- + 41780 0000691A 6F206C6F6E67657220- + 41780 00006923 76616C6964 + 41781 MSG_1029: + 41782 00006928 11 db 17 + 41783 00006929 4C6162656C206E6F74- db 'Label not found',0Dh,0Ah + 41783 00006932 20666F756E640D0A + 41784 MSG_1030: + 41785 0000693A 0E db 14 + 41786 0000693B 53796E746178206572- db 'Syntax error',0Dh,0Ah + 41786 00006944 726F720D0A + 41787 MSG_1032: + 41788 00006949 17 db 23 + 41789 0000694A 43757272656E742064- db 'Current date is %1 %2',0Dh,0Ah + 41789 00006953 617465206973202531- + 41789 0000695C 2025320D0A + 41790 MSG_1033: + 41791 00006961 15 db 21 + 41792 00006962 53756E4D6F6E547565- db 'SunMonTueWedThuFriSat' + 41792 0000696B 576564546875467269- + 41792 00006974 536174 + 41793 MSG_1034: + 41794 00006977 15 db 21 + 41795 00006978 456E746572206E6577- db 'Enter new date (%1): ' + 41795 00006981 206461746520282531- + 41795 0000698A 293A20 + 41796 MSG_1036: + 41797 0000698D 14 db 20 + 41798 0000698E 43757272656E742074- db 'Current time is %1',0Dh,0Ah + 41798 00006997 696D65206973202531- + 41798 000069A0 0D0A + 41799 MSG_1037: + 41800 000069A2 10 db 16 + 41801 000069A3 456E746572206E6577- db 'Enter new time: ' + 41801 000069AC 2074696D653A20 + 41802 MSG_1038: + 41803 000069B3 12 db 18 + 41804 000069B4 2C2020202044656C65- db ', Delete (Y/N)?' + 41804 000069BD 74652028592F4E293F + 41805 MSG_1039: + 41806 000069C6 3C db 60 + 41807 000069C7 416C6C2066696C6573- db 'All files in directory will be deleted!',0Dh,0Ah + 41807 000069D0 20696E206469726563- + 41807 000069D9 746F72792077696C6C- + 41807 000069E2 2062652064656C6574- + 41807 000069EB 6564210D0A + 41808 000069F0 41726520796F752073- db 'Are you sure (Y/N)?' + 41808 000069F9 7572652028592F4E29- + 41808 00006A02 3F + 41809 + 41810 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 41811 %if 0 + 41812 MSG_1040: + 41813 db 20 + 41814 db 'MS-DOS Version %1.%2' + 41815 %else + 41816 MSG_1040: + 41817 00006A03 12 db 18 + 41818 00006A04 504320444F53205665- db 'PC DOS Version 7.1' + 41818 00006A0D 7273696F6E20372E31 + 41819 %endif + 41820 + 41821 MSG_1044: + 41822 00006A16 13 db 19 + 41823 00006A17 496E76616C69642064- db 'Invalid directory',0Dh,0Ah + 41823 00006A20 69726563746F72790D- + 41823 00006A29 0A + 41824 MSG_1046: + 41825 00006A2A 36 db 54 + 41826 00006A2B 496E76616C69642070- db 'Invalid path, not directory,',0Dh,0Ah + 41826 00006A34 6174682C206E6F7420- + 41826 00006A3D 6469726563746F7279- + 41826 00006A46 2C0D0A + 41827 00006A49 6F7220646972656374- db 'or directory not empty',0Dh,0Ah + 41827 00006A52 6F7279206E6F742065- + 41827 00006A5B 6D7074790D0A + 41828 MSG_1047: + 41829 00006A61 18 db 24 + 41830 00006A62 4D7573742073706563- db 'Must specify ON or OFF',0Dh,0Ah + 41830 00006A6B 696679204F4E206F72- + 41830 00006A74 204F46460D0A + 41831 MSG_1048: + 41832 00006A7A 11 db 17 + 41833 00006A7B 4469726563746F7279- db 'Directory of %1',0Dh,0Ah + 41833 00006A84 206F662025310D0A + 41834 MSG_1049: + 41835 00006A8C 09 db 9 + 41836 00006A8D 4E6F20506174680D0A db 'No Path',0Dh,0Ah + 41837 MSG_1050: + 41838 00006A96 1E db 30 + 41839 00006A97 496E76616C69642064- db 'Invalid drive in search path',0Dh,0Ah + 41839 00006AA0 7269766520696E2073- + 41839 00006AA9 656172636820706174- + 41839 00006AB2 680D0A + 41840 MSG_1051: + 41841 00006AB5 10 db 16 + 41842 00006AB6 496E76616C69642064- db 'Invalid device',0Dh,0Ah + 41842 00006ABF 65766963650D0A + 41843 MSG_1052: + 41844 00006AC6 16 db 22 + 41845 00006AC7 464F522063616E6E6F- db 'FOR cannot be nested',0Dh,0Ah + 41845 00006AD0 74206265206E657374- + 41845 00006AD9 65640D0A + 41846 MSG_1053: + 41847 00006ADD 25 db 37 + 41848 00006ADE 496E7465726D656469- db 'Intermediate file error during pipe',0Dh,0Ah + 41848 00006AE7 6174652066696C6520- + 41848 00006AF0 6572726F7220647572- + 41848 00006AF9 696E6720706970650D- + 41848 00006B02 0A + 41849 MSG_1054: + 41850 00006B03 26 db 38 + 41851 00006B04 43616E6E6F7420646F- db 'Cannot do binary reads from a device',0Dh,0Ah + 41851 00006B0D 2062696E6172792072- + 41851 00006B16 656164732066726F6D- + 41851 00006B1F 206120646576696365- + 41851 00006B28 0D0A + 41852 + 41853 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:6205h) + 41854 ; 17/06/2023 + 41855 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7155h) + 41856 ; 06/08/2024 + 41857 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:6FDDh) + 41858 MSG_1055: + 41859 00006B2A 0D db 13 + 41860 00006B2B 425245414B20697320- db 'BREAK is %1',0Dh,0Ah + 41860 00006B34 25310D0A + 41861 MSG_1056: + 41862 00006B38 0E db 14 + 41863 00006B39 564552494659206973- db 'VERIFY is %1',0Dh,0Ah + 41863 00006B42 2025310D0A + 41864 MSG_1057: + 41865 00006B47 0C db 12 + 41866 00006B48 4543484F2069732025- db 'ECHO is %1',0Dh,0Ah + 41866 00006B51 310D0A + 41867 MSG_1059: + 41868 00006B54 04 db 4 + 41869 00006B55 6F666600 db 'off',0 + 41870 MSG_1060: + 41871 00006B59 03 db 3 + 41872 00006B5A 6F6E00 db 'on',0 + 41873 MSG_1061: + 41874 00006B5D 19 db 25 + 41875 00006B5E 4572726F7220777269- db 'Error writing to device',0Dh,0Ah + 41875 00006B67 74696E6720746F2064- + 41875 00006B70 65766963650D0A + 41876 MSG_1063: + 41877 00006B77 02 db 2 + 41878 00006B78 2531 db '%1' + 41879 MSG_1064: + 41880 00006B7A 02 db 2 + 41881 00006B7B 2531 db '%1' + 41882 MSG_1065: + 41883 00006B7D 02 db 2 + 41884 00006B7E 2531 db '%1' + 41885 MSG_1066: + 41886 00006B80 02 db 2 + 41887 00006B81 2531 db '%1' + 41888 MSG_1067: + 41889 00006B83 01 db 1 + 41890 00006B84 09 db 9 + 41891 MSG_1068: + 41892 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 41893 %if 0 + 41894 db 10 + 41895 db ' ' + 41896 %else + 41897 00006B85 0C db 12 + 41898 00006B86 203C4449523E202020- db ' ' + 41898 00006B8F 202020 + 41899 %endif + 41900 MSG_1069: + 41901 00006B92 03 db 3 + 41902 00006B93 082008 db 8, 20h, 8 + 41903 MSG_1070: ; CRLF + 41904 00006B96 02 db 2 + 41905 00006B97 0D db 0Dh + 41906 00006B98 0A db 0Ah + 41907 MSG_1071: + 41908 00006B99 02 db 2 + 41909 00006B9A 2531 db '%1' + 41910 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM + 41911 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:71C5h + 41912 MSG_1072: + 41913 ;db 8 + 41914 ;db 'mm-dd-yy' + 41915 00006B9C 09 db 9 + 41916 00006B9D 6D6D2D64642D797900 db 'mm-dd-yy',0 + 41917 MSG_1073: + 41918 ;db 8 + 41919 ;db 'dd-mm-yy' + 41920 00006BA6 09 db 9 + 41921 00006BA7 64642D6D6D2D797900 db 'dd-mm-yy',0 + 41922 MSG_1074: + 41923 ;db 8 + 41924 ;db 'yy-mm-dd' + 41925 00006BB0 09 db 9 + 41926 00006BB1 79792D6D6D2D646400 db 'yy-mm-dd',0 + 41927 MSG_1075: + 41928 00006BBA 05 db 5 + 41929 00006BBB 2531202532 db '%1 %2' + 41930 MSG_1076: + 41931 00006BC0 02 db 2 + 41932 00006BC1 2531 db '%1' + 41933 MSG_1077: + 41934 00006BC3 07 db 7 + 41935 00006BC4 20253120202532 db ' %1 %2' + 41936 MSG_1078: + 41937 00006BCB 1A db 26 + 41938 00006BCC 4469726563746F7279- db 'Directory already exists',0Dh,0Ah + 41938 00006BD5 20616C726561647920- + 41938 00006BDE 6578697374730D0A + 41939 MSG_1079: + 41940 00006BE6 0A db 10 + 41941 00006BE7 25312062797465730D- db '%1 bytes',0Dh,0Ah + 41941 00006BF0 0A + 41942 MSG_1080: + 41943 00006BF1 15 db 21 + 41944 00006BF2 546F74616C2066696C- db 'Total files listed:',0Dh,0Ah + 41944 00006BFB 6573206C6973746564- + 41944 00006C04 3A0D0A + 41945 MSG_1081: + 41946 00006C07 2A db 42 + 41947 00006C08 284572726F72206F63- db '(Error occurred in environment variable)',0Dh,0Ah + 41947 00006C11 63757272656420696E- + 41947 00006C1A 20656E7669726F6E6D- + 41947 00006C23 656E74207661726961- + 41947 00006C2C 626C65290D0A + 41948 ; + 41949 ; 06/08/2024 -Retro DOS 5.0 COMMAND.COM + 41950 %if 0 + 41951 ; 17/06/2023 - Retro DOS 4.2 COMMAND.COM + 41952 MSG_1082: + 41953 db 7 + 41954 db ' [Y/N]?' + 41955 %else + 41956 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 41957 MSG_1082: + 41958 00006C32 0B db 11 + 41959 00006C33 205B592C4E2C455343- db ' [Y,N,ESC]?' + 41959 00006C3C 5D3F + 41960 %endif + 41961 ; + 41962 MSG_1083: + 41963 00006C3E 02 db 2 + 41964 00006C3F 594E db 'YN' + 41965 ; + 41966 MSG_1084: + 41967 00006C41 0F db 15 + 41968 00006C42 28636F6E74696E7569- db '(continuing %1)' + 41968 00006C4B 6E6720253129 + 41969 MSG_1090: + 41970 00006C51 0D db 13 + 41971 00006C52 5265766973696F6E20- db 'Revision %1',0Dh,0Ah + 41971 00006C5B 25310D0A + 41972 MSG_1091: + 41973 00006C5F 0D db 13 + 41974 00006C60 444F5320697320696E- db 'DOS is in ROM' + 41974 00006C69 20524F4D + 41975 MSG_1092: + 41976 00006C6D 0D db 13 + 41977 00006C6E 444F5320697320696E- db 'DOS is in HMA' + 41977 00006C77 20484D41 + 41978 MSG_1093: + 41979 00006C7B 14 db 20 + 41980 00006C7C 444F5320697320696E- db 'DOS is in low memory' + 41980 00006C85 206C6F77206D656D6F- + 41980 00006C8E 7279 + 41981 MSG_1094: + 41982 00006C90 1C db 28 + 41983 00006C91 43616E6E6F74204C6F- db 'Cannot Loadhigh batch file',0Dh,0Ah + 41983 00006C9A 616468696768206261- + 41983 00006CA3 7463682066696C650D- + 41983 00006CAC 0A + 41984 MSG_1095: + 41985 00006CAD 1C db 28 + 41986 00006CAE 4C6F6164486967683A- db 'LoadHigh: Invalid filename',0Dh,0Ah + 41986 00006CB7 20496E76616C696420- + 41986 00006CC0 66696C656E616D650D- + 41986 00006CC9 0A + 41987 MSG_1096: + 41988 00006CCA 30 db 48 + 41989 00006CCB 43616E6E6F74206F70- db 'Cannot open specified country information file',0Dh,0Ah + 41989 00006CD4 656E20737065636966- + 41989 00006CDD 69656420636F756E74- + 41989 00006CE6 727920696E666F726D- + 41989 00006CEF 6174696F6E2066696C- + 41989 00006CF8 650D0A + 41990 + 41991 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 41992 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:7320h + 41993 MSG_1097: + 41994 00006CFB 1C db 28 + 41995 00006CFC 4C6F6164486967683A- db 'LoadHigh: Invalid argument',0Dh,0Ah + 41995 00006D05 20496E76616C696420- + 41995 00006D0E 617267756D656E740D- + 41995 00006D17 0A + 41996 MSG_1098: + 41997 00006D18 1C db 28 + 41998 00006D19 526571756972656420- db 'Required parameter missing',0Dh,0Ah + 41998 00006D22 706172616D65746572- + 41998 00006D2B 206D697373696E670D- + 41998 00006D34 0A + 41999 MSG_1099: + 42000 00006D35 15 db 21 + 42001 00006D36 556E7265636F676E69- db 'Unrecognized switch',0Dh,0Ah + 42001 00006D3F 7A6564207377697463- + 42001 00006D48 680D0A + 42002 MSG_1100: + 42003 00006D4B 25 db 37 + 42004 00006D4C 412062616420554D42- db 'A bad UMB number has been specified',0Dh,0Ah + 42004 00006D55 206E756D6265722068- + 42004 00006D5E 6173206265656E2073- + 42004 00006D67 70656369666965640D- + 42004 00006D70 0A + 42005 + 42006 ; 02/08/2024 - PCDOS 7.1 COMMAND.COM + 42007 %if 0 + 42008 MSG_1101: + 42009 db 14 + 42010 db ' %1.%2 to 1.0' + 42011 MSG_1102: + 42012 db 57 + 42013 db ' %1.%2 to 1.0 average compression ratio',0Dh,0Ah + 42014 %endif + 42015 + 42016 MSG_1103: + 42017 00006D71 1A db 26 + 42018 00006D72 4F7665727772697465- db 'Overwrite %1 (Yes/No/All)?' + 42018 00006D7B 20253120285965732F- + 42018 00006D84 4E6F2F416C6C293F + 42019 MSG_1104: + 42020 00006D8C 03 db 3 + 42021 00006D8D 59 _Y_es: db 'Y' + 42022 00006D8E 4E _N_o: db 'N' + 42023 00006D8F 41 _A_ll: db 'A' + 42024 + 42025 ; 02/08/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 42026 %if 0 + 42027 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:73FEh) + 42028 MSG_1105: + 42029 db 4 + 42030 db ' ' + 42031 %else + 42032 ; 03/08/2024 + 42033 MSG_1105: + 42034 00006D90 0A db 10 + 42035 00006D91 203C4449523E202020- db ' ' + 42035 00006D9A 20 + 42036 + 42037 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:724Eh) + 42038 MSG_1106: + 42039 00006D9B 11 db 17 + 42040 00006D9C 2531204B2062797465- db '%1 K bytes free',0Dh,0Ah + 42040 00006DA5 7320667265650D0A + 42041 %endif + 42042 + 42043 ; ((MSDOS 5.0 COMMAND.COM - TRANGROUP:63C2h)) + 42044 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7403h) + 42045 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:7260h + 42046 MSG_1200: + 42047 00006DAD 00 db 0 ; /? unimplemented + 42048 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7404h) + 42049 MSG_1300: + 42050 00006DAE 86 db 134 + 42051 00006DAF 53657473206F722063- db 'Sets or clears extended CTRL+C checking.',0Dh,0Ah + 42051 00006DB8 6C6561727320657874- + 42051 00006DC1 656E64656420435452- + 42051 00006DCA 4C2B4320636865636B- + 42051 00006DD3 696E672E0D0A + 42052 00006DD9 0D0A db 0Dh,0Ah + 42053 00006DDB 425245414B205B4F4E- db 'BREAK [ON | OFF]',0Dh,0Ah + 42053 00006DE4 207C204F46465D0D0A + 42054 00006DED 0D0A db 0Dh,0Ah + 42055 00006DEF 547970652042524541- db 'Type BREAK without a parameter to display the current BREAK setting.',0Dh,0Ah + 42055 00006DF8 4B20776974686F7574- + 42055 00006E01 206120706172616D65- + 42055 00006E0A 74657220746F206469- + 42055 00006E13 73706C617920746865- + 42055 00006E1C 2063757272656E7420- + 42055 00006E25 425245414B20736574- + 42055 00006E2E 74696E672E0D0A + 42056 MSG_1320: + 42057 00006E35 3F db 63 + 42058 00006E36 446973706C61797320- db 'Displays or sets the active code page number.',0Dh,0Ah + 42058 00006E3F 6F7220736574732074- + 42058 00006E48 686520616374697665- + 42058 00006E51 20636F646520706167- + 42058 00006E5A 65206E756D6265722E- + 42058 00006E63 0D0A + 42059 00006E65 0D0A db 0Dh,0Ah + 42060 00006E67 43484350205B6E6E6E- db 'CHCP [nnn]',0Dh,0Ah + 42060 00006E70 5D0D0A + 42061 00006E73 0D0A db 0Dh,0Ah + 42062 MSG_1321: + 42063 00006E75 70 db 112 + 42064 00006E76 20206E6E6E20202053- db ' nnn Specifies a code page number.',0Dh,0Ah + 42064 00006E7F 706563696669657320- + 42064 00006E88 6120636F6465207061- + 42064 00006E91 6765206E756D626572- + 42064 00006E9A 2E0D0A + 42065 00006E9D 0D0A db 0Dh,0Ah + 42066 00006E9F 547970652043484350- db 'Type CHCP without a parameter to display the active code page number.',0Dh,0Ah + 42066 00006EA8 20776974686F757420- + 42066 00006EB1 6120706172616D6574- + 42066 00006EBA 657220746F20646973- + 42066 00006EC3 706C61792074686520- + 42066 00006ECC 61637469766520636F- + 42066 00006ED5 64652070616765206E- + 42066 00006EDE 756D6265722E0D0A + 42067 MSG_1340: + 42068 00006EE6 5B db 91 + 42069 00006EE7 446973706C61797320- db 'Displays the name of or changes the current directory.',0Dh,0Ah + 42069 00006EF0 746865206E616D6520- + 42069 00006EF9 6F66206F7220636861- + 42069 00006F02 6E6765732074686520- + 42069 00006F0B 63757272656E742064- + 42069 00006F14 69726563746F72792E- + 42069 00006F1D 0D0A + 42070 00006F1F 0D0A db 0Dh,0Ah + 42071 00006F21 4348444952205B6472- db 'CHDIR [drive:][path]',0Dh,0Ah + 42071 00006F2A 6976653A5D5B706174- + 42071 00006F33 685D0D0A + 42072 00006F37 43484449525B2E2E5D- db 'CHDIR[..]',0Dh,0Ah + 42072 00006F40 0D0A + 42073 MSG_1341: + 42074 00006F42 62 db 98 + 42075 00006F43 4344205B6472697665- db 'CD [drive:][path]',0Dh,0Ah + 42075 00006F4C 3A5D5B706174685D0D- + 42075 00006F55 0A + 42076 00006F56 43445B2E2E5D0D0A db 'CD[..]',0Dh,0Ah + 42077 00006F5E 0D0A db 0Dh,0Ah + 42078 00006F60 20202E2E2020205370- db ' .. Specifies that you want to change to the parent directory.' + 42078 00006F69 656369666965732074- + 42078 00006F72 68617420796F752077- + 42078 00006F7B 616E7420746F206368- + 42078 00006F84 616E676520746F2074- + 42078 00006F8D 686520706172656E74- + 42078 00006F96 206469726563746F72- + 42078 00006F9F 792E + 42079 00006FA1 0D0A db 0Dh,0Ah + 42080 00006FA3 0D0A db 0Dh,0Ah + 42081 MSG_1342: + 42082 00006FA5 91 db 145 + 42083 00006FA6 547970652043442064- db 'Type CD drive: to display the current directory in the specified ' + 42083 00006FAF 726976653A20746F20- + 42083 00006FB8 646973706C61792074- + 42083 00006FC1 68652063757272656E- + 42083 00006FCA 74206469726563746F- + 42083 00006FD3 727920696E20746865- + 42083 00006FDC 207370656369666965- + 42083 00006FE5 6420 + 42084 00006FE7 64726976652E0D0A db 'drive.',0Dh,0Ah + 42085 00006FEF 547970652043442077- db 'Type CD without parameters to display the current drive and directory.',0Dh,0Ah + 42085 00006FF8 6974686F7574207061- + 42085 00007001 72616D657465727320- + 42085 0000700A 746F20646973706C61- + 42085 00007013 792074686520637572- + 42085 0000701C 72656E742064726976- + 42085 00007025 6520616E6420646972- + 42085 0000702E 6563746F72792E0D0A + 42086 MSG_1360: + 42087 00007037 1B db 27 + 42088 00007038 436C65617273207468- db 'Clears the screen.',0Dh,0Ah + 42088 00007041 652073637265656E2E- + 42088 0000704A 0D0A + 42089 0000704C 0D0A db 0Dh,0Ah + 42090 0000704E 434C530D0A db 'CLS',0Dh,0Ah + 42091 MSG_1400: + 42092 ;db 145 + 42093 ;db 'Copies one or more files to another location.',0Dh,0Ah 42094 ;db 0Dh,0Ah - 42095 - 42096 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42097 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:76A9h) - 42098 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42099 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:7506h) - 42100 - 42101 00007053 9C db 156 ; 19/06/2023 - 42102 00007054 436F70696573206F6E- db 'Copies one or more files to another location.',0Dh,0Ah - 42102 0000705D 65206F72206D6F7265- - 42102 00007066 2066696C657320746F- - 42102 0000706F 20616E6F7468657220- - 42102 00007078 6C6F636174696F6E2E- - 42102 00007081 0D0A - 42103 00007083 0D0A db 0Dh,0Ah - 42104 00007085 434F5059205B2F4120- db 'COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination',0Dh,0Ah - 42104 0000708E 7C202F425D20736F75- - 42104 00007097 726365205B2F41207C- - 42104 000070A0 202F425D205B2B2073- - 42104 000070A9 6F75726365205B2F41- - 42104 000070B2 207C202F425D205B2B- - 42104 000070BB 202E2E2E5D5D205B64- - 42104 000070C4 657374696E6174696F- - 42104 000070CD 6E0D0A - 42105 000070D0 20205B2F41207C202F- db ' [/A | /B]] [/V] [/Y | /-Y]',0Dh,0Ah - 42105 000070D9 425D5D205B2F565D20- - 42105 000070E2 5B2F59207C202F2D59- - 42105 000070EB 5D0D0A - 42106 000070EE 0D0A db 0Dh,0Ah - 42107 MSG_1401: - 42108 000070F0 68 db 104 - 42109 000070F1 2020736F7572636520- db ' source Specifies the file or files to be copied.',0Dh,0Ah - 42109 000070FA 202020202020537065- - 42109 00007103 636966696573207468- - 42109 0000710C 652066696C65206F72- - 42109 00007115 2066696C657320746F- - 42109 0000711E 20626520636F706965- - 42109 00007127 642E0D0A - 42110 0000712B 20202F412020202020- db ' /A Indicates an ASCII text file.',0Dh,0Ah - 42110 00007134 202020202020496E64- - 42110 0000713D 69636174657320616E- - 42110 00007146 204153434949207465- - 42110 0000714F 78742066696C652E0D- - 42110 00007158 0A - 42111 MSG_1402: - 42112 00007159 76 db 118 - 42113 0000715A 20202F422020202020- db ' /B Indicates a binary file.',0Dh,0Ah - 42113 00007163 202020202020496E64- - 42113 0000716C 696361746573206120- - 42113 00007175 62696E617279206669- - 42113 0000717E 6C652E0D0A - 42114 00007183 202064657374696E61- db ' destination Specifies the directory and/or filename for the new file(s).',0Dh,0Ah - 42114 0000718C 74696F6E2020537065- - 42114 00007195 636966696573207468- - 42114 0000719E 65206469726563746F- - 42114 000071A7 727920616E642F6F72- - 42114 000071B0 2066696C656E616D65- - 42114 000071B9 20666F722074686520- - 42114 000071C2 6E65772066696C6528- - 42114 000071CB 73292E0D0A - 42115 MSG_1403: - 42116 ;db 65 ; MSDOS 5.0 - 42117 ; 17/06/2023 - 42118 000071D0 3F db 63 ; MSDOS 6.22 - 42119 000071D1 20202F562020202020- db ' /V Verifies that new files are written correctly.',0Dh,0Ah - 42119 000071DA 202020202020566572- - 42119 000071E3 696669657320746861- - 42119 000071EC 74206E65772066696C- - 42119 000071F5 657320617265207772- - 42119 000071FE 697474656E20636F72- - 42119 00007207 726563746C792E0D0A - 42120 ;db 0Dh,0Ah ; MSDOS 5.0 - 42121 - 42122 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42123 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:7866h - 42124 MSG_1404: - 42125 00007210 74 db 116 - 42126 00007211 20202F592020202020- db ' /Y Suppresses prompting to confirm you want to overwrite an',0Dh,0Ah - 42126 0000721A 202020202020537570- - 42126 00007223 707265737365732070- - 42126 0000722C 726F6D7074696E6720- - 42126 00007235 746F20636F6E666972- - 42126 0000723E 6D20796F752077616E- - 42126 00007247 7420746F206F766572- - 42126 00007250 777269746520616E0D- - 42126 00007259 0A - 42127 0000725A 202020202020202020- db ' existing destination file.',0Dh,0Ah - 42127 00007263 202020202020657869- - 42127 0000726C 7374696E6720646573- - 42127 00007275 74696E6174696F6E20- - 42127 0000727E 66696C652E0D0A - 42128 MSG_1405: - 42129 00007285 72 db 114 - 42130 00007286 20202F2D5920202020- db ' /-Y Causes prompting to confirm you want to overwrite an',0Dh,0Ah - 42130 0000728F 202020202020436175- - 42130 00007298 7365732070726F6D70- - 42130 000072A1 74696E6720746F2063- - 42130 000072AA 6F6E6669726D20796F- - 42130 000072B3 752077616E7420746F- - 42130 000072BC 206F76657277726974- - 42130 000072C5 6520616E0D0A - 42131 000072CB 202020202020202020- db ' existing destination file.',0Dh,0Ah - 42131 000072D4 202020202020657869- - 42131 000072DD 7374696E6720646573- - 42131 000072E6 74696E6174696F6E20- - 42131 000072EF 66696C652E0D0A - 42132 000072F6 0D0A db 0Dh,0Ah - 42133 MSG_1406: - 42134 000072F8 42 db 66 - 42135 000072F9 546865207377697463- db 'The switch /Y may be preset in the COPYCMD environment variable.',0Dh,0Ah - 42135 00007302 68202F59206D617920- - 42135 0000730B 626520707265736574- - 42135 00007314 20696E207468652043- - 42135 0000731D 4F5059434D4420656E- - 42135 00007326 7669726F6E6D656E74- - 42135 0000732F 207661726961626C65- - 42135 00007338 2E0D0A - 42136 - 42137 ;MSG_1404: ; MSDOS 5.0 (TRANGROUP:681Ch) - 42138 ; MSDOS 6.22 (TRANGROUP:7991h) - 42139 MSG_1407: ; PCDOS 7.1 (TRANGROUP:77EEh) - 42140 0000733B 87 db 135 - 42141 0000733C 546F20617070656E64- db 'To append files, specify a single file for destination, but multiple files',0Dh,0Ah - 42141 00007345 2066696C65732C2073- - 42141 0000734E 706563696679206120- - 42141 00007357 73696E676C65206669- - 42141 00007360 6C6520666F72206465- - 42141 00007369 7374696E6174696F6E- - 42141 00007372 2C20627574206D756C- - 42141 0000737B 7469706C652066696C- - 42141 00007384 65730D0A - 42142 00007388 666F7220736F757263- db 'for source (using wildcards or file1+file2+file3 format).',0Dh,0Ah - 42142 00007391 6520287573696E6720- - 42142 0000739A 77696C646361726473- - 42142 000073A3 206F722066696C6531- - 42142 000073AC 2B66696C65322B6669- - 42142 000073B5 6C653320666F726D61- - 42142 000073BE 74292E0D0A - 42143 MSG_1420: - 42144 000073C3 8A db 138 - 42145 000073C4 4368616E6765732074- db 'Changes the terminal device used to control your system.',0Dh,0Ah - 42145 000073CD 6865207465726D696E- - 42145 000073D6 616C20646576696365- - 42145 000073DF 207573656420746F20- - 42145 000073E8 636F6E74726F6C2079- - 42145 000073F1 6F7572207379737465- - 42145 000073FA 6D2E0D0A - 42146 000073FE 0D0A db 0Dh,0Ah - 42147 00007400 435454592064657669- db 'CTTY device',0Dh,0Ah - 42147 00007409 63650D0A - 42148 0000740D 0D0A db 0Dh,0Ah - 42149 0000740F 202064657669636520- db ' device The terminal device you want to use, such as COM1.',0Dh,0Ah - 42149 00007418 202054686520746572- - 42149 00007421 6D696E616C20646576- - 42149 0000742A 69636520796F752077- - 42149 00007433 616E7420746F207573- - 42149 0000743C 652C20737563682061- - 42149 00007445 7320434F4D312E0D0A - 42150 MSG_1440: - 42151 ;db 45 - 42152 ;db 'Displays or sets the date.',0Dh,0Ah - 42153 ;db 0Dh,0Ah - 42154 ;db 'DATE [date]',0Dh,0Ah - 42155 ;db 0Dh,0Ah - 42156 - 42157 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42158 %if 0 - 42159 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42160 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7AA4h) - 42161 db 93 - 42162 db 'Displays or sets the date.',0Dh,0Ah - 42163 db 0Dh,0Ah - 42164 db 'DATE [mm-dd-yy]',0Dh,0Ah - 42165 db 0Dh,0Ah - 42166 db ' mm-dd-yy Sets the date you specify.',0Dh,0Ah - 42167 db 0Dh,0Ah - 42168 %else - 42169 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42170 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:7901h) - 42171 0000744E 26 db 38 - 42172 0000744F 446973706C61797320- db 'Displays or sets the date.',0Dh,0Ah - 42172 00007458 6F7220736574732074- - 42172 00007461 686520646174652E0D- - 42172 0000746A 0A - 42173 0000746B 0D0A db 0Dh,0Ah - 42174 0000746D 444154450D0A db 'DATE',0Dh,0Ah - 42175 00007473 0D0A db 0Dh,0Ah - 42176 %endif - 42177 - 42178 MSG_1441: - 42179 00007475 83 db 131 - 42180 00007476 547970652044415445- db 'Type DATE without parameters to display the current date setting and',0Dh,0Ah - 42180 0000747F 20776974686F757420- - 42180 00007488 706172616D65746572- - 42180 00007491 7320746F2064697370- - 42180 0000749A 6C6179207468652063- - 42180 000074A3 757272656E74206461- - 42180 000074AC 74652073657474696E- - 42180 000074B5 6720616E640D0A - 42181 000074BC 612070726F6D707420- db 'a prompt for a new one. Press ENTER to keep the same date.',0Dh,0Ah - 42181 000074C5 666F722061206E6577- - 42181 000074CE 206F6E652E20205072- - 42181 000074D7 65737320454E544552- - 42181 000074E0 20746F206B65657020- - 42181 000074E9 7468652073616D6520- - 42181 000074F2 646174652E0D0A - 42182 MSG_1460: - 42183 000074F9 64 db 100 - 42184 000074FA 44656C65746573206F- db 'Deletes one or more files.',0Dh,0Ah - 42184 00007503 6E65206F72206D6F72- - 42184 0000750C 652066696C65732E0D- - 42184 00007515 0A - 42185 00007516 0D0A db 0Dh,0Ah - 42186 00007518 44454C205B64726976- db 'DEL [drive:][path]filename [/P]',0Dh,0Ah - 42186 00007521 653A5D5B706174685D- - 42186 0000752A 66696C656E616D6520- - 42186 00007533 5B2F505D0D0A - 42187 00007539 4552415345205B6472- db 'ERASE [drive:][path]filename [/P]',0Dh,0Ah - 42187 00007542 6976653A5D5B706174- - 42187 0000754B 685D66696C656E616D- - 42187 00007554 65205B2F505D0D0A - 42188 0000755C 0D0A db 0Dh,0Ah - 42189 MSG_1461: - 42190 0000755E 83 db 131 - 42191 0000755F 20205B64726976653A- db ' [drive:][path]filename Specifies the file(s) to delete. Specify multiple',0Dh,0Ah - 42191 00007568 5D5B706174685D6669- - 42191 00007571 6C656E616D65202053- - 42191 0000757A 706563696669657320- - 42191 00007583 7468652066696C6528- - 42191 0000758C 732920746F2064656C- - 42191 00007595 6574652E2020537065- - 42191 0000759E 63696679206D756C74- - 42191 000075A7 69706C650D0A - 42192 000075AD 202020202020202020- db ' files by using wildcards.',0Dh,0Ah - 42192 000075B6 202020202020202020- - 42192 000075BF 202020202020202066- - 42192 000075C8 696C65732062792075- - 42192 000075D1 73696E672077696C64- - 42192 000075DA 63617264732E0D0A - 42193 MSG_1462: - 42194 000075E2 4F db 79 - 42195 000075E3 20202F502020202020- db ' /P Prompts for confirmation before deleting each file.',0Dh,0Ah - 42195 000075EC 202020202020202020- - 42195 000075F5 202020202020202050- - 42195 000075FE 726F6D70747320666F- - 42195 00007607 7220636F6E6669726D- - 42195 00007610 6174696F6E20626566- - 42195 00007619 6F72652064656C6574- - 42195 00007622 696E67206561636820- - 42195 0000762B 66696C652E0D0A - 42196 - 42197 ; 17/06/2023 - 42198 %if 0 ; MSDOS 5.0 DIR Help messages + 42095 ;db 'COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination',0Dh,0Ah + 42096 ;db ' [/A | /B]] [/V]',0Dh,0Ah + 42097 ;db 0Dh,0Ah + 42098 + 42099 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42100 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:76A9h) + 42101 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42102 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:7506h) + 42103 + 42104 00007053 9C db 156 ; 19/06/2023 + 42105 00007054 436F70696573206F6E- db 'Copies one or more files to another location.',0Dh,0Ah + 42105 0000705D 65206F72206D6F7265- + 42105 00007066 2066696C657320746F- + 42105 0000706F 20616E6F7468657220- + 42105 00007078 6C6F636174696F6E2E- + 42105 00007081 0D0A + 42106 00007083 0D0A db 0Dh,0Ah + 42107 00007085 434F5059205B2F4120- db 'COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination',0Dh,0Ah + 42107 0000708E 7C202F425D20736F75- + 42107 00007097 726365205B2F41207C- + 42107 000070A0 202F425D205B2B2073- + 42107 000070A9 6F75726365205B2F41- + 42107 000070B2 207C202F425D205B2B- + 42107 000070BB 202E2E2E5D5D205B64- + 42107 000070C4 657374696E6174696F- + 42107 000070CD 6E0D0A + 42108 000070D0 20205B2F41207C202F- db ' [/A | /B]] [/V] [/Y | /-Y]',0Dh,0Ah + 42108 000070D9 425D5D205B2F565D20- + 42108 000070E2 5B2F59207C202F2D59- + 42108 000070EB 5D0D0A + 42109 000070EE 0D0A db 0Dh,0Ah + 42110 MSG_1401: + 42111 000070F0 68 db 104 + 42112 000070F1 2020736F7572636520- db ' source Specifies the file or files to be copied.',0Dh,0Ah + 42112 000070FA 202020202020537065- + 42112 00007103 636966696573207468- + 42112 0000710C 652066696C65206F72- + 42112 00007115 2066696C657320746F- + 42112 0000711E 20626520636F706965- + 42112 00007127 642E0D0A + 42113 0000712B 20202F412020202020- db ' /A Indicates an ASCII text file.',0Dh,0Ah + 42113 00007134 202020202020496E64- + 42113 0000713D 69636174657320616E- + 42113 00007146 204153434949207465- + 42113 0000714F 78742066696C652E0D- + 42113 00007158 0A + 42114 MSG_1402: + 42115 00007159 76 db 118 + 42116 0000715A 20202F422020202020- db ' /B Indicates a binary file.',0Dh,0Ah + 42116 00007163 202020202020496E64- + 42116 0000716C 696361746573206120- + 42116 00007175 62696E617279206669- + 42116 0000717E 6C652E0D0A + 42117 00007183 202064657374696E61- db ' destination Specifies the directory and/or filename for the new file(s).',0Dh,0Ah + 42117 0000718C 74696F6E2020537065- + 42117 00007195 636966696573207468- + 42117 0000719E 65206469726563746F- + 42117 000071A7 727920616E642F6F72- + 42117 000071B0 2066696C656E616D65- + 42117 000071B9 20666F722074686520- + 42117 000071C2 6E65772066696C6528- + 42117 000071CB 73292E0D0A + 42118 MSG_1403: + 42119 ;db 65 ; MSDOS 5.0 + 42120 ; 17/06/2023 + 42121 000071D0 3F db 63 ; MSDOS 6.22 + 42122 000071D1 20202F562020202020- db ' /V Verifies that new files are written correctly.',0Dh,0Ah + 42122 000071DA 202020202020566572- + 42122 000071E3 696669657320746861- + 42122 000071EC 74206E65772066696C- + 42122 000071F5 657320617265207772- + 42122 000071FE 697474656E20636F72- + 42122 00007207 726563746C792E0D0A + 42123 ;db 0Dh,0Ah ; MSDOS 5.0 + 42124 + 42125 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42126 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:7866h + 42127 MSG_1404: + 42128 00007210 74 db 116 + 42129 00007211 20202F592020202020- db ' /Y Suppresses prompting to confirm you want to overwrite an',0Dh,0Ah + 42129 0000721A 202020202020537570- + 42129 00007223 707265737365732070- + 42129 0000722C 726F6D7074696E6720- + 42129 00007235 746F20636F6E666972- + 42129 0000723E 6D20796F752077616E- + 42129 00007247 7420746F206F766572- + 42129 00007250 777269746520616E0D- + 42129 00007259 0A + 42130 0000725A 202020202020202020- db ' existing destination file.',0Dh,0Ah + 42130 00007263 202020202020657869- + 42130 0000726C 7374696E6720646573- + 42130 00007275 74696E6174696F6E20- + 42130 0000727E 66696C652E0D0A + 42131 MSG_1405: + 42132 00007285 72 db 114 + 42133 00007286 20202F2D5920202020- db ' /-Y Causes prompting to confirm you want to overwrite an',0Dh,0Ah + 42133 0000728F 202020202020436175- + 42133 00007298 7365732070726F6D70- + 42133 000072A1 74696E6720746F2063- + 42133 000072AA 6F6E6669726D20796F- + 42133 000072B3 752077616E7420746F- + 42133 000072BC 206F76657277726974- + 42133 000072C5 6520616E0D0A + 42134 000072CB 202020202020202020- db ' existing destination file.',0Dh,0Ah + 42134 000072D4 202020202020657869- + 42134 000072DD 7374696E6720646573- + 42134 000072E6 74696E6174696F6E20- + 42134 000072EF 66696C652E0D0A + 42135 000072F6 0D0A db 0Dh,0Ah + 42136 MSG_1406: + 42137 000072F8 42 db 66 + 42138 000072F9 546865207377697463- db 'The switch /Y may be preset in the COPYCMD environment variable.',0Dh,0Ah + 42138 00007302 68202F59206D617920- + 42138 0000730B 626520707265736574- + 42138 00007314 20696E207468652043- + 42138 0000731D 4F5059434D4420656E- + 42138 00007326 7669726F6E6D656E74- + 42138 0000732F 207661726961626C65- + 42138 00007338 2E0D0A + 42139 + 42140 ;MSG_1404: ; MSDOS 5.0 (TRANGROUP:681Ch) + 42141 ; MSDOS 6.22 (TRANGROUP:7991h) + 42142 MSG_1407: ; PCDOS 7.1 (TRANGROUP:77EEh) + 42143 0000733B 87 db 135 + 42144 0000733C 546F20617070656E64- db 'To append files, specify a single file for destination, but multiple files',0Dh,0Ah + 42144 00007345 2066696C65732C2073- + 42144 0000734E 706563696679206120- + 42144 00007357 73696E676C65206669- + 42144 00007360 6C6520666F72206465- + 42144 00007369 7374696E6174696F6E- + 42144 00007372 2C20627574206D756C- + 42144 0000737B 7469706C652066696C- + 42144 00007384 65730D0A + 42145 00007388 666F7220736F757263- db 'for source (using wildcards or file1+file2+file3 format).',0Dh,0Ah + 42145 00007391 6520287573696E6720- + 42145 0000739A 77696C646361726473- + 42145 000073A3 206F722066696C6531- + 42145 000073AC 2B66696C65322B6669- + 42145 000073B5 6C653320666F726D61- + 42145 000073BE 74292E0D0A + 42146 MSG_1420: + 42147 000073C3 8A db 138 + 42148 000073C4 4368616E6765732074- db 'Changes the terminal device used to control your system.',0Dh,0Ah + 42148 000073CD 6865207465726D696E- + 42148 000073D6 616C20646576696365- + 42148 000073DF 207573656420746F20- + 42148 000073E8 636F6E74726F6C2079- + 42148 000073F1 6F7572207379737465- + 42148 000073FA 6D2E0D0A + 42149 000073FE 0D0A db 0Dh,0Ah + 42150 00007400 435454592064657669- db 'CTTY device',0Dh,0Ah + 42150 00007409 63650D0A + 42151 0000740D 0D0A db 0Dh,0Ah + 42152 0000740F 202064657669636520- db ' device The terminal device you want to use, such as COM1.',0Dh,0Ah + 42152 00007418 202054686520746572- + 42152 00007421 6D696E616C20646576- + 42152 0000742A 69636520796F752077- + 42152 00007433 616E7420746F207573- + 42152 0000743C 652C20737563682061- + 42152 00007445 7320434F4D312E0D0A + 42153 MSG_1440: + 42154 ;db 45 + 42155 ;db 'Displays or sets the date.',0Dh,0Ah + 42156 ;db 0Dh,0Ah + 42157 ;db 'DATE [date]',0Dh,0Ah + 42158 ;db 0Dh,0Ah + 42159 + 42160 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42161 %if 0 + 42162 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42163 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:7AA4h) + 42164 db 93 + 42165 db 'Displays or sets the date.',0Dh,0Ah + 42166 db 0Dh,0Ah + 42167 db 'DATE [mm-dd-yy]',0Dh,0Ah + 42168 db 0Dh,0Ah + 42169 db ' mm-dd-yy Sets the date you specify.',0Dh,0Ah + 42170 db 0Dh,0Ah + 42171 %else + 42172 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42173 ; (PCDOS 7.1 COMMAND.COM - TRANGROUP:7901h) + 42174 0000744E 26 db 38 + 42175 0000744F 446973706C61797320- db 'Displays or sets the date.',0Dh,0Ah + 42175 00007458 6F7220736574732074- + 42175 00007461 686520646174652E0D- + 42175 0000746A 0A + 42176 0000746B 0D0A db 0Dh,0Ah + 42177 0000746D 444154450D0A db 'DATE',0Dh,0Ah + 42178 00007473 0D0A db 0Dh,0Ah + 42179 %endif + 42180 + 42181 MSG_1441: + 42182 00007475 83 db 131 + 42183 00007476 547970652044415445- db 'Type DATE without parameters to display the current date setting and',0Dh,0Ah + 42183 0000747F 20776974686F757420- + 42183 00007488 706172616D65746572- + 42183 00007491 7320746F2064697370- + 42183 0000749A 6C6179207468652063- + 42183 000074A3 757272656E74206461- + 42183 000074AC 74652073657474696E- + 42183 000074B5 6720616E640D0A + 42184 000074BC 612070726F6D707420- db 'a prompt for a new one. Press ENTER to keep the same date.',0Dh,0Ah + 42184 000074C5 666F722061206E6577- + 42184 000074CE 206F6E652E20205072- + 42184 000074D7 65737320454E544552- + 42184 000074E0 20746F206B65657020- + 42184 000074E9 7468652073616D6520- + 42184 000074F2 646174652E0D0A + 42185 MSG_1460: + 42186 000074F9 64 db 100 + 42187 000074FA 44656C65746573206F- db 'Deletes one or more files.',0Dh,0Ah + 42187 00007503 6E65206F72206D6F72- + 42187 0000750C 652066696C65732E0D- + 42187 00007515 0A + 42188 00007516 0D0A db 0Dh,0Ah + 42189 00007518 44454C205B64726976- db 'DEL [drive:][path]filename [/P]',0Dh,0Ah + 42189 00007521 653A5D5B706174685D- + 42189 0000752A 66696C656E616D6520- + 42189 00007533 5B2F505D0D0A + 42190 00007539 4552415345205B6472- db 'ERASE [drive:][path]filename [/P]',0Dh,0Ah + 42190 00007542 6976653A5D5B706174- + 42190 0000754B 685D66696C656E616D- + 42190 00007554 65205B2F505D0D0A + 42191 0000755C 0D0A db 0Dh,0Ah + 42192 MSG_1461: + 42193 0000755E 83 db 131 + 42194 0000755F 20205B64726976653A- db ' [drive:][path]filename Specifies the file(s) to delete. Specify multiple',0Dh,0Ah + 42194 00007568 5D5B706174685D6669- + 42194 00007571 6C656E616D65202053- + 42194 0000757A 706563696669657320- + 42194 00007583 7468652066696C6528- + 42194 0000758C 732920746F2064656C- + 42194 00007595 6574652E2020537065- + 42194 0000759E 63696679206D756C74- + 42194 000075A7 69706C650D0A + 42195 000075AD 202020202020202020- db ' files by using wildcards.',0Dh,0Ah + 42195 000075B6 202020202020202020- + 42195 000075BF 202020202020202066- + 42195 000075C8 696C65732062792075- + 42195 000075D1 73696E672077696C64- + 42195 000075DA 63617264732E0D0A + 42196 MSG_1462: + 42197 000075E2 4F db 79 + 42198 000075E3 20202F502020202020- db ' /P Prompts for confirmation before deleting each file.',0Dh,0Ah + 42198 000075EC 202020202020202020- + 42198 000075F5 202020202020202050- + 42198 000075FE 726F6D70747320666F- + 42198 00007607 7220636F6E6669726D- + 42198 00007610 6174696F6E20626566- + 42198 00007619 6F72652064656C6574- + 42198 00007622 696E67206561636820- + 42198 0000762B 66696C652E0D0A 42199 - 42200 MSG_1480: - 42201 db 162 - 42202 db 'Displays a list of files and subdirectories in a directory.',0Dh,0Ah - 42203 db 0Dh,0Ah - 42204 db 'DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]',0Dh,0Ah - 42205 db ' [/O[[:]sortorder]] [/S] [/B] [/L]',0Dh,0Ah + 42200 ; 17/06/2023 + 42201 %if 0 ; MSDOS 5.0 DIR Help messages + 42202 + 42203 MSG_1480: + 42204 db 162 + 42205 db 'Displays a list of files and subdirectories in a directory.',0Dh,0Ah 42206 db 0Dh,0Ah - 42207 MSG_1481: - 42208 db 93 - 42209 db ' [drive:][path][filename]',0Dh,0Ah - 42210 db ' Specifies drive, directory, and/or files to list.',0Dh,0Ah - 42211 MSG_1482: - 42212 db 97 - 42213 db ' /P Pauses after each screenful of information.',0Dh,0Ah - 42214 db ' /W Uses wide list format.',0Dh,0Ah - 42215 MSG_1483: - 42216 db 122 - 42217 db ' /A Displays files with specified attributes.',0Dh,0Ah - 42218 db ' attributes D Directories R Read-only files',0Dh,0Ah - 42219 MSG_1484: - 42220 db 191 - 42221 db ' H Hidden files A Files ready for archiving',0Dh,0Ah - 42222 db ' S System files - Prefix meaning "not"',0Dh,0Ah - 42223 db ' /O List by files in sorted order.',0Dh,0Ah - 42224 MSG_1485: - 42225 db 155 - 42226 db ' sortorder N By name (alphabetic) S By size (smallest first)',0Dh,0Ah - 42227 db ' E By extension (alphabetic) D By date & time (earliest first)',0Dh,0Ah - 42228 MSG_1486: - 42229 db 150 - 42230 db ' G Group directories first - Prefix to reverse order',0Dh,0Ah - 42231 db ' /S Displays files in specified directory and all subdirectories.',0Dh,0Ah - 42232 MSG_1487: - 42233 db 102 - 42234 db ' /B Uses bare format (no heading information or summary).',0Dh,0Ah - 42235 db ' /L Uses lowercase.',0Dh,0Ah - 42236 db 0Dh,0Ah - 42237 MSG_1488: - 42238 db 146 - 42239 db 'Switches may be preset in the DIRCMD environment variable. Override',0Dh,0Ah - 42240 db 'preset switches by prefixing any switch with - (hyphen)--for example, /-W.',0Dh,0Ah - 42241 %endif - 42242 - 42243 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42244 %if 0 - 42245 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42246 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:7CBFh - 42247 MSG_1480: - 42248 db 137 - 42249 db 'Displays a list of files and subdirectories in a directory.',0Dh,0Ah - 42250 db 0Dh,0Ah - 42251 db 'DIR [drive:][path][filename] [/P] [/W] [/A[[:]attribs]] [/O[[:]sortord]]',0Dh,0Ah - 42252 MSG_1481: - 42253 db 30 - 42254 db ' [/S] [/B] [/L] [/C[H]]',0Dh,0Ah - 42255 db 0Dh,0Ah - 42256 MSG_1482: - 42257 db 80 - 42258 db ' [drive:][path][filename] Specifies drive, directory, and/or files to list.',0Dh,0Ah - 42259 MSG_1483: - 42260 db 89 - 42261 db ' /P Pauses after each screenful of information.',0Dh,0Ah - 42262 db ' /W Uses wide list format.',0Dh,0Ah - 42263 MSG_1484: - 42264 db 126 - 42265 db ' /A Displays files with specified attributes.',0Dh,0Ah - 42266 db ' attribs D Directories R Read-only files H Hidden files',0Dh,0Ah - 42267 MSG_1485: - 42268 db 123 - 42269 db ' S System files A Files ready to archive - Prefix meaning "not"',0Dh,0Ah - 42270 db ' /O List by files in sorted order.',0Dh,0Ah - 42271 MSG_1486: - 42272 db 149 - 42273 db ' sortord N By name (alphabetic) S By size (smallest first)',0Dh,0Ah - 42274 db ' E By extension (alphabetic) D By date & time (earliest first)',0Dh,0Ah - 42275 MSG_1487: - 42276 db 70 - 42277 db ' G Group directories first - Prefix to reverse order',0Dh,0Ah - 42278 MSG_1488: - 42279 db 127 - 42280 db ' C By compression ratio (smallest first)',0Dh,0Ah - 42281 db ' /S Displays files in specified directory and all subdirectories.',0Dh,0Ah - 42282 MSG_1489: - 42283 db 65 - 42284 db ' /B Uses bare format (no heading information or summary).',0Dh,0Ah - 42285 - 42286 MSG_1490: - 42287 db 27 - 42288 db ' /L Uses lowercase.',0Dh,0Ah - 42289 MSG_1491: - 42290 db 82 - 42291 db ' /C[H] Displays file compression ratio; /CH uses host allocation unit size.',0Dh,0Ah - 42292 db 0Dh,0Ah - 42293 MSG_1492: - 42294 db 146 - 42295 db 'Switches may be preset in the DIRCMD environment variable. Override',0Dh,0Ah - 42296 db 'preset switches by prefixing any switch with - (hyphen)--for example, /-W.',0Dh,0Ah - 42297 MSG_1493: - 42298 db 22 - 42299 db ' [/S] [/B] [/L]',0Dh,0Ah - 42300 db 0Dh,0Ah - 42301 MSG_1494: - 42302 db 29 - 42303 db ' /L Uses lowercase.',0Dh,0Ah - 42304 db 0Dh,0Ah - 42305 %else - 42306 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42307 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:7AE5h - 42308 MSG_1480: - 42309 00007632 9F db 159 - 42310 00007633 446973706C61797320- db 'Displays a list of files and subdirectories in a directory.',0Dh,0Ah - 42310 0000763C 61206C697374206F66- - 42310 00007645 2066696C657320616E- - 42310 0000764E 642073756264697265- - 42310 00007657 63746F726965732069- - 42310 00007660 6E2061206469726563- - 42310 00007669 746F72792E0D0A - 42311 00007670 0D0A db 0Dh,0Ah - 42312 00007672 444952205B64726976- db 'DIR [drive:][path][filename] [/P] [/W] [/A[[:]attribs]] [/O[[:]sortord]]',0Dh,0Ah - 42312 0000767B 653A5D5B706174685D- - 42312 00007684 5B66696C656E616D65- - 42312 0000768D 5D205B2F505D205B2F- - 42312 00007696 575D205B2F415B5B3A- - 42312 0000769F 5D617474726962735D- - 42312 000076A8 5D205B2F4F5B5B3A5D- - 42312 000076B1 736F72746F72645D5D- - 42312 000076BA 0D0A - 42313 000076BC 202020205B2F535D20- db ' [/S] [/B] [/L]',0Dh,0Ah - 42313 000076C5 5B2F425D205B2F4C5D- - 42313 000076CE 0D0A - 42314 000076D0 0D0A db 0Dh,0Ah - 42315 MSG_1481: - 42316 000076D2 4D db 77 - 42317 000076D3 20205B64726976653A- db ' [drive:][path][filename] Specifies drive, directory, and files to list.',0Dh,0Ah - 42317 000076DC 5D5B706174685D5B66- - 42317 000076E5 696C656E616D655D20- - 42317 000076EE 202053706563696669- - 42317 000076F7 65732064726976652C- - 42317 00007700 206469726563746F72- - 42317 00007709 792C20616E64206669- - 42317 00007712 6C657320746F206C69- - 42317 0000771B 73742E0D0A - 42318 MSG_1482: - 42319 00007720 5B db 91 - 42320 00007721 20202F502020202020- db ' /P Pauses after each full screen of information.',0Dh,0Ah - 42320 0000772A 205061757365732061- - 42320 00007733 667465722065616368- - 42320 0000773C 2066756C6C20736372- - 42320 00007745 65656E206F6620696E- - 42320 0000774E 666F726D6174696F6E- - 42320 00007757 2E0D0A - 42321 0000775A 20202F572020202020- db ' /W Uses wide list format.',0Dh,0Ah - 42321 00007763 205573657320776964- - 42321 0000776C 65206C69737420666F- - 42321 00007775 726D61742E0D0A - 42322 MSG_1483: - 42323 0000777C 7E db 126 - 42324 0000777D 20202F412020202020- db ' /A Displays files with specified attributes.',0Dh,0Ah - 42324 00007786 20446973706C617973- - 42324 0000778F 2066696C6573207769- - 42324 00007798 746820737065636966- - 42324 000077A1 696564206174747269- - 42324 000077AA 62757465732E0D0A - 42325 000077B2 202061747472696273- db ' attribs D Directories R Read-only files H Hidden files',0Dh,0Ah - 42325 000077BB 202020442020446972- - 42325 000077C4 6563746F7269657320- - 42325 000077CD 202052202052656164- - 42325 000077D6 2D6F6E6C792066696C- - 42325 000077DF 657320202020202020- - 42325 000077E8 202048202048696464- - 42325 000077F1 656E2066696C65730D- - 42325 000077FA 0A - 42326 MSG_1484: - 42327 000077FB 7C db 124 - 42328 000077FC 202020202020202020- db ' S System files A Files ready to archive - Prefix meaning "not"',0Dh,0Ah - 42328 00007805 202020532020537973- - 42328 0000780E 74656D2066696C6573- - 42328 00007817 202041202046696C65- - 42328 00007820 732072656164792074- - 42328 00007829 6F2061726368697665- - 42328 00007832 20202D202050726566- - 42328 0000783B 6978206D65616E696E- - 42328 00007844 6720226E6F74220D0A - 42329 0000784D 20202F4F2020202020- db ' /O Lists by files in sorted order.',0Dh,0Ah - 42329 00007856 204C69737473206279- - 42329 0000785F 2066696C657320696E- - 42329 00007868 20736F72746564206F- - 42329 00007871 726465722E0D0A - 42330 MSG_1485: - 42331 00007878 95 db 149 - 42332 00007879 2020736F72746F7264- db ' sortord N By name (alphabetic) S By size (smallest first)',0Dh,0Ah - 42332 00007882 2020204E2020427920- - 42332 0000788B 6E616D652028616C70- - 42332 00007894 686162657469632920- - 42332 0000789D 202020202020532020- - 42332 000078A6 42792073697A652028- - 42332 000078AF 736D616C6C65737420- - 42332 000078B8 6669727374290D0A - 42333 000078C0 202020202020202020- db ' E By extension (alphabetic) D By date & time (earliest first)',0Dh,0Ah - 42333 000078C9 202020452020427920- - 42333 000078D2 657874656E73696F6E- - 42333 000078DB 2028616C7068616265- - 42333 000078E4 746963292020442020- - 42333 000078ED 427920646174652026- - 42333 000078F6 2074696D6520286561- - 42333 000078FF 726C69657374206669- - 42333 00007908 727374290D0A - 42334 MSG_1486: - 42335 0000790E 8F db 143 - 42336 0000790F 202020202020202020- db ' G Group directories first - Prefix to reverse order',0Dh,0Ah - 42336 00007918 20202047202047726F- - 42336 00007921 757020646972656374- - 42336 0000792A 6F7269657320666972- - 42336 00007933 7374202020202D2020- - 42336 0000793C 50726566697820746F- - 42336 00007945 207265766572736520- - 42336 0000794E 6F726465720D0A - 42337 00007955 20202F532020202020- db ' /S Displays files in specified directory and all subdirectories.',0Dh,0Ah - 42337 0000795E 20446973706C617973- - 42337 00007967 2066696C657320696E- - 42337 00007970 207370656369666965- - 42337 00007979 64206469726563746F- - 42337 00007982 727920616E6420616C- - 42337 0000798B 6C2073756264697265- - 42337 00007994 63746F726965732E0D- - 42337 0000799D 0A - 42338 MSG_1487: - 42339 0000799E 5E db 94 - 42340 0000799F 20202F422020202020- db ' /B Uses bare format (no heading information or summary).',0Dh,0Ah - 42340 000079A8 205573657320626172- - 42340 000079B1 6520666F726D617420- - 42340 000079BA 286E6F206865616469- - 42340 000079C3 6E6720696E666F726D- - 42340 000079CC 6174696F6E206F7220- - 42340 000079D5 73756D6D617279292E- - 42340 000079DE 0D0A - 42341 000079E0 20202F4C2020202020- db ' /L Uses lowercase.',0Dh,0Ah - 42341 000079E9 2055736573206C6F77- - 42341 000079F2 6572636173652E0D0A - 42342 000079FB 0D0A db 0Dh,0Ah - 42343 MSG_1488: - 42344 000079FD 92 db 146 - 42345 000079FE 537769746368657320- db 'Switches may be preset in the DIRCMD environment variable. Override',0Dh,0Ah - 42345 00007A07 6D6179206265207072- - 42345 00007A10 6573657420696E2074- - 42345 00007A19 686520444952434D44- - 42345 00007A22 20656E7669726F6E6D- - 42345 00007A2B 656E74207661726961- - 42345 00007A34 626C652E20204F7665- - 42345 00007A3D 72726964650D0A - 42346 00007A44 707265736574207377- db 'preset switches by prefixing any switch with - (hyphen)--for example, /-W.',0Dh,0Ah - 42346 00007A4D 697463686573206279- - 42346 00007A56 20707265666978696E- - 42346 00007A5F 6720616E7920737769- - 42346 00007A68 746368207769746820- - 42346 00007A71 2D202868797068656E- - 42346 00007A7A 292D2D666F72206578- - 42346 00007A83 616D706C652C202F2D- - 42346 00007A8C 572E0D0A - 42347 MSG_1489: - 42348 00007A90 50 db 80 - 42349 00007A91 546F2072656D6F7665- db 'To remove the commas from the DIR output, use the NO_SEP environment variable.',0Dh,0Ah - 42349 00007A9A 2074686520636F6D6D- - 42349 00007AA3 61732066726F6D2074- - 42349 00007AAC 686520444952206F75- - 42349 00007AB5 747075742C20757365- - 42349 00007ABE 20746865204E4F5F53- - 42349 00007AC7 455020656E7669726F- - 42349 00007AD0 6E6D656E7420766172- - 42349 00007AD9 6961626C652E0D0A - 42350 %endif - 42351 - 42352 MSG_1500: - 42353 00007AE1 3E db 62 - 42354 00007AE2 517569747320746865- db 'Quits the COMMAND.COM program (command interpreter).',0Dh,0Ah - 42354 00007AEB 20434F4D4D414E442E- - 42354 00007AF4 434F4D2070726F6772- - 42354 00007AFD 616D2028636F6D6D61- - 42354 00007B06 6E6420696E74657270- - 42354 00007B0F 7265746572292E0D0A - 42355 00007B18 0D0A db 0Dh,0Ah - 42356 00007B1A 455849540D0A db 'EXIT',0Dh,0Ah - 42357 MSG_1520: - 42358 00007B20 3D db 61 - 42359 00007B21 437265617465732061- db 'Creates a directory.',0Dh,0Ah - 42359 00007B2A 206469726563746F72- - 42359 00007B33 792E0D0A - 42360 00007B37 0D0A db 0Dh,0Ah - 42361 00007B39 4D4B444952205B6472- db 'MKDIR [drive:]path',0Dh,0Ah - 42361 00007B42 6976653A5D70617468- - 42361 00007B4B 0D0A - 42362 00007B4D 4D44205B6472697665- db 'MD [drive:]path',0Dh,0Ah - 42362 00007B56 3A5D706174680D0A - 42363 MSG_1540: - 42364 00007B5E 5D db 93 - 42365 00007B5F 446973706C61797320- db 'Displays or sets a search path for executable files.',0Dh,0Ah - 42365 00007B68 6F7220736574732061- - 42365 00007B71 207365617263682070- - 42365 00007B7A 61746820666F722065- - 42365 00007B83 786563757461626C65- - 42365 00007B8C 2066696C65732E0D0A - 42366 00007B95 0D0A db 0Dh,0Ah - 42367 00007B97 50415448205B5B6472- db 'PATH [[drive:]path[;...]]',0Dh,0Ah - 42367 00007BA0 6976653A5D70617468- - 42367 00007BA9 5B3B2E2E2E5D5D0D0A - 42368 00007BB2 50415448203B0D0A db 'PATH ;',0Dh,0Ah - 42369 00007BBA 0D0A db 0Dh,0Ah - 42370 MSG_1541: - 42371 00007BBC 6B db 107 - 42372 00007BBD 547970652050415448- db 'Type PATH ; to clear all search-path settings and direct PC DOS to search',0Dh,0Ah - 42372 00007BC6 203B20746F20636C65- - 42372 00007BCF 617220616C6C207365- - 42372 00007BD8 617263682D70617468- - 42372 00007BE1 2073657474696E6773- - 42372 00007BEA 20616E642064697265- - 42372 00007BF3 637420504320444F53- - 42372 00007BFC 20746F207365617263- - 42372 00007C05 680D0A - 42373 00007C08 6F6E6C7920696E2074- db 'only in the current directory.',0Dh,0Ah - 42373 00007C11 68652063757272656E- - 42373 00007C1A 74206469726563746F- - 42373 00007C23 72792E0D0A - 42374 MSG_1542: - 42375 00007C28 3B db 59 - 42376 00007C29 547970652050415448- db 'Type PATH without parameters to display the current path.',0Dh,0Ah - 42376 00007C32 20776974686F757420- - 42376 00007C3B 706172616D65746572- - 42376 00007C44 7320746F2064697370- - 42376 00007C4D 6C6179207468652063- - 42376 00007C56 757272656E74207061- - 42376 00007C5F 74682E0D0A - 42377 MSG_1560: - 42378 00007C64 37 db 55 - 42379 00007C65 4368616E6765732074- db 'Changes the PC DOS command prompt.',0Dh,0Ah - 42379 00007C6E 686520504320444F53- - 42379 00007C77 20636F6D6D616E6420- - 42379 00007C80 70726F6D70742E0D0A - 42380 00007C89 0D0A db 0Dh,0Ah - 42381 00007C8B 50524F4D5054205B74- db 'PROMPT [text]',0Dh,0Ah - 42381 00007C94 6578745D0D0A - 42382 00007C9A 0D0A db 0Dh,0Ah - 42383 MSG_1561: - 42384 00007C9C 7C db 124 - 42385 00007C9D 202074657874202020- db ' text Specifies a new command prompt.',0Dh,0Ah - 42385 00007CA6 205370656369666965- - 42385 00007CAF 732061206E65772063- - 42385 00007CB8 6F6D6D616E64207072- - 42385 00007CC1 6F6D70742E0D0A - 42386 00007CC8 0D0A db 0Dh,0Ah - 42387 00007CCA 50726F6D7074206361- db 'Prompt can be made up of normal characters and the following special codes:',0Dh,0Ah - 42387 00007CD3 6E206265206D616465- - 42387 00007CDC 207570206F66206E6F- - 42387 00007CE5 726D616C2063686172- - 42387 00007CEE 61637465727320616E- - 42387 00007CF7 642074686520666F6C- - 42387 00007D00 6C6F77696E67207370- - 42387 00007D09 656369616C20636F64- - 42387 00007D12 65733A0D0A - 42388 00007D17 0D0A db 0Dh,0Ah - 42389 MSG_1562: - 42390 00007D19 2F db 47 - 42391 00007D1A 202024512020203D20- db ' $Q = (equal sign)',0Dh,0Ah - 42391 00007D23 28657175616C207369- - 42391 00007D2C 676E290D0A - 42392 00007D31 202024242020202420- db ' $$ $ (dollar sign)',0Dh,0Ah - 42392 00007D3A 28646F6C6C61722073- - 42392 00007D43 69676E290D0A - 42393 MSG_1563: - 42394 00007D49 2A db 42 - 42395 00007D4A 202024542020204375- db ' $T Current time',0Dh,0Ah - 42395 00007D53 7272656E742074696D- - 42395 00007D5C 650D0A - 42396 00007D5F 202024442020204375- db ' $D Current date',0Dh,0Ah - 42396 00007D68 7272656E7420646174- - 42396 00007D71 650D0A - 42397 MSG_1564: - 42398 00007D74 3D db 61 - 42399 00007D75 202024502020204375- db ' $P Current drive and path',0Dh,0Ah - 42399 00007D7E 7272656E7420647269- - 42399 00007D87 766520616E64207061- - 42399 00007D90 74680D0A - 42400 00007D94 202024562020204D53- db ' $V MS-DOS version number',0Dh,0Ah - 42400 00007D9D 2D444F532076657273- - 42400 00007DA6 696F6E206E756D6265- - 42400 00007DAF 720D0A - 42401 MSG_1565: - 42402 00007DB2 34 db 52 - 42403 00007DB3 2020244E2020204375- db ' $N Current drive',0Dh,0Ah - 42403 00007DBC 7272656E7420647269- - 42403 00007DC5 76650D0A - 42404 00007DC9 202024472020203E20- db ' $G > (greater-than sign)',0Dh,0Ah - 42404 00007DD2 28677265617465722D- - 42404 00007DDB 7468616E207369676E- - 42404 00007DE4 290D0A - 42405 MSG_1566: - 42406 00007DE7 2C db 44 - 42407 00007DE8 2020244C2020203C20- db ' $L < (less-than sign)',0Dh,0Ah - 42407 00007DF1 286C6573732D746861- - 42407 00007DFA 6E207369676E290D0A - 42408 00007E03 202024422020207C20- db ' $B | (pipe)',0Dh,0Ah - 42408 00007E0C 2870697065290D0A - 42409 MSG_1567: - 42410 00007E14 79 db 121 - 42411 00007E15 202024482020204261- db ' $H Backspace (erases previous character)',0Dh,0Ah - 42411 00007E1E 636B73706163652028- - 42411 00007E27 657261736573207072- - 42411 00007E30 6576696F7573206368- - 42411 00007E39 61726163746572290D- - 42411 00007E42 0A - 42412 00007E43 202024452020204573- db ' $E Escape code (ASCII code 27)',0Dh,0Ah - 42412 00007E4C 6361706520636F6465- - 42412 00007E55 202841534349492063- - 42412 00007E5E 6F6465203237290D0A - 42413 00007E67 2020245F2020204361- db ' $_ Carriage return and linefeed',0Dh,0Ah - 42413 00007E70 727269616765207265- - 42413 00007E79 7475726E20616E6420- - 42413 00007E82 6C696E65666565640D- - 42413 00007E8B 0A - 42414 00007E8C 0D0A db 0Dh,0Ah - 42415 MSG_1568: - 42416 00007E8E 4C db 76 - 42417 00007E8F 547970652050524F4D- db 'Type PROMPT without parameters to reset the prompt to the default setting.',0Dh,0Ah - 42417 00007E98 505420776974686F75- - 42417 00007EA1 7420706172616D6574- - 42417 00007EAA 65727320746F207265- - 42417 00007EB3 736574207468652070- - 42417 00007EBC 726F6D707420746F20- - 42417 00007EC5 746865206465666175- - 42417 00007ECE 6C742073657474696E- - 42417 00007ED7 672E0D0A - 42418 MSG_1580: - 42419 00007EDB 47 db 71 - 42420 00007EDC 52656D6F7665732028- db 'Removes (deletes) a directory.',0Dh,0Ah - 42420 00007EE5 64656C657465732920- - 42420 00007EEE 61206469726563746F- - 42420 00007EF7 72792E0D0A - 42421 00007EFC 0D0A db 0Dh,0Ah - 42422 00007EFE 524D444952205B6472- db 'RMDIR [drive:]path',0Dh,0Ah - 42422 00007F07 6976653A5D70617468- - 42422 00007F10 0D0A - 42423 00007F12 5244205B6472697665- db 'RD [drive:]path',0Dh,0Ah - 42423 00007F1B 3A5D706174680D0A - 42424 MSG_1600: - 42425 00007F23 1C db 28 - 42426 00007F24 52656E616D65732061- db 'Renames a file or files.',0Dh,0Ah - 42426 00007F2D 2066696C65206F7220- - 42426 00007F36 66696C65732E0D0A - 42427 00007F3E 0D0A db 0Dh,0Ah - 42428 MSG_1601: - 42429 00007F40 53 db 83 - 42430 00007F41 52454E414D45205B64- db 'RENAME [drive:][path]filename1 filename2',0Dh,0Ah - 42430 00007F4A 726976653A5D5B7061- - 42430 00007F53 74685D66696C656E61- - 42430 00007F5C 6D65312066696C656E- - 42430 00007F65 616D65320D0A - 42431 00007F6B 52454E205B64726976- db 'REN [drive:][path]filename1 filename2',0Dh,0Ah - 42431 00007F74 653A5D5B706174685D- - 42431 00007F7D 66696C656E616D6531- - 42431 00007F86 2066696C656E616D65- - 42431 00007F8F 320D0A - 42432 00007F92 0D0A db 0Dh,0Ah - 42433 MSG_1602: - 42434 ;db 77 - 42435 ;db 'Note that you cannot specify a new drive or path for your destination file.',0Dh,0Ah - 42436 - 42437 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42438 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:8697h + 42207 db 'DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]',0Dh,0Ah + 42208 db ' [/O[[:]sortorder]] [/S] [/B] [/L]',0Dh,0Ah + 42209 db 0Dh,0Ah + 42210 MSG_1481: + 42211 db 93 + 42212 db ' [drive:][path][filename]',0Dh,0Ah + 42213 db ' Specifies drive, directory, and/or files to list.',0Dh,0Ah + 42214 MSG_1482: + 42215 db 97 + 42216 db ' /P Pauses after each screenful of information.',0Dh,0Ah + 42217 db ' /W Uses wide list format.',0Dh,0Ah + 42218 MSG_1483: + 42219 db 122 + 42220 db ' /A Displays files with specified attributes.',0Dh,0Ah + 42221 db ' attributes D Directories R Read-only files',0Dh,0Ah + 42222 MSG_1484: + 42223 db 191 + 42224 db ' H Hidden files A Files ready for archiving',0Dh,0Ah + 42225 db ' S System files - Prefix meaning "not"',0Dh,0Ah + 42226 db ' /O List by files in sorted order.',0Dh,0Ah + 42227 MSG_1485: + 42228 db 155 + 42229 db ' sortorder N By name (alphabetic) S By size (smallest first)',0Dh,0Ah + 42230 db ' E By extension (alphabetic) D By date & time (earliest first)',0Dh,0Ah + 42231 MSG_1486: + 42232 db 150 + 42233 db ' G Group directories first - Prefix to reverse order',0Dh,0Ah + 42234 db ' /S Displays files in specified directory and all subdirectories.',0Dh,0Ah + 42235 MSG_1487: + 42236 db 102 + 42237 db ' /B Uses bare format (no heading information or summary).',0Dh,0Ah + 42238 db ' /L Uses lowercase.',0Dh,0Ah + 42239 db 0Dh,0Ah + 42240 MSG_1488: + 42241 db 146 + 42242 db 'Switches may be preset in the DIRCMD environment variable. Override',0Dh,0Ah + 42243 db 'preset switches by prefixing any switch with - (hyphen)--for example, /-W.',0Dh,0Ah + 42244 %endif + 42245 + 42246 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42247 %if 0 + 42248 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42249 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:7CBFh + 42250 MSG_1480: + 42251 db 137 + 42252 db 'Displays a list of files and subdirectories in a directory.',0Dh,0Ah + 42253 db 0Dh,0Ah + 42254 db 'DIR [drive:][path][filename] [/P] [/W] [/A[[:]attribs]] [/O[[:]sortord]]',0Dh,0Ah + 42255 MSG_1481: + 42256 db 30 + 42257 db ' [/S] [/B] [/L] [/C[H]]',0Dh,0Ah + 42258 db 0Dh,0Ah + 42259 MSG_1482: + 42260 db 80 + 42261 db ' [drive:][path][filename] Specifies drive, directory, and/or files to list.',0Dh,0Ah + 42262 MSG_1483: + 42263 db 89 + 42264 db ' /P Pauses after each screenful of information.',0Dh,0Ah + 42265 db ' /W Uses wide list format.',0Dh,0Ah + 42266 MSG_1484: + 42267 db 126 + 42268 db ' /A Displays files with specified attributes.',0Dh,0Ah + 42269 db ' attribs D Directories R Read-only files H Hidden files',0Dh,0Ah + 42270 MSG_1485: + 42271 db 123 + 42272 db ' S System files A Files ready to archive - Prefix meaning "not"',0Dh,0Ah + 42273 db ' /O List by files in sorted order.',0Dh,0Ah + 42274 MSG_1486: + 42275 db 149 + 42276 db ' sortord N By name (alphabetic) S By size (smallest first)',0Dh,0Ah + 42277 db ' E By extension (alphabetic) D By date & time (earliest first)',0Dh,0Ah + 42278 MSG_1487: + 42279 db 70 + 42280 db ' G Group directories first - Prefix to reverse order',0Dh,0Ah + 42281 MSG_1488: + 42282 db 127 + 42283 db ' C By compression ratio (smallest first)',0Dh,0Ah + 42284 db ' /S Displays files in specified directory and all subdirectories.',0Dh,0Ah + 42285 MSG_1489: + 42286 db 65 + 42287 db ' /B Uses bare format (no heading information or summary).',0Dh,0Ah + 42288 + 42289 MSG_1490: + 42290 db 27 + 42291 db ' /L Uses lowercase.',0Dh,0Ah + 42292 MSG_1491: + 42293 db 82 + 42294 db ' /C[H] Displays file compression ratio; /CH uses host allocation unit size.',0Dh,0Ah + 42295 db 0Dh,0Ah + 42296 MSG_1492: + 42297 db 146 + 42298 db 'Switches may be preset in the DIRCMD environment variable. Override',0Dh,0Ah + 42299 db 'preset switches by prefixing any switch with - (hyphen)--for example, /-W.',0Dh,0Ah + 42300 MSG_1493: + 42301 db 22 + 42302 db ' [/S] [/B] [/L]',0Dh,0Ah + 42303 db 0Dh,0Ah + 42304 MSG_1494: + 42305 db 29 + 42306 db ' /L Uses lowercase.',0Dh,0Ah + 42307 db 0Dh,0Ah + 42308 %else + 42309 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42310 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:7AE5h + 42311 MSG_1480: + 42312 00007632 9F db 159 + 42313 00007633 446973706C61797320- db 'Displays a list of files and subdirectories in a directory.',0Dh,0Ah + 42313 0000763C 61206C697374206F66- + 42313 00007645 2066696C657320616E- + 42313 0000764E 642073756264697265- + 42313 00007657 63746F726965732069- + 42313 00007660 6E2061206469726563- + 42313 00007669 746F72792E0D0A + 42314 00007670 0D0A db 0Dh,0Ah + 42315 00007672 444952205B64726976- db 'DIR [drive:][path][filename] [/P] [/W] [/A[[:]attribs]] [/O[[:]sortord]]',0Dh,0Ah + 42315 0000767B 653A5D5B706174685D- + 42315 00007684 5B66696C656E616D65- + 42315 0000768D 5D205B2F505D205B2F- + 42315 00007696 575D205B2F415B5B3A- + 42315 0000769F 5D617474726962735D- + 42315 000076A8 5D205B2F4F5B5B3A5D- + 42315 000076B1 736F72746F72645D5D- + 42315 000076BA 0D0A + 42316 000076BC 202020205B2F535D20- db ' [/S] [/B] [/L]',0Dh,0Ah + 42316 000076C5 5B2F425D205B2F4C5D- + 42316 000076CE 0D0A + 42317 000076D0 0D0A db 0Dh,0Ah + 42318 MSG_1481: + 42319 000076D2 4D db 77 + 42320 000076D3 20205B64726976653A- db ' [drive:][path][filename] Specifies drive, directory, and files to list.',0Dh,0Ah + 42320 000076DC 5D5B706174685D5B66- + 42320 000076E5 696C656E616D655D20- + 42320 000076EE 202053706563696669- + 42320 000076F7 65732064726976652C- + 42320 00007700 206469726563746F72- + 42320 00007709 792C20616E64206669- + 42320 00007712 6C657320746F206C69- + 42320 0000771B 73742E0D0A + 42321 MSG_1482: + 42322 00007720 5B db 91 + 42323 00007721 20202F502020202020- db ' /P Pauses after each full screen of information.',0Dh,0Ah + 42323 0000772A 205061757365732061- + 42323 00007733 667465722065616368- + 42323 0000773C 2066756C6C20736372- + 42323 00007745 65656E206F6620696E- + 42323 0000774E 666F726D6174696F6E- + 42323 00007757 2E0D0A + 42324 0000775A 20202F572020202020- db ' /W Uses wide list format.',0Dh,0Ah + 42324 00007763 205573657320776964- + 42324 0000776C 65206C69737420666F- + 42324 00007775 726D61742E0D0A + 42325 MSG_1483: + 42326 0000777C 7E db 126 + 42327 0000777D 20202F412020202020- db ' /A Displays files with specified attributes.',0Dh,0Ah + 42327 00007786 20446973706C617973- + 42327 0000778F 2066696C6573207769- + 42327 00007798 746820737065636966- + 42327 000077A1 696564206174747269- + 42327 000077AA 62757465732E0D0A + 42328 000077B2 202061747472696273- db ' attribs D Directories R Read-only files H Hidden files',0Dh,0Ah + 42328 000077BB 202020442020446972- + 42328 000077C4 6563746F7269657320- + 42328 000077CD 202052202052656164- + 42328 000077D6 2D6F6E6C792066696C- + 42328 000077DF 657320202020202020- + 42328 000077E8 202048202048696464- + 42328 000077F1 656E2066696C65730D- + 42328 000077FA 0A + 42329 MSG_1484: + 42330 000077FB 7C db 124 + 42331 000077FC 202020202020202020- db ' S System files A Files ready to archive - Prefix meaning "not"',0Dh,0Ah + 42331 00007805 202020532020537973- + 42331 0000780E 74656D2066696C6573- + 42331 00007817 202041202046696C65- + 42331 00007820 732072656164792074- + 42331 00007829 6F2061726368697665- + 42331 00007832 20202D202050726566- + 42331 0000783B 6978206D65616E696E- + 42331 00007844 6720226E6F74220D0A + 42332 0000784D 20202F4F2020202020- db ' /O Lists by files in sorted order.',0Dh,0Ah + 42332 00007856 204C69737473206279- + 42332 0000785F 2066696C657320696E- + 42332 00007868 20736F72746564206F- + 42332 00007871 726465722E0D0A + 42333 MSG_1485: + 42334 00007878 95 db 149 + 42335 00007879 2020736F72746F7264- db ' sortord N By name (alphabetic) S By size (smallest first)',0Dh,0Ah + 42335 00007882 2020204E2020427920- + 42335 0000788B 6E616D652028616C70- + 42335 00007894 686162657469632920- + 42335 0000789D 202020202020532020- + 42335 000078A6 42792073697A652028- + 42335 000078AF 736D616C6C65737420- + 42335 000078B8 6669727374290D0A + 42336 000078C0 202020202020202020- db ' E By extension (alphabetic) D By date & time (earliest first)',0Dh,0Ah + 42336 000078C9 202020452020427920- + 42336 000078D2 657874656E73696F6E- + 42336 000078DB 2028616C7068616265- + 42336 000078E4 746963292020442020- + 42336 000078ED 427920646174652026- + 42336 000078F6 2074696D6520286561- + 42336 000078FF 726C69657374206669- + 42336 00007908 727374290D0A + 42337 MSG_1486: + 42338 0000790E 8F db 143 + 42339 0000790F 202020202020202020- db ' G Group directories first - Prefix to reverse order',0Dh,0Ah + 42339 00007918 20202047202047726F- + 42339 00007921 757020646972656374- + 42339 0000792A 6F7269657320666972- + 42339 00007933 7374202020202D2020- + 42339 0000793C 50726566697820746F- + 42339 00007945 207265766572736520- + 42339 0000794E 6F726465720D0A + 42340 00007955 20202F532020202020- db ' /S Displays files in specified directory and all subdirectories.',0Dh,0Ah + 42340 0000795E 20446973706C617973- + 42340 00007967 2066696C657320696E- + 42340 00007970 207370656369666965- + 42340 00007979 64206469726563746F- + 42340 00007982 727920616E6420616C- + 42340 0000798B 6C2073756264697265- + 42340 00007994 63746F726965732E0D- + 42340 0000799D 0A + 42341 MSG_1487: + 42342 0000799E 5E db 94 + 42343 0000799F 20202F422020202020- db ' /B Uses bare format (no heading information or summary).',0Dh,0Ah + 42343 000079A8 205573657320626172- + 42343 000079B1 6520666F726D617420- + 42343 000079BA 286E6F206865616469- + 42343 000079C3 6E6720696E666F726D- + 42343 000079CC 6174696F6E206F7220- + 42343 000079D5 73756D6D617279292E- + 42343 000079DE 0D0A + 42344 000079E0 20202F4C2020202020- db ' /L Uses lowercase.',0Dh,0Ah + 42344 000079E9 2055736573206C6F77- + 42344 000079F2 6572636173652E0D0A + 42345 000079FB 0D0A db 0Dh,0Ah + 42346 MSG_1488: + 42347 000079FD 92 db 146 + 42348 000079FE 537769746368657320- db 'Switches may be preset in the DIRCMD environment variable. Override',0Dh,0Ah + 42348 00007A07 6D6179206265207072- + 42348 00007A10 6573657420696E2074- + 42348 00007A19 686520444952434D44- + 42348 00007A22 20656E7669726F6E6D- + 42348 00007A2B 656E74207661726961- + 42348 00007A34 626C652E20204F7665- + 42348 00007A3D 72726964650D0A + 42349 00007A44 707265736574207377- db 'preset switches by prefixing any switch with - (hyphen)--for example, /-W.',0Dh,0Ah + 42349 00007A4D 697463686573206279- + 42349 00007A56 20707265666978696E- + 42349 00007A5F 6720616E7920737769- + 42349 00007A68 746368207769746820- + 42349 00007A71 2D202868797068656E- + 42349 00007A7A 292D2D666F72206578- + 42349 00007A83 616D706C652C202F2D- + 42349 00007A8C 572E0D0A + 42350 MSG_1489: + 42351 00007A90 50 db 80 + 42352 00007A91 546F2072656D6F7665- db 'To remove the commas from the DIR output, use the NO_SEP environment variable.',0Dh,0Ah + 42352 00007A9A 2074686520636F6D6D- + 42352 00007AA3 61732066726F6D2074- + 42352 00007AAC 686520444952206F75- + 42352 00007AB5 747075742C20757365- + 42352 00007ABE 20746865204E4F5F53- + 42352 00007AC7 455020656E7669726F- + 42352 00007AD0 6E6D656E7420766172- + 42352 00007AD9 6961626C652E0D0A + 42353 %endif + 42354 + 42355 MSG_1500: + 42356 00007AE1 3E db 62 + 42357 00007AE2 517569747320746865- db 'Quits the COMMAND.COM program (command interpreter).',0Dh,0Ah + 42357 00007AEB 20434F4D4D414E442E- + 42357 00007AF4 434F4D2070726F6772- + 42357 00007AFD 616D2028636F6D6D61- + 42357 00007B06 6E6420696E74657270- + 42357 00007B0F 7265746572292E0D0A + 42358 00007B18 0D0A db 0Dh,0Ah + 42359 00007B1A 455849540D0A db 'EXIT',0Dh,0Ah + 42360 MSG_1520: + 42361 00007B20 3D db 61 + 42362 00007B21 437265617465732061- db 'Creates a directory.',0Dh,0Ah + 42362 00007B2A 206469726563746F72- + 42362 00007B33 792E0D0A + 42363 00007B37 0D0A db 0Dh,0Ah + 42364 00007B39 4D4B444952205B6472- db 'MKDIR [drive:]path',0Dh,0Ah + 42364 00007B42 6976653A5D70617468- + 42364 00007B4B 0D0A + 42365 00007B4D 4D44205B6472697665- db 'MD [drive:]path',0Dh,0Ah + 42365 00007B56 3A5D706174680D0A + 42366 MSG_1540: + 42367 00007B5E 5D db 93 + 42368 00007B5F 446973706C61797320- db 'Displays or sets a search path for executable files.',0Dh,0Ah + 42368 00007B68 6F7220736574732061- + 42368 00007B71 207365617263682070- + 42368 00007B7A 61746820666F722065- + 42368 00007B83 786563757461626C65- + 42368 00007B8C 2066696C65732E0D0A + 42369 00007B95 0D0A db 0Dh,0Ah + 42370 00007B97 50415448205B5B6472- db 'PATH [[drive:]path[;...]]',0Dh,0Ah + 42370 00007BA0 6976653A5D70617468- + 42370 00007BA9 5B3B2E2E2E5D5D0D0A + 42371 00007BB2 50415448203B0D0A db 'PATH ;',0Dh,0Ah + 42372 00007BBA 0D0A db 0Dh,0Ah + 42373 MSG_1541: + 42374 00007BBC 6B db 107 + 42375 00007BBD 547970652050415448- db 'Type PATH ; to clear all search-path settings and direct PC DOS to search',0Dh,0Ah + 42375 00007BC6 203B20746F20636C65- + 42375 00007BCF 617220616C6C207365- + 42375 00007BD8 617263682D70617468- + 42375 00007BE1 2073657474696E6773- + 42375 00007BEA 20616E642064697265- + 42375 00007BF3 637420504320444F53- + 42375 00007BFC 20746F207365617263- + 42375 00007C05 680D0A + 42376 00007C08 6F6E6C7920696E2074- db 'only in the current directory.',0Dh,0Ah + 42376 00007C11 68652063757272656E- + 42376 00007C1A 74206469726563746F- + 42376 00007C23 72792E0D0A + 42377 MSG_1542: + 42378 00007C28 3B db 59 + 42379 00007C29 547970652050415448- db 'Type PATH without parameters to display the current path.',0Dh,0Ah + 42379 00007C32 20776974686F757420- + 42379 00007C3B 706172616D65746572- + 42379 00007C44 7320746F2064697370- + 42379 00007C4D 6C6179207468652063- + 42379 00007C56 757272656E74207061- + 42379 00007C5F 74682E0D0A + 42380 MSG_1560: + 42381 00007C64 37 db 55 + 42382 00007C65 4368616E6765732074- db 'Changes the PC DOS command prompt.',0Dh,0Ah + 42382 00007C6E 686520504320444F53- + 42382 00007C77 20636F6D6D616E6420- + 42382 00007C80 70726F6D70742E0D0A + 42383 00007C89 0D0A db 0Dh,0Ah + 42384 00007C8B 50524F4D5054205B74- db 'PROMPT [text]',0Dh,0Ah + 42384 00007C94 6578745D0D0A + 42385 00007C9A 0D0A db 0Dh,0Ah + 42386 MSG_1561: + 42387 00007C9C 7C db 124 + 42388 00007C9D 202074657874202020- db ' text Specifies a new command prompt.',0Dh,0Ah + 42388 00007CA6 205370656369666965- + 42388 00007CAF 732061206E65772063- + 42388 00007CB8 6F6D6D616E64207072- + 42388 00007CC1 6F6D70742E0D0A + 42389 00007CC8 0D0A db 0Dh,0Ah + 42390 00007CCA 50726F6D7074206361- db 'Prompt can be made up of normal characters and the following special codes:',0Dh,0Ah + 42390 00007CD3 6E206265206D616465- + 42390 00007CDC 207570206F66206E6F- + 42390 00007CE5 726D616C2063686172- + 42390 00007CEE 61637465727320616E- + 42390 00007CF7 642074686520666F6C- + 42390 00007D00 6C6F77696E67207370- + 42390 00007D09 656369616C20636F64- + 42390 00007D12 65733A0D0A + 42391 00007D17 0D0A db 0Dh,0Ah + 42392 MSG_1562: + 42393 00007D19 2F db 47 + 42394 00007D1A 202024512020203D20- db ' $Q = (equal sign)',0Dh,0Ah + 42394 00007D23 28657175616C207369- + 42394 00007D2C 676E290D0A + 42395 00007D31 202024242020202420- db ' $$ $ (dollar sign)',0Dh,0Ah + 42395 00007D3A 28646F6C6C61722073- + 42395 00007D43 69676E290D0A + 42396 MSG_1563: + 42397 00007D49 2A db 42 + 42398 00007D4A 202024542020204375- db ' $T Current time',0Dh,0Ah + 42398 00007D53 7272656E742074696D- + 42398 00007D5C 650D0A + 42399 00007D5F 202024442020204375- db ' $D Current date',0Dh,0Ah + 42399 00007D68 7272656E7420646174- + 42399 00007D71 650D0A + 42400 MSG_1564: + 42401 00007D74 3D db 61 + 42402 00007D75 202024502020204375- db ' $P Current drive and path',0Dh,0Ah + 42402 00007D7E 7272656E7420647269- + 42402 00007D87 766520616E64207061- + 42402 00007D90 74680D0A + 42403 00007D94 202024562020204D53- db ' $V MS-DOS version number',0Dh,0Ah + 42403 00007D9D 2D444F532076657273- + 42403 00007DA6 696F6E206E756D6265- + 42403 00007DAF 720D0A + 42404 MSG_1565: + 42405 00007DB2 34 db 52 + 42406 00007DB3 2020244E2020204375- db ' $N Current drive',0Dh,0Ah + 42406 00007DBC 7272656E7420647269- + 42406 00007DC5 76650D0A + 42407 00007DC9 202024472020203E20- db ' $G > (greater-than sign)',0Dh,0Ah + 42407 00007DD2 28677265617465722D- + 42407 00007DDB 7468616E207369676E- + 42407 00007DE4 290D0A + 42408 MSG_1566: + 42409 00007DE7 2C db 44 + 42410 00007DE8 2020244C2020203C20- db ' $L < (less-than sign)',0Dh,0Ah + 42410 00007DF1 286C6573732D746861- + 42410 00007DFA 6E207369676E290D0A + 42411 00007E03 202024422020207C20- db ' $B | (pipe)',0Dh,0Ah + 42411 00007E0C 2870697065290D0A + 42412 MSG_1567: + 42413 00007E14 79 db 121 + 42414 00007E15 202024482020204261- db ' $H Backspace (erases previous character)',0Dh,0Ah + 42414 00007E1E 636B73706163652028- + 42414 00007E27 657261736573207072- + 42414 00007E30 6576696F7573206368- + 42414 00007E39 61726163746572290D- + 42414 00007E42 0A + 42415 00007E43 202024452020204573- db ' $E Escape code (ASCII code 27)',0Dh,0Ah + 42415 00007E4C 6361706520636F6465- + 42415 00007E55 202841534349492063- + 42415 00007E5E 6F6465203237290D0A + 42416 00007E67 2020245F2020204361- db ' $_ Carriage return and linefeed',0Dh,0Ah + 42416 00007E70 727269616765207265- + 42416 00007E79 7475726E20616E6420- + 42416 00007E82 6C696E65666565640D- + 42416 00007E8B 0A + 42417 00007E8C 0D0A db 0Dh,0Ah + 42418 MSG_1568: + 42419 00007E8E 4C db 76 + 42420 00007E8F 547970652050524F4D- db 'Type PROMPT without parameters to reset the prompt to the default setting.',0Dh,0Ah + 42420 00007E98 505420776974686F75- + 42420 00007EA1 7420706172616D6574- + 42420 00007EAA 65727320746F207265- + 42420 00007EB3 736574207468652070- + 42420 00007EBC 726F6D707420746F20- + 42420 00007EC5 746865206465666175- + 42420 00007ECE 6C742073657474696E- + 42420 00007ED7 672E0D0A + 42421 MSG_1580: + 42422 00007EDB 47 db 71 + 42423 00007EDC 52656D6F7665732028- db 'Removes (deletes) a directory.',0Dh,0Ah + 42423 00007EE5 64656C657465732920- + 42423 00007EEE 61206469726563746F- + 42423 00007EF7 72792E0D0A + 42424 00007EFC 0D0A db 0Dh,0Ah + 42425 00007EFE 524D444952205B6472- db 'RMDIR [drive:]path',0Dh,0Ah + 42425 00007F07 6976653A5D70617468- + 42425 00007F10 0D0A + 42426 00007F12 5244205B6472697665- db 'RD [drive:]path',0Dh,0Ah + 42426 00007F1B 3A5D706174680D0A + 42427 MSG_1600: + 42428 00007F23 1C db 28 + 42429 00007F24 52656E616D65732061- db 'Renames a file or files.',0Dh,0Ah + 42429 00007F2D 2066696C65206F7220- + 42429 00007F36 66696C65732E0D0A + 42430 00007F3E 0D0A db 0Dh,0Ah + 42431 MSG_1601: + 42432 00007F40 53 db 83 + 42433 00007F41 52454E414D45205B64- db 'RENAME [drive:][path]filename1 filename2',0Dh,0Ah + 42433 00007F4A 726976653A5D5B7061- + 42433 00007F53 74685D66696C656E61- + 42433 00007F5C 6D65312066696C656E- + 42433 00007F65 616D65320D0A + 42434 00007F6B 52454E205B64726976- db 'REN [drive:][path]filename1 filename2',0Dh,0Ah + 42434 00007F74 653A5D5B706174685D- + 42434 00007F7D 66696C656E616D6531- + 42434 00007F86 2066696C656E616D65- + 42434 00007F8F 320D0A + 42435 00007F92 0D0A db 0Dh,0Ah + 42436 MSG_1602: + 42437 ;db 77 + 42438 ;db 'Note that you cannot specify a new drive or path for your destination file.',0Dh,0Ah 42439 - 42440 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42441 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:8447h - 42442 MSG_1602: - 42443 00007F94 A0 db 160 - 42444 00007F95 4E6F74652074686174- db 'Note that you cannot specify a new drive or path for your destination file.',0Dh,0Ah - 42444 00007F9E 20796F752063616E6E- - 42444 00007FA7 6F7420737065636966- - 42444 00007FB0 792061206E65772064- - 42444 00007FB9 72697665206F722070- - 42444 00007FC2 61746820666F722079- - 42444 00007FCB 6F7572206465737469- - 42444 00007FD4 6E6174696F6E206669- - 42444 00007FDD 6C652E0D0A - 42445 00007FE2 0D0A db 0Dh,0Ah - 42446 00007FE4 557365204D4F564520- db 'Use MOVE to rename a directory, or to move files from one directory to another.',0Dh,0Ah - 42446 00007FED 746F2072656E616D65- - 42446 00007FF6 206120646972656374- - 42446 00007FFF 6F72792C206F722074- - 42446 00008008 6F206D6F7665206669- - 42446 00008011 6C65732066726F6D20- - 42446 0000801A 6F6E65206469726563- - 42446 00008023 746F727920746F2061- - 42446 0000802C 6E6F746865722E0D0A - 42447 MSG_1620: - 42448 00008035 57 db 87 - 42449 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42450 %if 0 - 42451 db 'Displays, sets, or removes MS-DOS environment variables.',0Dh,0Ah - 42452 %else - 42453 00008036 446973706C6179732C- db 'Displays, sets, or removes PC DOS environment variables.',0Dh,0Ah - 42453 0000803F 20736574732C206F72- - 42453 00008048 2072656D6F76657320- - 42453 00008051 504320444F5320656E- - 42453 0000805A 7669726F6E6D656E74- - 42453 00008063 207661726961626C65- - 42453 0000806C 732E0D0A - 42454 %endif - 42455 00008070 0D0A db 0Dh,0Ah - 42456 00008072 534554205B76617269- db 'SET [variable=[string]]',0Dh,0Ah - 42456 0000807B 61626C653D5B737472- - 42456 00008084 696E675D5D0D0A - 42457 0000808B 0D0A db 0Dh,0Ah - 42458 MSG_1621: - 42459 0000808D 81 db 129 - 42460 0000808E 20207661726961626C- db ' variable Specifies the environment-variable name.',0Dh,0Ah - 42460 00008097 652020537065636966- - 42460 000080A0 696573207468652065- - 42460 000080A9 6E7669726F6E6D656E- - 42460 000080B2 742D7661726961626C- - 42460 000080BB 65206E616D652E0D0A - 42461 000080C4 2020737472696E6720- db ' string Specifies a series of characters to assign to the variable.',0Dh,0Ah - 42461 000080CD 202020537065636966- - 42461 000080D6 696573206120736572- - 42461 000080DF 696573206F66206368- - 42461 000080E8 617261637465727320- - 42461 000080F1 746F2061737369676E- - 42461 000080FA 20746F207468652076- - 42461 00008103 61726961626C652E0D- - 42461 0000810C 0A - 42462 0000810D 0D0A db 0Dh,0Ah - 42463 MSG_1622: - 42464 0000810F 4B db 75 - 42465 00008110 547970652053455420- db 'Type SET without parameters to display the current environment variables.',0Dh,0Ah - 42465 00008119 776974686F75742070- - 42465 00008122 6172616D6574657273- - 42465 0000812B 20746F20646973706C- - 42465 00008134 617920746865206375- - 42465 0000813D 7272656E7420656E76- - 42465 00008146 69726F6E6D656E7420- - 42465 0000814F 7661726961626C6573- - 42465 00008158 2E0D0A - 42466 MSG_1640: - 42467 ;db 52 - 42468 ;db 'Displays or sets the system time.',0Dh,0Ah - 42469 ;db 0Dh,0Ah - 42470 ;db 'TIME [time]',0Dh,0Ah - 42471 ;db 0Dh,0Ah - 42472 - 42473 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42474 %if 0 - 42475 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42476 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:885Eh) - 42477 db 45 - 42478 db 'Displays or sets the time.',0Dh,0Ah - 42479 db 0Dh,0Ah - 42480 db 'TIME [time]',0Dh,0Ah - 42481 db 0Dh,0Ah - 42482 %else - 42483 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42484 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:860Eh - 42485 0000815B 34 db 52 - 42486 0000815C 446973706C61797320- db 'Displays or sets the system time.',0Dh,0Ah - 42486 00008165 6F7220736574732074- - 42486 0000816E 68652073797374656D- - 42486 00008177 2074696D652E0D0A - 42487 0000817F 0D0A db 0Dh,0Ah - 42488 00008181 54494D45205B74696D- db 'TIME [time]',0Dh,0Ah - 42488 0000818A 655D0D0A - 42489 0000818E 0D0A db 0Dh,0Ah - 42490 %endif - 42491 - 42492 MSG_1641: - 42493 00008190 83 db 131 - 42494 00008191 547970652054494D45- db 'Type TIME with no parameters to display the current time setting and a prompt',0Dh,0Ah - 42494 0000819A 2077697468206E6F20- - 42494 000081A3 706172616D65746572- - 42494 000081AC 7320746F2064697370- - 42494 000081B5 6C6179207468652063- - 42494 000081BE 757272656E74207469- - 42494 000081C7 6D652073657474696E- - 42494 000081D0 6720616E6420612070- - 42494 000081D9 726F6D70740D0A - 42495 000081E0 666F722061206E6577- db 'for a new one. Press ENTER to keep the same time.',0Dh,0Ah - 42495 000081E9 206F6E652E20205072- - 42495 000081F2 65737320454E544552- - 42495 000081FB 20746F206B65657020- - 42495 00008204 7468652073616D6520- - 42495 0000820D 74696D652E0D0A - 42496 MSG_1660: - 42497 00008214 46 db 70 - 42498 00008215 446973706C61797320- db 'Displays the contents of a text file.',0Dh,0Ah - 42498 0000821E 74686520636F6E7465- - 42498 00008227 6E7473206F66206120- - 42498 00008230 746578742066696C65- - 42498 00008239 2E0D0A - 42499 0000823C 0D0A db 0Dh,0Ah - 42500 0000823E 54595045205B647269- db 'TYPE [drive:][path]filename',0Dh,0Ah - 42500 00008247 76653A5D5B70617468- - 42500 00008250 5D66696C656E616D65- - 42500 00008259 0D0A - 42501 MSG_1680: - 42502 0000825B 25 db 37 - 42503 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42504 %if 0 - 42505 db 'Displays the MS-DOS version.',0Dh,0Ah - 42506 %else - 42507 0000825C 446973706C61797320- db 'Displays the PC DOS version.',0Dh,0Ah - 42507 00008265 74686520504320444F- - 42507 0000826E 532076657273696F6E- - 42507 00008277 2E0D0A - 42508 %endif - 42509 0000827A 0D0A db 0Dh,0Ah - 42510 0000827C 5645520D0A db 'VER',0Dh,0Ah - 42511 MSG_1700: - 42512 00008281 B1 db 177 - 42513 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42514 %if 0 - 42515 db 'Tells MS-DOS whether to verify that your files are written correctly to a',0Dh,0Ah - 42516 db 'disk.',0Dh,0Ah - 42517 %else - 42518 00008282 54656C6C7320504320- db 'Tells PC DOS whether to verify that your files are written correctly to a',0Dh,0Ah - 42518 0000828B 444F53207768657468- - 42518 00008294 657220746F20766572- - 42518 0000829D 696679207468617420- - 42518 000082A6 796F75722066696C65- - 42518 000082AF 732061726520777269- - 42518 000082B8 7474656E20636F7272- - 42518 000082C1 6563746C7920746F20- - 42518 000082CA 610D0A - 42519 000082CD 6469736B2E0D0A db 'disk.',0Dh,0Ah - 42520 %endif - 42521 000082D4 0D0A db 0Dh,0Ah - 42522 000082D6 564552494659205B4F- db 'VERIFY [ON | OFF]',0Dh,0Ah - 42522 000082DF 4E207C204F46465D0D- - 42522 000082E8 0A - 42523 000082E9 0D0A db 0Dh,0Ah - 42524 000082EB 547970652056455249- db 'Type VERIFY without a parameter to display the current VERIFY setting.',0Dh,0Ah - 42524 000082F4 465920776974686F75- - 42524 000082FD 74206120706172616D- - 42524 00008306 6574657220746F2064- - 42524 0000830F 6973706C6179207468- - 42524 00008318 652063757272656E74- - 42524 00008321 205645524946592073- - 42524 0000832A 657474696E672E0D0A - 42525 MSG_1720: - 42526 00008333 52 db 82 - 42527 00008334 446973706C61797320- db 'Displays the disk volume label and serial number, if they exist.',0Dh,0Ah - 42527 0000833D 746865206469736B20- - 42527 00008346 766F6C756D65206C61- - 42527 0000834F 62656C20616E642073- - 42527 00008358 657269616C206E756D- - 42527 00008361 6265722C2069662074- - 42527 0000836A 686579206578697374- - 42527 00008373 2E0D0A - 42528 00008376 0D0A db 0Dh,0Ah - 42529 00008378 564F4C205B64726976- db 'VOL [drive:]',0Dh,0Ah - 42529 00008381 653A5D0D0A - 42530 MSG_1740: - 42531 00008386 5B db 91 - 42532 00008387 43616C6C73206F6E65- db 'Calls one batch program from another.',0Dh,0Ah - 42532 00008390 206261746368207072- - 42532 00008399 6F6772616D2066726F- - 42532 000083A2 6D20616E6F74686572- - 42532 000083AB 2E0D0A - 42533 000083AE 0D0A db 0Dh,0Ah - 42534 000083B0 43414C4C205B647269- db 'CALL [drive:][path]filename [batch-parameters]',0Dh,0Ah - 42534 000083B9 76653A5D5B70617468- - 42534 000083C2 5D66696C656E616D65- - 42534 000083CB 205B62617463682D70- - 42534 000083D4 6172616D6574657273- - 42534 000083DD 5D0D0A - 42535 000083E0 0D0A db 0Dh,0Ah - 42536 MSG_1741: - 42537 000083E2 72 db 114 - 42538 000083E3 202062617463682D70- db ' batch-parameters Specifies any command-line information required by the',0Dh,0Ah - 42538 000083EC 6172616D6574657273- - 42538 000083F5 202020537065636966- - 42538 000083FE 69657320616E792063- - 42538 00008407 6F6D6D616E642D6C69- - 42538 00008410 6E6520696E666F726D- - 42538 00008419 6174696F6E20726571- - 42538 00008422 756972656420627920- - 42538 0000842B 7468650D0A - 42539 00008430 202020202020202020- db ' batch program.',0Dh,0Ah - 42539 00008439 202020202020202020- - 42539 00008442 202020626174636820- - 42539 0000844B 70726F6772616D2E0D- - 42539 00008454 0A - 42540 MSG_1760: - 42541 00008455 4C db 76 - 42542 00008456 5265636F7264732063- db 'Records comments (remarks) in a batch file or CONFIG.SYS.',0Dh,0Ah - 42542 0000845F 6F6D6D656E74732028- - 42542 00008468 72656D61726B732920- - 42542 00008471 696E20612062617463- - 42542 0000847A 682066696C65206F72- - 42542 00008483 20434F4E4649472E53- - 42542 0000848C 59532E0D0A - 42543 00008491 0D0A db 0Dh,0Ah - 42544 00008493 52454D205B636F6D6D- db 'REM [comment]',0Dh,0Ah - 42544 0000849C 656E745D0D0A - 42545 MSG_1780: - 42546 000084A2 6B db 107 - 42547 000084A3 53757370656E647320- db 'Suspends processing of a batch program and displays the message "' - 42547 000084AC 70726F63657373696E- - 42547 000084B5 67206F662061206261- - 42547 000084BE 7463682070726F6772- - 42547 000084C7 616D20616E64206469- - 42547 000084D0 73706C617973207468- - 42547 000084D9 65206D657373616765- - 42547 000084E2 2022 - 42548 000084E4 507265737320616E79- db 'Press any',0Dh,0Ah - 42548 000084ED 0D0A - 42549 000084EF 6B657920746F20636F- db 'key to continue...."',0Dh,0Ah - 42549 000084F8 6E74696E75652E2E2E- - 42549 00008501 2E220D0A - 42550 00008505 0D0A db 0Dh,0Ah - 42551 00008507 50415553450D0A db 'PAUSE',0Dh,0Ah - 42552 MSG_1800: - 42553 0000850E 4D db 77 - 42554 0000850F 446973706C61797320- db 'Displays messages, or turns command-echoing on or off.',0Dh,0Ah - 42554 00008518 6D657373616765732C- - 42554 00008521 206F72207475726E73- - 42554 0000852A 20636F6D6D616E642D- - 42554 00008533 6563686F696E67206F- - 42554 0000853C 6E206F72206F66662E- - 42554 00008545 0D0A - 42555 00008547 0D0A db 0Dh,0Ah - 42556 00008549 20204543484F205B4F- db ' ECHO [ON | OFF]',0Dh,0Ah - 42556 00008552 4E207C204F46465D0D- - 42556 0000855B 0A - 42557 MSG_1801: - 42558 0000855C 57 db 87 - 42559 0000855D 20204543484F205B6D- db ' ECHO [message]',0Dh,0Ah - 42559 00008566 6573736167655D0D0A - 42560 0000856F 0D0A db 0Dh,0Ah - 42561 00008571 54797065204543484F- db 'Type ECHO without parameters to display the current echo setting.' - 42561 0000857A 20776974686F757420- - 42561 00008583 706172616D65746572- - 42561 0000858C 7320746F2064697370- - 42561 00008595 6C6179207468652063- - 42561 0000859E 757272656E74206563- - 42561 000085A7 686F2073657474696E- - 42561 000085B0 672E - 42562 000085B2 0D0A db 0Dh,0Ah - 42563 MSG_1820: - 42564 000085B4 47 db 71 - 42565 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42566 %if 0 - 42567 db 'Directs MS-DOS to a labelled line in a batch program.',0Dh,0Ah - 42568 %else - 42569 000085B5 446972656374732050- db 'Directs PC DOS to a labelled line in a batch program.',0Dh,0Ah - 42569 000085BE 4320444F5320746F20- - 42569 000085C7 61206C6162656C6C65- - 42569 000085D0 64206C696E6520696E- - 42569 000085D9 206120626174636820- - 42569 000085E2 70726F6772616D2E0D- - 42569 000085EB 0A - 42570 %endif - 42571 000085EC 0D0A db 0Dh,0Ah - 42572 000085EE 474F544F206C616265- db 'GOTO label',0Dh,0Ah - 42572 000085F7 6C0D0A - 42573 000085FA 0D0A db 0Dh,0Ah - 42574 MSG_1821: - 42575 000085FC 8A db 138 - 42576 000085FD 20206C6162656C2020- db ' label Specifies a text string used in the batch program as a label.',0Dh,0Ah - 42576 00008606 205370656369666965- - 42576 0000860F 732061207465787420- - 42576 00008618 737472696E67207573- - 42576 00008621 656420696E20746865- - 42576 0000862A 206261746368207072- - 42576 00008633 6F6772616D20617320- - 42576 0000863C 61206C6162656C2E0D- - 42576 00008645 0A - 42577 00008646 0D0A db 0Dh,0Ah - 42578 00008648 596F75207479706520- db 'You type a label on a line by itself, beginning with a colon.',0Dh,0Ah - 42578 00008651 61206C6162656C206F- - 42578 0000865A 6E2061206C696E6520- - 42578 00008663 627920697473656C66- - 42578 0000866C 2C20626567696E6E69- - 42578 00008675 6E6720776974682061- - 42578 0000867E 20636F6C6F6E2E0D0A - 42579 MSG_1840: - 42580 00008687 4A db 74 - 42581 00008688 4368616E6765732074- db 'Changes the position of replaceable parameters in a batch file.',0Dh,0Ah - 42581 00008691 686520706F73697469- - 42581 0000869A 6F6E206F6620726570- - 42581 000086A3 6C61636561626C6520- - 42581 000086AC 706172616D65746572- - 42581 000086B5 7320696E2061206261- - 42581 000086BE 7463682066696C652E- - 42581 000086C7 0D0A - 42582 000086C9 0D0A db 0Dh,0Ah - 42583 000086CB 53484946540D0A db 'SHIFT',0Dh,0Ah - 42584 MSG_1860: - 42585 000086D2 5A db 90 - 42586 000086D3 506572666F726D7320- db 'Performs conditional processing in batch programs.',0Dh,0Ah - 42586 000086DC 636F6E646974696F6E- - 42586 000086E5 616C2070726F636573- - 42586 000086EE 73696E6720696E2062- - 42586 000086F7 617463682070726F67- - 42586 00008700 72616D732E0D0A - 42587 00008707 0D0A db 0Dh,0Ah - 42588 00008709 4946205B4E4F545D20- db 'IF [NOT] ERRORLEVEL number command',0Dh,0Ah - 42588 00008712 4552524F524C455645- - 42588 0000871B 4C206E756D62657220- - 42588 00008724 636F6D6D616E640D0A - 42589 MSG_1861: - 42590 0000872D 46 db 70 - 42591 0000872E 4946205B4E4F545D20- db 'IF [NOT] string1==string2 command',0Dh,0Ah - 42591 00008737 737472696E67313D3D- - 42591 00008740 737472696E67322063- - 42591 00008749 6F6D6D616E640D0A - 42592 00008751 4946205B4E4F545D20- db 'IF [NOT] EXIST filename command',0Dh,0Ah - 42592 0000875A 45584953542066696C- - 42592 00008763 656E616D6520636F6D- - 42592 0000876C 6D616E640D0A - 42593 00008772 0D0A db 0Dh,0Ah - 42594 MSG_1862: - 42595 00008774 7D db 125 - 42596 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42597 %if 0 - 42598 db ' NOT Specifies that MS-DOS should carry out the command only',0Dh,0Ah - 42599 %else - 42600 00008775 20204E4F5420202020- db ' NOT Specifies that PC DOS should carry out the command only',0Dh,0Ah - 42600 0000877E 202020202020202020- - 42600 00008787 202053706563696669- - 42600 00008790 657320746861742050- - 42600 00008799 4320444F532073686F- - 42600 000087A2 756C64206361727279- - 42600 000087AB 206F75742074686520- - 42600 000087B4 636F6D6D616E64206F- - 42600 000087BD 6E6C790D0A - 42601 %endif - 42602 000087C2 202020202020202020- db ' if the condition is false.',0Dh,0Ah - 42602 000087CB 202020202020202020- - 42602 000087D4 202069662074686520- - 42602 000087DD 636F6E646974696F6E- - 42602 000087E6 2069732066616C7365- - 42602 000087EF 2E0D0A - 42603 MSG_1863: - 42604 000087F2 A2 db 162 - 42605 000087F3 20204552524F524C45- db ' ERRORLEVEL number Specifies a true condition if the last program run returned',0Dh,0Ah - 42605 000087FC 56454C206E756D6265- - 42605 00008805 722053706563696669- - 42605 0000880E 657320612074727565- - 42605 00008817 20636F6E646974696F- - 42605 00008820 6E2069662074686520- - 42605 00008829 6C6173742070726F67- - 42605 00008832 72616D2072756E2072- - 42605 0000883B 657475726E65640D0A - 42606 00008844 202020202020202020- db ' ' - 42606 0000884D 202020202020202020- - 42606 00008856 2020 - 42607 00008858 616E20657869742063- db 'an exit code equal to or greater than the number specified.',0Dh,0Ah - 42607 00008861 6F646520657175616C- - 42607 0000886A 20746F206F72206772- - 42607 00008873 656174657220746861- - 42607 0000887C 6E20746865206E756D- - 42607 00008885 626572207370656369- - 42607 0000888E 666965642E0D0A - 42608 MSG_1864: - 42609 00008895 66 db 102 - 42610 00008896 2020636F6D6D616E64- db ' command Specifies the command to carry out if the condition is',0Dh,0Ah - 42610 0000889F 202020202020202020- - 42610 000088A8 202053706563696669- - 42610 000088B1 65732074686520636F- - 42610 000088BA 6D6D616E6420746F20- - 42610 000088C3 6361727279206F7574- - 42610 000088CC 206966207468652063- - 42610 000088D5 6F6E646974696F6E20- - 42610 000088DE 69730D0A - 42611 000088E2 202020202020202020- db ' met.',0Dh,0Ah - 42611 000088EB 202020202020202020- - 42611 000088F4 20206D65742E0D0A - 42612 MSG_1865: - 42613 000088FC 6A db 106 - 42614 000088FD 2020737472696E6731- db ' string1==string2 Specifies a true condition if the specified text strings',0Dh,0Ah - 42614 00008906 3D3D737472696E6732- - 42614 0000890F 202053706563696669- - 42614 00008918 657320612074727565- - 42614 00008921 20636F6E646974696F- - 42614 0000892A 6E2069662074686520- - 42614 00008933 737065636966696564- - 42614 0000893C 207465787420737472- - 42614 00008945 696E67730D0A - 42615 0000894B 202020202020202020- db ' match.',0Dh,0Ah - 42615 00008954 202020202020202020- - 42615 0000895D 20206D617463682E0D- - 42615 00008966 0A - 42616 MSG_1866: - 42617 00008967 67 db 103 - 42618 00008968 202045584953542066- db ' EXIST filename Specifies a true condition if the specified filename',0Dh,0Ah - 42618 00008971 696C656E616D652020- - 42618 0000897A 202053706563696669- - 42618 00008983 657320612074727565- - 42618 0000898C 20636F6E646974696F- - 42618 00008995 6E2069662074686520- - 42618 0000899E 737065636966696564- - 42618 000089A7 2066696C656E616D65- - 42618 000089B0 0D0A - 42619 000089B2 202020202020202020- db ' exists.',0Dh,0Ah - 42619 000089BB 202020202020202020- - 42619 000089C4 20206578697374732E- - 42619 000089CD 0D0A - 42620 MSG_1880: - 42621 000089CF 77 db 119 - 42622 000089D0 52756E732061207370- db 'Runs a specified command for each file in a set of files.',0Dh,0Ah - 42622 000089D9 656369666965642063- - 42622 000089E2 6F6D6D616E6420666F- - 42622 000089EB 722065616368206669- - 42622 000089F4 6C6520696E20612073- - 42622 000089FD 6574206F662066696C- - 42622 00008A06 65732E0D0A - 42623 00008A0B 0D0A db 0Dh,0Ah - 42624 00008A0D 464F52202576617269- db 'FOR %variable IN (set) DO command [command-parameters]',0Dh,0Ah - 42624 00008A16 61626C6520494E2028- - 42624 00008A1F 7365742920444F2063- - 42624 00008A28 6F6D6D616E64205B63- - 42624 00008A31 6F6D6D616E642D7061- - 42624 00008A3A 72616D65746572735D- - 42624 00008A43 0D0A - 42625 00008A45 0D0A db 0Dh,0Ah - 42626 MSG_1881: - 42627 00008A47 7D db 125 - 42628 00008A48 202025766172696162- db ' %variable Specifies a replaceable parameter.',0Dh,0Ah - 42628 00008A51 6C6520205370656369- - 42628 00008A5A 666965732061207265- - 42628 00008A63 706C61636561626C65- - 42628 00008A6C 20706172616D657465- - 42628 00008A75 722E0D0A - 42629 00008A79 202028736574292020- db ' (set) Specifies a set of one or more files. Wildcards may be used.',0Dh,0Ah - 42629 00008A82 202020205370656369- - 42629 00008A8B 666965732061207365- - 42629 00008A94 74206F66206F6E6520- - 42629 00008A9D 6F72206D6F72652066- - 42629 00008AA6 696C65732E20205769- - 42629 00008AAF 6C646361726473206D- - 42629 00008AB8 617920626520757365- - 42629 00008AC1 642E0D0A - 42630 MSG_1882: - 42631 00008AC5 56 db 86 - 42632 00008AC6 2020636F6D6D616E64- db ' command Specifies the command to carry out for each file.',0Dh,0Ah - 42632 00008ACF 202020205370656369- - 42632 00008AD8 666965732074686520- - 42632 00008AE1 636F6D6D616E642074- - 42632 00008AEA 6F206361727279206F- - 42632 00008AF3 757420666F72206561- - 42632 00008AFC 63682066696C652E0D- - 42632 00008B05 0A - 42633 00008B06 2020636F6D6D616E64- db ' command-parameters',0Dh,0Ah - 42633 00008B0F 2D706172616D657465- - 42633 00008B18 72730D0A - 42634 MSG_1883: - 42635 00008B1C A2 db 162 - 42636 00008B1D 202020202020202020- db ' Specifies parameters or switches for the specified command.',0Dh,0Ah - 42636 00008B26 202020205370656369- - 42636 00008B2F 666965732070617261- - 42636 00008B38 6D6574657273206F72- - 42636 00008B41 207377697463686573- - 42636 00008B4A 20666F722074686520- - 42636 00008B53 737065636966696564- - 42636 00008B5C 20636F6D6D616E642E- - 42636 00008B65 0D0A - 42637 00008B67 0D0A db 0Dh,0Ah - 42638 00008B69 546F20757365207468- db 'To use the FOR command in a batch program, specify %%variable instead of',0Dh,0Ah - 42638 00008B72 6520464F5220636F6D- - 42638 00008B7B 6D616E6420696E2061- - 42638 00008B84 206261746368207072- - 42638 00008B8D 6F6772616D2C207370- - 42638 00008B96 656369667920252576- - 42638 00008B9F 61726961626C652069- - 42638 00008BA8 6E7374656164206F66- - 42638 00008BB1 0D0A - 42639 00008BB3 257661726961626C65- db '%variable.',0Dh,0Ah - 42639 00008BBC 2E0D0A - 42640 MSG_1900: - 42641 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42642 %if 0 - 42643 ; MSDOS 6.22 COMMAND.COM - 42644 db 23 - 42645 db 'Reserved command name',0Dh,0Ah - 42646 %else - 42647 ; PCDOS 7.1 COMMAND.COM - 42648 00008BBF 48 db 72 - 42649 00008BC0 52657475726E732061- db 'Returns a fully qualified filename.',0Dh,0Ah - 42649 00008BC9 2066756C6C79207175- - 42649 00008BD2 616C69666965642066- - 42649 00008BDB 696C656E616D652E0D- - 42649 00008BE4 0A - 42650 00008BE5 0D0A db 0Dh,0Ah - 42651 00008BE7 545255454E414D4520- db 'TRUENAME [drive:][path]filename',0Dh,0Ah - 42651 00008BF0 5B64726976653A5D5B- - 42651 00008BF9 706174685D66696C65- - 42651 00008C02 6E616D650D0A - 42652 %endif - 42653 MSG_1920: - 42654 00008C08 2F db 47 - 42655 00008C09 4C6F61647320612070- db 'Loads a program into the upper memory area.',0Dh,0Ah - 42655 00008C12 726F6772616D20696E- - 42655 00008C1B 746F20746865207570- - 42655 00008C24 706572206D656D6F72- - 42655 00008C2D 7920617265612E0D0A - 42656 00008C36 0D0A db 0Dh,0Ah - 42657 MSG_1921: - 42658 ;db 88 - 42659 ;db 'LOADHIGH [drive:][path]filename [parameters]',0Dh,0Ah - 42660 ;db 'LH [drive:][path]filename [parameters]',0Dh,0Ah - 42661 ;db 0Dh,0Ah - 42662 - 42663 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42664 %if 0 - 42665 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42666 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9303h - 42667 db 157 - 42668 db 'LOADHIGH [drive:][path]filename [parameters]',0Dh,0Ah - 42669 db 'LOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...] [/S]]',0Dh,0Ah - 42670 db ' [drive:][path]filename [parameters]',0Dh,0Ah - 42671 db 0Dh,0Ah - 42672 %else - 42673 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42674 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:90EBh - 42675 00008C38 98 db 152 - 42676 00008C39 4C4F41444849474820- db 'LOADHIGH [drive:][path]filename [parameters]',0Dh,0Ah - 42676 00008C42 5B64726976653A5D5B- - 42676 00008C4B 706174685D66696C65- - 42676 00008C54 6E616D65205B706172- - 42676 00008C5D 616D65746572735D0D- - 42676 00008C66 0A - 42677 00008C67 4C4F41444849474820- db 'LOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...]]',0Dh,0Ah - 42677 00008C70 5B2F4C3A726567696F- - 42677 00008C79 6E315B2C6D696E7369- - 42677 00008C82 7A65315D5B3B726567- - 42677 00008C8B 696F6E325B2C6D696E- - 42677 00008C94 73697A65325D2E2E2E- - 42677 00008C9D 5D5D0D0A - 42678 00008CA1 202020202020202020- db ' [drive:][path]filename [parameters]',0Dh,0Ah - 42678 00008CAA 5B64726976653A5D5B- - 42678 00008CB3 706174685D66696C65- - 42678 00008CBC 6E616D65205B706172- - 42678 00008CC5 616D65746572735D0D- - 42678 00008CCE 0A - 42679 00008CCF 0D0A db 0Dh,0Ah - 42680 %endif - 42681 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:8111h) - 42682 ;MSG_1922: ; MSDOS 5.0 COMMAND.COM - 42683 ;db 113 - 42684 ;db ' parameters Specifies any command-line information required by the',0Dh,0Ah - 42685 ;db ' program you want to load.',0Dh,0Ah - 42686 - 42687 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42688 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:93A1h - 42689 MSG_1922: - 42690 00008CD1 B6 db 182 - 42691 00008CD2 2F4C3A726567696F6E- db '/L:region1[,minsize1][;region2[,minsize2]]...',0Dh,0Ah - 42691 00008CDB 315B2C6D696E73697A- - 42691 00008CE4 65315D5B3B72656769- - 42691 00008CED 6F6E325B2C6D696E73- - 42691 00008CF6 697A65325D5D2E2E2E- - 42691 00008CFF 0D0A - 42692 00008D01 202020202020202020- db ' Specifies the region(s) of memory into which to load',0Dh,0Ah - 42692 00008D0A 202020537065636966- - 42692 00008D13 696573207468652072- - 42692 00008D1C 6567696F6E28732920- - 42692 00008D25 6F66206D656D6F7279- - 42692 00008D2E 20696E746F20776869- - 42692 00008D37 636820746F206C6F61- - 42692 00008D40 640D0A - 42693 00008D43 202020202020202020- db ' the program. Region1 specifies the number of the first',0Dh,0Ah - 42693 00008D4C 202020746865207072- - 42693 00008D55 6F6772616D2E202052- - 42693 00008D5E 6567696F6E31207370- - 42693 00008D67 656369666965732074- - 42693 00008D70 6865206E756D626572- - 42693 00008D79 206F66207468652066- - 42693 00008D82 697273740D0A - 42694 MSG_1923: - 42695 00008D88 85 db 133 - 42696 00008D89 202020202020202020- db ' memory region; minsize1 specifies the minimum size, if',0Dh,0Ah - 42696 00008D92 2020206D656D6F7279- - 42696 00008D9B 20726567696F6E3B20- - 42696 00008DA4 6D696E73697A653120- - 42696 00008DAD 737065636966696573- - 42696 00008DB6 20746865206D696E69- - 42696 00008DBF 6D756D2073697A652C- - 42696 00008DC8 2069660D0A - 42697 00008DCD 202020202020202020- db ' any, for region1. Region2 and minsize2 specify the',0Dh - 42697 00008DD6 202020616E792C2066- - 42697 00008DDF 6F7220726567696F6E- - 42697 00008DE8 312E2020526567696F- - 42697 00008DF1 6E3220616E64206D69- - 42697 00008DFA 6E73697A6532207370- - 42697 00008E03 656369667920746865- - 42697 00008E0C 0D - 42698 00008E0D 0A db 0Ah - 42699 MSG_1924: - 42700 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42701 %if 0 - 42702 db 127 - 42703 db ' number and minimum size of the second region, if any.',0Dh,0Ah - 42704 db ' You can specify as many regions as you want.',0Dh,0Ah - 42705 db 0Dh,0Ah - 42706 MSG_1925: - 42707 db 131 - 42708 db '/S Shrinks a UMB to its minimum size while the program',0Dh,0Ah - 42709 db ' is loading. /S is normally used only by MemMaker.',0Dh,0Ah - 42710 db 0Dh,0Ah - 42711 %else - 42712 00008E0E 7B db 123 - 42713 00008E0F 202020202020202020- db ' number and minimum size of the second region, if any.',0Dh,0Ah - 42713 00008E18 2020206E756D626572- - 42713 00008E21 20616E64206D696E69- - 42713 00008E2A 6D756D2073697A6520- - 42713 00008E33 6F6620746865207365- - 42713 00008E3C 636F6E642072656769- - 42713 00008E45 6F6E2C20696620616E- - 42713 00008E4E 792E0D0A - 42714 00008E52 202020202020202020- db ' You can specify as many regions as you want.' - 42714 00008E5B 202020596F75206361- - 42714 00008E64 6E2073706563696679- - 42714 00008E6D 206173206D616E7920- - 42714 00008E76 726567696F6E732061- - 42714 00008E7F 7320796F752077616E- - 42714 00008E88 742E - 42715 MSG_1925: - 42716 00008E8A 02 db 2 - 42717 00008E8B 0D0A db 0Dh,0Ah - 42718 %endif - 42719 MSG_1926: - 42720 00008E8D 57 db 87 - 42721 00008E8E 5B64726976653A5D5B- db '[drive:][path]filename',0Dh,0Ah - 42721 00008E97 706174685D66696C65- - 42721 00008EA0 6E616D650D0A - 42722 00008EA6 202020202020202020- db ' Specifies the location and name of the program.',0Dh,0Ah - 42722 00008EAF 202020537065636966- - 42722 00008EB8 69657320746865206C- - 42722 00008EC1 6F636174696F6E2061- - 42722 00008ECA 6E64206E616D65206F- - 42722 00008ED3 66207468652070726F- - 42722 00008EDC 6772616D2E0D0A - 42723 00008EE3 0D0A db 0Dh,0Ah - 42724 - 42725 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42726 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:963Ah + 42440 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42441 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:8697h + 42442 + 42443 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42444 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:8447h + 42445 MSG_1602: + 42446 00007F94 A0 db 160 + 42447 00007F95 4E6F74652074686174- db 'Note that you cannot specify a new drive or path for your destination file.',0Dh,0Ah + 42447 00007F9E 20796F752063616E6E- + 42447 00007FA7 6F7420737065636966- + 42447 00007FB0 792061206E65772064- + 42447 00007FB9 72697665206F722070- + 42447 00007FC2 61746820666F722079- + 42447 00007FCB 6F7572206465737469- + 42447 00007FD4 6E6174696F6E206669- + 42447 00007FDD 6C652E0D0A + 42448 00007FE2 0D0A db 0Dh,0Ah + 42449 00007FE4 557365204D4F564520- db 'Use MOVE to rename a directory, or to move files from one directory to another.',0Dh,0Ah + 42449 00007FED 746F2072656E616D65- + 42449 00007FF6 206120646972656374- + 42449 00007FFF 6F72792C206F722074- + 42449 00008008 6F206D6F7665206669- + 42449 00008011 6C65732066726F6D20- + 42449 0000801A 6F6E65206469726563- + 42449 00008023 746F727920746F2061- + 42449 0000802C 6E6F746865722E0D0A + 42450 MSG_1620: + 42451 00008035 57 db 87 + 42452 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42453 %if 0 + 42454 db 'Displays, sets, or removes MS-DOS environment variables.',0Dh,0Ah + 42455 %else + 42456 00008036 446973706C6179732C- db 'Displays, sets, or removes PC DOS environment variables.',0Dh,0Ah + 42456 0000803F 20736574732C206F72- + 42456 00008048 2072656D6F76657320- + 42456 00008051 504320444F5320656E- + 42456 0000805A 7669726F6E6D656E74- + 42456 00008063 207661726961626C65- + 42456 0000806C 732E0D0A + 42457 %endif + 42458 00008070 0D0A db 0Dh,0Ah + 42459 00008072 534554205B76617269- db 'SET [variable=[string]]',0Dh,0Ah + 42459 0000807B 61626C653D5B737472- + 42459 00008084 696E675D5D0D0A + 42460 0000808B 0D0A db 0Dh,0Ah + 42461 MSG_1621: + 42462 0000808D 81 db 129 + 42463 0000808E 20207661726961626C- db ' variable Specifies the environment-variable name.',0Dh,0Ah + 42463 00008097 652020537065636966- + 42463 000080A0 696573207468652065- + 42463 000080A9 6E7669726F6E6D656E- + 42463 000080B2 742D7661726961626C- + 42463 000080BB 65206E616D652E0D0A + 42464 000080C4 2020737472696E6720- db ' string Specifies a series of characters to assign to the variable.',0Dh,0Ah + 42464 000080CD 202020537065636966- + 42464 000080D6 696573206120736572- + 42464 000080DF 696573206F66206368- + 42464 000080E8 617261637465727320- + 42464 000080F1 746F2061737369676E- + 42464 000080FA 20746F207468652076- + 42464 00008103 61726961626C652E0D- + 42464 0000810C 0A + 42465 0000810D 0D0A db 0Dh,0Ah + 42466 MSG_1622: + 42467 0000810F 4B db 75 + 42468 00008110 547970652053455420- db 'Type SET without parameters to display the current environment variables.',0Dh,0Ah + 42468 00008119 776974686F75742070- + 42468 00008122 6172616D6574657273- + 42468 0000812B 20746F20646973706C- + 42468 00008134 617920746865206375- + 42468 0000813D 7272656E7420656E76- + 42468 00008146 69726F6E6D656E7420- + 42468 0000814F 7661726961626C6573- + 42468 00008158 2E0D0A + 42469 MSG_1640: + 42470 ;db 52 + 42471 ;db 'Displays or sets the system time.',0Dh,0Ah + 42472 ;db 0Dh,0Ah + 42473 ;db 'TIME [time]',0Dh,0Ah + 42474 ;db 0Dh,0Ah + 42475 + 42476 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42477 %if 0 + 42478 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42479 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:885Eh) + 42480 db 45 + 42481 db 'Displays or sets the time.',0Dh,0Ah + 42482 db 0Dh,0Ah + 42483 db 'TIME [time]',0Dh,0Ah + 42484 db 0Dh,0Ah + 42485 %else + 42486 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42487 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:860Eh + 42488 0000815B 34 db 52 + 42489 0000815C 446973706C61797320- db 'Displays or sets the system time.',0Dh,0Ah + 42489 00008165 6F7220736574732074- + 42489 0000816E 68652073797374656D- + 42489 00008177 2074696D652E0D0A + 42490 0000817F 0D0A db 0Dh,0Ah + 42491 00008181 54494D45205B74696D- db 'TIME [time]',0Dh,0Ah + 42491 0000818A 655D0D0A + 42492 0000818E 0D0A db 0Dh,0Ah + 42493 %endif + 42494 + 42495 MSG_1641: + 42496 00008190 83 db 131 + 42497 00008191 547970652054494D45- db 'Type TIME with no parameters to display the current time setting and a prompt',0Dh,0Ah + 42497 0000819A 2077697468206E6F20- + 42497 000081A3 706172616D65746572- + 42497 000081AC 7320746F2064697370- + 42497 000081B5 6C6179207468652063- + 42497 000081BE 757272656E74207469- + 42497 000081C7 6D652073657474696E- + 42497 000081D0 6720616E6420612070- + 42497 000081D9 726F6D70740D0A + 42498 000081E0 666F722061206E6577- db 'for a new one. Press ENTER to keep the same time.',0Dh,0Ah + 42498 000081E9 206F6E652E20205072- + 42498 000081F2 65737320454E544552- + 42498 000081FB 20746F206B65657020- + 42498 00008204 7468652073616D6520- + 42498 0000820D 74696D652E0D0A + 42499 MSG_1660: + 42500 00008214 46 db 70 + 42501 00008215 446973706C61797320- db 'Displays the contents of a text file.',0Dh,0Ah + 42501 0000821E 74686520636F6E7465- + 42501 00008227 6E7473206F66206120- + 42501 00008230 746578742066696C65- + 42501 00008239 2E0D0A + 42502 0000823C 0D0A db 0Dh,0Ah + 42503 0000823E 54595045205B647269- db 'TYPE [drive:][path]filename',0Dh,0Ah + 42503 00008247 76653A5D5B70617468- + 42503 00008250 5D66696C656E616D65- + 42503 00008259 0D0A + 42504 MSG_1680: + 42505 0000825B 25 db 37 + 42506 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42507 %if 0 + 42508 db 'Displays the MS-DOS version.',0Dh,0Ah + 42509 %else + 42510 0000825C 446973706C61797320- db 'Displays the PC DOS version.',0Dh,0Ah + 42510 00008265 74686520504320444F- + 42510 0000826E 532076657273696F6E- + 42510 00008277 2E0D0A + 42511 %endif + 42512 0000827A 0D0A db 0Dh,0Ah + 42513 0000827C 5645520D0A db 'VER',0Dh,0Ah + 42514 MSG_1700: + 42515 00008281 B1 db 177 + 42516 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42517 %if 0 + 42518 db 'Tells MS-DOS whether to verify that your files are written correctly to a',0Dh,0Ah + 42519 db 'disk.',0Dh,0Ah + 42520 %else + 42521 00008282 54656C6C7320504320- db 'Tells PC DOS whether to verify that your files are written correctly to a',0Dh,0Ah + 42521 0000828B 444F53207768657468- + 42521 00008294 657220746F20766572- + 42521 0000829D 696679207468617420- + 42521 000082A6 796F75722066696C65- + 42521 000082AF 732061726520777269- + 42521 000082B8 7474656E20636F7272- + 42521 000082C1 6563746C7920746F20- + 42521 000082CA 610D0A + 42522 000082CD 6469736B2E0D0A db 'disk.',0Dh,0Ah + 42523 %endif + 42524 000082D4 0D0A db 0Dh,0Ah + 42525 000082D6 564552494659205B4F- db 'VERIFY [ON | OFF]',0Dh,0Ah + 42525 000082DF 4E207C204F46465D0D- + 42525 000082E8 0A + 42526 000082E9 0D0A db 0Dh,0Ah + 42527 000082EB 547970652056455249- db 'Type VERIFY without a parameter to display the current VERIFY setting.',0Dh,0Ah + 42527 000082F4 465920776974686F75- + 42527 000082FD 74206120706172616D- + 42527 00008306 6574657220746F2064- + 42527 0000830F 6973706C6179207468- + 42527 00008318 652063757272656E74- + 42527 00008321 205645524946592073- + 42527 0000832A 657474696E672E0D0A + 42528 MSG_1720: + 42529 00008333 52 db 82 + 42530 00008334 446973706C61797320- db 'Displays the disk volume label and serial number, if they exist.',0Dh,0Ah + 42530 0000833D 746865206469736B20- + 42530 00008346 766F6C756D65206C61- + 42530 0000834F 62656C20616E642073- + 42530 00008358 657269616C206E756D- + 42530 00008361 6265722C2069662074- + 42530 0000836A 686579206578697374- + 42530 00008373 2E0D0A + 42531 00008376 0D0A db 0Dh,0Ah + 42532 00008378 564F4C205B64726976- db 'VOL [drive:]',0Dh,0Ah + 42532 00008381 653A5D0D0A + 42533 MSG_1740: + 42534 00008386 5B db 91 + 42535 00008387 43616C6C73206F6E65- db 'Calls one batch program from another.',0Dh,0Ah + 42535 00008390 206261746368207072- + 42535 00008399 6F6772616D2066726F- + 42535 000083A2 6D20616E6F74686572- + 42535 000083AB 2E0D0A + 42536 000083AE 0D0A db 0Dh,0Ah + 42537 000083B0 43414C4C205B647269- db 'CALL [drive:][path]filename [batch-parameters]',0Dh,0Ah + 42537 000083B9 76653A5D5B70617468- + 42537 000083C2 5D66696C656E616D65- + 42537 000083CB 205B62617463682D70- + 42537 000083D4 6172616D6574657273- + 42537 000083DD 5D0D0A + 42538 000083E0 0D0A db 0Dh,0Ah + 42539 MSG_1741: + 42540 000083E2 72 db 114 + 42541 000083E3 202062617463682D70- db ' batch-parameters Specifies any command-line information required by the',0Dh,0Ah + 42541 000083EC 6172616D6574657273- + 42541 000083F5 202020537065636966- + 42541 000083FE 69657320616E792063- + 42541 00008407 6F6D6D616E642D6C69- + 42541 00008410 6E6520696E666F726D- + 42541 00008419 6174696F6E20726571- + 42541 00008422 756972656420627920- + 42541 0000842B 7468650D0A + 42542 00008430 202020202020202020- db ' batch program.',0Dh,0Ah + 42542 00008439 202020202020202020- + 42542 00008442 202020626174636820- + 42542 0000844B 70726F6772616D2E0D- + 42542 00008454 0A + 42543 MSG_1760: + 42544 00008455 4C db 76 + 42545 00008456 5265636F7264732063- db 'Records comments (remarks) in a batch file or CONFIG.SYS.',0Dh,0Ah + 42545 0000845F 6F6D6D656E74732028- + 42545 00008468 72656D61726B732920- + 42545 00008471 696E20612062617463- + 42545 0000847A 682066696C65206F72- + 42545 00008483 20434F4E4649472E53- + 42545 0000848C 59532E0D0A + 42546 00008491 0D0A db 0Dh,0Ah + 42547 00008493 52454D205B636F6D6D- db 'REM [comment]',0Dh,0Ah + 42547 0000849C 656E745D0D0A + 42548 MSG_1780: + 42549 000084A2 6B db 107 + 42550 000084A3 53757370656E647320- db 'Suspends processing of a batch program and displays the message "' + 42550 000084AC 70726F63657373696E- + 42550 000084B5 67206F662061206261- + 42550 000084BE 7463682070726F6772- + 42550 000084C7 616D20616E64206469- + 42550 000084D0 73706C617973207468- + 42550 000084D9 65206D657373616765- + 42550 000084E2 2022 + 42551 000084E4 507265737320616E79- db 'Press any',0Dh,0Ah + 42551 000084ED 0D0A + 42552 000084EF 6B657920746F20636F- db 'key to continue...."',0Dh,0Ah + 42552 000084F8 6E74696E75652E2E2E- + 42552 00008501 2E220D0A + 42553 00008505 0D0A db 0Dh,0Ah + 42554 00008507 50415553450D0A db 'PAUSE',0Dh,0Ah + 42555 MSG_1800: + 42556 0000850E 4D db 77 + 42557 0000850F 446973706C61797320- db 'Displays messages, or turns command-echoing on or off.',0Dh,0Ah + 42557 00008518 6D657373616765732C- + 42557 00008521 206F72207475726E73- + 42557 0000852A 20636F6D6D616E642D- + 42557 00008533 6563686F696E67206F- + 42557 0000853C 6E206F72206F66662E- + 42557 00008545 0D0A + 42558 00008547 0D0A db 0Dh,0Ah + 42559 00008549 20204543484F205B4F- db ' ECHO [ON | OFF]',0Dh,0Ah + 42559 00008552 4E207C204F46465D0D- + 42559 0000855B 0A + 42560 MSG_1801: + 42561 0000855C 57 db 87 + 42562 0000855D 20204543484F205B6D- db ' ECHO [message]',0Dh,0Ah + 42562 00008566 6573736167655D0D0A + 42563 0000856F 0D0A db 0Dh,0Ah + 42564 00008571 54797065204543484F- db 'Type ECHO without parameters to display the current echo setting.' + 42564 0000857A 20776974686F757420- + 42564 00008583 706172616D65746572- + 42564 0000858C 7320746F2064697370- + 42564 00008595 6C6179207468652063- + 42564 0000859E 757272656E74206563- + 42564 000085A7 686F2073657474696E- + 42564 000085B0 672E + 42565 000085B2 0D0A db 0Dh,0Ah + 42566 MSG_1820: + 42567 000085B4 47 db 71 + 42568 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42569 %if 0 + 42570 db 'Directs MS-DOS to a labelled line in a batch program.',0Dh,0Ah + 42571 %else + 42572 000085B5 446972656374732050- db 'Directs PC DOS to a labelled line in a batch program.',0Dh,0Ah + 42572 000085BE 4320444F5320746F20- + 42572 000085C7 61206C6162656C6C65- + 42572 000085D0 64206C696E6520696E- + 42572 000085D9 206120626174636820- + 42572 000085E2 70726F6772616D2E0D- + 42572 000085EB 0A + 42573 %endif + 42574 000085EC 0D0A db 0Dh,0Ah + 42575 000085EE 474F544F206C616265- db 'GOTO label',0Dh,0Ah + 42575 000085F7 6C0D0A + 42576 000085FA 0D0A db 0Dh,0Ah + 42577 MSG_1821: + 42578 000085FC 8A db 138 + 42579 000085FD 20206C6162656C2020- db ' label Specifies a text string used in the batch program as a label.',0Dh,0Ah + 42579 00008606 205370656369666965- + 42579 0000860F 732061207465787420- + 42579 00008618 737472696E67207573- + 42579 00008621 656420696E20746865- + 42579 0000862A 206261746368207072- + 42579 00008633 6F6772616D20617320- + 42579 0000863C 61206C6162656C2E0D- + 42579 00008645 0A + 42580 00008646 0D0A db 0Dh,0Ah + 42581 00008648 596F75207479706520- db 'You type a label on a line by itself, beginning with a colon.',0Dh,0Ah + 42581 00008651 61206C6162656C206F- + 42581 0000865A 6E2061206C696E6520- + 42581 00008663 627920697473656C66- + 42581 0000866C 2C20626567696E6E69- + 42581 00008675 6E6720776974682061- + 42581 0000867E 20636F6C6F6E2E0D0A + 42582 MSG_1840: + 42583 00008687 4A db 74 + 42584 00008688 4368616E6765732074- db 'Changes the position of replaceable parameters in a batch file.',0Dh,0Ah + 42584 00008691 686520706F73697469- + 42584 0000869A 6F6E206F6620726570- + 42584 000086A3 6C61636561626C6520- + 42584 000086AC 706172616D65746572- + 42584 000086B5 7320696E2061206261- + 42584 000086BE 7463682066696C652E- + 42584 000086C7 0D0A + 42585 000086C9 0D0A db 0Dh,0Ah + 42586 000086CB 53484946540D0A db 'SHIFT',0Dh,0Ah + 42587 MSG_1860: + 42588 000086D2 5A db 90 + 42589 000086D3 506572666F726D7320- db 'Performs conditional processing in batch programs.',0Dh,0Ah + 42589 000086DC 636F6E646974696F6E- + 42589 000086E5 616C2070726F636573- + 42589 000086EE 73696E6720696E2062- + 42589 000086F7 617463682070726F67- + 42589 00008700 72616D732E0D0A + 42590 00008707 0D0A db 0Dh,0Ah + 42591 00008709 4946205B4E4F545D20- db 'IF [NOT] ERRORLEVEL number command',0Dh,0Ah + 42591 00008712 4552524F524C455645- + 42591 0000871B 4C206E756D62657220- + 42591 00008724 636F6D6D616E640D0A + 42592 MSG_1861: + 42593 0000872D 46 db 70 + 42594 0000872E 4946205B4E4F545D20- db 'IF [NOT] string1==string2 command',0Dh,0Ah + 42594 00008737 737472696E67313D3D- + 42594 00008740 737472696E67322063- + 42594 00008749 6F6D6D616E640D0A + 42595 00008751 4946205B4E4F545D20- db 'IF [NOT] EXIST filename command',0Dh,0Ah + 42595 0000875A 45584953542066696C- + 42595 00008763 656E616D6520636F6D- + 42595 0000876C 6D616E640D0A + 42596 00008772 0D0A db 0Dh,0Ah + 42597 MSG_1862: + 42598 00008774 7D db 125 + 42599 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42600 %if 0 + 42601 db ' NOT Specifies that MS-DOS should carry out the command only',0Dh,0Ah + 42602 %else + 42603 00008775 20204E4F5420202020- db ' NOT Specifies that PC DOS should carry out the command only',0Dh,0Ah + 42603 0000877E 202020202020202020- + 42603 00008787 202053706563696669- + 42603 00008790 657320746861742050- + 42603 00008799 4320444F532073686F- + 42603 000087A2 756C64206361727279- + 42603 000087AB 206F75742074686520- + 42603 000087B4 636F6D6D616E64206F- + 42603 000087BD 6E6C790D0A + 42604 %endif + 42605 000087C2 202020202020202020- db ' if the condition is false.',0Dh,0Ah + 42605 000087CB 202020202020202020- + 42605 000087D4 202069662074686520- + 42605 000087DD 636F6E646974696F6E- + 42605 000087E6 2069732066616C7365- + 42605 000087EF 2E0D0A + 42606 MSG_1863: + 42607 000087F2 A2 db 162 + 42608 000087F3 20204552524F524C45- db ' ERRORLEVEL number Specifies a true condition if the last program run returned',0Dh,0Ah + 42608 000087FC 56454C206E756D6265- + 42608 00008805 722053706563696669- + 42608 0000880E 657320612074727565- + 42608 00008817 20636F6E646974696F- + 42608 00008820 6E2069662074686520- + 42608 00008829 6C6173742070726F67- + 42608 00008832 72616D2072756E2072- + 42608 0000883B 657475726E65640D0A + 42609 00008844 202020202020202020- db ' ' + 42609 0000884D 202020202020202020- + 42609 00008856 2020 + 42610 00008858 616E20657869742063- db 'an exit code equal to or greater than the number specified.',0Dh,0Ah + 42610 00008861 6F646520657175616C- + 42610 0000886A 20746F206F72206772- + 42610 00008873 656174657220746861- + 42610 0000887C 6E20746865206E756D- + 42610 00008885 626572207370656369- + 42610 0000888E 666965642E0D0A + 42611 MSG_1864: + 42612 00008895 66 db 102 + 42613 00008896 2020636F6D6D616E64- db ' command Specifies the command to carry out if the condition is',0Dh,0Ah + 42613 0000889F 202020202020202020- + 42613 000088A8 202053706563696669- + 42613 000088B1 65732074686520636F- + 42613 000088BA 6D6D616E6420746F20- + 42613 000088C3 6361727279206F7574- + 42613 000088CC 206966207468652063- + 42613 000088D5 6F6E646974696F6E20- + 42613 000088DE 69730D0A + 42614 000088E2 202020202020202020- db ' met.',0Dh,0Ah + 42614 000088EB 202020202020202020- + 42614 000088F4 20206D65742E0D0A + 42615 MSG_1865: + 42616 000088FC 6A db 106 + 42617 000088FD 2020737472696E6731- db ' string1==string2 Specifies a true condition if the specified text strings',0Dh,0Ah + 42617 00008906 3D3D737472696E6732- + 42617 0000890F 202053706563696669- + 42617 00008918 657320612074727565- + 42617 00008921 20636F6E646974696F- + 42617 0000892A 6E2069662074686520- + 42617 00008933 737065636966696564- + 42617 0000893C 207465787420737472- + 42617 00008945 696E67730D0A + 42618 0000894B 202020202020202020- db ' match.',0Dh,0Ah + 42618 00008954 202020202020202020- + 42618 0000895D 20206D617463682E0D- + 42618 00008966 0A + 42619 MSG_1866: + 42620 00008967 67 db 103 + 42621 00008968 202045584953542066- db ' EXIST filename Specifies a true condition if the specified filename',0Dh,0Ah + 42621 00008971 696C656E616D652020- + 42621 0000897A 202053706563696669- + 42621 00008983 657320612074727565- + 42621 0000898C 20636F6E646974696F- + 42621 00008995 6E2069662074686520- + 42621 0000899E 737065636966696564- + 42621 000089A7 2066696C656E616D65- + 42621 000089B0 0D0A + 42622 000089B2 202020202020202020- db ' exists.',0Dh,0Ah + 42622 000089BB 202020202020202020- + 42622 000089C4 20206578697374732E- + 42622 000089CD 0D0A + 42623 MSG_1880: + 42624 000089CF 77 db 119 + 42625 000089D0 52756E732061207370- db 'Runs a specified command for each file in a set of files.',0Dh,0Ah + 42625 000089D9 656369666965642063- + 42625 000089E2 6F6D6D616E6420666F- + 42625 000089EB 722065616368206669- + 42625 000089F4 6C6520696E20612073- + 42625 000089FD 6574206F662066696C- + 42625 00008A06 65732E0D0A + 42626 00008A0B 0D0A db 0Dh,0Ah + 42627 00008A0D 464F52202576617269- db 'FOR %variable IN (set) DO command [command-parameters]',0Dh,0Ah + 42627 00008A16 61626C6520494E2028- + 42627 00008A1F 7365742920444F2063- + 42627 00008A28 6F6D6D616E64205B63- + 42627 00008A31 6F6D6D616E642D7061- + 42627 00008A3A 72616D65746572735D- + 42627 00008A43 0D0A + 42628 00008A45 0D0A db 0Dh,0Ah + 42629 MSG_1881: + 42630 00008A47 7D db 125 + 42631 00008A48 202025766172696162- db ' %variable Specifies a replaceable parameter.',0Dh,0Ah + 42631 00008A51 6C6520205370656369- + 42631 00008A5A 666965732061207265- + 42631 00008A63 706C61636561626C65- + 42631 00008A6C 20706172616D657465- + 42631 00008A75 722E0D0A + 42632 00008A79 202028736574292020- db ' (set) Specifies a set of one or more files. Wildcards may be used.',0Dh,0Ah + 42632 00008A82 202020205370656369- + 42632 00008A8B 666965732061207365- + 42632 00008A94 74206F66206F6E6520- + 42632 00008A9D 6F72206D6F72652066- + 42632 00008AA6 696C65732E20205769- + 42632 00008AAF 6C646361726473206D- + 42632 00008AB8 617920626520757365- + 42632 00008AC1 642E0D0A + 42633 MSG_1882: + 42634 00008AC5 56 db 86 + 42635 00008AC6 2020636F6D6D616E64- db ' command Specifies the command to carry out for each file.',0Dh,0Ah + 42635 00008ACF 202020205370656369- + 42635 00008AD8 666965732074686520- + 42635 00008AE1 636F6D6D616E642074- + 42635 00008AEA 6F206361727279206F- + 42635 00008AF3 757420666F72206561- + 42635 00008AFC 63682066696C652E0D- + 42635 00008B05 0A + 42636 00008B06 2020636F6D6D616E64- db ' command-parameters',0Dh,0Ah + 42636 00008B0F 2D706172616D657465- + 42636 00008B18 72730D0A + 42637 MSG_1883: + 42638 00008B1C A2 db 162 + 42639 00008B1D 202020202020202020- db ' Specifies parameters or switches for the specified command.',0Dh,0Ah + 42639 00008B26 202020205370656369- + 42639 00008B2F 666965732070617261- + 42639 00008B38 6D6574657273206F72- + 42639 00008B41 207377697463686573- + 42639 00008B4A 20666F722074686520- + 42639 00008B53 737065636966696564- + 42639 00008B5C 20636F6D6D616E642E- + 42639 00008B65 0D0A + 42640 00008B67 0D0A db 0Dh,0Ah + 42641 00008B69 546F20757365207468- db 'To use the FOR command in a batch program, specify %%variable instead of',0Dh,0Ah + 42641 00008B72 6520464F5220636F6D- + 42641 00008B7B 6D616E6420696E2061- + 42641 00008B84 206261746368207072- + 42641 00008B8D 6F6772616D2C207370- + 42641 00008B96 656369667920252576- + 42641 00008B9F 61726961626C652069- + 42641 00008BA8 6E7374656164206F66- + 42641 00008BB1 0D0A + 42642 00008BB3 257661726961626C65- db '%variable.',0Dh,0Ah + 42642 00008BBC 2E0D0A + 42643 MSG_1900: + 42644 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42645 %if 0 + 42646 ; MSDOS 6.22 COMMAND.COM + 42647 db 23 + 42648 db 'Reserved command name',0Dh,0Ah + 42649 %else + 42650 ; PCDOS 7.1 COMMAND.COM + 42651 00008BBF 48 db 72 + 42652 00008BC0 52657475726E732061- db 'Returns a fully qualified filename.',0Dh,0Ah + 42652 00008BC9 2066756C6C79207175- + 42652 00008BD2 616C69666965642066- + 42652 00008BDB 696C656E616D652E0D- + 42652 00008BE4 0A + 42653 00008BE5 0D0A db 0Dh,0Ah + 42654 00008BE7 545255454E414D4520- db 'TRUENAME [drive:][path]filename',0Dh,0Ah + 42654 00008BF0 5B64726976653A5D5B- + 42654 00008BF9 706174685D66696C65- + 42654 00008C02 6E616D650D0A + 42655 %endif + 42656 MSG_1920: + 42657 00008C08 2F db 47 + 42658 00008C09 4C6F61647320612070- db 'Loads a program into the upper memory area.',0Dh,0Ah + 42658 00008C12 726F6772616D20696E- + 42658 00008C1B 746F20746865207570- + 42658 00008C24 706572206D656D6F72- + 42658 00008C2D 7920617265612E0D0A + 42659 00008C36 0D0A db 0Dh,0Ah + 42660 MSG_1921: + 42661 ;db 88 + 42662 ;db 'LOADHIGH [drive:][path]filename [parameters]',0Dh,0Ah + 42663 ;db 'LH [drive:][path]filename [parameters]',0Dh,0Ah + 42664 ;db 0Dh,0Ah + 42665 + 42666 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42667 %if 0 + 42668 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42669 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9303h + 42670 db 157 + 42671 db 'LOADHIGH [drive:][path]filename [parameters]',0Dh,0Ah + 42672 db 'LOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...] [/S]]',0Dh,0Ah + 42673 db ' [drive:][path]filename [parameters]',0Dh,0Ah + 42674 db 0Dh,0Ah + 42675 %else + 42676 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42677 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:90EBh + 42678 00008C38 98 db 152 + 42679 00008C39 4C4F41444849474820- db 'LOADHIGH [drive:][path]filename [parameters]',0Dh,0Ah + 42679 00008C42 5B64726976653A5D5B- + 42679 00008C4B 706174685D66696C65- + 42679 00008C54 6E616D65205B706172- + 42679 00008C5D 616D65746572735D0D- + 42679 00008C66 0A + 42680 00008C67 4C4F41444849474820- db 'LOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...]]',0Dh,0Ah + 42680 00008C70 5B2F4C3A726567696F- + 42680 00008C79 6E315B2C6D696E7369- + 42680 00008C82 7A65315D5B3B726567- + 42680 00008C8B 696F6E325B2C6D696E- + 42680 00008C94 73697A65325D2E2E2E- + 42680 00008C9D 5D5D0D0A + 42681 00008CA1 202020202020202020- db ' [drive:][path]filename [parameters]',0Dh,0Ah + 42681 00008CAA 5B64726976653A5D5B- + 42681 00008CB3 706174685D66696C65- + 42681 00008CBC 6E616D65205B706172- + 42681 00008CC5 616D65746572735D0D- + 42681 00008CCE 0A + 42682 00008CCF 0D0A db 0Dh,0Ah + 42683 %endif + 42684 ; (MSDOS 5.0 COMMAND.COM - TRANGROUP:8111h) + 42685 ;MSG_1922: ; MSDOS 5.0 COMMAND.COM + 42686 ;db 113 + 42687 ;db ' parameters Specifies any command-line information required by the',0Dh,0Ah + 42688 ;db ' program you want to load.',0Dh,0Ah + 42689 + 42690 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42691 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:93A1h + 42692 MSG_1922: + 42693 00008CD1 B6 db 182 + 42694 00008CD2 2F4C3A726567696F6E- db '/L:region1[,minsize1][;region2[,minsize2]]...',0Dh,0Ah + 42694 00008CDB 315B2C6D696E73697A- + 42694 00008CE4 65315D5B3B72656769- + 42694 00008CED 6F6E325B2C6D696E73- + 42694 00008CF6 697A65325D5D2E2E2E- + 42694 00008CFF 0D0A + 42695 00008D01 202020202020202020- db ' Specifies the region(s) of memory into which to load',0Dh,0Ah + 42695 00008D0A 202020537065636966- + 42695 00008D13 696573207468652072- + 42695 00008D1C 6567696F6E28732920- + 42695 00008D25 6F66206D656D6F7279- + 42695 00008D2E 20696E746F20776869- + 42695 00008D37 636820746F206C6F61- + 42695 00008D40 640D0A + 42696 00008D43 202020202020202020- db ' the program. Region1 specifies the number of the first',0Dh,0Ah + 42696 00008D4C 202020746865207072- + 42696 00008D55 6F6772616D2E202052- + 42696 00008D5E 6567696F6E31207370- + 42696 00008D67 656369666965732074- + 42696 00008D70 6865206E756D626572- + 42696 00008D79 206F66207468652066- + 42696 00008D82 697273740D0A + 42697 MSG_1923: + 42698 00008D88 85 db 133 + 42699 00008D89 202020202020202020- db ' memory region; minsize1 specifies the minimum size, if',0Dh,0Ah + 42699 00008D92 2020206D656D6F7279- + 42699 00008D9B 20726567696F6E3B20- + 42699 00008DA4 6D696E73697A653120- + 42699 00008DAD 737065636966696573- + 42699 00008DB6 20746865206D696E69- + 42699 00008DBF 6D756D2073697A652C- + 42699 00008DC8 2069660D0A + 42700 00008DCD 202020202020202020- db ' any, for region1. Region2 and minsize2 specify the',0Dh + 42700 00008DD6 202020616E792C2066- + 42700 00008DDF 6F7220726567696F6E- + 42700 00008DE8 312E2020526567696F- + 42700 00008DF1 6E3220616E64206D69- + 42700 00008DFA 6E73697A6532207370- + 42700 00008E03 656369667920746865- + 42700 00008E0C 0D + 42701 00008E0D 0A db 0Ah + 42702 MSG_1924: + 42703 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42704 %if 0 + 42705 db 127 + 42706 db ' number and minimum size of the second region, if any.',0Dh,0Ah + 42707 db ' You can specify as many regions as you want.',0Dh,0Ah + 42708 db 0Dh,0Ah + 42709 MSG_1925: + 42710 db 131 + 42711 db '/S Shrinks a UMB to its minimum size while the program',0Dh,0Ah + 42712 db ' is loading. /S is normally used only by MemMaker.',0Dh,0Ah + 42713 db 0Dh,0Ah + 42714 %else + 42715 00008E0E 7B db 123 + 42716 00008E0F 202020202020202020- db ' number and minimum size of the second region, if any.',0Dh,0Ah + 42716 00008E18 2020206E756D626572- + 42716 00008E21 20616E64206D696E69- + 42716 00008E2A 6D756D2073697A6520- + 42716 00008E33 6F6620746865207365- + 42716 00008E3C 636F6E642072656769- + 42716 00008E45 6F6E2C20696620616E- + 42716 00008E4E 792E0D0A + 42717 00008E52 202020202020202020- db ' You can specify as many regions as you want.' + 42717 00008E5B 202020596F75206361- + 42717 00008E64 6E2073706563696679- + 42717 00008E6D 206173206D616E7920- + 42717 00008E76 726567696F6E732061- + 42717 00008E7F 7320796F752077616E- + 42717 00008E88 742E + 42718 MSG_1925: + 42719 00008E8A 02 db 2 + 42720 00008E8B 0D0A db 0Dh,0Ah + 42721 %endif + 42722 MSG_1926: + 42723 00008E8D 57 db 87 + 42724 00008E8E 5B64726976653A5D5B- db '[drive:][path]filename',0Dh,0Ah + 42724 00008E97 706174685D66696C65- + 42724 00008EA0 6E616D650D0A + 42725 00008EA6 202020202020202020- db ' Specifies the location and name of the program.',0Dh,0Ah + 42725 00008EAF 202020537065636966- + 42725 00008EB8 69657320746865206C- + 42725 00008EC1 6F636174696F6E2061- + 42725 00008ECA 6E64206E616D65206F- + 42725 00008ED3 66207468652070726F- + 42725 00008EDC 6772616D2E0D0A + 42726 00008EE3 0D0A db 0Dh,0Ah 42727 42728 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42729 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9398h - 42730 MSG_1927: - 42731 00008EE5 5A db 90 - 42732 00008EE6 706172616D65746572- db 'parameters Specifies any command-line information required by',0Dh,0Ah - 42732 00008EEF 732020537065636966- - 42732 00008EF8 69657320616E792063- - 42732 00008F01 6F6D6D616E642D6C69- - 42732 00008F0A 6E6520696E666F726D- - 42732 00008F13 6174696F6E20726571- - 42732 00008F1C 75697265642062790D- - 42732 00008F25 0A - 42733 00008F26 202020202020202020- db ' the program.',0Dh,0Ah - 42733 00008F2F 202020746865207072- - 42733 00008F38 6F6772616D2E0D0A - 42734 - 42735 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM - 42736 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:96F3h - 42737 MSG_1107: - 42738 00008F40 0C db 12 - 42739 00008F41 2531204B2062797465- db '%1 K bytes',0Dh,0Ah - 42739 00008F4A 730D0A - 42740 - 42741 ; --------------------------------------------------------------------------- - 42742 - 42743 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 42744 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8183h + 42729 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:963Ah + 42730 + 42731 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42732 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9398h + 42733 MSG_1927: + 42734 00008EE5 5A db 90 + 42735 00008EE6 706172616D65746572- db 'parameters Specifies any command-line information required by',0Dh,0Ah + 42735 00008EEF 732020537065636966- + 42735 00008EF8 69657320616E792063- + 42735 00008F01 6F6D6D616E642D6C69- + 42735 00008F0A 6E6520696E666F726D- + 42735 00008F13 6174696F6E20726571- + 42735 00008F1C 75697265642062790D- + 42735 00008F25 0A + 42736 00008F26 202020202020202020- db ' the program.',0Dh,0Ah + 42736 00008F2F 202020746865207072- + 42736 00008F38 6F6772616D2E0D0A + 42737 + 42738 ; 02/08/2024 - Retro DOS v5.0 COMMAND.COM + 42739 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:96F3h + 42740 MSG_1107: + 42741 00008F40 0C db 12 + 42742 00008F41 2531204B2062797465- db '%1 K bytes',0Dh,0Ah + 42742 00008F4A 730D0A + 42743 + 42744 ; --------------------------------------------------------------------------- 42745 - 42746 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42747 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9695h + 42746 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 42747 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8183h 42748 - 42749 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42750 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9400h + 42749 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42750 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9695h 42751 - 42752 ; --------------- S U B R O U T I N E --------------------------------------- - 42753 - 42754 $M_CLS_3: - 42755 00008F4D 0E push cs ; CLASS_F - 42756 00008F4E 07 pop es - 42757 00008F4F 8D3E[FA62] lea di,$M_CLASS_3_STRUC ; LEA DI,$M_CLASS_3_STRUC - 42758 ; 15/04/2023 - 42759 ;add cx,10053 ; ADD CX,$-$M_CLASS_3_STRUC ; 8189h-5A44h - 42760 ; 17/06/2023 - 42761 ;add cx,11627 ; ADD CX,$-$M_CLASS_3_STRUC ; 969Bh-6930h - 42762 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42763 ;add cx,11353 ; ADD CX,$-$M_CLASS_3_STRUC ; 9406h-67ADh - 42764 00008F53 81C1592C add cx,$-$M_CLASS_3_STRUC - 42765 00008F57 C3 retn - 42766 - 42767 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 42768 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:818Eh + 42752 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42753 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9400h + 42754 + 42755 ; --------------- S U B R O U T I N E --------------------------------------- + 42756 + 42757 $M_CLS_3: + 42758 00008F4D 0E push cs ; CLASS_F + 42759 00008F4E 07 pop es + 42760 00008F4F 8D3E[FA62] lea di,$M_CLASS_3_STRUC ; LEA DI,$M_CLASS_3_STRUC + 42761 ; 15/04/2023 + 42762 ;add cx,10053 ; ADD CX,$-$M_CLASS_3_STRUC ; 8189h-5A44h + 42763 ; 17/06/2023 + 42764 ;add cx,11627 ; ADD CX,$-$M_CLASS_3_STRUC ; 969Bh-6930h + 42765 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42766 ;add cx,11353 ; ADD CX,$-$M_CLASS_3_STRUC ; 9406h-67ADh + 42767 00008F53 81C1592C add cx,$-$M_CLASS_3_STRUC + 42768 00008F57 C3 retn 42769 - 42770 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42771 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:96A0h + 42770 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 42771 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:818Eh 42772 - 42773 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42774 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:940Bh + 42773 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42774 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:96A0h 42775 - 42776 ; --------------------------------------------------------------------------- - 42777 ; Class 1 messages - 42778 ; --------------------------------------------------------------------------- - 42779 - 42780 $M_CLASS_1_STRUC: - 42781 00008F58 01 db 1 ; $M_CLASS_ID - 42782 ;dw 5 ; EXPECTED_VERSION (COMMAND.COM version) - 42783 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42784 ;dw 1606h ; MSDOS 6.22 COMMAND.COM - 42785 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM - 42786 00008F59 070A dw 0A07h ; PCDOS 7.10 COMMAND.COM - 42787 00008F5B 04 db 4 ; Class_1_MessageCount - 42788 $M_ID_1_1: - 42789 00008F5C 0200 dw 2 ; Message Number = 2 - 42790 00008F5E 1000 dw EXTEND2-$+2 ; 10h ; Message offset from message number - 42791 $M_ID_1_2: - 42792 00008F60 0300 dw 3 ; Message Number = 3 - 42793 00008F62 1B00 dw EXTEND3-$+2 ; 1Bh ; Message offset from message number - 42794 $M_ID_1_3: - 42795 00008F64 0800 dw 8 ; Message Number = 8 - 42796 00008F66 2600 dw EXTEND8-$+2 ; 26h ; Message offset from message number - 42797 $M_ID_1_4: - 42798 00008F68 FFFF dw 0FFFFh ; Message Number = -1 - 42799 00008F6A 3600 dw EXTEND999-$+2 ; 36h ; Message offset from message number - 42800 - 42801 ; --------------------------------------------------------------------------- - 42802 - 42803 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81A2h - 42804 EXTEND2: - 42805 00008F6C 0E db 14 - 42806 00008F6D 46696C65206E6F7420- db 'File not found' - 42806 00008F76 666F756E64 - 42807 EXTEND3: - 42808 00008F7B 0E db 14 - 42809 00008F7C 50617468206E6F7420- db 'Path not found' - 42809 00008F85 666F756E64 - 42810 EXTEND8: - 42811 00008F8A 13 db 19 - 42812 00008F8B 496E73756666696369- db 'Insufficient memory' - 42812 00008F94 656E74206D656D6F72- - 42812 00008F9D 79 - 42813 EXTEND999: - 42814 00008F9E 11 db 17 - 42815 00008F9F 457874656E64656420- db 'Extended Error %1' - 42815 00008FA8 4572726F72202531 - 42816 - 42817 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 42818 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81E6h + 42776 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42777 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:940Bh + 42778 + 42779 ; --------------------------------------------------------------------------- + 42780 ; Class 1 messages + 42781 ; --------------------------------------------------------------------------- + 42782 + 42783 $M_CLASS_1_STRUC: + 42784 00008F58 01 db 1 ; $M_CLASS_ID + 42785 ;dw 5 ; EXPECTED_VERSION (COMMAND.COM version) + 42786 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42787 ;dw 1606h ; MSDOS 6.22 COMMAND.COM + 42788 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM + 42789 00008F59 070A dw 0A07h ; PCDOS 7.10 COMMAND.COM + 42790 00008F5B 04 db 4 ; Class_1_MessageCount + 42791 $M_ID_1_1: + 42792 00008F5C 0200 dw 2 ; Message Number = 2 + 42793 00008F5E 1000 dw EXTEND2-$+2 ; 10h ; Message offset from message number + 42794 $M_ID_1_2: + 42795 00008F60 0300 dw 3 ; Message Number = 3 + 42796 00008F62 1B00 dw EXTEND3-$+2 ; 1Bh ; Message offset from message number + 42797 $M_ID_1_3: + 42798 00008F64 0800 dw 8 ; Message Number = 8 + 42799 00008F66 2600 dw EXTEND8-$+2 ; 26h ; Message offset from message number + 42800 $M_ID_1_4: + 42801 00008F68 FFFF dw 0FFFFh ; Message Number = -1 + 42802 00008F6A 3600 dw EXTEND999-$+2 ; 36h ; Message offset from message number + 42803 + 42804 ; --------------------------------------------------------------------------- + 42805 + 42806 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81A2h + 42807 EXTEND2: + 42808 00008F6C 0E db 14 + 42809 00008F6D 46696C65206E6F7420- db 'File not found' + 42809 00008F76 666F756E64 + 42810 EXTEND3: + 42811 00008F7B 0E db 14 + 42812 00008F7C 50617468206E6F7420- db 'Path not found' + 42812 00008F85 666F756E64 + 42813 EXTEND8: + 42814 00008F8A 13 db 19 + 42815 00008F8B 496E73756666696369- db 'Insufficient memory' + 42815 00008F94 656E74206D656D6F72- + 42815 00008F9D 79 + 42816 EXTEND999: + 42817 00008F9E 11 db 17 + 42818 00008F9F 457874656E64656420- db 'Extended Error %1' + 42818 00008FA8 4572726F72202531 42819 - 42820 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42821 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:96F8h + 42820 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 42821 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81E6h 42822 - 42823 ; --------------- S U B R O U T I N E --------------------------------------- - 42824 $M_MSGSERV_1: - 42825 00008FB0 0E push cs - 42826 00008FB1 07 pop es - 42827 00008FB2 8D3E[588F] lea di,$M_CLASS_1_STRUC - 42828 ; 15/04/2023 - 42829 ;add cx,94 ; $-$M_CLASS_1_STRUC ; 81ECh-818Eh - 42830 ; 17/06/2023 MSDOS 6.22 COMMAND.COM - 42831 ; 96FEh-96A0h = 5Eh = 94 - 42832 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42833 ;add cx,94 ; Retro DOS v5.0 COMMAND.COM - 42834 00008FB6 C3 retn - 42835 - 42836 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 42837 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81F0h + 42823 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42824 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:96F8h + 42825 + 42826 ; --------------- S U B R O U T I N E --------------------------------------- + 42827 $M_MSGSERV_1: + 42828 00008FB0 0E push cs + 42829 00008FB1 07 pop es + 42830 00008FB2 8D3E[588F] lea di,$M_CLASS_1_STRUC + 42831 ; 15/04/2023 + 42832 ;add cx,94 ; $-$M_CLASS_1_STRUC ; 81ECh-818Eh + 42833 ; 17/06/2023 MSDOS 6.22 COMMAND.COM + 42834 ; 96FEh-96A0h = 5Eh = 94 + 42835 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42836 ;add cx,94 ; Retro DOS v5.0 COMMAND.COM + 42837 00008FB6 C3 retn 42838 - 42839 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42840 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9702h + 42839 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 42840 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81F0h 42841 - 42842 ; --------------------------------------------------------------------------- - 42843 ; Class 2 messages - 42844 ; --------------------------------------------------------------------------- - 42845 - 42846 $M_CLASS_2_STRUC: - 42847 00008FB7 02 db 2 ; $M_CLASS_ID - 42848 ;dw 5 ; EXPECTED_VERSION (COMMAND.COM version) - 42849 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42850 ;dw 1606h ; MSDOS 6.22 COMMAND.COM - 42851 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM - 42852 00008FB8 070A dw 0A07h ; PCDOS 7.10 COMMAND.COM - 42853 00008FBA 01 db 1 ; Class_2_MessageCount - 42854 $M_ID_2_1: - 42855 00008FBB FFFF dw 0FFFFh ; Message Number = -1 - 42856 00008FBD 0400 dw PARSE999-$+2 ; 4 ; Message offset from message number - 42857 ; --------------------------------------------------------------------------- - 42858 - 42859 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81F8h - 42860 PARSE999: - 42861 00008FBF 0E db 14 - 42862 00008FC0 506172736520457272- db 'Parse Error %1' - 42862 00008FC9 6F72202531 - 42863 - 42864 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 42865 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8207h + 42842 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42843 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9702h + 42844 + 42845 ; --------------------------------------------------------------------------- + 42846 ; Class 2 messages + 42847 ; --------------------------------------------------------------------------- + 42848 + 42849 $M_CLASS_2_STRUC: + 42850 00008FB7 02 db 2 ; $M_CLASS_ID + 42851 ;dw 5 ; EXPECTED_VERSION (COMMAND.COM version) + 42852 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42853 ;dw 1606h ; MSDOS 6.22 COMMAND.COM + 42854 ; 21/07/2024 - Retro DOS v5.0 COMMAND.COM + 42855 00008FB8 070A dw 0A07h ; PCDOS 7.10 COMMAND.COM + 42856 00008FBA 01 db 1 ; Class_2_MessageCount + 42857 $M_ID_2_1: + 42858 00008FBB FFFF dw 0FFFFh ; Message Number = -1 + 42859 00008FBD 0400 dw PARSE999-$+2 ; 4 ; Message offset from message number + 42860 ; --------------------------------------------------------------------------- + 42861 + 42862 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:81F8h + 42863 PARSE999: + 42864 00008FBF 0E db 14 + 42865 00008FC0 506172736520457272- db 'Parse Error %1' + 42865 00008FC9 6F72202531 42866 - 42867 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42868 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9719h + 42867 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 42868 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8207h 42869 - 42870 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42871 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9484h + 42870 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42871 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9719h 42872 - 42873 ; --------------- S U B R O U T I N E --------------------------------------- - 42874 $M_MSGSERV_2: - 42875 00008FCE 0E push cs - 42876 00008FCF 07 pop es - 42877 00008FD0 8D3E[B78F] lea di,$M_CLASS_2_STRUC - 42878 ; 15/04/2023 - 42879 ;add cx,29 ; $-$M_CLASS_2_STRUC ; 820Dh-81F0h - 42880 ; 17/06/2023 MSDOS 6.22 COMMAND.COM - 42881 ; 971Fh-9702h = 1Dh = 29 - 42882 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 42883 ;add cx,29 ; Retro DOS v5.0 COMMAND.COM - 42884 00008FD4 C3 retn - 42885 - 42886 ;============================================================================ - 42887 ; TRANMSG.ASM, MSDOS 6.0, 1991 - 42888 ;============================================================================ - 42889 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 42890 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM - 42891 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM - 42892 - 42893 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8211h - 42894 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9723h - 42895 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:948Eh - 42896 - 42897 ;**************************************************** - 42898 ;* TRANSIENT MESSAGE POINTERS & SUBSTITUTION BLOCKS * - 42899 ;**************************************************** - 42900 - 42901 msg_disp_class: - 42902 00008FD5 FF db util_msg_class ; 0FFh - 42903 msg_cont_flag: - 42904 00008FD6 00 db no_cont_flag ; 0 - 42905 - 42906 ; extended error string output - 42907 extend_buf_ptr: - 42908 00008FD7 0000 dw 0 ;AN000;set to no message - 42909 extend_buf_sub: - 42910 00008FD9 00 db 0 ;AN000;set to no substitutions - 42911 00008FDA 0B db parm_block_size ; 11 ;AN000;size of sublist - 42912 00008FDB 00 db 0 ;AN000;reserved - 42913 extend_buf_off: - 42914 00008FDC [A09D] dw string_ptr_2 ;AN000;offset of arg - 42915 extend_buf_seg: - 42916 00008FDE 0000 dw 0 ;AN000;segment of arg - 42917 00008FE0 00 db 0 ;AN000;first subst - 42918 00008FE1 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 42919 00008FE2 80 db 128 ;AN000;maximum width - 42920 00008FE3 00 db 0 ;AN000;minimum width - 42921 00008FE4 20 db blank ; 20h ;AN000;pad character - 42922 - 42923 ; "Duplicate file name or file not found" - 42924 RENERR_PTR: - 42925 00008FE5 EA03 dw 1002 ;AN000;message number - 42926 00008FE7 00 db no_subst ; 0 ;AN000;number of subst - 42927 - 42928 ; "Invalid path or file name" - 42929 BADCPMES_PTR: - 42930 00008FE8 EB03 dw 1003 ;AN000;message number - 42931 00008FEA 00 db no_subst ; 0 ;AN000;number of subst - 42932 - 42933 ; "Insufficient disk space" - 42934 NOSPACE_PTR: - 42935 00008FEB EC03 dw 1004 ;AN000;message number - 42936 00008FED 00 db no_subst ; 0 ;AN000;number of subst - 42937 - 42938 ; "Out of environment space" - 42939 ENVERR_PTR: - 42940 00008FEE EF03 dw 1007 ;AN000;message number - 42941 00008FF0 00 db no_subst ; 0 ;AN000;number of subst - 42942 - 42943 ; "File creation error" - 42944 FULLDIR_PTR: - 42945 00008FF1 F003 dw 1008 ;AN000;message number - 42946 00008FF3 00 db no_subst ; 0 ;AN000;number of subst - 42947 - 42948 ; "Batch file missing",13,10 - 42949 BADBAT_PTR: - 42950 00008FF4 F103 dw 1009 ;AN000;message number - 42951 00008FF6 00 db no_subst ; 0 ;AN000;number of subst - 42952 - 42953 ; "Insert disk with batch file",13,10 - 42954 NEEDBAT_PTR: - 42955 00008FF7 F203 dw 1010 ;AN000;message number - 42956 00008FF9 00 db no_subst ; 0 ;AN000;number of subst - 42957 - 42958 ; "Bad command or file name",13,10 - 42959 BADNAM_PTR: - 42960 00008FFA F303 dw 1011 ;AN000;message number - 42961 00008FFC 00 db no_subst ; 0 ;AN000;number of subst - 42962 - 42963 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM - 42964 %if 1 - 42965 ; "REXX interpreter not found",13,10 - 42966 REXXNOTF_PTR: - 42967 00008FFD F403 dw 1012 - 42968 00008FFF 00 db no_subst ; 0 - 42969 %endif - 42970 - 42971 ; "Access denied",13,10 - 42972 ACCDEN_PTR: - 42973 00009000 F603 dw 1014 ;AN000;message number - 42974 00009002 00 db no_subst ; 0 ;AN000;number of subst - 42975 - 42976 ; "File cannot be copied onto itself",13,10 - 42977 OVERWR_PTR: - 42978 00009003 F703 dw 1015 ;AN000;message number - 42979 00009005 00 db no_subst ; 0 ;AN000;number of subst - 42980 - 42981 ; "Content of destination lost before copy",13,10 - 42982 LOSTERR_PTR: - 42983 00009006 F803 dw 1016 ;AN000;message number - 42984 00009008 00 db no_subst ; 0 ;AN000;number of subst - 42985 - 42986 ; "Invalid filename or file not found",13,10 - 42987 INORNOT_PTR: - 42988 00009009 F903 dw 1017 ;AN000;message number - 42989 0000900B 00 db no_subst ;AN000;number of subst - 42990 - 42991 ; "%1 File(s) copied",13,10 - 42992 copied_ptr: - 42993 0000900C FA03 dw 1018 ;AN000;message number - 42994 0000900E 01 db 1 ;AN000;number of subst - 42995 0000900F 0B db parm_block_size ; 11 ;AN000;size of sublist - 42996 00009010 00 db 0 ;AN000;reserved - 42997 00009011 [A29D] dw Copy_num ;AN000;offset of arg - 42998 00009013 0000 dw 0 ;AN000;segment of arg - 42999 00009015 01 db 1 ;AN000;first subst - 43000 00009016 A1 db 0A1h ; Right_Align+Unsgn_Bin_Word - 43001 ;AN000;binary to decimal - 43002 00009017 09 db 9 ;AN000;maximum width - 43003 00009018 09 db 9 ;AN000;minimum width - 43004 00009019 20 db blank ; 20h ;AN000;pad character - 43005 - 43006 ; "%1 File(s) " - 43007 dirmes_ptr: - 43008 0000901A FB03 dw 1019 ;AN000;message number - 43009 0000901C 01 db 1 ;AN000;number of subst - 43010 0000901D 0B db parm_block_size ; 11 ;AN000;size of sublist - 43011 0000901E 00 db 0 ;AN000;reserved - 43012 0000901F [A59D] dw Dir_Num ;AN000;offset of arg - 43013 00009021 0000 dw 0 ;AN000;segment of arg - 43014 00009023 01 db 1 ;AN000;first subst - 43015 ; MSDOS 5.0 COMMAND.COM - 43016 ;db 0A1h ; Right_Align+Unsgn_Bin_Word - 43017 ; 17/06/2023 - 43018 ;screen_f_3: - 43019 00009024 E1 db 0E1h ; MSDOS 6.22 COMMAND.COM - 43020 ;AN000;binary to decimal - 43021 00009025 09 db 9 ;AN000;maximum width - 43022 00009026 09 db 9 ;AN000;minimum width - 43023 00009027 20 db blank ; 20h ;AN000;pad character - 43024 - 43025 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 43026 %if 0 - 43027 ; "%1 bytes free",13,10 - 43028 bytmes_ptr: - 43029 dw 1020 ;AN000;message number - 43030 db 1 ;AN000;number of subst - 43031 db parm_block_size ; 11 ;AN000;size of sublist - 43032 db 0 ;AN000;reserved - 43033 dw Bytes_Free ;AN000;offset of arg - 43034 dw 0 ;AN000;segment of arg - 43035 db 1 ;AN000;first subst - 43036 ; MSDOS 5.0 COMMAND.COM - 43037 ;db 0B1h ; Right_Align+Unsgn_Bin_DWord - 43038 ; 17/06/2023 - 43039 screen_f_6: - 43040 db 0F1h ;AN000;long binary to decimal - 43041 ; MSDOS 5.0 COMMAND.COM - 43042 ;db 28 ;AN000;maximum width - 43043 ;db 28 ;AN000;minimum width - 43044 ; 17/06/2023 - 43045 screen_f_7: - 43046 db 32 ; MSDOS 6.22 COMMAND.COM - 43047 db 32 - 43048 - 43049 db blank ; 20h ;AN000;pad character - 43050 %else - 43051 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 43052 ; PCDOS 7.1 COMMAND.COM - 43053 dirmes_w_ptr: - 43054 00009028 FB03 dw 1019 - 43055 0000902A 01 db 1 - 43056 0000902B 0B db 11 - 43057 0000902C 00 db 0 - 43058 0000902D [A59D] dw Dir_Num - 43059 0000902F 0000 dw 0 - 43060 00009031 01 db 1 - 43061 00009032 F1 db 0F1h ; long binary to decimal - 43062 00009033 0A db 10 - 43063 00009034 0A db 10 - 43064 00009035 20 db 20h - 43065 dirmes2_ptr: - 43066 00009036 FB03 dw 1019 - 43067 00009038 01 db 1 - 43068 00009039 0B db 11 - 43069 0000903A 00 db 0 - 43070 0000903B [A59D] dw Dir_Num - 43071 0000903D 0000 dw 0 - 43072 0000903F 01 db 1 - 43073 00009040 B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord - 43074 00009041 09 db 9 - 43075 00009042 09 db 9 - 43076 00009043 20 db 20h - 43077 bytmes1_ptr: - 43078 00009044 FC03 dw 1020 - 43079 00009046 01 db 1 - 43080 00009047 0B db 11 - 43081 00009048 00 db 0 - 43082 00009049 [A99D] dw Bytes_Free - 43083 0000904B 0000 dw 0 - 43084 0000904D 01 db 1 - 43085 0000904E F1 db 0F1h ; long binary to decimal - 43086 0000904F 1E db 30 ; maximum width - 43087 00009050 1E db 30 ; minimum width - 43088 00009051 20 db 20h ; blank - 43089 bytmes2_ptr: - 43090 00009052 FC03 dw 1020 - 43091 00009054 01 db 1 - 43092 00009055 0B db 11 - 43093 00009056 00 db 0 - 43094 00009057 [A99D] dw Bytes_Free - 43095 00009059 0000 dw 0 - 43096 0000905B 01 db 1 - 43097 0000905C F1 db 0F1h ; long binary to decimal - 43098 0000905D 21 db 33 ; maximum width - 43099 0000905E 21 db 33 ; minimum width - 43100 0000905F 20 db 20h ; pad - 43101 bytmes_n_ptr: - 43102 00009060 FC03 dw 1020 - 43103 00009062 01 db 1 - 43104 00009063 0B db 11 ; parm_block_size - 43105 00009064 00 db 0 - 43106 00009065 [A99D] dw Bytes_Free - 43107 00009067 0000 dw 0 - 43108 00009069 01 db 1 - 43109 0000906A B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord - 43110 0000906B 1C db 28 - 43111 0000906C 1C db 28 - 43112 0000906D 20 db 20h - 43113 %endif - 43114 - 43115 ; "Invalid drive specification",13,10 - 43116 baddrv_ptr: - 43117 0000906E FD03 dw 1021 ;AN000;message number - 43118 00009070 00 db no_subst ; 0 ;AN000;number of subst - 43119 - 43120 ; "Code page %1 not prepared for system",13,10 - 43121 cp_not_set_ptr: - 43122 00009071 FE03 dw 1022 ;AN000;message number - 43123 00009073 01 db 1 ;AN000;number of subst - 43124 00009074 0B db parm_block_size ; 11 ;AN000;size of sublist - 43125 00009075 00 db 0 ;AN000;reserved - 43126 00009076 [9A9D] dw system_cpage ;AN000;offset of arg - 43127 00009078 0000 dw 0 ;AN000;segment of arg - 43128 0000907A 01 db 1 ;AN000;first subst - 43129 0000907B A1 db 0A1h ; Right_Align+Unsgn_Bin_Word - 43130 ;AN000;binary to decimal - 43131 0000907C 05 db 5 ;AN000;maximum width - 43132 0000907D 01 db 1 ;AN000;minimum width - 43133 0000907E 20 db blank ; 20h ;AN000;pad character - 43134 - 43135 ; "Code page %1 not prepared for all devices",13,10 - 43136 cp_not_all_ptr: - 43137 0000907F FF03 dw 1023 ;AN000;message number - 43138 00009081 01 db 1 ;AN000;number of subst - 43139 00009082 0B db parm_block_size ; 11 ;AN000;size of sublist - 43140 00009083 00 db 0 ;AN000;reserved - 43141 00009084 [9A9D] dw system_cpage ;AN000;offset of arg - 43142 00009086 0000 dw 0 ;AN000;segment of arg - 43143 00009088 01 db 1 ;AN000;first subst - 43144 00009089 A1 db 0A1h ; Right_Align+Unsgn_Bin_Word - 43145 ;AN000;binary to decimal - 43146 0000908A 05 db 5 ;AN000;maximum width - 43147 0000908B 01 db 1 ;AN000;minimum width - 43148 0000908C 20 db blank ; 20h ;AN000;pad character - 43149 - 43150 ; "Active code page: %1",13,10 - 43151 cp_active_ptr: - 43152 0000908D 0004 dw 1024 ;AN000;message number - 43153 0000908F 01 db 1 ;AN000;number of subst - 43154 00009090 0B db parm_block_size ; 11 ;AN000;size of sublist - 43155 00009091 00 db 0 ;AN000;reserved - 43156 00009092 [9A9D] dw system_cpage ;AN000;offset of arg - 43157 00009094 0000 dw 0 ;AN000;segment of arg - 43158 00009096 01 db 1 ;AN000;first subst - 43159 00009097 A1 db 0A1h ; Right_Align+Unsgn_Bin_Word - 43160 ;AN000;binary to decimal - 43161 00009098 05 db 5 ;AN000;maximum width - 43162 00009099 01 db 1 ;AN000;minimum width - 43163 0000909A 20 db blank ; 20h ;AN000;pad character - 43164 - 43165 ; "NLSFUNC not installed",13,10 - 43166 NLSFUNC_PTR: - 43167 0000909B 0104 dw 1025 ;AN000;message number - 43168 0000909D 00 db no_subst ; 0 ;AN000;number of subst - 43169 - 43170 ; "Invalid code page",13,10 - 43171 INV_CODE_PAGE: - 43172 0000909E 0204 dw 1026 ;AN000;message number - 43173 000090A0 00 db no_subst ; 0 ;AN000;number of subst - 43174 - 43175 ; "Current drive is no longer valid" - 43176 BADCURDRV: - 43177 000090A1 0304 dw 1027 ;AN000;message number - 43178 000090A3 00 db no_subst ; 0 ;AN000;number of subst - 43179 - 43180 ; "Press any key to continue" - 43181 PAUSEMES_PTR: - 43182 000090A4 0404 dw 1028 ;AN000;message number - 43183 000090A6 00 db no_subst ; 0 ;AN000;number of subst - 43184 - 43185 ; "Label not found",13,10 - 43186 BADLAB_PTR: - 43187 000090A7 0504 dw 1029 ;AN000;message number - 43188 000090A9 00 db no_subst ; 0 ;AN000;number of subst - 43189 - 43190 ; "Syntax error",13,10 - 43191 SYNTMES_PTR: - 43192 000090AA 0604 dw 1030 ;AN000;message number - 43193 000090AC 00 db no_subst ; 0 ;AN000;number of subst - 43194 - 43195 ; "Invalid date",13,10 - 43196 BADDAT_PTR: - 43197 000090AD 0704 dw 1031 ;AN000;message number - 43198 000090AF 00 db no_subst ; 0 ;AN000;number of subst - 43199 - 43200 ; "Current date is %1 %2",13,10 - 43201 CurDat_Ptr: - 43202 000090B0 0804 dw 1032 ;AN000;message number - 43203 000090B2 02 db 2 ;AN000;number of subst - 43204 000090B3 0B db parm_block_size ; 11 ;AN000;size of sublist - 43205 000090B4 00 db 0 ;AN000;reserved - 43206 000090B5 [96A3] dw Arg_Buf ;AN000;offset of arg - 43207 000090B7 0000 dw 0 ;AN000;segment of arg - 43208 000090B9 01 db 1 ;AN000;first subst - 43209 000090BA 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43210 000090BB 03 db 3 ;AN000;maximum width - 43211 000090BC 03 db 3 ;AN000;minimum width - 43212 000090BD 20 db blank ; 20h ;AN000;pad character - 43213 000090BE 0B db parm_block_size ;AN000;size of sublist - 43214 000090BF 00 db 0 ;AN000;reserved - 43215 CurDat_yr: - 43216 000090C0 0000 dw 0 ;AN000;year - 43217 CurDat_mo_day: - 43218 000090C2 0000 dw 0 ;AN000;month,day - 43219 000090C4 02 db 2 ;AN000;second subst - 43220 000090C5 34 db 34h ; DATE_MDY_4 ;AN000;date - 43221 000090C6 0A db 10 ;AN000;maximum width - 43222 000090C7 0A db 10 ;AN000;minimum width - 43223 000090C8 20 db blank ; 20h ;AN000;pad character - 43224 - 43225 ; "SunMonTueWedThuFriSat" - 43226 WeekTab: - 43227 000090C9 0904 dw 1033 ;AN000;message number - 43228 000090CB 00 db no_subst ; 0 ;AN000;number of subst - 43229 - 43230 ; "Enter new date (%1):" - 43231 - 43232 NewDat_Ptr: - 43233 000090CC 0A04 dw 1034 ;AN000;message number - 43234 000090CE 01 db 1 ;AN000;number of subst - 43235 000090CF 0B db parm_block_size ; 11 ;AN000;size of sublist - 43236 000090D0 00 db 0 ;AN000;reserved - 43237 NewDat_Format: - 43238 000090D1 0000 dw 0 ;AN000;offset of replacement - 43239 000090D3 0000 dw 0 ;AN000;segment of arg - 43240 000090D5 01 db 1 ;AN000;first subst - 43241 000090D6 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43242 000090D7 08 db 8 ;AN000;maximum width - 43243 000090D8 08 db 8 ;AN000;minimum width - 43244 000090D9 20 db blank ; 20h ;AN000;pad character - 43245 - 43246 ; "Invalid time",13,10 - 43247 - 43248 BadTim_Ptr: - 43249 000090DA 0B04 dw 1035 ;AN000;message number - 43250 000090DC 00 db no_subst ; 0 ;AN000;number of subst - 43251 - 43252 ; "Current time is %1",13,10 - 43253 CurTim_Ptr: - 43254 000090DD 0C04 dw 1036 ;AN000;message number - 43255 000090DF 01 db 1 ;AN000;number of subst - 43256 000090E0 0B db parm_block_size ;AN000;size of sublist - 43257 000090E1 00 db 0 ;AN000;reserved - 43258 CurTim_hr_min: - 43259 000090E2 0000 dw 0 ;AN000;hours,minutes - 43260 CurTim_Sec_hn: - 43261 000090E4 0000 dw 0 ;AN000;seconds,hundredths - 43262 000090E6 01 db 1 ;AN000;first subst - 43263 000090E7 A5 db 0A5h ; Right_Align+TIME_HHMMSSHH_Cty - 43264 ;AC059;time - 43265 000090E8 0C db 12 ;AC059;maximum width - 43266 000090E9 0C db 12 ;AC059;minimum width - 43267 000090EA 20 db blank ; 20h ;AN000;pad character - 43268 - 43269 ; "Enter new time:" - 43270 NewTim_Ptr: - 43271 000090EB 0D04 dw 1037 ;AN000;message number - 43272 000090ED 00 db no_subst ; 0 ;AN000;number of subst - 43273 - 43274 ; ", Delete (Y/N)?",13,10 - 43275 Del_Y_N_Ptr: - 43276 000090EE 0E04 dw 1038 ;AN000;message number - 43277 000090F0 00 db no_subst ; 0 ;AN000;number of subst - 43278 - 43279 ; "All files in directory will be deleted!",13,10 - 43280 ; "Are you sure (Y/N)?",13,10 - 43281 SureMes_Ptr: - 43282 000090F1 0F04 dw 1039 ;AN000;message number - 43283 000090F3 00 db no_subst ; 0 ;AN000;number of subst - 43284 - 43285 ; "Microsoft DOS Version %1.%2",13,10 - 43286 VerMes_Ptr: - 43287 000090F4 1004 dw 1040 ;AN000;message number - 43288 - 43289 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 43290 %if 0 - 43291 db 2 ;AN000;number of subst - 43292 db parm_block_size ; 11 ;AN000;size of sublist - 43293 db 0 ;AN000;reserved - 43294 dw Major_Ver_Num ;AN000;offset of arg - 43295 dw 0 ;AN000;segment of arg - 43296 db 1 ;AN000;first subst - 43297 db 0A1h ; Right_Align+Unsgn_Bin_Word - 43298 ;AN000;binary to decimal - 43299 db 1 ;AN000;maximum width - 43300 db 1 ;AN000;minimum width - 43301 db blank ; 20h ;AN000;pad character - 43302 db parm_block_size ; 11 ;AN000;size of sublist - 43303 db 0 ;AN000;reserved - 43304 dw Minor_Ver_Num ;AN000;offset of arg - 43305 dw 0 ;AN000;segment of arg - 43306 db 2 ;AN000;second subst - 43307 db 0A1h ; Right_Align+Unsgn_Bin_Word - 43308 ;AN000;binary to decimal - 43309 db 2 ;AN000;maximum width - 43310 db 2 ;AN000;minimum width - 43311 db '0' ; 30h ;AN000;pad character - 43312 %else - 43313 000090F6 00 db 0 ; no_subst - 43314 %endif - 43315 - 43316 ; "Volume in drive %1 has no label",13,10 - 43317 VolMes_Ptr_2: - 43318 000090F7 1104 dw 1041 ;AN000;message number - 43319 000090F9 01 db 1 ;AN000;number of subst - 43320 000090FA 0B db parm_block_size ; 11 ;AN000;size of sublist - 43321 000090FB 00 db 0 ;AN000;reserved - 43322 000090FC [B39D] dw vol_drv ;AN000;offset of drive - 43323 000090FE 0000 dw 0 ;AN000;segment of arg - 43324 00009100 01 db 1 ;AN000;first subst - 43325 00009101 00 db 0 ; Char_field_Char ;AN000;character - 43326 00009102 80 db 128 ;AN000;maximum width - 43327 00009103 01 db 1 ;AN000;minimum width - 43328 00009104 20 db blank ; 20h ;AN000;pad character - 43329 - 43330 ; "Volume in drive %1 is %2",13,10 - 43331 VolMes_Ptr: - 43332 00009105 1204 dw 1042 ;AN000;message number - 43333 00009107 02 db 2 ;AN000;number of subst - 43334 00009108 0B db parm_block_size ; 11 ;AN000;size of sublist - 43335 00009109 00 db 0 ;AN000;reserved - 43336 0000910A [B39D] dw vol_drv ;AN000;offset of drive - 43337 0000910C 0000 dw 0 ;AN000;segment of arg - 43338 0000910E 01 db 1 ;AN000;first subst - 43339 0000910F 00 db 00000000b ;AN000;character - 43340 00009110 80 db 128 ;AN000;maximum width - 43341 00009111 01 db 1 ;AN000;minimum width - 43342 00009112 20 db blank ; 20h ;AN000;pad character - 43343 00009113 0B db parm_block_size ; 11 ;AN000;size of sublist - 43344 00009114 00 db 0 ;AN000;reserved - 43345 00009115 [6A9C] dw CHARBUF ;AN000;offset of string - 43346 00009117 0000 dw 0 ;AN000;segment of arg - 43347 00009119 02 db 2 ;AN000;second subst - 43348 0000911A 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43349 0000911B 80 db 128 ;AN000;maximum width - 43350 0000911C 01 db 1 ;AN000;minimum width - 43351 0000911D 20 db blank ; 20h ;AN000;pad character - 43352 - 43353 ; "Volume Serial Number is %1-%2",13,10 - 43354 VolSerMes_Ptr: - 43355 0000911E 1304 dw 1043 ;AN000;message number - 43356 00009120 02 db 2 ;AN000;number of subst - 43357 00009121 0B db parm_block_size ; 11 ;AN000;size of sublist - 43358 00009122 00 db 0 ;AN000;reserved - 43359 00009123 [1D9F] dw vol_serial+2 ;AN000;offset of serial - 43360 00009125 0000 dw 0 ;AN000;segment of arg - 43361 00009127 01 db 1 ;AN000;first subst - 43362 00009128 A3 db 0A3h ; Right_Align+Bin_Hex_Word - 43363 ;AN000;binary to hex - 43364 00009129 04 db 4 ;AN000;maximum width - 43365 0000912A 04 db 4 ;AN000;minimum width - 43366 0000912B 30 db '0' ; 30h ;AN000;pad character - 43367 0000912C 0B db parm_block_size ; 11 ;AN000;size of sublist - 43368 0000912D 00 db 0 ;AN000;reserved - 43369 0000912E [1B9F] dw vol_serial ;AN000;offset of serial - 43370 00009130 0000 dw 0 ;AN000;segment of arg - 43371 00009132 02 db 2 ;AN000;second subst - 43372 00009133 A3 db 0A3h ; Right_Align+Bin_Hex_Word - 43373 ;AN000;binary to hex - 43374 00009134 04 db 4 ;AN000;maximum width - 43375 00009135 04 db 4 ;AN000;minimum width - 43376 00009136 30 db '0' ; 30h ;AN000;pad character - 43377 - 43378 ; "Invalid directory",13,10 - 43379 badcd_ptr: - 43380 00009137 1404 dw 1044 ;AN000;message number - 43381 00009139 00 db no_subst ; 0 ;AN000;number of subst - 43382 - 43383 ; "Unable to create directory",13,10 - 43384 badmkd_ptr: - 43385 0000913A 1504 dw 1045 ;AN000;message number - 43386 0000913C 00 db no_subst ; 0 ;AN000;number of subst - 43387 - 43388 ; "Invalid path, not directory,",13,10 - 43389 ; "or directory not empty",13,10 - 43390 badrmd_ptr: - 43391 0000913D 1604 dw 1046 ;AN000;message number - 43392 0000913F 00 db no_subst ; 0 ;AN000;number of subst - 43393 - 43394 ; "Must specify ON or OFF",13,10 - 43395 bad_on_off_ptr: - 43396 00009140 1704 dw 1047 ;AN000;message number - 43397 00009142 00 db no_subst ; 0 ;AN000;number of subst - 43398 - 43399 ; "Directory of %1",13,10 - 43400 dirhead_ptr: - 43401 00009143 1804 dw 1048 ;AN000;message number - 43402 00009145 01 db 1 ;AN000;number of subst - 43403 00009146 0B db parm_block_size ; 11 ;AN000;size of sublist - 43404 00009147 00 db 0 ;AN000;reserved - 43405 00009148 [399D] dw BWDBUF ;AN000;offset of arg - 43406 0000914A 0000 dw 0 ;AN000;segment of arg - 43407 0000914C 01 db 1 ;AN000;first subst - 43408 0000914D 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43409 0000914E 80 db 128 ;AN000;maximum width - 43410 0000914F 00 db 0 ;AN000;minimum width - 43411 00009150 20 db blank ; 20h ;AN000;pad character - 43412 - 43413 ; "No Path",13,10 - 43414 NULLPATH_PTR: - 43415 00009151 1904 dw 1049 ;AN000;message number - 43416 00009153 00 db no_subst ; 0 ;AN000;number of subst - 43417 - 43418 ; "Invalid drive in search path",13,10 - 43419 BADPMES_PTR: - 43420 00009154 1A04 dw 1050 ;AN000;message number - 43421 00009156 00 db no_subst ; 0 ;AN000;number of subst - 43422 - 43423 ; "Invalid device",13,10 - 43424 BADDEV_PTR: - 43425 00009157 1B04 dw 1051 ;AN000;message number - 43426 00009159 00 db no_subst ; 0 ;AN000;number of subst - 43427 - 43428 ; "FOR cannot be nested",13,10 - 43429 FORNESTMES_PTR: - 43430 0000915A 1C04 dw 1052 ;AN000;message number - 43431 0000915C 00 db no_subst ; 0 ;AN000;number of subst - 43432 - 43433 ; "Intermediate file error during pipe",13,10 - 43434 PIPEEMES_PTR: - 43435 0000915D 1D04 dw 1053 ;AN000;message number - 43436 0000915F 00 db no_subst ; 0 ;AN000;number of subst - 43437 - 43438 ; "Cannot do binary reads from a device",13,10 - 43439 INBDEV_PTR: - 43440 00009160 1E04 dw 1054 ;AN000;message number - 43441 00009162 00 db no_subst ; 0 ;AN000;number of subst - 43442 - 43443 ; "BREAK is %1",13,10 - 43444 CtrlcMes_Ptr: - 43445 00009163 1F04 dw 1055 ;AN000;message number - 43446 00009165 01 db 1 ;AN000;number of subst - 43447 00009166 0B db parm_block_size ; 11 ;AN000;size of sublist - 43448 00009167 00 db 0 ;AN000;reserved - 43449 00009168 0000 dw 0 ;AN000;offset of on/off (new) - 43450 0000916A 0000 dw 0 ;AN000;segment of arg - 43451 0000916C 01 db 1 ;AN000;first subst - 43452 0000916D 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43453 0000916E 80 db 128 ;AN000;maximum width - 43454 0000916F 01 db 1 ;AN000;minimum width - 43455 00009170 20 db blank ; 20h ;AN000;pad character - 43456 - 43457 ; "VERIFY is %1",13,10 - 43458 VeriMes_Ptr: - 43459 00009171 2004 dw 1056 ;AN000;message number - 43460 00009173 01 db 1 ;AN000;number of subst - 43461 00009174 0B db parm_block_size ; 11 ;AN000;size of sublist - 43462 00009175 00 db 0 ;AN000;reserved - 43463 00009176 0000 dw 0 ;AN000;offset of on/off (new) - 43464 00009178 0000 dw 0 ;AN000;segment of arg - 43465 0000917A 01 db 1 ;AN000;first subst - 43466 0000917B 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43467 0000917C 80 db 128 ;AN000;maximum width - 43468 0000917D 01 db 1 ;AN000;minimum width - 43469 0000917E 20 db blank ; 20h ;AN000;pad character - 43470 - 43471 ; "ECHO is %1",13,10 - 43472 EchoMes_Ptr: - 43473 0000917F 2104 dw 1057 ;AN000;message number - 43474 00009181 01 db 1 ;AN000;number of subst - 43475 00009182 0B db parm_block_size ; 11 ;AN000;size of sublist - 43476 00009183 00 db 0 ;AN000;reserved - 43477 00009184 0000 dw 0 ;AN000;offset of on/off (new) - 43478 00009186 0000 dw 0 ;AN000;segment of arg - 43479 00009188 01 db 1 ;AN000;first subst - 43480 00009189 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43481 0000918A 80 db 128 ;AN000;maximum width - 43482 0000918B 01 db 1 ;AN000;minimum width - 43483 0000918C 20 db blank ; 20h ;AN000;pad character - 43484 - 43485 ; "off" - 43486 OFFMES_PTR: - 43487 0000918D 2304 dw 1059 ;AN000;message number - 43488 0000918F 00 db no_subst ;AN000;number of subst - 43489 ; "on" - 43490 ONMES_PTR: - 43491 00009190 2404 dw 1060 ;AN000;message number - 43492 00009192 00 db no_subst ; 0 ;AN000;number of subst - 43493 - 43494 ; "Error writing to device",13,10 - 43495 DEVWMES_PTR: - 43496 00009193 2504 dw 1061 ;AN000;message number - 43497 00009195 00 db no_subst ; 0 ;AN000;number of subst - 43498 - 43499 ; "Invalid path",13,10 - 43500 INVAL_PATH_PTR: - 43501 00009196 2604 dw 1062 ;AN000;message number - 43502 00009198 00 db no_subst ; 0 ;AN000;number of subst - 43503 - 43504 ; unformatted string output - 43505 arg_buf_ptr: - 43506 00009199 2704 dw 1063 ;AN000;message number - 43507 0000919B 01 db 1 ;AN000;number of subst - 43508 0000919C 0B db parm_block_size ; 11 ;AN000;size of sublist - 43509 0000919D 00 db 0 ;AN000;reserved - 43510 0000919E [96A3] dw Arg_Buf ;AN000;offset of arg - 43511 000091A0 0000 dw 0 ;AN000;segment of arg - 43512 000091A2 01 db 1 ;AN000;first subst - 43513 000091A3 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43514 000091A4 80 db 128 ;AN000;maximum width - 43515 000091A5 00 db 0 ;AN000;minimum width - 43516 000091A6 20 db blank ; 20h ;AN000;pad character - 43517 - 43518 ; file name output - 43519 file_name_ptr: - 43520 000091A7 2804 dw 1064 ;AN000;message number - 43521 000091A9 01 db 1 ;AN000;number of subst - 43522 000091AA 0B db parm_block_size ; 11 ;AN000;size of sublist - 43523 000091AB 00 db 0 ;AN000;reserved - 43524 000091AC [219E] dw SrcBuf ;AN000;offset of arg - 43525 000091AE 0000 dw 0 ;AN000;segment of arg - 43526 000091B0 01 db 1 ;AN000;first subst - 43527 000091B1 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43528 000091B2 80 db 128 ;AN000;maximum width - 43529 000091B3 00 db 0 ;AN000;minimum width - 43530 000091B4 20 db blank ; 20h ;AN000;pad character - 43531 - 43532 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 43533 %if 0 + 42873 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42874 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9484h + 42875 + 42876 ; --------------- S U B R O U T I N E --------------------------------------- + 42877 $M_MSGSERV_2: + 42878 00008FCE 0E push cs + 42879 00008FCF 07 pop es + 42880 00008FD0 8D3E[B78F] lea di,$M_CLASS_2_STRUC + 42881 ; 15/04/2023 + 42882 ;add cx,29 ; $-$M_CLASS_2_STRUC ; 820Dh-81F0h + 42883 ; 17/06/2023 MSDOS 6.22 COMMAND.COM + 42884 ; 971Fh-9702h = 1Dh = 29 + 42885 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 42886 ;add cx,29 ; Retro DOS v5.0 COMMAND.COM + 42887 00008FD4 C3 retn + 42888 + 42889 ;============================================================================ + 42890 ; TRANMSG.ASM, MSDOS 6.0, 1991 + 42891 ;============================================================================ + 42892 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 42893 ; 17/06/2023 - Retro DOS v4.2 COMMAND.COM + 42894 ; 06/08/2024 - Retro DOS v5.0 COMMAND.COM + 42895 + 42896 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8211h + 42897 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9723h + 42898 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:948Eh + 42899 + 42900 ;**************************************************** + 42901 ;* TRANSIENT MESSAGE POINTERS & SUBSTITUTION BLOCKS * + 42902 ;**************************************************** + 42903 + 42904 msg_disp_class: + 42905 00008FD5 FF db util_msg_class ; 0FFh + 42906 msg_cont_flag: + 42907 00008FD6 00 db no_cont_flag ; 0 + 42908 + 42909 ; extended error string output + 42910 extend_buf_ptr: + 42911 00008FD7 0000 dw 0 ;AN000;set to no message + 42912 extend_buf_sub: + 42913 00008FD9 00 db 0 ;AN000;set to no substitutions + 42914 00008FDA 0B db parm_block_size ; 11 ;AN000;size of sublist + 42915 00008FDB 00 db 0 ;AN000;reserved + 42916 extend_buf_off: + 42917 00008FDC [A09D] dw string_ptr_2 ;AN000;offset of arg + 42918 extend_buf_seg: + 42919 00008FDE 0000 dw 0 ;AN000;segment of arg + 42920 00008FE0 00 db 0 ;AN000;first subst + 42921 00008FE1 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 42922 00008FE2 80 db 128 ;AN000;maximum width + 42923 00008FE3 00 db 0 ;AN000;minimum width + 42924 00008FE4 20 db blank ; 20h ;AN000;pad character + 42925 + 42926 ; "Duplicate file name or file not found" + 42927 RENERR_PTR: + 42928 00008FE5 EA03 dw 1002 ;AN000;message number + 42929 00008FE7 00 db no_subst ; 0 ;AN000;number of subst + 42930 + 42931 ; "Invalid path or file name" + 42932 BADCPMES_PTR: + 42933 00008FE8 EB03 dw 1003 ;AN000;message number + 42934 00008FEA 00 db no_subst ; 0 ;AN000;number of subst + 42935 + 42936 ; "Insufficient disk space" + 42937 NOSPACE_PTR: + 42938 00008FEB EC03 dw 1004 ;AN000;message number + 42939 00008FED 00 db no_subst ; 0 ;AN000;number of subst + 42940 + 42941 ; "Out of environment space" + 42942 ENVERR_PTR: + 42943 00008FEE EF03 dw 1007 ;AN000;message number + 42944 00008FF0 00 db no_subst ; 0 ;AN000;number of subst + 42945 + 42946 ; "File creation error" + 42947 FULLDIR_PTR: + 42948 00008FF1 F003 dw 1008 ;AN000;message number + 42949 00008FF3 00 db no_subst ; 0 ;AN000;number of subst + 42950 + 42951 ; "Batch file missing",13,10 + 42952 BADBAT_PTR: + 42953 00008FF4 F103 dw 1009 ;AN000;message number + 42954 00008FF6 00 db no_subst ; 0 ;AN000;number of subst + 42955 + 42956 ; "Insert disk with batch file",13,10 + 42957 NEEDBAT_PTR: + 42958 00008FF7 F203 dw 1010 ;AN000;message number + 42959 00008FF9 00 db no_subst ; 0 ;AN000;number of subst + 42960 + 42961 ; "Bad command or file name",13,10 + 42962 BADNAM_PTR: + 42963 00008FFA F303 dw 1011 ;AN000;message number + 42964 00008FFC 00 db no_subst ; 0 ;AN000;number of subst + 42965 + 42966 ; 04/08/2024 - PCDOS 7.1 COMMAND.COM + 42967 %if 1 + 42968 ; "REXX interpreter not found",13,10 + 42969 REXXNOTF_PTR: + 42970 00008FFD F403 dw 1012 + 42971 00008FFF 00 db no_subst ; 0 + 42972 %endif + 42973 + 42974 ; "Access denied",13,10 + 42975 ACCDEN_PTR: + 42976 00009000 F603 dw 1014 ;AN000;message number + 42977 00009002 00 db no_subst ; 0 ;AN000;number of subst + 42978 + 42979 ; "File cannot be copied onto itself",13,10 + 42980 OVERWR_PTR: + 42981 00009003 F703 dw 1015 ;AN000;message number + 42982 00009005 00 db no_subst ; 0 ;AN000;number of subst + 42983 + 42984 ; "Content of destination lost before copy",13,10 + 42985 LOSTERR_PTR: + 42986 00009006 F803 dw 1016 ;AN000;message number + 42987 00009008 00 db no_subst ; 0 ;AN000;number of subst + 42988 + 42989 ; "Invalid filename or file not found",13,10 + 42990 INORNOT_PTR: + 42991 00009009 F903 dw 1017 ;AN000;message number + 42992 0000900B 00 db no_subst ;AN000;number of subst + 42993 + 42994 ; "%1 File(s) copied",13,10 + 42995 copied_ptr: + 42996 0000900C FA03 dw 1018 ;AN000;message number + 42997 0000900E 01 db 1 ;AN000;number of subst + 42998 0000900F 0B db parm_block_size ; 11 ;AN000;size of sublist + 42999 00009010 00 db 0 ;AN000;reserved + 43000 00009011 [A29D] dw Copy_num ;AN000;offset of arg + 43001 00009013 0000 dw 0 ;AN000;segment of arg + 43002 00009015 01 db 1 ;AN000;first subst + 43003 00009016 A1 db 0A1h ; Right_Align+Unsgn_Bin_Word + 43004 ;AN000;binary to decimal + 43005 00009017 09 db 9 ;AN000;maximum width + 43006 00009018 09 db 9 ;AN000;minimum width + 43007 00009019 20 db blank ; 20h ;AN000;pad character + 43008 + 43009 ; "%1 File(s) " + 43010 dirmes_ptr: + 43011 0000901A FB03 dw 1019 ;AN000;message number + 43012 0000901C 01 db 1 ;AN000;number of subst + 43013 0000901D 0B db parm_block_size ; 11 ;AN000;size of sublist + 43014 0000901E 00 db 0 ;AN000;reserved + 43015 0000901F [A59D] dw Dir_Num ;AN000;offset of arg + 43016 00009021 0000 dw 0 ;AN000;segment of arg + 43017 00009023 01 db 1 ;AN000;first subst + 43018 ; MSDOS 5.0 COMMAND.COM + 43019 ;db 0A1h ; Right_Align+Unsgn_Bin_Word + 43020 ; 17/06/2023 + 43021 ;screen_f_3: + 43022 00009024 E1 db 0E1h ; MSDOS 6.22 COMMAND.COM + 43023 ;AN000;binary to decimal + 43024 00009025 09 db 9 ;AN000;maximum width + 43025 00009026 09 db 9 ;AN000;minimum width + 43026 00009027 20 db blank ; 20h ;AN000;pad character + 43027 + 43028 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 43029 %if 0 + 43030 ; "%1 bytes free",13,10 + 43031 bytmes_ptr: + 43032 dw 1020 ;AN000;message number + 43033 db 1 ;AN000;number of subst + 43034 db parm_block_size ; 11 ;AN000;size of sublist + 43035 db 0 ;AN000;reserved + 43036 dw Bytes_Free ;AN000;offset of arg + 43037 dw 0 ;AN000;segment of arg + 43038 db 1 ;AN000;first subst + 43039 ; MSDOS 5.0 COMMAND.COM + 43040 ;db 0B1h ; Right_Align+Unsgn_Bin_DWord + 43041 ; 17/06/2023 + 43042 screen_f_6: + 43043 db 0F1h ;AN000;long binary to decimal + 43044 ; MSDOS 5.0 COMMAND.COM + 43045 ;db 28 ;AN000;maximum width + 43046 ;db 28 ;AN000;minimum width + 43047 ; 17/06/2023 + 43048 screen_f_7: + 43049 db 32 ; MSDOS 6.22 COMMAND.COM + 43050 db 32 + 43051 + 43052 db blank ; 20h ;AN000;pad character + 43053 %else + 43054 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 43055 ; PCDOS 7.1 COMMAND.COM + 43056 dirmes_w_ptr: + 43057 00009028 FB03 dw 1019 + 43058 0000902A 01 db 1 + 43059 0000902B 0B db 11 + 43060 0000902C 00 db 0 + 43061 0000902D [A59D] dw Dir_Num + 43062 0000902F 0000 dw 0 + 43063 00009031 01 db 1 + 43064 00009032 F1 db 0F1h ; long binary to decimal + 43065 00009033 0A db 10 + 43066 00009034 0A db 10 + 43067 00009035 20 db 20h + 43068 dirmes2_ptr: + 43069 00009036 FB03 dw 1019 + 43070 00009038 01 db 1 + 43071 00009039 0B db 11 + 43072 0000903A 00 db 0 + 43073 0000903B [A59D] dw Dir_Num + 43074 0000903D 0000 dw 0 + 43075 0000903F 01 db 1 + 43076 00009040 B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord + 43077 00009041 09 db 9 + 43078 00009042 09 db 9 + 43079 00009043 20 db 20h + 43080 bytmes1_ptr: + 43081 00009044 FC03 dw 1020 + 43082 00009046 01 db 1 + 43083 00009047 0B db 11 + 43084 00009048 00 db 0 + 43085 00009049 [A99D] dw Bytes_Free + 43086 0000904B 0000 dw 0 + 43087 0000904D 01 db 1 + 43088 0000904E F1 db 0F1h ; long binary to decimal + 43089 0000904F 1E db 30 ; maximum width + 43090 00009050 1E db 30 ; minimum width + 43091 00009051 20 db 20h ; blank + 43092 bytmes2_ptr: + 43093 00009052 FC03 dw 1020 + 43094 00009054 01 db 1 + 43095 00009055 0B db 11 + 43096 00009056 00 db 0 + 43097 00009057 [A99D] dw Bytes_Free + 43098 00009059 0000 dw 0 + 43099 0000905B 01 db 1 + 43100 0000905C F1 db 0F1h ; long binary to decimal + 43101 0000905D 21 db 33 ; maximum width + 43102 0000905E 21 db 33 ; minimum width + 43103 0000905F 20 db 20h ; pad + 43104 bytmes_n_ptr: + 43105 00009060 FC03 dw 1020 + 43106 00009062 01 db 1 + 43107 00009063 0B db 11 ; parm_block_size + 43108 00009064 00 db 0 + 43109 00009065 [A99D] dw Bytes_Free + 43110 00009067 0000 dw 0 + 43111 00009069 01 db 1 + 43112 0000906A B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord + 43113 0000906B 1C db 28 + 43114 0000906C 1C db 28 + 43115 0000906D 20 db 20h + 43116 %endif + 43117 + 43118 ; "Invalid drive specification",13,10 + 43119 baddrv_ptr: + 43120 0000906E FD03 dw 1021 ;AN000;message number + 43121 00009070 00 db no_subst ; 0 ;AN000;number of subst + 43122 + 43123 ; "Code page %1 not prepared for system",13,10 + 43124 cp_not_set_ptr: + 43125 00009071 FE03 dw 1022 ;AN000;message number + 43126 00009073 01 db 1 ;AN000;number of subst + 43127 00009074 0B db parm_block_size ; 11 ;AN000;size of sublist + 43128 00009075 00 db 0 ;AN000;reserved + 43129 00009076 [9A9D] dw system_cpage ;AN000;offset of arg + 43130 00009078 0000 dw 0 ;AN000;segment of arg + 43131 0000907A 01 db 1 ;AN000;first subst + 43132 0000907B A1 db 0A1h ; Right_Align+Unsgn_Bin_Word + 43133 ;AN000;binary to decimal + 43134 0000907C 05 db 5 ;AN000;maximum width + 43135 0000907D 01 db 1 ;AN000;minimum width + 43136 0000907E 20 db blank ; 20h ;AN000;pad character + 43137 + 43138 ; "Code page %1 not prepared for all devices",13,10 + 43139 cp_not_all_ptr: + 43140 0000907F FF03 dw 1023 ;AN000;message number + 43141 00009081 01 db 1 ;AN000;number of subst + 43142 00009082 0B db parm_block_size ; 11 ;AN000;size of sublist + 43143 00009083 00 db 0 ;AN000;reserved + 43144 00009084 [9A9D] dw system_cpage ;AN000;offset of arg + 43145 00009086 0000 dw 0 ;AN000;segment of arg + 43146 00009088 01 db 1 ;AN000;first subst + 43147 00009089 A1 db 0A1h ; Right_Align+Unsgn_Bin_Word + 43148 ;AN000;binary to decimal + 43149 0000908A 05 db 5 ;AN000;maximum width + 43150 0000908B 01 db 1 ;AN000;minimum width + 43151 0000908C 20 db blank ; 20h ;AN000;pad character + 43152 + 43153 ; "Active code page: %1",13,10 + 43154 cp_active_ptr: + 43155 0000908D 0004 dw 1024 ;AN000;message number + 43156 0000908F 01 db 1 ;AN000;number of subst + 43157 00009090 0B db parm_block_size ; 11 ;AN000;size of sublist + 43158 00009091 00 db 0 ;AN000;reserved + 43159 00009092 [9A9D] dw system_cpage ;AN000;offset of arg + 43160 00009094 0000 dw 0 ;AN000;segment of arg + 43161 00009096 01 db 1 ;AN000;first subst + 43162 00009097 A1 db 0A1h ; Right_Align+Unsgn_Bin_Word + 43163 ;AN000;binary to decimal + 43164 00009098 05 db 5 ;AN000;maximum width + 43165 00009099 01 db 1 ;AN000;minimum width + 43166 0000909A 20 db blank ; 20h ;AN000;pad character + 43167 + 43168 ; "NLSFUNC not installed",13,10 + 43169 NLSFUNC_PTR: + 43170 0000909B 0104 dw 1025 ;AN000;message number + 43171 0000909D 00 db no_subst ; 0 ;AN000;number of subst + 43172 + 43173 ; "Invalid code page",13,10 + 43174 INV_CODE_PAGE: + 43175 0000909E 0204 dw 1026 ;AN000;message number + 43176 000090A0 00 db no_subst ; 0 ;AN000;number of subst + 43177 + 43178 ; "Current drive is no longer valid" + 43179 BADCURDRV: + 43180 000090A1 0304 dw 1027 ;AN000;message number + 43181 000090A3 00 db no_subst ; 0 ;AN000;number of subst + 43182 + 43183 ; "Press any key to continue" + 43184 PAUSEMES_PTR: + 43185 000090A4 0404 dw 1028 ;AN000;message number + 43186 000090A6 00 db no_subst ; 0 ;AN000;number of subst + 43187 + 43188 ; "Label not found",13,10 + 43189 BADLAB_PTR: + 43190 000090A7 0504 dw 1029 ;AN000;message number + 43191 000090A9 00 db no_subst ; 0 ;AN000;number of subst + 43192 + 43193 ; "Syntax error",13,10 + 43194 SYNTMES_PTR: + 43195 000090AA 0604 dw 1030 ;AN000;message number + 43196 000090AC 00 db no_subst ; 0 ;AN000;number of subst + 43197 + 43198 ; "Invalid date",13,10 + 43199 BADDAT_PTR: + 43200 000090AD 0704 dw 1031 ;AN000;message number + 43201 000090AF 00 db no_subst ; 0 ;AN000;number of subst + 43202 + 43203 ; "Current date is %1 %2",13,10 + 43204 CurDat_Ptr: + 43205 000090B0 0804 dw 1032 ;AN000;message number + 43206 000090B2 02 db 2 ;AN000;number of subst + 43207 000090B3 0B db parm_block_size ; 11 ;AN000;size of sublist + 43208 000090B4 00 db 0 ;AN000;reserved + 43209 000090B5 [96A3] dw Arg_Buf ;AN000;offset of arg + 43210 000090B7 0000 dw 0 ;AN000;segment of arg + 43211 000090B9 01 db 1 ;AN000;first subst + 43212 000090BA 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43213 000090BB 03 db 3 ;AN000;maximum width + 43214 000090BC 03 db 3 ;AN000;minimum width + 43215 000090BD 20 db blank ; 20h ;AN000;pad character + 43216 000090BE 0B db parm_block_size ;AN000;size of sublist + 43217 000090BF 00 db 0 ;AN000;reserved + 43218 CurDat_yr: + 43219 000090C0 0000 dw 0 ;AN000;year + 43220 CurDat_mo_day: + 43221 000090C2 0000 dw 0 ;AN000;month,day + 43222 000090C4 02 db 2 ;AN000;second subst + 43223 000090C5 34 db 34h ; DATE_MDY_4 ;AN000;date + 43224 000090C6 0A db 10 ;AN000;maximum width + 43225 000090C7 0A db 10 ;AN000;minimum width + 43226 000090C8 20 db blank ; 20h ;AN000;pad character + 43227 + 43228 ; "SunMonTueWedThuFriSat" + 43229 WeekTab: + 43230 000090C9 0904 dw 1033 ;AN000;message number + 43231 000090CB 00 db no_subst ; 0 ;AN000;number of subst + 43232 + 43233 ; "Enter new date (%1):" + 43234 + 43235 NewDat_Ptr: + 43236 000090CC 0A04 dw 1034 ;AN000;message number + 43237 000090CE 01 db 1 ;AN000;number of subst + 43238 000090CF 0B db parm_block_size ; 11 ;AN000;size of sublist + 43239 000090D0 00 db 0 ;AN000;reserved + 43240 NewDat_Format: + 43241 000090D1 0000 dw 0 ;AN000;offset of replacement + 43242 000090D3 0000 dw 0 ;AN000;segment of arg + 43243 000090D5 01 db 1 ;AN000;first subst + 43244 000090D6 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43245 000090D7 08 db 8 ;AN000;maximum width + 43246 000090D8 08 db 8 ;AN000;minimum width + 43247 000090D9 20 db blank ; 20h ;AN000;pad character + 43248 + 43249 ; "Invalid time",13,10 + 43250 + 43251 BadTim_Ptr: + 43252 000090DA 0B04 dw 1035 ;AN000;message number + 43253 000090DC 00 db no_subst ; 0 ;AN000;number of subst + 43254 + 43255 ; "Current time is %1",13,10 + 43256 CurTim_Ptr: + 43257 000090DD 0C04 dw 1036 ;AN000;message number + 43258 000090DF 01 db 1 ;AN000;number of subst + 43259 000090E0 0B db parm_block_size ;AN000;size of sublist + 43260 000090E1 00 db 0 ;AN000;reserved + 43261 CurTim_hr_min: + 43262 000090E2 0000 dw 0 ;AN000;hours,minutes + 43263 CurTim_Sec_hn: + 43264 000090E4 0000 dw 0 ;AN000;seconds,hundredths + 43265 000090E6 01 db 1 ;AN000;first subst + 43266 000090E7 A5 db 0A5h ; Right_Align+TIME_HHMMSSHH_Cty + 43267 ;AC059;time + 43268 000090E8 0C db 12 ;AC059;maximum width + 43269 000090E9 0C db 12 ;AC059;minimum width + 43270 000090EA 20 db blank ; 20h ;AN000;pad character + 43271 + 43272 ; "Enter new time:" + 43273 NewTim_Ptr: + 43274 000090EB 0D04 dw 1037 ;AN000;message number + 43275 000090ED 00 db no_subst ; 0 ;AN000;number of subst + 43276 + 43277 ; ", Delete (Y/N)?",13,10 + 43278 Del_Y_N_Ptr: + 43279 000090EE 0E04 dw 1038 ;AN000;message number + 43280 000090F0 00 db no_subst ; 0 ;AN000;number of subst + 43281 + 43282 ; "All files in directory will be deleted!",13,10 + 43283 ; "Are you sure (Y/N)?",13,10 + 43284 SureMes_Ptr: + 43285 000090F1 0F04 dw 1039 ;AN000;message number + 43286 000090F3 00 db no_subst ; 0 ;AN000;number of subst + 43287 + 43288 ; "Microsoft DOS Version %1.%2",13,10 + 43289 VerMes_Ptr: + 43290 000090F4 1004 dw 1040 ;AN000;message number + 43291 + 43292 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 43293 %if 0 + 43294 db 2 ;AN000;number of subst + 43295 db parm_block_size ; 11 ;AN000;size of sublist + 43296 db 0 ;AN000;reserved + 43297 dw Major_Ver_Num ;AN000;offset of arg + 43298 dw 0 ;AN000;segment of arg + 43299 db 1 ;AN000;first subst + 43300 db 0A1h ; Right_Align+Unsgn_Bin_Word + 43301 ;AN000;binary to decimal + 43302 db 1 ;AN000;maximum width + 43303 db 1 ;AN000;minimum width + 43304 db blank ; 20h ;AN000;pad character + 43305 db parm_block_size ; 11 ;AN000;size of sublist + 43306 db 0 ;AN000;reserved + 43307 dw Minor_Ver_Num ;AN000;offset of arg + 43308 dw 0 ;AN000;segment of arg + 43309 db 2 ;AN000;second subst + 43310 db 0A1h ; Right_Align+Unsgn_Bin_Word + 43311 ;AN000;binary to decimal + 43312 db 2 ;AN000;maximum width + 43313 db 2 ;AN000;minimum width + 43314 db '0' ; 30h ;AN000;pad character + 43315 %else + 43316 000090F6 00 db 0 ; no_subst + 43317 %endif + 43318 + 43319 ; "Volume in drive %1 has no label",13,10 + 43320 VolMes_Ptr_2: + 43321 000090F7 1104 dw 1041 ;AN000;message number + 43322 000090F9 01 db 1 ;AN000;number of subst + 43323 000090FA 0B db parm_block_size ; 11 ;AN000;size of sublist + 43324 000090FB 00 db 0 ;AN000;reserved + 43325 000090FC [B39D] dw vol_drv ;AN000;offset of drive + 43326 000090FE 0000 dw 0 ;AN000;segment of arg + 43327 00009100 01 db 1 ;AN000;first subst + 43328 00009101 00 db 0 ; Char_field_Char ;AN000;character + 43329 00009102 80 db 128 ;AN000;maximum width + 43330 00009103 01 db 1 ;AN000;minimum width + 43331 00009104 20 db blank ; 20h ;AN000;pad character + 43332 + 43333 ; "Volume in drive %1 is %2",13,10 + 43334 VolMes_Ptr: + 43335 00009105 1204 dw 1042 ;AN000;message number + 43336 00009107 02 db 2 ;AN000;number of subst + 43337 00009108 0B db parm_block_size ; 11 ;AN000;size of sublist + 43338 00009109 00 db 0 ;AN000;reserved + 43339 0000910A [B39D] dw vol_drv ;AN000;offset of drive + 43340 0000910C 0000 dw 0 ;AN000;segment of arg + 43341 0000910E 01 db 1 ;AN000;first subst + 43342 0000910F 00 db 00000000b ;AN000;character + 43343 00009110 80 db 128 ;AN000;maximum width + 43344 00009111 01 db 1 ;AN000;minimum width + 43345 00009112 20 db blank ; 20h ;AN000;pad character + 43346 00009113 0B db parm_block_size ; 11 ;AN000;size of sublist + 43347 00009114 00 db 0 ;AN000;reserved + 43348 00009115 [6A9C] dw CHARBUF ;AN000;offset of string + 43349 00009117 0000 dw 0 ;AN000;segment of arg + 43350 00009119 02 db 2 ;AN000;second subst + 43351 0000911A 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43352 0000911B 80 db 128 ;AN000;maximum width + 43353 0000911C 01 db 1 ;AN000;minimum width + 43354 0000911D 20 db blank ; 20h ;AN000;pad character + 43355 + 43356 ; "Volume Serial Number is %1-%2",13,10 + 43357 VolSerMes_Ptr: + 43358 0000911E 1304 dw 1043 ;AN000;message number + 43359 00009120 02 db 2 ;AN000;number of subst + 43360 00009121 0B db parm_block_size ; 11 ;AN000;size of sublist + 43361 00009122 00 db 0 ;AN000;reserved + 43362 00009123 [1D9F] dw vol_serial+2 ;AN000;offset of serial + 43363 00009125 0000 dw 0 ;AN000;segment of arg + 43364 00009127 01 db 1 ;AN000;first subst + 43365 00009128 A3 db 0A3h ; Right_Align+Bin_Hex_Word + 43366 ;AN000;binary to hex + 43367 00009129 04 db 4 ;AN000;maximum width + 43368 0000912A 04 db 4 ;AN000;minimum width + 43369 0000912B 30 db '0' ; 30h ;AN000;pad character + 43370 0000912C 0B db parm_block_size ; 11 ;AN000;size of sublist + 43371 0000912D 00 db 0 ;AN000;reserved + 43372 0000912E [1B9F] dw vol_serial ;AN000;offset of serial + 43373 00009130 0000 dw 0 ;AN000;segment of arg + 43374 00009132 02 db 2 ;AN000;second subst + 43375 00009133 A3 db 0A3h ; Right_Align+Bin_Hex_Word + 43376 ;AN000;binary to hex + 43377 00009134 04 db 4 ;AN000;maximum width + 43378 00009135 04 db 4 ;AN000;minimum width + 43379 00009136 30 db '0' ; 30h ;AN000;pad character + 43380 + 43381 ; "Invalid directory",13,10 + 43382 badcd_ptr: + 43383 00009137 1404 dw 1044 ;AN000;message number + 43384 00009139 00 db no_subst ; 0 ;AN000;number of subst + 43385 + 43386 ; "Unable to create directory",13,10 + 43387 badmkd_ptr: + 43388 0000913A 1504 dw 1045 ;AN000;message number + 43389 0000913C 00 db no_subst ; 0 ;AN000;number of subst + 43390 + 43391 ; "Invalid path, not directory,",13,10 + 43392 ; "or directory not empty",13,10 + 43393 badrmd_ptr: + 43394 0000913D 1604 dw 1046 ;AN000;message number + 43395 0000913F 00 db no_subst ; 0 ;AN000;number of subst + 43396 + 43397 ; "Must specify ON or OFF",13,10 + 43398 bad_on_off_ptr: + 43399 00009140 1704 dw 1047 ;AN000;message number + 43400 00009142 00 db no_subst ; 0 ;AN000;number of subst + 43401 + 43402 ; "Directory of %1",13,10 + 43403 dirhead_ptr: + 43404 00009143 1804 dw 1048 ;AN000;message number + 43405 00009145 01 db 1 ;AN000;number of subst + 43406 00009146 0B db parm_block_size ; 11 ;AN000;size of sublist + 43407 00009147 00 db 0 ;AN000;reserved + 43408 00009148 [399D] dw BWDBUF ;AN000;offset of arg + 43409 0000914A 0000 dw 0 ;AN000;segment of arg + 43410 0000914C 01 db 1 ;AN000;first subst + 43411 0000914D 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43412 0000914E 80 db 128 ;AN000;maximum width + 43413 0000914F 00 db 0 ;AN000;minimum width + 43414 00009150 20 db blank ; 20h ;AN000;pad character + 43415 + 43416 ; "No Path",13,10 + 43417 NULLPATH_PTR: + 43418 00009151 1904 dw 1049 ;AN000;message number + 43419 00009153 00 db no_subst ; 0 ;AN000;number of subst + 43420 + 43421 ; "Invalid drive in search path",13,10 + 43422 BADPMES_PTR: + 43423 00009154 1A04 dw 1050 ;AN000;message number + 43424 00009156 00 db no_subst ; 0 ;AN000;number of subst + 43425 + 43426 ; "Invalid device",13,10 + 43427 BADDEV_PTR: + 43428 00009157 1B04 dw 1051 ;AN000;message number + 43429 00009159 00 db no_subst ; 0 ;AN000;number of subst + 43430 + 43431 ; "FOR cannot be nested",13,10 + 43432 FORNESTMES_PTR: + 43433 0000915A 1C04 dw 1052 ;AN000;message number + 43434 0000915C 00 db no_subst ; 0 ;AN000;number of subst + 43435 + 43436 ; "Intermediate file error during pipe",13,10 + 43437 PIPEEMES_PTR: + 43438 0000915D 1D04 dw 1053 ;AN000;message number + 43439 0000915F 00 db no_subst ; 0 ;AN000;number of subst + 43440 + 43441 ; "Cannot do binary reads from a device",13,10 + 43442 INBDEV_PTR: + 43443 00009160 1E04 dw 1054 ;AN000;message number + 43444 00009162 00 db no_subst ; 0 ;AN000;number of subst + 43445 + 43446 ; "BREAK is %1",13,10 + 43447 CtrlcMes_Ptr: + 43448 00009163 1F04 dw 1055 ;AN000;message number + 43449 00009165 01 db 1 ;AN000;number of subst + 43450 00009166 0B db parm_block_size ; 11 ;AN000;size of sublist + 43451 00009167 00 db 0 ;AN000;reserved + 43452 00009168 0000 dw 0 ;AN000;offset of on/off (new) + 43453 0000916A 0000 dw 0 ;AN000;segment of arg + 43454 0000916C 01 db 1 ;AN000;first subst + 43455 0000916D 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43456 0000916E 80 db 128 ;AN000;maximum width + 43457 0000916F 01 db 1 ;AN000;minimum width + 43458 00009170 20 db blank ; 20h ;AN000;pad character + 43459 + 43460 ; "VERIFY is %1",13,10 + 43461 VeriMes_Ptr: + 43462 00009171 2004 dw 1056 ;AN000;message number + 43463 00009173 01 db 1 ;AN000;number of subst + 43464 00009174 0B db parm_block_size ; 11 ;AN000;size of sublist + 43465 00009175 00 db 0 ;AN000;reserved + 43466 00009176 0000 dw 0 ;AN000;offset of on/off (new) + 43467 00009178 0000 dw 0 ;AN000;segment of arg + 43468 0000917A 01 db 1 ;AN000;first subst + 43469 0000917B 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43470 0000917C 80 db 128 ;AN000;maximum width + 43471 0000917D 01 db 1 ;AN000;minimum width + 43472 0000917E 20 db blank ; 20h ;AN000;pad character + 43473 + 43474 ; "ECHO is %1",13,10 + 43475 EchoMes_Ptr: + 43476 0000917F 2104 dw 1057 ;AN000;message number + 43477 00009181 01 db 1 ;AN000;number of subst + 43478 00009182 0B db parm_block_size ; 11 ;AN000;size of sublist + 43479 00009183 00 db 0 ;AN000;reserved + 43480 00009184 0000 dw 0 ;AN000;offset of on/off (new) + 43481 00009186 0000 dw 0 ;AN000;segment of arg + 43482 00009188 01 db 1 ;AN000;first subst + 43483 00009189 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43484 0000918A 80 db 128 ;AN000;maximum width + 43485 0000918B 01 db 1 ;AN000;minimum width + 43486 0000918C 20 db blank ; 20h ;AN000;pad character + 43487 + 43488 ; "off" + 43489 OFFMES_PTR: + 43490 0000918D 2304 dw 1059 ;AN000;message number + 43491 0000918F 00 db no_subst ;AN000;number of subst + 43492 ; "on" + 43493 ONMES_PTR: + 43494 00009190 2404 dw 1060 ;AN000;message number + 43495 00009192 00 db no_subst ; 0 ;AN000;number of subst + 43496 + 43497 ; "Error writing to device",13,10 + 43498 DEVWMES_PTR: + 43499 00009193 2504 dw 1061 ;AN000;message number + 43500 00009195 00 db no_subst ; 0 ;AN000;number of subst + 43501 + 43502 ; "Invalid path",13,10 + 43503 INVAL_PATH_PTR: + 43504 00009196 2604 dw 1062 ;AN000;message number + 43505 00009198 00 db no_subst ; 0 ;AN000;number of subst + 43506 + 43507 ; unformatted string output + 43508 arg_buf_ptr: + 43509 00009199 2704 dw 1063 ;AN000;message number + 43510 0000919B 01 db 1 ;AN000;number of subst + 43511 0000919C 0B db parm_block_size ; 11 ;AN000;size of sublist + 43512 0000919D 00 db 0 ;AN000;reserved + 43513 0000919E [96A3] dw Arg_Buf ;AN000;offset of arg + 43514 000091A0 0000 dw 0 ;AN000;segment of arg + 43515 000091A2 01 db 1 ;AN000;first subst + 43516 000091A3 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43517 000091A4 80 db 128 ;AN000;maximum width + 43518 000091A5 00 db 0 ;AN000;minimum width + 43519 000091A6 20 db blank ; 20h ;AN000;pad character + 43520 + 43521 ; file name output + 43522 file_name_ptr: + 43523 000091A7 2804 dw 1064 ;AN000;message number + 43524 000091A9 01 db 1 ;AN000;number of subst + 43525 000091AA 0B db parm_block_size ; 11 ;AN000;size of sublist + 43526 000091AB 00 db 0 ;AN000;reserved + 43527 000091AC [219E] dw SrcBuf ;AN000;offset of arg + 43528 000091AE 0000 dw 0 ;AN000;segment of arg + 43529 000091B0 01 db 1 ;AN000;first subst + 43530 000091B1 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43531 000091B2 80 db 128 ;AN000;maximum width + 43532 000091B3 00 db 0 ;AN000;minimum width + 43533 000091B4 20 db blank ; 20h ;AN000;pad character 43534 - 43535 ; file size output for dir - 43536 disp_file_size_ptr: - 43537 dw 1065 ;AN000;message number - 43538 db 1 ;AN000;number of subst - 43539 db parm_block_size ; 11 ;AN000;size of sublist - 43540 db 0 ;AN000;reserved - 43541 dw File_Size_Low ;AN000;offset of arg - 43542 dw 0 ;AN000;segment of arg - 43543 db 1 ;AN000;first subst - 43544 ; MSDOS 5.0 COMMAND.COM - 43545 ;db 0B1h ; Right_Align+Unsgn_Bin_DWord - 43546 ; 17/06/2023 - 43547 screen_f_1: - 43548 db 0F1h ; MSDOS 6.22 COMMAND.COM - 43549 ;AN000;long binary to decimal - 43550 ; MSDOS 5.0 COMMAND.COM - 43551 ;db 10 ;AN000;maximum width - 43552 ;db 10 ;AN000;minimum width - 43553 screen_f_2: - 43554 db 14 ; MSDOS 6.22 COMMAND.COM - 43555 db 14 - 43556 - 43557 db blank ; 20h ;AN000;pad character - 43558 %else - 43559 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 43560 ; PCDOS 7.1 COMMAND.COM - 43561 disp_file_size_ptr: - 43562 000091B5 2904 dw 1065 - 43563 000091B7 01 db 1 - 43564 000091B8 0B db 11 - 43565 000091B9 00 db 0 - 43566 000091BA [9C9D] dw File_Size_Low - 43567 000091BC 0000 dw 0 - 43568 000091BE 01 db 1 - 43569 000091BF F1 db 0F1h - 43570 000091C0 0C db 12 - 43571 000091C1 0C db 12 - 43572 000091C2 20 db 20h - 43573 disp_file_size_w_ptr: - 43574 000091C3 2904 dw 1065 - 43575 000091C5 01 db 1 - 43576 000091C6 0B db 11 - 43577 000091C7 00 db 0 - 43578 000091C8 [9C9D] dw File_Size_Low - 43579 000091CA 0000 dw 0 - 43580 000091CC 01 db 1 - 43581 000091CD F1 db 0F1h ; long binary to decimal - 43582 000091CE 0E db 14 - 43583 000091CF 0E db 14 - 43584 000091D0 20 db 20h - 43585 disp_file_size_n_ptr: - 43586 000091D1 2904 dw 1065 - 43587 000091D3 01 db 1 - 43588 000091D4 0B db 11 - 43589 000091D5 00 db 0 - 43590 000091D6 [9C9D] dw File_Size_Low - 43591 000091D8 0000 dw 0 - 43592 000091DA 01 db 1 - 43593 000091DB B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord - 43594 000091DC 0A db 10 - 43595 000091DD 0A db 10 - 43596 000091DE 20 db 20h - 43597 %endif - 43598 - 43599 ; unformatted string output - 43600 ; %s - 43601 string_buf_ptr: - 43602 000091DF 2A04 dw 1066 ;AN000;message number - 43603 000091E1 01 db 1 ;AN000;number of subst - 43604 000091E2 0B db parm_block_size ;AN000;size of sublist - 43605 000091E3 00 db 0 ;AN000;reserved - 43606 000091E4 [A09D] dw string_ptr_2 ;AN000;offset of arg - 43607 000091E6 0000 dw 0 ;AN000;segment of arg - 43608 000091E8 01 db 1 ;AN000;first subst - 43609 000091E9 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43610 000091EA 80 db 128 ;AN000;maximum width - 43611 000091EB 00 db 0 ;AN000;minimum width - 43612 000091EC 20 db blank ; 20h ;AN000;pad character - 43613 000091ED 00 db 0 ;AN000; - 43614 - 43615 ; tab character - 43616 tab_ptr: - 43617 000091EE 2B04 dw 1067 ;AN000;message number - 43618 000091F0 00 db no_subst ; 0 ;AN000;number of subst - 43619 - 43620 ; " " - 43621 dmes_ptr: - 43622 000091F1 2C04 dw 1068 ;AN000;message number - 43623 000091F3 00 db no_subst ; 0 ;AN000;number of subst - 43624 - 43625 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 43626 space_4_ptr : - 43627 000091F4 5104 dw 1105 - 43628 000091F6 00 db no_subst ; 0 - 43629 - 43630 ; destructive back space - 43631 dback_ptr: - 43632 000091F7 2D04 dw 1069 ;AN000;message number - 43633 000091F9 00 db no_subst ; 0 ;AN000;number of subst - 43634 - 43635 ; carriage return / line feed - 43636 acrlf_ptr: - 43637 000091FA 2E04 dw 1070 ;AN000;message number - 43638 000091FC 00 db no_subst ; 0 ;AN000;number of subst - 43639 - 43640 ; "mm-dd-yy" - 43641 usadat_ptr: - 43642 000091FD 3004 dw 1072 ;AN000;message number - 43643 000091FF 00 db no_subst ; 0 ;AN000;number of subst - 43644 - 43645 ; "dd-mm-yy" - 43646 eurdat_ptr: - 43647 00009200 3104 dw 1073 ;AN000;message number - 43648 00009202 00 db no_subst ; 0 ;AN000;number of subst - 43649 - 43650 ; "yy-mm-dd" - 43651 japdat_ptr: - 43652 00009203 3204 dw 1074 ;AN000;message number - 43653 00009205 00 db no_subst ; 0 ;AN000;number of subst - 43654 - 43655 ; date string for prompt - 43656 promptdat_ptr: - 43657 00009206 3304 dw 1075 ;AN000;message number - 43658 00009208 02 db 2 ;AN000;number of subst - 43659 00009209 0B db parm_block_size ; 11 ;AN000;size of sublist - 43660 0000920A 00 db 0 ;AN000;reserved - 43661 0000920B [96A3] dw Arg_Buf ;AN000;offset of arg - 43662 0000920D 0000 dw 0 ;AN000;segment of arg - 43663 0000920F 01 db 1 ;AN000;first subst - 43664 00009210 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43665 00009211 03 db 3 ;AN000;maximum width - 43666 00009212 03 db 3 ;AN000;minimum width - 43667 00009213 20 db blank ; 20h ;AN000;pad character - 43668 00009214 0B db parm_block_size ; 11 ;AN000;size of sublist - 43669 00009215 00 db 0 ;AN000;reserved - 43670 promptDat_yr: - 43671 00009216 0000 dw 0 ;AN000;year - 43672 promptDat_moday: - 43673 00009218 0000 dw 0 ;AN000;month,day - 43674 0000921A 02 db 2 ;AN000;second subst - 43675 0000921B 34 db 34h ; DATE_MDY_4 ;AN000;date - 43676 0000921C 0A db 10 ;AN000;maximum width - 43677 0000921D 08 db 8 ;AN000;minimum width - 43678 0000921E 20 db blank ; 20h ;AN000;pad character - 43679 - 43680 ; Time for prompt - 43681 promtim_ptr: - 43682 0000921F 3404 dw 1076 ;AN000;message number - 43683 00009221 01 db 1 ;AN000;number of subst - 43684 00009222 0B db parm_block_size ; 11 ;AN000;size of sublist - 43685 00009223 00 db 0 ;AN000;reserved - 43686 PromTim_hr_min: - 43687 00009224 0000 dw 0 ;AN000;hours,minutes - 43688 PromTim_Sec_hn: - 43689 00009226 0000 dw 0 ;AN000;seconds,hundredths - 43690 00009228 01 db 1 ;AN000;first subst - 43691 00009229 A6 db 0A6h ; Right_Align+TIME_HHMMSSHH_24 - 43692 ;AC013;time - 43693 0000922A 0B db 11 ;AN000;maximum width - 43694 0000922B 0B db 11 ;AC013;minimum width - 43695 0000922C 20 db blank ; 20h ;AN000;pad character - 43696 - 43697 ; Date and time for DIR - 43698 dirdattim_ptr: - 43699 0000922D 3504 dw 1077 ;AN000;message number - 43700 0000922F 02 db 2 ;AN000;number of subst - 43701 00009230 0B db parm_block_size ; 11 ;AN000;size of sublist - 43702 00009231 00 db 0 ;AN000;reserved - 43703 DirDat_Yr: - 43704 00009232 0000 dw 0 ;AN000;year - 43705 DirDat_Mo_Day: - 43706 00009234 0000 dw 0 ;AN000;month,day - 43707 00009236 01 db 1 ;AN000;first subst - 43708 DirDat_form: ; 03/08/2024 - PCDOS 7.1 - 43709 00009237 A4 db 0A4h ; Right_Align+DATE_MDY_2 - 43710 ;AN000;date - 43711 DirDat_width: ; 03/08/2024 - PCDOS 7.1 - 43712 00009238 0A db 10 ;AN000;maximum width - 43713 00009239 08 db 8 ;AN000;minimum width - 43714 0000923A 20 db blank ; 20h ;AN000;pad character - 43715 0000923B 0B db parm_block_size ; 11 ;AN000;size of sublist - 43716 0000923C 00 db 0 ;AN000;reserved - 43717 DirTim_Hr_Min: - 43718 0000923D 0000 dw 0 ;AN000;hours,minutes - 43719 DirTim_Sec_hn: - 43720 0000923F 0000 dw 0 ;AN000;seconds,hundredths - 43721 00009241 02 db 2 ;AN000;second subst - 43722 00009242 85 db 85h ; Right_align+TIME_HHMM_Cty - 43723 ;AN000;time - 43724 00009243 06 db 6 ;AN000;maximum width - 43725 00009244 06 db 6 ;AN000;minimum width - 43726 00009245 20 db blank ; 20h ;AN000;pad character - 43727 - 43728 ; "Directory already exists" - 43729 MD_EXISTS_PTR: - 43730 00009246 3604 dw 1078 ;AN000;message number - 43731 00009248 00 db no_subst ;AN000;number of subst - 43732 - 43733 ; "%1 bytes",13,10 - 43734 - 43735 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 43736 %if 0 - 43737 bytes_ptr: - 43738 dw 1079 ; message number - 43739 db 1 ; number of subst - 43740 db parm_block_size ; 11 ; size of sublist - 43741 db 0 ; reserved - 43742 dw FileSiz ; offset of arg - 43743 dw 0 ; segment of arg - 43744 db 1 ; first subst - 43745 ; MSDOS 5.0 COMMAND.COM - 43746 ;db 0B1h ; Right_Align+Unsgn_Bin_DWord - 43747 ; 17/06/2023 - 43748 screen_f_4: - 43749 db 0F1h ; MSDOS 6.22 COMMAND.COM - 43750 ; long binary to decimal - 43751 ; MSDOS 5.0 COMMAND.COM - 43752 ;db 10 ; maximum width - 43753 ;db 10 ; minimum width - 43754 screen_f_5: - 43755 db 14 ; MSDOS 6.22 COMMAND.COM - 43756 db 14 - 43757 db blank ; 20h ; pad character - 43758 %else - 43759 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 43760 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9718h - 43761 bytes_ptr: - 43762 00009249 3704 dw 1079 - 43763 0000924B 01 db 1 - 43764 0000924C 0B db 11 - 43765 0000924D 00 db 0 - 43766 0000924E [229C] dw FileSiz - 43767 00009250 0000 dw 0 - 43768 00009252 01 db 1 - 43769 00009253 F1 db 0F1h - 43770 00009254 0C db 12 - 43771 00009255 0C db 12 - 43772 00009256 20 db 20h - 43773 bytes_w_tr: - 43774 00009257 3704 dw 1079 - 43775 00009259 01 db 1 - 43776 0000925A 0B db 11 - 43777 0000925B 00 db 0 - 43778 0000925C [229C] dw FileSiz - 43779 0000925E 0000 dw 0 - 43780 00009260 01 db 1 - 43781 00009261 F1 db 0F1h - 43782 00009262 0E db 14 - 43783 00009263 0E db 14 - 43784 00009264 20 db 20h - 43785 bytes_n_ptr: - 43786 00009265 3704 dw 1079 - 43787 00009267 01 db 1 - 43788 00009268 0B db 11 - 43789 00009269 00 db 0 - 43790 0000926A B1 db 0B1h - 43791 0000926B A0 db 160 - 43792 0000926C 00 db 0 - 43793 0000926D 00 db 0 - 43794 0000926E 01 db 1 - 43795 0000926F B1 db 0B1h - 43796 00009270 0A db 10 - 43797 00009271 0A db 10 - 43798 00009272 20 db 20h - 43799 kbytes_ptr: - 43800 00009273 5304 dw 1107 - 43801 00009275 01 db 1 - 43802 00009276 0B db 11 - 43803 00009277 00 db 0 - 43804 00009278 B1 db 0B1h - 43805 00009279 A0 db 160 - 43806 0000927A 00 db 0 - 43807 0000927B 00 db 0 - 43808 0000927C 01 db 1 - 43809 0000927D F1 db 0F1h - 43810 0000927E 0E db 14 - 43811 0000927F 0E db 14 - 43812 00009280 20 db 20h - 43813 kybytes_n_ptr: - 43814 00009281 5304 dw 1107 - 43815 00009283 01 db 1 - 43816 00009284 0B db 11 - 43817 00009285 00 db 0 - 43818 00009286 [229C] dw FileSiz - 43819 00009288 0000 dw 0 - 43820 0000928A 01 db 1 - 43821 0000928B B1 db 0B1h - 43822 0000928C 0A db 10 - 43823 0000928D 0A db 10 - 43824 0000928E 20 db 20h - 43825 %endif - 43826 - 43827 ; "Total:",13,10 - 43828 total_ptr: - 43829 0000928F 3804 dw 1080 ; message number - 43830 00009291 00 db no_subst ; 0 ; number of subst - 43831 - 43832 ; "Error parsing environment variable:",13,10 - 43833 errparsenv_ptr: - 43834 00009292 3904 dw 1081 ; message number - 43835 00009294 00 db no_subst ; 0 ; number of subst - 43836 - 43837 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 43838 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:996Ah) - 43839 cox_Y_quest_ptr: - 43840 00009295 3A04 dw 1082 - 43841 00009297 00 db no_subst ; 0 - 43842 cox_Y_answ_ptr: - 43843 00009298 3B04 dw 1083 - 43844 0000929A 00 db no_subst ; 0 - 43845 - 43846 ; "(continuing %1)",13,10 - 43847 dircont_ptr: - 43848 0000929B 3C04 dw 1084 ;AN000;message number - 43849 0000929D 01 db 1 ;AN000;number of subst - 43850 0000929E 0B db parm_block_size ; 11 ;AN000;size of sublist - 43851 0000929F 00 db 0 ;AN000;reserved - 43852 000092A0 [399D] dw BWDBUF ;AN000;offset of arg - 43853 000092A2 0000 dw 0 ;AN000;segment of arg - 43854 000092A4 01 db 1 ;AN000;first subst - 43855 000092A5 10 db 10h ; Char_field_ASCIIZ ;AN000;character string - 43856 000092A6 80 db 128 ;AN000;maximum width - 43857 000092A7 00 db 0 ;AN000;minimum width - 43858 000092A8 20 db blank ; 20h ;AN000;pad character - 43859 - 43860 ; "Revision %1",CR,LF - 43861 dosrev_ptr: - 43862 000092A9 4204 dw 1090 - 43863 000092AB 01 db 1 ; one substitution - 43864 000092AC 0B db parm_block_size ; 11 - 43865 000092AD 00 db 0 - 43866 000092AE [B19D] dw One_Char_Val ; ptr to char - 43867 000092B0 0000 dw 0 ; segment addr? - 43868 000092B2 01 db 1 ; 1st substitution - 43869 000092B3 00 db 0 ; CHAR_FIELD_CHAR ; character - 43870 000092B4 01 db 1 ; max width - 43871 000092B5 01 db 1 ; min width - 43872 000092B6 20 db blank ; 20h ; pad char - 43873 - 43874 ; "DOS is in ROM" - 43875 DosRom_Ptr: - 43876 000092B7 4304 dw 1091 - 43877 000092B9 00 db no_subst ; 0 - 43878 - 43879 ; "DOS is in HMA" - 43880 DosHma_Ptr: - 43881 000092BA 4404 dw 1092 - 43882 000092BC 00 db no_subst ; 0 - 43883 - 43884 ; "DOS is in low memory" - 43885 DosLow_Ptr: - 43886 000092BD 4504 dw 1093 - 43887 000092BF 00 db no_subst ; 0 - 43888 - 43889 ; "Cannot Loadhigh batch file" ;M016 - 43890 NoExecBat_Ptr: - 43891 000092C0 4604 dw 1094 ; M016 - 43892 000092C2 00 db no_subst ; 0 ; M016 - 43893 - 43894 ; "LoadHigh: Invalid filename" ; M016 - 43895 LhInvFil_Ptr: - 43896 000092C3 4704 dw 1095 ; M016 - 43897 000092C5 00 db no_subst ; 0 ; M016 - 43898 - 43899 ; "Could not open specified country information file" ; M045 - 43900 NoCntry_Ptr: - 43901 000092C6 4804 dw 1096 ; M045 - 43902 000092C8 00 db no_subst ; 0 ; M045 - 43903 - 43904 ; 15/04/2023 - 43905 ; MSDOS 6.0 COMMAND.COM only ! - 43906 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 43907 ;%if 0 - 43908 - 43909 ;* The next four errors emulate those reported by the normal parse - 43910 ; mechanism, with a little more accurate wording; that parser has been - 43911 ; replaced with a custom routine (ParseVar) for LoadHigh and DeviceHigh. - 43912 ; These errors aren't normally generated by LoadHigh except by the normal - 43913 ; parser, so they've been added here. - 43914 - 43915 ; "LoadHigh: Invalid argument" - 43916 LhInvArg_Ptr: - 43917 000092C9 4904 dw 1097 - 43918 000092CB 00 db no_subst ; 0 - 43919 - 43920 ; "Required parameter missing" - 43921 ReqParmMiss: - 43922 000092CC 4A04 dw 1098 - 43923 000092CE 00 db no_subst ; 0 - 43924 - 43925 ; "Unrecognized switch" - 43926 LhInvSwt_Ptr: - 43927 000092CF 4B04 dw 1099 - 43928 000092D1 00 db no_subst ; 0 - 43929 - 43930 ; "A bad UMB number has been specified" - 43931 LhBadUMB_Ptr: - 43932 000092D2 4C04 dw 1100 - 43933 000092D4 00 db no_subst ; 0 - 43934 ;%endif - 43935 - 43936 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 43937 %if 0 - 43938 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 43939 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:99AAh - 43940 - 43941 DirCompRatio_Ptr: - 43942 dw 1101 ;message number - 43943 db 2 ;number of subst - 43944 db parm_block_size ; 11 ;size of sublist - 43945 db 0 ;reserved - 43946 dw Dir_CRatio_1 ;offset of arg - 43947 dw 0 ;segment of arg - 43948 db 1 ;first subst - 43949 db 91h ;format - 43950 db 2 ;maximum width - 43951 db 2 ;minimum width - 43952 db blank ; 20h ;pad character - 43953 db parm_block_size ; 11 ;size of sublist - 43954 db 0 ; reserved - 43955 dw Dir_CRatio_2 ;offset of arg - 43956 dw 0 ;segment of arg - 43957 db 2 ;second subst - 43958 db 11h ;format - 43959 db 1 ;maximum width - 43960 db 1 ;minimum width - 43961 db blank ; 20h ;pad character - 43962 - 43963 AveCompRatio_Ptr: - 43964 dw 1102 ;message number - 43965 db 2 ;number of subst - 43966 db parm_block_size ; 11 ;size of sublist - 43967 db 0 ;reserved - 43968 dw Dir_CRatio_1 ;offset of arg - 43969 dw 0 ;segment of arg - 43970 db 1 ;first subst - 43971 db 91h ;format - 43972 db 2 ;maximum width - 43973 db 2 ;minimum width - 43974 db blank ; 20h ;pad character - 43975 db parm_block_size ; 11 ;size of sublist - 43976 db 0 ; reserved - 43977 dw Dir_CRatio_2 ;offset of arg - 43978 dw 0 ;segment of arg - 43979 db 2 ;second subst - 43980 db 11h ;format - 43981 db 1 ;maximum width - 43982 db 1 ;minimum width - 43983 db blank ; 20h ;pad character - 43984 %else - 43985 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 43986 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:97A4h - 43987 kbytesf_ptr: - 43988 000092D5 5204 dw 1106 - 43989 000092D7 01 db 1 - 43990 000092D8 0B db 11 - 43991 000092D9 00 db 0 - 43992 000092DA [A99D] dw Bytes_Free - 43993 000092DC 0000 dw 0 - 43994 000092DE 01 db 1 - 43995 000092DF F1 db 0F1h ; long binary to decimal - 43996 000092E0 1E db 30 - 43997 000092E1 1E db 30 - 43998 000092E2 20 db 20h - 43999 kbytesf_n_ptr: - 44000 000092E3 5204 dw 1106 - 44001 000092E5 01 db 1 - 44002 000092E6 0B db 11 - 44003 000092E7 00 db 0 - 44004 000092E8 [A99D] dw Bytes_Free - 44005 000092EA 0000 dw 0 - 44006 000092EC 01 db 1 - 44007 000092ED B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord - 44008 000092EE 1C db 28 - 44009 000092EF 1C db 28 - 44010 000092F0 20 db 20h - 44011 %endif - 44012 - 44013 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 44014 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8483h + 43535 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 43536 %if 0 + 43537 + 43538 ; file size output for dir + 43539 disp_file_size_ptr: + 43540 dw 1065 ;AN000;message number + 43541 db 1 ;AN000;number of subst + 43542 db parm_block_size ; 11 ;AN000;size of sublist + 43543 db 0 ;AN000;reserved + 43544 dw File_Size_Low ;AN000;offset of arg + 43545 dw 0 ;AN000;segment of arg + 43546 db 1 ;AN000;first subst + 43547 ; MSDOS 5.0 COMMAND.COM + 43548 ;db 0B1h ; Right_Align+Unsgn_Bin_DWord + 43549 ; 17/06/2023 + 43550 screen_f_1: + 43551 db 0F1h ; MSDOS 6.22 COMMAND.COM + 43552 ;AN000;long binary to decimal + 43553 ; MSDOS 5.0 COMMAND.COM + 43554 ;db 10 ;AN000;maximum width + 43555 ;db 10 ;AN000;minimum width + 43556 screen_f_2: + 43557 db 14 ; MSDOS 6.22 COMMAND.COM + 43558 db 14 + 43559 + 43560 db blank ; 20h ;AN000;pad character + 43561 %else + 43562 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 43563 ; PCDOS 7.1 COMMAND.COM + 43564 disp_file_size_ptr: + 43565 000091B5 2904 dw 1065 + 43566 000091B7 01 db 1 + 43567 000091B8 0B db 11 + 43568 000091B9 00 db 0 + 43569 000091BA [9C9D] dw File_Size_Low + 43570 000091BC 0000 dw 0 + 43571 000091BE 01 db 1 + 43572 000091BF F1 db 0F1h + 43573 000091C0 0C db 12 + 43574 000091C1 0C db 12 + 43575 000091C2 20 db 20h + 43576 disp_file_size_w_ptr: + 43577 000091C3 2904 dw 1065 + 43578 000091C5 01 db 1 + 43579 000091C6 0B db 11 + 43580 000091C7 00 db 0 + 43581 000091C8 [9C9D] dw File_Size_Low + 43582 000091CA 0000 dw 0 + 43583 000091CC 01 db 1 + 43584 000091CD F1 db 0F1h ; long binary to decimal + 43585 000091CE 0E db 14 + 43586 000091CF 0E db 14 + 43587 000091D0 20 db 20h + 43588 disp_file_size_n_ptr: + 43589 000091D1 2904 dw 1065 + 43590 000091D3 01 db 1 + 43591 000091D4 0B db 11 + 43592 000091D5 00 db 0 + 43593 000091D6 [9C9D] dw File_Size_Low + 43594 000091D8 0000 dw 0 + 43595 000091DA 01 db 1 + 43596 000091DB B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord + 43597 000091DC 0A db 10 + 43598 000091DD 0A db 10 + 43599 000091DE 20 db 20h + 43600 %endif + 43601 + 43602 ; unformatted string output + 43603 ; %s + 43604 string_buf_ptr: + 43605 000091DF 2A04 dw 1066 ;AN000;message number + 43606 000091E1 01 db 1 ;AN000;number of subst + 43607 000091E2 0B db parm_block_size ;AN000;size of sublist + 43608 000091E3 00 db 0 ;AN000;reserved + 43609 000091E4 [A09D] dw string_ptr_2 ;AN000;offset of arg + 43610 000091E6 0000 dw 0 ;AN000;segment of arg + 43611 000091E8 01 db 1 ;AN000;first subst + 43612 000091E9 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43613 000091EA 80 db 128 ;AN000;maximum width + 43614 000091EB 00 db 0 ;AN000;minimum width + 43615 000091EC 20 db blank ; 20h ;AN000;pad character + 43616 000091ED 00 db 0 ;AN000; + 43617 + 43618 ; tab character + 43619 tab_ptr: + 43620 000091EE 2B04 dw 1067 ;AN000;message number + 43621 000091F0 00 db no_subst ; 0 ;AN000;number of subst + 43622 + 43623 ; " " + 43624 dmes_ptr: + 43625 000091F1 2C04 dw 1068 ;AN000;message number + 43626 000091F3 00 db no_subst ; 0 ;AN000;number of subst + 43627 + 43628 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 43629 space_4_ptr : + 43630 000091F4 5104 dw 1105 + 43631 000091F6 00 db no_subst ; 0 + 43632 + 43633 ; destructive back space + 43634 dback_ptr: + 43635 000091F7 2D04 dw 1069 ;AN000;message number + 43636 000091F9 00 db no_subst ; 0 ;AN000;number of subst + 43637 + 43638 ; carriage return / line feed + 43639 acrlf_ptr: + 43640 000091FA 2E04 dw 1070 ;AN000;message number + 43641 000091FC 00 db no_subst ; 0 ;AN000;number of subst + 43642 + 43643 ; "mm-dd-yy" + 43644 usadat_ptr: + 43645 000091FD 3004 dw 1072 ;AN000;message number + 43646 000091FF 00 db no_subst ; 0 ;AN000;number of subst + 43647 + 43648 ; "dd-mm-yy" + 43649 eurdat_ptr: + 43650 00009200 3104 dw 1073 ;AN000;message number + 43651 00009202 00 db no_subst ; 0 ;AN000;number of subst + 43652 + 43653 ; "yy-mm-dd" + 43654 japdat_ptr: + 43655 00009203 3204 dw 1074 ;AN000;message number + 43656 00009205 00 db no_subst ; 0 ;AN000;number of subst + 43657 + 43658 ; date string for prompt + 43659 promptdat_ptr: + 43660 00009206 3304 dw 1075 ;AN000;message number + 43661 00009208 02 db 2 ;AN000;number of subst + 43662 00009209 0B db parm_block_size ; 11 ;AN000;size of sublist + 43663 0000920A 00 db 0 ;AN000;reserved + 43664 0000920B [96A3] dw Arg_Buf ;AN000;offset of arg + 43665 0000920D 0000 dw 0 ;AN000;segment of arg + 43666 0000920F 01 db 1 ;AN000;first subst + 43667 00009210 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43668 00009211 03 db 3 ;AN000;maximum width + 43669 00009212 03 db 3 ;AN000;minimum width + 43670 00009213 20 db blank ; 20h ;AN000;pad character + 43671 00009214 0B db parm_block_size ; 11 ;AN000;size of sublist + 43672 00009215 00 db 0 ;AN000;reserved + 43673 promptDat_yr: + 43674 00009216 0000 dw 0 ;AN000;year + 43675 promptDat_moday: + 43676 00009218 0000 dw 0 ;AN000;month,day + 43677 0000921A 02 db 2 ;AN000;second subst + 43678 0000921B 34 db 34h ; DATE_MDY_4 ;AN000;date + 43679 0000921C 0A db 10 ;AN000;maximum width + 43680 0000921D 08 db 8 ;AN000;minimum width + 43681 0000921E 20 db blank ; 20h ;AN000;pad character + 43682 + 43683 ; Time for prompt + 43684 promtim_ptr: + 43685 0000921F 3404 dw 1076 ;AN000;message number + 43686 00009221 01 db 1 ;AN000;number of subst + 43687 00009222 0B db parm_block_size ; 11 ;AN000;size of sublist + 43688 00009223 00 db 0 ;AN000;reserved + 43689 PromTim_hr_min: + 43690 00009224 0000 dw 0 ;AN000;hours,minutes + 43691 PromTim_Sec_hn: + 43692 00009226 0000 dw 0 ;AN000;seconds,hundredths + 43693 00009228 01 db 1 ;AN000;first subst + 43694 00009229 A6 db 0A6h ; Right_Align+TIME_HHMMSSHH_24 + 43695 ;AC013;time + 43696 0000922A 0B db 11 ;AN000;maximum width + 43697 0000922B 0B db 11 ;AC013;minimum width + 43698 0000922C 20 db blank ; 20h ;AN000;pad character + 43699 + 43700 ; Date and time for DIR + 43701 dirdattim_ptr: + 43702 0000922D 3504 dw 1077 ;AN000;message number + 43703 0000922F 02 db 2 ;AN000;number of subst + 43704 00009230 0B db parm_block_size ; 11 ;AN000;size of sublist + 43705 00009231 00 db 0 ;AN000;reserved + 43706 DirDat_Yr: + 43707 00009232 0000 dw 0 ;AN000;year + 43708 DirDat_Mo_Day: + 43709 00009234 0000 dw 0 ;AN000;month,day + 43710 00009236 01 db 1 ;AN000;first subst + 43711 DirDat_form: ; 03/08/2024 - PCDOS 7.1 + 43712 00009237 A4 db 0A4h ; Right_Align+DATE_MDY_2 + 43713 ;AN000;date + 43714 DirDat_width: ; 03/08/2024 - PCDOS 7.1 + 43715 00009238 0A db 10 ;AN000;maximum width + 43716 00009239 08 db 8 ;AN000;minimum width + 43717 0000923A 20 db blank ; 20h ;AN000;pad character + 43718 0000923B 0B db parm_block_size ; 11 ;AN000;size of sublist + 43719 0000923C 00 db 0 ;AN000;reserved + 43720 DirTim_Hr_Min: + 43721 0000923D 0000 dw 0 ;AN000;hours,minutes + 43722 DirTim_Sec_hn: + 43723 0000923F 0000 dw 0 ;AN000;seconds,hundredths + 43724 00009241 02 db 2 ;AN000;second subst + 43725 00009242 85 db 85h ; Right_align+TIME_HHMM_Cty + 43726 ;AN000;time + 43727 00009243 06 db 6 ;AN000;maximum width + 43728 00009244 06 db 6 ;AN000;minimum width + 43729 00009245 20 db blank ; 20h ;AN000;pad character + 43730 + 43731 ; "Directory already exists" + 43732 MD_EXISTS_PTR: + 43733 00009246 3604 dw 1078 ;AN000;message number + 43734 00009248 00 db no_subst ;AN000;number of subst + 43735 + 43736 ; "%1 bytes",13,10 + 43737 + 43738 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 43739 %if 0 + 43740 bytes_ptr: + 43741 dw 1079 ; message number + 43742 db 1 ; number of subst + 43743 db parm_block_size ; 11 ; size of sublist + 43744 db 0 ; reserved + 43745 dw FileSiz ; offset of arg + 43746 dw 0 ; segment of arg + 43747 db 1 ; first subst + 43748 ; MSDOS 5.0 COMMAND.COM + 43749 ;db 0B1h ; Right_Align+Unsgn_Bin_DWord + 43750 ; 17/06/2023 + 43751 screen_f_4: + 43752 db 0F1h ; MSDOS 6.22 COMMAND.COM + 43753 ; long binary to decimal + 43754 ; MSDOS 5.0 COMMAND.COM + 43755 ;db 10 ; maximum width + 43756 ;db 10 ; minimum width + 43757 screen_f_5: + 43758 db 14 ; MSDOS 6.22 COMMAND.COM + 43759 db 14 + 43760 db blank ; 20h ; pad character + 43761 %else + 43762 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 43763 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9718h + 43764 bytes_ptr: + 43765 00009249 3704 dw 1079 + 43766 0000924B 01 db 1 + 43767 0000924C 0B db 11 + 43768 0000924D 00 db 0 + 43769 0000924E [229C] dw FileSiz + 43770 00009250 0000 dw 0 + 43771 00009252 01 db 1 + 43772 00009253 F1 db 0F1h + 43773 00009254 0C db 12 + 43774 00009255 0C db 12 + 43775 00009256 20 db 20h + 43776 bytes_w_tr: + 43777 00009257 3704 dw 1079 + 43778 00009259 01 db 1 + 43779 0000925A 0B db 11 + 43780 0000925B 00 db 0 + 43781 0000925C [229C] dw FileSiz + 43782 0000925E 0000 dw 0 + 43783 00009260 01 db 1 + 43784 00009261 F1 db 0F1h + 43785 00009262 0E db 14 + 43786 00009263 0E db 14 + 43787 00009264 20 db 20h + 43788 bytes_n_ptr: + 43789 00009265 3704 dw 1079 + 43790 00009267 01 db 1 + 43791 00009268 0B db 11 + 43792 00009269 00 db 0 + 43793 0000926A B1 db 0B1h + 43794 0000926B A0 db 160 + 43795 0000926C 00 db 0 + 43796 0000926D 00 db 0 + 43797 0000926E 01 db 1 + 43798 0000926F B1 db 0B1h + 43799 00009270 0A db 10 + 43800 00009271 0A db 10 + 43801 00009272 20 db 20h + 43802 kbytes_ptr: + 43803 00009273 5304 dw 1107 + 43804 00009275 01 db 1 + 43805 00009276 0B db 11 + 43806 00009277 00 db 0 + 43807 00009278 B1 db 0B1h + 43808 00009279 A0 db 160 + 43809 0000927A 00 db 0 + 43810 0000927B 00 db 0 + 43811 0000927C 01 db 1 + 43812 0000927D F1 db 0F1h + 43813 0000927E 0E db 14 + 43814 0000927F 0E db 14 + 43815 00009280 20 db 20h + 43816 kybytes_n_ptr: + 43817 00009281 5304 dw 1107 + 43818 00009283 01 db 1 + 43819 00009284 0B db 11 + 43820 00009285 00 db 0 + 43821 00009286 [229C] dw FileSiz + 43822 00009288 0000 dw 0 + 43823 0000928A 01 db 1 + 43824 0000928B B1 db 0B1h + 43825 0000928C 0A db 10 + 43826 0000928D 0A db 10 + 43827 0000928E 20 db 20h + 43828 %endif + 43829 + 43830 ; "Total:",13,10 + 43831 total_ptr: + 43832 0000928F 3804 dw 1080 ; message number + 43833 00009291 00 db no_subst ; 0 ; number of subst + 43834 + 43835 ; "Error parsing environment variable:",13,10 + 43836 errparsenv_ptr: + 43837 00009292 3904 dw 1081 ; message number + 43838 00009294 00 db no_subst ; 0 ; number of subst + 43839 + 43840 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 43841 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:996Ah) + 43842 cox_Y_quest_ptr: + 43843 00009295 3A04 dw 1082 + 43844 00009297 00 db no_subst ; 0 + 43845 cox_Y_answ_ptr: + 43846 00009298 3B04 dw 1083 + 43847 0000929A 00 db no_subst ; 0 + 43848 + 43849 ; "(continuing %1)",13,10 + 43850 dircont_ptr: + 43851 0000929B 3C04 dw 1084 ;AN000;message number + 43852 0000929D 01 db 1 ;AN000;number of subst + 43853 0000929E 0B db parm_block_size ; 11 ;AN000;size of sublist + 43854 0000929F 00 db 0 ;AN000;reserved + 43855 000092A0 [399D] dw BWDBUF ;AN000;offset of arg + 43856 000092A2 0000 dw 0 ;AN000;segment of arg + 43857 000092A4 01 db 1 ;AN000;first subst + 43858 000092A5 10 db 10h ; Char_field_ASCIIZ ;AN000;character string + 43859 000092A6 80 db 128 ;AN000;maximum width + 43860 000092A7 00 db 0 ;AN000;minimum width + 43861 000092A8 20 db blank ; 20h ;AN000;pad character + 43862 + 43863 ; "Revision %1",CR,LF + 43864 dosrev_ptr: + 43865 000092A9 4204 dw 1090 + 43866 000092AB 01 db 1 ; one substitution + 43867 000092AC 0B db parm_block_size ; 11 + 43868 000092AD 00 db 0 + 43869 000092AE [B19D] dw One_Char_Val ; ptr to char + 43870 000092B0 0000 dw 0 ; segment addr? + 43871 000092B2 01 db 1 ; 1st substitution + 43872 000092B3 00 db 0 ; CHAR_FIELD_CHAR ; character + 43873 000092B4 01 db 1 ; max width + 43874 000092B5 01 db 1 ; min width + 43875 000092B6 20 db blank ; 20h ; pad char + 43876 + 43877 ; "DOS is in ROM" + 43878 DosRom_Ptr: + 43879 000092B7 4304 dw 1091 + 43880 000092B9 00 db no_subst ; 0 + 43881 + 43882 ; "DOS is in HMA" + 43883 DosHma_Ptr: + 43884 000092BA 4404 dw 1092 + 43885 000092BC 00 db no_subst ; 0 + 43886 + 43887 ; "DOS is in low memory" + 43888 DosLow_Ptr: + 43889 000092BD 4504 dw 1093 + 43890 000092BF 00 db no_subst ; 0 + 43891 + 43892 ; "Cannot Loadhigh batch file" ;M016 + 43893 NoExecBat_Ptr: + 43894 000092C0 4604 dw 1094 ; M016 + 43895 000092C2 00 db no_subst ; 0 ; M016 + 43896 + 43897 ; "LoadHigh: Invalid filename" ; M016 + 43898 LhInvFil_Ptr: + 43899 000092C3 4704 dw 1095 ; M016 + 43900 000092C5 00 db no_subst ; 0 ; M016 + 43901 + 43902 ; "Could not open specified country information file" ; M045 + 43903 NoCntry_Ptr: + 43904 000092C6 4804 dw 1096 ; M045 + 43905 000092C8 00 db no_subst ; 0 ; M045 + 43906 + 43907 ; 15/04/2023 + 43908 ; MSDOS 6.0 COMMAND.COM only ! + 43909 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 43910 ;%if 0 + 43911 + 43912 ;* The next four errors emulate those reported by the normal parse + 43913 ; mechanism, with a little more accurate wording; that parser has been + 43914 ; replaced with a custom routine (ParseVar) for LoadHigh and DeviceHigh. + 43915 ; These errors aren't normally generated by LoadHigh except by the normal + 43916 ; parser, so they've been added here. + 43917 + 43918 ; "LoadHigh: Invalid argument" + 43919 LhInvArg_Ptr: + 43920 000092C9 4904 dw 1097 + 43921 000092CB 00 db no_subst ; 0 + 43922 + 43923 ; "Required parameter missing" + 43924 ReqParmMiss: + 43925 000092CC 4A04 dw 1098 + 43926 000092CE 00 db no_subst ; 0 + 43927 + 43928 ; "Unrecognized switch" + 43929 LhInvSwt_Ptr: + 43930 000092CF 4B04 dw 1099 + 43931 000092D1 00 db no_subst ; 0 + 43932 + 43933 ; "A bad UMB number has been specified" + 43934 LhBadUMB_Ptr: + 43935 000092D2 4C04 dw 1100 + 43936 000092D4 00 db no_subst ; 0 + 43937 ;%endif + 43938 + 43939 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 43940 %if 0 + 43941 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 43942 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:99AAh + 43943 + 43944 DirCompRatio_Ptr: + 43945 dw 1101 ;message number + 43946 db 2 ;number of subst + 43947 db parm_block_size ; 11 ;size of sublist + 43948 db 0 ;reserved + 43949 dw Dir_CRatio_1 ;offset of arg + 43950 dw 0 ;segment of arg + 43951 db 1 ;first subst + 43952 db 91h ;format + 43953 db 2 ;maximum width + 43954 db 2 ;minimum width + 43955 db blank ; 20h ;pad character + 43956 db parm_block_size ; 11 ;size of sublist + 43957 db 0 ; reserved + 43958 dw Dir_CRatio_2 ;offset of arg + 43959 dw 0 ;segment of arg + 43960 db 2 ;second subst + 43961 db 11h ;format + 43962 db 1 ;maximum width + 43963 db 1 ;minimum width + 43964 db blank ; 20h ;pad character + 43965 + 43966 AveCompRatio_Ptr: + 43967 dw 1102 ;message number + 43968 db 2 ;number of subst + 43969 db parm_block_size ; 11 ;size of sublist + 43970 db 0 ;reserved + 43971 dw Dir_CRatio_1 ;offset of arg + 43972 dw 0 ;segment of arg + 43973 db 1 ;first subst + 43974 db 91h ;format + 43975 db 2 ;maximum width + 43976 db 2 ;minimum width + 43977 db blank ; 20h ;pad character + 43978 db parm_block_size ; 11 ;size of sublist + 43979 db 0 ; reserved + 43980 dw Dir_CRatio_2 ;offset of arg + 43981 dw 0 ;segment of arg + 43982 db 2 ;second subst + 43983 db 11h ;format + 43984 db 1 ;maximum width + 43985 db 1 ;minimum width + 43986 db blank ; 20h ;pad character + 43987 %else + 43988 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 43989 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:97A4h + 43990 kbytesf_ptr: + 43991 000092D5 5204 dw 1106 + 43992 000092D7 01 db 1 + 43993 000092D8 0B db 11 + 43994 000092D9 00 db 0 + 43995 000092DA [A99D] dw Bytes_Free + 43996 000092DC 0000 dw 0 + 43997 000092DE 01 db 1 + 43998 000092DF F1 db 0F1h ; long binary to decimal + 43999 000092E0 1E db 30 + 44000 000092E1 1E db 30 + 44001 000092E2 20 db 20h + 44002 kbytesf_n_ptr: + 44003 000092E3 5204 dw 1106 + 44004 000092E5 01 db 1 + 44005 000092E6 0B db 11 + 44006 000092E7 00 db 0 + 44007 000092E8 [A99D] dw Bytes_Free + 44008 000092EA 0000 dw 0 + 44009 000092EC 01 db 1 + 44010 000092ED B1 db 0B1h ; Right_Align+Unsgn_Bin_DWord + 44011 000092EE 1C db 28 + 44012 000092EF 1C db 28 + 44013 000092F0 20 db 20h + 44014 %endif 44015 - 44016 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44017 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:99DCh + 44016 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 44017 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8483h 44018 - 44019 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 44020 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:97C0h + 44019 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 44020 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:99DCh 44021 - 44022 ; --------------------------------------------------------------------------- - 44023 - 44024 PATH_TEXT: - 44025 000092F1 504154483D db "PATH=" - 44026 PROMPT_TEXT: - 44027 000092F6 50524F4D50543D db "PROMPT=" - 44028 COMSPECSTR: - 44029 000092FD 434F4D535045433D db "COMSPEC=" - 44030 DirEnvVar: - 44031 00009305 444952434D443D db "DIRCMD=" ; DIR's environment variable - 44032 - 44033 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 44034 ; PCDOS 7.1 COMMAND.COM - 44035 %if 1 - 44036 no_sep_text: - 44037 0000930C 4E4F5F5345503D db 'NO_SEP=' ; 1 = do not use commas as num separator - 44038 %endif - 44039 - 44040 ;============================================================================ - 44041 ; TDATA.ASM, MSDOS 6.0, 1991 - 44042 ;============================================================================ - 44043 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 44044 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44045 - 44046 ; 15/04/2023 - 44047 00009313 00 db 0 - 44048 align 2 - 44049 - 44050 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:849Eh - 44051 ; --------------------------------------------------------------------------- - 44052 ; 18/06/2023 - 44053 ;db 0 - 44054 - 44055 ; Lists of help message numbers for internal commands and /? - 44056 - 44057 ; 18/06/2023 - 44058 ;;NoHelpMsgs: - 44059 ;dw 1200,0 ;M014 - 44060 - 44061 ; 18/06/2023 - 44062 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:99F7h + 44022 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 44023 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:97C0h + 44024 + 44025 ; --------------------------------------------------------------------------- + 44026 + 44027 PATH_TEXT: + 44028 000092F1 504154483D db "PATH=" + 44029 PROMPT_TEXT: + 44030 000092F6 50524F4D50543D db "PROMPT=" + 44031 COMSPECSTR: + 44032 000092FD 434F4D535045433D db "COMSPEC=" + 44033 DirEnvVar: + 44034 00009305 444952434D443D db "DIRCMD=" ; DIR's environment variable + 44035 + 44036 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 44037 ; PCDOS 7.1 COMMAND.COM + 44038 %if 1 + 44039 no_sep_text: + 44040 0000930C 4E4F5F5345503D db 'NO_SEP=' ; 1 = do not use commas as num separator + 44041 %endif + 44042 + 44043 ;============================================================================ + 44044 ; TDATA.ASM, MSDOS 6.0, 1991 + 44045 ;============================================================================ + 44046 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 44047 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 44048 + 44049 ; 15/04/2023 + 44050 00009313 00 db 0 + 44051 align 2 + 44052 + 44053 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:849Eh + 44054 ; --------------------------------------------------------------------------- + 44055 ; 18/06/2023 + 44056 ;db 0 + 44057 + 44058 ; Lists of help message numbers for internal commands and /? + 44059 + 44060 ; 18/06/2023 + 44061 ;;NoHelpMsgs: + 44062 ;dw 1200,0 ;M014 44063 - 44064 BreakHelpMsgs: - 44065 00009314 14050000 dw 1300,0 - 44066 ChcpHelpMsgs: - 44067 00009318 280529050000 dw 1320,1321,0 - 44068 CdHelpMsgs: - 44069 0000931E 3C053D053E050000 dw 1340,1341,1342,0 - 44070 ClsHelpMsgs: - 44071 00009326 50050000 dw 1360,0 - 44072 CopyHelpMsgs: - 44073 ;dw 1400,1401,1402,1403,1404,0 - 44074 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 44075 0000932A 780579057A057B057C- dw 1400,1401,1402,1403,1404,1405,1406,1407,0 - 44075 00009333 057D057E057F050000 - 44076 CttyHelpMsgs: - 44077 0000933C 8C050000 dw 1420,0 - 44078 DateHelpMsgs: - 44079 00009340 A005A1050000 dw 1440,1441,0 - 44080 DelHelpMsgs: - 44081 00009346 B405B505B6050000 dw 1460,1461,1462,0 - 44082 DirHelpMsgs: - 44083 0000934E C805C905CA05CB05CC- dw 1480,1481,1482,1483,1484,1485,1486,1487,1488 - 44083 00009357 05CD05CE05CF05D005 - 44084 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 44085 ; MSDOS 6.0 COMMAND.COM - 44086 ;dw 1489,1490,1491,1492 - 44087 ; 06/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM - 44088 00009360 D105 dw 1489 - 44089 00009362 0000 dw 0 - 44090 ExitHelpMsgs: - 44091 00009364 DC050000 dw 1500,0 - 44092 MdHelpMsgs: - 44093 00009368 F0050000 dw 1520,0 - 44094 PathHelpMsgs: - 44095 0000936C 0406050606060000 dw 1540,1541,1542,0 - 44096 PromptHelpMsgs: - 44097 00009374 180619061A061B061C- dw 1560,1561,1562,1563,1564,1565,1566,1567,1568,0 - 44097 0000937D 061D061E061F062006- - 44097 00009386 0000 - 44098 RdHelpMsgs: - 44099 00009388 2C060000 dw 1580,0 - 44100 RenHelpMsgs: - 44101 0000938C 4006410642060000 dw 1600,1601,1602,0 - 44102 SetHelpMsgs: - 44103 00009394 5406550656060000 dw 1620,1621,1622,0 - 44104 TimeHelpMsgs: - 44105 0000939C 680669060000 dw 1640,1641,0 - 44106 TypeHelpMsgs: - 44107 000093A2 7C060000 dw 1660,0 - 44108 VerHelpMsgs: - 44109 000093A6 90060000 dw 1680,0 - 44110 VerifyHelpMsgs: - 44111 000093AA A4060000 dw 1700,0 - 44112 VolHelpMsgs: - 44113 000093AE B8060000 dw 1720,0 - 44114 CallHelpMsgs: - 44115 000093B2 CC06CD060000 dw 1740,1741,0 ;M014 - 44116 RemHelpMsgs: - 44117 000093B8 E0060000 dw 1760,0 ;M014 - 44118 PauseHelpMsgs: - 44119 000093BC F4060000 dw 1780,0 ;M014 - 44120 EchoHelpMsgs: - 44121 000093C0 080709070000 dw 1800,1801,0 ;M014 - 44122 GotoHelpMsgs: - 44123 000093C6 1C071D070000 dw 1820,1821,0 ;M014 - 44124 ShiftHelpMsgs: - 44125 000093CC 30070000 dw 1840,0 ;M014 - 44126 IfHelpMsgs: - 44127 000093D0 440745074607470748- dw 1860,1861,1862,1863,1864,1865,1866,0 ;M014 - 44127 000093D9 0749074A070000 - 44128 ForHelpMsgs: - 44129 000093E0 580759075A075B0700- dw 1880,1881,1882,1883,0 ;M014 - 44129 000093E9 00 - 44130 TruenameHelpMsgs: - 44131 000093EA 6C070000 dw 1900,0 ;M014 - 44132 LoadhighHelpMsgs: - 44133 000093EE 800781078207 dw 1920,1921,1922 - 44134 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 44135 ; MSDOS 6.0 COMMAND.COM - 44136 000093F4 830784078507860787- dw 1923,1924,1925,1926,1927 ;M014 - 44136 000093FD 07 - 44137 000093FE 0000 dw 0 - 44138 - 44139 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM - 44140 %if 1 - 44141 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:98CEh - 44142 twospacechars: - 44143 00009400 202000 db ' ',0 - 44144 %endif - 44145 - 44146 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8578h - 44147 CLSSTRING: - 44148 00009403 041B5B324A db 4,1Bh,"[2J" ; ANSI Clear screen - 44149 - 44150 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:98D6h - 44151 PROMPT_TABLE: - 44152 00009408 42 db "B" - 44153 00009409 [AC21] dw Print_B - 44154 0000940B 44 db "D" - 44155 0000940C [093B] dw PRINT_DATE - 44156 0000940E 45 db "E" - 44157 0000940F [A021] dw PRINT_ESC - 44158 00009411 47 db "G" - 44159 00009412 [A421] dw PRINT_G - 44160 00009414 48 db "H" - 44161 00009415 [5F21] dw PRINT_BACK - 44162 00009417 4C db "L" - 44163 00009418 [A821] dw PRINT_L - 44164 0000941A 4E db "N" - 44165 0000941B [BD21] dw PRINT_DRIVE - 44166 0000941D 50 db "P" - 44167 0000941E [C521] dw build_dir_for_prompt - 44168 00009420 51 db "Q" - 44169 00009421 [6521] dw PRINT_EQ - 44170 ; - 44171 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM - 44172 00009423 52 db "R" - 44173 00009424 [6921] dw PRINT_R ; PRINT Return code, [Retcode] - 44174 ; - 44175 00009426 54 db "T" - 44176 00009427 [BF33] dw PRINT_TIME - 44177 00009429 56 db "V" - 44178 0000942A [D820] dw PRINT_VERSION - 44179 0000942C 5F db "_" - 44180 0000942D [7929] dw CRLF2 - 44181 0000942F 24 db "$" - 44182 00009430 [AE21] dw PRINT_CHAR - 44183 00009432 00 db 0 ; NUL TERMINATED - 44184 - 44185 ; Table of IF conditionals - 44186 IFTAB: - 44187 00009433 034E4F54 db 3,"NOT" ; First byte is count - 44188 00009437 [F80B] dw IFNOT - 44189 00009439 0A4552524F524C4556- db 10,"ERRORLEVEL" - 44189 00009442 454C - 44190 00009444 [B70C] dw IFERLEV - 44191 00009446 054558495354 db 5,"EXIST" - 44192 0000944C [4C0C] dw IFEXISTS - 44193 0000944E 00 db 0 - 44194 - 44195 ; 06/08/2024 - 44196 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:991Dh + 44064 ; 18/06/2023 + 44065 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:99F7h + 44066 + 44067 BreakHelpMsgs: + 44068 00009314 14050000 dw 1300,0 + 44069 ChcpHelpMsgs: + 44070 00009318 280529050000 dw 1320,1321,0 + 44071 CdHelpMsgs: + 44072 0000931E 3C053D053E050000 dw 1340,1341,1342,0 + 44073 ClsHelpMsgs: + 44074 00009326 50050000 dw 1360,0 + 44075 CopyHelpMsgs: + 44076 ;dw 1400,1401,1402,1403,1404,0 + 44077 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 44078 0000932A 780579057A057B057C- dw 1400,1401,1402,1403,1404,1405,1406,1407,0 + 44078 00009333 057D057E057F050000 + 44079 CttyHelpMsgs: + 44080 0000933C 8C050000 dw 1420,0 + 44081 DateHelpMsgs: + 44082 00009340 A005A1050000 dw 1440,1441,0 + 44083 DelHelpMsgs: + 44084 00009346 B405B505B6050000 dw 1460,1461,1462,0 + 44085 DirHelpMsgs: + 44086 0000934E C805C905CA05CB05CC- dw 1480,1481,1482,1483,1484,1485,1486,1487,1488 + 44086 00009357 05CD05CE05CF05D005 + 44087 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 44088 ; MSDOS 6.0 COMMAND.COM + 44089 ;dw 1489,1490,1491,1492 + 44090 ; 06/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM + 44091 00009360 D105 dw 1489 + 44092 00009362 0000 dw 0 + 44093 ExitHelpMsgs: + 44094 00009364 DC050000 dw 1500,0 + 44095 MdHelpMsgs: + 44096 00009368 F0050000 dw 1520,0 + 44097 PathHelpMsgs: + 44098 0000936C 0406050606060000 dw 1540,1541,1542,0 + 44099 PromptHelpMsgs: + 44100 00009374 180619061A061B061C- dw 1560,1561,1562,1563,1564,1565,1566,1567,1568,0 + 44100 0000937D 061D061E061F062006- + 44100 00009386 0000 + 44101 RdHelpMsgs: + 44102 00009388 2C060000 dw 1580,0 + 44103 RenHelpMsgs: + 44104 0000938C 4006410642060000 dw 1600,1601,1602,0 + 44105 SetHelpMsgs: + 44106 00009394 5406550656060000 dw 1620,1621,1622,0 + 44107 TimeHelpMsgs: + 44108 0000939C 680669060000 dw 1640,1641,0 + 44109 TypeHelpMsgs: + 44110 000093A2 7C060000 dw 1660,0 + 44111 VerHelpMsgs: + 44112 000093A6 90060000 dw 1680,0 + 44113 VerifyHelpMsgs: + 44114 000093AA A4060000 dw 1700,0 + 44115 VolHelpMsgs: + 44116 000093AE B8060000 dw 1720,0 + 44117 CallHelpMsgs: + 44118 000093B2 CC06CD060000 dw 1740,1741,0 ;M014 + 44119 RemHelpMsgs: + 44120 000093B8 E0060000 dw 1760,0 ;M014 + 44121 PauseHelpMsgs: + 44122 000093BC F4060000 dw 1780,0 ;M014 + 44123 EchoHelpMsgs: + 44124 000093C0 080709070000 dw 1800,1801,0 ;M014 + 44125 GotoHelpMsgs: + 44126 000093C6 1C071D070000 dw 1820,1821,0 ;M014 + 44127 ShiftHelpMsgs: + 44128 000093CC 30070000 dw 1840,0 ;M014 + 44129 IfHelpMsgs: + 44130 000093D0 440745074607470748- dw 1860,1861,1862,1863,1864,1865,1866,0 ;M014 + 44130 000093D9 0749074A070000 + 44131 ForHelpMsgs: + 44132 000093E0 580759075A075B0700- dw 1880,1881,1882,1883,0 ;M014 + 44132 000093E9 00 + 44133 TruenameHelpMsgs: + 44134 000093EA 6C070000 dw 1900,0 ;M014 + 44135 LoadhighHelpMsgs: + 44136 000093EE 800781078207 dw 1920,1921,1922 + 44137 ; 17/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 44138 ; MSDOS 6.0 COMMAND.COM + 44139 000093F4 830784078507860787- dw 1923,1924,1925,1926,1927 ;M014 + 44139 000093FD 07 + 44140 000093FE 0000 dw 0 + 44141 + 44142 ; 03/08/2024 - Retro DOS v5.0 COMMAND.COM + 44143 %if 1 + 44144 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:98CEh + 44145 twospacechars: + 44146 00009400 202000 db ' ',0 + 44147 %endif + 44148 + 44149 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8578h + 44150 CLSSTRING: + 44151 00009403 041B5B324A db 4,1Bh,"[2J" ; ANSI Clear screen + 44152 + 44153 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:98D6h + 44154 PROMPT_TABLE: + 44155 00009408 42 db "B" + 44156 00009409 [AC21] dw Print_B + 44157 0000940B 44 db "D" + 44158 0000940C [093B] dw PRINT_DATE + 44159 0000940E 45 db "E" + 44160 0000940F [A021] dw PRINT_ESC + 44161 00009411 47 db "G" + 44162 00009412 [A421] dw PRINT_G + 44163 00009414 48 db "H" + 44164 00009415 [5F21] dw PRINT_BACK + 44165 00009417 4C db "L" + 44166 00009418 [A821] dw PRINT_L + 44167 0000941A 4E db "N" + 44168 0000941B [BD21] dw PRINT_DRIVE + 44169 0000941D 50 db "P" + 44170 0000941E [C521] dw build_dir_for_prompt + 44171 00009420 51 db "Q" + 44172 00009421 [6521] dw PRINT_EQ + 44173 ; + 44174 ; 06/08/2024 - PCDOS 7.1 COMMAND.COM + 44175 00009423 52 db "R" + 44176 00009424 [6921] dw PRINT_R ; PRINT Return code, [Retcode] + 44177 ; + 44178 00009426 54 db "T" + 44179 00009427 [BF33] dw PRINT_TIME + 44180 00009429 56 db "V" + 44181 0000942A [D820] dw PRINT_VERSION + 44182 0000942C 5F db "_" + 44183 0000942D [7929] dw CRLF2 + 44184 0000942F 24 db "$" + 44185 00009430 [AE21] dw PRINT_CHAR + 44186 00009432 00 db 0 ; NUL TERMINATED + 44187 + 44188 ; Table of IF conditionals + 44189 IFTAB: + 44190 00009433 034E4F54 db 3,"NOT" ; First byte is count + 44191 00009437 [F80B] dw IFNOT + 44192 00009439 0A4552524F524C4556- db 10,"ERRORLEVEL" + 44192 00009442 454C + 44193 00009444 [B70C] dw IFERLEV + 44194 00009446 054558495354 db 5,"EXIST" + 44195 0000944C [4C0C] dw IFEXISTS + 44196 0000944E 00 db 0 44197 - 44198 ; Table for internal command names - 44199 COMTAB: - 44200 0000944F 0344495203 db 3,"DIR",fSwitchAllowed+fCheckDrive ; 3 - 44201 00009454 [8011] dw CATALOG ; In TCMD1.ASM - 44202 00009456 [4E93] dw DirHelpMsgs - 44203 - 44204 00009458 0443414C4C02 db 4,"CALL",fSwitchAllowed ; 2 - 44205 0000945E [2C0D] dw _$CALL ; In TBATCH2.ASM - 44206 00009460 [B293] dw CallHelpMsgs - 44207 - 44208 00009462 044348435002 db 4,"CHCP",fSwitchAllowed ; 2 - 44209 00009468 [0824] dw CHCP ; In TCMD2B.ASM - 44210 0000946A [1893] dw ChcpHelpMsgs - 44211 - 44212 0000946C 0652454E414D4503 db 6,"RENAME",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44213 00009474 [8E1D] dw CRENAME ; In TCMD1.ASM - 44214 00009476 [8C93] dw RenHelpMsgs - 44215 - 44216 00009478 0352454E03 db 3,"REN",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44217 0000947D [8E1D] dw CRENAME ; In TCMD1.ASM - 44218 0000947F [8C93] dw RenHelpMsgs - 44219 - 44220 00009481 05455241534503 db 5,"ERASE",fSwitchAllowed+fCheckDrive ; 3 - 44221 00009488 [0C1D] dw ERASE ; In TCMD1.ASM - 44222 0000948A [4693] dw DelHelpMsgs - 44223 - 44224 0000948C 0344454C03 db 3,"DEL",fSwitchAllowed+fCheckDrive ; 3 - 44225 00009491 [0C1D] dw ERASE ; In TCMD1.ASM - 44226 00009493 [4693] dw DelHelpMsgs - 44227 - 44228 00009495 045459504503 db 4,"TYPE",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44229 0000949B [351E] dw TYPEFIL ; In TCMD1.ASM - 44230 0000949D [A293] dw TypeHelpMsgs - 44231 - 44232 0000949F 0352454D06 db 3,"REM",fSwitchAllowed+fLimitHelp ; 6 - 44233 000094A4 [0401] dw TCOMMAND ; In TCODE.ASM - 44234 000094A6 [B893] dw RemHelpMsgs - 44235 - 44236 000094A8 04434F505903 db 4,"COPY",fSwitchAllowed+fCheckDrive ; 3 - 44237 000094AE [563B] dw COPY ; In COPY.ASM - 44238 000094B0 [2A93] dw CopyHelpMsgs - 44239 - 44240 000094B2 05504155534506 db 5,"PAUSE",fSwitchAllowed+fLimitHelp ; 6 - 44241 000094B9 [001D] dw PAUSE ; In TCMD1.ASM - 44242 000094BB [BC93] dw PauseHelpMsgs - 44243 - 44244 000094BD 044441544502 db 4,"DATE",fSwitchAllowed ; 2 - 44245 000094C3 [CF32] dw DATE ; In TPIPE.ASM - 44246 000094C5 [4093] dw DateHelpMsgs - 44247 - 44248 000094C7 0454494D4502 db 4,"TIME",fSwitchAllowed ; 2 ;AC018; P3903 - 44249 000094CD [2F33] dw CTIME ; In TPIPE.ASM - 44250 000094CF [9C93] dw TimeHelpMsgs - 44251 - 44252 000094D1 0356455202 db 3,"VER",fSwitchAllowed ; 2 - 44253 000094D6 [6220] dw VERSION ; In TCMD2.ASM - 44254 000094D8 [A693] dw VerHelpMsgs - 44255 - 44256 000094DA 03564F4C03 db 3,"VOL",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44257 000094DF [631F] dw VOLUME ; In TCMD1.ASM - 44258 000094E1 [AE93] dw VolHelpMsgs - 44259 - 44260 000094E3 02434403 db 2,"CD",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44261 000094E7 [3C28] dw _$CHDIR ; In TENV.ASM - 44262 000094E9 [1E93] dw CdHelpMsgs - 44263 - 44264 000094EB 05434844495203 db 5,"CHDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903 - 44265 000094F2 [3C28] dw _$CHDIR ; In TENV.ASM - 44266 000094F4 [1E93] dw CdHelpMsgs - 44267 - 44268 000094F6 024D4403 db 2,"MD",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44269 000094FA [A228] dw _$MKDIR ; In TENV.ASM - 44270 000094FC [6893] dw MdHelpMsgs - 44271 - 44272 000094FE 054D4B44495203 db 5,"MKDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903 - 44273 00009505 [A228] dw _$MKDIR ; In TENV.ASM - 44274 00009507 [6893] dw MdHelpMsgs - 44275 - 44276 00009509 02524403 db 2,"RD",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 - 44277 0000950D [E728] dw _$RMDIR ; In TENV.ASM - 44278 0000950F [8893] dw RdHelpMsgs - 44279 - 44280 00009511 05524D44495203 db 5,"RMDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903 - 44281 00009518 [E728] dw _$RMDIR ; In TENV.ASM - 44282 0000951A [8893] dw RdHelpMsgs - 44283 - 44284 0000951C 05425245414B02 db 5,"BREAK",fSwitchAllowed ; 2 ;AC018; P3903 - 44285 00009523 [533A] dw CNTRLC ; In TUCODE.ASM - 44286 00009525 [1493] dw BreakHelpMsgs - 44287 - 44288 00009527 0656455249465902 db 6,"VERIFY",fSwitchAllowed ; 2 ;AC018; P3903 - 44289 0000952F [953A] dw VERIFY ; In TUCODE.ASM - 44290 00009531 [AA93] dw VerifyHelpMsgs - 44291 - 44292 00009533 0353455406 db 3,"SET",fSwitchAllowed+fLimitHelp ; 6 - 44293 00009538 [A625] dw ADD_NAME_TO_ENVIRONMENT ; In TENV.ASM - 44294 0000953A [9493] dw SetHelpMsgs - 44295 - 44296 0000953C 0650524F4D505406 db 6,"PROMPT",fSwitchAllowed+fLimitHelp ; 6 - 44297 00009544 [8C25] dw ADD_PROMPT ; In TENV.ASM - 44298 00009546 [7493] dw PromptHelpMsgs - 44299 - 44300 00009548 045041544802 db 4,"PATH",fSwitchAllowed ; 2 - 44301 0000954E [2C22] dw PATH ; In TCMD2.ASM - 44302 00009550 [6C93] dw PathHelpMsgs - 44303 - 44304 00009552 044558495400 db 4,"EXIT",0 - 44305 00009558 [FD24] dw _$EXIT ; In TCMD2.ASM - 44306 0000955A [6493] dw ExitHelpMsgs - 44307 - 44308 0000955C 044354545903 db 4,"CTTY",fCheckDrive+fSwitchAllowed ; 3 - 44309 00009562 [6A23] dw CTTY ; In TCMD2.ASM - 44310 00009564 [3C93] dw CttyHelpMsgs - 44311 - 44312 00009566 044543484F06 db 4,"ECHO",fSwitchAllowed+fLimitHelp ; 6 - 44313 0000956C [1A3A] dw _ECHO ; In TUCODE.ASM - 44314 0000956E [C093] dw EchoHelpMsgs - 44315 - 44316 00009570 04474F544F06 db 4,"GOTO",fSwitchAllowed+fLimitHelp - 44317 00009576 [600D] dw _GOTO ; In TBATCH.ASM - 44318 00009578 [C693] dw GotoHelpMsgs - 44319 - 44320 0000957A 05534849465402 db 5,"SHIFT",fSwitchAllowed ; 2 - 44321 00009581 [E50C] dw _SHIFT ; In TBATCH.ASM - 44322 00009583 [CC93] dw ShiftHelpMsgs - 44323 - 44324 00009585 02494606 db 2,"IF",fSwitchAllowed+fLimitHelp ; 6 - 44325 00009589 [910B] dw _$IF ; In TBATCH.ASM - 44326 0000958B [D093] dw IfHelpMsgs - 44327 - 44328 0000958D 03464F5206 db 3,"FOR",fSwitchAllowed+fLimitHelp ; 6 - 44329 00009592 [1910] dw _$FOR ; In TBATCH.ASM - 44330 00009594 [E093] dw ForHelpMsgs - 44331 - 44332 00009596 03434C5300 db 3,"CLS",0 - 44333 0000959B [D122] dw CLS ; In TCMD2.ASM - 44334 0000959D [2693] dw ClsHelpMsgs - 44335 - 44336 0000959F 08545255454E414D45- db 8,"TRUENAME",fSwitchAllowed+fCheckDrive ;AN000; P3903 changed - 44336 000095A8 03 - 44337 000095A9 [8624] dw TRUENAME ;AN000; - 44338 000095AB [EA93] dw TruenameHelpMsgs - 44339 - 44340 000095AD 084C4F414448494748- db 8,"LOADHIGH",fSwitchAllowed ; 2 ; M003 - 44340 000095B6 02 - 44341 000095B7 [1A62] dw LoadHigh ; In loadhi.asm ; M003 - 44342 000095B9 [EE93] dw LoadhighHelpMsgs ; M003 - 44343 - 44344 000095BB 024C4802 db 2,"LH",fSwitchAllowed ; 2 ; Short form; M003 - 44345 000095BF [1A62] dw LoadHigh ; In loadhi.asm ; M003 - 44346 000095C1 [EE93] dw LoadhighHelpMsgs ; M003 - 44347 - 44348 000095C3 00 db 0 ; Terminate command table - 44349 - 44350 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8736h - 44351 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9A92h ; 06/08/2024 + 44198 ; 06/08/2024 + 44199 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:991Dh + 44200 + 44201 ; Table for internal command names + 44202 COMTAB: + 44203 0000944F 0344495203 db 3,"DIR",fSwitchAllowed+fCheckDrive ; 3 + 44204 00009454 [8011] dw CATALOG ; In TCMD1.ASM + 44205 00009456 [4E93] dw DirHelpMsgs + 44206 + 44207 00009458 0443414C4C02 db 4,"CALL",fSwitchAllowed ; 2 + 44208 0000945E [2C0D] dw _$CALL ; In TBATCH2.ASM + 44209 00009460 [B293] dw CallHelpMsgs + 44210 + 44211 00009462 044348435002 db 4,"CHCP",fSwitchAllowed ; 2 + 44212 00009468 [0824] dw CHCP ; In TCMD2B.ASM + 44213 0000946A [1893] dw ChcpHelpMsgs + 44214 + 44215 0000946C 0652454E414D4503 db 6,"RENAME",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44216 00009474 [8E1D] dw CRENAME ; In TCMD1.ASM + 44217 00009476 [8C93] dw RenHelpMsgs + 44218 + 44219 00009478 0352454E03 db 3,"REN",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44220 0000947D [8E1D] dw CRENAME ; In TCMD1.ASM + 44221 0000947F [8C93] dw RenHelpMsgs + 44222 + 44223 00009481 05455241534503 db 5,"ERASE",fSwitchAllowed+fCheckDrive ; 3 + 44224 00009488 [0C1D] dw ERASE ; In TCMD1.ASM + 44225 0000948A [4693] dw DelHelpMsgs + 44226 + 44227 0000948C 0344454C03 db 3,"DEL",fSwitchAllowed+fCheckDrive ; 3 + 44228 00009491 [0C1D] dw ERASE ; In TCMD1.ASM + 44229 00009493 [4693] dw DelHelpMsgs + 44230 + 44231 00009495 045459504503 db 4,"TYPE",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44232 0000949B [351E] dw TYPEFIL ; In TCMD1.ASM + 44233 0000949D [A293] dw TypeHelpMsgs + 44234 + 44235 0000949F 0352454D06 db 3,"REM",fSwitchAllowed+fLimitHelp ; 6 + 44236 000094A4 [0401] dw TCOMMAND ; In TCODE.ASM + 44237 000094A6 [B893] dw RemHelpMsgs + 44238 + 44239 000094A8 04434F505903 db 4,"COPY",fSwitchAllowed+fCheckDrive ; 3 + 44240 000094AE [563B] dw COPY ; In COPY.ASM + 44241 000094B0 [2A93] dw CopyHelpMsgs + 44242 + 44243 000094B2 05504155534506 db 5,"PAUSE",fSwitchAllowed+fLimitHelp ; 6 + 44244 000094B9 [001D] dw PAUSE ; In TCMD1.ASM + 44245 000094BB [BC93] dw PauseHelpMsgs + 44246 + 44247 000094BD 044441544502 db 4,"DATE",fSwitchAllowed ; 2 + 44248 000094C3 [CF32] dw DATE ; In TPIPE.ASM + 44249 000094C5 [4093] dw DateHelpMsgs + 44250 + 44251 000094C7 0454494D4502 db 4,"TIME",fSwitchAllowed ; 2 ;AC018; P3903 + 44252 000094CD [2F33] dw CTIME ; In TPIPE.ASM + 44253 000094CF [9C93] dw TimeHelpMsgs + 44254 + 44255 000094D1 0356455202 db 3,"VER",fSwitchAllowed ; 2 + 44256 000094D6 [6220] dw VERSION ; In TCMD2.ASM + 44257 000094D8 [A693] dw VerHelpMsgs + 44258 + 44259 000094DA 03564F4C03 db 3,"VOL",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44260 000094DF [631F] dw VOLUME ; In TCMD1.ASM + 44261 000094E1 [AE93] dw VolHelpMsgs + 44262 + 44263 000094E3 02434403 db 2,"CD",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44264 000094E7 [3C28] dw _$CHDIR ; In TENV.ASM + 44265 000094E9 [1E93] dw CdHelpMsgs + 44266 + 44267 000094EB 05434844495203 db 5,"CHDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903 + 44268 000094F2 [3C28] dw _$CHDIR ; In TENV.ASM + 44269 000094F4 [1E93] dw CdHelpMsgs + 44270 + 44271 000094F6 024D4403 db 2,"MD",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44272 000094FA [A228] dw _$MKDIR ; In TENV.ASM + 44273 000094FC [6893] dw MdHelpMsgs + 44274 + 44275 000094FE 054D4B44495203 db 5,"MKDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903 + 44276 00009505 [A228] dw _$MKDIR ; In TENV.ASM + 44277 00009507 [6893] dw MdHelpMsgs + 44278 + 44279 00009509 02524403 db 2,"RD",fSwitchAllowed+fCheckDrive ; 3 ;AC018; P3903 + 44280 0000950D [E728] dw _$RMDIR ; In TENV.ASM + 44281 0000950F [8893] dw RdHelpMsgs + 44282 + 44283 00009511 05524D44495203 db 5,"RMDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903 + 44284 00009518 [E728] dw _$RMDIR ; In TENV.ASM + 44285 0000951A [8893] dw RdHelpMsgs + 44286 + 44287 0000951C 05425245414B02 db 5,"BREAK",fSwitchAllowed ; 2 ;AC018; P3903 + 44288 00009523 [533A] dw CNTRLC ; In TUCODE.ASM + 44289 00009525 [1493] dw BreakHelpMsgs + 44290 + 44291 00009527 0656455249465902 db 6,"VERIFY",fSwitchAllowed ; 2 ;AC018; P3903 + 44292 0000952F [953A] dw VERIFY ; In TUCODE.ASM + 44293 00009531 [AA93] dw VerifyHelpMsgs + 44294 + 44295 00009533 0353455406 db 3,"SET",fSwitchAllowed+fLimitHelp ; 6 + 44296 00009538 [A625] dw ADD_NAME_TO_ENVIRONMENT ; In TENV.ASM + 44297 0000953A [9493] dw SetHelpMsgs + 44298 + 44299 0000953C 0650524F4D505406 db 6,"PROMPT",fSwitchAllowed+fLimitHelp ; 6 + 44300 00009544 [8C25] dw ADD_PROMPT ; In TENV.ASM + 44301 00009546 [7493] dw PromptHelpMsgs + 44302 + 44303 00009548 045041544802 db 4,"PATH",fSwitchAllowed ; 2 + 44304 0000954E [2C22] dw PATH ; In TCMD2.ASM + 44305 00009550 [6C93] dw PathHelpMsgs + 44306 + 44307 00009552 044558495400 db 4,"EXIT",0 + 44308 00009558 [FD24] dw _$EXIT ; In TCMD2.ASM + 44309 0000955A [6493] dw ExitHelpMsgs + 44310 + 44311 0000955C 044354545903 db 4,"CTTY",fCheckDrive+fSwitchAllowed ; 3 + 44312 00009562 [6A23] dw CTTY ; In TCMD2.ASM + 44313 00009564 [3C93] dw CttyHelpMsgs + 44314 + 44315 00009566 044543484F06 db 4,"ECHO",fSwitchAllowed+fLimitHelp ; 6 + 44316 0000956C [1A3A] dw _ECHO ; In TUCODE.ASM + 44317 0000956E [C093] dw EchoHelpMsgs + 44318 + 44319 00009570 04474F544F06 db 4,"GOTO",fSwitchAllowed+fLimitHelp + 44320 00009576 [600D] dw _GOTO ; In TBATCH.ASM + 44321 00009578 [C693] dw GotoHelpMsgs + 44322 + 44323 0000957A 05534849465402 db 5,"SHIFT",fSwitchAllowed ; 2 + 44324 00009581 [E50C] dw _SHIFT ; In TBATCH.ASM + 44325 00009583 [CC93] dw ShiftHelpMsgs + 44326 + 44327 00009585 02494606 db 2,"IF",fSwitchAllowed+fLimitHelp ; 6 + 44328 00009589 [910B] dw _$IF ; In TBATCH.ASM + 44329 0000958B [D093] dw IfHelpMsgs + 44330 + 44331 0000958D 03464F5206 db 3,"FOR",fSwitchAllowed+fLimitHelp ; 6 + 44332 00009592 [1910] dw _$FOR ; In TBATCH.ASM + 44333 00009594 [E093] dw ForHelpMsgs + 44334 + 44335 00009596 03434C5300 db 3,"CLS",0 + 44336 0000959B [D122] dw CLS ; In TCMD2.ASM + 44337 0000959D [2693] dw ClsHelpMsgs + 44338 + 44339 0000959F 08545255454E414D45- db 8,"TRUENAME",fSwitchAllowed+fCheckDrive ;AN000; P3903 changed + 44339 000095A8 03 + 44340 000095A9 [8624] dw TRUENAME ;AN000; + 44341 000095AB [EA93] dw TruenameHelpMsgs + 44342 + 44343 000095AD 084C4F414448494748- db 8,"LOADHIGH",fSwitchAllowed ; 2 ; M003 + 44343 000095B6 02 + 44344 000095B7 [1A62] dw LoadHigh ; In loadhi.asm ; M003 + 44345 000095B9 [EE93] dw LoadhighHelpMsgs ; M003 + 44346 + 44347 000095BB 024C4802 db 2,"LH",fSwitchAllowed ; 2 ; Short form; M003 + 44348 000095BF [1A62] dw LoadHigh ; In loadhi.asm ; M003 + 44349 000095C1 [EE93] dw LoadhighHelpMsgs ; M003 + 44350 + 44351 000095C3 00 db 0 ; Terminate command table 44352 - 44353 000095C4 2E434F4D comext: db ".COM" - 44354 000095C8 2E455845 exeext: db ".EXE" - 44355 000095CC 2E424154 batext: db ".BAT" - 44356 - 44357 switch_list: - 44358 ; MSDOS 5.0 (& 6.0) COMMAND.COM - 44359 ;db "?VBAPW" ; flags we can recognize - 44360 ; 18/06/2023 - 44361 ; MSDOS 6.22 COMMAND.COM - 44362 000095D0 2D593F5642415057 db "-Y?VBAPW" ; PCDOS 7.1 COMMAND.COM ; 06/08/2024 - 44363 - 44364 AttrLtrs: - 44365 000095D8 524853764441 db "RHSvDA" ; attribute letters for DIR + 44353 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8736h + 44354 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9A92h ; 06/08/2024 + 44355 + 44356 000095C4 2E434F4D comext: db ".COM" + 44357 000095C8 2E455845 exeext: db ".EXE" + 44358 000095CC 2E424154 batext: db ".BAT" + 44359 + 44360 switch_list: + 44361 ; MSDOS 5.0 (& 6.0) COMMAND.COM + 44362 ;db "?VBAPW" ; flags we can recognize + 44363 ; 18/06/2023 + 44364 ; MSDOS 6.22 COMMAND.COM + 44365 000095D0 2D593F5642415057 db "-Y?VBAPW" ; PCDOS 7.1 COMMAND.COM ; 06/08/2024 44366 - 44367 ; Attribute letters in AttrLtrs must appear in the order that - 44368 ; attribute bits occur in the attribute byte returned by - 44369 ; directory searches, starting with bit 0. - 44370 ; The volume label attribute is lowercased to keep it from - 44371 ; being matched (by an uppercase comparison). - 44372 - 44373 OrderLtrs: - 44374 ; MSDOS 5.0 - 44375 ;db "NEDSG" ; sort order letters for DIR - 44376 ; 18/06/2023 - 44377 ; MSDOS 6.0 COMMAND.COM - 44378 ;db "NEDSGC" ; sort order letters for DIR - 44379 ; 06/08/2024 - 44380 ; PCDOS 7.1 COMMAND.COM - 44381 000095DE 4E45445347 db "NEDSG" - 44382 - 44383 ; Sort order letters stand for file name, extension, - 44384 ; date/time, size, grouped (directory files before others), - 44385 ; and compression ratio. DIR routines rely on the specific - 44386 ; order of the letters in this list. - 44387 - 44388 comspec_flag: - 44389 000095E3 00 db 0 ;AN071; + 44367 AttrLtrs: + 44368 000095D8 524853764441 db "RHSvDA" ; attribute letters for DIR + 44369 + 44370 ; Attribute letters in AttrLtrs must appear in the order that + 44371 ; attribute bits occur in the attribute byte returned by + 44372 ; directory searches, starting with bit 0. + 44373 ; The volume label attribute is lowercased to keep it from + 44374 ; being matched (by an uppercase comparison). + 44375 + 44376 OrderLtrs: + 44377 ; MSDOS 5.0 + 44378 ;db "NEDSG" ; sort order letters for DIR + 44379 ; 18/06/2023 + 44380 ; MSDOS 6.0 COMMAND.COM + 44381 ;db "NEDSGC" ; sort order letters for DIR + 44382 ; 06/08/2024 + 44383 ; PCDOS 7.1 COMMAND.COM + 44384 000095DE 4E45445347 db "NEDSG" + 44385 + 44386 ; Sort order letters stand for file name, extension, + 44387 ; date/time, size, grouped (directory files before others), + 44388 ; and compression ratio. DIR routines rely on the specific + 44389 ; order of the letters in this list. 44390 - 44391 BATBUFLEN: - 44392 000095E4 2000 dw BatLen ; 32 + 44391 comspec_flag: + 44392 000095E3 00 db 0 ;AN071; 44393 - 44394 ; ***************************************************** - 44395 ; EMG 4.00 - 44396 ; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00 - 44397 ; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE - 44398 ; ***************************************************** - 44399 - 44400 ; COMMON PARSE BLOCKS - 44401 - 44402 ; Indicates no value list for PARSE. - 44403 - 44404 NO_VALUES: - 44405 000095E6 0000 dw 0 ;AN000; no values + 44394 BATBUFLEN: + 44395 000095E4 2000 dw BatLen ; 32 + 44396 + 44397 ; ***************************************************** + 44398 ; EMG 4.00 + 44399 ; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00 + 44400 ; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE + 44401 ; ***************************************************** + 44402 + 44403 ; COMMON PARSE BLOCKS + 44404 + 44405 ; Indicates no value list for PARSE. 44406 - 44407 NULL_VALUE_LIST: ; for unvalidated value - 44408 000095E8 00 db 0 ; no value lists + 44407 NO_VALUES: + 44408 000095E6 0000 dw 0 ;AN000; no values 44409 - 44410 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 44411 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8759h + 44410 NULL_VALUE_LIST: ; for unvalidated value + 44411 000095E8 00 db 0 ; no value lists 44412 - 44413 ; PARSE control block for a required file specification (upper cased) - 44414 - 44415 FILE_REQUIRED: - 44416 000095E9 0002 dw 0200h ;AN000; filespec - required - 44417 000095EB 0100 dw 1 ;AN000; capitalize - file table - 44418 000095ED [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44419 000095EF [E695] dw NO_VALUES ;AN000; - 44420 000095F1 00 db 0 ;AN000; no keywords - 44421 - 44422 ; PARSE control block for an optional file specification (upper cased) - 44423 ; or drive number + 44413 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 44414 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8759h + 44415 + 44416 ; PARSE control block for a required file specification (upper cased) + 44417 + 44418 FILE_REQUIRED: + 44419 000095E9 0002 dw 0200h ;AN000; filespec - required + 44420 000095EB 0100 dw 1 ;AN000; capitalize - file table + 44421 000095ED [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44422 000095EF [E695] dw NO_VALUES ;AN000; + 44423 000095F1 00 db 0 ;AN000; no keywords 44424 - 44425 FILE_OPTIONAL: - 44426 000095F2 0103 dw 0301h ;AN000; filespec or drive number - 44427 ; optional - 44428 000095F4 0100 dw 1 ;AN000; capitalize - file table - 44429 000095F6 [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44430 000095F8 [E695] dw NO_VALUES ;AN000; - 44431 000095FA 00 db 0 ;AN000; no keywords - 44432 - 44433 ; PARSE control block for an optional file specification (upper cased) - 44434 - 44435 FILE_OPTIONAL2: - 44436 000095FB 0102 dw 0201h ;AN000; filespec optional - 44437 000095FD 0100 dw 1 ;AN000; capitalize - file table - 44438 000095FF [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44439 00009601 [E695] dw NO_VALUES ;AN000; - 44440 00009603 00 db 0 ;AN000; no keywords - 44441 - 44442 ; PARSE control block for an optional /P switch - 44443 - 44444 SLASH_P_SWITCH: - 44445 00009604 0000 dw 0 ;AN000; no match flags - 44446 00009606 0200 dw 2 ;AN000; capitalize - char table - 44447 00009608 [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44448 0000960A [E695] dw NO_VALUES ;AN000; - 44449 0000960C 01 db 1 ;AN000; 1 keyword - 44450 SLASH_P_SYN: - 44451 0000960D 2F5000 db "/P",0 ;AN000; /P switch - 44452 - 44453 ; PARSE BLOCK FOR BREAK, VERIFY, ECHO - 44454 - 44455 ; The following parse control block can be used for any command which - 44456 ; needs only the optional "ON" and "OFF" keywords as operands. Allows - 44457 ; the equal sign as an additional delimiter. Returns verified result - 44458 ; in PARSE1_OUTPUT. Currently used for the BREAK, VERIFY, and ECHO - 44459 ; internal commands. - 44460 - 44461 PARSE_BREAK: - 44462 00009610 [1396] dw BREAK_PARMS ;AN000; - 44463 00009612 00 db 0 ;AN032; no extra delimiter - 44464 - 44465 BREAK_PARMS: - 44466 00009613 0001 db 0,1 ;AN000; 1 positional parm - 44467 00009615 [1996] dw BREAK_CONTROL1 ;AN000; - 44468 00009617 00 db 0 ;AN000; no switches - 44469 00009618 00 db 0 ;AN000; no keywords - 44470 - 44471 BREAK_CONTROL1: - 44472 00009619 0120 dw 2001h ;AN000; string value - optional - 44473 0000961B 0200 dw 2 ;AN000; capitalize - char table - 44474 0000961D [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44475 0000961F [2296] dw BREAK_VALUES ;AN000; - 44476 00009621 00 db 0 ;AN000; no keywords - 44477 - 44478 BREAK_VALUES: - 44479 00009622 03 db 3 ;AN000; - 44480 00009623 00 db 0 ;AN000; no ranges - 44481 00009624 00 db 0 ;AN000; no numeric values - 44482 00009625 02 db 2 ;AN000; 2 string values - 44483 00009626 00 db 0 ;AN000; returned if ON - 44484 00009627 [2C96] dw BREAK_ON ;AN000; point to ON string - 44485 00009629 66 db 'f' ;AN000; returned if OFF - 44486 0000962A [2F96] dw BREAK_OFF ;AN000; point to OFF string - 44487 - 44488 BREAK_ON: - 44489 0000962C 4F4E00 db "ON",0 ;AN000; - 44490 BREAK_OFF: - 44491 0000962F 4F464600 db "OFF",0 ;AN000; - 44492 - 44493 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 44494 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:87A3h + 44425 ; PARSE control block for an optional file specification (upper cased) + 44426 ; or drive number + 44427 + 44428 FILE_OPTIONAL: + 44429 000095F2 0103 dw 0301h ;AN000; filespec or drive number + 44430 ; optional + 44431 000095F4 0100 dw 1 ;AN000; capitalize - file table + 44432 000095F6 [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44433 000095F8 [E695] dw NO_VALUES ;AN000; + 44434 000095FA 00 db 0 ;AN000; no keywords + 44435 + 44436 ; PARSE control block for an optional file specification (upper cased) + 44437 + 44438 FILE_OPTIONAL2: + 44439 000095FB 0102 dw 0201h ;AN000; filespec optional + 44440 000095FD 0100 dw 1 ;AN000; capitalize - file table + 44441 000095FF [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44442 00009601 [E695] dw NO_VALUES ;AN000; + 44443 00009603 00 db 0 ;AN000; no keywords + 44444 + 44445 ; PARSE control block for an optional /P switch + 44446 + 44447 SLASH_P_SWITCH: + 44448 00009604 0000 dw 0 ;AN000; no match flags + 44449 00009606 0200 dw 2 ;AN000; capitalize - char table + 44450 00009608 [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44451 0000960A [E695] dw NO_VALUES ;AN000; + 44452 0000960C 01 db 1 ;AN000; 1 keyword + 44453 SLASH_P_SYN: + 44454 0000960D 2F5000 db "/P",0 ;AN000; /P switch + 44455 + 44456 ; PARSE BLOCK FOR BREAK, VERIFY, ECHO + 44457 + 44458 ; The following parse control block can be used for any command which + 44459 ; needs only the optional "ON" and "OFF" keywords as operands. Allows + 44460 ; the equal sign as an additional delimiter. Returns verified result + 44461 ; in PARSE1_OUTPUT. Currently used for the BREAK, VERIFY, and ECHO + 44462 ; internal commands. + 44463 + 44464 PARSE_BREAK: + 44465 00009610 [1396] dw BREAK_PARMS ;AN000; + 44466 00009612 00 db 0 ;AN032; no extra delimiter + 44467 + 44468 BREAK_PARMS: + 44469 00009613 0001 db 0,1 ;AN000; 1 positional parm + 44470 00009615 [1996] dw BREAK_CONTROL1 ;AN000; + 44471 00009617 00 db 0 ;AN000; no switches + 44472 00009618 00 db 0 ;AN000; no keywords + 44473 + 44474 BREAK_CONTROL1: + 44475 00009619 0120 dw 2001h ;AN000; string value - optional + 44476 0000961B 0200 dw 2 ;AN000; capitalize - char table + 44477 0000961D [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44478 0000961F [2296] dw BREAK_VALUES ;AN000; + 44479 00009621 00 db 0 ;AN000; no keywords + 44480 + 44481 BREAK_VALUES: + 44482 00009622 03 db 3 ;AN000; + 44483 00009623 00 db 0 ;AN000; no ranges + 44484 00009624 00 db 0 ;AN000; no numeric values + 44485 00009625 02 db 2 ;AN000; 2 string values + 44486 00009626 00 db 0 ;AN000; returned if ON + 44487 00009627 [2C96] dw BREAK_ON ;AN000; point to ON string + 44488 00009629 66 db 'f' ;AN000; returned if OFF + 44489 0000962A [2F96] dw BREAK_OFF ;AN000; point to OFF string + 44490 + 44491 BREAK_ON: + 44492 0000962C 4F4E00 db "ON",0 ;AN000; + 44493 BREAK_OFF: + 44494 0000962F 4F464600 db "OFF",0 ;AN000; 44495 - 44496 ; PARSE BLOCK FOR CHCP - 44497 - 44498 ; The following parse control block can be used for any command which - 44499 ; needs only one optional three digit decimal parameter for operands. - 44500 ; Returns verified result in PARSE1_OUTPUT. Currently used for the - 44501 ; CHCP internal command. - 44502 - 44503 CHCP_MINVAL EQU 100 ;AN000; - 44504 CHCP_MAXVAL EQU 999 ;AN000; + 44496 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 44497 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:87A3h + 44498 + 44499 ; PARSE BLOCK FOR CHCP + 44500 + 44501 ; The following parse control block can be used for any command which + 44502 ; needs only one optional three digit decimal parameter for operands. + 44503 ; Returns verified result in PARSE1_OUTPUT. Currently used for the + 44504 ; CHCP internal command. 44505 - 44506 PARSE_CHCP: - 44507 00009633 [3696] dw CHCP_PARMS ;AN000; - 44508 00009635 00 db 0 ;AN000; no extra delimiter - 44509 CHCP_PARMS: - 44510 00009636 0001 db 0,1 ;AN000; 1 positional parm - 44511 00009638 [3C96] dw CHCP_CONTROL1 ;AN000; - 44512 0000963A 00 db 0 ;AN000; no switches - 44513 0000963B 00 db 0 ;AN000; no keywords - 44514 - 44515 CHCP_CONTROL1: - 44516 0000963C 0180 dw 8001h ;AN000; numeric value - optional - 44517 0000963E 0000 dw 0 ;AN000; no function flags - 44518 00009640 [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44519 00009642 [4596] dw CHCP_VALUES ;AN000; - 44520 00009644 00 db 0 ;AN000; no keywords - 44521 - 44522 CHCP_VALUES: - 44523 00009645 01 db 1 ;AN000; - 44524 00009646 01 db 1 ;AN000; 1 range - 44525 00009647 01 db 1 ;AN000; returned if result - 44526 00009648 64000000E7030000 dd CHCP_MINVAL,CHCP_MAXVAL ;AN000; minimum & maximum value - 44527 00009650 00 db 0 ;AN000; no numeric values - 44528 00009651 00 db 0 ;AN000; no string values - 44529 - 44530 ; PARSE BLOCK FOR DATE - 44531 - 44532 ; The following parse control block can be used for any command which - 44533 ; needs only an optional date string as an operand. Returns unverified - 44534 ; result in DATE_OUTPUT. Currently used for the DATE internal command. - 44535 - 44536 PARSE_DATE: - 44537 00009652 [5596] dw DATE_PARMS ;AN000; - 44538 00009654 00 db 0 ;AN000; no extra delimiter - 44539 DATE_PARMS: - 44540 00009655 0001 db 0,1 ;AN000; 1 positional parm - 44541 00009657 [5B96] dw DATE_CONTROL1 ;AN000; - 44542 00009659 00 db 0 ;AN000; no switches - 44543 0000965A 00 db 0 ;AN000; no keywords - 44544 - 44545 DATE_CONTROL1: - 44546 0000965B 0110 dw 1001h ;AN000; date - optional - 44547 0000965D 0000 dw 0 ;AN000; no function flags - 44548 0000965F [F3A5] dw DATE_OUTPUT ;AN000; result buffer - 44549 00009661 [E695] dw NO_VALUES ;AN000; - 44550 00009663 00 db 0 ;AN000; no keywords - 44551 - 44552 ; PARSE BLOCK FOR TIME - 44553 - 44554 ; The following parse control block can be used for any command which - 44555 ; needs only an optional time string as an operand. Returns unverified - 44556 ; result in TIME_OUTPUT. Currently used for the TIME internal command. - 44557 - 44558 PARSE_TIME: - 44559 00009664 [6796] dw TIME_PARMS ;AN000; - 44560 00009666 00 db 0 ;AN000; no extra delimiter - 44561 TIME_PARMS: - 44562 00009667 0001 db 0,1 ;AN000; 1 positional parm - 44563 00009669 [6D96] dw TIME_CONTROL1 ;AN000; - 44564 0000966B 00 db 0 ;AN000; no switches - 44565 0000966C 00 db 0 ;AN000; no keywords - 44566 - 44567 TIME_CONTROL1: - 44568 0000966D 0108 dw 0801h ;AN000; TIME - optional - 44569 0000966F 0000 dw 0 ;AN000; no function flags - 44570 00009671 [FBA5] dw TIME_OUTPUT ;AN000; result buffer - 44571 00009673 [E695] dw NO_VALUES ;AN000; - 44572 00009675 00 db 0 ;AN000; no keywords - 44573 - 44574 ; PARSE BLOCK FOR VOL - 44575 - 44576 ; The following parse control block can be used for any command which - 44577 ; needs only an optional drive letter as an operand. Returns unverified - 44578 ; drive number (one based) in DRIVE_OUTPUT. Currently used for the VOL - 44579 ; internal command. - 44580 - 44581 PARSE_VOL: - 44582 00009676 [7996] dw VOL_PARMS ;AN000; - 44583 00009678 00 db 0 ;AN000; no extra delimiter - 44584 VOL_PARMS: - 44585 00009679 0001 db 0,1 ;AN000; 1 positional parm - 44586 0000967B [7F96] dw DRIVE_CONTROL1 ;AN000; - 44587 0000967D 00 db 0 ;AN000; no switches - 44588 0000967E 00 db 0 ;AN000; no keywords - 44589 - 44590 DRIVE_CONTROL1: - 44591 0000967F 0101 dw 0101h ;AN000; DRIVE - optional - 44592 00009681 0100 dw 1 ;AN000; capitalize - file table - 44593 00009683 [03A6] dw DRIVE_OUTPUT ;AN000; result buffer - 44594 00009685 [E695] dw NO_VALUES ;AN000; - 44595 00009687 00 db 0 ;AN000; no keywords - 44596 - 44597 ; PARSE BLOCK FOR MKDIR, RMDIR, TYPE - 44598 - 44599 ; The following parse control block can be used for any command which - 44600 ; needs only one required file specification as an operand. Returns a - 44601 ; pointer to the unverified string in PARSE1_OUTPUT. Currently used - 44602 ; for the MKDIR, RMDIR, and TYPE internal commands. - 44603 - 44604 PARSE_MRDIR: - 44605 00009688 [8B96] dw MRDIR_PARMS ;AN000; - 44606 0000968A 00 db 0 ;AN000; no extra delimiter - 44607 MRDIR_PARMS: - 44608 0000968B 0101 db 1,1 ;AN000; 1 positional parm - 44609 0000968D [E995] dw FILE_REQUIRED ;AN000; - 44610 0000968F 00 db 0 ;AN000; no switches - 44611 00009690 00 db 0 ;AN000; no keywords - 44612 - 44613 ; PARSE BLOCK FOR CHDIR, TRUENAME - 44614 - 44615 ; The following parse control block can be used for any command which - 44616 ; needs only one optional file specification an operand. Returns a - 44617 ; pointer to the unverified string in PARSE1_OUTPUT. Currently used - 44618 ; for the CHDIR and TRUENAME internal commands. - 44619 - 44620 PARSE_CHDIR: - 44621 00009691 [9496] dw CHDIR_PARMS ;AN000; - 44622 00009693 00 db 0 ;AN000; no extra delimiter - 44623 CHDIR_PARMS: - 44624 00009694 0001 db 0,1 ;AN000; 1 positional parm - 44625 00009696 [F295] dw FILE_OPTIONAL ;AN000; - 44626 00009698 00 db 0 ;AN000; no switches - 44627 00009699 00 db 0 ;AN000; no keywords - 44628 - 44629 ; PARSE BLOCK FOR ERASE - 44630 - 44631 ; The following parse control block is used for the DEL/ERASE internal - 44632 ; commands. This command has one required file specification and an - 44633 ; optional switch (/p) as operands. The verified switch or unverified - 44634 ; file specification is returned in PARSE1_OUTPUT. - 44635 - 44636 PARSE_ERASE: - 44637 0000969A [9D96] dw ERASE_PARMS ;AN000; - 44638 0000969C 00 db 0 ;AN000; no extra delimiter - 44639 - 44640 ERASE_PARMS: - 44641 0000969D 0101 db 1,1 ;AN000; 1 positional parm - 44642 0000969F [E995] dw FILE_REQUIRED ;AN000; - 44643 000096A1 01 db 1 ;AN000; 1 switch - 44644 000096A2 [0496] dw SLASH_P_SWITCH ;AN000; - 44645 000096A4 00 db 0 ;AN000; no keywords - 44646 - 44647 ; PARSE BLOCK FOR DIR - 44648 - 44649 ; The following parse control block is used for the DIR internal command. - 44650 ; This command has one optional file specification and several optional - 44651 ; switches. Switches, switch values, and the filespec are returned in - 44652 ; PARSE1_OUTPUT. - 44653 ; - 44654 ; Switches are /a[value], /-a, /o[value], /-o, /s, /-s, /?, /b, /-b, - 44655 ; /w, /-w, /p, and /-p. The string values for /a and /o are optional, - 44656 ; do not require colons, and are not checked against a value list. - 44657 ; - 44658 ; Switch /h has been removed from the DIR command ;M008 - 44659 ; Switch /? is no longer handled internally ;M008 + 44506 CHCP_MINVAL EQU 100 ;AN000; + 44507 CHCP_MAXVAL EQU 999 ;AN000; + 44508 + 44509 PARSE_CHCP: + 44510 00009633 [3696] dw CHCP_PARMS ;AN000; + 44511 00009635 00 db 0 ;AN000; no extra delimiter + 44512 CHCP_PARMS: + 44513 00009636 0001 db 0,1 ;AN000; 1 positional parm + 44514 00009638 [3C96] dw CHCP_CONTROL1 ;AN000; + 44515 0000963A 00 db 0 ;AN000; no switches + 44516 0000963B 00 db 0 ;AN000; no keywords + 44517 + 44518 CHCP_CONTROL1: + 44519 0000963C 0180 dw 8001h ;AN000; numeric value - optional + 44520 0000963E 0000 dw 0 ;AN000; no function flags + 44521 00009640 [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44522 00009642 [4596] dw CHCP_VALUES ;AN000; + 44523 00009644 00 db 0 ;AN000; no keywords + 44524 + 44525 CHCP_VALUES: + 44526 00009645 01 db 1 ;AN000; + 44527 00009646 01 db 1 ;AN000; 1 range + 44528 00009647 01 db 1 ;AN000; returned if result + 44529 00009648 64000000E7030000 dd CHCP_MINVAL,CHCP_MAXVAL ;AN000; minimum & maximum value + 44530 00009650 00 db 0 ;AN000; no numeric values + 44531 00009651 00 db 0 ;AN000; no string values + 44532 + 44533 ; PARSE BLOCK FOR DATE + 44534 + 44535 ; The following parse control block can be used for any command which + 44536 ; needs only an optional date string as an operand. Returns unverified + 44537 ; result in DATE_OUTPUT. Currently used for the DATE internal command. + 44538 + 44539 PARSE_DATE: + 44540 00009652 [5596] dw DATE_PARMS ;AN000; + 44541 00009654 00 db 0 ;AN000; no extra delimiter + 44542 DATE_PARMS: + 44543 00009655 0001 db 0,1 ;AN000; 1 positional parm + 44544 00009657 [5B96] dw DATE_CONTROL1 ;AN000; + 44545 00009659 00 db 0 ;AN000; no switches + 44546 0000965A 00 db 0 ;AN000; no keywords + 44547 + 44548 DATE_CONTROL1: + 44549 0000965B 0110 dw 1001h ;AN000; date - optional + 44550 0000965D 0000 dw 0 ;AN000; no function flags + 44551 0000965F [F3A5] dw DATE_OUTPUT ;AN000; result buffer + 44552 00009661 [E695] dw NO_VALUES ;AN000; + 44553 00009663 00 db 0 ;AN000; no keywords + 44554 + 44555 ; PARSE BLOCK FOR TIME + 44556 + 44557 ; The following parse control block can be used for any command which + 44558 ; needs only an optional time string as an operand. Returns unverified + 44559 ; result in TIME_OUTPUT. Currently used for the TIME internal command. + 44560 + 44561 PARSE_TIME: + 44562 00009664 [6796] dw TIME_PARMS ;AN000; + 44563 00009666 00 db 0 ;AN000; no extra delimiter + 44564 TIME_PARMS: + 44565 00009667 0001 db 0,1 ;AN000; 1 positional parm + 44566 00009669 [6D96] dw TIME_CONTROL1 ;AN000; + 44567 0000966B 00 db 0 ;AN000; no switches + 44568 0000966C 00 db 0 ;AN000; no keywords + 44569 + 44570 TIME_CONTROL1: + 44571 0000966D 0108 dw 0801h ;AN000; TIME - optional + 44572 0000966F 0000 dw 0 ;AN000; no function flags + 44573 00009671 [FBA5] dw TIME_OUTPUT ;AN000; result buffer + 44574 00009673 [E695] dw NO_VALUES ;AN000; + 44575 00009675 00 db 0 ;AN000; no keywords + 44576 + 44577 ; PARSE BLOCK FOR VOL + 44578 + 44579 ; The following parse control block can be used for any command which + 44580 ; needs only an optional drive letter as an operand. Returns unverified + 44581 ; drive number (one based) in DRIVE_OUTPUT. Currently used for the VOL + 44582 ; internal command. + 44583 + 44584 PARSE_VOL: + 44585 00009676 [7996] dw VOL_PARMS ;AN000; + 44586 00009678 00 db 0 ;AN000; no extra delimiter + 44587 VOL_PARMS: + 44588 00009679 0001 db 0,1 ;AN000; 1 positional parm + 44589 0000967B [7F96] dw DRIVE_CONTROL1 ;AN000; + 44590 0000967D 00 db 0 ;AN000; no switches + 44591 0000967E 00 db 0 ;AN000; no keywords + 44592 + 44593 DRIVE_CONTROL1: + 44594 0000967F 0101 dw 0101h ;AN000; DRIVE - optional + 44595 00009681 0100 dw 1 ;AN000; capitalize - file table + 44596 00009683 [03A6] dw DRIVE_OUTPUT ;AN000; result buffer + 44597 00009685 [E695] dw NO_VALUES ;AN000; + 44598 00009687 00 db 0 ;AN000; no keywords + 44599 + 44600 ; PARSE BLOCK FOR MKDIR, RMDIR, TYPE + 44601 + 44602 ; The following parse control block can be used for any command which + 44603 ; needs only one required file specification as an operand. Returns a + 44604 ; pointer to the unverified string in PARSE1_OUTPUT. Currently used + 44605 ; for the MKDIR, RMDIR, and TYPE internal commands. + 44606 + 44607 PARSE_MRDIR: + 44608 00009688 [8B96] dw MRDIR_PARMS ;AN000; + 44609 0000968A 00 db 0 ;AN000; no extra delimiter + 44610 MRDIR_PARMS: + 44611 0000968B 0101 db 1,1 ;AN000; 1 positional parm + 44612 0000968D [E995] dw FILE_REQUIRED ;AN000; + 44613 0000968F 00 db 0 ;AN000; no switches + 44614 00009690 00 db 0 ;AN000; no keywords + 44615 + 44616 ; PARSE BLOCK FOR CHDIR, TRUENAME + 44617 + 44618 ; The following parse control block can be used for any command which + 44619 ; needs only one optional file specification an operand. Returns a + 44620 ; pointer to the unverified string in PARSE1_OUTPUT. Currently used + 44621 ; for the CHDIR and TRUENAME internal commands. + 44622 + 44623 PARSE_CHDIR: + 44624 00009691 [9496] dw CHDIR_PARMS ;AN000; + 44625 00009693 00 db 0 ;AN000; no extra delimiter + 44626 CHDIR_PARMS: + 44627 00009694 0001 db 0,1 ;AN000; 1 positional parm + 44628 00009696 [F295] dw FILE_OPTIONAL ;AN000; + 44629 00009698 00 db 0 ;AN000; no switches + 44630 00009699 00 db 0 ;AN000; no keywords + 44631 + 44632 ; PARSE BLOCK FOR ERASE + 44633 + 44634 ; The following parse control block is used for the DEL/ERASE internal + 44635 ; commands. This command has one required file specification and an + 44636 ; optional switch (/p) as operands. The verified switch or unverified + 44637 ; file specification is returned in PARSE1_OUTPUT. + 44638 + 44639 PARSE_ERASE: + 44640 0000969A [9D96] dw ERASE_PARMS ;AN000; + 44641 0000969C 00 db 0 ;AN000; no extra delimiter + 44642 + 44643 ERASE_PARMS: + 44644 0000969D 0101 db 1,1 ;AN000; 1 positional parm + 44645 0000969F [E995] dw FILE_REQUIRED ;AN000; + 44646 000096A1 01 db 1 ;AN000; 1 switch + 44647 000096A2 [0496] dw SLASH_P_SWITCH ;AN000; + 44648 000096A4 00 db 0 ;AN000; no keywords + 44649 + 44650 ; PARSE BLOCK FOR DIR + 44651 + 44652 ; The following parse control block is used for the DIR internal command. + 44653 ; This command has one optional file specification and several optional + 44654 ; switches. Switches, switch values, and the filespec are returned in + 44655 ; PARSE1_OUTPUT. + 44656 ; + 44657 ; Switches are /a[value], /-a, /o[value], /-o, /s, /-s, /?, /b, /-b, + 44658 ; /w, /-w, /p, and /-p. The string values for /a and /o are optional, + 44659 ; do not require colons, and are not checked against a value list. 44660 ; - 44661 ; A list of pointers to all the switch synonyms is provided here to - 44662 ; help identify which switch has been matched. - 44663 - 44664 ; 15/04/2023 - Retro DOS v4.0 COMMAND.COM - 44665 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8815h + 44661 ; Switch /h has been removed from the DIR command ;M008 + 44662 ; Switch /? is no longer handled internally ;M008 + 44663 ; + 44664 ; A list of pointers to all the switch synonyms is provided here to + 44665 ; help identify which switch has been matched. 44666 - 44667 PARSE_DIR: - 44668 000096A5 [A896] dw DIR_PARMS - 44669 000096A7 00 db 0 ; no extra delimiters - 44670 DIR_PARMS: - 44671 000096A8 0001 db 0,1 ; 1 optional positional param - 44672 000096AA [FB95] dw FILE_OPTIONAL2 - 44673 000096AC 02 db 2 ; 2 kinds of switches - 44674 000096AD [B296] dw DIR_SW_VALUED - 44675 000096AF [C196] dw DIR_SW_UNVALUED - 44676 000096B1 00 db 0 ; no keywords - 44677 - 44678 DIR_SW_VALUED: - 44679 000096B2 0120 dw 2001h ; optional string value - 44680 000096B4 2100 dw 21h ; optional colon; capitalize - 44681 000096B6 [EBA5] dw PARSE1_OUTPUT ; result buffer - 44682 000096B8 [E895] dw NULL_VALUE_LIST ; don't validate value - 44683 - 44684 ; 18/06/2023 - 44685 ;db 2 + 44667 ; 15/04/2023 - Retro DOS v4.0 COMMAND.COM + 44668 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8815h + 44669 + 44670 PARSE_DIR: + 44671 000096A5 [A896] dw DIR_PARMS + 44672 000096A7 00 db 0 ; no extra delimiters + 44673 DIR_PARMS: + 44674 000096A8 0001 db 0,1 ; 1 optional positional param + 44675 000096AA [FB95] dw FILE_OPTIONAL2 + 44676 000096AC 02 db 2 ; 2 kinds of switches + 44677 000096AD [B296] dw DIR_SW_VALUED + 44678 000096AF [C196] dw DIR_SW_UNVALUED + 44679 000096B1 00 db 0 ; no keywords + 44680 + 44681 DIR_SW_VALUED: + 44682 000096B2 0120 dw 2001h ; optional string value + 44683 000096B4 2100 dw 21h ; optional colon; capitalize + 44684 000096B6 [EBA5] dw PARSE1_OUTPUT ; result buffer + 44685 000096B8 [E895] dw NULL_VALUE_LIST ; don't validate value 44686 - 44687 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44688 ; PCDOS 7.1 COMMAND.COM - 44689 %if 0 - 44690 ; MSDOS 6.0 COMMAND.COM - 44691 ;ifdef DBLSPACE_HOOKS - 44692 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44693 db 3 ; 3 'synonyms' - 44694 ;else - 44695 %else - 44696 000096BA 02 db 2 ; 2 'synonyms' - 44697 ;endif - 44698 %endif - 44699 - 44700 DIR_SW_A: - 44701 000096BB 2F4100 db "/A",0 - 44702 DIR_SW_O: - 44703 000096BE 2F4F00 db "/O",0 - 44704 - 44705 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44706 ; PCDOS 7.1 COMMAND.COM - 44707 %if 0 - 44708 ; MSDOS 6.0 COMMAND.COM - 44709 ;ifdef DBLSPACE_HOOKS - 44710 ; 18/06/2023 - 44711 DIR_SW_C: - 44712 db "/C",0 - 44713 ;endif - 44714 %endif - 44715 - 44716 DIR_SW_UNVALUED: - 44717 000096C1 0000 dw 0 ; no value - 44718 000096C3 0000 dw 0 ; no format functions - 44719 000096C5 [EBA5] dw PARSE1_OUTPUT ; result buffer - 44720 000096C7 [E695] dw NO_VALUES - 44721 - 44722 ; 15/04/2023 - Retro DOS v4.0 COMMAND.COM - 44723 ;;db 12 - 44724 - 44725 ; 18/06/2023 - 44726 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8839h - 44727 ;db 14 ; 14 'synonyms' !? - 44728 - 44729 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44730 ; PCDOS 7.1 COMMAND.COM - 44731 %if 0 - 44732 ; MSDOS 6.0 COMMAND.COM - 44733 ;ifdef DBLSPACE_HOOKS - 44734 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44735 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9DB0h - 44736 db 13 ; 13 'synonyms' - 44737 ;else - 44738 ;db 12 ; 12 'synonyms' - 44739 %else - 44740 000096C9 10 db 16 ; 16 'synonyms' - 44741 ;endif - 44742 %endif - 44743 - 44744 DIR_SW_NEG_A: - 44745 000096CA 2F2D4100 db "/-A",0 - 44746 DIR_SW_NEG_O: - 44747 000096CE 2F2D4F00 db "/-O",0 - 44748 DIR_SW_S: - 44749 000096D2 2F5300 db "/S",0 - 44750 DIR_SW_NEG_S: - 44751 000096D5 2F2D5300 db "/-S",0 - 44752 DIR_SW_B: - 44753 000096D9 2F4200 db "/B",0 - 44754 DIR_SW_NEG_B: - 44755 000096DC 2F2D4200 db "/-B",0 - 44756 DIR_SW_W: - 44757 000096E0 2F5700 db "/W",0 - 44758 DIR_SW_NEG_W: - 44759 000096E3 2F2D5700 db "/-W",0 - 44760 DIR_SW_P: - 44761 000096E7 2F5000 db "/P",0 - 44762 DIR_SW_NEG_P: - 44763 000096EA 2F2D5000 db "/-P",0 - 44764 DIR_SW_L: - 44765 000096EE 2F4C00 db "/L",0 ;M010 - 44766 DIR_SW_NEG_L: - 44767 000096F1 2F2D4C00 db "/-L",0 ;M010 - 44768 - 44769 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44770 ; PCDOS 7.1 COMMAND.COM - 44771 %if 0 - 44772 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44773 ; MSDOS 6.0 COMMAND.COM (DBLSPACE_HOOKS) - 44774 DIR_SW_NEG_C: - 44775 db "/-C",0 - 44776 %else - 44777 DIR_SW_Z: - 44778 000096F5 2F5A00 db "/Z",0 - 44779 DIR_SW_NEG_Z: - 44780 000096F8 2F2D5A00 db "/-Z",0 - 44781 DIR_SW_4: - 44782 000096FC 2F3400 db "/4",0 - 44783 DIR_SW_NEG_4: - 44784 000096FF 2F2D3400 db "/-4",0 - 44785 %endif - 44786 - 44787 ; Here's a list of pointers to DIR's switch synonyms, for easier - 44788 ; identification. Order is critical - DIR routines rely on the - 44789 ; specific order in this list. Negated options appear at odd - 44790 ; positions in the list, and simple on/off options appear first. - 44791 - 44792 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44793 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9DE0h - 44794 Dir_Sw_Ptrs: ; list of ptrs to switch synonyms - 44795 - 44796 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44797 ; PCDOS 7.1 COMMAND.COM - 44798 %if 0 - 44799 ; 18/06/2023 - 44800 ; MSDOS 6.0 COMMAND.COM ; * - 44801 dw DIR_SW_NEG_C ; * - 44802 Dir_Sw_Ptrs_2: - 44803 dw DIR_SW_C ; * - 44804 ; MSDOS 5.0 COMMAND.COM - 44805 %endif - 44806 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44807 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9BD1h - 44808 Dir_Sw_Ptrs: - 44809 00009703 [E396] dw DIR_SW_NEG_W - 44810 Dir_Sw_Ptrs_2: - 44811 00009705 [E096] dw DIR_SW_W - 44812 00009707 [EA96] dw DIR_SW_NEG_P - 44813 00009709 [E796] dw DIR_SW_P - 44814 0000970B [D596] dw DIR_SW_NEG_S - 44815 0000970D [D296] dw DIR_SW_S - 44816 0000970F [DC96] dw DIR_SW_NEG_B - 44817 00009711 [D996] dw DIR_SW_B - 44818 00009713 [F196] dw DIR_SW_NEG_L ;M010 - 44819 00009715 [EE96] dw DIR_SW_L ;M010 - 44820 - 44821 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 44822 ; PCDOS 7.1 COMMAND.COM - 44823 %if 1 - 44824 00009717 [F896] dw DIR_SW_NEG_Z - 44825 00009719 [F596] dw DIR_SW_Z - 44826 0000971B [FF96] dw DIR_SW_NEG_4 - 44827 0000971D [FC96] dw DIR_SW_4 - 44828 %endif - 44829 0000971F [CE96] dw DIR_SW_NEG_O - 44830 00009721 [BE96] dw DIR_SW_O - 44831 00009723 [CA96] dw DIR_SW_NEG_A - 44832 00009725 [BB96] dw DIR_SW_A - 44833 - 44834 ; PARSE BLOCK FOR RENAME - 44835 - 44836 ; The following parse control block can be used for any command which - 44837 ; needs only two required file specifications as operands. Returns - 44838 ; pointers to the unverified string in PARSE1_OUTPUT. - 44839 ; Currently used for the RENAME internal command. - 44840 - 44841 PARSE_RENAME: - 44842 00009727 [2A97] dw RENAME_PARMS ;AN000; - 44843 00009729 00 db 0 ;AN000; no extra delimiter - 44844 RENAME_PARMS: - 44845 0000972A 0202 db 2,2 ;AN000; 2 positional parms - 44846 0000972C [E995] dw FILE_REQUIRED ;AN000; - 44847 0000972E [E995] dw FILE_REQUIRED ;AN000; - 44848 00009730 00 db 0 ;AN000; no switches - 44849 00009731 00 db 0 ;AN000; no keywords - 44850 - 44851 ; PARSE BLOCK FOR CTTY - 44852 - 44853 ; The following parse control block can be used for any command which - 44854 ; needs one required device name as an operand. Returns a pointer to - 44855 ; unverified string in PARSE1_OUTPUT. Currently used for the CTTY - 44856 ; internal command. - 44857 - 44858 PARSE_CTTY: - 44859 00009732 [3597] dw CTTY_PARMS ;AN000; - 44860 00009734 00 db 0 ;AN000; no extra delimiter - 44861 CTTY_PARMS: - 44862 00009735 0101 db 1,1 ;AN000; 1 positional parm - 44863 00009737 [3B97] dw CTTY_CONTROL1 ;AN000; - 44864 00009739 00 db 0 ;AN000; no switches - 44865 0000973A 00 db 0 ;AN000; no keywords - 44866 CTTY_CONTROL1: - 44867 0000973B 0020 dw 2000h ;AN000; string value - required - 44868 0000973D 1100 dw 11h ;AN000; capitalize - file table - 44869 ;AN000; remove colon at end - 44870 0000973F [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer - 44871 00009741 [E695] dw NO_VALUES ;AN000; - 44872 00009743 00 db 0 ;AN000; no keywords - 44873 - 44874 ; PARSE BLOCK FOR VER - 44875 - 44876 ; The following parse control block can be used for any command which - 44877 ; needs an optional switch "/debug". Currently used for the VER command. + 44687 ; 18/06/2023 + 44688 ;db 2 + 44689 + 44690 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44691 ; PCDOS 7.1 COMMAND.COM + 44692 %if 0 + 44693 ; MSDOS 6.0 COMMAND.COM + 44694 ;ifdef DBLSPACE_HOOKS + 44695 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 44696 db 3 ; 3 'synonyms' + 44697 ;else + 44698 %else + 44699 000096BA 02 db 2 ; 2 'synonyms' + 44700 ;endif + 44701 %endif + 44702 + 44703 DIR_SW_A: + 44704 000096BB 2F4100 db "/A",0 + 44705 DIR_SW_O: + 44706 000096BE 2F4F00 db "/O",0 + 44707 + 44708 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44709 ; PCDOS 7.1 COMMAND.COM + 44710 %if 0 + 44711 ; MSDOS 6.0 COMMAND.COM + 44712 ;ifdef DBLSPACE_HOOKS + 44713 ; 18/06/2023 + 44714 DIR_SW_C: + 44715 db "/C",0 + 44716 ;endif + 44717 %endif + 44718 + 44719 DIR_SW_UNVALUED: + 44720 000096C1 0000 dw 0 ; no value + 44721 000096C3 0000 dw 0 ; no format functions + 44722 000096C5 [EBA5] dw PARSE1_OUTPUT ; result buffer + 44723 000096C7 [E695] dw NO_VALUES + 44724 + 44725 ; 15/04/2023 - Retro DOS v4.0 COMMAND.COM + 44726 ;;db 12 + 44727 + 44728 ; 18/06/2023 + 44729 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8839h + 44730 ;db 14 ; 14 'synonyms' !? + 44731 + 44732 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44733 ; PCDOS 7.1 COMMAND.COM + 44734 %if 0 + 44735 ; MSDOS 6.0 COMMAND.COM + 44736 ;ifdef DBLSPACE_HOOKS + 44737 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 44738 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9DB0h + 44739 db 13 ; 13 'synonyms' + 44740 ;else + 44741 ;db 12 ; 12 'synonyms' + 44742 %else + 44743 000096C9 10 db 16 ; 16 'synonyms' + 44744 ;endif + 44745 %endif + 44746 + 44747 DIR_SW_NEG_A: + 44748 000096CA 2F2D4100 db "/-A",0 + 44749 DIR_SW_NEG_O: + 44750 000096CE 2F2D4F00 db "/-O",0 + 44751 DIR_SW_S: + 44752 000096D2 2F5300 db "/S",0 + 44753 DIR_SW_NEG_S: + 44754 000096D5 2F2D5300 db "/-S",0 + 44755 DIR_SW_B: + 44756 000096D9 2F4200 db "/B",0 + 44757 DIR_SW_NEG_B: + 44758 000096DC 2F2D4200 db "/-B",0 + 44759 DIR_SW_W: + 44760 000096E0 2F5700 db "/W",0 + 44761 DIR_SW_NEG_W: + 44762 000096E3 2F2D5700 db "/-W",0 + 44763 DIR_SW_P: + 44764 000096E7 2F5000 db "/P",0 + 44765 DIR_SW_NEG_P: + 44766 000096EA 2F2D5000 db "/-P",0 + 44767 DIR_SW_L: + 44768 000096EE 2F4C00 db "/L",0 ;M010 + 44769 DIR_SW_NEG_L: + 44770 000096F1 2F2D4C00 db "/-L",0 ;M010 + 44771 + 44772 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44773 ; PCDOS 7.1 COMMAND.COM + 44774 %if 0 + 44775 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 44776 ; MSDOS 6.0 COMMAND.COM (DBLSPACE_HOOKS) + 44777 DIR_SW_NEG_C: + 44778 db "/-C",0 + 44779 %else + 44780 DIR_SW_Z: + 44781 000096F5 2F5A00 db "/Z",0 + 44782 DIR_SW_NEG_Z: + 44783 000096F8 2F2D5A00 db "/-Z",0 + 44784 DIR_SW_4: + 44785 000096FC 2F3400 db "/4",0 + 44786 DIR_SW_NEG_4: + 44787 000096FF 2F2D3400 db "/-4",0 + 44788 %endif + 44789 + 44790 ; Here's a list of pointers to DIR's switch synonyms, for easier + 44791 ; identification. Order is critical - DIR routines rely on the + 44792 ; specific order in this list. Negated options appear at odd + 44793 ; positions in the list, and simple on/off options appear first. + 44794 + 44795 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 44796 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9DE0h + 44797 Dir_Sw_Ptrs: ; list of ptrs to switch synonyms + 44798 + 44799 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44800 ; PCDOS 7.1 COMMAND.COM + 44801 %if 0 + 44802 ; 18/06/2023 + 44803 ; MSDOS 6.0 COMMAND.COM ; * + 44804 dw DIR_SW_NEG_C ; * + 44805 Dir_Sw_Ptrs_2: + 44806 dw DIR_SW_C ; * + 44807 ; MSDOS 5.0 COMMAND.COM + 44808 %endif + 44809 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44810 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9BD1h + 44811 Dir_Sw_Ptrs: + 44812 00009703 [E396] dw DIR_SW_NEG_W + 44813 Dir_Sw_Ptrs_2: + 44814 00009705 [E096] dw DIR_SW_W + 44815 00009707 [EA96] dw DIR_SW_NEG_P + 44816 00009709 [E796] dw DIR_SW_P + 44817 0000970B [D596] dw DIR_SW_NEG_S + 44818 0000970D [D296] dw DIR_SW_S + 44819 0000970F [DC96] dw DIR_SW_NEG_B + 44820 00009711 [D996] dw DIR_SW_B + 44821 00009713 [F196] dw DIR_SW_NEG_L ;M010 + 44822 00009715 [EE96] dw DIR_SW_L ;M010 + 44823 + 44824 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 44825 ; PCDOS 7.1 COMMAND.COM + 44826 %if 1 + 44827 00009717 [F896] dw DIR_SW_NEG_Z + 44828 00009719 [F596] dw DIR_SW_Z + 44829 0000971B [FF96] dw DIR_SW_NEG_4 + 44830 0000971D [FC96] dw DIR_SW_4 + 44831 %endif + 44832 0000971F [CE96] dw DIR_SW_NEG_O + 44833 00009721 [BE96] dw DIR_SW_O + 44834 00009723 [CA96] dw DIR_SW_NEG_A + 44835 00009725 [BB96] dw DIR_SW_A + 44836 + 44837 ; PARSE BLOCK FOR RENAME + 44838 + 44839 ; The following parse control block can be used for any command which + 44840 ; needs only two required file specifications as operands. Returns + 44841 ; pointers to the unverified string in PARSE1_OUTPUT. + 44842 ; Currently used for the RENAME internal command. + 44843 + 44844 PARSE_RENAME: + 44845 00009727 [2A97] dw RENAME_PARMS ;AN000; + 44846 00009729 00 db 0 ;AN000; no extra delimiter + 44847 RENAME_PARMS: + 44848 0000972A 0202 db 2,2 ;AN000; 2 positional parms + 44849 0000972C [E995] dw FILE_REQUIRED ;AN000; + 44850 0000972E [E995] dw FILE_REQUIRED ;AN000; + 44851 00009730 00 db 0 ;AN000; no switches + 44852 00009731 00 db 0 ;AN000; no keywords + 44853 + 44854 ; PARSE BLOCK FOR CTTY + 44855 + 44856 ; The following parse control block can be used for any command which + 44857 ; needs one required device name as an operand. Returns a pointer to + 44858 ; unverified string in PARSE1_OUTPUT. Currently used for the CTTY + 44859 ; internal command. + 44860 + 44861 PARSE_CTTY: + 44862 00009732 [3597] dw CTTY_PARMS ;AN000; + 44863 00009734 00 db 0 ;AN000; no extra delimiter + 44864 CTTY_PARMS: + 44865 00009735 0101 db 1,1 ;AN000; 1 positional parm + 44866 00009737 [3B97] dw CTTY_CONTROL1 ;AN000; + 44867 00009739 00 db 0 ;AN000; no switches + 44868 0000973A 00 db 0 ;AN000; no keywords + 44869 CTTY_CONTROL1: + 44870 0000973B 0020 dw 2000h ;AN000; string value - required + 44871 0000973D 1100 dw 11h ;AN000; capitalize - file table + 44872 ;AN000; remove colon at end + 44873 0000973F [EBA5] dw PARSE1_OUTPUT ;AN000; result buffer + 44874 00009741 [E695] dw NO_VALUES ;AN000; + 44875 00009743 00 db 0 ;AN000; no keywords + 44876 + 44877 ; PARSE BLOCK FOR VER 44878 - 44879 PARSE_VER: - 44880 00009744 [4797] dw VER_PARMS - 44881 00009746 00 db 0 ; no extra delimiters - 44882 VER_PARMS: - 44883 00009747 0000 db 0,0 ; no positional parameters - 44884 ; 20/07/2024 - Retro DOS v5 COMMAND.COM - 44885 %if 0 ; PCDOS 7.1 (& MSDOS 5.0-6.22) COMMAND.COM - 44886 db 1 ; one switch - 44887 dw SLASH_R - 44888 %else - 44889 ; 20/07/2024 - Retro DOS v4-v5 COMMAND.COM - 44890 00009749 02 db 2 - 44891 0000974A [4F97] dw SLASH_R - 44892 0000974C [5B97] dw SLASH_T ; Retro DOS v4-v5 COMMAND.COM switch - 44893 %endif - 44894 0000974E 00 db 0 ; no keywords - 44895 SLASH_R: - 44896 0000974F 0000 dw 0 ; no values - 44897 00009751 0200 dw 2 ; capitalize by filename table - 44898 00009753 [EBA5] dw PARSE1_OUTPUT ; result buffer - 44899 00009755 [E695] dw NO_VALUES ; no values - 44900 00009757 01 db 1 ; one synonym - 44901 SLASH_R_SYN: - 44902 00009758 2F5200 db "/R",0 - 44903 - 44904 ; 20/07/2024 - Retro DOS v5 COMMAND.COM - 44905 %if 1 - 44906 SLASH_T: - 44907 0000975B 0000 dw 0 ; no values - 44908 0000975D 0200 dw 2 ; capitalize by filename table - 44909 0000975F [EBA5] dw PARSE1_OUTPUT ; result buffer - 44910 00009761 [E695] dw NO_VALUES ; no values - 44911 00009763 01 db 1 ; one synonym - 44912 SLASH_T_SYN: - 44913 00009764 2F5400 db "/T",0 - 44914 %endif - 44915 - 44916 ; M003 ; Start of changes for LoadHigh support - 44917 - 44918 ;Parse Control Block for LOADHIGH command - 44919 - 44920 Parse_LoadHi: - 44921 00009767 [6A97] dw LoadHi_Parms ;extended parm table - 44922 00009769 00 db 0 ;no extra delimiters - 44923 - 44924 LoadHi_Parms: - 44925 0000976A 0101 db 1,1 ;min. 1 parm, max. 1 parm - 44926 0000976C [E995] dw FILE_REQUIRED ;control struc for filename - 44927 0000976E 00 db 0 ;no switches - 44928 0000976F 00 db 0 ;no keywords - 44929 - 44930 ; M003 ; End of changes for LoadHigh support - 44931 - 44932 TempVarName: - 44933 00009770 54454D503D00 db "TEMP=",0 + 44879 ; The following parse control block can be used for any command which + 44880 ; needs an optional switch "/debug". Currently used for the VER command. + 44881 + 44882 PARSE_VER: + 44883 00009744 [4797] dw VER_PARMS + 44884 00009746 00 db 0 ; no extra delimiters + 44885 VER_PARMS: + 44886 00009747 0000 db 0,0 ; no positional parameters + 44887 ; 20/07/2024 - Retro DOS v5 COMMAND.COM + 44888 %if 0 ; PCDOS 7.1 (& MSDOS 5.0-6.22) COMMAND.COM + 44889 db 1 ; one switch + 44890 dw SLASH_R + 44891 %else + 44892 ; 20/07/2024 - Retro DOS v4-v5 COMMAND.COM + 44893 00009749 02 db 2 + 44894 0000974A [4F97] dw SLASH_R + 44895 0000974C [5B97] dw SLASH_T ; Retro DOS v4-v5 COMMAND.COM switch + 44896 %endif + 44897 0000974E 00 db 0 ; no keywords + 44898 SLASH_R: + 44899 0000974F 0000 dw 0 ; no values + 44900 00009751 0200 dw 2 ; capitalize by filename table + 44901 00009753 [EBA5] dw PARSE1_OUTPUT ; result buffer + 44902 00009755 [E695] dw NO_VALUES ; no values + 44903 00009757 01 db 1 ; one synonym + 44904 SLASH_R_SYN: + 44905 00009758 2F5200 db "/R",0 + 44906 + 44907 ; 20/07/2024 - Retro DOS v5 COMMAND.COM + 44908 %if 1 + 44909 SLASH_T: + 44910 0000975B 0000 dw 0 ; no values + 44911 0000975D 0200 dw 2 ; capitalize by filename table + 44912 0000975F [EBA5] dw PARSE1_OUTPUT ; result buffer + 44913 00009761 [E695] dw NO_VALUES ; no values + 44914 00009763 01 db 1 ; one synonym + 44915 SLASH_T_SYN: + 44916 00009764 2F5400 db "/T",0 + 44917 %endif + 44918 + 44919 ; M003 ; Start of changes for LoadHigh support + 44920 + 44921 ;Parse Control Block for LOADHIGH command + 44922 + 44923 Parse_LoadHi: + 44924 00009767 [6A97] dw LoadHi_Parms ;extended parm table + 44925 00009769 00 db 0 ;no extra delimiters + 44926 + 44927 LoadHi_Parms: + 44928 0000976A 0101 db 1,1 ;min. 1 parm, max. 1 parm + 44929 0000976C [E995] dw FILE_REQUIRED ;control struc for filename + 44930 0000976E 00 db 0 ;no switches + 44931 0000976F 00 db 0 ;no keywords + 44932 + 44933 ; M003 ; End of changes for LoadHigh support 44934 - 44935 ; 16/04/2023 - Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM - 44936 ;TRANDATAEND: ; TRANGROUP:88C2h + 44935 TempVarName: + 44936 00009770 54454D503D00 db "TEMP=",0 44937 - 44938 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 44939 copycmd: - 44940 00009776 434F5059434D443D db 'COPYCMD=' - 44941 - 44942 ; 06/08/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM - 44943 %if 0 - 44944 sCVFRoot: - 44945 db '\DBLSPACE.' - 44946 %else - 44947 ; 06/08/2024 - 44948 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9C3Eh - 44949 REXX_EXE: - 44950 0000977E 524558582E45584500 db 'REXX.EXE',0 - 44951 %endif - 44952 - 44953 ; ---------------------------------------------------------------------------- - 44954 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM - 44955 %if 1 - 44956 00009787 0D0A RD5CMD_VER_MSG: db 0Dh, 0Ah - 44957 00009789 526574726F20444F53- db 'Retro DOS v5 COMMAND.COM' - 44957 00009792 20763520434F4D4D41- - 44957 0000979B 4E442E434F4D - 44958 000097A1 0D0A db 0Dh, 0Ah - 44959 000097A3 32303234202D204572- db '2024 - Erdogan Tan' - 44959 000097AC 646F67616E2054616E - 44960 000097B5 0D0A db 0Dh,0Ah - 44961 000097B7 24 db '$' - 44962 %endif - 44963 ; ---------------------------------------------------------------------------- - 44964 - 44965 ; 18/06/2023 - 44966 ; MSDOS 6.22 COMMAND.COM - 44967 TRANDATAEND: ; TRANGROUP:9E53h - 44968 - 44969 ;============================================================================ - 44970 ; PSDATA.INC, MSDOS 6.0, 1991 - 44971 ;============================================================================ - 44972 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 44973 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 44974 - 44975 ; 18/04/2023 - 44976 TRANSPACESTART: + 44938 ; 16/04/2023 - Retro DOS v4.0 (MSDOS 5.0) COMMAND.COM + 44939 ;TRANDATAEND: ; TRANGROUP:88C2h + 44940 + 44941 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 44942 copycmd: + 44943 00009776 434F5059434D443D db 'COPYCMD=' + 44944 + 44945 ; 06/08/2024 - Retro DOS v5.0 - PCDOS 7.1 COMMAND.COM + 44946 %if 0 + 44947 sCVFRoot: + 44948 db '\DBLSPACE.' + 44949 %else + 44950 ; 06/08/2024 + 44951 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9C3Eh + 44952 REXX_EXE: + 44953 0000977E 524558582E45584500 db 'REXX.EXE',0 + 44954 %endif + 44955 + 44956 ; ---------------------------------------------------------------------------- + 44957 ; 20/07/2024 - Retro DOS v5.0 COMMAND.COM + 44958 %if 1 + 44959 00009787 0D0A RD5CMD_VER_MSG: db 0Dh, 0Ah + 44960 00009789 526574726F20444F53- db 'Retro DOS v5 COMMAND.COM' + 44960 00009792 20763520434F4D4D41- + 44960 0000979B 4E442E434F4D + 44961 000097A1 0D0A db 0Dh, 0Ah + 44962 000097A3 32303234202D204572- db '2024 - Erdogan Tan' + 44962 000097AC 646F67616E2054616E + 44963 000097B5 0D0A db 0Dh,0Ah + 44964 000097B7 24 db '$' + 44965 %endif + 44966 ; ---------------------------------------------------------------------------- + 44967 + 44968 ; 18/06/2023 + 44969 ; MSDOS 6.22 COMMAND.COM + 44970 TRANDATAEND: ; TRANGROUP:9E53h + 44971 + 44972 ;============================================================================ + 44973 ; PSDATA.INC, MSDOS 6.0, 1991 + 44974 ;============================================================================ + 44975 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 44976 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM 44977 - 44978 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:88C2h - 44979 - 44980 ; 18/06/2023 - 44981 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9E53h - 44982 - 44983 ;********************** Local Data ************************************* - 44984 - 44985 $P_ORDINAL: - 44986 000097B8 0000 dw 0 ;AN000; Operand ordinal save area - 44987 $P_RC: - 44988 000097BA 0000 dw 0 ;AN000; Return code from parser - 44989 $P_SI_Save: - 44990 000097BC 0000 dw 0 ;AN000; Pointer of command buffer - 44991 $P_DX: - 44992 000097BE 0000 dw 0 ;AN000; Return result buffer address - 44993 $P_Terminator: - 44994 000097C0 00 db 0 ;AN000; Terminator code (ASCII) - 44995 $P_DBCSEV_OFF: - 44996 000097C1 0000 dw 0 ;AN000; Offset of DBCS EV - 44997 $P_DBCSEV_SEG: - 44998 000097C3 0000 dw 0 ;AN000; Segment of DBCS EV - 44999 $P_Flags: ;AN000; Parser internal flags - 45000 $P_Flags1: - 45001 000097C5 00 db 0 ;AN038; to reference first byte flags - 45002 $P_Flags2: - 45003 000097C6 00 db 0 ;AN038; to reference second byte flags only - 45004 $P_SaveSI_Cmpx: - 45005 000097C7 0000 dw 0 ;AN000; save si for later use by complex - 45006 $P_KEYorSW_Ptr: - 45007 000097C9 0000 dw 0 ;AN000; points next to "=" or ":" code - 45008 $P_Save_EOB: - 45009 000097CB 0000 dw 0 ;AN000; save pointer to EOB - 45010 $P_Found_SYNONYM: - 45011 000097CD 0000 dw 0 ;AN000; es:@ points to found synonym - 45012 $P_STRING_BUF: - 45013 000097CF 00 times 128 db 0 ;AN000; Pick a operand from command line - 45014 $P_ORIG_ORD: - 45015 0000984F 0000 dw 0 ;AN039; ORIGINAL ORDINAL FROM CX - 45016 $P_ORIG_STACK: - 45017 00009851 0000 dw 0 ;AN039; ORIGINAL VALUE OF STACK FROM SP - 45018 $P_ORIG_SI: - 45019 00009853 0000 dw 0 ;AN039; ORIGINAL START PARSE POINTER FROM SI - 45020 $P_Got_Time: - 45021 00009855 00 db 0 ;AN023; if 1, use Time delimiters - 45022 $P_Country_Info: - 45023 00009856 FFFF dw -1 ; 0FFFFh - 45024 00009858 00 times 32 db 0 - 45025 $P_1st_Val: - 45026 00009878 0000 dw 0 ;AN000; used when process date or time - 45027 $P_2nd_Val: - 45028 0000987A 0000 dw 0 ;AN000; used when process date or time - 45029 $P_3rd_Val: - 45030 0000987C 0000 dw 0 ;AN000; used when process date or time - 45031 $P_4th_Val: - 45032 0000987E 0000 dw 0 ;AN000; used when process date or time - 45033 $P_Char_CAP_Ptr: - 45034 00009880 FF db 0FFh ;AN000; info id - 45035 00009881 0000 dw 0 ;AN000; offset of char case map table - 45036 00009883 0000 dw 0 ;AN000; segment of char case map table - 45037 $P_File_CAP_Ptr: - 45038 00009885 FF db 0FFh ;AN000; info id - 45039 00009886 0000 dw 0 ;AN000; offset of file case map table - 45040 00009888 0000 dw 0 ;AN000; segment of file case map table - 45041 - 45042 ; 18/04/2023 - 45043 ;M029 - 45044 ;!!!WARNING!!! - 45045 ; In routine SYSPARSE (parse.asm), $P_FileSp_Char is reinitialized using - 45046 ;hardcoded strings. If the chars in the string are changed here, corresponding - 45047 ;changes need to be made in SYSPARSE - 45048 - 45049 $P_FileSp_Char: - 45050 0000988A 5B5D7C3C3E2B3D3B22 db '[]|<>+=;"' ;AN000; delimitter of file spec - 45051 $P_FileSp_Len equ $-$P_FileSp_Char ;AN000; - 45052 - 45053 ;filespec error flag - 45054 $P_err_flag: - 45055 00009893 00 db 0 ;AN033; flag set if filespec parsing error - 45056 ;AN033; was detected. - 45057 - 45058 ;============================================================================ - 45059 ; MSGSERV.ASM, MSDOS 6.0, 1991 - 45060 ;============================================================================ - 45061 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 45062 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45063 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 45064 - 45065 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:899Eh - 45066 - 45067 ; 18/06/2023 - 45068 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9F2Fh + 44978 ; 18/04/2023 + 44979 TRANSPACESTART: + 44980 + 44981 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:88C2h + 44982 + 44983 ; 18/06/2023 + 44984 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9E53h + 44985 + 44986 ;********************** Local Data ************************************* + 44987 + 44988 $P_ORDINAL: + 44989 000097B8 0000 dw 0 ;AN000; Operand ordinal save area + 44990 $P_RC: + 44991 000097BA 0000 dw 0 ;AN000; Return code from parser + 44992 $P_SI_Save: + 44993 000097BC 0000 dw 0 ;AN000; Pointer of command buffer + 44994 $P_DX: + 44995 000097BE 0000 dw 0 ;AN000; Return result buffer address + 44996 $P_Terminator: + 44997 000097C0 00 db 0 ;AN000; Terminator code (ASCII) + 44998 $P_DBCSEV_OFF: + 44999 000097C1 0000 dw 0 ;AN000; Offset of DBCS EV + 45000 $P_DBCSEV_SEG: + 45001 000097C3 0000 dw 0 ;AN000; Segment of DBCS EV + 45002 $P_Flags: ;AN000; Parser internal flags + 45003 $P_Flags1: + 45004 000097C5 00 db 0 ;AN038; to reference first byte flags + 45005 $P_Flags2: + 45006 000097C6 00 db 0 ;AN038; to reference second byte flags only + 45007 $P_SaveSI_Cmpx: + 45008 000097C7 0000 dw 0 ;AN000; save si for later use by complex + 45009 $P_KEYorSW_Ptr: + 45010 000097C9 0000 dw 0 ;AN000; points next to "=" or ":" code + 45011 $P_Save_EOB: + 45012 000097CB 0000 dw 0 ;AN000; save pointer to EOB + 45013 $P_Found_SYNONYM: + 45014 000097CD 0000 dw 0 ;AN000; es:@ points to found synonym + 45015 $P_STRING_BUF: + 45016 000097CF 00 times 128 db 0 ;AN000; Pick a operand from command line + 45017 $P_ORIG_ORD: + 45018 0000984F 0000 dw 0 ;AN039; ORIGINAL ORDINAL FROM CX + 45019 $P_ORIG_STACK: + 45020 00009851 0000 dw 0 ;AN039; ORIGINAL VALUE OF STACK FROM SP + 45021 $P_ORIG_SI: + 45022 00009853 0000 dw 0 ;AN039; ORIGINAL START PARSE POINTER FROM SI + 45023 $P_Got_Time: + 45024 00009855 00 db 0 ;AN023; if 1, use Time delimiters + 45025 $P_Country_Info: + 45026 00009856 FFFF dw -1 ; 0FFFFh + 45027 00009858 00 times 32 db 0 + 45028 $P_1st_Val: + 45029 00009878 0000 dw 0 ;AN000; used when process date or time + 45030 $P_2nd_Val: + 45031 0000987A 0000 dw 0 ;AN000; used when process date or time + 45032 $P_3rd_Val: + 45033 0000987C 0000 dw 0 ;AN000; used when process date or time + 45034 $P_4th_Val: + 45035 0000987E 0000 dw 0 ;AN000; used when process date or time + 45036 $P_Char_CAP_Ptr: + 45037 00009880 FF db 0FFh ;AN000; info id + 45038 00009881 0000 dw 0 ;AN000; offset of char case map table + 45039 00009883 0000 dw 0 ;AN000; segment of char case map table + 45040 $P_File_CAP_Ptr: + 45041 00009885 FF db 0FFh ;AN000; info id + 45042 00009886 0000 dw 0 ;AN000; offset of file case map table + 45043 00009888 0000 dw 0 ;AN000; segment of file case map table + 45044 + 45045 ; 18/04/2023 + 45046 ;M029 + 45047 ;!!!WARNING!!! + 45048 ; In routine SYSPARSE (parse.asm), $P_FileSp_Char is reinitialized using + 45049 ;hardcoded strings. If the chars in the string are changed here, corresponding + 45050 ;changes need to be made in SYSPARSE + 45051 + 45052 $P_FileSp_Char: + 45053 0000988A 5B5D7C3C3E2B3D3B22 db '[]|<>+=;"' ;AN000; delimitter of file spec + 45054 $P_FileSp_Len equ $-$P_FileSp_Char ;AN000; + 45055 + 45056 ;filespec error flag + 45057 $P_err_flag: + 45058 00009893 00 db 0 ;AN033; flag set if filespec parsing error + 45059 ;AN033; was detected. + 45060 + 45061 ;============================================================================ + 45062 ; MSGSERV.ASM, MSDOS 6.0, 1991 + 45063 ;============================================================================ + 45064 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 45065 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45066 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 45067 + 45068 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:899Eh 45069 - 45070 ; 13/08/2024 - 45071 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9D23h + 45070 ; 18/06/2023 + 45071 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9F2Fh 45072 - 45073 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 45074 ;; - 45075 ;; STRUCTURE: $M_RES_ADDRS - 45076 ;; - 45077 ;; Resident data area definition of variables - 45078 ;; - 45079 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - 45080 - 45081 $M_RT: - 45082 00009894 00 times $M_RES_ADDRS_SZ db 0 ; times 141 db 0 ; 13/08/2024 + 45073 ; 13/08/2024 + 45074 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:9D23h + 45075 + 45076 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + 45077 ;; + 45078 ;; STRUCTURE: $M_RES_ADDRS + 45079 ;; + 45080 ;; Resident data area definition of variables + 45081 ;; + 45082 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 45083 - 45084 ;============================================================================ - 45085 ; COPYRIGHT.INC, MSDOS 6.0, 1993 - 45086 ;============================================================================ - 45087 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 45088 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45089 - 45090 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8A2Bh - 45091 ; --------------------------------------------------------------------------- - 45092 ;;M00 - changed to DOS 5.0 copyright - MD 9 Jul 90 - 45093 ;;M031 - changed copyright to 1991 - 45094 ;;9/16 - changed version to 6.0 and copyright to 1992 - 45095 ;;9/21 - Added international translations, language passed through COUNTRY macro - 45096 ;;B49,50 - changed version to 6 and copyright to 1993 - 45097 ; --------------------------------------------------------------------------- - 45098 - 45099 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 45100 ; PCDOS 7.1 COMMAND.COM - 45101 %if 0 - 45102 ; 18/06/2023 - 45103 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9FBCh - 45104 ;ifdef USA - 45105 MsDosVer6_CCopy: - 45106 ; MSDOS 6.0 - 45107 ;db "MS DOS Version 6 (C)Copyright 1981-1993 Microsoft Corp " - 45108 ; 18/06/2023 - 45109 ; MSDOS 6.22 - 45110 db "MS DOS Version 6 (C)Copyright 1981-1994 Microsoft Corp " - 45111 db "Licensed Material - Property of Microsoft " - 45112 db "All rights reserved " - 45113 ;endif - 45114 %endif - 45115 - 45116 ; --------------------------------------------------------------------------- - 45117 ; 18/06/2023 - 45118 ; 15/04/2023 - 45119 ;MsDosVer5_CCopy: - 45120 ;db "MS DOS Version 5.00 (C)Copyright 1981-1991 Microsoft Corp " - 45121 ;db "Licensed Material - Property of Microsoft " - 45122 ;db "All rights reserved " - 45123 ; --------------------------------------------------------------------------- - 45124 ; 15/04/2023 - 45125 ; 16/04/2023 - 21/04/2023 - 45126 ;db 0 - 45127 ;db 0Dh,0Ah - 45128 ;db 'Retro DOS v4.0 (& v4.1) COMMAND.COM ' - 45129 ;db 0 - 45130 ;db 'by Erdogan Tan - 05/05/2023' - 45131 ;db 0 - 45132 - 45133 ; 19/06/2023 - 45134 ; 18/06/2023 - 45135 ;db 0 - 45136 ;db 0Dh,0Ah - 45137 ;db 'Retro DOS v4.2 COMMAND.COM ' - 45138 ;db 0 - 45139 ;db 'by Erdogan Tan - 19/6/2023' - 45140 ;db 0 - 45141 - 45142 ;============================================================================ - 45143 ; TPRINTF.ASM, MSDOS 6.0, 1991 - 45144 ;============================================================================ - 45145 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 45146 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45147 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 45148 - 45149 PRINTF_HANDLE: - 45150 00009921 0000 dw 0 ;AC000; + 45084 $M_RT: + 45085 00009894 00 times $M_RES_ADDRS_SZ db 0 ; times 141 db 0 ; 13/08/2024 + 45086 + 45087 ;============================================================================ + 45088 ; COPYRIGHT.INC, MSDOS 6.0, 1993 + 45089 ;============================================================================ + 45090 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 45091 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45092 + 45093 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:8A2Bh + 45094 ; --------------------------------------------------------------------------- + 45095 ;;M00 - changed to DOS 5.0 copyright - MD 9 Jul 90 + 45096 ;;M031 - changed copyright to 1991 + 45097 ;;9/16 - changed version to 6.0 and copyright to 1992 + 45098 ;;9/21 - Added international translations, language passed through COUNTRY macro + 45099 ;;B49,50 - changed version to 6 and copyright to 1993 + 45100 ; --------------------------------------------------------------------------- + 45101 + 45102 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 45103 ; PCDOS 7.1 COMMAND.COM + 45104 %if 0 + 45105 ; 18/06/2023 + 45106 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:9FBCh + 45107 ;ifdef USA + 45108 MsDosVer6_CCopy: + 45109 ; MSDOS 6.0 + 45110 ;db "MS DOS Version 6 (C)Copyright 1981-1993 Microsoft Corp " + 45111 ; 18/06/2023 + 45112 ; MSDOS 6.22 + 45113 db "MS DOS Version 6 (C)Copyright 1981-1994 Microsoft Corp " + 45114 db "Licensed Material - Property of Microsoft " + 45115 db "All rights reserved " + 45116 ;endif + 45117 %endif + 45118 + 45119 ; --------------------------------------------------------------------------- + 45120 ; 18/06/2023 + 45121 ; 15/04/2023 + 45122 ;MsDosVer5_CCopy: + 45123 ;db "MS DOS Version 5.00 (C)Copyright 1981-1991 Microsoft Corp " + 45124 ;db "Licensed Material - Property of Microsoft " + 45125 ;db "All rights reserved " + 45126 ; --------------------------------------------------------------------------- + 45127 ; 15/04/2023 + 45128 ; 16/04/2023 - 21/04/2023 + 45129 ;db 0 + 45130 ;db 0Dh,0Ah + 45131 ;db 'Retro DOS v4.0 (& v4.1) COMMAND.COM ' + 45132 ;db 0 + 45133 ;db 'by Erdogan Tan - 05/05/2023' + 45134 ;db 0 + 45135 + 45136 ; 19/06/2023 + 45137 ; 18/06/2023 + 45138 ;db 0 + 45139 ;db 0Dh,0Ah + 45140 ;db 'Retro DOS v4.2 COMMAND.COM ' + 45141 ;db 0 + 45142 ;db 'by Erdogan Tan - 19/6/2023' + 45143 ;db 0 + 45144 + 45145 ;============================================================================ + 45146 ; TPRINTF.ASM, MSDOS 6.0, 1991 + 45147 ;============================================================================ + 45148 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 45149 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45150 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM 45151 - 45152 ;============================================================================ - 45153 ; TSPC.ASM, MSDOS 6.0, 1991 - 45154 ;============================================================================ - 45155 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 45156 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45157 - 45158 ;TITLE COMMAND Transient Uninitialized DATA - 45159 - 45160 ;The TRANSPACE segment contains variable data that is considered - 45161 ;volatile between command cycles, and therefore is not included in the - 45162 ;transient checksum area. Contents of these variables MUST be - 45163 ;initialized before use, and must not be relied upon from command - 45164 ;cycle to command cycle. - 45165 ; - 45166 ;No constant data values should be stored here. - 45167 - 45168 ; --------------------------------------------------------------------------- - 45169 ; START OF UNITIALIZED DATA - 45170 ; --------------------------------------------------------------------------- - 45171 - 45172 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 8AA5h - 45173 - 45174 ; 18/06/2023 - 45175 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A033h + 45152 PRINTF_HANDLE: + 45153 00009921 0000 dw 0 ;AC000; + 45154 + 45155 ;============================================================================ + 45156 ; TSPC.ASM, MSDOS 6.0, 1991 + 45157 ;============================================================================ + 45158 ; 15/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 45159 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45160 + 45161 ;TITLE COMMAND Transient Uninitialized DATA + 45162 + 45163 ;The TRANSPACE segment contains variable data that is considered + 45164 ;volatile between command cycles, and therefore is not included in the + 45165 ;transient checksum area. Contents of these variables MUST be + 45166 ;initialized before use, and must not be relied upon from command + 45167 ;cycle to command cycle. + 45168 ; + 45169 ;No constant data values should be stored here. + 45170 + 45171 ; --------------------------------------------------------------------------- + 45172 ; START OF UNITIALIZED DATA + 45173 ; --------------------------------------------------------------------------- + 45174 + 45175 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 8AA5h 45176 - 45177 ; 13/08/2024 - 45178 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 9DB2h + 45177 ; 18/06/2023 + 45178 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A033h 45179 - 45180 00009923 00 SRCXNAME: times DIRSTRLEN+20 db 0 ; 87 ; buffer for name translate - 45181 0000997A 00 TRGXNAME: times DIRSTRLEN+20 db 0 ; 87 ; buffer for name translate - 45182 000099D1 00 UCOMBUF: times COMBUFLEN+3 db 0 ; 131 ; Raw console buffer - 45183 00009A54 00 COMBUF: times COMBUFLEN+3 db 0 ; 131 ; Cooked console buffer - 45184 00009AD7 00 USERDIR1: times DIRSTRLEN+3 db 0 ; 70 ; Storage for users current directory - 45185 00009B1D 00 EXECPATH: times COMBUFLEN+3 db 0 ; 131 ; Path for external command - 45186 00009BA0 00 RE_INSTR: times DIRSTRLEN+16 db 0 ; 83 ; path for input to redirection - 45187 - 45188 ; Variables passed up from resident ; in the Resident portion: (initial values) - 45189 HEADCALL: - 45190 00009BF3 0000 dw 0 ; TRANVARS (dw THEADFIX) - 45191 00009BF5 0000 RESSEG: dw 0 ; MYSEG (dw 0) - 45192 00009BF7 0000 TPA: dw 0 ; LTPA (dw 0) - 45193 SWITCHAR: - 45194 00009BF9 00 db 0 ; RSWITCHAR (db '-') - 45195 DIRCHAR: - 45196 00009BFA 00 db 0 ; RDIRCHAR (db '/') - 45197 EXEC_ADDR: - 45198 00009BFB 00000000 dd 0 ; (dw EXT_EXEC) - 45199 ; MYSEG1 (dw 0) - 45200 RCH_ADDR: - 45201 00009BFF 00000000 dd 0 ; (dw TREMCHECK) - 45202 ; MYSEG2 (dw 0) - 45203 - 45204 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 45205 ; PCDOS 7.1 COMMAND.COM - 45206 %if 0 - 45207 dw 0 ; RESTEST (dw 0) - 45208 %endif - 45209 - 45210 TRAN_TPA: - 45211 00009C03 0000 dw 0 ; RES_TPA (dw 0) + 45180 ; 13/08/2024 + 45181 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 9DB2h + 45182 + 45183 00009923 00 SRCXNAME: times DIRSTRLEN+20 db 0 ; 87 ; buffer for name translate + 45184 0000997A 00 TRGXNAME: times DIRSTRLEN+20 db 0 ; 87 ; buffer for name translate + 45185 000099D1 00 UCOMBUF: times COMBUFLEN+3 db 0 ; 131 ; Raw console buffer + 45186 00009A54 00 COMBUF: times COMBUFLEN+3 db 0 ; 131 ; Cooked console buffer + 45187 00009AD7 00 USERDIR1: times DIRSTRLEN+3 db 0 ; 70 ; Storage for users current directory + 45188 00009B1D 00 EXECPATH: times COMBUFLEN+3 db 0 ; 131 ; Path for external command + 45189 00009BA0 00 RE_INSTR: times DIRSTRLEN+16 db 0 ; 83 ; path for input to redirection + 45190 + 45191 ; Variables passed up from resident ; in the Resident portion: (initial values) + 45192 HEADCALL: + 45193 00009BF3 0000 dw 0 ; TRANVARS (dw THEADFIX) + 45194 00009BF5 0000 RESSEG: dw 0 ; MYSEG (dw 0) + 45195 00009BF7 0000 TPA: dw 0 ; LTPA (dw 0) + 45196 SWITCHAR: + 45197 00009BF9 00 db 0 ; RSWITCHAR (db '-') + 45198 DIRCHAR: + 45199 00009BFA 00 db 0 ; RDIRCHAR (db '/') + 45200 EXEC_ADDR: + 45201 00009BFB 00000000 dd 0 ; (dw EXT_EXEC) + 45202 ; MYSEG1 (dw 0) + 45203 RCH_ADDR: + 45204 00009BFF 00000000 dd 0 ; (dw TREMCHECK) + 45205 ; MYSEG2 (dw 0) + 45206 + 45207 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 45208 ; PCDOS 7.1 COMMAND.COM + 45209 %if 0 + 45210 dw 0 ; RESTEST (dw 0) + 45211 %endif 45212 - 45213 00009C05 00 CHKDRV: db 0 - 45214 IFNOTFLAG: - 45215 FILTYP: - 45216 00009C06 00 RDEOF: db 0 ; Misc flags - 45217 00009C07 00 CURDRV: db 0 - 45218 PARM1: - 45219 00009C08 00 Concat: db 0 - 45220 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM - 45221 %if 1 - 45222 notzerofile: - 45223 00009C09 00 db 0 ; (if 1, destination file size is not zero) - 45224 %endif - 45225 PARM2: - 45226 00009C0A 00 ArgC: db 0 - 45227 00009C0B 0000 COMSW: dw 0 ; Switches between command and 1st arg - 45228 00009C0D 0000 ARG1S: dw 0 ; Switches between 1st and 2nd arg - 45229 ARG2S: ; Switches after 2nd arg - 45230 DestSwitch: - 45231 00009C0F 0000 dw 0 - 45232 ARGTS: - 45233 AllSwitch: - 45234 00009C11 0000 dw 0 ; ALL switches except for COMSW - 45235 00009C13 00 CFLAG: db 0 - 45236 DestClosed: - 45237 SPECDRV: - 45238 00009C14 00 db 0 - 45239 00009C15 0000 BYTCNT: dw 0 ; Size of buffer between RES and TRANS - 45240 - 45241 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 45242 ;ifdef DBLSPACE_HOOKS - 45243 savBytCnt: ; MSDOS 6.0 - 45244 00009C17 0000 dw 0 ; 13/08/2024 - PCDOS 7.1 COMMAND.COM - 45245 ;endif - 45246 - 45247 00009C19 0000 NXTADD: dw 0 - 45248 FRSTSRCH: - 45249 00009C1B 00 db 0 - 45250 ; 15/04/2023 - 45251 LeftOnLine: - 45252 00009C1C 00 db 0 ; entries left on line u.b. DIR - 45253 PerLine: - 45254 00009C1D 00 db 0 ; entries/line u.b. DIR - 45255 - 45256 ; 13/08/2024 - PCDOS 7.1 COMMAND.COM - 45257 %if 0 - 45258 LINCNT: db 0 - 45259 LINLEN: db 0 - 45260 %endif - 45261 - 45262 LeftOnPage: - 45263 00009C1E 0000 dw 0 ; lines left on page u.b. DIR - 45264 FileCnt: - 45265 00009C20 0000 dw 0 ; file count u.b. DIR - 45266 FileSiz: - 45267 00009C22 00000000 dd 0 ; file size u.b. DIR - 45268 - 45269 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - TRANGROUP:A0B5h - 45270 %if 1 - 45271 00009C26 00000000 dd 0 - 45272 00009C2A 00 narrow: db 0 - 45273 nocommas: - 45274 00009C2B 00 db 0 - 45275 yeardigit4: - 45276 00009C2C 00 db 0 - 45277 bfree_not_kilo: - 45278 00009C2D 00 db 0 - 45279 efs_buffer: - 45280 00009C2E 000000000000000000- db 44 dup(0) ; times 44 db 0 - 45280 00009C37 000000000000000000- - 45280 00009C40 000000000000000000- - 45280 00009C49 000000000000000000- - 45280 00009C52 0000000000000000 - 45281 efs_drive: - 45282 00009C5A 433A5C00 db 'C:\',0 - 45283 %endif - 45284 - 45285 ; Note: keep FileCntTotal through csecUsedTotal together! - 45286 - 45287 FileCntTotal: - 45288 00009C5E 00000000 dd 0 ; total file count u.b. DIR - 45289 FileSizTotal: - 45290 00009C62 00000000 dd 0 ; total file size u.b. DIR - 45291 - 45292 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM - 45293 %if 1 - 45294 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:A0F5h - 45295 00009C66 00000000 dd 0 - 45296 %else - 45297 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM - 45298 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A33Fh - 45299 ; MSDOS 6.0 - 45300 ;ifdef DBLSPACE_HOOKS - 45301 ccluUsed: - 45302 dw 0 ; count of DOS clusters used - 45303 ccluUsedDir: - 45304 dw 0 - 45305 ccluUsedTotal: - 45306 dw 0 - 45307 csecUsed: - 45308 dd 0 ; count of comp sectors used - 45309 csecUsedDir: - 45310 dd 0 - 45311 csecUsedTotal: - 45312 dd 0 - 45313 - 45314 ; Note: keep FileCntTotal through csecUsedTotal together! - 45315 - 45316 fhCVF: - 45317 dw 0 ; Compressed Volume File handle - 45318 szCVF: - 45319 times 16 db 0 ; "X:\\12345678.123\0" - 45320 MDBPB: - 45321 ;MD_BPB <> ; Extended MagicDrv BPB - 45322 times 64 db 0 - 45323 csecPerCluster: - 45324 db 0 ; sectors/cluster for ratio calc - 45325 fUseHostSize: - 45326 db 0 ; NZ if using host cluster size - 45327 cFATEntries: - 45328 dw 0 ; # FAT entries in buffers - 45329 entInBuf: - 45330 dw 0 ; 1st entry # in FAT buffers - 45331 segFATBuf: - 45332 dw 0 ; seg of DOS & MD FAT buffers - 45333 pbufDOSFAT: - 45334 dw 0 ; off of DOS FAT buffer - 45335 pbufMDFAT: - 45336 dw 0 ; off of MD FAT buffer - 45337 bufDOSFAT: - 45338 ;times (cRES_FAT_ENTRIES*2) db 0 - 45339 times 64 db 0 ; small DOS FAT buffer - 45340 bufMDFAT: - 45341 ;times (cRES_FAT_ENTRIES*4) db 0 - 45342 times 128 db 0 ; small MD FAT buffer - 45343 ;endif - 45344 %endif - 45345 - 45346 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 8DAFh - 45347 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A46Fh - 45348 ; 31/07/2024 - 45349 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:A0F9h - 45350 CHARBUF: - 45351 00009C6A 00 times 80 db 0 ;line byte character buffer for xenix write - 45352 DESTFCB2: - 45353 00009CBA 00 IDLEN: db 0 - 45354 00009CBB 00 ID: times 8 db 0 - 45355 00009CC3 00 COM: times 3 db 0 - 45356 00009CC6 00 DEST: times 37 db 0 - 45357 DESTNAME: - 45358 00009CEB 00 times 11 db 0 - 45359 DESTDIR: - 45360 DestFcb: - 45361 00009CF6 00 times DIRSTRLEN db 0 ; 67 ; Directory for PATH searches - 45362 GOTOLEN: ; word - 45363 BWDBUF: ; byte - 45364 EXEFCB: ; word - 45365 00009D39 00 DIRBUF: times DIRSTRLEN+3 db 0 ; 70 - 45366 - 45367 DIRBUF_ATTRIB1 equ DIRBUF+19 ; byte ; INT 21h AH=11h (8+DIR_ENTRY struc) - 45368 DIRBUF_ATTRIB2 equ DIRBUF+21 ; byte ; INT 21h AH=4Eh (FIND_BUF struc) - 45369 DIRBUF_FTIME equ DIRBUF+30 ; word - 45370 DIRBUF_FDATE equ DIRBUF+32 ; word - 45371 DIRBUF_FSIZ_L equ DIRBUF+36 ; word - 45372 DIRBUF_FSIZ_H equ DIRBUF+38 ; word - 45373 - 45374 ; 16/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM - 45375 - 45376 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45377 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0A584h - 45378 SDIRBUF: - 45379 00009D7F 00 times 12 db 0 - 45380 _Bits: - 45381 00009D8B 0000 dw 0 - 45382 PathCnt: - 45383 00009D8D 0000 dw 0 - 45384 PathPos: - 45385 00009D8F 0000 dw 0 - 45386 00009D91 0000 PathSw: dw 0 - 45387 AttrSpecified: - 45388 00009D93 00 db 0 ; attribute bits u.b. DIR - 45389 AttrSelect: - 45390 00009D94 00 db 0 ; attribute bits u.b. DIR - 45391 00009D95 00 comma: db 0 ; flag set if +,, occurs - 45392 plus_comma: - 45393 00009D96 00 db 0 ; flag set if +,, occurs - 45394 DirFlag: - 45395 00009D97 00 db 0 ;AN015; set when pathcrunch called from DIR - 45396 parse_last: - 45397 00009D98 0000 dw 0 ;AN018; used to hold parsing position - 45398 system_cpage: - 45399 00009D9A 0000 dw 0 ;AC001; used for CHCP variable - 45400 - 45401 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 45402 %if 0 - 45403 Arg_Buf: - 45404 times 128 db 0 - 45405 %endif - 45406 - 45407 File_Size_Low: - 45408 00009D9C 0000 dw 0 - 45409 File_Size_High: - 45410 00009D9E 0000 dw 0 - 45411 string_ptr_2: - 45412 00009DA0 0000 dw 0 - 45413 Copy_num: - 45414 00009DA2 0000 dw 0 - 45415 cpyflag: - 45416 00009DA4 00 db 0 - 45417 Dir_Num: - 45418 00009DA5 0000 dw 0 - 45419 - 45420 ; 13/08/2024 - 45421 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 45422 %if 1 - 45423 00009DA7 0000 dw 0 - 45424 %else - 45425 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45426 ; MSDOS 6.0 - 45427 ;ifdef DBLSPACE_HOOKS - 45428 Dir_CRatio_1: - 45429 db 0 - 45430 Dir_CRatio_2: - 45431 db 0 - 45432 ;endif - 45433 %endif - 45434 - 45435 Bytes_Free: - 45436 00009DA9 00000000 dd 0 + 45213 TRAN_TPA: + 45214 00009C03 0000 dw 0 ; RES_TPA (dw 0) + 45215 + 45216 00009C05 00 CHKDRV: db 0 + 45217 IFNOTFLAG: + 45218 FILTYP: + 45219 00009C06 00 RDEOF: db 0 ; Misc flags + 45220 00009C07 00 CURDRV: db 0 + 45221 PARM1: + 45222 00009C08 00 Concat: db 0 + 45223 ; 11/08/2024 - PCDOS 7.1 COMMAND.COM + 45224 %if 1 + 45225 notzerofile: + 45226 00009C09 00 db 0 ; (if 1, destination file size is not zero) + 45227 %endif + 45228 PARM2: + 45229 00009C0A 00 ArgC: db 0 + 45230 00009C0B 0000 COMSW: dw 0 ; Switches between command and 1st arg + 45231 00009C0D 0000 ARG1S: dw 0 ; Switches between 1st and 2nd arg + 45232 ARG2S: ; Switches after 2nd arg + 45233 DestSwitch: + 45234 00009C0F 0000 dw 0 + 45235 ARGTS: + 45236 AllSwitch: + 45237 00009C11 0000 dw 0 ; ALL switches except for COMSW + 45238 00009C13 00 CFLAG: db 0 + 45239 DestClosed: + 45240 SPECDRV: + 45241 00009C14 00 db 0 + 45242 00009C15 0000 BYTCNT: dw 0 ; Size of buffer between RES and TRANS + 45243 + 45244 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 45245 ;ifdef DBLSPACE_HOOKS + 45246 savBytCnt: ; MSDOS 6.0 + 45247 00009C17 0000 dw 0 ; 13/08/2024 - PCDOS 7.1 COMMAND.COM + 45248 ;endif + 45249 + 45250 00009C19 0000 NXTADD: dw 0 + 45251 FRSTSRCH: + 45252 00009C1B 00 db 0 + 45253 ; 15/04/2023 + 45254 LeftOnLine: + 45255 00009C1C 00 db 0 ; entries left on line u.b. DIR + 45256 PerLine: + 45257 00009C1D 00 db 0 ; entries/line u.b. DIR + 45258 + 45259 ; 13/08/2024 - PCDOS 7.1 COMMAND.COM + 45260 %if 0 + 45261 LINCNT: db 0 + 45262 LINLEN: db 0 + 45263 %endif + 45264 + 45265 LeftOnPage: + 45266 00009C1E 0000 dw 0 ; lines left on page u.b. DIR + 45267 FileCnt: + 45268 00009C20 0000 dw 0 ; file count u.b. DIR + 45269 FileSiz: + 45270 00009C22 00000000 dd 0 ; file size u.b. DIR + 45271 + 45272 ; 31/07/2024 - PCDOS 7.1 COMMAND.COM - TRANGROUP:A0B5h + 45273 %if 1 + 45274 00009C26 00000000 dd 0 + 45275 00009C2A 00 narrow: db 0 + 45276 nocommas: + 45277 00009C2B 00 db 0 + 45278 yeardigit4: + 45279 00009C2C 00 db 0 + 45280 bfree_not_kilo: + 45281 00009C2D 00 db 0 + 45282 efs_buffer: + 45283 00009C2E 000000000000000000- db 44 dup(0) ; times 44 db 0 + 45283 00009C37 000000000000000000- + 45283 00009C40 000000000000000000- + 45283 00009C49 000000000000000000- + 45283 00009C52 0000000000000000 + 45284 efs_drive: + 45285 00009C5A 433A5C00 db 'C:\',0 + 45286 %endif + 45287 + 45288 ; Note: keep FileCntTotal through csecUsedTotal together! + 45289 + 45290 FileCntTotal: + 45291 00009C5E 00000000 dd 0 ; total file count u.b. DIR + 45292 FileSizTotal: + 45293 00009C62 00000000 dd 0 ; total file size u.b. DIR + 45294 + 45295 ; 31/07/2024 - Retro DOS v5.0 COMMAND.COM + 45296 %if 1 + 45297 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:A0F5h + 45298 00009C66 00000000 dd 0 + 45299 %else + 45300 ; 18/06/2023 - Retro DOS v4.2 (MSDOS 6.22) COMMAND.COM + 45301 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A33Fh + 45302 ; MSDOS 6.0 + 45303 ;ifdef DBLSPACE_HOOKS + 45304 ccluUsed: + 45305 dw 0 ; count of DOS clusters used + 45306 ccluUsedDir: + 45307 dw 0 + 45308 ccluUsedTotal: + 45309 dw 0 + 45310 csecUsed: + 45311 dd 0 ; count of comp sectors used + 45312 csecUsedDir: + 45313 dd 0 + 45314 csecUsedTotal: + 45315 dd 0 + 45316 + 45317 ; Note: keep FileCntTotal through csecUsedTotal together! + 45318 + 45319 fhCVF: + 45320 dw 0 ; Compressed Volume File handle + 45321 szCVF: + 45322 times 16 db 0 ; "X:\\12345678.123\0" + 45323 MDBPB: + 45324 ;MD_BPB <> ; Extended MagicDrv BPB + 45325 times 64 db 0 + 45326 csecPerCluster: + 45327 db 0 ; sectors/cluster for ratio calc + 45328 fUseHostSize: + 45329 db 0 ; NZ if using host cluster size + 45330 cFATEntries: + 45331 dw 0 ; # FAT entries in buffers + 45332 entInBuf: + 45333 dw 0 ; 1st entry # in FAT buffers + 45334 segFATBuf: + 45335 dw 0 ; seg of DOS & MD FAT buffers + 45336 pbufDOSFAT: + 45337 dw 0 ; off of DOS FAT buffer + 45338 pbufMDFAT: + 45339 dw 0 ; off of MD FAT buffer + 45340 bufDOSFAT: + 45341 ;times (cRES_FAT_ENTRIES*2) db 0 + 45342 times 64 db 0 ; small DOS FAT buffer + 45343 bufMDFAT: + 45344 ;times (cRES_FAT_ENTRIES*4) db 0 + 45345 times 128 db 0 ; small MD FAT buffer + 45346 ;endif + 45347 %endif + 45348 + 45349 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 8DAFh + 45350 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A46Fh + 45351 ; 31/07/2024 + 45352 ; PCDOS 7.1 COMMAND.COM - TRANGROUP:A0F9h + 45353 CHARBUF: + 45354 00009C6A 00 times 80 db 0 ;line byte character buffer for xenix write + 45355 DESTFCB2: + 45356 00009CBA 00 IDLEN: db 0 + 45357 00009CBB 00 ID: times 8 db 0 + 45358 00009CC3 00 COM: times 3 db 0 + 45359 00009CC6 00 DEST: times 37 db 0 + 45360 DESTNAME: + 45361 00009CEB 00 times 11 db 0 + 45362 DESTDIR: + 45363 DestFcb: + 45364 00009CF6 00 times DIRSTRLEN db 0 ; 67 ; Directory for PATH searches + 45365 GOTOLEN: ; word + 45366 BWDBUF: ; byte + 45367 EXEFCB: ; word + 45368 00009D39 00 DIRBUF: times DIRSTRLEN+3 db 0 ; 70 + 45369 + 45370 DIRBUF_ATTRIB1 equ DIRBUF+19 ; byte ; INT 21h AH=11h (8+DIR_ENTRY struc) + 45371 DIRBUF_ATTRIB2 equ DIRBUF+21 ; byte ; INT 21h AH=4Eh (FIND_BUF struc) + 45372 DIRBUF_FTIME equ DIRBUF+30 ; word + 45373 DIRBUF_FDATE equ DIRBUF+32 ; word + 45374 DIRBUF_FSIZ_L equ DIRBUF+36 ; word + 45375 DIRBUF_FSIZ_H equ DIRBUF+38 ; word + 45376 + 45377 ; 16/04/2023 - Retro DOS v4.0 (& v4.1) COMMAND.COM + 45378 + 45379 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45380 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0A584h + 45381 SDIRBUF: + 45382 00009D7F 00 times 12 db 0 + 45383 _Bits: + 45384 00009D8B 0000 dw 0 + 45385 PathCnt: + 45386 00009D8D 0000 dw 0 + 45387 PathPos: + 45388 00009D8F 0000 dw 0 + 45389 00009D91 0000 PathSw: dw 0 + 45390 AttrSpecified: + 45391 00009D93 00 db 0 ; attribute bits u.b. DIR + 45392 AttrSelect: + 45393 00009D94 00 db 0 ; attribute bits u.b. DIR + 45394 00009D95 00 comma: db 0 ; flag set if +,, occurs + 45395 plus_comma: + 45396 00009D96 00 db 0 ; flag set if +,, occurs + 45397 DirFlag: + 45398 00009D97 00 db 0 ;AN015; set when pathcrunch called from DIR + 45399 parse_last: + 45400 00009D98 0000 dw 0 ;AN018; used to hold parsing position + 45401 system_cpage: + 45402 00009D9A 0000 dw 0 ;AC001; used for CHCP variable + 45403 + 45404 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 45405 %if 0 + 45406 Arg_Buf: + 45407 times 128 db 0 + 45408 %endif + 45409 + 45410 File_Size_Low: + 45411 00009D9C 0000 dw 0 + 45412 File_Size_High: + 45413 00009D9E 0000 dw 0 + 45414 string_ptr_2: + 45415 00009DA0 0000 dw 0 + 45416 Copy_num: + 45417 00009DA2 0000 dw 0 + 45418 cpyflag: + 45419 00009DA4 00 db 0 + 45420 Dir_Num: + 45421 00009DA5 0000 dw 0 + 45422 + 45423 ; 13/08/2024 + 45424 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 45425 %if 1 + 45426 00009DA7 0000 dw 0 + 45427 %else + 45428 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45429 ; MSDOS 6.0 + 45430 ;ifdef DBLSPACE_HOOKS + 45431 Dir_CRatio_1: + 45432 db 0 + 45433 Dir_CRatio_2: + 45434 db 0 + 45435 ;endif + 45436 %endif 45437 - 45438 Major_Ver_Num: - 45439 00009DAD 0000 dw 0 - 45440 Minor_Ver_Num: - 45441 00009DAF 0000 dw 0 - 45442 - 45443 One_Char_Val: - 45444 00009DB1 00 db 0 - 45445 00009DB2 00 db 0 - 45446 vol_drv: - 45447 00009DB3 00 db 0 - 45448 ROM_CALL: - 45449 00009DB4 00 db 0 ; flag for rom function - 45450 00009DB5 0000 ROM_IP: dw 0 - 45451 00009DB7 0000 ROM_CS: dw 0 - 45452 - 45453 DestVars: - 45454 DestIsDir: - 45455 00009DB9 00 db 0 - 45456 DestSiz: - 45457 00009DBA 00 db 0 - 45458 DestTail: - 45459 00009DBB 0000 dw 0 - 45460 DestInfo: - 45461 00009DBD 00 db 0 - 45462 DestBuf: - 45463 00009DBE 00 times DIRSTRLEN+20 db 0 ; 87 - 45464 EndDestBuf: - 45465 DESTHAND: - 45466 00009E15 0000 dw 0 - 45467 DESTISDEV: - 45468 00009E17 00 db 0 - 45469 FIRSTDEST: - 45470 00009E18 00 db 0 - 45471 MELCOPY: - 45472 00009E19 00 db 0 - 45473 MELSTART: - 45474 00009E1A 0000 dw 0 - 45475 SrcVars: - 45476 SrcIsDir: - 45477 00009E1C 00 db 0 - 45478 00009E1D 00 SrcSiz: db 0 - 45479 SrcTail: - 45480 00009E1E 0000 dw 0 - 45481 SrcInfo: - 45482 00009E20 00 db 0 - 45483 SrcBuf: - 45484 00009E21 00 times DIRSTRLEN+20 db 0 ; 87 - 45485 SRCHAND: - 45486 00009E78 0000 dw 0 - 45487 SRCISDEV: - 45488 00009E7A 00 db 0 - 45489 ScanBuf: - 45490 00009E7B 00 times DIRSTRLEN+20 db 0 ; 87 - 45491 - 45492 00009ED2 0000 SRCPT: dw 0 - 45493 INEXACT: - 45494 00009ED4 00 db 0 - 45495 NOWRITE: - 45496 00009ED5 00 db 0 - 45497 BINARY: - 45498 00009ED6 00 db 0 - 45499 WRITTEN: - 45500 00009ED7 0000 dw 0 - 45501 TERMREAD: - 45502 00009ED9 00 db 0 - 45503 00009EDA 00 ASCII: db 0 - 45504 00009EDB 00 PLUS: db 0 - 45505 00009EDC 00 objcnt: db 0 ; Used in copy - 45506 00009EDD 0000 CPDATE: dw 0 - 45507 00009EDF 0000 CPTIME: dw 0 - 45508 - 45509 OFilePtr_Lo: - 45510 00009EE1 0000 dw 0 ; original file ptr for COPY when - 45511 OFilePtr_Hi: - 45512 00009EE3 0000 dw 0 ; 1st source is also destination - 45513 zflag: ; 10/08/2024 - PCDOS 7.1 COMMAND.COM - 45514 00009EE5 00 OCtrlZ: db 0 ; original ctrl+Z for COPY when ditto - 45515 - 45516 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45517 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0A76Bh - 45518 cox_sublist_buff: - 45519 00009EE6 00 times 11 db 0 - 45520 cox_y_override: - 45521 00009EF1 00 db 0 - 45522 cox_dest_file: - 45523 00009EF2 00 db 0 - 45524 cox_src_file: - 45525 00009EF3 00 db 0 - 45526 - 45527 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:0A779h) - 45528 BATHAND: - 45529 00009EF4 0000 dw 0 ; Batch handle - 45530 STARTEL: - 45531 00009EF6 0000 dw 0 - 45532 00009EF8 00 ELCNT: db 0 - 45533 00009EF9 00 ELPOS: db 0 - 45534 - 45535 ; 28/03/2023 - Retro DOS v4.0 COMMAND.COM - 45536 ; MSDOS 5.0 - 45537 SKPDEL: - 45538 ; 18/06/2023 - 45539 00009EFA 00 db 0 ; MSDOS 6.22 (& MSDOS 5.0) - 45540 00009EFB 00 SOURCE: times 11 db 0 - 45541 - 45542 ext_entered: - 45543 00009F06 00 db 0 ;AN005; + 45438 Bytes_Free: + 45439 00009DA9 00000000 dd 0 + 45440 + 45441 Major_Ver_Num: + 45442 00009DAD 0000 dw 0 + 45443 Minor_Ver_Num: + 45444 00009DAF 0000 dw 0 + 45445 + 45446 One_Char_Val: + 45447 00009DB1 00 db 0 + 45448 00009DB2 00 db 0 + 45449 vol_drv: + 45450 00009DB3 00 db 0 + 45451 ROM_CALL: + 45452 00009DB4 00 db 0 ; flag for rom function + 45453 00009DB5 0000 ROM_IP: dw 0 + 45454 00009DB7 0000 ROM_CS: dw 0 + 45455 + 45456 DestVars: + 45457 DestIsDir: + 45458 00009DB9 00 db 0 + 45459 DestSiz: + 45460 00009DBA 00 db 0 + 45461 DestTail: + 45462 00009DBB 0000 dw 0 + 45463 DestInfo: + 45464 00009DBD 00 db 0 + 45465 DestBuf: + 45466 00009DBE 00 times DIRSTRLEN+20 db 0 ; 87 + 45467 EndDestBuf: + 45468 DESTHAND: + 45469 00009E15 0000 dw 0 + 45470 DESTISDEV: + 45471 00009E17 00 db 0 + 45472 FIRSTDEST: + 45473 00009E18 00 db 0 + 45474 MELCOPY: + 45475 00009E19 00 db 0 + 45476 MELSTART: + 45477 00009E1A 0000 dw 0 + 45478 SrcVars: + 45479 SrcIsDir: + 45480 00009E1C 00 db 0 + 45481 00009E1D 00 SrcSiz: db 0 + 45482 SrcTail: + 45483 00009E1E 0000 dw 0 + 45484 SrcInfo: + 45485 00009E20 00 db 0 + 45486 SrcBuf: + 45487 00009E21 00 times DIRSTRLEN+20 db 0 ; 87 + 45488 SRCHAND: + 45489 00009E78 0000 dw 0 + 45490 SRCISDEV: + 45491 00009E7A 00 db 0 + 45492 ScanBuf: + 45493 00009E7B 00 times DIRSTRLEN+20 db 0 ; 87 + 45494 + 45495 00009ED2 0000 SRCPT: dw 0 + 45496 INEXACT: + 45497 00009ED4 00 db 0 + 45498 NOWRITE: + 45499 00009ED5 00 db 0 + 45500 BINARY: + 45501 00009ED6 00 db 0 + 45502 WRITTEN: + 45503 00009ED7 0000 dw 0 + 45504 TERMREAD: + 45505 00009ED9 00 db 0 + 45506 00009EDA 00 ASCII: db 0 + 45507 00009EDB 00 PLUS: db 0 + 45508 00009EDC 00 objcnt: db 0 ; Used in copy + 45509 00009EDD 0000 CPDATE: dw 0 + 45510 00009EDF 0000 CPTIME: dw 0 + 45511 + 45512 OFilePtr_Lo: + 45513 00009EE1 0000 dw 0 ; original file ptr for COPY when + 45514 OFilePtr_Hi: + 45515 00009EE3 0000 dw 0 ; 1st source is also destination + 45516 zflag: ; 10/08/2024 - PCDOS 7.1 COMMAND.COM + 45517 00009EE5 00 OCtrlZ: db 0 ; original ctrl+Z for COPY when ditto + 45518 + 45519 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45520 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0A76Bh + 45521 cox_sublist_buff: + 45522 00009EE6 00 times 11 db 0 + 45523 cox_y_override: + 45524 00009EF1 00 db 0 + 45525 cox_dest_file: + 45526 00009EF2 00 db 0 + 45527 cox_src_file: + 45528 00009EF3 00 db 0 + 45529 + 45530 ; (MSDOS 6.22 COMMAND.COM - TRANGROUP:0A779h) + 45531 BATHAND: + 45532 00009EF4 0000 dw 0 ; Batch handle + 45533 STARTEL: + 45534 00009EF6 0000 dw 0 + 45535 00009EF8 00 ELCNT: db 0 + 45536 00009EF9 00 ELPOS: db 0 + 45537 + 45538 ; 28/03/2023 - Retro DOS v4.0 COMMAND.COM + 45539 ; MSDOS 5.0 + 45540 SKPDEL: + 45541 ; 18/06/2023 + 45542 00009EFA 00 db 0 ; MSDOS 6.22 (& MSDOS 5.0) + 45543 00009EFB 00 SOURCE: times 11 db 0 45544 - 45545 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:90BCh - 45546 - 45547 Display_Ioctl: - 45548 00009F07 00 db 0 ;AN000; info level - 45549 00009F08 00 db 0 ;AN000; reserved - 45550 00009F09 0E00 dw crt_ioctl_ln ; 14 ;AN000; length of data - 45551 00009F0B 0000 dw 0 ;AN000; control flags - 45552 display_mode: - 45553 00009F0D 00 db 0 ;AN000; display mode, colors - 45554 00009F0E 00 db 0 ;AN000; reserved - 45555 00009F0F 0000 dw 0 ;AN023; colors - 45556 00009F11 0000 dw 0 ;AN000; display width (PELS) - 45557 00009F13 0000 dw 0 ;AN000; display length (PELS) - 45558 display_width: - 45559 00009F15 0000 dw 0 ;AN000; display width - 45560 LinPerPag: - 45561 00009F17 1900 dw LINESPERPAGE ; 25 ;AN000; display length (default to linesperpage) - 45562 - 45563 vol_ioctl_buf: ;AN000; buffer for ioctl volume label/serial call - 45564 00009F19 0000 dw 0 ;AN000; info level - 45565 vol_serial: - 45566 00009F1B 00000000 dd 0 ;AN000; volume serial number - 45567 vol_label: - 45568 00009F1F 20 times 11 db 20h ; " " ;AN000; volume label - init to blanks - 45569 00009F2A 20 times 8 db 20h ; " " ;AN000; file system type - 45570 - 45571 expand_star: - 45572 00009F32 00 db 0 + 45545 ext_entered: + 45546 00009F06 00 db 0 ;AN005; + 45547 + 45548 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:90BCh + 45549 + 45550 Display_Ioctl: + 45551 00009F07 00 db 0 ;AN000; info level + 45552 00009F08 00 db 0 ;AN000; reserved + 45553 00009F09 0E00 dw crt_ioctl_ln ; 14 ;AN000; length of data + 45554 00009F0B 0000 dw 0 ;AN000; control flags + 45555 display_mode: + 45556 00009F0D 00 db 0 ;AN000; display mode, colors + 45557 00009F0E 00 db 0 ;AN000; reserved + 45558 00009F0F 0000 dw 0 ;AN023; colors + 45559 00009F11 0000 dw 0 ;AN000; display width (PELS) + 45560 00009F13 0000 dw 0 ;AN000; display length (PELS) + 45561 display_width: + 45562 00009F15 0000 dw 0 ;AN000; display width + 45563 LinPerPag: + 45564 00009F17 1900 dw LINESPERPAGE ; 25 ;AN000; display length (default to linesperpage) + 45565 + 45566 vol_ioctl_buf: ;AN000; buffer for ioctl volume label/serial call + 45567 00009F19 0000 dw 0 ;AN000; info level + 45568 vol_serial: + 45569 00009F1B 00000000 dd 0 ;AN000; volume serial number + 45570 vol_label: + 45571 00009F1F 20 times 11 db 20h ; " " ;AN000; volume label - init to blanks + 45572 00009F2A 20 times 8 db 20h ; " " ;AN000; file system type 45573 - 45574 msg_flag: - 45575 00009F33 00 db 0 ;AN022; flag set if non-utility message issued - 45576 Msg_Numb: - 45577 00009F34 0000 dw 0 ;AN022; set with extended error message issued - 45578 append_exec: - 45579 00009F36 00 db 0 ;AN041; set if internal append executed - 45580 print_err_flag: - 45581 00009F37 0000 dw 0 ;AN000; flag set if error during sysdispmsg - 45582 subst_buffer: - 45583 00009F39 00 times parm_block_size*2 db 0 ; times 22 db 0 - 45584 ;AN061; - 45585 ; 15/04/2023 - 45586 00009F4F 00 KPARSE: db 0 ; 3/3/KK - 45587 - 45588 ; Data declarations taken out of parse.asm - 45589 - 45590 ; MSDOS 6.0 - 45591 ;arg arg_unit <> ; pointers, arg count, string buffer - 45592 ;argbufptr dw ? ; index for argv[].argpointer - 45593 ;tpbuf db 128 DUP (?) ; temporary buffer - 45594 ;LAST_ARG dw ? ; point at which to accumulate switch info - 45595 ;comptr dw ? ; ptr into combuf - 45596 - 45597 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9105h - 45598 - 45599 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45600 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A7D5h + 45574 expand_star: + 45575 00009F32 00 db 0 + 45576 + 45577 msg_flag: + 45578 00009F33 00 db 0 ;AN022; flag set if non-utility message issued + 45579 Msg_Numb: + 45580 00009F34 0000 dw 0 ;AN022; set with extended error message issued + 45581 append_exec: + 45582 00009F36 00 db 0 ;AN041; set if internal append executed + 45583 print_err_flag: + 45584 00009F37 0000 dw 0 ;AN000; flag set if error during sysdispmsg + 45585 subst_buffer: + 45586 00009F39 00 times parm_block_size*2 db 0 ; times 22 db 0 + 45587 ;AN061; + 45588 ; 15/04/2023 + 45589 00009F4F 00 KPARSE: db 0 ; 3/3/KK + 45590 + 45591 ; Data declarations taken out of parse.asm + 45592 + 45593 ; MSDOS 6.0 + 45594 ;arg arg_unit <> ; pointers, arg count, string buffer + 45595 ;argbufptr dw ? ; index for argv[].argpointer + 45596 ;tpbuf db 128 DUP (?) ; temporary buffer + 45597 ;LAST_ARG dw ? ; point at which to accumulate switch info + 45598 ;comptr dw ? ; ptr into combuf + 45599 + 45600 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9105h 45601 - 45602 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM - 45603 ; PCDOS 7.1 COMMAND.COM (20023) Transient portion offset 0A3DFh - 45604 ARG: - 45605 ARG_ARGV: - 45606 ARGV0_ARGPOINTER: - 45607 00009F50 0000 dw 0 ; ARGV[0] - 45608 ARGV0_ARG_FLAGS: - 45609 00009F52 00 db 0 - 45610 ARGV0_ARGSTARTEL: - 45611 00009F53 0000 dw 0 - 45612 ARGV0_ARGLEN: - 45613 00009F55 0000 dw 0 - 45614 ARGV0_ARGSW_WORD: - 45615 00009F57 0000 dw 0 - 45616 ARGV0_OCOMPTR: - 45617 00009F59 0000 dw 0 - 45618 ARGV1_ARGPOINTER: - 45619 00009F5B 0000 dw 0 ; ARGV[1] - 45620 00009F5D 00 times 5 db 0 - 45621 ARGV1_ARGSW_WORD: - 45622 00009F62 0000 dw 0 - 45623 00009F64 0000 dw 0 - 45624 ARGV2_ARGPOINTER: - 45625 00009F66 0000 dw 0 ; ARGV[2] - 45626 00009F68 00 times 5 db 0 - 45627 ARGV2_ARGSW_WORD: - 45628 00009F6D 0000 dw 0 - 45629 00009F6F 0000 dw 0 - 45630 00009F71 00 times 671 db 0 ; ARGV[3] to ARGV[63] - 45631 ARG_ARGVCNT: - 45632 0000A210 0000 dw 0 - 45633 ARG_ARGSWINFO: - 45634 0000A212 0000 dw 0 - 45635 ARG_ARGBUF: - 45636 ;times 256 dw 0 ; times ARGBLEN dw 0 - 45637 ; 27/07/2024 PCDOS 7.1 COMMAND.COM - 45638 0000A214 0000 times 128 dw 0 ; times ARGBLEN dw 0 - 45639 ARG_ARGFORCOMBUF: - 45640 0000A314 00 times 128 db 0 ; times COMBUFLEN db 0 - 45641 - 45642 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9649h - 45643 ; 18/06/2023 - 45644 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0AD19h - 45645 ; 03/08/2024 - 45646 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 0A823h - 45647 ARGBUF_PTR: - 45648 0000A394 0000 dw 0 ; index for argv[].argpointer - 45649 TPBUF: ; temporary buffer - 45650 Arg_Buf: ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 45651 0000A396 00 times 128 db 0 - 45652 LASTARG: - 45653 0000A416 0000 dw 0 ; point at which to accumulate switch info - 45654 0000A418 0000 COMPTR: dw 0 ; ptr into combuf - 45655 - 45656 ; Data declarations taken out of path.asm - 45657 ;fbuf find_buf <> ; dma buffer for findfirst/findnext - 45658 ;pathinfo DW 3 DUP (?) ; ES, SI(old), and SI(new) of user path - 45659 ;psep_char DB ? ; '/' or '\' - 45660 ;search_best DB (?) ; best code, best filename so far - 45661 ;fname_max_len equ 13 - 45662 ;search_best_buf DB fname_max_len DUP (?) - 45663 ;search_curdir_buf DB 64 DUP (?) ; a place for CurDir info, if successful - 45664 ;search_error DW (?) ; address of error message to be printed - 45665 - 45666 FINDBUFLEN equ FIND_BUF.size ; 43 - 45667 - 45668 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 96CFh - 45669 - 45670 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45671 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0AD9Fh + 45602 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45603 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0A7D5h + 45604 + 45605 ; 13/08/2024 - Retro DOS v5.0 COMMAND.COM + 45606 ; PCDOS 7.1 COMMAND.COM (20023) Transient portion offset 0A3DFh + 45607 ARG: + 45608 ARG_ARGV: + 45609 ARGV0_ARGPOINTER: + 45610 00009F50 0000 dw 0 ; ARGV[0] + 45611 ARGV0_ARG_FLAGS: + 45612 00009F52 00 db 0 + 45613 ARGV0_ARGSTARTEL: + 45614 00009F53 0000 dw 0 + 45615 ARGV0_ARGLEN: + 45616 00009F55 0000 dw 0 + 45617 ARGV0_ARGSW_WORD: + 45618 00009F57 0000 dw 0 + 45619 ARGV0_OCOMPTR: + 45620 00009F59 0000 dw 0 + 45621 ARGV1_ARGPOINTER: + 45622 00009F5B 0000 dw 0 ; ARGV[1] + 45623 00009F5D 00 times 5 db 0 + 45624 ARGV1_ARGSW_WORD: + 45625 00009F62 0000 dw 0 + 45626 00009F64 0000 dw 0 + 45627 ARGV2_ARGPOINTER: + 45628 00009F66 0000 dw 0 ; ARGV[2] + 45629 00009F68 00 times 5 db 0 + 45630 ARGV2_ARGSW_WORD: + 45631 00009F6D 0000 dw 0 + 45632 00009F6F 0000 dw 0 + 45633 00009F71 00 times 671 db 0 ; ARGV[3] to ARGV[63] + 45634 ARG_ARGVCNT: + 45635 0000A210 0000 dw 0 + 45636 ARG_ARGSWINFO: + 45637 0000A212 0000 dw 0 + 45638 ARG_ARGBUF: + 45639 ;times 256 dw 0 ; times ARGBLEN dw 0 + 45640 ; 27/07/2024 PCDOS 7.1 COMMAND.COM + 45641 0000A214 0000 times 128 dw 0 ; times ARGBLEN dw 0 + 45642 ARG_ARGFORCOMBUF: + 45643 0000A314 00 times 128 db 0 ; times COMBUFLEN db 0 + 45644 + 45645 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9649h + 45646 ; 18/06/2023 + 45647 ; MSDOS 6.22 COMMAND.COM (1994) Transient portion offset 0AD19h + 45648 ; 03/08/2024 + 45649 ; PCDOS 7.1 COMMAND.COM (2003) Transient portion offset 0A823h + 45650 ARGBUF_PTR: + 45651 0000A394 0000 dw 0 ; index for argv[].argpointer + 45652 TPBUF: ; temporary buffer + 45653 Arg_Buf: ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 45654 0000A396 00 times 128 db 0 + 45655 LASTARG: + 45656 0000A416 0000 dw 0 ; point at which to accumulate switch info + 45657 0000A418 0000 COMPTR: dw 0 ; ptr into combuf + 45658 + 45659 ; Data declarations taken out of path.asm + 45660 ;fbuf find_buf <> ; dma buffer for findfirst/findnext + 45661 ;pathinfo DW 3 DUP (?) ; ES, SI(old), and SI(new) of user path + 45662 ;psep_char DB ? ; '/' or '\' + 45663 ;search_best DB (?) ; best code, best filename so far + 45664 ;fname_max_len equ 13 + 45665 ;search_best_buf DB fname_max_len DUP (?) + 45666 ;search_curdir_buf DB 64 DUP (?) ; a place for CurDir info, if successful + 45667 ;search_error DW (?) ; address of error message to be printed + 45668 + 45669 FINDBUFLEN equ FIND_BUF.size ; 43 + 45670 + 45671 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 96CFh 45672 - 45673 0000A41A 00 FBUF: times FINDBUFLEN db 0 ; times 43 db 0 - 45674 FBUF_PNAME equ FBUF+30 ; packed name, 13 bytes - 45675 pathinfo: - 45676 ;pathinfo_0: - 45677 0000A445 0000 dw 0 - 45678 ;pathinfo_2: - 45679 0000A447 0000 dw 0 - 45680 ;pathinfo_4: - 45681 0000A449 0000 dw 0 - 45682 psep_char: - 45683 0000A44B 00 db 0 - 45684 search_best: - 45685 0000A44C 00 db 0 - 45686 FNAME_MAX_LEN equ 13 - 45687 search_best_buf: - 45688 0000A44D 00 times FNAME_MAX_LEN db 0 ; times 13 db 0 - 45689 search_curdir_buf: - 45690 0000A45A 00 times 64 db 0 - 45691 search_error: - 45692 0000A49A 0000 dw 0 - 45693 - 45694 ; Data declarations taken out of tbatch.asm - 45695 - 45696 ;if_not_count DW ? - 45697 ; - 45698 ;zflag db ? ; Used by typefil to indicate ^Z's - 45699 ; - 45700 ; DW 80H DUP(0) ; Init to 0 to make sure the linker is not fooled - 45701 - 45702 ; 31/03/2023 - 45703 ;STACK: ;LABEL WORD + 45673 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45674 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0AD9Fh + 45675 + 45676 0000A41A 00 FBUF: times FINDBUFLEN db 0 ; times 43 db 0 + 45677 FBUF_PNAME equ FBUF+30 ; packed name, 13 bytes + 45678 pathinfo: + 45679 ;pathinfo_0: + 45680 0000A445 0000 dw 0 + 45681 ;pathinfo_2: + 45682 0000A447 0000 dw 0 + 45683 ;pathinfo_4: + 45684 0000A449 0000 dw 0 + 45685 psep_char: + 45686 0000A44B 00 db 0 + 45687 search_best: + 45688 0000A44C 00 db 0 + 45689 FNAME_MAX_LEN equ 13 + 45690 search_best_buf: + 45691 0000A44D 00 times FNAME_MAX_LEN db 0 ; times 13 db 0 + 45692 search_curdir_buf: + 45693 0000A45A 00 times 64 db 0 + 45694 search_error: + 45695 0000A49A 0000 dw 0 + 45696 + 45697 ; Data declarations taken out of tbatch.asm + 45698 + 45699 ;if_not_count DW ? + 45700 ; + 45701 ;zflag db ? ; Used by typefil to indicate ^Z's + 45702 ; + 45703 ; DW 80H DUP(0) ; Init to 0 to make sure the linker is not fooled 45704 - 45705 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9751h - 45706 - 45707 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45708 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0AE21h + 45705 ; 31/03/2023 + 45706 ;STACK: ;LABEL WORD + 45707 + 45708 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9751h 45709 - 45710 ; 14/08/2024 - Retro DOS v5.0 COMMAND.COM - 45711 ; MSDOS 7.1 COMMAND.COM - TRANGROUP:0A92Bh - 45712 IF_NOT_COUNT: - 45713 0000A49C 0000 dw 0 - 45714 - 45715 align 2 ; 18/06/2023 - 45716 - 45717 0000A49E 00 times 256 db 0 - 45718 - 45719 ; 16/04/2023 - 45720 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:9854h + 45710 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45711 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0AE21h + 45712 + 45713 ; 14/08/2024 - Retro DOS v5.0 COMMAND.COM + 45714 ; MSDOS 7.1 COMMAND.COM - TRANGROUP:0A92Bh + 45715 IF_NOT_COUNT: + 45716 0000A49C 0000 dw 0 + 45717 + 45718 align 2 ; 18/06/2023 + 45719 + 45720 0000A49E 00 times 256 db 0 45721 - 45722 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM - 45723 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0AF24h - 45724 STACK: - 45725 - 45726 ;INTERNATVARS internat_block <> - 45727 ; db (internat_block_max - ($ - INTERNATVARS)) DUP (?) + 45722 ; 16/04/2023 + 45723 ; MSDOS 5.0 COMMAND.COM - TRANGROUP:9854h + 45724 + 45725 ; 18/06/2023 - Retro DOS v4.2 COMMAND.COM + 45726 ; MSDOS 6.22 COMMAND.COM - TRANGROUP:0AF24h + 45727 STACK: 45728 - 45729 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9854h - 45730 INTERNATVARS: - 45731 ; (24+8 = 32 bytes) - 45732 DATE_TIME_FORMAT: - 45733 0000A59E 0000 dw 0 ; 0-USA, 1-EUR, 2-JAP - 45734 CURRENCY_SYM: - 45735 0000A5A0 0000000000 db 0,0,0,0,0 ; times 5 db 0 ; Currency Symbol 5 bytes - 45736 THOUS_SEP: - 45737 0000A5A5 0000 db 0,0 ; Thousands separator 2 bytes - 45738 DECIMAL_SEP: - 45739 0000A5A7 0000 db 0,0 ; Decimal separator 2 bytes - 45740 DATE_SEP: - 45741 0000A5A9 0000 db 0,0 ; Date separator 2 bytes - 45742 TIME_SEP: - 45743 0000A5AB 0000 db 0,0 ; Time separator 2 bytes - 45744 BIT_FIELD: - 45745 0000A5AD 00 db 0 ; Bit values - 45746 ; Bit 0 = 0 if currency symbol first - 45747 ; = 1 if currency symbol last - 45748 ; Bit 1 = 0 if No space after currency symbol - 45749 ; = 1 if space after currency symbol - 45750 CURRENCY_CENTS: - 45751 0000A5AE 00 db 0 ; Number of places after currency dec point - 45752 TIME_24: - 45753 0000A5AF 00 db 0 ; 1 if 24 hour time, 0 if 12 hour time - 45754 MAP_CALL: - 45755 0000A5B0 00000000 dw 0,0 ; dd 0 ; Address of case mapping call (DWORD) - 45756 ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED - 45757 ; in pieces. - 45758 DATA_SEP: - 45759 0000A5B4 0000 db 0,0 ; Data list separator character - 45760 - 45761 0000A5B6 00 times 8 db 0 - 45762 - 45763 ; Max size of the block returned by the INTERNATIONAL call - 45764 - 45765 INTERNAT_BLOCK_SIZE EQU 32 - 45766 - 45767 ;; Buffer for DOS function 64h (Get extended country information) - 45768 ;; subfunctions 2, 4, 6, or 7: - 45769 ; - 45770 ;CountryPtrInfo label byte - 45771 ;CountryPtrId db ? - 45772 ;CountryPtr dd ? - 45773 ; .erre (($ - CountryPtrInfo) GE 5) - 45774 - 45775 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9874h - 45776 CountryPtrInfo: - 45777 CountryPtrId: - 45778 0000A5BE 00 db 0 - 45779 CountryPtr: - 45780 0000A5BF 00000000 dd 0 - 45781 - 45782 OldCtrlCHandler: - 45783 0000A5C3 00000000 dd 0 ; previous int 23 vector + 45729 ;INTERNATVARS internat_block <> + 45730 ; db (internat_block_max - ($ - INTERNATVARS)) DUP (?) + 45731 + 45732 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9854h + 45733 INTERNATVARS: + 45734 ; (24+8 = 32 bytes) + 45735 DATE_TIME_FORMAT: + 45736 0000A59E 0000 dw 0 ; 0-USA, 1-EUR, 2-JAP + 45737 CURRENCY_SYM: + 45738 0000A5A0 0000000000 db 0,0,0,0,0 ; times 5 db 0 ; Currency Symbol 5 bytes + 45739 THOUS_SEP: + 45740 0000A5A5 0000 db 0,0 ; Thousands separator 2 bytes + 45741 DECIMAL_SEP: + 45742 0000A5A7 0000 db 0,0 ; Decimal separator 2 bytes + 45743 DATE_SEP: + 45744 0000A5A9 0000 db 0,0 ; Date separator 2 bytes + 45745 TIME_SEP: + 45746 0000A5AB 0000 db 0,0 ; Time separator 2 bytes + 45747 BIT_FIELD: + 45748 0000A5AD 00 db 0 ; Bit values + 45749 ; Bit 0 = 0 if currency symbol first + 45750 ; = 1 if currency symbol last + 45751 ; Bit 1 = 0 if No space after currency symbol + 45752 ; = 1 if space after currency symbol + 45753 CURRENCY_CENTS: + 45754 0000A5AE 00 db 0 ; Number of places after currency dec point + 45755 TIME_24: + 45756 0000A5AF 00 db 0 ; 1 if 24 hour time, 0 if 12 hour time + 45757 MAP_CALL: + 45758 0000A5B0 00000000 dw 0,0 ; dd 0 ; Address of case mapping call (DWORD) + 45759 ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED + 45760 ; in pieces. + 45761 DATA_SEP: + 45762 0000A5B4 0000 db 0,0 ; Data list separator character + 45763 + 45764 0000A5B6 00 times 8 db 0 + 45765 + 45766 ; Max size of the block returned by the INTERNATIONAL call + 45767 + 45768 INTERNAT_BLOCK_SIZE EQU 32 + 45769 + 45770 ;; Buffer for DOS function 64h (Get extended country information) + 45771 ;; subfunctions 2, 4, 6, or 7: + 45772 ; + 45773 ;CountryPtrInfo label byte + 45774 ;CountryPtrId db ? + 45775 ;CountryPtr dd ? + 45776 ; .erre (($ - CountryPtrInfo) GE 5) + 45777 + 45778 ; MSDOS 5.0 COMMAND.COM (1991) Transient portion offset 9874h + 45779 CountryPtrInfo: + 45780 CountryPtrId: + 45781 0000A5BE 00 db 0 + 45782 CountryPtr: + 45783 0000A5BF 00000000 dd 0 45784 - 45785 BATLEN equ 32 - 45786 - 45787 BATBUFPOS: - 45788 0000A5C7 0000 dw 0 ; integer position in buffer of next byte + 45785 OldCtrlCHandler: + 45786 0000A5C3 00000000 dd 0 ; previous int 23 vector + 45787 + 45788 BATLEN equ 32 45789 - 45790 0000A5C9 00 BATBUF: times BATLEN db 0 ; times 32 db 0 - 45791 BATBUFEND: - 45792 0000A5E9 0000 dw 0 - 45793 - 45794 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM - 45795 %if 0 - 45796 TypeFilSiz: - 45797 dd 0 ; stores size of file to be typed - 45798 %endif - 45799 - 45800 ; ***************************************************** - 45801 ; EMG 4.00 - 45802 ; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00 - 45803 ; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE - 45804 ; ***************************************************** - 45805 ; - 45806 ; COMMON PARSE OUTPUT BLOCKS - 45807 - 45808 ; Common output blocks for PARSE number, complex, or string values. - 45809 - 45810 PARSE1_OUTPUT: - 45811 PARSE1_TYPE: - 45812 0000A5EB 00 db 0 ;AN000; type - 45813 PARSE1_CODE: - 45814 0000A5EC 00 db 0 ;AN000; return value - 45815 PARSE1_SYN: - 45816 0000A5ED 0000 dw 0 ;AN000; es offset of synonym - 45817 PARSE1_ADDR: - 45818 0000A5EF 00000000 dd 0 ;AN000; numeric value / address - 45819 ; of string value - 45820 - 45821 ; Common output block for PARSE date strings. - 45822 - 45823 DATE_OUTPUT: - 45824 DATE_TYPE: - 45825 0000A5F3 00 db 0 ;AN000; type - 45826 0000A5F4 00 db 0 ;AN000; return value - 45827 0000A5F5 0000 dw 0 ;AN000; es offset of synonym - 45828 DATE_YEAR: - 45829 0000A5F7 0000 dw 0 ;AN000; year - 45830 DATE_MONTH: - 45831 0000A5F9 00 db 0 ;AN000; month - 45832 DATE_DAY: - 45833 0000A5FA 00 db 0 ;AN000; day - 45834 - 45835 ; Common output block for PARSE time strings. - 45836 - 45837 TIME_OUTPUT: - 45838 TIME_TYPE: - 45839 0000A5FB 00 db 0 ;AN000; type - 45840 0000A5FC 00 db 0 ;AN000; return value - 45841 0000A5FD 0000 dw 0 ;AN000; es offset of synonym - 45842 TIME_HOUR: - 45843 0000A5FF 00 db 0 ;AN000; hour - 45844 TIME_MINUTES: - 45845 0000A600 00 db 0 ;AN000; minutes - 45846 TIME_SECONDS: - 45847 0000A601 00 db 0 ;AN000; seconds - 45848 TIME_FRACTION: - 45849 0000A602 00 db 0 ;AN000; hundredths - 45850 - 45851 ; Common output block for PARSE drive specifier (one based drive number). - 45852 - 45853 DRIVE_OUTPUT: - 45854 DRIVE_TYPE: - 45855 0000A603 00 db 0 ;AN000; type - 45856 DRIVE_VALUE: - 45857 0000A604 00 db 0 ;AN000; return value - 45858 0000A605 0000 dw 0 ;AN000; es offset of synonym - 45859 DRIVE_NUMBER: - 45860 0000A607 00 db 0 ;AN000; drive number - 45861 0000A608 000000 db 0,0,0 ;AN000; reserved - 45862 - 45863 ; 18/04/2023 - 45864 ; 16/04/2023 - 45865 ;TRANSPACEEND: ; 98C5h - 45866 ; End of MSDOS 5.0 COMMAND.COM (1991) Transient portion - 45867 - 45868 ; 18/06/2023 - 45869 ;TRANSPACEEND: ; 0AF95h - 45870 ; End of MSDOS 6.22 COMMAND.COM (1994) Transient portion - 45871 - 45872 ; ---------------------------------------------------------------------------- - 45873 ; 18/06/2023 - 45874 ; 20/04/2023 - 45875 ; 14/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM - 45876 TRANSPACEEND equ ($-TRANSIENTSTART) ; Transient portion size + 45790 BATBUFPOS: + 45791 0000A5C7 0000 dw 0 ; integer position in buffer of next byte + 45792 + 45793 0000A5C9 00 BATBUF: times BATLEN db 0 ; times 32 db 0 + 45794 BATBUFEND: + 45795 0000A5E9 0000 dw 0 + 45796 + 45797 ; 03/08/2024 - PCDOS 7.1 COMMAND.COM + 45798 %if 0 + 45799 TypeFilSiz: + 45800 dd 0 ; stores size of file to be typed + 45801 %endif + 45802 + 45803 ; ***************************************************** + 45804 ; EMG 4.00 + 45805 ; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00 + 45806 ; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE + 45807 ; ***************************************************** + 45808 ; + 45809 ; COMMON PARSE OUTPUT BLOCKS + 45810 + 45811 ; Common output blocks for PARSE number, complex, or string values. + 45812 + 45813 PARSE1_OUTPUT: + 45814 PARSE1_TYPE: + 45815 0000A5EB 00 db 0 ;AN000; type + 45816 PARSE1_CODE: + 45817 0000A5EC 00 db 0 ;AN000; return value + 45818 PARSE1_SYN: + 45819 0000A5ED 0000 dw 0 ;AN000; es offset of synonym + 45820 PARSE1_ADDR: + 45821 0000A5EF 00000000 dd 0 ;AN000; numeric value / address + 45822 ; of string value + 45823 + 45824 ; Common output block for PARSE date strings. + 45825 + 45826 DATE_OUTPUT: + 45827 DATE_TYPE: + 45828 0000A5F3 00 db 0 ;AN000; type + 45829 0000A5F4 00 db 0 ;AN000; return value + 45830 0000A5F5 0000 dw 0 ;AN000; es offset of synonym + 45831 DATE_YEAR: + 45832 0000A5F7 0000 dw 0 ;AN000; year + 45833 DATE_MONTH: + 45834 0000A5F9 00 db 0 ;AN000; month + 45835 DATE_DAY: + 45836 0000A5FA 00 db 0 ;AN000; day + 45837 + 45838 ; Common output block for PARSE time strings. + 45839 + 45840 TIME_OUTPUT: + 45841 TIME_TYPE: + 45842 0000A5FB 00 db 0 ;AN000; type + 45843 0000A5FC 00 db 0 ;AN000; return value + 45844 0000A5FD 0000 dw 0 ;AN000; es offset of synonym + 45845 TIME_HOUR: + 45846 0000A5FF 00 db 0 ;AN000; hour + 45847 TIME_MINUTES: + 45848 0000A600 00 db 0 ;AN000; minutes + 45849 TIME_SECONDS: + 45850 0000A601 00 db 0 ;AN000; seconds + 45851 TIME_FRACTION: + 45852 0000A602 00 db 0 ;AN000; hundredths + 45853 + 45854 ; Common output block for PARSE drive specifier (one based drive number). + 45855 + 45856 DRIVE_OUTPUT: + 45857 DRIVE_TYPE: + 45858 0000A603 00 db 0 ;AN000; type + 45859 DRIVE_VALUE: + 45860 0000A604 00 db 0 ;AN000; return value + 45861 0000A605 0000 dw 0 ;AN000; es offset of synonym + 45862 DRIVE_NUMBER: + 45863 0000A607 00 db 0 ;AN000; drive number + 45864 0000A608 000000 db 0,0,0 ;AN000; reserved + 45865 + 45866 ; 18/04/2023 + 45867 ; 16/04/2023 + 45868 ;TRANSPACEEND: ; 98C5h + 45869 ; End of MSDOS 5.0 COMMAND.COM (1991) Transient portion + 45870 + 45871 ; 18/06/2023 + 45872 ;TRANSPACEEND: ; 0AF95h + 45873 ; End of MSDOS 6.22 COMMAND.COM (1994) Transient portion + 45874 + 45875 ; ---------------------------------------------------------------------------- + 45876 ; 18/06/2023 + 45877 ; 20/04/2023 + 45878 ; 14/08/2024 - Retro DOS v5.0 (PCDOS 7.1) COMMAND.COM + 45879 TRANSPACEEND equ ($-TRANSIENTSTART) ; Transient portion size diff --git a/retrodos5/command/command7_2024.zip b/retrodos5/command/command7_2024.zip index 9842c80a..c8e636be 100644 Binary files a/retrodos5/command/command7_2024.zip and b/retrodos5/command/command7_2024.zip differ