From bf0d71ea8a2ecdd8b311ec020ce6934629ddac57 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Thu, 1 Aug 2024 23:26:07 +0100 Subject: [PATCH] Added tab auto-complete --- build/chimaera.img | Bin 368640 -> 368640 bytes build/chimaera.vhd | Bin 34120704 -> 34120704 bytes src/apps/pcomm/Makefile.unix | 2 +- src/apps/pcomm/dir.asm | 19 +- src/apps/pcomm/pcomm.asm | 340 +++++++++++++++++++++++++++++++-- src/apps/pcomm/vector.asm | 8 +- src/apps/pcomm/xmalloc.asm | 11 +- src/apps/pcomm/xstrcpy.asm | 11 +- src/kernel/int21.asm | 16 +- src/lib/crt/stdlib/realloc.asm | 10 +- 10 files changed, 372 insertions(+), 45 deletions(-) diff --git a/build/chimaera.img b/build/chimaera.img index fbf278fafeef33232f3f63e70847825ca00be465..f8cac9ef2c837c8b4d163e57b9c2c2a6778598ce 100644 GIT binary patch delta 4900 zcmZ`+3s_TEw%+F?Bmp6WM*;-MLvx}a9*J)uDvBaL&_I-@O6#??c&!geU}{xx(61gr zZpYnr#Hu642ZGF?;3t|wahquXl-Yw(JI9vAi`ZIh_#)$d|&onXYIY$ zUVE*7Jt%W1${dP!M+#T^r8b`$9YhOa$_AQh{4NRhh>X9`e$rB%oywtd5aMU#{hPIT z@ehGrADP1P=8IH{x6yA~KO@ zmp;>xULAR&Bad|zDTqJA@>hSaBj4)CH#+jAj(Y@WfOS(xuIq?PM?TSU-K1LwEQgL< z(2?^xa#oiOM}YHZ9jVumS{*qGoLf9+zm8Pv$Ok%tfpeMX?9!2UbY#1ZY|~{2kVcTv zOV0PQ<17erl@CYJZycoiA@we4k-+(yjImNvi}rf zCfcTdto%So?ZF#Y%O^jM^bNB_aVh;t>{OA&zewP2 zMXBZ8bdiKO5qzD(7gmRjP#LFuRo?}=}f0kiwb|Babctycfp+;$6hd(Ts87)wfY2oVZEcU8MGmb{2Kg>%BQ9cp; zh{sMFk%mf@^me7VQYmRr`aV+nQIS%8RK%(%WkD2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mf=l3Ma2asW0Db{(a0N7iCU6z}3a)|cpc&i%H$e-y1zJHH zxDD=ryPzF(08inn7I76IDM(6^isVC5lQbko@+J9^x{&-y0i-}uSCW<#L<%P9NFk(9 zQW&WlsXHm0q$fp?B1uuCXi^NxKr)hINpU0-$xMnT^&s^m^&<5q^&usY`jRA4KT;ye zLVASsD5*c`F;Ws~0O@hkK++&mGAV^Lm^6emlr)SqoHT+ok~E4mnv_Z!LmEpOM@l1& zCruztBuyesCRs^SNK;Aaq-mrlNYhC(NExI|(oE7U(rnTk(p=I!(jQ1qlAa;TZ6uYDHjzq6n@L+pACW#LZ6$p|DkE(pZ71y@eM*qn)ENyS<=5rb);`d-;(M{=Sbg?z9*e0{XqJWbb<5}=_2V8 z>1Wbq5+^l~ej&L@S4fSdCel^XucT|F>!fDV4bn|g3+WcAmDEPMO}az6OKK-|kUS!$ zKLrXRNkLMQR3smgT2YPZPw~pO-CD&C#XmMNMYwYC=kq^|M5#y63w;MniFjE|3pa$m Pk@Q&fjOo~kZx{au=GUkv diff --git a/src/apps/pcomm/Makefile.unix b/src/apps/pcomm/Makefile.unix index 215b56d..ddb3cc1 100644 --- a/src/apps/pcomm/Makefile.unix +++ b/src/apps/pcomm/Makefile.unix @@ -46,7 +46,7 @@ genver: genver.c gcc -o $@ $^ endif -pcomm.com: ../../lib/crt/crt0.o cbreak.o cd.o crlf.o date.o dir.o erase.o exit.o history.o pcomm.o time.o type.o vector.o writedec.o writestr.o xmalloc.o xstrcpy.o ../../lib/crt/libc.a +pcomm.com: ../../lib/crt/crt0.o cbreak.o cd.o crlf.o date.o dir.o erase.o exit.o history.o pcomm.o time.o type.o vector.o writedec.o writehex.o writestr.o xmalloc.o xstrcpy.o ../../lib/crt/libc.a ../../utils/binutils/slink --oformat msdos -o $@ $^ %.o: %.asm diff --git a/src/apps/pcomm/dir.asm b/src/apps/pcomm/dir.asm index a15c65e..2e4a9d5 100644 --- a/src/apps/pcomm/dir.asm +++ b/src/apps/pcomm/dir.asm @@ -129,7 +129,7 @@ _handler_dir.next: inc ax cmp ax, cs:[_vec_files + 4] - ja _handler_dir.free + ja _handler_dir.cleanup mov word ptr [bp - 6], ax dec ax @@ -153,15 +153,26 @@ _handler_dir.next: call _walk_dir jmp _handler_dir.next -_handler_dir.free: +_handler_dir.cleanup: mov ax, cs:[_dta_addr] push ax call _free add sp, 2 - -_handler_dir.cleanup: + + push dx + push ds + + mov dx, HEX (80) + mov ax, cs + mov ds, ax + + mov ah, HEX (1A) + int HEX (21) + + pop ds + pop dx mov ax, cs:[_vec_files + 0] push ax diff --git a/src/apps/pcomm/pcomm.asm b/src/apps/pcomm/pcomm.asm index f8505d1..e4e3669 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -54,6 +54,36 @@ _main: and al, al jnz .L10 + mov bx, cs:[_dta_addr] + + and bx, bx + jz .L35 + + push bx + + call _free + add sp, 2 + + xor bx, bx + mov cs:[_dta_addr], bx + + push dx + push ds + push ax + + mov dx, HEX (80) + mov ax, cs + mov ds, ax + + mov ah, HEX (1A) + int HEX (21) + + pop ax + pop ds + pop dx + +.L35: + mov ah, HEX (08) int HEX (21) @@ -74,49 +104,315 @@ _main: jne .L14 push ax + push bx + push dx + push si + push cx + push di + + mov di, offset _temp + + mov ax, ' ' + push ax + + mov si, offset _scratch + push si + + call _strrchr + add sp, 4 + + and ax, ax + jz .L50 + + mov si, ax + inc si + +.L50: + + push si + + call _strlen + add sp, 2 + + mov cx, ax + +.L49: + + push cx + push di + + mov cx, 257 + xor al, al + + rep stosb + pop di + pop cx + rep movsb + + mov ax, cs:[_dta_addr] + + and ax, ax + jnz .L46 + + mov ax, 64 + xor dx, dx + + push ax push dx - xor ah, ah - mov al, ch + call _xmalloc + add sp, 4 + + mov cs:[_dta_addr], ax + + push ds + push dx + push ax + + mov ds, ax xor dx, dx - mov cx, 4 - div cx + mov ah, HEX (1A) + int HEX (21) - mov cx, 4 - sub cx, dx + pop ax + pop dx + pop ds + +.L51: + + mov bx, offset _temp - mov al, ' ' - push cx + cmp byte ptr [bx], 0 + jne .L40 + + mov bx, offset _fn_wild + jmp .L38 + +.L40: + + mov al, '*' + stosb + +.L38: + + mov ah, HEX (4E) + xor cx, cx + mov dx, bx + int HEX (21) + jc .L39 + +.L48: + + push es + push si + + mov ax, cs:[_dta_addr] + mov es, ax + + mov si, 30 + mov al, es:[si] + + pop si + pop es + + cmp al, '.' + je .L46 + +.L47: + + mov ax, '\\' + push ax + + mov ax, offset _temp + push ax + + call _strrchr + add sp, 4 + + mov bx, di + pop di + pop cx + + and ax, ax + jnz .L44 + + mov bx, offset _temp + push bx + + call _strlen + add sp, 2 + + mov bx, ax + jmp .L41 + +.L44: + + cmp byte ptr [bx - 1], '*' + jne .L53 + + inc ax + inc ax + + jmp .L52 + +.L53: + + inc ax + +.L52: + + sub bx, ax + +.L41: + + and bx, bx + jz .L42 + + call _handle_backspace + + dec bx + jnz .L41 + +.L42: + + push si + push ds + + mov ax, cs:[_dta_addr] + mov ds, ax + + mov si, 30 .L15: - and cx, cx + lodsb + + and al, al jz .L16 + cmp al, HEX (41) + jb .L45 + + cmp al, HEX (5A) + ja .L45 + + or al, HEX (20) + +.L45: + mov ah, HEX (02) mov dl, al int HEX (21) stosb - dec cx + inc ch jmp .L15 .L16: + pop ds + pop si + + jmp .L37 + +.L46: + + push dx + push ds + push ax + + mov ax, cs:[_dta_addr] + mov ds, ax + xor dx, dx + + mov ah, HEX (1A) + int HEX (21) + pop ax + pop ds pop dx - pop cx - add ch, al + mov ah, HEX (4F) + int HEX (21) + jc .L43 + + jmp .L48 + +.L39: + + mov ax, cs:[_dta_addr] + push ax + + call _free + add sp, 2 + + xor ax, ax + mov cs:[_dta_addr], ax + + push dx + push ds + push ax + + mov dx, HEX (80) + mov ax, cs + mov ds, ax + + mov ah, HEX (1A) + int HEX (21) + + pop ax + pop ds + pop dx + +.L43: + + pop di + pop cx + +.L37: + + pop si + pop dx + pop bx pop ax jmp .L11 .L14: + mov bx, cs:[_dta_addr] + + and bx, bx + jz .L36 + + push bx + + call _free + add sp, 2 + + xor bx, bx + mov cs:[_dta_addr], bx + + push dx + push ds + push ax + + mov dx, HEX (80) + mov ax, cs + mov ds, ax + + mov ah, HEX (1A) + int HEX (21) + + pop ax + pop ds + pop dx + +.L36: + cmp al, HEX (0D) je .L3 @@ -168,7 +464,7 @@ _main: push ax push dx - call _malloc + call _xmalloc add sp, 4 and ax, ax @@ -254,14 +550,14 @@ _main: mov si, bx xor ax, ax - push bx - xor bx, bx - lodsb - or al, al + and al, al jz .L7 + push bx + xor bx, bx + or al, HEX (20) mov bl, al @@ -414,8 +710,7 @@ _main: stosb mov dx, offset _app_path - - add bx, 1 + inc bx mov di, bx mov bx, offset _param_blk @@ -594,11 +889,12 @@ _get_command.done: pop dx pop ax pop si - pop bp add sp, 2 clc + pop bp + and bx, bx jz _get_command.ret @@ -896,7 +1192,11 @@ _err_invalid: db "Bad command or file name - ", HEX ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Data area. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +_fn_wild: db "*.*", HEX (00) +_temp: db 257 dup (0) + _need_ext: dw HEX (0000) +_dta_addr: dw HEX (0000) global _vec_history _vec_history: db 6 dup (0) diff --git a/src/apps/pcomm/vector.asm b/src/apps/pcomm/vector.asm index 9f89487..3e74644 100644 --- a/src/apps/pcomm/vector.asm +++ b/src/apps/pcomm/vector.asm @@ -44,8 +44,8 @@ _vec_adjust.set: _vec_adjust.alloc: - mov ax, 2 xor dx, dx + mov ax, 2 mul cx @@ -58,6 +58,9 @@ _vec_adjust.alloc: call _realloc add sp, 6 + and ax, ax + jz _vec_adjust.done + mov [bx + 0], ax _vec_adjust.done: @@ -95,7 +98,8 @@ _vec_push.alt: mov ax, [bx + 4] push ax - push word ptr [bp + 4] + mov ax, bx + push ax call _vec_adjust add sp, 4 diff --git a/src/apps/pcomm/xmalloc.asm b/src/apps/pcomm/xmalloc.asm index 5957544..13dd03e 100644 --- a/src/apps/pcomm/xmalloc.asm +++ b/src/apps/pcomm/xmalloc.asm @@ -27,7 +27,6 @@ _xmalloc: and ax, ax jnz _xmalloc.ok - pop ax pop di pop cx pop es @@ -45,18 +44,12 @@ _xmalloc: _xmalloc.ok: push ax - push bx dec ax mov es, ax - xor bx, bx - mov cx, es:[bx + 3] - - pop bx - pop ax - - push ax + mov cx, es:[HEX (0003)] + inc ax mov es, ax _xmalloc.loop: diff --git a/src/apps/pcomm/xstrcpy.asm b/src/apps/pcomm/xstrcpy.asm index 77c9b06..cbe9400 100644 --- a/src/apps/pcomm/xstrcpy.asm +++ b/src/apps/pcomm/xstrcpy.asm @@ -15,6 +15,7 @@ _xstrcpy: mov bp, sp push ax + push cx push si push di @@ -28,13 +29,16 @@ _xstrcpy.loop: or al, al jz _xstrcpy.done - cmp al, 90 + cmp al, HEX (7A) ja _xstrcpy.got_char - cmp al, 65 + cmp al, HEX (61) jb _xstrcpy.got_char - or al, HEX (20) + mov cl, HEX (20) + not cl + + and al, cl _xstrcpy.got_char: @@ -48,6 +52,7 @@ _xstrcpy.done: pop di pop si + pop cx pop ax pop bp ret diff --git a/src/kernel/int21.asm b/src/kernel/int21.asm index bff6bb3..9140701 100644 --- a/src/kernel/int21.asm +++ b/src/kernel/int21.asm @@ -229,9 +229,10 @@ _get_disk_info.got_disk: _get_disk_info.copy: push si + push ds - mov ds, ax xor si, si + mov ds, ax lodsw ;mov cs:[_curr_path], ax @@ -246,12 +247,16 @@ _get_disk_info.copy: mov cs:[_disk_scratch], ax mov di, offset _fat_bpb + push es + mov ax, cs mov es, ax mov cx, 25 rep movsb + pop es + lodsb mov cs:[_drive_no], al @@ -288,6 +293,7 @@ _get_disk_info.copy: lodsw mov cs:[_clustsize], ax + pop ds pop si mov bx, cs:[_root_cluster] @@ -311,8 +317,10 @@ _get_disk_info.fat32: _get_disk_info.done: - mov word ptr cs:[_fat_sector], ax - mov word ptr cs:[_fat_sector + 2], ax + xor ax, ax + + mov cs:[_fat_sector], ax + mov cs:[_fat_sector + 2], ax pop ds pop es @@ -330,8 +338,6 @@ _get_disk_info.done: _get_disk_info.error: - xor ax, ax - pop ds pop es pop di diff --git a/src/lib/crt/stdlib/realloc.asm b/src/lib/crt/stdlib/realloc.asm index 2e43b97..2bb888a 100644 --- a/src/lib/crt/stdlib/realloc.asm +++ b/src/lib/crt/stdlib/realloc.asm @@ -100,11 +100,19 @@ _realloc.alloc: ;; Call int 21h/ah=48 to allocate the blocks. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; push bx - mov bx, si mov ah, HEX (48) + mov bx, si int HEX (21) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Restoer the bx register. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pop bx + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Jump to error if the call fails. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; jc _realloc.error ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- 2.34.1