pub enum AssemblyResult {
I(Instruction),
C(CInstruction),
}Variants§
Implementations§
Source§impl AssemblyResult
impl AssemblyResult
pub fn c(self) -> CInstruction
Sourcepub fn i(self) -> Instruction
pub fn i(self) -> Instruction
Examples found in repository?
examples/simple.rs (line 4)
2fn main() {
3 // instruction can be assembled from strings
4 let instr: Instruction = assemble_line("addi t0, t1, 1024").unwrap().i();
5 // and disassembled
6 println!("assembled instruction: {}", instr);
7
8 // instructions can also be decoded from binary
9 let instr2 = Instruction::decode(0xe0058513).unwrap();
10
11 // and encoded
12 assert_eq!(Instruction::encode(&instr2), 0xe0058513);
13}Trait Implementations§
Source§impl Debug for AssemblyResult
impl Debug for AssemblyResult
Source§impl PartialEq for AssemblyResult
impl PartialEq for AssemblyResult
impl StructuralPartialEq for AssemblyResult
Auto Trait Implementations§
impl Freeze for AssemblyResult
impl RefUnwindSafe for AssemblyResult
impl Send for AssemblyResult
impl Sync for AssemblyResult
impl Unpin for AssemblyResult
impl UnwindSafe for AssemblyResult
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