zasm: add support for .fill directive

This commit is contained in:
Virgil Dupras 2019-05-20 08:20:00 -04:00
parent ae315499cb
commit 848a7500bc
4 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -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

Binary file not shown.

View File

@ -27,3 +27,4 @@ label2: .dw 0x42
rlc c
cp '-'
sbc hl, de
.fill 0x10