More robust handling of PDP-10 memory errors (so that when a file is assembled and loaded into non-existent memory, an error is generated); bumped the PDP-10 test machine to 32K words
This commit is contained in:
parent
88d5572aa3
commit
ab41fdef3c
7 changed files with 73 additions and 52 deletions
|
|
@ -707,7 +707,7 @@ class BusPDP10 extends Component {
|
|||
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP10.FAULT)) {
|
||||
this.dbg.printMessage("memory fault on " + this.dbg.toStrBase(addr), true, true);
|
||||
}
|
||||
this.cpu.stopCPU();
|
||||
this.cpu.haltCPU();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -832,6 +832,20 @@ class CPUStatePDP10 extends CPUPDP10 {
|
|||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* haltCPU()
|
||||
*
|
||||
* This is a temporary helper function for the Bus component, to force the CPU to stop executing the
|
||||
* current instruction.
|
||||
*
|
||||
* @this {CPUStatePDP10}
|
||||
*/
|
||||
haltCPU()
|
||||
{
|
||||
this.stopCPU();
|
||||
throw -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* stepCPU(nMinCycles)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2528,7 +2528,7 @@ class DebuggerPDP10 extends Debugger {
|
|||
var dbg = this.dbg;
|
||||
var nWords = 0, addrLo = null, addrHi = 0;
|
||||
aWords.forEach(function(w, addr) {
|
||||
bus.setWordDirect(addr, w);
|
||||
bus.setWord(addr, w);
|
||||
if (addrLo == null) addrLo = addr;
|
||||
if (addr > addrHi) addrHi = addr;
|
||||
nWords++;
|
||||
|
|
@ -2665,10 +2665,15 @@ class DebuggerPDP10 extends Debugger {
|
|||
if (addrStart == null) addrStart = addrLoad;
|
||||
dbg.loadImage(macro10.getImage(), addrStart);
|
||||
} catch(e) {
|
||||
dbg.println(e.message);
|
||||
nErrorCode = -1; // fake error so that command processing stops
|
||||
if (typeof e == "number") {
|
||||
nErrorCode = e || -1;
|
||||
} else {
|
||||
dbg.println(e.message);
|
||||
nErrorCode = -1; // fake error so that command processing stops
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if (nErrorCode) {
|
||||
dbg.println("error (" + nErrorCode + ") processing " + (sURL || sFile));
|
||||
}
|
||||
dbg.macro10 = null;
|
||||
|
|
|
|||
|
|
@ -420,6 +420,7 @@ class MemoryPDP10 {
|
|||
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP10.MEMORY) /* && !off */) {
|
||||
this.dbg.printMessage("attempt to write " + this.dbg.toStrBase(v) + " to invalid addresses " + this.dbg.toStrBase(addr), true);
|
||||
}
|
||||
this.bus.fault(addr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue