Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | 1x 1x 8x 8x 8x 8x 8x 8x 8x 481x 481x 481x 481x 481x 3x 3x 481x 472x 472x 4x 4x 472x 472x 481x 233x 898x 898x 233x 481x 481x 481x 1597x 1597x 481x 481x 2123x 2123x 481x 12x 12x 12x 481x 60x 60x 469x 481x 1306x 1306x 469x 481x 1655x 1655x 481x 360x 360x 481x 481x 481x 459x 459x 481x 109x 109x 469x 469x 8x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 8x 40x 40x 40x 40x 40x 40x 483x 483x 40x 40x 40x 40x 40x 20x 42x 42x 42x 42x 42x 20x 40x 7x 1x 1x 1x 1x 1x 1x 1x 127x 127x 5400x 5400x 5400x 2455x 5400x 7x 7x 5400x 120x 1x 1x 1x 1x 1x 167x 167x 167x 167x 167x 167x 167x 167x 167x 167x 167x 2x 167x 167x 167x 167x 81x 81x 340x 340x 81x 167x 167x 167x 19x 167x 167x 124x 167x 167x 164x 167x 167x 46x 167x 167x 167x 1x 1x 1x | import {toHex2, toHex4} from './utils/utils.js';
export const lst = (result, raw, compact=false) => {
let V = result.dump;
let vars = result.vars;
let opts = result.opts;
let ln;
let op;
let out = "";
for (let i = 0, j = V.length; i < j; i++) {
op = V[i];
//console.log(op)
ln = "";
//if (op.ifskip) {continue}
if (op.macro && !raw) {
/*out += ' **MACRO UNROLL - '+op.macro+'\n';*/
}
if (op.addr !== undefined && !op.ifskip) {
ln += toHex4(op.addr);
if (op.phase) {
ln += " @" + toHex4(op.addr - op.phase);
}
ln += compact ? " " : " ";
}
if (op.lens && !op.ifskip) {
for (let n = 0; n < op.lens.length; n++) {
ln += toHex2(op.lens[n]) + " ";
}
}
if (!compact)
while (ln.length < 20) {
ln += " ";
}
if (compact)
while (ln.length < 15) {
ln += " ";
}
if (op.listing) {
out += ln + op.listing + "\n";
continue;
}
if (op.label) {
ln += op.label + ": ";
}
if (!compact)
while (ln.length < 30) {
ln += " ";
}
if (compact)
while (ln.length < 22) {
ln += " ";
}
if (op.opcode) {
ln += op.opcode + (compact ? " " : " ");
}
if (op.bandPar) {
ln += op.bandPar + ",";
}
if (op.aimPar) {
ln += op.aimPar + ",";
}
if (op.params) {
ln += op.params + (compact ? " " : " ");
}
if (op.remark) {
ln += ";" + op.remark;
}
out += ln + "\n";
}
if (raw) return out;
/*
out+="\n\n";
for (let k in vars) {
if (vars[k]===null) continue;
if (k[0]=='_' && k[1]=='_') continue;
if (k[k.length-1]==='$') continue;
ln = '';
ln += k;
while (ln.length<12) {ln+= ' ';}
ln += toHex4(vars[k]);
out += ln+"\n";
}
*/
//xref
out += "\n\n";
let xref = opts.xref
for (let k in xref) {
if (xref[k] === null) continue;
if (k[0] == "_" && k[1] == "_") continue;
if (k[k.length - 1] === "$") continue;
ln = "";
ln += k + ": ";
while (ln.length < 20) {
ln += " ";
}
ln += toHex4(xref[k].value);
ln += " DEFINED AT LINE " + xref[k].defined.line;
if (xref[k].defined.file != "*main*") ln += " IN " + xref[k].defined.file;
out += ln + "\n";
if (xref[k].usage) {
for (let j = 0; j < xref[k].usage.length; j++) {
out += " > USED AT LINE " + xref[k].usage[j].line;
if (xref[k].usage[j].file != "*main*")
out += " IN " + xref[k].usage[j].file;
out += "\n";
}
}
}
return out;
};
export const html = (result, raw, compact=false) => {
let V = result.dump;
let vars = result.vars;
let opts = result.opts;
let parfix = (par) => {
par += "";
for (let k in vars) {
if (vars[k] === null) continue;
if (k[0] == "_" && k[1] == "_") continue;
if (k[k.length - 1] === "$") continue;
let re = new RegExp("^" + k + "$", "i");
if (par.match(re)) {
return '<a href="#LBL' + k + '">' + par + "</a>";
}
}
return par;
};
let ln;
let op;
let out = "<html><head><meta charset=utf-8><body><table>";
for (let i = 0, j = V.length; i < j; i++) {
op = V[i];
ln = '<tr id="ln' + op.numline + '">';
if (op.macro && !raw) {
/*ln += ' **MACRO UNROLL - '+op.macro+'\n';*/
}
if (op.addr !== undefined) {
ln +=
'<td><a name="ADDR' +
toHex4(op.addr) +
'">' +
toHex4(op.addr) +
"</a>";
if (op.phase) {
ln += "</td><td>" + toHex4(op.addr - op.phase);
} else ln += "</td><td>";
ln += "</td>";
} else ln += "<td></td><td></td>";
if (op.lens) {
ln += "<td>";
for (let n = 0; n < op.lens.length; n++) {
ln += toHex2(op.lens[n]) + " ";
}
ln += "</td>";
} else ln += "<td></td>";
if (op.label) {
ln += '<td><a name="LBL' + op.label + '">' + op.label + "</a></td>";
} else ln += "<td></td>";
if (op.opcode) {
ln += "<td>" + op.opcode + "</td>";
} else ln += "<td></td>";
if (op.params) {
ln += "<td>" + op.params.map(parfix) + "</td>";
} else ln += "<td></td>";
if (op.remark) {
ln += "<td>" + ";" + op.remark + "</td>";
} else ln += "<td></td>";
out += ln + "</tr>\n";
}
out += "</table>";
return out;
}; |