From 6c4f8f4bb3b34535804f61931d015431f1a1401c Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 18 Oct 2016 16:53:20 -0700 Subject: [PATCH] Code in place for parsing tape data when "load" (as opposed to "attach") is requested --- apps/pdp11/tapes/demo.xml | 1 + modules/pdp11/lib/pc11.js | 144 +++++++++++------ versions/pdpjs/1.30.1/pdp11-dbg.js | 248 ++++++++++++++--------------- versions/pdpjs/1.30.1/pdp11.js | 82 +++++----- 4 files changed, 258 insertions(+), 217 deletions(-) diff --git a/apps/pdp11/tapes/demo.xml b/apps/pdp11/tapes/demo.xml index 9e54a95d8..626585617 100644 --- a/apps/pdp11/tapes/demo.xml +++ b/apps/pdp11/tapes/demo.xml @@ -6,6 +6,7 @@ + Attach Load diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index 7f4fd1b0a..2d387948a 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -56,15 +56,12 @@ function PC11(parms) this.configMount = parms['autoMount'] || null; this.cAutoMount = 0; - /* - * TODO: Technically, the PC11 should have a timer that "clocks" data from the aTapeData buffer into the - * PRB register at the appropriate rate (300 CPS for the high-speed version, 10 CPS for the low-speed version). - */ this.prs = 0; // PRS register this.prb = 0; // PRB register this.iTapeData = 0; // buffer index this.aTapeData = []; // buffer for the PRB register - this.sLoadState = PC11.LOADSTATE.NONE; + this.sTapeSource = PC11.SOURCE.NONE; + this.nTapeTarget = PC11.TARGET.NONE; this.sTapeName = this.sTapePath = ""; /* @@ -80,12 +77,18 @@ Component.subclass(PC11); /* * There's nothing super special about these values, except that NONE should be falsey and the others should not. */ -PC11.LOADSTATE = { +PC11.SOURCE = { NONE: "", LOCAL: "?", REMOTE: "??" }; +PC11.TARGET = { + NONE: 0, + READER: 1, + MEMORY: 2 +}; + /** * setBinding(sType, sBinding, control, sValue) * @@ -99,12 +102,12 @@ PC11.LOADSTATE = { PC11.prototype.setBinding = function(sType, sBinding, control, sValue) { var pc11 = this; + var nTapeTarget = PC11.TARGET.NONE; switch (sBinding) { case "listTapes": this.bindings[sBinding] = control; - control.onchange = function onChangeListTapes(event) { var controlDesc = pc11.bindings["descTape"]; var controlOption = control.options[control.selectedIndex]; @@ -131,15 +134,24 @@ PC11.prototype.setBinding = function(sType, sBinding, control, sValue) this.bindings[sBinding] = control; return true; + /* + * "loadTape" operation must do pretty much everything that the "attachTape" does, but whereas the attach + * operation records the bytes in aTapeData, the load operation stuffs them directly into the machine's memory; + * the former sets nTapeTarget to TARGET.READER, while the latter sets it to TARGET.MEMORY. + */ case "loadTape": - this.bindings[sBinding] = control; + nTapeTarget = PC11.TARGET.MEMORY; + /* falls through */ + case "attachTape": + if (!nTapeTarget) nTapeTarget = PC11.TARGET.READER; + this.bindings[sBinding] = control; control.onclick = function onClickLoadTape(event) { var controlTapes = pc11.bindings["listTapes"]; if (controlTapes) { var sTapeName = controlTapes.options[controlTapes.selectedIndex].text; var sTapePath = controlTapes.value; - pc11.loadSelectedTape(sTapeName, sTapePath); + pc11.loadSelectedTape(sTapeName, sTapePath, nTapeTarget); } }; return true; @@ -175,7 +187,10 @@ PC11.prototype.setBinding = function(sType, sBinding, control, sValue) if (file) { var sTapePath = file.name; var sTapeName = str.getBaseName(sTapePath, true); - pc11.loadSelectedTape(sTapeName, sTapePath, file); + /* + * TODO: Provide a way to mount tapes into MEMORY as well as READER. + */ + pc11.loadSelectedTape(sTapeName, sTapePath, PC11.TARGET.READER, file); } /* * Prevent reloading of web page after form submission @@ -233,9 +248,9 @@ PC11.prototype.initBus = function(cmp, bus, cpu, dbg) bus.addIOTable(this, PC11.UNIBUS_IOTABLE); - this.addTape("None", PC11.LOADSTATE.NONE, true); - if (this.fLocalTapes) this.addTape("Local Tape", PC11.LOADSTATE.LOCAL); - this.addTape("Remote Tape", PC11.LOADSTATE.REMOTE); + this.addTape("None", PC11.SOURCE.NONE, true); + if (this.fLocalTapes) this.addTape("Local Tape", PC11.SOURCE.LOCAL); + this.addTape("Remote Tape", PC11.SOURCE.REMOTE); if (!this.autoMount()) this.setReady(); }; @@ -298,7 +313,10 @@ PC11.prototype.autoMount = function(fRemount) var sTapePath = this.configMount['path']; var sTapeName = this.configMount['name'] || this.findTape(sTapePath); if (sTapePath && sTapeName) { - if (!this.loadTape(sTapeName, sTapePath, true) && fRemount) { + /* + * TODO: Provide a way to autoMount tapes into MEMORY as well as READER. + */ + if (!this.loadTape(sTapeName, sTapePath, PC11.TARGET.READER, true) && fRemount) { this.setReady(false); } } else { @@ -309,28 +327,28 @@ PC11.prototype.autoMount = function(fRemount) }; /** - * loadSelectedTape(sTapeName, sTapePath, file) + * loadSelectedTape(sTapeName, sTapePath, nTapeTarget, file) * * @this {PC11} * @param {string} sTapeName * @param {string} sTapePath + * @param {number} nTapeTarget * @param {File} [file] is set if there's an associated File object */ -PC11.prototype.loadSelectedTape = function(sTapeName, sTapePath, file) +PC11.prototype.loadSelectedTape = function(sTapeName, sTapePath, nTapeTarget, file) { if (!sTapePath) { this.unloadTape(false); return; } - if (sTapePath == PC11.LOADSTATE.LOCAL) { + if (sTapePath == PC11.SOURCE.LOCAL) { this.notice('Use "Choose File" and "Mount" to select and load a local tape.'); return; } - /* - * If the special PC11.LOADSTATE.REMOTE path is selected, then we want to prompt the user for a URL. + * If the special PC11.SOURCE.REMOTE path is selected, then we want to prompt the user for a URL. * Oh, and make sure we pass an empty string as the 2nd parameter to prompt(), so that IE won't display * "undefined" -- because after all, undefined and "undefined" are EXACTLY the same thing, right? * @@ -338,36 +356,37 @@ PC11.prototype.loadSelectedTape = function(sTapeName, sTapePath, file) * I should do, like dynamically updating "listTapes" to include new entries, and adding new entries * to the save/restore data. */ - if (sTapePath == PC11.LOADSTATE.REMOTE) { + if (sTapePath == PC11.SOURCE.REMOTE) { sTapePath = window.prompt("Enter the URL of a remote tape image.", "") || ""; if (!sTapePath) return; sTapeName = str.getBaseName(sTapePath); if (DEBUG) this.println("Attempting to load " + sTapePath + " as \"" + sTapeName + "\""); - this.sLoadState = PC11.LOADSTATE.REMOTE; + this.sTapeSource = PC11.SOURCE.REMOTE; } else { - this.sLoadState = sTapePath; + this.sTapeSource = sTapePath; } - this.loadTape(sTapeName, sTapePath, false, file); + this.loadTape(sTapeName, sTapePath, nTapeTarget, false, file); }; /** - * loadTape(sTapeName, sTapePath, fAutoMount, file) + * loadTape(sTapeName, sTapePath, nTapeTarget, fAutoMount, file) * * NOTE: If sTapePath is already loaded, nothing needs to be done. * * @this {PC11} * @param {string} sTapeName * @param {string} sTapePath + * @param {number} nTapeTarget * @param {boolean} [fAutoMount] * @param {File} [file] is set if there's an associated File object * @return {number} 1 if tape loaded, 0 if queued up (or busy), -1 if already loaded */ -PC11.prototype.loadTape = function(sTapeName, sTapePath, fAutoMount, file) +PC11.prototype.loadTape = function(sTapeName, sTapePath, nTapeTarget, fAutoMount, file) { var nResult = -1; - if (this.sTapePath.toLowerCase() != sTapePath.toLowerCase()) { + if (this.sTapePath.toLowerCase() != sTapePath.toLowerCase() || this.nTapeTarget != nTapeTarget) { nResult++; this.unloadTape(true); @@ -381,27 +400,28 @@ PC11.prototype.loadTape = function(sTapeName, sTapePath, fAutoMount, file) this.cAutoMount++; if (this.messageEnabled()) this.printMessage("auto-loading tape: " + sTapeName); } - if (this.load(sTapeName, sTapePath, file)) { + if (this.load(sTapeName, sTapePath, nTapeTarget, file)) { nResult++; } else { this.flags.busy = true; } } } - if (DEBUG && nResult) this.println("tape loaded"); + if (DEBUG && nResult) this.println(this.nTapeTarget == PC11.TARGET.READER? "tape attached" : "tape loaded"); return nResult; }; /** - * load(sTapeName, sTapePath, file) + * load(sTapeName, sTapePath, nTapeTarget, file) * * @this {PC11} * @param {string} sTapeName * @param {string} sTapePath + * @param {number} nTapeTarget * @param {File} [file] is set if there's an associated File object * @return {boolean} true if load completed (successfully or not), false if queued */ -PC11.prototype.load = function(sTapeName, sTapePath, file) +PC11.prototype.load = function(sTapeName, sTapePath, nTapeTarget, file) { var pc11 = this; var sTapeURL = sTapePath; @@ -414,7 +434,7 @@ PC11.prototype.load = function(sTapeName, sTapePath, file) if (file) { var reader = new FileReader(); reader.onload = function() { - pc11.doneRead(sTapeName, sTapePath, reader.result); + pc11.doneRead(sTapeName, sTapePath, nTapeTarget, reader.result); }; reader.readAsArrayBuffer(file); return true; @@ -440,21 +460,22 @@ PC11.prototype.load = function(sTapeName, sTapePath, file) } return !!web.getResource(sTapeURL, null, true, function(sURL, sResponse, nErrorCode) { - pc11.doneLoad(sTapeName, sTapePath, sResponse, sURL, nErrorCode); + pc11.doneLoad(sTapeName, sTapePath, nTapeTarget, sResponse, sURL, nErrorCode); }); }; /** - * doneLoad(sTapeName, sTapePath, sTapeData, sURL, nErrorCode) + * doneLoad(sTapeName, sTapePath, sTapeData, nTapeTarget, sURL, nErrorCode) * * @this {PC11} * @param {string} sTapeName * @param {string} sTapePath * @param {string} sTapeData + * @param {number} nTapeTarget * @param {string} sURL * @param {number} nErrorCode (response from server if anything other than 200) */ -PC11.prototype.doneLoad = function(sTapeName, sTapePath, sTapeData, sURL, nErrorCode) +PC11.prototype.doneLoad = function(sTapeName, sTapePath, nTapeTarget, sTapeData, sURL, nErrorCode) { var fPrintOnly = (nErrorCode < 0 && this.cmp && !this.cmp.flags.powered); @@ -475,11 +496,7 @@ PC11.prototype.doneLoad = function(sTapeName, sTapePath, sTapeData, sURL, nError Component.addMachineResource(this.idMachine, sURL, sTapeData); var resource = web.parseMemoryResource(sURL, sTapeData); if (resource) { - this.sTapeName = sTapeName; - this.sTapePath = sTapePath; - this.iTapeData = 0; - this.aTapeData = resource.aBytes; - if (DEBUG) this.println("tape loaded: " + sTapeName); + this.parseTape(sTapeName, sTapePath, nTapeTarget, resource.aBytes); } } this.flags.busy = false; @@ -491,22 +508,20 @@ PC11.prototype.doneLoad = function(sTapeName, sTapePath, sTapeData, sURL, nError }; /** - * doneRead(sTapeName, sTapePath, buffer) + * doneRead(sTapeName, sTapePath, nTapeTarget, buffer) * * @this {PC11} * @param {string} sTapeName * @param {string} sTapePath + * @param {number} nTapeTarget * @param {?} buffer (we KNOW this is an ArrayBuffer, but we can't seem to convince the Closure Compiler) */ -PC11.prototype.doneRead = function(sTapeName, sTapePath, buffer) +PC11.prototype.doneRead = function(sTapeName, sTapePath, nTapeTarget, buffer) { if (buffer) { - this.sTapeName = sTapeName; - this.sTapePath = sTapePath; - this.iTapeData = 0; - this.aTapeData = new Uint8Array(buffer, 0, buffer.byteLength); - this.sLoadState = PC11.LOADSTATE.LOCAL; - if (DEBUG) this.println("tape length: " + this.aTapeData.length); + var aBytes = new Uint8Array(buffer, 0, buffer.byteLength); + this.parseTape(sTapeName, sTapePath, nTapeTarget, aBytes); + this.sTapeSource = PC11.SOURCE.LOCAL; } this.displayTape(); }; @@ -568,7 +583,7 @@ PC11.prototype.displayTape = function() { var controlTapes = this.bindings["listTapes"]; if (controlTapes && controlTapes.options) { - var sTargetPath = this.sLoadState || this.sTapePath; + var sTargetPath = this.sTapeSource || this.sTapePath; for (var i = 0; i < controlTapes.options.length; i++) { if (controlTapes.options[i].value == sTargetPath) { if (controlTapes.selectedIndex != i) { @@ -581,6 +596,29 @@ PC11.prototype.displayTape = function() } }; +/** + * parseTape(sTapeName, sTapePath, nTapeTarget, aBytes) + * + * @this {PC11} + * @param {string} sTapeName + * @param {string} sTapePath + * @param {number} nTapeTarget + * @param {Array|Uint8Array} aBytes + */ +PC11.prototype.parseTape = function(sTapeName, sTapePath, nTapeTarget, aBytes) +{ + this.sTapeName = sTapeName; + this.sTapePath = sTapePath; + this.nTapeTarget = nTapeTarget; + if (nTapeTarget == PC11.TARGET.MEMORY) { + if (DEBUG) this.println("tape loaded: " + sTapeName); + return; + } + this.iTapeData = 0; + this.aTapeData = aBytes; + if (DEBUG) this.println("tape attached: " + sTapeName); +}; + /** * unloadTape(fLoading) * @@ -593,12 +631,13 @@ PC11.prototype.unloadTape = function(fLoading) this.sTapeName = ""; this.sTapePath = ""; /* - * Try to avoid any unnecessary hysteresis regarding the display if this unload is merely a prelude to another load. + * Avoid any unnecessary hysteresis regarding the display if this unload is merely a prelude to another load. */ if (!fLoading) { - this.sLoadState = PC11.LOADSTATE.NONE; + this.sTapeSource = PC11.SOURCE.NONE; this.displayTape(); - if (DEBUG) this.println("tape unloaded"); + if (DEBUG && this.nTapeTarget) this.println(this.nTapeTarget == PC11.TARGET.READER? "tape detached" : "tape unloaded"); + this.nTapeTarget = PC11.TARGET.NONE; } } }; @@ -653,7 +692,8 @@ PC11.prototype.advanceReader = function() } /* * The PC11, by virtue of its "high speed", is supposed to deliver characters at 300 CPS, - * so for now, that's what we're going to deliver (ie, 1000ms / 300). + * so for now, that's what we're going to deliver (ie, 1000ms / 300). The original "low speed" + * version of the reader ran at 10 CPS. * * TODO: Review this code. If we don't set the fReset parameter to true, the timer will eventually * fire while the "Absolute Loader" tape is still reading bytes from, say, the "BASIC (Single User)" diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index 500b57c44..168351604 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -70,10 +70,10 @@ function ec(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.b.ab)){var function gc(a,b){a.A||(a.i&&D(a.i,536870912)&&C(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Db:20,gd:0};this.f={Td:0,Rb:-1}}u(K);h=K.prototype; h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Rb=hc(c,function(){e.f.Ka|=128;e.f.Ka&64&&(qc(e.b,e.f.hd),rc(e.b,e.f.Rb,1E3/60))});this.f.hd=sc(64,6);ec(b,this,L);fc(b,this.reset.bind(this));H(this)};h.reset=function(){this.g.Db=this.g.Db&-120|20;this.f.Ka=0};h.Dc=function(){var a=this.f.Ka;this.f.Ka&=-129;return a};h.rd=function(a){this.f.Ka=a;a&64&&rc(this.b,this.f.Rb,1E3/60);this.f.Ka=a&-129};h.wc=function(a){return(a?this.g.gd:this.g.data)&65535}; h.kd=function(a){this.g.data=a};h.Fc=function(){var a=this.b;return a.F&62337|a.wa<<5|a.xa<<1};h.td=function(a){var b=this.b;a&=62337;if(b.F!=a){b.F=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.La!=c&&(b.La=c,tc(b))}uc(this)};h.Gc=function(){var a=this.b.Na;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hc=function(){return this.b.tb};h.Ic=function(){return this.b.Oa}; -h.ud=function(a){var b=this.b;1170>b.ab&&(a&=-49);b.Oa!=a&&(b.Oa=a,a&16?(b.Za=4194303,b.ya=3915776):(b.Za=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.La?a.b.Oa&16?1:2:4)}h.Wc=function(a){return this.b.S[1][a>>1&7]};h.Id=function(a,b){this.b.S[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.S[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.S[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.ta[1][a>>1&7]}; -h.Hd=function(a,b){b=b>>1&7;this.b.ta[1][b]=a;this.b.S[1][b]&=65295};h.Tc=function(a){return this.b.ta[1][(a>>1&7)+8]};h.Fd=function(a,b){b=(b>>1&7)+8;this.b.ta[1][b]=a;this.b.S[1][b]&=65295};h.Cc=function(a){return this.b.S[0][a>>1&7]};h.qd=function(a,b){this.b.S[0][b>>1&7]=a&65295};h.Ac=function(a){return this.b.S[0][(a>>1&7)+8]};h.od=function(a,b){this.b.S[0][(b>>1&7)+8]=a&65295};h.Bc=function(a){return this.b.ta[0][a>>1&7]};h.pd=function(a,b){b=b>>1&7;this.b.ta[0][b]=a;this.b.S[0][b]&=65295}; -h.zc=function(a){return this.b.ta[0][(a>>1&7)+8]};h.nd=function(a,b){b=(b>>1&7)+8;this.b.ta[0][b]=a;this.b.S[0][b]&=65295};h.bd=function(a){return this.b.S[3][a>>1&7]};h.Od=function(a,b){this.b.S[3][b>>1&7]=a&65295};h.$c=function(a){return this.b.S[3][(a>>1&7)+8]};h.Md=function(a,b){this.b.S[3][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.b.ta[3][a>>1&7]};h.Nd=function(a,b){b=b>>1&7;this.b.ta[3][b]=a;this.b.S[3][b]&=65295};h.Zc=function(a){return this.b.ta[3][(a>>1&7)+8]}; -h.Ld=function(a,b){b=(b>>1&7)+8;this.b.ta[3][b]=a;this.b.S[3][b]&=65295};h.fb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.kb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.gb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; +h.ud=function(a){var b=this.b;1170>b.ab&&(a&=-49);b.Oa!=a&&(b.Oa=a,a&16?(b.Za=4194303,b.ya=3915776):(b.Za=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Db=a.g.Db&-8|(a.b.La?a.b.Oa&16?1:2:4)}h.Wc=function(a){return this.b.T[1][a>>1&7]};h.Id=function(a,b){this.b.T[1][b>>1&7]=a&65295};h.Uc=function(a){return this.b.T[1][(a>>1&7)+8]};h.Gd=function(a,b){this.b.T[1][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.ta[1][a>>1&7]}; +h.Hd=function(a,b){b=b>>1&7;this.b.ta[1][b]=a;this.b.T[1][b]&=65295};h.Tc=function(a){return this.b.ta[1][(a>>1&7)+8]};h.Fd=function(a,b){b=(b>>1&7)+8;this.b.ta[1][b]=a;this.b.T[1][b]&=65295};h.Cc=function(a){return this.b.T[0][a>>1&7]};h.qd=function(a,b){this.b.T[0][b>>1&7]=a&65295};h.Ac=function(a){return this.b.T[0][(a>>1&7)+8]};h.od=function(a,b){this.b.T[0][(b>>1&7)+8]=a&65295};h.Bc=function(a){return this.b.ta[0][a>>1&7]};h.pd=function(a,b){b=b>>1&7;this.b.ta[0][b]=a;this.b.T[0][b]&=65295}; +h.zc=function(a){return this.b.ta[0][(a>>1&7)+8]};h.nd=function(a,b){b=(b>>1&7)+8;this.b.ta[0][b]=a;this.b.T[0][b]&=65295};h.bd=function(a){return this.b.T[3][a>>1&7]};h.Od=function(a,b){this.b.T[3][b>>1&7]=a&65295};h.$c=function(a){return this.b.T[3][(a>>1&7)+8]};h.Md=function(a,b){this.b.T[3][(b>>1&7)+8]=a&65295};h.ad=function(a){return this.b.ta[3][a>>1&7]};h.Nd=function(a,b){b=b>>1&7;this.b.ta[3][b]=a;this.b.T[3][b]&=65295};h.Zc=function(a){return this.b.ta[3][(a>>1&7)+8]}; +h.Ld=function(a,b){b=(b>>1&7)+8;this.b.ta[3][b]=a;this.b.T[3][b]&=65295};h.fb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.kb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};h.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};h.Qc=function(){return this.b.u[7]};h.Cd=function(a){this.b.u[7]=a};h.gb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; h.lb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};h.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};h.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};h.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};h.yc=function(a){return this.b.gc[a-65504>>1]};h.md=function(a,b){this.b.gc[b-65504>>1]=a};h.dc=function(a){return 65520==a?61183:0};h.jc=function(){}; h.Yc=function(){return 1};h.Kd=function(){};h.xc=function(){return this.b.Z};h.ld=function(){this.b.Z=0};h.Ec=function(){return this.b.fc};h.sd=function(a,b){b&1||(a&=255);this.b.fc=a};h.Jc=function(a){return a?this.b.Pb:0};h.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Pb=a;b.G|=2};h.Xc=function(a){return a?this.b.Pa&65280:0};h.Jd=function(a){this.b.Pa=a|255};h.Mc=function(){return Lb(this.b)};h.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.G|=128}; h.ic=function(a,b){D(this)&&C(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; @@ -92,10 +92,10 @@ var Bc=0,Cc=2,Zb=4,bc=["NONE","RAM","ROM","VID","H/W"],Ac=0; I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a,b){a&1&&gc(this.w,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},sa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]= this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ja=!0},O:function(a,b){if(this.i&&null!=this.C){var c=this.i;Kc(c,this.C+a,1,c.M)&&c.da(!0)}return this.Mb(a,b)},ba:function(a,b){if(this.i&&null!=this.C){var c=this.i;Kc(c,this.C+a,2,c.M)&&c.da(!0)}return this.Nb(a,b)},qa:function(a,b,c){if(this.i&&null!=this.C){var d=this.i;Kc(d,this.C+a, -1,d.B)&&d.da(!0)}this.f?this.D(a,b,c):this.Sb(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.C){var d=this.i;Kc(d,this.C+a,2,d.B)&&d.da(!0)}this.f?this.D(a,b,c):this.Tb(a,b,c)},N:function(a){return this.B[a]},U:function(a,b){a=this.B[a];this.i&&D(this.i,128)&&C(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&gc(this.w,b);return this.F.getUint16(a,!0)},fa:function(a,b){a&1&&gc(this.w,b);a=this.I[a>>1];this.i&&D(this.i,128)&&C(this.i,"Memory.readWord("+ +1,d.B)&&d.da(!0)}this.f?this.D(a,b,c):this.Sb(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.C){var d=this.i;Kc(d,this.C+a,2,d.B)&&d.da(!0)}this.f?this.D(a,b,c):this.Tb(a,b,c)},N:function(a){return this.B[a]},P:function(a,b){a=this.B[a];this.i&&D(this.i,128)&&C(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&gc(this.w,b);return this.F.getUint16(a,!0)},fa:function(a,b){a&1&&gc(this.w,b);a=this.I[a>>1];this.i&&D(this.i,128)&&C(this.i,"Memory.readWord("+ J(this.i,b)+"): "+J(this.i,a),!0);return a},pa:function(a,b){this.B[a]=b;this.Ja=!0},Ra:function(a,b,c){this.B[a]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&gc(this.w,c);this.F.setUint16(a,b,!0);this.Ja=!0},ya:function(a,b,c){a&1&&gc(this.w,c);this.I[a>>1]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; function Sb(a,b,c){a.i=b;a.g=a.J=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.J=c.J)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.J||(a.Hb=a.f?a.D:a.Sb,a.wb=a.f?a.H:a.Tb):--a.g||(a.Eb=a.Mb,a.oa=a.Nb)}function Hc(a,b,c){c&&a.J||(a.Hb=!a.f&&b[1]||a.D,a.wb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Sb=b[1]||a.D,a.Tb=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Eb=b[0]||a.K,a.oa=b[2]||a.M);if(c||void 0===c)a.Mb=b[0]||a.K,a.Nb=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)} -var Mc=[],Gc=[I.prototype.V,I.prototype.sa,I.prototype.ma,I.prototype.Wa],Ic=[I.prototype.O,I.prototype.qa,I.prototype.ba,I.prototype.xa];if(sb)var Fc=[I.prototype.N,I.prototype.pa,I.prototype.aa,I.prototype.wa],Ec=[I.prototype.U,I.prototype.Ra,I.prototype.fa,I.prototype.ya]; +var Mc=[],Gc=[I.prototype.V,I.prototype.sa,I.prototype.ma,I.prototype.Wa],Ic=[I.prototype.O,I.prototype.qa,I.prototype.ba,I.prototype.xa];if(sb)var Fc=[I.prototype.N,I.prototype.pa,I.prototype.aa,I.prototype.wa],Ec=[I.prototype.P,I.prototype.Ra,I.prototype.fa,I.prototype.ya]; function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.Ma=c;this.Ya=Math.round(this.Ga/1E4)/100;this.Ua=this.Ya*this.Ma;this.v.ca=!1;this.v.Qb=!1;this.v.mb=a.autoStart;this.v.$a=!1;this.qb=this.ma=0;this.rb=a.csStart;this.bb=a.csInterval;this.cb=a.csStop;this.K=[];this.bc=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];h=Nc.prototype; h.Ca=function(a,b,c,d){this.D=a;this.w=b;this.i=d;for(b=0;bd[0]||b>d[0]&&( h.fd=function(){if(this.v.ca){this.nb>=this.Ga&&Xc(this,!0);this.sa=0;this.Fa=za();if(this.aa){var a=this.Fa-this.aa;a>this.Ab&&(this.N+=a,this.N>this.Fa&&(this.N=this.Fa))}try{do{var b=Zc(this,this.v.$a?1:this.Qa);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.sa+=b;this.O+=b;Tc(this,b);$c(this,b);this.pa-=b;if(0>=this.pa){this.pa+=this.Qa;15<=++this.Cb&&(this.D&&this.D.$(),this.Cb=0);break}}while(this.v.ca)}catch(e){this.da();this.D&&this.D.stop(za(),Uc(this));rb(this, e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.bc;this.aa=za();var c=this.Ab;this.sa&&(c=Math.round(c*this.sa/this.Qa));var c=c-(this.aa-this.Fa),d=this.aa-this.N;d&&(this.V=Math.round(this.O/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.Vc&&(this.N-=c),c=0;this.nb+=this.sa;this.aa+=c;a(b,c)}}}; h.ib=function(a){if(qb(this))return!1;if(this.v.ca)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ca=!0;this.v.Qb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.D&&(a&&this.D.ub(!0),this.D.start(this.N,Uc(this)));setTimeout(this.bc,0);return!0};h.jb=function(){return 0};h.da=function(a){if(this.v.ca){Yc(this);Wc(this,this.O);this.O=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.D&&this.D.stop(za(),Uc(this))}this.v.complete=a}; -function ad(a){this.ab=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.ab?bd.bind(this):cd.bind(this);dd(this);this.A=0;this.U=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.ab);this.v.ca&&this.da();dd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; -function dd(a){a.P=65536;a.R=32768;a.X=65535;a.T=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.B=0;a.xa=0;a.sc=[4,2,0,1];a.S=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ta=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +function ad(a){this.ab=+a.model||1170;this.xb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.ab?bd.bind(this):cd.bind(this);dd(this);this.A=0;this.P=null;this.v.complete=this.v.oc=!1}u(ad,Nc);h=ad.prototype;h.reset=function(){this.status("model "+this.ab);this.v.ca&&this.da();dd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; +function dd(a){a.R=65536;a.S=32768;a.X=65535;a.U=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.xb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.B=0;a.xa=0;a.sc=[4,2,0,1];a.T=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ta=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.G=0;a.H=a.I=0;a.g=a.f=a.Xa=0;a.qa=-1;ed(a)}function ed(a){a.Pa=255;a.Z=0;a.Pb=0;a.F=0;a.Na=0;a.tb=0;a.Oa=0;a.La=0;a.wa=0;a.Za=262143;a.ya=253952;a.G|=2;a.w&&tc(a)}function tc(a){a.La?(a.M=65536,a.Y=a.rc,a.oa=a.cd,a.wb=a.Pd,Vb(a.w,a.Oa&16?22:18)):(a.M=0,a.Y=a.qc,a.oa=a.ec,a.wb=a.kc,Vb(a.w,16))}h.Zb=function(){return 0}; -h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.Ma]);a.set(2,cc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.B!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.B]);a.L=b;a.G|=2}function P(a,b){a.G&128||(a.T=a.X=b,a.R=0)}function Dd(a,b,c){a.G&128||(a.T=a.X=a.P=b,a.R=c||0)}function Ed(a,b,c,d){a.G&128||(a.T=a.X=a.P=b,a.R=(c^b)&(d^b))}function Fd(a,b){a.G&128||(a.T=a.X=a.P=b,a.R=a.T^a.P>>1)} -function Gd(a,b,c,d){a.G&128||(a.T=a.X=a.P=b,a.R=(c^d)&(d^b))}h.ea=function(a,b){if(!this.A){var c=!1;0>this.qa?this.qa=Lb(this):this.B||(a=4,c=!0);this.F&57344||(this.Na=63222,this.tb=a);this.B=0;var d=this.oa(a|this.M),e=this.oa(a+2&65535|this.M);vc(this,e&-12289|this.qa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Hd(this,this.qa);Hd(this,this.u[7]);O(this,d);this.G&=-113;this.qa=-1;if(26!=b)throw a;}};function Id(a){var b=Jd(a),c=Jd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.G&=-17} -function Kd(a,b,c){var d,e,f,g=0;d=b>>13;a.Oa&a.sc[a.B]||(d&=7);e=a.S[a.B][d];f=(a.ta[a.B][d]<<6)+(b&8191)&a.Za;if(ff){if(3932160<=f){f&=262143;var k=f>>13&31;31>k?a.Oa&32&&(f=a.uc[k]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? -192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.S[a.B][d]=e;if(4194170!==f||a.B)a.wa=a.B,a.xa=d;g&&(g&57344&&(0<=a.qa&&(g|=128),a.F&57344||(a.F=a.F|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.F&61440||!(4191360>f||4194239>14&3;c=a.L>>14&3;a.B!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.B]);a.L=b;a.G|=2}function P(a,b){a.G&128||(a.U=a.X=b,a.S=0)}function Dd(a,b,c){a.G&128||(a.U=a.X=a.R=b,a.S=c||0)}function Ed(a,b,c,d){a.G&128||(a.U=a.X=a.R=b,a.S=(c^b)&(d^b))}function Fd(a,b){a.G&128||(a.U=a.X=a.R=b,a.S=a.U^a.R>>1)} +function Gd(a,b,c,d){a.G&128||(a.U=a.X=a.R=b,a.S=(c^d)&(d^b))}h.ea=function(a,b){if(!this.A){var c=!1;0>this.qa?this.qa=Lb(this):this.B||(a=4,c=!0);this.F&57344||(this.Na=63222,this.tb=a);this.B=0;var d=this.oa(a|this.M),e=this.oa(a+2&65535|this.M);vc(this,e&-12289|this.qa>>2&12288);c&&(this.Z|=4,this.u[6]=4);Hd(this,this.qa);Hd(this,this.u[7]);O(this,d);this.G&=-113;this.qa=-1;if(26!=b)throw a;}};function Id(a){var b=Jd(a),c=Jd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);O(a,b);vc(a,c);a.G&=-17} +function Kd(a,b,c){var d,e,f,g=0;d=b>>13;a.Oa&a.sc[a.B]||(d&=7);e=a.T[a.B][d];f=(a.ta[a.B][d]<<6)+(b&8191)&a.Za;if(ff){if(3932160<=f){f&=262143;var k=f>>13&31;31>k?a.Oa&32&&(f=a.uc[k]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? +192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.T[a.B][d]=e;if(4194170!==f||a.B)a.wa=a.B,a.xa=d;g&&(g&57344&&(0<=a.qa&&(g|=128),a.F&57344||(a.F=a.F|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.F&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.oa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.oa(e)|g; -a.b-=8;break;case 6:return e=a.oa(Cd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.oa(Cd(a,2)),e=e+a.u[c]&65535,e=a.oa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Na=a.Na<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.G|=64));return e}h.Bb=function(a){if(!this.La)return this.w.Bb(a);this.A++;a=Ld(this,Kd(this,a,3));this.A--;return a}; +a.b-=8;break;case 6:return e=a.oa(jd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.oa(jd(a,2)),e=e+a.u[c]&65535,e=a.oa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Na=a.Na<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.G|=64));return e}h.Bb=function(a){if(!this.La)return this.w.Bb(a);this.A++;a=Ld(this,Kd(this,a,3));this.A--;return a}; h.pb=function(a){if(!this.La)return this.w.pb(a);this.A++;a=this.ec(Kd(this,a,2));this.A--;return a};h.hb=function(a,b){this.La?(this.A++,Md(this,Kd(this,a,5),b),this.A--):this.w.hb(a,b)};h.Gb=function(a,b){this.La?(this.A++,this.kc(Kd(this,a,4),b),this.A--):this.w.Gb(a,b)};h.qc=function(a,b,c){return Nd(this,a,b,c)};h.rc=function(a,b,c){return Kd(this,Nd(this,a,b,c),c)};h.ec=function(a){return this.w.na(a)};h.cd=function(a){return this.w.na(Kd(this,a,2))};h.kc=function(a,b){this.w.Va(a,b&65535)}; h.Pd=function(a,b){this.w.Va(Kd(this,a,4),b)};function Od(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Nd(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.B=a.L>>12&3,c=a.oa(d|c&a.M),a.B=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Pd(a,b,c,d){a.F&57344||(a.Na=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Nd(a,b,e,4),c&65536||(e&=65535),a.B=a.L>>12&3,e=Kd(a,e|c&65536,4),a.B=a.L>>14&3,a.w.Va(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d} function Qd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Ld(a,a.Y(b,c,3)):a.u[c]&255}function Rd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]}function Sd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Nd(a,b,c,8)}function Td(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ld(a,a.Y(b,c,3)):a.u[c]&255}function Ud(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]} function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Xa=a.Y(b,e,7),Md(a,e,d.call(a,c,Ld(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Va(e,d.call(a,c,a.w.na(e)))):a.u[e]=d.call(a,c,a.u[e])}function Vd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Md(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Wd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Va(a.Y(b,d,4),c):a.u[d]=c&65535;return c} function S(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.jb=function(a){this.v.complete=!0;var b=this.v.oc=this.i&&Xd(this.i),c=a?this.v.Qb?0:1:-1;this.v.Qb=!1;this.ba=this.b=a;do{if(b){if(Yd(this.i,this.u[7],c)){this.da();break}c=1}if(this.G&&(this.G&112&&(this.G&32?this.ea(168,28):this.G&64?this.ea(4,30):this.G&16&&this.ea(12,32),this.G&=-113),this.G&7))if(this.G&2){this.G&=-3;var d=160,e=(this.Pb&224)>>5;if(a=this.U&&this.U.eb>e?this.U:null)d=a.jd,e=a.eb;e>(this.L&224)>>5?(this.G&4&&(Cd(this,2),this.G&=-5),this.ea(d,26),e=!0):e=!1;if(e&&a)if(e=this.U, -e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.G&1&&this.G++;this.G=this.G&7|this.L&16;this.decode(id(this))}while(0>5;if(a=this.P&&this.P.eb>e?this.P:null)d=a.jd,e=a.eb;e>(this.L&224)>>5?(this.G&4&&(jd(this,2),this.G&=-5),this.ea(d,26),e=!0):e=!1;if(e&&a)if(e=this.P, +e==a)this.P=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.G&1&&this.G++;this.G=this.G&7|this.L&16;this.decode(id(this))}while(0>1|b<<16;Fd(this,a);return a&65535}function de(a,b){a=b&2048|b>>1|b<<8;Fd(this,a<<8);return a&255}function ee(a,b){a=b&~a;P(this,a);return a}function fe(a,b){a=b&~a;P(this,a<<8);return a}function ge(a,b){a|=b;P(this,a);return a}function he(a,b){a|=b;P(this,a<<8);return a}function ie(a,b){a=~b|65536;Dd(this,a);return a&65535} -function je(a,b){a=~b|256;Dd(this,a<<8);return a&255}function ke(a,b){a=b-a;this.G&128||(this.T=this.X=a,this.R=b&(b^a));return a&65535}function le(a,b){a=b-a;var c=a<<8;b<<=8;this.G&128||(this.T=this.X=c,this.R=b&(b^c));return a&255}function me(a,b){a=b+a;this.G&128||(this.T=this.X=a,this.R=a&(b^a));return a&65535}function ne(a,b){a=b+a;var c=a<<8;this.G&128||(this.T=this.X=c,this.R=c&(b<<8^c));return a&255}function oe(a,b){a=-b;Dd(this,a,a&b&32768);return a&65535} -function pe(a,b){a=-b;Dd(this,a<<8,(a&b&128)<<8);return a&255}function qe(a,b){a=b<<1|this.P>>16&1;Fd(this,a);return a&65535}function re(a,b){a=b<<1|this.P>>16&1;Fd(this,a<<8);return a&255}function se(a,b){a=(this.P&65536|b)>>1|b<<16;Fd(this,a);return a&65535}function te(a,b){a=((this.P&65536)>>8|b)>>1|b<<8;Fd(this,a<<8);return a&255}function ue(a,b){var c=b-a;Gd(this,c,a,b);return c&65535}function ve(a,b){var c=b-a;Gd(this,c<<8,a<<8,b<<8);return c&255} -function we(a,b){this.G&128||(this.T=this.X=b&65280,this.R=this.P=0);return(b<<8|b>>8)&65535}function xe(a,b){a^=b;P(this,a);return a&65535}function ye(a){R(this,a,Rd(this,a),Zd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function ze(a){var b=Ud(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.P=this.R=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.R=32768)}this.u[a]=c&65535;this.T=this.X=c;this.b-=(this.g?6:7)+b} -function Ae(a){var b=Ud(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.P=this.R=0;b&=63;if(b&32){b=64-b;32>b-1;this.P=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.T=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Be(a){S(this,a,!fd(this))}function Ce(a){S(this,a,fd(this))} +function je(a,b){a=~b|256;Dd(this,a<<8);return a&255}function ke(a,b){a=b-a;this.G&128||(this.U=this.X=a,this.S=b&(b^a));return a&65535}function le(a,b){a=b-a;var c=a<<8;b<<=8;this.G&128||(this.U=this.X=c,this.S=b&(b^c));return a&255}function me(a,b){a=b+a;this.G&128||(this.U=this.X=a,this.S=a&(b^a));return a&65535}function ne(a,b){a=b+a;var c=a<<8;this.G&128||(this.U=this.X=c,this.S=c&(b<<8^c));return a&255}function oe(a,b){a=-b;Dd(this,a,a&b&32768);return a&65535} +function pe(a,b){a=-b;Dd(this,a<<8,(a&b&128)<<8);return a&255}function qe(a,b){a=b<<1|this.R>>16&1;Fd(this,a);return a&65535}function re(a,b){a=b<<1|this.R>>16&1;Fd(this,a<<8);return a&255}function se(a,b){a=(this.R&65536|b)>>1|b<<16;Fd(this,a);return a&65535}function te(a,b){a=((this.R&65536)>>8|b)>>1|b<<8;Fd(this,a<<8);return a&255}function ue(a,b){var c=b-a;Gd(this,c,a,b);return c&65535}function ve(a,b){var c=b-a;Gd(this,c<<8,a<<8,b<<8);return c&255} +function we(a,b){this.G&128||(this.U=this.X=b&65280,this.S=this.R=0);return(b<<8|b>>8)&65535}function xe(a,b){a^=b;P(this,a);return a&65535}function ye(a){R(this,a,Rd(this,a),Zd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function ze(a){var b=Ud(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.R=this.S=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.S=32768)}this.u[a]=c&65535;this.U=this.X=c;this.b-=(this.g?6:7)+b} +function Ae(a){var b=Ud(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=0;b&=63;if(b&32){b=64-b;32>b-1;this.R=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.U=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Be(a){S(this,a,!fd(this))}function Ce(a){S(this,a,fd(this))} function De(a){R(this,a,Rd(this,a),ee);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){Q(this,a,Qd(this,a),fe);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){R(this,a,Rd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ge(a){Q(this,a,Qd(this,a),he);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function He(a){P(this,Rd(this,a)&Ud(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){P(this,(Qd(this,a)&Td(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Je(a){S(this,a,hd(this))}function Ke(a){S(this,a,!this.Da()==!gd(this))}function Le(a){S(this,a,!hd(this)&&!this.Da()==!gd(this))}function Me(a){S(this,a,!fd(this)&&!hd(this))}function Ne(a){S(this,a,hd(this)||!this.Da()!=!gd(this))} -function Oe(a){S(this,a,fd(this)||hd(this))}function Pe(a){S(this,a,!this.Da()!=!gd(this))}function Qe(a){S(this,a,this.Da())}function Re(a){S(this,a,!hd(this))}function Se(a){S(this,a,!this.Da())}function Te(){this.ea(12,1);this.b-=5}function Ue(a){S(this,a,!0)}function Ve(a){S(this,a,!gd(this))}function We(a){S(this,a,gd(this))}function T(a){a&1&&(this.P=0);a&2&&(this.R=0);a&4&&(this.X=1);a&8&&(this.T=0);this.b-=5} +function Oe(a){S(this,a,fd(this)||hd(this))}function Pe(a){S(this,a,!this.Da()!=!gd(this))}function Qe(a){S(this,a,this.Da())}function Re(a){S(this,a,!hd(this))}function Se(a){S(this,a,!this.Da())}function Te(){this.ea(12,1);this.b-=5}function Ue(a){S(this,a,!0)}function Ve(a){S(this,a,!gd(this))}function We(a){S(this,a,gd(this))}function T(a){a&1&&(this.R=0);a&2&&(this.S=0);a&4&&(this.X=1);a&8&&(this.U=0);this.b-=5} function Xe(a){var b=Rd(this,a);a=Ud(this,a);Gd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ye(a){var b=Qd(this,a)<<8;a=Td(this,a)<<8;Gd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} -function Ze(a){var b=Ud(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.P=this.R=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.T=d>>16):(this.R=32768,this.X=d>>15|d,this.T=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.T=0,this.R=32768,this.P=65536,this.b-=7}function $e(){this.ea(24,2);this.b-=25} +function Ze(a){var b=Ud(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.U=d>>16):(this.S=32768,this.X=d>>15|d,this.U=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.U=0,this.S=32768,this.R=65536,this.b-=7}function $e(){this.ea(24,2);this.b-=25} function af(){this.L&49152?(this.Z|=128,this.ea(4,3)):this.i?$b(this.i):this.da();this.b-=7}function bf(){this.ea(16,4);this.b-=25}var cf=[0,7,7,10,7,11,9,13];function df(a){var b=this.b;O(this,Sd(this,a));this.b=b-cf[this.g]}var ef=[0,14,14,17,14,18,16,20];function ff(a){var b=this.b,c=Sd(this,a);a=a>>6&7;Hd(this,this.u[a]);this.u[a]=this.u[7];O(this,c);this.b=b-ef[this.g]}var gf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function hf(a){var b=Rd(this,a),c=this.b;P(this,Wd(this,a,b));this.b=c-gf[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)}function jf(a){var b=Qd(this,a);P(this,Vd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var kf=[7,13,13,17,14,18,17,21]; -function lf(a){var b=Ud(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.G&128||(this.T=b>>16,this.X=this.T|b,this.R=0,this.P=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function rf(a){R(this,a,Rd(this,a),ue);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function sf(a){R(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)}function tf(){this.ea(28,5);this.b-=5}function uf(){this.G&4||this.D.$();this.G|=4;Cd(this,-2);this.b-=3} +function lf(a){var b=Ud(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.G&128||(this.U=b>>16,this.X=this.U|b,this.S=0,this.R=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function rf(a){R(this,a,Rd(this,a),ue);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function sf(a){R(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)}function tf(){this.ea(28,5);this.b-=5}function uf(){this.G&4||this.D.$();this.G|=4;jd(this,-2);this.b-=3} function vf(a){R(this,a,Rd(this,a),xe);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,C(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function bd(a){wf[a>>12].call(this,a)}function xf(a){yf[a>>6&3].call(this,a)}function zf(a){Af[a>>6&3].call(this,a)}function Bf(a){Cf[a>>6&3].call(this,a)}function Df(a){Ef[a&15].call(this,a)}function Ff(a){Gf[a&15].call(this,a)}function Hf(a){If[a>>6&3].call(this,a)}function Jf(a){Kf[a>>6&3].call(this,a)} function Lf(a){Mf[a>>6&3].call(this,a)} -var wf=[function(a){Nf[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,ye,V,function(a){gg[a>>8&15].call(this,a)},jf,Ye,Ie,Ee,Ge,rf,V],Nf=[function(a){hg[a>>4&15].call(this,a)},Ue,Re,Je,Ke,Pe,Le,Ne,ff,ff,xf,zf,Bf,V,V,V],yf=[function(a){Dd(this,Wd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],Af=[function(a){R(this,a,0, +var wf=[function(a){Nf[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,ye,V,function(a){Of[a>>8&15].call(this,a)},jf,Ye,Ie,Ee,Ge,rf,V],Nf=[function(a){hg[a>>4&15].call(this,a)},Ue,Re,Je,Ke,Pe,Le,Ne,ff,ff,xf,zf,Bf,V,V,V],yf=[function(a){Dd(this,Wd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ke);this.b-=this.g?9:3+(7==this.f?2:0)}],Af=[function(a){R(this,a,0, oe);this.b-=this.g?11:6},function(a){R(this,a,fd(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,fd(this)?1:0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ud(this,a);Dd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Cf=[function(a){R(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}], -hg=[function(a){ig[a&15].call(this,a)},V,V,V,df,df,df,df,pf,V,Df,Ff,sf,sf,sf,sf],ig=[af,uf,of,Te,bf,nf,V,V,V,V,V,V,V,V,V,V],Ef=[mf,function(){this.P=0;this.b-=5},function(){this.R=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.T=0;this.b-=5},T,T,T,T,T,T,T],Gf=[mf,function(){this.P=65536;this.b-=5},function(){this.R=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.T=32768;this.b-=5},W,W,W,W,W,W,W],gg=[Se,Qe,Me,Oe,Ve,We,Be,Ce,$e,tf,Hf,Jf,Lf,V,V,V],If=[function(a){Dd(this, +hg=[function(a){ig[a&15].call(this,a)},V,V,V,df,df,df,df,pf,V,Df,Ff,sf,sf,sf,sf],ig=[af,uf,of,Te,bf,nf,V,V,V,V,V,V,V,V,V,V],Ef=[mf,function(){this.R=0;this.b-=5},function(){this.S=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.U=0;this.b-=5},T,T,T,T,T,T,T],Gf=[mf,function(){this.R=65536;this.b-=5},function(){this.S=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.U=32768;this.b-=5},W,W,W,W,W,W,W],Of=[Se,Qe,Me,Oe,Ve,We,Be,Ce,$e,tf,Hf,Jf,Lf,V,V,V],If=[function(a){Dd(this, Vd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,le);this.b-=this.g?9:3+(7==this.f?2:0)}],Kf=[function(a){Q(this,a,0,pe);this.b-=this.g?11:6},function(a){Q(this,a,fd(this)?1:0,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,fd(this)?1:0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Dd(this,a<<8);this.b-=this.g?4:3+(7== this.f?2:0)}],Mf=[function(a){Q(this,a,0,te);this.b-=this.g?9+(this.Xa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,de);this.b-=this.g?9+(this.Xa&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)}];function cd(a){jg[a>>12].call(this,a)} var jg=[function(a){kg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,ye,function(a){lg[a>>8&15].call(this,a)},function(a){mg[a>>8&15].call(this,a)},jf,Ye,Ie,Ee,Ge,rf,V],kg=[function(a){ng[a>>4&15].call(this,a)},Ue,Re,Je,Ke,Pe,Le,Ne,ff,ff,xf,zf,Bf,function(a){og[a>>6&3].call(this,a)},V,V],og=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.oa(a|this.M);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Od(this,a,0);Hd(this,a);P(this,a);this.b-=11},function(a){var b=Jd(this),c= @@ -160,111 +160,111 @@ ug(c))})}}u(tg);tg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;ug( Ta(function(){for(var a=B(document,"pdp11","ram"),b=0;b=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=va(b[0]);if(c!=this.Wa)return;b=va(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.za=function(a){return a?this.save():!0};h.reset=function(){yg(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return yg(this)};function yg(a){a.N=0;a.f=0;a.g=128;a.B=[];return!0}h.Ob=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.O||8,c=a-this.H%a,this.O&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.j(this.F), this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;rc(this.b,this.V,1)}};var zg={},xg=(zg[65392]=[null,null,X.prototype.Sc,X.prototype.Ed,"RCSR"],zg[65394]=[null,null,X.prototype.Rc,X.prototype.Dd,"RBUF"],zg[65396]=[null,null,X.prototype.ed,X.prototype.Rd,"XCSR"],zg[65398]=[null,null,X.prototype.dd,X.prototype.Qd,"XBUF"],zg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.J[b]=c,!0;case "loadTape":return this.J[b]=c,c.onclick=function(){var a=d.J.listTapes;a&&Bg(d, -a.options[a.selectedIndex].text,a.value)},!0;case "mountTape":if(this.M)return this.J[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Bg(d,oa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.Ca=function(a,b,c,d){this.D=a;this.w=b;this.b=c;this.i=d;var e=this;if((this.g=Pc(this.D,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){n("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.O=sc(56,4);this.N=hc(this.b,function(){Cg(e)});ec(b,this,Dg);Eg(this,"None",Ag,!0);this.M&&Eg(this,"Local Tape","?");Eg(this,"Remote Tape","??");Fg(this)||H(this)}; -h.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){this.f&=-2241;this.K=0};function Fg(a){a.A=0;if(a.g){var b=a.g.path,c;if(!(c=a.g.name))a:{if((c=a.J.listTapes)&&c.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(d=pa(c),e="json"==d||"gz"==d?encodeURI(c):ra()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ba(e,null,!0,function(d,e,f){var g=0>f&&a.D&&!a.D.v.ha;if(f)a.ga('Unable to load tape "'+b+'" (error '+f+": "+d+")",g);else if(jb(a.Ra,d,e),d=Ca(d,e))a.B=c,a.I=0,a.H= -d.ia;a.v.Ia=!1;a.A&&(a.A--,a.A||H(a));Jg(a)})}function Eg(a,b,c,d){if((a=a.J.listTapes)&&a.options){for(var e=0;e=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Lg.prototype.$b=function(){return-1};Lg.prototype.ac=function(){}; -function Ng(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.U?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a} -function Og(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<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":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; +function wc(a){r.call(this,"PC11",a,wc);this.g=a.autoMount||null;this.I=this.M=this.f=this.A=0;this.H=[];this.F=Ag;this.K=Bg;this.B="";this.N=!La("Mobi")&&window&&"FileReader"in window}u(wc);var Ag="",Bg=0;h=wc.prototype; +h.ra=function(a,b,c){var d=this,e=Bg;switch(b){case "listTapes":return this.J[b]=c,c.onchange=function(){var a=d.J.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(m){n("PC11 option error: "+m.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b=''+b+"");a.innerHTML=b}},!0;case "descTape":return this.J[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.J[b]=c,c.onclick= +function(){var a=d.J.listTapes;a&&Cg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(this.N)return this.J[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Cg(d,oa(b,!0),b,1,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.Ca=function(a,b,c,d){this.D=a;this.w=b;this.b=c;this.i=d;var e=this;if((this.g=Pc(this.D,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){n("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.P=sc(56,4);this.O=hc(this.b,function(){Dg(e)});ec(b,this,Eg);Fg(this,"None",Ag,!0);this.N&&Fg(this,"Local Tape","?");Fg(this,"Remote Tape","??");Gg(this)||H(this)}; +h.Aa=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){this.f&=-2241;this.M=0};function Gg(a){a.A=0;if(a.g){var b=a.g.path,c;if(!(c=a.g.name))a:{if((c=a.J.listTapes)&&c.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(e=pa(c),f="json"==e||"gz"==e?encodeURI(c):ra()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ba(f,null,!0,function(e,f,g){var k=0>g&&a.D&&!a.D.v.ha;if(g)a.ga('Unable to load tape "'+b+'" (error '+g+": "+e+")",k);else if(jb(a.Ra,e,f),e=Ca(e, +f))e=e.ia,a.B=c,a.K=d,2!=d&&(a.I=0,a.H=e);a.v.Ia=!1;a.A&&(a.A--,a.A||H(a));Kg(a)})}function Fg(a,b,c,d){if((a=a.J.listTapes)&&a.options){for(var e=0;e=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Mg.prototype.$b=function(){return-1};Mg.prototype.ac=function(){}; +function Og(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.P?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(va(b.substring(c,f))),c=f+1}}return a} +function Pg(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<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":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 Pg(a,b,c){var d;if(b){b=Qg(a,b);for(var e=0,f=!1,g=b,k=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Tg(a,b){if(b)return Sg(a,b,a.aa[b]);var c=0;for(b in a.aa)Sg(a,b,a.aa[b]),c++;return 0>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Ug(a,b){if(b)return Tg(a,b,a.aa[b]);var c=0;for(b in a.aa)Tg(a,b,a.aa[b]),c++;return 0this.b.ab?bh:[];ch(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(dh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ja;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<this.b.ab?ch:[];dh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(eh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ja;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b}; +d.pa.value="";Sc(d,a,!0);return!0}return!1}),!0;case "step":return this.J[b]=c,Na(c,function(a){var b=!1;ob(d,!0)||(nb(d,!0),b=d.jb(a?1:0),nb(d,!1));return b}),!0}return!1};h.ub=function(){this.pa&&this.pa.focus()};h.Y=function(a){a=a&&a.C;null==a&&(a=-1);return a};h.ob=function(a,b){var c=255,d=this.Y(a,!1,1);-1!==d&&(c=a.yb?this.w.Bb(d):this.b.Bb(d),b&&fh(a,b));return c};h.na=function(a,b){var c=65535,d=this.Y(a,!1,2);-1!==d&&(c=a.yb?this.w.pb(d):this.b.pb(d),b&&fh(a,b));return c}; +h.Fb=function(a,b,c){var d=this.Y(a,!0,1);-1!==d&&(a.yb?this.w.hb(d,b):this.b.hb(d,b),c&&fh(a,c),this.D.$(!0))};h.Va=function(a,b,c){var d=this.Y(a,!0,2);-1!==d&&(a.yb?this.w.Gb(d,b):this.b.Gb(d,b),c&&fh(a,c),this.D.$(!0))};function Z(a,b){return{C:a,yb:b,Ba:!1}}function gh(a){return[a.C,a.Ba]}function hh(a){return{C:a[0],Ba:a[1]}} +function eh(a,b,c){var d,e=(c?a.K:a.Qa).C;c=!1;if(void 0!==b){b=Rg(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;ed&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b}; h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.tb).C));this.la&1073741824?this.wa.push(a):this.sa&&a==this.sa||(this.sa=a,this.la&-2147483648&&(this.da(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.pa=0,a.D.$()))}; -function Wg(a){var b;if(Xd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.ja],!1)}a.M=["br"];if(a.B)for(b=1;b>>d.ja],!0);a.B=["bw"];a.Xa=0} -h.Sa=function(a,b,c){var d=!0;c||nh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.C)),d=!1;else{var f=this.w;f.W[e>>>f.ja].Sa(e&f.w,a==this.B)}}d&&(a.push(b),c?b.Ba=!0:(oh(this,a,a.length-1,"set"),Wg(this)));return d};function nh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ja],b==a.B));k.Ba||Wg(a);break}}return f} -function ph(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==F)w=w.C-((f&63)<<1)&65535,y=J(x,w);else if(12288==F)y=J(x,f&7,1);else if(24576==F)y=J(x,f&63,1);else if(F=f&E,E&4032&&(F>>=6,E>>=6),E&63)switch(E=F&7,F&56){case 0:y= -ih(E);break;case 8:y="@"+ih(E);break;case 16:7>E?y="("+ih(E)+")+":(F=x.na(w,2),y="#"+J(x,F,0,!0));break;case 24:7>E?y="@("+ih(E)+")+":(F=x.na(w,2),y="@#"+J(x,F,0,!0));break;case 32:y="-("+ih(E)+")";break;case 40:y="@-("+ih(E)+")";break;case 48:F=x.na(w,2);y=J(x,F,0,!0)+"("+ih(E)+")";7==E&&(y=[y,J(x,F+w.C&65535)]);break;case 56:F=x.na(w,2),y="@"+J(x,F)+"("+ih(E)+")",7==E&&(y=[y,J(x,F+w.C&65535)])}x=y;if(!x||!x.length){k="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=ih(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function uh(a){var b,c="";for(b=0;6>b;b++)c+=th(a,b);c=c+"\n"+(th(a,6)+th(a,7)+th(a,20));return c+=sh(a,"T")+sh(a,"N")+sh(a,"Z")+sh(a,"V")+sh(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,k=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.D.$();a.j("updated registers:")}a.j(uh(a));c&&(a.K=Z(d.u[7]),lh(a,J(a,a.K.C)))}}function zh(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var p=k[0]+":";k[2]&&(p+=" "+k[2]);a.j(p)}k[3]&&(g=k[3],f=null);f=rh(a,b,g,f);a.j(f);a.K=b;e-=b.C-m;c++}}} -function qh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.U&&(a.j("ended assemble at "+J(a,a.O.C)),a.K=a.O,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.sa=null;if(pb(a)&&0q||"z"ja.length&&(a.j("note: only "+ja.length+" available"),Y=ja.length);ca-=Y;0>ca&&(null==ja[ja.length-1].C?(Y=ca+Y,ca=0):ca+=ja.length);var md=[];"call"==Tf&&(vb=1E5,md=["CALL"]);for(void 0!==Sf&&a.j(Y+" instructions earlier:");0=ja.length&&(ca=0);a.Ya=Y;Vf++;vb--}}Vf||(a.j("no "+Uf+"history available"),a.Ya=void 0)}else{var xb=dh(a,ia);if(xb){var ic=0;Ga&&("l"==Ga.charAt(0)&&(Ga=Ga.substr(1)||Th),ic=Rg(a,Ga)>>>0,65536>4||1;Vh--&&0lc?String.fromCharCode(lc):".";jc--}yb&&(yb+="\n");yb+=ia+" "+nd+(0==Ab?" "+Yf:"")}yb&&a.j(yb);a.Qa=xb}}}}break;case "e":if("else"==g[0])break;var bb,pd,qd,rd,sd=g[0],td=g[1];"eb"==sd?(bb=1,pd=255,qd=a.ob,rd=a.Fb):"e"==sd||"ew"==sd?(bb=2,pd=65535,qd=a.na,rd=a.Va):td=null;if(null==td)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var mc=dh(a,td);if(mc)for(var nc=2;nc< -g.length;nc++){var Bb=Pg(a,g[nc]);if(void 0===Bb){a.j("unrecognized value: "+g[nc]);break}Bb&~pd&&a.j("warning: "+l(Bb)+" exceeds "+bb+"-byte value");var Wh=qd.call(a,mc);a.j("changing "+J(a,mc.C)+" from "+J(a,Wh,bb)+" to "+J(a,Bb,bb));rd.call(a,mc,Bb,bb)}}break;case "g":a:{var Zf=g[1],Xh=b;if(void 0!==Zf){var ud=dh(a,Zf,!0);if(!ud)break a;hh(a,ud,Xh);a.Sa(a.f,ud,!0)}a.ib(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var vd; -var Cb=b.substr(2),Cb=va(Cb);Pg(a,Cb)?(c||a.j("true: "+Cb),vd=!0):(c||a.j("false: "+Cb),vd=!1);vd||(d=!1);break}f=!0;break;case "k":var Yh=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var wd=0,xd=Z(),Db=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Db.C));10>wd;){for(var Ha=null,Zh=256;65536>Db.C>>>0;){xd.C=a.na(Db,2);if(null==Db.C||!Zh--)break;if(!(xd.C&1)){for(var $h=a,oc=xd,$f=null,Eb=oc.C,ag=Eb,yd=1;6>=yd&&Eb;yd++){if(2< -yd){oc.C=Eb;var pc=rh($h,oc);if(0<=pc.indexOf("JSR")){var bg=pc.indexOf(" ");if(Eb+(pc.indexOf(" ",bg+1)-bg-1)/2==ag){$f=pc;break}}}Eb-=2}oc.C=ag;if(Ha=$f)break}}if(!Ha||null==Ha)break;var cg=null;if("ks"==Yh){var dg=Ha.match(/[0-9A-F]+$/);dg&&(cg=yh(a,dg[0]))}Ha=ua(Ha,50)+" ;"+(cg||"stack="+J(a,Db.C));a.j(Ha);wd++}wd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){yh(a,g[1],!0);break}f=!0;break;case "m":a:{var ka,la=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var xa=0;if("all"== -G)xa=1878917119,G=null;else if("on"==G)la=!0,G=null;else if("off"==G)la=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(ka in tb)if(G==ka){xa=tb[ka];la=!!(a.la&xa);break}if(!xa){a.j("unknown message category: "+G);break a}}if(xa)if("on"==g[2])a.la|=xa,la=!0;else if("off"==g[2]&&(a.la&=~xa,la=!1,1073741824==xa)){for(var zd=0;zd>>d.ja],!1)}a.M=["br"];if(a.B)for(b=1;b>>d.ja],!0);a.B=["bw"];a.Xa=0} +h.Sa=function(a,b,c){var d=!0;c||oh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.C)),d=!1;else{var f=this.w;f.W[e>>>f.ja].Sa(e&f.w,a==this.B)}}d&&(a.push(b),c?b.Ba=!0:(ph(this,a,a.length-1,"set"),Xg(this)));return d};function oh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ja],b==a.B));k.Ba||Xg(a);break}}return f} +function qh(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==F)w=w.C-((f&63)<<1)&65535,y=J(x,w);else if(12288==F)y=J(x,f&7,1);else if(24576==F)y=J(x,f&63,1);else if(F=f&E,E&4032&&(F>>=6,E>>=6),E&63)switch(E=F&7,F&56){case 0:y= +jh(E);break;case 8:y="@"+jh(E);break;case 16:7>E?y="("+jh(E)+")+":(F=x.na(w,2),y="#"+J(x,F,0,!0));break;case 24:7>E?y="@("+jh(E)+")+":(F=x.na(w,2),y="@#"+J(x,F,0,!0));break;case 32:y="-("+jh(E)+")";break;case 40:y="@-("+jh(E)+")";break;case 48:F=x.na(w,2);y=J(x,F,0,!0)+"("+jh(E)+")";7==E&&(y=[y,J(x,F+w.C&65535)]);break;case 56:F=x.na(w,2),y="@"+J(x,F)+"("+jh(E)+")",7==E&&(y=[y,J(x,F+w.C&65535)])}x=y;if(!x||!x.length){k="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=jh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function vh(a){var b,c="";for(b=0;6>b;b++)c+=uh(a,b);c=c+"\n"+(uh(a,6)+uh(a,7)+uh(a,20));return c+=th(a,"T")+th(a,"N")+th(a,"Z")+th(a,"V")+th(a,"C")}h.Vb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,k=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.D.$();a.j("updated registers:")}a.j(vh(a));c&&(a.K=Z(d.u[7]),mh(a,J(a,a.K.C)))}}function Ah(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var p=k[0]+":";k[2]&&(p+=" "+k[2]);a.j(p)}k[3]&&(g=k[3],f=null);f=sh(a,b,g,f);a.j(f);a.K=b;e-=b.C-m;c++}}} +function rh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.P&&(a.j("ended assemble at "+J(a,a.O.C)),a.K=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.sa=null;if(pb(a)&&0q||"z"ja.length&&(a.j("note: only "+ja.length+" available"),Y=ja.length);ca-=Y;0>ca&&(null==ja[ja.length-1].C?(Y=ca+Y,ca=0):ca+=ja.length);var nd=[];"call"==Uf&&(vb=1E5,nd=["CALL"]);for(void 0!==Tf&&a.j(Y+" instructions earlier:");0=ja.length&&(ca=0);a.Ya=Y;Wf++;vb--}}Wf||(a.j("no "+Vf+"history available"),a.Ya=void 0)}else{var xb=eh(a,ia);if(xb){var ic=0;Ga&&("l"==Ga.charAt(0)&&(Ga=Ga.substr(1)||Uh),ic=Sg(a,Ga)>>>0,65536>4||1;Wh--&&0lc?String.fromCharCode(lc):".";jc--}yb&&(yb+="\n");yb+=ia+" "+od+(0==Ab?" "+Zf:"")}yb&&a.j(yb);a.Qa=xb}}}}break;case "e":if("else"==g[0])break;var bb,qd,rd,sd,td=g[0],ud=g[1];"eb"==td?(bb=1,qd=255,rd=a.ob,sd=a.Fb):"e"==td||"ew"==td?(bb=2,qd=65535,rd=a.na,sd=a.Va):ud=null;if(null==ud)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var mc=eh(a,ud);if(mc)for(var nc=2;nc< +g.length;nc++){var Bb=Qg(a,g[nc]);if(void 0===Bb){a.j("unrecognized value: "+g[nc]);break}Bb&~qd&&a.j("warning: "+l(Bb)+" exceeds "+bb+"-byte value");var Xh=rd.call(a,mc);a.j("changing "+J(a,mc.C)+" from "+J(a,Xh,bb)+" to "+J(a,Bb,bb));sd.call(a,mc,Bb,bb)}}break;case "g":a:{var $f=g[1],Yh=b;if(void 0!==$f){var vd=eh(a,$f,!0);if(!vd)break a;ih(a,vd,Yh);a.Sa(a.f,vd,!0)}a.ib(!0,c)}break;case "h":a.v.ca?(c||a.j("halting"),a.da()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var wd; +var Cb=b.substr(2),Cb=va(Cb);Qg(a,Cb)?(c||a.j("true: "+Cb),wd=!0):(c||a.j("false: "+Cb),wd=!1);wd||(d=!1);break}f=!0;break;case "k":var Zh=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var xd=0,yd=Z(),Db=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Db.C));10>xd;){for(var Ha=null,$h=256;65536>Db.C>>>0;){yd.C=a.na(Db,2);if(null==Db.C||!$h--)break;if(!(yd.C&1)){for(var ai=a,oc=yd,ag=null,Eb=oc.C,bg=Eb,zd=1;6>=zd&&Eb;zd++){if(2< +zd){oc.C=Eb;var pc=sh(ai,oc);if(0<=pc.indexOf("JSR")){var cg=pc.indexOf(" ");if(Eb+(pc.indexOf(" ",cg+1)-cg-1)/2==bg){ag=pc;break}}}Eb-=2}oc.C=bg;if(Ha=ag)break}}if(!Ha||null==Ha)break;var dg=null;if("ks"==Zh){var eg=Ha.match(/[0-9A-F]+$/);eg&&(dg=zh(a,eg[0]))}Ha=ua(Ha,50)+" ;"+(dg||"stack="+J(a,Db.C));a.j(Ha);xd++}xd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){zh(a,g[1],!0);break}f=!0;break;case "m":a:{var ka,la=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var xa=0;if("all"== +G)xa=1878917119,G=null;else if("on"==G)la=!0,G=null;else if("off"==G)la=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(ka in tb)if(G==ka){xa=tb[ka];la=!!(a.la&xa);break}if(!xa){a.j("unknown message category: "+G);break a}}if(xa)if("on"==g[2])a.la|=xa,la=!0;else if("off"==g[2]&&(a.la&=~xa,la=!1,1073741824==xa)){for(var Ad=0;Ad\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bEh){if(Gh(d,this.I)){this.B=new N(this,"1.30.1","failsafe");Gh(this.B)&&(Lh(this,d),a=2,Mh(this.B));this.B.set("timestamp",Aa());Nh(this.B);var e=this.f&&!this.F;if(1==a||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Kh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Gh(d,g):("error"== -f&&"no machine state"!=g?(this.ga("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Mh(d),Gh(d)?(c=Kh(d),e=!0):c=!1))}e&&Jh(this,c?d:null)}else 2==a&&d.clear()}else Jh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Oh(this,this.b,b,c,a),this.b.mb());this.O&&(Lh(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.D=0}; -function Lh(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} -function Bh(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),k=Aa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var k=kb(a.id),m=0;m\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bFh){if(Hh(d,this.I)){this.B=new N(this,"1.30.1","failsafe");Hh(this.B)&&(Mh(this,d),a=2,Nh(this.B));this.B.set("timestamp",Aa());Oh(this.B);var e=this.f&&!this.F;if(1==a||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Lh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Hh(d,g):("error"== +f&&"no machine state"!=g?(this.ga("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Nh(d),Hh(d)?(c=Lh(d),e=!0):c=!1))}e&&Kh(this,c?d:null)}else 2==a&&d.clear()}else Kh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Ph(this,this.b,b,c,a),this.b.mb());this.O&&(Mh(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.D=0}; +function Mh(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} +function Ch(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),k=Aa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var k=kb(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=k[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);k[0]!=m&&(g=g.replace(k[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);fi(a,b,c)}})}else c(a,null)} -function gi(a,b,c,d){function e(a){if(void 0===k){var b=g&&B(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Sh||Va(!0));m=!1}var g,k,m=!0;Sh++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,k){k?di(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=k.transformNode(m))?(g.outerHTML=m,--Sh||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Sh||Va(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?di(b,a,d,!0,e,p):ei(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return gi(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map +h.ra=function(a,b,c){var d=this;switch(b){case "power":return this.J[b]=c,c.onclick=function(){d.D||(d.v.ha?Ch(d,!1,!0):Jh(d,d.sb))},!0;case "reset":return this.J[b]=c,c.onclick=function(){if(d.v.ha&&!d.D)if(d.f&&!d.H){var a=Da("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ch(d,a,!0);!a&&d.N?window&&window.location.reload():d.sb(Fh)}else d.reset(),d.b&&d.b.mb()},!0;case "save":if(qa())c.parentNode.removeChild(c);else return this.J[b]= +c,c.onclick=function(){var a=Gh(d,!0);if(a){var b=!!(d.f&&!d.H||d.N),c=Ch(d,b);b?Qh(d,a,c):d.ga("Resume disabled, machine state not saved")}},!0}return!1}; +function Gh(a,b){var c=a.g;c||((c=Ja("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Rh(a,c))||a.ga("The user ID is invalid.")):b&&a.ga("Browser local storage is not available"));return c} +function Rh(a,b){a.g=null;b=Ba(ra()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ka("user",b.data),a.g=b.data)}catch(d){n(d.message+" ("+c+")")}return a.g}function Ih(a){var b=null;a.g&&(b=ra()+"/api/v1/user?req=load&user="+a.g+"&state="+Sh(a,"1.30.1"));return b} +function Qh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Sh(a,"1.30.1");d.data=c;b=Ba(ra()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ba(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=k[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);k[0]!=m&&(g=g.replace(k[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);gi(a,b,c)}})}else c(a,null)} +function hi(a,b,c,d){function e(a){if(void 0===k){var b=g&&B(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ta(a))}function f(a){e("Error: "+a);m&&(--Th||Va(!0));m=!1}var g,k,m=!0;Th++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,k){k?ei(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=k.transformNode(m))?(g.outerHTML=m,--Th||Va(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Th||Va(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ei(b,a,d,!0,e,p):fi(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){Va(!1);return hi(a,b,c,d)};window.enableEvents=Va;window.sendEvent=Wa;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 3f0a259e4..f32432395 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -128,8 +128,8 @@ function zd(){this.w&49152?(this.G|=128,F(this,4,3)):this.F?this.F.c():Xa(this); function Fd(a){var b=Q(this,a),c=this.a;N(this,wc(this,a,b));this.a=c-Ed[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Gd(a){var b=rc(this,a);N(this,vc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Hd=[7,13,13,17,14,18,17,21]; function Id(a){var b=uc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.o=b>>16,this.h=this.o|b,this.g=0,this.j=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Od(a){S(this,a,Q(this,a),Tc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function X(a){S(this,a,0,Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Pd(){F(this,28,5);this.a-=5}function Qd(){this.l&4||this.v.fa();this.l|=4;gc(this,-2);this.a-=3} -function Rd(a){S(this,a,Q(this,a),Wc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Sd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Xd[a>>6&3].call(this,a)}function Yd(a){Zd[a>>6&3].call(this,a)}function $d(a){ae[a&15].call(this,a)}function be(a){ce[a&15].call(this,a)}function de(a){ee[a>>6&3].call(this,a)}function fe(a){ge[a>>6&3].call(this,a)}function he(a){ie[a>>6&3].call(this,a)} -var Sd=[function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Xc,Y,function(a){ke[a>>8&15].call(this,a)},Gd,wd,gd,cd,ed,Od,Y],je=[function(a){le[a>>4&15].call(this,a)},sd,pd,hd,id,nd,jd,ld,Dd,Dd,Td,Vd,Yd,Y,Y,Y],Ud=[function(a){O(this,wc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],Xd=[function(a){S(this,a,0,Nc); +function Rd(a){S(this,a,Q(this,a),Wc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){F(this,8,6)}function bc(a){Sd[a>>12].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Yd(a){Zd[a>>6&3].call(this,a)}function $d(a){ae[a&15].call(this,a)}function be(a){ce[a&15].call(this,a)}function de(a){ee[a>>6&3].call(this,a)}function fe(a){ge[a>>6&3].call(this,a)}function he(a){ie[a>>6&3].call(this,a)} +var Sd=[function(a){je[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Xc,Y,function(a){ke[a>>8&15].call(this,a)},Gd,wd,gd,cd,ed,Od,Y],je=[function(a){le[a>>4&15].call(this,a)},sd,pd,hd,id,nd,jd,ld,Dd,Dd,Td,Vd,Yd,Y,Y,Y],Ud=[function(a){O(this,wc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Nc); this.a-=this.c?11:6},function(a){S(this,a,L(this)?1:0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,L(this)?1:0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=uc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Zd=[function(a){S(this,a,0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}],le=[function(a){me[a& 15].call(this,a)},Y,Y,Y,V,V,V,V,Md,Y,$d,be,X,X,X,X],me=[zd,Qd,Ld,rd,Ad,Kd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],ae=[Jd,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.h=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],ce=[Jd,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.h=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],ke=[qd,od,kd,md,td,ud,$c,ad,yd,Pd,de,fe,he,Y,Y,Y],ee=[function(a){O(this,vc(this,a,0)); this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Mc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}],ge=[function(a){R(this,a,0,Oc);this.a-=this.c?11:6},function(a){R(this,a,L(this)?1:0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,L(this)?1:0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=tc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],ie= @@ -152,43 +152,43 @@ g.Z=function(a){return a?this.save():!0};g.reset=function(){Ce(this)};g.save=fun g.dc=function(){this.b&=-129;0":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j), this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;yb(this.a,this.K,1)}};var De={},Be=(De[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],De[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],De[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],De[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],De);q(function(){for(var a=A(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.s[b]=c,!0;case "loadTape":return this.s[b]=c,c.onclick=function(){var a=d.s.listTapes;a&&Fe(d, -a.options[a.selectedIndex].text,a.value)},!0;case "mountTape":if(this.B)return this.s[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Fe(d,ka(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -g.ea=function(a,b,c,d){this.v=a;this.m=b;this.a=c;this.F=d;var e=this;if((this.c=Tb(this.v,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){m("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.H=zb(56,4);this.C=wb(this.a,function(){Ge(e)});tb(b,this,He);Ie(this,"None",Ee,!0);this.B&&Ie(this,"Local Tape","?");Ie(this,"Remote Tape","??");Je(this)||B(this)}; -g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0};g.reset=function(){this.b&=-2241;this.A=0};function Je(a){a.g=0;if(a.c){var b=a.c.path,c;if(!(c=a.c.name))a:{if((c=a.s.listTapes)&&c.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(d=la(c),e="json"==d||"gz"==d?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!h(e,null,!0,function(d,e,f){var k=0>f&&a.v&&!a.v.i.M;if(f)a.I('Unable to load tape "'+b+'" (error '+f+": "+d+")",k);else if(Pa(a.ra,d,e),d=ua(d,e))a.h=c,a.u=0,a.o=d.L; -a.i.Wa=!1;a.g&&(a.g--,a.g||B(a));Ne(a)})}function Ie(a,b,c,d){if((a=a.s.listTapes)&&a.options){for(var e=0;e\nLicense: GPL version 3 or later ");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bRe){if(Te(d,this.u)){this.j=new K(this,"1.30.1","failsafe");Te(this.j)&&(Ye(this,d),a=2,Ze(this.j));this.j.set("timestamp",ta());$e(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Xe(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Te(d,k):("error"== -f&&"no machine state"!=k?(this.I("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),Ze(d),Te(d)?(c=Xe(d),e=!0):c=!1))}e&&We(this,c?d:null)}else 2==a&&d.clear()}else We(this);delete this.u;delete this.A}e=x(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.i.M=!0;var d=this.s.power;d&&(d.textContent="Shutdown");this.a&&(af(this,this.a,b,c,a),this.a.Da());this.H&&(Ye(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; -function Ye(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}} -function bf(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.M=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n'+b+"");a.innerHTML=b}},!0;case "descTape":return this.s[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.s[b]=c,c.onclick=function(){var a= +d.s.listTapes;a&&Ge(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(this.C)return this.s[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ge(d,ka(b,!0),b,1,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +g.ea=function(a,b,c,d){this.v=a;this.m=b;this.a=c;this.F=d;var e=this;if((this.c=Tb(this.v,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){m("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.J=zb(56,4);this.H=wb(this.a,function(){He(e)});tb(b,this,Ie);Je(this,"None",Ee,!0);this.C&&Je(this,"Local Tape","?");Je(this,"Remote Tape","??");Ke(this)||B(this)}; +g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0};g.reset=function(){this.b&=-2241;this.B=0};function Ke(a){a.g=0;if(a.c){var b=a.c.path,c;if(!(c=a.c.name))a:{if((c=a.s.listTapes)&&c.options)for(var d=0;dc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!h(f,null,!0,function(e,f,k){var n=0>k&&a.v&&!a.v.i.M;if(k)a.I('Unable to load tape "'+b+'" (error '+k+": "+e+")",n);else if(Pa(a.ra,e,f),e=ua(e,f))e= +e.L,a.h=c,a.A=d,2!=d&&(a.u=0,a.o=e);a.i.Wa=!1;a.g&&(a.g--,a.g||B(a));Oe(a)})}function Je(a,b,c,d){if((a=a.s.listTapes)&&a.options){for(var e=0;e\nLicense: GPL version 3 or later ");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bSe){if(Ue(d,this.u)){this.j=new K(this,"1.30.1","failsafe");Ue(this.j)&&(Ze(this,d),a=2,$e(this.j));this.j.set("timestamp",ta());af(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ye(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Ue(d,k):("error"== +f&&"no machine state"!=k?(this.I("Error: "+k),"unable to verify user"==k&&(za("user",""),this.c=null)):this.P(f+": "+k),$e(d),Ue(d)?(c=Ye(d),e=!0):c=!1))}e&&Xe(this,c?d:null)}else 2==a&&d.clear()}else Xe(this);delete this.u;delete this.A}e=x(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.i.M=!0;var d=this.s.power;d&&(d.textContent="Shutdown");this.a&&(bf(this,this.a,b,c,a),this.a.Da());this.H&&(Ze(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +function Ze(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;h("http://www.pcjs.org/api/v1/report",d,!0)}} +function cf(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new K(a,"1.30.1"),k=new K(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&Xa(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.M=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],k);jf(a,b,c)}})}else c(a,null)} -function kf(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--ff||Ga(!0));n=!1}var k,l,n=!0;ff++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=r:D.appendChild(document.createTextNode(r));t.appendChild(D)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?gf(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--ff||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--ff||Ga(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?gf(b,a,d,!0,e,r):hf(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Wd){f(Wd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return kf(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map +g.V=function(a,b,c){var d=this;switch(b){case "power":return this.s[b]=c,c.onclick=function(){d.g||(d.i.M?cf(d,!1,!0):We(d,d.Fa))},!0;case "reset":return this.s[b]=c,c.onclick=function(){if(d.i.M&&!d.g)if(d.b&&!d.v){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");cf(d,a,!0);!a&&d.C?window&&window.location.reload():d.Fa(Se)}else d.reset(),d.a&&d.a.Da()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.s[b]= +c,c.onclick=function(){var a=Te(d,!0);if(a){var b=!!(d.b&&!d.v||d.C),c=cf(d,b);b?df(d,a,c):d.I("Resume disabled, machine state not saved")}},!0}return!1}; +function Te(a,b){var c=a.c;c||((c=ya("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ef(a,c))||a.I("The user ID is invalid.")):b&&a.I("Browser local storage is not available"));return c} +function ef(a,b){a.c=null;b=h(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){m(d.message+" ("+c+")")}return a.c}function Ve(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+ff(a,"1.30.1"));return b} +function df(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ff(a,"1.30.1");d.data=c;b=h(na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");h(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);kf(a,b,c)}})}else c(a,null)} +function lf(a,b,c,d){function e(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--gf||Ga(!0));n=!1}var k,l,n=!0;gf++;Oa[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=r:D.appendChild(document.createTextNode(r));t.appendChild(D)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?hf(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--gf||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--gf||Ga(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?hf(b,a,d,!0,e,r):jf(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Xd){f(Xd.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return lf(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map