refactor Linker & add LinkAddr to allow bytecode with partially resolved symbols / symbol-relative addresses
This commit is contained in:
parent
b94723f1ba
commit
35760d76ce
4 changed files with 183 additions and 43 deletions
src
|
@ -31,6 +31,14 @@ impl VM {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn load(&mut self, bytecode: Vec< VM_Word >) {
|
||||
let mut addr = 0;
|
||||
for w in bytecode {
|
||||
self.memory[addr] = w;
|
||||
addr += 1;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn execute(&mut self, entry: VM_Word) {
|
||||
self.inst_ptr = entry;
|
||||
while self.execute_step() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue