Fixed the fallback logic for IOPAGE ranges where only byte handlers exist (ie, the readROMByte() case)
This commit is contained in:
parent
9e00cd4dad
commit
8188554875
6 changed files with 489 additions and 468 deletions
|
|
@ -219,7 +219,7 @@ BusPDP11.IOHANDLER = {
|
|||
* Unlike regular Memory blocks, IOPAGE accesses permit word accesses on ODD addresses; that works
|
||||
* just fine by registering WORD handlers for the appropriate ODD addresses. For BYTE accesses, it
|
||||
* depends. For CPU register addresses, addIOHandlers() installs special byte handlers that perform
|
||||
* either a simple word read or write. Other addresses must be handled on case-by-case basis.
|
||||
* either a simple word read or write. Other addresses must be handled on a case-by-case basis.
|
||||
*
|
||||
* TODO: Another small potential improvement would be for addIOHandlers() to install fallbacks for ALL
|
||||
* missing handlers, in both the ODD and EVEN cases, so there's never a need to check each function index
|
||||
|
|
@ -265,6 +265,13 @@ BusPDP11.IOController = {
|
|||
if (afn) {
|
||||
if (afn[BusPDP11.IOHANDLER.READ_WORD]) {
|
||||
b = afn[BusPDP11.IOHANDLER.READ_WORD](addrMasked & ~0x1) >> 8;
|
||||
} else if (afn[BusPDP11.IOHANDLER.READ_BYTE]) {
|
||||
/*
|
||||
* WARNING: This is an unusual fall-back, because we're trying to read an ODD byte
|
||||
* access using a BYTE handler registered for EVEN bytes. But if that's all we've got,
|
||||
* then presumably the handler is prepared for it (certainly, readROMByte() is).
|
||||
*/
|
||||
b = afn[BusPDP11.IOHANDLER.READ_BYTE](addrMasked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -346,6 +353,13 @@ BusPDP11.IOController = {
|
|||
w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](0) : 0;
|
||||
afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & 0xff) | (b << 8), addrMasked);
|
||||
fWrite = true;
|
||||
} else if (afn[BusPDP11.IOHANDLER.WRITE_BYTE]) {
|
||||
/*
|
||||
* WARNING: This is an unusual fall-back, because we're trying to write an ODD byte
|
||||
* access using a BYTE handler registered for EVEN bytes. But if that's all we've got,
|
||||
* then presumably the handler is prepared for it (certainly, writeROMByte() is).
|
||||
*/
|
||||
afn[BusPDP11.IOHANDLER.WRITE_BYTE](b, addrMasked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1239,7 +1253,7 @@ BusPDP11.prototype.restoreMemory = function(a)
|
|||
* getMemorySize(type)
|
||||
*
|
||||
* NOTE: The original pdp11.js defined MAX_MEMORY as IOBASE_UNIBUS - 16384, where IOBASE_UNIBUS
|
||||
* is 4Mb less 256Kb, and then subtracted another 16Kb so that BSD 2.9 could boot.
|
||||
* is 4Mb less 256Kb, and then it subtracted another 16Kb so that BSD 2.9 could boot.
|
||||
*
|
||||
* @this {BusPDP11}
|
||||
* @param {number} type is one of the MemoryPDP11.TYPE constants (only RAM is currently supported)
|
||||
|
|
@ -1263,6 +1277,11 @@ BusPDP11.prototype.getMemorySize = function(type)
|
|||
* relative to the starting IOPAGE address, but they can also be absolute; we simply mask all addresses with
|
||||
* IOPAGE_MASK.
|
||||
*
|
||||
* CAVEATS: If a conflict is reported, a partial set of handlers may still have been added. There is no mechanism
|
||||
* for removing handlers, since this is considered an initialization function. And finally, when a range of addresses
|
||||
* is used, each successive address is advanced by 2, so if you really want to add a handler for a "+1" (usually odd)
|
||||
* address, then you must add it individually.
|
||||
*
|
||||
* @this {BusPDP11}
|
||||
* @param {number} start address
|
||||
* @param {number} end address
|
||||
|
|
@ -1319,8 +1338,8 @@ BusPDP11.prototype.addIOTable = function(component, table, msgCategory, sName)
|
|||
var nRegs = afn[5] || 1;
|
||||
|
||||
/*
|
||||
* As discussed in the IOController comments above, when handlers are being registered for the following
|
||||
* addresses, we must install different fallback handlers for all BYTE accesses.
|
||||
* As discussed in the IOController comments above, when handlers are being registered for these
|
||||
* BYTE-granular UNIBUS addresses, we must install custom fallback handlers for all BYTE accesses.
|
||||
*/
|
||||
if (addr >= PDP11.UNIBUS.R0SET0 && addr <= PDP11.UNIBUS.R6USER) {
|
||||
if (!fnReadByte && fnReadWord) {
|
||||
|
|
|
|||
|
|
@ -507,8 +507,10 @@ var PDP11 = {
|
|||
R6USER: 0o177717,
|
||||
|
||||
/*
|
||||
* This next group of registers is largely ignored; all accesses are routed to regsControl[]
|
||||
* This next group of registers is largely ignored; all accesses are routed to regsControl[],
|
||||
* and therefore are managed as a block of 8 "CTRL" registers.
|
||||
*/
|
||||
CTRL: 0o177740,
|
||||
LAERR: 0o177740, // Low Address Error (11/70 only)
|
||||
HAERR: 0o177742, // High Address Error (11/70 only)
|
||||
MEMERR: 0o177744, // Memory System Error (11/70 only)
|
||||
|
|
|
|||
|
|
@ -835,7 +835,7 @@ DevicePDP11.prototype.writeR6USER = function(data, addr)
|
|||
*/
|
||||
DevicePDP11.prototype.readCTRL = function(addr)
|
||||
{
|
||||
var reg = (addr - PDP11.UNIBUS.LAERR) >> 1;
|
||||
var reg = (addr - PDP11.UNIBUS.CTRL) >> 1;
|
||||
return this.cpu.regsControl[reg];
|
||||
};
|
||||
|
||||
|
|
@ -848,7 +848,7 @@ DevicePDP11.prototype.readCTRL = function(addr)
|
|||
*/
|
||||
DevicePDP11.prototype.writeCTRL = function(data, addr)
|
||||
{
|
||||
var reg = (addr - PDP11.UNIBUS.LAERR) >> 1;
|
||||
var reg = (addr - PDP11.UNIBUS.CTRL) >> 1;
|
||||
this.cpu.regsControl[reg] = data;
|
||||
};
|
||||
|
||||
|
|
@ -1090,7 +1090,7 @@ DevicePDP11.UNIBUS_IOTABLE = {
|
|||
[PDP11.UNIBUS.R5SET1]: /* 177715 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R5SET1", 1, PDP11.MODEL_1145],
|
||||
[PDP11.UNIBUS.R6SUPER]: /* 177716 */ [null, null, DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, "R6SUPER", 1, PDP11.MODEL_1145],
|
||||
[PDP11.UNIBUS.R6USER]: /* 177717 */ [null, null, DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, "R6USER", 1, PDP11.MODEL_1145],
|
||||
[PDP11.UNIBUS.LAERR]: /* 177740 */ [null, null, DevicePDP11.prototype.readCTRL, DevicePDP11.prototype.writeCTRL, "CTRL", 1, PDP11.MODEL_1170],
|
||||
[PDP11.UNIBUS.CTRL]: /* 177740 */ [null, null, DevicePDP11.prototype.readCTRL, DevicePDP11.prototype.writeCTRL, "CTRL", 8, PDP11.MODEL_1170],
|
||||
[PDP11.UNIBUS.LSIZE]: /* 177760 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "LSIZE", 1, PDP11.MODEL_1170],
|
||||
[PDP11.UNIBUS.HSIZE]: /* 177762 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "HSIZE", 1, PDP11.MODEL_1170],
|
||||
[PDP11.UNIBUS.SYSID]: /* 177764 */ [null, null, DevicePDP11.prototype.readSYSID, DevicePDP11.prototype.writeSYSID, "SYSID", 1, PDP11.MODEL_1170],
|
||||
|
|
@ -1101,14 +1101,6 @@ DevicePDP11.UNIBUS_IOTABLE = {
|
|||
[PDP11.UNIBUS.PSW]: /* 177776 */ [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW, "PSW"]
|
||||
};
|
||||
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.HAERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.MEMERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.CACHEC] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.MAINT] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.HITMISS]= DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UNDEF1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UNDEF2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
|
||||
|
||||
/**
|
||||
* DevicePDP11.init()
|
||||
*
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ ROMPDP11.prototype.addROM = function(addr)
|
|||
* This code has been added as a work-around to effectively allow us to install small ROMs into portions
|
||||
* of the IOPAGE address space, by installing I/O handlers for the entire range that return the corresponding
|
||||
* bytes of the current ROM image on reads, and ignore any writes (which I'm only assuming is how a typical
|
||||
* ROM "device" deals with writes; if we remove the write handler, then writes will cause a fault).
|
||||
* ROM "device" deals with writes; if we remove the write handler, then writes will fault).
|
||||
*/
|
||||
var IOTable = {
|
||||
[addr]: [ROMPDP11.prototype.readROMByte, ROMPDP11.prototype.writeROMByte, null, null, null, this.sizeROM >> 1]
|
||||
|
|
@ -348,6 +348,12 @@ ROMPDP11.prototype.readROMByte = function(addr)
|
|||
/**
|
||||
* writeROMByte(data, addr)
|
||||
*
|
||||
* This handler exists simply to ignore any writes, so that they don't cause faults.
|
||||
*
|
||||
* TODO: Another possible use for this would be to allow the Debugger to alter ROM contents,
|
||||
* if the Debugger were to provide an interface indicating whether or not it was responsible
|
||||
* for this write.
|
||||
*
|
||||
* @this {ROMPDP11}
|
||||
* @param {number} data
|
||||
* @param {number} addr
|
||||
|
|
|
|||
|
|
@ -31,288 +31,289 @@
|
|||
http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016
|
||||
http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
|
||||
*/
|
||||
for(var k,ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ca||(ca[fa]={});ca=ca[fa]}var ha=da[da.length-1],ia=ca[ha],ka=ia?ia:function(a){return Math.log(a)/Math.LN2};
|
||||
ka!=ia&&null!=ka&&ba(ca,ha,{configurable:!0,writable:!0,value:ka});var la={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
|
||||
function qa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ra(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&","<":"<",">":">",'"':""","'":"'"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})}
|
||||
function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ba=Date.now||function(){return+new Date};function Ca(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function Ea(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da<ca.length-1;da++){var ea=ca[da];ea in ba||(ba[ea]={});ba=ba[ea]}var ga=ca[ca.length-1],ha=ba[ga],ja=ha?ha:function(a){return Math.log(a)/Math.LN2};
|
||||
ja!=ha&&null!=ja&&aa(ba,ga,{configurable:!0,writable:!0,value:ja});var ka={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
|
||||
function pa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function qa(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function ra(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function sa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ta(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ua={"&":"&","<":"<",">":">",'"':""","'":"'"};function va(a){return a.replace(/[&<>"']/g,function(a){return ua[a]})}
|
||||
function wa(a,b){return(a+" ").slice(0,b)}function xa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ya={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
function za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Aa=Date.now||function(){return+new Date};function Ba(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function Fa(a,b){var c,d={da:null,ha:null,La:null,Ka:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c<e.length;c++)d.da[f++]=e[c]&255,d.da[f++]=e[c]>>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c<e.length;c++)d.da[f++]=
|
||||
function Ea(a,b){var c,d={da:null,ha:null,La:null,Ka:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c<e.length;c++)d.da[f++]=e[c]&255,d.da[f++]=e[c]>>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c<e.length;c++)d.da[f++]=
|
||||
e[c]&255,d.da[f++]=e[c]>>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else d.da=g;d.ha=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.da=e)}return d}
|
||||
function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ja(){if(null==Ia){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ia=a}return Ia}
|
||||
function La(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Oa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function Ra(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Sa={init:[],show:[],exit:[]},Ta=!1,Ua=!1,Va=!0;function Wa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Xa(a){Sa.init.push(a)}
|
||||
function Ya(a){if(Va)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Za(a){!Va&&a?(Va=!0,Ta&&$a("init"),Ua&&$a("show")):Va=a}function $a(a){Sa[a]&&Ya(Sa[a])}Wa("onload",function(){Ta=!0;Ya(Sa.init)});Wa("onpageshow",function(){Ua=!0;Ya(Sa.show)});Wa(Pa("Opera")||Pa("iOS")?"onunload":"onbeforeunload",function(){Ya(Sa.exit)});
|
||||
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.rc=b.comment;this.Tc=b;b=this.id.indexOf(".");0>b?this.Ya=this.id:(this.Qa=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.A={ready:!1,ab:!1,bc:!1,ia:!1,error:!1};this.Tb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;u.push(this)}var ab=void 0,bb={};
|
||||
if(window){ab||(ab=window.location.search.substr(1));for(var cb,db=/\+/g,eb=/([^&=]+)=?([^&]*)/g;cb=eb.exec(ab);)bb[decodeURIComponent(cb[1].replace(db," "))]=decodeURIComponent(cb[2].replace(db," "))}function fb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function z(a,b){b||(b=t);a.prototype=fb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var mb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else mb={},u=[];function nb(a,b,c){mb[a]&&b&&(mb[a][b]=c)}function ob(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function pb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function qb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
|
||||
function Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ha=a}return Ha}
|
||||
function Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Na(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Oa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Pa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function Qa(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ra={init:[],show:[],exit:[]},Sa=!1,Ta=!1,Ua=!0;function Va(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Wa(a){Ra.init.push(a)}
|
||||
function Xa(a){if(Ua)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ya(a){!Ua&&a?(Ua=!0,Sa&&Za("init"),Ta&&Za("show")):Ua=a}function Za(a){Ra[a]&&Xa(Ra[a])}Va("onload",function(){Sa=!0;Xa(Ra.init)});Va("onpageshow",function(){Ta=!0;Xa(Ra.show)});Va(Oa("Opera")||Oa("iOS")?"onunload":"onbeforeunload",function(){Xa(Ra.exit)});
|
||||
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.rc=b.comment;this.Tc=b;b=this.id.indexOf(".");0>b?this.Ya=this.id:(this.Qa=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.A={ready:!1,ab:!1,bc:!1,ia:!1,error:!1};this.Tb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;u.push(this)}var $a=void 0,ab={};
|
||||
if(window){$a||($a=window.location.search.substr(1));for(var bb,cb=/\+/g,db=/([^&=]+)=?([^&]*)/g;bb=db.exec($a);)ab[decodeURIComponent(bb[1].replace(cb," "))]=decodeURIComponent(bb[2].replace(cb," "))}function eb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function z(a,b){b||(b=t);a.prototype=eb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},u=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function ob(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function pb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
|
||||
function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.ta(g.type,g.binding,f,g.value),l=h.length}}}}
|
||||
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ta:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Ra=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.O=function(a){this.j(a,this.Ya)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Ya+": "+a)},O:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ha:function(){return this.A.ia=!0},Ga:function(a,b){b&&(this.A.ia=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.na;var c=a.i.na&b;return!!b&&c===b||!!(c&a.i.Mc)}return!1}
|
||||
function rb(a,b){if(a.A.bc)return a.A.ab=!1,a.A.bc=!1;if(a.A.error)return a.j(a.toString()+" error"),!1;a.A.ab=b;return a.A.ab}function sb(a,b){a.A.ab&&(b?a.A.bc=!0:void 0===b&&a.j(a.toString()+" busy"));return a.A.ab}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Tb,a.Tb=null,b&&b()))}function tb(a,b){b&&(a.A.ready?b():a.Tb=b);return a.A.ready}function ub(a){return a.A.error?(a.j(a.toString()+" error"),!0):!1}function vb(a,b){a.A.error=!0;a.O(b)}
|
||||
function qb(a,b){if(a.A.bc)return a.A.ab=!1,a.A.bc=!1;if(a.A.error)return a.j(a.toString()+" error"),!1;a.A.ab=b;return a.A.ab}function rb(a,b){a.A.ab&&(b?a.A.bc=!0:void 0===b&&a.j(a.toString()+" busy"));return a.A.ab}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Tb,a.Tb=null,b&&b()))}function sb(a,b){b&&(a.A.ready?b():a.Tb=b);return a.A.ready}function tb(a){return a.A.error?(a.j(a.toString()+" error"),!0):!1}function ub(a,b){a.A.error=!0;a.O(b)}
|
||||
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||
function yb(a){t.call(this,"Panel",a,yb);this.f=this.v=this.Va=this.J=this.D=0;this.K=this.L=this.H=!1;this.M=zb;this.C={};this.g={START:[1,!0,!1,this.cd],STEP:[1,!1,!1,this.dd],ENABLE:[1,!1,!1,this.Zc],CONT:[1,!0,!1,this.Xc],DEP:[0,!0,!1,this.Yc],EXAM:[1,!0,!1,this.$c],LOAD:[1,!0,!1,this.bd],TEST:[0,!0,!1,this.ad]};for(a=0;22>a;a++)this.g["S"+a]=[0,!1,!1,this.ed,a]}z(yb);var zb=7;function Ab(a,b){return a.g[b]&&a.g[b][0]}k=yb.prototype;k.reset=function(){this.stop()};
|
||||
k.ta=function(a,b,c,d){if(this.B&&this.B.ta(a,b,c,d)||this.b&&this.b.ta(a,b,c,d)||this.i&&this.i.ta(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.C[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c=
|
||||
a.g[b];Bb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.K="DEP"==b,a.L="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.g[b];c[1]&&c[2]&&(Bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.ta.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;Cb(b,this,Db);Eb(b,this.reset.bind(this));Fb(this);Gb(this)};k.Ha=function(a,b){b||(Hb(),this.reset());return!0};k.Ga=function(){return!0};
|
||||
function Ib(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Fb(a,b){for(var c in a.C)Ib(a,c,null!=b?b:a.C[c])}function Bb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Gb(a){for(var b in a.g)Bb(a,b,a.g[b][0])}function Jb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ga()),c=8==(a.i&&a.i.ca||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
|
||||
k.cd=function(a){a||this.b.A.Z||(this.w.reset(),Yb(this.b),Ab(this,"ENABLE")&&this.b.jb())};k.dd=function(){};k.Zc=function(a){a||this.b.ga()};k.Xc=function(a){if(!a&&!this.b.A.Z)if(Ab(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.kb(0),rb(a,!1);else try{var b=this.b.kb(1);0<b&&(Zb(this.b,b),$b(this.b,b,!0),ac(this.b,b))}catch(c){"number"!=typeof c&&vb(this.b,c.stack||c.message)}this.stop();this.B&&this.B.qa()}};
|
||||
k.Yc=function(a){a&&!this.b.A.Z&&(this.K&&bc(this),a=cc(this,this.Va),this.M==zb?this.w.Db(this.f,a):this.b.Db(this.f,a))};k.$c=function(a){a||this.b.A.Z||(this.L&&bc(this),a=this.M==zb?this.w.bb(this.f):this.b.bb(this.f),cc(this,a))};k.bd=function(a){a||this.b.A.Z||(this.f=this.Va&this.w.Fa,dc(this,"A",this.f,22))};k.ad=function(a){a?(this.H=!0,Fb(this,!0)):(this.H=!1,Fb(this),ec(this,0))};k.ed=function(a,b){this.Va=a?this.Va|1<<b:this.Va&~(1<<b)};
|
||||
function bc(a){var b=1145>a.b.pb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.w.Fa;Ab(a,"STEP")||(b=-b);a.f=a.f&~c|a.f+b&c;dc(a,"A",a.f,22)}function cc(a,b){a.v=b&65535;dc(a,"D",a.v,16);return a.v}function fc(a,b,c){a.C[b]=c;a.H||Ib(a,b,c)}function dc(a,b,c,d){for(var e=0;e<d;e++)fc(a,b+e,c&1<<e)}function gc(a){return void 0!==a.G.S0}function ec(a,b){if(gc(a)){a.Va=b;for(var c=0;22>c;c++)a.g["S"+c][0]=b&1<<c?1:0;Gb(a)}}k.stop=function(){this.f=this.b.u[7]&this.w.Fa;dc(this,"A",this.f,22)};
|
||||
k.fd=function(a){return(a?this.Va:this.v)&65535};k.ae=function(a){this.v=a};var hc={},Db=(hc[65400]=[null,null,yb.prototype.fd,yb.prototype.ae,"CNSW"],hc);function Hb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=pb(e.id);f||(a=!0,f=new yb(e));C(f,d);a&&H(f)}}Xa(Hb);
|
||||
function ic(a,b,c){t.call(this,"Bus",a,ic,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.B=0;this.v=[];this.g=null;this.H=1<<this.K;this.Fa=this.H-1;this.ya=jc;this.ka=Math.log2(this.ya);this.J=this.ya>>2;this.w=this.ya-1;this.D=this.H/this.ya|0;this.$a=[];this.la=0;this.f=!1;this.Ob=0;this.C=[];this.Jc=[kc,lc,mc,nc];a=new I(this);oc(a,this.i);this.W=Array(this.D);for(b=0;b<this.D;b++)this.W[b]=a;H(this)}z(ic);var jc=8192,pc=jc-1;
|
||||
function kc(a,b){var c=-1,d=this.controller,e=d.$a[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&e[2]&&(c=e[2](f&-2)>>8);if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
|
||||
function lc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.$a[a&-2])&&f[3]&&(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))}
|
||||
function mc(a,b){var c=-1,d=this.controller;a=d.$a[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
|
||||
function nc(a,b,c){var d=!1,e=this.controller;a=e.$a[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))}
|
||||
function qc(a,b){if(b!=a.B){var c;a.B&&(c=(1<<a.B)-jc,rc(a,c,jc,a.v),a.B=0);b&&(a.B=b,c=1<<b,a.Fa=c-1,c-=jc,a.v=sc(a,c,jc),a.g?rc(a,c,jc,a.g):(tc(a,c,jc,uc,a),a.g=sc(a,c,jc)))}}k=ic.prototype;k.reset=function(){for(var a=0;a<this.C.length;a++)this.C[a]();qc(this,16)};k.Ha=function(a,b){b||this.reset();return!0};
|
||||
function tc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0<g&&h<a.W.length;){var l=a.W[h],m=h*a.ya,n=a.ya-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Mb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Mb){n=l.size-(f-m);n>g&&(n=g);l.Mb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return vc(1,f,g)}f=new I(a,f,n,a.ya,d,e);oc(f,a.i,l);a.W[h++]=f;f=m+a.ya;g-=n}return 0>=g?(d!=wc||a.Ob||(a.Ob+=c),a.status((c>>10)+"Kb "+xc[d]+" at "+ra(b)),!0):vc(2,b,c)}
|
||||
function sc(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.ya;return d}function rc(a,b,c,d){var e=0;for(b>>>=a.ka;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.ya}}k.Gb=function(a){3932160<=a&&(a=yc(this.b,a));return this.W[(a&this.Fa)>>>this.ka].Xb(a&this.w,a)};k.Vb=function(a){3932160<=a&&(a=yc(this.b,a));this.f=!1;this.la++;a=this.W[(a&this.Fa)>>>this.ka].hc(a&this.w,a);this.la--;return a};
|
||||
k.oa=function(a){3932160<=a&&(a=yc(this.b,a));return this.W[(a&this.Fa)>>>this.ka].sa(a&this.w,a)};k.bb=function(a){3932160<=a&&(a=yc(this.b,a));var b=a&this.w,c=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;a=this.W[c].ic(b,a);this.la--;return a};k.Yb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.W[(a&this.Fa)>>>this.ka].$b(a&this.w,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.f=!1;this.la++;this.W[(a&this.Fa)>>>this.ka].ac(a&this.w,b&255,a);this.la--};
|
||||
k.ib=function(a,b){3932160<=a&&(a=yc(this.b,a));this.W[(a&this.Fa)>>>this.ka].Nb(a&this.w,b&65535,a)};k.Db=function(a,b){3932160<=a&&(a=yc(this.b,a));var c=a&this.w,d=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;this.W[d].mc(c,b&65535,a);this.la--};
|
||||
function zc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.W[d];if(e.Sa||e.Pc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Ac(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&pc;if(void 0!==a.$a[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.$a[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
|
||||
function Cb(a,b,c,d,e){for(var f in c){var g=+f,h=c[f];if(!(h[6]&&h[6]>a.b.pb)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y<r;y++,g+=2)if(w&&1<r&&(w=h[4]+y),!Ac(a,g,g,l,m,n,v,d||64,w||e))return!1}}return!0}function Eb(a,b){a.C.push(b)}
|
||||
k.Da=function(a,b,c){this.f=!0;this.la||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on address "+J(this.i,a),!0,!0),b&&(this.b.fa|=b),this.b.pa(4,a))};function Bc(a){var b=a.f;a.f=!1;return b}function vc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={ea:0,lc:-1}}z(K);k=K.prototype;
|
||||
k.Ea=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.i=d;var e=this;this.f.lc=Kc(c,function(){e.f.cb|=128;e.f.cb&64&&(Lc(e.b,e.f.Zd),Mc(e.b,e.f.lc,1E3/60));e.B&&e.B.qa(1)});this.f.Zd=Nc(64,6);Cb(b,this,L);Eb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.cb=0};k.od=function(){var a=this.f.cb;this.f.cb&=-129;return a};k.ie=function(a){this.f.cb=a;a&64&&Mc(this.b,this.f.lc,1E3/60);this.f.cb=a&-129};k.qd=function(){var a=this.b;return a.C&62337|a.Ja<<5|a.Na<<1};
|
||||
k.ke=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ja=a>>5&3;b.Na=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Oc(b))}};k.rd=function(){var a=this.b.fb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.sd=function(){return this.b.Kb};k.td=function(){return this.b.qb};k.le=function(a){var b=this.b;1170>b.pb&&(a&=-49);b.qb!=a&&(b.qb=a,b.Sb=a&16?4194303:262143,Oc(b))};k.Ud=function(a){a=a>>1&63;var b=this.b.Lb[a>>1];return a&1?b>>16:b&65535};
|
||||
var vb="undefined"!==typeof ArrayBuffer,wb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||
function xb(a){t.call(this,"Panel",a,xb);this.f=this.v=this.Va=this.J=this.D=0;this.K=this.L=this.H=!1;this.M=yb;this.C={};this.g={START:[1,1,!0,!1,this.cd],STEP:[1,1,!1,!1,this.dd],ENABLE:[1,1,!1,!1,this.Zc],CONT:[1,1,!0,!1,this.Xc],DEP:[0,0,!0,!1,this.Yc],EXAM:[1,1,!0,!1,this.$c],LOAD:[1,1,!0,!1,this.bd],TEST:[0,0,!0,!1,this.ad]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.ed,a]}z(xb);var yb=7;function zb(a,b){return a.g[b]&&a.g[b][1]}k=xb.prototype;k.reset=function(){this.stop()};
|
||||
k.ta=function(a,b,c,d){if(this.B&&this.B.ta(a,b,c,d)||this.b&&this.b.ta(a,b,c,d)||this.i&&this.i.ta(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.C[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
||||
b){return function(){Ab(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Bb(a,b)}}(this,b),!0):this.parent.ta.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;Cb(b,this,Db);Eb(b,this.reset.bind(this));Fb(this);Gb(this)};k.Ha=function(a,b){b||(Hb(),this.reset());return!0};k.Ga=function(){return!0};
|
||||
function Ib(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Fb(a,b){for(var c in a.C)Ib(a,c,null!=b?b:a.C[c])}function Xb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Gb(a){for(var b in a.g)Xb(a,b,a.g[b][1])}function Yb(a,b,c,d){a.G[b]&&(void 0===c&&(ub(a,"Value for "+b+" is invalid"),a.b.ga()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
|
||||
function Ab(a,b){var c=a.g[b];Xb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.K="DEP"==b,a.L="EXAM"==b)}function Bb(a,b){var c=a.g[b];c[2]&&c[3]&&(Xb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.cd=function(a){a||this.b.A.Z||(this.w.reset(),Zb(this.b),zb(this,"ENABLE")&&this.b.jb())};k.dd=function(){};k.Zc=function(a){a||this.b.ga()};
|
||||
k.Xc=function(a){if(!a&&!this.b.A.Z)if(zb(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!rb(a,!0))qb(a,!0),a.kb(0),qb(a,!1);else try{var b=this.b.kb(1);0<b&&($b(this.b,b),ac(this.b,b,!0),bc(this.b,b))}catch(c){"number"!=typeof c&&ub(this.b,c.stack||c.message)}this.stop();this.B&&this.B.qa()}};k.Yc=function(a){a&&!this.b.A.Z&&(this.K&&cc(this),a=dc(this,this.Va),this.M==yb?this.w.Db(this.f,a):this.b.Db(this.f,a))};
|
||||
k.$c=function(a){a||this.b.A.Z||(this.L&&cc(this),a=this.M==yb?this.w.bb(this.f):this.b.bb(this.f),dc(this,a))};k.bd=function(a){a||this.b.A.Z||(this.f=this.Va&this.w.Fa,ec(this,"A",this.f,22))};k.ad=function(a){a?(this.H=!0,Fb(this,!0)):(this.H=!1,Fb(this),fc(this,0))};k.ed=function(a,b){this.Va=a?this.Va|1<<b:this.Va&~(1<<b)};function cc(a){var b=1145>a.b.pb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.w.Fa;zb(a,"STEP")||(b=-b);a.f=a.f&~c|a.f+b&c;ec(a,"A",a.f,22)}
|
||||
function dc(a,b){a.v=b&65535;ec(a,"D",a.v,16);return a.v}function gc(a,b,c){a.C[b]=c;a.H||Ib(a,b,c)}function ec(a,b,c,d){for(var e=0;e<d;e++)gc(a,b+e,c&1<<e)}function hc(a){return void 0!==a.G.S0}function fc(a,b){if(hc(a)){a.Va=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Gb(a)}}k.stop=function(){this.f=this.b.u[7]&this.w.Fa;ec(this,"A",this.f,22)};k.fd=function(a){return(a?this.Va:this.v)&65535};k.ae=function(a){this.v=a};
|
||||
var ic={},Db=(ic[65400]=[null,null,xb.prototype.fd,xb.prototype.ae,"CNSW"],ic);function Hb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=ob(e.id);f||(a=!0,f=new xb(e));C(f,d);a&&H(f)}}Wa(Hb);
|
||||
function jc(a,b,c){t.call(this,"Bus",a,jc,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.B=0;this.v=[];this.g=null;this.H=1<<this.K;this.Fa=this.H-1;this.ya=kc;this.ka=Math.log2(this.ya);this.J=this.ya>>2;this.w=this.ya-1;this.D=this.H/this.ya|0;this.$a=[];this.la=0;this.f=!1;this.Ob=0;this.C=[];this.Jc=[lc,mc,nc,oc];a=new I(this);pc(a,this.i);this.W=Array(this.D);for(b=0;b<this.D;b++)this.W[b]=a;H(this)}z(jc);var kc=8192,qc=kc-1;
|
||||
function lc(a,b){var c=-1,d=this.controller,e=d.$a[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
|
||||
function mc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else if(g&1&&(f=e.$a[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,
|
||||
b),!0,!e.la))}function nc(a,b){var c=-1,d=this.controller;a=d.$a[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
|
||||
function oc(a,b,c){var d=!1,e=this.controller;a=e.$a[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))}
|
||||
function rc(a,b){if(b!=a.B){var c;a.B&&(c=(1<<a.B)-kc,sc(a,c,kc,a.v),a.B=0);b&&(a.B=b,c=1<<b,a.Fa=c-1,c-=kc,a.v=tc(a,c,kc),a.g?sc(a,c,kc,a.g):(uc(a,c,kc,vc,a),a.g=tc(a,c,kc)))}}k=jc.prototype;k.reset=function(){for(var a=0;a<this.C.length;a++)this.C[a]();rc(this,16)};k.Ha=function(a,b){b||this.reset();return!0};
|
||||
function uc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0<g&&h<a.W.length;){var l=a.W[h],m=h*a.ya,n=a.ya-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Mb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Mb){n=l.size-(f-m);n>g&&(n=g);l.Mb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return wc(1,f,g)}f=new I(a,f,n,a.ya,d,e);pc(f,a.i,l);a.W[h++]=f;f=m+a.ya;g-=n}return 0>=g?(d!=xc||a.Ob||(a.Ob+=c),a.status((c>>10)+"Kb "+yc[d]+" at "+qa(b)),!0):wc(2,b,c)}
|
||||
function tc(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.ya;return d}function sc(a,b,c,d){var e=0;for(b>>>=a.ka;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.ya}}k.Gb=function(a){3932160<=a&&(a=zc(this.b,a));return this.W[(a&this.Fa)>>>this.ka].Xb(a&this.w,a)};k.Vb=function(a){3932160<=a&&(a=zc(this.b,a));this.f=!1;this.la++;a=this.W[(a&this.Fa)>>>this.ka].hc(a&this.w,a);this.la--;return a};
|
||||
k.oa=function(a){3932160<=a&&(a=zc(this.b,a));return this.W[(a&this.Fa)>>>this.ka].sa(a&this.w,a)};k.bb=function(a){3932160<=a&&(a=zc(this.b,a));var b=a&this.w,c=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;a=this.W[c].ic(b,a);this.la--;return a};k.Yb=function(a,b){3932160<=a&&(a=zc(this.b,a));this.W[(a&this.Fa)>>>this.ka].$b(a&this.w,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=zc(this.b,a));this.f=!1;this.la++;this.W[(a&this.Fa)>>>this.ka].ac(a&this.w,b&255,a);this.la--};
|
||||
k.ib=function(a,b){3932160<=a&&(a=zc(this.b,a));this.W[(a&this.Fa)>>>this.ka].Nb(a&this.w,b&65535,a)};k.Db=function(a,b){3932160<=a&&(a=zc(this.b,a));var c=a&this.w,d=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;this.W[d].mc(c,b&65535,a);this.la--};
|
||||
function Ac(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.W[d];if(e.Sa||e.Pc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Jc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&qc;if(void 0!==a.$a[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.$a[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
|
||||
function Cb(a,b,c,d,e){for(var f in c){var g=+f,h=c[f];if(!(h[6]&&h[6]>a.b.pb)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y<r;y++,g+=2)if(w&&1<r&&(w=h[4]+y),!Jc(a,g,g,l,m,n,v,d||64,w||e))return!1}}return!0}function Eb(a,b){a.C.push(b)}
|
||||
k.Da=function(a,b,c){this.f=!0;this.la||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on address "+J(this.i,a),!0,!0),b&&(this.b.fa|=b),this.b.pa(4,a))};function Kc(a){var b=a.f;a.f=!1;return b}function wc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={ea:0,lc:-1}}z(K);k=K.prototype;
|
||||
k.Ea=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.i=d;var e=this;this.f.lc=Lc(c,function(){e.f.cb|=128;e.f.cb&64&&(Mc(e.b,e.f.Zd),Nc(e.b,e.f.lc,1E3/60));e.B&&e.B.qa(1)});this.f.Zd=Oc(64,6);Cb(b,this,Pc);Eb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.cb=0};k.od=function(){var a=this.f.cb;this.f.cb&=-129;return a};k.ie=function(a){this.f.cb=a;a&64&&Nc(this.b,this.f.lc,1E3/60);this.f.cb=a&-129};k.qd=function(){var a=this.b;return a.C&62337|a.Ja<<5|a.Na<<1};
|
||||
k.ke=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ja=a>>5&3;b.Na=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Qc(b))}};k.rd=function(){var a=this.b.fb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.sd=function(){return this.b.Kb};k.td=function(){return this.b.qb};k.le=function(a){var b=this.b;1170>b.pb&&(a&=-49);b.qb!=a&&(b.qb=a,b.Sb=a&16?4194303:262143,Qc(b))};k.Ud=function(a){a=a>>1&63;var b=this.b.Lb[a>>1];return a&1?b>>16:b&65535};
|
||||
k.Me=function(a,b){b=b>>1&63;var c=b>>1;this.b.Lb[c]=b&1?this.b.Lb[c]&65535|(a&63)<<16:this.b.Lb[c]&-65536|a&65534};k.Nd=function(a){return this.b.V[1][a>>1&7]};k.Fe=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Ld=function(a){return this.b.V[1][(a>>1&7)+8]};k.De=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.xa[1][a>>1&7]};k.Ee=function(a,b){b=b>>1&7;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.Kd=function(a){return this.b.xa[1][(a>>1&7)+8]};
|
||||
k.Ce=function(a,b){b=(b>>1&7)+8;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.nd=function(a){return this.b.V[0][a>>1&7]};k.he=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.ld=function(a){return this.b.V[0][(a>>1&7)+8]};k.fe=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.md=function(a){return this.b.xa[0][a>>1&7]};k.ge=function(a,b){b=b>>1&7;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};k.kd=function(a){return this.b.xa[0][(a>>1&7)+8]};k.ee=function(a,b){b=(b>>1&7)+8;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};
|
||||
k.Td=function(a){return this.b.V[3][a>>1&7]};k.Le=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Rd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Je=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Sd=function(a){return this.b.xa[3][a>>1&7]};k.Ke=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Qd=function(a){return this.b.xa[3][(a>>1&7)+8]};k.Ie=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Bb=function(a){a&=7;return this.b.N&2048?this.b.Wa[a]:this.b.u[a]};
|
||||
k.Eb=function(a,b){b&=7;this.b.N&2048?this.b.Wa[b]=a:this.b.u[b]=a};k.yd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.qe=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Bd=function(){return this.b.u[7]};k.te=function(a){this.b.u[7]=a};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Wa[a]};k.Fb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Wa[b]=a};k.zd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]};
|
||||
k.re=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ad=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.se=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.hd=function(a){return this.b.Cc[a-65504>>1]};k.ce=function(a,b){this.b.Cc[b-65504>>1]=a};k.zc=function(a){if(65520==a){a=0;switch(wc){case wc:a=this.w.Ob}a=(a>>6)-1}else a=0;return a};k.Gc=function(){};k.Pd=function(){return 1};k.He=function(){};k.gd=function(){return this.b.fa};
|
||||
k.be=function(){this.b.fa=0};k.pd=function(){return this.b.Bc};k.je=function(a,b){b&1||(a&=255);this.b.Bc=a};k.ud=function(a){return a?this.b.kc:0};k.me=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.kc=a;b.I|=2};k.Od=function(a){return a?this.b.gb&65280:0};k.Ge=function(a){this.b.gb=a|255};k.xd=function(){return Pc(this.b)};k.pe=function(a){Qc(this.b,a&-1809|Pc(this.b)&1808);this.b.I|=128};k.Fc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)};
|
||||
var M={},L=(M[61568]=[null,null,K.prototype.Ud,K.prototype.Me,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Nd,K.prototype.Fe,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Ld,K.prototype.De,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Md,K.prototype.Ee,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Kd,K.prototype.Ce,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.nd,K.prototype.he,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.ld,K.prototype.fe,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.md,
|
||||
K.prototype.ge,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.kd,K.prototype.ee,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.td,K.prototype.le,"MMR3",1,1145],M[65382]=[null,null,K.prototype.od,K.prototype.ie,"LKS"],M[65402]=[null,null,K.prototype.qd,K.prototype.ke,"MMR0",1,1145],M[65404]=[null,null,K.prototype.rd,K.prototype.Fc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.sd,K.prototype.Fc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Td,K.prototype.Le,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Rd,
|
||||
K.prototype.Je,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Sd,K.prototype.Ke,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Qd,K.prototype.Ie,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Bb,K.prototype.Eb,"R0SET0"],M[65473]=[null,null,K.prototype.Bb,K.prototype.Eb,"R1SET0"],M[65474]=[null,null,K.prototype.Bb,K.prototype.Eb,"R2SET0"],M[65475]=[null,null,K.prototype.Bb,K.prototype.Eb,"R3SET0"],M[65476]=[null,null,K.prototype.Bb,K.prototype.Eb,"R4SET0"],M[65477]=[null,null,K.prototype.Bb,K.prototype.Eb,
|
||||
"R5SET0"],M[65478]=[null,null,K.prototype.yd,K.prototype.qe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Bd,K.prototype.te,"R7KERNEL"],M[65480]=[null,null,K.prototype.Cb,K.prototype.Fb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Cb,K.prototype.Fb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Cb,K.prototype.Fb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Cb,K.prototype.Fb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Cb,K.prototype.Fb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Cb,
|
||||
K.prototype.Fb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.zd,K.prototype.re,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Ad,K.prototype.se,"R6USER",1,1145],M[65504]=[null,null,K.prototype.hd,K.prototype.ce,"CTRL",1,1170],M[65520]=[null,null,K.prototype.zc,K.prototype.Gc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.zc,K.prototype.Gc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Pd,K.prototype.He,"SYSID",1,1170],M[65526]=[null,null,K.prototype.gd,K.prototype.be,"CPUERR",1,1170],M[65528]=
|
||||
[null,null,K.prototype.pd,K.prototype.je,"MB",1,1170],M[65530]=[null,null,K.prototype.ud,K.prototype.me,"PIR"],M[65532]=[null,null,K.prototype.Od,K.prototype.Ge,"SL"],M[65534]=[null,null,K.prototype.xd,K.prototype.pe,"PSW"],M);L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];
|
||||
Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new K(c);C(c,d);break;case "pc11":c=new Rc(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var Sc;if(wb){var Tc=new ArrayBuffer(2);(new DataView(Tc)).setUint16(0,256,!0);Sc=256===(new Uint16Array(Tc))[0]}else Sc=!1;var Uc=Sc;
|
||||
function I(a,b,c,d,e,f){this.w=a;this.id=Vc+=2;this.b=null;this.F=b;this.Mb=c;this.size=d||0;this.type=e||Wc;this.f=e==Xc;this.controller=null;oc(this);this.Sa=this.Pc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Yc(this,f.Jc);else if(wb)this.C=new ArrayBuffer(this.size),this.D=new DataView(this.C,0,this.size),this.G=new Uint8Array(this.C,0,this.size),this.J=new Uint16Array(this.C,0,this.size>>1),this.b=new Int32Array(this.C,0,this.size>>2),Yc(this,Uc?Zc:$c);else{a=this.b=Array(this.size>>
|
||||
2);for(f=0;f<a.length;f++)a[f]=0;Yc(this,ad)}else Yc(this)}var Wc=0,wc=1,Xc=2,uc=4,xc=["NONE","RAM","ROM","VID","H/W"],Vc=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(wb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(wb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Sa=!0}return!1},nb:function(a,b){b?this.B++||bd(this,cd,!1):this.g++||dd(this,cd,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i,
|
||||
k.re=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ad=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.se=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.hd=function(a){return this.b.Cc[a-65504>>1]};k.ce=function(a,b){this.b.Cc[b-65504>>1]=a};k.zc=function(a){if(65520==a){a=0;switch(xc){case xc:a=this.w.Ob}a=(a>>6)-1}else a=0;return a};k.Gc=function(){};k.Pd=function(){return 1};k.He=function(){};k.gd=function(){return this.b.fa};
|
||||
k.be=function(){this.b.fa=0};k.pd=function(){return this.b.Bc};k.je=function(a,b){b&1||(a&=255);this.b.Bc=a};k.ud=function(a){return a?this.b.kc:0};k.me=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.kc=a;b.I|=2};k.Od=function(a){return a?this.b.gb&65280:0};k.Ge=function(a){this.b.gb=a|255};k.xd=function(){return Rc(this.b)};k.pe=function(a){Sc(this.b,a&-1809|Rc(this.b)&1808);this.b.I|=128};k.Fc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
|
||||
var L={},Pc=(L[61568]=[null,null,K.prototype.Ud,K.prototype.Me,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Nd,K.prototype.Fe,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Ld,K.prototype.De,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Md,K.prototype.Ee,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Kd,K.prototype.Ce,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.nd,K.prototype.he,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.ld,K.prototype.fe,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.md,
|
||||
K.prototype.ge,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.kd,K.prototype.ee,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.td,K.prototype.le,"MMR3",1,1145],L[65382]=[null,null,K.prototype.od,K.prototype.ie,"LKS"],L[65402]=[null,null,K.prototype.qd,K.prototype.ke,"MMR0",1,1145],L[65404]=[null,null,K.prototype.rd,K.prototype.Fc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.sd,K.prototype.Fc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Td,K.prototype.Le,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Rd,
|
||||
K.prototype.Je,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Sd,K.prototype.Ke,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Qd,K.prototype.Ie,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.Bb,K.prototype.Eb,"R0SET0"],L[65473]=[null,null,K.prototype.Bb,K.prototype.Eb,"R1SET0"],L[65474]=[null,null,K.prototype.Bb,K.prototype.Eb,"R2SET0"],L[65475]=[null,null,K.prototype.Bb,K.prototype.Eb,"R3SET0"],L[65476]=[null,null,K.prototype.Bb,K.prototype.Eb,"R4SET0"],L[65477]=[null,null,K.prototype.Bb,K.prototype.Eb,
|
||||
"R5SET0"],L[65478]=[null,null,K.prototype.yd,K.prototype.qe,"R6KERNEL"],L[65479]=[null,null,K.prototype.Bd,K.prototype.te,"R7KERNEL"],L[65480]=[null,null,K.prototype.Cb,K.prototype.Fb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Cb,K.prototype.Fb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Cb,K.prototype.Fb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Cb,K.prototype.Fb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Cb,K.prototype.Fb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Cb,
|
||||
K.prototype.Fb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.zd,K.prototype.re,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ad,K.prototype.se,"R6USER",1,1145],L[65504]=[null,null,K.prototype.hd,K.prototype.ce,"CTRL",8,1170],L[65520]=[null,null,K.prototype.zc,K.prototype.Gc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.zc,K.prototype.Gc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Pd,K.prototype.He,"SYSID",1,1170],L[65526]=[null,null,K.prototype.gd,K.prototype.be,"CPUERR",1,1170],L[65528]=
|
||||
[null,null,K.prototype.pd,K.prototype.je,"MB",1,1170],L[65530]=[null,null,K.prototype.ud,K.prototype.me,"PIR"],L[65532]=[null,null,K.prototype.Od,K.prototype.Ge,"SL"],L[65534]=[null,null,K.prototype.xd,K.prototype.pe,"PSW"],L);Wa(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new K(c);C(c,d);break;case "pc11":c=new Tc(c);C(c,d);break;case "rl11":c=new M(c),C(c,d)}}});var Uc;
|
||||
if(vb){var Vc=new ArrayBuffer(2);(new DataView(Vc)).setUint16(0,256,!0);Uc=256===(new Uint16Array(Vc))[0]}else Uc=!1;var Wc=Uc;
|
||||
function I(a,b,c,d,e,f){this.w=a;this.id=Xc+=2;this.b=null;this.F=b;this.Mb=c;this.size=d||0;this.type=e||Yc;this.f=e==Zc;this.controller=null;pc(this);this.Sa=this.Pc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],$c(this,f.Jc);else if(vb)this.C=new ArrayBuffer(this.size),this.D=new DataView(this.C,0,this.size),this.G=new Uint8Array(this.C,0,this.size),this.J=new Uint16Array(this.C,0,this.size>>1),this.b=new Int32Array(this.C,0,this.size>>2),$c(this,Wc?ad:bd);else{a=this.b=Array(this.size>>
|
||||
2);for(f=0;f<a.length;f++)a[f]=0;$c(this,cd)}else $c(this)}var Yc=0,xc=1,Zc=2,vc=4,yc=["NONE","RAM","ROM","VID","H/W"],Xc=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(vb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(vb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Sa=!0}return!1},nb:function(a,b){b?this.B++||dd(this,ed,!1):this.g++||fd(this,ed,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i,
|
||||
"attempt to read invalid address "+J(this.i,b),!0);this.w.Da(b,32,2);return 255},v:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.w.Da(c,32,4)},L:function(a,b){return this.Xb(a++,b++)|this.Xb(a,b)<<8},H:function(a,b,c){this.$b(a++,b&255,c++);this.$b(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.w.Da(b,64,2);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},ua:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Sa=!0},Na:function(a,b,c){a&1&&this.w.Da(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Sa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;ed(c,this.F+a,1,c.M)&&c.ga(!0)}return this.hc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;ed(c,this.F+a,2,c.M)&&c.ga(!0)}return this.ic(a,b)},Ya:function(a,
|
||||
b,c){if(this.i&&null!=this.F){var d=this.i;ed(d,this.F+a,1,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.ac(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;ed(d,this.F+a,2,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Qa:function(a,b){a&1&&this.w.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.w.Da(b,64,2);
|
||||
1]&255)<<8},ua:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Sa=!0},Na:function(a,b,c){a&1&&this.w.Da(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Sa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;gd(c,this.F+a,1,c.M)&&c.ga(!0)}return this.hc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;gd(c,this.F+a,2,c.M)&&c.ga(!0)}return this.ic(a,b)},Ya:function(a,
|
||||
b,c){if(this.i&&null!=this.F){var d=this.i;gd(d,this.F+a,1,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.ac(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;gd(d,this.F+a,2,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Qa:function(a,b){a&1&&this.w.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.w.Da(b,64,2);
|
||||
a=this.J[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ja:function(a,b){this.G[a]=b;this.Sa=!0},ma:function(a,b,c){this.G[a]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&this.w.Da(c,64,4);this.D.setUint16(a,b,!0);this.Sa=!0},Ja:function(a,b,c){a&1&&this.w.Da(c,64,4);this.J[a>>1]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
|
||||
b)+")",!0)}};function oc(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&dd(a,cd,!1),(a.B=c.B)&&bd(a,cd,!1))}function fd(a,b){b?--a.B||(a.$b=a.f?a.v:a.ac,a.Nb=a.f?a.H:a.mc):--a.g||(a.Xb=a.hc,a.sa=a.ic)}function bd(a,b,c){c&&a.B||(a.$b=!a.f&&b[1]||a.v,a.Nb=!a.f&&b[3]||a.H);if(c||void 0===c)a.ac=b[1]||a.v,a.mc=b[3]||a.H}function dd(a,b,c){c&&a.g||(a.Xb=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.K,a.ic=b[2]||a.L}function Yc(a,b){b||(b=gd);dd(a,b,void 0);bd(a,b,void 0)}
|
||||
var gd=[],ad=[I.prototype.S,I.prototype.ua,I.prototype.ca,I.prototype.Na],cd=[I.prototype.P,I.prototype.Ya,I.prototype.Y,I.prototype.Aa];if(wb)var $c=[I.prototype.M,I.prototype.ja,I.prototype.Qa,I.prototype.wa],Zc=[I.prototype.R,I.prototype.ma,I.prototype.$,I.prototype.Ja];
|
||||
function hd(a,b){t.call(this,"CPU",a,hd,1);var c=a.multiplier||1;this.mb=a.cycles||b;this.eb=c;this.vb=Math.round(this.mb/1E4)/100;this.ob=this.vb*this.eb;this.A.Z=!1;this.A.Zb=!1;this.A.ub=a.autoStart;this.A.xb=!1;this.Hb=this.ma=0;this.Ib=a.csStart;this.yb=a.csInterval;this.zb=a.csStop;this.K=[];this.wc=this.Yd.bind(this);H(this)}z(hd);var id=["power","reset"];k=hd.prototype;
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b<id.length;b++)(c=this.G[id[b]])&&this.B.ta(null,id[b],c);a=jd(a,"autoStart");null!=a&&(this.A.ub="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||
k.Ha=function(a,b){if(!b){if(a&&this.restore){kd(this);if(!this.restore(a))return!1;ld(this)}else this.reset();this.i?(a=this.i,b=this.A.ub,a.lb=!0,a.j("Type ? for help with PDPjs Debugger commands"),md(a),b||a.sb(),a.Za&&(b=a.Za,a.Za=null,nd(a,b))):this.j("No debugger detected")}return!0};k.Ga=function(a){return a?this.save():!0};k.ub=function(){return this.A.ub||!this.i&&void 0===this.G.run?(this.jb(),!0):!1};k.tc=function(){return 0};
|
||||
function ld(a){void 0===a.Ib&&(a.Ib=0);void 0===a.yb&&(a.yb=-1);void 0===a.zb&&(a.zb=-1);a.A.xb=0<=a.Ib&&0<a.yb;a.A.xb&&(a.Hb=0,a.ma=a.Ib-a.ja)}function ac(a,b){if(a.A.xb){var c=!1;a.Hb=a.Hb+a.tc()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.yb,c=!0);0<=a.zb&&a.zb<=od(a)&&(a.yb=a.zb=-1,ld(a),a.ga(),c=!0);c&&a.j(od(a)+" cycles: checksum="+p(a.Hb))}}
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Tb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.Z?d.ga():d.jb())},
|
||||
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){pd(d,d.eb<<1,!0)},c.textContent=this.ob.toFixed(2)+"Mhz",!0}return!1};k.qa=function(a){this.B&&this.B.qa(a)};function $b(a,b,c){a.ja+=b;c&&(a.ca=a.b=a.J=0)}function qd(a,b){var c=1;b&&1<a.eb&&a.Y&&(c=a.Y/a.vb);a.Ub=Math.round(1E3/30);a.lb=Math.floor(a.mb/30*c);b||(a.ua=a.lb);a.wb=0}function od(a){return a.ja+a.S+a.ca-a.b}function kd(a){a.Y=0;a.Wb=0;a.ja=a.S=a.ca=a.b=a.J=0;ld(a);pd(a,1)}
|
||||
function pd(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.ob?b=1:d=!0;a.eb=b;b=a.vb*a.eb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.sb()}$b(a,a.S);a.S=0;a.R=Ba();a.$=0;qd(a);return d}function Kc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Mc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.mb*a.eb/1E3*c|0,a.K[b][0]=c+rd(a))}
|
||||
function sd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Zb(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function rd(a,b){var c=a.ca-=a.b;a.b=a.J=0;b&&(a.ca=0);return c}
|
||||
k.Yd=function(){if(this.A.Z){this.wb>=this.mb&&qd(this,!0);this.Aa=0;this.Za=Ba();if(this.$){var a=this.Za-this.$;a>this.Ub&&(this.R+=a,this.R>this.Za&&(this.R=this.Za))}try{do{var b=sd(this,this.A.xb?1:this.lb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=rd(this,!0);this.Aa+=b;this.S+=b;ac(this,b);Zb(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.lb;15<=++this.Wb&&(this.qa(),this.Wb=0);break}}while(this.A.Z)}catch(e){this.ga();this.B&&this.B.stop(Ba(),od(this));vb(this,e.stack||e.message);
|
||||
return}if(this.A.Z){a=setTimeout;b=this.wc;this.$=Ba();var c=this.Ub;this.Aa&&(c=Math.round(c*this.Aa/this.lb));var c=c-(this.$-this.Za),d=this.$-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ja=0,pd(this)));if(0>c||this.Y<this.ob)-1E3>c&&(this.R-=c),c=0;this.wb+=this.Aa;this.$+=c;a(b,c)}}};
|
||||
k.jb=function(a){if(ub(this))return!1;if(this.A.Z)return this.j(this.toString()+" busy"),!1;pd(this);this.A.Z=!0;this.A.Zb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,od(this)));setTimeout(this.wc,0);return!0};k.kb=function(){return 0};k.ga=function(a){var b=!1;if(this.A.Z){rd(this);$b(this,this.S);this.S=0;this.A.Z=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Ba(),od(this));b=!0}this.A.complete=a;return b};
|
||||
function td(a){this.pb=+a.model||1170;this.Pb=a.addrReset||0;hd.call(this,a,6666667);this.decode=1120==this.pb?ud.bind(this):vd.bind(this);wd(this);this.L=0;this.M=null;this.A.complete=!1}z(td,hd);k=td.prototype;k.reset=function(){this.status("model "+this.pb);this.A.Z&&this.ga();wd(this);kd(this);this.A.error=!1;this.parent.reset.call(this)};
|
||||
function wd(a){a.T=65536;a.U=32768;a.aa=65535;a.X=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Pb];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.v=0;a.Na=0;a.Sc=[4,2,0,1];a.V=[[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.xa=[[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.Lb=[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.Cc=[0,0,0,0,0,0,0,0];a.Bc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.tb=0;a.wa=-1;Yb(a)}function Yb(a){a.gb=255;a.fa=0;a.kc=0;a.C=0;a.fb=0;a.Kb=0;a.qb=0;a.Ua=0;a.Ja=0;a.Sb=262143;a.M=null;a.w&&Oc(a)}function Oc(a){a.Ua?(a.P=65536,a.ba=a.Rc,a.sa=a.Vd,a.Nb=a.Ne,qc(a.w,a.qb&16?22:18)):(a.P=0,a.ba=a.Qc,a.sa=a.Ac,a.Nb=a.Hc,qc(a.w,16))}function xd(a,b,c){a.Pb=b;O(a,b);!c&&a.i&&(a.ga()||md(a.i))}k.tc=function(){return 0};
|
||||
k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ja,this.eb]);a.set(2,zc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];pd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.W[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function yd(a){return a.T&65536?1:0}
|
||||
function zd(a){return a.U&32768?2:0}function Ad(a){return a.aa&65535?0:4}k.Ta=function(){return this.X&32768?8:0};function Bd(a){var b=a.u[7];a.C&57344||(a.fb=0,a.Kb=b);a.u[7]=b+2&65535;return a.sa(b)}function Cd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Nc(a,b){return{$d:a,Ab:b,next:null}}function Lc(a,b){if(b!=a.M){var c=a.M;if(!c||c.Ab<=b.Ab)b.next=c,a.M=b;else{do{var d=c.next;if(!d||d.Ab<=b.Ab){b.next=d;c.next=b;break}c=d}while(c)}}a.I|=2}
|
||||
function Pc(a){return a.N=a.N&63728|a.Ta()|Ad(a)|zd(a)|yd(a)}function Qc(a,b){a.X=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Wa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Wa[c];a.Wa[c]=d}a.v=b>>14&3;c=a.N>>14&3;a.v!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.v]);a.N=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.aa=b,a.U=0)}function Dd(a,b,c){a.I&128||(a.X=a.aa=a.T=b,a.U=c||0)}function Ed(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^b)&(d^b))}
|
||||
function Fd(a,b){a.I&128||(a.X=a.aa=a.T=b,a.U=a.X^a.T>>1)}function Gd(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.wa?this.wa=Pc(this):this.v||(a=4,c=!0);this.C&57344||(this.fb=63222,this.Kb=a);this.v=0;var d=this.sa(a|this.P),e=this.sa(a+2&65535|this.P);Qc(this,e&-12289|this.wa>>2&12288);c&&(this.fa|=4,this.u[6]=4);Yd(this,this.wa);Yd(this,this.u[7]);O(this,d);this.I&=-113;this.wa=-1;this.I|=8;this.Wc=a;this.Uc=b;if(26!=b)throw a;}};
|
||||
function Zd(a){var b=$d(a),c=$d(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Qc(a,c);a.I&=-17}function yc(a,b){var c=b>>13&31;31>c&&a.qb&32&&(b=a.Lb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function ae(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.qb&a.Sc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.Sb;var g=0;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.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Na=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Na<<1),
|
||||
b=!0),a.C&61440||!(4191360>f||4194239<f)||(a.C|=4096,a.C&512&&(a.I|=32)),b&&a.pa(168,16));return f}function be(a,b){return a.w.Gb(b)}function ce(a,b,c){b&1&&a.b--;a.w.Yb(b,c&255)}function $d(a){var b=a.sa(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b}function Yd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.C&57344||(a.fb=a.fb<<8|246);!a.v&&c<=a.gb&&4<c&&(c<=a.gb-32?(a.fa|=4,a.u[6]=4,a.pa(4,18)):(a.fa|=8,a.I|=4));a.Nb(c,b)}
|
||||
function de(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.pa(4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.u[6]<=a.gb||65534<=a.u[6])&&(a.u[6]<=a.gb-32||65534<=a.u[6]?(a.fa|=4,a.u[6]=4,a.pa(4,22)):(a.fa|=8,a.I|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.sa(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.sa(e)|
|
||||
g;a.b-=8;break;case 6:return e=a.sa(Cd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Cd(a,2)),e=e+a.u[c]&65535,e=a.sa(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.fb=a.fb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.gb||65534<=a.u[6])&&(a.u[6]<=a.gb-32?(a.fa|=4,a.u[6]=4,a.pa(4,24)):(a.fa|=8,a.I|=64));return e}k.Vb=function(a){if(!this.Ua)return this.w.Vb(a);this.L++;a=be(this,ae(this,a,3));this.L--;return a};
|
||||
k.bb=function(a){if(!this.Ua)return this.w.bb(a);this.L++;a=this.Ac(ae(this,a,2));this.L--;return a};k.rb=function(a,b){this.Ua?(this.L++,ce(this,ae(this,a,5),b),this.L--):this.w.rb(a,b)};k.Db=function(a,b){this.Ua?(this.L++,this.Hc(ae(this,a,4),b),this.L--):this.w.Db(a,b)};k.Qc=function(a,b,c){return de(this,a,b,c)};k.Rc=function(a,b,c){return ae(this,de(this,a,b,c),c)};k.Ac=function(a){return this.w.oa(a)};k.Vd=function(a){return this.w.oa(ae(this,a,2))};k.Hc=function(a,b){this.w.ib(a,b&65535)};
|
||||
k.Ne=function(a,b){this.w.ib(ae(this,a,4),b)};function ee(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=de(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.v=a.N>>12&3,c=a.sa(d|c&a.P),a.v=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function fe(a,b,c,d){a.C&57344||(a.fb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=de(a,b,e,4),c&65536||(e&=65535),a.v=a.N>>12&3,e=ae(a,e|c&65536,4),a.v=a.N>>14&3,a.w.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d}
|
||||
function ge(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?be(a,a.ba(b,c,3)):a.u[c]&255}function he(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}function ie(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return de(a,b,c,8)}function je(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?be(a,a.ba(b,c,3)):a.u[c]&255}function ke(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}
|
||||
function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.tb=a.ba(b,e,7),ce(a,e,d.call(a,c,be(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.ib(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function le(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?ce(a,a.ba(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 me(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ib(a.ba(b,d,4),c):a.u[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
k.kb=function(a){this.A.complete=!0;var b=this.i&&ne(this.i)?1:this.A.Zb?-1:0,c=a?this.A.Zb?0:1:-1;this.A.Zb=!1;this.ca=this.b=a;do{if(b){if(this.i&&oe(this.i,this.u[7],c)){this.ga();break}c||c++;b++}if(this.I){this.I&112&&(this.I&32?this.pa(168,28):this.I&64?this.pa(4,30):this.I&16&&this.pa(12,32),this.I&=-113);if(a=this.I&7){a=!1;if(this.I&2){this.I&=-3;var d=160,e=(this.kc&224)>>5,f=this.M&&this.M.Ab>e?this.M:null;f&&(d=f.$d,e=f.Ab);e>(this.N&224)>>5?(this.I&4&&(Cd(this,2),this.I&=-5),this.pa(d,
|
||||
26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.M,f==a)this.M=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.I&1&&this.I++;a=a&&0>c}if(a)break}this.I=this.I&7|this.N&16;this.decode(Bd(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};Xa(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new td(d);C(d,c)}});function pe(a,b){var c=b+a;Ed(this,c,a,b);return c&65535}
|
||||
function qe(a,b){var c=b+a;Ed(this,c<<8,a<<8,b<<8);return c&255}function re(a,b){a=b<<1;Fd(this,a);return a&65535}function se(a,b){a=b<<1;Fd(this,a<<8);return a&255}function te(a,b){a=b&32768|b>>1|b<<16;Fd(this,a);return a&65535}function ue(a,b){a=b&2048|b>>1|b<<8;Fd(this,a<<8);return a&255}function ve(a,b){a=b&~a;R(this,a);return a}function we(a,b){a=b&~a;R(this,a<<8);return a}function xe(a,b){a|=b;R(this,a);return a}function ye(a,b){a|=b;R(this,a<<8);return a}
|
||||
function ze(a,b){a=~b|65536;Dd(this,a);return a&65535}function Ae(a,b){a=~b|256;Dd(this,a<<8);return a&255}function Be(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.U=b&(b^a));return a&65535}function Ce(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.aa=c,this.U=b&(b^c));return a&255}function De(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.U=a&(b^a));return a&65535}function Ee(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.aa=c,this.U=c&(b<<8^c));return a&255}
|
||||
function Fe(a,b){a=-b;Dd(this,a,a&b&32768);return a&65535}function Ge(a,b){a=-b;Dd(this,a<<8,(a&b&128)<<8);return a&255}function He(a,b){a=b<<1|this.T>>16&1;Fd(this,a);return a&65535}function Ie(a,b){a=b<<1|this.T>>16&1;Fd(this,a<<8);return a&255}function Je(a,b){a=(this.T&65536|b)>>1|b<<16;Fd(this,a);return a&65535}function Ke(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Fd(this,a<<8);return a&255}function Le(a,b){var c=b-a;Gd(this,c,a,b);return c&65535}
|
||||
function Me(a,b){var c=b-a;Gd(this,c<<8,a<<8,b<<8);return c&255}function Ne(a,b){this.I&128||(this.X=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Oe(a,b){a^=b;R(this,a);return a&65535}function Pe(a){T(this,a,he(this,a),pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function Qe(a){var b=ke(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b}
|
||||
function Re(a){var b=ke(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Se(a){U(this,a,!yd(this))}function Te(a){U(this,a,yd(this))}
|
||||
function Ue(a){T(this,a,he(this,a),ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ve(a){S(this,a,ge(this,a),we);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function We(a){T(this,a,he(this,a),xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Xe(a){S(this,a,ge(this,a),ye);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function Ye(a){R(this,he(this,a)&ke(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Ze(a){R(this,(ge(this,a)&je(this,a))<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function $e(a){U(this,a,Ad(this))}function af(a){U(this,a,!this.Ta()==!zd(this))}function bf(a){U(this,a,!Ad(this)&&!this.Ta()==!zd(this))}function cf(a){U(this,a,!yd(this)&&!Ad(this))}function df(a){U(this,a,Ad(this)||!this.Ta()!=!zd(this))}
|
||||
function ef(a){U(this,a,yd(this)||Ad(this))}function ff(a){U(this,a,!this.Ta()!=!zd(this))}function gf(a){U(this,a,this.Ta())}function hf(a){U(this,a,!Ad(this))}function jf(a){U(this,a,!this.Ta())}function kf(){this.pa(12,1);this.b-=5}function lf(a){U(this,a,!0)}function mf(a){U(this,a,!zd(this))}function nf(a){U(this,a,zd(this))}function V(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5}
|
||||
function of(a){var b=he(this,a);a=ke(this,a);Gd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function pf(a){var b=ge(this,a)<<8;a=je(this,a)<<8;Gd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}
|
||||
function qf(a){var b=ke(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=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.aa=d>>16|d,this.X=d>>16):(this.U=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.U=32768,this.T=65536,this.b-=7}function rf(){this.pa(24,2);this.b-=25}
|
||||
function sf(){this.N&49152?(this.fa|=128,this.pa(4,3)):this.i?tf(this.i):this.ga();this.b-=7}function uf(){this.pa(16,4);this.b-=25}var vf=[0,7,7,10,7,11,9,13];function wf(a){this.J=this.b;O(this,ie(this,a));this.b=this.J-vf[this.g]}var xf=[0,14,14,17,14,18,16,20];function yf(a){this.J=this.b;var b=ie(this,a);a=a>>6&7;Yd(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-xf[this.g]}var zf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function Af(a){var b=he(this,a);this.J=this.b;R(this,me(this,a,b));this.b=this.J-zf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Bf(a){var b=ge(this,a);R(this,le(this,a,b,1)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Cf=[7,13,13,17,14,18,17,21];
|
||||
function Df(a){var b=ke(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.I&128||(this.X=b>>16,this.aa=this.X|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Ef(){this.b-=5}function Ff(){this.N&49152||(this.w.reset(),Yb(this));this.b-=667}function Gf(){Zd(this);this.I|=this.N&16;this.b-=13}
|
||||
function Hf(a){if(a&8)W.call(this,a);else{var b=$d(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function X(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.X=32768);this.b-=5}function If(a){var b=(a&448)>>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 Jf(a){T(this,a,he(this,a),Le);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function Kf(a){T(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}function Lf(){this.pa(28,5);this.b-=5}function Mf(){this.I|=4;Cd(this,-2);this.b-=3}function Nf(a){T(this,a,he(this,a),Oe);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=tf(b);b||this.pa(8,6)}function ud(a){Of[a>>12].call(this,a)}function Pf(a){Qf[a>>6&3].call(this,a)}function Rf(a){Sf[a>>6&3].call(this,a)}function Tf(a){Uf[a>>6&3].call(this,a)}
|
||||
function Vf(a){Wf[a&15].call(this,a)}function Xf(a){Yf[a&15].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)}
|
||||
var Of=[function(a){eg[a>>8&15].call(this,a)},Af,of,Ye,Ue,We,Pe,W,function(a){fg[a>>8&15].call(this,a)},Bf,pf,Ze,Ve,Xe,Jf,W],eg=[function(a){gg[a>>4&15].call(this,a)},lf,hf,$e,af,ff,bf,df,yf,yf,Pf,Rf,Tf,W,W,W],Qf=[function(a){Dd(this,me(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Be);this.b-=this.g?9:3+(7==this.f?2:0)}],Sf=[function(a){T(this,a,0,
|
||||
Fe);this.b-=this.g?11:6},function(a){T(this,a,yd(this)?1:0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,yd(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ke(this,a);Dd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Uf=[function(a){T(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
gg=[function(a){hg[a&15].call(this,a)},W,W,W,wf,wf,wf,wf,Hf,W,Vf,Xf,Kf,Kf,Kf,Kf],hg=[sf,Mf,Gf,kf,uf,Ff,W,W,W,W,W,W,W,W,W,W],Wf=[Ef,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},V,function(){this.aa=1;this.b-=5},V,V,V,function(){this.X=0;this.b-=5},V,V,V,V,V,V,V],Yf=[Ef,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},X,function(){this.aa=0;this.b-=5},X,X,X,function(){this.X=32768;this.b-=5},X,X,X,X,X,X,X],fg=[jf,gf,cf,ef,mf,nf,Se,Te,rf,Lf,Zf,ag,cg,W,W,W],$f=[function(a){Dd(this,
|
||||
le(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){S(this,a,0,Ge);this.b-=this.g?11:6},function(a){S(this,a,yd(this)?1:0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,yd(this)?1:0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=je(this,a);Dd(this,a<<8);this.b-=this.g?4:3+(7==
|
||||
this.f?2:0)}],dg=[function(a){S(this,a,0,Ke);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ue);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)}];function vd(a){ig[a>>12].call(this,a)}
|
||||
var ig=[function(a){jg[a>>8&15].call(this,a)},Af,of,Ye,Ue,We,Pe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},Bf,pf,Ze,Ve,Xe,Jf,W],jg=[function(a){mg[a>>4&15].call(this,a)},lf,hf,$e,af,ff,bf,df,yf,yf,Pf,Rf,Tf,function(a){ng[a>>6&3].call(this,a)},W,W],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ee(this,a,0);Yd(this,a);R(this,a);this.b-=11},function(a){var b=$d(this);this.J=
|
||||
this.b;fe(this,a,0,b);R(this,b);this.b=this.J-Cf[this.g]},function(a){R(this,me(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},W,W,W,wf,wf,wf,wf,Hf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.I|=1),this.b-=5):W.call(this,a)},Vf,Xf,Kf,Kf,Kf,Kf],og=[sf,Mf,Gf,kf,uf,Ff,function(){Zd(this);this.b-=13},W,W,W,W,W,W,W,W,W],kg=[Df,Df,qf,qf,Qe,Qe,Re,Re,Nf,Nf,W,W,W,W,If,If],lg=[jf,gf,cf,ef,mf,nf,Se,Te,rf,Lf,Zf,ag,cg,function(a){pg[a>>
|
||||
6&3].call(this,a)},W,W],pg=[W,function(a){a=ee(this,a,65536);Yd(this,a);R(this,a);this.b-=11},function(a){var b=$d(this);this.J=this.b;fe(this,a,65536,b);R(this,b);this.b=this.J-Cf[this.g]},W];
|
||||
function qg(a){t.call(this,"ROM",a,qg);this.ha=this.g=null;this.C=a.addr;this.f=a.size;this.D=!1;this.v=a.alias;this.B=a.file;this.H=sa(this.B);if(this.B){a=this.B;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.B=null):(nb(c.Qa,a,b),(a=Fa(a,b))?(c.g=a.da,c.ha=a.ha):c.B=null);rg(c)})}}z(qg);k=qg.prototype;
|
||||
k.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)};k.Ha=function(){this.ha&&(this.i&&sg(this.i,this.id,this.C,this.f,this.ha),delete this.ha);return!0};k.Ga=function(){return!0};
|
||||
function rg(a){if(!tb(a)){if(a.B){if(!a.g||!a.w)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)vb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.C;a.status(a.f+"-byte ROM at "+ra(b));if(57344<=b&&b<57344+jc){var c={};b=(c[b]=[qg.prototype.Jd,qg.prototype.Be,null,null,null,a.f>>1],c);if(Cb(a.w,a,b,256,a.Ya)){b=a.D=!0;break a}}else if(tc(a.w,b,a.f,Xc)){for(c=0;c<a.g.length;c++)a.w.rb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.v?
|
||||
b.push(a.v):null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){var d=a,e=b[c],f=sc(d.w,d.C,d.f);rc(d.w,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Jd=function(a){return this.g[a-this.C]};k.Be=function(){};Xa(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new qg(d);C(d,c)}});
|
||||
function tg(a){t.call(this,"RAM",a,tg);this.ha=this.g=null;this.B=a.addr;this.C=a.size;this.La=a.load;this.Ka=a.exec;this.v=!1;this.f=a.file;this.D=sa(this.f);if(this.f){a=this.f;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(nb(c.Qa,a,b),(a=Fa(a,b))?(c.g=a.da,c.ha=a.ha,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.f=null);ug(c)})}}
|
||||
z(tg);tg.prototype.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;ug(this)};tg.prototype.Ha=function(){this.ha&&(this.i&&sg(this.i,this.id,this.B,this.C,this.ha),delete this.ha);return!0};tg.prototype.Ga=function(){return!0};function ug(a){if(a.w&&(!a.v&&a.C&&tc(a.w,a.B,a.C,wc)&&(a.v=!0),!tb(a))){if(!a.v)q("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;Og(a,a.g,a.La,a.Ka,a.B)}H(a)}}
|
||||
tg.prototype.reset=function(){if(this.v){for(var a=this.w,b=this.B,c=this.C,d=b&a.w,b=b>>>a.ka;0<c&&b<a.W.length;){var e=a.W[b];if(e.controller&&a.g&&a.g.length==a.v.length){var f=a.g.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(wb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.ac(d,g,e.F+d)}c-=a.ya;b++;d=0}this.g&&Og(this,this.g,this.La,this.Ka,this.B,!0)}};
|
||||
function Og(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(;r--;)a.b.rb(n++,b[v++]&255);else n&1?a.b.ga():xd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.b.rb(c+
|
||||
e,b[e]);null!=d&&xd(a.b,d,f);g=!0}return g}Xa(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new tg(d);C(d,c)}});function Pg(a){t.call(this,"Keyboard",a,Pg,65536);H(this)}z(Pg);Pg.prototype.ta=function(){return!1};Pg.prototype.Ea=function(a,b,c,d){this.B=a;this.b=c;this.i=d};Xa(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Pg(d);C(d,c)}});
|
||||
function Y(a){this.M=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.ca=a.upperCase;this.v=this.D=null;this.S=a.tabSize;this.P=a.charBOL;this.H=0;t.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Qg;b&&(void 0===c&&(c="Panel"),(c=qb(c,this.id))&&(b=c.G[b])&&this.ta(null,a,b))}this.J=this.L=null;this.exports={connect:this.xc,receiveData:this.jc}}z(Y);var Qg="buffer";k=Y.prototype;
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case Qg:return this.G[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.jc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.jc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;var e=this;this.ja=Nc(48,4);this.Y=Kc(this.b,function(){e.f&128||!e.C.length||(e.K=e.C.shift()&255,e.ca&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Lc(e.b,e.ja))});this.ma=Nc(52,4);this.$=Kc(this.b,function(){e.g|=128;e.g&64&&Lc(e.b,e.ma)});Cb(b,this,Rg);H(this)};
|
||||
k.xc=function(){if(!this.J){var a=jd(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.Ya)return;b=ya(b[1]);if(this.J=pb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ha=function(a,b){if(!b)if(this.xc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
k.Ga=function(a){return a?this.save():!0};k.reset=function(){Sg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Sg(this)};function Sg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.jc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.C.push(a.charCodeAt(b));else this.C=this.C.concat(a);Mc(this.b,this.Y,1E3/Math.round(this.M/10));return!0};k.Dd=function(){return this.f&65534};
|
||||
k.ve=function(a){this.f=this.f&-112|a&111};k.Cd=function(){this.f&=-129;0<this.C.length&&Mc(this.b,this.Y,1E3/Math.round(this.M/10));return this.K};k.ue=function(){};k.Xd=function(){return this.g};k.Pe=function(a){128==(this.g&192)&&a&64&&Mc(this.b,this.$,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Wd=function(){return 0};
|
||||
k.Oe=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.J,a);if(this.v)if(13==a)this.H=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=za[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=xa("",c)));this.P&&!this.H&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D),
|
||||
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Mc(this.b,this.$,1E3/Math.round(this.R/10))}};var Tg={},Rg=(Tg[65392]=[null,null,Y.prototype.Dd,Y.prototype.ve,"RCSR"],Tg[65394]=[null,null,Y.prototype.Cd,Y.prototype.ue,"RBUF"],Tg[65396]=[null,null,Y.prototype.Xd,Y.prototype.Pe,"XCSR"],Tg[65398]=[null,null,Y.prototype.Wd,Y.prototype.Oe,"XBUF"],Tg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Y(d);C(d,c)}});
|
||||
function Rc(a){t.call(this,"PC11",a,Rc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.K=this.L=this.f=0;this.J=[];this.H=Ug;this.v=Vg;this.M=this.C="";this.da=this.La=this.Ka=null;this.R=-1;this.P=!Pa("Mobi")&&window&&"FileReader"in window}z(Rc);var Ug="",Vg=0;k=Rc.prototype;
|
||||
k.ta=function(a,b,c){var d=this,e=Vg;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
|
||||
function(){var a=d.G.listTapes;a&&Wg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[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;Wg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Xg(a);var e=this;if((this.g=jd(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=Nc(56,4);this.ca=Kc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.J.length&&(e.L=e.J[e.K++]&255,Yg(e,e.K/e.J.length*100),e.f|=128,e.f&=-2049,e.f&64&&Lc(e.b,e.Y))});Cb(b,this,Zg);$g(this,"None",Ug,!0);this.P&&$g(this,"Local Tape",
|
||||
"?");$g(this,"Remote Tape","??");ah(this)||H(this)};k.Ha=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function ah(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=sa(b,!0)}b&&c?bh(a,c,b,1,!0):ch(a)}return!!a.D}
|
||||
function Wg(a,b,c,d,e){if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;bh(a,b,c,d,!1,e)}else dh(a,!1)}
|
||||
function bh(a,b,c,d,e,f){var g=-1;if(a.C.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,dh(a,!0),a.A.ab?a.O("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),eh(a,b,c,d,f)?g++:a.A.ab=!0);g&&fh(a,a.M,a.C,a.v,a.da,a.La,a.Ka)}
|
||||
function eh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),fh(a,b,c,d,e),a.H="?");ch(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Qa,e,f),(e=Fa(e,f))&&fh(a,b,c,d,e.da,e.La,
|
||||
e.Ka));a.A.ab=!1;a.D&&(a.D--,a.D||H(a));ch(a)})}function $g(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function ch(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.C;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Yg(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
|
||||
function fh(a,b,c,d,e,f,g){a.M=b;a.C=c;a.v=d;a.da=e;a.La=f;a.Ka=g;2==d?a.S&&Og(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.C="",a.H=Ug,a.v=Vg,a.O("No load address available for tape: "+b)):(a.K=0,a.J=e,a.status("tape attached: "+b),Yg(a,0))}function dh(a,b){if(a.C||!1===b)a.M="",a.C="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.H=Ug,a.v=Vg,ch(a))}k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};k.wd=function(){return this.f&65534};
|
||||
k.oe=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Lc(this.b,this.Y)):(this.f&=-129,this.f|=2048,this.L=0,Mc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.vd=function(){this.f&=-129;this.f|=2048;return this.L};k.ne=function(){};var gh={},Zg=(gh[65384]=[null,null,Rc.prototype.wd,Rc.prototype.oe,"PRS"],gh[65386]=[null,null,Rc.prototype.vd,Rc.prototype.ne,"PRB"],gh);
|
||||
function hh(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++ih,4)},hh,2097152);this.controller=a;this.B=a.B;this.i=a.i;this.v=b;this.Xa=b.name;this.fc=b.fc;jh(this,c,b.va,b.za,b.ra,b.Ma);H(this)}var ih=0;z(hh);k=hh.prototype;k.Ea=function(a,b,c,d){this.i=d};
|
||||
function jh(a,b,c,d,e,f){a.mode=b;a.va=c;a.za=d;a.ra=e;a.Ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.va);for(c=0;c<b.length;c++){d=Array(a.za);for(e=0;e<d.length;e++){f=Array(a.ra);for(var g=1;g<=f.length;g++)f[g-1]=kh(null,c,e,g,a.Ma,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
||||
function lh(a,b,c,d,e){var f=c;if(a.w)return!0;a.Xa=b;a.hb=c;a.Ec=sa(c);a.w=e;a.C=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=la[d];if(e){a.va=e[0];a.za=e[1];a.ra=e[2];a.Ma=e[3]||512;c=a.Ma>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.za),w=0;w<r.length;w++)for(var y=r[w]=Array(a.ra),x=0;x<y.length;x++){for(var A=kh(null,d,w,x+1,a.Ma,0),ja=A.data,Ka=0;Ka<c;Ka++,f+=4)var Q=ja[Ka]=b.getInt32(f,
|
||||
!0),e=e+Q&-1;A.Ba=c;y[x]=A}a.f=e;c=a}else a.O("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Xa,a.hb),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Ea(f,
|
||||
null,!0,function(b,c,d){mh(a,b,c,d)})}
|
||||
function mh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Xa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Qa,b,c);try{if(0<sa(a.Ec,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Xa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.va=h.length;a.za=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d<a.va;d++)for(f=0;f<a.za;f++)for(g=0;g<a.ra;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;nh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}kh(l,d,f);for(w=
|
||||
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Xa)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.w&&(a.w.call(a.C,a.v,e,a.Xa,a.hb),a.w=null)}function kh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Se=b;a.Te=c;a.Pa=a.Ba=0;a.Sa=!1;return a}
|
||||
k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.Kc&&b<f.za)for(h=g[b]=Array(f.Lc),g=0;g<h.length;g++)h[g]=kh(null,a,b,g+1,f.yc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Kc&&9==f.oc&&(d=h[g]=kh(null,a,b,f.oc,f.yc,0))}}e&&e(d,!1);return d};function nh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
b)+")",!0)}};function pc(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&fd(a,ed,!1),(a.B=c.B)&&dd(a,ed,!1))}function hd(a,b){b?--a.B||(a.$b=a.f?a.v:a.ac,a.Nb=a.f?a.H:a.mc):--a.g||(a.Xb=a.hc,a.sa=a.ic)}function dd(a,b,c){c&&a.B||(a.$b=!a.f&&b[1]||a.v,a.Nb=!a.f&&b[3]||a.H);if(c||void 0===c)a.ac=b[1]||a.v,a.mc=b[3]||a.H}function fd(a,b,c){c&&a.g||(a.Xb=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.K,a.ic=b[2]||a.L}function $c(a,b){b||(b=id);fd(a,b,void 0);dd(a,b,void 0)}
|
||||
var id=[],cd=[I.prototype.S,I.prototype.ua,I.prototype.ca,I.prototype.Na],ed=[I.prototype.P,I.prototype.Ya,I.prototype.Y,I.prototype.Aa];if(vb)var bd=[I.prototype.M,I.prototype.ja,I.prototype.Qa,I.prototype.wa],ad=[I.prototype.R,I.prototype.ma,I.prototype.$,I.prototype.Ja];
|
||||
function jd(a,b){t.call(this,"CPU",a,jd,1);var c=a.multiplier||1;this.mb=a.cycles||b;this.eb=c;this.vb=Math.round(this.mb/1E4)/100;this.ob=this.vb*this.eb;this.A.Z=!1;this.A.Zb=!1;this.A.ub=a.autoStart;this.A.xb=!1;this.Hb=this.ma=0;this.Ib=a.csStart;this.yb=a.csInterval;this.zb=a.csStop;this.K=[];this.wc=this.Yd.bind(this);H(this)}z(jd);var kd=["power","reset"];k=jd.prototype;
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b<kd.length;b++)(c=this.G[kd[b]])&&this.B.ta(null,kd[b],c);a=ld(a,"autoStart");null!=a&&(this.A.ub="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||
k.Ha=function(a,b){if(!b){if(a&&this.restore){md(this);if(!this.restore(a))return!1;nd(this)}else this.reset();this.i?(a=this.i,b=this.A.ub,a.lb=!0,a.j("Type ? for help with PDPjs Debugger commands"),od(a),b||a.sb(),a.Za&&(b=a.Za,a.Za=null,pd(a,b))):this.j("No debugger detected")}return!0};k.Ga=function(a){return a?this.save():!0};k.ub=function(){return this.A.ub||!this.i&&void 0===this.G.run?(this.jb(),!0):!1};k.tc=function(){return 0};
|
||||
function nd(a){void 0===a.Ib&&(a.Ib=0);void 0===a.yb&&(a.yb=-1);void 0===a.zb&&(a.zb=-1);a.A.xb=0<=a.Ib&&0<a.yb;a.A.xb&&(a.Hb=0,a.ma=a.Ib-a.ja)}function bc(a,b){if(a.A.xb){var c=!1;a.Hb=a.Hb+a.tc()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.yb,c=!0);0<=a.zb&&a.zb<=qd(a)&&(a.yb=a.zb=-1,nd(a),a.ga(),c=!0);c&&a.j(qd(a)+" cycles: checksum="+p(a.Hb))}}
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Tb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.Z?d.ga():d.jb())},
|
||||
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){rd(d,d.eb<<1,!0)},c.textContent=this.ob.toFixed(2)+"Mhz",!0}return!1};k.qa=function(a){this.B&&this.B.qa(a)};function ac(a,b,c){a.ja+=b;c&&(a.ca=a.b=a.J=0)}function sd(a,b){var c=1;b&&1<a.eb&&a.Y&&(c=a.Y/a.vb);a.Ub=Math.round(1E3/30);a.lb=Math.floor(a.mb/30*c);b||(a.ua=a.lb);a.wb=0}function qd(a){return a.ja+a.S+a.ca-a.b}function md(a){a.Y=0;a.Wb=0;a.ja=a.S=a.ca=a.b=a.J=0;nd(a);rd(a,1)}
|
||||
function rd(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.ob?b=1:d=!0;a.eb=b;b=a.vb*a.eb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.sb()}ac(a,a.S);a.S=0;a.R=Aa();a.$=0;sd(a);return d}function Lc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Nc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.mb*a.eb/1E3*c|0,a.K[b][0]=c+td(a))}
|
||||
function ud(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function $b(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function td(a,b){var c=a.ca-=a.b;a.b=a.J=0;b&&(a.ca=0);return c}
|
||||
k.Yd=function(){if(this.A.Z){this.wb>=this.mb&&sd(this,!0);this.Aa=0;this.Za=Aa();if(this.$){var a=this.Za-this.$;a>this.Ub&&(this.R+=a,this.R>this.Za&&(this.R=this.Za))}try{do{var b=ud(this,this.A.xb?1:this.lb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=td(this,!0);this.Aa+=b;this.S+=b;bc(this,b);$b(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.lb;15<=++this.Wb&&(this.qa(),this.Wb=0);break}}while(this.A.Z)}catch(e){this.ga();this.B&&this.B.stop(Aa(),qd(this));ub(this,e.stack||e.message);
|
||||
return}if(this.A.Z){a=setTimeout;b=this.wc;this.$=Aa();var c=this.Ub;this.Aa&&(c=Math.round(c*this.Aa/this.lb));var c=c-(this.$-this.Za),d=this.$-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ja=0,rd(this)));if(0>c||this.Y<this.ob)-1E3>c&&(this.R-=c),c=0;this.wb+=this.Aa;this.$+=c;a(b,c)}}};
|
||||
k.jb=function(a){if(tb(this))return!1;if(this.A.Z)return this.j(this.toString()+" busy"),!1;rd(this);this.A.Z=!0;this.A.Zb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,qd(this)));setTimeout(this.wc,0);return!0};k.kb=function(){return 0};k.ga=function(a){var b=!1;if(this.A.Z){td(this);ac(this,this.S);this.S=0;this.A.Z=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Aa(),qd(this));b=!0}this.A.complete=a;return b};
|
||||
function vd(a){this.pb=+a.model||1170;this.Pb=a.addrReset||0;jd.call(this,a,6666667);this.decode=1120==this.pb?wd.bind(this):xd.bind(this);yd(this);this.L=0;this.M=null;this.A.complete=!1}z(vd,jd);k=vd.prototype;k.reset=function(){this.status("model "+this.pb);this.A.Z&&this.ga();yd(this);md(this);this.A.error=!1;this.parent.reset.call(this)};
|
||||
function yd(a){a.T=65536;a.U=32768;a.aa=65535;a.X=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Pb];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.v=0;a.Na=0;a.Sc=[4,2,0,1];a.V=[[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.xa=[[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.Lb=[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.Cc=[0,0,0,0,0,0,0,0];a.Bc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.tb=0;a.wa=-1;Zb(a)}function Zb(a){a.gb=255;a.fa=0;a.kc=0;a.C=0;a.fb=0;a.Kb=0;a.qb=0;a.Ua=0;a.Ja=0;a.Sb=262143;a.M=null;a.w&&Qc(a)}function Qc(a){a.Ua?(a.P=65536,a.ba=a.Rc,a.sa=a.Vd,a.Nb=a.Ne,rc(a.w,a.qb&16?22:18)):(a.P=0,a.ba=a.Qc,a.sa=a.Ac,a.Nb=a.Hc,rc(a.w,16))}function zd(a,b,c){a.Pb=b;N(a,b);!c&&a.i&&(a.ga()||od(a.i))}k.tc=function(){return 0};
|
||||
k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ja,this.eb]);a.set(2,Ac(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];rd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.W[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Ad(a){return a.T&65536?1:0}
|
||||
function Bd(a){return a.U&32768?2:0}function Cd(a){return a.aa&65535?0:4}k.Ta=function(){return this.X&32768?8:0};function Dd(a){var b=a.u[7];a.C&57344||(a.fb=0,a.Kb=b);a.u[7]=b+2&65535;return a.sa(b)}function Ed(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function N(a,b){a.u[7]=b&65535}function Oc(a,b){return{$d:a,Ab:b,next:null}}function Mc(a,b){if(b!=a.M){var c=a.M;if(!c||c.Ab<=b.Ab)b.next=c,a.M=b;else{do{var d=c.next;if(!d||d.Ab<=b.Ab){b.next=d;c.next=b;break}c=d}while(c)}}a.I|=2}
|
||||
function Rc(a){return a.N=a.N&63728|a.Ta()|Cd(a)|Bd(a)|Ad(a)}function Sc(a,b){a.X=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Wa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Wa[c];a.Wa[c]=d}a.v=b>>14&3;c=a.N>>14&3;a.v!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.v]);a.N=b;a.I|=2}function Q(a,b){a.I&128||(a.X=a.aa=b,a.U=0)}function Fd(a,b,c){a.I&128||(a.X=a.aa=a.T=b,a.U=c||0)}function Xd(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^b)&(d^b))}
|
||||
function Yd(a,b){a.I&128||(a.X=a.aa=a.T=b,a.U=a.X^a.T>>1)}function Zd(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.wa?this.wa=Rc(this):this.v||(a=4,c=!0);this.C&57344||(this.fb=63222,this.Kb=a);this.v=0;var d=this.sa(a|this.P),e=this.sa(a+2&65535|this.P);Sc(this,e&-12289|this.wa>>2&12288);c&&(this.fa|=4,this.u[6]=4);$d(this,this.wa);$d(this,this.u[7]);N(this,d);this.I&=-113;this.wa=-1;this.I|=8;this.Wc=a;this.Uc=b;if(26!=b)throw a;}};
|
||||
function ae(a){var b=be(a),c=be(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);N(a,b);Sc(a,c);a.I&=-17}function zc(a,b){var c=b>>13&31;31>c&&a.qb&32&&(b=a.Lb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function ce(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.qb&a.Sc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.Sb;var g=0;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.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Na=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Na<<1),
|
||||
b=!0),a.C&61440||!(4191360>f||4194239<f)||(a.C|=4096,a.C&512&&(a.I|=32)),b&&a.pa(168,16));return f}function de(a,b){return a.w.Gb(b)}function ee(a,b,c){b&1&&a.b--;a.w.Yb(b,c&255)}function be(a){var b=a.sa(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b}function $d(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.C&57344||(a.fb=a.fb<<8|246);!a.v&&c<=a.gb&&4<c&&(c<=a.gb-32?(a.fa|=4,a.u[6]=4,a.pa(4,18)):(a.fa|=8,a.I|=4));a.Nb(c,b)}
|
||||
function fe(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.pa(4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.u[6]<=a.gb||65534<=a.u[6])&&(a.u[6]<=a.gb-32||65534<=a.u[6]?(a.fa|=4,a.u[6]=4,a.pa(4,22)):(a.fa|=8,a.I|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.sa(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.sa(e)|
|
||||
g;a.b-=8;break;case 6:return e=a.sa(Ed(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Ed(a,2)),e=e+a.u[c]&65535,e=a.sa(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.fb=a.fb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.gb||65534<=a.u[6])&&(a.u[6]<=a.gb-32?(a.fa|=4,a.u[6]=4,a.pa(4,24)):(a.fa|=8,a.I|=64));return e}k.Vb=function(a){if(!this.Ua)return this.w.Vb(a);this.L++;a=de(this,ce(this,a,3));this.L--;return a};
|
||||
k.bb=function(a){if(!this.Ua)return this.w.bb(a);this.L++;a=this.Ac(ce(this,a,2));this.L--;return a};k.rb=function(a,b){this.Ua?(this.L++,ee(this,ce(this,a,5),b),this.L--):this.w.rb(a,b)};k.Db=function(a,b){this.Ua?(this.L++,this.Hc(ce(this,a,4),b),this.L--):this.w.Db(a,b)};k.Qc=function(a,b,c){return fe(this,a,b,c)};k.Rc=function(a,b,c){return ce(this,fe(this,a,b,c),c)};k.Ac=function(a){return this.w.oa(a)};k.Vd=function(a){return this.w.oa(ce(this,a,2))};k.Hc=function(a,b){this.w.ib(a,b&65535)};
|
||||
k.Ne=function(a,b){this.w.ib(ce(this,a,4),b)};function ge(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=fe(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.v=a.N>>12&3,c=a.sa(d|c&a.P),a.v=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function he(a,b,c,d){a.C&57344||(a.fb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=fe(a,b,e,4),c&65536||(e&=65535),a.v=a.N>>12&3,e=ce(a,e|c&65536,4),a.v=a.N>>14&3,a.w.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d}
|
||||
function ie(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?de(a,a.ba(b,c,3)):a.u[c]&255}function je(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}function ke(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return fe(a,b,c,8)}function le(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?de(a,a.ba(b,c,3)):a.u[c]&255}function me(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}
|
||||
function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.tb=a.ba(b,e,7),ee(a,e,d.call(a,c,de(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.ib(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function ne(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?ee(a,a.ba(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 oe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ib(a.ba(b,d,4),c):a.u[d]=c&65535;return c}function T(a,b,c){c&&(N(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
k.kb=function(a){this.A.complete=!0;var b=this.i&&pe(this.i)?1:this.A.Zb?-1:0,c=a?this.A.Zb?0:1:-1;this.A.Zb=!1;this.ca=this.b=a;do{if(b){if(this.i&&qe(this.i,this.u[7],c)){this.ga();break}c||c++;b++}if(this.I){this.I&112&&(this.I&32?this.pa(168,28):this.I&64?this.pa(4,30):this.I&16&&this.pa(12,32),this.I&=-113);if(a=this.I&7){a=!1;if(this.I&2){this.I&=-3;var d=160,e=(this.kc&224)>>5,f=this.M&&this.M.Ab>e?this.M:null;f&&(d=f.$d,e=f.Ab);e>(this.N&224)>>5?(this.I&4&&(Ed(this,2),this.I&=-5),this.pa(d,
|
||||
26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.M,f==a)this.M=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.I&1&&this.I++;a=a&&0>c}if(a)break}this.I=this.I&7|this.N&16;this.decode(Dd(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};Wa(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new vd(d);C(d,c)}});function re(a,b){var c=b+a;Xd(this,c,a,b);return c&65535}
|
||||
function se(a,b){var c=b+a;Xd(this,c<<8,a<<8,b<<8);return c&255}function te(a,b){a=b<<1;Yd(this,a);return a&65535}function ue(a,b){a=b<<1;Yd(this,a<<8);return a&255}function ve(a,b){a=b&32768|b>>1|b<<16;Yd(this,a);return a&65535}function we(a,b){a=b&2048|b>>1|b<<8;Yd(this,a<<8);return a&255}function xe(a,b){a=b&~a;Q(this,a);return a}function ye(a,b){a=b&~a;Q(this,a<<8);return a}function ze(a,b){a|=b;Q(this,a);return a}function Ae(a,b){a|=b;Q(this,a<<8);return a}
|
||||
function Be(a,b){a=~b|65536;Fd(this,a);return a&65535}function Ce(a,b){a=~b|256;Fd(this,a<<8);return a&255}function De(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.U=b&(b^a));return a&65535}function Ee(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.aa=c,this.U=b&(b^c));return a&255}function Fe(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.U=a&(b^a));return a&65535}function Ge(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.aa=c,this.U=c&(b<<8^c));return a&255}
|
||||
function He(a,b){a=-b;Fd(this,a,a&b&32768);return a&65535}function Ie(a,b){a=-b;Fd(this,a<<8,(a&b&128)<<8);return a&255}function Je(a,b){a=b<<1|this.T>>16&1;Yd(this,a);return a&65535}function Ke(a,b){a=b<<1|this.T>>16&1;Yd(this,a<<8);return a&255}function Le(a,b){a=(this.T&65536|b)>>1|b<<16;Yd(this,a);return a&65535}function Me(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Yd(this,a<<8);return a&255}function Ne(a,b){var c=b-a;Zd(this,c,a,b);return c&65535}
|
||||
function Oe(a,b){var c=b-a;Zd(this,c<<8,a<<8,b<<8);return c&255}function Pe(a,b){this.I&128||(this.X=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Qe(a,b){a^=b;Q(this,a);return a&65535}function Re(a){S(this,a,je(this,a),re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function Se(a){var b=me(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b}
|
||||
function Te(a){var b=me(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Ue(a){T(this,a,!Ad(this))}function Ve(a){T(this,a,Ad(this))}
|
||||
function We(a){S(this,a,je(this,a),xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Xe(a){R(this,a,ie(this,a),ye);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ye(a){S(this,a,je(this,a),ze);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ze(a){R(this,a,ie(this,a),Ae);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function $e(a){Q(this,je(this,a)&me(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function af(a){Q(this,(ie(this,a)&le(this,a))<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function bf(a){T(this,a,Cd(this))}function cf(a){T(this,a,!this.Ta()==!Bd(this))}function df(a){T(this,a,!Cd(this)&&!this.Ta()==!Bd(this))}function ef(a){T(this,a,!Ad(this)&&!Cd(this))}function ff(a){T(this,a,Cd(this)||!this.Ta()!=!Bd(this))}
|
||||
function gf(a){T(this,a,Ad(this)||Cd(this))}function hf(a){T(this,a,!this.Ta()!=!Bd(this))}function jf(a){T(this,a,this.Ta())}function kf(a){T(this,a,!Cd(this))}function lf(a){T(this,a,!this.Ta())}function mf(){this.pa(12,1);this.b-=5}function nf(a){T(this,a,!0)}function of(a){T(this,a,!Bd(this))}function pf(a){T(this,a,Bd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5}
|
||||
function qf(a){var b=je(this,a);a=me(this,a);Zd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function rf(a){var b=ie(this,a)<<8;a=le(this,a)<<8;Zd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}
|
||||
function sf(a){var b=me(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=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.aa=d>>16|d,this.X=d>>16):(this.U=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.U=32768,this.T=65536,this.b-=7}function tf(){this.pa(24,2);this.b-=25}
|
||||
function uf(){this.N&49152?(this.fa|=128,this.pa(4,3)):this.i?vf(this.i):this.ga();this.b-=7}function wf(){this.pa(16,4);this.b-=25}var xf=[0,7,7,10,7,11,9,13];function yf(a){this.J=this.b;N(this,ke(this,a));this.b=this.J-xf[this.g]}var zf=[0,14,14,17,14,18,16,20];function Af(a){this.J=this.b;var b=ke(this,a);a=a>>6&7;$d(this,this.u[a]);this.u[a]=this.u[7];N(this,b);this.b=this.J-zf[this.g]}var Bf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function Cf(a){var b=je(this,a);this.J=this.b;Q(this,oe(this,a,b));this.b=this.J-Bf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Df(a){var b=ie(this,a);Q(this,ne(this,a,b,1)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Ef=[7,13,13,17,14,18,17,21];
|
||||
function Ff(a){var b=me(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.I&128||(this.X=b>>16,this.aa=this.X|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Gf(){this.b-=5}function Hf(){this.N&49152||(this.w.reset(),Zb(this));this.b-=667}function If(){ae(this);this.I|=this.N&16;this.b-=13}
|
||||
function Jf(a){if(a&8)V.call(this,a);else{var b=be(this);a&=7;7==a?N(this,b):(N(this,this.u[a]),this.u[a]=b);this.b-=9}}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.X=32768);this.b-=5}function Kf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)N(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Lf(a){S(this,a,je(this,a),Ne);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function Mf(a){S(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)}function Nf(){this.pa(28,5);this.b-=5}function Of(){this.I|=4;Ed(this,-2);this.b-=3}function Pf(a){S(this,a,je(this,a),Qe);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=vf(b);b||this.pa(8,6)}function wd(a){Qf[a>>12].call(this,a)}function Rf(a){Sf[a>>6&3].call(this,a)}function Tf(a){Uf[a>>6&3].call(this,a)}function Vf(a){Wf[a>>6&3].call(this,a)}
|
||||
function Xf(a){Yf[a&15].call(this,a)}function Zf(a){$f[a&15].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)}function eg(a){fg[a>>6&3].call(this,a)}
|
||||
var Qf=[function(a){gg[a>>8&15].call(this,a)},Cf,qf,$e,We,Ye,Re,V,function(a){hg[a>>8&15].call(this,a)},Df,rf,af,Xe,Ze,Lf,V],gg=[function(a){ig[a>>4&15].call(this,a)},nf,kf,bf,cf,hf,df,ff,Af,Af,Rf,Tf,Vf,V,V,V],Sf=[function(a){Fd(this,oe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,De);this.b-=this.g?9:3+(7==this.f?2:0)}],Uf=[function(a){S(this,a,0,
|
||||
He);this.b-=this.g?11:6},function(a){S(this,a,Ad(this)?1:0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Ad(this)?1:0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=me(this,a);Fd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Wf=[function(a){S(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,te);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
ig=[function(a){jg[a&15].call(this,a)},V,V,V,yf,yf,yf,yf,Jf,V,Xf,Zf,Mf,Mf,Mf,Mf],jg=[uf,Of,If,mf,wf,Hf,V,V,V,V,V,V,V,V,V,V],Yf=[Gf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.X=0;this.b-=5},U,U,U,U,U,U,U],$f=[Gf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.X=32768;this.b-=5},W,W,W,W,W,W,W],hg=[lf,jf,ef,gf,of,pf,Ue,Ve,tf,Nf,ag,cg,eg,V,V,V],bg=[function(a){Fd(this,
|
||||
ne(this,a,0));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,1,Ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ee);this.b-=this.g?9:3+(7==this.f?2:0)}],dg=[function(a){R(this,a,0,Ie);this.b-=this.g?11:6},function(a){R(this,a,Ad(this)?1:0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Ad(this)?1:0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=le(this,a);Fd(this,a<<8);this.b-=this.g?4:3+(7==
|
||||
this.f?2:0)}],fg=[function(a){R(this,a,0,Me);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,we);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,ue);this.b-=this.g?9:3+(7==this.f?2:0)}];function xd(a){kg[a>>12].call(this,a)}
|
||||
var kg=[function(a){lg[a>>8&15].call(this,a)},Cf,qf,$e,We,Ye,Re,function(a){mg[a>>8&15].call(this,a)},function(a){ng[a>>8&15].call(this,a)},Df,rf,af,Xe,Ze,Lf,V],lg=[function(a){og[a>>4&15].call(this,a)},nf,kf,bf,cf,hf,df,ff,Af,Af,Rf,Tf,Vf,function(a){pg[a>>6&3].call(this,a)},V,V],pg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.P);N(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ge(this,a,0);$d(this,a);Q(this,a);this.b-=11},function(a){var b=be(this);this.J=
|
||||
this.b;he(this,a,0,b);Q(this,b);this.b=this.J-Ef[this.g]},function(a){Q(this,oe(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],og=[function(a){qg[a&15].call(this,a)},V,V,V,yf,yf,yf,yf,Jf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.I|=1),this.b-=5):V.call(this,a)},Xf,Zf,Mf,Mf,Mf,Mf],qg=[uf,Of,If,mf,wf,Hf,function(){ae(this);this.b-=13},V,V,V,V,V,V,V,V,V],mg=[Ff,Ff,sf,sf,Se,Se,Te,Te,Pf,Pf,V,V,V,V,Kf,Kf],ng=[lf,jf,ef,gf,of,pf,Ue,Ve,tf,Nf,ag,cg,eg,function(a){rg[a>>
|
||||
6&3].call(this,a)},V,V],rg=[V,function(a){a=ge(this,a,65536);$d(this,a);Q(this,a);this.b-=11},function(a){var b=be(this);this.J=this.b;he(this,a,65536,b);Q(this,b);this.b=this.J-Ef[this.g]},V];
|
||||
function sg(a){t.call(this,"ROM",a,sg);this.ha=this.g=null;this.C=a.addr;this.f=a.size;this.D=!1;this.v=a.alias;this.B=a.file;this.H=ra(this.B);if(this.B){a=this.B;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.B=null):(mb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ha=a.ha):c.B=null);tg(c)})}}z(sg);k=sg.prototype;
|
||||
k.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;tg(this)};k.Ha=function(){this.ha&&(this.i&&ug(this.i,this.id,this.C,this.f,this.ha),delete this.ha);return!0};k.Ga=function(){return!0};
|
||||
function tg(a){if(!sb(a)){if(a.B){if(!a.g||!a.w)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)ub(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.C;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+kc){var c={};b=(c[b]=[sg.prototype.Jd,sg.prototype.Be,null,null,null,a.f>>1],c);if(Cb(a.w,a,b,256,a.Ya)){b=a.D=!0;break a}}else if(uc(a.w,b,a.f,Zc)){for(c=0;c<a.g.length;c++)a.w.rb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.v?
|
||||
b.push(a.v):null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){var d=a,e=b[c],f=tc(d.w,d.C,d.f);sc(d.w,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Jd=function(a){return this.g[a-this.C]};k.Be=function(){};Wa(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new sg(d);C(d,c)}});
|
||||
function vg(a){t.call(this,"RAM",a,vg);this.ha=this.g=null;this.B=a.addr;this.C=a.size;this.La=a.load;this.Ka=a.exec;this.v=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(mb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.da,c.ha=a.ha,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.f=null);Pg(c)})}}
|
||||
z(vg);vg.prototype.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;Pg(this)};vg.prototype.Ha=function(){this.ha&&(this.i&&ug(this.i,this.id,this.B,this.C,this.ha),delete this.ha);return!0};vg.prototype.Ga=function(){return!0};function Pg(a){if(a.w&&(!a.v&&a.C&&uc(a.w,a.B,a.C,xc)&&(a.v=!0),!sb(a))){if(!a.v)q("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;Qg(a,a.g,a.La,a.Ka,a.B)}H(a)}}
|
||||
vg.prototype.reset=function(){if(this.v){for(var a=this.w,b=this.B,c=this.C,d=b&a.w,b=b>>>a.ka;0<c&&b<a.W.length;){var e=a.W[b];if(e.controller&&a.g&&a.g.length==a.v.length){var f=a.g.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(vb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.ac(d,g,e.F+d)}c-=a.ya;b++;d=0}this.g&&Qg(this,this.g,this.La,this.Ka,this.B,!0)}};
|
||||
function Qg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(;r--;)a.b.rb(n++,b[v++]&255);else n&1?a.b.ga():zd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.b.rb(c+
|
||||
e,b[e]);null!=d&&zd(a.b,d,f);g=!0}return g}Wa(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new vg(d);C(d,c)}});function Rg(a){t.call(this,"Keyboard",a,Rg,65536);H(this)}z(Rg);Rg.prototype.ta=function(){return!1};Rg.prototype.Ea=function(a,b,c,d){this.B=a;this.b=c;this.i=d};Wa(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Rg(d);C(d,c)}});
|
||||
function X(a){this.M=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.ca=a.upperCase;this.v=this.D=null;this.S=a.tabSize;this.P=a.charBOL;this.H=0;t.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Sg;b&&(void 0===c&&(c="Panel"),(c=pb(c,this.id))&&(b=c.G[b])&&this.ta(null,a,b))}this.J=this.L=null;this.exports={connect:this.xc,receiveData:this.jc}}z(X);var Sg="buffer";k=X.prototype;
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case Sg:return this.G[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.jc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.jc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;var e=this;this.ja=Oc(48,4);this.Y=Lc(this.b,function(){e.f&128||!e.C.length||(e.K=e.C.shift()&255,e.ca&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Mc(e.b,e.ja))});this.ma=Oc(52,4);this.$=Lc(this.b,function(){e.g|=128;e.g&64&&Mc(e.b,e.ma)});Cb(b,this,Tg);H(this)};
|
||||
k.xc=function(){if(!this.J){var a=ld(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Ya)return;b=xa(b[1]);if(this.J=ob(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ha=function(a,b){if(!b)if(this.xc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
k.Ga=function(a){return a?this.save():!0};k.reset=function(){Ug(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return Ug(this)};function Ug(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.jc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.C.push(a.charCodeAt(b));else this.C=this.C.concat(a);Nc(this.b,this.Y,1E3/Math.round(this.M/10));return!0};k.Dd=function(){return this.f&65534};
|
||||
k.ve=function(a){this.f=this.f&-112|a&111};k.Cd=function(){this.f&=-129;0<this.C.length&&Nc(this.b,this.Y,1E3/Math.round(this.M/10));return this.K};k.ue=function(){};k.Xd=function(){return this.g};k.Pe=function(a){128==(this.g&192)&&a&64&&Nc(this.b,this.$,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Wd=function(){return 0};
|
||||
k.Oe=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.J,a);if(this.v)if(13==a)this.H=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=wa("",c)));this.P&&!this.H&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D),
|
||||
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Nc(this.b,this.$,1E3/Math.round(this.R/10))}};var Vg={},Tg=(Vg[65392]=[null,null,X.prototype.Dd,X.prototype.ve,"RCSR"],Vg[65394]=[null,null,X.prototype.Cd,X.prototype.ue,"RBUF"],Vg[65396]=[null,null,X.prototype.Xd,X.prototype.Pe,"XCSR"],Vg[65398]=[null,null,X.prototype.Wd,X.prototype.Oe,"XBUF"],Vg);Wa(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new X(d);C(d,c)}});
|
||||
function Tc(a){t.call(this,"PC11",a,Tc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.K=this.L=this.f=0;this.J=[];this.H=Wg;this.v=Xg;this.M=this.C="";this.da=this.La=this.Ka=null;this.R=-1;this.P=!Oa("Mobi")&&window&&"FileReader"in window}z(Tc);var Wg="",Xg=0;k=Tc.prototype;
|
||||
k.ta=function(a,b,c){var d=this,e=Xg;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
|
||||
function(){var a=d.G.listTapes;a&&Yg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[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;Yg(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Zg(a);var e=this;if((this.g=ld(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=Oc(56,4);this.ca=Lc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.J.length&&(e.L=e.J[e.K++]&255,$g(e,e.K/e.J.length*100),e.f|=128,e.f&=-2049,e.f&64&&Mc(e.b,e.Y))});Cb(b,this,ah);bh(this,"None",Wg,!0);this.P&&bh(this,"Local Tape",
|
||||
"?");bh(this,"Remote Tape","??");ch(this)||H(this)};k.Ha=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function ch(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?dh(a,c,b,1,!0):eh(a)}return!!a.D}
|
||||
function Yg(a,b,c,d,e){if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;dh(a,b,c,d,!1,e)}else fh(a,!1)}
|
||||
function dh(a,b,c,d,e,f){var g=-1;if(a.C.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,fh(a,!0),a.A.ab?a.O("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),gh(a,b,c,d,f)?g++:a.A.ab=!0);g&&hh(a,a.M,a.C,a.v,a.da,a.La,a.Ka)}
|
||||
function gh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),hh(a,b,c,d,e),a.H="?");eh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.Qa,e,f),(e=Ea(e,f))&&hh(a,b,c,d,e.da,e.La,
|
||||
e.Ka));a.A.ab=!1;a.D&&(a.D--,a.D||H(a));eh(a)})}function bh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function eh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.C;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function $g(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
|
||||
function hh(a,b,c,d,e,f,g){a.M=b;a.C=c;a.v=d;a.da=e;a.La=f;a.Ka=g;2==d?a.S&&Qg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.C="",a.H=Wg,a.v=Xg,a.O("No load address available for tape: "+b)):(a.K=0,a.J=e,a.status("tape attached: "+b),$g(a,0))}function fh(a,b){if(a.C||!1===b)a.M="",a.C="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.H=Wg,a.v=Xg,eh(a))}k.save=function(){return(new O(this)).data()};k.restore=function(){return!0};k.wd=function(){return this.f&65534};
|
||||
k.oe=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Mc(this.b,this.Y)):(this.f&=-129,this.f|=2048,this.L=0,Nc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.vd=function(){this.f&=-129;this.f|=2048;return this.L};k.ne=function(){};var ih={},ah=(ih[65384]=[null,null,Tc.prototype.wd,Tc.prototype.oe,"PRS"],ih[65386]=[null,null,Tc.prototype.vd,Tc.prototype.ne,"PRB"],ih);
|
||||
function jh(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++kh,4)},jh,2097152);this.controller=a;this.B=a.B;this.i=a.i;this.v=b;this.Xa=b.name;this.fc=b.fc;lh(this,c,b.va,b.za,b.ra,b.Ma);H(this)}var kh=0;z(jh);k=jh.prototype;k.Ea=function(a,b,c,d){this.i=d};
|
||||
function lh(a,b,c,d,e,f){a.mode=b;a.va=c;a.za=d;a.ra=e;a.Ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.va);for(c=0;c<b.length;c++){d=Array(a.za);for(e=0;e<d.length;e++){f=Array(a.ra);for(var g=1;g<=f.length;g++)f[g-1]=mh(null,c,e,g,a.Ma,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
||||
function nh(a,b,c,d,e){var f=c;if(a.w)return!0;a.Xa=b;a.hb=c;a.Ec=ra(c);a.w=e;a.C=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.va=e[0];a.za=e[1];a.ra=e[2];a.Ma=e[3]||512;c=a.Ma>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.za),w=0;w<r.length;w++)for(var y=r[w]=Array(a.ra),x=0;x<y.length;x++){for(var A=mh(null,d,w,x+1,a.Ma,0),ia=A.data,Ja=0;Ja<c;Ja++,f+=4)var P=ia[Ja]=b.getInt32(f,
|
||||
!0),e=e+P&-1;A.Ba=c;y[x]=A}a.f=e;c=a}else a.O("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Xa,a.hb),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Da(f,
|
||||
null,!0,function(b,c,d){oh(a,b,c,d)})}
|
||||
function oh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Xa+'" (error '+d+": "+b+")",f);else{mb(a.controller.Qa,b,c);try{if(0<ra(a.Ec,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Xa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.va=h.length;a.za=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d<a.va;d++)for(f=0;f<a.za;f++)for(g=0;g<a.ra;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;ph(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}mh(l,d,f);for(w=
|
||||
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Xa)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.w&&(a.w.call(a.C,a.v,e,a.Xa,a.hb),a.w=null)}function mh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Se=b;a.Te=c;a.Pa=a.Ba=0;a.Sa=!1;return a}
|
||||
k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.Kc&&b<f.za)for(h=g[b]=Array(f.Lc),g=0;g<h.length;g++)h[g]=mh(null,a,b,g+1,f.yc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Kc&&9==f.oc&&(d=h[g]=mh(null,a,b,f.oc,f.yc,0))}}e&&e(d,!1);return d};function ph(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f<a.Pa?(a.Ba+=a.Pa-f,a.Pa=f):f>=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function oh(a,b){var c=a.za*a.ra,d=b/c|0;return d<a.va?(b%=c,a.seek(d,b/a.ra|0,b%a.ra+1)):null}function ph(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
|
||||
function qh(a,b){var c=a.za*a.ra,d=b/c|0;return d<a.va?(b%=c,a.seek(d,b/a.ra|0,b%a.ra+1)):null}function rh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
|
||||
k.save=function(){var a=0,b=[];b[a++]=[this.hb,this.f,this.va,this.za,this.ra,this.Ma];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ba){for(var h=[],l=0,m=g.Pa,n=g.Pa+g.Ba;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Pa,h]}}return b};
|
||||
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?jh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
|
||||
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?lh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.Pa=e;for(h.Ba=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Xa+": "+c);return b};
|
||||
k.toJSON=function(){var a;a=0;for(var b;b=oh(this,a++);)qh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
||||
function qh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){t.call(this,"RL11",a,N,2097152);this.v=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype;
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&rh(d,a)},!0;case "loadDrive":return this.G[b]=
|
||||
c,c.onclick=function(){var a=d.G.listDisks;a&&sh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[qa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=oh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(ph(a,h,l));b=btoa(b);a=a.Ec.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
|
||||
k.toJSON=function(){var a;a=0;for(var b;b=qh(this,a++);)sh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
||||
function sh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,2097152);this.v=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Oa("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype;
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=pa(c.value,10);null!=a&&th(d,a)},!0;case "loadDrive":return this.G[b]=
|
||||
c,c.onclick=function(){var a=d.G.listDisks;a&&uh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[pa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=qh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(rh(a,h,l));b=btoa(b);a=a.Ec.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
|
||||
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.O("No disk loaded in drive.");else d.O("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[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;sh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;if((this.v=jd(this.B,"autoMount")||this.v)&&"string"==typeof this.v)try{this.v=eval("("+this.v+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.v+")"),this.v=null}th(this);this.P=Nc(112,5);Cb(b,this,uh,2097152);vh(this,"None","",!0);this.L&&vh(this,"Local Disk","?");vh(this,"Remote Disk","??");wh(this)||H(this)};
|
||||
k.Ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.sc){for(a=0;a<this.f.length;a++)xh(this,a,!0);wh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";rh(this,0)}}return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){th(this)};k.save=function(){return(new P(this)).data()};
|
||||
k.restore=function(a){return th(this,a[0])};function wh(a,b){b||(a.H=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!yh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.O("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
|
||||
function sh(a,b,c,d){var e=a.G.listDrives,e=e&&qa(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}yh(a,e,b,c,!1,d)}else xh(a,e)}
|
||||
function yh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,xh(a,b,!0),h.ec?a.O("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,lh(new hh(a,h,"preload"),c,d,f,a.Nc)&&g++));return g}
|
||||
k.Nc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.za)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ca=b,a.Xa=c,a.hb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.B&&this.B.sb()):a.Qb=!1;a.dc&&(a.dc=!1,--this.H||H(this));rh(this,a.gc)};
|
||||
function vh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function rh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=qa(a.value,10),c=c.Qb?"?":c.hb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function xh(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Xa="",d.hb="",d.Ca=null,d.Qb=!1,c||(a.O("Drive RL"+b+" unloaded",c),rh(a,b))}
|
||||
function th(a,b){var c=0;b||(b=[]);a.ea=b[c++]||0;a.J=b[c++]||0;a.g=b[c++]||0;a.C=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.gc=b;d.ec=d.Qb=!1;d.name=c.Ya;d.va=512;d.za=2;d.ra=40;d.Ma=256;d.fc=!0;d.Re=0;d.Qe=0;d.oc=1;d.Lc=d.ra;d.yc=d.Ma;d.Ue=0;d.We=null;d.Ca||(d.hb="");d.status=29|(512==d.va?128:0)}return!0}
|
||||
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;uh(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;if((this.v=ld(this.B,"autoMount")||this.v)&&"string"==typeof this.v)try{this.v=eval("("+this.v+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.v+")"),this.v=null}vh(this);this.P=Oc(112,5);Cb(b,this,wh,2097152);xh(this,"None","",!0);this.L&&xh(this,"Local Disk","?");xh(this,"Remote Disk","??");yh(this)||H(this)};
|
||||
k.Ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.sc){for(a=0;a<this.f.length;a++)zh(this,a,!0);yh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";th(this,0)}}return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){vh(this)};k.save=function(){return(new O(this)).data()};
|
||||
k.restore=function(a){return vh(this,a[0])};function yh(a,b){b||(a.H=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Ah(a,g,f,e,!0)&&b&&H(a,!1);continue}a.O("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
|
||||
function uh(a,b,c,d){var e=a.G.listDrives,e=e&&pa(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ah(a,e,b,c,!1,d)}else zh(a,e)}
|
||||
function Ah(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,zh(a,b,!0),h.ec?a.O("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,nh(new jh(a,h,"preload"),c,d,f,a.Nc)&&g++));return g}
|
||||
k.Nc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.za)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ca=b,a.Xa=c,a.hb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.B&&this.B.sb()):a.Qb=!1;a.dc&&(a.dc=!1,--this.H||H(this));th(this,a.gc)};
|
||||
function xh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function th(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=pa(a.value,10),c=c.Qb?"?":c.hb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function zh(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Xa="",d.hb="",d.Ca=null,d.Qb=!1,c||(a.O("Drive RL"+b+" unloaded",c),th(a,b))}
|
||||
function vh(a,b){var c=0;b||(b=[]);a.ea=b[c++]||0;a.J=b[c++]||0;a.g=b[c++]||0;a.C=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.gc=b;d.ec=d.Qb=!1;d.name=c.Ya;d.va=512;d.za=2;d.ra=40;d.Ma=256;d.fc=!0;d.Re=0;d.Qe=0;d.oc=1;d.Lc=d.ra;d.yc=d.Ma;d.Ue=0;d.We=null;d.Ca||(d.hb="");d.status=29|(512==d.va?128:0)}return!0}
|
||||
k.Oc=function(a,b,c,d,e,f){this.J=f&65535;this.ea=this.ea&-49|f>>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0};
|
||||
k.jd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.w.ib(f,v|r<<8);if(Bc(this.w)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};
|
||||
k.de=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var v=this.w.oa(f);if(Bc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Gd=function(){return this.ea&65535};
|
||||
k.jd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.w.ib(f,v|r<<8);if(Kc(this.w)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};
|
||||
k.de=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var v=this.w.oa(f);if(Kc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Gd=function(){return this.ea&65535};
|
||||
k.ye=function(a){this.ea=this.ea&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.D=c.status|this.C&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.C=this.g&4?this.C+b:this.C-b,this.g=this.C=this.C&65408|c);break;case 8:this.D=this.C;break;case 12:b=this.jd;case 10:b||(b=this.de),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.va||f>=c.ra?this.ea|=37888:
|
||||
(g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Oc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Lc(this.b,this.P))}};k.Ed=function(){return this.J};k.we=function(a){this.J=a&65534};k.Hd=function(){return this.g};k.ze=function(a){this.g=a};k.Id=function(){return this.D};k.Ae=function(a){this.D=a};k.Fd=function(){return this.K};k.xe=function(a){this.K=a&63};
|
||||
var zh={},uh=(zh[63744]=[null,null,N.prototype.Gd,N.prototype.ye,"RLCS"],zh[63746]=[null,null,N.prototype.Ed,N.prototype.we,"RLBA"],zh[65284]=[null,null,N.prototype.Hd,N.prototype.ze,"RLDA"],zh[65286]=[null,null,N.prototype.Id,N.prototype.Ae,"RLMP"],zh[65288]=[null,null,N.prototype.Fd,N.prototype.xe,"RLBE"],zh);function Ah(a){t.call(this,"Debugger",a,Ah);this.ca=a.base||16;this.Ja=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(Ah);
|
||||
var Bh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Ah.prototype.uc=function(){return-1};Ah.prototype.vc=function(){};
|
||||
function Ch(a,b,c,d){if(c)if(b){0>a.C&&a.v.length&&(a.C=0);if(0>a.C||b!=a.v[a.C])a.v.splice(0,0,b),a.C=0;a.C--}else a.R?b="end":b=a.v[a.C+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(ya(b.substring(c,f))),c=f+1}}return a}
|
||||
function Dh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
||||
(g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Oc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Mc(this.b,this.P))}};k.Ed=function(){return this.J};k.we=function(a){this.J=a&65534};k.Hd=function(){return this.g};k.ze=function(a){this.g=a};k.Id=function(){return this.D};k.Ae=function(a){this.D=a};k.Fd=function(){return this.K};k.xe=function(a){this.K=a&63};
|
||||
var Bh={},wh=(Bh[63744]=[null,null,M.prototype.Gd,M.prototype.ye,"RLCS"],Bh[63746]=[null,null,M.prototype.Ed,M.prototype.we,"RLBA"],Bh[63748]=[null,null,M.prototype.Hd,M.prototype.ze,"RLDA"],Bh[63750]=[null,null,M.prototype.Id,M.prototype.Ae,"RLMP"],Bh[63752]=[null,null,M.prototype.Fd,M.prototype.xe,"RLBE"],Bh);function Ch(a){t.call(this,"Debugger",a,Ch);this.ca=a.base||16;this.Ja=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(Ch);
|
||||
var Dh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Ch.prototype.uc=function(){return-1};Ch.prototype.vc=function(){};
|
||||
function Eh(a,b,c,d){if(c)if(b){0>a.C&&a.v.length&&(a.C=0);if(0>a.C||b!=a.v[a.C])a.v.splice(0,0,b),a.C=0;a.C--}else a.R?b="end":b=a.v[a.C+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(xa(b.substring(c,f))),c=f+1}}return a}
|
||||
function Fh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
||||
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
||||
function Eh(a,b,c){var d;if(b){b=Fh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=ya(n);if(!n){f=!0;break}n=Gh(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],r=n.length;l.length&&Bh[n]<Bh[l[l.length-1]]&&Dh(h,l,1);l.push(n);b=b.substr(v+r)}Dh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Hh(a,null,
|
||||
d))}return d}function Fh(a,b){for(var c,d=a.Ja?"(":"{",e=a.Ja?")":"}",f=new RegExp(a.Ja?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Eh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
||||
function Gh(a,b,c,d){var e;null!=b?(e=a.uc(b),0<=e?e=a.vc(e):(e=a.Y[b],null==e&&(e=qa(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
|
||||
function Hh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Ih(a,b){if(b)return Hh(a,b,a.Y[b]);var c=0;for(b in a.Y)Hh(a,b,a.Y[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.ca){case 8:a=ra(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
|
||||
function Jh(a){Ah.call(this,a);this.lb=!1;this.Ja=!0;this.L=Z(0);this.mb=Z(0);this.P=Z(0);this.J=[];this.g=this.M=this.D=[];Kh(this);this.ua=0;Lh(this);this.Na={};Mh(this,a.messages);this.Za=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return nd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return nd(b,a)})}z(Jh,Ah);
|
||||
var Nh={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Oh=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
|
||||
Ph={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
|
||||
function Gh(a,b,c){var d;if(b){b=Hh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Ih(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],r=n.length;l.length&&Dh[n]<Dh[l[l.length-1]]&&Fh(h,l,1);l.push(n);b=b.substr(v+r)}Fh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Jh(a,null,
|
||||
d))}return d}function Hh(a,b){for(var c,d=a.Ja?"(":"{",e=a.Ja?")":"}",f=new RegExp(a.Ja?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Gh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
||||
function Ih(a,b,c,d){var e;null!=b?(e=a.uc(b),0<=e?e=a.vc(e):(e=a.Y[b],null==e&&(e=pa(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
|
||||
function Jh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Kh(a,b){if(b)return Jh(a,b,a.Y[b]);var c=0;for(b in a.Y)Jh(a,b,a.Y[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.ca){case 8:a=qa(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
|
||||
function Lh(a){Ch.call(this,a);this.lb=!1;this.Ja=!0;this.L=Y(0);this.mb=Y(0);this.P=Y(0);this.J=[];this.g=this.M=this.D=[];Mh(this);this.ua=0;Nh(this);this.Na={};Oh(this,a.messages);this.Za=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return pd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return pd(b,a)})}z(Lh,Ch);
|
||||
var Ph={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Qh=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
|
||||
Rh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
|
||||
33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,
|
||||
63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Qh=[0],Rh=
|
||||
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Jh.prototype;
|
||||
k.Ea=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.f=a.f;(a=jd(a,"messages"))&&Mh(this,a);this.wb=Ph;this.Pb=1145>this.b.pb?Rh:[];Sh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Th(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=xc[c],n&&d.j(p(n.id,8)+" %"+
|
||||
p(e<<d.w.ka,8)+" %%"+p(n.F,8)+" "+p(n.Mb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=Wc&&(c=-1),m=0);a+=d.w.ya;e++}}});H(this)};
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",nd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.v.length-1&&(b=d.v[++d.C])):40==a.keyCode&&(0<d.C?b=d.v[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ra(c,function(){if(d.ma){var a=d.ma.value;
|
||||
d.ma.value="";nd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ra(c,function(a){var b=!1;sb(d,!0)||(rb(d,!0),b=d.kb(a?1:0),rb(d,!1));return b}),!0}return!1};k.sb=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Gb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Rb?this.w.Vb(d):this.b.Vb(d),b&&Uh(a,b));return c};
|
||||
k.oa=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Rb?this.w.bb(d):this.b.bb(d),b&&Uh(a,b));return c};k.Yb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Rb?this.w.rb(d,b):this.b.rb(d,b),c&&Uh(a,c),this.B.qa(-1))};k.ib=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Rb?this.w.Db(d,b):this.b.Db(d,b),c&&Uh(a,c),this.B.qa(-1))};function Z(a,b){return{F:a,Rb:b,Oa:!1}}function Vh(a){return[a.F,a.Oa]}function Wh(a){return{F:a[0],Oa:a[1]}}
|
||||
function Th(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=Fh(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;e<a.J.length;e++){var g=a.J[e].ha[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Eh(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Xh(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Ic=Ch(a,b.Dc=c[2]))}function Uh(a,b){null!=a.F&&(a.F+=b||1)}
|
||||
function Mh(a,b){a.i=a;a.na=a.Mc=536870912;a.ja=null;a.wa=[];b=Ch(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in xb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.na|=xb[c],a.j(c+" messages enabled"))}}function Sh(a,b){for(var c in xb)if(64==xb[c]){a.Na[c]=b;break}}
|
||||
k.uc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SW":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Yh(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.vc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Pc(this.b):21==a&&this.f&&gc(this.f)&&(b=this.f.Va));return b};
|
||||
k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Kb).F));this.na&1073741824?this.wa.push(a):this.ja&&a==this.ja||(this.ja=a,this.na&-2147483648&&this.b&&this.b.A.Z&&(this.ga(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,rd(a),a.ua=0,a.qa()))};function Lh(a){var b;if(!ne(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Z();a.$=0;a.j("instruction history buffer allocated")}}
|
||||
k.jb=function(a,b){if(!Zh(this,b))return!1;this.b.jb(a);return!0};k.kb=function(a,b,c){if(!Zh(this))return!1;this.K=0;a||ne(this)&&oe(this,this.b.u[7],0);try{a=sd(this.b,a);var d=this.b.kb(a);0<d&&(Zb(this.b,d),this.K+=d,$b(this.b,d,!0),ac(this.b,d),this.Aa++)}catch(e){"number"!=typeof e&&(this.K=0,vb(this.b,e.stack||e.message))}!1!==c&&this.B.qa(-1);md(this,b||!1);return 0<this.K};k.ga=function(a){this.b&&this.b.ga(a)};
|
||||
function md(a,b){if(a.lb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.I&8?c.Wc|c.Uc<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+(d?" ("+J(a,d)+")":""))}a.L=Z(a.b.u[7]);b&&1!=a.S?$h(a):ai(a)}}function Zh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ha=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
k.Ga=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Lh(this);this.Aa=0;this.ja=null;this.K=0;this.L=Z(this.b.u[7]);this.A.Z=!1;bi(this);a||md(this)};k.save=function(){var a=new P(this);a.set(0,Vh(this.L));a.set(1,Vh(this.P));a.set(2,[this.v,this.R,this.na]);a.set(3,this.J);return a.data()};
|
||||
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Wh(a[b++]),this.P=Wh(a[b++]),this.v=a[b][0],"string"==typeof this.v&&(this.v=[this.v]),this.R=a[b][1],this.na|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.Z=!0;this.Sb=a;this.Ub=b};
|
||||
k.stop=function(a,b){if(this.A.Z){this.A.Z=!1;this.K=b-this.Ub;if(!this.S){b="stopped";if(this.K){a-=this.Sb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";ne(this)&&(b+=this.Aa+" instructions, ",this.Aa=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}md(this,!0);this.sb();bi(this,this.b.u[7]);this.ja=null}};function ne(a){return 1<a.g.length||!!a.ua}
|
||||
function oe(a,b,c){var d=-1;c||(d=a.b.bb(b),0==d&&(b=Cd(a.b,2)));if(0<c&&(a.ua&&!--a.ua||ed(a,b,1,a.g)))return!0;0<=c&&a.H.length&&(a.Aa++,0>d&&(d=a.b.bb(b)),65535!=(d&65535)&&(c=a.H[a.$],c.F=b,c.Oa=!1,++a.$==a.H.length&&(a.$=0)));return!1}function tf(a){var b=a.b;if(b.A.Z)throw O(b,a.b.Kb),a.ga(),-1;return!1}
|
||||
function Kh(a){var b,c;a.g=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.w;c=a.ba(c);fd(d.W[c>>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.ba(c),fd(d.W[c>>>d.ka],!0);a.D=["bw"];a.tb=0}k.nb=function(a,b,c){var d=!0;c||ci(this,a,b,!1,!0);if(a!=this.g){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.W[e>>>f.ka].nb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(di(this,a,a.length-1,"set"),Lh(this)));return d};
|
||||
function ci(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Oa)){f=!0;h.Oa||e||di(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(d=a.w,fd(d.W[c>>>d.ka],b==a.D));h.Oa||Lh(a);break}}return f}function ei(a,b){for(var c=1;c<b.length;c++)di(a,b,c);return b.length-1}function di(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Dc?' "'+c.Dc+'"':""))}
|
||||
function bi(a,b){if(void 0!==b)ed(a,b,1,a.g,!0),a.S=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Oa){if(!ci(a,a.g,c,!0))break;b=0}}}
|
||||
function ed(a,b,c,d,e){var f=!1;if(!a.tb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Oa)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Oa&&(ci(a,d,h,!0),e=!0);if(n=h.Ic){for(var f=!1,v=0;v<n.length;v++)if(!fi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.A.Z||(f=!0)}if(f){e||di(a,d,g,"hit");break}}}a.tb--;return f}
|
||||
function gi(a,b,c,d){var e=Z(b.F),f=a.oa(b,2),g,h;for(h in a.wb)if(g=a.wb[h][f&h])break;g||(g=Qh);var l=g[0];0<=a.Pb.indexOf(l)&&(g=Qh,l=g[0]);var m=h="",n=Oh[l],v=g.length-1;l||v||(h=J(a,f));for(l=1;l<=v;l++){var r=g[l];if(void 0!==r){var w;w=a;var y=r,r=b,x="",A=y&61440;if(4096==A)r=r.F+((f&255)<<24>>23)&65535,x=J(w,r);else if(8192==A)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6),
|
||||
y&63)switch(y=A&7,A&56){case 0:x=Yh(y);break;case 8:x="@"+Yh(y);break;case 16:7>y?x="("+Yh(y)+")+":(A=w.oa(r,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Yh(y)+")+":(A=w.oa(r,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Yh(y)+")";break;case 40:x="@-("+Yh(y)+")";break;case 48:A=w.oa(r,2);x=J(w,A,0,!0)+"("+Yh(y)+")";7==y&&(x=J(w,A+r.F&65535));break;case 56:A=w.oa(r,2),x="@"+J(w,A)+"("+Yh(y)+")",7==y&&(x="@"+J(w,A+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
|
||||
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.oa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.A.xb?g+("cycles="+od(a.b).toString()+" cs="+p(a.b.Hb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function hi(a,b){switch(b){case "N":a=a.b.Ta();break;case "Z":a=Ad(a.b);break;case "V":a=zd(a.b);break;case "C":a=yd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function ii(a,b){var c="",d=a.b;8>b?(c=Yh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Pc(d)):21==b&&a.f&&gc(a.f)&&(c="SW="+J(a,a.f.Va,3));c&&(c+=" ");return c}function ji(a){var b,c="";for(b=0;6>b;b++)c+=ii(a,b);c=c+"\n"+(ii(a,6)+ii(a,7));c+=ii(a,20)+ii(a,21);return c+=hi(a,"T")+hi(a,"N")+hi(a,"Z")+hi(a,"V")+hi(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function sg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=Aa(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Ve:b,F:c,Vc:d,ha:e,nc:f})}function ki(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.J.length;b++){var f=a.J[b],g=f.F>>>0,h=f.Vc;if(e>=g&&e<g+h){e=Aa(f.nc,[e-g],a.pc);0<=e?li(a,b,e,d):c&&(e=~e,li(a,b,e-1,d),li(a,b,e,d));break}}return d}
|
||||
function li(a,b,c,d){var e={},f=a.J[b].nc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.J[b].ha[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function mi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Ih(a)||a.j("no variables"),!0;if(!c[2])return Ih(a,c[1]);if(!c[3])return delete a.Y[c[1]],!0;b=Eh(a,c[3]);return void 0!==b?(a.Y[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
||||
function ni(a,b,c){var d=null;if(b=Th(a,b,!0)){a.ba(b);var e=ki(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
||||
function $h(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Eh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.L=Z(d.u[7]);break;case "N":d.X=f?32768:0;break;case "Z":d.aa=
|
||||
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SW":if(a.f&&gc(a.f)){ec(a.f,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.qa();a.j("updated registers:")}a.j(ji(a));c&&(a.L=Z(d.u[7]),ai(a,J(a,a.L.F)))}}function oi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Hh(a,null,c[2].charCodeAt(0)):Eh(a,b,!0)}
|
||||
function pi(a,b,c){var d="t"!=b;c=Gh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Qa(c,function(){return rb(a,!0)&&a.kb(e,d,!1)},function(){a.f&&a.f.stop&&a.f.stop();a.B.qa();rb(a,!1)})}
|
||||
function ai(a,b,c,d){if(b=Th(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Gh(a,c.substr(1)),null!=c&&(d=c);else{d=Th(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=sb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=ki(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=gi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
|
||||
function fi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(tb(a)&&0<b.length){a.R&&(b="a "+J(a,a.P.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var v=
|
||||
Th(a,g[1],!0);if(v)if(a.P=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.B.qa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Yb(v,r[w],1);a.j(gi(a,a.P))}}break;case "b":a:{var y=g[0],x=g[1],A=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
|
||||
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ka;Ka=0+ei(a,a.g);Ka+=ei(a,a.M);(Ka+=ei(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ua=Gh(a,x),a.j("break after "+a.ua+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var Q=Z();if("*"!=x&&(Q=Th(a,x,!0),!Q))break a;"c"==ja?null==Q.F?(Kh(a),a.j("all breakpoints cleared")):ci(a,a.g,Q)||ci(a,a.M,Q)||ci(a,a.D,Q)||a.j("breakpoint missing: "+J(a,Q.F)):null!=Q.F&&(Xh(a,Q,A),"p"==ja?a.nb(a.g,
|
||||
Q):"r"==ja?a.nb(a.M,Q):"w"==ja?a.nb(a.D,Q):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Ra&&(a.Ra.value="");break;case "d":a:{var gb,hb=g[0],ma=g[1],Ma=g[2],Ii=g[3];if("?"==ma){var ib="";for(gb in xb)a.Na[gb]&&(ib&&(ib+=","),ib+=gb);ib+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
|
||||
ib.length&&a.j("dump extension commands:\n\t"+ib)}else if("state"==ma){var vg=qi(a.B,!0);"console"==Ma?console.log(vg):(a.Ra&&(a.Ra.value=""),a.j(vg))}else if("symbols"==ma)for(var Hd=0;Hd<a.J.length;Hd++){var Id=a.J[Hd],jb;for(jb in Id.ha)if("."!=jb.charAt(0)){var wg=Id.ha[jb].o;if(void 0!==wg){var xg=Id.ha[jb].l;xg&&(jb=xg);a.j(J(a,wg)+" "+jb)}}}else{if("d"==hb){for(gb in xb)if(g[1]==gb){var yg=a.Na[gb];yg?(g.shift(),g.shift(),yg(g)):a.j("no dump registered for "+ma);break a}ma||(hb=a.Wb||"dw")}else a.Wb=
|
||||
hb;if("dh"==hb){var zg=ma,Ag=Ma,Bg="",Cg=0,ga=a.$,na=a.H;if(na.length){var aa=+zg||a.vb,Kb=+Ag||10;isNaN(aa)?aa=Kb:Bg="more ";aa>na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);ga-=aa;0>ga&&(null==na[na.length-1].F?(aa=ga+aa,ga=0):ga+=na.length);var Jd=[];"call"==Ag&&(Kb=1E5,Jd=["CALL"]);for(void 0!==zg&&a.j(aa+" instructions earlier:");0<Kb&&ga!=a.$;){var Dg=na[ga++];if(null==Dg.F)break;var Lb=Z(Dg.F),Ji=aa--,Eg=gi(a,Lb,"history",Ji);(!Jd.length||0<=Eg.indexOf(Jd[0]))&&a.j(Eg);
|
||||
Lb.cc&&(ga+=Lb.cc,Kb-=Lb.cc,aa-=Lb.cc);ga>=na.length&&(ga=0);a.vb=aa;Cg++;Kb--}}Cg||(a.j("no "+Bg+"history available"),a.vb=void 0)}else{var Mb=Th(a,ma);if(Mb){var Cc=0;Ma&&("l"==Ma.charAt(0)&&(Ma=Ma.substr(1)||Ii),Cc=Gh(a,Ma)>>>0,65536<Cc&&(Cc=65536));for(var Nb="dd"==hb?4:"db"==hb?1:2,Dc=Nb*Cc||128,Ki=Dc+15>>4||1,Ob="";Ki--&&0<Dc;){var Kd="",Fg="",ma=J(a,Mb.F),Pb,kb,Ec=0,Qb=0;for(Pb=a.ca;0<Pb&&0<Dc;Pb-=kb,Dc-=kb){kb=1;var Fc=1==Nb?a.Gb(Mb,kb):a.oa(Mb,kb=2),Ec=Ec|Fc<<(Qb<<3),Qb=Qb+kb;Qb==Nb&&(Kd+=
|
||||
J(a,Ec,Nb),Kd+=1==Nb?9==Pb?"-":" ":" ",Ec=Qb=0);Fg+=32<=Fc&&128>Fc?String.fromCharCode(Fc):"."}Ob&&(Ob+="\n");Ob+=ma+" "+Kd+(0==Pb?" "+Fg:"")}Ob&&a.j(Ob);a.mb=Mb}}}}break;case "e":if("else"==g[0])break;var lb,Ld,Md,Nd,Od=g[0],Pd=g[1];"eb"==Od?(lb=1,Ld=255,Md=a.Gb,Nd=a.Yb):"e"==Od||"ew"==Od?(lb=2,Ld=65535,Md=a.oa,Nd=a.ib):Pd=null;if(null==Pd)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 Gc=Th(a,Pd);if(Gc)for(var Hc=
|
||||
2;Hc<g.length;Hc++){var Rb=Eh(a,g[Hc]);if(void 0===Rb){a.j("unrecognized value: "+g[Hc]);break}Rb&~Ld&&a.j("warning: "+p(Rb)+" exceeds "+lb+"-byte value");a.j("changing "+J(a,Gc.F)+(F(a,64)?"":" from "+J(a,Md.call(a,Gc),lb))+" to "+J(a,Rb,lb));Nd.call(a,Gc,Rb,lb)}}break;case "g":a:{var Gg=g[1],Li=b;if(void 0!==Gg){var Qd=Th(a,Gg,!0);if(!Qd)break a;Xh(a,Qd,Li);a.nb(a.g,Qd,!0)}a.jb(!0,c)}break;case "h":a.A.Z?(c||a.j("halting"),a.ga()):sb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Rd;
|
||||
var Sb=b.substr(2),Sb=ya(Sb);Eh(a,Sb)?(c||a.j("true: "+Sb),Rd=!0):(c||a.j("false: "+Sb),Rd=!1);Rd||(d=!1);break}f=!0;break;case "k":var Mi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Sd=0,Td=Z(),Tb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Tb.F));10>Sd;){for(var Na=null,Ni=256;65536>Tb.F>>>0;){Td.F=a.oa(Tb,2);if(null==Tb.F||!Ni--)break;if(!(Td.F&1)){for(var Oi=a,Ic=Td,Hg=null,Ub=Ic.F,Ig=Ub,Ud=1;6>=Ud&&Ub;Ud++){if(2<
|
||||
Ud){Ic.F=Ub;var Jc=gi(Oi,Ic);if(0<=Jc.indexOf("JSR")){var Jg=Jc.indexOf(" ");if(Ub+(Jc.indexOf(" ",Jg+1)-Jg-1)/2==Ig){Hg=Jc;break}}}Ub-=2}Ic.F=Ig;if(Na=Hg)break}}if(!Na||null==Na)break;var Kg=null;if("ks"==Mi){var Lg=Na.match(/[0-9A-F]+$/);Lg&&(Kg=ni(a,Lg[0]))}Na=xa(Na,50)+" ;"+(Kg||"stack="+J(a,Tb.F));a.j(Na);Sd++}Sd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){ni(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"==
|
||||
G)Da=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in xb)if(G==oa){Da=xb[oa];pa=!!(a.na&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.na|=Da,pa=!0;else if("off"==g[2]&&(a.na&=~Da,pa=!1,1073741824==Da)){for(var Vd=0;Vd<a.wa.length;Vd++)a.j(a.wa[Vd]);a.wa=[]}}var Pi=0,Vb="";for(oa in xb)if(!G||G==oa){var Qi=!!(a.na&xb[oa]);if(null===pa||pa==Qi)Vb&&(Vb+=","),++Pi%10||(Vb+="\n\t"),
|
||||
"key"==oa&&(oa="keys"),Vb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Vb||"none"));Lh(a)}break;case "p":if("print"==g[0]){oi(a,b.substr(5));break}var Ri="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Mg=Z(a.b.u[7]);a.Gb(Mg);a.S?(a.nb(a.g,Mg,!0),a.jb()||(a.B&&a.B.sb(),a.S=0)):pi(a,Ri?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}$h(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Wb=
|
||||
+g[2];if(8==Wb||10==Wb||16==Wb)a.ca=Wb;else{a.j("invalid base: "+Wb);break}}a.j("default base: "+a.ca);break;case "cs":var Xb;void 0!==g[3]&&(Xb=+g[3]);switch(g[2]){case "int":a.b.yb=Xb;break;case "start":a.b.Ib=Xb;break;case "stop":a.b.zb=Xb;break;default:a.j("unknown cs option");break a}void 0!==Xb&&ld(a.b);a.j("checksums "+(a.b.A.xb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(pd(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.ob.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.eb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":pi(a,g[0],g[1]);break;case "u":ai(a,g[1],g[2],8);break;case "v":if("var"==g[0]){mi(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.j("PDPjs version 1.30.3 ("+a.b.pb+",RELEASE"+(wb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){oi(a,b.substr(1));break}var Wd="commands:",Xd;for(Xd in Nh)Wd+="\n"+xa(Xd,9)+Nh[Xd];ne(a)||(Wd+="\nnote: history disabled if no exec breakpoints");a.j(Wd);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Ng){a.j("debugger error: "+(Ng.stack||Ng.message)),d=!1}return d}
|
||||
function nd(a,b,c){b=Ch(a,b,c);for(var d in b)if(!fi(a,b[+d]))return!1;return!0}Xa(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Jh(d);C(d,c)}});
|
||||
function ri(a,b,c){t.call(this,"Computer",a,ri,67108864);this.A.ia=!1;si(this,b);this.L=jd(this,"autoPower",a);this.v=0;this.Y=a.busWidth||a.buswidth;this.g=ti;this.J=null;this.D=this.R=!1;this.$=jd(this,"url")||"";(Math.random()+.1).toString(36);this.B=ui(this);if(this.b=qb("CPU",this.id)){this.i=qb("Debugger",this.id);this.w=new ic({id:this.Qa+".bus",busWidth:this.Y},this.b,this.i);var d,e=ob(this.id);if((this.f=qb("Panel",this.id))&&this.f.Ra)for(b=0;b<e.length;b++)d=e[b],d.O=this.f.O,d.j=this.f.j,
|
||||
d.Ra=this.f.Ra;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.g=parseInt(d,10));var f;if(a=jd(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.g=ti),this.g&&(this.K=
|
||||
new P(this,"1.30.3"),vi(this.K)?b=null:delete this.K);!b&&this.g&&(b=wi(this))&&(this.D=!0);if(b){var g=this;Ea(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.O("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.J=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&xi(this,this.Jb)}else q("Unable to find CPU component")}z(ri);var ti=0;
|
||||
function si(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function jd(a,b,c){var d=b.toLowerCase(),d=bb[b]||bb[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function xi(a,b,c){for(var d=ob(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!tb(f)){tb(f,function(){xi(a,b,c)});return}}b.call(a,c)}
|
||||
function yi(a,b){var c=new P(a,"1.30.3","validate");if(vi(c)&&zi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.O("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=ri.prototype;
|
||||
k.Jb=function(a){void 0===a&&(a=this.g||(this.J?1:ti));if(!this.v){this.v++;var b=!1,c=!1;this.P=!1;var d=this.K||new P(this,"1.30.3");if(-1==a)b=!0;else if(a>ti){if(vi(d,this.J)){this.C=new P(this,"1.30.3","failsafe");vi(this.C)&&(Ai(this,d),a=2,Bi(this.C));this.C.set("timestamp",Ca());Ci(this.C);var e=this.g&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=zi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?vi(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.B=null)):this.j(f+": "+g),Bi(d),vi(d)?(c=zi(d),e=!0):c=!1))}e&&yi(this,c?d:null)}else 2==a&&d.clear()}else yi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Di(this,g,d,b,c));b=[d,a,c];-1!=a?xi(this,this.qc,b):this.qc(b)}};
|
||||
function Di(a,b,c,d,e){if(!b.A.ia){b.A.ia=!0;if(b.Ha){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ha(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.g=ti,window&&window.location.reload()):a.P=!0,b.Ha(null),e=!1)}if(!d&&b.rc)for(a=b.rc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.qc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Di(this,this.b,b,c,a),this.qa(),this.b.ub());this.P&&(Ai(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0};
|
||||
function Ai(a,b){if(Ha("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.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function qi(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new P(a,"1.30.3"),g=new P(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ga&&(c&&a.b.ga(),d=a.b.Ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ia&&(m.Ga&&(d=m.Ga(b,c),"object"===typeof d&&f.set(m.id,
|
||||
d)),c&&(m.A.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&Ei(a,a.B,f.toString()),Ci(g)&&Ci(f)||(e=null,d=h=!0)):a.g&&(d=!0,h=3==a.g),d&&f.clear(h)):e=f.toString());c&&(a.A.ia=!1,b=a.G.power)&&(b.textContent="Power");a.v=0;return e}
|
||||
k.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=ob(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.qa(-1)};k.start=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.qa(-1)};
|
||||
k.stop=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.qa(-1)};
|
||||
k.qa=function(a){if(this.b){var b=this.b,c=b.G.speed;c&&(c.textContent=b.A.Z&&b.Y?b.Y.toFixed(2)+"Mhz":"Stopped")}if(this.f&&(b=this.f,b.D)){if(!(0<a&&60>(b.J+=a))){for(a=0;a<b.b.u.length;a++)Jb(b,"R"+a,b.b.u[a]);a=Pc(b.b);Jb(b,"PS",a);Jb(b,"NF",a&8?1:0,1);Jb(b,"ZF",a&4?1:0,1);Jb(b,"VF",a&2?1:0,1);Jb(b,"CF",a&1?1:0,1);b.J=0}dc(b,"D",b.v,16);dc(b,"A",b.f,22);a=b.b.Ua?b.b.qb&16?1:2:4;fc(b,"B22",a&1);fc(b,"B18",a&2);fc(b,"B16",a&4)}};
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.v||(d.A.ia?qi(d,!1,!0):xi(d,d.Jb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.v)if(d.g&&!d.H){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");qi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.sc=!0),d.Jb(ti),d.sc=!1)}else d.reset(),d.b&&d.b.ub()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.G[b]=c,c.onclick=function(){var a=ui(d,!0);if(a){var b=!!(d.g&&!d.H||d.M),c=qi(d,b);b?Ei(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function ui(a,b){var c=a.B;c||((c=La("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=Fi(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c}
|
||||
function Fi(a,b){a.B=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa("user",b.data),a.B=b.data)}catch(d){q(d.message+" ("+c+")")}return a.B}function wi(a){var b=null;a.B&&(b=Ga()+"/api/v1/user?req=load&user="+a.B+"&state="+Gi(a,"1.30.3"));return b}
|
||||
function Ei(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Gi(a,"1.30.3");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.O("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.O(c),Oa("user",""),a.B=null)}}
|
||||
function Xg(a){var b;a=ob(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.sb=function(a){if(this.Ra){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Ra.focus();!a&&window&&window.scrollTo(b,c)}};Xa(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new ri(g,d,!0);C(g,f);g.L&&xi(g,g.Jb)}});
|
||||
Sa.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.ca&&!c.A.ia&&c.Jb(-1)}});Sa.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.A.ia&&qi(c,!(!c.g||c.H),!0)}});function P(a,b,c){this.id=a.id;this.key=Gi(a,b,c);this.i=a.i;Bi(this,a.Tc)}function Gi(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Bi(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Bi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ci(a){var b=!0;if(Ja()){var c=JSON.stringify(a[a.id]);Oa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function zi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function vi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ja()&&(b=La(a.key))?(a[a.id]=b,a.b=!0):!1}var Hi=0;
|
||||
function Si(a,b,c,d,e,f){e("Loading "+a+"...");Ea(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Ti(h,a,b,c,d,e,f)})}
|
||||
function Ti(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(nb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Ui(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Ui(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);Ui(a,b,c)}})}else c(a,null)}
|
||||
function Vi(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Hi||Za(!0));l=!1}var g,h,l=!0;Hi++;mb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Si(c,null,null,!1,e,function(d,l){l?(nb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Hi||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Hi||Za(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Si(b,a,d,!0,e,m):Ti(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return Vi(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
||||
63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Sh=[0],Th=
|
||||
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Lh.prototype;
|
||||
k.Ea=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.f=a.f;(a=ld(a,"messages"))&&Oh(this,a);this.wb=Rh;this.Pb=1145>this.b.pb?Th:[];Uh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Vh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=yc[c],n&&d.j(p(n.id,8)+" %"+
|
||||
p(e<<d.w.ka,8)+" %%"+p(n.F,8)+" "+p(n.Mb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=Yc&&(c=-1),m=0);a+=d.w.ya;e++}}});H(this)};
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",pd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.v.length-1&&(b=d.v[++d.C])):40==a.keyCode&&(0<d.C?b=d.v[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Qa(c,function(){if(d.ma){var a=d.ma.value;
|
||||
d.ma.value="";pd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Qa(c,function(a){var b=!1;rb(d,!0)||(qb(d,!0),b=d.kb(a?1:0),qb(d,!1));return b}),!0}return!1};k.sb=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Gb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Rb?this.w.Vb(d):this.b.Vb(d),b&&Wh(a,b));return c};
|
||||
k.oa=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Rb?this.w.bb(d):this.b.bb(d),b&&Wh(a,b));return c};k.Yb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Rb?this.w.rb(d,b):this.b.rb(d,b),c&&Wh(a,c),this.B.qa(-1))};k.ib=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Rb?this.w.Db(d,b):this.b.Db(d,b),c&&Wh(a,c),this.B.qa(-1))};function Y(a,b){return{F:a,Rb:b,Oa:!1}}function Xh(a){return[a.F,a.Oa]}function Yh(a){return{F:a[0],Oa:a[1]}}
|
||||
function Vh(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=Hh(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;e<a.J.length;e++){var g=a.J[e].ha[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Y(d));break}}if(d=f)return d;e=Gh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function Zh(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Ic=Eh(a,b.Dc=c[2]))}function Wh(a,b){null!=a.F&&(a.F+=b||1)}
|
||||
function Oh(a,b){a.i=a;a.na=a.Mc=536870912;a.ja=null;a.wa=[];b=Eh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in wb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.na|=wb[c],a.j(c+" messages enabled"))}}function Uh(a,b){for(var c in wb)if(64==wb[c]){a.Na[c]=b;break}}
|
||||
k.uc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SW":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function $h(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.vc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Rc(this.b):21==a&&this.f&&hc(this.f)&&(b=this.f.Va));return b};
|
||||
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Kb).F));this.na&1073741824?this.wa.push(a):this.ja&&a==this.ja||(this.ja=a,this.na&-2147483648&&this.b&&this.b.A.Z&&(this.ga(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,td(a),a.ua=0,a.qa()))};function Nh(a){var b;if(!pe(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.$=0;a.j("instruction history buffer allocated")}}
|
||||
k.jb=function(a,b){if(!ai(this,b))return!1;this.b.jb(a);return!0};k.kb=function(a,b,c){if(!ai(this))return!1;this.K=0;a||pe(this)&&qe(this,this.b.u[7],0);try{a=ud(this.b,a);var d=this.b.kb(a);0<d&&($b(this.b,d),this.K+=d,ac(this.b,d,!0),bc(this.b,d),this.Aa++)}catch(e){"number"!=typeof e&&(this.K=0,ub(this.b,e.stack||e.message))}!1!==c&&this.B.qa(-1);od(this,b||!1);return 0<this.K};k.ga=function(a){this.b&&this.b.ga(a)};
|
||||
function od(a,b){if(a.lb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.I&8?c.Wc|c.Uc<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+(d?" ("+J(a,d)+")":""))}a.L=Y(a.b.u[7]);b&&1!=a.S?bi(a):ci(a)}}function ai(a,b){var c;(c=!a.b||!sb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!tb(a.b)}k.Ha=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
k.Ga=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Nh(this);this.Aa=0;this.ja=null;this.K=0;this.L=Y(this.b.u[7]);this.A.Z=!1;di(this);a||od(this)};k.save=function(){var a=new O(this);a.set(0,Xh(this.L));a.set(1,Xh(this.P));a.set(2,[this.v,this.R,this.na]);a.set(3,this.J);return a.data()};
|
||||
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Yh(a[b++]),this.P=Yh(a[b++]),this.v=a[b][0],"string"==typeof this.v&&(this.v=[this.v]),this.R=a[b][1],this.na|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.Z=!0;this.Sb=a;this.Ub=b};
|
||||
k.stop=function(a,b){if(this.A.Z){this.A.Z=!1;this.K=b-this.Ub;if(!this.S){b="stopped";if(this.K){a-=this.Sb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";pe(this)&&(b+=this.Aa+" instructions, ",this.Aa=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}od(this,!0);this.sb();di(this,this.b.u[7]);this.ja=null}};function pe(a){return 1<a.g.length||!!a.ua}
|
||||
function qe(a,b,c){var d=-1;c||(d=a.b.bb(b),0==d&&(b=Ed(a.b,2)));if(0<c&&(a.ua&&!--a.ua||gd(a,b,1,a.g)))return!0;0<=c&&a.H.length&&(a.Aa++,0>d&&(d=a.b.bb(b)),65535!=(d&65535)&&(c=a.H[a.$],c.F=b,c.Oa=!1,++a.$==a.H.length&&(a.$=0)));return!1}function vf(a){var b=a.b;if(b.A.Z)throw N(b,a.b.Kb),a.ga(),-1;return!1}
|
||||
function Mh(a){var b,c;a.g=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.w;c=a.ba(c);hd(d.W[c>>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.ba(c),hd(d.W[c>>>d.ka],!0);a.D=["bw"];a.tb=0}k.nb=function(a,b,c){var d=!0;c||ei(this,a,b,!1,!0);if(a!=this.g){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.W[e>>>f.ka].nb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(fi(this,a,a.length-1,"set"),Nh(this)));return d};
|
||||
function ei(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Oa)){f=!0;h.Oa||e||fi(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(d=a.w,hd(d.W[c>>>d.ka],b==a.D));h.Oa||Nh(a);break}}return f}function gi(a,b){for(var c=1;c<b.length;c++)fi(a,b,c);return b.length-1}function fi(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Dc?' "'+c.Dc+'"':""))}
|
||||
function di(a,b){if(void 0!==b)gd(a,b,1,a.g,!0),a.S=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Oa){if(!ei(a,a.g,c,!0))break;b=0}}}
|
||||
function gd(a,b,c,d,e){var f=!1;if(!a.tb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Oa)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Oa&&(ei(a,d,h,!0),e=!0);if(n=h.Ic){for(var f=!1,v=0;v<n.length;v++)if(!hi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.A.Z||(f=!0)}if(f){e||fi(a,d,g,"hit");break}}}a.tb--;return f}
|
||||
function ii(a,b,c,d){var e=Y(b.F),f=a.oa(b,2),g,h;for(h in a.wb)if(g=a.wb[h][f&h])break;g||(g=Sh);var l=g[0];0<=a.Pb.indexOf(l)&&(g=Sh,l=g[0]);var m=h="",n=Qh[l],v=g.length-1;l||v||(h=J(a,f));for(l=1;l<=v;l++){var r=g[l];if(void 0!==r){var w;w=a;var y=r,r=b,x="",A=y&61440;if(4096==A)r=r.F+((f&255)<<24>>23)&65535,x=J(w,r);else if(8192==A)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6),
|
||||
y&63)switch(y=A&7,A&56){case 0:x=$h(y);break;case 8:x="@"+$h(y);break;case 16:7>y?x="("+$h(y)+")+":(A=w.oa(r,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+$h(y)+")+":(A=w.oa(r,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+$h(y)+")";break;case 40:x="@-("+$h(y)+")";break;case 48:A=w.oa(r,2);x=J(w,A,0,!0)+"("+$h(y)+")";7==y&&(x=J(w,A+r.F&65535));break;case 56:A=w.oa(r,2),x="@"+J(w,A)+"("+$h(y)+")",7==y&&(x="@"+J(w,A+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
|
||||
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.oa(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.A.xb?g+("cycles="+qd(a.b).toString()+" cs="+p(a.b.Hb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function ji(a,b){switch(b){case "N":a=a.b.Ta();break;case "Z":a=Cd(a.b);break;case "V":a=Bd(a.b);break;case "C":a=Ad(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function ki(a,b){var c="",d=a.b;8>b?(c=$h(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Rc(d)):21==b&&a.f&&hc(a.f)&&(c="SW="+J(a,a.f.Va,3));c&&(c+=" ");return c}function li(a){var b,c="";for(b=0;6>b;b++)c+=ki(a,b);c=c+"\n"+(ki(a,6)+ki(a,7));c+=ki(a,20)+ki(a,21);return c+=ji(a,"T")+ji(a,"N")+ji(a,"Z")+ji(a,"V")+ji(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function ug(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],v=za(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Ve:b,F:c,Vc:d,ha:e,nc:f})}function mi(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.J.length;b++){var f=a.J[b],g=f.F>>>0,h=f.Vc;if(e>=g&&e<g+h){e=za(f.nc,[e-g],a.pc);0<=e?ni(a,b,e,d):c&&(e=~e,ni(a,b,e-1,d),ni(a,b,e,d));break}}return d}
|
||||
function ni(a,b,c,d){var e={},f=a.J[b].nc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.J[b].ha[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function oi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Kh(a)||a.j("no variables"),!0;if(!c[2])return Kh(a,c[1]);if(!c[3])return delete a.Y[c[1]],!0;b=Gh(a,c[3]);return void 0!==b?(a.Y[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
||||
function pi(a,b,c){var d=null;if(b=Vh(a,b,!0)){a.ba(b);var e=mi(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
||||
function bi(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=Gh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":N(d,f);a.L=Y(d.u[7]);break;case "N":d.X=f?32768:0;break;case "Z":d.aa=
|
||||
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SW":if(a.f&&hc(a.f)){fc(a.f,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.qa();a.j("updated registers:")}a.j(li(a));c&&(a.L=Y(d.u[7]),ci(a,J(a,a.L.F)))}}function qi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Jh(a,null,c[2].charCodeAt(0)):Gh(a,b,!0)}
|
||||
function ri(a,b,c){var d="t"!=b;c=Ih(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Pa(c,function(){return qb(a,!0)&&a.kb(e,d,!1)},function(){a.f&&a.f.stop&&a.f.stop();a.B.qa();qb(a,!1)})}
|
||||
function ci(a,b,c,d){if(b=Vh(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ih(a,c.substr(1)),null!=c&&(d=c);else{d=Vh(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=rb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=mi(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=ii(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
|
||||
function hi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(sb(a)&&0<b.length){a.R&&(b="a "+J(a,a.P.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var v=
|
||||
Vh(a,g[1],!0);if(v)if(a.P=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.B.qa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Yb(v,r[w],1);a.j(ii(a,a.P))}}break;case "b":a:{var y=g[0],x=g[1],A=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
|
||||
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ia=y.charAt(1);if("l"==ia){var Ja;Ja=0+gi(a,a.g);Ja+=gi(a,a.M);(Ja+=gi(a,a.D))||a.j("no breakpoints")}else if("n"==ia)a.ua=Ih(a,x),a.j("break after "+a.ua+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=Vh(a,x,!0),!P))break a;"c"==ia?null==P.F?(Mh(a),a.j("all breakpoints cleared")):ei(a,a.g,P)||ei(a,a.M,P)||ei(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(Zh(a,P,A),"p"==ia?a.nb(a.g,
|
||||
P):"r"==ia?a.nb(a.M,P):"w"==ia?a.nb(a.D,P):a.j("unknown breakpoint command: "+ia))}}}break;case "c":a.Ra&&(a.Ra.value="");break;case "d":a:{var fb,gb=g[0],la=g[1],La=g[2],Ki=g[3];if("?"==la){var hb="";for(fb in wb)a.Na[fb]&&(hb&&(hb+=","),hb+=fb);hb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
|
||||
hb.length&&a.j("dump extension commands:\n\t"+hb)}else if("state"==la){var wg=si(a.B,!0);"console"==La?console.log(wg):(a.Ra&&(a.Ra.value=""),a.j(wg))}else if("symbols"==la)for(var Gd=0;Gd<a.J.length;Gd++){var Hd=a.J[Gd],ib;for(ib in Hd.ha)if("."!=ib.charAt(0)){var xg=Hd.ha[ib].o;if(void 0!==xg){var yg=Hd.ha[ib].l;yg&&(ib=yg);a.j(J(a,xg)+" "+ib)}}}else{if("d"==gb){for(fb in wb)if(g[1]==fb){var zg=a.Na[fb];zg?(g.shift(),g.shift(),zg(g)):a.j("no dump registered for "+la);break a}la||(gb=a.Wb||"dw")}else a.Wb=
|
||||
gb;if("dh"==gb){var Ag=la,Bg=La,Cg="",Dg=0,fa=a.$,ma=a.H;if(ma.length){var Z=+Ag||a.vb,Jb=+Bg||10;isNaN(Z)?Z=Jb:Cg="more ";Z>ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);fa-=Z;0>fa&&(null==ma[ma.length-1].F?(Z=fa+Z,fa=0):fa+=ma.length);var Id=[];"call"==Bg&&(Jb=1E5,Id=["CALL"]);for(void 0!==Ag&&a.j(Z+" instructions earlier:");0<Jb&&fa!=a.$;){var Eg=ma[fa++];if(null==Eg.F)break;var Kb=Y(Eg.F),Li=Z--,Fg=ii(a,Kb,"history",Li);(!Id.length||0<=Fg.indexOf(Id[0]))&&a.j(Fg);Kb.cc&&(fa+=
|
||||
Kb.cc,Jb-=Kb.cc,Z-=Kb.cc);fa>=ma.length&&(fa=0);a.vb=Z;Dg++;Jb--}}Dg||(a.j("no "+Cg+"history available"),a.vb=void 0)}else{var Lb=Vh(a,la);if(Lb){var Bc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||Ki),Bc=Ih(a,La)>>>0,65536<Bc&&(Bc=65536));for(var Mb="dd"==gb?4:"db"==gb?1:2,Cc=Mb*Bc||128,Mi=Cc+15>>4||1,Nb="";Mi--&&0<Cc;){var Jd="",Gg="",la=J(a,Lb.F),Ob,jb,Dc=0,Pb=0;for(Ob=a.ca;0<Ob&&0<Cc;Ob-=jb,Cc-=jb){jb=1;var Ec=1==Mb?a.Gb(Lb,jb):a.oa(Lb,jb=2),Dc=Dc|Ec<<(Pb<<3),Pb=Pb+jb;Pb==Mb&&(Jd+=J(a,Dc,Mb),Jd+=
|
||||
1==Mb?9==Ob?"-":" ":" ",Dc=Pb=0);Gg+=32<=Ec&&128>Ec?String.fromCharCode(Ec):"."}Nb&&(Nb+="\n");Nb+=la+" "+Jd+(0==Ob?" "+Gg:"")}Nb&&a.j(Nb);a.mb=Lb}}}}break;case "e":if("else"==g[0])break;var kb,Kd,Ld,Md,Nd=g[0],Od=g[1];"eb"==Nd?(kb=1,Kd=255,Ld=a.Gb,Md=a.Yb):"e"==Nd||"ew"==Nd?(kb=2,Kd=65535,Ld=a.oa,Md=a.ib):Od=null;if(null==Od)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 Fc=Vh(a,Od);if(Fc)for(var Gc=2;Gc<g.length;Gc++){var Qb=
|
||||
Gh(a,g[Gc]);if(void 0===Qb){a.j("unrecognized value: "+g[Gc]);break}Qb&~Kd&&a.j("warning: "+p(Qb)+" exceeds "+kb+"-byte value");a.j("changing "+J(a,Fc.F)+(F(a,64)?"":" from "+J(a,Ld.call(a,Fc),kb))+" to "+J(a,Qb,kb));Md.call(a,Fc,Qb,kb)}}break;case "g":a:{var Hg=g[1],Ni=b;if(void 0!==Hg){var Pd=Vh(a,Hg,!0);if(!Pd)break a;Zh(a,Pd,Ni);a.nb(a.g,Pd,!0)}a.jb(!0,c)}break;case "h":a.A.Z?(c||a.j("halting"),a.ga()):rb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Qd;var Rb=b.substr(2),
|
||||
Rb=xa(Rb);Gh(a,Rb)?(c||a.j("true: "+Rb),Qd=!0):(c||a.j("false: "+Rb),Qd=!1);Qd||(d=!1);break}f=!0;break;case "k":var Oi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Rd=0,Sd=Y(),Sb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Sb.F));10>Rd;){for(var Ma=null,Pi=256;65536>Sb.F>>>0;){Sd.F=a.oa(Sb,2);if(null==Sb.F||!Pi--)break;if(!(Sd.F&1)){for(var Qi=a,Hc=Sd,Ig=null,Tb=Hc.F,Jg=Tb,Td=1;6>=Td&&Tb;Td++){if(2<Td){Hc.F=Tb;var Ic=
|
||||
ii(Qi,Hc);if(0<=Ic.indexOf("JSR")){var Kg=Ic.indexOf(" ");if(Tb+(Ic.indexOf(" ",Kg+1)-Kg-1)/2==Jg){Ig=Ic;break}}}Tb-=2}Hc.F=Jg;if(Ma=Ig)break}}if(!Ma||null==Ma)break;var Lg=null;if("ks"==Oi){var Mg=Ma.match(/[0-9A-F]+$/);Mg&&(Lg=pi(a,Mg[0]))}Ma=wa(Ma,50)+" ;"+(Lg||"stack="+J(a,Sb.F));a.j(Ma);Rd++}Rd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){pi(a,g[1],!0);break}f=!0;break;case "m":a:{var na,oa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=
|
||||
null;else if("on"==G)oa=!0,G=null;else if("off"==G)oa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(na in wb)if(G==na){Ca=wb[na];oa=!!(a.na&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.na|=Ca,oa=!0;else if("off"==g[2]&&(a.na&=~Ca,oa=!1,1073741824==Ca)){for(var Ud=0;Ud<a.wa.length;Ud++)a.j(a.wa[Ud]);a.wa=[]}}var Ri=0,Ub="";for(na in wb)if(!G||G==na){var Si=!!(a.na&wb[na]);if(null===oa||oa==Si)Ub&&(Ub+=","),++Ri%10||(Ub+="\n\t"),"key"==na&&
|
||||
(na="keys"),Ub+=na}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==oa?oa?"messages on: ":"messages off: ":"message categories:\n\t")+(Ub||"none"));Nh(a)}break;case "p":if("print"==g[0]){qi(a,b.substr(5));break}var Ti="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Ng=Y(a.b.u[7]);a.Gb(Ng);a.S?(a.nb(a.g,Ng,!0),a.jb()||(a.B&&a.B.sb(),a.S=0)):ri(a,Ti?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}bi(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Vb=
|
||||
+g[2];if(8==Vb||10==Vb||16==Vb)a.ca=Vb;else{a.j("invalid base: "+Vb);break}}a.j("default base: "+a.ca);break;case "cs":var Wb;void 0!==g[3]&&(Wb=+g[3]);switch(g[2]){case "int":a.b.yb=Wb;break;case "start":a.b.Ib=Wb;break;case "stop":a.b.zb=Wb;break;default:a.j("unknown cs option");break a}void 0!==Wb&&nd(a.b);a.j("checksums "+(a.b.A.xb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(rd(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.ob.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.eb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":ri(a,g[0],g[1]);break;case "u":ci(a,g[1],g[2],8);break;case "v":if("var"==g[0]){oi(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.j("PDPjs version 1.30.3 ("+a.b.pb+",RELEASE"+(vb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){qi(a,b.substr(1));break}var Vd="commands:",Wd;for(Wd in Ph)Vd+="\n"+wa(Wd,9)+Ph[Wd];pe(a)||(Vd+="\nnote: history disabled if no exec breakpoints");a.j(Vd);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Og){a.j("debugger error: "+(Og.stack||Og.message)),d=!1}return d}
|
||||
function pd(a,b,c){b=Eh(a,b,c);for(var d in b)if(!hi(a,b[+d]))return!1;return!0}Wa(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Lh(d);C(d,c)}});
|
||||
function ti(a,b,c){t.call(this,"Computer",a,ti,67108864);this.A.ia=!1;ui(this,b);this.L=ld(this,"autoPower",a);this.v=0;this.Y=a.busWidth||a.buswidth;this.g=vi;this.J=null;this.D=this.R=!1;this.$=ld(this,"url")||"";(Math.random()+.1).toString(36);this.B=wi(this);if(this.b=pb("CPU",this.id)){this.i=pb("Debugger",this.id);this.w=new jc({id:this.Qa+".bus",busWidth:this.Y},this.b,this.i);var d,e=nb(this.id);if((this.f=pb("Panel",this.id))&&this.f.Ra)for(b=0;b<e.length;b++)d=e[b],d.O=this.f.O,d.j=this.f.j,
|
||||
d.Ra=this.f.Ra;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.g=parseInt(d,10));var f;if(a=ld(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.g=vi),this.g&&(this.K=
|
||||
new O(this,"1.30.3"),xi(this.K)?b=null:delete this.K);!b&&this.g&&(b=yi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.O("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.J=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&zi(this,this.Jb)}else q("Unable to find CPU component")}z(ti);var vi=0;
|
||||
function ui(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function ld(a,b,c){var d=b.toLowerCase(),d=ab[b]||ab[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function zi(a,b,c){for(var d=nb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!sb(f)){sb(f,function(){zi(a,b,c)});return}}b.call(a,c)}
|
||||
function Ai(a,b){var c=new O(a,"1.30.3","validate");if(xi(c)&&Bi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.O("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=ti.prototype;
|
||||
k.Jb=function(a){void 0===a&&(a=this.g||(this.J?1:vi));if(!this.v){this.v++;var b=!1,c=!1;this.P=!1;var d=this.K||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>vi){if(xi(d,this.J)){this.C=new O(this,"1.30.3","failsafe");xi(this.C)&&(Ci(this,d),a=2,Di(this.C));this.C.set("timestamp",Ba());Ei(this.C);var e=this.g&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Bi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?xi(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Na("user",""),this.B=null)):this.j(f+": "+g),Di(d),xi(d)?(c=Bi(d),e=!0):c=!1))}e&&Ai(this,c?d:null)}else 2==a&&d.clear()}else Ai(this);delete this.J;delete this.K}e=nb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Fi(this,g,d,b,c));b=[d,a,c];-1!=a?zi(this,this.qc,b):this.qc(b)}};
|
||||
function Fi(a,b,c,d,e){if(!b.A.ia){b.A.ia=!0;if(b.Ha){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ha(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.g=vi,window&&window.location.reload()):a.P=!0,b.Ha(null),e=!1)}if(!d&&b.rc)for(a=b.rc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
k.qc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Fi(this,this.b,b,c,a),this.qa(),this.b.ub());this.P&&(Ci(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0};
|
||||
function Ci(a,b){if(Ga("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.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function si(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ga&&(c&&a.b.ga(),d=a.b.Ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ia&&(m.Ga&&(d=m.Ga(b,c),"object"===typeof d&&f.set(m.id,
|
||||
d)),c&&(m.A.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&Gi(a,a.B,f.toString()),Ei(g)&&Ei(f)||(e=null,d=h=!0)):a.g&&(d=!0,h=3==a.g),d&&f.clear(h)):e=f.toString());c&&(a.A.ia=!1,b=a.G.power)&&(b.textContent="Power");a.v=0;return e}
|
||||
k.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=nb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.qa(-1)};k.start=function(a,b){for(var c=nb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.qa(-1)};
|
||||
k.stop=function(a,b){for(var c=nb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.qa(-1)};
|
||||
k.qa=function(a){if(this.b){var b=this.b,c=b.G.speed;c&&(c.textContent=b.A.Z&&b.Y?b.Y.toFixed(2)+"Mhz":"Stopped")}if(this.f&&(b=this.f,b.D)){if(!(0<a&&60>(b.J+=a))){for(a=0;a<b.b.u.length;a++)Yb(b,"R"+a,b.b.u[a]);a=Rc(b.b);Yb(b,"PS",a);Yb(b,"NF",a&8?1:0,1);Yb(b,"ZF",a&4?1:0,1);Yb(b,"VF",a&2?1:0,1);Yb(b,"CF",a&1?1:0,1);b.J=0}ec(b,"D",b.v,16);ec(b,"A",b.f,22);a=b.b.Ua?b.b.qb&16?1:2:4;gc(b,"B22",a&1);gc(b,"B18",a&2);gc(b,"B16",a&4)}};
|
||||
k.ta=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.v||(d.A.ia?si(d,!1,!0):zi(d,d.Jb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.v)if(d.g&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");si(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.sc=!0),d.Jb(vi),d.sc=!1)}else d.reset(),d.b&&d.b.ub()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.G[b]=c,c.onclick=function(){var a=wi(d,!0);if(a){var b=!!(d.g&&!d.H||d.M),c=si(d,b);b?Gi(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function wi(a,b){var c=a.B;c||((c=Ka("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=Hi(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c}
|
||||
function Hi(a,b){a.B=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Na("user",b.data),a.B=b.data)}catch(d){q(d.message+" ("+c+")")}return a.B}function yi(a){var b=null;a.B&&(b=Fa()+"/api/v1/user?req=load&user="+a.B+"&state="+Ii(a,"1.30.3"));return b}
|
||||
function Gi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Ii(a,"1.30.3");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.O("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.O(c),Na("user",""),a.B=null)}}
|
||||
function Zg(a){var b;a=nb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.sb=function(a){if(this.Ra){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Ra.focus();!a&&window&&window.scrollTo(b,c)}};Wa(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new ti(g,d,!0);C(g,f);g.L&&zi(g,g.Jb)}});
|
||||
Ra.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=pb("Computer",c.id))&&c.ca&&!c.A.ia&&c.Jb(-1)}});Ra.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=pb("Computer",c.id))&&c.A.ia&&si(c,!(!c.g||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=Ii(a,b,c);this.i=a.i;Di(this,a.Tc)}function Ii(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Di(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Di(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ei(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Na(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Bi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function xi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var Ji=0;
|
||||
function Ui(a,b,c,d,e,f){e("Loading "+a+"...");Da(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Vi(h,a,b,c,d,e,f)})}
|
||||
function Vi(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(mb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Wi(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Wi(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);Wi(a,b,c)}})}else c(a,null)}
|
||||
function Xi(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Ji||Ya(!0));l=!1}var g,h,l=!0;Ji++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Ui(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Ji||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Ji||Ya(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ui(b,a,d,!0,e,m):Vi(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return Xi(a,b,c,d)};window.enableEvents=Ya;window.sendEvent=Za;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
||||
|
|
|
|||
|
|
@ -42,201 +42,202 @@ function r(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=reso
|
|||
typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function ta(a,b){var c,d={K:null,X:null,fa:null,ea:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.fa=g.load;d.ea=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,
|
||||
d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.X=g.symbols;d.K.length?1==d.K.length&&(t(d.K[0]),d=null):(t("Empty resource: "+a),d=null)}catch(k){t("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){t("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d}
|
||||
function ua(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}
|
||||
function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ca={init:[],show:[],exit:[]},Da=!1,Ea=!1,Fa=!0;
|
||||
function Ga(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ha(a){Ca.init.push(a)}function Ia(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ja(a){!Fa&&a?(Fa=!0,Da&&Ka("init"),Ea&&Ka("show")):Fa=a}function Ka(a){Ca[a]&&Ia(Ca[a])}Ga("onload",function(){Da=!0;Ia(Ca.init)});Ga("onpageshow",function(){Ea=!0;Ia(Ca.show)});
|
||||
Ga(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ia(Ca.exit)});function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Lb=b.comment;this.kc=b;b=this.id.indexOf(".");0>b?this.wa=this.id:(this.na=this.id.substr(0,b),this.wa=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Fa:!1,qb:!1,O:!1,error:!1};this.kb=null;this.l.error=!1;this.o={};this.D=null;x.push(this)}var La=void 0,Ma={};
|
||||
if(window){La||(La=window.location.search.substr(1));for(var Na,Oa=/\+/g,Pa=/([^&=]+)=?([^&]*)/g;Na=Pa.exec(La);)Ma[decodeURIComponent(Na[1].replace(Oa," "))]=decodeURIComponent(Na[2].replace(Oa," "))}function Qa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function y(a,b){b||(b=v);a.prototype=Qa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ra=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else Ra={},x=[];function Sa(a,b,c){Ra[a]&&b&&(Ra[a][b]=c)}function z(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<x.length;b++){var d=x[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function Ta(a){if(void 0!==a){var b;for(b=0;b<x.length;b++)if(x[b].id===a)return x[b]}return null}function Ua(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<x.length;d++)if(c)c==x[d]&&(c=null);else if(!(a!=x[d].type||b&&x[d].id.indexOf(b)))return x[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
||||
function B(a,b){b=C(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.$(g.type,g.binding,f,g.value),l=k.length}}}}
|
||||
function C(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},$:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Va=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.G=function(a){this.T(a,this.wa)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.wa+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.l.O=!0},ja:function(a,b){b&&(this.l.O=!1);return!0}};function Va(a,b){a.l.qb?(a.l.Fa=!1,a.l.qb=!1):a.l.error?a.T(a.toString()+" error"):a.l.Fa=b}function D(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.kb,a.kb=null,b&&b()))}
|
||||
function Wa(a,b){b&&(a.l.ready?b():a.kb=b);return a.l.ready}function Xa(a,b){a.l.error=!0;a.G(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ya="undefined"!==typeof ArrayBuffer;
|
||||
function Za(a){v.call(this,"Panel",a,Za);this.b=this.i=this.f=this.w=this.s=0;this.A=this.C=this.v=!1;this.F=$a;this.m={};this.c={START:[1,!0,!1,this.rc],STEP:[1,!1,!1,this.sc],ENABLE:[1,!1,!1,this.nc],CONT:[1,!0,!1,this.lc],DEP:[0,!0,!1,this.mc],EXAM:[1,!0,!1,this.oc],LOAD:[1,!0,!1,this.qc],TEST:[0,!0,!1,this.pc]};for(a=0;22>a;a++)this.c["S"+a]=[0,!1,!1,this.tc,a]}y(Za);var $a=7;function ab(a,b){return a.c[b]&&a.c[b][0]}h=Za.prototype;h.reset=function(){this.stop()};
|
||||
h.$=function(a,b,c,d){if(this.j&&this.j.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.m[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.c[b]&&(this.c[b]=[d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c=a.c[b];bb(a,
|
||||
b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.c[b];c[1]&&c[2]&&(bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0};
|
||||
function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.m)ib(a,c,null!=b?b:a.m[c])}function bb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.c)bb(a,b,a.c[b][0])}function jb(a,b,c,d){a.o[b]&&(void 0===c&&(Xa(a,"Value for "+b+" is invalid"),F(a.a)),c=8==(a.D&&a.D.g||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
|
||||
h.rc=function(a){a||this.a.l.U||(this.g.reset(),kb(this.a),ab(this,"ENABLE")&&lb(this.a))};h.sc=function(){};h.nc=function(a){a||F(this.a)};h.lc=function(a){if(!a&&!this.a.l.U)if(ab(this,"ENABLE"))lb(this.a);else{a=this.D;var b;if(b=a)a.l.Fa&&(a.l.qb=!0),b=!a.l.Fa;if(b)Va(a,!0),a.nb(0),Va(a,!1);else try{var c=this.a.nb(1);0<c&&(mb(this.a,c),nb(this.a,c,!0),ob(this.a,c))}catch(d){"number"!=typeof d&&Xa(this.a,d.stack||d.message)}this.stop();this.j&&this.j.va()}};
|
||||
h.mc=function(a){a&&!this.a.l.U&&(this.A&&pb(this),a=qb(this,this.f),this.F==$a?this.g.mb(this.b,a):this.a.mb(this.b,a))};h.oc=function(a){a||this.a.l.U||(this.C&&pb(this),a=this.F==$a?this.g.lb(this.b):this.a.lb(this.b),qb(this,a))};h.qc=function(a){a||this.a.l.U||(this.b=this.f&this.g.ia,rb(this,"A",this.b,22))};h.pc=function(a){if(a)this.v=!0,fb(this,!0);else if(this.v=!1,fb(this),void 0!==this.o.S0){for(a=this.f=0;22>a;a++)this.c["S"+a][0]=0&1<<a?1:0;gb(this)}};
|
||||
h.tc=function(a,b){this.f=a?this.f|1<<b:this.f&~(1<<b)};function pb(a){var b=1145>a.a.Wa?8:16,c=65472<=a.b&&a.b<65472+b,b=c?1:2,c=c?15:a.g.ia;ab(a,"STEP")||(b=-b);a.b=a.b&~c|a.b+b&c;rb(a,"A",a.b,22)}function qb(a,b){a.i=b&65535;rb(a,"D",a.i,16);return a.i}function sb(a,b,c){a.m[b]=c;a.v||ib(a,b,c)}function rb(a,b,c,d){for(var e=0;e<d;e++)sb(a,b+e,c&1<<e)}h.stop=function(){this.b=this.a.h[7]&this.g.ia;rb(this,"A",this.b,22)};h.uc=function(a){return(a?this.f:this.i)&65535};h.pd=function(a){this.i=a};
|
||||
var tb={},db=(tb[65400]=[null,null,Za.prototype.uc,Za.prototype.pd,"CNSW"],tb);function hb(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Ta(e.id);f||(a=!0,f=new Za(e));B(f,d);a&&D(f)}}Ha(hb);
|
||||
function ub(a,b,c){v.call(this,"Bus",a,ub);this.a=b;this.D=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.ia=this.C-1;this.b=G;this.c=Math.log2(this.b);this.F=this.b>>2;this.j=this.b-1;this.A=this.C/this.b|0;this.ya=[];this.f=0;this.m=!1;this.gb=0;this.w=[];this.bc=[vb,wb,xb,yb];a=new H(this);zb(a,this.D);this.g=Array(this.A);for(b=0;b<this.A;b++)this.g[b]=a;D(this)}y(ub);var G=8192,Ab=G-1;
|
||||
function vb(a,b){var c=-1,d=this.controller,e=d.ya[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.ya[a&-2])&&e[2]&&(c=e[2](f&-2)>>8);if(0<=c)return c;I(d,b,16);return 255}function wb(a,b,c){var d=!1,e=this.controller,f=e.ya[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.ya[a&-2])&&f[3]&&(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0);d||I(e,c,16)}
|
||||
function xb(a,b){var c=-1,d=this.controller;a=d.ya[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535}function yb(a,b,c){var d=!1,e=this.controller;a=e.ya[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Bb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-G,Cb(a,c,G,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.ia=c-1,c-=G,a.v=Db(a,c,G),a.i?Cb(a,c,G,a.i):(Eb(a,c,G,Fb,a),a.i=Db(a,c,G)))}}h=ub.prototype;
|
||||
h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Bb(this,16)};h.ka=function(a,b){b||this.reset();return!0};
|
||||
function Eb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.g.length;){var l=a.g[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.ob+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.ob){p=l.size-(f-n);p>g&&(p=g);l.ob=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Gb(1,f,g)}f=new H(a,f,p,a.b,d,e);zb(f,a.D,l);a.g[k++]=f;f=n+a.b;g-=p}return 0>=g?(d!=Hb||a.gb||(a.gb+=c),a.status((c>>10)+"Kb "+Ib[d]+" at "+ka(b)),!0):Gb(2,b,c)}
|
||||
function Db(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.g.length;)d.push(a.g[b++]),c-=a.b;return d}function Cb(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.g.length;){var f=d[e++];if(!f)break;a.g[b++]=f;c-=a.b}}function Jb(a,b){3932160<=b&&(b=Kb(a.a,b));return a.g[(b&a.ia)>>>a.c].yb(b&a.j,b)}function Lb(a,b){3932160<=b&&(b=Kb(a.a,b));return a.g[(b&a.ia)>>>a.c].W(b&a.j,b)}h.lb=function(a){3932160<=a&&(a=Kb(this.a,a));var b=a&this.j,c=(a&this.ia)>>>this.c;this.m=!1;this.f++;a=this.g[c].Tb(b,a);this.f--;return a};
|
||||
h.Ya=function(a,b){3932160<=a&&(a=Kb(this.a,a));this.m=!1;this.f++;this.g[(a&this.ia)>>>this.c].Fb(a&this.j,b&255,a);this.f--};function Mb(a,b,c){3932160<=b&&(b=Kb(a.a,b));a.g[(b&a.ia)>>>a.c].pb(b&a.j,c&65535,b)}h.mb=function(a,b){3932160<=a&&(a=Kb(this.a,a));var c=a&this.j,d=(a&this.ia)>>>this.c;this.m=!1;this.f++;this.g[d].$b(c,b&65535,a);this.f--};
|
||||
function Nb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.g[d];if(e.ta||e.gc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Ob(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Ab;if(void 0!==a.ya[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.ya[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
|
||||
function cb(a,b,c,d,e){for(var f in c){var g=+f,k=c[f];if(!(k[6]&&k[6]>a.a.Wa)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var E=k[4],V=0;V<w;V++,g+=2)if(E&&1<w&&(E=k[4]+V),!Ob(a,g,g,l,n,p,u,d||64,E||e))return!1}}return!0}function eb(a,b){a.w.push(b)}
|
||||
function I(a,b,c){a.m=!0;a.f||(c&&(a.a.M|=c),J(a.a,4,b))}function Pb(a){var b=a.m;a.m=!1;return b}function Gb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function K(a){v.call(this,"Device",a,K);this.b={L:0,Db:-1}}y(K);h=K.prototype;h.ha=function(a,b,c,d){this.g=b;this.j=a;this.a=c;this.D=d;var e=this;this.b.Db=Qb(c,function(){e.b.Aa|=128;e.b.Aa&64&&(Rb(e.a,e.b.nd),Sb(e.a,e.b.Db,1E3/60));e.j&&e.j.va(1)});this.b.nd=Tb(64,6);cb(b,this,L);eb(b,this.reset.bind(this));D(this)};
|
||||
h.reset=function(){this.b.Aa=0};h.Cc=function(){var a=this.b.Aa;this.b.Aa&=-129;return a};h.xd=function(a){this.b.Aa=a;a&64&&Sb(this.a,this.b.Db,1E3/60);this.b.Aa=a&-129};h.Ec=function(){var a=this.a;return a.w&62337|a.ab<<5|a.bb<<1};h.zd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.ab=a>>5&3;b.bb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Ub(b))}};h.Fc=function(){var a=this.a.Ca;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Gc=function(){return this.a.Ab};h.Hc=function(){return this.a.Ga};
|
||||
h.Ad=function(a){var b=this.a;1170>b.Wa&&(a&=-49);b.Ga!=a&&(b.Ga=a,b.Nb=a&16?4194303:262143,Ub(b))};h.hd=function(a){a=a>>1&63;var b=this.a.Za[a>>1];return a&1?b>>16:b&65535};h.ae=function(a,b){b=b>>1&63;var c=b>>1;this.a.Za[c]=b&1?this.a.Za[c]&65535|(a&63)<<16:this.a.Za[c]&-65536|a&65534};h.ad=function(a){return this.a.H[1][a>>1&7]};h.Ud=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Zc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Sd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};
|
||||
function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va}
|
||||
function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ba={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0;
|
||||
function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){Ba.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){Ba[a]&&Ha(Ba[a])}Fa("onload",function(){Ca=!0;Ha(Ba.init)});Fa("onpageshow",function(){Da=!0;Ha(Ba.show)});
|
||||
Fa(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ha(Ba.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Lb=b.comment;this.kc=b;b=this.id.indexOf(".");0>b?this.wa=this.id:(this.na=this.id.substr(0,b),this.wa=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Fa:!1,qb:!1,O:!1,error:!1};this.kb=null;this.l.error=!1;this.o={};this.D=null;y.push(this)}var Ka=void 0,La={};
|
||||
if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
||||
function z(a,b){b||(b=x);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},y=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function Sa(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
||||
function C(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.$(g.type,g.binding,f,g.value),l=k.length}}}}
|
||||
function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},$:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Va=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.G=function(a){this.T(a,this.wa)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.wa+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.l.O=!0},ja:function(a,b){b&&(this.l.O=!1);return!0}};function Ua(a,b){a.l.qb?(a.l.Fa=!1,a.l.qb=!1):a.l.error?a.T(a.toString()+" error"):a.l.Fa=b}function F(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.kb,a.kb=null,b&&b()))}
|
||||
function Va(a,b){b&&(a.l.ready?b():a.kb=b);return a.l.ready}function Wa(a,b){a.l.error=!0;a.G(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Xa="undefined"!==typeof ArrayBuffer;
|
||||
function Ya(a){x.call(this,"Panel",a,Ya);this.b=this.i=this.f=this.w=this.s=0;this.A=this.C=this.v=!1;this.F=Za;this.m={};this.c={START:[1,1,!0,!1,this.rc],STEP:[1,1,!1,!1,this.sc],ENABLE:[1,1,!1,!1,this.nc],CONT:[1,1,!0,!1,this.lc],DEP:[0,0,!0,!1,this.mc],EXAM:[1,1,!0,!1,this.oc],LOAD:[1,1,!0,!1,this.qc],TEST:[0,0,!0,!1,this.pc]};for(a=0;22>a;a++)this.c["S"+a]=[0,0,!1,!1,this.tc,a]}z(Ya);var Za=7;function $a(a,b){return a.c[b]&&a.c[b][1]}h=Ya.prototype;h.reset=function(){this.stop()};
|
||||
h.$=function(a,b,c,d){if(this.j&&this.j.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.m[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.c[b]&&(this.c[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this,
|
||||
b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0};
|
||||
function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.m)ib(a,c,null!=b?b:a.m[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.c)jb(a,b,a.c[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.D&&a.D.g||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
|
||||
function ab(a,b){var c=a.c[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function bb(a,b){var c=a.c[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.rc=function(a){a||this.a.l.U||(this.g.reset(),lb(this.a),$a(this,"ENABLE")&&mb(this.a))};h.sc=function(){};h.nc=function(a){a||G(this.a)};
|
||||
h.lc=function(a){if(!a&&!this.a.l.U)if($a(this,"ENABLE"))mb(this.a);else{a=this.D;var b;if(b=a)a.l.Fa&&(a.l.qb=!0),b=!a.l.Fa;if(b)Ua(a,!0),a.nb(0),Ua(a,!1);else try{var c=this.a.nb(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.j&&this.j.va()}};h.mc=function(a){a&&!this.a.l.U&&(this.A&&qb(this),a=rb(this,this.f),this.F==Za?this.g.mb(this.b,a):this.a.mb(this.b,a))};
|
||||
h.oc=function(a){a||this.a.l.U||(this.C&&qb(this),a=this.F==Za?this.g.lb(this.b):this.a.lb(this.b),rb(this,a))};h.qc=function(a){a||this.a.l.U||(this.b=this.f&this.g.ia,sb(this,"A",this.b,22))};h.pc=function(a){if(a)this.v=!0,fb(this,!0);else if(this.v=!1,fb(this),void 0!==this.o.S0){for(a=this.f=0;22>a;a++)this.c["S"+a][1]=0&1<<a?1:0;gb(this)}};h.tc=function(a,b){this.f=a?this.f|1<<b:this.f&~(1<<b)};
|
||||
function qb(a){var b=1145>a.a.Wa?8:16,c=65472<=a.b&&a.b<65472+b,b=c?1:2,c=c?15:a.g.ia;$a(a,"STEP")||(b=-b);a.b=a.b&~c|a.b+b&c;sb(a,"A",a.b,22)}function rb(a,b){a.i=b&65535;sb(a,"D",a.i,16);return a.i}function tb(a,b,c){a.m[b]=c;a.v||ib(a,b,c)}function sb(a,b,c,d){for(var e=0;e<d;e++)tb(a,b+e,c&1<<e)}h.stop=function(){this.b=this.a.h[7]&this.g.ia;sb(this,"A",this.b,22)};h.uc=function(a){return(a?this.f:this.i)&65535};h.pd=function(a){this.i=a};
|
||||
var ub={},db=(ub[65400]=[null,null,Ya.prototype.uc,Ya.prototype.pd,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));C(f,d);a&&F(f)}}Ga(hb);
|
||||
function vb(a,b,c){x.call(this,"Bus",a,vb);this.a=b;this.D=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.ia=this.C-1;this.b=H;this.c=Math.log2(this.b);this.F=this.b>>2;this.j=this.b-1;this.A=this.C/this.b|0;this.ya=[];this.f=0;this.m=!1;this.gb=0;this.w=[];this.bc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.g=Array(this.A);for(b=0;b<this.A;b++)this.g[b]=a;F(this)}z(vb);var H=8192,Bb=H-1;
|
||||
function wb(a,b){var c=-1,d=this.controller,e=d.ya[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.ya[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
|
||||
function xb(a,b,c){var d=!1,e=this.controller,f=e.ya[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else if(g&1&&(f=e.ya[a&-2]))if(f[3])g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0;else if(f[1])f[1](b,g);d||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.ya[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
|
||||
function zb(a,b,c){var d=!1,e=this.controller;a=e.ya[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.ia=c-1,c-=H,a.v=Eb(a,c,H),a.i?Db(a,c,H,a.i):(Fb(a,c,H,Gb,a),a.i=Eb(a,c,H)))}}h=vb.prototype;h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Cb(this,16)};h.ka=function(a,b){b||this.reset();return!0};
|
||||
function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.g.length;){var l=a.g[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.ob+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.ob){p=l.size-(f-n);p>g&&(p=g);l.ob=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.g[k++]=f;f=n+a.b;g-=p}return 0>=g?(d!=Ib||a.gb||(a.gb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
|
||||
function Eb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.g.length;)d.push(a.g[b++]),c-=a.b;return d}function Db(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.g.length;){var f=d[e++];if(!f)break;a.g[b++]=f;c-=a.b}}function Kb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.g[(b&a.ia)>>>a.c].yb(b&a.j,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.g[(b&a.ia)>>>a.c].W(b&a.j,b)}h.lb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.j,c=(a&this.ia)>>>this.c;this.m=!1;this.f++;a=this.g[c].Tb(b,a);this.f--;return a};
|
||||
h.Ya=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.f++;this.g[(a&this.ia)>>>this.c].Fb(a&this.j,b&255,a);this.f--};function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.g[(b&a.ia)>>>a.c].pb(b&a.j,c&65535,b)}h.mb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.j,d=(a&this.ia)>>>this.c;this.m=!1;this.f++;this.g[d].$b(c,b&65535,a);this.f--};
|
||||
function Ob(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.g[d];if(e.ta||e.gc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Pb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.ya[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.ya[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
|
||||
function cb(a,b,c,d,e){for(var f in c){var g=+f,k=c[f];if(!(k[6]&&k[6]>a.a.Wa)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U<w;U++,g+=2)if(D&&1<w&&(D=k[4]+U),!Pb(a,g,g,l,n,p,u,d||64,D||e))return!1}}return!0}function eb(a,b){a.w.push(b)}
|
||||
function J(a,b,c){a.m=!0;a.f||(c&&(a.a.M|=c),K(a.a,4,b))}function Qb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Db:-1}}z(L);h=L.prototype;h.ha=function(a,b,c,d){this.g=b;this.j=a;this.a=c;this.D=d;var e=this;this.b.Db=Rb(c,function(){e.b.Aa|=128;e.b.Aa&64&&(Sb(e.a,e.b.nd),Tb(e.a,e.b.Db,1E3/60));e.j&&e.j.va(1)});this.b.nd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
|
||||
h.reset=function(){this.b.Aa=0};h.Cc=function(){var a=this.b.Aa;this.b.Aa&=-129;return a};h.xd=function(a){this.b.Aa=a;a&64&&Tb(this.a,this.b.Db,1E3/60);this.b.Aa=a&-129};h.Ec=function(){var a=this.a;return a.w&62337|a.ab<<5|a.bb<<1};h.zd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.ab=a>>5&3;b.bb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Xb(b))}};h.Fc=function(){var a=this.a.Ca;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Gc=function(){return this.a.Ab};h.Hc=function(){return this.a.Ga};
|
||||
h.Ad=function(a){var b=this.a;1170>b.Wa&&(a&=-49);b.Ga!=a&&(b.Ga=a,b.Nb=a&16?4194303:262143,Xb(b))};h.hd=function(a){a=a>>1&63;var b=this.a.Za[a>>1];return a&1?b>>16:b&65535};h.ae=function(a,b){b=b>>1&63;var c=b>>1;this.a.Za[c]=b&1?this.a.Za[c]&65535|(a&63)<<16:this.a.Za[c]&-65536|a&65534};h.ad=function(a){return this.a.H[1][a>>1&7]};h.Ud=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Zc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Sd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};
|
||||
h.$c=function(a){return this.a.Y[1][a>>1&7]};h.Td=function(a,b){b=b>>1&7;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Yc=function(a){return this.a.Y[1][(a>>1&7)+8]};h.Rd=function(a,b){b=(b>>1&7)+8;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Bc=function(a){return this.a.H[0][a>>1&7]};h.wd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.zc=function(a){return this.a.H[0][(a>>1&7)+8]};h.ud=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Ac=function(a){return this.a.Y[0][a>>1&7]};
|
||||
h.vd=function(a,b){b=b>>1&7;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.yc=function(a){return this.a.Y[0][(a>>1&7)+8]};h.td=function(a,b){b=(b>>1&7)+8;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.gd=function(a){return this.a.H[3][a>>1&7]};h.$d=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.ed=function(a){return this.a.H[3][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.fd=function(a){return this.a.Y[3][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.Y[3][b]=a;this.a.H[3][b]&=65295};
|
||||
h.dd=function(a){return this.a.Y[3][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.Y[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.B&2048?this.a.Ha[a]:this.a.h[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.Ha[b]=a:this.a.h[b]=a};h.Mc=function(){return this.a.B&49152?this.a.ma[0]:this.a.h[6]};h.Fd=function(a){this.a.B&49152?this.a.ma[0]=a:this.a.h[6]=a};h.Pc=function(){return this.a.h[7]};h.Id=function(a){this.a.h[7]=a};
|
||||
h.Na=function(a){a&=7;return this.a.B&2048?this.a.h[a]:this.a.Ha[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.h[b]=a:this.a.Ha[b]=a};h.Nc=function(){return 1==(this.a.B&49152)>>14?this.a.h[6]:this.a.ma[1]};h.Gd=function(a){1==(this.a.B&49152)>>14?this.a.h[6]=a:this.a.ma[1]=a};h.Oc=function(){return 3==(this.a.B&49152)>>14?this.a.h[6]:this.a.ma[3]};h.Hd=function(a){3==(this.a.B&49152)>>14?this.a.h[6]=a:this.a.ma[3]=a};h.wc=function(a){return this.a.Wb[a-65504>>1]};
|
||||
h.rd=function(a,b){this.a.Wb[b-65504>>1]=a};h.Sb=function(a){if(65520==a){a=0;switch(Hb){case Hb:a=this.g.gb}a=(a>>6)-1}else a=0;return a};h.Zb=function(){};h.cd=function(){return 1};h.Wd=function(){};h.vc=function(){return this.a.M};h.qd=function(){this.a.M=0};h.Dc=function(){return this.a.Vb};h.yd=function(a,b){b&1||(a&=255);this.a.Vb=a};h.Ic=function(a){return a?this.a.Bb:0};h.Bd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Bb=a;b.u|=2};
|
||||
h.bd=function(a){return a?this.a.Da&65280:0};h.Vd=function(a){this.a.Da=a|255};h.Lc=function(){return Wb(this.a)};h.Ed=function(a){Xb(this.a,a&-1809|Wb(this.a)&1808);this.a.u|=128};h.Yb=function(){};
|
||||
var M={},L=(M[61568]=[null,null,K.prototype.hd,K.prototype.ae,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.ad,K.prototype.Ud,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Zc,K.prototype.Sd,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.$c,K.prototype.Td,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Yc,K.prototype.Rd,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.Bc,K.prototype.wd,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.zc,K.prototype.ud,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.Ac,
|
||||
K.prototype.vd,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.yc,K.prototype.td,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.Hc,K.prototype.Ad,"MMR3",1,1145],M[65382]=[null,null,K.prototype.Cc,K.prototype.xd,"LKS"],M[65402]=[null,null,K.prototype.Ec,K.prototype.zd,"MMR0",1,1145],M[65404]=[null,null,K.prototype.Fc,K.prototype.Yb,"MMR1",1,1145],M[65406]=[null,null,K.prototype.Gc,K.prototype.Yb,"MMR2",1,1145],M[65408]=[null,null,K.prototype.gd,K.prototype.$d,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.ed,
|
||||
K.prototype.Yd,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.fd,K.prototype.Zd,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.dd,K.prototype.Xd,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Ma,K.prototype.Oa,"R0SET0"],M[65473]=[null,null,K.prototype.Ma,K.prototype.Oa,"R1SET0"],M[65474]=[null,null,K.prototype.Ma,K.prototype.Oa,"R2SET0"],M[65475]=[null,null,K.prototype.Ma,K.prototype.Oa,"R3SET0"],M[65476]=[null,null,K.prototype.Ma,K.prototype.Oa,"R4SET0"],M[65477]=[null,null,K.prototype.Ma,K.prototype.Oa,
|
||||
"R5SET0"],M[65478]=[null,null,K.prototype.Mc,K.prototype.Fd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Pc,K.prototype.Id,"R7KERNEL"],M[65480]=[null,null,K.prototype.Na,K.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Na,K.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Na,K.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Na,K.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Na,K.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Na,
|
||||
K.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Nc,K.prototype.Gd,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Oc,K.prototype.Hd,"R6USER",1,1145],M[65504]=[null,null,K.prototype.wc,K.prototype.rd,"CTRL",1,1170],M[65520]=[null,null,K.prototype.Sb,K.prototype.Zb,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Sb,K.prototype.Zb,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.cd,K.prototype.Wd,"SYSID",1,1170],M[65526]=[null,null,K.prototype.vc,K.prototype.qd,"CPUERR",1,1170],M[65528]=
|
||||
[null,null,K.prototype.Dc,K.prototype.yd,"MB",1,1170],M[65530]=[null,null,K.prototype.Ic,K.prototype.Bd,"PIR"],M[65532]=[null,null,K.prototype.bd,K.prototype.Vd,"SL"],M[65534]=[null,null,K.prototype.Lc,K.prototype.Ed,"PSW"],M);L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];
|
||||
Ha(function(){for(var a=C(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Yb(c);B(c,d);break;case "rl11":c=new N(c),B(c,d)}}});var Zb;if(Ya){var $b=new ArrayBuffer(2);(new DataView($b)).setUint16(0,256,!0);Zb=256===(new Uint16Array($b))[0]}else Zb=!1;var ac=Zb;
|
||||
function H(a,b,c,d,e,f){this.g=a;this.id=bc+=2;this.a=null;this.Ka=b;this.ob=c;this.size=d||0;this.type=e||cc;this.j=e==dc;this.controller=null;zb(this);this.ta=this.gc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],ec(this,f.bc);else if(Ya)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),ec(this,ac?fc:gc);else{a=this.a=Array(this.size>>
|
||||
2);for(f=0;f<a.length;f++)a[f]=0;ec(this,hc)}else ec(this)}var cc=0,Hb=1,dc=2,Fb=4,Ib=["NONE","RAM","ROM","VID","H/W"],bc=0;
|
||||
H.prototype={constructor:H,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ya)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ya)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.ta=!0}return!1},v:function(a,b){I(this.g,b,32);return 255},f:function(a,b,c){I(this.g,c,32)},w:function(a,b){return this.yb(a++,b++)|
|
||||
this.yb(a,b)<<8},A:function(a,b,c){this.Eb(a++,b&255,c++);this.Eb(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},na:function(a,b){a&1&&I(this.g,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ta=!0},xa:function(a,b,c){a&1&&I(this.g,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
|
||||
b>>8);this.ta=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Tb(a,b)},oa:function(a,b,c){this.j?this.f(a,b,c):this.Fb(a,b,c)},sa:function(a,b,c){this.j?this.f(a,b,c):this.$b(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},P:function(a,b){a&1&&I(this.g,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&I(this.g,b,64);return this.s[a>>1]},da:function(a,b){this.o[a]=b;this.ta=!0},pa:function(a,b){this.o[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&I(this.g,
|
||||
c,64);this.c.setUint16(a,b,!0);this.ta=!0},wa:function(a,b,c){a&1&&I(this.g,c,64);this.s[a>>1]=b;this.ta=!0}};function zb(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&ic(a,kc,!1),(a.m=c.m)&&lc(a,kc,!1))}function lc(a,b,c){c&&a.m||(a.Eb=!a.j&&b[1]||a.f,a.pb=!a.j&&b[3]||a.A);if(c||void 0===c)a.Fb=b[1]||a.f,a.$b=b[3]||a.A}function ic(a,b,c){c&&a.i||(a.yb=b[0]||a.v,a.W=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Tb=b[2]||a.w}function ec(a,b){b||(b=mc);ic(a,b,void 0);lc(a,b,void 0)}
|
||||
var mc=[],hc=[H.prototype.N,H.prototype.qa,H.prototype.na,H.prototype.xa],kc=[H.prototype.F,H.prototype.oa,H.prototype.R,H.prototype.sa];if(Ya)var gc=[H.prototype.C,H.prototype.da,H.prototype.P,H.prototype.ra],fc=[H.prototype.J,H.prototype.pa,H.prototype.aa,H.prototype.wa];
|
||||
function nc(a,b){v.call(this,"CPU",a,nc);var c=a.multiplier||1;this.fb=a.cycles||b;this.qa=c;this.vb=Math.round(this.fb/1E4)/100;this.xa=this.vb*this.qa;this.l.U=!1;this.l.Cb=!1;this.l.Ua=a.autoStart;this.l.hb=!1;this.cb=this.Ia=0;this.eb=a.csStart;this.Qa=a.csInterval;this.Ra=a.csStop;this.I=[];this.Qb=this.md.bind(this);D(this)}y(nc);var oc=["power","reset"];h=nc.prototype;
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.D=d;for(b=0;b<oc.length;b++)(c=this.o[oc[b]])&&this.j.$(null,oc[b],c);a=pc(a,"autoStart");null!=a&&(this.l.Ua="true"==a?!0:"false"==a?!1:!!a);D(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){qc(this);if(!this.restore(a))return!1;rc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0};
|
||||
h.Ua=function(){return this.l.Ua||void 0===this.o.run?(lb(this),!0):!1};h.Jb=function(){return 0};function rc(a){void 0===a.eb&&(a.eb=0);void 0===a.Qa&&(a.Qa=-1);void 0===a.Ra&&(a.Ra=-1);a.l.hb=0<=a.eb&&0<a.Qa;a.l.hb&&(a.cb=0,a.Ia=a.eb-a.sa)}function ob(a,b){if(a.l.hb){var c=!1;a.cb=a.cb+a.Jb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=sc(a)&&(a.Qa=a.Ra=-1,rc(a),F(a),c=!0);c&&a.T(sc(a)+" cycles: checksum="+m(a.cb))}}
|
||||
h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.j)if(a=d.j,a.l.O)a=!0;else{var b=null,c,k=z(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.l.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.l.O);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.kb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.U?F(d):lb(d))},!0;case "speed":return this.o[b]=
|
||||
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){tc(d,d.qa<<1,!0)},c.textContent=this.xa.toFixed(2)+"Mhz",!0}return!1};h.va=function(a){this.j&&this.j.va(a)};function nb(a,b,c){a.sa+=b;c&&(a.pa=a.a=a.F=0)}function uc(a,b){var c=1;b&&1<a.qa&&a.da&&(c=a.da/a.vb);a.Ob=Math.round(1E3/30);a.ib=Math.floor(a.fb/30*c);b||(a.Sa=a.ib);a.wb=0}function sc(a){return a.sa+a.aa+a.pa-a.a}function qc(a){a.da=0;a.Pb=0;a.sa=a.aa=a.pa=a.a=a.F=0;rc(a);tc(a,1)}
|
||||
function tc(a,b,c){if(void 0!==b){.8>a.da/a.xa&&(b=1);a.qa=b;b=a.vb*a.qa;if(a.xa!=b){a.xa=b;b=a.xa.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.j&&vc(a.j)}nb(a,a.aa);a.aa=0;a.R=ra();a.oa=0;uc(a)}function Qb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Sb(a,b,c){0<=b&&b<a.I.length&&0>a.I[b][0]&&(c=a.fb*a.qa/1E3*c|0,a.I[b][0]=c+wc(a))}function mb(a,b){for(var c=a.I.length-1;0<=c;c--){var d=a.I[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}
|
||||
function wc(a,b){var c=a.pa-=a.a;a.a=a.F=0;b&&(a.pa=0);return c}
|
||||
h.md=function(){if(this.l.U){this.wb>=this.fb&&uc(this,!0);this.Ta=0;this.$a=ra();if(this.oa){var a=this.$a-this.oa;a>this.Ob&&(this.R+=a,this.R>this.$a&&(this.R=this.$a))}try{do{for(var b,c=this.l.hb?1:this.ib,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.nb(b)}catch(f){if("number"!=typeof f)throw f;}b=wc(this,!0);this.Ta+=b;this.aa+=b;ob(this,b);mb(this,b);this.Sa-=b;if(0>=this.Sa){this.Sa+=this.ib;15<=++this.Pb&&(this.va(),this.Pb=0);break}}while(this.l.U)}catch(f){F(this);
|
||||
this.j&&this.j.stop(ra(),sc(this));Xa(this,f.stack||f.message);return}if(this.l.U){a=setTimeout;b=this.Qb;this.oa=ra();c=this.Ob;this.Ta&&(c=Math.round(c*this.Ta/this.ib));c-=this.oa-this.$a;if(d=this.oa-this.R)this.da=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.sa=0,tc(this));if(0>c||this.da<this.xa)-1E3>c&&(this.R-=c),c=0;this.wb+=this.Ta;this.oa+=c;a(b,c)}}};
|
||||
function lb(a){var b;a.l.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.U)a.T(a.toString()+" busy");else{tc(a);a.l.U=!0;a.l.Cb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.R,sc(a));setTimeout(a.Qb,0)}}h.nb=function(){return 0};function F(a){var b=!1;if(a.l.U){wc(a);nb(a,a.aa);a.aa=0;a.l.U=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),sc(a));b=!0}a.l.complete=void 0;return b}
|
||||
function xc(a){this.Wa=+a.model||1170;this.Kb=a.addrReset||0;nc.call(this,a,6666667);this.decode=1120==this.Wa?yc.bind(this):zc.bind(this);Ac(this);this.ra=0;this.N=null;this.l.complete=!1}y(xc,nc);h=xc.prototype;h.reset=function(){this.status("model "+this.Wa);this.l.U&&F(this);Ac(this);qc(this);this.l.error=!1;this.parent.reset.call(this)};
|
||||
function Ac(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.B=15;a.h=[0,0,0,0,0,0,0,a.Kb];a.Ha=[0,0,0,0,0,0];a.ma=[0,0,0,0];a.v=0;a.bb=0;a.jc=[4,2,0,1];a.H=[[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.Y=[[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.Za=[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.Wb=[0,0,0,0,0,0,0,0];a.Vb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.rb=0;a.Ja=-1;kb(a)}function kb(a){a.Da=255;a.M=0;a.Bb=0;a.w=0;a.Ca=0;a.Ab=0;a.Ga=0;a.Ba=0;a.ab=0;a.Nb=262143;a.N=null;a.g&&Ub(a)}function Ub(a){a.Ba?(a.P=65536,a.J=a.ic,a.W=a.jd,a.pb=a.be,Bb(a.g,a.Ga&16?22:18)):(a.P=0,a.J=a.hc,a.W=a.Ub,a.pb=a.ac,Bb(a.g,16))}function Bc(a,b,c){a.Kb=b;O(a,b);!c&&a.D&&(F(a)||a.D.c())}h.Jb=function(){return 0};
|
||||
h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.sa,this.qa]);a.set(2,Nb(this.g));return a.data()};h.restore=function(a){var b=a[1];this.sa=b[1];tc(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,g=Array(b.F),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.g[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Q(a){return a.m&65536?1:0}
|
||||
h.za=function(){return this.s&32768?8:0};function Cc(a){var b=a.h[7];a.w&57344||(a.Ca=0,a.Ab=b);a.h[7]=b+2&65535;return a.W(b)}function Dc(a,b){var c=a.h[7];a.h[7]=c+b&65535;return c}function O(a,b){a.h[7]=b&65535}function Tb(a,b){return{od:a,La:b,next:null}}function Rb(a,b){if(b!=a.N){var c=a.N;if(!c||c.La<=b.La)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function Wb(a){return a.B=a.B&63728|a.za()|(a.i&65535?0:4)|(a.f&32768?2:0)|Q(a)}
|
||||
function Xb(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ha.length;0<=--c;){var d=a.h[c];a.h[c]=a.Ha[c];a.Ha[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.ma[c]=a.h[6],a.h[6]=a.ma[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function Ec(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Fc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Gc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Hc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))}
|
||||
function J(a,b,c){if(!a.ra){var d=!1;0>a.Ja?a.Ja=Wb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ca=63222,a.Ab=b);a.v=0;var e=a.W(b|a.P),f=a.W(b+2&65535|a.P);Xb(a,f&-12289|a.Ja>>2&12288);d&&(a.M|=4,a.h[6]=4);Ic(a,a.Ja);Ic(a,a.h[7]);O(a,e);a.u&=-113;a.Ja=-1;a.u|=8;if(26!=c)throw b;}}function Jc(a){var b=Kc(a),c=Kc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Xb(a,c);a.u&=-17}
|
||||
function Kb(a,b){var c=b>>13&31;31>c&&a.Ga&32&&(b=a.Za[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function Lc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ga&a.jc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[a.v][d]<<6)+(b&8191)&a.Nb;var g=0;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.H[a.v][d]=e;if(4194170!==f||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.w&57344||(a.w=a.w|g|a.ab<<5|a.bb<<1),
|
||||
b=!0),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.u|=32)),b&&J(a,168,16));return f}function Mc(a,b,c){b&1&&a.a--;a=a.g;c&=255;3932160<=b&&(b=Kb(a.a,b));a.g[(b&a.ia)>>>a.c].Eb(b&a.j,c&255,b)}function Kc(a){var b=a.W(a.h[6]|a.P);a.h[6]=a.h[6]+2&65535;return b}function Ic(a,b){var c=a.h[6]-2&65535;a.h[6]=c;a.w&57344||(a.Ca=a.Ca<<8|246);!a.v&&c<=a.Da&&4<c&&(c<=a.Da-32?(a.M|=4,a.h[6]=4,J(a,4,18)):(a.M|=8,a.u|=4));a.pb(c,b)}
|
||||
function Nc(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return J(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.h[6]<=a.Da||65534<=a.h[6])&&(a.h[6]<=a.Da-32||65534<=a.h[6]?(a.M|=4,a.h[6]=4,J(a,4,22)):(a.M|=8,a.u|=64)),a.a-=3,7===c?a.h[c]:a.h[c]|g;case 2:f=2;e=a.h[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.h[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.h[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.h[c]-2&65535;7!==c&&(e|=g);e=a.W(e)|g;a.a-=
|
||||
8;break;case 6:return e=a.W(Dc(a,2)),e=e+a.h[c]&65535|g,a.a-=6,e;case 7:return e=a.W(Dc(a,2)),e=e+a.h[c]&65535,e=a.W(e|a.P)|g,a.a-=10,e}a.h[c]=a.h[c]+f&65535;!g||a.w&57344||(a.Ca=a.Ca<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.h[6]<=a.Da||65534<=a.h[6])&&(a.h[6]<=a.Da-32?(a.M|=4,a.h[6]=4,J(a,4,24)):(a.M|=8,a.u|=64));return e}h.lb=function(a){if(!this.Ba)return this.g.lb(a);this.ra++;a=this.Ub(Lc(this,a,2));this.ra--;return a};
|
||||
h.Ya=function(a,b){this.Ba?(this.ra++,Mc(this,Lc(this,a,5),b),this.ra--):this.g.Ya(a,b)};h.mb=function(a,b){this.Ba?(this.ra++,this.ac(Lc(this,a,4),b),this.ra--):this.g.mb(a,b)};h.hc=function(a,b,c){return Nc(this,a,b,c)};h.ic=function(a,b,c){return Lc(this,Nc(this,a,b,c),c)};h.Ub=function(a){return Lb(this.g,a)};h.jd=function(a){return Lb(this.g,Lc(this,a,2))};h.ac=function(a,b){Mb(this.g,a,b&65535)};h.be=function(a,b){Mb(this.g,Lc(this,a,4),b)};
|
||||
function Oc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Nc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.P),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.h[d]:a.ma[a.B>>12&3];return c}function Pc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Nc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Lc(a,e|c&65536,4),a.v=a.B>>14&3,Mb(a.g,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.h[e]=d:a.ma[a.B>>12&3]=d}
|
||||
function Qc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=Jb(a.g,c)):a=a.h[c]&255;return a}function Rc(a,b){b>>=6;var c=a.C=b&7;return(b=a.A=(b&56)>>3)?Lb(a.g,a.J(b,c,2)):a.h[c]}function Sc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Nc(a,b,c,8)}function Tc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=Jb(a.g,c)):a=a.h[c]&255;return a}function Uc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Lb(a.g,a.J(b,c,2)):a.h[c]}
|
||||
function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.rb=a.J(b,e,7),Mc(a,e,d.call(a,c,Jb(a.g,e)))):a.h[e]=a.h[e]&65280|d.call(a,c,a.h[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),Mb(a.g,e,d.call(a,c,Lb(a.g,e)))):a.h[e]=d.call(a,c,a.h[e])}function Vc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Mc(a,a.J(b,e,5),c):a.h[e]=c?d&1?c<<24>>24&65535:a.h[e]&-256|c&255:a.h[e]&-256;return c}
|
||||
function Wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Mb(a.g,a.J(b,d,4),c):a.h[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.h[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
h.nb=function(a){this.l.complete=!0;var b=a?this.l.Cb?0:1:-1;this.l.Cb=!1;this.pa=this.a=a;do{if(this.u){this.u&112&&(this.u&32?J(this,168,28):this.u&64?J(this,4,30):this.u&16&&J(this,12,32),this.u&=-113);if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Bb&224)>>5,e=this.N&&this.N.La>d?this.N:null;e&&(c=e.od,d=e.La);d>(this.B&224)>>5?(this.u&4&&(Dc(this,2),this.u&=-5),J(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.N,e==a)this.N=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=
|
||||
d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break}this.u=this.u&7|this.B&16;this.decode(Cc(this))}while(0<this.a);return this.l.complete?this.pa-this.a:void 0===this.l.complete?0:-1};Ha(function(){for(var a=C(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new xc(d);B(d,c)}});function Xc(a,b){var c=b+a;Fc(this,c,a,b);return c&65535}function Yc(a,b){var c=b+a;Fc(this,c<<8,a<<8,b<<8);return c&255}function Zc(a,b){a=b<<1;Gc(this,a);return a&65535}
|
||||
function $c(a,b){a=b<<1;Gc(this,a<<8);return a&255}function ad(a,b){a=b&32768|b>>1|b<<16;Gc(this,a);return a&65535}function bd(a,b){a=b&2048|b>>1|b<<8;Gc(this,a<<8);return a&255}function cd(a,b){a=b&~a;R(this,a);return a}function dd(a,b){a=b&~a;R(this,a<<8);return a}function ed(a,b){a|=b;R(this,a);return a}function fd(a,b){a|=b;R(this,a<<8);return a}function gd(a,b){a=~b|65536;Ec(this,a);return a&65535}function hd(a,b){a=~b|256;Ec(this,a<<8);return a&255}
|
||||
function id(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function jd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.f=b&(b^c));return a&255}function kd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function ld(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function md(a,b){a=-b;Ec(this,a,a&b&32768);return a&65535}function nd(a,b){a=-b;Ec(this,a<<8,(a&b&128)<<8);return a&255}
|
||||
function od(a,b){a=b<<1|this.m>>16&1;Gc(this,a);return a&65535}function pd(a,b){a=b<<1|this.m>>16&1;Gc(this,a<<8);return a&255}function qd(a,b){a=(this.m&65536|b)>>1|b<<16;Gc(this,a);return a&65535}function rd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Gc(this,a<<8);return a&255}function sd(a,b){var c=b-a;Hc(this,c,a,b);return c&65535}function td(a,b){var c=b-a;Hc(this,c<<8,a<<8,b<<8);return c&255}function ud(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}
|
||||
function vd(a,b){a^=b;R(this,a);return a&65535}function wd(a){T(this,a,Rc(this,a),Xc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function xd(a){var b=Uc(this,a);a=a>>6&7;var c=this.h[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.h[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function yd(a){var b=Uc(this,a);a=a>>6&7;var c=this.h[a]<<16|this.h[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.h[a]=d>>16&65535;this.h[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function zd(a){U(this,a,!Q(this))}function Ad(a){U(this,a,Q(this))}
|
||||
function Bd(a){T(this,a,Rc(this,a),cd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Cd(a){S(this,a,Qc(this,a),dd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Dd(a){T(this,a,Rc(this,a),ed);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Ed(a){S(this,a,Qc(this,a),fd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function Fd(a){R(this,Rc(this,a)&Uc(this,a));this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Gd(a){R(this,(Qc(this,a)&Tc(this,a))<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Hd(a){U(this,a,this.i&65535?0:4)}function Id(a){U(this,a,!this.za()==!(this.f&32768))}function Jd(a){U(this,a,!!(this.i&65535)&&!this.za()==!(this.f&32768))}function Kd(a){U(this,a,!Q(this)&&!!(this.i&65535))}
|
||||
function Ld(a){U(this,a,(this.i&65535?0:4)||!this.za()!=!(this.f&32768))}function Md(a){U(this,a,Q(this)||(this.i&65535?0:4))}function Nd(a){U(this,a,!this.za()!=!(this.f&32768))}function Od(a){U(this,a,this.za())}function Pd(a){U(this,a,!!(this.i&65535))}function Qd(a){U(this,a,!this.za())}function Rd(){J(this,12,1);this.a-=5}function Sd(a){U(this,a,!0)}function Td(a){U(this,a,!(this.f&32768))}function Ud(a){U(this,a,this.f&32768?2:0)}
|
||||
function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Vd(a){var b=Rc(this,a);a=Uc(this,a);Hc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Wd(a){var b=Qc(this,a)<<8;a=Tc(this,a)<<8;Hc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}
|
||||
function Xd(a){var b=Uc(this,a);if(b){a=a>>6&7;var c=this.h[a]<<16|this.h[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.h[a]=d&65535,this.h[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.h[a]&&(this.h[a]=this.h[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function Yd(){J(this,24,2);this.a-=25}
|
||||
function Zd(){this.B&49152?(this.M|=128,J(this,4,3)):this.D?this.D.b():F(this);this.a-=7}function $d(){J(this,16,4);this.a-=25}var ae=[0,7,7,10,7,11,9,13];function be(a){this.F=this.a;O(this,Sc(this,a));this.a=this.F-ae[this.c]}var ce=[0,14,14,17,14,18,16,20];function de(a){this.F=this.a;var b=Sc(this,a);a=a>>6&7;Ic(this,this.h[a]);this.h[a]=this.h[7];O(this,b);this.a=this.F-ce[this.c]}var ee=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function fe(a){var b=Rc(this,a);this.F=this.a;R(this,Wc(this,a,b));this.a=this.F-ee[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ge(a){var b=Qc(this,a);R(this,Vc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var he=[7,13,13,17,14,18,17,21];
|
||||
function ie(a){var b=Uc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.h[a];c&32768&&(c|=-65536);b=~~(b*c);this.h[a]=b>>16&65535;this.h[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function je(){this.a-=5}function ke(){this.B&49152||(this.g.reset(),kb(this));this.a-=667}function le(){Jc(this);this.u|=this.B&16;this.a-=13}
|
||||
function me(a){if(a&8)J(this,8,6);else{var b=Kc(this);a&=7;7==a?O(this,b):(O(this,this.h[a]),this.h[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function ne(a){var b=(a&448)>>6;if(this.h[b]=this.h[b]-1&65535)O(this,this.h[7]-((a&63)<<1)),this.a+=1;this.a-=6}function oe(a){T(this,a,Rc(this,a),sd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function pe(a){T(this,a,0,ud);this.a-=this.c?9:3+(7==this.b?2:0)}function qe(){J(this,28,5);this.a-=5}function re(){this.u|=4;Dc(this,-2);this.a-=3}function se(a){T(this,a,Rc(this,a),vd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,6)}function yc(a){te[a>>12].call(this,a)}function ue(a){ve[a>>6&3].call(this,a)}function we(a){xe[a>>6&3].call(this,a)}function ye(a){ze[a>>6&3].call(this,a)}function Ae(a){Be[a&15].call(this,a)}function Ce(a){De[a&15].call(this,a)}
|
||||
function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a>>6&3].call(this,a)}
|
||||
var te=[function(a){Ke[a>>8&15].call(this,a)},fe,Vd,Fd,Bd,Dd,wd,Y,function(a){Le[a>>8&15].call(this,a)},ge,Wd,Gd,Cd,Ed,oe,Y],Ke=[function(a){Me[a>>4&15].call(this,a)},Sd,Pd,Hd,Id,Nd,Jd,Ld,de,de,ue,we,ye,Y,Y,Y],ve=[function(a){Ec(this,Wc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,id);this.a-=this.c?9:3+(7==this.b?2:0)}],xe=[function(a){T(this,a,0,
|
||||
md);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,Xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Uc(this,a);Ec(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],ze=[function(a){T(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Zc);this.a-=this.c?9:3+(7==this.b?2:0)}],
|
||||
Me=[function(a){Oe[a&15].call(this,a)},Y,Y,Y,be,be,be,be,me,Y,Ae,Ce,pe,pe,pe,pe],Oe=[Zd,re,le,Rd,$d,ke,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Be=[je,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],De=[je,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Le=[Qd,Od,Kd,Md,Td,Ud,zd,Ad,Yd,qe,Ee,Ge,Ie,Y,Y,Y],Fe=[function(a){Ec(this,
|
||||
Vc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,ld);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,jd);this.a-=this.c?9:3+(7==this.b?2:0)}],He=[function(a){S(this,a,0,nd);this.a-=this.c?11:6},function(a){S(this,a,Q(this)?1:0,Yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,Q(this)?1:0,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Tc(this,a);Ec(this,a<<8);this.a-=this.c?4:3+(7==this.b?
|
||||
2:0)}],Je=[function(a){S(this,a,0,rd);this.a-=this.c?9+(this.rb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,bd);this.a-=this.c?9+(this.rb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,$c);this.a-=this.c?9:3+(7==this.b?2:0)}];function zc(a){Pe[a>>12].call(this,a)}
|
||||
var Pe=[function(a){Qe[a>>8&15].call(this,a)},fe,Vd,Fd,Bd,Dd,wd,function(a){Re[a>>8&15].call(this,a)},function(a){Se[a>>8&15].call(this,a)},ge,Wd,Gd,Cd,Ed,oe,Y],Qe=[function(a){Te[a>>4&15].call(this,a)},Sd,Pd,Hd,Id,Nd,Jd,Ld,de,de,ue,we,ye,function(a){Ue[a>>6&3].call(this,a)},Y,Y],Ue=[function(a){a=this.h[7]+((a&63)<<1)&65535;var b=this.W(a|this.P);O(this,this.h[5]);this.h[6]=a+2&65535;this.h[5]=b;this.a-=8},function(a){a=Oc(this,a,0);Ic(this,a);R(this,a);this.a-=11},function(a){var b=Kc(this);this.F=
|
||||
this.a;Pc(this,a,0,b);R(this,b);this.a=this.F-he[this.c]},function(a){R(this,Wc(this,a,this.za?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Te=[function(a){Ve[a&15].call(this,a)},Y,Y,Y,be,be,be,be,me,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):J(this,8,6)},Ae,Ce,pe,pe,pe,pe],Ve=[Zd,re,le,Rd,$d,ke,function(){Jc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Re=[ie,ie,Xd,Xd,xd,xd,yd,yd,se,se,Y,Y,Y,Y,ne,ne],Se=[Qd,Od,Kd,Md,Td,Ud,zd,Ad,Yd,qe,Ee,Ge,Ie,function(a){We[a>>6&
|
||||
3].call(this,a)},Y,Y],We=[Y,function(a){a=Oc(this,a,65536);Ic(this,a);R(this,a);this.a-=11},function(a){var b=Kc(this);this.F=this.a;Pc(this,a,65536,b);R(this,b);this.a=this.F-he[this.c]},Y];
|
||||
function Xe(a){v.call(this,"ROM",a,Xe);this.X=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.j=a.file;this.s=q(this.j);if(this.j){a=this.j;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Sa(c.na,a,b),(a=ta(a,b))?(c.c=a.K,c.X=a.X):c.j=null);Ye(c)})}}y(Xe);h=Xe.prototype;
|
||||
h.ha=function(a,b,c,d){this.g=b;this.a=c;this.D=d;Ye(this)};h.ka=function(){this.X&&(this.D&&this.D.a(this.id,this.i,this.b,this.X),delete this.X);return!0};h.ja=function(){return!0};
|
||||
function Ye(a){if(!Wa(a)){if(a.j){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Xa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+G){var c={};b=(c[b]=[Xe.prototype.Xc,Xe.prototype.Qd,null,null,null,a.b>>1],c);if(cb(a.g,a,b,256,a.wa)){b=a.m=!0;break a}}else if(Eb(a.g,b,a.b,dc)){for(c=0;c<a.c.length;c++)a.g.Ya(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.f?
|
||||
b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Db(d.g,d.i,d.b);Cb(d.g,e,d.b,f)}a.m||delete a.c}}}D(a)}}h.Xc=function(a){return this.c[a-this.i]};h.Qd=function(){};Ha(function(){for(var a=C(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Xe(d);B(d,c)}});
|
||||
function Ze(a){v.call(this,"RAM",a,Ze);this.X=this.c=null;this.j=a.addr;this.i=a.size;this.fa=a.load;this.ea=a.exec;this.f=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Sa(c.na,a,b),(a=ta(a,b))?(c.c=a.K,c.X=a.X,null==c.fa&&(c.fa=a.fa),null==c.ea&&(c.ea=a.ea)):c.b=null);$e(c)})}}y(Ze);
|
||||
Ze.prototype.ha=function(a,b,c,d){this.g=b;this.a=c;this.D=d;$e(this)};Ze.prototype.ka=function(){this.X&&(this.D&&this.D.a(this.id,this.j,this.i,this.X),delete this.X);return!0};Ze.prototype.ja=function(){return!0};function $e(a){if(a.g&&(!a.f&&a.i&&Eb(a.g,a.j,a.i,Hb)&&(a.f=!0),!Wa(a))){if(!a.f)t("No RAM allocated");else if(a.b){if(!a.c||!a.g)return;af(a,a.c,a.fa,a.ea,a.j)}D(a)}}
|
||||
Ze.prototype.reset=function(){if(this.f){for(var a=this.g,b=this.j,c=this.i,d=b&a.j,b=b>>>a.c;0<c&&b<a.g.length;){var e=a.g[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Ya&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Fb(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&af(this,this.c,this.fa,this.ea,this.j,!0)}};
|
||||
function af(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ya(p++,b[u++]&255);else p&1?F(a.a):Bc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Ya(c+
|
||||
e,b[e]);null!=d&&Bc(a.a,d,f);g=!0}return g}Ha(function(){for(var a=C(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ze(d);B(d,c)}});function bf(a){v.call(this,"Keyboard",a,bf);D(this)}y(bf);bf.prototype.$=function(){return!1};bf.prototype.ha=function(a,b,c,d){this.j=a;this.a=c;this.D=d};Ha(function(){for(var a=C(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new bf(d);B(d,c)}});
|
||||
function Z(a){this.C=a.baudReceive||9600;this.I=a.baudTransmit||9600;this.R=a.upperCase;this.f=this.m=null;this.J=a.tabSize;this.F=a.charBOL;this.s=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=cf;b&&(void 0===c&&(c="Panel"),(c=Ua(c,this.id))&&(b=c.o[b])&&this.$(null,a,b))}this.v=this.A=null;this.exports={connect:this.Mb,receiveData:this.zb}}y(Z);var cf="buffer";h=Z.prototype;
|
||||
h.$=function(a,b,c){var d=this;switch(b){case cf:return this.o[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.zb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.zb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;var e=this;this.aa=Tb(48,4);this.N=Qb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Rb(e.a,e.aa))});this.da=Tb(52,4);this.P=Qb(this.a,function(){e.c|=128;e.c&64&&Rb(e.a,e.da)});cb(b,this,df);D(this)};
|
||||
h.Mb=function(){if(!this.v){var a=pc(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.wa)return;b=pa(b[1]);if(this.v=Ta(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Mb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.ja=function(a){return a?this.save():!0};h.reset=function(){ef(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return ef(this)};function ef(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.zb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Sb(this.a,this.N,1E3/Math.round(this.C/10));return!0};h.Rc=function(){return this.b&65534};
|
||||
h.Kd=function(a){this.b=this.b&-112|a&111};h.Qc=function(){this.b&=-129;0<this.i.length&&Sb(this.a,this.N,1E3/Math.round(this.C/10));return this.w};h.Jd=function(){};h.ld=function(){return this.c};h.de=function(a){128==(this.c&192)&&a&64&&Sb(this.a,this.P,1E3/Math.round(this.I/10));this.c=this.c&-70|a&69};h.kd=function(){return 0};
|
||||
h.rd=function(a,b){this.a.Wb[b-65504>>1]=a};h.Sb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.g.gb}a=(a>>6)-1}else a=0;return a};h.Zb=function(){};h.cd=function(){return 1};h.Wd=function(){};h.vc=function(){return this.a.M};h.qd=function(){this.a.M=0};h.Dc=function(){return this.a.Vb};h.yd=function(a,b){b&1||(a&=255);this.a.Vb=a};h.Ic=function(a){return a?this.a.Bb:0};h.Bd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Bb=a;b.u|=2};
|
||||
h.bd=function(a){return a?this.a.Da&65280:0};h.Vd=function(a){this.a.Da=a|255};h.Lc=function(){return Yb(this.a)};h.Ed=function(a){Zb(this.a,a&-1809|Yb(this.a)&1808);this.a.u|=128};h.Yb=function(){};
|
||||
var M={},Wb=(M[61568]=[null,null,L.prototype.hd,L.prototype.ae,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.ad,L.prototype.Ud,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.Zc,L.prototype.Sd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.$c,L.prototype.Td,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.Yc,L.prototype.Rd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Bc,L.prototype.wd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.zc,L.prototype.ud,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Ac,
|
||||
L.prototype.vd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.yc,L.prototype.td,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Hc,L.prototype.Ad,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Cc,L.prototype.xd,"LKS"],M[65402]=[null,null,L.prototype.Ec,L.prototype.zd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Fc,L.prototype.Yb,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Gc,L.prototype.Yb,"MMR2",1,1145],M[65408]=[null,null,L.prototype.gd,L.prototype.$d,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.ed,
|
||||
L.prototype.Yd,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.fd,L.prototype.Zd,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.dd,L.prototype.Xd,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa,
|
||||
"R5SET0"],M[65478]=[null,null,L.prototype.Mc,L.prototype.Fd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Pc,L.prototype.Id,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na,
|
||||
L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Nc,L.prototype.Gd,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Oc,L.prototype.Hd,"R6USER",1,1145],M[65504]=[null,null,L.prototype.wc,L.prototype.rd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Sb,L.prototype.Zb,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Sb,L.prototype.Zb,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.cd,L.prototype.Wd,"SYSID",1,1170],M[65526]=[null,null,L.prototype.vc,L.prototype.qd,"CPUERR",1,1170],M[65528]=
|
||||
[null,null,L.prototype.Dc,L.prototype.yd,"MB",1,1170],M[65530]=[null,null,L.prototype.Ic,L.prototype.Bd,"PIR"],M[65532]=[null,null,L.prototype.bd,L.prototype.Vd,"SL"],M[65534]=[null,null,L.prototype.Lc,L.prototype.Ed,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new $b(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var ac;
|
||||
if(Xa){var bc=new ArrayBuffer(2);(new DataView(bc)).setUint16(0,256,!0);ac=256===(new Uint16Array(bc))[0]}else ac=!1;var cc=ac;
|
||||
function I(a,b,c,d,e,f){this.g=a;this.id=dc+=2;this.a=null;this.Ka=b;this.ob=c;this.size=d||0;this.type=e||ec;this.j=e==fc;this.controller=null;Ab(this);this.ta=this.gc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],gc(this,f.bc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),gc(this,cc?hc:jc);else{a=this.a=Array(this.size>>
|
||||
2);for(f=0;f<a.length;f++)a[f]=0;gc(this,kc)}else gc(this)}var ec=0,Ib=1,fc=2,Gb=4,Jb=["NONE","RAM","ROM","VID","H/W"],dc=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.ta=!0}return!1},v:function(a,b){J(this.g,b,32);return 255},f:function(a,b,c){J(this.g,c,32)},w:function(a,b){return this.yb(a++,b++)|
|
||||
this.yb(a,b)<<8},A:function(a,b,c){this.Eb(a++,b&255,c++);this.Eb(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},na:function(a,b){a&1&&J(this.g,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ta=!0},xa:function(a,b,c){a&1&&J(this.g,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
|
||||
b>>8);this.ta=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Tb(a,b)},oa:function(a,b,c){this.j?this.f(a,b,c):this.Fb(a,b,c)},sa:function(a,b,c){this.j?this.f(a,b,c):this.$b(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},P:function(a,b){a&1&&J(this.g,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.g,b,64);return this.s[a>>1]},da:function(a,b){this.o[a]=b;this.ta=!0},pa:function(a,b){this.o[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&J(this.g,
|
||||
c,64);this.c.setUint16(a,b,!0);this.ta=!0},wa:function(a,b,c){a&1&&J(this.g,c,64);this.s[a>>1]=b;this.ta=!0}};function Ab(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&lc(a,mc,!1),(a.m=c.m)&&nc(a,mc,!1))}function nc(a,b,c){c&&a.m||(a.Eb=!a.j&&b[1]||a.f,a.pb=!a.j&&b[3]||a.A);if(c||void 0===c)a.Fb=b[1]||a.f,a.$b=b[3]||a.A}function lc(a,b,c){c&&a.i||(a.yb=b[0]||a.v,a.W=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Tb=b[2]||a.w}function gc(a,b){b||(b=oc);lc(a,b,void 0);nc(a,b,void 0)}
|
||||
var oc=[],kc=[I.prototype.N,I.prototype.qa,I.prototype.na,I.prototype.xa],mc=[I.prototype.F,I.prototype.oa,I.prototype.R,I.prototype.sa];if(Xa)var jc=[I.prototype.C,I.prototype.da,I.prototype.P,I.prototype.ra],hc=[I.prototype.J,I.prototype.pa,I.prototype.aa,I.prototype.wa];
|
||||
function pc(a,b){x.call(this,"CPU",a,pc);var c=a.multiplier||1;this.fb=a.cycles||b;this.qa=c;this.vb=Math.round(this.fb/1E4)/100;this.xa=this.vb*this.qa;this.l.U=!1;this.l.Cb=!1;this.l.Ua=a.autoStart;this.l.hb=!1;this.cb=this.Ia=0;this.eb=a.csStart;this.Qa=a.csInterval;this.Ra=a.csStop;this.I=[];this.Qb=this.md.bind(this);F(this)}z(pc);var qc=["power","reset"];h=pc.prototype;
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.D=d;for(b=0;b<qc.length;b++)(c=this.o[qc[b]])&&this.j.$(null,qc[b],c);a=rc(a,"autoStart");null!=a&&(this.l.Ua="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){sc(this);if(!this.restore(a))return!1;tc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0};
|
||||
h.Ua=function(){return this.l.Ua||void 0===this.o.run?(mb(this),!0):!1};h.Jb=function(){return 0};function tc(a){void 0===a.eb&&(a.eb=0);void 0===a.Qa&&(a.Qa=-1);void 0===a.Ra&&(a.Ra=-1);a.l.hb=0<=a.eb&&0<a.Qa;a.l.hb&&(a.cb=0,a.Ia=a.eb-a.sa)}function pb(a,b){if(a.l.hb){var c=!1;a.cb=a.cb+a.Jb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=uc(a)&&(a.Qa=a.Ra=-1,tc(a),G(a),c=!0);c&&a.T(uc(a)+" cycles: checksum="+m(a.cb))}}
|
||||
h.$=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.j)if(a=d.j,a.l.O)a=!0;else{var b=null,c,k=A(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.l.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.l.O);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.kb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.U?G(d):mb(d))},!0;case "speed":return this.o[b]=
|
||||
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){vc(d,d.qa<<1,!0)},c.textContent=this.xa.toFixed(2)+"Mhz",!0}return!1};h.va=function(a){this.j&&this.j.va(a)};function ob(a,b,c){a.sa+=b;c&&(a.pa=a.a=a.F=0)}function wc(a,b){var c=1;b&&1<a.qa&&a.da&&(c=a.da/a.vb);a.Ob=Math.round(1E3/30);a.ib=Math.floor(a.fb/30*c);b||(a.Sa=a.ib);a.wb=0}function uc(a){return a.sa+a.aa+a.pa-a.a}function sc(a){a.da=0;a.Pb=0;a.sa=a.aa=a.pa=a.a=a.F=0;tc(a);vc(a,1)}
|
||||
function vc(a,b,c){if(void 0!==b){.8>a.da/a.xa&&(b=1);a.qa=b;b=a.vb*a.qa;if(a.xa!=b){a.xa=b;b=a.xa.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.j&&xc(a.j)}ob(a,a.aa);a.aa=0;a.R=ra();a.oa=0;wc(a)}function Rb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Tb(a,b,c){0<=b&&b<a.I.length&&0>a.I[b][0]&&(c=a.fb*a.qa/1E3*c|0,a.I[b][0]=c+yc(a))}function nb(a,b){for(var c=a.I.length-1;0<=c;c--){var d=a.I[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}
|
||||
function yc(a,b){var c=a.pa-=a.a;a.a=a.F=0;b&&(a.pa=0);return c}
|
||||
h.md=function(){if(this.l.U){this.wb>=this.fb&&wc(this,!0);this.Ta=0;this.$a=ra();if(this.oa){var a=this.$a-this.oa;a>this.Ob&&(this.R+=a,this.R>this.$a&&(this.R=this.$a))}try{do{for(var b,c=this.l.hb?1:this.ib,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.nb(b)}catch(f){if("number"!=typeof f)throw f;}b=yc(this,!0);this.Ta+=b;this.aa+=b;pb(this,b);nb(this,b);this.Sa-=b;if(0>=this.Sa){this.Sa+=this.ib;15<=++this.Pb&&(this.va(),this.Pb=0);break}}while(this.l.U)}catch(f){G(this);
|
||||
this.j&&this.j.stop(ra(),uc(this));Wa(this,f.stack||f.message);return}if(this.l.U){a=setTimeout;b=this.Qb;this.oa=ra();c=this.Ob;this.Ta&&(c=Math.round(c*this.Ta/this.ib));c-=this.oa-this.$a;if(d=this.oa-this.R)this.da=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.sa=0,vc(this));if(0>c||this.da<this.xa)-1E3>c&&(this.R-=c),c=0;this.wb+=this.Ta;this.oa+=c;a(b,c)}}};
|
||||
function mb(a){var b;a.l.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.U)a.T(a.toString()+" busy");else{vc(a);a.l.U=!0;a.l.Cb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.R,uc(a));setTimeout(a.Qb,0)}}h.nb=function(){return 0};function G(a){var b=!1;if(a.l.U){yc(a);ob(a,a.aa);a.aa=0;a.l.U=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),uc(a));b=!0}a.l.complete=void 0;return b}
|
||||
function zc(a){this.Wa=+a.model||1170;this.Kb=a.addrReset||0;pc.call(this,a,6666667);this.decode=1120==this.Wa?Ac.bind(this):Bc.bind(this);Cc(this);this.ra=0;this.N=null;this.l.complete=!1}z(zc,pc);h=zc.prototype;h.reset=function(){this.status("model "+this.Wa);this.l.U&&G(this);Cc(this);sc(this);this.l.error=!1;this.parent.reset.call(this)};
|
||||
function Cc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.B=15;a.h=[0,0,0,0,0,0,0,a.Kb];a.Ha=[0,0,0,0,0,0];a.ma=[0,0,0,0];a.v=0;a.bb=0;a.jc=[4,2,0,1];a.H=[[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.Y=[[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.Za=[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.Wb=[0,0,0,0,0,0,0,0];a.Vb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.rb=0;a.Ja=-1;lb(a)}function lb(a){a.Da=255;a.M=0;a.Bb=0;a.w=0;a.Ca=0;a.Ab=0;a.Ga=0;a.Ba=0;a.ab=0;a.Nb=262143;a.N=null;a.g&&Xb(a)}function Xb(a){a.Ba?(a.P=65536,a.J=a.ic,a.W=a.jd,a.pb=a.be,Cb(a.g,a.Ga&16?22:18)):(a.P=0,a.J=a.hc,a.W=a.Ub,a.pb=a.ac,Cb(a.g,16))}function Dc(a,b,c){a.Kb=b;O(a,b);!c&&a.D&&(G(a)||a.D.c())}h.Jb=function(){return 0};
|
||||
h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.sa,this.qa]);a.set(2,Ob(this.g));return a.data()};h.restore=function(a){var b=a[1];this.sa=b[1];vc(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,g=Array(b.F),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.g[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Q(a){return a.m&65536?1:0}
|
||||
h.za=function(){return this.s&32768?8:0};function Ec(a){var b=a.h[7];a.w&57344||(a.Ca=0,a.Ab=b);a.h[7]=b+2&65535;return a.W(b)}function Fc(a,b){var c=a.h[7];a.h[7]=c+b&65535;return c}function O(a,b){a.h[7]=b&65535}function Vb(a,b){return{od:a,La:b,next:null}}function Sb(a,b){if(b!=a.N){var c=a.N;if(!c||c.La<=b.La)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function Yb(a){return a.B=a.B&63728|a.za()|(a.i&65535?0:4)|(a.f&32768?2:0)|Q(a)}
|
||||
function Zb(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ha.length;0<=--c;){var d=a.h[c];a.h[c]=a.Ha[c];a.Ha[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.ma[c]=a.h[6],a.h[6]=a.ma[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function Gc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Hc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Ic(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Jc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))}
|
||||
function K(a,b,c){if(!a.ra){var d=!1;0>a.Ja?a.Ja=Yb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ca=63222,a.Ab=b);a.v=0;var e=a.W(b|a.P),f=a.W(b+2&65535|a.P);Zb(a,f&-12289|a.Ja>>2&12288);d&&(a.M|=4,a.h[6]=4);Kc(a,a.Ja);Kc(a,a.h[7]);O(a,e);a.u&=-113;a.Ja=-1;a.u|=8;if(26!=c)throw b;}}function Lc(a){var b=Mc(a),c=Mc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Zb(a,c);a.u&=-17}
|
||||
function Lb(a,b){var c=b>>13&31;31>c&&a.Ga&32&&(b=a.Za[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function Nc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Ga&a.jc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[a.v][d]<<6)+(b&8191)&a.Nb;var g=0;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.H[a.v][d]=e;if(4194170!==f||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.w&57344||(a.w=a.w|g|a.ab<<5|a.bb<<1),
|
||||
b=!0),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.u|=32)),b&&K(a,168,16));return f}function Oc(a,b,c){b&1&&a.a--;a=a.g;c&=255;3932160<=b&&(b=Lb(a.a,b));a.g[(b&a.ia)>>>a.c].Eb(b&a.j,c&255,b)}function Mc(a){var b=a.W(a.h[6]|a.P);a.h[6]=a.h[6]+2&65535;return b}function Kc(a,b){var c=a.h[6]-2&65535;a.h[6]=c;a.w&57344||(a.Ca=a.Ca<<8|246);!a.v&&c<=a.Da&&4<c&&(c<=a.Da-32?(a.M|=4,a.h[6]=4,K(a,4,18)):(a.M|=8,a.u|=4));a.pb(c,b)}
|
||||
function Pc(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return K(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.h[6]<=a.Da||65534<=a.h[6])&&(a.h[6]<=a.Da-32||65534<=a.h[6]?(a.M|=4,a.h[6]=4,K(a,4,22)):(a.M|=8,a.u|=64)),a.a-=3,7===c?a.h[c]:a.h[c]|g;case 2:f=2;e=a.h[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.h[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.h[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.h[c]-2&65535;7!==c&&(e|=g);e=a.W(e)|g;a.a-=
|
||||
8;break;case 6:return e=a.W(Fc(a,2)),e=e+a.h[c]&65535|g,a.a-=6,e;case 7:return e=a.W(Fc(a,2)),e=e+a.h[c]&65535,e=a.W(e|a.P)|g,a.a-=10,e}a.h[c]=a.h[c]+f&65535;!g||a.w&57344||(a.Ca=a.Ca<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.h[6]<=a.Da||65534<=a.h[6])&&(a.h[6]<=a.Da-32?(a.M|=4,a.h[6]=4,K(a,4,24)):(a.M|=8,a.u|=64));return e}h.lb=function(a){if(!this.Ba)return this.g.lb(a);this.ra++;a=this.Ub(Nc(this,a,2));this.ra--;return a};
|
||||
h.Ya=function(a,b){this.Ba?(this.ra++,Oc(this,Nc(this,a,5),b),this.ra--):this.g.Ya(a,b)};h.mb=function(a,b){this.Ba?(this.ra++,this.ac(Nc(this,a,4),b),this.ra--):this.g.mb(a,b)};h.hc=function(a,b,c){return Pc(this,a,b,c)};h.ic=function(a,b,c){return Nc(this,Pc(this,a,b,c),c)};h.Ub=function(a){return Mb(this.g,a)};h.jd=function(a){return Mb(this.g,Nc(this,a,2))};h.ac=function(a,b){Nb(this.g,a,b&65535)};h.be=function(a,b){Nb(this.g,Nc(this,a,4),b)};
|
||||
function Qc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Pc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.P),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.h[d]:a.ma[a.B>>12&3];return c}function Rc(a,b,c,d){a.w&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Pc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Nc(a,e|c&65536,4),a.v=a.B>>14&3,Nb(a.g,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.h[e]=d:a.ma[a.B>>12&3]=d}
|
||||
function Sc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=Kb(a.g,c)):a=a.h[c]&255;return a}function Tc(a,b){b>>=6;var c=a.C=b&7;return(b=a.A=(b&56)>>3)?Mb(a.g,a.J(b,c,2)):a.h[c]}function Uc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Pc(a,b,c,8)}function Vc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=Kb(a.g,c)):a=a.h[c]&255;return a}function Wc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.g,a.J(b,c,2)):a.h[c]}
|
||||
function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.rb=a.J(b,e,7),Oc(a,e,d.call(a,c,Kb(a.g,e)))):a.h[e]=a.h[e]&65280|d.call(a,c,a.h[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),Nb(a.g,e,d.call(a,c,Mb(a.g,e)))):a.h[e]=d.call(a,c,a.h[e])}function Xc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Oc(a,a.J(b,e,5),c):a.h[e]=c?d&1?c<<24>>24&65535:a.h[e]&-256|c&255:a.h[e]&-256;return c}
|
||||
function Yc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Nb(a.g,a.J(b,d,4),c):a.h[d]=c&65535;return c}function V(a,b,c){c&&(O(a,a.h[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
h.nb=function(a){this.l.complete=!0;var b=a?this.l.Cb?0:1:-1;this.l.Cb=!1;this.pa=this.a=a;do{if(this.u){this.u&112&&(this.u&32?K(this,168,28):this.u&64?K(this,4,30):this.u&16&&K(this,12,32),this.u&=-113);if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Bb&224)>>5,e=this.N&&this.N.La>d?this.N:null;e&&(c=e.od,d=e.La);d>(this.B&224)>>5?(this.u&4&&(Fc(this,2),this.u&=-5),K(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.N,e==a)this.N=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=
|
||||
d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break}this.u=this.u&7|this.B&16;this.decode(Ec(this))}while(0<this.a);return this.l.complete?this.pa-this.a:void 0===this.l.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new zc(d);C(d,c)}});function Zc(a,b){var c=b+a;Hc(this,c,a,b);return c&65535}function $c(a,b){var c=b+a;Hc(this,c<<8,a<<8,b<<8);return c&255}function ad(a,b){a=b<<1;Ic(this,a);return a&65535}
|
||||
function bd(a,b){a=b<<1;Ic(this,a<<8);return a&255}function cd(a,b){a=b&32768|b>>1|b<<16;Ic(this,a);return a&65535}function dd(a,b){a=b&2048|b>>1|b<<8;Ic(this,a<<8);return a&255}function ed(a,b){a=b&~a;R(this,a);return a}function fd(a,b){a=b&~a;R(this,a<<8);return a}function gd(a,b){a|=b;R(this,a);return a}function hd(a,b){a|=b;R(this,a<<8);return a}function id(a,b){a=~b|65536;Gc(this,a);return a&65535}function jd(a,b){a=~b|256;Gc(this,a<<8);return a&255}
|
||||
function kd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function ld(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.f=b&(b^c));return a&255}function md(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function nd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function od(a,b){a=-b;Gc(this,a,a&b&32768);return a&65535}function pd(a,b){a=-b;Gc(this,a<<8,(a&b&128)<<8);return a&255}
|
||||
function qd(a,b){a=b<<1|this.m>>16&1;Ic(this,a);return a&65535}function rd(a,b){a=b<<1|this.m>>16&1;Ic(this,a<<8);return a&255}function sd(a,b){a=(this.m&65536|b)>>1|b<<16;Ic(this,a);return a&65535}function td(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Ic(this,a<<8);return a&255}function ud(a,b){var c=b-a;Jc(this,c,a,b);return c&65535}function vd(a,b){var c=b-a;Jc(this,c<<8,a<<8,b<<8);return c&255}function wd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}
|
||||
function xd(a,b){a^=b;R(this,a);return a&65535}function yd(a){T(this,a,Tc(this,a),Zc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function zd(a){var b=Wc(this,a);a=a>>6&7;var c=this.h[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.h[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function Ad(a){var b=Wc(this,a);a=a>>6&7;var c=this.h[a]<<16|this.h[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.h[a]=d>>16&65535;this.h[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Bd(a){V(this,a,!Q(this))}function Cd(a){V(this,a,Q(this))}
|
||||
function Dd(a){T(this,a,Tc(this,a),ed);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Ed(a){S(this,a,Sc(this,a),fd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Fd(a){T(this,a,Tc(this,a),gd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Gd(a){S(this,a,Sc(this,a),hd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function Hd(a){R(this,Tc(this,a)&Wc(this,a));this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Id(a){R(this,(Sc(this,a)&Vc(this,a))<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Jd(a){V(this,a,this.i&65535?0:4)}function Kd(a){V(this,a,!this.za()==!(this.f&32768))}function Ld(a){V(this,a,!!(this.i&65535)&&!this.za()==!(this.f&32768))}function Md(a){V(this,a,!Q(this)&&!!(this.i&65535))}
|
||||
function Nd(a){V(this,a,(this.i&65535?0:4)||!this.za()!=!(this.f&32768))}function Od(a){V(this,a,Q(this)||(this.i&65535?0:4))}function Pd(a){V(this,a,!this.za()!=!(this.f&32768))}function Qd(a){V(this,a,this.za())}function Rd(a){V(this,a,!!(this.i&65535))}function Sd(a){V(this,a,!this.za())}function Td(){K(this,12,1);this.a-=5}function Ud(a){V(this,a,!0)}function Vd(a){V(this,a,!(this.f&32768))}function Wd(a){V(this,a,this.f&32768?2:0)}
|
||||
function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Xd(a){var b=Tc(this,a);a=Wc(this,a);Jc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Yd(a){var b=Sc(this,a)<<8;a=Vc(this,a)<<8;Jc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}
|
||||
function Zd(a){var b=Wc(this,a);if(b){a=a>>6&7;var c=this.h[a]<<16|this.h[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.h[a]=d&65535,this.h[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.h[a]&&(this.h[a]=this.h[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function $d(){K(this,24,2);this.a-=25}
|
||||
function ae(){this.B&49152?(this.M|=128,K(this,4,3)):this.D?this.D.b():G(this);this.a-=7}function be(){K(this,16,4);this.a-=25}var ce=[0,7,7,10,7,11,9,13];function de(a){this.F=this.a;O(this,Uc(this,a));this.a=this.F-ce[this.c]}var ee=[0,14,14,17,14,18,16,20];function fe(a){this.F=this.a;var b=Uc(this,a);a=a>>6&7;Kc(this,this.h[a]);this.h[a]=this.h[7];O(this,b);this.a=this.F-ee[this.c]}var ge=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function he(a){var b=Tc(this,a);this.F=this.a;R(this,Yc(this,a,b));this.a=this.F-ge[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ie(a){var b=Sc(this,a);R(this,Xc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var je=[7,13,13,17,14,18,17,21];
|
||||
function ke(a){var b=Wc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.h[a];c&32768&&(c|=-65536);b=~~(b*c);this.h[a]=b>>16&65535;this.h[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function le(){this.a-=5}function me(){this.B&49152||(this.g.reset(),lb(this));this.a-=667}function ne(){Lc(this);this.u|=this.B&16;this.a-=13}
|
||||
function oe(a){if(a&8)K(this,8,6);else{var b=Mc(this);a&=7;7==a?O(this,b):(O(this,this.h[a]),this.h[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function pe(a){var b=(a&448)>>6;if(this.h[b]=this.h[b]-1&65535)O(this,this.h[7]-((a&63)<<1)),this.a+=1;this.a-=6}function qe(a){T(this,a,Tc(this,a),ud);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function re(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)}function se(){K(this,28,5);this.a-=5}function te(){this.u|=4;Fc(this,-2);this.a-=3}function ue(a){T(this,a,Tc(this,a),xd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,6)}function Ac(a){ve[a>>12].call(this,a)}function we(a){xe[a>>6&3].call(this,a)}function ye(a){ze[a>>6&3].call(this,a)}function Ae(a){Be[a>>6&3].call(this,a)}function Ce(a){De[a&15].call(this,a)}function Ee(a){Fe[a&15].call(this,a)}
|
||||
function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a>>6&3].call(this,a)}function Ke(a){Le[a>>6&3].call(this,a)}
|
||||
var ve=[function(a){Me[a>>8&15].call(this,a)},he,Xd,Hd,Dd,Fd,yd,Y,function(a){Ne[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,qe,Y],Me=[function(a){Pe[a>>4&15].call(this,a)},Ud,Rd,Jd,Kd,Pd,Ld,Nd,fe,fe,we,ye,Ae,Y,Y,Y],xe=[function(a){Gc(this,Yc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,kd);this.a-=this.c?9:3+(7==this.b?2:0)}],ze=[function(a){T(this,a,0,
|
||||
od);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,Zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Wc(this,a);Gc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Be=[function(a){T(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ad);this.a-=this.c?9:3+(7==this.b?2:0)}],
|
||||
Pe=[function(a){Qe[a&15].call(this,a)},Y,Y,Y,de,de,de,de,oe,Y,Ce,Ee,re,re,re,re],Qe=[ae,te,ne,Td,be,me,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],De=[le,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Fe=[le,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ne=[Sd,Qd,Md,Od,Vd,Wd,Bd,Cd,$d,se,Ge,Ie,Ke,Y,Y,Y],He=[function(a){Gc(this,
|
||||
Xc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,ld);this.a-=this.c?9:3+(7==this.b?2:0)}],Je=[function(a){S(this,a,0,pd);this.a-=this.c?11:6},function(a){S(this,a,Q(this)?1:0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,Q(this)?1:0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Vc(this,a);Gc(this,a<<8);this.a-=this.c?4:3+(7==this.b?
|
||||
2:0)}],Le=[function(a){S(this,a,0,td);this.a-=this.c?9+(this.rb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,dd);this.a-=this.c?9+(this.rb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,bd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Bc(a){Re[a>>12].call(this,a)}
|
||||
var Re=[function(a){Se[a>>8&15].call(this,a)},he,Xd,Hd,Dd,Fd,yd,function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},ie,Yd,Id,Ed,Gd,qe,Y],Se=[function(a){Ve[a>>4&15].call(this,a)},Ud,Rd,Jd,Kd,Pd,Ld,Nd,fe,fe,we,ye,Ae,function(a){We[a>>6&3].call(this,a)},Y,Y],We=[function(a){a=this.h[7]+((a&63)<<1)&65535;var b=this.W(a|this.P);O(this,this.h[5]);this.h[6]=a+2&65535;this.h[5]=b;this.a-=8},function(a){a=Qc(this,a,0);Kc(this,a);R(this,a);this.a-=11},function(a){var b=Mc(this);this.F=
|
||||
this.a;Rc(this,a,0,b);R(this,b);this.a=this.F-je[this.c]},function(a){R(this,Yc(this,a,this.za?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ve=[function(a){Xe[a&15].call(this,a)},Y,Y,Y,de,de,de,de,oe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,6)},Ce,Ee,re,re,re,re],Xe=[ae,te,ne,Td,be,me,function(){Lc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Te=[ke,ke,Zd,Zd,zd,zd,Ad,Ad,ue,ue,Y,Y,Y,Y,pe,pe],Ue=[Sd,Qd,Md,Od,Vd,Wd,Bd,Cd,$d,se,Ge,Ie,Ke,function(a){Ye[a>>6&
|
||||
3].call(this,a)},Y,Y],Ye=[Y,function(a){a=Qc(this,a,65536);Kc(this,a);R(this,a);this.a-=11},function(a){var b=Mc(this);this.F=this.a;Rc(this,a,65536,b);R(this,b);this.a=this.F-je[this.c]},Y];
|
||||
function Ze(a){x.call(this,"ROM",a,Ze);this.X=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.j=a.file;this.s=q(this.j);if(this.j){a=this.j;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Ra(c.na,a,b),(a=ta(a,b))?(c.c=a.K,c.X=a.X):c.j=null);$e(c)})}}z(Ze);h=Ze.prototype;
|
||||
h.ha=function(a,b,c,d){this.g=b;this.a=c;this.D=d;$e(this)};h.ka=function(){this.X&&(this.D&&this.D.a(this.id,this.i,this.b,this.X),delete this.X);return!0};h.ja=function(){return!0};
|
||||
function $e(a){if(!Va(a)){if(a.j){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[Ze.prototype.Xc,Ze.prototype.Qd,null,null,null,a.b>>1],c);if(cb(a.g,a,b,256,a.wa)){b=a.m=!0;break a}}else if(Fb(a.g,b,a.b,fc)){for(c=0;c<a.c.length;c++)a.g.Ya(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.f?
|
||||
b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Eb(d.g,d.i,d.b);Db(d.g,e,d.b,f)}a.m||delete a.c}}}F(a)}}h.Xc=function(a){return this.c[a-this.i]};h.Qd=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ze(d);C(d,c)}});
|
||||
function af(a){x.call(this,"RAM",a,af);this.X=this.c=null;this.j=a.addr;this.i=a.size;this.fa=a.load;this.ea=a.exec;this.f=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.na,a,b),(a=ta(a,b))?(c.c=a.K,c.X=a.X,null==c.fa&&(c.fa=a.fa),null==c.ea&&(c.ea=a.ea)):c.b=null);bf(c)})}}z(af);
|
||||
af.prototype.ha=function(a,b,c,d){this.g=b;this.a=c;this.D=d;bf(this)};af.prototype.ka=function(){this.X&&(this.D&&this.D.a(this.id,this.j,this.i,this.X),delete this.X);return!0};af.prototype.ja=function(){return!0};function bf(a){if(a.g&&(!a.f&&a.i&&Fb(a.g,a.j,a.i,Ib)&&(a.f=!0),!Va(a))){if(!a.f)t("No RAM allocated");else if(a.b){if(!a.c||!a.g)return;cf(a,a.c,a.fa,a.ea,a.j)}F(a)}}
|
||||
af.prototype.reset=function(){if(this.f){for(var a=this.g,b=this.j,c=this.i,d=b&a.j,b=b>>>a.c;0<c&&b<a.g.length;){var e=a.g[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Fb(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&cf(this,this.c,this.fa,this.ea,this.j,!0)}};
|
||||
function cf(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ya(p++,b[u++]&255);else p&1?G(a.a):Dc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Ya(c+
|
||||
e,b[e]);null!=d&&Dc(a.a,d,f);g=!0}return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new af(d);C(d,c)}});function df(a){x.call(this,"Keyboard",a,df);F(this)}z(df);df.prototype.$=function(){return!1};df.prototype.ha=function(a,b,c,d){this.j=a;this.a=c;this.D=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new df(d);C(d,c)}});
|
||||
function Z(a){this.C=a.baudReceive||9600;this.I=a.baudTransmit||9600;this.R=a.upperCase;this.f=this.m=null;this.J=a.tabSize;this.F=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=ef;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.$(null,a,b))}this.v=this.A=null;this.exports={connect:this.Mb,receiveData:this.zb}}z(Z);var ef="buffer";h=Z.prototype;
|
||||
h.$=function(a,b,c){var d=this;switch(b){case ef:return this.o[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.zb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.zb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;var e=this;this.aa=Vb(48,4);this.N=Rb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Sb(e.a,e.aa))});this.da=Vb(52,4);this.P=Rb(this.a,function(){e.c|=128;e.c&64&&Sb(e.a,e.da)});cb(b,this,ff);F(this)};
|
||||
h.Mb=function(){if(!this.v){var a=rc(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.wa)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Mb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.ja=function(a){return a?this.save():!0};h.reset=function(){gf(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return gf(this)};function gf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.zb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Tb(this.a,this.N,1E3/Math.round(this.C/10));return!0};h.Rc=function(){return this.b&65534};
|
||||
h.Kd=function(a){this.b=this.b&-112|a&111};h.Qc=function(){this.b&=-129;0<this.i.length&&Tb(this.a,this.N,1E3/Math.round(this.C/10));return this.w};h.Jd=function(){};h.ld=function(){return this.c};h.de=function(a){128==(this.c&192)&&a&64&&Tb(this.a,this.P,1E3/Math.round(this.I/10));this.c=this.c&-70|a&69};h.kd=function(){return 0};
|
||||
h.ce=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.F&&!this.s&&c&&(b=String.fromCharCode(this.F)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.T(this.m),
|
||||
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Sb(this.a,this.P,1E3/Math.round(this.I/10))}};var ff={},df=(ff[65392]=[null,null,Z.prototype.Rc,Z.prototype.Kd,"RCSR"],ff[65394]=[null,null,Z.prototype.Qc,Z.prototype.Jd,"RBUF"],ff[65396]=[null,null,Z.prototype.ld,Z.prototype.de,"XCSR"],ff[65398]=[null,null,Z.prototype.kd,Z.prototype.ce,"XBUF"],ff);Ha(function(){for(var a=C(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Z(d);B(d,c)}});
|
||||
function Yb(a){v.call(this,"PC11",a,Yb);this.c=a.autoMount||null;this.m=0;this.P=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=gf;this.f=hf;this.C=this.i="";this.K=this.fa=this.ea=null;this.I=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window}y(Yb);var gf="",hf=0;h=Yb.prototype;
|
||||
h.$=function(a,b,c){var d=this,e=hf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
|
||||
d.o.listTapes;a&&jf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[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;jf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;this.J=kf(a);var e=this;if((this.c=pc(this.j,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.N=Tb(56,4);this.R=Qb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,lf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Rb(e.a,e.N))});cb(b,this,mf);nf(this,"None",gf,!0);this.F&&nf(this,"Local Tape","?");
|
||||
nf(this,"Remote Tape","??");of(this)||D(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function of(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?pf(a,c,b,1,!0):qf(a)}return!!a.m}
|
||||
function jf(a,b,c,d,e){if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;pf(a,b,c,d,!1,e)}else rf(a,!1)}function pf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,rf(a,!0),a.l.Fa?a.G("PC11 busy"):(e&&a.m++,sf(a,b,c,d,f)?g++:a.l.Fa=!0);g&&tf(a,a.C,a.i,a.f,a.K,a.fa,a.ea)}
|
||||
function sf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),tf(a,b,c,d,e),a.s="?");qf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):ua()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.j&&!a.j.l.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.na,e,f),(e=ta(e,f))&&tf(a,b,c,d,e.K,e.fa,e.ea));
|
||||
a.l.Fa=!1;a.m&&(a.m--,a.m||D(a));qf(a)})}function nf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function qf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
|
||||
function lf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=C(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function tf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.f=d;a.K=e;a.fa=f;a.ea=g;2==d?a.J&&af(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=gf,a.f=hf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),lf(a,0))}
|
||||
function rf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.s=gf,a.f=hf,qf(a))}h.save=function(){return(new P(this)).data()};h.restore=function(){return!0};h.Kc=function(){return this.b&65534};h.Dd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Rb(this.a,this.N)):(this.b&=-129,this.b|=2048,this.A=0,Sb(this.a,this.R,1E3/Math.round(this.P/10))));this.b=this.b&-66|a&65};h.Jc=function(){this.b&=-129;this.b|=2048;return this.A};h.Cd=function(){};
|
||||
var uf={},mf=(uf[65384]=[null,null,Yb.prototype.Kc,Yb.prototype.Dd,"PRS"],uf[65386]=[null,null,Yb.prototype.Jc,Yb.prototype.Cd,"PRB"],uf);function vf(a,b,c){v.call(this,"Disk",{id:a.na+".disk"+m(++wf,4)},vf);this.controller=a;this.j=a.j;this.D=a.D;this.f=b;this.ua=b.name;this.ub=b.ub;xf(this,c,b.V,b.Z,b.S,b.ga);D(this)}var wf=0;y(vf);h=vf.prototype;h.ha=function(a,b,c,d){this.D=d};
|
||||
function xf(a,b,c,d,e,f){a.mode=b;a.V=c;a.Z=d;a.S=e;a.ga=f;a.a=[];if("preload"!=a.mode){b=Array(a.V);for(c=0;c<b.length;c++){d=Array(a.Z);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=yf(null,c,e,g,a.ga,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
|
||||
function zf(a,b,c,d,e){var f=c;if(a.g)return!0;a.ua=b;a.Ea=c;a.Xb=q(c);a.g=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.V=e[0];a.Z=e[1];a.S=e[2];a.ga=e[3]||512;c=a.ga>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Z),E=0;E<w.length;E++)for(var V=w[E]=Array(a.S),za=0;za<V.length;za++){for(var Vb=yf(null,d,E,za+1,a.ga,0),Ne=Vb.data,jc=0;jc<c;jc++,f+=4)var ag=Ne[jc]=b.getInt32(f,
|
||||
!0),e=e+ag&-1;Vb.ba=c;V[za]=Vb}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.f,c,a.ua,a.Ea),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=ua()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ub?"":e)+"&format=json"));return!!r(f,
|
||||
null,!0,function(b,c,d){Af(a,b,c,d)})}
|
||||
function Af(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.O;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{Sa(a.controller.na,b,c);try{if(0<q(a.Xb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ua]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ga=l&&l.length||512;for(d=c=0;d<a.V;d++)for(f=0;f<a.Z;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var E=n<<2,V=w.length;V<E;V++)w[V]=p;Bf(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}yf(l,d,f);for(E=0;E<
|
||||
u.length;E++)c=c+u[E]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.ua)}catch(za){t("Disk image error ("+b+"): "+za.message)}}a.g&&(a.g.call(a.i,a.f,e,a.ua,a.Ea),a.g=null)}function yf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ge=b;a.he=c;a.la=a.ba=0;a.ta=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var k=g[b];if(!k&&f.cc&&b<f.Z)for(k=g[b]=Array(f.dc),g=0;g<k.length;g++)k[g]=yf(null,a,b,g+1,f.Rb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.cc&&9==f.Gb&&(d=k[g]=yf(null,a,b,f.Gb,f.Rb,0))}}e&&e(d,!1);return d};function Bf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Tb(this.a,this.P,1E3/Math.round(this.I/10))}};var hf={},ff=(hf[65392]=[null,null,Z.prototype.Rc,Z.prototype.Kd,"RCSR"],hf[65394]=[null,null,Z.prototype.Qc,Z.prototype.Jd,"RBUF"],hf[65396]=[null,null,Z.prototype.ld,Z.prototype.de,"XCSR"],hf[65398]=[null,null,Z.prototype.kd,Z.prototype.ce,"XBUF"],hf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}});
|
||||
function $b(a){x.call(this,"PC11",a,$b);this.c=a.autoMount||null;this.m=0;this.P=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=jf;this.f=kf;this.C=this.i="";this.K=this.fa=this.ea=null;this.I=-1;this.F=!Aa("Mobi")&&window&&"FileReader"in window}z($b);var jf="",kf=0;h=$b.prototype;
|
||||
h.$=function(a,b,c){var d=this,e=kf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
|
||||
d.o.listTapes;a&&lf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[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;lf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;this.J=mf(a);var e=this;if((this.c=rc(this.j,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.N=Vb(56,4);this.R=Rb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,nf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Sb(e.a,e.N))});cb(b,this,of);pf(this,"None",jf,!0);this.F&&pf(this,"Local Tape","?");
|
||||
pf(this,"Remote Tape","??");qf(this)||F(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function qf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?rf(a,c,b,1,!0):sf(a)}return!!a.m}
|
||||
function lf(a,b,c,d,e){if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;rf(a,b,c,d,!1,e)}else tf(a,!1)}function rf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,tf(a,!0),a.l.Fa?a.G("PC11 busy"):(e&&a.m++,uf(a,b,c,d,f)?g++:a.l.Fa=!0);g&&vf(a,a.C,a.i,a.f,a.K,a.fa,a.ea)}
|
||||
function uf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),vf(a,b,c,d,e),a.s="?");sf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.j&&!a.j.l.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.na,e,f),(e=ta(e,f))&&vf(a,b,c,d,e.K,e.fa,e.ea));
|
||||
a.l.Fa=!1;a.m&&(a.m--,a.m||F(a));sf(a)})}function pf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function sf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
|
||||
function nf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function vf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.f=d;a.K=e;a.fa=f;a.ea=g;2==d?a.J&&cf(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=jf,a.f=kf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),nf(a,0))}
|
||||
function tf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.s=jf,a.f=kf,sf(a))}h.save=function(){return(new P(this)).data()};h.restore=function(){return!0};h.Kc=function(){return this.b&65534};h.Dd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Sb(this.a,this.N)):(this.b&=-129,this.b|=2048,this.A=0,Tb(this.a,this.R,1E3/Math.round(this.P/10))));this.b=this.b&-66|a&65};h.Jc=function(){this.b&=-129;this.b|=2048;return this.A};h.Cd=function(){};
|
||||
var wf={},of=(wf[65384]=[null,null,$b.prototype.Kc,$b.prototype.Dd,"PRS"],wf[65386]=[null,null,$b.prototype.Jc,$b.prototype.Cd,"PRB"],wf);function xf(a,b,c){x.call(this,"Disk",{id:a.na+".disk"+m(++yf,4)},xf);this.controller=a;this.j=a.j;this.D=a.D;this.f=b;this.ua=b.name;this.ub=b.ub;zf(this,c,b.V,b.Z,b.S,b.ga);F(this)}var yf=0;z(xf);h=xf.prototype;h.ha=function(a,b,c,d){this.D=d};
|
||||
function zf(a,b,c,d,e,f){a.mode=b;a.V=c;a.Z=d;a.S=e;a.ga=f;a.a=[];if("preload"!=a.mode){b=Array(a.V);for(c=0;c<b.length;c++){d=Array(a.Z);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Af(null,c,e,g,a.ga,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
|
||||
function Bf(a,b,c,d,e){var f=c;if(a.g)return!0;a.ua=b;a.Ea=c;a.Xb=q(c);a.g=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.V=e[0];a.Z=e[1];a.S=e[2];a.ga=e[3]||512;c=a.ga>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Z),D=0;D<w.length;D++)for(var U=w[D]=Array(a.S),ya=0;ya<U.length;ya++){for(var Ub=Af(null,d,D,ya+1,a.ga,0),Oe=Ub.data,ic=0;ic<c;ic++,f+=4)var cg=Oe[ic]=b.getInt32(f,
|
||||
!0),e=e+cg&-1;Ub.ba=c;U[ya]=Ub}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.f,c,a.ua,a.Ea),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ub?"":e)+"&format=json"));return!!r(f,
|
||||
null,!0,function(b,c,d){Cf(a,b,c,d)})}
|
||||
function Cf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.O;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{Ra(a.controller.na,b,c);try{if(0<q(a.Xb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ua]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ga=l&&l.length||512;for(d=c=0;d<a.V;d++)for(f=0;f<a.Z;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var D=n<<2,U=w.length;U<D;U++)w[U]=p;Df(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Af(l,d,f);for(D=0;D<
|
||||
u.length;D++)c=c+u[D]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.ua)}catch(ya){t("Disk image error ("+b+"): "+ya.message)}}a.g&&(a.g.call(a.i,a.f,e,a.ua,a.Ea),a.g=null)}function Af(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ge=b;a.he=c;a.la=a.ba=0;a.ta=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var k=g[b];if(!k&&f.cc&&b<f.Z)for(k=g[b]=Array(f.dc),g=0;g<k.length;g++)k[g]=Af(null,a,b,g+1,f.Rb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.cc&&9==f.Gb&&(d=k[g]=Af(null,a,b,f.Gb,f.Rb,0))}}e&&e(d,!1);return d};function Df(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
||||
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f<a.la?(a.ba+=a.la-f,a.la=f):f>=a.la+a.ba&&(a.ba+=f-(a.la+a.ba)+1):(a.la=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function Cf(a,b){var c=a.Z*a.S,d=b/c|0;return d<a.V?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Df(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ea,this.b,this.V,this.Z,this.S,this.ga];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.la,p=g.la+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.la,k]}}return b};
|
||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?xf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+
|
||||
function Ef(a,b){var c=a.Z*a.S,d=b/c|0;return d<a.V?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Ff(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Ea,this.b,this.V,this.Z,this.S,this.ga];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var k=[],l=0,n=g.la,p=g.la+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.la,k]}}return b};
|
||||
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?zf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.la=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.ua+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=Cf(this,a++);)Ef(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
||||
function Ef(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){v.call(this,"RL11",a,N);this.f=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Ba("Mobi")&&window&&"FileReader"in window}y(N);h=N.prototype;
|
||||
h.$=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Ff(d,a)},!0;case "loadDrive":return this.o[b]=
|
||||
c,c.onclick=function(){var a=d.o.listDisks;a&&Gf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Cf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Df(a,k,l));b=btoa(b);a=a.Xb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=Ef(this,a++);)Gf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
||||
function Gf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RL11",a,N);this.f=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Aa("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype;
|
||||
h.$=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Hf(d,a)},!0;case "loadDrive":return this.o[b]=
|
||||
c,c.onclick=function(){var a=d.o.listDisks;a&&If(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Ef(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Ff(a,k,l));b=btoa(b);a=a.Xb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
|
||||
typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[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;Gf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;if((this.f=pc(this.j,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}Hf(this);this.F=Tb(112,5);cb(b,this,If,2097152);Jf(this,"None","",!0);this.A&&Jf(this,"Local Disk","?");Jf(this,"Remote Disk","??");Kf(this)||D(this)};
|
||||
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.j.Ib){for(a=0;a<this.b.length;a++)Lf(this,a,!0);Kf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ff(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Hf(this)};h.save=function(){return(new P(this)).data()};
|
||||
h.restore=function(a){return Hf(this,a[0])};function Kf(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Mf(a,g,f,e,!0)&&b&&D(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
|
||||
function Gf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Mf(a,e,b,c,!1,d)}else Lf(a,e)}
|
||||
function Mf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ea.toLowerCase()!=d.toLowerCase()&&(g++,Lf(a,b,!0),k.tb?a.G("RL11 busy"):(k.tb=!0,e&&(k.sb=!0,a.s++),k.jb=!!f,zf(new vf(a,k,"preload"),c,d,f,a.ec)&&g++));return g}
|
||||
h.ec=function(a,b,c,d,e){var f;a.tb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.V||f[1]>a.Z)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.xb)),b=null);b?(a.ca=b,a.ua=c,a.Ea=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.xb),a.sb||e),this.j&&vc(this.j)):a.jb=!1;a.sb&&(a.sb=!1,--this.s||D(this));Ff(this,a.xb)};
|
||||
function Jf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function Ff(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.jb?"?":c.Ea,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Lf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.ua="",d.Ea="",d.ca=null,d.jb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Ff(a,b))}
|
||||
function Hf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.xb=b;d.tb=d.jb=!1;d.name=c.wa;d.V=512;d.Z=2;d.S=40;d.ga=256;d.ub=!0;d.fe=0;d.ee=0;d.Gb=1;d.dc=d.S;d.Rb=d.ga;d.ie=0;d.je=null;d.ca||(d.Ea="");d.status=29|(512==d.V?128:0)}return!0}
|
||||
c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;If(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.ha=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.D=d;if((this.f=rc(this.j,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}Jf(this);this.F=Vb(112,5);cb(b,this,Kf,2097152);Lf(this,"None","",!0);this.A&&Lf(this,"Local Disk","?");Lf(this,"Remote Disk","??");Mf(this)||F(this)};
|
||||
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.j.Ib){for(a=0;a<this.b.length;a++)Nf(this,a,!0);Mf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Hf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Jf(this)};h.save=function(){return(new P(this)).data()};
|
||||
h.restore=function(a){return Jf(this,a[0])};function Mf(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!Of(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
|
||||
function If(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Of(a,e,b,c,!1,d)}else Nf(a,e)}
|
||||
function Of(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ea.toLowerCase()!=d.toLowerCase()&&(g++,Nf(a,b,!0),k.tb?a.G("RL11 busy"):(k.tb=!0,e&&(k.sb=!0,a.s++),k.jb=!!f,Bf(new xf(a,k,"preload"),c,d,f,a.ec)&&g++));return g}
|
||||
h.ec=function(a,b,c,d,e){var f;a.tb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.V||f[1]>a.Z)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.xb)),b=null);b?(a.ca=b,a.ua=c,a.Ea=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.xb),a.sb||e),this.j&&xc(this.j)):a.jb=!1;a.sb&&(a.sb=!1,--this.s||F(this));Hf(this,a.xb)};
|
||||
function Lf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
||||
function Hf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.jb?"?":c.Ea,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Nf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.ua="",d.Ea="",d.ca=null,d.jb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Hf(a,b))}
|
||||
function Jf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.xb=b;d.tb=d.jb=!1;d.name=c.wa;d.V=512;d.Z=2;d.S=40;d.ga=256;d.ub=!0;d.fe=0;d.ee=0;d.Gb=1;d.dc=d.S;d.Rb=d.ga;d.ie=0;d.je=null;d.ca||(d.Ea="");d.status=29|(512==d.V?128:0)}return!0}
|
||||
h.fc=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
|
||||
h.xc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Mb(this.g,f,u|w<<8);if(Pb(this.g)){k=8192;break}f+=2;if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};
|
||||
h.sd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){var u=Lb(this.g,f);if(Pb(this.g)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Uc=function(){return this.L&65535};
|
||||
h.xc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Nb(this.g,f,u|w<<8);if(Qb(this.g)){k=8192;break}f+=2;if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};
|
||||
h.sd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){var u=Mb(this.g,f);if(Qb(this.g)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Uc=function(){return this.L&65535};
|
||||
h.Nd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.xc;case 10:b||(b=this.sd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.V||f>=c.S?this.L|=37888:(g=(this.w&
|
||||
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.fc.bind(this)))}a&&(this.L|=129,this.L&64&&Rb(this.a,this.F))}};h.Sc=function(){return this.v};h.Ld=function(a){this.v=a&65534};h.Vc=function(){return this.c};h.Od=function(a){this.c=a};h.Wc=function(){return this.m};h.Pd=function(a){this.m=a};h.Tc=function(){return this.w};h.Md=function(a){this.w=a&63};
|
||||
var Nf={},If=(Nf[63744]=[null,null,N.prototype.Uc,N.prototype.Nd,"RLCS"],Nf[63746]=[null,null,N.prototype.Sc,N.prototype.Ld,"RLBA"],Nf[65284]=[null,null,N.prototype.Vc,N.prototype.Od,"RLDA"],Nf[65286]=[null,null,N.prototype.Wc,N.prototype.Pd,"RLMP"],Nf[65288]=[null,null,N.prototype.Tc,N.prototype.Md,"RLBE"],Nf);
|
||||
function Of(a,b,c){v.call(this,"Computer",a,Of);this.l.O=!1;Pf(this,b);this.A=pc(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=Qf;this.v=null;this.m=this.I=!1;this.P=pc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Rf(this);if(this.a=Ua("CPU",this.id)){this.D=Ua("Debugger",this.id);this.g=new ub({id:this.na+".bus",busWidth:this.N},this.a,this.D);var d,e=z(this.id);if((this.f=Ua("Panel",this.id))&&this.f.Va)for(b=0;b<e.length;b++)d=e[b],d.G=this.f.G,d.T=this.f.T,d.Va=this.f.Va;
|
||||
this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ha&&d.ha(this,this.g,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=pc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.m=!0,this.b=Qf),this.b&&(this.w=new P(this,
|
||||
"1.30.3"),Sf(this.w)?b=null:delete this.w);!b&&this.b&&(b=Tf(this))&&(this.m=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.s=null,g.m=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.v=b,g.I=!0);D(g)})}else D(this);this.o.power||(this.A=!0);!c&&this.A&&Uf(this,this.Xa)}else t("Unable to find CPU component")}y(Of);var Qf=0;
|
||||
function Pf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function pc(a,b,c){var d=b.toLowerCase(),d=Ma[b]||Ma[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Uf(a,b,c){for(var d=z(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Wa(f)){Wa(f,function(){Uf(a,b,c)});return}}b.call(a,c)}
|
||||
function Vf(a,b){var c=new P(a,"1.30.3","validate");if(Sf(c)&&Wf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Of.prototype;
|
||||
h.Xa=function(a){void 0===a&&(a=this.b||(this.v?1:Qf));if(!this.j){this.j++;var b=!1,c=!1;this.F=!1;var d=this.w||new P(this,"1.30.3");if(-1==a)b=!0;else if(a>Qf){if(Sf(d,this.v)){this.i=new P(this,"1.30.3","failsafe");Sf(this.i)&&(Xf(this,d),a=2,Yf(this.i));this.i.set("timestamp",sa());Zf(this.i);var e=this.b&&!this.m;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Wf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Sf(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Yf(d),Sf(d)?(c=Wf(d),e=!0):c=!1))}e&&Vf(this,c?d:null)}else 2==a&&d.clear()}else Vf(this);delete this.v;delete this.w}e=z(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=$f(this,g,d,b,c));b=[d,a,c];-1!=a?Uf(this,this.Hb,b):this.Hb(b)}};
|
||||
function $f(a,b,c,d,e){if(!b.l.O){b.l.O=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Qf,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.Lb)for(a=b.Lb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Hb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.l.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&($f(this,this.a,b,c,a),this.va(),this.a.Ua());this.F&&(Xf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.j=0};
|
||||
function Xf(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.3"};d.url=a.P;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function bg(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.30.3"),g=new P(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&F(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.O=!1,!1===d&&(e=null)));for(var k=z(a.id),l=0;l<k.length;l++){var n=k[l];n.l.O&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id,
|
||||
d)),c&&(n.l.O=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&cg(a,a.c,f.toString()),Zf(g)&&Zf(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.l.O=!1,b=a.o.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.g&&this.g.reset&&this.g.reset();this.a&&this.a.reset&&this.a.reset();for(var a=z(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.g&&c!==this.a&&c.reset&&c.reset()}this.va(-1)};
|
||||
h.start=function(a,b){for(var c=z(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.va(-1)};h.stop=function(a,b){for(var c=z(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.va(-1)};
|
||||
h.va=function(a){if(this.a){var b=this.a,c=b.o.speed;c&&(c.textContent=b.l.U&&b.da?b.da.toFixed(2)+"Mhz":"Stopped")}if(this.f&&(b=this.f,b.s)){if(!(0<a&&60>(b.w+=a))){for(a=0;a<b.a.h.length;a++)jb(b,"R"+a,b.a.h[a]);a=Wb(b.a);jb(b,"PS",a);jb(b,"NF",a&8?1:0,1);jb(b,"ZF",a&4?1:0,1);jb(b,"VF",a&2?1:0,1);jb(b,"CF",a&1?1:0,1);b.w=0}rb(b,"D",b.i,16);rb(b,"A",b.b,22);a=b.a.Ba?b.a.Ga&16?1:2:4;sb(b,"B22",a&1);sb(b,"B18",a&2);sb(b,"B16",a&4)}};
|
||||
h.$=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.j||(d.l.O?bg(d,!1,!0):Uf(d,d.Xa))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.l.O&&!d.j)if(d.b&&!d.s){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");bg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Ib=!0),d.Xa(Qf),d.Ib=!1)}else d.reset(),d.a&&d.a.Ua()},!0;case "save":if(ma(ua(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.o[b]=c,c.onclick=function(){var a=Rf(d,!0);if(a){var b=!!(d.b&&!d.s||d.C),c=bg(d,b);b?cg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Rf(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=dg(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||
function dg(a,b){a.c=null;b=r(ua()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Tf(a){var b=null;a.c&&(b=ua()+"/api/v1/user?req=load&user="+a.c+"&state="+eg(a,"1.30.3"));return b}
|
||||
function cg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=eg(a,"1.30.3");d.data=c;b=r(ua()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),Aa("user",""),a.c=null)}}
|
||||
function kf(a){var b;a=z(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function vc(a){if(a.Va){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Va.focus();window&&window.scrollTo(b,c)}}Ha(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Of(g,d,!0);B(g,f);g.A&&Uf(g,g.Xa)}});
|
||||
Ca.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ua("Computer",c.id))&&c.R&&!c.l.O&&c.Xa(-1)}});Ca.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ua("Computer",c.id))&&c.l.O&&bg(c,!(!c.b||c.s),!0)}});function P(a,b,c){this.id=a.id;this.key=eg(a,b,c);this.D=a.D;Yf(this,a.kc)}function eg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Yf(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Yf(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Zf(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Wf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Sf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:xa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var fg=0;
|
||||
function gg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):hg(k,a,b,c,d,e,f)})}
|
||||
function hg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Sa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?ig(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function ig(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(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 l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);ig(a,b,c)}})}else c(a,null)}
|
||||
function jg(a,b,c,d){function e(a){if(void 0===k){var b=g&&C(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--fg||Ja(!0));l=!1}var g,k,l=!0;fg++;Ra[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?gg(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--fg||Ja(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--fg||Ja(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?gg(b,a,d,!0,e,n):hg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ja(!1);return jg(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map
|
||||
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.fc.bind(this)))}a&&(this.L|=129,this.L&64&&Sb(this.a,this.F))}};h.Sc=function(){return this.v};h.Ld=function(a){this.v=a&65534};h.Vc=function(){return this.c};h.Od=function(a){this.c=a};h.Wc=function(){return this.m};h.Pd=function(a){this.m=a};h.Tc=function(){return this.w};h.Md=function(a){this.w=a&63};
|
||||
var Pf={},Kf=(Pf[63744]=[null,null,N.prototype.Uc,N.prototype.Nd,"RLCS"],Pf[63746]=[null,null,N.prototype.Sc,N.prototype.Ld,"RLBA"],Pf[63748]=[null,null,N.prototype.Vc,N.prototype.Od,"RLDA"],Pf[63750]=[null,null,N.prototype.Wc,N.prototype.Pd,"RLMP"],Pf[63752]=[null,null,N.prototype.Tc,N.prototype.Md,"RLBE"],Pf);
|
||||
function Qf(a,b,c){x.call(this,"Computer",a,Qf);this.l.O=!1;Rf(this,b);this.A=rc(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=Sf;this.v=null;this.m=this.I=!1;this.P=rc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Tf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.g=new vb({id:this.na+".bus",busWidth:this.N},this.a,this.D);var d,e=A(this.id);if((this.f=Ta("Panel",this.id))&&this.f.Va)for(b=0;b<e.length;b++)d=e[b],d.G=this.f.G,d.T=this.f.T,d.Va=this.f.Va;
|
||||
this.T("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ha&&d.ha(this,this.g,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=rc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.m=!0,this.b=Sf),this.b&&(this.w=new P(this,
|
||||
"1.30.3"),Uf(this.w)?b=null:delete this.w);!b&&this.b&&(b=Vf(this))&&(this.m=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.s=null,g.m=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.v=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Wf(this,this.Xa)}else t("Unable to find CPU component")}z(Qf);var Sf=0;
|
||||
function Rf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function rc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Wf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Wf(a,b,c)});return}}b.call(a,c)}
|
||||
function Xf(a,b){var c=new P(a,"1.30.3","validate");if(Uf(c)&&Yf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Qf.prototype;
|
||||
h.Xa=function(a){void 0===a&&(a=this.b||(this.v?1:Sf));if(!this.j){this.j++;var b=!1,c=!1;this.F=!1;var d=this.w||new P(this,"1.30.3");if(-1==a)b=!0;else if(a>Sf){if(Uf(d,this.v)){this.i=new P(this,"1.30.3","failsafe");Uf(this.i)&&(Zf(this,d),a=2,$f(this.i));this.i.set("timestamp",sa());ag(this.i);var e=this.b&&!this.m;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Yf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Uf(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),$f(d),Uf(d)?(c=Yf(d),e=!0):c=!1))}e&&Xf(this,c?d:null)}else 2==a&&d.clear()}else Xf(this);delete this.v;delete this.w}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=bg(this,g,d,b,c));b=[d,a,c];-1!=a?Wf(this,this.Hb,b):this.Hb(b)}};
|
||||
function bg(a,b,c,d,e){if(!b.l.O){b.l.O=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Sf,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.Lb)for(a=b.Lb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Hb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.l.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(bg(this,this.a,b,c,a),this.va(),this.a.Ua());this.F&&(Zf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.j=0};
|
||||
function Zf(a,b){if(ua("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.3"};d.url=a.P;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function dg(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.30.3"),g=new P(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.O=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l<k.length;l++){var n=k[l];n.l.O&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id,
|
||||
d)),c&&(n.l.O=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&eg(a,a.c,f.toString()),ag(g)&&ag(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.l.O=!1,b=a.o.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.g&&this.g.reset&&this.g.reset();this.a&&this.a.reset&&this.a.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.g&&c!==this.a&&c.reset&&c.reset()}this.va(-1)};
|
||||
h.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.va(-1)};h.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.va(-1)};
|
||||
h.va=function(a){if(this.a){var b=this.a,c=b.o.speed;c&&(c.textContent=b.l.U&&b.da?b.da.toFixed(2)+"Mhz":"Stopped")}if(this.f&&(b=this.f,b.s)){if(!(0<a&&60>(b.w+=a))){for(a=0;a<b.a.h.length;a++)kb(b,"R"+a,b.a.h[a]);a=Yb(b.a);kb(b,"PS",a);kb(b,"NF",a&8?1:0,1);kb(b,"ZF",a&4?1:0,1);kb(b,"VF",a&2?1:0,1);kb(b,"CF",a&1?1:0,1);b.w=0}sb(b,"D",b.i,16);sb(b,"A",b.b,22);a=b.a.Ba?b.a.Ga&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",a&4)}};
|
||||
h.$=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.j||(d.l.O?dg(d,!1,!0):Wf(d,d.Xa))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.l.O&&!d.j)if(d.b&&!d.s){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");dg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Ib=!0),d.Xa(Sf),d.Ib=!1)}else d.reset(),d.a&&d.a.Ua()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.o[b]=c,c.onclick=function(){var a=Tf(d,!0);if(a){var b=!!(d.b&&!d.s||d.C),c=dg(d,b);b?eg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Tf(a,b){var c=a.c;c||((c=xa("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=fg(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||
function fg(a,b){a.c=null;b=r(v()+"/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){t(d.message+" ("+c+")")}return a.c}function Vf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+gg(a,"1.30.3"));return b}
|
||||
function eg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=gg(a,"1.30.3");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.G("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.G(c),za("user",""),a.c=null)}}
|
||||
function mf(a){var b;a=A(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function xc(a){if(a.Va){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Va.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Qf(g,d,!0);C(g,f);g.A&&Wf(g,g.Xa)}});
|
||||
Ba.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.l.O&&c.Xa(-1)}});Ba.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.l.O&&dg(c,!(!c.b||c.s),!0)}});function P(a,b,c){this.id=a.id;this.key=gg(a,b,c);this.D=a.D;$f(this,a.kc)}function gg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){$f(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function $f(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function ag(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Yf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Uf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=xa(a.key))?(a[a.id]=b,a.a=!0):!1}var hg=0;
|
||||
function ig(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):jg(k,a,b,c,d,e,f)})}
|
||||
function jg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?kg(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function kg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(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 l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);kg(a,b,c)}})}else c(a,null)}
|
||||
function lg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--hg||Ia(!0));l=!1}var g,k,l=!0;hg++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?ig(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--hg||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--hg||Ia(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ig(b,a,d,!0,e,n):jg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return lg(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map
|
||||
|
|
|
|||
Loading…
Reference in a new issue