From 86cad39de452bf1bd6b7a37013d612913edd4850 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 12 May 2019 21:23:24 -0400 Subject: [PATCH] zasm: fix wrong logic in .numberTruncated error condition `xor c` didn't do what I thought it did at the time. Newbie mistake, there are probably a lot like this scattered around... --- apps/zasm/instr.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/zasm/instr.asm b/apps/zasm/instr.asm index 09ca3ea..ee064ae 100644 --- a/apps/zasm/instr.asm +++ b/apps/zasm/instr.asm @@ -620,7 +620,7 @@ getUpcode: inc hl ; MSB is 2nd byte ld a, (hl) dec hl ; HL now points to LSB - cp 0 + or a ; cp 0 jr nz, .numberTruncated ; HL points to our number ; one last thing to check. Is the 7th bit on the displacement value set? @@ -655,7 +655,7 @@ getUpcode: jr .end .numberTruncated: ; problem: not zero, so value is truncated. error - xor c + ld c, 0 .end: ld a, c pop bc