Skip to content

Commit

Permalink
merge D2 pull 86
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jun 7, 2011
1 parent 92a9682 commit 181fbbc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/iasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2513,14 +2513,17 @@ STATIC void asm_make_modrm_byte(
else
{
sib.sib.base = popnd->pregDisp1->val;
if (popnd->pregDisp1->val & NUM_MASKR)
pc->Irex |= REX_B;
//
// This is to handle the special case
// of using the EBP register and no
// of using the EBP (or R13) register and no
// displacement. You must put in an
// 8 byte displacement in order to
// get the correct opcodes.
//
if (popnd->pregDisp1->val == _EBP &&
if ((popnd->pregDisp1->val == _EBP ||
popnd->pregDisp1->val == _R13) &&
(!popnd->disp && !s))
{
#ifdef DEBUG
Expand All @@ -2534,6 +2537,9 @@ STATIC void asm_make_modrm_byte(
}

sib.sib.index = popnd->pregDisp2->val;
if (popnd->pregDisp2->val & NUM_MASKR)
pc->Irex |= REX_X;

}
switch (popnd->uchMultiplier)
{
Expand Down

0 comments on commit 181fbbc

Please sign in to comment.