From 347a945e29b540f439d85467db44cb2705ba9af4 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Fri, 23 Aug 2024 14:35:20 +0100 Subject: [PATCH] Bug fixes and start of left and right arrow key logic --- build/chimaera.img | Bin 368640 -> 368640 bytes build/chimaera.vhd | Bin 34120704 -> 34120704 bytes src/apps/pcomm/pcomm.asm | 224 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 212 insertions(+), 12 deletions(-) diff --git a/build/chimaera.img b/build/chimaera.img index 8c637b69ce9bd3769255441178dd483ea2ab54d6..ca1e7c2b1534bd86815bb9fb55b163cdfb27ef9a 100644 GIT binary patch delta 3446 zcmaJ@3s93+7QXot5=6jY6%jP~f8gU{A#47UpN4DOM4i_36bzkm;46mZ?3Ah;_cEVM1V@&spe7KtD!-Ev-DVI0p;p zE7>GxD4K+JCeAyfuN;-{nq4`{m8+d2^b?*}y@EFB$*((iayK#Q>WrD!hr#DU zQE=P~+o6Q1K@<$vtNM*TdK8n}olB>Q*#8!?(k)qJiCY_~!j&f!li}24xMR-#ODf`U zFX4`4l4I^n?!8Ph?B2w!%_Qb7)3m4cKrocPX(TUPOCs%E3EVrFT9BfV?xBLGsjnA|?0ov}9cAt08; zzCWbEWRRD;V>mH`yxF~s>&gH$Jh|O%; zHZuBhq>}E{3<@;^#yj|z%6?%-OkNv@?p`fcIz71Vyins#+N)9lu{->&ibBJ6d}u%* zHK(@Q2L&6bU@PQyLItH-l}D+u;<}51(U;Y?OYT37F!L=8*fK3pAPNC3`Si*H$b!>T zBn(st*a>!Jp{5|uQse2U)fgXC`3<*5-Zi-Ei;6dE%Tz|+I)?FwnAAT4Y7uEWojE%Q zZ2Q7TfRWcOE(kZwreb_h84JmhGuj!d_=gIjUMLmBaRzjuBgf8wE_7u04Cq1^)Ww3J zE)s*f5J4C5x398e6@uW>#c z!iRkZL6dKpRD4m1*44{1*@w7J^8vmU!(Bk{Xe9r($b!6%(>!_Q9B=S}qB=AvsammF zWx{~_0BYTYEUmq~g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m +++ b/src/apps/pcomm/pcomm.asm @@ -102,6 +102,9 @@ _main: cmp al, HEX (4B) je .L4 + ;cmp al, HEX (4D) + ;je .L58 + cmp al, HEX (50) je .L2 @@ -112,6 +115,28 @@ _main: cmp al, HEX (09) jne .L14 + push ax + push bx + push cx + push dx + + mov bx, offset _scratch + + mov ax, di + sub ax, bx + + mov cl, ch + xor ch, ch + + cmp ax, cx + + pop dx + pop cx + pop bx + pop ax + + jne .L11 + push ax push bx push dx @@ -536,10 +561,105 @@ _main: jmp .L11 +.L58: + + push bx + push cx + push dx + + mov bx, offset _scratch + + mov ax, di + sub ax, bx + + mov cl, ch + xor ch, ch + + cmp ax, cx + je .L63 + + mov ax, HEX (0300) + xor bx, bx + int HEX (10) + + cmp dl, HEX (4F) + jb .L64 + + xor dl, dl + inc dh + + jmp .L65 + +.L64: + + inc dl + +.L65: + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + inc di + +.L63: + + pop dx + pop cx + pop bx + + jmp .L11 + +.L57: + + push bx + push cx + push dx + + mov ax, HEX (0300) + xor bx, bx + int HEX (10) + + cmp dh, cs:[_curr_row] + jne .L62 + + cmp dl, cs:[_curr_col] + je .L60 + +.L62: + + and dl, dl + jnz .L59 + + mov dl, HEX (4F) + dec dh + + jmp .L61 + +.L59: + + dec dl + +.L61: + + mov ax, HEX (0200) + xor bx, bx + int HEX (10) + + dec di + +.L60: + + pop dx + pop cx + pop bx + + jmp .L11 + .L4: - call _handle_backspace - jmp .L11 + call _handle_backspace + jmp .L11 .L3: @@ -849,11 +969,87 @@ _main: .L1: + and ch, ch + jz .L67 + + 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 + +.L67: + call _history_up jmp .L11 .L2: + and ch, ch + jz .L66 + + 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 + +.L66: + call _history_down jmp .L11 @@ -1015,20 +1211,24 @@ _handle_backspace: xor ah, ah mov al, cs:[_curr_col] + push bx push cx push dx + xor dx, dx mov cl, ch xor ch, ch + add ax, cx - mov cx, HEX (50) + mov cx, 80 div cx xchg ax, dx pop dx pop cx + pop bx and ax, ax jnz .L13 @@ -1200,15 +1400,6 @@ _prompt: mov ax, cs mov ds, ax -.L19: - - mov ax, HEX (0300) - xor bx, bx - int HEX (10) - - mov cs:[_curr_row], dh ; byte ptr [bp - 2] - mov cs:[_curr_col], dl ; byte ptr [bp - 1] - .L17: mov di, offset _scratch @@ -1256,6 +1447,15 @@ _prompt: mov dl, ' ' int HEX (21) +.L19: + + mov ax, HEX (0300) + xor bx, bx + int HEX (10) + + mov cs:[_curr_row], dh ; byte ptr [bp - 2] + mov cs:[_curr_col], dl ; byte ptr [bp - 1] + .L18: pop ds -- 2.34.1