1 parent
4c4fa91dc9
commit
cc8516a369
7 files changed
+438
-44
No files matched your search
@@ -64,3 +64,18 @@ fn Asm::i64(self : Asm, x : Int64) -> Unit {
|
||||
self.b((x >> (8 * k)).to_int())
|
||||
}
|
||||
}
|
||||
|
||||
///|
|
||||
/// Emit opcode bytes followed by a rel8 placeholder; returns its position.
|
||||
fn Asm::rel8(self : Asm, op : Array[Int]) -> Int {
|
||||
self.bs(op)
|
||||
let at = self.here()
|
||||
self.b(0)
|
||||
at
|
||||
}
|
||||
|
||||
///|
|
||||
/// Point the rel8 placeholder at `at` to the current position.
|
||||
fn Asm::patch_here8(self : Asm, at : Int) -> Unit {
|
||||
self.code[at] = (self.here() - (at + 1)).to_byte()
|
||||
}
|
||||
Reference in new issue
Block a user