More 80386 support (PUSH/POP FS/GS)
This commit is contained in:
parent
e3a5408031
commit
e4b5f2b020
4 changed files with 117 additions and 32 deletions
|
|
@ -879,7 +879,11 @@ if (DEBUGGER) {
|
|||
0x05: [Debugger.INS.LOADALL,Debugger.TYPE_80286],
|
||||
0x06: [Debugger.INS.CLTS, Debugger.TYPE_80286],
|
||||
0x20: [Debugger.INS.MOV, Debugger.TYPE_REG | Debugger.TYPE_DWORD | Debugger.TYPE_OUT | Debugger.TYPE_80386, Debugger.TYPE_CTLREG | Debugger.TYPE_DWORD | Debugger.TYPE_IN],
|
||||
0x22: [Debugger.INS.MOV, Debugger.TYPE_CTLREG | Debugger.TYPE_DWORD | Debugger.TYPE_OUT | Debugger.TYPE_80386, Debugger.TYPE_REG | Debugger.TYPE_DWORD | Debugger.TYPE_IN]
|
||||
0x22: [Debugger.INS.MOV, Debugger.TYPE_CTLREG | Debugger.TYPE_DWORD | Debugger.TYPE_OUT | Debugger.TYPE_80386, Debugger.TYPE_REG | Debugger.TYPE_DWORD | Debugger.TYPE_IN],
|
||||
0xA0: [Debugger.INS.PUSH, Debugger.TYPE_FS | Debugger.TYPE_IN | Debugger.TYPE_80386],
|
||||
0xA1: [Debugger.INS.POP, Debugger.TYPE_FS | Debugger.TYPE_OUT | Debugger.TYPE_80386],
|
||||
0xA8: [Debugger.INS.PUSH, Debugger.TYPE_GS | Debugger.TYPE_IN | Debugger.TYPE_80386],
|
||||
0xA9: [Debugger.INS.POP, Debugger.TYPE_GS | Debugger.TYPE_OUT | Debugger.TYPE_80386]
|
||||
};
|
||||
|
||||
Debugger.aaGrpDescs = [
|
||||
|
|
@ -4062,6 +4066,10 @@ if (DEBUGGER) {
|
|||
return;
|
||||
for (var i = 2; i < asArgs.length; i++) {
|
||||
var b = str.parseInt(asArgs[i], 16);
|
||||
if (b === undefined) {
|
||||
this.println("unrecognized value: " + str.toHexByte(b));
|
||||
break;
|
||||
}
|
||||
this.println("setting " + this.hexAddr(aAddr) + " to " + str.toHexByte(b));
|
||||
this.setByte(aAddr, b, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -311,6 +311,58 @@ X86.opMOVcrr = function MOVcrr()
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* opPUSHFS()
|
||||
*
|
||||
* op=0x0F,0xA0 (PUSH FS)
|
||||
*
|
||||
* @this {X86CPU}
|
||||
*/
|
||||
X86.opPUSHFS = function PUSHFS()
|
||||
{
|
||||
this.pushWord(this.segFS.sel);
|
||||
this.nStepCycles -= this.CYCLES.nOpCyclesPushSeg;
|
||||
};
|
||||
|
||||
/**
|
||||
* opPOPFS()
|
||||
*
|
||||
* op=0x0F,0xA1 (POP FS)
|
||||
*
|
||||
* @this {X86CPU}
|
||||
*/
|
||||
X86.opPOPFS = function POPFS()
|
||||
{
|
||||
this.setFS(this.popWord());
|
||||
this.nStepCycles -= this.CYCLES.nOpCyclesPopReg;
|
||||
};
|
||||
|
||||
/**
|
||||
* opPUSHGS()
|
||||
*
|
||||
* op=0x0F,0xA8 (PUSH GS)
|
||||
*
|
||||
* @this {X86CPU}
|
||||
*/
|
||||
X86.opPUSHGS = function PUSHGS()
|
||||
{
|
||||
this.pushWord(this.segGS.sel);
|
||||
this.nStepCycles -= this.CYCLES.nOpCyclesPushSeg;
|
||||
};
|
||||
|
||||
/**
|
||||
* opPOPGS()
|
||||
*
|
||||
* op=0x0F,0xA9 (POP GS)
|
||||
*
|
||||
* @this {X86CPU}
|
||||
*/
|
||||
X86.opPOPGS = function POPGS()
|
||||
{
|
||||
this.setGS(this.popWord());
|
||||
this.nStepCycles -= this.CYCLES.nOpCyclesPopReg;
|
||||
};
|
||||
|
||||
X86.aOps0F = new Array(256);
|
||||
|
||||
X86.aOps0F[0x00] = X86.opGrp6;
|
||||
|
|
@ -334,6 +386,10 @@ if (I386) {
|
|||
X86.aOps0F386 = [];
|
||||
X86.aOps0F386[0x20] = X86.opMOVrcr;
|
||||
X86.aOps0F386[0x22] = X86.opMOVcrr;
|
||||
X86.aOps0F386[0xA0] = X86.opPUSHFS;
|
||||
X86.aOps0F386[0xA1] = X86.opPOPFS;
|
||||
X86.aOps0F386[0xA8] = X86.opPUSHGS;
|
||||
X86.aOps0F386[0xA9] = X86.opPOPGS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue