From: Robert Pengelly Date: Sat, 24 Aug 2024 15:17:56 +0000 (+0100) Subject: Command manipulation X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=13067957c813b1d1c5ede4dd2556c45033398580;p=chimaera.git Command manipulation --- diff --git a/build/chimaera.img b/build/chimaera.img index ca1e7c2..2b9ed57 100644 Binary files a/build/chimaera.img and b/build/chimaera.img differ diff --git a/build/chimaera.vhd b/build/chimaera.vhd index 14c5bb5..b1a091a 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 81272c8..7dfad70 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -96,18 +96,27 @@ _main: mov ah, HEX (08) int HEX (21) + cmp al, HEX (47) + je .L74 + cmp al, HEX (48) je .L1 cmp al, HEX (4B) - je .L4 + je .L57 + + cmp al, HEX (4D) + je .L58 - ;cmp al, HEX (4D) - ;je .L58 + cmp al, HEX (4F) + je .L75 cmp al, HEX (50) je .L2 + cmp al, HEX (53) + je .L71 + jmp .L11 .L10: @@ -552,13 +561,101 @@ _main: cmp al, HEX (7F) ja .L11 - mov ah, HEX (02) - mov dl, al - int HEX (21) + push ax + push bx + push cx + push dx + push si + push di + push ax + + mov bx, offset _scratch + + mov ax, di + sub ax, bx + + mov cl, ch + xor ch, ch + + cmp ax, cx + je .L68 + + push cx + mov si, offset _scratch + mov di, offset _temp + + push ax + push cx + + mov cx, ax + rep movsb + + xor al, al stosb + + pop cx + pop ax + + sub cx, ax + rep movsb + + xor al, al + stosb + + pop cx + inc cx + + mov si, offset _temp + mov di, offset _scratch + + rep movsb + +.L68: + + pop ax + pop di + +.L69: + + stosb + + mov ax, HEX (0300) + xor bx, bx + int HEX (10) + + mov bx, di + dec bx + + call _writestr + + cmp dl, HEX (4F) + jb .L73 + + xor dl, dl + inc dh + + jmp .L70 + +.L73: + + add dl, 1 + +.L70: + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + pop si + pop dx + + pop cx inc ch + pop bx + pop ax + jmp .L11 .L58: @@ -658,8 +755,141 @@ _main: .L4: - call _handle_backspace - jmp .L11 + cmp di, offset _scratch + je .L11 + + push es + push ds + push ax + push bx + push cx + push dx + push si + push di + + mov bx, offset _scratch + + mov ax, di + sub ax, bx + + mov cl, ch + xor ch, ch + + mov si, di + dec di + + sub cx, ax + rep movsb + + xor al, al + stosb + + call _erase_char + pop di + dec di + + mov ax, HEX (0300) + xor bx, bx + int HEX (10) + + mov cx, dx + + mov bx, di + call _writestr + + mov ah, HEX (02) + xor dl, dl + int HEX (21) + + mov dx, cx + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + pop si + pop dx + + pop cx + dec ch + + pop bx + pop ax + pop ds + pop es + + jmp .L11 + +.L71: + + push ax + push bx + push cx + push dx + push si + push di + + mov bx, offset _scratch + + mov ax, di + sub ax, bx + + mov cl, ch + xor ch, ch + + cmp ax, cx + je .L72 + + mov si, di + inc si + + sub cx, ax + rep movsb + + xor al, al + stosb + + pop di + + mov ax, HEX (0300) + xor bx, bx + int HEX (10) + + mov cx, dx + + mov bx, di + call _writestr + + mov ah, HEX (02) + xor dl, dl + int HEX (21) + + mov dx, cx + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + pop si + pop dx + + pop cx + dec ch + + pop bx + pop ax + + jmp .L11 + +.L72: + + pop si + pop dx + pop cx + pop bx + pop ax + + jmp .L11 .L3: @@ -1053,6 +1283,68 @@ _main: call _history_down jmp .L11 +.L75: + + and ch, ch + jz .L11 + + push ax + push bx + push cx + push dx + + xor ah, ah + mov al, cs:[_curr_col] + + xor dx, dx + + mov cl, ch + xor ch, ch + + add ax, cx + + mov di, offset _scratch + add di, cx + + mov cx, 80 + div cx + + mov dh, cs:[_curr_row] + add dh, al + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + pop dx + pop cx + pop bx + pop ax + + jmp .L11 + +.L74: + + push ax + push bx + push cx + push dx + + mov dh, cs:[_curr_row] + mov dl, cs:[_curr_col] + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + mov di, offset _scratch + pop dx + pop cx + pop bx + pop ax + + jmp .L11 + ;****************************************************************************** ; @function _format_path ;****************************************************************************** diff --git a/src/apps/pcomm/writestr.asm b/src/apps/pcomm/writestr.asm index 161b82e..64cc800 100644 --- a/src/apps/pcomm/writestr.asm +++ b/src/apps/pcomm/writestr.asm @@ -16,6 +16,7 @@ _writestr: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; push ax push bx + push dx push si push bp @@ -66,6 +67,7 @@ _writestr.done: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pop bp pop si + pop dx pop bx pop ax