First batch of pdp11.js code adapted but totally untested
This commit is contained in:
parent
475b08fa91
commit
100779e30a
22 changed files with 2697 additions and 1273 deletions
|
|
@ -1035,6 +1035,17 @@ CPU8080.prototype.updateTimers = function(nCycles)
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* endBurst()
|
||||
*
|
||||
* @this {CPU8080}
|
||||
*/
|
||||
CPU8080.prototype.endBurst = function()
|
||||
{
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* runCPU(fUpdateFocus)
|
||||
*
|
||||
|
|
@ -1170,8 +1181,7 @@ CPU8080.prototype.stepCPU = function(nMinCycles)
|
|||
CPU8080.prototype.stopCPU = function(fComplete)
|
||||
{
|
||||
this.isBusy(true);
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0;
|
||||
this.endBurst();
|
||||
this.addCycles(this.nRunCycles);
|
||||
this.nRunCycles = 0;
|
||||
if (this.flags.fRunning) {
|
||||
|
|
@ -1212,9 +1222,8 @@ CPU8080.prototype.updateCPU = function(fForce)
|
|||
*/
|
||||
CPU8080.prototype.yieldCPU = function()
|
||||
{
|
||||
this.endBurst(); // this will break us out of stepCPU()
|
||||
this.nCyclesNextYield = 0; // this will break us out of runCPU(), once we break out of stepCPU()
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0; // this will break us out of stepCPU()
|
||||
// if (DEBUG) this.nSnapCycles = this.nBurstCycles;
|
||||
/*
|
||||
* The Debugger calls yieldCPU() after every message() to ensure browser responsiveness, but it looks
|
||||
|
|
|
|||
|
|
@ -961,8 +961,7 @@ CPUState8080.prototype.checkINTR = function()
|
|||
* current burst AND that it should not execute any more instructions until checkINTR() indicates
|
||||
* that a hardware interrupt has been requested.
|
||||
*/
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0;
|
||||
this.endBurst();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -994,8 +993,7 @@ CPUState8080.prototype.clearINTR = function(nLevel)
|
|||
CPUState8080.prototype.requestHALT = function()
|
||||
{
|
||||
this.intFlags |= CPUDef8080.INTFLAG.HALT;
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0;
|
||||
this.endBurst();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1015,8 +1013,7 @@ CPUState8080.prototype.requestINTR = function(nLevel)
|
|||
{
|
||||
this.intFlags |= (1 << nLevel);
|
||||
if (this.getIF()) {
|
||||
this.nBurstCycles -= this.nStepCycles;
|
||||
this.nStepCycles = 0;
|
||||
this.endBurst();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1088,9 +1085,6 @@ CPUState8080.prototype.updateStatus = function(fForce)
|
|||
* they're all one continuous stream of instructions that can be stepped or run at will. Moreover,
|
||||
* stepping vs. running should never change the behavior of the simulation.
|
||||
*
|
||||
* As a result, the Debugger's complete independence means you can run other 8086/8088 debuggers
|
||||
* (eg, DEBUG) inside the simulation without interference; you can even "debug" them with the Debugger.
|
||||
*
|
||||
* @this {CPUState8080}
|
||||
* @param {number} nMinCycles (0 implies a single-step, and therefore breakpoints should be ignored)
|
||||
* @return {number} of cycles executed; 0 indicates a pre-execution condition (ie, an execution breakpoint
|
||||
|
|
|
|||
Loading…
Reference in a new issue