From 848a7500bc339a06984467a514823b440950b287 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 20 May 2019 08:20:00 -0400 Subject: [PATCH] zasm: add support for .fill directive --- apps/zasm/directive.asm | 18 +++++++++++++++++- tools/emul/Makefile | 4 ++-- tools/emul/zasm/zasm.bin | Bin 3976 -> 4001 bytes tools/tests/zasm/test1.asm | 1 + 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/zasm/directive.asm b/apps/zasm/directive.asm index e4b65ba..9c42901 100644 --- a/apps/zasm/directive.asm +++ b/apps/zasm/directive.asm @@ -4,7 +4,8 @@ .equ D_DW 0x01 .equ D_EQU 0x02 .equ D_ORG 0x03 -.equ D_INC 0x04 +.equ D_FIL 0x04 +.equ D_INC 0x05 .equ D_BAD 0xff ; *** Variables *** @@ -18,6 +19,7 @@ directiveNames: .db ".DW", 0 .db ".EQU" .db ".ORG" + .db ".FIL" .db "#inc" ; This is a list of handlers corresponding to indexes in directiveNames @@ -26,6 +28,7 @@ directiveHandlers: .dw handleDW .dw handleEQU .dw handleORG + .dw handleFIL .dw handleINC handleDB: @@ -103,6 +106,19 @@ handleORG: push ix \ pop hl jp zasmSetOrg +handleFIL: + call readWord + call parseExpr + ret nz + push bc + push ix \ pop bc + xor a + ld b, c +.loop: + call ioPutC + djnz .loop + pop bc + handleINC: call readWord jr nz, .end diff --git a/tools/emul/Makefile b/tools/emul/Makefile index 9ba7e2c..0cfcf8a 100644 --- a/tools/emul/Makefile +++ b/tools/emul/Makefile @@ -33,11 +33,11 @@ shell/shell: shell/shell.c libz80/libz80.o shell/kernel.h $(CFSPACK) $(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel.h zasm/user.h zasm/includes.h runbin/runbin: runbin/runbin.c libz80/libz80.o $(TARGETS): - cc $< libz80/libz80.o -o $@ + $(CC) $< libz80/libz80.o -o $@ libz80/libz80.o: libz80/z80.c make -C libz80/codegen opcodes - gcc -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c + $(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c $(CFSPACK): make -C ../cfspack diff --git a/tools/emul/zasm/zasm.bin b/tools/emul/zasm/zasm.bin index 2ed59ed19b52d38352fc5ef63277abf8cd0faba0..f6c9b9a7a0c76d201378f0a03e5b5f074f746b9e 100644 GIT binary patch delta 410 zcmXX?F-RL>80Eh+X=uH~U<)Z~l19*jwA(*A5l1?>6Z@NQOEU~7Pq_Rl{^SiS0jcL=~BGt`0%$f2>%R?&#&l( z>Ca!bLu8I<DGx+GrEIMO@!^ zIndiM$UB}L1f_YOEzR+XwdmJ^Zqi6%6 zlj^Y`qJbR>IjZ#7a7pc!V;S6RvQnVqw@N`x=xS0tXS?uR?Swx<;`r|VW+yXA7RfF- zVnK0hc7j&!Er)}Vg6rja%XQ2r>Vwh+=c*EbgH(k-*x`^A>~}J7t6KNmKJEWxcj7iG zvmptKIf|364Z~_0-UwTfW`=2 z4l}9Be`K$cvfi!L^PYzV`4b+g5`sfbZW|o7mhv8IL^V%n#5FH~MbF~}b2VLn3u5rG zXx4Az2)qy+1K&3SYnnXxi+>BfzCCR_Fv0dBG1(#