Fixed read/write breakpoint checking, added support for file table rebuilds, and improved BACKTRACK support for MOVSD operations
This commit is contained in:
parent
f1a1fd04b3
commit
712ecb7eaf
4 changed files with 189 additions and 149 deletions
|
|
@ -1554,7 +1554,7 @@ if (DEBUGGER) {
|
|||
* getAddr(dbgAddr, fWrite, nb)
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {DbgAddr} dbgAddr
|
||||
* @param {DbgAddr|null|undefined} dbgAddr
|
||||
* @param {boolean} [fWrite]
|
||||
* @param {number} [nb] is number of bytes to check (1, 2 or 4); default is 1
|
||||
* @return {number} is the corresponding linear address, or X86.ADDR_INVALID
|
||||
|
|
@ -1567,17 +1567,19 @@ if (DEBUGGER) {
|
|||
* whose linear address must always be (re)calculated based on current machine state (mode, active
|
||||
* descriptor tables, etc).
|
||||
*/
|
||||
var addr = dbgAddr.addr;
|
||||
var addr = dbgAddr && dbgAddr.addr;
|
||||
if (addr == null) {
|
||||
addr = X86.ADDR_INVALID;
|
||||
var seg = this.getSegment(dbgAddr.sel, dbgAddr.fProt);
|
||||
if (seg) {
|
||||
if (!fWrite) {
|
||||
addr = seg.checkRead(dbgAddr.off, nb || 1, true);
|
||||
} else {
|
||||
addr = seg.checkWrite(dbgAddr.off, nb || 1, true);
|
||||
if (dbgAddr) {
|
||||
var seg = this.getSegment(dbgAddr.sel, dbgAddr.fProt);
|
||||
if (seg) {
|
||||
if (!fWrite) {
|
||||
addr = seg.checkRead(dbgAddr.off, nb || 1, true);
|
||||
} else {
|
||||
addr = seg.checkWrite(dbgAddr.off, nb || 1, true);
|
||||
}
|
||||
dbgAddr.addr = addr;
|
||||
}
|
||||
dbgAddr.addr = addr;
|
||||
}
|
||||
}
|
||||
return addr;
|
||||
|
|
@ -1930,16 +1932,19 @@ if (DEBUGGER) {
|
|||
{
|
||||
var i = 0, n = aBlocks.length;
|
||||
|
||||
if (sAddr) {
|
||||
var addr = this.getAddr(this.parseAddr(sAddr));
|
||||
if (addr == X86.ADDR_INVALID) {
|
||||
this.println("invalid address: " + sAddr);
|
||||
return;
|
||||
}
|
||||
i = addr >>> this.cpu.nBlockShift;
|
||||
n = 1;
|
||||
}
|
||||
|
||||
this.println("id physaddr blkaddr used size type");
|
||||
this.println("-------- --------- -------- ------ ------ ----");
|
||||
|
||||
if (sAddr) {
|
||||
var addr = this.parseValue(sAddr);
|
||||
if (addr !== undefined) {
|
||||
i = addr >>> this.cpu.nBlockShift;
|
||||
n = 1;
|
||||
}
|
||||
}
|
||||
while (n--) {
|
||||
var block = aBlocks[i];
|
||||
if (block.type === Memory.TYPE.NONE) continue;
|
||||
|
|
@ -3537,8 +3542,6 @@ if (DEBUGGER) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
addrBreak++;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4986,6 +4989,7 @@ if (DEBUGGER) {
|
|||
Debugger.prototype.doDump = function(sCmd, sAddr, sLen, sBytes)
|
||||
{
|
||||
var m;
|
||||
|
||||
if (sAddr == '?') {
|
||||
var sDumpers = "";
|
||||
for (m in Debugger.MESSAGES) {
|
||||
|
|
@ -5008,11 +5012,48 @@ if (DEBUGGER) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (sAddr == "state") {
|
||||
this.println(this.cmp.powerOff(true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (sAddr == "symbols") {
|
||||
this.dumpSymbols();
|
||||
return;
|
||||
}
|
||||
|
||||
if (sCmd == "dos") {
|
||||
/*
|
||||
* The "dos" command is an undocumented command that's useful any time we're inside an internal
|
||||
* DOS dispatch function where the registers are substantially the same as the corresponding INT 0x21;
|
||||
* "m int on; m dos on" produces the same output, but only when an actual INT 0x21 instruction is used.
|
||||
* Issuing this command at any other time should also be OK, but the results will be meaningless.
|
||||
*
|
||||
* NOTE: This is different from the "d dos" command, which invokes dumpDos() to dump DOS memory blocks,
|
||||
* and is handled by one of the registered dumper functions below.
|
||||
*/
|
||||
this.messageInt(Interrupts.DOS.VECTOR, this.cpu.regLIP, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sCmd == "ds") { // transform a "ds" command into a "d desc" command
|
||||
sCmd = 'd';
|
||||
sLen = sAddr;
|
||||
sAddr = "desc";
|
||||
}
|
||||
|
||||
for (m in Debugger.MESSAGES) {
|
||||
if (sAddr == m) {
|
||||
var fnDumper = this.afnDumpers[m];
|
||||
if (fnDumper) {
|
||||
fnDumper(sLen);
|
||||
} else {
|
||||
this.println("no dump registered for " + sAddr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var cb = 0; // 0 is not a default; 0 triggers the appropriate defaults below
|
||||
if (sLen) {
|
||||
if (sLen.charAt(0) == 'l') {
|
||||
|
|
@ -5028,43 +5069,10 @@ if (DEBUGGER) {
|
|||
this.sCmdDumpPrev = sCmd;
|
||||
}
|
||||
|
||||
if (sAddr == "state") {
|
||||
this.println(this.cmp.powerOff(true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (sCmd == "dh") {
|
||||
this.dumpHistory(sAddr, cb);
|
||||
return;
|
||||
}
|
||||
if (sCmd == "dos") {
|
||||
/*
|
||||
* The "dos" command is an undocumented command that's useful any time we're inside an internal
|
||||
* DOS dispatch function where the registers are substantially the same as the corresponding INT 0x21;
|
||||
* "m int on; m dos on" produces the same output, but only when an actual INT 0x21 instruction is used.
|
||||
* Issuing this command at any other time should also be OK, but the results will be meaningless.
|
||||
*/
|
||||
this.messageInt(Interrupts.DOS.VECTOR, this.cpu.regLIP, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sCmd == "ds") { // transform a "ds" command into a "d desc" command
|
||||
sCmd = 'd';
|
||||
sLen = sAddr;
|
||||
sAddr = "desc";
|
||||
}
|
||||
|
||||
for (m in Debugger.MESSAGES) {
|
||||
if (sAddr == m) {
|
||||
var fnDumper = this.afnDumpers[m];
|
||||
if (fnDumper) {
|
||||
fnDumper(sLen);
|
||||
} else {
|
||||
this.println("no dump registered for " + sAddr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var dbgAddr = this.parseAddr(sAddr, Debugger.ADDR_DATA);
|
||||
if (!dbgAddr) return;
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ if (typeof module !== 'undefined') {
|
|||
*/
|
||||
function Disk(controller, drive, mode)
|
||||
{
|
||||
Component.call(this, "Disk", {'id': controller.idMachine + ".disk" + (++Disk.nDisks)}, Disk, Messages.DISK);
|
||||
Component.call(this, "Disk", {'id': controller.idMachine + ".disk" + str.toHex(++Disk.nDisks, 4)}, Disk, Messages.DISK);
|
||||
|
||||
/*
|
||||
* Route all non-Debugger messages (eg, notice() and println() calls) through
|
||||
|
|
@ -678,7 +678,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
|
|||
this.printMessage('doneLoad("' + sDiskFile + '","' + sDiskPath + '")');
|
||||
}
|
||||
this.fRemote = true;
|
||||
this.buildFileTable();
|
||||
if (BACKTRACK) this.buildFileTable();
|
||||
disk = this;
|
||||
} else {
|
||||
this.controller.notice('Unable to connect to disk "' + sDiskPath + '" (error ' + nErrorCode + ': ' + sDiskData + ')', fPrintOnly);
|
||||
|
|
@ -868,7 +868,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
|
|||
}
|
||||
this.aDiskData = aDiskData;
|
||||
this.dwChecksum = dwChecksum;
|
||||
this.buildFileTable();
|
||||
if (BACKTRACK) this.buildFileTable();
|
||||
disk = this;
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
@ -901,8 +901,28 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
|
|||
Disk.prototype.buildFileTable = function()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
|
||||
var i, off, dir = {};
|
||||
|
||||
if (this.aFileTable) {
|
||||
/*
|
||||
* In order for buildFileTable() to rebuild an existing table (eg, after deltas have been
|
||||
* applied), we need to zap any and all existing file table references in the sector data.
|
||||
*/
|
||||
var aDiskData = this.aDiskData;
|
||||
for (var iCylinder = 0; iCylinder < aDiskData.length; iCylinder++) {
|
||||
for (var iHead = 0; iHead < aDiskData[iCylinder].length; iHead++) {
|
||||
for (var iSector = 0; iSector < aDiskData[iCylinder][iHead].length; iSector++) {
|
||||
var sector = aDiskData[iCylinder][iHead][iSector];
|
||||
if (sector) {
|
||||
delete sector['file'];
|
||||
delete sector.offFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.aFileTable = [];
|
||||
|
||||
dir.pbaVolume = dir.lbaTotal = 0;
|
||||
|
|
@ -2096,6 +2116,10 @@ Disk.prototype.restore = function(deltas)
|
|||
if (DEBUG && this.messageEnabled()) {
|
||||
this.printMessage('restore("' + this.sDiskName + '"): restored ' + nChanges + ' change(s)');
|
||||
}
|
||||
/*
|
||||
* Last but not least, rebuild the disk's file table if BACKTRACK support is enabled.
|
||||
*/
|
||||
if (BACKTRACK) this.buildFileTable();
|
||||
}
|
||||
return nChanges;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1369,8 +1369,10 @@ X86CPU.prototype.resetRegs = function()
|
|||
btiSIHi: 0,
|
||||
btiDILo: 0,
|
||||
btiDIHi: 0,
|
||||
btiMemLo: 0,
|
||||
btiMemHi: 0,
|
||||
btiMem0: 0,
|
||||
btiMem1: 0,
|
||||
btiMem2: 0,
|
||||
btiMem3: 0,
|
||||
btiEALo: 0,
|
||||
btiEAHi: 0,
|
||||
btiIO: 0
|
||||
|
|
@ -3128,7 +3130,7 @@ X86CPU.prototype.probeAddr = function(addr)
|
|||
*/
|
||||
X86CPU.prototype.getByte = function getByte(addr)
|
||||
{
|
||||
if (BACKTRACK) this.backTrack.btiMemLo = this.bus.readBackTrack(addr);
|
||||
if (BACKTRACK) this.backTrack.btiMem0 = this.bus.readBackTrack(addr);
|
||||
return this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr);
|
||||
};
|
||||
|
||||
|
|
@ -3153,8 +3155,8 @@ X86CPU.prototype.getShort = function getShort(addr)
|
|||
this.nStepCycles -= this.cycleCounts.nWordCyclePenalty;
|
||||
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.bus.readBackTrack(addr);
|
||||
this.backTrack.btiMemHi = this.bus.readBackTrack(addr + 1);
|
||||
this.backTrack.btiMem0 = this.bus.readBackTrack(addr);
|
||||
this.backTrack.btiMem1 = this.bus.readBackTrack(addr + 1);
|
||||
}
|
||||
if (off < this.nBlockLimit) {
|
||||
return this.aMemBlocks[iBlock].readShort(off, addr);
|
||||
|
|
@ -3177,8 +3179,10 @@ X86CPU.prototype.getLong = function getLong(addr)
|
|||
var off = addr & this.nBlockLimit;
|
||||
var iBlock = (addr & this.nMemMask) >>> this.nBlockShift;
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.bus.readBackTrack(addr);
|
||||
this.backTrack.btiMemHi = this.bus.readBackTrack(addr + 1);
|
||||
this.backTrack.btiMem0 = this.bus.readBackTrack(addr);
|
||||
this.backTrack.btiMem1 = this.bus.readBackTrack(addr + 1);
|
||||
this.backTrack.btiMem2 = this.bus.readBackTrack(addr + 2);
|
||||
this.backTrack.btiMem3 = this.bus.readBackTrack(addr + 3);
|
||||
}
|
||||
if (off < this.nBlockLimit - 2) {
|
||||
return this.aMemBlocks[iBlock].readLong(off, addr);
|
||||
|
|
@ -3199,7 +3203,7 @@ X86CPU.prototype.getLong = function getLong(addr)
|
|||
*/
|
||||
X86CPU.prototype.setByte = function setByte(addr, b)
|
||||
{
|
||||
if (BACKTRACK) this.bus.writeBackTrack(addr, this.backTrack.btiMemLo);
|
||||
if (BACKTRACK) this.bus.writeBackTrack(addr, this.backTrack.btiMem0);
|
||||
this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr);
|
||||
};
|
||||
|
||||
|
|
@ -3224,8 +3228,8 @@ X86CPU.prototype.setShort = function setShort(addr, w)
|
|||
this.nStepCycles -= this.cycleCounts.nWordCyclePenalty;
|
||||
|
||||
if (BACKTRACK) {
|
||||
this.bus.writeBackTrack(addr, this.backTrack.btiMemLo);
|
||||
this.bus.writeBackTrack(addr + 1, this.backTrack.btiMemHi);
|
||||
this.bus.writeBackTrack(addr, this.backTrack.btiMem0);
|
||||
this.bus.writeBackTrack(addr + 1, this.backTrack.btiMem1);
|
||||
}
|
||||
if (off < this.nBlockLimit) {
|
||||
this.aMemBlocks[iBlock].writeShort(off, w & 0xffff, addr);
|
||||
|
|
@ -3252,8 +3256,10 @@ X86CPU.prototype.setLong = function setLong(addr, l)
|
|||
this.nStepCycles -= this.cycleCounts.nWordCyclePenalty;
|
||||
|
||||
if (BACKTRACK) {
|
||||
this.bus.writeBackTrack(addr, this.backTrack.btiMemLo);
|
||||
this.bus.writeBackTrack(addr + 1, this.backTrack.btiMemHi);
|
||||
this.bus.writeBackTrack(addr, this.backTrack.btiMem0);
|
||||
this.bus.writeBackTrack(addr + 1, this.backTrack.btiMem1);
|
||||
this.bus.writeBackTrack(addr + 2, this.backTrack.btiMem2);
|
||||
this.bus.writeBackTrack(addr + 3, this.backTrack.btiMem3);
|
||||
}
|
||||
if (off < this.nBlockLimit - 2) {
|
||||
this.aMemBlocks[iBlock].writeLong(off, l, addr);
|
||||
|
|
@ -3283,7 +3289,7 @@ X86CPU.prototype.getEAByte = function(seg, off)
|
|||
this.regEA = seg.checkRead(this.offEA = off, 1);
|
||||
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||
var b = this.getByte(this.regEA);
|
||||
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMem0;
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3326,8 +3332,8 @@ X86CPU.prototype.getEAWord = function(seg, off)
|
|||
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||
var w = this.getWord(this.regEA);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||
this.backTrack.btiEAHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiEALo = this.backTrack.btiMem0;
|
||||
this.backTrack.btiEAHi = this.backTrack.btiMem1;
|
||||
}
|
||||
return w;
|
||||
};
|
||||
|
|
@ -3370,7 +3376,7 @@ X86CPU.prototype.modEAByte = function(seg, off)
|
|||
this.regEAWrite = this.regEA = seg.checkRead(this.offEA = off, 1);
|
||||
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||
var b = this.getByte(this.regEA);
|
||||
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiEALo = this.backTrack.btiMem0;
|
||||
return b;
|
||||
};
|
||||
|
||||
|
|
@ -3413,8 +3419,8 @@ X86CPU.prototype.modEAWord = function(seg, off)
|
|||
if (this.opFlags & X86.OPFLAG.NOREAD) return 0;
|
||||
var w = this.getWord(this.regEA);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiEALo = this.backTrack.btiMemLo;
|
||||
this.backTrack.btiEAHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiEALo = this.backTrack.btiMem0;
|
||||
this.backTrack.btiEAHi = this.backTrack.btiMem1;
|
||||
}
|
||||
return w;
|
||||
};
|
||||
|
|
@ -3452,7 +3458,7 @@ X86CPU.prototype.modEAWordStack = function(off)
|
|||
X86CPU.prototype.setEAByte = function(b)
|
||||
{
|
||||
if (this.opFlags & X86.OPFLAG.NOWRITE) return;
|
||||
if (BACKTRACK) this.backTrack.btiMemLo = this.backTrack.btiEALo;
|
||||
if (BACKTRACK) this.backTrack.btiMem0 = this.backTrack.btiEALo;
|
||||
this.setByte(this.segEA.checkWrite(this.offEA, 1), b);
|
||||
};
|
||||
|
||||
|
|
@ -3466,8 +3472,8 @@ X86CPU.prototype.setEAWord = function(w)
|
|||
{
|
||||
if (this.opFlags & X86.OPFLAG.NOWRITE) return;
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiEALo;
|
||||
this.backTrack.btiMemHi = this.backTrack.btiEAHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiEALo;
|
||||
this.backTrack.btiMem1 = this.backTrack.btiEAHi;
|
||||
}
|
||||
if (!I386) {
|
||||
this.setShort(this.segEA.checkWrite(this.offEA, 2), w);
|
||||
|
|
@ -3710,7 +3716,7 @@ X86CPU.prototype.advancePrefetch = function(inc)
|
|||
X86CPU.prototype.getIPByte = function()
|
||||
{
|
||||
var b = (PREFETCH? this.getBytePrefetch(this.regLIP) : this.getByte(this.regLIP));
|
||||
if (BACKTRACK) this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
if (BACKTRACK) this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.advanceIP(1);
|
||||
return b;
|
||||
};
|
||||
|
|
@ -3725,8 +3731,8 @@ X86CPU.prototype.getIPShort = function()
|
|||
{
|
||||
var w = (PREFETCH? this.getShortPrefetch(this.regLIP) : this.getShort(this.regLIP));
|
||||
if (BACKTRACK) {
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMemHi);
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMem1);
|
||||
}
|
||||
this.advanceIP(2);
|
||||
return w;
|
||||
|
|
@ -3742,8 +3748,10 @@ X86CPU.prototype.getIPLong = function()
|
|||
{
|
||||
var l = (PREFETCH? this.getLongPrefetch(this.regLIP) : this.getLong(this.regLIP));
|
||||
if (BACKTRACK) {
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMemHi);
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMem1);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 2, this.backTrack.btiMem2);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 3, this.backTrack.btiMem3);
|
||||
}
|
||||
this.advanceIP(4);
|
||||
return l;
|
||||
|
|
@ -3762,8 +3770,8 @@ X86CPU.prototype.getIPAddr = function()
|
|||
*/
|
||||
var w = this.getAddr(this.regLIP);
|
||||
if (BACKTRACK) {
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMemHi);
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMem1);
|
||||
}
|
||||
this.advanceIP(this.addrSize);
|
||||
return w;
|
||||
|
|
@ -3779,8 +3787,8 @@ X86CPU.prototype.getIPWord = function()
|
|||
{
|
||||
var w = (PREFETCH? this.getWordPrefetch(this.regLIP) : this.getWord(this.regLIP));
|
||||
if (BACKTRACK) {
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMemHi);
|
||||
this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.bus.updateBackTrackCode(this.regLIP + 1, this.backTrack.btiMem1);
|
||||
}
|
||||
this.advanceIP(this.dataSize);
|
||||
return w;
|
||||
|
|
@ -3795,7 +3803,7 @@ X86CPU.prototype.getIPWord = function()
|
|||
X86CPU.prototype.getIPDisp = function()
|
||||
{
|
||||
var w = ((PREFETCH? this.getBytePrefetch(this.regLIP) : this.getByte(this.regLIP)) << 24) >> 24;
|
||||
if (BACKTRACK) this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
if (BACKTRACK) this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.advanceIP(1);
|
||||
return w;
|
||||
};
|
||||
|
|
@ -3810,7 +3818,7 @@ X86CPU.prototype.getIPDisp = function()
|
|||
X86CPU.prototype.getSIBAddr = function(mod)
|
||||
{
|
||||
var b = PREFETCH? this.getBytePrefetch(this.regLIP) : this.getByte(this.regLIP);
|
||||
if (BACKTRACK) this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMemLo);
|
||||
if (BACKTRACK) this.bus.updateBackTrackCode(this.regLIP, this.backTrack.btiMem0);
|
||||
this.advanceIP(1);
|
||||
return X86ModSIB.aOpModSIB[b].call(this, mod);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ X86.opADDALb = function ADDALb()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnADDb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
/*
|
||||
* NOTE: Whenever the result is "blended" value (eg, of btiAL and btiMemLo), a new bti should be
|
||||
* NOTE: Whenever the result is "blended" value (eg, of btiAL and btiMem0), a new bti should be
|
||||
* allocated to reflect that fact; however, I'm leaving "perfect" BACKTRACK support for another day.
|
||||
*/
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ X86.opADDAX = function ADDAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnADDw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -189,7 +189,7 @@ X86.opORrw = function ORrw()
|
|||
X86.opORALb = function ORALb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnORb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ X86.opORAX = function ORAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnORw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -287,7 +287,7 @@ X86.opADCrw = function ADCrw()
|
|||
X86.opADCALb = function ADCALb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnADCb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ X86.opADCAX = function ADCAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnADCw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -375,7 +375,7 @@ X86.opSBBrw = function SBBrw()
|
|||
X86.opSBBALb = function SBBALb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnSBBb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ X86.opSBBAX = function SBBAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnSBBw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -463,7 +463,7 @@ X86.opANDrw = function ANDrw()
|
|||
X86.opANDAL = function ANDAL()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnANDb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -476,7 +476,7 @@ X86.opANDAX = function ANDAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnANDw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -571,7 +571,7 @@ X86.opSUBrw = function SUBrw()
|
|||
X86.opSUBALb = function SUBALb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnSUBb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ X86.opSUBAX = function SUBAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnSUBw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -679,7 +679,7 @@ X86.opXORrw = function XORrw()
|
|||
X86.opXORALb = function XORALb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | X86.fnXORb.call(this, this.regEAX & 0xff, this.getIPByte());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
||||
|
|
@ -692,7 +692,7 @@ X86.opXORAX = function XORAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | X86.fnXORw.call(this, this.regEAX & this.dataMask, this.getIPWord());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles--; // in the absence of any EA calculations, we need deduct only one more cycle
|
||||
};
|
||||
|
|
@ -1005,7 +1005,7 @@ X86.opDECDI = function DECDI()
|
|||
X86.opPUSHAX = function PUSHAX()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiAL; this.backTrack.btiMemHi = this.backTrack.btiAH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiAL; this.backTrack.btiMem1 = this.backTrack.btiAH;
|
||||
}
|
||||
this.pushWord(this.regEAX & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1019,7 +1019,7 @@ X86.opPUSHAX = function PUSHAX()
|
|||
X86.opPUSHCX = function PUSHCX()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiCL; this.backTrack.btiMemHi = this.backTrack.btiCH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiCL; this.backTrack.btiMem1 = this.backTrack.btiCH;
|
||||
}
|
||||
this.pushWord(this.regECX & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1033,7 +1033,7 @@ X86.opPUSHCX = function PUSHCX()
|
|||
X86.opPUSHDX = function PUSHDX()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiDL; this.backTrack.btiMemHi = this.backTrack.btiDH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiDL; this.backTrack.btiMem1 = this.backTrack.btiDH;
|
||||
}
|
||||
this.pushWord(this.regEDX & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1047,7 +1047,7 @@ X86.opPUSHDX = function PUSHDX()
|
|||
X86.opPUSHBX = function PUSHBX()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiBL; this.backTrack.btiMemHi = this.backTrack.btiBH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiBL; this.backTrack.btiMem1 = this.backTrack.btiBH;
|
||||
}
|
||||
this.pushWord(this.regEBX & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1084,7 +1084,7 @@ X86.opPUSHSP = function PUSHSP()
|
|||
X86.opPUSHBP = function PUSHBP()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiBPLo; this.backTrack.btiMemHi = this.backTrack.btiBPHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiBPLo; this.backTrack.btiMem1 = this.backTrack.btiBPHi;
|
||||
}
|
||||
this.pushWord(this.regEBP & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1098,7 +1098,7 @@ X86.opPUSHBP = function PUSHBP()
|
|||
X86.opPUSHSI = function PUSHSI()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiSILo; this.backTrack.btiMemHi = this.backTrack.btiSIHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiSILo; this.backTrack.btiMem1 = this.backTrack.btiSIHi;
|
||||
}
|
||||
this.pushWord(this.regESI & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1112,7 +1112,7 @@ X86.opPUSHSI = function PUSHSI()
|
|||
X86.opPUSHDI = function PUSHDI()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiDILo; this.backTrack.btiMemHi = this.backTrack.btiDIHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiDILo; this.backTrack.btiMem1 = this.backTrack.btiDIHi;
|
||||
}
|
||||
this.pushWord(this.regEDI & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
|
|
@ -1127,7 +1127,7 @@ X86.opPOPAX = function POPAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1141,7 +1141,7 @@ X86.opPOPCX = function POPCX()
|
|||
{
|
||||
this.regECX = (this.regECX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiCL = this.backTrack.btiMemLo; this.backTrack.btiCH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiCL = this.backTrack.btiMem0; this.backTrack.btiCH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1155,7 +1155,7 @@ X86.opPOPDX = function POPDX()
|
|||
{
|
||||
this.regEDX = (this.regEDX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiDL = this.backTrack.btiMemLo; this.backTrack.btiDH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiDL = this.backTrack.btiMem0; this.backTrack.btiDH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1169,7 +1169,7 @@ X86.opPOPBX = function POPBX()
|
|||
{
|
||||
this.regEBX = (this.regEBX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiBL = this.backTrack.btiMemLo; this.backTrack.btiBH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiBL = this.backTrack.btiMem0; this.backTrack.btiBH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1194,7 +1194,7 @@ X86.opPOPBP = function POPBP()
|
|||
{
|
||||
this.regEBP = (this.regEBP & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiBPLo = this.backTrack.btiMemLo; this.backTrack.btiBPHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiBPLo = this.backTrack.btiMem0; this.backTrack.btiBPHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1208,7 +1208,7 @@ X86.opPOPSI = function POPSI()
|
|||
{
|
||||
this.regESI = (this.regESI & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiSILo = this.backTrack.btiMemLo; this.backTrack.btiSIHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiSILo = this.backTrack.btiMem0; this.backTrack.btiSIHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1222,7 +1222,7 @@ X86.opPOPDI = function POPDI()
|
|||
{
|
||||
this.regEDI = (this.regEDI & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiDILo = this.backTrack.btiMemLo; this.backTrack.btiDIHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiDILo = this.backTrack.btiMem0; this.backTrack.btiDIHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopReg;
|
||||
};
|
||||
|
|
@ -1239,32 +1239,32 @@ X86.opPUSHA = function PUSHA()
|
|||
*/
|
||||
var temp = this.getSP() & this.dataMask;
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiAL; this.backTrack.btiMemHi = this.backTrack.btiAH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiAL; this.backTrack.btiMem1 = this.backTrack.btiAH;
|
||||
}
|
||||
this.pushWord(this.regEAX & this.dataMask);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiCL; this.backTrack.btiMemHi = this.backTrack.btiCH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiCL; this.backTrack.btiMem1 = this.backTrack.btiCH;
|
||||
}
|
||||
this.pushWord(this.regECX & this.dataMask);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiDL; this.backTrack.btiMemHi = this.backTrack.btiDH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiDL; this.backTrack.btiMem1 = this.backTrack.btiDH;
|
||||
}
|
||||
this.pushWord(this.regEDX & this.dataMask);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiBL; this.backTrack.btiMemHi = this.backTrack.btiBH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiBL; this.backTrack.btiMem1 = this.backTrack.btiBH;
|
||||
}
|
||||
this.pushWord(this.regEBX & this.dataMask);
|
||||
this.pushWord(temp);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiBPLo; this.backTrack.btiMemHi = this.backTrack.btiBPHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiBPLo; this.backTrack.btiMem1 = this.backTrack.btiBPHi;
|
||||
}
|
||||
this.pushWord(this.regEBP & this.dataMask);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiSILo; this.backTrack.btiMemHi = this.backTrack.btiSIHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiSILo; this.backTrack.btiMem1 = this.backTrack.btiSIHi;
|
||||
}
|
||||
this.pushWord(this.regESI & this.dataMask);
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiDILo; this.backTrack.btiMemHi = this.backTrack.btiDIHi;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiDILo; this.backTrack.btiMem1 = this.backTrack.btiDIHi;
|
||||
}
|
||||
this.pushWord(this.regEDI & this.dataMask);
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushAll;
|
||||
|
|
@ -1279,15 +1279,15 @@ X86.opPOPA = function POPA()
|
|||
{
|
||||
this.regEDI = (this.regEDI & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiDILo = this.backTrack.btiMemLo; this.backTrack.btiDIHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiDILo = this.backTrack.btiMem0; this.backTrack.btiDIHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.regESI = (this.regESI & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiSILo = this.backTrack.btiMemLo; this.backTrack.btiSIHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiSILo = this.backTrack.btiMem0; this.backTrack.btiSIHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.regEBP = (this.regEBP & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiBPLo = this.backTrack.btiMemLo; this.backTrack.btiBPHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiBPLo = this.backTrack.btiMem0; this.backTrack.btiBPHi = this.backTrack.btiMem1;
|
||||
}
|
||||
/*
|
||||
* TODO: regLSP needs to be pre-bounds-checked against regLSPLimit at the start
|
||||
|
|
@ -1296,19 +1296,19 @@ X86.opPOPA = function POPA()
|
|||
// this.regLSP += (I386? this.dataSize : 2);
|
||||
this.regEBX = (this.regEBX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiBL = this.backTrack.btiMemLo; this.backTrack.btiBH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiBL = this.backTrack.btiMem0; this.backTrack.btiBH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.regEDX = (this.regEDX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiDL = this.backTrack.btiMemLo; this.backTrack.btiDH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiDL = this.backTrack.btiMem0; this.backTrack.btiDH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.regECX = (this.regECX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiCL = this.backTrack.btiMemLo; this.backTrack.btiCH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiCL = this.backTrack.btiMem0; this.backTrack.btiCH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | this.popWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPopAll;
|
||||
};
|
||||
|
|
@ -1458,7 +1458,7 @@ X86.opIMULn = function IMULn()
|
|||
*/
|
||||
X86.opPUSH8 = function PUSH8()
|
||||
{
|
||||
if (BACKTRACK) this.backTrack.btiMemHi = 0;
|
||||
if (BACKTRACK) this.backTrack.btiMem1 = 0;
|
||||
this.pushWord(this.getIPDisp());
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPushReg;
|
||||
};
|
||||
|
|
@ -1507,7 +1507,7 @@ X86.opINSb = function INSb()
|
|||
var b = this.bus.checkPortInputNotify(port, this.regLIP - nDelta - 1);
|
||||
this.setSOByte(this.segES, this.regEDI & this.addrMask, b);
|
||||
if (this.opFlags & X86.OPFLAG.FAULT) return;
|
||||
if (BACKTRACK) this.backTrack.btiMemLo = this.backTrack.btiIO;
|
||||
if (BACKTRACK) this.backTrack.btiMem0 = this.backTrack.btiIO;
|
||||
this.regEDI = (this.regEDI & ~this.addrMask) | ((this.regEDI + ((this.regPS & X86.PS.DF)? -1 : 1)) & this.addrMask);
|
||||
this.regECX = (this.regECX & ~this.addrMask) | ((this.regECX - nDelta) & this.addrMask);
|
||||
this.nStepCycles -= nCycles;
|
||||
|
|
@ -1560,9 +1560,9 @@ X86.opINSw = function INSw()
|
|||
shift += 8;
|
||||
if (BACKTRACK) {
|
||||
if (!n) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiIO;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiIO;
|
||||
} else if (n == 1) {
|
||||
this.backTrack.btiMemHi = this.backTrack.btiIO;
|
||||
this.backTrack.btiMem1 = this.backTrack.btiIO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1614,7 +1614,7 @@ X86.opOUTSb = function OUTSb()
|
|||
if (!this.checkIOPM(port, 1)) return;
|
||||
var b = this.getSOByte(this.segDS, this.regESI & this.addrMask);
|
||||
if (this.opFlags & X86.OPFLAG.FAULT) return;
|
||||
if (BACKTRACK) this.backTrack.btiIO = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiIO = this.backTrack.btiMem0;
|
||||
this.bus.checkPortOutputNotify(port, b, this.regLIP - nDelta - 1);
|
||||
this.regESI = (this.regESI & ~this.addrMask) | ((this.regESI + ((this.regPS & X86.PS.DF)? -1 : 1)) & this.addrMask);
|
||||
this.regECX = (this.regECX & ~this.addrMask) | ((this.regECX - nDelta) & this.addrMask);
|
||||
|
|
@ -1666,9 +1666,9 @@ X86.opOUTSw = function OUTSw()
|
|||
for (var n = 0; n < this.dataSize; n++) {
|
||||
if (BACKTRACK) {
|
||||
if (!n) {
|
||||
this.backTrack.btiIO = this.backTrack.btiMemLo;
|
||||
this.backTrack.btiIO = this.backTrack.btiMem0;
|
||||
} else if (n == 1) {
|
||||
this.backTrack.btiIO = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiIO = this.backTrack.btiMem1;
|
||||
}
|
||||
}
|
||||
this.bus.checkPortOutputNotify(port, (w >> shift) & 0xff, addrFrom);
|
||||
|
|
@ -2554,7 +2554,7 @@ X86.opLAHF = function LAHF()
|
|||
X86.opMOVALm = function MOVALm()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | this.getSOByte(this.segData, this.getIPAddr());
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesMovAM;
|
||||
};
|
||||
|
||||
|
|
@ -2567,7 +2567,7 @@ X86.opMOVAXm = function MOVAXm()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | this.getSOWord(this.segData, this.getIPAddr());
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesMovAM;
|
||||
};
|
||||
|
|
@ -2579,7 +2579,7 @@ X86.opMOVAXm = function MOVAXm()
|
|||
*/
|
||||
X86.opMOVmAL = function MOVmAL()
|
||||
{
|
||||
if (BACKTRACK) this.backTrack.btiMemLo = this.backTrack.btiAL;
|
||||
if (BACKTRACK) this.backTrack.btiMem0 = this.backTrack.btiAL;
|
||||
/*
|
||||
* setSOByte() truncates the value as appropriate
|
||||
*/
|
||||
|
|
@ -2595,7 +2595,7 @@ X86.opMOVmAL = function MOVmAL()
|
|||
X86.opMOVmAX = function MOVmAX()
|
||||
{
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiAL; this.backTrack.btiMemHi = this.backTrack.btiAH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiAL; this.backTrack.btiMem1 = this.backTrack.btiAH;
|
||||
}
|
||||
/*
|
||||
* setSOWord() truncates the value as appropriate
|
||||
|
|
@ -2811,7 +2811,7 @@ X86.opSTOSb = function STOSb()
|
|||
if (nReps--) {
|
||||
this.setSOByte(this.segES, this.regEDI & this.addrMask, this.regEAX);
|
||||
if (this.opFlags & X86.OPFLAG.FAULT) return;
|
||||
if (BACKTRACK) this.backTrack.btiMemLo = this.backTrack.btiAL;
|
||||
if (BACKTRACK) this.backTrack.btiMem0 = this.backTrack.btiAL;
|
||||
this.regEDI = (this.regEDI & ~this.addrMask) | ((this.regEDI + ((this.regPS & X86.PS.DF)? -1 : 1)) & this.addrMask);
|
||||
this.regECX = (this.regECX & ~this.addrMask) | ((this.regECX - nDelta) & this.addrMask);
|
||||
this.nStepCycles -= nCycles;
|
||||
|
|
@ -2849,7 +2849,7 @@ X86.opSTOSw = function STOSw()
|
|||
this.setSOWord(this.segES, this.regEDI & this.addrMask, this.regEAX);
|
||||
if (this.opFlags & X86.OPFLAG.FAULT) return;
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiMemLo = this.backTrack.btiAL; this.backTrack.btiMemHi = this.backTrack.btiAH;
|
||||
this.backTrack.btiMem0 = this.backTrack.btiAL; this.backTrack.btiMem1 = this.backTrack.btiAH;
|
||||
}
|
||||
this.regEDI = (this.regEDI & ~this.addrMask) | ((this.regEDI + ((this.regPS & X86.PS.DF)? -this.dataSize : this.dataSize)) & this.addrMask);
|
||||
this.regECX = (this.regECX & ~this.addrMask) | ((this.regECX - nDelta) & this.addrMask);
|
||||
|
|
@ -2886,7 +2886,7 @@ X86.opLODSb = function LODSb()
|
|||
var b = this.getSOByte(this.segData, this.regESI & this.addrMask);
|
||||
if (this.opFlags & X86.OPFLAG.FAULT) return;
|
||||
this.regEAX = (this.regEAX & ~0xff) | b;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.regESI = (this.regESI & ~this.addrMask) | ((this.regESI + ((this.regPS & X86.PS.DF)? -1 : 1)) & this.addrMask);
|
||||
this.regECX = (this.regECX & ~this.addrMask) | ((this.regECX - nDelta) & this.addrMask);
|
||||
this.nStepCycles -= nCycles;
|
||||
|
|
@ -2923,7 +2923,7 @@ X86.opLODSw = function LODSw()
|
|||
if (this.opFlags & X86.OPFLAG.FAULT) return;
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | w;
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.regESI = (this.regESI & ~this.addrMask) | ((this.regESI + ((this.regPS & X86.PS.DF)? -this.dataSize : this.dataSize)) & this.addrMask);
|
||||
this.regECX = (this.regECX & ~this.addrMask) | ((this.regECX - nDelta) & this.addrMask);
|
||||
|
|
@ -3032,7 +3032,7 @@ X86.opSCASw = function SCASw()
|
|||
X86.opMOVALb = function MOVALb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & ~0xff) | this.getIPByte();
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAL = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3044,7 +3044,7 @@ X86.opMOVALb = function MOVALb()
|
|||
X86.opMOVCLb = function MOVCLb()
|
||||
{
|
||||
this.regECX = (this.regECX & ~0xff) | this.getIPByte();
|
||||
if (BACKTRACK) this.backTrack.btiCL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiCL = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3056,7 +3056,7 @@ X86.opMOVCLb = function MOVCLb()
|
|||
X86.opMOVDLb = function MOVDLb()
|
||||
{
|
||||
this.regEDX = (this.regEDX & ~0xff) | this.getIPByte();
|
||||
if (BACKTRACK) this.backTrack.btiDL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiDL = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3068,7 +3068,7 @@ X86.opMOVDLb = function MOVDLb()
|
|||
X86.opMOVBLb = function MOVBLb()
|
||||
{
|
||||
this.regEBX = (this.regEBX & ~0xff) | this.getIPByte();
|
||||
if (BACKTRACK) this.backTrack.btiBL = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiBL = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3080,7 +3080,7 @@ X86.opMOVBLb = function MOVBLb()
|
|||
X86.opMOVAHb = function MOVAHb()
|
||||
{
|
||||
this.regEAX = (this.regEAX & 0xff) | (this.getIPByte() << 8);
|
||||
if (BACKTRACK) this.backTrack.btiAH = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiAH = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3092,7 +3092,7 @@ X86.opMOVAHb = function MOVAHb()
|
|||
X86.opMOVCHb = function MOVCHb()
|
||||
{
|
||||
this.regECX = (this.regECX & 0xff) | (this.getIPByte() << 8);
|
||||
if (BACKTRACK) this.backTrack.btiCH = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiCH = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3104,7 +3104,7 @@ X86.opMOVCHb = function MOVCHb()
|
|||
X86.opMOVDHb = function MOVDHb()
|
||||
{
|
||||
this.regEDX = (this.regEDX & 0xff) | (this.getIPByte() << 8);
|
||||
if (BACKTRACK) this.backTrack.btiDH = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiDH = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3116,7 +3116,7 @@ X86.opMOVDHb = function MOVDHb()
|
|||
X86.opMOVBHb = function MOVBHb()
|
||||
{
|
||||
this.regEBX = (this.regEBX & 0xff) | (this.getIPByte() << 8);
|
||||
if (BACKTRACK) this.backTrack.btiBH = this.backTrack.btiMemLo;
|
||||
if (BACKTRACK) this.backTrack.btiBH = this.backTrack.btiMem0;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
||||
|
|
@ -3129,7 +3129,7 @@ X86.opMOVAX = function MOVAX()
|
|||
{
|
||||
this.regEAX = (this.regEAX & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiAL = this.backTrack.btiMemLo; this.backTrack.btiAH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiAL = this.backTrack.btiMem0; this.backTrack.btiAH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
@ -3143,7 +3143,7 @@ X86.opMOVCX = function MOVCX()
|
|||
{
|
||||
this.regECX = (this.regECX & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiCL = this.backTrack.btiMemLo; this.backTrack.btiCH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiCL = this.backTrack.btiMem0; this.backTrack.btiCH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
@ -3157,7 +3157,7 @@ X86.opMOVDX = function MOVDX()
|
|||
{
|
||||
this.regEDX = (this.regEDX & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiDL = this.backTrack.btiMemLo; this.backTrack.btiDH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiDL = this.backTrack.btiMem0; this.backTrack.btiDH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
@ -3171,7 +3171,7 @@ X86.opMOVBX = function MOVBX()
|
|||
{
|
||||
this.regEBX = (this.regEBX & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiBL = this.backTrack.btiMemLo; this.backTrack.btiBH = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiBL = this.backTrack.btiMem0; this.backTrack.btiBH = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
@ -3196,7 +3196,7 @@ X86.opMOVBP = function MOVBP()
|
|||
{
|
||||
this.regEBP = (this.regEBP & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiBPLo = this.backTrack.btiMemLo; this.backTrack.btiBPHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiBPLo = this.backTrack.btiMem0; this.backTrack.btiBPHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
@ -3210,7 +3210,7 @@ X86.opMOVSI = function MOVSI()
|
|||
{
|
||||
this.regESI = (this.regESI & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiSILo = this.backTrack.btiMemLo; this.backTrack.btiSIHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiSILo = this.backTrack.btiMem0; this.backTrack.btiSIHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
@ -3224,7 +3224,7 @@ X86.opMOVDI = function MOVDI()
|
|||
{
|
||||
this.regEDI = (this.regEDI & ~this.dataMask) | this.getIPWord();
|
||||
if (BACKTRACK) {
|
||||
this.backTrack.btiDILo = this.backTrack.btiMemLo; this.backTrack.btiDIHi = this.backTrack.btiMemHi;
|
||||
this.backTrack.btiDILo = this.backTrack.btiMem0; this.backTrack.btiDIHi = this.backTrack.btiMem1;
|
||||
}
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesLAHF;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue