Code cleanup.

This commit is contained in:
2023-06-29 20:53:39 -05:00
parent 2918f2964d
commit 3031fa8b9b
6 changed files with 16 additions and 53 deletions
-8
View File
@@ -4,7 +4,6 @@
#include <string.h>
#include <errno.h>
#include <stdio.h>
//#include "symbols_table.h"
typedef enum {
R1 = 0, R2, R3, R4, R5, R6, R7, R8 = 7
@@ -17,16 +16,9 @@ typedef enum {
JMPI = 0xB8, JMP = 0x02, JZ = 0x03, JG = 0x04, JL = 0x05, NOP = 0x01, CALL = 0x06, RET = 0x07
} Mnemonic;
typedef struct {
Mnemonic Mnemonic;
} Instruction;
Instruction* CreateInstruction(Mnemonic mnemonic);
void FreeInstruction(Instruction* instruction);
int IsOpcode(const char*, Mnemonic*);
int IsRegister(const char*, Registers*);
void GetMnemonicText(Mnemonic mnemonic, char buffer[12]);
void GetRegisterText(Registers reg, char buffer[3]);
unsigned char GetInstructionMask(Mnemonic type);
#endif
+1 -8
View File
@@ -11,13 +11,6 @@
#include "opcodes.h"
#include "symbols_table.h"
//#define HIGHMEMORY 65535 //64KiB - 1 AKA 0xFFFF
typedef struct {
List* Instructions;
SymbolTable* SymbolsTable;
} IRState;
IRState* ParseTokens(List*);
SymbolTable* ParseTokens(List* tokens);
#endif