Fix opcode 0x6A (PUSH imm8)
This commit is contained in:
parent
9128fb234e
commit
74bb240255
128 changed files with 138 additions and 129 deletions
|
|
@ -3559,7 +3559,16 @@ X86CPU.prototype.popWord = function()
|
|||
*/
|
||||
X86CPU.prototype.pushWord = function(w)
|
||||
{
|
||||
this.assert((w & this.dataMask) == w);
|
||||
/*
|
||||
* This assertion is no longer valid, now that we've fixed opPUSH8() to use getIPDisp() instead of getIPByte(),
|
||||
* thus sign-extending the byte as appropriate. And since sign-extension necessarily affects the entire 32-bit
|
||||
* value, this assertion could fail when dataMask is 16 bits.
|
||||
*
|
||||
* this.assert((w & this.dataMask) == w);
|
||||
*
|
||||
* setWord() calls setShort() or setLong() as appropriate, and setShort() truncates incoming values, so the fact
|
||||
* that any incoming signed values will not be truncated to 16 bits should not be a concern.
|
||||
*/
|
||||
this.regLSP = (this.regLSP - (I386? this.dataSize : 2))|0;
|
||||
/*
|
||||
* Properly comparing regLSP to regLSPLimitLow would normally require coercing both to unsigned
|
||||
|
|
|
|||
|
|
@ -889,8 +889,8 @@ X86.fnIDIVw = function IDIVw(dst, src)
|
|||
*/
|
||||
X86.fnIMUL8 = function IMUL8(dst, src)
|
||||
{
|
||||
dst = this.getIPByte();
|
||||
var result = (((src << 16) >> 16) * ((dst << 24) >> 24))|0;
|
||||
dst = this.getIPDisp();
|
||||
var result = (((src << 16) >> 16) * dst)|0;
|
||||
|
||||
if (result > 32767 || result < -32768) {
|
||||
this.setCF(); this.setOF();
|
||||
|
|
|
|||
|
|
@ -1432,7 +1432,7 @@ X86.opIMULn = function IMULn()
|
|||
X86.opPUSH8 = function PUSH8()
|
||||
{
|
||||
if (BACKTRACK) this.backTrack.btiMemHi = 0;
|
||||
this.pushWord(this.getIPByte());
|
||||
this.pushWord(this.getIPDisp());
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue