Updated the Instruction's structure and updated the Parser accordingly.
This commit is contained in:
+14
-16
@@ -20,31 +20,29 @@ typedef enum {
|
||||
RegisterParameter
|
||||
} OpcodeParameter;
|
||||
|
||||
typedef struct {
|
||||
OpcodeParameter ParameterType;
|
||||
OpcodeParameter InterpretedAs;
|
||||
|
||||
union {
|
||||
int Number; //ConstanrParam
|
||||
Registers Register; //Register param
|
||||
Symbol* Symbol; //Address param
|
||||
} Value;
|
||||
} Parameter;
|
||||
|
||||
typedef struct {
|
||||
Mnemonic Mnemonic;
|
||||
OpcodeParameter ParameterOneType;
|
||||
OpcodeParameter ParameterTwoType;
|
||||
int LineNumber;
|
||||
|
||||
union {
|
||||
int Constant;
|
||||
Symbol* Symbol;
|
||||
} ParameterOne;
|
||||
|
||||
union {
|
||||
int Constant;
|
||||
Symbol* Symbol;
|
||||
} ParameterTwo;
|
||||
Parameter* ParameterOne;
|
||||
Parameter* ParameterTwo;
|
||||
} Instruction;
|
||||
|
||||
//extern Instruction instructions[OPCODECOUNT];
|
||||
|
||||
Instruction* CreateInstruction(Mnemonic mnemonic);
|
||||
Parameter* CreateParameter(OpcodeParameter parameterType);
|
||||
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);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user