zasm: allow leading whitespace in parsed lines
This commit is contained in:
parent
57c3dfece8
commit
eb5c974573
2
apps/zasm/tests/test1.asm
Normal file
2
apps/zasm/tests/test1.asm
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
add a, b
|
||||||
|
inc a
|
@ -18,6 +18,7 @@ tokenize:
|
|||||||
ld (tokArg1), a
|
ld (tokArg1), a
|
||||||
ld (tokArg2), a
|
ld (tokArg2), a
|
||||||
ld de, tokInstr
|
ld de, tokInstr
|
||||||
|
call toWord
|
||||||
ld a, 4
|
ld a, 4
|
||||||
call readWord
|
call readWord
|
||||||
call toWord
|
call toWord
|
||||||
@ -105,14 +106,10 @@ toWord:
|
|||||||
inc hl
|
inc hl
|
||||||
jr .loop
|
jr .loop
|
||||||
.error:
|
.error:
|
||||||
; we need the Z flag to be unset and it is set now. Let's CP with
|
call JUMP_UNSETZ
|
||||||
; something it can't be equal to, something not a line end.
|
|
||||||
cp 'a' ; Z flag unset
|
|
||||||
ret
|
ret
|
||||||
.success:
|
.success:
|
||||||
; We need the Z flag to be set and it is unset. Let's compare it with
|
xor a ; ensure Z
|
||||||
; itself to return a set Z
|
|
||||||
cp a
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; Advance HL to the beginning of the next line, that is, right after the next
|
; Advance HL to the beginning of the next line, that is, right after the next
|
||||||
|
Loading…
Reference in New Issue
Block a user