From 7255ab59a59072a73da55a99ba0460dafc27500d Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 4 Aug 2015 07:59:49 -0700 Subject: [PATCH] Fixed Debug exceptions that occur during REPeated instructions --- modules/pcjs/lib/x86func.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/pcjs/lib/x86func.js b/modules/pcjs/lib/x86func.js index 97cef61b4..4b71bb25c 100644 --- a/modules/pcjs/lib/x86func.js +++ b/modules/pcjs/lib/x86func.js @@ -3747,6 +3747,11 @@ X86.fnFault = function(nFault, nError, fHalt, nCycles) if (fDispatch) { this.nFault = nFault; X86.fnINT.call(this, nFault, nError, nCycles || 0); + /* + * REP'eated instructions that want to rewind regLIP to opLIP used to screw up this dispatch, + * so now we slip the new regLIP into opLIP, effectively turning their action into a no-op. + */ + this.opLIP = this.regLIP; } /* @@ -3841,7 +3846,7 @@ X86.fnFaultMessage = function(nFault, nError, fHalt) fHalt = false; } } else { - if (nFault == X86.EXCEPTION.NP_FAULT && bOpcode == 0x8E) { + if (MAXDEBUG && nFault == X86.EXCEPTION.NP_FAULT && bOpcode == 0x8E) { fHalt = true; } }