Assorted PDP-11 debugger changes

This commit is contained in:
Jeff Parsons 2016-09-19 16:30:08 -07:00 committed by Jeff Parsons
commit 1df54a338f
21 changed files with 499 additions and 276 deletions

View file

@ -38,7 +38,7 @@ try {
var asLines = sText.split('\n');
for (var iLine = 0; iLine < asLines.length; iLine++) {
var sLine = asLines[iLine];
var match, re = /([^0-9a-z_-])(0[0-7]+)([^0-9a-z_])/gi;
var match, re = /(^|[^0-9a-z_-]*)(0[0-7]+)([^0-9a-z_,]*|$)/gi;
var iComment = sLine.indexOf("//");
while (match = re.exec(sLine)) {
if (iComment >= 0 && match.index > iComment) break;
@ -47,7 +47,7 @@ try {
console.log("found negative octal value (" + match[2] + "), skipping");
continue;
}
var sReplace = match[1] + "0x" + n.toString(16).toUpperCase() + match[3] + " /*" + match[2] + "*/";
var sReplace = match[1] + "0x" + ("0000" + n.toString(16).toUpperCase()).substr(-4) + match[3] + " /*" + match[2] + "*/";
sLine = sLine.substr(0, match.index) + sReplace + sLine.substr(match.index + match[0].length);
re.lastIndex = match.index + sReplace.length;
asLines[iLine] = sLine;