[][src]Struct dez80::instruction::Instruction

pub struct Instruction {
    pub ignored_prefixes: Vec<OpcodePrefix>,
    pub opcode: Opcode,
    pub type: InstructionType,
    pub source: Option<Operand>,
    pub destination: Option<Operand>,
}

Represents a single Z80 instruction.

Fields

ignored_prefixes: Vec<OpcodePrefix>

Collection of 0xDD and 0xFD opcodes (indexed instruction prefixes) that are ignored during the decoding process, due to the opcodes they precede not mapping to an actual indexed instruction. These ignored prefixes incur a runtime cost, but have no other effect on the decoded instruction.

opcode: Opcode

The actual opcode decoded for this instruction, including any prefix.

type: InstructionType

The instruction type for this instruction, which maps to a mnemonic.

source: Option<Operand>

The source operand for this instruction if any, indicating where data is read.

destination: Option<Operand>

The destination operand for this instruction if any, indicating where data is written.

Implementations

impl Instruction[src]

pub fn to_bytes(&self) -> Vec<u8>[src]

Provides the raw encoded representation of the instruction.

pub fn decode_one<R: Read>(source: &mut R) -> Result<Instruction, DecodingState>[src]

Decodes a single instruction from a source, or None if one cannot be decoded. This is a thin wrapper around Instruction::decode(), which does not require the caller to convert its source to a Peekable<Bytes<R>>.

pub fn decode_all<R: Read>(source: &mut R) -> Vec<Instruction>[src]

Decodes a sequence of instructions, until the end of the stream or an error is reached.

Trait Implementations

impl Clone for Instruction[src]

impl Debug for Instruction[src]

impl Default for Instruction[src]

impl Display for Instruction[src]

Formats instructions by disassembling their raw byte representation.

impl PartialEq<Instruction> for Instruction[src]

impl StructuralPartialEq for Instruction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.