Moved PDP-11 console I/O to SerialPort component

This commit is contained in:
Jeff 2016-10-04 14:02:39 -07:00 committed by Jeff Parsons
commit d90d10ea52
15 changed files with 1241 additions and 561 deletions

View file

@ -22,7 +22,7 @@ function ob(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1
function rb(a,b,c){var d;b&&(void 0===d&&(d="Panel"),(d=pb(d,a.id))&&(b=d.qa[b])&&a.Pb(null,c,b))}function sb(a,b){b=tb(b.parentNode,"pcx86-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pcx86-binding":(g=qb(f))&&g.binding&&a.Pb(g.type,g.binding,f,g.value),k=h.length}}}}
function tb(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
bb.prototype={constructor:bb,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Pb:function(a,b,c){switch(b){case "clear":return this.qa[b]||(this.qa[b]=c,c.onclick=function(a){return function(){a.qa.print&&(a.qa.print.value="")}}(this)),!0;case "print":return this.qa[b]||(this.Gf=this.qa[b]=c,c.value="",this.O=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.Na=function(a){this.O(a,this.xd)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.xd+": "+a)},Na:function(a,b,c){c=c||this.type;b||w((c?c+": ":"")+a)},hc:function(){return this.la.ic=!0},gc:function(a,b){b&&(this.la.ic=!1);return!0}};function x(a,b,c,d,e,f,g){a.ha&&(!0===g?g=0:null==g&&(g=a.wc),ub(a.ha,a,b,c,d,e,f,g))}function y(a,b,c,d){a.ha&&(!0===c||z(a,c|0))&&a.ha.message(b,d)}
this.Na=function(a){this.O(a,this.xd)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.xd+": "+a)},Na:function(a,b,c){c=c||this.type;b||w((c?c+": ":"")+a)},hc:function(){return this.la.ic=!0},gc:function(a,b){b&&(this.la.ic=!1);return!0}};function x(a,b,c,d,e,f,g){a.ha&&(!0===g?g=0:null==g&&(g=a.wc),ub(a.ha,a,b,c,d,e,f,g))}function y(a,b,c,d){a.ha&&(!0===c||z(a,c|0))&&a.ha.message(b,d||!0===c)}
function z(a,b){if(a.ha){a===a.ha?b|=0:b=b||a.wc;var c=a.ha.wc&b;return!!b&&c===b||!!(c&a.ha.pl)}return!1}function vb(a,b){if(a.la.hh)return a.la.Ff=!1,a.la.hh=!1;if(a.la.error)return a.O(a.toString()+" error"),!1;a.la.Ff=b;return a.la.Ff}function wb(a,b){a.la.Ff&&(b?a.la.hh=!0:void 0===b&&a.O(a.toString()+" busy"));return a.la.Ff}function xb(a,b){a.la.error||(a.la.ready=!1!==b,a.la.ready&&(b=a.yg,a.yg=null,b&&b()))}function yb(a,b){b&&(a.la.ready?b():a.yg=b);return a.la.ready}
function zb(a,b){a.la.error=!0;a.Na(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
@ -658,12 +658,12 @@ l.Le=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;
function dq(a,b){if(a.errorCode)return-1;do{if(a.pb&&a.za.write(a.pb,a.eb++,b))break;a.za&&a.za.seek(a.be,a.kb,a.xb+a.rg,!0,function(b){a.pb=b});if(!a.pb){a.errorCode=20;b=-1;break}a.eb=0;lq(a)}while(1);return b}function lq(a){a.xb++;var b=1-a.rg;a.xb>=a.lb+b&&(a.xb=b,a.kb++,a.kb>=a.ub&&(a.kb=0,a.be++))}l.Nm=function(){var a=this.F.M&255;!(this.F.G>>8)&&128<a&&(this.ka=a-128);return!0};l.Om=function(){var a;(a=this.F.G>>8||!this.N)||(a=!(this.N.vc[0].Ad&64));return a?!0:!1};
var Tp={800:Pp.prototype.Lm,801:Pp.prototype.Mm,802:Pp.prototype.Km},Sp={496:Pp.prototype.il,497:Pp.prototype.Sl,498:Pp.prototype.Ul,499:Pp.prototype.Vl,500:Pp.prototype.Ql,501:Pp.prototype.Pl,502:Pp.prototype.Rl,503:Pp.prototype.Wl},Vp={800:Pp.prototype.ho,801:Pp.prototype.ko,802:Pp.prototype.jo,803:Pp.prototype.io,807:Pp.prototype.pi,811:Pp.prototype.pi,815:Pp.prototype.pi},Up={496:Pp.prototype.qn,497:Pp.prototype.vn,498:Pp.prototype.tn,499:Pp.prototype.un,500:Pp.prototype.pn,501:Pp.prototype.on,
502:Pp.prototype.rn,503:Pp.prototype.nn,1014:Pp.prototype.sn};Xa(function(){for(var a=tb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new Pp(d);sb(d,c)}});function mq(a){bb.call(this,"Debugger",a,mq);this.Ya=a.base||16;this.pa=this.Ca=this.ea=0;this.va=!1;this.A=-1;this.C=[];this.ya={}}jb(mq);var nq={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};mq.prototype.oh=function(){return-1};mq.prototype.ph=function(){};
mq.prototype.Pk=function(a,b){return a.replace("["+b+"]","unimplemented")};mq.prototype.Ng=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.va?a="end":a=this.C[this.A+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(qa(a.substring(d,f))),d=f+1}}return b};
mq.prototype.Pk=function(a,b){return a.replace("["+b+"]","unimplemented")};mq.prototype.Ng=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.va?a="end":a=this.C[this.A+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(qa(a.substring(d,f))),d=f+1}}return b};
function oq(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
function pq(a,b,c){var d;if(b){b=qq(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],t=n.length,n=qa(n);if(!n){f=!0;break}n=rq(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],q=n.length;k.length&&nq[n]<nq[k[k.length-1]]&&oq(h,k,1);k.push(n);b=b.substr(t+q)}oq(h,k)&&1==h.length||(f=!0);f?c&&a.O("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&sq(a,null,
d))}return d}function qq(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=pq(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?tq(a,e):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=a.Pk(b,c[1]);for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.pa-a.Ca}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
function rq(a,b,c,d){var e;null!=b?(e=a.oh(b),0<=e?e=a.ph(e):(e=a.ya[b],null==e&&(e=ea(b,a.Ya))),null!=e||d||a.O("invalid "+(c?c:"value")+": "+b)):d||a.O("missing "+(c||"value"));return e}function sq(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d=r(c,0,!0)+" "+c+". "+ia(c,0,!0)+" "+ha(c,0,!0));a.O((null!=b?b+": ":"")+d);return e}function uq(a,b){if(b)return sq(a,b,a.ya[b]);var c=0;for(b in a.ya)sq(a,b,a.ya[b]),c++;return 0<c}
function rq(a,b,c,d){var e;null!=b?(e=a.oh(b),0<=e?e=a.ph(e):(e=a.ya[b],null==e&&(e=ea(b,a.Ya))),null!=e||d||a.O("invalid "+(c?c:"value")+": "+b)):d||a.O("missing "+(c||"value"));return e}function sq(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d=r(c,0,!0)+" "+c+". "+ia(c,0,!0)+" "+ha(c,0,!0),32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'"));a.O((null!=b?b+": ":"")+d);return e}function uq(a,b){if(b)return sq(a,b,a.ya[b]);var c=0;for(b in a.ya)sq(a,b,a.ya[b]),c++;return 0<c}
function tq(a,b){switch(a.Ya){case 8:a=ia(b,NaN);break;case 10:a=b.toString();break;default:a=r(b,NaN)}return a}function vq(a){mq.call(this,a);this.Ja=4;this.Da=5;this.Ba=1048575;this.aa=wq(this);this.Db=wq(this);this.ua=wq(this);this.N=[];this.B=this.ra=this.fa=[];xq(this);this.Oa=0;yq(this);this.cb={};zq(this,a.messages);this.qb=a.commands;var b=this;window?void 0===window.pcx86&&(window.pcx86=function(a){return Aq(b,a)}):void 0===global.pcx86&&(global.pcx86=function(a){return Aq(b,a)})}jb(vq,mq);
var Bq={16:262144,19:524288,21:32768,22:65536,28:2048,33:134217728,51:16777216},Cq=[26,28,40,42,109],Dq={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",l:"load sector(s)",ln:"list nearest symbol(s)",m:"messages",mouse:"mouse action","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",
"t [#]":"trace","u [#]":"unassemble",x:"execution options",v:"print version","var":"assign variable"},Eq="INVALID AAA AAD AAM AAS ADC ADD AND ARPL AS: BOUND BSF BSR BT BTC BTR BTS CALL CBW CLC CLD CLI CLTS CMC CMP CMPSB CMPSW CS: CWD DAA DAS DEC DIV DS: ENTER ES: ESC FS: GS: HLT IBTS IDIV IMUL IN INC INS INT INT3 INTO IRET JBE JC JCXZ JG JGE JL JLE JMP JA JNC JNO JNP JNS JNZ JO JP JS JZ LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT LLDT LMSW LOADALL LOCK LODSB LODSW LOOP LOOPNZ LOOPZ LSL LSS LTR MOV MOVSB MOVSW MOVSX MOVZX MUL NEG NOP NOT OR OS: OUT OUTS POP POPA POPF PUSHF PUSHA PUSH RCL RCR REPNZ REPZ RET RETF ROL ROR SAHF SALC SAR SBB SCASB SCASW SETBE SETC SETG SETGE SETL SETLE SETNBE SETNC SETNO SETNP SETNS SETNZ SETO SETP SETS SETZ SGDT SHL SHLD SHR SHRD SIDT SLDT SMSW SS: STC STD STI STOSB STOSW STR SUB TEST VERR VERW WAIT XBTS XCHG XLAT XOR".split(" "),