diff options
Diffstat (limited to 'asmmon.c')
-rw-r--r-- | asmmon.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -149,6 +149,7 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u uint8_t am_done = 1; uint8_t op_done = 1; uint16_t bline = s->bline; + const char *inst_name; for (; bline; bline--) { putchar('\n'); } @@ -169,7 +170,6 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u case INDY: putchar('('); am_done = 0; break; case ZMY : case ZMX : am_done = 0; break; - case BREG: putchar('b'); am_done = 1; break; } am = (am_done) ? 0xFF : am; } @@ -188,9 +188,14 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u switch (t->id) { case TOK_DIR : printf(".%s", dir_t[t->type]); break; case TOK_RS : printf("%s", rs_t[t->type]); break; + case TOK_EXTOP : case TOK_OPCODE: + switch (t->id) { + case TOK_EXTOP : inst_name = ext_mne[t->byte]; break; + case TOK_OPCODE: inst_name = /**/mne[t->byte]; break; + } for (; j < 3; j++) { - mne_lower[j] = tolower(mne[t->byte][j]); + mne_lower[j] = tolower(inst_name[j]); } mne_lower[j] = '\0'; j = 0; @@ -300,6 +305,12 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u if (t->next && !isopdone(t)) { op_done = isopdone(t->next); } + if (am != 0xFF && op_done && t->id != TOK_RS && !t->next) { + switch (am) { + case EIND: putchar('('); am_done = 0; break; + case BREG: putchar('b'); am_done = 1; break; + } + } if (am != 0xFF && !am_done && op_done) { switch (am) { case INDX: @@ -309,12 +320,18 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u break; } /* Falls Through. */ + case EIND: + if (am == EIND) { + putchar('e'); + } + /* Falls Through. */ case INDY: case IND : putchar(')'); - if (am == IND) { + if (am == IND || am == EIND) { break; } + /* Falls Through. */ case ZMY : printf(", y"); break; } am = 0xFF; |