Fixed some regressions in MACRO-10 support (all the KA10 diagnostics archived so far assemble and pass again)
This commit is contained in:
parent
816e52ee35
commit
f928fd85f5
2 changed files with 16 additions and 16 deletions
|
|
@ -1644,9 +1644,8 @@ class DebuggerPDP10 extends Debugger {
|
||||||
|
|
||||||
if (!sOpcode) {
|
if (!sOpcode) {
|
||||||
/*
|
/*
|
||||||
* MACRO-10 permits instructions to be assembled without an explicit opcode;
|
* MACRO-10 also allows instructions to be assembled without an opcode (ie, just an address expression),
|
||||||
* an address expression is sufficient. This is done to generate UUO opcodes,
|
* so if that's all we have, skip the opcode parsing.
|
||||||
* for example.
|
|
||||||
*/
|
*/
|
||||||
if (sOperands) opCode = opMask = 0;
|
if (sOperands) opCode = opMask = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1710,10 +1709,10 @@ class DebuggerPDP10 extends Debugger {
|
||||||
if (opCode >= 0) break;
|
if (opCode >= 0) break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* MACRO-10 also allows instructions to be assembled without an opcode (ie, just an address reference),
|
* MACRO-10 also allows instructions to be assembled without an opcode (ie, just an address expression),
|
||||||
* so we'll give that a try next (as long as we're not mashing two symbols together).
|
* so we'll give that a try next (as long as we're not mashing two symbols together).
|
||||||
*/
|
*/
|
||||||
if (opCode < 0 && sOperands && !sOperands.match(/^[0-9A-Z$%.?]/i)) {
|
if (opCode < 0 && (!sOperands || !sOperands.match(/^[0-9A-Z$%.?]/i))) {
|
||||||
sOperands = sOpcode + sOperands;
|
sOperands = sOpcode + sOperands;
|
||||||
sOpcode = "";
|
sOpcode = "";
|
||||||
opCode = 0;
|
opCode = 0;
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ class Macro10 {
|
||||||
/*
|
/*
|
||||||
* And last but not least, perform all fixups.
|
* And last but not least, perform all fixups.
|
||||||
*/
|
*/
|
||||||
this.aFixups.forEach(function processFixup(sValue, nLocation){
|
this.aFixups.forEach(function processFixup(sValue, nLocation) {
|
||||||
let value = macro10.parseExpression(sValue, undefined, nLocation);
|
let value = macro10.parseExpression(sValue, undefined, nLocation);
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
macro10.error("unable to parse expression '" + sValue + "'");
|
macro10.error("unable to parse expression '" + sValue + "'");
|
||||||
|
|
@ -657,6 +657,7 @@ class Macro10 {
|
||||||
var sLiteral = this.getLiteral(sOperands);
|
var sLiteral = this.getLiteral(sOperands);
|
||||||
if (sLiteral) {
|
if (sLiteral) {
|
||||||
sOperands = sOperands.replace(sLiteral, this.defMacro(Macro10.PSEUDO_OP.LITERAL, this.getLiteral(sRemainder)));
|
sOperands = sOperands.replace(sLiteral, this.defMacro(Macro10.PSEUDO_OP.LITERAL, this.getLiteral(sRemainder)));
|
||||||
|
if (!sSeparator) sSeparator = "\t";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -785,7 +786,7 @@ class Macro10 {
|
||||||
if (nLocation < this.nLocation) {
|
if (nLocation < this.nLocation) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An OPDEF invokation *may* have operands, but it's not required to.
|
* An OPDEF invocation *may* have operands, but it's not required to.
|
||||||
*/
|
*/
|
||||||
if (!sOperands) return true;
|
if (!sOperands) return true;
|
||||||
|
|
||||||
|
|
@ -995,7 +996,7 @@ class Macro10 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseExpression(sOperand, fPass1, nLocation)
|
* parseExpression(sExp, fPass1, nLocation)
|
||||||
*
|
*
|
||||||
* This is a wrapper around the Debugger's parseExpression() function to take care of some
|
* This is a wrapper around the Debugger's parseExpression() function to take care of some
|
||||||
* additional requirements we have, such as interpreting a period as the current location and
|
* additional requirements we have, such as interpreting a period as the current location and
|
||||||
|
|
@ -1003,19 +1004,19 @@ class Macro10 {
|
||||||
* of a 36-bit value.
|
* of a 36-bit value.
|
||||||
*
|
*
|
||||||
* @this {Macro10}
|
* @this {Macro10}
|
||||||
* @param {string} sOperand
|
* @param {string} sExp
|
||||||
* @param {boolean|undefined} [fPass1]
|
* @param {boolean|undefined} [fPass1]
|
||||||
* @param {number|undefined} [nLocation]
|
* @param {number|undefined} [nLocation]
|
||||||
* @return {number|undefined}
|
* @return {number|undefined}
|
||||||
*/
|
*/
|
||||||
parseExpression(sOperand, fPass1, nLocation)
|
parseExpression(sExp, fPass1, nLocation)
|
||||||
{
|
{
|
||||||
var result;
|
var result;
|
||||||
/*
|
/*
|
||||||
* Check for the "double comma" syntax that MACRO-10 uses to express a 36-bit value as two 18-bit halves,
|
* Check for the "double comma" syntax that MACRO-10 uses to express a 36-bit value as two 18-bit halves,
|
||||||
* and invoke ourselves recursively for each half.
|
* and invoke ourselves recursively for each half.
|
||||||
*/
|
*/
|
||||||
var match = sOperand.match(/^([^,]*),,([^,]*)$/);
|
var match = sExp.match(/^([^,]*),,([^,]*)$/);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
if (nLocation === undefined) {
|
if (nLocation === undefined) {
|
||||||
nLocation = (this.nLocationScope >= 0? this.nLocationScope : this.nLocation);
|
nLocation = (this.nLocationScope >= 0? this.nLocationScope : this.nLocation);
|
||||||
|
|
@ -1025,11 +1026,11 @@ class Macro10 {
|
||||||
* (or at least assignments), so we check for those in the given expression and convert them to quoted
|
* (or at least assignments), so we check for those in the given expression and convert them to quoted
|
||||||
* sequences that the Debugger's parseExpression() understands.
|
* sequences that the Debugger's parseExpression() understands.
|
||||||
*/
|
*/
|
||||||
sOperand = sOperand.replace(/SIXBIT\s*(\S)(.*?)\1/g, "'$2'").replace(/ASCII\s*(\S)(.*?)\1/g, '"$2"');
|
sExp = sExp.replace(/SIXBIT\s*(\S)(.*?)\1/g, "'$2'").replace(/ASCII\s*(\S)(.*?)\1/g, '"$2"');
|
||||||
|
|
||||||
var sOperator = "";
|
var sOperator = "";
|
||||||
var sOperands = sOperand;
|
var sOperands = sExp;
|
||||||
if (match = sOperand.match(/^([^\s]+)\s+(.+?)\s*$/)) {
|
if (match = sExp.match(/^([^\s]+)\s*(.*?)\s*$/)) {
|
||||||
sOperator = match[1];
|
sOperator = match[1];
|
||||||
sOperands = match[2];
|
sOperands = match[2];
|
||||||
}
|
}
|
||||||
|
|
@ -1046,9 +1047,9 @@ class Macro10 {
|
||||||
* is (I think) as the decimal point within a floating-point number, so here we only replace
|
* is (I think) as the decimal point within a floating-point number, so here we only replace
|
||||||
* periods that are not FOLLOWED by a decimal digit.
|
* periods that are not FOLLOWED by a decimal digit.
|
||||||
*/
|
*/
|
||||||
result = this.dbg.parseExpression(sOperand.replace(/\.([^0-9]|$)/g, this.dbg.toStrBase(nLocation, -1) + "$1"), fPass1);
|
result = this.dbg.parseExpression(sExp.replace(/\.([^0-9]|$)/g, this.dbg.toStrBase(nLocation, -1) + "$1"), fPass1);
|
||||||
if (result === undefined) {
|
if (result === undefined) {
|
||||||
this.error("unable to parse expression '" + sOperand + "'");
|
this.error("unable to parse expression '" + sExp + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue