summaryrefslogtreecommitdiff
path: root/asm.myr
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2020-01-01 12:59:47 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2020-01-01 12:59:47 -0500
commit0a1fdf45794b0f00be44bd48113daea90aace65e (patch)
treeab4d251446589d87231d3b2b9bec1671dba38394 /asm.myr
parent4d42144c4dc35a8e7e7ce544e90b34eb440ed1c5 (diff)
Calculate label positions relative to load address
Diffstat (limited to 'asm.myr')
-rw-r--r--asm.myr4
1 files changed, 2 insertions, 2 deletions
diff --git a/asm.myr b/asm.myr
index b634e9c..40e89fb 100644
--- a/asm.myr
+++ b/asm.myr
@@ -373,8 +373,8 @@ const main = {
match std.htget(labels, l)
| `std.None: die_rewrite(l, linum)
| `std.Some(addr):
- buf[buf_pos] |= addr & 0x0f00
- buf[buf_pos + 1] |= addr & 0xff
+ buf[buf_pos] |= ((addr + 0x200) & 0x0f00) >> 8
+ buf[buf_pos + 1] |= (addr + 0x200) & 0xff
;;
;;
;;