Added support for future PDP-10 MACRO-10 assembler

This commit is contained in:
Jeff 2017-03-10 10:28:32 -08:00 committed by Jeff Parsons
commit fcee8a2838
7 changed files with 366 additions and 224 deletions

View file

@ -40,6 +40,7 @@ if (NODE) {
var BusPDP10 = require("./bus");
var MemoryPDP10 = require("./memory");
var MessagesPDP10 = require("./messages");
var Macro10 = require("./macro10");
}
/**
@ -77,6 +78,7 @@ class DebuggerPDP10 extends Debugger {
* The DebuggerPDP10 component is an optional component that implements a variety of user
* commands for controlling the CPU, dumping and editing memory, etc.
*
* @this {DebuggerPDP10}
* @param {Object} parmsDbg
*/
constructor(parmsDbg)
@ -174,6 +176,13 @@ class DebuggerPDP10 extends Debugger {
this.controlDebug = null;
this.panel = null;
/**
* This records any active Macro10 assembler object.
*
* @type {Macro10|null}
*/
this.macro10 = null;
/*
* Make it easier to access DebuggerPDP10 commands from an external REPL (eg, the WebStorm
* "live" console window); eg:
@ -2430,11 +2439,23 @@ class DebuggerPDP10 extends Debugger {
return dbgAddr;
}
/**
* loadAssembly(macro10, addrLoad)
*
* @this {DebuggerPDP10}
* @param {Macro10} macro10
* @param {number|null} addrLoad
*/
loadAssembly(macro10, addrLoad)
{
}
/**
* returnSymbol(iTable, iOffset, aSymbol)
*
* Helper function for findSymbol().
*
* @this {DebuggerPDP10}
* @param {number} iTable
* @param {number} iOffset
* @param {Array} aSymbol is updated with the specified symbol, if it exists
@ -2517,6 +2538,25 @@ class DebuggerPDP10 extends Debugger {
return;
}
if (sOpCode.indexOf(':') >= 0) {
var dbg = this;
if (this.macro10) {
dbg.println("assembly already in progress");
}
else {
var addrLoad = dbgAddr.addr;
this.macro10 = new Macro10(sOpCode, addrLoad, dbg, function(macro10, sURL, nErrorCode) {
if (!nErrorCode) {
dbg.loadAssembly(macro10, addrLoad);
} else {
dbg.println("error assembling " + sURL + ": (" + nErrorCode + ")");
}
dbg.macro10 = null;
});
}
return;
}
asArgs.shift();
asArgs.shift();
asArgs.shift();