diff options
Diffstat (limited to 'disasm.c')
-rw-r--r-- | disasm.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -2,6 +2,23 @@ #include "disasm.h" #include <string.h> +void print_regs(struct sux *cpu, uint8_t lines, uint8_t thread) { + for (uint8_t i = (24*thread)+2; i <= 24*(thread+1); i++) { + wmove(scr, i, 0); + waddch(scr, (i == lines) ? '>' : ' '); + } + wmove(scr, lines, 1); + wclrtoeol(scr); + wprintw(scr, "pc: $%04"PRIX64 , cpu->pc); + wprintw(scr, ", a: $%016"PRIX64, cpu->a); + wprintw(scr, ", b: $%016"PRIX64, cpu->b); + wprintw(scr, ", x: $%016"PRIX64, cpu->x); + wprintw(scr, ", y: $%016"PRIX64, cpu->y); + wprintw(scr, ", sp: $%04X", cpu->sp); + wprintw(scr, ", ps: $%02X", cpu->ps.u8[thread]); + wprintw(scr, ", inst: "); +} + void disasm(struct sux *cpu, uint8_t lines, uint8_t opcode, uint8_t prefix, uint8_t thread) { uint64_t value; uint64_t address = get_addr(cpu, opcode, prefix, 0, 0, thread); |