diff --git a/apps/zasm/main.asm b/apps/zasm/main.asm index ca258dd..2f32cf0 100644 --- a/apps/zasm/main.asm +++ b/apps/zasm/main.asm @@ -27,11 +27,14 @@ zasmMain: ld de, .argspecs ld ix, ZASM_RAMSTART call parseArgs + jr z, .goodargs + ; bad args ld hl, 0 ld de, 0 ld a, SHELL_ERR_BAD_ARGS - ret nz + ret +.goodargs: ; HL now points to parsed args ; Init I/O ld a, (ZASM_RAMSTART) ; blkdev in ID diff --git a/tools/emul/.gitignore b/tools/emul/.gitignore index d0ec041..9527004 100644 --- a/tools/emul/.gitignore +++ b/tools/emul/.gitignore @@ -1,8 +1,6 @@ /shell/shell /zasm/zasm /runbin/runbin -/zasm/includes.* -/*/kernel.h -/*/user.h +/*/*-bin.h /cfsin /cfsout diff --git a/tools/emul/Makefile b/tools/emul/Makefile index a92776c..f30a250 100644 --- a/tools/emul/Makefile +++ b/tools/emul/Makefile @@ -8,17 +8,17 @@ ZASMSH = ../zasm.sh .PHONY: all all: $(TARGETS) -shell/kernel.h: shell/shell_.asm $(ZASMBIN) +shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN) $(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null -zasm/kernel.h: zasm/kernel.bin +zasm/kernel-bin.h: zasm/kernel.bin ./bin2c.sh KERNEL < $< | tee $@ > /dev/null -zasm/user.h: zasm/zasm.bin +zasm/zasm-bin.h: zasm/zasm.bin ./bin2c.sh USERSPACE < $< | tee $@ > /dev/null -shell/shell: shell/shell.c libz80/libz80.o shell/kernel.h -$(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel.h zasm/user.h $(CFSPACK) +shell/shell: shell/shell.c libz80/libz80.o shell/kernel-bin.h +$(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK) runbin/runbin: runbin/runbin.c libz80/libz80.o $(TARGETS): $(CC) $< libz80/libz80.o -o $@ @@ -33,7 +33,7 @@ $(CFSPACK): .PHONY: updatebootstrap updatebootstrap: $(ZASMBIN) $(INCCFS) $(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin - $(ZASMSH) $(KERNEL) $(APPS) user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin + $(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin # Sometimes, when developing zasm, stuff get messed up and it's hard to unmess # because zasm's brake-up ends up in its bootstrap bins. Sure, we can revert @@ -42,8 +42,8 @@ updatebootstrap: $(ZASMBIN) $(INCCFS) .PHONY: rescue rescue: scas -o zasm/kernel.bin -I $(KERNEL) zasm/glue.asm - scas -o zasm/zasm.bin -I $(APPS) -I $(KERNEL) $(APPS)/zasm/glue.asm + scas -o zasm/zasm.bin -I $(APPS) -I $(KERNEL) -I zasm $(APPS)/zasm/glue.asm .PHONY: clean clean: - rm -f $(TARGETS) zasm/{kernel,user}.h shell/kernel.h zasm/includes.* + rm -f $(TARGETS) {zasm,shell}/*-bin.h diff --git a/tools/emul/shell/shell.c b/tools/emul/shell/shell.c index 9459b73..8193e9d 100644 --- a/tools/emul/shell/shell.c +++ b/tools/emul/shell/shell.c @@ -2,7 +2,7 @@ #include #include #include "../libz80/z80.h" -#include "kernel.h" +#include "kernel-bin.h" /* Collapse OS shell with filesystem * diff --git a/tools/emul/user.h b/tools/emul/zasm/user.h similarity index 100% rename from tools/emul/user.h rename to tools/emul/zasm/user.h diff --git a/tools/emul/zasm/zasm.c b/tools/emul/zasm/zasm.c index bba87aa..b858c99 100644 --- a/tools/emul/zasm/zasm.c +++ b/tools/emul/zasm/zasm.c @@ -1,8 +1,8 @@ #include #include #include "../libz80/z80.h" -#include "kernel.h" -#include "user.h" +#include "kernel-bin.h" +#include "zasm-bin.h" /* zasm reads from a specified blkdev, assemble the file and writes the result * in another specified blkdev. In our emulator layer, we use stdin and stdout