Remove EAFUNCS
This commit is contained in:
parent
2e729f9179
commit
9ae860d28f
16 changed files with 2655 additions and 2727 deletions
|
|
@ -17,7 +17,8 @@ Here's how you embed an "uncompiled" machine in a PCjs Markdown file:
|
||||||
|
|
||||||
[Embedded IBM PC](/devices/pc/machine/5170/ega/1152kb/rev3/ "PCjs:at-ega-1152k-rev3::uncompiled:debugger")
|
[Embedded IBM PC](/devices/pc/machine/5170/ega/1152kb/rev3/ "PCjs:at-ega-1152k-rev3::uncompiled:debugger")
|
||||||
|
|
||||||
And here's that example in action, in the Markdown ([README.md]()) file you are reading right now:
|
And here's that example in action, in the Markdown ([README.md]()) file you are reading right now -- assuming
|
||||||
|
you are reading it on a [PCjs](http://www.pcjs.org/blog/2015/01/17/) web server:
|
||||||
|
|
||||||
[Embedded IBM PC](/devices/pc/machine/5170/ega/1152kb/rev3/ "PCjs:at-ega-1152k-rev3::uncompiled:debugger")
|
[Embedded IBM PC](/devices/pc/machine/5170/ega/1152kb/rev3/ "PCjs:at-ega-1152k-rev3::uncompiled:debugger")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,15 @@ function genSIB(sib) {
|
||||||
print(" * @param {number} mod");
|
print(" * @param {number} mod");
|
||||||
print(" */");
|
print(" */");
|
||||||
print(" function " + sFunc + "(mod) {");
|
print(" function " + sFunc + "(mod) {");
|
||||||
var sBase = (base == 5? "(mod? this.reg" + aBase[base] + " : this.getIPWord())" : "this.reg" + aBase[base]);
|
var sMod = "this.reg" + aBase[base];
|
||||||
|
if (aBase[base] == "ESP" || aBase[base] == "EBP") {
|
||||||
|
if (base != 5) {
|
||||||
|
print(" this.segData = this.segStack;");
|
||||||
|
} else {
|
||||||
|
sMod = "((this.segData = this.segStack), " + sMod + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var sBase = (base == 5? "(mod? " + sMod + " : this.getIPWord())" : "this.reg" + aBase[base]);
|
||||||
if (index != 4) sBase += " + " + (scale? ("(this.reg" + aIndex[index] + " << " + scale + ")") : ("this.reg" + aIndex[index]));
|
if (index != 4) sBase += " + " + (scale? ("(this.reg" + aIndex[index] + " << " + scale + ")") : ("this.reg" + aIndex[index]));
|
||||||
print(" return " + sBase + ";");
|
print(" return " + sBase + ";");
|
||||||
print(" }" + (sib < 255? "," : ""));
|
print(" }" + (sib < 255? "," : ""));
|
||||||
|
|
@ -419,7 +427,7 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
var sModRegSet = null;
|
var sModRegSet = null;
|
||||||
var sModRegSetBegin = "", sModRegSetEnd = "";
|
var sModRegSetBegin = "", sModRegSetEnd = "";
|
||||||
var sModRegBTLo = null, sModRegBTHi = null;
|
var sModRegBTLo = null, sModRegBTHi = null;
|
||||||
var sModRegSeg = "this.segData";
|
var sModRegSeg = "Data";
|
||||||
|
|
||||||
if (!a) {
|
if (!a) {
|
||||||
switch (mod) {
|
switch (mod) {
|
||||||
|
|
@ -438,13 +446,13 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 2:
|
case 2:
|
||||||
sModAddr = "this.regEBP + this.regESI";
|
sModAddr = "this.regEBP + this.regESI";
|
||||||
sModFunc = "BPSI";
|
sModFunc = "BPSI";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseIndexExtra"; // 8086: 8
|
nCycles = "this.CYCLES.nEACyclesBaseIndexExtra"; // 8086: 8
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sModAddr = "this.regEBP + this.regEDI";
|
sModAddr = "this.regEBP + this.regEDI";
|
||||||
sModFunc = "BPDI";
|
sModFunc = "BPDI";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseIndex"; // 8086: 7
|
nCycles = "this.CYCLES.nEACyclesBaseIndex"; // 8086: 7
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -487,13 +495,13 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 2:
|
case 2:
|
||||||
sModAddr = "this.regEBP + this.regESI + this.getIPDisp()";
|
sModAddr = "this.regEBP + this.regESI + this.getIPDisp()";
|
||||||
sModFunc = "BPSID8";
|
sModFunc = "BPSID8";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseIndexDispExtra"; // 8086: 12
|
nCycles = "this.CYCLES.nEACyclesBaseIndexDispExtra"; // 8086: 12
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sModAddr = "this.regEBP + this.regEDI + this.getIPDisp()";
|
sModAddr = "this.regEBP + this.regEDI + this.getIPDisp()";
|
||||||
sModFunc = "BPDID8";
|
sModFunc = "BPDID8";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseIndexDisp"; // 8086: 11
|
nCycles = "this.CYCLES.nEACyclesBaseIndexDisp"; // 8086: 11
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -509,7 +517,7 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 6:
|
case 6:
|
||||||
sModAddr = "this.regEBP + this.getIPDisp()";
|
sModAddr = "this.regEBP + this.getIPDisp()";
|
||||||
sModFunc = "BPD8";
|
sModFunc = "BPD8";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseDisp"; // 8086: 9
|
nCycles = "this.CYCLES.nEACyclesBaseDisp"; // 8086: 9
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
@ -537,13 +545,13 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 2:
|
case 2:
|
||||||
sModAddr = "this.regEBP + this.regESI + this.getIPWord()";
|
sModAddr = "this.regEBP + this.regESI + this.getIPWord()";
|
||||||
sModFunc = "BPSID16";
|
sModFunc = "BPSID16";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseIndexDispExtra"; // 8086: 12
|
nCycles = "this.CYCLES.nEACyclesBaseIndexDispExtra"; // 8086: 12
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sModAddr = "this.regEBP + this.regEDI + this.getIPWord()";
|
sModAddr = "this.regEBP + this.regEDI + this.getIPWord()";
|
||||||
sModFunc = "BPDID16";
|
sModFunc = "BPDID16";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseIndexDisp"; // 8086: 11
|
nCycles = "this.CYCLES.nEACyclesBaseIndexDisp"; // 8086: 11
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -559,7 +567,7 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 6:
|
case 6:
|
||||||
sModAddr = "this.regEBP + this.getIPWord()";
|
sModAddr = "this.regEBP + this.getIPWord()";
|
||||||
sModFunc = "BPD16";
|
sModFunc = "BPD16";
|
||||||
sModRegSeg = "this.segStack";
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseDisp"; // 8086: 9
|
nCycles = "this.CYCLES.nEACyclesBaseDisp"; // 8086: 9
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
@ -763,6 +771,7 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 5:
|
case 5:
|
||||||
sModAddr = "this.regEBP + this.getIPDisp()";
|
sModAddr = "this.regEBP + this.getIPDisp()";
|
||||||
sModFunc = "EBPD8";
|
sModFunc = "EBPD8";
|
||||||
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseDisp";
|
nCycles = "this.CYCLES.nEACyclesBaseDisp";
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
|
|
@ -810,6 +819,7 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
case 5:
|
case 5:
|
||||||
sModAddr = "this.regEBP + this.getIPWord()";
|
sModAddr = "this.regEBP + this.getIPWord()";
|
||||||
sModFunc = "EBPD32";
|
sModFunc = "EBPD32";
|
||||||
|
sModRegSeg = "Stack";
|
||||||
nCycles = "this.CYCLES.nEACyclesBaseDisp";
|
nCycles = "this.CYCLES.nEACyclesBaseDisp";
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
|
|
@ -969,17 +979,11 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
print(" function " + sOpMod + "(afnGrp, fnSrc) {");
|
print(" function " + sOpMod + "(afnGrp, fnSrc) {");
|
||||||
|
|
||||||
if (sModAddr) {
|
if (sModAddr) {
|
||||||
if (!a && sModAddr.indexOf("regE") >= 0) {
|
|
||||||
if (sModAddr.indexOf(' ') > 0) {
|
|
||||||
sModAddr = "(" + sModAddr + ")";
|
|
||||||
}
|
|
||||||
sModAddr += " & 0xffff";
|
|
||||||
}
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
if (reg == 7 && sRO) {
|
if (reg == 7 && sRO) {
|
||||||
if (sModFunc) {
|
if (sModFunc) {
|
||||||
if (fInline) {
|
if (fInline) {
|
||||||
print(" afnGrp[" + reg + "].call(this, this.getEA" + aSize[w] + "(" + sModRegSeg + ", " + sModAddr + "), fnSrc.call(this));");
|
print(" afnGrp[" + reg + "].call(this, this.getEA" + aSize[w] + sModRegSeg + "(" + sModAddr + "), fnSrc.call(this));");
|
||||||
} else {
|
} else {
|
||||||
sModFunc = "read" + sModFunc + aSize[w];
|
sModFunc = "read" + sModFunc + aSize[w];
|
||||||
print(" var addr = X86Mods." + sModFunc + ".call(this);");
|
print(" var addr = X86Mods." + sModFunc + ".call(this);");
|
||||||
|
|
@ -994,7 +998,7 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
else {
|
else {
|
||||||
if (sModFunc) {
|
if (sModFunc) {
|
||||||
if (fInline) {
|
if (fInline) {
|
||||||
print(" var " + sTemp + " = afnGrp[" + reg + "].call(this, this.modEA" + aSize[w] + "(" + sModRegSeg + ", " + sModAddr + "), fnSrc.call(this));");
|
print(" var " + sTemp + " = afnGrp[" + reg + "].call(this, this.modEA" + aSize[w] + sModRegSeg + "(" + sModAddr + "), fnSrc.call(this));");
|
||||||
print(" this.setEA" + aSize[w] + "(" + sTemp + ");");
|
print(" this.setEA" + aSize[w] + "(" + sTemp + ");");
|
||||||
} else {
|
} else {
|
||||||
sModFunc = "write" + sModFunc + aSize[w];
|
sModFunc = "write" + sModFunc + aSize[w];
|
||||||
|
|
@ -1065,16 +1069,10 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
print(" function " + sOpMod + "(fn) {");
|
print(" function " + sOpMod + "(fn) {");
|
||||||
|
|
||||||
if (sModAddr && sRegGet) {
|
if (sModAddr && sRegGet) {
|
||||||
if (!a && sModAddr.indexOf("regE") >= 0) {
|
|
||||||
if (sModAddr.indexOf(' ') > 0) {
|
|
||||||
sModAddr = "(" + sModAddr + ")";
|
|
||||||
}
|
|
||||||
sModAddr += " & 0xffff";
|
|
||||||
}
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
if (sModFunc) {
|
if (sModFunc) {
|
||||||
if (fInline) {
|
if (fInline) {
|
||||||
print(" var " + sTemp + " = fn.call(this, this.modEA" + aSize[w] + "(" + sModRegSeg + ", " + sModAddr + "), " + sRegGet + ");");
|
print(" var " + sTemp + " = fn.call(this, this.modEA" + aSize[w] + sModRegSeg + "(" + sModAddr + "), " + sRegGet + ");");
|
||||||
if (sRegBTLo) {
|
if (sRegBTLo) {
|
||||||
if (!sRegBTHi) {
|
if (!sRegBTHi) {
|
||||||
print(" if (BACKTRACK) this.backTrack.btiEALo = " + sRegBTLo + ";");
|
print(" if (BACKTRACK) this.backTrack.btiEALo = " + sRegBTLo + ";");
|
||||||
|
|
@ -1119,9 +1117,9 @@ function genMode(a, d, w, mrm, sGroup, sRO) {
|
||||||
if (sModFunc) {
|
if (sModFunc) {
|
||||||
if (fInline) {
|
if (fInline) {
|
||||||
if (!sTemp) {
|
if (!sTemp) {
|
||||||
print(" " + sRegSet + sRegSetBegin + "fn.call(this, " + sRegGet + ", this.getEA" + aSize[w] + "(" + sModRegSeg + ", " + sModAddr + "))" + sRegSetEnd + ";");
|
print(" " + sRegSet + sRegSetBegin + "fn.call(this, " + sRegGet + ", this.getEA" + aSize[w] + sModRegSeg + "(" + sModAddr + "))" + sRegSetEnd + ";");
|
||||||
} else {
|
} else {
|
||||||
print(" var " + sTemp + " = fn.call(this, " + sRegGet + ", this.getEA" + aSize[w] + "(" + sModRegSeg + ", " + sModAddr + "));");
|
print(" var " + sTemp + " = fn.call(this, " + sRegGet + ", this.getEA" + aSize[w] + sModRegSeg + "(" + sModAddr + "));");
|
||||||
print(" " + sRegSet + sRegSetBegin + sTemp + sRegSetEnd + ";");
|
print(" " + sRegSet + sRegSetBegin + sTemp + sRegSetEnd + ";");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -262,9 +262,7 @@ Bus.prototype.initMemory = function()
|
||||||
Bus.prototype.reset = function()
|
Bus.prototype.reset = function()
|
||||||
{
|
{
|
||||||
this.setA20(true);
|
this.setA20(true);
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) this.ibtLastDelete = 0;
|
||||||
this.ibtLastDelete = 0;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -349,6 +347,30 @@ Bus.prototype.cleanMemory = function(addr, size)
|
||||||
return fClean;
|
return fClean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* scanMemory(addr, size, stats)
|
||||||
|
*
|
||||||
|
* @this {Bus}
|
||||||
|
* @param {number} [addr]
|
||||||
|
* @param {number} [size]
|
||||||
|
* @param {Object} [stats]
|
||||||
|
* @return {number} bytes allocated
|
||||||
|
*/
|
||||||
|
Bus.prototype.scanMemory = function(addr, size, stats)
|
||||||
|
{
|
||||||
|
var cbTotal = 0;
|
||||||
|
if (addr === undefined) addr = 0;
|
||||||
|
if (size === undefined) size = (this.addrLimit + 1) - addr;
|
||||||
|
var iBlock = addr >>> this.blockShift;
|
||||||
|
var iBlockMax = ((addr + size - 1) >>> this.blockShift);
|
||||||
|
while (iBlock <= iBlockMax) {
|
||||||
|
var block = this.aMemBlocks[iBlock];
|
||||||
|
cbTotal += block.size;
|
||||||
|
iBlock++;
|
||||||
|
}
|
||||||
|
return cbTotal;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getA20()
|
* getA20()
|
||||||
*
|
*
|
||||||
|
|
@ -820,6 +842,37 @@ Bus.prototype.updateBackTrackCode = function(addr, bti)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getBackTrackObject(bti)
|
||||||
|
*
|
||||||
|
* @this {Bus}
|
||||||
|
* @param {number} bti
|
||||||
|
* @return {Object|null}
|
||||||
|
*/
|
||||||
|
Bus.prototype.getBackTrackObject = function(bti)
|
||||||
|
{
|
||||||
|
if (BACKTRACK) {
|
||||||
|
var slot = bti >>> Bus.BACKTRACK.SLOT_SHIFT;
|
||||||
|
if (slot) {
|
||||||
|
var bto = this.abtObjects[slot-1];
|
||||||
|
if (bto) return bto.obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getBackTrackObjectFromAddr(addr)
|
||||||
|
*
|
||||||
|
* @this {Bus}
|
||||||
|
* @param {number} addr
|
||||||
|
* @return {Object|null}
|
||||||
|
*/
|
||||||
|
Bus.prototype.getBackTrackObjectFromAddr = function(addr)
|
||||||
|
{
|
||||||
|
return BACKTRACK? this.getBackTrackObject(this.readBackTrack(addr)) : null;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getBackTrackInfo(bti)
|
* getBackTrackInfo(bti)
|
||||||
*
|
*
|
||||||
|
|
@ -830,10 +883,9 @@ Bus.prototype.updateBackTrackCode = function(addr, bti)
|
||||||
Bus.prototype.getBackTrackInfo = function(bti)
|
Bus.prototype.getBackTrackInfo = function(bti)
|
||||||
{
|
{
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
var slot = bti >>> Bus.BACKTRACK.SLOT_SHIFT;
|
var bto = this.getBackTrackObject(bti);
|
||||||
if (slot) {
|
if (bto) {
|
||||||
var off = bti & Bus.BACKTRACK.OFF_MASK;
|
var off = bti & Bus.BACKTRACK.OFF_MASK;
|
||||||
var bto = this.abtObjects[slot-1];
|
|
||||||
var file = bto.obj.file;
|
var file = bto.obj.file;
|
||||||
if (file) {
|
if (file) {
|
||||||
this.assert(!bto.off);
|
this.assert(!bto.off);
|
||||||
|
|
@ -854,8 +906,7 @@ Bus.prototype.getBackTrackInfo = function(bti)
|
||||||
*/
|
*/
|
||||||
Bus.prototype.getBackTrackInfoFromAddr = function(addr)
|
Bus.prototype.getBackTrackInfoFromAddr = function(addr)
|
||||||
{
|
{
|
||||||
var bti = this.readBackTrack(addr);
|
return BACKTRACK? this.getBackTrackInfo(this.readBackTrack(addr)) : null;
|
||||||
return this.getBackTrackInfo(bti);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3671,7 +3671,7 @@ if (DEBUGGER) {
|
||||||
if (aAddr[0] == null) return;
|
if (aAddr[0] == null) return;
|
||||||
|
|
||||||
var sDump = "";
|
var sDump = "";
|
||||||
if (sCmd == "di") {
|
if (BACKTRACK && sCmd == "di") {
|
||||||
var addr = this.getAddr(aAddr);
|
var addr = this.getAddr(aAddr);
|
||||||
sDump += '%' + str.toHex(addr) + ": ";
|
sDump += '%' + str.toHex(addr) + ": ";
|
||||||
var sInfo = this.bus.getBackTrackInfoFromAddr(addr);
|
var sInfo = this.bus.getBackTrackInfoFromAddr(addr);
|
||||||
|
|
@ -4746,7 +4746,7 @@ if (DEBUGGER) {
|
||||||
if (this.cmp) this.cmp.reset();
|
if (this.cmp) this.cmp.reset();
|
||||||
return true;
|
return true;
|
||||||
case "ver":
|
case "ver":
|
||||||
this.println((APPNAME || "PCjs") + " version " + APPVERSION + " (" + (I386? "80386" : "80286") + (COMPILED? ",RELEASE" : (DEBUG? ",DEBUG" : ",NODEBUG")) + (PREFETCH? ",PREFETCH" : ",NOPREFETCH") + (EAFUNCS? ",EAFUNCS" : ",EATESTS") + (TYPEDARRAYS? ",TYPEDARRAYS" : (FATARRAYS? ",FATARRAYS" : ",DWORDARRAYS")) + (BACKTRACK? ",BACKTRACK" : "") + ")");
|
this.println((APPNAME || "PCjs") + " version " + APPVERSION + " (" + (I386? "80386" : "80286") + (COMPILED? ",RELEASE" : (DEBUG? ",DEBUG" : ",NODEBUG")) + (PREFETCH? ",PREFETCH" : ",NOPREFETCH") + (TYPEDARRAYS? ",TYPEDARRAYS" : (FATARRAYS? ",FATARRAYS" : ",DWORDARRAYS")) + (BACKTRACK? ",BACKTRACK" : "") + ")");
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
ch0 = sCmd.charAt(0);
|
ch0 = sCmd.charAt(0);
|
||||||
|
|
|
||||||
|
|
@ -69,19 +69,6 @@ var DEBUGGER = true; // this @define is overridden by the Closure Com
|
||||||
*/
|
*/
|
||||||
var PREFETCH = false;
|
var PREFETCH = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @define {boolean}
|
|
||||||
*
|
|
||||||
* EAFUNCS enables dynamic function switching whenever the CPU needs to disable one or both EA (Effective Address)
|
|
||||||
* memory functions for a ModRM instruction that doesn't observe the normal "read/modify/write" behavior. The goal
|
|
||||||
* is to avoid useless memory reads (which are mostly harmless) and stale memory writes (which are mostly destructive).
|
|
||||||
*
|
|
||||||
* If EAFUNCS is false, then the CPU falls back to setting/testing internal OP_NOREAD and OP_NOWRITE opFlags as
|
|
||||||
* needed. At the moment, it seems that "EAFUNCS mode" is a bit slower than "EATESTS mode", so EAFUNCS is turned off;
|
|
||||||
* however, your mileage may vary, depending on the browser and its vintage.
|
|
||||||
*/
|
|
||||||
var EAFUNCS = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @define {boolean}
|
* @define {boolean}
|
||||||
*
|
*
|
||||||
|
|
@ -137,7 +124,6 @@ if (typeof module !== 'undefined') {
|
||||||
global.PCJSCLASS = PCJSCLASS;
|
global.PCJSCLASS = PCJSCLASS;
|
||||||
global.DEBUGGER = DEBUGGER;
|
global.DEBUGGER = DEBUGGER;
|
||||||
global.PREFETCH = PREFETCH;
|
global.PREFETCH = PREFETCH;
|
||||||
global.EAFUNCS = EAFUNCS;
|
|
||||||
global.FATARRAYS = FATARRAYS;
|
global.FATARRAYS = FATARRAYS;
|
||||||
global.TYPEDARRAYS = TYPEDARRAYS;
|
global.TYPEDARRAYS = TYPEDARRAYS;
|
||||||
global.BACKTRACK = BACKTRACK;
|
global.BACKTRACK = BACKTRACK;
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,25 @@ Panel.prototype.powerUp = function(data, fRepower)
|
||||||
{
|
{
|
||||||
if (!fRepower) {
|
if (!fRepower) {
|
||||||
Panel.init();
|
Panel.init();
|
||||||
|
if (this.canvas) {
|
||||||
|
if (this.fBackTrack) {
|
||||||
|
/*
|
||||||
|
* We need to calculate some parameters based on the canvas pixel dimensions. For now, we're
|
||||||
|
* going to use 100% of the canvas height, and 75% of the canvas width (starting with the left edge),
|
||||||
|
* for the live memory display.
|
||||||
|
*
|
||||||
|
* For a 640x350 canvas, that means 480x350 pixels for the live memory display, or 168,000 pixels.
|
||||||
|
* For a 16Mb (24-bit) address space, with 16,777,216 locations, the worst case would mean each pixel
|
||||||
|
* represents roughly 100 memory locations. But in a machine with only 1152Kb of RAM, 32Kb of Video RAM,
|
||||||
|
* and 128Kb of ROM, that's only 1,343,488 locations we need to worry about, because we can ignore all
|
||||||
|
* the unallocated regions.
|
||||||
|
*
|
||||||
|
* So to start, we need a function that scans the entire address space, and reports how many bytes are
|
||||||
|
* actually allocated. At the same time, we should also count how many different objects exist.
|
||||||
|
*/
|
||||||
|
this.bus.scanMemory()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
@ -137,6 +156,11 @@ Panel.prototype.powerDown = function(fSave)
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Panel.prototype.scanMemory = function()
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updateAnimation()
|
* updateAnimation()
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -169,11 +169,6 @@ function X86CPU(parmsCPU) {
|
||||||
this.aMemBlocks = [];
|
this.aMemBlocks = [];
|
||||||
this.addrMemMask = this.blockShift = this.blockLimit = this.blockMask = 0;
|
this.addrMemMask = this.blockShift = this.blockLimit = this.blockMask = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* Establish all the default get/set functions for accessing memory; see this function for details.
|
|
||||||
*/
|
|
||||||
this.setMemoryEnabled();
|
|
||||||
|
|
||||||
if (SAMPLER) {
|
if (SAMPLER) {
|
||||||
/*
|
/*
|
||||||
* For now, we're just going to sample LIP values (well, LIP + cycle count)
|
* For now, we're just going to sample LIP values (well, LIP + cycle count)
|
||||||
|
|
@ -1270,43 +1265,6 @@ X86CPU.prototype.restore = function(data)
|
||||||
return this.bus.restoreMemory(data[4]);
|
return this.bus.restoreMemory(data[4]);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* setMemoryEnabled()
|
|
||||||
*
|
|
||||||
* Set the default EA memory access functions (enabled vs. disabled). When EAFUNCS is true, assorted
|
|
||||||
* CPU opcode functions override the default functions whenever a CPU operation needs to temporarily disable the
|
|
||||||
* "get" of a source operand (or the "set" of a destination operand, as in the case of a CMP instruction).
|
|
||||||
*
|
|
||||||
* However, it is ALSO every CPU opcode function's responsibility to restore those default access functions
|
|
||||||
* back to their normal (eg, enabled) values below, so that stepCPU() doesn't have to do this after every
|
|
||||||
* instruction (although in DEBUG builds, stepCPU() will call verifyMemoryEnabled() to assert that's been done).
|
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
*/
|
|
||||||
X86CPU.prototype.setMemoryEnabled = function()
|
|
||||||
{
|
|
||||||
this.getEAByte = this.getEAByteEnabled;
|
|
||||||
this.getEAWord = this.getEAWordEnabled;
|
|
||||||
this.modEAByte = this.modEAByteEnabled;
|
|
||||||
this.modEAWord = this.modEAWordEnabled;
|
|
||||||
this.setEAByte = this.setEAByteEnabled;
|
|
||||||
this.setEAWord = this.setEAWordEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* verifyMemoryEnabled()
|
|
||||||
*
|
|
||||||
* Used by stepCPU() in DEBUG builds to confirm that all CPU opcode functions have re-enabled memory access.
|
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
*/
|
|
||||||
X86CPU.prototype.verifyMemoryEnabled = function()
|
|
||||||
{
|
|
||||||
this.assert(!(this.regEAX & 0xffff0000) && !(this.regEBX & 0xffff0000) && !(this.regECX & 0xffff0000) && !(this.regEDX & 0xffff0000));
|
|
||||||
this.assert(!(this.regESI & 0xffff0000) && !(this.regEDI & 0xffff0000) && !(this.regEBP & 0xffff0000) && !(this.regESP & 0xffff0000));
|
|
||||||
this.assert((this.getEAByte == this.getEAByteEnabled && this.getEAWord == this.getEAWordEnabled && this.modEAByte == this.modEAByteEnabled && this.modEAWord == this.modEAWordEnabled && this.setEAByte == this.setEAByteEnabled && this.setEAWord == this.setEAWordEnabled), "verifyMemoryEnabled() failed");
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getSeg(sName)
|
* getSeg(sName)
|
||||||
*
|
*
|
||||||
|
|
@ -1977,117 +1935,36 @@ X86CPU.prototype.setWord = function(addr, w)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getEAByteDisabled(seg, off)
|
* getEAByte(seg, off)
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
|
||||||
* @param {number} off is a segment-relative offset
|
|
||||||
* @return {number}
|
|
||||||
*
|
|
||||||
X86CPU.prototype.getEAByteDisabled = function getEAByteDisabled(seg, off)
|
|
||||||
{
|
|
||||||
this.segEA = seg;
|
|
||||||
this.offEA = off;
|
|
||||||
//
|
|
||||||
// The LEA opcode is at least one unavoidable reason we must still calculate regEA in
|
|
||||||
// getEAWordDisabled(), but as for getEAByteDisabled(), I can't think of any reason for this.
|
|
||||||
//
|
|
||||||
this.regEA = seg.base + off;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getEAWordDisabled(seg, off)
|
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
|
||||||
* @param {number} off is a segment-relative offset
|
|
||||||
* @return {number}
|
|
||||||
*/
|
|
||||||
X86CPU.prototype.getEAWordDisabled = function getEAWordDisabled(seg, off)
|
|
||||||
{
|
|
||||||
this.segEA = seg;
|
|
||||||
this.offEA = off;
|
|
||||||
/*
|
|
||||||
* The LEA opcode is at least one unavoidable reason we must still calculate regEA here....
|
|
||||||
*/
|
|
||||||
this.regEA = seg.base + off;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* modEAByteDisabled(seg, off)
|
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
|
||||||
* @param {number} off is a segment-relative offset
|
|
||||||
* @return {number}
|
|
||||||
*/
|
|
||||||
X86CPU.prototype.modEAByteDisabled = function modEADisabled(seg, off)
|
|
||||||
{
|
|
||||||
this.segEA = seg;
|
|
||||||
this.offEA = off;
|
|
||||||
/*
|
|
||||||
* TODO: Should this not also set regEA? Optimization or oversight?
|
|
||||||
*/
|
|
||||||
this.regEAWrite = seg.base + off;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
X86CPU.prototype.modEAWordDisabled = X86CPU.prototype.modEAByteDisabled;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setEAByteDisabled(w)
|
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
* @param {number} w is the word (16-bit) value to write (ignored)
|
|
||||||
*/
|
|
||||||
X86CPU.prototype.setEAByteDisabled = function setEAByteDisabled(w)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setEAWordDisabled(w)
|
|
||||||
*
|
|
||||||
* @this {X86CPU}
|
|
||||||
* @param {number} w is the word (16-bit) value to write (ignored)
|
|
||||||
*/
|
|
||||||
X86CPU.prototype.setEAWordDisabled = function setEAWordDisabled(w)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getEAByteEnabled(seg, off)
|
|
||||||
*
|
*
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
* @param {X86Seg} seg register (eg, segDS)
|
||||||
* @param {number} off is a segment-relative offset
|
* @param {number} off is a segment-relative offset
|
||||||
* @return {number} byte (8-bit) value at that address
|
* @return {number} byte (8-bit) value at that address
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.getEAByteEnabled = function getEAByteEnabled(seg, off)
|
X86CPU.prototype.getEAByte = function(seg, off)
|
||||||
{
|
{
|
||||||
this.segEA = seg;
|
this.segEA = seg;
|
||||||
this.regEA = seg.checkRead(this.offEA = off, 0);
|
this.regEA = seg.checkRead(this.offEA = off, 0);
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOREAD)) return 0;
|
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||||
var b = this.getByte(this.regEA);
|
var b = this.getByte(this.regEA);
|
||||||
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||||
return b;
|
return b;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getEAWordEnabled(seg, off)
|
* getEAWord(seg, off)
|
||||||
*
|
*
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
* @param {X86Seg} seg register (eg, segDS)
|
||||||
* @param {number} off is a segment-relative offset
|
* @param {number} off is a segment-relative offset
|
||||||
* @return {number} word (16-bit) value at that address
|
* @return {number} word (16-bit) value at that address
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.getEAWordEnabled = function getEAWordEnabled(seg, off)
|
X86CPU.prototype.getEAWord = function(seg, off)
|
||||||
{
|
{
|
||||||
this.segEA = seg;
|
this.segEA = seg;
|
||||||
this.regEA = seg.checkRead(this.offEA = off, 1);
|
this.regEA = seg.checkRead(this.offEA = off, 1);
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOREAD)) return 0;
|
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||||
var w = this.getWord(this.regEA);
|
var w = this.getWord(this.regEA);
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||||
|
|
@ -2097,36 +1974,36 @@ X86CPU.prototype.getEAWordEnabled = function getEAWordEnabled(seg, off)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* modEAByteEnabled(seg, off)
|
* modEAByte(seg, off)
|
||||||
*
|
*
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
* @param {X86Seg} seg register (eg, segDS)
|
||||||
* @param {number} off is a segment-relative offset
|
* @param {number} off is a segment-relative offset
|
||||||
* @return {number} byte (8-bit) value at that address
|
* @return {number} byte (8-bit) value at that address
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.modEAByteEnabled = function modEAByteEnabled(seg, off)
|
X86CPU.prototype.modEAByte = function(seg, off)
|
||||||
{
|
{
|
||||||
this.segEA = seg;
|
this.segEA = seg;
|
||||||
this.regEAWrite = this.regEA = seg.checkRead(this.offEA = off, 0);
|
this.regEAWrite = this.regEA = seg.checkRead(this.offEA = off, 0);
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOREAD)) return 0;
|
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||||
var b = this.getByte(this.regEA);
|
var b = this.getByte(this.regEA);
|
||||||
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||||
return b;
|
return b;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* modEAWordEnabled(seg, off)
|
* modEAWord(seg, off)
|
||||||
*
|
*
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
* @param {X86Seg} seg register (eg, segDS)
|
* @param {X86Seg} seg register (eg, segDS)
|
||||||
* @param {number} off is a segment-relative offset
|
* @param {number} off is a segment-relative offset
|
||||||
* @return {number} word (16-bit) value at that address
|
* @return {number} word (16-bit) value at that address
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.modEAWordEnabled = function modEAWordEnabled(seg, off)
|
X86CPU.prototype.modEAWord = function(seg, off)
|
||||||
{
|
{
|
||||||
this.segEA = seg;
|
this.segEA = seg;
|
||||||
this.regEAWrite = this.regEA = seg.checkRead(this.offEA = off, 1);
|
this.regEAWrite = this.regEA = seg.checkRead(this.offEA = off, 1);
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOREAD)) return 0;
|
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||||
var w = this.getWord(this.regEA);
|
var w = this.getWord(this.regEA);
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||||
|
|
@ -2136,27 +2013,123 @@ X86CPU.prototype.modEAWordEnabled = function modEAWordEnabled(seg, off)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setEAByteEnabled(b)
|
* getEAByteData(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} byte (8-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.getEAByteData = function(off)
|
||||||
|
{
|
||||||
|
return this.getEAByte(this.segData, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getEAByteStack(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} byte (8-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.getEAByteStack = function(off)
|
||||||
|
{
|
||||||
|
return this.getEAByte(this.segStack, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getEAWordData(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} word (16-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.getEAWordData = function(off)
|
||||||
|
{
|
||||||
|
return this.getEAWord(this.segData, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getEAWordStack(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} word (16-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.getEAWordStack = function(off)
|
||||||
|
{
|
||||||
|
return this.getEAWord(this.segStack, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modEAByteData(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} byte (8-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.modEAByteData = function(off)
|
||||||
|
{
|
||||||
|
return this.modEAByte(this.segData, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modEAByteStack(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} byte (8-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.modEAByteStack = function(off)
|
||||||
|
{
|
||||||
|
return this.modEAByte(this.segStack, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modEAWordData(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} word (16-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.modEAWordData = function(off)
|
||||||
|
{
|
||||||
|
return this.modEAWord(this.segData, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modEAWordStack(off)
|
||||||
|
*
|
||||||
|
* @this {X86CPU}
|
||||||
|
* @param {number} off is a segment-relative offset
|
||||||
|
* @return {number} word (16-bit) value at that address
|
||||||
|
*/
|
||||||
|
X86CPU.prototype.modEAWordStack = function(off)
|
||||||
|
{
|
||||||
|
return this.modEAWord(this.segStack, off & this.addrMask);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setEAByte(b)
|
||||||
*
|
*
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
* @param {number} b is the byte (8-bit) value to write
|
* @param {number} b is the byte (8-bit) value to write
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.setEAByteEnabled = function setEAByteEnabled(b)
|
X86CPU.prototype.setEAByte = function(b)
|
||||||
{
|
{
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOWRITE)) return;
|
if (this.opFlags & X86.OPFLAG.NOWRITE) return;
|
||||||
if (BACKTRACK) this.backTrack.btiMemLo = this.backTrack.btiEALo;
|
if (BACKTRACK) this.backTrack.btiMemLo = this.backTrack.btiEALo;
|
||||||
this.setByte(this.segEA.checkWrite(this.offEA, 0), b);
|
this.setByte(this.segEA.checkWrite(this.offEA, 0), b);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setEAWordEnabled(w)
|
* setEAWord(w)
|
||||||
*
|
*
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
* @param {number} w is the word (16-bit) value to write
|
* @param {number} w is the word (16-bit) value to write
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.setEAWordEnabled = function setEAWordEnabled(w)
|
X86CPU.prototype.setEAWord = function(w)
|
||||||
{
|
{
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOWRITE)) return;
|
if (this.opFlags & X86.OPFLAG.NOWRITE) return;
|
||||||
if (BACKTRACK) {
|
if (BACKTRACK) {
|
||||||
this.backTrack.btiMemLo = this.backTrack.btiEALo;
|
this.backTrack.btiMemLo = this.backTrack.btiEALo;
|
||||||
this.backTrack.btiMemHi = this.backTrack.btiEAHi;
|
this.backTrack.btiMemHi = this.backTrack.btiEAHi;
|
||||||
|
|
@ -2235,7 +2208,7 @@ X86CPU.prototype.setSOWord = function(seg, off, w)
|
||||||
*/
|
*/
|
||||||
X86CPU.prototype.getBytePrefetch = function(addr)
|
X86CPU.prototype.getBytePrefetch = function(addr)
|
||||||
{
|
{
|
||||||
if (!EAFUNCS && (this.opFlags & X86.OPFLAG.NOREAD)) return 0;
|
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||||
var b;
|
var b;
|
||||||
if (!this.cbPrefetchQueued) {
|
if (!this.cbPrefetchQueued) {
|
||||||
if (MAXDEBUG) {
|
if (MAXDEBUG) {
|
||||||
|
|
@ -2816,18 +2789,6 @@ X86CPU.prototype.stepCPU = function(nMinCycles)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
/*
|
|
||||||
* Some opcode helpers are required to temporarily redirect getEAByte/getEAWord or setEAByte/setEAWord
|
|
||||||
* to null functions, effectively disabling a memory read that's unnecessary (or a memory write that could
|
|
||||||
* be destructive). However, they weren't originally required to restore those memory functions when they
|
|
||||||
* were done; we would simply reset all the memory functions here, after every single instruction.
|
|
||||||
*
|
|
||||||
* That's no longer the case. Those opcode helpers (or their callers) are now required to restore the
|
|
||||||
* memory access functions to their defaults, so that we don't have to waste time resetting them here, on
|
|
||||||
* every instruction. The DEBUG-only verifyMemoryEnabled() simply confirms that everyone's doing their job.
|
|
||||||
*/
|
|
||||||
this.verifyMemoryEnabled();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure that every instruction is assessing a cycle cost, and that the cost is a net positive.
|
* Make sure that every instruction is assessing a cycle cost, and that the cost is a net positive.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ var X86Grps = {
|
||||||
this.resultSize = X86.RESULT.SIZE_BYTE;
|
this.resultSize = X86.RESULT.SIZE_BYTE;
|
||||||
this.resultValue = this.resultParitySign = dst - src;
|
this.resultValue = this.resultParitySign = dst - src;
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesArithRR : this.CYCLES.nOpCyclesCompareRM) : this.CYCLES.nOpCyclesArithRM);
|
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesArithRR : this.CYCLES.nOpCyclesCompareRM) : this.CYCLES.nOpCyclesArithRM);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -275,7 +275,7 @@ var X86Grps = {
|
||||||
this.resultSize = X86.RESULT.SIZE_WORD;
|
this.resultSize = X86.RESULT.SIZE_WORD;
|
||||||
this.resultValue = this.resultParitySign = dst - src;
|
this.resultValue = this.resultParitySign = dst - src;
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesArithRR : this.CYCLES.nOpCyclesCompareRM) : this.CYCLES.nOpCyclesArithRM);
|
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesArithRR : this.CYCLES.nOpCyclesCompareRM) : this.CYCLES.nOpCyclesArithRM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -655,7 +655,7 @@ var X86Grps = {
|
||||||
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
||||||
this.resultSize = X86.RESULT.SIZE_BYTE;
|
this.resultSize = X86.RESULT.SIZE_BYTE;
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesTestRI : this.CYCLES.nOpCyclesTestMI);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesTestRI : this.CYCLES.nOpCyclesTestMI);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -669,7 +669,7 @@ var X86Grps = {
|
||||||
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
||||||
this.resultSize = X86.RESULT.SIZE_WORD;
|
this.resultSize = X86.RESULT.SIZE_WORD;
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesTestRI : this.CYCLES.nOpCyclesTestMI);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesTestRI : this.CYCLES.nOpCyclesTestMI);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -745,7 +745,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('MULB', src, dst, null, this.getPS(), this.regMD16);
|
if (DEBUG && DEBUGGER) this.traceLog('MULB', src, dst, null, this.getPS(), this.regMD16);
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesMulBR : this.CYCLES.nOpCyclesMulBM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesMulBR : this.CYCLES.nOpCyclesMulBM);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -789,7 +789,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('IMULB', src, dst, null, this.getPS(), this.regMD16);
|
if (DEBUG && DEBUGGER) this.traceLog('IMULB', src, dst, null, this.getPS(), this.regMD16);
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIMulBR : this.CYCLES.nOpCyclesIMulBM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIMulBR : this.CYCLES.nOpCyclesIMulBM);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -828,7 +828,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('DIVB', src, dst, null, this.getPS(), this.regMD16);
|
if (DEBUG && DEBUGGER) this.traceLog('DIVB', src, dst, null, this.getPS(), this.regMD16);
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesDivBR : this.CYCLES.nOpCyclesDivBM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesDivBR : this.CYCLES.nOpCyclesDivBM);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -875,7 +875,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('IDIVB', src, dst, null, this.getPS(), this.regMD16);
|
if (DEBUG && DEBUGGER) this.traceLog('IDIVB', src, dst, null, this.getPS(), this.regMD16);
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIDivBR : this.CYCLES.nOpCyclesIDivBM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIDivBR : this.CYCLES.nOpCyclesIDivBM);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -906,7 +906,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('MULW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
if (DEBUG && DEBUGGER) this.traceLog('MULW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesMulWR : this.CYCLES.nOpCyclesMulWM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesMulWR : this.CYCLES.nOpCyclesMulWM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -951,7 +951,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('IMULW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
if (DEBUG && DEBUGGER) this.traceLog('IMULW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIMulWR : this.CYCLES.nOpCyclesIMulWM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIMulWR : this.CYCLES.nOpCyclesIMulWM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -996,7 +996,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('DIVW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
if (DEBUG && DEBUGGER) this.traceLog('DIVW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesDivWR : this.CYCLES.nOpCyclesDivWM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesDivWR : this.CYCLES.nOpCyclesDivWM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1046,7 +1046,7 @@ var X86Grps = {
|
||||||
*/
|
*/
|
||||||
if (DEBUG && DEBUGGER) this.traceLog('IDIVW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
if (DEBUG && DEBUGGER) this.traceLog('IDIVW', src, dst, null, this.getPS(), this.regMD16 | (this.regMD32 << 16));
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIDivWR : this.CYCLES.nOpCyclesIDivWM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesIDivWR : this.CYCLES.nOpCyclesIDivWM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1115,7 +1115,7 @@ var X86Grps = {
|
||||||
this.pushWord(this.regEIP);
|
this.pushWord(this.regEIP);
|
||||||
this.setIP(dst);
|
this.setIP(dst);
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesCallWR : this.CYCLES.nOpCyclesCallWM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesCallWR : this.CYCLES.nOpCyclesCallWM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1130,7 +1130,7 @@ var X86Grps = {
|
||||||
}
|
}
|
||||||
X86Help.opHelpCALLF.call(this, dst, this.getWord(this.regEA + 2));
|
X86Help.opHelpCALLF.call(this, dst, this.getWord(this.regEA + 2));
|
||||||
this.nStepCycles -= this.CYCLES.nOpCyclesCallDM;
|
this.nStepCycles -= this.CYCLES.nOpCyclesCallDM;
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1142,7 +1142,7 @@ var X86Grps = {
|
||||||
opGrpJMPw: function(dst, src) {
|
opGrpJMPw: function(dst, src) {
|
||||||
this.setIP(dst);
|
this.setIP(dst);
|
||||||
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesJmpWR : this.CYCLES.nOpCyclesJmpWM);
|
this.nStepCycles -= (this.regEA < 0? this.CYCLES.nOpCyclesJmpWR : this.CYCLES.nOpCyclesJmpWM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1158,7 +1158,7 @@ var X86Grps = {
|
||||||
this.setCSIP(dst, this.getWord(this.regEA + 2));
|
this.setCSIP(dst, this.getWord(this.regEA + 2));
|
||||||
if (this.cIntReturn) this.checkIntReturn(this.regLIP);
|
if (this.cIntReturn) this.checkIntReturn(this.regLIP);
|
||||||
this.nStepCycles -= this.CYCLES.nOpCyclesJmpDM;
|
this.nStepCycles -= this.CYCLES.nOpCyclesJmpDM;
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1186,7 +1186,7 @@ var X86Grps = {
|
||||||
/*
|
/*
|
||||||
* The PUSH is the only write that needs to occur; dst was the source operand and does not need to be rewritten.
|
* The PUSH is the only write that needs to occur; dst was the source operand and does not need to be rewritten.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ var X86Help = {
|
||||||
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
||||||
this.resultSize = X86.RESULT.SIZE_BYTE;
|
this.resultSize = X86.RESULT.SIZE_BYTE;
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesTestRR : this.CYCLES.nOpCyclesTestRM) : this.CYCLES.nOpCyclesTestRM);
|
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesTestRR : this.CYCLES.nOpCyclesTestRM) : this.CYCLES.nOpCyclesTestRM);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,7 +80,7 @@ var X86Help = {
|
||||||
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
this.resultValue = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
||||||
this.resultSize = X86.RESULT.SIZE_WORD;
|
this.resultSize = X86.RESULT.SIZE_WORD;
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesTestRR : this.CYCLES.nOpCyclesTestRM) : this.CYCLES.nOpCyclesTestRM);
|
this.nStepCycles -= (this.regEAWrite < 0? (this.regEA < 0? this.CYCLES.nOpCyclesTestRR : this.CYCLES.nOpCyclesTestRM) : this.CYCLES.nOpCyclesTestRM);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -251,7 +251,7 @@ var X86Help = {
|
||||||
this.setIP(this.opLIP - this.segCS.base);
|
this.setIP(this.opLIP - this.segCS.base);
|
||||||
X86Help.opHelpINT.call(this, X86.EXCEPTION.BOUND_ERR, null, 0);
|
X86Help.opHelpINT.call(this, X86.EXCEPTION.BOUND_ERR, null, 0);
|
||||||
}
|
}
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -660,16 +660,14 @@ var X86Help = {
|
||||||
* executing, and since we currently don't do anything to interrupt that execution (eg, throw a
|
* executing, and since we currently don't do anything to interrupt that execution (eg, throw a
|
||||||
* JavaScript exception), we should shut off all further reads/writes for the current instruction.
|
* JavaScript exception), we should shut off all further reads/writes for the current instruction.
|
||||||
*
|
*
|
||||||
* That's easy for any EA-based memory accesses (provided we're not using EAFUNCS): simply set both
|
* That's easy for any EA-based memory accesses: simply set both the NOREAD and NOWRITE flags.
|
||||||
* the NOREAD and NOWRITE flags. However, there are also direct, non-EA-based memory accesses to
|
* However, there are also direct, non-EA-based memory accesses to consider. A perfect example is
|
||||||
* consider. A perfect example is opPUSHA(): if a GP fault occurs on any PUSH other than the last,
|
* opPUSHA(): if a GP fault occurs on any PUSH other than the last, a subsequent PUSH is likely to
|
||||||
* a subsequent PUSH is likely to cause another fault, which we will misinterpret as a double-fault.
|
* cause another fault, which we will misinterpret as a double-fault.
|
||||||
*
|
*
|
||||||
* TODO: Throw a special JavaScript exception that cpu.js must intercept and quietly ignore.
|
* TODO: Throw a special JavaScript exception that cpu.js must intercept and quietly ignore.
|
||||||
*/
|
*/
|
||||||
if (!EAFUNCS) {
|
this.opFlags &= ~(X86.OPFLAG.NOREAD | X86.OPFLAG.NOWRITE);
|
||||||
this.opFlags &= ~(X86.OPFLAG.NOREAD | X86.OPFLAG.NOWRITE);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opHelpFaultMessage()
|
* opHelpFaultMessage()
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -82,6 +82,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB04(mod) {
|
function opModSIB04(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regEAX;
|
return this.regESP + this.regEAX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,7 +92,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB05(mod) {
|
function opModSIB05(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regEAX;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regEAX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB06(): scale=00 (1) index=000 (EAX) base=110 (ESI)
|
* opModSIB06(): scale=00 (1) index=000 (EAX) base=110 (ESI)
|
||||||
|
|
@ -154,6 +155,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB0C(mod) {
|
function opModSIB0C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regECX;
|
return this.regESP + this.regECX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -163,7 +165,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB0D(mod) {
|
function opModSIB0D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regECX;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regECX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB0E(): scale=00 (1) index=001 (ECX) base=110 (ESI)
|
* opModSIB0E(): scale=00 (1) index=001 (ECX) base=110 (ESI)
|
||||||
|
|
@ -226,6 +228,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB14(mod) {
|
function opModSIB14(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regEDX;
|
return this.regESP + this.regEDX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -235,7 +238,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB15(mod) {
|
function opModSIB15(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regEDX;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regEDX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB16(): scale=00 (1) index=010 (EDX) base=110 (ESI)
|
* opModSIB16(): scale=00 (1) index=010 (EDX) base=110 (ESI)
|
||||||
|
|
@ -298,6 +301,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB1C(mod) {
|
function opModSIB1C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regEBX;
|
return this.regESP + this.regEBX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -307,7 +311,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB1D(mod) {
|
function opModSIB1D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regEBX;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regEBX;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB1E(): scale=00 (1) index=011 (EBX) base=110 (ESI)
|
* opModSIB1E(): scale=00 (1) index=011 (EBX) base=110 (ESI)
|
||||||
|
|
@ -370,6 +374,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB24(mod) {
|
function opModSIB24(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP;
|
return this.regESP;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -379,7 +384,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB25(mod) {
|
function opModSIB25(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord());
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord());
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB26(): scale=00 (1) index=100 (none) base=110 (ESI)
|
* opModSIB26(): scale=00 (1) index=100 (none) base=110 (ESI)
|
||||||
|
|
@ -442,6 +447,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB2C(mod) {
|
function opModSIB2C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regEBP;
|
return this.regESP + this.regEBP;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -451,7 +457,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB2D(mod) {
|
function opModSIB2D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regEBP;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regEBP;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB2E(): scale=00 (1) index=101 (EBP) base=110 (ESI)
|
* opModSIB2E(): scale=00 (1) index=101 (EBP) base=110 (ESI)
|
||||||
|
|
@ -514,6 +520,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB34(mod) {
|
function opModSIB34(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regESI;
|
return this.regESP + this.regESI;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -523,7 +530,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB35(mod) {
|
function opModSIB35(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regESI;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regESI;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB36(): scale=00 (1) index=110 (ESI) base=110 (ESI)
|
* opModSIB36(): scale=00 (1) index=110 (ESI) base=110 (ESI)
|
||||||
|
|
@ -586,6 +593,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB3C(mod) {
|
function opModSIB3C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + this.regEDI;
|
return this.regESP + this.regEDI;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -595,7 +603,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB3D(mod) {
|
function opModSIB3D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + this.regEDI;
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + this.regEDI;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB3E(): scale=00 (1) index=111 (EDI) base=110 (ESI)
|
* opModSIB3E(): scale=00 (1) index=111 (EDI) base=110 (ESI)
|
||||||
|
|
@ -658,6 +666,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB44(mod) {
|
function opModSIB44(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEAX << 1);
|
return this.regESP + (this.regEAX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -667,7 +676,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB45(mod) {
|
function opModSIB45(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEAX << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEAX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB46(): scale=01 (2) index=000 (EAX) base=110 (ESI)
|
* opModSIB46(): scale=01 (2) index=000 (EAX) base=110 (ESI)
|
||||||
|
|
@ -730,6 +739,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB4C(mod) {
|
function opModSIB4C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regECX << 1);
|
return this.regESP + (this.regECX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -739,7 +749,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB4D(mod) {
|
function opModSIB4D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regECX << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regECX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB4E(): scale=01 (2) index=001 (ECX) base=110 (ESI)
|
* opModSIB4E(): scale=01 (2) index=001 (ECX) base=110 (ESI)
|
||||||
|
|
@ -802,6 +812,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB54(mod) {
|
function opModSIB54(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEDX << 1);
|
return this.regESP + (this.regEDX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -811,7 +822,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB55(mod) {
|
function opModSIB55(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEDX << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEDX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB56(): scale=01 (2) index=010 (EDX) base=110 (ESI)
|
* opModSIB56(): scale=01 (2) index=010 (EDX) base=110 (ESI)
|
||||||
|
|
@ -874,6 +885,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB5C(mod) {
|
function opModSIB5C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEBX << 1);
|
return this.regESP + (this.regEBX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -883,7 +895,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB5D(mod) {
|
function opModSIB5D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEBX << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEBX << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB5E(): scale=01 (2) index=011 (EBX) base=110 (ESI)
|
* opModSIB5E(): scale=01 (2) index=011 (EBX) base=110 (ESI)
|
||||||
|
|
@ -946,6 +958,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB64(mod) {
|
function opModSIB64(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP;
|
return this.regESP;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -955,7 +968,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB65(mod) {
|
function opModSIB65(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord());
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord());
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB66(): scale=01 (2) index=100 (none) base=110 (ESI)
|
* opModSIB66(): scale=01 (2) index=100 (none) base=110 (ESI)
|
||||||
|
|
@ -1018,6 +1031,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB6C(mod) {
|
function opModSIB6C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEBP << 1);
|
return this.regESP + (this.regEBP << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1027,7 +1041,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB6D(mod) {
|
function opModSIB6D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEBP << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEBP << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB6E(): scale=01 (2) index=101 (EBP) base=110 (ESI)
|
* opModSIB6E(): scale=01 (2) index=101 (EBP) base=110 (ESI)
|
||||||
|
|
@ -1090,6 +1104,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB74(mod) {
|
function opModSIB74(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regESI << 1);
|
return this.regESP + (this.regESI << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1099,7 +1114,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB75(mod) {
|
function opModSIB75(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regESI << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regESI << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB76(): scale=01 (2) index=110 (ESI) base=110 (ESI)
|
* opModSIB76(): scale=01 (2) index=110 (ESI) base=110 (ESI)
|
||||||
|
|
@ -1162,6 +1177,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB7C(mod) {
|
function opModSIB7C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEDI << 1);
|
return this.regESP + (this.regEDI << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1171,7 +1187,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB7D(mod) {
|
function opModSIB7D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEDI << 1);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEDI << 1);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB7E(): scale=01 (2) index=111 (EDI) base=110 (ESI)
|
* opModSIB7E(): scale=01 (2) index=111 (EDI) base=110 (ESI)
|
||||||
|
|
@ -1234,6 +1250,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB84(mod) {
|
function opModSIB84(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEAX << 2);
|
return this.regESP + (this.regEAX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1243,7 +1260,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB85(mod) {
|
function opModSIB85(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEAX << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEAX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB86(): scale=10 (4) index=000 (EAX) base=110 (ESI)
|
* opModSIB86(): scale=10 (4) index=000 (EAX) base=110 (ESI)
|
||||||
|
|
@ -1306,6 +1323,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB8C(mod) {
|
function opModSIB8C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regECX << 2);
|
return this.regESP + (this.regECX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1315,7 +1333,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB8D(mod) {
|
function opModSIB8D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regECX << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regECX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB8E(): scale=10 (4) index=001 (ECX) base=110 (ESI)
|
* opModSIB8E(): scale=10 (4) index=001 (ECX) base=110 (ESI)
|
||||||
|
|
@ -1378,6 +1396,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB94(mod) {
|
function opModSIB94(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEDX << 2);
|
return this.regESP + (this.regEDX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1387,7 +1406,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB95(mod) {
|
function opModSIB95(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEDX << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEDX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB96(): scale=10 (4) index=010 (EDX) base=110 (ESI)
|
* opModSIB96(): scale=10 (4) index=010 (EDX) base=110 (ESI)
|
||||||
|
|
@ -1450,6 +1469,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB9C(mod) {
|
function opModSIB9C(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEBX << 2);
|
return this.regESP + (this.regEBX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1459,7 +1479,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIB9D(mod) {
|
function opModSIB9D(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEBX << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEBX << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIB9E(): scale=10 (4) index=011 (EBX) base=110 (ESI)
|
* opModSIB9E(): scale=10 (4) index=011 (EBX) base=110 (ESI)
|
||||||
|
|
@ -1522,6 +1542,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBA4(mod) {
|
function opModSIBA4(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP;
|
return this.regESP;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1531,7 +1552,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBA5(mod) {
|
function opModSIBA5(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord());
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord());
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBA6(): scale=10 (4) index=100 (none) base=110 (ESI)
|
* opModSIBA6(): scale=10 (4) index=100 (none) base=110 (ESI)
|
||||||
|
|
@ -1594,6 +1615,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBAC(mod) {
|
function opModSIBAC(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEBP << 2);
|
return this.regESP + (this.regEBP << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1603,7 +1625,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBAD(mod) {
|
function opModSIBAD(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEBP << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEBP << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBAE(): scale=10 (4) index=101 (EBP) base=110 (ESI)
|
* opModSIBAE(): scale=10 (4) index=101 (EBP) base=110 (ESI)
|
||||||
|
|
@ -1666,6 +1688,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBB4(mod) {
|
function opModSIBB4(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regESI << 2);
|
return this.regESP + (this.regESI << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1675,7 +1698,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBB5(mod) {
|
function opModSIBB5(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regESI << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regESI << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBB6(): scale=10 (4) index=110 (ESI) base=110 (ESI)
|
* opModSIBB6(): scale=10 (4) index=110 (ESI) base=110 (ESI)
|
||||||
|
|
@ -1738,6 +1761,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBBC(mod) {
|
function opModSIBBC(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEDI << 2);
|
return this.regESP + (this.regEDI << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1747,7 +1771,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBBD(mod) {
|
function opModSIBBD(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEDI << 2);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEDI << 2);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBBE(): scale=10 (4) index=111 (EDI) base=110 (ESI)
|
* opModSIBBE(): scale=10 (4) index=111 (EDI) base=110 (ESI)
|
||||||
|
|
@ -1810,6 +1834,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBC4(mod) {
|
function opModSIBC4(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEAX << 3);
|
return this.regESP + (this.regEAX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1819,7 +1844,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBC5(mod) {
|
function opModSIBC5(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEAX << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEAX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBC6(): scale=11 (8) index=000 (EAX) base=110 (ESI)
|
* opModSIBC6(): scale=11 (8) index=000 (EAX) base=110 (ESI)
|
||||||
|
|
@ -1882,6 +1907,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBCC(mod) {
|
function opModSIBCC(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regECX << 3);
|
return this.regESP + (this.regECX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1891,7 +1917,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBCD(mod) {
|
function opModSIBCD(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regECX << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regECX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBCE(): scale=11 (8) index=001 (ECX) base=110 (ESI)
|
* opModSIBCE(): scale=11 (8) index=001 (ECX) base=110 (ESI)
|
||||||
|
|
@ -1954,6 +1980,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBD4(mod) {
|
function opModSIBD4(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEDX << 3);
|
return this.regESP + (this.regEDX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1963,7 +1990,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBD5(mod) {
|
function opModSIBD5(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEDX << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEDX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBD6(): scale=11 (8) index=010 (EDX) base=110 (ESI)
|
* opModSIBD6(): scale=11 (8) index=010 (EDX) base=110 (ESI)
|
||||||
|
|
@ -2026,6 +2053,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBDC(mod) {
|
function opModSIBDC(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEBX << 3);
|
return this.regESP + (this.regEBX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2035,7 +2063,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBDD(mod) {
|
function opModSIBDD(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEBX << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEBX << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBDE(): scale=11 (8) index=011 (EBX) base=110 (ESI)
|
* opModSIBDE(): scale=11 (8) index=011 (EBX) base=110 (ESI)
|
||||||
|
|
@ -2098,6 +2126,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBE4(mod) {
|
function opModSIBE4(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP;
|
return this.regESP;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2107,7 +2136,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBE5(mod) {
|
function opModSIBE5(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord());
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord());
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBE6(): scale=11 (8) index=100 (none) base=110 (ESI)
|
* opModSIBE6(): scale=11 (8) index=100 (none) base=110 (ESI)
|
||||||
|
|
@ -2170,6 +2199,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBEC(mod) {
|
function opModSIBEC(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEBP << 3);
|
return this.regESP + (this.regEBP << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2179,7 +2209,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBED(mod) {
|
function opModSIBED(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEBP << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEBP << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBEE(): scale=11 (8) index=101 (EBP) base=110 (ESI)
|
* opModSIBEE(): scale=11 (8) index=101 (EBP) base=110 (ESI)
|
||||||
|
|
@ -2242,6 +2272,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBF4(mod) {
|
function opModSIBF4(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regESI << 3);
|
return this.regESP + (this.regESI << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2251,7 +2282,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBF5(mod) {
|
function opModSIBF5(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regESI << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regESI << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBF6(): scale=11 (8) index=110 (ESI) base=110 (ESI)
|
* opModSIBF6(): scale=11 (8) index=110 (ESI) base=110 (ESI)
|
||||||
|
|
@ -2314,6 +2345,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBFC(mod) {
|
function opModSIBFC(mod) {
|
||||||
|
this.segData = this.segStack;
|
||||||
return this.regESP + (this.regEDI << 3);
|
return this.regESP + (this.regEDI << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2323,7 +2355,7 @@ X86ModSIB.aOpModSIB = [
|
||||||
* @param {number} mod
|
* @param {number} mod
|
||||||
*/
|
*/
|
||||||
function opModSIBFD(mod) {
|
function opModSIBFD(mod) {
|
||||||
return (mod? this.regEBP : this.getIPWord()) + (this.regEDI << 3);
|
return (mod? ((this.segData = this.segStack), this.regEBP) : this.getIPWord()) + (this.regEDI << 3);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* opModSIBFE(): scale=11 (8) index=111 (EDI) base=110 (ESI)
|
* opModSIBFE(): scale=11 (8) index=111 (EDI) base=110 (ESI)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -47,10 +47,9 @@ var X86Op0F = {
|
||||||
opGrp6: function() {
|
opGrp6: function() {
|
||||||
var bModRM = this.getIPByte();
|
var bModRM = this.getIPByte();
|
||||||
if ((bModRM & 0x38) < 0x10) { // possible reg values: 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38
|
if ((bModRM & 0x38) < 0x10) { // possible reg values: 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
}
|
}
|
||||||
this.opMods.aOpModGrpWord[bModRM].call(this, this.aOpGrp6, X86Grps.opGrpNoSrc);
|
this.opMods.aOpModGrpWord[bModRM].call(this, this.aOpGrp6, X86Grps.opGrpNoSrc);
|
||||||
if (EAFUNCS) { this.modEAWord = this.modEAWordEnabled; this.setEAWord = this.setEAWordEnabled; }
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
|
|
@ -60,10 +59,9 @@ var X86Op0F = {
|
||||||
opGrp7: function() {
|
opGrp7: function() {
|
||||||
var bModRM = this.getIPByte();
|
var bModRM = this.getIPByte();
|
||||||
if (!(bModRM & 0x10)) {
|
if (!(bModRM & 0x10)) {
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
}
|
}
|
||||||
this.opMods.aOpModGrpWord[bModRM].call(this, X86Op0F.aOpGrp7, X86Grps.opGrpNoSrc);
|
this.opMods.aOpModGrpWord[bModRM].call(this, X86Op0F.aOpGrp7, X86Grps.opGrpNoSrc);
|
||||||
if (EAFUNCS) { this.modEAWord = this.modEAWordEnabled; this.setEAWord = this.setEAWordEnabled; }
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
|
|
@ -200,7 +198,7 @@ var X86Op0F = {
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
opLLDT: function(dst, src) {
|
opLLDT: function(dst, src) {
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
this.segLDT.load(dst);
|
this.segLDT.load(dst);
|
||||||
this.nStepCycles -= (17 + (this.regEA < 0? 0 : 2));
|
this.nStepCycles -= (17 + (this.regEA < 0? 0 : 2));
|
||||||
return dst;
|
return dst;
|
||||||
|
|
@ -212,7 +210,7 @@ var X86Op0F = {
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
opLTR: function(dst, src) {
|
opLTR: function(dst, src) {
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
if (this.segTSS.load(dst) != X86.ADDR_INVALID) {
|
if (this.segTSS.load(dst) != X86.ADDR_INVALID) {
|
||||||
this.setWord(this.segTSS.addrDesc + X86.DESC.ACC.OFFSET, this.segTSS.acc |= X86.DESC.ACC.TYPE.LDT);
|
this.setWord(this.segTSS.addrDesc + X86.DESC.ACC.OFFSET, this.segTSS.acc |= X86.DESC.ACC.TYPE.LDT);
|
||||||
this.segTSS.type = X86.DESC.ACC.TYPE.TSS_BUSY;
|
this.segTSS.type = X86.DESC.ACC.TYPE.TSS_BUSY;
|
||||||
|
|
@ -227,7 +225,7 @@ var X86Op0F = {
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
opVERR: function(dst, src) {
|
opVERR: function(dst, src) {
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
/*
|
/*
|
||||||
* Currently, segVER.load() will return an error only if the selector is beyond the bounds of the
|
* Currently, segVER.load() will return an error only if the selector is beyond the bounds of the
|
||||||
* descriptor table or the descriptor is not for a segment.
|
* descriptor table or the descriptor is not for a segment.
|
||||||
|
|
@ -263,7 +261,7 @@ var X86Op0F = {
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
opVERW: function(dst, src) {
|
opVERW: function(dst, src) {
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
/*
|
/*
|
||||||
* Currently, segVER.load() will return an error only if the selector is beyond the bounds of the
|
* Currently, segVER.load() will return an error only if the selector is beyond the bounds of the
|
||||||
* descriptor table or the descriptor is not for a segment.
|
* descriptor table or the descriptor is not for a segment.
|
||||||
|
|
@ -386,7 +384,7 @@ var X86Op0F = {
|
||||||
} else {
|
} else {
|
||||||
this.addrGDT = this.getWord(this.regEA + 2) | (this.getByte(this.regEA + 4) << 16);
|
this.addrGDT = this.getWord(this.regEA + 2) | (this.getByte(this.regEA + 4) << 16);
|
||||||
this.addrGDTLimit = this.addrGDT + dst;
|
this.addrGDTLimit = this.addrGDT + dst;
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
this.nStepCycles -= 11;
|
this.nStepCycles -= 11;
|
||||||
}
|
}
|
||||||
return dst;
|
return dst;
|
||||||
|
|
@ -409,7 +407,7 @@ var X86Op0F = {
|
||||||
} else {
|
} else {
|
||||||
this.addrIDT = this.getWord(this.regEA + 2) | (this.getByte(this.regEA + 4) << 16);
|
this.addrIDT = this.getWord(this.regEA + 2) | (this.getByte(this.regEA + 4) << 16);
|
||||||
this.addrIDTLimit = this.addrIDT + dst;
|
this.addrIDTLimit = this.addrIDT + dst;
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
this.nStepCycles -= 12;
|
this.nStepCycles -= 12;
|
||||||
}
|
}
|
||||||
return dst;
|
return dst;
|
||||||
|
|
@ -433,7 +431,7 @@ var X86Op0F = {
|
||||||
opLMSW: function(dst, src) {
|
opLMSW: function(dst, src) {
|
||||||
X86Help.opHelpLMSW.call(this, dst);
|
X86Help.opHelpLMSW.call(this, dst);
|
||||||
this.nStepCycles -= (this.regEA < 0? 3 : 6);
|
this.nStepCycles -= (this.regEA < 0? 3 : 6);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOWRITE;
|
this.opFlags |= X86.OPFLAG.NOWRITE;
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -685,7 +685,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opCMPmb: function() {
|
opCMPmb: function() {
|
||||||
this.opMods.aOpModMemByte[this.getIPByte()].call(this, X86Grps.opGrpCMPb);
|
this.opMods.aOpModMemByte[this.getIPByte()].call(this, X86Grps.opGrpCMPb);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x39 (CMP word,reg)
|
* op=0x39 (CMP word,reg)
|
||||||
|
|
@ -694,7 +693,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opCMPmw: function() {
|
opCMPmw: function() {
|
||||||
this.opMods.aOpModMemWord[this.getIPByte()].call(this, X86Grps.opGrpCMPw);
|
this.opMods.aOpModMemWord[this.getIPByte()].call(this, X86Grps.opGrpCMPw);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x3A (CMP reg,byte)
|
* op=0x3A (CMP reg,byte)
|
||||||
|
|
@ -703,7 +701,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opCMPrb: function() {
|
opCMPrb: function() {
|
||||||
this.opMods.aOpModRegByte[this.getIPByte()].call(this, X86Grps.opGrpCMPb);
|
this.opMods.aOpModRegByte[this.getIPByte()].call(this, X86Grps.opGrpCMPb);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x3B (CMP reg,word)
|
* op=0x3B (CMP reg,word)
|
||||||
|
|
@ -712,7 +709,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opCMPrw: function() {
|
opCMPrw: function() {
|
||||||
this.opMods.aOpModRegWord[this.getIPByte()].call(this, X86Grps.opGrpCMPw);
|
this.opMods.aOpModRegWord[this.getIPByte()].call(this, X86Grps.opGrpCMPw);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x3C (CMP AL,imm8)
|
* op=0x3C (CMP AL,imm8)
|
||||||
|
|
@ -721,7 +717,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opCMPALb: function() {
|
opCMPALb: function() {
|
||||||
X86Grps.opGrpCMPb.call(this, this.regEAX & 0xff, this.getIPByte());
|
X86Grps.opGrpCMPb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
/*
|
/*
|
||||||
* In the absence of any EA calculations, opGrpCMPb() will deduct nOpCyclesArithRR, and for all CPUs through
|
* In the absence of any EA calculations, opGrpCMPb() will deduct nOpCyclesArithRR, and for all CPUs through
|
||||||
* the 80286, we need deduct only one more cycle.
|
* the 80286, we need deduct only one more cycle.
|
||||||
|
|
@ -735,7 +730,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opCMPAXw: function() {
|
opCMPAXw: function() {
|
||||||
X86Grps.opGrpCMPw.call(this, this.regEAX & this.opMask, this.getIPWord());
|
X86Grps.opGrpCMPw.call(this, this.regEAX & this.opMask, this.getIPWord());
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
/*
|
/*
|
||||||
* In the absence of any EA calculations, opGrpCMPw() will deduct nOpCyclesArithRR, and for all CPUs through
|
* In the absence of any EA calculations, opGrpCMPw() will deduct nOpCyclesArithRR, and for all CPUs through
|
||||||
* the 80286, we need deduct only one more cycle.
|
* the 80286, we need deduct only one more cycle.
|
||||||
|
|
@ -1749,7 +1743,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opGrp1b: function() {
|
opGrp1b: function() {
|
||||||
this.opMods.aOpModGrpByte[this.getIPByte()].call(this, X86Grps.aOpGrp1b, this.getIPByte);
|
this.opMods.aOpModGrpByte[this.getIPByte()].call(this, X86Grps.aOpGrp1b, this.getIPByte);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? 1 : this.CYCLES.nOpCyclesArithMID);
|
this.nStepCycles -= (this.regEAWrite < 0? 1 : this.CYCLES.nOpCyclesArithMID);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1759,7 +1752,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opGrp1w: function() {
|
opGrp1w: function() {
|
||||||
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrp1w, this.getIPWord);
|
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrp1w, this.getIPWord);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? 1 : this.CYCLES.nOpCyclesArithMID);
|
this.nStepCycles -= (this.regEAWrite < 0? 1 : this.CYCLES.nOpCyclesArithMID);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1769,7 +1761,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opGrp1sw: function() {
|
opGrp1sw: function() {
|
||||||
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrp1w, this.getIPDisp);
|
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrp1w, this.getIPDisp);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
this.nStepCycles -= (this.regEAWrite < 0? 1 : this.CYCLES.nOpCyclesArithMID);
|
this.nStepCycles -= (this.regEAWrite < 0? 1 : this.CYCLES.nOpCyclesArithMID);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -1779,7 +1770,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opTESTrb: function() {
|
opTESTrb: function() {
|
||||||
this.opMods.aOpModMemByte[this.getIPByte()].call(this, X86Help.opHelpTESTb);
|
this.opMods.aOpModMemByte[this.getIPByte()].call(this, X86Help.opHelpTESTb);
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x85 (TEST reg,word)
|
* op=0x85 (TEST reg,word)
|
||||||
|
|
@ -1788,7 +1778,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opTESTrw: function() {
|
opTESTrw: function() {
|
||||||
this.opMods.aOpModMemWord[this.getIPByte()].call(this, X86Help.opHelpTESTw);
|
this.opMods.aOpModMemWord[this.getIPByte()].call(this, X86Help.opHelpTESTw);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x86 (XCHG reg,byte)
|
* op=0x86 (XCHG reg,byte)
|
||||||
|
|
@ -1839,9 +1828,8 @@ var X86OpXX = {
|
||||||
/*
|
/*
|
||||||
* Like other MOV operations, the destination does not need to be read, just written.
|
* Like other MOV operations, the destination does not need to be read, just written.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.modEAByte = this.modEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.opMods.aOpModMemByte[this.getIPByte()].call(this, X86Help.opHelpMOV);
|
this.opMods.aOpModMemByte[this.getIPByte()].call(this, X86Help.opHelpMOV);
|
||||||
if (EAFUNCS) this.modEAByte = this.modEAByteEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x89 (MOV word,reg)
|
* op=0x89 (MOV word,reg)
|
||||||
|
|
@ -1852,9 +1840,8 @@ var X86OpXX = {
|
||||||
/*
|
/*
|
||||||
* Like other MOV operations, the destination does not need to be read, just written.
|
* Like other MOV operations, the destination does not need to be read, just written.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.opMods.aOpModMemWord[this.getIPByte()].call(this, X86Help.opHelpMOV);
|
this.opMods.aOpModMemWord[this.getIPByte()].call(this, X86Help.opHelpMOV);
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x8A (MOV reg,byte)
|
* op=0x8A (MOV reg,byte)
|
||||||
|
|
@ -1904,9 +1891,8 @@ var X86OpXX = {
|
||||||
/*
|
/*
|
||||||
* Like other MOV operations, the destination does not need to be read, just written.
|
* Like other MOV operations, the destination does not need to be read, just written.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.opMods.aOpModMemWord[bModRM].call(this, X86Help.opHelpMOVSegSrc);
|
this.opMods.aOpModMemWord[bModRM].call(this, X86Help.opHelpMOVSegSrc);
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x8D (LEA reg,word)
|
* op=0x8D (LEA reg,word)
|
||||||
|
|
@ -1914,10 +1900,9 @@ var X86OpXX = {
|
||||||
* @this {X86CPU}
|
* @this {X86CPU}
|
||||||
*/
|
*/
|
||||||
opLEA: function() {
|
opLEA: function() {
|
||||||
if (EAFUNCS) this.getEAWord = this.getEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.segData = this.segStack = this.segNULL; // we can't have the EA calculation, if any, "polluted" by segment arithmetic
|
this.segData = this.segStack = this.segNULL; // we can't have the EA calculation, if any, "polluted" by segment arithmetic
|
||||||
this.opMods.aOpModRegWord[this.getIPByte()].call(this, X86Help.opHelpLEA);
|
this.opMods.aOpModRegWord[this.getIPByte()].call(this, X86Help.opHelpLEA);
|
||||||
if (EAFUNCS) this.getEAWord = this.getEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x8E (MOV sr,word)
|
* op=0x8E (MOV sr,word)
|
||||||
|
|
@ -2015,9 +2000,8 @@ var X86OpXX = {
|
||||||
/*
|
/*
|
||||||
* Like other MOV operations, the destination does not need to be read, just written.
|
* Like other MOV operations, the destination does not need to be read, just written.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrpPOPw, this.popWord);
|
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrpPOPw, this.popWord);
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0x90 (NOP, aka XCHG AX,AX)
|
* op=0x90 (NOP, aka XCHG AX,AX)
|
||||||
|
|
@ -2419,7 +2403,6 @@ var X86OpXX = {
|
||||||
this.assert(this.regLIP == this.opLIP);
|
this.assert(this.regLIP == this.opLIP);
|
||||||
this.opFlags |= X86.OPFLAG.REPEAT;
|
this.opFlags |= X86.OPFLAG.REPEAT;
|
||||||
}
|
}
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2468,7 +2451,6 @@ var X86OpXX = {
|
||||||
this.assert(this.regLIP == this.opLIP);
|
this.assert(this.regLIP == this.opLIP);
|
||||||
this.opFlags |= X86.OPFLAG.REPEAT;
|
this.opFlags |= X86.OPFLAG.REPEAT;
|
||||||
}
|
}
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2688,7 +2670,6 @@ var X86OpXX = {
|
||||||
this.assert(this.regLIP == this.opLIP);
|
this.assert(this.regLIP == this.opLIP);
|
||||||
this.opFlags |= X86.OPFLAG.REPEAT;
|
this.opFlags |= X86.OPFLAG.REPEAT;
|
||||||
}
|
}
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2729,7 +2710,6 @@ var X86OpXX = {
|
||||||
this.assert(this.regLIP == this.opLIP);
|
this.assert(this.regLIP == this.opLIP);
|
||||||
this.opFlags |= X86.OPFLAG.REPEAT;
|
this.opFlags |= X86.OPFLAG.REPEAT;
|
||||||
}
|
}
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -2972,9 +2952,8 @@ var X86OpXX = {
|
||||||
/*
|
/*
|
||||||
* Like other MOV operations, the destination does not need to be read, just written.
|
* Like other MOV operations, the destination does not need to be read, just written.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.modEAByte = this.modEAByteDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.opMods.aOpModGrpByte[this.getIPByte()].call(this, X86Grps.aOpGrpMOVImm, this.getIPByte);
|
this.opMods.aOpModGrpByte[this.getIPByte()].call(this, X86Grps.aOpGrpMOVImm, this.getIPByte);
|
||||||
if (EAFUNCS) this.modEAByte = this.modEAByteEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0xC7 (MOV word,imm16)
|
* op=0xC7 (MOV word,imm16)
|
||||||
|
|
@ -2985,9 +2964,8 @@ var X86OpXX = {
|
||||||
/*
|
/*
|
||||||
* Like other MOV operations, the destination does not need to be read, just written.
|
* Like other MOV operations, the destination does not need to be read, just written.
|
||||||
*/
|
*/
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordDisabled; else this.opFlags |= X86.OPFLAG.NOREAD;
|
this.opFlags |= X86.OPFLAG.NOREAD;
|
||||||
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrpMOVImm, this.getIPWord);
|
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrpMOVImm, this.getIPWord);
|
||||||
if (EAFUNCS) this.modEAWord = this.modEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0xC8 (ENTER imm16,imm8) (80186/80188 and up)
|
* op=0xC8 (ENTER imm16,imm8) (80186/80188 and up)
|
||||||
|
|
@ -3520,7 +3498,6 @@ var X86OpXX = {
|
||||||
this.regMD16 = -1;
|
this.regMD16 = -1;
|
||||||
this.opMods.aOpModGrpByte[this.getIPByte()].call(this, X86Grps.aOpGrp3b, X86Grps.opGrpNoSrc);
|
this.opMods.aOpModGrpByte[this.getIPByte()].call(this, X86Grps.aOpGrp3b, X86Grps.opGrpNoSrc);
|
||||||
if (this.regMD16 >= 0) this.regEAX = this.regMD16;
|
if (this.regMD16 >= 0) this.regEAX = this.regMD16;
|
||||||
if (EAFUNCS) this.setEAByte = this.setEAByteEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0xF7 (GRP3 word)
|
* op=0xF7 (GRP3 word)
|
||||||
|
|
@ -3547,7 +3524,6 @@ var X86OpXX = {
|
||||||
this.regEAX = this.regMD16;
|
this.regEAX = this.regMD16;
|
||||||
this.regEDX = this.regMD32;
|
this.regEDX = this.regMD32;
|
||||||
}
|
}
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* op=0xF8 (CLC)
|
* op=0xF8 (CLC)
|
||||||
|
|
@ -3619,7 +3595,6 @@ var X86OpXX = {
|
||||||
*/
|
*/
|
||||||
opGrp4w: function() {
|
opGrp4w: function() {
|
||||||
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrp4w, X86Grps.opGrpNoSrc);
|
this.opMods.aOpModGrpWord[this.getIPByte()].call(this, X86Grps.aOpGrp4w, X86Grps.opGrpNoSrc);
|
||||||
if (EAFUNCS) this.setEAWord = this.setEAWordEnabled;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue