9 Commits

Author SHA1 Message Date
Aryadev Chavali
f4e0be8977 struct Label -> label_t 2024-12-24 23:21:01 +00:00
Aryadev Chavali
9fb9413c45 node_t -> ast_node_t
Clearer to understand the intent of node_t as a direct result of
parsing source code.
2024-12-24 23:18:52 +00:00
Aryadev Chavali
fbf2202cfd Remove asm_write_init and asm_write_exit
Just inline into asm_translate_nodes
2024-12-24 23:15:04 +00:00
Aryadev Chavali
3c39df6c95 Implement SIZE_FMT and vec_append_fmt
SIZE_FMT gets the size of a cstr with the given sprintf formatted
string and arguments using `snprintf`.

vec_append_fmt formats a cstr with the given sprintf arguments then
appends it to the given vector.

This simplifies a little bit of the wordy implementation of the
assembler.
2024-12-24 23:08:52 +00:00
Aryadev Chavali
70cfeac995 Move system calling code to the end 2024-12-24 22:57:28 +00:00
Aryadev Chavali
7686c1043c Refactor assembler to use vec_t instead of buffer
Clearer, precise and no double pointers.
2024-12-19 08:45:47 +00:00
Aryadev Chavali
87fa534a7a asm_write_{init, exit} when asm_translate_nodes 2024-12-03 04:22:59 +00:00
Aryadev Chavali
6ad3e61a2b Fix errors due to no loops 2024-12-03 04:13:40 +00:00
Aryadev Chavali
a135262cd8 Wrote an assembler (transpiles brainfuck into assembly code)
Provides:
+ Transpilation from brainfuck code into intel style assembly
+ functions to assemble and link code
2024-12-03 03:38:01 +00:00