Remove runbin
It's not used
This commit is contained in:
parent
b536d3bfd6
commit
d919a10265
2
emul/.gitignore
vendored
2
emul/.gitignore
vendored
@ -1,8 +1,6 @@
|
|||||||
/forth/stage1
|
/forth/stage1
|
||||||
/forth/stage1dbg
|
/forth/stage1dbg
|
||||||
/forth/stage2
|
/forth/stage2
|
||||||
/forth/stage2dbg
|
|
||||||
/forth/forth
|
/forth/forth
|
||||||
/runbin/runbin
|
|
||||||
/*/*-bin.h
|
/*/*-bin.h
|
||||||
/*/*.bin
|
/*/*.bin
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
TARGETS = runbin/runbin forth/forth
|
TARGETS = forth/forth
|
||||||
BIN2C = ../tools/bin2c
|
BIN2C = ../tools/bin2c
|
||||||
# Those Forth source files are in a particular order
|
# Those Forth source files are in a particular order
|
||||||
BOOTSRCS = ./forth/conf.fs \
|
BOOTSRCS = ./forth/conf.fs \
|
||||||
@ -58,9 +58,6 @@ forth/stage2: forth/stage.c $(OBJS) forth/forth1-bin.h
|
|||||||
forth/forth: forth/forth.c $(OBJS) forth/forth1-bin.h
|
forth/forth: forth/forth.c $(OBJS) forth/forth1-bin.h
|
||||||
$(CC) forth/forth.c $(OBJS) -o $@
|
$(CC) forth/forth.c $(OBJS) -o $@
|
||||||
|
|
||||||
runbin/runbin: runbin/runbin.c $(OBJS)
|
|
||||||
$(CC) runbin/runbin.c $(OBJS) -o $@
|
|
||||||
|
|
||||||
libz80/libz80.o: libz80/z80.c
|
libz80/libz80.o: libz80/z80.c
|
||||||
$(MAKE) -C libz80/codegen opcodes
|
$(MAKE) -C libz80/codegen opcodes
|
||||||
$(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
|
$(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
|
||||||
|
@ -49,14 +49,6 @@ the power of a full Forth intepreter, including an assembler, to assemble
|
|||||||
Normally, running this step should yield the exact same `boot.bin` and
|
Normally, running this step should yield the exact same `boot.bin` and
|
||||||
`z80c.bin` as before, unless of course you've changed the source.
|
`z80c.bin` as before, unless of course you've changed the source.
|
||||||
|
|
||||||
## runbin
|
|
||||||
|
|
||||||
This is a very simple tool that reads binary z80 code from stdin, loads it in
|
|
||||||
memory starting at address 0 and then run the code until it halts. The exit
|
|
||||||
code of the program is the value of `A` when the program halts.
|
|
||||||
|
|
||||||
This is used for unit tests.
|
|
||||||
|
|
||||||
## Problems?
|
## Problems?
|
||||||
|
|
||||||
If the libz80-wrapped zasm executable works badly (hangs, spew garbage, etc.),
|
If the libz80-wrapped zasm executable works badly (hangs, spew garbage, etc.),
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "../emul.h"
|
|
||||||
|
|
||||||
/* runbin loads binary from stdin directly in memory address 0 then runs it
|
|
||||||
* until it halts. The return code is the value of the register A at halt time.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void iowr_stderr(uint8_t val)
|
|
||||||
{
|
|
||||||
fputc(val, stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Machine *m = emul_init();
|
|
||||||
m->iowr[0] = iowr_stderr;
|
|
||||||
// read stdin in mem
|
|
||||||
int i = 0;
|
|
||||||
int c = getchar();
|
|
||||||
while (c != EOF) {
|
|
||||||
m->mem[i] = c & 0xff;
|
|
||||||
i++;
|
|
||||||
c = getchar();
|
|
||||||
}
|
|
||||||
if (!i) {
|
|
||||||
fprintf(stderr, "No input, aborting\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
emul_loop();
|
|
||||||
return m->cpu.R1.br.A;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user