Struct disasm6502::instruction::Instruction [−][src]
Decoded 6502 instruction.
Fields
opcode: OpCode
instruction opcode
cycles: u8
cycle count for the instruction
addr_mode: AddrMode
instruction addressing mode
address: u16
address of the instruction in memory buffer
operand: Option<u16>
optional instruction operand
extra_cycle: bool
instruction may take an extra cycle if zero page boundary is crossed
illegal: bool
instruction is illegal/undocumented
registers_read: RegVec
registers read by this instruction (optional)
registers_written: RegVec
registers written by this instruction (optional)
affected_flags: FlagVec
CPU status flags affected by this instruction (optional)
Implementations
impl Instruction
[src]
pub fn as_hex_str(&self) -> String
[src]
Convert instruction to fixed length string of hex values (opcode + operand, if applicable).
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); // prints: "0x05 0x0B " (instruction + operand value) println!("{}", instruction.as_hex_str());
pub fn as_str(&self) -> String
[src]
Convert instruction to assembler mnemonic.
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); // prints: "ORA $0B" println!("{}", instruction.as_str());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,