Wrote an assembler (transpiles brainfuck into assembly code)

Provides:
+ Transpilation from brainfuck code into intel style assembly
+ functions to assemble and link code
This commit is contained in:
2024-12-03 03:38:01 +00:00
parent 14ee1d3f02
commit a135262cd8
2 changed files with 220 additions and 0 deletions

17
assembler.h Normal file
View File

@@ -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