BOUND fixes

This commit is contained in:
Jeff Parsons 2015-05-07 20:57:49 -07:00 committed by jeffpar
commit 3a1d05d541
4 changed files with 377 additions and 359 deletions

View file

@ -78,7 +78,7 @@
"debugger": {
"id": "pc386.debugger",
"name": "",
"commands": "",
"commands": "bp 0010:829B;g",
"messages": ""
}
}

File diff suppressed because it is too large Load diff

View file

@ -172,9 +172,14 @@ X86.fnBOUND = function BOUND(dst, src)
/*
* Note that BOUND performs signed comparisons, so we must transform all arguments into signed values.
*/
var wIndex = (dst << 16) >> 16;
var wLower = (this.getWord(this.regEA) << 16) >> 16;
var wUpper = (this.getWord(this.regEA + this.dataSize) << 16) >> 16;
var wIndex = dst;
var wLower = this.getWord(this.regEA);
var wUpper = this.getWord(this.regEA + this.dataSize);
if (this.dataSize == 2) {
wIndex = (dst << 16) >> 16;
wLower = (wLower << 16) >> 16;
wUpper = (wUpper << 16) >> 16;
}
this.nStepCycles -= this.cycleCounts.nOpCyclesBound;
if (wIndex < wLower || wIndex > wUpper) {
/*

View file

@ -290,11 +290,11 @@ toProt32:
cmp eax,[0x0000]
err1: jne err1
mov [0x0000],edx ; restore the DWORD at 0x0000:0x0000 from EDX
jmp test2
;
; Test moving a byte to a 32-bit register with sign-extension
;
movsx eax,byte [0xfffff]
test2: movsx eax,byte [0xfffff]
cmp eax,0xffffff80
err2: jne err2