assembler: add call_symobl()

This commit is contained in:
Michael Sippel 2024-05-12 04:38:02 +02:00
parent 4fb80fe158
commit ed5e3453b0
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -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) );