diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-02-14 00:42:13 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-02-14 00:42:13 +0100 |
commit | 1bbcb4597e873416223a01a03f7c7e3831dfa6bc (patch) | |
tree | d58f9b22468560eecee8b7011a3348844b568c5f | |
parent | 7f170ee856a07769a2db9a373efecb690a9840ee (diff) |
Offset labels by 0x200
-rw-r--r-- | src/c8asm/assembler.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/c8asm/assembler.c b/src/c8asm/assembler.c index c682ccb..ea292b7 100644 --- a/src/c8asm/assembler.c +++ b/src/c8asm/assembler.c @@ -50,8 +50,10 @@ getaddr(struct raw_addr a) struct label *lbl; if (!a.label) return a.val; + /* The first 0x200 is reserved for the interpreter, so we need to offset + labels that aren’t integer-literals by that. */ if (lbl = getlabel(a.sv)) - return lbl->addr; + return lbl->addr + 0x200; die_with_off(filename, a.sv.p - baseptr, E_LNEXISTS, U8_PRI_ARGS(a.sv)); } |