Added structs to represent labels and directives for assembler

This commit is contained in:
Themis Demetriades 2024-06-05 20:54:22 +01:00
parent 379dedc6ce
commit 120b492a48
3 changed files with 15 additions and 1 deletions

View File

@ -4,6 +4,8 @@
#include "a64instruction_DPRegister.h"
#include "a64instruction_Branch.h"
#include "a64instruction_SingleTransfer.h"
#include "a64instruction_Label.h"
#include "a64instruction_Directive.h"
// Define the types of instructions in subset of the AArch64 Instruction Set implemented.
// Each type is defined by the format of the instruction's operand(s).
@ -13,7 +15,9 @@ typedef enum {
a64inst_SINGLETRANSFER,
a64inst_LOADLITERAL,
a64inst_BRANCH,
a64inst_HALT
a64inst_HALT,
a64inst_LABEL,
a64inst_DIRECTIVE
} a64inst_type;
// Structure the holds the type and operand data of an instruction
@ -24,6 +28,8 @@ typedef struct {
a64inst_DPRegisterData DPRegisterData;
a64inst_BranchData BranchData;
a64inst_SingleTransferData SingleTransferData;
a64inst_LabelData LabelData;
a64inst_DirectiveData DirectiveData;
} data;
} a64inst_instruction;

View File

@ -0,0 +1,5 @@
include "global.h"
typedef struct {
dword value;
} a64inst_DirectiveData;

View File

@ -0,0 +1,3 @@
typedef struct {
char* label;
} a64inst_LabelData;