Minor page and comment updates
This commit is contained in:
parent
1f7c95f328
commit
6eca71ace3
16 changed files with 57 additions and 68 deletions
|
|
@ -33,9 +33,31 @@
|
|||
"use strict";
|
||||
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
/*
|
||||
* Before 80386 support was added to PCjs, the approach to decoding ModRegRM bytes (which I usually
|
||||
* just call ModRM bytes) used one generated function per ModRM value. This was optimal for 16-bit processors,
|
||||
* because the functions were small, and it was maximally efficient, turning the entire ModRM decoding operation
|
||||
* into one table lookup and function call.
|
||||
*
|
||||
* However, that approach didn't scale well for 32-bit processors, which had extended ModRM capabilities in both
|
||||
* the addressing mode dimension and the operand size dimension. So I've rewritten ModRM decoding as 18 functions.
|
||||
* The first 9 are for 16-bit addressing modes, and the second 9 are for 32-bit addressing modes. Within each
|
||||
* group of 9, there are 3 for 8-bit operands, 3 for 16-bit operands, and 3 for 32-bit operands. And each group of 3
|
||||
* contains functions for register-source, memory-source, and group-source.
|
||||
*
|
||||
* Each of the 18 functions must do additional work to examine the ModRM bits, which makes decoding slightly slower,
|
||||
* but it's not really noticeable, and the speed difference didn't justify the additional generated code. So one much
|
||||
* smaller file (x86mods.js) replaces a host of older files (x86modb.js, x86modw.js, x86modb16.js, x86modw16.js,
|
||||
* x86modb32.js, x86modw32.js, and x86modsib.js).
|
||||
*
|
||||
* You can dig up the older files from the repository if you're curious, or you can run /modules/pcjs/bin/x86gen.js to
|
||||
* get a sense of what they contained (x86gen.js created most of the code, but it still had to be massaged afterward).
|
||||
*/
|
||||
|
||||
/**
|
||||
* modRegByte16(fn)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -543,10 +543,6 @@ X86.opANDAX = function()
|
|||
*/
|
||||
X86.opES = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with SEG is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.SEG | X86.OPFLAG.NOINTR;
|
||||
this.segData = this.segStack = this.segES;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
|
|
@ -651,10 +647,6 @@ X86.opSUBAX = function()
|
|||
*/
|
||||
X86.opCS = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with SEG is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.SEG | X86.OPFLAG.NOINTR;
|
||||
this.segData = this.segStack = this.segCS;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
|
|
@ -759,10 +751,6 @@ X86.opXORAX = function()
|
|||
*/
|
||||
X86.opSS = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with SEG is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.SEG | X86.OPFLAG.NOINTR;
|
||||
this.segData = this.segStack = this.segSS; // QUESTION: Is there a case where segStack would not already be segSS? (eg, multiple segment overrides?)
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
|
|
@ -864,10 +852,6 @@ X86.opCMPAX = function()
|
|||
*/
|
||||
X86.opDS = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with SEG is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.SEG | X86.OPFLAG.NOINTR;
|
||||
this.segData = this.segStack = this.segDS; // QUESTION: Is there a case where segData would not already be segDS? (eg, multiple segment overrides?)
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
|
|
@ -1484,10 +1468,6 @@ X86.opARPL = function()
|
|||
*/
|
||||
X86.opFS = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with SEG is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.SEG | X86.OPFLAG.NOINTR;
|
||||
this.segData = this.segStack = this.segFS;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
|
|
@ -1500,10 +1480,6 @@ X86.opFS = function()
|
|||
*/
|
||||
X86.opGS = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with SEG is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.SEG | X86.OPFLAG.NOINTR;
|
||||
this.segData = this.segStack = this.segGS;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
|
|
@ -2149,14 +2125,14 @@ X86.opXCHGrb = function()
|
|||
* To be clear, a single assignment like this will fail:
|
||||
*
|
||||
* opModRegByteF2: function(fn)
|
||||
{
|
||||
* {
|
||||
* this.regEDX = (this.regEDX & 0xff) | (fn.call(this, this.regEDX >> 8, this.regEDX & 0xff) << 8);
|
||||
* }
|
||||
*
|
||||
* which is why all affected decoders now use separate assignments; eg:
|
||||
*
|
||||
* opModRegByteF2: function(fn)
|
||||
{
|
||||
* {
|
||||
* var b = fn.call(this, this.regEDX >> 8, this.regEDX & 0xff);
|
||||
* this.regEDX = (this.regEDX & 0xff) | (b << 8);
|
||||
* }
|
||||
|
|
@ -4162,10 +4138,6 @@ X86.opOUTDXw = function()
|
|||
*/
|
||||
X86.opLOCK = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with LOCK is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.LOCK | X86.OPFLAG.NOINTR;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
};
|
||||
|
|
@ -4193,10 +4165,6 @@ X86.opINT1 = function()
|
|||
*/
|
||||
X86.opREPNZ = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with REPNZ is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.REPNZ | X86.OPFLAG.NOINTR;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
};
|
||||
|
|
@ -4208,10 +4176,6 @@ X86.opREPNZ = function()
|
|||
*/
|
||||
X86.opREPZ = function()
|
||||
{
|
||||
/*
|
||||
* NOTE: The fact that we're setting NOINTR along with REPZ is really just for documentation purposes;
|
||||
* the way stepCPU() is written, the presence of any prefix bypasses normal interrupt processing anyway.
|
||||
*/
|
||||
this.opFlags |= X86.OPFLAG.REPZ | X86.OPFLAG.NOINTR;
|
||||
this.nStepCycles -= this.cycleCounts.nOpCyclesPrefix;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -198,6 +198,13 @@ web.getResource = function(sURL, dataPost, fAsync, done)
|
|||
return [sResource, nErrorCode];
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
/*
|
||||
* The larger resources that we put on archive.pcjs.org should also be available locally...
|
||||
*/
|
||||
sURL = sURL.replace("http://archive.pcjs.org", "");
|
||||
}
|
||||
|
||||
if (NODE) {
|
||||
/*
|
||||
* We don't even need to load Component, because we can't use any of the code below
|
||||
|
|
|
|||
Loading…
Reference in a new issue