Fixed multiline ASCIZ MACRO-10 pseudo-op, and expressions with binary shift suffixes finally evaluate correctly in parseExpression()

This commit is contained in:
Jeff 2017-03-16 16:50:47 -07:00 committed by Jeff Parsons
commit 01e9bcf0fe
9 changed files with 1381 additions and 1363 deletions

View file

@ -2850,8 +2850,8 @@ class DebuggerPDP10 extends Debugger {
if (dbgAddr.nBase) this.nBase = dbgAddr.nBase;
var size = (sCmd == "db"? 1 : 2);
var nWords = len || 32;
var nWordsPerLine = (size == 1? 2 : 4);
var nWords = len || 16;
var nWordsPerLine = (size == 1? 1 : 4);
var nLines = (((nWords + nWordsPerLine - 1) / nWordsPerLine)|0) || 1;
var sDump = "";
@ -2874,7 +2874,9 @@ class DebuggerPDP10 extends Debugger {
var nBits = 7;
var shift = 36 - nBits;
for (var i = 0; size == 1 && shift >= 0; i++) {
var c = ((w / Math.pow(2, shift)) % Math.pow(2, nBits)) + (nBits == 6? 0x20 : 0);
var c = ((w / Math.pow(2, shift)) % Math.pow(2, nBits));
sData += this.toStrBase(c, nBits) + ' ';
c += (nBits == 6? 0x20 : 0);
sChars += (c < 0x20? '.' : String.fromCharCode(c));
shift -= nBits;
}

View file

@ -348,7 +348,7 @@ class Macro10 {
sLine = this.addASCII(sLine);
}
var reLine = /\s*([A-Z$%._][0-9A-Z$%.]*[:=]|)\s*([A-Z$%.][0-9A-Z$%.]*|)\s*([^;]+|)\s*(;?.*)/i;
var reLine = /\s*([A-Z$%._][0-9A-Z$%.]*[:=]|)\s*([A-Z$%.][0-9A-Z$%.]*|)\s*([^;]+|)(;?[\s\S]*)/i;
var match = sLine.match(reLine);
if (!match || match[4] && match[4].slice(0, 1) != ';') {
this.error("failed to parse line: " + sLine);
@ -358,7 +358,9 @@ class Macro10 {
var sLabel = match[1];
var sOperator = match[2].toUpperCase();
var sOperands = match[3].trim();
var sComment = match[4].slice(1);
var sComment = match[4];
var sRemainder = match[3] + match[4];
if (sLabel) {
var chSep = sLabel.slice(-1);
sLabel = sLabel.slice(0, -1);
@ -370,8 +372,6 @@ class Macro10 {
}
}
sOperands = sOperands.trim();
if (!sOperator && !sOperands) return true;
/*
@ -413,7 +413,7 @@ class Macro10 {
case Macro10.PSEUDO_OP.ASCII:
case Macro10.PSEUDO_OP.ASCIZ:
case Macro10.PSEUDO_OP.SIXBIT:
this.addASCII(sOperands);
this.addASCII(sRemainder);
break;
case Macro10.PSEUDO_OP.XWD: