#include "cpu.h"
|
|
#include "insn.h"
|
|
|
|
static cpu_insn_handler primary_insn_handler[0x34] = {};
|
|
static cpu_insn_handler secondary_insn_handler[0x34] = {};
|
|
|
|
void cpu_execute_insn(cpu_t *cpu, uint32_t insn) {
|
|
const op_primary_t op = extract_primary_op(insn);
|
|
|
|
if (op == SPECIAL) {
|
|
const op_secondary_t op2 = extract_secondary_op(insn);
|
|
secondary_insn_handler[op2](cpu, insn);
|
|
return;
|
|
}
|
|
|
|
primary_insn_handler[op](cpu, insn);
|
|
}
|