From 5dd788d5a1acc7f23835882420d50e9f020728ac Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Mon, 18 May 2020 13:14:08 -0400 Subject: Did alot of stuff while I was up at the family trailer. - Moved the large enums, and large tables into separate header files. - Added enums for implementing the base extension - Fixed a bug in the assembler. - Worked more on SuBAsm. --- lexer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lexer.c') diff --git a/lexer.c b/lexer.c index 6ed6cf4..4c398a4 100644 --- a/lexer.c +++ b/lexer.c @@ -1,5 +1,8 @@ #include "asmmon.h" +uint8_t lex_type; +uint16_t sym_count = 0; + void init_symbol() { uint16_t i = 0; for (; i < 0x1000; i++) { @@ -8,7 +11,6 @@ void init_symbol() { } } -uint16_t sym_count = 0; uint16_t mksymbol(const char *name, uint64_t val, uint8_t def, uint8_t useid, uint16_t id, uint8_t dbg) { uint16_t i = 0; uint8_t flag = 0; @@ -104,6 +106,7 @@ uint8_t set_symval(const char *name, uint16_t id, uint64_t val, uint8_t useid, u return 0; } } + return 0; } char *get_symname(uint16_t id, uint8_t dbg) { @@ -255,7 +258,7 @@ uint64_t update_addr(struct line *ln, uint64_t address, uint8_t fixup, uint16_t } return address; } - if (((flags & 0x53) == 0x42)) { + if ((flags & 0x53) == 0x42 || (flags & 0x51) == 0x41) { if (fixup && symid == 0xFFFF && (opcodes[mne][IMPL] == 0xFF)) { value = address; } else if (opcodes[mne][IMPL] != 0xFF && symid == 0xFFFF) { @@ -443,7 +446,6 @@ uint64_t lex(char *str, struct line *l, uint64_t address, uint8_t dbg) { } else { ln = linenum; } - for (; isspace(str[i]); i++); line = find_line(l, ln, dbg); if (line != lineidx) { address = l[line].addr; -- cgit v1.2.3-13-gbd6f