Allow the debugger to switch to base 2

This commit is contained in:
Jeff 2017-03-17 11:20:26 -07:00 committed by Jeff Parsons
commit abd17be706
10 changed files with 677 additions and 654 deletions

View file

@ -3179,7 +3179,7 @@ class DebuggerPDP10 extends Debugger {
case "base":
if (asArgs[2]) {
var nBase = +asArgs[2];
if (nBase == 8 || nBase == 10 || nBase == 16) {
if (nBase == 2 || nBase == 8 || nBase == 10 || nBase == 16) {
this.nBase = nBase;
} else {
this.println("invalid base: " + nBase);

View file

@ -1,5 +1,5 @@
/**
* @fileoverview My homage to MACRO-10: a work-alike assembler for the PDP-10
* @fileoverview A MACRO-10 "work-alike" Mini-Assembler for the PDP-10
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
* @copyright © Jeff Parsons 2012-2017
*
@ -119,10 +119,7 @@ class Macro10 {
this.dbg = dbg;
this.done = done;
/*
* Set up shortcuts to frequently used helper services that the caller must provide.
*/
this.println = dbg.println;
this.println("starting PCjs MACRO-10 Mini-Assembler...");
/*
* Initialize all the tables that MACRO-10 uses.
@ -200,6 +197,7 @@ class Macro10 {
this.sText = "";
this.iURL = 0;
this.asURLs = sURL.split(';');
this.loadNextResource();
}
@ -218,6 +216,8 @@ class Macro10 {
var macro10 = this;
var sURL = this.asURLs[this.iURL++];
this.println("loading " + Str.getBaseName(sURL));
/*
* We know that local resources ending with ".MAC" are actually stored with a ".txt" extension.
*/
@ -1090,6 +1090,21 @@ class Macro10 {
}
return w;
}
/**
* println(s)
*
* @this {Macro10}
* @param {string} s
*/
println(s)
{
if (!this.dbg) {
console.log(s);
} else {
this.dbg.println(s);
}
}
}
Macro10.PSEUDO_OP = {