1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 16:28:05 +11:00

zasm: allow leading whitespace in parsed lines

This commit is contained in:
Virgil Dupras 2019-04-30 16:08:21 -04:00
parent 57c3dfece8
commit eb5c974573
2 changed files with 5 additions and 6 deletions

View File

@ -0,0 +1,2 @@
add a, b
inc a

View File

@ -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