Преглед изворни кода

Remove runbin

It's not used
pull/102/head
Virgil Dupras пре 4 година
родитељ
комит
d919a10265
4 измењених фајлова са 1 додато и 47 уклоњено
  1. +0
    -2
      emul/.gitignore
  2. +1
    -4
      emul/Makefile
  3. +0
    -8
      emul/README.md
  4. +0
    -33
      emul/runbin/runbin.c

+ 0
- 2
emul/.gitignore Прегледај датотеку

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

+ 1
- 4
emul/Makefile Прегледај датотеку

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


+ 0
- 8
emul/README.md Прегледај датотеку

@@ -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.),


+ 0
- 33
emul/runbin/runbin.c Прегледај датотеку

@@ -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…
Откажи
Сачувај