more instructions decompiled

This commit is contained in:
Trevor Merritt 2025-07-09 11:27:48 -04:00
parent 258e4dc59b
commit b7e161ef0b
3 changed files with 296 additions and 159 deletions

View File

@ -72,7 +72,7 @@ fn decompile(data: &[u8]) -> Vec<(u16, DecompiledLine)> {
// println!("Instruction {:?}/{:?} needs {:?} bytes.", top.operation, top.mode, top.length); // println!("Instruction {:?}/{:?} needs {:?} bytes.", top.operation, top.mode, top.length);
let num_bytes_to_load = top.length - 1; let num_bytes_to_load = top.length - 1;
println!("Need {num_bytes_to_load} more bytes."); // println!("Need {num_bytes_to_load} more bytes.");
let mut formatted_asm = String::from(top.format_prefix); let mut formatted_asm = String::from(top.format_prefix);
let mut param = None; let mut param = None;
if num_bytes_to_load == 1 { if num_bytes_to_load == 1 {

View File

@ -160,23 +160,23 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::IndirectX, mode: AddressMode::IndirectX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "AND ($",
format_postfix: "", format_postfix: ",X)",
}); });
table[ISA_OP_AND_INDY as usize] = Some(OpInfo { table[ISA_OP_AND_INDY as usize] = Some(OpInfo {
operation: AND, operation: AND,
mode: AddressMode::IndirectY, mode: AddressMode::IndirectY,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "AND ($",
format_postfix: "", format_postfix: "),Y",
}); });
table[ISA_OP_ASL_A as usize] = Some(OpInfo { table[ISA_OP_ASL_A as usize] = Some(OpInfo {
operation: ASL, operation: ASL,
mode: AddressMode::Accumulator, mode: AddressMode::Accumulator,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "ASL",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ASL_Z as usize] = Some(OpInfo { table[ISA_OP_ASL_Z as usize] = Some(OpInfo {
@ -184,7 +184,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "ASL $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ASL_ZX as usize] = Some(OpInfo { table[ISA_OP_ASL_ZX as usize] = Some(OpInfo {
@ -192,15 +192,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ASL $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_ASL_ABS as usize] = Some(OpInfo { table[ISA_OP_ASL_ABS as usize] = Some(OpInfo {
operation: ASL, operation: ASL,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ASL $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ASL_ABSX as usize] = Some(OpInfo { table[ISA_OP_ASL_ABSX as usize] = Some(OpInfo {
@ -209,34 +209,34 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
length: 3, length: 3,
cycles: 7, cycles: 7,
format_prefix: "TBD", format_prefix: "ASL $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_BCC as usize] = Some(OpInfo { table[ISA_OP_BCC as usize] = Some(OpInfo {
operation: BCC, operation: BCC,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BCC #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BCS as usize] = Some(OpInfo { table[ISA_OP_BCS as usize] = Some(OpInfo {
operation: BCS, operation: BCS,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BCS $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BEQ as usize] = Some(OpInfo { table[ISA_OP_BEQ as usize] = Some(OpInfo {
operation: BEQ, operation: BEQ,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BEQ $",
format_postfix: "", format_postfix: "",
}); });
@ -246,7 +246,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "BIT $",
format_postfix: "", format_postfix: "",
}); });
@ -255,36 +255,36 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "BIT $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BMI as usize] = Some(OpInfo { table[ISA_OP_BMI as usize] = Some(OpInfo {
operation: BMI, operation: BMI,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BMI #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BNE as usize] = Some(OpInfo { table[ISA_OP_BNE as usize] = Some(OpInfo {
operation: BNE, operation: BNE,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BNE #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BPL as usize] = Some(OpInfo { table[ISA_OP_BPL as usize] = Some(OpInfo {
operation: Operation::BPL, operation: Operation::BPL,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BPL #$",
format_postfix: "", format_postfix: "",
}); });
@ -293,25 +293,25 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 7, cycles: 7,
format_prefix: "TBD", format_prefix: "BRK",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BVC as usize] = Some(OpInfo { table[ISA_OP_BVC as usize] = Some(OpInfo {
operation: BVC, operation: BVC,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BVC #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_BVS as usize] = Some(OpInfo { table[ISA_OP_BVS as usize] = Some(OpInfo {
operation: BVS, operation: BVS,
mode: AddressMode::Implied, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "BVS #$",
format_postfix: "", format_postfix: "",
}); });
@ -320,7 +320,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CLC",
format_postfix: "", format_postfix: "",
}); });
@ -329,7 +329,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CLD",
format_postfix: "", format_postfix: "",
}); });
@ -338,7 +338,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CLI",
format_postfix: "", format_postfix: "",
}); });
@ -347,7 +347,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CLV",
format_postfix: "", format_postfix: "",
}); });
@ -357,7 +357,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CMP #$",
format_postfix: "", format_postfix: "",
}); });
@ -366,7 +366,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "CMP $",
format_postfix: "", format_postfix: "",
}); });
@ -375,8 +375,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "CMP $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_CMP_ABS as usize] = Some(OpInfo { table[ISA_OP_CMP_ABS as usize] = Some(OpInfo {
@ -384,7 +384,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "CMP $",
format_postfix: "", format_postfix: "",
}); });
@ -393,8 +393,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "CMP $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_CMP_ABSY as usize] = Some(OpInfo { table[ISA_OP_CMP_ABSY as usize] = Some(OpInfo {
@ -402,8 +402,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteY, mode: AddressMode::AbsoluteY,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "CMP $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_CMP_INDX as usize] = Some(OpInfo { table[ISA_OP_CMP_INDX as usize] = Some(OpInfo {
@ -411,8 +411,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::IndirectX, mode: AddressMode::IndirectX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "CMP ($",
format_postfix: "", format_postfix: " ,X)",
}); });
table[ISA_OP_CMP_INDY as usize] = Some(OpInfo { table[ISA_OP_CMP_INDY as usize] = Some(OpInfo {
@ -420,8 +420,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::IndirectY, mode: AddressMode::IndirectY,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "CMP ($",
format_postfix: "", format_postfix: "),Y",
}); });
@ -430,7 +430,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CPX #$",
format_postfix: "", format_postfix: "",
}); });
@ -439,7 +439,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "CPX $",
format_postfix: "", format_postfix: "",
}); });
@ -448,7 +448,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "CPX $",
format_postfix: "", format_postfix: "",
}); });
@ -457,7 +457,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "CPY #$",
format_postfix: "", format_postfix: "",
}); });
@ -466,7 +466,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "CPY $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_CPY_ABS as usize] = Some(OpInfo { table[ISA_OP_CPY_ABS as usize] = Some(OpInfo {
@ -474,7 +474,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "CPY $",
format_postfix: "", format_postfix: "",
}); });
@ -483,7 +483,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "DEC $",
format_postfix: "", format_postfix: "",
}); });
@ -492,8 +492,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "DEC $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_DEC_ABS as usize] = Some(OpInfo { table[ISA_OP_DEC_ABS as usize] = Some(OpInfo {
@ -501,7 +501,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "DEC $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_DEC_ABSX as usize] = Some(OpInfo { table[ISA_OP_DEC_ABSX as usize] = Some(OpInfo {
@ -509,15 +509,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 7, cycles: 7,
format_prefix: "TBD", format_prefix: "DEC $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_DEX as usize] = Some(OpInfo { table[ISA_OP_DEX as usize] = Some(OpInfo {
operation: DEX, operation: DEX,
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "DEX",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_DEY as usize] = Some(OpInfo { table[ISA_OP_DEY as usize] = Some(OpInfo {
@ -525,7 +525,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "DEY",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_EOR_I as usize] = Some(OpInfo { table[ISA_OP_EOR_I as usize] = Some(OpInfo {
@ -533,7 +533,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "EOR #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_EOR_ZP as usize] = Some(OpInfo { table[ISA_OP_EOR_ZP as usize] = Some(OpInfo {
@ -541,7 +541,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "EOR $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_EOR_ZPX as usize] = Some(OpInfo { table[ISA_OP_EOR_ZPX as usize] = Some(OpInfo {
@ -549,15 +549,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "EOR $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_EOR_ABS as usize] = Some(OpInfo { table[ISA_OP_EOR_ABS as usize] = Some(OpInfo {
operation: EOR, operation: EOR,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "EOR $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_EOR_ABSX as usize] = Some(OpInfo { table[ISA_OP_EOR_ABSX as usize] = Some(OpInfo {
@ -565,32 +565,32 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "EOR $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_EOR_ABSY as usize] = Some(OpInfo { table[ISA_OP_EOR_ABSY as usize] = Some(OpInfo {
operation: EOR, operation: EOR,
mode: AddressMode::AbsoluteY, mode: AddressMode::AbsoluteY,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "EOR $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_EOR_INDX as usize] = Some(OpInfo { table[ISA_OP_EOR_INDX as usize] = Some(OpInfo {
operation: EOR, operation: EOR,
mode: AddressMode::IndirectX, mode: AddressMode::IndirectX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "EOR ($",
format_postfix: "", format_postfix: ",X)",
}); });
table[ISA_OP_EOR_INDY as usize] = Some(OpInfo { table[ISA_OP_EOR_INDY as usize] = Some(OpInfo {
operation: EOR, operation: EOR,
mode: AddressMode::IndirectY, mode: AddressMode::IndirectY,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "EOR ($",
format_postfix: "", format_postfix: "),Y",
}); });
table[ISA_OP_INC_ZP as usize] = Some(OpInfo { table[ISA_OP_INC_ZP as usize] = Some(OpInfo {
@ -598,7 +598,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "INC $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_INC_ZPX as usize] = Some(OpInfo { table[ISA_OP_INC_ZPX as usize] = Some(OpInfo {
@ -606,15 +606,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "INC $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_INC_ABS as usize] = Some(OpInfo { table[ISA_OP_INC_ABS as usize] = Some(OpInfo {
operation: INC, operation: INC,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "INC $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_INC_ABSX as usize] = Some(OpInfo { table[ISA_OP_INC_ABSX as usize] = Some(OpInfo {
@ -622,15 +622,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 7, cycles: 7,
format_prefix: "TBD", format_prefix: "INC $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_INX as usize] = Some(OpInfo { table[ISA_OP_INX as usize] = Some(OpInfo {
operation: INX, operation: INX,
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "INX",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_INY as usize] = Some(OpInfo { table[ISA_OP_INY as usize] = Some(OpInfo {
@ -638,7 +638,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "INY",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_JMP_ABS as usize] = Some(OpInfo { table[ISA_OP_JMP_ABS as usize] = Some(OpInfo {
@ -646,7 +646,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 3, cycles: 3,
format_prefix: "JMP", format_prefix: "JMP $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_JMP_IND as usize] = Some(OpInfo { table[ISA_OP_JMP_IND as usize] = Some(OpInfo {
@ -679,7 +679,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "LDA $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDA_ZX as usize] = Some(OpInfo { table[ISA_OP_LDA_ZX as usize] = Some(OpInfo {
@ -687,15 +687,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDA $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_LDA_ABS as usize] = Some(OpInfo { table[ISA_OP_LDA_ABS as usize] = Some(OpInfo {
operation: Operation::LDA, operation: Operation::LDA,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDA $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDA_ABSX as usize] = Some(OpInfo { table[ISA_OP_LDA_ABSX as usize] = Some(OpInfo {
@ -703,32 +703,32 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDA $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_LDA_ABSY as usize] = Some(OpInfo { table[ISA_OP_LDA_ABSY as usize] = Some(OpInfo {
operation: LDA, operation: LDA,
mode: AddressMode::AbsoluteY, mode: AddressMode::AbsoluteY,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDA $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_LDA_INDX as usize] = Some(OpInfo { table[ISA_OP_LDA_INDX as usize] = Some(OpInfo {
operation: Operation::LDA, operation: Operation::LDA,
mode: AddressMode::IndirectX, mode: AddressMode::IndirectX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "LDA ($",
format_postfix: "", format_postfix: ",X)",
}); });
table[ISA_OP_LDA_INDY as usize] = Some(OpInfo { table[ISA_OP_LDA_INDY as usize] = Some(OpInfo {
operation: LDA, operation: LDA,
mode: AddressMode::IndirectY, mode: AddressMode::IndirectY,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "LDA ($",
format_postfix: "", format_postfix: "),Y",
}); });
table[ISA_OP_LDX_I as usize] = Some(OpInfo { table[ISA_OP_LDX_I as usize] = Some(OpInfo {
@ -736,7 +736,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "LDX #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDX_ZP as usize] = Some(OpInfo { table[ISA_OP_LDX_ZP as usize] = Some(OpInfo {
@ -744,7 +744,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "LDX $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDX_ZPY as usize] = Some(OpInfo { table[ISA_OP_LDX_ZPY as usize] = Some(OpInfo {
@ -752,15 +752,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageY, mode: AddressMode::ZeroPageY,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDX $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_LDX_ABS as usize] = Some(OpInfo { table[ISA_OP_LDX_ABS as usize] = Some(OpInfo {
operation: Operation::LDX, operation: Operation::LDX,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDX $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDX_ABSY as usize] = Some(OpInfo { table[ISA_OP_LDX_ABSY as usize] = Some(OpInfo {
@ -768,8 +768,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteY, mode: AddressMode::AbsoluteY,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDX $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_LDY_I as usize] = Some(OpInfo { table[ISA_OP_LDY_I as usize] = Some(OpInfo {
@ -777,7 +777,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "LDY #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDY_ZP as usize] = Some(OpInfo { table[ISA_OP_LDY_ZP as usize] = Some(OpInfo {
@ -785,7 +785,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "LDY $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDY_ZPX as usize] = Some(OpInfo { table[ISA_OP_LDY_ZPX as usize] = Some(OpInfo {
@ -793,15 +793,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDY $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_LDY_ABS as usize] = Some(OpInfo { table[ISA_OP_LDY_ABS as usize] = Some(OpInfo {
operation: LDY, operation: LDY,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDY $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LDY_ABSX as usize] = Some(OpInfo { table[ISA_OP_LDY_ABSX as usize] = Some(OpInfo {
@ -809,8 +809,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "LDY $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_LSR_A as usize] = Some(OpInfo { table[ISA_OP_LSR_A as usize] = Some(OpInfo {
@ -818,7 +818,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Accumulator, mode: AddressMode::Accumulator,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "LSR",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LSR_ZP as usize] = Some(OpInfo { table[ISA_OP_LSR_ZP as usize] = Some(OpInfo {
@ -826,7 +826,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "LSR $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LSR_ZPX as usize] = Some(OpInfo { table[ISA_OP_LSR_ZPX as usize] = Some(OpInfo {
@ -834,15 +834,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "LSR $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_LSR_ABS as usize] = Some(OpInfo { table[ISA_OP_LSR_ABS as usize] = Some(OpInfo {
operation: Operation::LSR, operation: Operation::LSR,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "LSR $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_LSR_ABSX as usize] = Some(OpInfo { table[ISA_OP_LSR_ABSX as usize] = Some(OpInfo {
@ -868,7 +868,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "ORA #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ORA_ZP as usize] = Some(OpInfo { table[ISA_OP_ORA_ZP as usize] = Some(OpInfo {
@ -876,7 +876,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "ORA $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ORA_ZPX as usize] = Some(OpInfo { table[ISA_OP_ORA_ZPX as usize] = Some(OpInfo {
@ -884,15 +884,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "ORA $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_ORA_ABS as usize] = Some(OpInfo { table[ISA_OP_ORA_ABS as usize] = Some(OpInfo {
operation: Operation::ORA, operation: Operation::ORA,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "ORA $",
format_postfix: "", format_postfix: "",
}); });
@ -901,32 +901,32 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "ORA $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_ORA_ABSY as usize] = Some(OpInfo { table[ISA_OP_ORA_ABSY as usize] = Some(OpInfo {
operation: Operation::ORA, operation: Operation::ORA,
mode: AddressMode::AbsoluteY, mode: AddressMode::AbsoluteY,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "ORA $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_ORA_INDX as usize] = Some(OpInfo { table[ISA_OP_ORA_INDX as usize] = Some(OpInfo {
operation: Operation::ORA, operation: Operation::ORA,
mode: AddressMode::IndirectX, mode: AddressMode::IndirectX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ORA ($",
format_postfix: "", format_postfix: ",X)",
}); });
table[ISA_OP_ORA_INDY as usize] = Some(OpInfo { table[ISA_OP_ORA_INDY as usize] = Some(OpInfo {
operation: Operation::ORA, operation: Operation::ORA,
mode: AddressMode::IndirectY, mode: AddressMode::IndirectY,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "ORA ($",
format_postfix: "", format_postfix: "),Y",
}); });
table[ISA_OP_PHA as usize] = Some(OpInfo { table[ISA_OP_PHA as usize] = Some(OpInfo {
@ -934,7 +934,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "PHA",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_PHP as usize] = Some(OpInfo { table[ISA_OP_PHP as usize] = Some(OpInfo {
@ -942,7 +942,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "PHP",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_PLA as usize] = Some(OpInfo { table[ISA_OP_PLA as usize] = Some(OpInfo {
@ -950,7 +950,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "PLA",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_PLP as usize] = Some(OpInfo { table[ISA_OP_PLP as usize] = Some(OpInfo {
@ -958,7 +958,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "PLP",
format_postfix: "", format_postfix: "",
}); });
@ -967,7 +967,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Accumulator, mode: AddressMode::Accumulator,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "ROL",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ROL_ZP as usize] = Some(OpInfo { table[ISA_OP_ROL_ZP as usize] = Some(OpInfo {
@ -975,7 +975,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "ROL $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ROL_ZPX as usize] = Some(OpInfo { table[ISA_OP_ROL_ZPX as usize] = Some(OpInfo {
@ -983,15 +983,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ROL $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_ROL_ABS as usize] = Some(OpInfo { table[ISA_OP_ROL_ABS as usize] = Some(OpInfo {
operation: Operation::ROL, operation: Operation::ROL,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ROL $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ROL_ABSX as usize] = Some(OpInfo { table[ISA_OP_ROL_ABSX as usize] = Some(OpInfo {
@ -999,8 +999,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 7, cycles: 7,
format_prefix: "TBD", format_prefix: "ROL $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_ROR_A as usize] = Some(OpInfo { table[ISA_OP_ROR_A as usize] = Some(OpInfo {
@ -1008,7 +1008,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Accumulator, mode: AddressMode::Accumulator,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "ROR",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ROR_ZP as usize] = Some(OpInfo { table[ISA_OP_ROR_ZP as usize] = Some(OpInfo {
@ -1016,7 +1016,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 5, cycles: 5,
format_prefix: "TBD", format_prefix: "ROR $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ROR_ZPX as usize] = Some(OpInfo { table[ISA_OP_ROR_ZPX as usize] = Some(OpInfo {
@ -1024,15 +1024,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ROR $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_ROR_ABS as usize] = Some(OpInfo { table[ISA_OP_ROR_ABS as usize] = Some(OpInfo {
operation: Operation::ROR, operation: Operation::ROR,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "ROR $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_ROR_ABSX as usize] = Some(OpInfo { table[ISA_OP_ROR_ABSX as usize] = Some(OpInfo {
@ -1040,8 +1040,8 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 7, cycles: 7,
format_prefix: "TBD", format_prefix: "ROR $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_RTI as usize] = Some(OpInfo { table[ISA_OP_RTI as usize] = Some(OpInfo {
@ -1049,7 +1049,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "RTI",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_RTS as usize] = Some(OpInfo { table[ISA_OP_RTS as usize] = Some(OpInfo {
@ -1057,7 +1057,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Implied, mode: AddressMode::Implied,
length: 1, length: 1,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "RTS",
format_postfix: "", format_postfix: "",
}); });
@ -1066,7 +1066,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::Immediate, mode: AddressMode::Immediate,
length: 2, length: 2,
cycles: 2, cycles: 2,
format_prefix: "TBD", format_prefix: "SBC #$",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_SBC_ZP as usize] = Some(OpInfo { table[ISA_OP_SBC_ZP as usize] = Some(OpInfo {
@ -1074,7 +1074,7 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPage, mode: AddressMode::ZeroPage,
length: 2, length: 2,
cycles: 3, cycles: 3,
format_prefix: "TBD", format_prefix: "SBC $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_SBC_ZPX as usize] = Some(OpInfo { table[ISA_OP_SBC_ZPX as usize] = Some(OpInfo {
@ -1082,15 +1082,15 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::ZeroPageX, mode: AddressMode::ZeroPageX,
length: 2, length: 2,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "SBC $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_SBC_ABS as usize] = Some(OpInfo { table[ISA_OP_SBC_ABS as usize] = Some(OpInfo {
operation: Operation::SBC, operation: Operation::SBC,
mode: AddressMode::Absolute, mode: AddressMode::Absolute,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "SBC $",
format_postfix: "", format_postfix: "",
}); });
table[ISA_OP_SBC_ABSX as usize] = Some(OpInfo { table[ISA_OP_SBC_ABSX as usize] = Some(OpInfo {
@ -1098,24 +1098,24 @@ pub const INSTRUCTION_TABLE: [Option<OpInfo>; 256] = {
mode: AddressMode::AbsoluteX, mode: AddressMode::AbsoluteX,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "SBC $",
format_postfix: "", format_postfix: ",X",
}); });
table[ISA_OP_SBC_ABSY as usize] = Some(OpInfo { table[ISA_OP_SBC_ABSY as usize] = Some(OpInfo {
operation: Operation::SBC, operation: Operation::SBC,
mode: AddressMode::AbsoluteY, mode: AddressMode::AbsoluteY,
length: 3, length: 3,
cycles: 4, cycles: 4,
format_prefix: "TBD", format_prefix: "SBC $",
format_postfix: "", format_postfix: ",Y",
}); });
table[ISA_OP_SBC_INDX as usize] = Some(OpInfo { table[ISA_OP_SBC_INDX as usize] = Some(OpInfo {
operation: Operation::SBC, operation: Operation::SBC,
mode: AddressMode::IndirectX, mode: AddressMode::IndirectX,
length: 2, length: 2,
cycles: 6, cycles: 6,
format_prefix: "TBD", format_prefix: "SBC ($",
format_postfix: "", format_postfix: ",X)",
}); });
table[ISA_OP_SBC_INDY as usize] = Some(OpInfo { table[ISA_OP_SBC_INDY as usize] = Some(OpInfo {
operation: Operation::SBC, operation: Operation::SBC,

View File

@ -15,3 +15,140 @@
AND #$ab ; AND Immediate AND #$ab ; AND Immediate
AND $ab ; AND ZeroPage AND $ab ; AND ZeroPage
AND $ab,X ; AND ZeroPageX AND $ab,X ; AND ZeroPageX
AND $abcd ; AND Absolute
AND $abcd,X; AND AbsoluteX
AND $abcd,Y; AND AbsoluteY
AND ($ab,X); AND IndirectX
AND ($ab),Y; AND IndirectY
ASL ; ASL Accumulator
ASL $ab ; ASL ZeroPage
ASL $ab,X ; ASL ZeroPageX
ASL $abcd ; ASL Absolute
ASL $abcd,X; ASL AbsoluteX
BCC $ab ; BCC Immediate
BCS $ab ; BCS Immediate
BEQ $ab ; BEQ Immediate
BIT $ab ; BIT ZeroPage
BIT $abcd ; BIT Absolute
BMI $ab ; BMI Immediate
BNE $ab ; BNI Immediate
BPL $ab ; BPL Immediate
BRK ; BRK
BVC $ab ; BVC Immediate
BVS $ab ; BVS Immediate
CLC ; CLC
CLD ; CLD
CLI ; CLI
CLV ; CLV
CMP #$ab ; CMP Immediate
CMP $ab ; CMP ZeroPage
CMP $ab,X ; CMP ZeroPageX
CMP $abcd ; CMP Absolute
CMP $abcd,X; CMP AbsoluteX
CMP $abcd,Y; CMP AbsoluteY
CMP ($ab,X); CMP IndirectX
CMP ($ab),Y; CMP IndirectY
CPX #$ab ; CPX Immediate
CPX $ab ; CPX ZeroPage
CPX $abcd ; CPX Absolute
CPY #$ab ; CPY Immediate
CPY $ab ; CPY ZeroPage
CPY $abcd ; CPY Absolute
DEC $ab ; DEC ZeroPage
DEC $ab,X ; DEC ZeroPageX
DEC $abcd ; DEC Absolute
DEC $abcd,X; DEC AbsoluteX
DEX ; DEX
DEY ; DEY
EOR #$ab ; EOR Immediate
EOR $ab ; EOR ZeroPage
EOR $ab,X ; EOR ZeroPageX
EOR $abcd ; EOR Absolute
EOR $abcd,X; EOR AbsoluteX
EOR $abcd,Y; EOR AbsoluteY
EOR ($ab,X); EOR IndirectX
EOR ($ab),Y; EOR IndirectY
INC $ab ; INC ZeroPage
INC $ab,X ; INC ZeroPage,X
INC $abcd ; INC Absolute
INC $abcd,X; INC AbsoluteX
INX ; INX
INY ; INY
JMP $abcd ; JMP Absolute
JMP ($abcd); JMP Indirect
JSR $abcd ; JSR Absolute
LDA #$ab ; LDA Immediate
LDA $ab ; LDA ZeroPage
LDA $ab,X ; LDA ZeroPageX
LDA $abcd ; LDA Absolute
LDA $abcd,X; LDA AbsoluteX
LDA $abcd,Y; LDA AbsoluteY
LDA ($ab,X); LDA IndirectX
LDA ($ab),Y; LDA IndirectY
LDX #$ab ; LDX Immediate
LDX $ab ; LDX ZeroPage
LDX $ab,Y ; LDX ZeroPageY
LDX $abcd ; LDX Absolute
LDX $abcd,Y; LDX AbsoluteY
LDY #$ab ; LDY Immediate
LDY $ab ; LDY ZeroPage
LDY $ab,X ; LDY ZeroPageX
LDY $abcd ; LDY Absolute
LDY $abcd,X; LDY AbsoluteX
LSR ; LSR Accumulator
LSR $ab ; LSR ZeroPage
LSR $ab,X ; LSR ZeroPageX
LSR $abcd ; LSR Absolute
LSR $abcd,X; LSR AbsoluteX
NOP ; The great and powerful NOP
ORA #$ab ; ORA Immediate
ORA $ab ; ORA ZeroPage
ORA $ab,X ; ORA ZeroPageX
ORA $abcd ; ORA Absolute
ORA $abcd,X; ORA AbsoluteX
ORA $abcd,Y; ORA AbsoluteY
ORA ($ab,X); ORA IndirectX
ORA ($ab),Y; ORA IndirectY
PHA ; PHA
PHP ; PHP
PLA ; PLA
PLP ; PLP
ROL ; ROL Accumulator
ROL $ab ; ROL ZeroPage
ROL $ab,X ; ROL ZeroPageX
ROL $abcd ; ROL Absolute
ROL $abcd,X; ROL AbsoluteX
ROR ; ROR Accumulator
ROR $ab ; ROR ZeroPage
ROR $ab,X ; ROR ZeroPageX
ROR $abcd ; ROR Absolute
ROR $abcd,X; ROR AbsoluteX
RTI ; Interrupt Return
RTS ; Subroutine Return