Some refactoring to update everything to use the new structures and some new considerations for how Symbols and Instructions shoudl be represented.
This commit is contained in:
+8
-6
@@ -4,8 +4,6 @@
|
||||
#include <string.h>
|
||||
#include "symbols_table.h"
|
||||
|
||||
#define OPCODECOUNT 13
|
||||
|
||||
typedef enum {
|
||||
R1, R2, R3, R4, R5, R6, R7, R8
|
||||
} Registers;
|
||||
@@ -16,9 +14,10 @@ typedef enum {
|
||||
} Mnemonic;
|
||||
|
||||
typedef enum {
|
||||
None,
|
||||
Constant,
|
||||
Address
|
||||
NoParameter,
|
||||
ConstantParameter,
|
||||
AddressParameter,
|
||||
RegisterParameter
|
||||
} OpcodeParameter;
|
||||
|
||||
typedef struct {
|
||||
@@ -37,10 +36,13 @@ typedef struct {
|
||||
} ParameterTwo;
|
||||
} Instruction;
|
||||
|
||||
extern Instruction instructions[OPCODECOUNT];
|
||||
//extern Instruction instructions[OPCODECOUNT];
|
||||
|
||||
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]);
|
||||
//const Instruction* GetOpcodeDetails(Mnemonic);
|
||||
unsigned char GetInstructionMask(Mnemonic type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user