From f478e6c1223cc8370fa51d44b9244ec25be99788 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 13 Feb 2022 20:20:59 -0400 Subject: igen: Start work on writing an instruction handler generator. This will make it easier in the long run to modify instructions, add new instructions, and move the opcode tables around. --- igen/igen.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 igen/igen.c (limited to 'igen/igen.c') diff --git a/igen/igen.c b/igen/igen.c new file mode 100644 index 0000000..fa9f10f --- /dev/null +++ b/igen/igen.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include "lexer.h" +#include "misc.h" + +void usage(const char *name) { + printf("Usage: %s \n", name); +} + +int main(int argc, char **argv) { + char *buf; + long file_size = 0; + int dbg = 0; + int ret = 0; + if (argc < 2) { + usage(argv[0]); + ret = 1; + } + buf = read_file(argc[1], &file_size); + if (buf == NULL) { + printf("Error: read_file() returned NULL.\n"); + usage(argv[0]); + ret = 1; + } + + ret = lex(buf, dbg); + return ret; +} -- cgit v1.2.3-13-gbd6f