refactor Linker & add LinkAddr to allow bytecode with partially resolved symbols / symbol-relative addresses

This commit is contained in:
Michael Sippel 2024-05-08 04:13:40 +02:00
parent b94723f1ba
commit 35760d76ce
Signed by: senvas
GPG key ID: F96CF119C34B64A6
4 changed files with 183 additions and 43 deletions

View file

@ -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() {}