aboutsummaryrefslogtreecommitdiff
path: root/src/c8asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/c8asm')
-rw-r--r--src/c8asm/assembler.c4
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));
}