Modified how registers and opcodes are represented. This commit is a bit buggy but doesn't crash and burn at least. I just wanted the new structs push out before making a bigger mess of things as I try to organize this all.

This commit is contained in:
2022-02-17 21:35:57 -06:00
parent 3d4ab57f05
commit 19021ff782
6 changed files with 106 additions and 59 deletions
+20 -17
View File
@@ -9,23 +9,26 @@
#include "tokenizer.h"
typedef enum {
TK_Add,
TK_Sub,
TK_Mul,
TK_Div,
TK_Power,
TK_LParam,
TK_RParam,
TK_LBracket,
TK_RBracket,
TK_String,
TK_Number,
TK_Hex,
TK_Opcode,
TK_Register,
TK_Directive,
TK_Symbol,
TK_Comma
PLUS,
MINUS,
STAR,
SLASH,
POWER,
LPARAM,
RPARAM,
LBRACKET,
RBracket,
COMMA,
IDENTIFIER,
NUMBER,
HEX,
//Keywords
DB, ORG,
//Opcodes
COPY, ADD, SUB, JZ, INT, YLD, RET,
CMP, IN, OUT,
//Registers
R1, R2, R3, R4, R5, R6, R7, R8
} TokenType;
typedef struct {