pub struct Instruction { /* private fields */ }
Expand description
An instruction for the CFD-16 ISA. Please use the InstructionBuilder interface to ensure that the built Instruction is valid.
use cfd16_lib::prelude::*;
let instr = InstructionBuilder::new(OpCode::Add)
.condition(CondCode::Zero)
.argument(Argument::Reg(Register::A))
.argument(Argument::Reg(Register::B))
.build()
.unwrap();
println!("{}", instr);
let encoding = instr.encode();
println!("{:#4x}", encoding);
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn executable(&self, mode: Mode) -> bool
pub fn executable(&self, mode: Mode) -> bool
Checks if the instruction can be executed in the given mode.
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Codable for Instruction
impl Codable for Instruction
Source§impl Debug for Instruction
impl Debug for Instruction
Source§impl Default for Instruction
impl Default for Instruction
Source§impl Display for Instruction
impl Display for Instruction
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
impl Eq for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more