From 3fe9c90d8d332b08706e47b29e1e0def3beb3659 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Mon, 13 Nov 2023 14:03:02 +0100 Subject: [PATCH] WIP: assembly step --- include/ulas.h | 9 ++++++++- src/ulas.c | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/include/ulas.h b/include/ulas.h index 6fe20a9..b1df177 100644 --- a/include/ulas.h +++ b/include/ulas.h @@ -281,7 +281,8 @@ int ulas_preprocnext(struct ulas_preproc *pp, FILE *dst, FILE *src, char *buf, // -1 on error // Warning: calling this recursively may clobber pp buffers and those should // not be used in the caller after recursvion finishes! -// or initialize a new preproc object if the old state is important! (preprocinit and preprocfree) +// or initialize a new preproc object if the old state is important! +// (preprocinit and preprocfree) int ulas_preprocline(struct ulas_preproc *pp, FILE *dst, FILE *src, const char *raw_line, size_t n); @@ -289,4 +290,10 @@ int ulas_preprocline(struct ulas_preproc *pp, FILE *dst, FILE *src, char *ulas_preprocexpand(struct ulas_preproc *pp, const char *raw_line, size_t *n); +/** + * Assembly step + */ + +int ulas_asm(FILE *dst, FILE *src); + #endif diff --git a/src/ulas.c b/src/ulas.c index 10851b6..8aca72d 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -72,7 +72,8 @@ int ulas_main(struct ulas_config cfg) { goto cleanup; } - // TODO: rest of steps here + fseek(preprocdst, 0, SEEK_SET); + rc = ulas_asm(ulasout, preprocdst); cleanup: if (!cfg.preproc_only) { @@ -683,3 +684,13 @@ int ulas_preproc(FILE *dst, FILE *src) { return rc; } + +/** + * Assembly step + */ + +int ulas_asm(FILE *dst, FILE *src) { + int rc = 0; + + return rc; +} -- 2.30.2