diff --git a/src/makefile b/src/makefile index 427ed8b..17378b4 100755 --- a/src/makefile +++ b/src/makefile @@ -192,8 +192,8 @@ $(DRAWL): lisp/s-expr.pla lisp/drawl.pla vmsrc/lib6502/lib6502.a: vmsrc/lib6502/lib6502.h vmsrc/lib6502/lib6502.c make -C vmsrc/lib6502 -$(PLVM): vmsrc/plvm.c vmsrc/cmdsys.c vmsrc/lib6502/lib6502.a - cc vmsrc/plvm.c vmsrc/cmdsys.c vmsrc/lib6502/lib6502.a -o $(PLVM) +$(PLVM): vmsrc/plvm.c vmsrc/cmdsys.c vmsrc/sysio.c vmsrc/lib6502/lib6502.a + cc vmsrc/plvm.c vmsrc/cmdsys.c vmsrc/sysio.c vmsrc/lib6502/lib6502.a -o $(PLVM) $(PLVMZP_APL): FORCE -mkdir -p rel @@ -265,7 +265,7 @@ test: samplesrc/test.pla samplesrc/testlib.pla $(PLVM) $(PLASM) acme --setpc 4094 -o $(TEST) samplesrc/test.a ./$(PLASM) -AMOW samplesrc/testlib.pla acme --setpc 4094 -o $(TESTLIB) samplesrc/testlib.a - ./$(PLVM) test.mod + ./$(PLVM) test $(ED): toolsrc/ed.pla $(PLVM02) $(PLASM) toolsrc/ed.pla ./$(PLASM) -AMOW toolsrc/ed.pla diff --git a/src/vmsrc/cmdsys.c b/src/vmsrc/cmdsys.c index df43ed0..1e3fd61 100644 --- a/src/vmsrc/cmdsys.c +++ b/src/vmsrc/cmdsys.c @@ -491,8 +491,8 @@ int load_mod(M6502 *mpu, byte *mod) char filename[128], string[17]; dcitos(mod, filename); - printf("Load module %s\n", filename); - if (strlen(filename) > 4 && (filename[strlen(filename) - 4] != '.')) + if (trace) printf("Load module %s\n", filename); + if (strlen(filename) < 4 || (filename[strlen(filename) - 4] != '.')) strcat(filename, ".mod"); fd = open(filename, O_RDONLY, 0); if (fd <= 0 && filename[0] != '/' && strlen(filename) < 17) @@ -770,38 +770,9 @@ int load_mod(M6502 *mpu, byte *mod) /* * Native CMDSYS routines */ -int vm_syscall(M6502 *mpu, uword address, byte data) -{ - return address + 1; -} -void syscall6502(M6502 *mpu) -{ - uword params; - byte cmd, status; - - PULL_ESTK(params); - PULL_ESTK(cmd); - status = 0; - switch (cmd) - { - } - PUSH_ESTK(status); -} void sysexecmod(M6502 *mpu) { } -void sysopen(M6502 *mpu) -{ -} -void sysclose(M6502 *mpu) -{ -} -void sysread(M6502 *mpu) -{ -} -void syswrite(M6502 *mpu) -{ -} void syslookuptbl(M6502 *mpu) { uword sym, addr; diff --git a/src/vmsrc/plvm.h b/src/vmsrc/plvm.h index aaab2d4..f8fe926 100644 --- a/src/vmsrc/plvm.h +++ b/src/vmsrc/plvm.h @@ -113,3 +113,13 @@ extern int vm_iidef(M6502 *mpu, uword address, byte data); extern int vm_exdef(M6502 *mpu, uword address, byte data); extern int vm_natvdef(M6502 *mpu, uword address, byte data); extern void vm_interp(M6502 *mpu, code *vm_ip); +/* + * System I/O routines + */ +extern void sysio_init(void); +extern void syscall6502(M6502 *mpu); +extern void sysopen(M6502 *mpu); +extern void sysclose(M6502 *mpu); +extern void sysread(M6502 *mpu); +extern void syswrite(M6502 *mpu); + diff --git a/src/vmsrc/sysio.c b/src/vmsrc/sysio.c new file mode 100644 index 0000000..5835691 --- /dev/null +++ b/src/vmsrc/sysio.c @@ -0,0 +1,40 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "plvm.h" + +void syscall6502(M6502 *mpu) +{ + uword params; + byte cmd, status; + + PULL_ESTK(params); + PULL_ESTK(cmd); + status = 0; + switch (cmd) + { + } + PUSH_ESTK(status); +} +void sysopen(M6502 *mpu) +{ +} +void sysclose(M6502 *mpu) +{ +} +void sysread(M6502 *mpu) +{ +} +void syswrite(M6502 *mpu) +{ +} +void sysio_init(void) +{ +}