starting work on tokenizer for assembly language
This commit is contained in:
21
src/main.c
21
src/main.c
@@ -1,19 +1,28 @@
|
||||
#include "vmbl.h"
|
||||
#include "asm/tokenize.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]));
|
||||
|
||||
VMBL_Instruction program[] = {
|
||||
MAKE_INST_PUSH(123),
|
||||
MAKE_INST_PUSH(0),
|
||||
MAKE_INST_PUSH(124),
|
||||
MAKE_INST_PUSH(2),
|
||||
MAKE_INST_DIV,
|
||||
|
||||
MAKE_INST_HALT
|
||||
};
|
||||
|
||||
int main() {
|
||||
VMBL_State vmblState = {};
|
||||
//VMBL_State vmblState = {};
|
||||
|
||||
VMBL_LoadExecutable(&vmblState, program, sizeof(program));
|
||||
VMBL_StartVM(&vmblState);
|
||||
//VMBL_LoadExecutable(&vmblState, program, sizeof(program));
|
||||
//VMBL_StartVM(&vmblState);
|
||||
|
||||
Tokenizer tokenizer = {
|
||||
"push 1224\npush 2\ndiv\nhalt"
|
||||
};
|
||||
Token token = getCurrentToken(&tokenizer);
|
||||
|
||||
printf("%s\n", tokenTypeAsCStr(token.type));
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user