diff --git a/src/65c02isa.c b/src/65c02isa.c deleted file mode 100644 index e8346e0..0000000 --- a/src/65c02isa.c +++ /dev/null @@ -1,285 +0,0 @@ -#include "bus.h" -#include "instruction.h" - -#include "65c02isa.h" - -#define OP_BRK 0x00 -#define OP_TSB_ZP 0x04 -#define OP_JSR 0x20 -#define OP_LDY_IMM 0xA0 -#define OP_STP 0xDB -#define OP_INX 0xE8 -#define OP_NOP 0xEA - -#define OP_UNIMPL 0xFF - -static const struct instrdef instrs[] = { - { OP_BRK, "brk", IMPLIED, 1 }, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_NOP, "nop", IMMEDIATE, 2}, /* inv */ - { OP_NOP, "nop", IMPLIED, 1}, /* inv */ - { OP_TSB_ZP, "tsb", ZP, 2}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_JSR, "jsr", ABSOLUTE, 3}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_LDY_IMM, "ldy", IMMEDIATE, 2}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_STP, "stp", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_INX, "inx", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_NOP, "nop", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpl", IMPLIED, 1}, - { OP_UNIMPL, "unimpllast", IMPLIED, 1} -}; - -instrdef_t -instrdef_get(uint8_t opcode) -{ - instrdef_t id; - - id = instrs[opcode]; - - return id; -} - diff --git a/src/65c02isa.h b/src/65c02isa.h deleted file mode 100644 index 20db0f3..0000000 --- a/src/65c02isa.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _65C02ISA_H_ -#define _65C02ISA_H_ - -#include - -instrdef_t instrdef_get(uint8_t); - -#endif /* _65C02ISA_H_ */ -