From: Lukas Krickl Date: Sun, 2 Mar 2025 05:22:24 +0000 (+0100) Subject: symbols: Added bank variable and TODO for new .bank command X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=a67264829e491f641bc02ba4ee3309988c60310f;p=ulas%2F.git symbols: Added bank variable and TODO for new .bank command --- 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; };