[−][src]Trait lasm::target::Target
This trait should be implemented for a struct that represents a target language that lasm assembles to.
Required methods
fn assemble(
&self,
initial_stack_ptr: usize,
stack_size: usize,
code: Vec<Instruct>
) -> String
&self,
initial_stack_ptr: usize,
stack_size: usize,
code: Vec<Instruct>
) -> String
This function assembles a list of instructions with a given stack size and initial stack pointer.
The reason the initial stack pointer is necessary is because the output code must know how large the memory allocated for registers is. Without the initial stack pointer, the output code would have no clue how much memory registers use.