summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
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;