fix adc/sbc for gb

This commit is contained in:
condret 2015-09-28 00:32:45 +00:00
parent 191c454a61
commit 33d5cf0cc0

View File

@ -418,18 +418,16 @@ static void gb_anal_xoaasc_imm (RReg *reg, RAnalOp *op, const ut8 *data) //xor ,
if (data[0] == 0xce) { //adc
op->src[1] = r_anal_value_new ();
op->src[1]->reg = r_reg_get (reg, "C", R_REG_TYPE_GPR);
r_strbuf_append (&op->esil, "C,+,");
}
r_strbuf_append (&op->esil, "a,+=,$z,Z,=,$c3,H,=,$c7,C,=,0,N,=");
r_strbuf_append (&op->esil, "a,+=,C,DUP,$c7,C,=,$c3,H,=,a,+=,$c7,C,|=,$c3,H,|=,a,a,=,$z,Z,=,0,N,=");
} else r_strbuf_append (&op->esil, "a,+=,$c3,H,=,$c7,C,=,0,N,=,a,a,=,$z,Z,=");
break;
case R_ANAL_OP_TYPE_SUB:
r_strbuf_setf (&op->esil, "0x%02x,", data[1]);
if (data[0] == 0xde) { //sbc
op->src[1] = r_anal_value_new ();
op->src[1]->reg = r_reg_get (reg, "C", R_REG_TYPE_GPR);
r_strbuf_append (&op->esil, "C,-,");
}
r_strbuf_append (&op->esil, "a,-=,$z,Z,=,$b4,H,=,$b8,C,=,1,N,=");
r_strbuf_append (&op->esil, "a,-=,C,DUP,$b8,C,=,$b4,H,=,a,-=,$b8,C,|=,$b4,H,|=,a,a,=,$z,Z,=,1,N,=");
} else r_strbuf_append (&op->esil, "a,-=,$b4,H,=,$b8,C,=,1,N,=,a,a,=,$z,Z,=");
break;
case R_ANAL_OP_TYPE_CMP:
r_strbuf_setf (&op->esil, "%d,a,==,$z,Z,=,$b4,H,=,$b8,C,=,1,N,=", data[1]);