Skip to content

Commit

Permalink
amd64: Support lods rep prefixes (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson authored Sep 12, 2024
1 parent e7438bb commit c0bace1
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions priv/guest_amd64_toIR.c
Original file line number Diff line number Diff line change
Expand Up @@ -21039,11 +21039,27 @@ Long dis_ESC_NONE (
delta = dis_op_imm_A( sz, False, Iop_And8, False, delta, "test" );
return delta;

case 0xAC: /* LODS, no REP prefix */
case 0xAC:
case 0xAD:
dis_string_op( dis_LODS, ( opc == 0xAC ? 1 : sz ), "lods", pfx );
return delta;

/* F2 AC/AD: rep lodsb/rep lods{w,l,q} */
/* F3 AC/AD: repne lodsb/repne lods{w,l,q} */
if (haveF2(pfx) || haveF3(pfx)) {
if (opc == 0xAC)
sz = 1;
dis_REP_op ( dres, AMD64CondAlways, dis_LODS, sz,
guest_RIP_curr_instr,
guest_RIP_bbstart+delta, "rep lods", pfx );
vassert(dres->whatNext == Dis_StopHere);
return delta;
}
/* AC/AD: lodsb/lods{w,l,q} */
if (!haveF2(pfx) && !haveF3(pfx)) {
if (opc == 0xAC)
sz = 1;
dis_string_op( dis_LODS, sz, "lods", pfx );
return delta;
}
goto decode_failure;
case 0xAE:
case 0xAF:
/* F2 AE/AF: repne scasb/repne scas{w,l,q} */
Expand Down

0 comments on commit c0bace1

Please sign in to comment.