From: Lukas Krickl Date: Tue, 28 Nov 2023 16:38:41 +0000 (+0100) Subject: WIP: symbols X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=36ca47e5c15193c98217a2f9881399ffb781a08d;p=ulas%2F.git WIP: symbols --- diff --git a/include/ulas.h b/include/ulas.h index dcf793f..806fde6 100644 --- a/include/ulas.h +++ b/include/ulas.h @@ -152,7 +152,7 @@ struct ulas_exprbuf { * Symbols */ -enum ulas_syms { ULAS_SYM_FORWARD, ULAS_SYM_DECL }; +enum ulas_syms { ULAS_SYM_LABEL, ULAS_SYM_DEF }; struct ulas_sym { char *name; diff --git a/src/ulas.c b/src/ulas.c index 993a00a..977e758 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -41,9 +41,7 @@ void ulas_init(struct ulas_config cfg) { ulas.syms = ulas_symbuf(); } -void ulas_nextpass(void) { - ulas.scope = 0; -} +void ulas_nextpass(void) { ulas.scope = 0; } void ulas_free(void) { ulas_strfree(&ulas.tok); @@ -1963,6 +1961,10 @@ int ulas_asmline(FILE *dst, FILE *src, const char *line, unsigned long n) { ulas.address = ulas_intexpr(&line, strnlen(start, n), &rc); break; case ULAS_ASMDIR_SET: + // only do this in the final pass + if (ulas.pass == ULAS_PASS_FINAL) { + } + break; case ULAS_ASMDIR_BYTE: case ULAS_ASMDIR_STR: case ULAS_ASMDIR_FILL: