#include "memory.h"
#include "psw.h"
#include "timers.h"
-#include "disasm.h"
+#include "opcodes.h"
#include "options.h"
#include "instructions_8051.h"
sprintf(&text[len], ".%X", bit_address);
}
-/* Get instruction size from opcode */
-int
-cpu8051_get_instruction_size(unsigned char opcode)
-{
- return instr_size[opcode];
-}
-
/* Display instruction mnemonic. */
int
cpu8051_disasm_mnemonic(unsigned char opcode, char *buf)
{
- return sprintf(buf, "%s", instr_type_str[instr_type_id[opcode]]);
+ return sprintf(buf, "%s", opcodes_get_instr_type_str(opcode));
}
/* Disasm instruction arguments starting at address into a text string */
return;
}
- for (i = 1; i <= instr_arg_type_id[args_table_offset]; i++) {
- switch (instr_arg_type_id[args_table_offset + i]) {
+ for (i = 1; i <= opcodes_get_instr_arg_type_id(args_table_offset);
+ i++) {
+ switch (opcodes_get_instr_arg_type_id(args_table_offset + i)) {
case ADDR11: {
len += sprintf(&buf[len],
"%.4XH", ((opcode << 3) & 0xF00) +
break;
}
default: {
- len += sprintf(
- &buf[len], "%s",
- instr_arg_type_str[instr_arg_type_id[
- args_table_offset + i]]);
+ len += sprintf(&buf[len], "%s",
+ opcodes_get_instr_arg_type_str(
+ args_table_offset + i));
}
}
- if (i < instr_arg_type_id[args_table_offset])
+ if (i < opcodes_get_instr_arg_type_id(args_table_offset))
len += sprintf(&buf[len], ",");
}
}
len += sprintf(text, " %.4X ", address);
opcode = mem_read8(PGM_MEM_ID, address);
- inst_size = instr_size[opcode];
+ inst_size = opcodes_get_instr_size(opcode);
/* Display hex bytes. */
for (i = 0; i < inst_size; i++)