1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:38:05 +11:00

Remove runbin

It's not used
This commit is contained in:
Virgil Dupras 2020-04-13 19:25:28 -04:00
parent b536d3bfd6
commit d919a10265
4 changed files with 1 additions and 47 deletions

2
emul/.gitignore vendored
View File

@ -1,8 +1,6 @@
/forth/stage1
/forth/stage1dbg
/forth/stage2
/forth/stage2dbg
/forth/forth
/runbin/runbin
/*/*-bin.h
/*/*.bin

View File

@ -1,4 +1,4 @@
TARGETS = runbin/runbin forth/forth
TARGETS = forth/forth
BIN2C = ../tools/bin2c
# Those Forth source files are in a particular order
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
$(CC) forth/forth.c $(OBJS) -o $@
runbin/runbin: runbin/runbin.c $(OBJS)
$(CC) runbin/runbin.c $(OBJS) -o $@
libz80/libz80.o: libz80/z80.c
$(MAKE) -C libz80/codegen opcodes
$(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c

View File

@ -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
`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?
If the libz80-wrapped zasm executable works badly (hangs, spew garbage, etc.),

View File

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