diff --git a/src/a64instruction_SingleTransfer.h b/src/a64instruction_SingleTransfer.h new file mode 100644 index 0000000..150437b --- /dev/null +++ b/src/a64instruction_SingleTransfer.h @@ -0,0 +1,46 @@ +#include +#include "a64instruction_global.h" +#include "global.h" + +typedef enum { + a64inst_SINGLE_TRANSFER_SINGLE_DATA_TRANSFER, + a64inst_SINGLE_TRANSFER_LOAD_LITERAL +} a64inst_SingleTransferType; + +typedef enum { + a64inst_STORE, + a64inst_LOAD +} a64inst_TransferType; + +typedef enum { + a64inst_REGISTER_OFFSET, + a64inst_PRE_INDEXED, + a64inst_POST_INDEXED, + a64inst_UNSIGNED_OFFSET +} a64inst_AddressingMode; + +typedef struct { + a64inst_TransferType transferType; + a64inst_regSpecifier base; + a64inst_AddressingMode addressingMode; + // I think the following is better than another level of nesting. + union { + a64inst_regSpecifier offsetReg; + word preIndexedOffset; + word postIndexedOffset; + word unsignedOffset; + } a64inst_addressingModeData; +} a64inst_SingleDataTransferData; + +typedef struct { + word offset; +} a64inst_LoadLiteralData; + +typedef struct { + a64inst_regSpecifier target; + a64inst_regType regType; + union { + a64inst_SingleDataTransferData singleDataTransferData; + a64inst_LoadLiteralData loadLiteralData; + } processOpData; +} a64inst_SingleTransferData; \ No newline at end of file