From 1207728a0c8824029a10d091e2258d242b77bd26 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 19 Feb 2024 01:40:54 +0100 Subject: Better errors in the assembler --- src/c8asm/assembler.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/c8asm/assembler.c b/src/c8asm/assembler.c index eaf2929..8ccf9b0 100644 --- a/src/c8asm/assembler.c +++ b/src/c8asm/assembler.c @@ -13,8 +13,8 @@ #include "macros.h" #include "parser.h" -#define E_LEXISTS "label ‘%.*s’ has already been declared" -#define E_LNEXISTS "label ‘%.*s’ hasn’t been declared" +#define E_LEXISTS "label has already been declared" +#define E_LNEXISTS "label hasn’t been declared yet" struct label { uint16_t addr; @@ -54,15 +54,15 @@ getaddr(struct raw_addr a) labels that aren’t integer-literals by that. */ if (lbl = getlabel(a.sv)) return lbl->addr + 0x200; - die_with_off(filename, a.sv.p - baseptr, E_LNEXISTS, U8_PRI_ARGS(a.sv)); + die_at_pos_with_code(filename, filebuf, a.sv, a.sv.p - baseptr, E_LNEXISTS); } void pushlabel(struct labels *dst, struct label lbl) { if (getlabel(lbl.sv)) { - die_with_off(filename, lbl.sv.p - baseptr, E_LEXISTS, - U8_PRI_ARGS(lbl.sv)); + die_at_pos_with_code(filename, filebuf, lbl.sv, lbl.sv.p - baseptr, + E_LEXISTS); } dapush(dst, lbl); } -- cgit v1.2.3