From 8d9190cb14f287193196f422d49dbca0809980c7 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 9 Feb 2022 13:45:26 -0400 Subject: sux.{c,h}, opcode.h, disasm.c: Add code to use the new instruction handler for reading the interrupt vectors. --- disasm.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'disasm.c') diff --git a/disasm.c b/disasm.c index 586d18b..0a592ba 100644 --- a/disasm.c +++ b/disasm.c @@ -407,15 +407,17 @@ static void disasm_ortho(struct sux *cpu, WINDOW *w, uint8_t opcode, uint8_t pre } -void disasm(struct sux *cpu, WINDOW *w, uint8_t lines, uint8_t opcode, uint8_t prefix, uint8_t ext_prefix, uint8_t prefix2, uint8_t *op_type, uint8_t *op_id, uint8_t thread) { +void disasm(struct sux *cpu, WINDOW *w, uint8_t lines, int opcode, uint8_t prefix, uint8_t ext_prefix, uint8_t prefix2, uint8_t *op_type, uint8_t *op_id, uint8_t thread) { uint64_t value; uint64_t address = 0; operand ortho_op[2]; uint64_t ortho_addr[2] = {0, 0}; - if (ext_prefix != 0x1D) { - address = get_addr(cpu, opcode, prefix, ext_prefix, 0, 0, thread); - } else { - get_ortho_addr(cpu, opcode, prefix, cpu->pc, ortho_op, ortho_addr, op_type, op_id, 0, 0, thread); + if (opcode < 0x100) { + if (ext_prefix != 0x1D) { + address = get_addr(cpu, opcode, prefix, ext_prefix, 0, 0, thread); + } else { + get_ortho_addr(cpu, opcode, prefix, cpu->pc, ortho_op, ortho_addr, op_type, op_id, 0, 0, thread); + } } uint8_t rs = (prefix >> 4) & 3; char *postfix; @@ -449,8 +451,17 @@ void disasm(struct sux *cpu, WINDOW *w, uint8_t lines, uint8_t opcode, uint8_t p case 0x0: inst_name = ext_opname[opcode]; inst_type = ext_optype[opcode]; break; } } else { - inst_name = opname[opcode]; - inst_type = optype[opcode]; + if (opcode < 0x100) { + inst_name = opname[opcode]; + inst_type = optype[opcode]; + } else { + switch (opcode) { + case 0x100: inst_name = "NMI"; break; + case 0x101: inst_name = "RESET"; break; + case 0x102: inst_name = "IRQ"; break; + } + inst_type = IMPL; + } } memcpy(op, inst_name, 3); -- cgit v1.2.3-13-gbd6f