assembler: add call_symobl()
This commit is contained in:
parent
4fb80fe158
commit
ed5e3453b0
1 changed files with 12 additions and 0 deletions
|
@ -96,6 +96,18 @@ impl Assembler {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn call_symbol(mut self, addr: LinkAddr) -> Assembler {
|
||||
self.words.push( AssemblyWord::inst(VM_Instruction::Call) );
|
||||
self.words.push( AssemblyWord::Symbol(addr) );
|
||||
self
|
||||
}
|
||||
|
||||
pub fn ref_symbol(mut self, addr: LinkAddr) -> Assembler {
|
||||
self.words.push( AssemblyWord::inst(VM_Instruction::Lit) );
|
||||
self.words.push( AssemblyWord::Symbol(addr) );
|
||||
self
|
||||
}
|
||||
|
||||
pub fn call(mut self, s: &str) -> Assembler {
|
||||
self.words.push( AssemblyWord::inst(VM_Instruction::Call) );
|
||||
self.words.push( AssemblyWord::symbol(s) );
|
||||
|
|
Loading…
Reference in a new issue