r16/asm/main.c
2024-12-10 10:52:14 +00:00

26 lines
555 B
C

#include "../lib/carg-parse/carg-parse.h"
#include "./asm_const.h"
#include "./assembler.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
const char demo[] =
"mov R0, 1\n\
mov ACU, 0\n\
loop: add ACU, R0\n\
out ACU\n\
jmp loop\n";
int main(int argc, char **argv)
{
carg_parse_data* args = carg_parse(argc, argv);
AsmInstructionArray* abin = InterpretAssembly(/*args->values[0]*/ demo);
AsmLabelArray* labels = GenerateLabels(abin);
uint16_t* bin = CompileAsembly(abin, labels);
carg_parse_free(args);
return 0;
}