pub struct Assembler { /* private fields */ }Implementations§
Source§impl Assembler
impl Assembler
pub fn new() -> Self
pub fn position(&self) -> u32
pub fn label(&mut self, name: &str) -> Result<(), AssemblerError>
pub fn set_source(&mut self, source: String)
pub fn mark_line(&mut self, line: u32)
pub fn add_function(&mut self, name: String, args: Vec<String>)
pub fn add_local(&mut self, name: String, index: u8)
pub fn add_local_with_range( &mut self, name: String, index: u8, declared_line: Option<u32>, last_line: Option<u32>, )
pub fn add_constant(&mut self, value: Value) -> u32
pub fn push_const(&mut self, value: Value) -> u32
pub fn finish_program(self) -> Result<Program, AssemblerError>
pub fn nop(&mut self)
pub fn ret(&mut self)
pub fn ldc(&mut self, index: u32)
pub fn add(&mut self)
pub fn sub(&mut self)
pub fn mul(&mut self)
pub fn div(&mut self)
pub fn modulo(&mut self)
pub fn and(&mut self)
pub fn or(&mut self)
pub fn neg(&mut self)
pub fn not(&mut self)
pub fn ceq(&mut self)
pub fn clt(&mut self)
pub fn cgt(&mut self)
pub fn br(&mut self, target: u32)
pub fn br_label(&mut self, label: &str)
pub fn brfalse(&mut self, target: u32)
pub fn brfalse_label(&mut self, label: &str)
pub fn pop(&mut self)
pub fn dup(&mut self)
pub fn ldloc(&mut self, index: u8)
pub fn stloc(&mut self, index: u8)
pub fn call(&mut self, index: u16, argc: u8)
pub fn shl(&mut self)
pub fn shr(&mut self)
pub fn lshr(&mut self)
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 UnsafeUnpin 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