zasm: support multiple elements in .dw and .db

This commit is contained in:
Virgil Dupras 2019-05-17 15:39:28 -04:00
parent b0318f4891
commit 16922da3d4
2 changed files with 8 additions and 2 deletions

View File

@ -27,16 +27,20 @@ directiveHandlers:
handleDB:
push hl
.loop:
call readWord
ld hl, scratchpad
call parseLiteral
ld a, ixl
call ioPutC
call readComma
jr z, .loop
pop hl
ret
handleDW:
push hl
.loop:
call readWord
ld hl, scratchpad
call parseExpr
@ -45,6 +49,8 @@ handleDW:
call ioPutC
ld a, h
call ioPutC
call readComma
jr z, .loop
pop hl
ret

View File

@ -5,9 +5,9 @@ label1:
ld hl, label2
.dw label2
; comment
.db 42
.db 42, 54
label2: .dw 0x42
.dw 3742
.dw 3742, 0xffff
.dw 0x3742
ld a, (label1)
rla \ rla