pub enum Instruction {
Show 19 variants
ADD {
dst: i16,
src1: i16,
src2: i16,
},
ADDi {
dst: i16,
src: i16,
immd: i16,
},
AND {
dst: i16,
src1: i16,
src2: i16,
},
ANDi {
dst: i16,
src: i16,
immd: i16,
},
BR {
cond: Condition,
offset: i16,
},
JMP {
base: i16,
},
JSR {
offset: i16,
},
JSRR {
base: i16,
},
LD {
dst: i16,
offset: i16,
},
LDI {
dst: i16,
offset: i16,
},
LDR {
dst: i16,
base: i16,
offset: i16,
},
LEA {
dst: i16,
offset: i16,
},
NOT {
dst: i16,
src: i16,
},
RTI,
ST {
src: i16,
offset: i16,
},
STI {
src: i16,
offset: i16,
},
STR {
src: i16,
base: i16,
offset: i16,
},
RESERVED,
TRAP {
vect: i16,
},
}
Expand description
A single LC-3 instruction. Except condition codes and is_immd values, all fields are set to i16 type for convenience.
Variants§
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn from_u16(data: u16) -> Instruction
pub fn from_u16(data: u16) -> Instruction
Converts a single u16 value to LC-3 instruction. Note that for some instructions that can be interpreted in multiple types (e.g. JSR/JSRR), every field will be initialized to defined bit array slice values even if it won’t be used.
Trait Implementations§
Source§impl Debug for Instruction
impl Debug 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