aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-19 01:40:54 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-19 01:40:54 +0100
commit1207728a0c8824029a10d091e2258d242b77bd26 (patch)
tree999e9462721ef78eb1037e48f9083ec029965dae
parent6eec862df222c8d060e8482dd09d0f91197ee9fc (diff)
Better errors in the assembler
-rw-r--r--src/c8asm/assembler.c10
1 files 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);
}