Added AVR8 instruction mnemonic enum
This commit is contained in:
@@ -10,9 +10,21 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
{
|
{
|
||||||
struct Instruction
|
struct Instruction
|
||||||
{
|
{
|
||||||
|
enum class Mnemonic: std::uint8_t
|
||||||
|
{
|
||||||
|
ADC, ADD, ADIW, AND, ANDI, ASR, BCLR, BLD, BRBC, BRBS, BRCC, BRCS, BREAK, BREQ, BRGE, BRHC, BRHS, BRID,
|
||||||
|
BRIE, BRLO, BRLT, BRMI, BRNE, BRPL, BRSH, BRTC, BRTS, BRVC, BRVS, BSET, BST, CALL, CBI, CBR, CLC, CLH,
|
||||||
|
CLI, CLN, CLR, CLS, CLT, CLV, CLZ, COM, CP, CPC, CPI, CPSE, DEC, DES, EICALL, EIJMP, ELPM, EOR, FMUL,
|
||||||
|
FMULS, FMULSU, ICALL, IJMP, IN, INC, JMP, LAC, LAS, LAT, LD, LDD, LDI, LDS, LPM, LSL, LSR, MOV, MOVW,
|
||||||
|
MUL, MULS, MULSU, NEG, NOP, OR, ORI, OUT, POP, PUSH, RCALL, RET, RETI, RJMP, ROL, ROR, SBC, SBCI, SBI,
|
||||||
|
SBIC, SBIS, SBIW, SBR, SBRC, SBRS, SEC, SEH, SEI, SEN, SER, SES, SET, SEV, SEZ, SLEEP, SPM, ST, STD, STS,
|
||||||
|
SUB, SUBI, SWAP, TST, WDR, XCH,
|
||||||
|
};
|
||||||
|
|
||||||
const std::string& name;
|
const std::string& name;
|
||||||
std::uint32_t opcode;
|
std::uint32_t opcode;
|
||||||
std::uint8_t byteSize;
|
std::uint8_t byteSize;
|
||||||
|
Mnemonic mnemonic;
|
||||||
bool canChangeProgramFlow;
|
bool canChangeProgramFlow;
|
||||||
|
|
||||||
std::optional<std::uint32_t> data;
|
std::optional<std::uint32_t> data;
|
||||||
@@ -36,6 +48,7 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
const std::string& name,
|
const std::string& name,
|
||||||
std::uint32_t opcode,
|
std::uint32_t opcode,
|
||||||
std::uint8_t byteSize,
|
std::uint8_t byteSize,
|
||||||
|
Mnemonic mnemonic,
|
||||||
bool canChangeProgramFlow,
|
bool canChangeProgramFlow,
|
||||||
std::optional<std::uint32_t> data = std::nullopt,
|
std::optional<std::uint32_t> data = std::nullopt,
|
||||||
std::optional<std::uint8_t> sourceRegister = std::nullopt,
|
std::optional<std::uint8_t> sourceRegister = std::nullopt,
|
||||||
@@ -52,6 +65,7 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
: name(name)
|
: name(name)
|
||||||
, opcode(opcode)
|
, opcode(opcode)
|
||||||
, byteSize(byteSize)
|
, byteSize(byteSize)
|
||||||
|
, mnemonic(mnemonic)
|
||||||
, canChangeProgramFlow(canChangeProgramFlow)
|
, canChangeProgramFlow(canChangeProgramFlow)
|
||||||
, data(data)
|
, data(data)
|
||||||
, sourceRegister(sourceRegister)
|
, sourceRegister(sourceRegister)
|
||||||
|
|||||||
@@ -161,6 +161,9 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
* @tparam wordSize
|
* @tparam wordSize
|
||||||
* The word size of the instruction. AVR8 instructions are either 1 or 2 words.
|
* The word size of the instruction. AVR8 instructions are either 1 or 2 words.
|
||||||
*
|
*
|
||||||
|
* @tparam mnemonic
|
||||||
|
* The instruction's mnemonic.
|
||||||
|
*
|
||||||
* @tparam canChangeProgramFlow
|
* @tparam canChangeProgramFlow
|
||||||
* Whether the instruction **can** change program flow.
|
* Whether the instruction **can** change program flow.
|
||||||
*
|
*
|
||||||
@@ -228,6 +231,7 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
FixedString instructionName,
|
FixedString instructionName,
|
||||||
std::uint32_t expectedOpcode,
|
std::uint32_t expectedOpcode,
|
||||||
int wordSize,
|
int wordSize,
|
||||||
|
Instruction::Mnemonic mnemonic,
|
||||||
bool canChangeProgramFlow,
|
bool canChangeProgramFlow,
|
||||||
OptionalInstructionParameter sourceRegisterParameter = std::nullopt,
|
OptionalInstructionParameter sourceRegisterParameter = std::nullopt,
|
||||||
OptionalInstructionParameter destinationRegisterParameter = std::nullopt,
|
OptionalInstructionParameter destinationRegisterParameter = std::nullopt,
|
||||||
@@ -454,6 +458,7 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
instructionName,
|
instructionName,
|
||||||
expectedOpcode,
|
expectedOpcode,
|
||||||
wordSize,
|
wordSize,
|
||||||
|
mnemonic,
|
||||||
canChangeProgramFlow,
|
canChangeProgramFlow,
|
||||||
sourceRegisterParameter,
|
sourceRegisterParameter,
|
||||||
destinationRegisterParameter,
|
destinationRegisterParameter,
|
||||||
@@ -518,6 +523,7 @@ namespace Targets::Microchip::Avr::Avr8Bit::OpcodeDecoder
|
|||||||
SelfType::name,
|
SelfType::name,
|
||||||
opcode,
|
opcode,
|
||||||
byteSize,
|
byteSize,
|
||||||
|
mnemonic,
|
||||||
canChangeProgramFlow
|
canChangeProgramFlow
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user