summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-05-18 13:14:08 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-05-18 13:14:08 -0400
commit5dd788d5a1acc7f23835882420d50e9f020728ac (patch)
tree2b9226863fc44e5bce88eb85be1f0ee97ede1922 /lexer.c
parent545bb8591e8003912b6c6b494acefd74e6b3abfd (diff)
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.
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c8
1 files changed, 5 insertions, 3 deletions
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;