Fixed handling of redundant address/data override prefixes

This commit is contained in:
Jeff Parsons 2015-07-17 10:14:17 -07:00
commit b6e8eb8877
4 changed files with 68 additions and 19 deletions

View file

@ -58,8 +58,8 @@ if (!I386) {
}
} else {
/*
* These are the more general-purpose ModRM decoders, required for I386 suppport. The current addressing
* mode (16-bit or 32-bit) dynamically selects the appropriate byte and word decoders.
* These are the more general-purpose ModRM decoders, required for I386 support. The current addressing
* mode (16-bit or 32-bit) dynamically selects the appropriate set of decoders.
*/
if (typeof module !== 'undefined') {
var X86ModB16 = require("./x86modb16");
@ -141,9 +141,9 @@ function X86CPU(parmsCPU)
* if any function returns false, the software interrupt will be skipped (presumed to be emulated),
* and no further notification functions will be called.
*
* NOTE: Registered functions are called only for "INT N" instructions -- NOT "INT 3" or "INTO" or the
* "INT 0x00" generated by a divide-by-zero or any other kind of interrupt (nor any interrupt simulated
* with "PUSHF/CALLF").
* NOTE: Registered functions are called only for INT N instructions -- *not* INT 0x03 or INTO or the
* INT 0x00 generated by a divide-by-zero or any other kind of interrupt (nor any interrupt simulated
* with PUSHF/CALLF).
*
* aIntReturn is a hash of return address notifications set up by software interrupt notification
* functions that want to receive return notifications. A software interrupt function must call
@ -1163,7 +1163,7 @@ X86CPU.prototype.reset = function()
* the D0 stepping reported 0x0305; beyond that, it's not known exactly what revision numbers Intel used for all
* 80386 revisions.
*
* We define some additional "registers", such as regLIP. which mirrors the linear address corresponding to
* We define some additional "registers", such as regLIP, which mirrors the linear address corresponding to
* CS:IP (the address of the next opcode byte). In fact, regLIP functions as our internal IP register, so any
* code that needs the real IP must call getIP(). This, in turn, means that whenever CS or IP must be modified,
* regLIP must be recalculated, so you must use either setCSIP(), which takes both an offset and a segment,
@ -2791,6 +2791,11 @@ X86CPU.prototype.setBinding = function(sHTMLType, sBinding, control)
case "DS":
case "SS":
case "ES":
case "FS":
case "GS":
case "CR0":
case "CR2":
case "CR3":
case "PS": // this refers to "Processor Status", aka the 16-bit flags register (although DEBUG.COM refers to this as "PC", surprisingly)
case "C":
case "P":
@ -3822,6 +3827,8 @@ X86CPU.prototype.updateStatus = function(fForce)
this.updateReg("DS", this.getDS());
this.updateReg("SS", this.getSS());
this.updateReg("ES", this.getES());
this.updateReg("FS", this.getFS());
this.updateReg("GS", this.getGS());
this.updateReg("EIP", this.getIP());
var regPS = this.getPS();
this.updateReg("PS", regPS);
@ -3834,6 +3841,9 @@ X86CPU.prototype.updateStatus = function(fForce)
this.updateReg("A", (regPS & X86.PS.AF));
this.updateReg("P", (regPS & X86.PS.PF));
this.updateReg("C", (regPS & X86.PS.CF));
this.updateReg("CR0", this.regCR0);
this.updateReg("CR2", this.regCR2);
this.updateReg("CR3", this.regCR3);
}
}