pub struct Assembler { /* private fields */ }Expand description
Assembles a series of RawOp into raw bytes, tracking and resolving macros and labels,
and handling dynamic pushes.
§Example
use etk_asm::asm::Assembler;
use etk_asm::ops::AbstractOp;
use etk_ops::shanghai::{Op, GetPc};
let mut asm = Assembler::new();
asm.push_all(vec![
AbstractOp::new(GetPc),
])?;
let output = asm.take();
asm.finish()?;Implementations§
Source§impl Assembler
impl Assembler
Sourcepub fn finish(self) -> Result<(), Error>
pub fn finish(self) -> Result<(), Error>
Indicate that the input sequence is complete. Returns any errors that may remain.
Sourcepub fn take(&mut self) -> Vec<u8> ⓘ
pub fn take(&mut self) -> Vec<u8> ⓘ
Collect any assembled instructions that are ready to be output.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Assembler
impl RefUnwindSafe for Assembler
impl Send for Assembler
impl Sync for Assembler
impl Unpin for Assembler
impl UnwindSafe for Assembler
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