From: Robert Pengelly Date: Fri, 27 Sep 2024 21:20:00 +0000 (+0100) Subject: Search .bat as well as .com X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=be3ba9989c50bd199c08ed9a314245fc846894b6;p=chimaera.git Search .bat as well as .com --- diff --git a/build/chimaera.img b/build/chimaera.img index 0e30930..9a4a3d2 100644 Binary files a/build/chimaera.img and b/build/chimaera.img differ diff --git a/build/chimaera.vhd b/build/chimaera.vhd index e629017..fffe6cb 100644 Binary files a/build/chimaera.vhd and b/build/chimaera.vhd differ diff --git a/src/apps/pcomm/pcomm.asm b/src/apps/pcomm/pcomm.asm index ff12bf4..395aec2 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -2238,20 +2238,26 @@ _process_line: mov word ptr cs:[_need_ext], 1 add bx, ax + mov si, offset _ext_table + mov cx, offset _ext_count + +.L106: + + mov dx, di + push di + push cx - mov al, '.' - stosb + mov ax, cs:[si + 2] + mov cx, cs:[si] - mov al, 'c' - stosb - - mov al, 'o' - stosb + add si, offset _ext_size + push si - mov al, 'm' - stosb + mov si, ax + rep movsb + push dx jmp .L25 .L24: @@ -2274,7 +2280,7 @@ _process_line: mov word ptr cs:[_in_batch], 0 - mov ax, offset _ext_batch + mov ax, offset _ext_bat push ax call _strcmp @@ -2295,6 +2301,14 @@ _process_line: jc .L107 add sp, 4 + + cmp word ptr cs:[_need_ext], 1 + jne .L101 + + pop si + pop cx + pop di + jmp .L101 .L104: @@ -2313,9 +2327,16 @@ _process_line: mov ax, HEX (4B00) int HEX (21) pop bx - jnc .L101 + jc .L103 + + cmp word ptr cs:[_need_ext], 1 + jne .L101 - jmp .L103 + pop si + pop cx + pop di + + jmp .L101 .L107: @@ -2395,6 +2416,13 @@ _process_line: pop bx pop ax + cmp word ptr cs:[_need_ext], 1 + jne .L101 + + pop si + pop cx + pop di + jmp .L101 .L97: @@ -2407,6 +2435,18 @@ _process_line: .L98: + cmp word ptr cs:[_need_ext], 1 + jne .L108 + + pop si + pop cx + pop di + + dec cx + jnz .L106 + +.L108: + mov bx, offset _err_invalid call _writestr @@ -2748,9 +2788,8 @@ _autoexec: db "AUTOEXEC.BAT", HEX (00) _batch_flags: db "r", HEX (00) _in_batch: dw HEX (0000) -_ext_batch: db ".bat", HEX (00) - _ll_scratch: dw HEX (0000) + _fn_wild: db "*.*", HEX (00) _dta_addr: dw HEX (0000) @@ -2787,10 +2826,25 @@ global _curr_drive _curr_drive: db HEX (00) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Commands. +;; Commands and extensions. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %include "cmdhash.gen" +_ext_com: db ".com", HEX (00) +_ext_bat: db ".bat", HEX (00) + _cmd_size: equ 6 +_ext_size: equ 4 + +align 4 +_ext_table: + + dw HEX (0004) + dw offset _ext_com + + dw HEX (0004) + dw offset _ext_bat + +_ext_count: equ ($ - _ext_table) / _ext_size align 4 _cmd_table: