Function disasm6502::instruction::decode [] [src]

pub fn decode(address: u16, index: &mut usize, memory: &[u8]) -> Instruction

Create instruction for given index/program counter in memory buffer and place it at specified address.

Examples

extern crate disasm6502;

let memory = vec![0x05, 0x0B, 0x6C, 0x01, 0x02];

// set program counter to 0 - will decode first instruction
let mut pc: usize = 0;

// interprets 0x05 as an instruction, places it at $0800
let instruction = disasm6502::instruction::decode(0x0800, &mut pc, &memory);