diff options
Diffstat (limited to 'asmmon.c')
-rw-r--r-- | asmmon.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -17,7 +17,9 @@ uint16_t incl[MAX_TOK]; line *lines; line *last_line; symbol *symbols = 0; +symbol *last_sym = 0; fixup *fixups = 0; +fixup *last_fix = 0; static char tstr[2048]; @@ -110,7 +112,7 @@ char *showbits(uint64_t value, uint8_t bitnum, uint8_t dbg) { } -void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, uint8_t dbg) { +void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, uint64_t address, uint8_t dbg) { line *s = (!all) ? find_line(start, dbg) : lines ; line *e = (!all) ? find_line( end, dbg) : last_line; uint8_t j = 0; @@ -125,8 +127,8 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u uint8_t tabs; char mne_lower[4]; char ch[6]; - do { + address = s->addr; token *t = s->tok; uint8_t am = 0xFF; uint8_t rs = 0xFF; @@ -174,6 +176,12 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u case INDY: putchar('('); break; } break; + case TOK_OF: + switch (t->type) { + case 1: printf("sp"); break; + case 2: printf("pc"); break; + } + break; case TOK_SYM: case TOK_LABEL: if (t->type == 1) { @@ -436,9 +444,9 @@ int asmmon(const char *fn) { } i++; } - list(start, end, isstart, islinenum, isaddr, isdebug); + list(start, end, isstart, islinenum, isaddr, 0, isdebug); } else { - list(0, 0, 1, 0, 0, 0); + list(0, 0, 1, 0, 0, 0, 0); } break; case 0x08: @@ -447,6 +455,7 @@ int asmmon(const char *fn) { } if (!inc_file) { puts("Now assembling."); + address = 0; bc.progsize = 0; bc.datasize = 0; assemble(lines, &bc, dbg); |