From eb5c974573b4d58221d943690e50ab062c1e5636 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 30 Apr 2019 16:08:21 -0400 Subject: [PATCH] zasm: allow leading whitespace in parsed lines --- apps/zasm/tests/test1.asm | 2 ++ apps/zasm/tok.asm | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 apps/zasm/tests/test1.asm diff --git a/apps/zasm/tests/test1.asm b/apps/zasm/tests/test1.asm new file mode 100644 index 0000000..55823c4 --- /dev/null +++ b/apps/zasm/tests/test1.asm @@ -0,0 +1,2 @@ + add a, b + inc a diff --git a/apps/zasm/tok.asm b/apps/zasm/tok.asm index 61fef88..cedac41 100644 --- a/apps/zasm/tok.asm +++ b/apps/zasm/tok.asm @@ -18,6 +18,7 @@ tokenize: ld (tokArg1), a ld (tokArg2), a ld de, tokInstr + call toWord ld a, 4 call readWord call toWord @@ -105,14 +106,10 @@ toWord: inc hl jr .loop .error: - ; we need the Z flag to be unset and it is set now. Let's CP with - ; something it can't be equal to, something not a line end. - cp 'a' ; Z flag unset + call JUMP_UNSETZ ret .success: - ; We need the Z flag to be set and it is unset. Let's compare it with - ; itself to return a set Z - cp a + xor a ; ensure Z ret ; Advance HL to the beginning of the next line, that is, right after the next