zasm: fix first pass inversion bug

Also, confirm in tests that we can refer to other symbols in `.equ`.
This commit is contained in:
Virgil Dupras 2019-05-12 08:50:29 -04:00
parent 6aa53afabc
commit d6f5cf5b90
2 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ handleDW:
handleEQU: handleEQU:
call zasmIsFirstPass call zasmIsFirstPass
jr z, .begin jr nz, .begin
; first pass? .equ are noops ; first pass? .equ are noops
xor a xor a
ret ret
@ -74,7 +74,6 @@ handleEQU:
call toWord call toWord
call readWord call readWord
ld hl, scratchpad ld hl, scratchpad
ld a, (hl)
call parseNumberOrSymbol call parseNumberOrSymbol
jr nz, .error jr nz, .error
ld hl, DIREC_SCRATCHPAD ld hl, DIREC_SCRATCHPAD

View File

@ -11,5 +11,6 @@ label2:
.dw 3742 .dw 3742
.dw 0x3742 .dw 0x3742
ld a, (label1) ld a, (label1)
.equ foobar 0x1234 .equ foo 0x1234
ld hl, foobar .equ bar foo
ld hl, bar