From: Robert Pengelly Date: Mon, 7 Oct 2024 01:55:21 +0000 (+0100) Subject: Bug fixes X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=37f0752b6cae739b747e536669f1ff9e6a85c10e;p=chimaera.git Bug fixes --- diff --git a/build/chimaera.img b/build/chimaera.img index 2933388..8173673 100644 Binary files a/build/chimaera.img and b/build/chimaera.img differ diff --git a/build/chimaera.vhd b/build/chimaera.vhd index 47cb422..08934ea 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 2e21d9e..ae475c1 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -80,6 +80,8 @@ _main: mov ax, [_scratch_list] xor di, di + + mov word ptr [bp - 2], ax .L112: @@ -143,6 +145,15 @@ _main: call _free add sp, 2 + mov bx, [_scratch_list] + + cmp bx, word ptr [bp - 2] + je .L126 + + mov ax, bx + +.L126: + mov [_scratch_list], ax mov word ptr [bp - 2], ax @@ -2380,6 +2391,30 @@ _process_line: .L123: push es + push bx + + mov ax, [_scratch_list] + + and ax, ax + jz .L127 + + push es + push bx + + mov es, ax + xor bx, bx + + mov ax, es:[bx + 4] + pop bx + pop es + +.L127: + + push ax + + xor ax, ax + mov [_scratch_list], ax + push di call _strlen @@ -2414,6 +2449,32 @@ _process_line: call _strcpy add sp, 4 + mov ax, [_scratch_list] + + and ax, ax + jnz .L125 + + pop ax + mov [_scratch_list], ax + + jmp .L119 + +.L125: + + mov es, ax + xor bx, bx + + mov ax, es:[bx + 4] + + and ax, ax + jnz .L125 + + pop ax + mov es:[bx + 4], ax + +.L119: + + pop bx pop es .L120: @@ -2922,6 +2983,12 @@ _read_batch.parse: jz _read_batch.close mov word ptr [bp - 2], ax + + mov ax, [_scratch_list] + mov word ptr [bp - 6], ax + + xor ax, ax + mov [_scratch_list], ax _read_batch.read_line: @@ -3041,13 +3108,38 @@ _read_batch.free: mov ax, word ptr [bp - 2] and ax, ax - jz _read_batch.done + jz _read_batch.append push ax call _load_line_destroy_internal_data add sp, 2 +_read_batch.append: + + mov ax, [_scratch_list] + + and ax, ax + jnz _read_batch.find_last + + mov ax, word ptr [bp - 6] + mov [_scratch_list], ax + + jmp _read_batch.done + +_read_batch.find_last: + + mov es, ax + xor bx, bx + + mov ax, es:[bx + 4] + + and ax, ax + jnz _read_batch.find_last + + mov ax, word ptr [bp - 6] + mov es:[bx + 4], ax + _read_batch.done: pop ds