[−][src]Struct dez80::instruction::Instruction
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]
fn clone(&self) -> Instruction
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn eq(&self, other: &Instruction) -> bool
[src]
fn ne(&self, other: &Instruction) -> bool
[src]
impl StructuralPartialEq for Instruction
[src]
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,