From a67264829e491f641bc02ba4ee3309988c60310f Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 2 Mar 2025 06:22:24 +0100 Subject: [PATCH] symbols: Added bank variable and TODO for new .bank command --- TODO.md | 1 + src/ulas.c | 2 +- src/ulas.h | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 0d6c2cd..341b382 100644 --- a/TODO.md +++ b/TODO.md @@ -6,3 +6,4 @@ - Add `.error` and `.warning` directives - Add failing tests for most failure cases - Assert `.section` in full test +- Add `.bank.` directive allowing users to set the current bank number (ulas.bank) which can be used for symbol files. diff --git a/src/ulas.c b/src/ulas.c index 98588f3..673ee02 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -441,7 +441,7 @@ int ulas_symbolout(FILE *dst, struct ulas_sym *s) { fprintf(dst, "\n"); break; case ULAS_SYM_FMT_SYM: - fprintf(dst, "00:"); + fprintf(dst, "%02d:", ulas.bank); switch (s->tok.type) { case ULAS_INT: diff --git a/src/ulas.h b/src/ulas.h index 9f62e74..129b068 100644 --- a/src/ulas.h +++ b/src/ulas.h @@ -320,8 +320,11 @@ struct ulas { char charcodemap[ULAS_CHARCODEMAPLEN]; char section[ULAS_SECTIONMAX]; // where was the section defined? - unsigned int section_address; - + unsigned int section_address; + + // active bank + unsigned int bank; + struct ulas_arch arch; }; -- 2.30.2