More updates to the PDP-10 DAKAD diagnostic page
This commit is contained in:
parent
e1e11b3b2d
commit
c4a3d72674
5 changed files with 43046 additions and 13 deletions
43000
apps/pdp10/tapes/diags/klad/dakad/DAKAD.SEQ.txt
Normal file
43000
apps/pdp10/tapes/diags/klad/dakad/DAKAD.SEQ.txt
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -13,12 +13,30 @@ PDP-10 KA10 BASIC INSTRUCTION DIAGNOSTIC
|
|||
----------------------------------------
|
||||
|
||||
The *PDP-10 KA10 BASIC INSTRUCTION DIAGNOSTIC* (MAINDEC-10-DAKAD-B-D) test code has been extracted from [DAKAD.MAC](DAKAD.MAC)
|
||||
[[original file](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakaam.mac.html)] and is shown below,
|
||||
along with a [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/).
|
||||
[[original file](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakadm.mac.html)] for use with the
|
||||
[PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
|
||||
|
||||
The Debugger command `a 100 /apps/pdp10/tapes/diags/klad/dakad/TEST.MAC`
|
||||
can be used to test the new [Mini MACRO-10](http://archive.pcjs.org/pubs/dec/pdp10/tops10/02_1973AsmRef_macro.pdf)
|
||||
assembler being added to the PDP-10 Emulator.
|
||||
Resources for this test include:
|
||||
|
||||
- [DAKAD.TXT](#dakadtxt)
|
||||
- [DAKAD.MAC](#dakadmac)
|
||||
- [DAKAD.SEQ](#dakadseq)
|
||||
|
||||
The Debugger's assemble ("a") command can be used to test the new built-in
|
||||
[MACRO-10 mini-assembler](/modules/pdp10/lib/macro10.js), which supports a subset
|
||||
of the [MACRO-10](http://archive.pcjs.org/pubs/dec/pdp10/tops10/02_1973AsmRef_macro.pdf) assembly language. This command:
|
||||
|
||||
a 100 /apps/pdp10/tapes/diags/klad/dakad/TEST.MAC
|
||||
|
||||
will automatically read the [TEST.MAC](TEST.MAC) source file (a slightly modified copy of [DAKAD.MAC](DAKAD.MAC)), assemble it,
|
||||
and then load the binary output at the specified address. Use the command `db 100` to dump the first block of binary data:
|
||||
|
||||
000100: 254000 000114 502112 026542 +...&PDP-1
|
||||
000102: 301011 340542 301010 240646 0 KA10 BAS
|
||||
000104: 446064 044634 516512 252606 IC INSTRUC
|
||||
000106: 522231 747100 422230 143634 TION DIAGN
|
||||
000110: 476472 444606 201206 424500 OSTIC (4)
|
||||
000112: 556110 145602 422721 505000 [DAKAD]...
|
||||
|
||||
{% include machine.html id="testka10" %}
|
||||
|
||||
|
|
@ -2279,3 +2297,9 @@ C22700: SETZM 2 ;INITIALIZE AC
|
|||
|
||||
JRST BEGEND
|
||||
```
|
||||
|
||||
DAKAD.SEQ
|
||||
---------
|
||||
|
||||
To view the contents of **DAKAD.SEQ** (a combination of [DAKAD.TXT](#dakadtxt), a MACRO-10 assembly listing, and run data),
|
||||
click [here](DAKAD.SEQ.txt).
|
||||
|
|
|
|||
|
|
@ -2557,6 +2557,15 @@ class DebuggerPDP10 extends Debugger {
|
|||
* NOTE: As the previous example implies, you can even assemble new instructions into ROM address space;
|
||||
* as our setByte() function explains, the ROM write-notification handlers only refuse writes from the CPU.
|
||||
*
|
||||
* When filename(s) or URL(s) are provided in lieu of an opcode, we pass those on to the Macro10 component
|
||||
* for assembling, along with any option letters that were included with the "a" command; for example, if "ap"
|
||||
* was specified, then "p" will be passed to Macro10 as an option.
|
||||
*
|
||||
* Macro10 options include:
|
||||
*
|
||||
* p: preprocess the specified resource(s) without assembling them
|
||||
* l: generate listing information
|
||||
*
|
||||
* @this {DebuggerPDP10}
|
||||
* @param {Array.<string>} asArgs is the complete argument array, beginning with the "a" command in asArgs[0]
|
||||
*/
|
||||
|
|
@ -2574,6 +2583,7 @@ class DebuggerPDP10 extends Debugger {
|
|||
return;
|
||||
}
|
||||
|
||||
var sOptions = asArgs[0].substr(1);
|
||||
var match = sOpcode.match(/^(['"]?)((\/|http:).*)\1$/);
|
||||
if (match) {
|
||||
var dbg = this;
|
||||
|
|
@ -2582,7 +2592,6 @@ class DebuggerPDP10 extends Debugger {
|
|||
}
|
||||
else {
|
||||
var addrLoad = dbgAddr.addr;
|
||||
var sOptions = ""; // add "p" for preprocessing only
|
||||
this.macro10 = new Macro10(match[2], addrLoad, sOptions, dbg, function doneMacro10(nErrorCode, sURL) {
|
||||
if (!nErrorCode) {
|
||||
dbg.loadBin(dbg.macro10.getBin(), addrLoad);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class Macro10 {
|
|||
* @this {Macro10}
|
||||
* @param {string} sURL (the URL(s) of the resource to be assembled)
|
||||
* @param {number|null} nAddr (the absolute address to assemble the code at, if any)
|
||||
* @param {string} sOptions (zero or more letter codes to control the assembly process)
|
||||
* @param {string|null} sOptions (zero or more letter codes to control the assembly process)
|
||||
* @param {DebuggerPDP10} dbg (used to provide helper services to the Macro10 class)
|
||||
* @param {function(...)} done
|
||||
*/
|
||||
|
|
@ -115,12 +115,12 @@ class Macro10 {
|
|||
{
|
||||
this.sURL = sURL;
|
||||
this.nAddr = nAddr || 0;
|
||||
this.sOptions = sOptions;
|
||||
this.sOptions = sOptions || "";
|
||||
this.dbg = dbg;
|
||||
this.done = done;
|
||||
|
||||
/*
|
||||
* Set up all the services we need to use.
|
||||
* Set up shortcuts to frequently used helper services that the caller must provide.
|
||||
*/
|
||||
this.println = dbg.println;
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ class Macro10 {
|
|||
* If the "preprocess" option is set, then just return the plain text we retrieved.
|
||||
*/
|
||||
if (this.sOptions.indexOf('p') >= 0) {
|
||||
this.dbg.println(this.sText);
|
||||
this.println(this.sText);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ function Vc(a,b,c,d,e){var f=!1;if(!a.sa++)for(var g=1;!f&&g<d.length;g++){var h
|
|||
function jg(a,b){b=void 0===b?!0:b;for(var c="",d=0;16>d;d++){!d||d&3||(c+="\n");var e=a,f=m(d,2);We(e.Ba,d);f+="="+J(e,e.Ha(e.Ba),36)+" ";c+=f}if(b){b="";for(d=0;d<df.length;d++)(e=df[d]||"")&&(e+="="+J(a,a.lb(d),d>=hf?1:d==ff?23:18)+" "),b+=e;c+="\n"+b}return c}l.zb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function Ae(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,n=h.a;if(void 0!==k){var p=f,k=[k>>>0,g],t=Ea(p,k,a.zb);0>t&&p.splice(-(t+1),0,k)}n&&(h.a=n.replace(/''/g,'"'))}a.F.push({sd:b,B:c,Ob:d,U:e,ub:f})}function kg(a,b,c){var d=[],e=Ve(b)>>>0;for(b=0;b<a.F.length;b++){var f=a.F[b],g=f.B>>>0,h=f.Ob;if(e>=g&&e<g+h){e=Ea(f.ub,[e-g],a.zb);0<=e?lg(a,b,e,d):c&&(e=~e,lg(a,b,e-1,d),lg(a,b,e,d));break}}return d}
|
||||
function mg(a,b,c){var d=0,e=a.G;b.forEach(function(a,b){vc(e,b,a);d++});d?a.j(d+" words loaded at "+J(a,c)+"-"+J(a,c+d-1)):a.j("no data")}function lg(a,b,c,d){var e={},f=a.F[b].ub,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.F[b].U[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function ng(a,b){var c=$e(a,b[1],a.ba);if(c){var d=b[2];if(void 0==d)a.j("begin assemble at "+J(a,c.B)),a.R=!0,I(a.H);else{var e=d.match(/^(['"]?)((\/|http:).*)\1$/);if(e)if(a.pa)a.j("assembly already in progress");else{var f=c.B;a.pa=new og(e[2],f,"",a,function(b,c){b?a.j("error ("+b+") processing "+c):mg(a,a.pa.w,f);a.pa=null})}else b.shift(),b.shift(),b.shift(),b=Cf(a,d,b.join(""),c.B||0),0<=b&&(a.rb(c,b),a.j(uf(a,c)))}}}
|
||||
function ng(a,b){var c=$e(a,b[1],a.ba);if(c){var d=b[2];if(void 0==d)a.j("begin assemble at "+J(a,c.B)),a.R=!0,I(a.H);else{var e=b[0].substr(1),f=d.match(/^(['"]?)((\/|http:).*)\1$/);if(f)if(a.pa)a.j("assembly already in progress");else{var g=c.B;a.pa=new og(f[2],g,e,a,function(b,c){b?a.j("error ("+b+") processing "+c):mg(a,a.pa.w,g);a.pa=null})}else b.shift(),b.shift(),b.shift(),b=Cf(a,d,b.join(""),c.B||0),0<=b&&(a.rb(c,b),a.j(uf(a,c)))}}}
|
||||
function pg(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Qe(a)||a.j("no variables"),!0;if(!c[2])return Qe(a,c[1]);if(!c[3])return delete a.K[c[1]],!0;b=X(a,c[3]);return void 0!==b?(a.K[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
||||
function qg(a,b,c){var d=null;if(b=$e(a,b)){var e=kg(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.B-e[1])&&(g=" + "+q(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.B)&&(g=" - "+q(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
||||
function rf(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trm\tdump misc registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.v,e=void 0;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)e=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}g=X(a,b);if(void 0===g)return;b=a.kb(f);if(0>b){a.j("unknown register: "+f);return}var f=0,h=a.v;switch(b){case ef:H(h,
|
||||
|
|
@ -228,9 +228,9 @@ var ug={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output
|
|||
ef=0,ff=1,gf=2,hf=3,jf=4,kf=5,lf=6,mf=7,df="PC RA EA C0 C1 OV ND PD".split(" "),vg={},vf=(vg[28672]={0:101},vg[32704]={5632:64,5696:63,5760:58,5824:27,5888:28,5952:25,6016:29,6080:26,10240:56,10304:48,10368:46,10432:84,10496:57,10560:49,10624:47,10752:21,10816:22,10880:69,10944:70,11008:88,11072:85,11136:83,11264:91,11328:23,11392:24,11456:92,11520:86,11584:87,11648:89,11712:90},vg[32512]={6144:65,6400:59,6656:66,6912:60,7168:67,7424:61,7680:68,7936:62,8192:17,8448:18,8704:19,8960:zf,9216:53,9472:52,
|
||||
9728:55,9984:54,11776:50,12032:51,16384:30,16640:36,16896:37,17152:34,17408:38,17664:32,17920:44,18176:40,18432:39,18688:45,18944:33,19200:41,19456:35,19712:42,19968:43,20224:31,20480:1,20736:5,20992:2,21248:6,21504:3,21760:7,22016:4,22272:8,22528:9,22784:13,23040:10,23296:14,23552:11,23808:15,24064:12,24320:16},vg[32256]={12288:71,12800:72,13312:73,13824:74,14336:75,14848:76,15360:77,15872:78},vg[29248]={24576:79,24640:80,25088:81,25152:82},vg[28700]={28672:93,28676:94,28680:95,28684:96,28688:97,
|
||||
28692:98,28696:99,28700:100},vg),wf=["","I","M","S"],xf=" L E LE A GE N G".split(" "),yf="N NE NA NN Z ZE ZA ZN C CE CA CN O OE OA ON".split(" "),Bf=[{0:85,8:102,4:103,2:104,6:105,1:106},{0:88,4:107,2:108,10:109}],nf=1E3,qf=">> ";Ya(function(){for(var a=x(document,w,"debugger"),b=0;b<a.length;b++){var c=a[b],d=v(c),d=new Re(d);sb(d,c)}});
|
||||
function og(a,b,c,d,e){this.P=b||0;this.R=c;this.i=d;this.done=e;this.j=d.j;this.v={};this.O={};this.G=[];this.I=[];this.w=[];this.M=this.ka=0;this.Ga=this.P;this.F=null;this.b=0;this.C=null;this.J=this.H="";this.u=null;this.ea=this.D="";this.L=0;this.K=a.split(";");wg(this)}
|
||||
function og(a,b,c,d,e){this.P=b||0;this.R=c||"";this.i=d;this.done=e;this.j=d.j;this.v={};this.O={};this.G=[];this.I=[];this.w=[];this.M=this.ka=0;this.Ga=this.P;this.F=null;this.b=0;this.C=null;this.J=this.H="";this.u=null;this.ea=this.D="";this.L=0;this.K=a.split(";");wg(this)}
|
||||
function wg(a){a.L==a.K.length?a.done(xg(a)):Ga(a.K[a.L++],null,!0,function(b,c,d){if(d)a.done(d,b);else{d=c;if(za(b,".html")){d="";var e;for(b=/<pre>([\s\S]*?)<\/pre>/gi;e=b.exec(c);)e=e[1],0<=e.indexOf("&")&&(e=e.replace(/</gi,"<").replace(/>/gi,">").replace(/&/gi,"&")),d+=e;(e=d.match(/&[a-z]+;/i))&&yg(a,"unrecognized HTML entity: "+e[0])}a.ea&&(a.ea+="\n");a.ea+=d;setTimeout(function(){wg(a)},0)}})}
|
||||
function xg(a){if(0<=a.R.indexOf("p"))return a.i.j(a.ea),0;var b=Pe(a.i);try{var c,d=a.ea.split(/\r?\n/);for(c=0;c<d.length&&(a.ka++,zg(a,d[c]+"\r\n"));c++);a.b&&a.error("open block from line "+a.v[a.C].ka);for(c=0;c<a.G.length;c++){var e=a.G[c],f=a.v[e];f?Ag(a,f.ea):a.error("missing definition for literal: "+e)}a.I.forEach(function(b){var c,d=b.Ma[0];c=b.Ma[1];var e=b.Ga;1==b.Ma.length&&(0<=d.indexOf("@")||0<=d.indexOf("("))&&(c=d,d="");null!=c?(c=Cf(a.i,d,c,e),0>c&&a.error("unable to parse instruction: "+
|
||||
function xg(a){if(0<=a.R.indexOf("p"))return a.j(a.ea),0;var b=Pe(a.i);try{var c,d=a.ea.split(/\r?\n/);for(c=0;c<d.length&&(a.ka++,zg(a,d[c]+"\r\n"));c++);a.b&&a.error("open block from line "+a.v[a.C].ka);for(c=0;c<a.G.length;c++){var e=a.G[c],f=a.v[e];f?Ag(a,f.ea):a.error("missing definition for literal: "+e)}a.I.forEach(function(b){var c,d=b.Ma[0];c=b.Ma[1];var e=b.Ga;1==b.Ma.length&&(0<=d.indexOf("@")||0<=d.indexOf("("))&&(c=d,d="");null!=c?(c=Cf(a.i,d,c,e),0>c&&a.error("unable to parse instruction: "+
|
||||
b.Ma[0]+" "+b.Ma[1])):(c=Bg(a,d,e),void 0===c?a.error("unable to parse expression: "+d):void 0===a.w[e]?a.error("undefined fixup location: "+m(e,0,!0)):c+=a.w[e]);b=Ie(a.i,c||0,36,!0);(c<-B||c>=E)&&yg(a,"truncated value "+m(c)+" at location "+m(e)+" to "+m(b));a.w[e]=b})}catch(g){a.j(g.message),a.M=-1}a.i.K=b;return a.M}
|
||||
function zg(a,b){if(a.b){if(1==a.b){var c=b.indexOf(a.J);0<=c?(a.b++,b=b.substr(c+1)):a.error("expected "+a.F+" definition: "+b)}if(1<a.b){for(var c="",d=0;d<b.length;d++)if(b[d]==a.J)a.b++;else if(b[d]==a.H&&(a.b--,1==a.b)){a.b=0;c=b.substr(d+1);b=b.substr(0,d);break}d=a.C||"";a.v[d].ea+=b;a.b||(a.C=null,Cg(a,d));b=c}if(a.b)return!0}null!=a.u&&(b=Dg(a,b));c=b.match(/\s*([A-Z$%._][0-9A-Z$%.]*[:=]|)\s*([A-Z$%.][0-9A-Z$%.]*|)\s*([^;]+|)\s*(;?.*)/i);if(!c||c[4]&&";"!=c[4].slice(0,1))return a.error("failed to parse line: "+
|
||||
b),!1;d=c[1];b=c[2].toUpperCase();c=c[3].trim();if(d){var e=d.slice(-1),d=d.slice(0,-1);":"==e?Eg(a,d,a.Ga,!0):(c=b+c,b=e)}a.F=b;c=c.trim();"="==c[0]&&(d=b,c=c.substr(1),b="=");for(var e=c,f=0,g=null,h=0,k=-1;h<e.length;){var n=e[h];"["==n&&(f++||(k=h));h++;if("]"==n&&0>=--f)break}0>f&&a.error("missing bracket(s): "+e);0<=k&&(g=e.substr(k,h-k));for((e=g)&&(c=c.replace(e,Fg(a,Gg,e)));e=Hg(a,c);)c=c.replace(e,e.slice(0,-1));if(!Cg(a,b,c))switch(b){case "":c&&Ig(a,0,[c]);break;case "=":b=d;d=Bg(a,c);
|
||||
|
|
|
|||
Loading…
Reference in a new issue