From: Robert Pengelly Date: Sun, 29 Sep 2024 11:41:27 +0000 (+0100) Subject: Toggle echo X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=b16f848c313901b2e1555f355ab738cfe5c393f9;p=chimaera.git Toggle echo --- diff --git a/build/chimaera.img b/build/chimaera.img index d8581c3..2c9457a 100644 Binary files a/build/chimaera.img and b/build/chimaera.img differ diff --git a/build/chimaera.vhd b/build/chimaera.vhd index 2ac110c..1e70211 100644 Binary files a/build/chimaera.vhd and b/build/chimaera.vhd differ diff --git a/src/Makefile.unix b/src/Makefile.unix index f33d33f..6377e4f 100644 --- a/src/Makefile.unix +++ b/src/Makefile.unix @@ -25,10 +25,12 @@ chimaera.img: all if [ -f autoexec.bat ]; then rm -rf autoexec.bat; fi if [ -f $@ ]; then rm -rf $@; fi + echo @echo off >> autoexec.bat echo set PATH=A:\\DOS >> autoexec.bat +# echo '%PATH%\\temp.bat' >> autoexec.bat # echo echo 123 >> temp.bat -# echo @ echo %PATH% >> temp.bat -# echo temp.bat >> temp.bat +# echo echo %PATH% >> temp.bat +# echo temp >> temp.bat utils/dosfstools/mkdosfs --boot boot/freeldr/bootsect/fat12.bin --sectors 720 -F 12 -n "CHIMAERA OS" $@ utils/dosfstools/mmd -i $@ boot boot/freeldr @@ -47,6 +49,7 @@ chimaera.vhd: all if [ -f autoexec.bat ]; then rm -rf autoexec.bat; fi if [ -f $@ ]; then rm -rf $@; fi + echo @echo off >> autoexec.bat echo set PATH=C:\\DOS >> autoexec.bat # echo echo %PATH% >> autoexec.bat # echo autoexec.bat >> autoexec.bat diff --git a/src/apps/pcomm/pcomm.asm b/src/apps/pcomm/pcomm.asm index 5f92e12..ef84c04 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -37,6 +37,11 @@ _main: .L5: + mov ax, cs:[_echo_line] + mov word ptr [bp - 4], ax + +.L119: + push es push di push cx @@ -165,12 +170,15 @@ _main: pop di pop es - jmp .L5 + jmp .L119 .L111: mov word ptr [_scratch_list], 0 + mov ax, word ptr [bp - 4] + mov cs:[_echo_line], ax + pop cx pop di pop es @@ -2122,9 +2130,75 @@ _handler_echo: push ax push dx push si - + push es + push ds + mov si, bx +_handler_echo.copy: + + push es + push ds + push si + push di + + mov ax, cs + mov es, ax + + mov di, offset _temp + push si + + call _strlen + add sp, 2 + + mov cx, ax + rep movsb + + xor al, al + stosb + + pop di + pop si + pop ds + pop es + + mov ax, cs + mov ds, ax + + mov si, offset _temp + +_handler_echo.check_off: + + push si + + mov ax, offset _echo_off + push ax + + call _strcmp + add sp, 4 + + and ax, ax + jnz _handler_echo.check_on + + mov word ptr cs:[_echo_line], 0 + jmp _handler_echo.done + +_handler_echo.check_on: + + push si + + mov ax, offset _echo_on + push ax + + call _strcmp + add sp, 4 + + and ax, ax + jnz _handler_echo.check + + mov word ptr cs:[_echo_line], 1 + jmp _handler_echo.done + _handler_echo.check: cmp word ptr cs:[_cbreak], 1 @@ -2153,6 +2227,8 @@ _handler_echo.newline: _handler_echo.done: + pop ds + pop es pop si pop dx pop ax @@ -2969,6 +3045,9 @@ _temp: db 257 dup (0) _autoexec: db "AUTOEXEC.BAT", HEX (00) _batch_flags: db "r", HEX (00) +_echo_off: db "off", HEX (00) +_echo_on: db "on", HEX (00) + _echo_line: dw HEX (0001) _in_batch: dw HEX (0000) _ll_scratch: dw HEX (0000)