- goto immediate;
- } else {
- instruction->type = ARM_ORR;
- mnemonic = "ORR";
- }
- break;
- case 3:
- if (rn == 0xf) {
- instruction->type = ARM_MVN;
- mnemonic = "MVN";
- rn = rd;
- goto two;
- } else {
- // instruction->type = ARM_ORN;
- mnemonic = "ORN";
- }
- break;
- case 4:
- if (rd == 0xf) {
- if (!(opcode & (1 << 20)))
- return ERROR_INVALID_ARGUMENTS;
- instruction->type = ARM_TEQ;
- mnemonic = "TEQ";
- suffix = "";
- goto two;
- }
- instruction->type = ARM_EOR;
- mnemonic = "EOR";
- break;
- case 8:
- if (rd == 0xf) {
- if (!(opcode & (1 << 20)))
- return ERROR_INVALID_ARGUMENTS;
- instruction->type = ARM_CMN;
- mnemonic = "CMN";
- suffix = "";
- goto two;
- }
- instruction->type = ARM_ADD;
- mnemonic = "ADD";
- break;
- case 0xa:
- instruction->type = ARM_ADC;
- mnemonic = "ADC";
- break;
- case 0xb:
- instruction->type = ARM_SBC;
- mnemonic = "SBC";
- break;
- case 0xd:
- if (rd == 0xf) {
- if (!(opcode & (1 << 21)))
- return ERROR_INVALID_ARGUMENTS;
- instruction->type = ARM_CMP;
- mnemonic = "CMP";
- suffix = "";
- goto two;
- }
- instruction->type = ARM_SUB;
- mnemonic = "SUB";
- break;
- case 0xe:
- instruction->type = ARM_RSB;
- mnemonic = "RSB";
- break;
- default:
- return ERROR_INVALID_ARGUMENTS;
+ instruction->type = ARM_AND;
+ mnemonic = "AND";
+ break;
+ case 1:
+ instruction->type = ARM_BIC;
+ mnemonic = "BIC";
+ break;
+ case 2:
+ if (rn == 0xf) {
+ instruction->type = ARM_MOV;
+ switch (type) {
+ case 0:
+ if (immed == 0) {
+ sprintf(cp, "MOV%s.W\tr%d, r%d",
+ suffix, rd,
+ (int) (opcode & 0xf));
+ return ERROR_OK;
+ }
+ mnemonic = "LSL";
+ break;
+ case 1:
+ mnemonic = "LSR";
+ break;
+ case 2:
+ mnemonic = "ASR";
+ break;
+ default:
+ if (immed == 0) {
+ sprintf(cp, "RRX%s\tr%d, r%d",
+ suffix, rd,
+ (int) (opcode & 0xf));
+ return ERROR_OK;
+ }
+ mnemonic = "ROR";
+ break;
+ }
+ goto immediate;
+ } else {
+ instruction->type = ARM_ORR;
+ mnemonic = "ORR";
+ }
+ break;
+ case 3:
+ if (rn == 0xf) {
+ instruction->type = ARM_MVN;
+ mnemonic = "MVN";
+ rn = rd;
+ goto two;
+ } else {
+ /* instruction->type = ARM_ORN; */
+ mnemonic = "ORN";
+ }
+ break;
+ case 4:
+ if (rd == 0xf) {
+ if (!(opcode & (1 << 20)))
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ instruction->type = ARM_TEQ;
+ mnemonic = "TEQ";
+ suffix = "";
+ goto two;
+ }
+ instruction->type = ARM_EOR;
+ mnemonic = "EOR";
+ break;
+ case 8:
+ if (rd == 0xf) {
+ if (!(opcode & (1 << 20)))
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ instruction->type = ARM_CMN;
+ mnemonic = "CMN";
+ suffix = "";
+ goto two;
+ }
+ instruction->type = ARM_ADD;
+ mnemonic = "ADD";
+ break;
+ case 0xa:
+ instruction->type = ARM_ADC;
+ mnemonic = "ADC";
+ break;
+ case 0xb:
+ instruction->type = ARM_SBC;
+ mnemonic = "SBC";
+ break;
+ case 0xd:
+ if (rd == 0xf) {
+ if (!(opcode & (1 << 21)))
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ instruction->type = ARM_CMP;
+ mnemonic = "CMP";
+ suffix = "";
+ goto two;
+ }
+ instruction->type = ARM_SUB;
+ mnemonic = "SUB";
+ break;
+ case 0xe:
+ instruction->type = ARM_RSB;
+ mnemonic = "RSB";
+ break;
+ default:
+ return ERROR_COMMAND_SYNTAX_ERROR;