Add XCH for AVR, patch from @Darkkey

This commit is contained in:
Anton Kochkov 2015-10-13 18:56:58 +03:00 committed by pancake
parent 82e02d15b0
commit 32a4b9e6b7
3 changed files with 6 additions and 2 deletions

View File

@ -93,7 +93,7 @@ static int avr_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len)
}
// 0xf0 - 0xf7 BR
if ((buf[1] >= 0xf0 && buf[1] <= 0xf8)) {
int cond = (buf[0] & 7);
//int cond = (buf[0] & 7);
op->type = R_ANAL_OP_TYPE_CJMP;
op->jump = imm;
op->fail = addr + 2;

View File

@ -30,7 +30,7 @@
int avrdis (char *out, unsigned long long addr, const unsigned char *buf, int len);
/* Total number of assembly instructions, Maximum number of operands */
#define AVR_TOTAL_INSTRUCTIONS 141
#define AVR_TOTAL_INSTRUCTIONS 145
#define AVR_MAX_NUM_OPERANDS 2
/* Enumeration for all types of AVR Operands */

View File

@ -109,6 +109,10 @@ instructionInfo instructionSet[AVR_TOTAL_INSTRUCTIONS] = {
{"lsr", 0x9406, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}},
{"neg", 0x9401, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}},
{"pop", 0x900f, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}},
{"xch", 0x9204, 2, {0x0000, 0x01f0}, {OPERAND_Z, OPERAND_REGISTER}},
{"las", 0x9205, 2, {0x0000, 0x01f0}, {OPERAND_Z, OPERAND_REGISTER}},
{"lac", 0x9206, 2, {0x0000, 0x01f0}, {OPERAND_Z, OPERAND_REGISTER}},
{"lat", 0x9207, 2, {0x0000, 0x01f0}, {OPERAND_Z, OPERAND_REGISTER}},
{"push", 0x920f, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}},
{"rcall", 0xd000, 1, {0x0fff, 0x0000}, {OPERAND_RELATIVE_ADDRESS, OPERAND_NONE}},
{"rjmp", 0xc000, 1, {0x0fff, 0x0000}, {OPERAND_RELATIVE_ADDRESS, OPERAND_NONE}},