r16/asm/main.c
2024-12-17 10:09:20 +00:00

26 lines
562 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, 0x1\n\
mov ACU, 0x0\n\
add ACU, R0\n\
out ACU, 0x0\n\
jmp 0x8, 0x0\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;
}