summaryrefslogtreecommitdiff
path: root/disasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'disasm.c')
-rw-r--r--disasm.c25
1 files changed, 18 insertions, 7 deletions
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);