From 16922da3d44f5addfa78b23b976d54e4bd867ec5 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 17 May 2019 15:39:28 -0400 Subject: [PATCH] zasm: support multiple elements in .dw and .db --- apps/zasm/directive.asm | 6 ++++++ tools/tests/zasm/test1.asm | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/zasm/directive.asm b/apps/zasm/directive.asm index 02fe25a..2c3f147 100644 --- a/apps/zasm/directive.asm +++ b/apps/zasm/directive.asm @@ -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 diff --git a/tools/tests/zasm/test1.asm b/tools/tests/zasm/test1.asm index f238dd5..7c9bca5 100644 --- a/tools/tests/zasm/test1.asm +++ b/tools/tests/zasm/test1.asm @@ -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