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

zasm: support forward label references!

This commit is contained in:
Virgil Dupras 2019-05-10 21:14:46 -04:00
parent c239ec7dea
commit c000d5cfb1
2 changed files with 4 additions and 1 deletions

View File

@ -169,6 +169,9 @@ symFind:
; Return value associated with symbol string in (HL) into DE.
; Sets Z on success, unset on error.
symGetVal:
call zasmIsFirstPass
ret z ; first pass? we don't care about the value,
; return success.
call symFind
ret nz ; not found
; our index is in A. Let's fetch the proper value

View File

@ -2,6 +2,7 @@
add a, b ; comment
label1:
inc a ; comment
ld hl, label2
; comment
.db 42
label2:
@ -9,4 +10,3 @@ label2:
.dw 3742
.dw 0x3742
ld a, (label1)
ld hl, label2