//Figure out what segment to use. This won't be entirely accurate since
//the presence of a displacement is supposed to make the instruction
//default to the data segment.
- if ((base != INTREG_RBP && base != INTREG_RSP) ||
- 0/*Has an immediate offset*/) {
+ if ((base != INTREG_RBP && base != INTREG_RSP) || machInst.dispSize) {
seg = SEGMENT_REG_DS;
//Handle any segment override that might have been in the instruction
int segFromInst = machInst.legacy.seg;
uint8_t addrSize;
//The effective stack size.
uint8_t stackSize;
+ //The size of the displacement
+ uint8_t dispSize;
//Mode information
OperatingMode mode;
"op = {\n\t\tnum = %d,\n\t\top = %#x,\n\t\t"
"prefixA = %#x,\n\t\tprefixB = %#x\n\t},\n\t"
"modRM = %#x,\n\tsib = %#x,\n\t"
- "immediate = %#x,\n\tdisplacement = %#x\n}\n",
+ "immediate = %#x,\n\tdisplacement = %#x\n\t"
+ "dispSize = %d}\n",
(uint8_t)emi.legacy, (uint8_t)emi.rex,
emi.opcode.num, (uint8_t)emi.opcode.op,
emi.opcode.prefixA, emi.opcode.prefixB,
(uint8_t)emi.modRM, (uint8_t)emi.sib,
- emi.immediate, emi.displacement);
+ emi.immediate, emi.displacement, emi.dispSize);
return os;
}
return false;
if(emi1.stackSize != emi2.stackSize)
return false;
+ if(emi1.dispSize != emi2.dispSize)
+ return false;
return true;
}
((uint64_t)emi.opcode.op)) ^
emi.immediate ^ emi.displacement ^
emi.mode ^
- emi.opSize ^ emi.addrSize ^ emi.stackSize;
+ emi.opSize ^ emi.addrSize ^
+ emi.stackSize ^ emi.dispSize;
};
};
}