zasm: support forward label references!
This commit is contained in:
parent
c239ec7dea
commit
c000d5cfb1
@ -169,6 +169,9 @@ symFind:
|
|||||||
; Return value associated with symbol string in (HL) into DE.
|
; Return value associated with symbol string in (HL) into DE.
|
||||||
; Sets Z on success, unset on error.
|
; Sets Z on success, unset on error.
|
||||||
symGetVal:
|
symGetVal:
|
||||||
|
call zasmIsFirstPass
|
||||||
|
ret z ; first pass? we don't care about the value,
|
||||||
|
; return success.
|
||||||
call symFind
|
call symFind
|
||||||
ret nz ; not found
|
ret nz ; not found
|
||||||
; our index is in A. Let's fetch the proper value
|
; our index is in A. Let's fetch the proper value
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
add a, b ; comment
|
add a, b ; comment
|
||||||
label1:
|
label1:
|
||||||
inc a ; comment
|
inc a ; comment
|
||||||
|
ld hl, label2
|
||||||
; comment
|
; comment
|
||||||
.db 42
|
.db 42
|
||||||
label2:
|
label2:
|
||||||
@ -9,4 +10,3 @@ label2:
|
|||||||
.dw 3742
|
.dw 3742
|
||||||
.dw 0x3742
|
.dw 0x3742
|
||||||
ld a, (label1)
|
ld a, (label1)
|
||||||
ld hl, label2
|
|
||||||
|
Loading…
Reference in New Issue
Block a user