From a135262cd8eed85df769a7dbace73a886af7d6df Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 3 Dec 2024 03:38:01 +0000 Subject: Wrote an assembler (transpiles brainfuck into assembly code) Provides: + Transpilation from brainfuck code into intel style assembly + functions to assemble and link code --- assembler.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 assembler.h (limited to 'assembler.h') diff --git a/assembler.h b/assembler.h new file mode 100644 index 0000000..f311a96 --- /dev/null +++ b/assembler.h @@ -0,0 +1,17 @@ +#ifndef ASSEMBLER_H +#define ASSEMBLER_H + +#include "./lib.h" +#include "./parser.h" + +void asm_setup_buffer(buffer_t **asm_buffer, const char *outname); +void asm_translate_nodes(buffer_t **asm_buffer, struct PResult nodes, + const char *src_name); + +void asm_write(buffer_t **asm_buffer); +int asm_assemble(const char *srcname, const char *objname); +int asm_link(const char *objname, const char *outname); +int asm_compile(buffer_t **asm_buffer, const char *objname, + const char *outname); + +#endif -- cgit v1.2.3-13-gbd6f