From 26d6dd1912754a6e70893f63c40b6858b09ea964 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 17 May 2019 15:14:38 -0400 Subject: [PATCH] zasm: remove direcData buffer --- apps/zasm/directive.asm | 20 +++++++------------- apps/zasm/main.asm | 13 +------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/apps/zasm/directive.asm b/apps/zasm/directive.asm index 332db02..02fe25a 100644 --- a/apps/zasm/directive.asm +++ b/apps/zasm/directive.asm @@ -31,8 +31,7 @@ handleDB: ld hl, scratchpad call parseLiteral ld a, ixl - ld (direcData), a - ld a, 1 + call ioPutC pop hl ret @@ -41,11 +40,11 @@ handleDW: call readWord ld hl, scratchpad call parseExpr - ld a, ixl - ld (direcData), a - ld a, ixh - ld (direcData+1), a - ld a, 2 + push ix \ pop hl + ld a, l + call ioPutC + ld a, h + call ioPutC pop hl ret @@ -128,8 +127,7 @@ getDirectiveID: ; Parse directive specified in A (D_* const) with args in I/O and act in ; an appropriate manner. If the directive results in writing data at its -; current location, that data is in (direcData) and A is the number of bytes -; in it. +; current location, that data is directly written through ioPutC. parseDirective: push de ; double A to have a proper offset in directiveHandlers @@ -141,7 +139,3 @@ parseDirective: ld ixl, e pop de jp (ix) - -; *** Variables *** -direcData: - .fill 2 diff --git a/apps/zasm/main.asm b/apps/zasm/main.asm index c1e2a8f..26d08a9 100644 --- a/apps/zasm/main.asm +++ b/apps/zasm/main.asm @@ -171,18 +171,7 @@ _parseInstr: _parseDirec: ld a, c ; D_* call parseDirective - or a ; cp 0 - jr z, .success ; if zero, shortcut through - ld b, a ; save output byte count - ld hl, direcData -.loopDirec: - ld a, (hl) - call ioPutC - inc hl - djnz .loopDirec - ; continue to success -.success: - xor a ; ensure Z + cp a ; ensure Z ret _parseLabel: