Merge branch 'next-release'
This commit is contained in:
commit
31d634eb72
28 changed files with 652 additions and 509 deletions
|
|
@ -44,7 +44,7 @@ Running Paper Tape Diagnostics
|
|||
|
||||
Instructions for running "TEST 1 - BRANCH" through "TEST 12 - JUMP" come from the
|
||||
[MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQAB-B-D_User_Reference_Manual_Oct73.pdf),
|
||||
p. 19:
|
||||
page 19:
|
||||
|
||||
MAINDEC-11-D0AA to D0LA (NEW NUMBER - DZKAA to DZKAL)
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ so for now, I'm just going to pick out selected tapes and archive them here.
|
|||
|
||||
From [bitsavers.org](http://bitsavers.trailing-edge.com/bits/DEC/pdp11/papertapeimages/20040101/), Tray 02:
|
||||
|
||||
* Tape 04: [MAINDEC-11-DEQKC-B1-PB 06/12/78; 11/70 cpu instruction exerciser; (c)1975,76](#md-11-1170-cpu-exerciser)
|
||||
* Tape 04: [MAINDEC-11-DEQKC-B1-PB 06/12/78; 11/70 cpu instruction exerciser; (c)1975,76](#md-11-1170-cpu-exerciser) [[1980 Listing](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7996E-MC__PDP11-70-74__11-70_INST_EXR__CEQKCE0__%28C%2975,80.pdf)]
|
||||
|
||||
MD-11 11/70 CPU EXERCISER
|
||||
-------------------------
|
||||
|
|
@ -336,7 +336,7 @@ I disassembled the code responsible for that failure:
|
|||
I wasn't able to locate a source code listing for this particular (1978) version of the 11/70 CPU Instruction Exerciser,
|
||||
but I did find another useful document,
|
||||
[MAINDEC-11-DCQKC 11/40 and 11/45 INSTRUCTION EXERCISER (Sep 1974)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DCQKC-D-D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf),
|
||||
where I discovered a matching test sequence on p. 86.
|
||||
where I discovered a matching test sequence on page 86.
|
||||
|
||||
Here's an excerpt:
|
||||
|
||||
|
|
@ -373,6 +373,13 @@ to trap when SP is 150. That contradicts this newer test (ie, that TST should n
|
|||
trap "BECAUSE TST IS A NON MODIFYING INST"). For this and other reasons, PDPjs now installs different
|
||||
checkStackLimit() handlers based on the CPU model.
|
||||
|
||||
UPDATE: Another (1980) version of the source code for this diagnostic has been located and archived
|
||||
with the rest of our [DEC PDP-11 Diagnostic Publications](/pubs/dec/pdp11/diags/):
|
||||
|
||||
- [CEQKCE0 11/70 INSTRUCTION EXERCISER (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7994E-MC_CEQKCE0_1170_INSTRUCTION_EXERCISER_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7996E-MC__PDP11-70-74__11-70_INST_EXR__CEQKCE0__%28C%2975,80.pdf)]
|
||||
|
||||
You'll find the above excerpt on page 114, at address 024624.
|
||||
|
||||
---
|
||||
|
||||
Here's the next test that PDPjs failed. Again, I found the same sequence of instructions in the 11/40 and 11/45
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="rk11" commands='bp 33330 "bp 037772; bp 041734; bp 042164"'/>
|
||||
<debugger id="debugger" base="8" messages="rk11|pc11" commands='bp 033330 "bp 037772; bp 041734; bp 042164"'/>
|
||||
<device ref="/devices/pdp11/pc11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rk11/default.xml"/>
|
||||
<device ref="/devices/pdp11/rl11/default.xml"/>
|
||||
|
|
|
|||
|
|
@ -975,6 +975,7 @@ MarkOut.prototype.convertMDLinks = function(sBlock)
|
|||
} else {
|
||||
sURL = net.encodeURL(sURL, this.req, this.fDebug);
|
||||
}
|
||||
sURL = sURL.replace(/_/g, "%5F"); // this helps prevent emphasis detection in URLs
|
||||
sBlock = str.replaceAll(aMatch[0], '<' + sTag + ' ' + sType + '="' + sURL + '"' + sTitle + '>' + sText + '</' + sTag + '>', sBlock);
|
||||
}
|
||||
return sBlock;
|
||||
|
|
|
|||
|
|
@ -1043,7 +1043,7 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
|
|||
kbd.addActiveKey(simCode);
|
||||
};
|
||||
}(this, sBinding, Keyboard.SOFTCODES[sBinding]);
|
||||
var fnUp = function (kbd, sKey, simCode) {
|
||||
var fnUp = function(kbd, sKey, simCode) {
|
||||
return function onKeyboardBindingUp(event) {
|
||||
kbd.removeActiveKey(simCode);
|
||||
};
|
||||
|
|
@ -1655,7 +1655,7 @@ Keyboard.prototype.injectKeysFromBuffer = function(msDelay)
|
|||
this.addActiveKey(ch, true);
|
||||
}
|
||||
if (this.sInjectBuffer.length > 0) {
|
||||
setTimeout(function (kbd) {
|
||||
setTimeout(function(kbd) {
|
||||
return function onInjectKeyTimeout() {
|
||||
kbd.injectKeysFromBuffer(msDelay);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,29 +9,94 @@ PDP-11 Machine Emulation Module (PDPjs)
|
|||
|
||||
Overview
|
||||
---
|
||||
PDPjs, our [PDP-11 Machine](/devices/pdp11/machine/) emulation module, is adapted from
|
||||
the [PDP-11/70 Emulator (v1.4)](http://skn.noip.me/pdp11/pdp11.html) written by
|
||||
Paul Nankervis.
|
||||
PDPjs, our [PDP-11 Machine](/devices/pdp11/machine/) emulation module, was written in 2016. It was adapted from
|
||||
the [PDP-11/70 Emulator (v1.4)](http://skn.noip.me/pdp11/pdp11.html) written by Paul Nankervis.
|
||||
|
||||
PDPjs is currently comprised of the following non-shared components, as listed in
|
||||
[package.json](../../package.json) (see the *pdp11Files* property):
|
||||
PDPjs is currently comprised of the following PDP-11 components, as listed in [package.json](../../package.json)
|
||||
(see the *pdp11Files* property):
|
||||
|
||||
* [bus.js](/modules/pdp11/lib/bus.js)
|
||||
* [computer.js](/modules/pdp11/lib/computer.js)
|
||||
* [cpu.js](/modules/pdp11/lib/cpu.js)
|
||||
* [cpuops.js](/modules/pdp11/lib/cpuops.js)
|
||||
* [cpustate.js](/modules/pdp11/lib/cpustate.js)
|
||||
* [debugger.js](/modules/pdp11/lib/debugger.js)
|
||||
* [defines.js](/modules/pdp11/lib/defines.js)
|
||||
* [device.js](/modules/pdp11/lib/device.js)
|
||||
* [disk.js](/modules/pdp11/lib/disk.js)
|
||||
* [keyboard.js](/modules/pdp11/lib/keyboard.js)
|
||||
* [memory.js](/modules/pdp11/lib/memory.js)
|
||||
* [messages.js](/modules/pdp11/lib/messages.js)
|
||||
* [panel.js](/modules/pdp11/lib/panel.js)
|
||||
* [bus.js](/modules/pdp11/lib/bus.js)
|
||||
* [device.js](/modules/pdp11/lib/device.js)
|
||||
* [memory.js](/modules/pdp11/lib/memory.js)
|
||||
* [cpu.js](/modules/pdp11/lib/cpu.js)
|
||||
* [cpustate.js](/modules/pdp11/lib/cpustate.js)
|
||||
* [cpuops.js](/modules/pdp11/lib/cpuops.js)
|
||||
* [rom.js](/modules/pdp11/lib/rom.js)
|
||||
* [ram.js](/modules/pdp11/lib/ram.js)
|
||||
* [keyboard.js](/modules/pdp11/lib/keyboard.js)
|
||||
* [serialport.js](/modules/pdp11/lib/serialport.js)
|
||||
* [pc11.js](/modules/pdp11/lib/pc11.js)
|
||||
* [disk.js](/modules/pdp11/lib/disk.js)
|
||||
* [ram.js](/modules/pdp11/lib/ram.js)
|
||||
* [rk11.js](/modules/pdp11/lib/rk11.js)
|
||||
* [rl11.js](/modules/pdp11/lib/rl11.js)
|
||||
* [debugger.js](/modules/pdp11/lib/debugger.js)
|
||||
* [computer.js](/modules/pdp11/lib/computer.js)
|
||||
* [rom.js](/modules/pdp11/lib/rom.js)
|
||||
* [serialport.js](/modules/pdp11/lib/serialport.js)
|
||||
|
||||
Since this module was written in 2016, it seemed appropriate to start adopting some of the more useful features of
|
||||
[ECMAScript](http://www.ecma-international.org/ecma-262/6.0/index.html) 2015 (aka ES6), including:
|
||||
|
||||
* Classes
|
||||
* *const* and *let*
|
||||
* Computed Properties
|
||||
* Default Parameters
|
||||
* Octal and Binary Constants
|
||||
* Template Literals
|
||||
- String Interpolation (i.e., ${*expr*})
|
||||
* New Built-in Methods
|
||||
- String.repeat()
|
||||
* *import* and *export*
|
||||
|
||||
However, I've still configured the Closure Compiler to "transpile" to ECMAScript 5 (aka ES5), because some people
|
||||
may still be using older browsers that don't support ES6 -- or at least the subset of ES6 features I'm currently
|
||||
using.
|
||||
|
||||
Eventually, I need to do some performance testing and determine whether the ES6 version performs any faster and/or
|
||||
consumes fewer resources than the ES5 version. If it does, then I should either bite the bullet and generate ES6 code,
|
||||
or generate both versions and use a loader that detects the browser's capabilities and loads the appropriate version.
|
||||
|
||||
Caveats
|
||||
-------
|
||||
|
||||
### Shared modules
|
||||
|
||||
All PCjs machines rely on shared modules that are normally stored in [/shared/lib](/shared/lib/). However, until
|
||||
ALL the machines have been converted to use ES6 classes, shared code must now exist in two flavors:
|
||||
[/shared/lib](/shared/lib/) and [/shared/es6](/shared/es6/).
|
||||
|
||||
Once all the other machines have been converted to use ES6 classes, the shared ES6 code will be folded back into
|
||||
[/shared/lib](/shared/lib/), and the temporary ES6 folder will go away. Obviously, there is incentive for me to do
|
||||
this sooner rather than later, since in the interim, I must make any changes to shared code in both places.
|
||||
|
||||
There's also a less obvious problem: if you load a web page that attempts to load two or more PCjs machines, one of
|
||||
which uses [/shared/lib](/shared/lib/) and another of which uses [/shared/es6](/shared/es6/), at least one of them will
|
||||
fail to start, because the two sets of shared code cannot coexist. Well, they *could* have coexisted if I had been
|
||||
willing to change the names of all the shared global objects (like **Component**), but I wasn't.
|
||||
|
||||
### *import* and *export*
|
||||
|
||||
With regard to *import* and *export* statements, the main reason I use them is to inform my development environment
|
||||
(WebStorm) about each file's dependencies, thereby preventing inspection warnings. And ultimately, I plan to make PDPjs
|
||||
run as a Node application, so explicitly declaring all imports and exports will be required, but for now, it's just
|
||||
a web application, so strictly speaking, they're not required.
|
||||
|
||||
When loading uncompiled PDPjs files into a web browser, the Node-based web server bundled with PCjs still relies on
|
||||
the `<script>` tag to load all JavaScript files, and as far as I know, no browser currently knows what to do with the
|
||||
*import* and *export* keywords under those conditions. Chrome, for example, will immediately throw an exception when
|
||||
it encounters a file containing them.
|
||||
|
||||
As a work-around, the bundled web server intercepts all requests for .js files and inserts line comments in front of
|
||||
every *import* and *export* statement, so that your web browser won't barf on them. The statements are completely
|
||||
superfluous anyway, since the web server generates `<script>` tags for all the necessary scripts, in the order they are
|
||||
listed in [package.json](../../package.json).
|
||||
|
||||
This work-around assumes that all *export* statements appear AFTER the object they're exporting; e.g.:
|
||||
|
||||
export default ComputerPDP11;
|
||||
|
||||
and NOT as part of the object declaration; e.g.:
|
||||
|
||||
export default class ComputerPDP11 extends Component { ... }
|
||||
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ class BusPDP11 extends Component {
|
|||
var block = this.aBusBlocks[iBlock];
|
||||
info.cbTotal += block.size;
|
||||
if (block.size) {
|
||||
info.aBlocks.push(Usr.initBitFields(BlockInfoPDP11, iBlock, 0, 0, block.type));
|
||||
info.aBlocks.push(/** @type {BlockInfoPDP11} */ (Usr.initBitFields(BlockInfoPDP11, iBlock, 0, 0, block.type)));
|
||||
info.cBlocks++
|
||||
}
|
||||
iBlock++;
|
||||
|
|
@ -982,7 +982,7 @@ class BusPDP11 extends Component {
|
|||
var fnWriteWord = afn[3]? afn[3].bind(component) : null;
|
||||
|
||||
/*
|
||||
* As discussed in the IOController comments above, when handlers are being registered for these
|
||||
* As discussed in the IOController comments below, 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) {
|
||||
|
|
@ -1131,12 +1131,14 @@ class BusPDP11 extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
BusPDP11.IOPAGE_16BIT = 0xE000; /*000160000*/ // eg, PDP-11/20
|
||||
BusPDP11.IOPAGE_18BIT = 0x3E000; /*000760000*/ // eg, PDP-11/45
|
||||
BusPDP11.IOPAGE_16BIT = 0x00E000; /*000160000*/ // eg, PDP-11/20
|
||||
BusPDP11.IOPAGE_18BIT = 0x03E000; /*000760000*/ // eg, PDP-11/45
|
||||
BusPDP11.IOPAGE_22BIT = 0x3FE000; /*017760000*/ // eg, PDP-11/70
|
||||
BusPDP11.IOPAGE_LENGTH = 0x2000; // ie, 8Kb
|
||||
BusPDP11.IOPAGE_LENGTH = 0x002000; // ie, 8Kb
|
||||
BusPDP11.IOPAGE_MASK = BusPDP11.IOPAGE_LENGTH - 1;
|
||||
|
||||
BusPDP11.MASK_18BIT = 0x03FFFF; /*000777777*/
|
||||
|
||||
BusPDP11.UNIBUS_22BIT = 0x3C0000; /*017000000*/
|
||||
BusPDP11.MASK_22BIT = 0x3FFFFF; /*017777777*/
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ import MemoryPDP11 from "./memory";
|
|||
* queue would constantly grow and shrink as requests were issued and dispatched, and as long as there was something
|
||||
* in the queue, the CPU was constantly examining it.
|
||||
*
|
||||
* Now we are trying something more efficient. First, for devices that require delays (like a serial port's receiver
|
||||
* and transmitter buffer registers that are supposed to "clock" the data in and out at a specific baud rate), the
|
||||
* Now we are trying something more efficient. First, for devices that require delays (like the SerialPort's receiver
|
||||
* and transmitter buffer registers, which are supposed to "clock" the data in and out at a specific baud rate), the
|
||||
* CPU offers timer services that will "fire" a callback after a specified delay, which are much more efficient than
|
||||
* requiring the CPU to dive into an interrupt queue and decrement delay counts on every instruction.
|
||||
*
|
||||
|
|
@ -337,11 +337,29 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
this.mmuLastPage = 0;
|
||||
this.mmuMask = 0x3ffff;
|
||||
|
||||
this.addrLast = 0; // this is queried by the Panel when it's not using its own ADDRESS register
|
||||
this.opLast = 0; // stores the PC and any auto-incs or auto-decs from the last opcode; used to update MMR1 and MMR2
|
||||
/*
|
||||
* This is queried and displayed by the Panel when it's not displaying its own ADDRESS register
|
||||
* (which takes precedence when, for example, you've manually halted the CPU and are independently
|
||||
* examining the contents of other addresses).
|
||||
*
|
||||
* We initialize it to whatever the current PC is, because according to @paulnank's pdp11.js: "Reset
|
||||
* displays next instruction address" and initMMU() is called on a RESET.
|
||||
*/
|
||||
this.addrLast = this.regsGen[7];
|
||||
|
||||
/*
|
||||
* This stores the PC in the lower 16 bits, and any auto-incs or auto-decs from the last opcode in the
|
||||
* upper 16 bits; the lower 16 bits are used to update MMR2, and the upper 16 bits are used to update MMR1.
|
||||
* The upper bits are automatically zeroed at the start of every operation when PC is copied to opLast.
|
||||
*/
|
||||
this.opLast = 0;
|
||||
|
||||
this.resetIRQs();
|
||||
|
||||
/*
|
||||
* As initCPU() explains, we shouldn't be calling this function until well after initBus() has been
|
||||
* called, but we still make absolutely sure we have Bus access.
|
||||
*/
|
||||
if (this.bus) {
|
||||
this.setMemoryAccess();
|
||||
this.addrInvalid = this.bus.getMemoryLimit(MemoryPDP11.TYPE.RAM);
|
||||
|
|
@ -479,8 +497,8 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
getMMR1()
|
||||
{
|
||||
/*
|
||||
* If updates to MMR1 have not been shut off (ie, MMR0.ABORT bits are clear),
|
||||
* then we are allowed to sync MMR1 with its real-time counterpart in opLast.
|
||||
* If updates to MMR1 have not been shut off (ie, MMR0.ABORT bits are clear), then we are allowed
|
||||
* to sync MMR1 with its real-time counterpart in opLast.
|
||||
*/
|
||||
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
|
||||
this.regMMR1 = (this.opLast >> 16) & 0xffff;
|
||||
|
|
@ -501,8 +519,8 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
getMMR2()
|
||||
{
|
||||
/*
|
||||
* If updates to MMR2 have not been shut off (ie, MMR0.ABORT bits are clear),
|
||||
* then we are allowed to sync MMR2 with its real-time counterpart in opLast.
|
||||
* If updates to MMR2 have not been shut off (ie, MMR0.ABORT bits are clear), then we are allowed
|
||||
* to sync MMR2 with its real-time counterpart in opLast.
|
||||
*/
|
||||
if (!(this.regMMR0 & PDP11.MMR0.ABORT)) {
|
||||
this.regMMR2 = this.opLast & 0xffff;
|
||||
|
|
@ -530,14 +548,14 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
setMMR3(newMMR3)
|
||||
{
|
||||
/*
|
||||
* Don't allow the 11/45 to use 22-bit addressing or the UNIBUS map
|
||||
* Don't allow the 11/45 to use 22-bit addressing or the UNIBUS map.
|
||||
*/
|
||||
if (this.model < PDP11.MODEL_1170) {
|
||||
newMMR3 &= ~(PDP11.MMR3.MMU_22BIT | PDP11.MMR3.UNIBUS_MAP);
|
||||
}
|
||||
if (this.regMMR3 != newMMR3) {
|
||||
this.regMMR3 = newMMR3;
|
||||
this.mmuMask = (newMMR3 & PDP11.MMR3.MMU_22BIT)? 0x3fffff : 0x3ffff;
|
||||
this.mmuMask = (newMMR3 & PDP11.MMR3.MMU_22BIT)? BusPDP11.MASK_22BIT : BusPDP11.MASK_18BIT;
|
||||
this.setMemoryAccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -817,6 +835,26 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
return pc;
|
||||
}
|
||||
|
||||
/**
|
||||
* branch(opCode)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} opCode
|
||||
* @param {boolean|number} condition
|
||||
*/
|
||||
branch(opCode, condition)
|
||||
{
|
||||
if (condition) {
|
||||
var off = ((opCode << 24) >> 23);
|
||||
if (DEBUG && DEBUGGER && this.dbg && off == -2) {
|
||||
this.dbg.stopInstruction("branch to self");
|
||||
}
|
||||
this.setPC(this.getPC() + off);
|
||||
this.nStepCycles -= 2;
|
||||
}
|
||||
this.nStepCycles -= (2 + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* getPC()
|
||||
*
|
||||
|
|
@ -2151,6 +2189,9 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
/**
|
||||
* getByteChecked(addr)
|
||||
*
|
||||
* This is the getByte() handler whenever the Debugger has one or more virtual memory READ breakpoints set;
|
||||
* otherwise, getByte() is bound to Bus.getByte().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @return {number}
|
||||
|
|
@ -2166,6 +2207,9 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
/**
|
||||
* getWordChecked(addr)
|
||||
*
|
||||
* This is the getWord() handler whenever the Debugger has one or more virtual memory READ breakpoints set;
|
||||
* otherwise, getWord() is bound to Bus.getWord().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @return {number}
|
||||
|
|
@ -2181,6 +2225,9 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
/**
|
||||
* setByteChecked(addr, data)
|
||||
*
|
||||
* This is the setByte() handler whenever the Debugger has one or more virtual memory WRITE breakpoints set;
|
||||
* otherwise, setByte() is bound to Bus.setByte().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @param {number} data
|
||||
|
|
@ -2196,6 +2243,9 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
/**
|
||||
* setWordChecked(addr, data)
|
||||
*
|
||||
* This is the setWord() handler whenever the Debugger has one or more virtual memory WRITE breakpoints set;
|
||||
* otherwise, setWord() is bound to Bus.setWord().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @param {number} data
|
||||
|
|
@ -2767,26 +2817,6 @@ class CPUStatePDP11 extends CPUPDP11 {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* branch(opCode)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} opCode
|
||||
* @param {boolean|number} condition
|
||||
*/
|
||||
branch(opCode, condition)
|
||||
{
|
||||
if (condition) {
|
||||
var off = ((opCode << 24) >> 23);
|
||||
if (DEBUG && DEBUGGER && this.dbg && off == -2) {
|
||||
this.dbg.stopInstruction("branch to self");
|
||||
}
|
||||
this.setPC(this.getPC() + off);
|
||||
this.nStepCycles -= 2;
|
||||
}
|
||||
this.nStepCycles -= (2 + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* stepCPU(nMinCycles)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ import MessagesPDP11 from "./messages";
|
|||
* aCmds preprocessed commands (from sCmd)
|
||||
*
|
||||
* @typedef {{
|
||||
* addr:(number),
|
||||
* addr:(number|null),
|
||||
* fPhysical:(boolean),
|
||||
* fTemporary:(boolean),
|
||||
* nBase:(number|undefined),
|
||||
|
|
@ -203,7 +203,7 @@ class DebuggerPDP11 extends Debugger {
|
|||
* getAddr(dbgAddr, fWrite, nb)
|
||||
*
|
||||
* @this {DebuggerPDP11}
|
||||
* @param {DbgAddrPDP11|null|undefined} dbgAddr
|
||||
* @param {DbgAddrPDP11|null} [dbgAddr]
|
||||
* @param {boolean} [fWrite]
|
||||
* @param {number} [nb] number of bytes to check (1 or 2); default is 1
|
||||
* @return {number} is the corresponding linear address, or PDP11.ADDR_INVALID
|
||||
|
|
@ -221,14 +221,14 @@ class DebuggerPDP11 extends Debugger {
|
|||
* Returns a NEW DbgAddrPDP11 object, initialized with specified values and/or defaults.
|
||||
*
|
||||
* @this {DebuggerPDP11}
|
||||
* @param {number} [addr]
|
||||
* @param {number|null} [addr]
|
||||
* @param {boolean} [fPhysical]
|
||||
* @param {number} [nBase]
|
||||
* @return {DbgAddrPDP11}
|
||||
*/
|
||||
newAddr(addr, fPhysical, nBase)
|
||||
{
|
||||
return {addr: addr || 0, fPhysical: fPhysical || false, fTemporary: false, nBase: nBase};
|
||||
return {addr: addr || null, fPhysical: fPhysical || false, fTemporary: false, nBase: nBase};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2918,7 +2918,7 @@ class DebuggerPDP11 extends Debugger {
|
|||
* TODO: Tweak this output to accommodate 18-bit machines as well as 22-bit machines.
|
||||
*/
|
||||
var fPhysical = (dbgAddr.fPhysical || dbgAddr.addr > 0xffff);
|
||||
var a = this.cpu.getAddrInfo(dbgAddr.addr, fPhysical);
|
||||
var a = this.cpu.getAddrInfo(dbgAddr.addr || 0, fPhysical);
|
||||
this.println(Str.pad("", fPhysical? 12: 19) + Str.toBin(dbgAddr.addr, fPhysical? 22 : 17, 3) + " " + Str.toOct(dbgAddr.addr, 8));
|
||||
if (a.length < 6) {
|
||||
if (a.length > 2) {
|
||||
|
|
|
|||
|
|
@ -708,6 +708,7 @@ var PDP11 = {
|
|||
RKER: { // 177402: Error Register
|
||||
WCE: 0x0001, // Write Check Error
|
||||
CSE: 0x0002, // Checksum Error
|
||||
SE: 0x0003, // Soft Error bits (cleared at the start of a new function)
|
||||
UNUSED: 0x001C, // unused (returns zero)
|
||||
NXS: 0x0020, // Non-Existent Sector
|
||||
NXC: 0x0040, // Non-Existent Cylinder
|
||||
|
|
@ -719,7 +720,8 @@ var PDP11 = {
|
|||
SKE: 0x1000, // Seek Error
|
||||
WLO: 0x2000, // Write Lock-Out Violation
|
||||
OVR: 0x4000, // Overrun
|
||||
DRE: 0x8000 // Drive Error
|
||||
DRE: 0x8000, // Drive Error
|
||||
HE: 0x7FE0 // Hard Error bits (cleared only by Bus RESET or RK11 CRESET function)
|
||||
},
|
||||
RKCS: { // 177404: Control Status Register
|
||||
GO: 0x0001, // (000001) Go (W/O)
|
||||
|
|
|
|||
|
|
@ -35,11 +35,13 @@
|
|||
import Str from "../../shared/es6/strlib";
|
||||
import Web from "../../shared/es6/weblib";
|
||||
import Component from "../../shared/es6/component";
|
||||
import PDP11 from "./defines";
|
||||
import BusPDP11 from "./bus";
|
||||
import MemoryPDP11 from "./memory";
|
||||
import MessagesPDP11 from "./messages";
|
||||
import PC11 from "./pc11";
|
||||
import RL11 from "./rl11";
|
||||
import RK11 from "./rk11";
|
||||
|
||||
class DevicePDP11 extends Component {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,7 @@ class PanelPDP11 extends Component {
|
|||
}
|
||||
|
||||
/*
|
||||
* Update the ADDRESS and DATA LEDs by selecting the appropriate values
|
||||
* Update the ADDRESS and DATA LEDs by selecting the appropriate values.
|
||||
*
|
||||
* TODO: There is currently no mechanism for selecting regData over regDisplay;
|
||||
* we are acting as if the DATASEL switch setting is locked to "DISPLAY REGISTER".
|
||||
|
|
|
|||
|
|
@ -944,30 +944,20 @@ class RK11 extends Component {
|
|||
processCommand()
|
||||
{
|
||||
var fInterrupt = true;
|
||||
var fnReadWrite, sFunc = "";
|
||||
var fnReadWrite, func, sFunc = "";
|
||||
var iDrive = (this.regRKDA & PDP11.RK11.RKDA.DS) >> PDP11.RK11.RKDA.SHIFT.DS;
|
||||
var drive = this.aDrives[iDrive];
|
||||
var iCylinder, iHead, iSector, nWords, addr, inc;
|
||||
|
||||
this.regRKCS &= ~PDP11.RK11.RKCS.CRDY;
|
||||
var func = this.regRKCS & PDP11.RK11.RKCS.FUNC;
|
||||
this.regRKCS &= ~(PDP11.RK11.RKCS.CRDY | PDP11.RK11.RKCS.SCP);
|
||||
this.regRKER &= ~(PDP11.RK11.RKER.SE);
|
||||
|
||||
switch(func) {
|
||||
switch(func = this.regRKCS & PDP11.RK11.RKCS.FUNC) {
|
||||
|
||||
case PDP11.RK11.FUNC.CRESET:
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ": CRESET(" + iDrive + ")", true);
|
||||
this.regRKER = 0;
|
||||
this.regRKER = this.regRKDA = 0;
|
||||
this.regRKCS = PDP11.RK11.RKCS.CRDY;
|
||||
this.regRKDA = 0;
|
||||
break;
|
||||
|
||||
case PDP11.RK11.FUNC.SEEK:
|
||||
iCylinder = (this.regRKDA & PDP11.RK11.RKDA.CA) >> PDP11.RK11.RKDA.SHIFT.CA;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ": SEEK(" + iCylinder + ")", true);
|
||||
if (iCylinder >= drive.nCylinders) {
|
||||
this.regRKER |= PDP11.RK11.RKER.DRE | PDP11.RK11.RKER.NXC;
|
||||
this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR;
|
||||
}
|
||||
break;
|
||||
|
||||
case PDP11.RK11.FUNC.RCHK:
|
||||
|
|
@ -997,21 +987,31 @@ class RK11 extends Component {
|
|||
if (this.messageEnabled()) this.printMessage(this.type + ": " + sFunc + "(" + iCylinder + ":" + iHead + ":" + iSector + ") " + Str.toOct(addr) + "--" + Str.toOct(addr + (nWords << 1)), true, true);
|
||||
|
||||
if (iCylinder >= drive.nCylinders) {
|
||||
this.regRKER |= PDP11.RK11.RKER.DRE | PDP11.RK11.RKER.NXC;
|
||||
this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR;
|
||||
this.regRKER |= PDP11.RK11.RKER.NXC;
|
||||
break;
|
||||
}
|
||||
if (iSector >= drive.nSectors) {
|
||||
this.regRKER |= PDP11.RK11.RKER.DRE | PDP11.RK11.RKER.NXS;
|
||||
this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR;
|
||||
this.regRKER |= PDP11.RK11.RKER.NXS;
|
||||
break;
|
||||
}
|
||||
|
||||
fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, inc, (func >= PDP11.RK11.FUNC.WCHK), this.doneReadWrite.bind(this));
|
||||
break;
|
||||
|
||||
case PDP11.RK11.FUNC.SEEK:
|
||||
iCylinder = (this.regRKDA & PDP11.RK11.RKDA.CA) >> PDP11.RK11.RKDA.SHIFT.CA;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ": SEEK(" + iCylinder + ")", true);
|
||||
if (iCylinder < drive.nCylinders) {
|
||||
this.regRKCS |= PDP11.RK11.RKCS.SCP;
|
||||
} else {
|
||||
this.regRKER |= PDP11.RK11.RKER.NXC;
|
||||
}
|
||||
break;
|
||||
|
||||
case PDP11.RK11.FUNC.DRESET:
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ": DRESET(" + iDrive + ")");
|
||||
this.regRKER = this.regRKDA = 0;
|
||||
this.regRKCS = PDP11.RK11.RKCS.CRDY | PDP11.RK11.RKCS.SCP;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -1021,9 +1021,7 @@ class RK11 extends Component {
|
|||
|
||||
this.regRKDS = drive.status | (drive.disk? PDP11.RK11.RKDS.DRDY : 0) | (iDrive << PDP11.RK11.RKDS.SHIFT.ID) | (this.regRKDA & PDP11.RK11.RKDS.SC);
|
||||
|
||||
if (this.regRKER & PDP11.RK11.RKER.DRE) {
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ": ERROR: " + Str.toOct(this.regRKER));
|
||||
}
|
||||
this.updateErrors();
|
||||
|
||||
if (fInterrupt) {
|
||||
this.regRKCS &= ~PDP11.RK11.RKCS.GO;
|
||||
|
|
@ -1139,8 +1137,6 @@ class RK11 extends Component {
|
|||
err = PDP11.RK11.RKER.NXM;
|
||||
break;
|
||||
}
|
||||
addr += inc;
|
||||
nWords--;
|
||||
if (!sector) {
|
||||
if (iCylinder >= disk.nCylinders) {
|
||||
err = PDP11.RK11.RKER.NXC;
|
||||
|
|
@ -1167,56 +1163,19 @@ class RK11 extends Component {
|
|||
break;
|
||||
}
|
||||
/*
|
||||
* TODO: Figure out why certain WCHK commands fail during the 11/70 CPU EXERCISER diagnostic,
|
||||
* once the test starts reading/writing with physical addresses > 177777. I think all the
|
||||
* UNIBUS address calculations are fine, so I'm at a loss to explain how a WCHK operation
|
||||
* can succeed when the diagnostic itself appears to alter the memory immediately after the
|
||||
* preceding WRITE operation.
|
||||
* NOTE: During the 11/70 CPU EXERCISER diagnostic, a number of WCHK requests will fail
|
||||
* when the test starts reading/writing with physical addresses > 177777. I'm pretty sure all
|
||||
* the UNIBUS address calculations are fine, and therefore those failures are expected.
|
||||
*
|
||||
* The following machine is already primed with the diagnostic, as well as the recommended
|
||||
* breakpoints and messages:
|
||||
*
|
||||
* http://www.pcjs.org/devices/pdp11/machine/1170/panel/debugger/cpuexer/
|
||||
*
|
||||
* If you're not using that machine, turn on RK11 messages ("m rk11 on"), set a breakpoint at
|
||||
* 033330 ("bp 033330") and then take a look at the first RK11 operation after that breakpoint;
|
||||
* it should be the first one using a UNIBUS address larger than 16 bits:
|
||||
*
|
||||
* RK11: WRITE(147:1:2) 00453610--00463610 @037772
|
||||
*
|
||||
* Use a breakpoint to halt the machine at 037772, and then use the Debugger's "da" command
|
||||
* to determine where UNIBUS address 00453610 is mapped (make sure you specify it as a physical
|
||||
* address using the % prefix):
|
||||
*
|
||||
* >> da %00453610
|
||||
* 00,101,011,110,001,000 00453610
|
||||
* UNIMAP[18]: 1,111,111,110,100,001,111,000 17764170
|
||||
* OFFSET: 1,011,110,001,000 00013610
|
||||
* PHYSICAL: 0,000,000,000,000,000,000,000 00000000
|
||||
*
|
||||
* So, you can see that the starting address for the WRITE is perfectly calculated to begin at
|
||||
* physical address 0. And the "da" command indicates virtual address 0 points to the same
|
||||
* memory:
|
||||
*
|
||||
* >> da 0
|
||||
* 00,000,000,000,000,000 00000000
|
||||
* 0,000,000,000,000 00000000
|
||||
* + KIPAR0: 0,000,000,000,000,000,000,000 00000000
|
||||
* & MMUMASK: 1,111,111,111,111,111,111,111 17777777
|
||||
* = PHYSICAL: 0,000,000,000,000,000,000,000 00000000
|
||||
*
|
||||
* Strangely, the diagnostic (its interrupt handler to be exact) is updating the next RKCS command
|
||||
* value at 001570, which is right in the middle of the first 2048 words of memory -- the same 2048
|
||||
* words that the diagnostic is about to WRITE and then WCHK. Since that value is changing between
|
||||
* the WRITE and the WCHK, how can WCHK succeed?
|
||||
*
|
||||
* For now, I just pretend that it does, by skipping the actual comparison.
|
||||
*
|
||||
* if (data != (b0 | (b1 << 8))) {
|
||||
* err = PDP11.RK11.RKER.WCE;
|
||||
* break;
|
||||
* }
|
||||
* Originally, those failures were causing me some grief because I was treating a WCE error like
|
||||
* any other error; ie, as a HARD error. That was wrong. Two errors (WCE and CSE) are soft
|
||||
* errors, so while they should still trigger the general-purpose RKCS ERR bit, they should NOT
|
||||
* trigger the RKCS HE (Hard Error) bit. This is all taken care of in updateErrors() now.
|
||||
*/
|
||||
if (data != (b0 | (b1 << 8))) {
|
||||
err = PDP11.RK11.RKER.WCE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) {
|
||||
err = PDP11.RK11.RKER.NXS;
|
||||
|
|
@ -1224,6 +1183,8 @@ class RK11 extends Component {
|
|||
}
|
||||
}
|
||||
if (ibSector >= disk.cbSector) sector = null;
|
||||
addr += inc;
|
||||
nWords--;
|
||||
}
|
||||
return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err;
|
||||
}
|
||||
|
|
@ -1246,13 +1207,39 @@ class RK11 extends Component {
|
|||
this.regRKCS = (this.regRKCS & ~PDP11.RK11.RKCS.MEX) | ((addr >> (16 - PDP11.RK11.RKCS.SHIFT.MEX)) & PDP11.RK11.RKCS.MEX);
|
||||
this.regRKWC = (0x10000 - nWords) & 0xffff;
|
||||
this.regRKDA = (this.regRKDA & ~PDP11.RK11.RKDA.SA) | (iSector & PDP11.RK11.RKDA.SA);
|
||||
if (err) {
|
||||
this.regRKER |= err | PDP11.RK11.RKER.DRE;
|
||||
this.regRKCS |= PDP11.RK11.RKCS.HE | PDP11.RK11.RKCS.ERR;
|
||||
}
|
||||
this.regRKER |= err;
|
||||
this.updateErrors();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* updateErrors()
|
||||
*
|
||||
* @this {RK11}
|
||||
*/
|
||||
updateErrors()
|
||||
{
|
||||
/*
|
||||
* Reflect RKER bits to RKCS bits as appropriate.
|
||||
*
|
||||
* TODO: I'm not entirely sure about the handling of the DRE bit here. DEC's RK11 documentation says:
|
||||
*
|
||||
* Sets if one of the drives in the system senses a loss of either AC or DC power and a function is
|
||||
* either initiated or in process while the selected drive is not ready or in some error condition.
|
||||
*
|
||||
* I'm not sure how to parse all the "ands" and "ors" in that sentence. For now, we're treating the DRE bit
|
||||
* much like the high error bit found in other hardware registers: we always set it if any lower error bits
|
||||
* are also set.
|
||||
*/
|
||||
this.regRKCS &= ~PDP11.RK11.RKCS.ERR;
|
||||
if (this.regRKER) {
|
||||
this.regRKER |= PDP11.RK11.RKER.DRE;
|
||||
this.regRKCS |= PDP11.RK11.RKCS.ERR;
|
||||
if (this.regRKER & PDP11.RK11.RKER.HE) this.regRKCS |= PDP11.RK11.RKCS.HE;
|
||||
if (this.messageEnabled()) this.printMessage(this.type + ": ERROR: " + Str.toOct(this.regRKER));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* readRKDS(addr)
|
||||
*
|
||||
|
|
|
|||
28
modules/shared/es6/README.md
Normal file
28
modules/shared/es6/README.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Shared (ES6) Sources
|
||||
====================
|
||||
|
||||
This folder contains a mix of shared code, with some files used only by Node (server) modules,
|
||||
some used only by Browser (client) modules, and others used by both.
|
||||
|
||||
At the moment, only a few files are completely agnostic; eg: [strlib.js](strlib.js) and [usrlib.js](usrlib.js).
|
||||
One give-away is that neither contain references to any globals (although references to each other
|
||||
would be fine).
|
||||
|
||||
[netlib.js](netlib.js) is appropriate only for Node modules, because it contains code that relies on Node's
|
||||
global *Buffer* object, as indicated by:
|
||||
|
||||
/* global Buffer: false */
|
||||
|
||||
[weblib.js](weblib.js) is appropriate only for client modules, because it contains code that relies on the
|
||||
browser's global *window* object, as indicated by:
|
||||
|
||||
/* global window: true */
|
||||
|
||||
We declare *window* modifiable (true) so that [defines.js](defines.js) can set *global.window* to *false*
|
||||
when running within Node, allowing any other code to test the existence of *window* with a simple:
|
||||
|
||||
if (window) {...}
|
||||
|
||||
instead of:
|
||||
|
||||
if (typeof window !== "undefined") {...}
|
||||
|
|
@ -1027,7 +1027,7 @@ if (!Array.prototype.indexOf) {
|
|||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
||||
*/
|
||||
if (!Array.isArray) {
|
||||
Array.isArray = function (arg) {
|
||||
Array.isArray = function(arg) {
|
||||
return Object.prototype.toString.call(arg) === '[object Array]';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
"use strict";
|
||||
|
||||
import Str from "../../shared/es6/strlib";
|
||||
import Component from "../..shared/es6/component";
|
||||
import Component from "../../shared/es6/component";
|
||||
|
||||
/**
|
||||
* Debugger Address Object
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class Net {
|
|||
var options = url.parse(sURL);
|
||||
options.method = "HEAD";
|
||||
options.path = options.pathname; // TODO: Determine the necessity of aliasing this
|
||||
var req = http.request(options, function (res)
|
||||
var req = http.request(options, function(res)
|
||||
{
|
||||
var err = null;
|
||||
var stat = null;
|
||||
|
|
@ -179,7 +179,7 @@ class Net {
|
|||
}
|
||||
done(err, stat);
|
||||
});
|
||||
req.on('error', function (err)
|
||||
req.on('error', function(err)
|
||||
{
|
||||
done(err, null);
|
||||
});
|
||||
|
|
@ -211,9 +211,9 @@ class Net {
|
|||
*/
|
||||
var sFile = "";
|
||||
var bufFile = null;
|
||||
http.get(sURL, function (res)
|
||||
http.get(sURL, function(res)
|
||||
{
|
||||
res.on('data', function (data)
|
||||
res.on('data', function(data)
|
||||
{
|
||||
if (sEncoding) {
|
||||
sFile += data;
|
||||
|
|
@ -241,7 +241,7 @@ class Net {
|
|||
* bufFile = buf;
|
||||
*/
|
||||
bufFile = Buffer.concat([bufFile, data], bufFile.length + data.length);
|
||||
}).on('end', function ()
|
||||
}).on('end', function()
|
||||
{
|
||||
/*
|
||||
* TODO: Decide what to do when res.statusCode is actually an error code (eg, 404), because
|
||||
|
|
@ -252,7 +252,7 @@ class Net {
|
|||
} else {
|
||||
done(new Error(sEncoding ? sFile : bufFile), res.statusCode, null);
|
||||
}
|
||||
}).on('error', function (err)
|
||||
}).on('error', function(err)
|
||||
{
|
||||
done(err, res.statusCode, null);
|
||||
});
|
||||
|
|
@ -279,12 +279,12 @@ class Net {
|
|||
* Either the documentation isn't quite right for url.parse() or http.request() (the big brother
|
||||
* of http.get), or one of those "options" properties is aliased to the other, or...?
|
||||
*/
|
||||
http.get(sURL, function (res)
|
||||
http.get(sURL, function(res)
|
||||
{
|
||||
res.on('data', function (data)
|
||||
res.on('data', function(data)
|
||||
{
|
||||
file.write(data);
|
||||
}).on('end', function ()
|
||||
}).on('end', function()
|
||||
{
|
||||
file.end();
|
||||
/*
|
||||
|
|
@ -295,7 +295,7 @@ class Net {
|
|||
* in such cases, the file content will likely just be an HTML error page.
|
||||
*/
|
||||
done(null, res.statusCode);
|
||||
}).on('error', function (err)
|
||||
}).on('error', function(err)
|
||||
{
|
||||
done(err, res.statusCode);
|
||||
});
|
||||
|
|
@ -329,7 +329,7 @@ class Net {
|
|||
var sBaseName = Str.getBaseName(sURL);
|
||||
var sFile = path.join(Net.sServerRoot, sURL);
|
||||
if (fAsync) {
|
||||
fs.readFile(sFile, {encoding: "utf8"}, function (err, s)
|
||||
fs.readFile(sFile, {encoding: "utf8"}, function(err, s)
|
||||
{
|
||||
/*
|
||||
* TODO: If err is set, is there an error code we should return (instead of -1)?
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class Proc {
|
|||
*
|
||||
* @return {{argc:number, argv:{}}}
|
||||
*/
|
||||
static getArgs = function ()
|
||||
static getArgs()
|
||||
{
|
||||
var argc = 0;
|
||||
var argv = {};
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ class Str {
|
|||
*/
|
||||
static escapeHTML(sHTML)
|
||||
{
|
||||
return sHTML.replace(/[&<>"']/g, function (m)
|
||||
return sHTML.replace(/[&<>"']/g, function(m)
|
||||
{
|
||||
return Str.aHTMLEscapeMap[m];
|
||||
});
|
||||
|
|
@ -494,7 +494,7 @@ class Str {
|
|||
k = k.replace(/([\\[\]*{}().+?])/g, "\\$1");
|
||||
sMatch += (sMatch ? '|' : '') + k;
|
||||
}
|
||||
return s.replace(new RegExp('(' + sMatch + ')', "g"), function (m)
|
||||
return s.replace(new RegExp('(' + sMatch + ')', "g"), function(m)
|
||||
{
|
||||
return a[m];
|
||||
});
|
||||
|
|
@ -553,7 +553,10 @@ class Str {
|
|||
*/
|
||||
static toASCIICode(b)
|
||||
{
|
||||
var s = (b != Str.ASCII.CR && b != Str.ASCII.LF ? Str.aASCIICodes[b] : null);
|
||||
var s;
|
||||
if (b != Str.ASCII.CR && b != Str.ASCII.LF) {
|
||||
s = Str.aASCIICodes[b];
|
||||
}
|
||||
if (s) {
|
||||
s = '<' + s + '>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class Usr {
|
|||
var right = a.length;
|
||||
var found = 0;
|
||||
if (fnCompare === undefined) {
|
||||
fnCompare = function (a, b)
|
||||
fnCompare = function(a, b)
|
||||
{
|
||||
return a > b ? 1 : a < b ? -1 : 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class Web {
|
|||
return [sResource, nErrorCode];
|
||||
}
|
||||
else if (fAsync && typeof resources == 'function') {
|
||||
resources(sURL, function (sResource, nErrorCode)
|
||||
resources(sURL, function(sResource, nErrorCode)
|
||||
{
|
||||
if (done) done(sURL, sResource, nErrorCode);
|
||||
});
|
||||
|
|
@ -190,7 +190,7 @@ class Web {
|
|||
|
||||
var xmlHTTP = (window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject("Microsoft.XMLHTTP"));
|
||||
if (fAsync) {
|
||||
xmlHTTP.onreadystatechange = function ()
|
||||
xmlHTTP.onreadystatechange = function()
|
||||
{
|
||||
if (xmlHTTP.readyState === 4) {
|
||||
/*
|
||||
|
|
@ -679,7 +679,7 @@ class Web {
|
|||
var match;
|
||||
var pl = /\+/g; // RegExp for replacing addition symbol with a space
|
||||
var search = /([^&=]+)=?([^&]*)/g;
|
||||
var decode = function (s)
|
||||
var decode = function(s)
|
||||
{
|
||||
return decodeURIComponent(s.replace(pl, " "));
|
||||
};
|
||||
|
|
@ -777,7 +777,7 @@ class Web {
|
|||
ms = msRepeat;
|
||||
}
|
||||
};
|
||||
e.onmousedown = function ()
|
||||
e.onmousedown = function()
|
||||
{
|
||||
// Web.log("onMouseDown()");
|
||||
if (!fIgnoreMouseEvents) {
|
||||
|
|
@ -787,7 +787,7 @@ class Web {
|
|||
}
|
||||
}
|
||||
};
|
||||
e.ontouchstart = function ()
|
||||
e.ontouchstart = function()
|
||||
{
|
||||
// Web.log("onTouchStart()");
|
||||
if (!timer) {
|
||||
|
|
@ -795,7 +795,7 @@ class Web {
|
|||
fnRepeat();
|
||||
}
|
||||
};
|
||||
e.onmouseup = e.onmouseout = function ()
|
||||
e.onmouseup = e.onmouseout = function()
|
||||
{
|
||||
// Web.log("onMouseUp()/onMouseOut()");
|
||||
if (timer) {
|
||||
|
|
@ -803,7 +803,7 @@ class Web {
|
|||
timer = null;
|
||||
}
|
||||
};
|
||||
e.ontouchend = e.ontouchcancel = function ()
|
||||
e.ontouchend = e.ontouchcancel = function()
|
||||
{
|
||||
// Web.log("onTouchEnd()/onTouchCancel()");
|
||||
if (timer) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Shared Sources
|
||||
===
|
||||
==============
|
||||
|
||||
This folder contains a mix of shared code, with some files used only by Node (server) modules,
|
||||
some used only by Browser (client) modules, and others used by both.
|
||||
|
|
@ -8,7 +8,7 @@ At the moment, only a few files are completely agnostic; eg: [strlib.js](strlib.
|
|||
One give-away is that neither contain references to any globals (although references to each other
|
||||
would be fine).
|
||||
|
||||
**netlib.js** is appropriate only for Node modules, because it contains code that relies on Node's
|
||||
[netlib.js](netlib.js) is appropriate only for Node modules, because it contains code that relies on Node's
|
||||
global *Buffer* object, as indicated by:
|
||||
|
||||
/* global Buffer: false */
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,7 @@ if (!Array.prototype.indexOf) {
|
|||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
||||
*/
|
||||
if (!Array.isArray) {
|
||||
Array.isArray = function (arg) {
|
||||
Array.isArray = function(arg) {
|
||||
return Object.prototype.toString.call(arg) === '[object Array]';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,6 @@
|
|||
var socket = io.connect();
|
||||
|
||||
// if we get an "info" emit from the socket server then console.log the data we receive
|
||||
socket.on('info', function (data) {
|
||||
socket.on('info', function(data) {
|
||||
console.log(data);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,26 +8,26 @@ DEC PDP-11 Publications
|
|||
---
|
||||
|
||||
This page summarizes PDP-11 documentation that was useful in creating [PDPjs](/modules/pdp11/). In most cases,
|
||||
these documents came from the PDF Document Archive at [bitsavers.org](http://bitsavers.org), in the [/pdf/dec/pdp11/](http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp11/)
|
||||
these documents came from the PDF Document Archive at [bitsavers.org](http://bitsavers.org), in the [/pdf/dec/pdp11/](http://bitsavers.org/pdf/dec/pdp11/)
|
||||
directory. If a PDF was not searchable, it was "OCR'ed" before being archived below.
|
||||
|
||||
[PDP-11/20](1120/)
|
||||
|
||||
- [PDP-11/20 Handbook (1969)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1969.pdf) [[Original PDF](http://research.microsoft.com/en-us/um/people/gbell/Digital/PDP%2011%20Handbook%201969.pdf)]
|
||||
- [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf) [[Original PDF](http://bitsavers.trailing-edge.com/pdf/dec/pdp11/handbooks/PDP1120_Handbook_1972.pdf)]
|
||||
- [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/handbooks/PDP1120_Handbook_1972.pdf)]
|
||||
|
||||
[PDP-11/40](1140/)
|
||||
|
||||
- [PDP-11/40 Handbook (1972)](http://archive.pcjs.org/pubs/dec/pdp11/1140/PDP1140_Handbook_1972.pdf) [[Original PDF](http://bitsavers.trailing-edge.com/pdf/dec/pdp11/handbooks/PDP-11_40_Processor_Handbook_1972.pdf)]
|
||||
- [PDP-11/40 Handbook (1972)](http://archive.pcjs.org/pubs/dec/pdp11/1140/PDP1140_Handbook_1972.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/handbooks/PDP-11_40_Processor_Handbook_1972.pdf)]
|
||||
|
||||
[PDP-11/45](1145/)
|
||||
|
||||
- [PDP-11/45 Handbook (1973)](http://archive.pcjs.org/pubs/dec/pdp11/1145/PDP1145_Handbook_1973.pdf) [[Original PDF](http://bitsavers.trailing-edge.com/pdf/dec/pdp11/handbooks/PDP1145_Handbook_1973.pdf)]
|
||||
- [PDP-11/45 Handbook (1973)](http://archive.pcjs.org/pubs/dec/pdp11/1145/PDP1145_Handbook_1973.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/handbooks/PDP1145_Handbook_1973.pdf)]
|
||||
|
||||
[PDP-11/70](1170/)
|
||||
|
||||
- [PDP-11/70 Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Handbook_1976.pdf) [[Original PDF](http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp11/1170/PDP-11_70_Handbook_1977-78.pdf)]
|
||||
- [PDP-11/70 Handbook (1979)](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Handbook_1979.pdf) [[Original PDF](http://bitsavers.trailing-edge.com/pdf/dec/pdp11/handbooks/PDP11_Handbook1979.pdf)]
|
||||
- [PDP-11/70 Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Handbook_1976.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/1170/PDP-11_70_Handbook_1977-78.pdf)]
|
||||
- [PDP-11/70 Handbook (1979)](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Handbook_1979.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/handbooks/PDP11_Handbook1979.pdf)]
|
||||
|
||||
[PDP-11 BASIC](basic/)
|
||||
|
||||
|
|
@ -36,18 +36,26 @@ directory. If a PDF was not searchable, it was "OCR'ed" before being archived b
|
|||
|
||||
[PDP-11 Diagnostics](diags/)
|
||||
|
||||
- [MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQAB-B-D_User_Reference_Manual_Oct73.pdf)
|
||||
- [MAINDEC-11-DCQKC 11/40 and 11/45 INSTRUCTION EXERCISER (Sep 1974)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DCQKC-D-D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf)
|
||||
- [MAINDEC-11-DZQXA XXDP USER MANUAL (Jul 1976)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQXA-I-D_XXDP_User_Manual_Jul76.pdf)
|
||||
- [CEKBAD0 11/70 CPU #1 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AH-7963D-MC_CEKBAD0_1170_CPU_1_May80.pdf)
|
||||
- [CEKBBF0 11/70 CPU #2 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AH-7968F-MC_CEKBBF0_1170_CPU_2_May80.pdf)
|
||||
- [CEKBEE0 11/70 MEM MGMT (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7975E-MC_CEKBEE0_1170_MEM_MGMT_May80.pdf)
|
||||
- [MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQAB-B-D_User_Reference_Manual_Oct73.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/MAINDEC-11-DZQAB-B-D_MAINDEC_User_Reference_Manual_Oct73.pdf)]
|
||||
- [MAINDEC-11-DCQKC 11/40 and 11/45 INSTRUCTION EXERCISER (Sep 1974)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DCQKC-D-D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/diag_listings/1140_45/028_MAINDEC-11-DCQKC-D_D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf)]
|
||||
- [MAINDEC-11-DZQXA XXDP USER MANUAL (Jul 1976)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQXA-I-D_XXDP_User_Manual_Jul76.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/MAINDEC-11-DZQXA-I-D_XXDP_User_Manual_Jul76.pdf)]
|
||||
- [CEKBAD0 11/70 CPU #1 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7962D-MC_CEKBAD0_1170_CPU_1_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7963D-MC__PDP-11-70__11-70_CPU_%231__CEKBAD0__%28C%2975-80.pdf)]
|
||||
- [CEKBBF0 11/70 CPU #2 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7966F-MC_CEKBBF0_1170_CPU_2_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7968F-MC__PDP11-70__11-70_CPU_%232__CEKBBF0__%28C%2975,80.pdf)]
|
||||
- [CEKBCD0 11/70 CACHE #1 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-0009D-MC_CEKBCD0_1170_CACHE_1_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-0010D-MC__PDP11-70-74__11-70_CACHE_%231__CEKBCD0__%28C%2975,80.pdf)]
|
||||
- [CEKBDE0 11/70 CACHE #2 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7971E-MC_CEKBDE0_1170_CACHE_2_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7972E-MC__PDP11-70-74__11-70_CACHE_%232__CEKBDE0__%28C%2975,80.pdf)]
|
||||
- [CEKBEE0 11/70 MEM MGMT (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7975E-MC_CEKBEE0_1170_MEM_MGMT_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7976E-MC__PDP-11-70__11-70_MEM_MGMT__CEKBEE0__%28C%2975,80.pdf)]
|
||||
- [CEKBFD0 11/70 UNIBUS MAP (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7979D-MC_CEKBFD0_1170_UNIBUS_MAP_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7980D-MC__11-70-11-74__11-70_UNIBUS_MAP__CEKBFD0__%28C%2975-80.pdf)]
|
||||
- [CEMJAD0 11/70 MEM TST (Feb 1979)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7990D-MC_CEMJAD0_1170_MEM_TST_Feb79.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7991D-MC__MJ11__11-70_MEM_TST__CEMJAD0__%28C%2973-79.pdf)]
|
||||
- [CEQKCE0 11/70 INSTRUCTION EXERCISER (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7994E-MC_CEQKCE0_1170_INSTRUCTION_EXERCISER_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7996E-MC__PDP11-70-74__11-70_INST_EXR__CEQKCE0__%28C%2975,80.pdf)]
|
||||
- [CFKAAC0 11/34 BASIC INSTRUCTION TEST (Oct 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-8041C-MC_CFKAAC0_1134_BSC_INST_TST_Oct78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/diag_listings/1134/AC-8041C-MC_CFKAAC0-1134-Bsc-Inst-Tst_Oct78.pdf)]
|
||||
- [CXCPAG0 INSTRUCTION TEST (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-E664G-MC_CXCPAG0_PROCESSOR_TEST_Sep78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/x11_listings/AC-E664G-MC_CXCPAG0-Processor-test_Sep78.pdf)]
|
||||
- [PDP-11 DIAGNOSTIC HANDBOOK (1988)](http://archive.pcjs.org/pubs/dec/pdp11/diags/PDP11_DiagnosticHandbook_1988.pdf)
|
||||
- [Notes for XXDP+ and XXDP V2 Operating Systems (Feb 1993)](http://archive.pcjs.org/pubs/dec/pdp11/diags/XXDP_Notes_Feb93.pdf)
|
||||
|
||||
[PDP-11 KW11](kw11/)
|
||||
|
||||
- [KW11-L Line Time Clock Manual (Apr 1973)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Apr73.pdf)
|
||||
- [KW11-L Line Time Clock Manual (Apr 1973)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Apr73.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/unibus/DEC-11-HKWB-D_KW11L_Apr73.pdf)]
|
||||
- [KW11-L Line Time Clock Manual (Jul 1974)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Jul74.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/1140/EK-KW11L_TM-002_KW11-L_Line_Time_Clock_Manual_Jul74.pdf)]
|
||||
|
||||
[PDP-11 M9312](m9312/)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,12 +9,19 @@ DEC PDP-11 Diagnostic Publications
|
|||
|
||||
PDPjs development and testing relied on the following PDP-11 diagnostic publications:
|
||||
|
||||
- [MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQAB-B-D_User_Reference_Manual_Oct73.pdf)
|
||||
- [MAINDEC-11-DCQKC 11/40 and 11/45 INSTRUCTION EXERCISER (Sep 1974)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DCQKC-D-D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf)
|
||||
- [MAINDEC-11-DZQXA XXDP USER MANUAL (Jul 1976)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQXA-I-D_XXDP_User_Manual_Jul76.pdf)
|
||||
- [CEKBAD0 11/70 CPU #1 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AH-7963D-MC_CEKBAD0_1170_CPU_1_May80.pdf)
|
||||
- [CEKBBF0 11/70 CPU #2 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AH-7968F-MC_CEKBBF0_1170_CPU_2_May80.pdf)
|
||||
- [CEKBEE0 11/70 MEM MGMT (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7975E-MC_CEKBEE0_1170_MEM_MGMT_May80.pdf)
|
||||
- [MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQAB-B-D_User_Reference_Manual_Oct73.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/MAINDEC-11-DZQAB-B-D_MAINDEC_User_Reference_Manual_Oct73.pdf)]
|
||||
- [MAINDEC-11-DCQKC 11/40 and 11/45 INSTRUCTION EXERCISER (Sep 1974)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DCQKC-D-D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/diag_listings/1140_45/028_MAINDEC-11-DCQKC-D_D_1140_1145_INSTRUCTION_EXERCISER_Sep74.pdf)]
|
||||
- [MAINDEC-11-DZQXA XXDP USER MANUAL (Jul 1976)](http://archive.pcjs.org/pubs/dec/pdp11/diags/MAINDEC-11-DZQXA-I-D_XXDP_User_Manual_Jul76.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/MAINDEC-11-DZQXA-I-D_XXDP_User_Manual_Jul76.pdf)]
|
||||
- [CEKBAD0 11/70 CPU #1 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7962D-MC_CEKBAD0_1170_CPU_1_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7963D-MC__PDP-11-70__11-70_CPU_%231__CEKBAD0__%28C%2975-80.pdf)]
|
||||
- [CEKBBF0 11/70 CPU #2 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7966F-MC_CEKBBF0_1170_CPU_2_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7968F-MC__PDP11-70__11-70_CPU_%232__CEKBBF0__%28C%2975,80.pdf)]
|
||||
- [CEKBCD0 11/70 CACHE #1 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-0009D-MC_CEKBCD0_1170_CACHE_1_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-0010D-MC__PDP11-70-74__11-70_CACHE_%231__CEKBCD0__%28C%2975,80.pdf)]
|
||||
- [CEKBDE0 11/70 CACHE #2 (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7971E-MC_CEKBDE0_1170_CACHE_2_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7972E-MC__PDP11-70-74__11-70_CACHE_%232__CEKBDE0__%28C%2975,80.pdf)]
|
||||
- [CEKBEE0 11/70 MEM MGMT (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7975E-MC_CEKBEE0_1170_MEM_MGMT_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7976E-MC__PDP-11-70__11-70_MEM_MGMT__CEKBEE0__%28C%2975,80.pdf)]
|
||||
- [CEKBFD0 11/70 UNIBUS MAP (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7979D-MC_CEKBFD0_1170_UNIBUS_MAP_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7980D-MC__11-70-11-74__11-70_UNIBUS_MAP__CEKBFD0__%28C%2975-80.pdf)]
|
||||
- [CEMJAD0 11/70 MEM TST (Feb 1979)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7990D-MC_CEMJAD0_1170_MEM_TST_Feb79.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7991D-MC__MJ11__11-70_MEM_TST__CEMJAD0__%28C%2973-79.pdf)]
|
||||
- [CEQKCE0 11/70 INSTRUCTION EXERCISER (May 1980)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-7994E-MC_CEQKCE0_1170_INSTRUCTION_EXERCISER_May80.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/AH-7996E-MC__PDP11-70-74__11-70_INST_EXR__CEQKCE0__%28C%2975,80.pdf)]
|
||||
- [CFKAAC0 11/34 BASIC INSTRUCTION TEST (Oct 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-8041C-MC_CFKAAC0_1134_BSC_INST_TST_Oct78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/diag_listings/1134/AC-8041C-MC_CFKAAC0-1134-Bsc-Inst-Tst_Oct78.pdf)]
|
||||
- [CXCPAG0 INSTRUCTION TEST (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-E664G-MC_CXCPAG0_PROCESSOR_TEST_Sep78.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/xxdp/x11_listings/AC-E664G-MC_CXCPAG0-Processor-test_Sep78.pdf)]
|
||||
|
||||
The *MAINDEC-11-DZQAB MAINDEC USER REFERENCE MANUAL (Oct 1973)* was particularly useful for understanding DEC's
|
||||
[Paper Tape Diagnostics](/apps/pdp11/tapes/diags/).
|
||||
|
|
|
|||
|
|
@ -9,4 +9,5 @@ DEC PDP-11 KW11 Line Time Clock
|
|||
|
||||
PDPjs development and testing relied on the following PDP-11 publications:
|
||||
|
||||
- [KW11-L Line Time Clock Manual (Apr 1973)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Apr73.pdf)
|
||||
- [KW11-L Line Time Clock Manual (Apr 1973)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Apr73.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/unibus/DEC-11-HKWB-D_KW11L_Apr73.pdf)]
|
||||
- [KW11-L Line Time Clock Manual (Jul 1974)](http://archive.pcjs.org/pubs/dec/pdp11/kw11/KW11L_Jul74.pdf) [[Original PDF](http://bitsavers.org/pdf/dec/pdp11/1140/EK-KW11L_TM-002_KW11-L_Line_Time_Clock_Manual_Jul74.pdf)]
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ function Ic(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0<g&&k<a.b.length;){var l=a.b[k
|
|||
h.Zb=function(a){return this.v[(a&this.w)>>>this.g].ia(a&this.j,a)};h.Jc=function(a,b){this.v[(a&this.w)>>>this.g].Xb(a&this.j,b,a)};h.Ib=function(a,b){this.v[(a&this.w)>>>this.g].sb(a&this.j,b,a)};function Pc(a,b){return a.b[(b&a.H)>>>a.g]}function ic(a,b){a.G=!1;a.ha++;b=Pc(a,b).B(b&a.j,b);a.ha--;return b}function Qc(a,b,c){a.G=!1;a.ha++;Pc(a,b).I(b&a.j,c&255,b);a.ha--}function gc(a,b,c){a.G=!1;a.ha++;Pc(a,b).G(b&a.j,c&65535,b);a.ha--}
|
||||
function Rc(a){for(var b=0,c=[],d=0;d<a.J;d++){var e=a.b[d];if(e.Sa||e.Ld){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[k++]=n-g;l[k++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Sc(a){for(var b=Tc,c=0,d=0;d<a.b.length;d++){var e=a.b[d];e.type==b&&(c=e.K+e.Eb)}return c}
|
||||
function Uc(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var n=b&Vc;if(void 0!==a.Ja[n])return y("I/O address already registered: "+v(b,8,!0)),!1;var r=l||"unknown";r&&0<=m&&(r+=m++);a.Ja[n]=[d,e,f,g,r,k||16,!1]}return!0}
|
||||
function Mb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.xa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],t=g[5]||1,u=0;u<t;u++,f+=2)if(r&&1<t&&(r=g[4]+u),!Uc(a,f,f,k,l,m,n,g[7]||b.fa,r||b.jb))return!1}}return!0}
|
||||
function Mb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.f.xa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var r=g[4],u=g[5]||1,t=0;t<u;t++,f+=2)if(r&&1<u&&(r=g[4]+t),!Uc(a,f,f,k,l,m,n,g[7]||b.fa,r||b.jb))return!1}}return!0}
|
||||
function Ob(a,b){a.O.push(b)}h.Ia=function(a,b,c){this.G=!0;this.ha||(this.F&&H(this.F,4)&&I(this.F,"memory fault ("+c+") on "+O(this.F,a),!0,!0),b&&(this.f.R|=b),this.f.ja(4,0,a))};function Wc(a){var b=a.G;a.G=!1;return b}function Lc(a,b,c){y("Memory block error ("+a+": "+v(b)+","+v(c)+")");return!1}var Cc=8192,Vc=Cc-1,Mc=1,Oc=2;
|
||||
function Dc(a,b){var c=-1,d=this.controller,e=d.Ja[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.Ja[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&H(this.f,16|e[5])&&I(this.f,e[4]+".readByte("+O(this.f,b)+"): "+O(this.f,c),!0,!d.ha),c;d.Ia(b,16,3);c=255;this.f&&H(this.f,16)&&I(this.f,"warning: unconverted read access to byte @"+O(this.f,b)+": "+O(this.f,c),!0,!d.ha);return c}
|
||||
function Ec(a,b,c){var d=!1,e=this.controller,f=e.Ja[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!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.Ja[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.f&&H(this.f,16|f[5])&&I(this.f,f[4]+".writeByte("+O(this.f,c)+","+O(this.f,b)+")",!0,!e.ha):(e.Ia(c,16,5),this.f&&H(this.f,16)&&I(this.f,"warning: unconverted write access to byte @"+O(this.f,c)+": "+O(this.f,
|
||||
|
|
@ -126,12 +126,12 @@ function ce(a){var b=+a.model||1170;Nd.call(this,a,6666667);this.xa=b;this.Pc=a.
|
|||
ee.bind(this),this.tb=this.Kd,this.Wc=~(1792|(1145>this.xa?2048:0))&65535,this.Vc=1145<=this.xa?2048:0);this.la=0;this.ka=null;this.sc=[];this.A.complete=!1;this.Jb=this.oc=this.dd;this.Kb=this.pc=this.jd;this.gc=this.qc=this.nd;this.Lb=this.rc=this.od;this.Ba=this.hb=this.Rb=this.Sb=0;this.ta=this.hd;this.ia=this.Dc;this.sb=this.Gc;this.Yc=this.Xc=0}p(ce,Nd);h=ce.prototype;
|
||||
h.pa=function(a,b,c,d){Nd.prototype.pa.call(this,a,b,c,d);this.oc=b.Ic.bind(b);this.pc=b.Zb.bind(b);this.qc=b.Jc.bind(b);this.rc=b.Ib.bind(b)};h.qa=function(a,b){for(var c=192,d=0;d<this.sc.length;d++){var e=this.sc[d];0>e.Wb&&(e.Wb=c,c+=4)}return Nd.prototype.qa.call(this,a,b)};
|
||||
h.reset=function(){this.status("Model "+this.xa);this.A.T&&J(this);this.G=65536;this.H=32768;this.L=65535;this.J=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Pc,-1,-2,-3,-4,-5,-6,-7,-8];this.oa=[0,0,0,0,0,0];this.X=[0,0,0,0];this.O=0;this.tc=[4,2,0,1];this.B=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.M=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Yb=[0,0,0,0,0,0,0,0];this.v=this.j=this.hc=this.V=this.Y=this.i=this.mc=0;this.$a=-1;Yb(this);Qd(this);this.A.error=!1;Nd.prototype.reset.call(this)};function Yb(a){a.S=0;a.Ub=0;a.Vb=0;a.U=0;a.R=0;a.ab=0;a.ya=255;a.Va=0;a.ub=0;a.wb=0;a.Ca=262143;a.ib=0;a.P=0;a.ka=null;a.D&&(fe(a),a.Oc=Sc(a.D))}
|
||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Fa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Yb=[0,0,0,0,0,0,0,0];this.v=this.j=this.hc=this.V=this.Y=this.i=this.mc=0;this.$a=-1;Yb(this);Qd(this);this.A.error=!1;Nd.prototype.reset.call(this)};function Yb(a){a.S=0;a.Ub=0;a.Vb=0;a.U=0;a.R=0;a.ab=0;a.ya=255;a.Va=0;a.ub=0;a.wb=0;a.Ca=262143;a.ib=a.g[7];a.P=0;a.ka=null;a.D&&(fe(a),a.Oc=Sc(a.D))}
|
||||
function fe(a){a.Jb=a.oc;a.Kb=a.pc;a.gc=a.qc;a.Lb=a.rc;a.Rb&&(a.Jb=a.dd,a.Kb=a.jd);a.Sb&&(a.gc=a.nd,a.Lb=a.od);a.Va?(a.Ba=65536,a.hb=a.U&16?4186112:253952,a.ta=a.hd,a.ia=a.Rb?a.Ze:a.Dc,a.sb=a.Sb?a.jg:a.Gc,Kc(a.D,a.U&16?22:18)):(a.Ba=0,a.hb=57344,a.ta=a.Md,a.ia=a.Rb?a.Ye:a.md,a.sb=a.Sb?a.ig:a.rd,Kc(a.D,16))}function ed(a){var b=a.S;b&57344||(b=b&-3199|a.ub<<5|a.wb<<1);return b}
|
||||
function fd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.Ub=a.P>>16&65535,a.Vb=a.P&65535);a.S=b;a.ub=(b&96)>>5;a.wb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Va!=c&&(a.Va=c,fe(a))}}function gd(a){a.S&57344||(a.Ub=a.P>>16&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a}function hd(a){a.S&57344||(a.Vb=a.P&65535);return a.Vb}function id(a,b){1170>a.xa&&(b&=-49);a.U!=b&&(a.U=b,a.Ca=b&16?4194303:262143,fe(a))}
|
||||
function ge(a,b,c){a.Pc=b;a.D.reset();Yb(a);he(a,b);ld(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.T||$b(a)}else a.F?J(a)||Sd(a.F):!1===c&&J(a);!a.A.T&&a.sa&&a.sa.stop()}h.ed=function(){return 0};h.save=function(){var a=new ie(this);a.set(0,[this.g,this.oa,this.X,this.Fa,this.Yb,this.R,this.mc,this.ab,this.ya,kd(this),this.$a,this.O,this.i,this.S,this.Ub,this.Vb,this.U,this.ub,this.wb,this.B,this.M,this.Va,this.Ca,this.ib,this.P]);a.set(1,[this.Za,this.Ya]);a.set(2,Rc(this.D));return a.data()};
|
||||
h.restore=function(a){var b=a[1];this.Za=b[1];Wd(this,b[3]);a:{b=this.D;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.S){for(var f=0,g=Array(b.S),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.b[d];if(!f||!f.restore(e)){y("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function je(a){return a.G&65536?1:0}function ke(a){return a.H&32768?2:0}function le(a){return a.L&65535?0:4}function me(a){return a.J&32768?8:0}
|
||||
function ne(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function he(a,b){a.g[7]=b&65535}function $c(a,b,c,d){c={Wb:b,eb:c,message:d||0,next:null};c.name=Ab[b];a.sc.push(c);return c}function oe(a,b){var c=a.ka;if(c==b)a.ka=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ka&&(a.i|=1)}
|
||||
function ne(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function S(a,b,c){c&&(he(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}function he(a,b){a.g[7]=b&65535}function $c(a,b,c,d){c={Wb:b,eb:c,message:d||0,next:null};c.name=Ab[b];a.sc.push(c);return c}function oe(a,b){var c=a.ka;if(c==b)a.ka=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ka&&(a.i|=1)}
|
||||
function Yc(a,b){if(b){if(b!=a.ka){var c=a.ka;if(!c||c.eb<=b.eb)b.next=c,a.ka=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&H(a,b.message|8)&&I(a,"setIRQ(vector="+q(b.Wb)+",priority="+b.eb+")",!0,!0)}}function dd(a,b){b&&(oe(a,b),b.message&&H(a,b.message|8)&&I(a,"clearIRQ(vector="+q(b.Wb)+",priority="+b.eb+")",!0,!0))}function pe(a){return a.i&64?(a.ja(168,64,-6),!0):a.i&32?(a.ja(4,32,-5),!0):a.i&16?(a.ja(12,16,-7),!0):!1}
|
||||
function kd(a){return a.w=a.w&63728|me(a)|le(a)|ke(a)|je(a)}function ld(a,b){b&=a.Wc;a.J=b<<12;a.L=~b&4;a.H=b<<14;a.G=b<<16;if((b^a.w)&a.Vc)for(var c=a.oa.length;0<=--c;){var d=a.g[c];a.g[c]=a.oa[c];a.oa[c]=d}a.O=b>>14&3;c=a.w>>14&3;a.O!=c&&(a.X[c]=a.g[6],a.g[6]=a.X[a.O]);a.w=b;a.i&=-3;a.i|=a.ka?2:1}function jd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.ab=b}h.wa=function(a){this.J=this.L=a;this.H=0};h.fb=function(a,b){this.J=this.L=this.G=a;this.H=b||0};
|
||||
function qe(a,b){a.J=a.L=a.G=b;a.H=a.J^a.G>>1}function re(a,b,c,d){a.J=a.L=a.G=b;a.H=(c^d)&(d^b)}
|
||||
|
|
@ -146,29 +146,29 @@ h.nd=function(a,b){this.F&&Kd(this.F,a,1);this.qc(a,b)};h.od=function(a,b){this.
|
|||
h.Ze=function(a){this.F&&Jd(this.F,a,2);return this.Dc(a)};h.rd=function(a,b){this.D.Ib(this.ib=a,b)};h.ig=function(a,b){this.F&&Kd(this.F,a,2);this.rd(a,b)};h.Gc=function(a,b){this.D.Ib(this.ib=hc(this,a,4),b)};h.jg=function(a,b){this.F&&Kd(this.F,a,2);this.Gc(a,b)};function ze(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=xe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.O=a.w>>12&3,c=a.ia(d|c&a.Ba),a.O=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.X[a.w>>12&3];return c}
|
||||
function Ae(a,b,c,d){a.P=a.P&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=xe(a,b,e,4),c&65536||(e&=65535),a.O=a.w>>12&3,e=hc(a,e|c&65536,4),a.O=a.w>>14&3,a.Lb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.X[a.w>>12&3]=d}function Be(a,b){b>>=6;var c=a.Y=b&7;return(b=a.V=(b&56)>>3)?a.Jb(a.ta(b,c,3)):a.g[c+a.lc]&a.Rc}function Ce(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.V=(b&56)>>3)?c=a.Kb(a.ta(b,d,2)):c=a.g[d+a.lc];return c}function De(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return xe(a,b,c,8)}
|
||||
function Ee(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Jb(a.ta(b,c,3)):a.g[c]&255}function Fe(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Kb(a.ta(b,d,2)):c=a.g[d];return c}function Ge(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.hc=a.ta(b,e,7),c=0>c?a.g[-c-1]&255:c,a.gc(e,d.call(a,c,a.Jb(e))),e&1&&a.b--):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))}
|
||||
function S(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ta(b,e,6),a.Lb(e,d.call(a,0>c?a.g[-c-1]:c,a.Kb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function He(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.ta(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.gc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
|
||||
function Ie(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ta(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Lb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}function T(a,b,c){c&&(he(a,a.g[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
function T(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ta(b,e,6),a.Lb(e,d.call(a,0>c?a.g[-c-1]:c,a.Kb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function He(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.ta(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.gc(d,c),d&1&&a.b--):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
|
||||
function Ie(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.ta(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Lb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}
|
||||
h.$b=function(a){this.A.complete=!0;var b=this.F?Je(this.F)?1:this.A.fc?-1:0:0,c=a?this.A.fc?0:1:-1;this.A.fc=!1;this.Xa=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(ef(this.F,this.g[7],c)){J(this);break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.ab&224)>>5,f=this.ka&&this.ka.eb>e?this.ka:null;f&&(d=f.Wb,e=f.eb);e>(this.w&224)>>5?(this.i&8&&(ne(this,2),this.i&=-9),this.ja(d,0,-10),e=!0):e=!1;e&&(f&&oe(this,f),a=!0);this.ka||this.ab||(this.i&=-3)}else this.i&
|
||||
1&&this.i++;if(a){if(this.i&4&&ef(this.F,this.g[7],c)){J(this);break}if(0>c)break}if(this.i&112&&pe(this)){if(this.i&4&&ef(this.F,this.g[7],c)){J(this);break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.P=this.g[7];f=this.ia(a);this.g[7]=a+2&65535;this.Nc(f)}while(0<this.b);return this.A.complete?this.Xa-this.b:void 0===this.A.complete?0:-1};Ua(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ce(d);nb(d,c)}});
|
||||
function ff(a,b){var c=b+a;this.J=this.L=this.G=c;this.H=(a^c)&(b^c);return c&65535}function gf(a,b){var c=b+a,d=c<<8;this.J=this.L=this.G=d;this.H=(a<<8^d)&(b<<8^d);return c&255}function hf(a,b){a=b<<1;qe(this,a);return a&65535}function jf(a,b){a=b<<1;qe(this,a<<8);return a&255}function kf(a,b){a=b&32768|b>>1|b<<16;qe(this,a);return a&65535}function lf(a,b){a=b&128|b>>1|b<<8;qe(this,a<<8);return a&255}function mf(a,b){a=b&~a;this.wa(a);return a}function nf(a,b){a=b&~a;this.wa(a<<8);return a}
|
||||
function of(a,b){a|=b;this.wa(a);return a}function pf(a,b){a|=b;this.wa(a<<8);return a}function qf(a,b){a=~b|65536;this.fb(a);return a&65535}function rf(a,b){a=~b|256;this.fb(a<<8);return a&255}function sf(a,b){this.J=this.L=a=b-a;this.H=b&(b^a);return a&65535}function tf(a,b){a=b-a;var c=a<<8;b<<=8;this.J=this.L=c;this.H=b&(b^c);return a&255}function uf(a,b){this.J=this.L=a=b+a;this.H=a&(b^a);return a&65535}function vf(a,b){a=b+a;var c=a<<8;this.J=this.L=c;this.H=c&(b<<8^c);return a&255}
|
||||
function wf(a,b){a=-b;this.fb(a,a&b&32768);return a&65535}function xf(a,b){a=-b;this.fb(a<<8,(a&b&128)<<8);return a&255}function yf(a,b){a=b<<1|this.G>>16&1;qe(this,a);return a&65535}function zf(a,b){a=b<<1|this.G>>16&1;qe(this,a<<8);return a&255}function Af(a,b){a=(this.G&65536|b)>>1|b<<16;qe(this,a);return a&65535}function Bf(a,b){a=((this.G&65536)>>8|b)>>1|b<<8;qe(this,a<<8);return a&255}function Cf(a,b){var c=b-a;re(this,c,a,b);return c&65535}
|
||||
function Df(a,b){var c=b-a;re(this,c<<8,a<<8,b<<8);return c&255}function Ef(a,b){this.J=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function Ff(a,b){a^=b;this.wa(a);return a&65535}function Gf(a){S(this,a,Ce(this,a),ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
||||
function Df(a,b){var c=b-a;re(this,c<<8,a<<8,b<<8);return c&255}function Ef(a,b){this.J=this.L=b&65280;this.H=this.G=0;return(b<<8|b>>8)&65535}function Ff(a,b){a^=b;this.wa(a);return a&65535}function Gf(a){T(this,a,Ce(this,a),ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
||||
function Hf(a){var b=Fe(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.G=this.H=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.G=c<<17-b,c>>=b;else if(b)if(16<b)this.H=c,c=0;else{this.G=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.H=32768)}this.g[a]=c&65535;this.J=this.L=c;this.b-=(this.v?6:7)+b}
|
||||
function If(a){var b=Fe(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.G=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.H=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.J=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Jf(a){T(this,a,!je(this))}function Kf(a){T(this,a,je(this))}
|
||||
function Lf(a){S(this,a,Ce(this,a),mf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Mf(a){Ge(this,a,Be(this,a),nf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Nf(a){S(this,a,Ce(this,a),of);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Of(a){Ge(this,a,Be(this,a),pf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
||||
function Pf(a){var b=Ce(this,a);a=Fe(this,a);this.wa((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Qf(a){var b=Be(this,a);a=Ee(this,a);this.wa(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Rf(a){T(this,a,le(this))}function Sf(a){T(this,a,!me(this)==!ke(this))}function Tf(a){T(this,a,!le(this)&&!me(this)==!ke(this))}function Uf(a){T(this,a,!je(this)&&!le(this))}
|
||||
function Vf(a){T(this,a,le(this)||!me(this)!=!ke(this))}function Wf(a){T(this,a,je(this)||le(this))}function Xf(a){T(this,a,!me(this)!=!ke(this))}function Yf(a){T(this,a,me(this))}function Zf(a){T(this,a,!le(this))}function $f(a){T(this,a,!me(this))}function ag(){this.ja(12,0,-9)}function bg(a){T(this,a,!0)}function cg(a){T(this,a,!ke(this))}function dg(a){T(this,a,ke(this))}function eg(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.J=0);this.b-=5}
|
||||
function If(a){var b=Fe(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.G=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.G=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.H=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.J=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function Jf(a){S(this,a,!je(this))}function Kf(a){S(this,a,je(this))}
|
||||
function Lf(a){T(this,a,Ce(this,a),mf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Mf(a){Ge(this,a,Be(this,a),nf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Nf(a){T(this,a,Ce(this,a),of);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Of(a){Ge(this,a,Be(this,a),pf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}
|
||||
function Pf(a){var b=Ce(this,a);a=Fe(this,a);this.wa((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Qf(a){var b=Be(this,a);a=Ee(this,a);this.wa(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function Rf(a){S(this,a,le(this))}function Sf(a){S(this,a,!me(this)==!ke(this))}function Tf(a){S(this,a,!le(this)&&!me(this)==!ke(this))}function Uf(a){S(this,a,!je(this)&&!le(this))}
|
||||
function Vf(a){S(this,a,le(this)||!me(this)!=!ke(this))}function Wf(a){S(this,a,je(this)||le(this))}function Xf(a){S(this,a,!me(this)!=!ke(this))}function Yf(a){S(this,a,me(this))}function Zf(a){S(this,a,!le(this))}function $f(a){S(this,a,!me(this))}function ag(){this.ja(12,0,-9)}function bg(a){S(this,a,!0)}function cg(a){S(this,a,!ke(this))}function dg(a){S(this,a,ke(this))}function eg(a){a&1&&(this.G=0);a&2&&(this.H=0);a&4&&(this.L=1);a&8&&(this.J=0);this.b-=5}
|
||||
function fg(a){var b=Ce(this,a);a=Fe(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;re(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}function gg(a){var b=Be(this,a);a=Ee(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);re(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.V?4:3)+(7==this.j?2:0)}
|
||||
function hg(a){var b=Fe(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.G=this.H=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.L=d>>16|d,this.J=d>>16):(this.H=32768,this.L=d>>15|d,this.J=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.J=0,this.H=32768,this.G=65536,this.b-=7}function ig(){this.ja(24,0,-9);this.b-=20}
|
||||
function jg(){this.w&49152?(this.R|=128,this.ja(4,0,-8)):(this.sa&&1120==this.xa&&this.sa.setData(this.g[0],!0),this.F?kg(this.F):J(this));this.b-=7}function lg(){this.ja(16,0,-9);this.b-=20}var mg=[0,7,7,10,7,11,9,13];function ng(a){this.aa=this.b;he(this,De(this,a));this.b=this.aa-mg[this.v]}var og=[0,14,14,17,14,18,16,20];function pg(a){this.aa=this.b;var b=De(this,a);a=a>>6&7;se(this,this.g[a]);this.g[a]=this.g[7];he(this,b);this.b=this.aa-og[this.v]}
|
||||
var qg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function rg(a){var b=Ce(this,a);this.aa=this.b;Ie(this,a,b,this.wa);this.b=this.aa-qg[(this.V?8:0)+this.v]+(7!=this.j||this.v?0:2)}function sg(a){var b=Be(this,a);He(this,a,b,65535,this.wa);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}var tg=[7,13,13,17,14,18,17,21];
|
||||
function ug(a){var b=Fe(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.J=b>>16;this.L=this.J|b;this.H=0;this.G=-32768>b||32767<b?65536:0;this.b-=23}function vg(){this.b-=5}function wg(){this.w&49152||(this.D.reset(),Yb(this),this.sa&&this.sa.setData(this.g[0],!0));this.b-=667}function xg(a){if(a&8)U.call(this,a);else{var b=ue(this);a&=7;7==a?he(this,b):(he(this,this.g[a]),this.g[a]=b);this.b-=9}}
|
||||
function yg(){te(this);this.b-=13}function zg(a){a&1&&(this.G=65536);a&2&&(this.H=32768);a&4&&(this.L=0);a&8&&(this.J=32768);this.b-=5}function Ag(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)he(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Bg(a){S(this,a,Ce(this,a),Cf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Cg(a){S(this,a,0,Ef);this.b-=this.v?9:3+(7==this.j?2:0)}function Dg(){this.ja(28,0,-9)}
|
||||
function Eg(){this.sa&&(this.sa.Ec(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;ne(this,-2);this.b-=3}function Fg(a){S(this,a,this.g[(a>>6&7)+this.lc],Ff);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,H(b,1)?(I(b,"undefined opcode "+O(b,a),!0,!0),b=kg(b)):b=!1;b||this.ja(8,0,-9)}function de(a){Gg[a>>12].call(this,a)}function Hg(a){Ig[a>>6&3].call(this,a)}function Jg(a){Kg[a>>6&3].call(this,a)}function Lg(a){Mg[a>>6&3].call(this,a)}
|
||||
function yg(){te(this);this.b-=13}function zg(a){a&1&&(this.G=65536);a&2&&(this.H=32768);a&4&&(this.L=0);a&8&&(this.J=32768);this.b-=5}function Ag(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)he(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Bg(a){T(this,a,Ce(this,a),Cf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.V?5:3)+(7==this.j?2:0)}function Cg(a){T(this,a,0,Ef);this.b-=this.v?9:3+(7==this.j?2:0)}function Dg(){this.ja(28,0,-9)}
|
||||
function Eg(){this.sa&&(this.sa.Ec(this.g[7],!0),this.sa.setData(this.g[0],!0));this.i|=8;ne(this,-2);this.b-=3}function Fg(a){T(this,a,this.g[(a>>6&7)+this.lc],Ff);this.b-=this.v?9:3+(7==this.j?2:0)}function U(a){var b;if(b=this.F)b=this.F,H(b,1)?(I(b,"undefined opcode "+O(b,a),!0,!0),b=kg(b)):b=!1;b||this.ja(8,0,-9)}function de(a){Gg[a>>12].call(this,a)}function Hg(a){Ig[a>>6&3].call(this,a)}function Jg(a){Kg[a>>6&3].call(this,a)}function Lg(a){Mg[a>>6&3].call(this,a)}
|
||||
function Ng(a){Og[a&15].call(this,a)}function Pg(a){Qg[a&15].call(this,a)}function Rg(a){Sg[a>>6&3].call(this,a)}function Tg(a){Ug[a>>6&3].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}
|
||||
var Gg=[function(a){Xg[a>>8&15].call(this,a)},rg,fg,Pf,Lf,Nf,Gf,U,function(a){Yg[a>>8&15].call(this,a)},sg,gg,Qf,Mf,Of,Bg,U],Xg=[function(a){Zg[a>>4&15].call(this,a)},bg,Zf,Rf,Sf,Xf,Tf,Vf,pg,pg,Hg,Jg,Lg,U,U,U],Ig=[function(a){Ie(this,a,0,this.fb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,0,qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,1,uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,1,sf);this.b-=this.v?9:3+(7==this.j?2:0)}],Kg=[function(a){S(this,a,0,wf);
|
||||
this.b-=this.v?11:6},function(a){S(this,a,je(this)?1:0,ff);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,je(this)?1:0,Cf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Fe(this,a);this.fb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Mg=[function(a){S(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,0,kf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){S(this,a,0,hf);this.b-=this.v?9:3+(7==this.j?2:0)}],Zg=
|
||||
var Gg=[function(a){Xg[a>>8&15].call(this,a)},rg,fg,Pf,Lf,Nf,Gf,U,function(a){Yg[a>>8&15].call(this,a)},sg,gg,Qf,Mf,Of,Bg,U],Xg=[function(a){Zg[a>>4&15].call(this,a)},bg,Zf,Rf,Sf,Xf,Tf,Vf,pg,pg,Hg,Jg,Lg,U,U,U],Ig=[function(a){Ie(this,a,0,this.fb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,1,sf);this.b-=this.v?9:3+(7==this.j?2:0)}],Kg=[function(a){T(this,a,0,wf);
|
||||
this.b-=this.v?11:6},function(a){T(this,a,je(this)?1:0,ff);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,je(this)?1:0,Cf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Fe(this,a);this.fb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],Mg=[function(a){T(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,kf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){T(this,a,0,hf);this.b-=this.v?9:3+(7==this.j?2:0)}],Zg=
|
||||
[function(a){$g[a&15].call(this,a)},U,U,U,ng,ng,ng,ng,xg,U,Ng,Pg,Cg,Cg,Cg,Cg],$g=[jg,Eg,yg,ag,lg,wg,U,U,U,U,U,U,U,U,U,U],Og=[vg,function(){this.G=0;this.b-=5},function(){this.H=0;this.b-=5},eg,function(){this.L=1;this.b-=5},eg,eg,eg,function(){this.J=0;this.b-=5},eg,eg,eg,eg,eg,eg,eg],Qg=[vg,function(){this.G=65536;this.b-=5},function(){this.H=32768;this.b-=5},zg,function(){this.L=0;this.b-=5},zg,zg,zg,function(){this.J=32768;this.b-=5},zg,zg,zg,zg,zg,zg,zg],Yg=[$f,Yf,Uf,Wf,cg,dg,Jf,Kf,ig,Dg,Rg,Tg,
|
||||
Vg,U,U,U],Sg=[function(a){He(this,a,0,255,this.fb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ge(this,a,0,rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ge(this,a,1,vf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ge(this,a,1,tf);this.b-=this.v?9:3+(7==this.j?2:0)}],Ug=[function(a){Ge(this,a,0,xf);this.b-=this.v?11:6},function(a){Ge(this,a,je(this)?1:0,gf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ge(this,a,je(this)?1:0,Df);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ee(this,
|
||||
a);this.fb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],Wg=[function(a){Ge(this,a,0,Bf);this.b-=this.v?9+(this.hc&1):3+(7==this.j?2:0)},function(a){Ge(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Ge(this,a,0,lf);this.b-=this.v?9+(this.hc&1):3+(7==this.j?2:0)},function(a){Ge(this,a,0,jf);this.b-=this.v?9:3+(7==this.j?2:0)}];function ee(a){ah[a>>12].call(this,a)}
|
||||
|
|
@ -182,8 +182,8 @@ null!=a.j&&a.j.length&&(b=a.j);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.D,
|
|||
function lh(a){A.call(this,"RAM",a);this.da=this.g=null;this.i=a.addr;this.j=a.size;this.La=a.load;this.Ka=a.exec;this.v=!1;this.b=a.file;this.w=x(this.b);if(this.b){a=this.b;var b=oa(this.w);"json"!=b&&"hex"!=b&&(a=Ca()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;Aa(a,null,!0,function(a,b,f){f?(c.N("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(ib(c.kb,a,b),(a=Ba(a,b))?(c.g=a.ba,c.da=a.da,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.b=null);mh(c)})}}
|
||||
p(lh,A);lh.prototype.pa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;mh(this)};lh.prototype.qa=function(){this.da&&(this.F&&kh(this.F,this.id,this.i,this.j,this.da),delete this.da);return!0};lh.prototype.za=function(){return!0};function mh(a){if(a.D&&(!a.v&&a.j&&(Ic(a.D,a.i,a.j,Tc)?a.v=!0:a.j=0),!qb(a))){if(!a.v)y("No RAM allocated");else if(a.b){if(!a.g||!a.D)return;nh(a,a.g,a.La,a.Ka,a.i)}G(a)}}
|
||||
lh.prototype.reset=function(){if(this.v){for(var a=this.D,b=this.i,c=this.j,d=b&a.j,b=b>>>a.g;0<c&&b<a.b.length;){var e=a.b[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(yb&&e.C)for(k=d;f--&&k<e.C.length;k++)e.C[k]=g;else for(k=d;f--&&k<e.size;k++)e.I(d,g,e.K+d);c-=a.i;b++;d=0}this.g&&nh(this,this.g,this.La,this.Ka,this.i,!0)}};
|
||||
function nh(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){I(a,"invalid signature ("+w(m)+") at offset "+w(n),4096);break}if(l+6>=b.length){I(a,"invalid block at offset "+w(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(t&255)+(t>>8)),u=l,E=r-=6;0<r&&l<b.length;)m+=b[l++]&255,r--;if(r||l>=b.length){I(a,"insufficient data for block at offset "+w(n),4096);break}m+=
|
||||
b[l++]&255;if(m&255){I(a,"invalid checksum ("+v(m,2,!0)+") for block at offset "+w(n),4096);break}if(E)for(I(a,"loading "+w(E)+" bytes at "+w(t)+"-"+w(t+E),4096);E--;)Qc(a.D,t++,b[u++]&255);else t&1?g=!0:null==d&&(d=t),null!=d&&I(a,"starting address: "+w(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)Qc(a.D,c+e,b[e]);k=!0}if(k){if(null==d||g)J(a.f),f=!1;null!=d&&ge(a.f,d,f)}return k}
|
||||
function nh(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){I(a,"invalid signature ("+w(m)+") at offset "+w(n),4096);break}if(l+6>=b.length){I(a,"invalid block at offset "+w(n),4096);break}for(var l=l+2,r=b[l++]&255|(b[l++]&255)<<8,u=b[l++]&255|(b[l++]&255)<<8,m=m+((r&255)+(r>>8)+(u&255)+(u>>8)),t=l,E=r-=6;0<r&&l<b.length;)m+=b[l++]&255,r--;if(r||l>=b.length){I(a,"insufficient data for block at offset "+w(n),4096);break}m+=
|
||||
b[l++]&255;if(m&255){I(a,"invalid checksum ("+v(m,2,!0)+") for block at offset "+w(n),4096);break}if(E)for(I(a,"loading "+w(E)+" bytes at "+w(u)+"-"+w(u+E),4096);E--;)Qc(a.D,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&I(a,"starting address: "+w(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)Qc(a.D,c+e,b[e]);k=!0}if(k){if(null==d||g)J(a.f),f=!1;null!=d&&ge(a.f,d,f)}return k}
|
||||
Ua(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new lh(d);nb(d,c)}});function oh(a){A.call(this,"Keyboard",a,0,1024);G(this)}p(oh,A);oh.prototype.na=function(){return!1};oh.prototype.pa=function(a,b,c,d){this.I=a;this.f=c;this.F=d};Ua(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new oh(d);nb(d,c)}});
|
||||
function ph(a){A.call(this,"SerialPort",a,0,262144);this.J=a.adapter;this.S=a.baudReceive||9600;this.aa=a.baudTransmit||9600;this.Y=a.upperCase;this.i=this.w=null;this.V=a.tabSize;this.U=a.charBOL;this.B=0;this.H=!0;this.P=this.L=null;this.R=this.X=-1;this.G=this.b=this.g=0;this.j=[];var b=a.binding;if("console"==b)this.w="";else{var c;a=qh;b&&(void 0===c&&(c="Panel"),(c=mb(c,this.id))&&(b=c.C[b])&&this.na(null,a,b))}this.v=this.M=this.O=null;this.exports={connect:this.kd,receiveData:this.cc,receiveStatus:this.df}}
|
||||
p(ph,A);h=ph.prototype;
|
||||
|
|
@ -194,7 +194,7 @@ G(this)};h.kd=function(a){if(!this.v){var b=Pd(this.I,"connection");if(b){var c=
|
|||
h.qa=function(a,b){if(!b)if(this.kd(this.H),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){sh(this)};h.save=function(){var a=new ie(this);a.set(0,[]);return a.data()};h.restore=function(){return sh(this)};function sh(a){a.G=0;a.b=8192;a.g=128;a.j=[];return!0}
|
||||
h.cc=function(a){if("number"==typeof a)this.j.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.j.push(b)}else this.j=this.j.concat(a);Zc(this.f,this.R,1E3/Math.round(this.S/10));return!0};h.df=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&Yc(this.f,this.P))};h.xe=function(){var a=this.b&65534;this.b&=-32769;return a};
|
||||
h.Gf=function(a){var b=a^this.b;this.b=this.b&-112|a&111;this.O&&b&6&&(b=0,b=this.H?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.O.call(this.v,b))};h.we=function(){this.b&=-129;return this.G};h.Ff=function(){};h.cf=function(){return this.g};h.lg=function(a){this.g&128&&(a&64?Yc(this.f,this.L):dd(this.f,this.L));this.g=this.g&-70|a&69};h.bf=function(){return 0};
|
||||
h.kg=function(a){a&=255;I(this,"transmitByte("+v(a,2,!0)+")");this.M&&this.M.call(this.v,a);a&=127;if(this.i)if(13==a)this.B=0;else if(8==a)this.i.value=this.i.value.slice(0,-1),0<this.B&&this.B--;else{if(a){var b;b=(b=13!=a&&10!=a?wa[a]:null)?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.V||8,c=a-this.B%a,this.V&&(b=ta("",c)));this.U&&!this.B&&c&&(b=String.fromCharCode(this.U)+b);this.i.value+=b;this.i.scrollTop=this.i.scrollHeight;this.B+=c}}else if(null!=this.w){if(10==
|
||||
h.kg=function(a){a&=255;I(this,"transmitByte("+v(a,2,!0)+")");this.M&&this.M.call(this.v,a);a&=127;if(this.i)if(13==a)this.B=0;else if(8==a)this.i.value=this.i.value.slice(0,-1),0<this.B&&this.B--;else{if(a){var b;13!=a&&10!=a&&(b=wa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.V||8,c=a-this.B%a,this.V&&(b=ta("",c)));this.U&&!this.B&&c&&(b=String.fromCharCode(this.U)+b);this.i.value+=b;this.i.scrollTop=this.i.scrollHeight;this.B+=c}}else if(null!=this.w){if(10==
|
||||
a||1024<=this.w.length)this.u(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}Zc(this.f,this.X,1E3/Math.round(this.aa/10));this.g&=-129};var qh="buffer",th={},rh=(th[65392]=[null,null,ph.prototype.xe,ph.prototype.Gf,"RCSR"],th[65394]=[null,null,ph.prototype.we,ph.prototype.Ff,"RBUF"],th[65396]=[null,null,ph.prototype.cf,ph.prototype.lg,"XCSR"],th[65398]=[null,null,ph.prototype.bf,ph.prototype.kg,"XBUF"],th);
|
||||
Ua(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ph(d);nb(d,c)}});function md(a){A.call(this,"PC11",a);this.M=uh(this,a.autoMount);this.g=0;this.S=a.baudReceive||3600;this.B=this.G=this.b=0;this.w=[];this.v=vh;this.i=wh;this.L=this.j="";this.ba=this.La=this.Ka=null;this.P=-1;this.O=!Ma("Mobi")&&window&&"FileReader"in window;this.H=null;this.R=-1;this.J=null}p(md,A);
|
||||
function uh(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=md.prototype;
|
||||
|
|
@ -211,12 +211,12 @@ function Mh(a,b,c,d,e,f,g){a.L=b;a.j=c;a.i=d;a.ba=e;a.La=f;a.Ka=g;d==xh?a.J&&nh(
|
|||
h.zf=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Yc(this.f,this.H)):(this.b&=-129,this.b|=2048,this.G=0,Zc(this.f,this.R,1E3/Math.round(this.S/10))));this.b=this.b&-66|a&65};h.pe=function(){this.b&=-129;this.b|=2048;return this.G};h.yf=function(){};var vh="",Fh="?",Gh="??",wh=0,yh=1,xh=2,Ah="readProgress",Nh="pcjs-progress-bar",Oh={},Dh=(Oh[65384]=[null,null,md.prototype.qe,md.prototype.zf,"PRS"],Oh[65386]=[null,null,md.prototype.pe,md.prototype.yf,"PRB"],Oh);
|
||||
function Ph(a,b,c){A.call(this,"Disk",{id:a.kb+".disk"+v(++Qh,4)},0,8192);this.controller=a;this.I=a.I;this.F=a.F;this.v=b;this.Ma=b.name;this.va=this.ec="";this.ac=b.ac;this.W=this.ca=this.Z=this.ma=this.mode=0;this.b=[];this.i=null;this.j=!1;Rh(this,c,b.W,b.ca,b.Z,b.ma);this.g=this.w=null;G(this)}p(Ph,A);h=Ph.prototype;h.pa=function(a,b,c,d){this.F=d};
|
||||
function Rh(a,b,c,d,e,f){a.mode=b;a.W=c;a.ca=d;a.Z=e;a.ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.W);for(c=0;c<b.length;c++){d=Array(a.ca);for(e=0;e<d.length;e++){f=Array(a.Z);for(var g=1;g<=f.length;g++)f[g-1]=Sh(null,c,e,g,a.ma,0);d[e]=f}b[c]=d}a.b=b}a.i=null}
|
||||
function Th(a,b,c,d,e){var f=c;if(a.g)return!0;a.Ma=b;a.va=c;a.ec=x(c);a.g=e;a.w=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ja[d];if(e){a.W=e[0];a.ca=e[1];a.Z=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.W);for(d=0;d<a.b.length;d++)for(var t=a.b[d]=Array(a.ca),u=0;u<t.length;u++)for(var E=t[u]=Array(a.Z),z=0;z<E.length;z++){for(var C=Sh(null,d,u,z+1,a.ma,0),F=C.data,bb=0;bb<c;bb++,f+=4)var V=F[bb]=b.getInt32(f,!0),
|
||||
function Th(a,b,c,d,e){var f=c;if(a.g)return!0;a.Ma=b;a.va=c;a.ec=x(c);a.g=e;a.w=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ja[d];if(e){a.W=e[0];a.ca=e[1];a.Z=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.W);for(d=0;d<a.b.length;d++)for(var u=a.b[d]=Array(a.ca),t=0;t<u.length;t++)for(var E=u[t]=Array(a.Z),z=0;z<E.length;z++){for(var C=Sh(null,d,t,z+1,a.ma,0),F=C.data,bb=0;bb<c;bb++,f+=4)var V=F[bb]=b.getInt32(f,!0),
|
||||
e=e+V&-1;C.Ga=c;E[z]=C}a.i=e;c=a}else a.N("Unrecognized disk format ("+d+" bytes)");a.g&&(a.g.call(a.controller,a.v,c,a.Ma,a.va),a.g=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=oa(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"):pa(c,"/")&&(d="dir"),f=Ca()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ac?"":e)+"&format=json"));return!!Aa(f,null,
|
||||
!0,function(b,c,d){Uh(a,b,c,d)})}
|
||||
function Uh(a,b,c,d){var e=null,f=0>d&&!!a.I&&!a.I.A.ea;a.j=!1;if(d)a.controller.N('Unable to load disk "'+a.Ma+'" (error '+d+": "+b+")",f);else{ib(a.controller.kb,b,c);try{if(0<x(a.ec,!0).toLowerCase().indexOf("-readonly"))a.j=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.j=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.Ma]: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)y(k[0]);else{a.W=k.length;a.ca=k[0].length;a.Z=k[0][0].length;var l=k[0][0][0];a.ma=l&&l.length||512;for(d=c=0;d<a.W;d++)for(f=0;f<a.ca;f++)for(g=0;g<a.Z;g++)if(l=k[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 r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var u=m<<2,E=t.length;E<u;E++)t[E]=n;Vh(l,t)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}Sh(l,d,f);for(u=
|
||||
0;u<r.length;u++)c=c+r[u]&-1}a.b=k;a.i=c;e=a}else y("Empty disk image: "+a.Ma)}catch(z){y("Disk image error ("+b+"): "+z.message)}}a.g&&(a.g.call(a.w,a.v,e,a.Ma,a.va),a.g=null)}function Sh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.nh=b;a.oh=c;a.Qa=a.Ga=0;a.Sa=!1;return a}
|
||||
c+")");if(k.length)if(1==k.length)y(k[0]);else{a.W=k.length;a.ca=k[0].length;a.Z=k[0][0].length;var l=k[0][0][0];a.ma=l&&l.length||512;for(d=c=0;d<a.W;d++)for(f=0;f<a.ca;f++)for(g=0;g<a.Z;g++)if(l=k[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 r=l.data;if(void 0===r){var u=l.bytes;if(void 0!==u&&u.length){for(var t=m<<2,E=u.length;E<t;E++)u[E]=n;Vh(l,u)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}Sh(l,d,f);for(t=
|
||||
0;t<r.length;t++)c=c+r[t]&-1}a.b=k;a.i=c;e=a}else y("Empty disk image: "+a.Ma)}catch(z){y("Disk image error ("+b+"): "+z.message)}}a.g&&(a.g.call(a.w,a.v,e,a.Ma,a.va),a.g=null)}function Sh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.nh=b;a.oh=c;a.Qa=a.Ga=0;a.Sa=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var k=g[b];if(!k&&f.Hd&&b<f.ca)for(k=g[b]=Array(f.ad),g=0;g<k.length;g++)k[g]=Sh(null,a,b,g+1,f.Ac,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Hd&&9==f.xc&&(d=k[g]=Sh(null,a,b,f.xc,f.Ac,0))}}e&&e(d,!1);return d};function Vh(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.j)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.Ga?f<a.Qa?(a.Ga+=a.Qa-f,a.Qa=f):f>=a.Qa+a.Ga&&(a.Ga+=f-(a.Qa+a.Ga)+1):(a.Qa=f,a.Ga=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function Wh(a,b){var c=a.ca*a.Z,d=b/c|0;return d<a.W?(b%=c,a.seek(d,b/a.Z|0,b%a.Z+1)):null}function Xh(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 Yh(a){for(var b="",c=0,d;d=Wh(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(Xh(a,d,e));return btoa(b)}
|
||||
|
|
@ -224,146 +224,146 @@ h.save=function(){var a=0,b=[];b[a++]=[this.va,this.i,this.W,this.ca,this.Z,this
|
|||
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.b.length&&6<=e.length?Rh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.i&&e[1]!=this.i&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.i+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.b.length||l>=this.b[k].length||m>=this.b[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.j){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.b[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.Qa=e;for(k.Ga=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.N("Unable to restore disk '"+this.Ma+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=Wh(this,a++);)Zh(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 Zh(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)}}var Qh=0;function R(a){A.call(this,"RK11",a,0,65536);this.G=$h(this,a.autoMount);this.B=0;this.g=Array(8);this.H=!Ma("Mobi")&&window&&"FileReader"in window;this.cb=null;this.L=this.i=this.b=this.w=this.v=this.j=this.J=0}p(R,A);
|
||||
function Zh(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)}}var Qh=0;function R(a){A.call(this,"RK11",a,0,65536);this.G=$h(this,a.autoMount);this.B=0;this.i=Array(8);this.H=!Ma("Mobi")&&window&&"FileReader"in window;this.cb=null;this.L=this.g=this.b=this.w=this.v=this.j=this.J=0}p(R,A);
|
||||
function $h(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=R.prototype;
|
||||
h.na=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RK11 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.C[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&ai(d,
|
||||
a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&ui(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ga?(ge(d.f,0,!0),(a=d.Tc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c);
|
||||
break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[la(a.value,10)||0])?(a=a.ga)?(a=Na(Yh(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.C[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;ui(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=$h(this,Pd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);wi(this);this.cb=$c(this.f,144,5,65536);Mb(b,this,xi);Ob(b,this.reset.bind(this));yi(this,"None",zi,!0);this.H&&yi(this,"Local Disk",Ai);yi(this,"Remote Disk",Bi);Ci(this)||G(this)};
|
||||
h.qa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.g.length;a++)Di(this,a,!0);Ci(this,!0)}}else if(!this.restore(a))return!1;if(a=this.C.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ai(this,0)}}return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){wi(this)};h.save=function(){return(new ie(this)).data()};
|
||||
h.restore=function(a){return wi(this,a[0])};function Ci(a,b){b||(a.B=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.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=x(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.g.length)){!Ei(a,g,f,e,!0)&&b&&G(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.B}
|
||||
function ui(a,b,c,d){var e=a.C.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==Ai)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Bi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ei(a,e,b,c,!1,d)}else Di(a,e)}
|
||||
function Ei(a,b,c,d,e,f){var g=-1,k=a.g[b];k.va.toLowerCase()!=d.toLowerCase()&&(g++,Di(a,b,!0),k.pb?a.N("RK11 busy"):(k.pb=!0,e&&(k.ob=!0,a.B++,H(a)&&I(a,"auto-loading disk: "+c)),k.Ta=!!f,Th(new Ph(a,k,"preload"),c,d,f,a.yd)&&g++));return g}
|
||||
a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&bi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.i.length||!(a=d.i[b])?d.N("Unable to boot the selected drive"):a.ga?(ge(d.f,0,!0),(a=d.Tc(a,0,0,0,512,0,2))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.H){c.parentNode.removeChild(c);
|
||||
break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.i&&((a=d.i[la(a.value,10)||0])?(a=a.ga)?(a=Na(Yh(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.H)return this.C[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;bi(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=$h(this,Pd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.G[e]=a[e]);vi(this);this.cb=$c(this.f,144,5,65536);Mb(b,this,xi);Ob(b,this.reset.bind(this));yi(this,"None",zi,!0);this.H&&yi(this,"Local Disk",Ai);yi(this,"Remote Disk",Bi);Ci(this)||G(this)};
|
||||
h.qa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.i.length;a++)Di(this,a,!0);Ci(this,!0)}}else if(!this.restore(a))return!1;if(a=this.C.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";ai(this,0)}}return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){vi(this)};h.save=function(){return(new ie(this)).data()};
|
||||
h.restore=function(a){return vi(this,a[0])};function Ci(a,b){b||(a.B=0);for(var c in a.G){var d=a.G[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.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=x(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.i.length)){!Ei(a,g,f,e,!0)&&b&&G(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.B}
|
||||
function bi(a,b,c,d){var e=a.C.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.i.length)a.N("Unable to load the selected drive");else if(c)if(c==Ai)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Bi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ei(a,e,b,c,!1,d)}else Di(a,e)}
|
||||
function Ei(a,b,c,d,e,f){var g=-1,k=a.i[b];k.va.toLowerCase()!=d.toLowerCase()&&(g++,Di(a,b,!0),k.pb?a.N("RK11 busy"):(k.pb=!0,e&&(k.ob=!0,a.B++,H(a)&&I(a,"auto-loading disk: "+c)),k.Ta=!!f,Th(new Ph(a,k,"preload"),c,d,f,a.yd)&&g++));return g}
|
||||
h.yd=function(a,b,c,d,e){a.pb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RK"+a.qb)),b=null);b?(a.ga=b,a.Ma=c,a.va=d,this.N('Loaded disk "'+c+'" in drive '+("RK"+a.qb),a.ob||e),this.I&&Zd(this.I)):a.Ta=!1;a.ob&&(a.ob=!1,--this.B||G(this));ai(this,a.qb)};
|
||||
function yi(a,b,c,d){if((a=a.C.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 ai(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.C.listDisks;a=a.C.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ta?Ai:c.va,!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 Di(a,b,c){var d=a.g[b];if(d.ga||!1===c)d.Ma="",d.va="",d.ga=null,d.Ta=!1,c||(a.N("Drive RK"+b+" unloaded",c),ai(a,b))}
|
||||
function wi(a,b){var c=0;b||(b=[]);a.L=b[c++]||2368;a.i=b[c++]||0;a.b=b[c++]||128;a.w=b[c++]||0;a.v=b[c++]||0;a.j=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.qb=b;d.name=c.jb;d.pb=d.Ta=!1;d.W=203;d.ca=2;d.Z=12;d.ma=512;d.ac=!0;d.Id=0;d.Gd=0;d.xc=1;d.ad=d.Z;d.Ac=d.ma;d.Nd=0;d.ff=null;d.ga||(d.va="");d.status=2368}return!0}
|
||||
h.Tc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ga;var n=null,r;a||(m=128,e=0);for(;e;){if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b))}var t,u;if(0>(t=a.read(n,r++))||0>(u=a.read(n,r++))){m=32;break}if(!k&&(gc(this.D,ve(this.f,f),t|u<<8),Wc(this.D))){m=1024;break}r>=a.ma&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.zd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ga;var n=null,r;a||(m=128,e=0);for(;e;){var t=ic(this.D,ve(this.f,f));if(Wc(this.D)){m=1024;break}f+=g;e--;if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b))}if(k){if(0>a.read(n,r++)||0>a.read(n,r++)){m=32;break}}else if(!a.write(n,r++,t&255)||!a.write(n,r++,t>>8)){m=32;break}r>=a.ma&&(n=null)}return l?l(m,b,c,d,e,f):m};
|
||||
h.xd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;a&&(this.i=this.i|a|32768,this.b|=49152);return!0};h.Ce=function(){return this.L};h.Lf=function(){};h.De=function(){return this.i};h.Mf=function(){};h.ze=function(){return this.b&61438};
|
||||
h.If=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c="",d=(this.j&57344)>>13,e=this.g[d],f,g,k,l,m,n;this.b&=-129;var r=this.b&14;switch(r){case 0:H(this)&&I(this,this.type+": CRESET("+d+")",!0);this.i=0;this.b=128;this.j=0;break;case 8:f=(this.j&8160)>>5;H(this)&&I(this,this.type+": SEEK("+f+")",!0);f>=e.W&&(this.i|=32832,this.b|=49152);break;case 10:c="RCHK";case 4:c||(c="READ"),b=this.Tc;case 6:c||(c="WCHK");case 2:c||(c="WRITE");b||(b=this.zd);f=(this.j&8160)>>5;g=(this.j&16)>>
|
||||
4;k=this.j&15;l=65536-this.w&65535;m=(this.b&48)<<12|this.v;n=this.b&2048?0:2;H(this)&&I(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+q(m)+"--"+q(m+(l<<1)),!0,!0);if(f>=e.W){this.i|=32832;this.b|=49152;break}if(k>=e.Z){this.i|=32800;this.b|=49152;break}a=b.call(this,e,f,g,k,l,m,n,6<=r,this.xd.bind(this));break;case 12:H(this)&&I(this,this.type+": DRESET("+d+")");break;default:H(this)&&I(this,this.type+": UNSUPPORTED("+r+")")}this.L=e.status|(e.ga?128:0)|d<<13|this.j&15;this.i&32768&&H(this)&&I(this,
|
||||
this.type+": ERROR: "+q(this.i));a&&(this.b&=-2,this.b|=128,this.b&64&&Yc(this.f,this.cb))}};h.Ee=function(){return this.w};h.Nf=function(a){this.w=a};h.ye=function(){return this.v};h.Hf=function(a){this.v=a};h.Ae=function(){return this.j};h.Jf=function(a){this.j=a};h.Be=function(){return this.J};h.Kf=function(a){this.J=a};
|
||||
var zi="",Ai="?",Bi="??",Fi={},xi=(Fi[65280]=[null,null,R.prototype.Ce,R.prototype.Lf,"RKDS"],Fi[65282]=[null,null,R.prototype.De,R.prototype.Mf,"RKER"],Fi[65284]=[null,null,R.prototype.ze,R.prototype.If,"RKCS"],Fi[65286]=[null,null,R.prototype.Ee,R.prototype.Nf,"RKWC"],Fi[65288]=[null,null,R.prototype.ye,R.prototype.Hf,"RKBA"],Fi[65290]=[null,null,R.prototype.Ae,R.prototype.Jf,"RKDA"],Fi[65294]=[null,null,R.prototype.Be,R.prototype.Kf,"RKDB"],Fi);
|
||||
function nd(a){A.call(this,"RL11",a,0,131072);this.H=Gi(this,a.autoMount);this.G=0;this.g=Array(4);this.J=!Ma("Mobi")&&window&&"FileReader"in window;this.cb=null;this.b=this.B=this.i=this.j=this.w=this.v=0}p(nd,A);function Gi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=nd.prototype;
|
||||
h.na=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("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.C[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Hi(d,
|
||||
a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Ii(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ga?(ge(d.f,0,!0),(a=d.Uc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.J){c.parentNode.removeChild(c);
|
||||
break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[la(a.value,10)||0])?(a=a.ga)?(a=Na(Yh(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.J)return this.C[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;Ii(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=Gi(this,Pd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Ji(this);this.cb=$c(this.f,112,5,131072);Mb(b,this,Ki);Ob(b,this.reset.bind(this));Li(this,"None",Mi,!0);this.J&&Li(this,"Local Disk",Ni);Li(this,"Remote Disk",Oi);Pi(this)||G(this)};
|
||||
h.qa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.g.length;a++)Qi(this,a,!0);Pi(this,!0)}}else if(!this.restore(a))return!1;if(a=this.C.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";Hi(this,0)}}return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){Ji(this)};h.save=function(){return(new ie(this)).data()};
|
||||
h.restore=function(a){return Ji(this,a[0])};function Pi(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.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=x(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.g.length)){!Ri(a,g,f,e,!0)&&b&&G(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.G}
|
||||
function Ii(a,b,c,d){var e=a.C.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==Ni)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Oi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ri(a,e,b,c,!1,d)}else Qi(a,e)}
|
||||
function Ri(a,b,c,d,e,f){var g=-1,k=a.g[b];k.va.toLowerCase()!=d.toLowerCase()&&(g++,Qi(a,b,!0),k.pb?a.N("RL11 busy"):(k.pb=!0,e&&(k.ob=!0,a.G++,H(a)&&I(a,"auto-loading disk: "+c)),k.Ta=!!f,Th(new Ph(a,k,"preload"),c,d,f,a.Bd)&&g++));return g}
|
||||
h.Bd=function(a,b,c,d,e){a.pb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.qb)),b=null);b?(a.ga=b,a.Ma=c,a.va=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.qb),a.ob||e),this.I&&Zd(this.I)):a.Ta=!1;a.ob&&(a.ob=!1,--this.G||G(this));Hi(this,a.qb)};
|
||||
function Li(a,b,c,d){if((a=a.C.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 Hi(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.C.listDisks;a=a.C.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ta?Ni:c.va,!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 Qi(a,b,c){var d=a.g[b];if(d.ga||!1===c)d.Ma="",d.va="",d.ga=null,d.Ta=!1,c||(a.N("Drive RL"+b+" unloaded",c),Hi(a,b))}
|
||||
function Ji(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.B=b[c++]||0;a.i=b[c++]||0;a.j=b[c++]||0;a.w=b[c++]||0;a.v=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.qb=b;d.name=c.jb;d.pb=d.Ta=!1;d.W=512;d.ca=2;d.Z=40;d.ma=256;d.ac=!0;d.Id=0;d.Gd=0;d.xc=1;d.ad=d.Z;d.Ac=d.ma;d.Nd=0;d.ff=null;d.ga||(d.va="");d.status=29}return!0}
|
||||
function ai(a,b){if(0<=b&&b<a.i.length){var c=a.i[b],d=a.C.listDisks;a=a.C.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ta?Ai:c.va,!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 Di(a,b,c){var d=a.i[b];if(d.ga||!1===c)d.Ma="",d.va="",d.ga=null,d.Ta=!1,c||(a.N("Drive RK"+b+" unloaded",c),ai(a,b))}
|
||||
function vi(a,b){var c=0;b||(b=[]);a.L=b[c++]||2368;a.g=b[c++]||0;a.b=b[c++]||128;a.w=b[c++]||0;a.v=b[c++]||0;a.j=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.i.length;b++){var d=a.i[b];void 0===d&&(d=a.i[b]={});c=a;d.qb=b;d.name=c.jb;d.pb=d.Ta=!1;d.W=203;d.ca=2;d.Z=12;d.ma=512;d.ac=!0;d.Id=0;d.Gd=0;d.xc=1;d.ad=d.Z;d.Ac=d.ma;d.Nd=0;d.ff=null;d.ga||(d.va="");d.status=2368}return!0}
|
||||
h.Tc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ga;var n=null,r;a||(m=128,e=0);for(;e;){if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1);if(!n){m=4096;break}r=0;++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=32;break}if(!k&&(gc(this.D,ve(this.f,f),u|t<<8),Wc(this.D))){m=1024;break}r>=a.ma&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.zd=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ga;var n=null,r;a||(m=128,e=0);for(;e;){var u=ic(this.D,ve(this.f,f));if(Wc(this.D)){m=1024;break}if(!n){if(b>=a.W){m=64;break}n=a.seek(b,c,d+1,!0);if(!n){m=4096;break}r=0;++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b))}if(k){var t,E;if(0>(t=a.read(n,r++))||0>(E=a.read(n,r++))){m=32;break}if(u!=(t|E<<8)){m=1;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=32;break}r>=a.ma&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.xd=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.w=65536-e&65535;this.j=this.j&-16|d&15;this.g|=a;Fi(this);return!0};function Fi(a){a.b&=-32769;a.g&&(a.g|=32768,a.b|=32768,a.g&32736&&(a.b|=16384),H(a)&&I(a,a.type+": ERROR: "+q(a.g)))}h.Ce=function(){return this.L};h.Lf=function(){};h.De=function(){return this.g};h.Mf=function(){};h.ze=function(){return this.b&61438};
|
||||
h.If=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c,d="",e=(this.j&57344)>>13,f=this.i[e],g,k,l,m,n,r;this.b&=-8321;this.g&=-4;switch(c=this.b&14){case 0:H(this)&&I(this,this.type+": CRESET("+e+")",!0);this.g=this.j=0;this.b=128;break;case 10:d="RCHK";case 4:d||(d="READ"),b=this.Tc;case 6:d||(d="WCHK");case 2:d||(d="WRITE");b||(b=this.zd);g=(this.j&8160)>>5;k=(this.j&16)>>4;l=this.j&15;m=65536-this.w&65535;n=(this.b&48)<<12|this.v;r=this.b&2048?0:2;H(this)&&I(this,this.type+": "+
|
||||
d+"("+g+":"+k+":"+l+") "+q(n)+"--"+q(n+(m<<1)),!0,!0);if(g>=f.W){this.g|=64;break}if(l>=f.Z){this.g|=32;break}a=b.call(this,f,g,k,l,m,n,r,6<=c,this.xd.bind(this));break;case 8:g=(this.j&8160)>>5;H(this)&&I(this,this.type+": SEEK("+g+")",!0);g<f.W?this.b|=8192:this.g|=64;break;case 12:H(this)&&I(this,this.type+": DRESET("+e+")");this.g=this.j=0;this.b=8320;break;default:H(this)&&I(this,this.type+": UNSUPPORTED("+c+")")}this.L=f.status|(f.ga?128:0)|e<<13|this.j&15;Fi(this);a&&(this.b&=-2,this.b|=128,
|
||||
this.b&64&&Yc(this.f,this.cb))}};h.Ee=function(){return this.w};h.Nf=function(a){this.w=a};h.ye=function(){return this.v};h.Hf=function(a){this.v=a};h.Ae=function(){return this.j};h.Jf=function(a){this.j=a};h.Be=function(){return this.J};h.Kf=function(a){this.J=a};
|
||||
var zi="",Ai="?",Bi="??",Gi={},xi=(Gi[65280]=[null,null,R.prototype.Ce,R.prototype.Lf,"RKDS"],Gi[65282]=[null,null,R.prototype.De,R.prototype.Mf,"RKER"],Gi[65284]=[null,null,R.prototype.ze,R.prototype.If,"RKCS"],Gi[65286]=[null,null,R.prototype.Ee,R.prototype.Nf,"RKWC"],Gi[65288]=[null,null,R.prototype.ye,R.prototype.Hf,"RKBA"],Gi[65290]=[null,null,R.prototype.Ae,R.prototype.Jf,"RKDA"],Gi[65294]=[null,null,R.prototype.Be,R.prototype.Kf,"RKDB"],Gi);
|
||||
function nd(a){A.call(this,"RL11",a,0,131072);this.H=Hi(this,a.autoMount);this.G=0;this.g=Array(4);this.J=!Ma("Mobi")&&window&&"FileReader"in window;this.cb=null;this.b=this.B=this.i=this.j=this.w=this.v=0}p(nd,A);function Hi(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=nd.prototype;
|
||||
h.na=function(a,b,c){var d=this;switch(b){case "listDisks":return this.C[b]=c,c.onchange=function(){var a=d.C.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("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.C[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Ii(d,
|
||||
a)},!0;case "loadDisk":return this.C[b]=c,c.onclick=function(){var a=d.C.listDisks;a&&a.options&&Ji(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.C[b]=c,c.onclick=function(){var a,b=d.C.listDrives,b=b&&la(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.N("Unable to boot the selected drive"):a.ga?(ge(d.f,0,!0),(a=d.Uc(a,0,0,0,512,0))&&d.N("Unable to read the boot sector ("+a+")")):d.N("Load a disk into the drive first")},!0;case "saveDisk":if(!this.J){c.parentNode.removeChild(c);
|
||||
break}this.C[b]=c;c.onclick=function(){var a=d.C.listDrives;a&&a.options&&d.g&&((a=d.g[la(a.value,10)||0])?(a=a.ga)?(a=Na(Yh(a),a.ec.replace(".json",".img")),y(a)):d.N("No disk loaded in drive."):d.N("No disk drive selected."))};return!0;case "mountDisk":if(this.J)return this.C[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;Ji(d,x(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.pa=function(a,b,c,d){this.I=a;this.D=b;this.f=c;this.F=d;if(a=Hi(this,Pd(this.I,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.H[e]=a[e]);Ki(this);this.cb=$c(this.f,112,5,131072);Mb(b,this,Li);Ob(b,this.reset.bind(this));Mi(this,"None",Ni,!0);this.J&&Mi(this,"Local Disk",Oi);Mi(this,"Remote Disk",Pi);Qi(this)||G(this)};
|
||||
h.qa=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.I.w){for(a=0;a<this.g.length;a++)Ri(this,a,!0);Qi(this,!0)}}else if(!this.restore(a))return!1;if(a=this.C.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";Ii(this,0)}}return!0};h.za=function(a){return a?this.save():!0};h.reset=function(){Ki(this)};h.save=function(){return(new ie(this)).data()};
|
||||
h.restore=function(a){return Ki(this,a[0])};function Qi(a,b){b||(a.G=0);for(var c in a.H){var d=a.H[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.C.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=x(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.g.length)){!Si(a,g,f,e,!0)&&b&&G(a,!1);continue}a.N("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.G}
|
||||
function Ji(a,b,c,d){var e=a.C.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.N("Unable to load the selected drive");else if(c)if(c==Oi)a.N('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Pi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=x(c);a.status("Attempting to load "+c+' as "'+b+'"')}Si(a,e,b,c,!1,d)}else Ri(a,e)}
|
||||
function Si(a,b,c,d,e,f){var g=-1,k=a.g[b];k.va.toLowerCase()!=d.toLowerCase()&&(g++,Ri(a,b,!0),k.pb?a.N("RL11 busy"):(k.pb=!0,e&&(k.ob=!0,a.G++,H(a)&&I(a,"auto-loading disk: "+c)),k.Ta=!!f,Th(new Ph(a,k,"preload"),c,d,f,a.Bd)&&g++));return g}
|
||||
h.Bd=function(a,b,c,d,e){a.pb=!1;b&&(b.W>a.W||b.ca>a.ca)&&(this.N('Disk "'+c+'" too large for drive '+("RL"+a.qb)),b=null);b?(a.ga=b,a.Ma=c,a.va=d,this.N('Loaded disk "'+c+'" in drive '+("RL"+a.qb),a.ob||e),this.I&&Zd(this.I)):a.Ta=!1;a.ob&&(a.ob=!1,--this.G||G(this));Ii(this,a.qb)};
|
||||
function Mi(a,b,c,d){if((a=a.C.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 Ii(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.C.listDisks;a=a.C.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Ta?Oi:c.va,!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 Ri(a,b,c){var d=a.g[b];if(d.ga||!1===c)d.Ma="",d.va="",d.ga=null,d.Ta=!1,c||(a.N("Drive RL"+b+" unloaded",c),Ii(a,b))}
|
||||
function Ki(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.B=b[c++]||0;a.i=b[c++]||0;a.j=b[c++]||0;a.w=b[c++]||0;a.v=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.qb=b;d.name=c.jb;d.pb=d.Ta=!1;d.W=512;d.ca=2;d.Z=40;d.ma=256;d.ac=!0;d.Id=0;d.Gd=0;d.xc=1;d.ad=d.Z;d.Ac=d.ma;d.Nd=0;d.ff=null;d.ga||(d.va="");d.status=29}return!0}
|
||||
h.Uc=function(a,b,c,d,e,f,g){var k=0;a=a.ga;var l=null,m;a||(k=5120,e=0);for(;e;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var n,r;if(0>(n=a.read(l,m++))||0>(r=a.read(l,m++))){k=5120;break}gc(this.D,ve(this.f,f),n|r<<8);if(Wc(this.D)){k=8192;break}f+=2;e--;if(m>=a.ma&&(l=null,++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b>=a.W)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
||||
h.Cd=function(a,b,c,d,e,f,g){var k=0;a=a.ga;var l=null,m;a||(k=5120,e=0);for(;e;){var n=ic(this.D,ve(this.f,f));if(Wc(this.D)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){k=5120;break}if(m>=a.ma&&(l=null,++d>=a.Z&&(d=0,++c>=a.ca&&(c=0,++b>=a.W)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
||||
h.Ad=function(a,b,c,d,e,f){this.B=f&65535;this.b=this.b&-49|f>>12&48;this.v=f>>16&63;this.j=this.i=b<<7|(c?64:0)|d&63;this.w=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};h.He=function(){return this.b&65535};
|
||||
h.Qf=function(a){this.b=this.b&-1023|a&1022;this.v=this.v&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c="",d=this.g[(this.b&768)>>8],e=d.ga,f,g,k;this.b&=-2;switch(this.b&14){case 4:this.w&8&&(this.b&=63);this.w=d.status|this.j&64|(e&&512==e.W?128:0);break;case 6:1==(this.i&3)&&(b=this.i&65408,c=(this.i&16)<<2,this.j=this.i&4?this.j+b:this.j-b,this.i=this.j=this.j&65408|c);break;case 8:this.w=this.j;break;case 12:c="READ",b=this.Uc;case 10:c||(c="WRITE"),b||(b=this.Cd),f=this.i>>7,g=this.i&64?1:0,k=
|
||||
this.i&63,!e||f>=e.W||k>=e.Z?this.b|=37888:(a=65536-this.w&65535,e=(this.v&63)<<16|this.B,H(this)&&I(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+q(e)+"--"+q(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,this.Ad.bind(this)))}a&&(this.b|=129,this.b&64&&Yc(this.f,this.cb))}};h.Fe=function(){return this.B};h.Of=function(a){this.B=a&65534};h.Ie=function(){return this.i};h.Rf=function(a){this.i=a};h.Je=function(){return this.w};h.Sf=function(a){this.w=a};h.Ge=function(){return this.v};
|
||||
h.Pf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Mi="",Ni="?",Oi="??",Si={},Ki=(Si[63744]=[null,null,nd.prototype.He,nd.prototype.Qf,"RLCS"],Si[63746]=[null,null,nd.prototype.Fe,nd.prototype.Of,"RLBA"],Si[63748]=[null,null,nd.prototype.Ie,nd.prototype.Rf,"RLDA"],Si[63750]=[null,null,nd.prototype.Je,nd.prototype.Sf,"RLMP"],Si[63752]=[null,null,nd.prototype.Ge,nd.prototype.Pf,"RLBE"],Si);
|
||||
function Ti(a){A.call(this,"Debugger",a);this.ua=a.base||16;this.aa=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.U={}}p(Ti,A);Ti.prototype.fd=function(){return-1};Ti.prototype.gd=function(){};
|
||||
function Ui(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+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(ua(b.substring(c,f))),c=f+1}}return a}
|
||||
function Vi(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;
|
||||
h.Pf=function(a){this.v=a&63;this.b=this.b&-49|(this.v&3)<<4};var Ni="",Oi="?",Pi="??",Ti={},Li=(Ti[63744]=[null,null,nd.prototype.He,nd.prototype.Qf,"RLCS"],Ti[63746]=[null,null,nd.prototype.Fe,nd.prototype.Of,"RLBA"],Ti[63748]=[null,null,nd.prototype.Ie,nd.prototype.Rf,"RLDA"],Ti[63750]=[null,null,nd.prototype.Je,nd.prototype.Sf,"RLMP"],Ti[63752]=[null,null,nd.prototype.Ge,nd.prototype.Pf,"RLBE"],Ti);
|
||||
function Ui(a){A.call(this,"Debugger",a);this.ua=a.base||16;this.aa=!1;this.w=0;this.P=!1;this.v=-1;this.j=[];this.U={}}p(Ui,A);Ui.prototype.fd=function(){return-1};Ui.prototype.gd=function(){};
|
||||
function Vi(a,b,c,d){if(c)if(b){0>a.v&&a.j.length&&(a.v=0);if(0>a.v||b!=a.j[a.v])a.j.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.j[a.v+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(ua(b.substring(c,f))),c=f+1}}return a}
|
||||
function Wi(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 Wi(a,b,c){var d;if(b){b=Xi(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ua(n);if(!n){f=!0;break}n=Yi(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],t=n.length;l.length&&Zi[n]<Zi[l[l.length-1]]&&Vi(k,l,1);l.push(n);b=b.substr(r+t)}Vi(k,l)&&1==k.length||(f=!0);f?c&&a.u("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&$i(a,null,
|
||||
d))}return d}function Xi(a,b){for(var c,d=a.aa?"(":"{",e=a.aa?")":"}",f=new RegExp(a.aa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Wi(a,c[1]);b=b.replace(d+c[1]+e,null!=g?O(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 Yi(a,b,c,d){var e;null!=b?(e=a.fd(b),0<=e?e=a.gd(e):(e=a.U[b],null==e&&(e=la(b,a.ua))),null!=e||d||a.u("invalid "+(c?c:"value")+": "+b)):d||a.u("missing "+(c||"value"));return e}function $i(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=ma(d&255,8)+g,d>>=8;d=v(c,0,!0)+" "+c+". "+q(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e}
|
||||
function aj(a,b){if(b)return $i(a,b,a.U[b]);var c=0;for(b in a.U)$i(a,b,a.U[b]),c++;return 0<c}function O(a,b,c,d){switch(a.ua){case 8:a=q(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=v(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var Zi={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function bj(a){Ti.call(this,a);this.Ba=!1;this.aa=!0;this.H=W();this.Aa=W();this.O=W();this.B=[];this.g=this.L=this.G=[];cj(this);this.R=this.Y=0;this.i=[];this.oa=void 0;dj(this);this.F=this;this.ka={};this.fa=this.ya=0;this.S=null;this.M=[];ej(this,a.messages);this.ta=a.commands;this.Ea=fj;this.xa=[];this.J=0;this.Fa=this.sa=null;this.w=this.Da=this.Ca=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Ud(b,a)}):void 0===global.pdp11&&(global.pdp11=
|
||||
function(a){return Ud(b,a)})}p(bj,Ti);function gj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:a||0,Ha:b||!1,Pa:!1,ua:c}}h=bj.prototype;h.Ec=function(a,b){a.K=b;a.Pa=!1;a.ua=void 0;return a};function hj(a){return[a.K,a.Ha,a.ua,a.Pa,a.dc]}function ij(a,b){var c=W(b[0],b[1],b[2]);c.Pa=b[3];b[4]&&(c.Zc=Ui(a,c.dc=b[4]));return c}
|
||||
h.pa=function(a,b,c,d){this.D=b;this.I=a;this.f=c;this.b=a.i;(a=Pd(a,"messages"))&&ej(this,a);1145>this.f.xa&&(this.xa=jj);bd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=gj(kj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."):(c=n.type,m=Nc[c],n&&d.u(v(n.id,8)+" %"+v(e<<d.D.g,8)+
|
||||
function Xi(a,b,c){var d;if(b){b=Yi(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ua(n);if(!n){f=!0;break}n=Zi(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}k.push(n);if(e==m.length)break;var n=m[e++],u=n.length;l.length&&$i[n]<$i[l[l.length-1]]&&Wi(k,l,1);l.push(n);b=b.substr(r+u)}Wi(k,l)&&1==k.length||(f=!0);f?c&&a.u("error parsing '"+g+"' at character "+(g.length-b.length)):(d=k.pop(),c&&aj(a,null,
|
||||
d))}return d}function Yi(a,b){for(var c,d=a.aa?"(":"{",e=a.aa?")":"}",f=new RegExp(a.aa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Xi(a,c[1]);b=b.replace(d+c[1]+e,null!=g?O(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 Zi(a,b,c,d){var e;null!=b?(e=a.fd(b),0<=e?e=a.gd(e):(e=a.U[b],null==e&&(e=la(b,a.ua))),null!=e||d||a.u("invalid "+(c?c:"value")+": "+b)):d||a.u("missing "+(c||"value"));return e}function aj(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=4,g="";if(!f||4<f)f=4;for(var k=0;k<f;k++)g&&(g=","+g),g=ma(d&255,8)+g,d>>=8;d=v(c,0,!0)+" "+c+". "+q(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e}
|
||||
function bj(a,b){if(b)return aj(a,b,a.U[b]);var c=0;for(b in a.U)aj(a,b,a.U[b]),c++;return 0<c}function O(a,b,c,d){switch(a.ua){case 8:a=q(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=v(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}var $i={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function cj(a){Ui.call(this,a);this.Ba=!1;this.aa=!0;this.H=W();this.Aa=W();this.O=W();this.B=[];this.g=this.L=this.G=[];dj(this);this.R=this.Y=0;this.i=[];this.oa=void 0;ej(this);this.F=this;this.ka={};this.fa=this.ya=0;this.S=null;this.M=[];fj(this,a.messages);this.ta=a.commands;this.Ea=gj;this.xa=[];this.J=0;this.Fa=this.sa=null;this.w=this.Da=this.Ca=this.X=this.la=0;this.b=this.V=null;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Ud(b,a)}):void 0===global.pdp11&&(global.pdp11=
|
||||
function(a){return Ud(b,a)})}p(cj,Ui);function hj(a){a=a&&a.K;null==a&&(a=-1);return a}function W(a,b,c){return{K:a||null,Ha:b||!1,Pa:!1,ua:c}}h=cj.prototype;h.Ec=function(a,b){a.K=b;a.Pa=!1;a.ua=void 0;return a};function ij(a){return[a.K,a.Ha,a.ua,a.Pa,a.dc]}function jj(a,b){var c=W(b[0],b[1],b[2]);c.Pa=b[3];b[4]&&(c.Zc=Vi(a,c.dc=b[4]));return c}
|
||||
h.pa=function(a,b,c,d){this.D=b;this.I=a;this.f=c;this.b=a.i;(a=Pd(a,"messages"))&&fj(this,a);1145>this.f.xa&&(this.xa=kj);bd(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=hj(lj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.u("blockid physical blockaddr used size type");d.u("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.u("..."):(c=n.type,m=Nc[c],n&&d.u(v(n.id,8)+" %"+v(e<<d.D.g,8)+
|
||||
" %"+v(n.K,8)+" "+w(n.Eb)+" "+w(n.size)+" "+m),c!=pd&&(c=-1),m=0);a+=d.D.i;e++}}});G(this)};
|
||||
h.na=function(a,b,c){var d=this;switch(b){case "debugInput":return this.V=this.C[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Ud(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.v<d.j.length-1&&(b=d.j[++d.v])):40==a.keyCode&&(0<d.v?b=d.j[--d.v]:(b="",d.v=-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.C[b]=c,Pa(c,function(){if(d.V){var a=d.V.value;d.V.value=
|
||||
"";Ud(d,a,!0);return!0}return!1}),!0;case "step":return this.C[b]=c,Pa(c,function(a){var b=!1;rb(d,!0)||(sb(d,!0),b=ac(d,a?1:0,null),sb(d,!1));return b}),!0}return!1};function Td(a){if(a.V){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.V.focus();window&&window.scrollTo(b,c)}}h.Lc=function(a,b){var c=255,d=gj(a);-1!==d&&(a.Ha||65535<d?(c=this.D,d=ve(this.f,d),c.G=!1,c.ha++,d=Pc(c,d).w(d&c.j,d),c.ha--):(c=this.f,c.la++,d=c.D.Ic(hc(c,d,3)),c.la--),c=d,b&&lj(a,b));return c};
|
||||
h.Na=function(a,b){var c=65535,d=gj(a);-1!==d&&(c=a.Ha||65535<d?ic(this.D,ve(this.f,d)):jc(this.f,d),b&&lj(a,b));return c};h.Mc=function(a,b,c){var d=gj(a);if(-1!==d){if(a.Ha||65535<d)Qc(this.D,ve(this.f,d),b);else{var e=this.f;e.la++;e.D.Jc(hc(e,d,5),b);e.la--}c&&lj(a,c);L(this.I,-1)}};h.wd=function(a,b,c){var d=gj(a);if(-1!==d){if(a.Ha||65535<d)gc(this.D,ve(this.f,d),b);else{var e=this.f;e.la++;e.D.Ib(hc(e,d,4),b);e.la--}c&&lj(a,c);L(this.I,-1)}};
|
||||
function kj(a,b,c){var d;c=(c?a.H:a.Aa).K;var e,f;if(void 0!==b){b=Xi(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,k;a:{c=a.D;var l;l=d.toUpperCase();for(k in c.Ja){var m=+k;if(c.Ja[m][4]==l){k=c.B+m;break a}}k=null}if(null==k&&d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.B.length;c++)if(l=a.B[c].da[d],null!=l){k=l.o;break}null!=k&&(g=W(k));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=Wi(a,b,void 0)}null!=c&&(d=W(c,e,f));return d}
|
||||
function mj(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Zc=Ui(a,b.dc=c[2]))}function lj(a,b){null!=a.K&&(a.K+=b||1)}function nj(a,b){return(b.Ha?"%":"")+O(a,b.K)}
|
||||
function ej(a,b){a.F=a;a.fa=a.ya=536870912;a.S=null;a.M=[];b=Ui(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Hb){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.fa|=Hb[c],a.u(c+" messages enabled"))}}function bd(a,b,c){for(var d in Hb)if(b==Hb[d]){a.ka[d]=c;break}}
|
||||
h.fd=function(a){a=a.toUpperCase();var b=oj[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function pj(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
h.gd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.oa[a-8];else if(20>a)b=this.f.X[a-16];else{var c=this.f,d=this.b;switch(a){case qj:b=kd(this.f);break;case rj:b=c.ab;break;case sj:b=c.R;break;case tj:b=c.ya&65280;break;case uj:b=ed(c);break;case vj:b=gd(c);break;case wj:b=hd(c);break;case xj:b=c.U;break;case yj:d&&(b=d.ra);break;case zj:d&&(b=d.rb);break;case Aj:d&&yc(d)&&(b=d.Ua)}}return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+nj(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||rb(this,!0))Bj(this),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,$d(a),a.mb=0,a.I&&L(a.I,void 0))}};
|
||||
function dj(a){var b;if(!Je(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Cj);for(b=0;b<a.i.length;b++)a.i[b]=W();a.R=0;a.u("instruction history buffer allocated")}}function Dj(a,b,c){if(!Ej(a,c))return!1;$b(a.f,b);return!0}
|
||||
function ac(a,b,c,d){if(!Ej(a))return!1;null===c&&(c=!a.sa||"tr"==a.sa);a.w=0;b||Je(a)&&ef(a,a.f.g[7],0);try{b=ae(a.f,b);var e=a.f.$b(b);0<e&&(bc(a.f,e),a.w+=e,cc(a.f,e,!0),dc(a.f,e),a.X++)}catch(f){"number"!=typeof f&&(a.w=0,ob(a.f,f.stack||f.message))}!1!==d&&(a.b&&a.b.stop(),L(a.I,-1));Sd(a,c||!1);return 0<a.w}function Bj(a,b){a.f&&J(a.f,b)}
|
||||
function Sd(a,b){if(a.Ba){void 0===b&&(b=!0);var c;c=a.f;if(c=c.i&128?c.Yc|c.Xc<<8:0){var d=c>>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?zb[-d]:O(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.J?Fj(a):Gj(a)}}function Ej(a,b){var c;(c=!a.f||!qb(a.f))||(c=a.f,c.A.ea?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!pb(a.f)}h.qa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
h.za=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){dj(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;Hj(this);a||Sd(this)};h.save=function(){var a=new ie(this);a.set(0,hj(this.H));a.set(1,hj(this.O));a.set(2,[this.j,this.P,this.fa]);a.set(3,this.B);return a.data()};
|
||||
h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=ij(this,a[b++]),this.O=ij(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.J||this.u("running");this.A.T=!0;this.Ca=a;this.Da=b};
|
||||
h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Da;if(!this.J){b="stopped";if(this.w){a-=this.Ca;var c=0<a?Math.round(1E3*this.w/a):0;b+=" (";Je(this)&&(b+=this.X+" instructions, ",this.X=0);b+=this.w+" cycles, "+a+" ms, "+c+" hz)"}else H(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.u(b)}Sd(this,!0);Td(this);Hj(this,this.f.g[7]);this.S=null}};function Je(a){return 1<a.g.length||!!a.Y}
|
||||
function ef(a,b,c){var d=-1;c||(d=jc(a.f,b))||(a.f.P&65535)!=b||(b=ne(a.f,2));if(0<c&&(a.Y&&!--a.Y||Ij(a,b,1,a.g)))return!0;0<=c&&a.i.length&&(a.X++,0>d&&(d=jc(a.f,b)),65535!=(d&65535)&&(a.Ec(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function kg(a){var b=a.f;if(b.A.T)throw he(b,a.f.P&65535),Bj(a),-1;return!1}function Jd(a,b,c){Ij(a,b,c||1,a.L)&&Bj(a,!0)}function Kd(a,b,c){Ij(a,b,c||1,a.G)&&Bj(a,!0)}
|
||||
function cj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b<a.L.length;b++)c=a.L[b],d=gj(c),c.Ha?(c=a.D,Id(c.b[d>>>c.g],!1)):ye(a.f,!1);a.L=["br"];if(a.G)for(b=1;b<a.G.length;b++)c=a.G[b],d=gj(c),c.Ha?(c=a.D,Id(c.b[d>>>c.g],!0)):ye(a.f,!0);a.G=["bw"];a.la=0}
|
||||
h.nb=function(a,b,c){var d=!0;c||Jj(this,a,b,!1,!0);if(a!=this.g){var e=gj(b);if(-1===e)this.u("invalid address: "+nj(this,b)),d=!1;else{var f=a==this.G;65535<e&&(b.Ha=!0);if(b.Ha){var g=this.D;g.b[e>>>g.g].nb(e&g.j,f)}else e=this.f,(f?e.Sb++:e.Rb++)||fe(e)}}d&&(a.push(b),c?b.Pa=!0:(Kj(this,a,a.length-1,"set"),dj(this)));return d};
|
||||
function Jj(a,b,c,d,e){var f=!1;c=gj(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==gj(k)&&(!d||k.Pa)){f=!0;k.Pa||e||Kj(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(b=b==a.G,k.Ha?(d=a.D,Id(d.b[c>>>d.g],b)):ye(a.f,b));k.Pa||dj(a);break}}return f}function Lj(a,b){for(var c=1;c<b.length;c++)Kj(a,b,c);return b.length-1}function Kj(a,b,c,d){c=b[c];a.u(b[0]+" "+nj(a,c)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}
|
||||
function Hj(a,b){if(void 0!==b)Ij(a,b,1,a.g,!0),a.J=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Pa){if(!Jj(a,a.g,c,!0))break;b=0}}}
|
||||
function Ij(a,b,c,d,e){var f=!1;if(!a.la++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Pa)for(var l=gj(k)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==l){var n,f=!0;k.Pa&&(Jj(a,d,k,!0),e=!0);if(n=k.Zc){for(var f=!1,r=0;r<n.length;r++)if(!Mj(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var t=r+1;t<n.length&&n[t].indexOf("else");t++)r++;if(t==n.length){f=!0;break}}a.f.A.T||(f=!0)}if(f){e||Kj(a,d,g,"hit");break}}}a.la--;return f}
|
||||
function Nj(a,b,c,d){var e=W(b.K),f=a.Na(b,2),g,k;for(k in a.Ea)if(g=a.Ea[k][f&k])break;g||(g=Oj);var l=g[0];0<=a.xa.indexOf(l)&&(g=Oj,l=g[0]);var m=k="",n=Pj[l],r=g.length-1;l||r||(k=O(a,f));for(l=1;l<=r;l++){var t=g[l];if(void 0!==t){var u;u=a;var E=t,t=b,z="",C=E&Qj;if(C==X)t=t.K+((f&255)<<24>>23)&65535,z=O(u,t);else if(C==Rj)t=t.K-((f&63)<<1)&65535,z=O(u,t);else if(C==Sj)z=O(u,f&7,1);else if(C==Tj)z=O(u,f&63,1);else if(C==Uj)z=O(u,f&255,1);else if(C=f&E,E&Vj&&(C>>=6,E>>=6),E&Y){var E=null,F=C&
|
||||
Wj;switch(C&Xj){case 0:z=pj(F);break;case 8:z="@"+pj(F);E=Yj(u,u.f.g[F]);break;case 16:7>F?z="("+pj(F)+")+":(C=u.Na(t,2),z="#"+O(u,C,0,!0));break;case 24:7>F?z="@("+pj(F)+")+":(C=u.Na(t,2),z="@#"+O(u,C,0,!0),E=Yj(u,C));break;case 32:z="-("+pj(F)+")";break;case 40:z="@-("+pj(F)+")";break;case 48:C=u.Na(t,2);z=O(u,C,0,!0)+"("+pj(F)+")";7==F&&(z=O(u,C=C+t.K&65535),E=Yj(u,C));break;case 56:C=u.Na(t,2),z="@"+O(u,C)+"("+pj(F)+")",7==F&&(z="@"+O(u,C=C+t.K&65535),E=Yj(u,jc(u.f,C)))}E&&(z=[z,E])}u=z;if(!u||
|
||||
!u.length){k="INVALID";break}"string"!=typeof u&&(m=u[1],u=u[0]);0<k.length&&(k+=",");k+=u||"???"}}f="";g=nj(a,e)+":";if(-1!==e.K&&-1!==b.K){do if(f+=" "+O(a,a.Na(e,2)),null==e.K)break;while(e.K!=b.K)}g+=ta(f,24);g+=ta(n,5);k&&(g+=" "+k);if(c||m)g=ta(g,60)+";"+(c||""),g=a.f.A.vb?g+("cycles="+Vd(a.f).toString()+" cs="+v(a.f.Nb)):g+(null!=d?"="+d.toString():""),m&&(";"!=g.slice(-1)&&(g+=" "),g+=m);return g}
|
||||
function Yj(a,b){b=we(a.f,b)[0];b>=a.f.hb&&b<a.D.B&&(b=b-a.f.hb+a.D.B);var c=a.D;a=null;b>=c.B&&(b=c.Ja[b&Vc])&&(a=b[4]);return a}function Zj(a,b){switch(b){case "N":a=me(a.f);break;case "Z":a=le(a.f);break;case "V":a=ke(a.f);break;case "C":a=je(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Z(a,b){var c="",d=a.f;if(8>b)c=pj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.oa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.X[b-16]);else switch(b){case qj:c="PS="+O(a,kd(d));break;case rj:c="PI="+O(a,d.ab);break;case sj:c="ER="+O(a,d.R);break;case tj:c="SL="+O(a,d.ya&65280);break;case uj:c="M0="+O(a,ed(d));break;case vj:c="M1="+O(a,gd(d));break;case wj:c="M2="+O(a,hd(d));break;case xj:c="M3="+O(a,d.U);break;case yj:a.b&&(c="AR="+O(a,a.b.ra,3));break;case zj:a.b&&(c="DR="+
|
||||
O(a,a.b.rb));break;case Aj:a.b&&yc(a.b)&&(c="SR="+O(a,a.b.Ua,3))}c&&(c+=" ");return c}function ak(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,qj)+Z(a,rj)+Z(a,tj);d+=Zj(a,"T")+Zj(a,"N")+Zj(a,"Z")+Zj(a,"V")+Zj(a,"C");b&&(b=d,c=""+(Z(a,uj)+Z(a,vj)),c+=Z(a,wj)+Z(a,xj)+Z(a,sj),c=c+"\n"+(Z(a,Aj)+Z(a,yj)+Z(a,zj)),d=b+("\n"+c));return d}h.bd=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function kh(a,b,c,d,e){var f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var l=k.o,m=k.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=xa(n,l,a.bd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({uh:b,K:c,Od:d,da:e,$c:f})}function bk(a,b,c){var d=[],e=gj(b)>>>0;for(b=0;b<a.B.length;b++){var f=a.B[b],g=f.K>>>0,k=f.Od;if(e>=g&&e<g+k){e=xa(f.$c,[e-g],a.bd);0<=e?ck(a,b,e,d):c&&(e=~e,ck(a,b,e-1,d),ck(a,b,e,d));break}}return d}
|
||||
function ck(a,b,c,d){var e={},f=a.B[b].$c,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.B[b].da[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}function dk(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return aj(a)||a.u("no variables"),!0;if(!c[2])return aj(a,c[1]);if(!c[3])return delete a.U[c[1]],!0;b=Wi(a,c[3]);return void 0!==b?(a.U[c[1]]=b,!0):!1}a.u("invalid assignment:"+b);return!1}
|
||||
function ek(a,b,c){var d=null;if(b=kj(a,b,!0)){var e=bk(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.K-e[1])&&(g=" + "+w(f)),f=e[0]+" ("+O(a,e[1])+")"+g,c&&a.u(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.K)&&(g=" - "+w(f)),f=e[4]+" ("+O(a,e[5])+")"+g,c&&a.u(f),d||(d=f))}else c&&a.u("no symbols")}return d}
|
||||
function Fj(a,b){var c;if(b&&"?"==b[1])a.u("register commands:"),a.u("\tr\tdump registers"),a.u("\trm\tdump misc registers"),a.u("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.f;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.u("missing value for "+b[1]);return}g=Wi(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.g[6]=g&65535;break;case "PC":case "R7":he(e,
|
||||
"";Ud(d,a,!0);return!0}return!1}),!0;case "step":return this.C[b]=c,Pa(c,function(a){var b=!1;rb(d,!0)||(sb(d,!0),b=ac(d,a?1:0,null),sb(d,!1));return b}),!0}return!1};function Td(a){if(a.V){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.V.focus();window&&window.scrollTo(b,c)}}h.Lc=function(a,b){var c=255,d=hj(a);-1!==d&&(a.Ha||65535<d?(c=this.D,d=ve(this.f,d),c.G=!1,c.ha++,d=Pc(c,d).w(d&c.j,d),c.ha--):(c=this.f,c.la++,d=c.D.Ic(hc(c,d,3)),c.la--),c=d,b&&mj(a,b));return c};
|
||||
h.Na=function(a,b){var c=65535,d=hj(a);-1!==d&&(c=a.Ha||65535<d?ic(this.D,ve(this.f,d)):jc(this.f,d),b&&mj(a,b));return c};h.Mc=function(a,b,c){var d=hj(a);if(-1!==d){if(a.Ha||65535<d)Qc(this.D,ve(this.f,d),b);else{var e=this.f;e.la++;e.D.Jc(hc(e,d,5),b);e.la--}c&&mj(a,c);L(this.I,-1)}};h.wd=function(a,b,c){var d=hj(a);if(-1!==d){if(a.Ha||65535<d)gc(this.D,ve(this.f,d),b);else{var e=this.f;e.la++;e.D.Ib(hc(e,d,4),b);e.la--}c&&mj(a,c);L(this.I,-1)}};
|
||||
function lj(a,b,c){var d;c=(c?a.H:a.Aa).K;var e,f;if(void 0!==b){b=Yi(a,b);"%"==b.charAt(0)&&(e=!0,b=b.substr(1));d=b;var g,k;a:{c=a.D;var l;l=d.toUpperCase();for(k in c.Ja){var m=+k;if(c.Ja[m][4]==l){k=c.B+m;break a}}k=null}if(null==k&&d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.B.length;c++)if(l=a.B[c].da[d],null!=l){k=l.o;break}null!=k&&(g=W(k));if(d=g)return d;0<=b.indexOf("0x")?f=16:0<=b.indexOf("0o")?f=8:0<=b.indexOf(".")&&(f=10);c=Xi(a,b,void 0)}null!=c&&(d=W(c,e,f));return d}
|
||||
function nj(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Zc=Vi(a,b.dc=c[2]))}function mj(a,b){null!=a.K&&(a.K+=b||1)}function oj(a,b){return(b.Ha?"%":"")+O(a,b.K)}
|
||||
function fj(a,b){a.F=a;a.fa=a.ya=536870912;a.S=null;a.M=[];b=Vi(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Hb){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.fa|=Hb[c],a.u(c+" messages enabled"))}}function bd(a,b,c){for(var d in Hb)if(b==Hb[d]){a.ka[d]=c;break}}
|
||||
h.fd=function(a){a=a.toUpperCase();var b=pj[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function qj(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
h.gd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.oa[a-8];else if(20>a)b=this.f.X[a-16];else{var c=this.f,d=this.b;switch(a){case rj:b=kd(this.f);break;case sj:b=c.ab;break;case tj:b=c.R;break;case uj:b=c.ya&65280;break;case vj:b=ed(c);break;case wj:b=gd(c);break;case xj:b=hd(c);break;case yj:b=c.U;break;case zj:d&&(b=d.ra);break;case Aj:d&&(b=d.rb);break;case Bj:d&&yc(d)&&(b=d.Ua)}}return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+oj(this,W(this.f.P&65535)));if(!this.S||a!=this.S)if(this.S=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||rb(this,!0))Cj(this),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,$d(a),a.mb=0,a.I&&L(a.I,void 0))}};
|
||||
function ej(a){var b;if(!Je(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.R=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Dj);for(b=0;b<a.i.length;b++)a.i[b]=W();a.R=0;a.u("instruction history buffer allocated")}}function Ej(a,b,c){if(!Fj(a,c))return!1;$b(a.f,b);return!0}
|
||||
function ac(a,b,c,d){if(!Fj(a))return!1;null===c&&(c=!a.sa||"tr"==a.sa);a.w=0;b||Je(a)&&ef(a,a.f.g[7],0);try{b=ae(a.f,b);var e=a.f.$b(b);0<e&&(bc(a.f,e),a.w+=e,cc(a.f,e,!0),dc(a.f,e),a.X++)}catch(f){"number"!=typeof f&&(a.w=0,ob(a.f,f.stack||f.message))}!1!==d&&(a.b&&a.b.stop(),L(a.I,-1));Sd(a,c||!1);return 0<a.w}function Cj(a,b){a.f&&J(a.f,b)}
|
||||
function Sd(a,b){if(a.Ba){void 0===b&&(b=!0);var c;c=a.f;if(c=c.i&128?c.Yc|c.Xc<<8:0){var d=c>>8;a.u("trapped to "+O(a,c&255,1)+" ("+(0>d?zb[-d]:O(a,d))+")")}a.H=W(a.f.g[7]);b&&1!=a.J?Gj(a):Hj(a)}}function Fj(a,b){var c;(c=!a.f||!qb(a.f))||(c=a.f,c.A.ea?c=!0:(c.u(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.T?(b||a.u("cpu busy or unavailable, command ignored"),!1):!pb(a.f)}h.qa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
||||
h.za=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){ej(this);this.X=0;this.S=null;this.w=0;this.H=W(this.f.g[7]);this.A.T=!1;Ij(this);a||Sd(this)};h.save=function(){var a=new ie(this);a.set(0,ij(this.H));a.set(1,ij(this.O));a.set(2,[this.j,this.P,this.fa]);a.set(3,this.B);return a.data()};
|
||||
h.restore=function(a){var b=0;void 0!==a[2]&&(this.H=jj(this,a[b++]),this.O=jj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.P=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.J||this.u("running");this.A.T=!0;this.Ca=a;this.Da=b};
|
||||
h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Da;if(!this.J){b="stopped";if(this.w){a-=this.Ca;var c=0<a?Math.round(1E3*this.w/a):0;b+=" (";Je(this)&&(b+=this.X+" instructions, ",this.X=0);b+=this.w+" cycles, "+a+" ms, "+c+" hz)"}else H(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.u(b)}Sd(this,!0);Td(this);Ij(this,this.f.g[7]);this.S=null}};function Je(a){return 1<a.g.length||!!a.Y}
|
||||
function ef(a,b,c){var d=-1;c||(d=jc(a.f,b))||(a.f.P&65535)!=b||(b=ne(a.f,2));if(0<c&&(a.Y&&!--a.Y||Jj(a,b,1,a.g)))return!0;0<=c&&a.i.length&&(a.X++,0>d&&(d=jc(a.f,b)),65535!=(d&65535)&&(a.Ec(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1}function kg(a){var b=a.f;if(b.A.T)throw he(b,a.f.P&65535),Cj(a),-1;return!1}function Jd(a,b,c){Jj(a,b,c||1,a.L)&&Cj(a,!0)}function Kd(a,b,c){Jj(a,b,c||1,a.G)&&Cj(a,!0)}
|
||||
function dj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b<a.L.length;b++)c=a.L[b],d=hj(c),c.Ha?(c=a.D,Id(c.b[d>>>c.g],!1)):ye(a.f,!1);a.L=["br"];if(a.G)for(b=1;b<a.G.length;b++)c=a.G[b],d=hj(c),c.Ha?(c=a.D,Id(c.b[d>>>c.g],!0)):ye(a.f,!0);a.G=["bw"];a.la=0}
|
||||
h.nb=function(a,b,c){var d=!0;c||Kj(this,a,b,!1,!0);if(a!=this.g){var e=hj(b);if(-1===e)this.u("invalid address: "+oj(this,b)),d=!1;else{var f=a==this.G;65535<e&&(b.Ha=!0);if(b.Ha){var g=this.D;g.b[e>>>g.g].nb(e&g.j,f)}else e=this.f,(f?e.Sb++:e.Rb++)||fe(e)}}d&&(a.push(b),c?b.Pa=!0:(Lj(this,a,a.length-1,"set"),ej(this)));return d};
|
||||
function Kj(a,b,c,d,e){var f=!1;c=hj(c);for(var g=1;g<b.length;g++){var k=b[g];if(c==hj(k)&&(!d||k.Pa)){f=!0;k.Pa||e||Lj(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(b=b==a.G,k.Ha?(d=a.D,Id(d.b[c>>>d.g],b)):ye(a.f,b));k.Pa||ej(a);break}}return f}function Mj(a,b){for(var c=1;c<b.length;c++)Lj(a,b,c);return b.length-1}function Lj(a,b,c,d){c=b[c];a.u(b[0]+" "+oj(a,c)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}
|
||||
function Ij(a,b){if(void 0!==b)Jj(a,b,1,a.g,!0),a.J=0;else for(b=1;b<a.g.length;b++){var c=a.g[b];if(c.Pa){if(!Kj(a,a.g,c,!0))break;b=0}}}
|
||||
function Jj(a,b,c,d,e){var f=!1;if(!a.la++)for(var g=1;!f&&g<d.length;g++){var k=d[g];if(!e||k.Pa)for(var l=hj(k)&(d==a.g?65535:-1),m=0;m<c;m++)if(b+m==l){var n,f=!0;k.Pa&&(Kj(a,d,k,!0),e=!0);if(n=k.Zc){for(var f=!1,r=0;r<n.length;r++)if(!Nj(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var u=r+1;u<n.length&&n[u].indexOf("else");u++)r++;if(u==n.length){f=!0;break}}a.f.A.T||(f=!0)}if(f){e||Lj(a,d,g,"hit");break}}}a.la--;return f}
|
||||
function Oj(a,b,c,d){var e=W(b.K),f=a.Na(b,2),g,k;for(k in a.Ea)if(g=a.Ea[k][f&k])break;g||(g=Pj);var l=g[0];0<=a.xa.indexOf(l)&&(g=Pj,l=g[0]);var m=k="",n=Qj[l],r=g.length-1;l||r||(k=O(a,f));for(l=1;l<=r;l++){var u=g[l];if(void 0!==u){var t;t=a;var E=u,u=b,z="",C=E&Rj;if(C==X)u=u.K+((f&255)<<24>>23)&65535,z=O(t,u);else if(C==Sj)u=u.K-((f&63)<<1)&65535,z=O(t,u);else if(C==Tj)z=O(t,f&7,1);else if(C==Uj)z=O(t,f&63,1);else if(C==Vj)z=O(t,f&255,1);else if(C=f&E,E&Wj&&(C>>=6,E>>=6),E&Y){var E=null,F=C&
|
||||
Xj;switch(C&Yj){case 0:z=qj(F);break;case 8:z="@"+qj(F);E=Zj(t,t.f.g[F]);break;case 16:7>F?z="("+qj(F)+")+":(C=t.Na(u,2),z="#"+O(t,C,0,!0));break;case 24:7>F?z="@("+qj(F)+")+":(C=t.Na(u,2),z="@#"+O(t,C,0,!0),E=Zj(t,C));break;case 32:z="-("+qj(F)+")";break;case 40:z="@-("+qj(F)+")";break;case 48:C=t.Na(u,2);z=O(t,C,0,!0)+"("+qj(F)+")";7==F&&(z=O(t,C=C+u.K&65535),E=Zj(t,C));break;case 56:C=t.Na(u,2),z="@"+O(t,C)+"("+qj(F)+")",7==F&&(z="@"+O(t,C=C+u.K&65535),E=Zj(t,jc(t.f,C)))}E&&(z=[z,E])}t=z;if(!t||
|
||||
!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0<k.length&&(k+=",");k+=t||"???"}}f="";g=oj(a,e)+":";if(-1!==e.K&&-1!==b.K){do if(f+=" "+O(a,a.Na(e,2)),null==e.K)break;while(e.K!=b.K)}g+=ta(f,24);g+=ta(n,5);k&&(g+=" "+k);if(c||m)g=ta(g,60)+";"+(c||""),g=a.f.A.vb?g+("cycles="+Vd(a.f).toString()+" cs="+v(a.f.Nb)):g+(null!=d?"="+d.toString():""),m&&(";"!=g.slice(-1)&&(g+=" "),g+=m);return g}
|
||||
function Zj(a,b){b=we(a.f,b)[0];b>=a.f.hb&&b<a.D.B&&(b=b-a.f.hb+a.D.B);var c=a.D;a=null;b>=c.B&&(b=c.Ja[b&Vc])&&(a=b[4]);return a}function ak(a,b){switch(b){case "N":a=me(a.f);break;case "Z":a=le(a.f);break;case "V":a=ke(a.f);break;case "C":a=je(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Z(a,b){var c="",d=a.f;if(8>b)c=qj(b),c+="="+O(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+O(a,d.oa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+O(a,d.X[b-16]);else switch(b){case rj:c="PS="+O(a,kd(d));break;case sj:c="PI="+O(a,d.ab);break;case tj:c="ER="+O(a,d.R);break;case uj:c="SL="+O(a,d.ya&65280);break;case vj:c="M0="+O(a,ed(d));break;case wj:c="M1="+O(a,gd(d));break;case xj:c="M2="+O(a,hd(d));break;case yj:c="M3="+O(a,d.U);break;case zj:a.b&&(c="AR="+O(a,a.b.ra,3));break;case Aj:a.b&&(c="DR="+
|
||||
O(a,a.b.rb));break;case Bj:a.b&&yc(a.b)&&(c="SR="+O(a,a.b.Ua,3))}c&&(c+=" ");return c}function bk(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,rj)+Z(a,sj)+Z(a,uj);d+=ak(a,"T")+ak(a,"N")+ak(a,"Z")+ak(a,"V")+ak(a,"C");b&&(b=d,c=""+(Z(a,vj)+Z(a,wj)),c+=Z(a,xj)+Z(a,yj)+Z(a,tj),c=c+"\n"+(Z(a,Bj)+Z(a,zj)+Z(a,Aj)),d=b+("\n"+c));return d}h.bd=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function kh(a,b,c,d,e){var f=[],g;for(g in e){var k=e[g];"number"==typeof k&&(e[g]=k={o:k});var l=k.o,m=k.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=xa(n,l,a.bd);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({uh:b,K:c,Od:d,da:e,$c:f})}function ck(a,b,c){var d=[],e=hj(b)>>>0;for(b=0;b<a.B.length;b++){var f=a.B[b],g=f.K>>>0,k=f.Od;if(e>=g&&e<g+k){e=xa(f.$c,[e-g],a.bd);0<=e?dk(a,b,e,d):c&&(e=~e,dk(a,b,e-1,d),dk(a,b,e,d));break}}return d}
|
||||
function dk(a,b,c,d){var e={},f=a.B[b].$c,g=0,k=null;0<=c&&c<f.length&&(g=f[c][0],k=f[c][1]);k&&(e=a.B[b].da[k],k="."==k.charAt(0)?null:e.l||k);d.push(k);d.push(g);d.push(e.a);d.push(e.c)}function ek(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return bj(a)||a.u("no variables"),!0;if(!c[2])return bj(a,c[1]);if(!c[3])return delete a.U[c[1]],!0;b=Xi(a,c[3]);return void 0!==b?(a.U[c[1]]=b,!0):!1}a.u("invalid assignment:"+b);return!1}
|
||||
function fk(a,b,c){var d=null;if(b=lj(a,b,!0)){var e=ck(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.K-e[1])&&(g=" + "+w(f)),f=e[0]+" ("+O(a,e[1])+")"+g,c&&a.u(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.K)&&(g=" - "+w(f)),f=e[4]+" ("+O(a,e[5])+")"+g,c&&a.u(f),d||(d=f))}else c&&a.u("no symbols")}return d}
|
||||
function Gj(a,b){var c;if(b&&"?"==b[1])a.u("register commands:"),a.u("\tr\tdump registers"),a.u("\trm\tdump misc registers"),a.u("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.f;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.u("missing value for "+b[1]);return}g=Xi(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.g[6]=g&65535;break;case "PC":case "R7":he(e,
|
||||
g);a.H=W(e.g[7]);break;case "N":e.J=g?32768:0;break;case "Z":e.L=g?0:1;break;case "V":e.H=g?32768:0;break;case "C":e.G=g?65536:0;break;case "PS":ld(e,g);break;case "PI":jd(e,g);break;case "ER":e.R=g;d=!0;break;case "SL":e.ya=g|255;break;case "M0":fd(e,g);d=!0;break;case "M3":id(e,g);d=!0;break;case "AR":a.b&&(d=a.b,kc(d,d.ra=g));d=!0;break;case "DR":a.b&&(d=a.b,fc(d,d.rb=g));d=!0;break;case "SR":if(a.b&&yc(a.b)){lc(a.b,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.g[b]=
|
||||
g&65535;break}a.u("unknown register: "+f);return}L(a.I);a.u("updated registers:")}}a.u(ak(a,d));c&&(a.H=W(e.g[7]),Gj(a,nj(a,a.H)))}}function fk(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.u(c[2]):$i(a,null,c[2].charCodeAt(0)):Wi(a,b,!0)}
|
||||
function gk(a,b,c){if("?"==c)a.u("trace commands:"),a.u("\tt [#]\ttrace # instructions"),a.u("\ttr [#]\ttrace # instructions with register updates"),a.u("\ttc [#]\ttrace # cycles"),a.u("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=Yi(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.sa=b;Oa(c,function(){return sb(a,!0)&&ac(a,e,d,!1)},function(){a.b&&a.b.stop();L(a.I,-1);sb(a,!1)})}}
|
||||
function Gj(a,b,c,d){if(b=kj(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Yi(a,c.substr(1)),null!=c&&(d=c);else{d=kj(a,c,!0);if(!d||d.K<b.K)return;e=d.K-b.K;if(256<e){a.u("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=rb(a,!1)||a.J?a.w:null;var g=null!=f?"cycles":null,k=bk(a,b),l=b.K;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=Nj(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}}
|
||||
function Mj(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(">> "+b):(a.P&&(a.u("ended assemble at "+nj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(qb(a)&&0<b.length){a.P&&(b="a "+nj(a,a.O)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var k=g[0],l=k.charAt(0),m=1;m<k.length;m++){var n=k.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=k.substr(m);g.unshift(k.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
|
||||
kj(a,g[1],!0);if(r)if(a.O=r,void 0===g[2])a.u("begin assemble at "+nj(a,r)),a.P=!0,L(a.I);else{var t;a.u("not supported yet");t=[];if(t.length){for(var u=0;u<t.length;u++)a.Mc(r,t[u],1);a.u(Nj(a,a.O))}}break;case "b":a:{var E=g[0],z=g[1],C=b;if("?"==z)a.u("breakpoint commands:"),a.u("\tbp [#]\tset exec breakpoint at addr #"),a.u("\tbr [#]\tset read breakpoint at addr #"),a.u("\tbw [#]\tset write breakpoint at addr #"),a.u("\tbc [#]\tclear breakpoint at addr #"),a.u("\tbl\tlist all breakpoints"),a.u("\tbn [#]\tbreak after # instruction(s)");
|
||||
else{var F=E.charAt(1);if("l"==F){var bb;bb=0+Lj(a,a.g);bb+=Lj(a,a.L);(bb+=Lj(a,a.G))||a.u("no breakpoints")}else if("n"==F)a.Y=Yi(a,z),a.u("break after "+a.Y+" instruction(s)");else if(void 0===z)a.u("missing breakpoint address");else{var V=W();if("*"!=z&&(V=kj(a,z,!0),!V))break a;"c"==F?null==V.K?(cj(a),a.u("all breakpoints cleared")):Jj(a,a.g,V)||Jj(a,a.L,V)||Jj(a,a.G,V)||a.u("breakpoint missing: "+nj(a,V)):null!=V.K&&(mj(a,V,C),"p"==F?a.nb(a.g,V):"r"==F?a.nb(a.L,V):"w"==F?a.nb(a.G,V):a.u("unknown breakpoint command: "+
|
||||
F))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var Bb,Ra=g[0],Fa=g[1],Sa=g[2],Gk=g[3];if("?"==Fa){var Cb="";for(Bb in Hb)a.ka[Bb]&&(Cb&&(Cb+=","),Cb+=Bb);Cb+=",state,symbols";a.u("dump memory commands:");a.u("\tda [a] dump info for address a");a.u("\tdb [a] [n] dump n bytes at address a");a.u("\tdw [a] [n] dump n words at address a");a.u("\tdd [a] [n] dump n dwords at address a");a.u("\tds [a] [n] dump n words at address a as JSON");a.u("\tdh [p] [n] dump n instructions from history position p");
|
||||
Cb.length&&a.u("dump extension commands:\n\t"+Cb)}else if("state"==Fa){var Ke=hk(a.I,!0);"console"==Sa?console.log(Ke):(a.Oa&&(a.Oa.value=""),Ke&&a.u(Ke))}else if("symbols"==Fa)for(var Le=0;Le<a.B.length;Le++){var Me=a.B[Le],Db;for(Db in Me.da)if("."!=Db.charAt(0)){var bi=Me.da[Db].o;if(void 0!==bi){var ci=Me.da[Db].l;ci&&(Db=ci);a.u(O(a,bi)+" "+Db)}}}else{if("d"==Ra){for(Bb in Hb)if(g[1]==Bb){var di=a.ka[Bb];di?(g.shift(),g.shift(),di(g)):a.u("no dump registered for "+Fa);break a}Fa||(Ra=a.Fa||"dw")}else a.Fa=
|
||||
Ra;if("dh"==Ra){var ei=Fa,fi=Sa,gi="",hi=0,va=a.R,Ga=a.i;if(Ga.length){var qa=+ei||a.oa,nc=+fi||10;isNaN(qa)?qa=nc:gi="more ";qa>Ga.length&&(a.u("note: only "+Ga.length+" available"),qa=Ga.length);va-=qa;0>va&&(null==Ga[Ga.length-1].K?(qa=va+qa,va=0):va+=Ga.length);var Ne=[];"call"==fi&&(nc=1E5,Ne=["CALL"]);for(void 0!==ei&&a.u(qa+" instructions earlier:");0<nc&&va!=a.R;){var ii=Ga[va++];if(null==ii.K)break;var oc=W(ii.K),Hk=qa--,ji=Nj(a,oc,"history",Hk);(!Ne.length||0<=ji.indexOf(Ne[0]))&&a.u(ji);
|
||||
oc.zc&&(va+=oc.zc,nc-=oc.zc,qa-=oc.zc);va>=Ga.length&&(va=0);a.oa=qa;hi++;nc--}}hi||(a.u("no "+gi+"history available"),a.oa=void 0)}else{var fa=kj(a,Fa);if(fa)if("da"==Ra){var Oe=fa.Ha||65535<fa.K,K=we(a.f,fa.K,Oe);a.u(ta("",Oe?12:19)+ma(fa.K,Oe?22:17,3)+" "+q(fa.K,8));6>K.length?(2<K.length&&(a.u(" OFFSET: "+ma(K[3],13,3)+" "+q(K[3],8)),a.u("UNIMAP["+na(K[1])+"]: "+ma(K[2],22,3)+" "+q(K[2],8))),a.u(" PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8))):(a.u(" OFFSET: "+ma(K[1],
|
||||
13,3)+" "+q(K[1],8)),a.u("+ "+ik[K[2]]+"PAR"+K[3]+": "+ma(K[4],22,3)+" "+q(K[4],8)),a.u("& MMUMASK: "+ma(K[5],22,3)+" "+q(K[5],8)),a.u("= PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8)))}else{var db=0,Pe="ds"==Ra;if(Sa){if("l"==Sa.charAt(0))Sa=Sa.substr(1)||Gk,db=Yi(a,Sa);else{var ki=kj(a,Sa);ki&&(db=ki.K-fa.K)}0>db&&(db=0);65536<db&&(db=65536)}var Jk=a.ua;fa.ua&&(a.ua=fa.ua);for(var eb="dd"==Ra?4:"db"==Ra?1:2,sd=eb*db||128,Qe=Pe?16:a.ua,Kk=(sd+Qe-1)/Qe|0||1,fb="";Kk--&&0<sd;){for(var gb="",Re="",
|
||||
Fa=nj(a,fa),td=Qe,pc=0,qc=0;0<td&&0<sd;){var Eb=1,ud=1==eb?a.Lc(fa,Eb):a.Na(fa,Eb=2),pc=pc|ud<<(qc<<3),qc=qc+Eb;qc==eb&&(Pe?(gb&&(gb+=","),gb+="0x"+v(pc,2*eb)):(gb+=O(a,pc,eb),gb+=1==eb?9==td?"-":" ":" "),pc=qc=0);td-=Eb;for(sd-=Eb;1==eb&&Eb--;)var Se=ud&255,Re=Re+(32<=Se&&128>Se?String.fromCharCode(Se):"."),ud=ud>>8}fb&&(fb+="\n");fb=Pe?fb+(gb+","):fb+(Fa+": "+gb+(0==td?" "+Re:""))}fb&&a.u(fb);a.Aa=fa;a.ua=Jk}}}}break;case "e":if("else"==g[0])break;var Fb,Te,Ue,Ve,We=g[0],Xe=g[1];"eb"==We?(Fb=
|
||||
1,Te=255,Ue=a.Lc,Ve=a.Mc):"e"==We||"ew"==We?(Fb=2,Te=65535,Ue=a.Na,Ve=a.wd):Xe=null;if(null==Xe)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var vd=kj(a,Xe);if(vd)for(var wd=2;wd<g.length;wd++){var rc=Wi(a,g[wd]);if(void 0===rc){a.u("unrecognized value: "+g[wd]);break}rc&~Te&&a.u("warning: "+v(rc)+" exceeds "+Fb+"-byte value");a.u("changing "+nj(a,vd)+(H(a,16)?"":" from "+O(a,Ue.call(a,vd),Fb))+" to "+O(a,rc,Fb));Ve.call(a,
|
||||
vd,rc,Fb)}}break;case "g":a:{var li=g[1],Lk=b;if(void 0!==li){var Ye=kj(a,li,!0);if(!Ye)break a;mj(a,Ye,Lk);a.nb(a.g,Ye,!0)}Dj(a,!0,c)}break;case "h":a.A.T?(c||a.u("halting"),Bj(a)):rb(a,!0)||c||a.u("already halted");break;case "i":if("if"==g[0]){var Ze;var sc=b.substr(2),sc=ua(sc);Wi(a,sc)?(c||a.u("true: "+sc),Ze=!0):(c||a.u("false: "+sc),Ze=!1);Ze||(d=!1);break}f=!0;break;case "k":var Mk=g[0];if("?"==g[1])a.u("stack trace commands:"),a.u("\tk\tshow frame addresses"),a.u("\tks\tshow symbol information");
|
||||
else{var $e=0,af=W(),tc=W(a.f.g[6]);for(a.u("stack trace for "+nj(a,tc));10>$e;){for(var hb=null,Nk=256;65536>tc.K>>>0;){af.K=a.Na(tc,2);if(null==tc.K||!Nk--)break;if(!(af.K&1)){for(var Ok=a,xd=af,mi=null,uc=xd.K,ni=uc,bf=1;6>=bf&&uc;bf++){if(2<bf){xd.K=uc;var yd=Nj(Ok,xd);if(0<=yd.indexOf("JSR")){var oi=yd.indexOf(" ");if(uc+(yd.indexOf(" ",oi+1)-oi-1)/2==ni){mi=yd;break}}}uc-=2}xd.K=ni;if(hb=mi)break}}if(!hb||null==hb)break;var pi=null;if("ks"==Mk){var qi=hb.match(/[0-9A-F]+$/);qi&&(pi=ek(a,qi[0]))}hb=
|
||||
ta(hb,50)+" ;"+(pi||"stack="+nj(a,tc));a.u(hb);$e++}$e||a.u("no return addresses found")}break;case "l":if("ln"==g[0]){ek(a,g[1],!0);break}f=!0;break;case "m":a:{var Ha,Ia=null,M=g[1];"?"==M&&(M=void 0);if(void 0!==M){var Ta=0;if("all"==M)Ta=1879046143,M=null;else if("on"==M)Ia=!0,M=null;else if("off"==M)Ia=!1,M=null;else{"keys"==M&&(M="key");"kbd"==M&&(M="keyboard");for(Ha in Hb)if(M==Ha){Ta=Hb[Ha];Ia=!!(a.fa&Ta);break}if(!Ta){a.u("unknown message category: "+M);break a}}if(Ta)if("on"==g[2])a.fa|=
|
||||
Ta,Ia=!0;else if("off"==g[2]&&(a.fa&=~Ta,Ia=!1,1073741824==Ta)){for(var ri=1E3<=a.M.length?a.M.length-1E3:0;ri<a.M.length;)a.u(a.M[ri++]);a.M=[]}}var Pk=0,vc="";for(Ha in Hb)if(!M||M==Ha){var Qk=!!(a.fa&Hb[Ha]);if(null===Ia||Ia==Qk)vc&&(vc+=","),++Pk%10||(vc+="\n\t"),"key"==Ha&&(Ha="keys"),vc+=Ha}void 0===M&&a.u("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.u((null!==Ia?Ia?"messages on: ":"messages off: ":"message categories:\n\t")+(vc||"none"));dj(a)}break;case "p":if("print"==
|
||||
g[0]){fk(a,b.substr(5));break}var Rk=g[0];if("?"==g[1])a.u("step commands:"),a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else{var si="pr"==Rk?1:0,ti=1+si;if(a.J)a.u("step in progress");else{var zd=W(a.f.g[7]),Gb=a.Na(zd);3==Gb||4==Gb||34816==(Gb&65280)||32256==(Gb&65024)||35072==(Gb&65280)?(a.J=ti,lj(zd,2)):2048==(Gb&65024)&&(Nj(a,zd),a.J=ti);a.J?(a.nb(a.g,zd,!0),Dj(a)||(a.I&&Zd(a.I),a.J=0)):gk(a,si?"tr":"t")}}break;case "r":if("reset"==b){a.I&&a.I.reset();
|
||||
break}Fj(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var wc=+g[2];if(8==wc||10==wc||16==wc)a.ua=wc;else{a.u("invalid base: "+wc);break}}a.u("default base: "+a.ua);break;case "cs":var xc;void 0!==g[3]&&(xc=+g[3]);switch(g[2]){case "int":a.f.xb=xc;break;case "start":a.f.Ob=xc;break;case "stop":a.f.zb=xc;break;default:a.u("unknown cs option");break a}void 0!==xc&&Rd(a.f);a.u("checksums "+(a.f.A.vb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Wd(a.f,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));
|
||||
a.u("target speed: "+(a.f.gb.toFixed(2)+"Mhz")+" ("+a.f.Ya+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"),a.u("\tcs start #\tset checksum cycle start count to #"),a.u("\tcs stop #\tset checksum cycle stop count to #"),a.u("\tsp #\t\tset speed multiplier to #")}break;case "t":gk(a,g[0],g[1]);break;case "u":Gj(a,g[1],g[2],8);break;case "v":if("var"==g[0]){dk(a,
|
||||
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.u("PDPjs version 1.31.0 ("+a.f.xa+",RELEASE"+(yb?",TYPEDARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){fk(a,b.substr(1));break}var cf="commands:",df;for(df in jk)cf+="\n"+ta(df,9)+jk[df];Je(a)||(cf+="\nnote: history disabled if no exec breakpoints");a.u(cf);break;default:f=!0}f&&(a.u("unknown command: "+b),d=!1)}}catch(vi){a.u("debugger error: "+(vi.stack||vi.message)),d=!1}return d}
|
||||
function Ud(a,b,c){b=Ui(a,b,c);for(var d in b)if(!Mj(a,b[+d]))return!1;return!0}
|
||||
var jk={"?":"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"},Pj=".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(" "),
|
||||
qj=20,rj=21,sj=22,tj=23,uj=24,vj=25,wj=26,xj=27,yj=28,zj=29,Aj=30,oj={SP:6,PC:7,PS:qj,PI:rj,ER:sj,SL:tj,M0:uj,M1:vj,M2:wj,M3:xj,AR:yj,DR:zj,SR:Aj},ik="KI KD SI SD ?? ?? UI UD".split(" "),Wj=7,Xj=56,Y=Xj|Wj,Vj=4032,X=4096,Rj=8192,Sj=12288,Tj=24576,Uj=32768,Qj=61440,fj={61440:{4096:[62,Vj,Y],8192:[47,Vj,Y],12288:[18,Vj,Y],16384:[14,Vj,Y],20480:[16,Vj,Y],24576:[3,Vj,Y],36864:[63,Vj,Y],40960:[48,Vj,Y],45056:[19,Vj,Y],49152:[15,Vj,Y],53248:[17,Vj,Y],57344:[94,Vj,Y]},65024:{2048:[57,448,Y],28672:[100,Y,
|
||||
448],29184:[101,Y,448],29696:[102,Y,448],30208:[103,Y,448],30720:[104,448,Y],32256:[105,448,Rj]},65280:{256:[27,X],512:[24,X],768:[10,X],1024:[11,X],1280:[22,X],1536:[12,X],1792:[20,X],32768:[25,X],33024:[23,X],33280:[13,X],33536:[21,X],33792:[28,X],34048:[29,X],34304:[8,X],34560:[9,X],34816:[106,Uj],35072:[107,Uj]},65472:{64:[56,Y],192:[95,Y],2560:[39,Y],2624:[49,Y],2688:[53,Y],2752:[51,Y],2816:[67,Y],2880:[1,Y],2944:[77,Y],3008:[97,Y],3072:[73,Y],3136:[71,Y],3200:[6,Y],3264:[4,Y],3328:[58,Tj],3392:[60,
|
||||
Y],3456:[65,Y],3520:[96,Y],35328:[40,Y],35392:[50,Y],35456:[54,Y],35520:[52,Y],35584:[68,Y],35648:[2,Y],35712:[78,Y],35776:[98,Y],35840:[74,Y],35904:[72,Y],35968:[7,Y],36032:[5,Y],36096:[66,Y],36160:[59,Y],36224:[64,Y],36288:[61,Y]},65528:{128:[76,Wj],152:[108,Sj]},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]}},Oj=[0],jj=[58,60,65,96,108,110,100,101,102,103,104,105,59,64],Cj=1E3;Ua(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new bj(d);nb(d,c)}});
|
||||
function kk(a,b,c){A.call(this,"Computer",a,0,33554432);this.A.ea=!1;this.O=null;lk(this,b);this.L=Pd(this,"autoPower",a);this.j=0;this.U=a.busWidth||a.buswidth;this.b=mk;this.H=null;this.R=this.w=this.M=this.B=this.S=!1;this.v=null;this.V=Pd(this,"url")||"";(Math.random()+.1).toString(36);this.g=nk(this);if(this.f=mb("CPU",this.id)){this.F=mb("Debugger",this.id);this.D=new Bc({id:this.kb+".bus",busWidth:this.U},this.f,this.F);var d,e=kb(this.id);if((this.i=mb("Panel",this.id))&&this.i.Oa)for(b=0;b<
|
||||
g&65535;break}a.u("unknown register: "+f);return}L(a.I);a.u("updated registers:")}}a.u(bk(a,d));c&&(a.H=W(e.g[7]),Hj(a,oj(a,a.H)))}}function gk(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.u(c[2]):aj(a,null,c[2].charCodeAt(0)):Xi(a,b,!0)}
|
||||
function hk(a,b,c){if("?"==c)a.u("trace commands:"),a.u("\tt [#]\ttrace # instructions"),a.u("\ttr [#]\ttrace # instructions with register updates"),a.u("\ttc [#]\ttrace # cycles"),a.u("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=Zi(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.sa=b;Oa(c,function(){return sb(a,!0)&&ac(a,e,d,!1)},function(){a.b&&a.b.stop();L(a.I,-1);sb(a,!1)})}}
|
||||
function Hj(a,b,c,d){if(b=lj(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Zi(a,c.substr(1)),null!=c&&(d=c);else{d=lj(a,c,!0);if(!d||d.K<b.K)return;e=d.K-b.K;if(256<e){a.u("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=rb(a,!1)||a.J?a.w:null;var g=null!=f?"cycles":null,k=ck(a,b),l=b.K;if(k[0]&&d&&(!c&&d||0>k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=Oj(a,b,g,f);a.u(f);a.H=b;e-=b.K-l;c++}}}
|
||||
function Nj(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(">> "+b):(a.P&&(a.u("ended assemble at "+oj(a,a.O)),a.H=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(qb(a)&&0<b.length){a.P&&(b="a "+oj(a,a.O)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var k=g[0],l=k.charAt(0),m=1;m<k.length;m++){var n=k.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=k.substr(m);g.unshift(k.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
|
||||
lj(a,g[1],!0);if(r)if(a.O=r,void 0===g[2])a.u("begin assemble at "+oj(a,r)),a.P=!0,L(a.I);else{var u;a.u("not supported yet");u=[];if(u.length){for(var t=0;t<u.length;t++)a.Mc(r,u[t],1);a.u(Oj(a,a.O))}}break;case "b":a:{var E=g[0],z=g[1],C=b;if("?"==z)a.u("breakpoint commands:"),a.u("\tbp [#]\tset exec breakpoint at addr #"),a.u("\tbr [#]\tset read breakpoint at addr #"),a.u("\tbw [#]\tset write breakpoint at addr #"),a.u("\tbc [#]\tclear breakpoint at addr #"),a.u("\tbl\tlist all breakpoints"),a.u("\tbn [#]\tbreak after # instruction(s)");
|
||||
else{var F=E.charAt(1);if("l"==F){var bb;bb=0+Mj(a,a.g);bb+=Mj(a,a.L);(bb+=Mj(a,a.G))||a.u("no breakpoints")}else if("n"==F)a.Y=Zi(a,z),a.u("break after "+a.Y+" instruction(s)");else if(void 0===z)a.u("missing breakpoint address");else{var V=W();if("*"!=z&&(V=lj(a,z,!0),!V))break a;"c"==F?null==V.K?(dj(a),a.u("all breakpoints cleared")):Kj(a,a.g,V)||Kj(a,a.L,V)||Kj(a,a.G,V)||a.u("breakpoint missing: "+oj(a,V)):null!=V.K&&(nj(a,V,C),"p"==F?a.nb(a.g,V):"r"==F?a.nb(a.L,V):"w"==F?a.nb(a.G,V):a.u("unknown breakpoint command: "+
|
||||
F))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var Bb,Ra=g[0],Fa=g[1],Sa=g[2],Hk=g[3];if("?"==Fa){var Cb="";for(Bb in Hb)a.ka[Bb]&&(Cb&&(Cb+=","),Cb+=Bb);Cb+=",state,symbols";a.u("dump memory commands:");a.u("\tda [a] dump info for address a");a.u("\tdb [a] [n] dump n bytes at address a");a.u("\tdw [a] [n] dump n words at address a");a.u("\tdd [a] [n] dump n dwords at address a");a.u("\tds [a] [n] dump n words at address a as JSON");a.u("\tdh [p] [n] dump n instructions from history position p");
|
||||
Cb.length&&a.u("dump extension commands:\n\t"+Cb)}else if("state"==Fa){var Ke=ik(a.I,!0);"console"==Sa?console.log(Ke):(a.Oa&&(a.Oa.value=""),Ke&&a.u(Ke))}else if("symbols"==Fa)for(var Le=0;Le<a.B.length;Le++){var Me=a.B[Le],Db;for(Db in Me.da)if("."!=Db.charAt(0)){var ci=Me.da[Db].o;if(void 0!==ci){var di=Me.da[Db].l;di&&(Db=di);a.u(O(a,ci)+" "+Db)}}}else{if("d"==Ra){for(Bb in Hb)if(g[1]==Bb){var ei=a.ka[Bb];ei?(g.shift(),g.shift(),ei(g)):a.u("no dump registered for "+Fa);break a}Fa||(Ra=a.Fa||"dw")}else a.Fa=
|
||||
Ra;if("dh"==Ra){var fi=Fa,gi=Sa,hi="",ii=0,va=a.R,Ga=a.i;if(Ga.length){var qa=+fi||a.oa,nc=+gi||10;isNaN(qa)?qa=nc:hi="more ";qa>Ga.length&&(a.u("note: only "+Ga.length+" available"),qa=Ga.length);va-=qa;0>va&&(null==Ga[Ga.length-1].K?(qa=va+qa,va=0):va+=Ga.length);var Ne=[];"call"==gi&&(nc=1E5,Ne=["CALL"]);for(void 0!==fi&&a.u(qa+" instructions earlier:");0<nc&&va!=a.R;){var ji=Ga[va++];if(null==ji.K)break;var oc=W(ji.K),Ik=qa--,ki=Oj(a,oc,"history",Ik);(!Ne.length||0<=ki.indexOf(Ne[0]))&&a.u(ki);
|
||||
oc.zc&&(va+=oc.zc,nc-=oc.zc,qa-=oc.zc);va>=Ga.length&&(va=0);a.oa=qa;ii++;nc--}}ii||(a.u("no "+hi+"history available"),a.oa=void 0)}else{var fa=lj(a,Fa);if(fa)if("da"==Ra){var Oe=fa.Ha||65535<fa.K,K=we(a.f,fa.K||0,Oe);a.u(ta("",Oe?12:19)+ma(fa.K,Oe?22:17,3)+" "+q(fa.K,8));6>K.length?(2<K.length&&(a.u(" OFFSET: "+ma(K[3],13,3)+" "+q(K[3],8)),a.u("UNIMAP["+na(K[1])+"]: "+ma(K[2],22,3)+" "+q(K[2],8))),a.u(" PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8))):(a.u(" OFFSET: "+
|
||||
ma(K[1],13,3)+" "+q(K[1],8)),a.u("+ "+jk[K[2]]+"PAR"+K[3]+": "+ma(K[4],22,3)+" "+q(K[4],8)),a.u("& MMUMASK: "+ma(K[5],22,3)+" "+q(K[5],8)),a.u("= PHYSICAL: "+ma(K[0],22,3)+" "+q(K[0],8)))}else{var db=0,Pe="ds"==Ra;if(Sa){if("l"==Sa.charAt(0))Sa=Sa.substr(1)||Hk,db=Zi(a,Sa);else{var li=lj(a,Sa);li&&(db=li.K-fa.K)}0>db&&(db=0);65536<db&&(db=65536)}var Kk=a.ua;fa.ua&&(a.ua=fa.ua);for(var eb="dd"==Ra?4:"db"==Ra?1:2,sd=eb*db||128,Qe=Pe?16:a.ua,Lk=(sd+Qe-1)/Qe|0||1,fb="";Lk--&&0<sd;){for(var gb=
|
||||
"",Re="",Fa=oj(a,fa),td=Qe,pc=0,qc=0;0<td&&0<sd;){var Eb=1,ud=1==eb?a.Lc(fa,Eb):a.Na(fa,Eb=2),pc=pc|ud<<(qc<<3),qc=qc+Eb;qc==eb&&(Pe?(gb&&(gb+=","),gb+="0x"+v(pc,2*eb)):(gb+=O(a,pc,eb),gb+=1==eb?9==td?"-":" ":" "),pc=qc=0);td-=Eb;for(sd-=Eb;1==eb&&Eb--;)var Se=ud&255,Re=Re+(32<=Se&&128>Se?String.fromCharCode(Se):"."),ud=ud>>8}fb&&(fb+="\n");fb=Pe?fb+(gb+","):fb+(Fa+": "+gb+(0==td?" "+Re:""))}fb&&a.u(fb);a.Aa=fa;a.ua=Kk}}}}break;case "e":if("else"==g[0])break;var Fb,Te,Ue,Ve,We=g[0],Xe=g[1];"eb"==
|
||||
We?(Fb=1,Te=255,Ue=a.Lc,Ve=a.Mc):"e"==We||"ew"==We?(Fb=2,Te=65535,Ue=a.Na,Ve=a.wd):Xe=null;if(null==Xe)a.u("edit memory commands:"),a.u("\teb [a] [...] edit bytes at address a"),a.u("\tew [a] [...] edit words at address a");else{var vd=lj(a,Xe);if(vd)for(var wd=2;wd<g.length;wd++){var rc=Xi(a,g[wd]);if(void 0===rc){a.u("unrecognized value: "+g[wd]);break}rc&~Te&&a.u("warning: "+v(rc)+" exceeds "+Fb+"-byte value");a.u("changing "+oj(a,vd)+(H(a,16)?"":" from "+O(a,Ue.call(a,vd),Fb))+" to "+O(a,rc,
|
||||
Fb));Ve.call(a,vd,rc,Fb)}}break;case "g":a:{var mi=g[1],Mk=b;if(void 0!==mi){var Ye=lj(a,mi,!0);if(!Ye)break a;nj(a,Ye,Mk);a.nb(a.g,Ye,!0)}Ej(a,!0,c)}break;case "h":a.A.T?(c||a.u("halting"),Cj(a)):rb(a,!0)||c||a.u("already halted");break;case "i":if("if"==g[0]){var Ze;var sc=b.substr(2),sc=ua(sc);Xi(a,sc)?(c||a.u("true: "+sc),Ze=!0):(c||a.u("false: "+sc),Ze=!1);Ze||(d=!1);break}f=!0;break;case "k":var Nk=g[0];if("?"==g[1])a.u("stack trace commands:"),a.u("\tk\tshow frame addresses"),a.u("\tks\tshow symbol information");
|
||||
else{var $e=0,af=W(),tc=W(a.f.g[6]);for(a.u("stack trace for "+oj(a,tc));10>$e;){for(var hb=null,Ok=256;65536>tc.K>>>0;){af.K=a.Na(tc,2);if(null==tc.K||!Ok--)break;if(!(af.K&1)){for(var Pk=a,xd=af,ni=null,uc=xd.K,oi=uc,bf=1;6>=bf&&uc;bf++){if(2<bf){xd.K=uc;var yd=Oj(Pk,xd);if(0<=yd.indexOf("JSR")){var pi=yd.indexOf(" ");if(uc+(yd.indexOf(" ",pi+1)-pi-1)/2==oi){ni=yd;break}}}uc-=2}xd.K=oi;if(hb=ni)break}}if(!hb||null==hb)break;var qi=null;if("ks"==Nk){var ri=hb.match(/[0-9A-F]+$/);ri&&(qi=fk(a,ri[0]))}hb=
|
||||
ta(hb,50)+" ;"+(qi||"stack="+oj(a,tc));a.u(hb);$e++}$e||a.u("no return addresses found")}break;case "l":if("ln"==g[0]){fk(a,g[1],!0);break}f=!0;break;case "m":a:{var Ha,Ia=null,M=g[1];"?"==M&&(M=void 0);if(void 0!==M){var Ta=0;if("all"==M)Ta=1879046143,M=null;else if("on"==M)Ia=!0,M=null;else if("off"==M)Ia=!1,M=null;else{"keys"==M&&(M="key");"kbd"==M&&(M="keyboard");for(Ha in Hb)if(M==Ha){Ta=Hb[Ha];Ia=!!(a.fa&Ta);break}if(!Ta){a.u("unknown message category: "+M);break a}}if(Ta)if("on"==g[2])a.fa|=
|
||||
Ta,Ia=!0;else if("off"==g[2]&&(a.fa&=~Ta,Ia=!1,1073741824==Ta)){for(var si=1E3<=a.M.length?a.M.length-1E3:0;si<a.M.length;)a.u(a.M[si++]);a.M=[]}}var Qk=0,vc="";for(Ha in Hb)if(!M||M==Ha){var Rk=!!(a.fa&Hb[Ha]);if(null===Ia||Ia==Rk)vc&&(vc+=","),++Qk%10||(vc+="\n\t"),"key"==Ha&&(Ha="keys"),vc+=Ha}void 0===M&&a.u("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.u((null!==Ia?Ia?"messages on: ":"messages off: ":"message categories:\n\t")+(vc||"none"));ej(a)}break;case "p":if("print"==
|
||||
g[0]){gk(a,b.substr(5));break}var Sk=g[0];if("?"==g[1])a.u("step commands:"),a.u("\tp\tstep over instruction"),a.u("\tpr\tstep over instruction with register update");else{var ti="pr"==Sk?1:0,ui=1+ti;if(a.J)a.u("step in progress");else{var zd=W(a.f.g[7]),Gb=a.Na(zd);3==Gb||4==Gb||34816==(Gb&65280)||32256==(Gb&65024)||35072==(Gb&65280)?(a.J=ui,mj(zd,2)):2048==(Gb&65024)&&(Oj(a,zd),a.J=ui);a.J?(a.nb(a.g,zd,!0),Ej(a)||(a.I&&Zd(a.I),a.J=0)):hk(a,ti?"tr":"t")}}break;case "r":if("reset"==b){a.I&&a.I.reset();
|
||||
break}Gj(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var wc=+g[2];if(8==wc||10==wc||16==wc)a.ua=wc;else{a.u("invalid base: "+wc);break}}a.u("default base: "+a.ua);break;case "cs":var xc;void 0!==g[3]&&(xc=+g[3]);switch(g[2]){case "int":a.f.xb=xc;break;case "start":a.f.Ob=xc;break;case "stop":a.f.zb=xc;break;default:a.u("unknown cs option");break a}void 0!==xc&&Rd(a.f);a.u("checksums "+(a.f.A.vb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Wd(a.f,+g[2])||a.u("warning: using 1x multiplier, previous target not reached"));
|
||||
a.u("target speed: "+(a.f.gb.toFixed(2)+"Mhz")+" ("+a.f.Ya+"x)");break;default:if(g[1]){a.u("unknown option: "+g[1]);break}case "?":a.u("debugger options:"),a.u("\tbase #\t\tset default base to #"),a.u("\tcs int #\tset checksum cycle interval to #"),a.u("\tcs start #\tset checksum cycle start count to #"),a.u("\tcs stop #\tset checksum cycle stop count to #"),a.u("\tsp #\t\tset speed multiplier to #")}break;case "t":hk(a,g[0],g[1]);break;case "u":Hj(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ek(a,
|
||||
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.u("PDPjs version 1.31.0 ("+a.f.xa+",RELEASE"+(yb?",TYPEDARRAYS":",LONGARRAYS")+")");a.u(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){gk(a,b.substr(1));break}var cf="commands:",df;for(df in kk)cf+="\n"+ta(df,9)+kk[df];Je(a)||(cf+="\nnote: history disabled if no exec breakpoints");a.u(cf);break;default:f=!0}f&&(a.u("unknown command: "+b),d=!1)}}catch(wi){a.u("debugger error: "+(wi.stack||wi.message)),d=!1}return d}
|
||||
function Ud(a,b,c){b=Vi(a,b,c);for(var d in b)if(!Nj(a,b[+d]))return!1;return!0}
|
||||
var kk={"?":"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"},Qj=".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(" "),
|
||||
rj=20,sj=21,tj=22,uj=23,vj=24,wj=25,xj=26,yj=27,zj=28,Aj=29,Bj=30,pj={SP:6,PC:7,PS:rj,PI:sj,ER:tj,SL:uj,M0:vj,M1:wj,M2:xj,M3:yj,AR:zj,DR:Aj,SR:Bj},jk="KI KD SI SD ?? ?? UI UD".split(" "),Xj=7,Yj=56,Y=Yj|Xj,Wj=4032,X=4096,Sj=8192,Tj=12288,Uj=24576,Vj=32768,Rj=61440,gj={61440:{4096:[62,Wj,Y],8192:[47,Wj,Y],12288:[18,Wj,Y],16384:[14,Wj,Y],20480:[16,Wj,Y],24576:[3,Wj,Y],36864:[63,Wj,Y],40960:[48,Wj,Y],45056:[19,Wj,Y],49152:[15,Wj,Y],53248:[17,Wj,Y],57344:[94,Wj,Y]},65024:{2048:[57,448,Y],28672:[100,Y,
|
||||
448],29184:[101,Y,448],29696:[102,Y,448],30208:[103,Y,448],30720:[104,448,Y],32256:[105,448,Sj]},65280:{256:[27,X],512:[24,X],768:[10,X],1024:[11,X],1280:[22,X],1536:[12,X],1792:[20,X],32768:[25,X],33024:[23,X],33280:[13,X],33536:[21,X],33792:[28,X],34048:[29,X],34304:[8,X],34560:[9,X],34816:[106,Vj],35072:[107,Vj]},65472:{64:[56,Y],192:[95,Y],2560:[39,Y],2624:[49,Y],2688:[53,Y],2752:[51,Y],2816:[67,Y],2880:[1,Y],2944:[77,Y],3008:[97,Y],3072:[73,Y],3136:[71,Y],3200:[6,Y],3264:[4,Y],3328:[58,Uj],3392:[60,
|
||||
Y],3456:[65,Y],3520:[96,Y],35328:[40,Y],35392:[50,Y],35456:[54,Y],35520:[52,Y],35584:[68,Y],35648:[2,Y],35712:[78,Y],35776:[98,Y],35840:[74,Y],35904:[72,Y],35968:[7,Y],36032:[5,Y],36096:[66,Y],36160:[59,Y],36224:[64,Y],36288:[61,Y]},65528:{128:[76,Xj],152:[108,Tj]},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]}},Pj=[0],kj=[58,60,65,96,108,110,100,101,102,103,104,105,59,64],Dj=1E3;Ua(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new cj(d);nb(d,c)}});
|
||||
function lk(a,b,c){A.call(this,"Computer",a,0,33554432);this.A.ea=!1;this.O=null;mk(this,b);this.L=Pd(this,"autoPower",a);this.j=0;this.U=a.busWidth||a.buswidth;this.b=nk;this.H=null;this.R=this.w=this.M=this.B=this.S=!1;this.v=null;this.V=Pd(this,"url")||"";(Math.random()+.1).toString(36);this.g=ok(this);if(this.f=mb("CPU",this.id)){this.F=mb("Debugger",this.id);this.D=new Bc({id:this.kb+".bus",busWidth:this.U},this.f,this.F);var d,e=kb(this.id);if((this.i=mb("Panel",this.id))&&this.i.Oa)for(b=0;b<
|
||||
e.length;b++)d=e[b],d.N=this.i.N,d.u=this.i.u,d.Oa=this.i.Oa;this.u("PDPjs v1.31.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.u("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.pa&&d.pa(this,this.D,this.f,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.G=d:this.b=parseInt(d,10));var f;if(a=Pd(this,"state")||(f=!0,a.state))b=
|
||||
this.P=a,f||(this.B=!0,this.b=mk),this.b&&(this.J=new ie(this,"1.31.0"),ok(this.J)?b=null:delete this.J);!b&&this.b&&(b=pk(this))&&(this.B=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.G=null,g.B=!1,g.N("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(g.H=b,g.S=!0);G(g)})}else G(this);this.C.power||(this.L=!0);!c&&this.L&&qk(this,this.Qb)}else y("Unable to find CPU component")}p(kk,A);
|
||||
function lk(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.O=b}function Pd(a,b,c){var d=b.toLowerCase(),d=ub[b]||ub[d];void 0===d&&a.O&&(d=a.O[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function qk(a,b,c){for(var d=kb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!qb(f)){qb(f,function(){qk(a,b,c)});return}}b.call(a,c)}
|
||||
function rk(a,b){var c=new ie(a,"1.31.0",sk);if(ok(c)&&tk(c)){var d=c.get(uk),e=b?b.get(uk):"unknown";d!=e&&(a.N("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=kk.prototype;
|
||||
h.Qb=function(a){void 0===a&&(a=this.b||(this.H?vk:mk));if(!this.j){this.j++;var b=!1,c=!1;this.M=!1;var d=this.J||new ie(this,"1.31.0");if(a==wk)b=!0;else if(a>mk){if(ok(d,this.H)){this.v=new ie(this,"1.31.0",xk);ok(this.v)&&(yk(this,d),a=zk,Ak(this.v));this.v.set(uk,za());Bk(this.v);var e=this.b&&!this.B;if(a==vk||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=tk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ok(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.N("Error: "+g),"unable to verify user"==g&&(La(Ck,""),this.g=null)):this.u(f+": "+g),Ak(d),ok(d)?(c=tk(d),e=!0):c=!1))}e&&rk(this,c?d:null)}else a==zk&&d.clear()}else rk(this);delete this.H;delete this.J}e=kb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.f&&(c=Dk(this,g,d,b,c));b=[d,a,c];a!=wk?qk(this,this.cd,b):this.cd(b)}};
|
||||
function Dk(a,b,c,d,e){if(!b.A.ea){b.A.ea=!0;if(b.qa){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.qa(f,d)&&f&&(y("Unable to restore state for "+b.type),a.P&&!a.S?(c.clear(),a.b=mk,window&&window.location.reload()):a.M=!0,b.qa(null),e=!1)}if(!d&&b.Qc)for(a=b.Qc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.cd=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.A.ea=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Dk(this,this.f,b,c,a),L(this),this.f.Ra());this.M&&(yk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0};
|
||||
function yk(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.31.0"};d.url=a.V;d.user=c;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function hk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new ie(a,"1.31.0"),g=new ie(a,"1.31.0",sk),k=za();g.set(uk,k);f.set(uk,k);f.set(Ek,"1.31.0");f.set(Fk,window?window.location.href:null);f.set(Ik,window?window.navigator.userAgent:"");a.f&&a.f.za&&(c&&J(a.f),d=a.f.za(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ea=!1,!1===d&&(e=null)));for(var k=kb(a.id),l=0;l<k.length;l++){var m=k[l];m.A.ea&&(m.za&&(d=m.za(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.A.ea=!1,!1===d&&(e=null)))}e&&
|
||||
(c?(k=d=!1,b?(a.g&&Sk(a,a.g,f.toString()),Bk(g)&&Bk(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=a.b==Tk),d&&f.clear(k)):e=f.toString());c&&(a.A.ea=!1,b=a.C.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.D&&this.D.reset&&(I(this,"Resetting "+this.D.type),this.D.reset());this.f&&this.f.reset&&(I(this,"Resetting "+this.f.type),this.f.reset());for(var a=kb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.D&&c!==this.f&&c.reset&&(I(this,"Resetting "+c.type),c.reset())}L(this,-1)};
|
||||
this.P=a,f||(this.B=!0,this.b=nk),this.b&&(this.J=new ie(this,"1.31.0"),pk(this.J)?b=null:delete this.J);!b&&this.b&&(b=qk(this))&&(this.B=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.G=null,g.B=!1,g.N("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(g.H=b,g.S=!0);G(g)})}else G(this);this.C.power||(this.L=!0);!c&&this.L&&rk(this,this.Qb)}else y("Unable to find CPU component")}p(lk,A);
|
||||
function mk(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.O=b}function Pd(a,b,c){var d=b.toLowerCase(),d=ub[b]||ub[d];void 0===d&&a.O&&(d=a.O[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function rk(a,b,c){for(var d=kb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!qb(f)){qb(f,function(){rk(a,b,c)});return}}b.call(a,c)}
|
||||
function sk(a,b){var c=new ie(a,"1.31.0",tk);if(pk(c)&&uk(c)){var d=c.get(vk),e=b?b.get(vk):"unknown";d!=e&&(a.N("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=lk.prototype;
|
||||
h.Qb=function(a){void 0===a&&(a=this.b||(this.H?wk:nk));if(!this.j){this.j++;var b=!1,c=!1;this.M=!1;var d=this.J||new ie(this,"1.31.0");if(a==xk)b=!0;else if(a>nk){if(pk(d,this.H)){this.v=new ie(this,"1.31.0",yk);pk(this.v)&&(zk(this,d),a=Ak,Bk(this.v));this.v.set(vk,za());Ck(this.v);var e=this.b&&!this.B;if(a==wk||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=uk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?pk(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.N("Error: "+g),"unable to verify user"==g&&(La(Dk,""),this.g=null)):this.u(f+": "+g),Bk(d),pk(d)?(c=uk(d),e=!0):c=!1))}e&&sk(this,c?d:null)}else a==Ak&&d.clear()}else sk(this);delete this.H;delete this.J}e=kb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.f&&(c=Ek(this,g,d,b,c));b=[d,a,c];a!=xk?rk(this,this.cd,b):this.cd(b)}};
|
||||
function Ek(a,b,c,d,e){if(!b.A.ea){b.A.ea=!0;if(b.qa){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.qa(f,d)&&f&&(y("Unable to restore state for "+b.type),a.P&&!a.S?(c.clear(),a.b=nk,window&&window.location.reload()):a.M=!0,b.qa(null),e=!1)}if(!d&&b.Qc)for(a=b.Qc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.cd=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.A.ea=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.f&&(Ek(this,this.f,b,c,a),L(this),this.f.Ra());this.M&&(zk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0};
|
||||
function zk(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.31.0"};d.url=a.V;d.user=c;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function ik(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new ie(a,"1.31.0"),g=new ie(a,"1.31.0",tk),k=za();g.set(vk,k);f.set(vk,k);f.set(Fk,"1.31.0");f.set(Gk,window?window.location.href:null);f.set(Jk,window?window.navigator.userAgent:"");a.f&&a.f.za&&(c&&J(a.f),d=a.f.za(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.ea=!1,!1===d&&(e=null)));for(var k=kb(a.id),l=0;l<k.length;l++){var m=k[l];m.A.ea&&(m.za&&(d=m.za(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.A.ea=!1,!1===d&&(e=null)))}e&&
|
||||
(c?(k=d=!1,b?(a.g&&Tk(a,a.g,f.toString()),Ck(g)&&Ck(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=a.b==Uk),d&&f.clear(k)):e=f.toString());c&&(a.A.ea=!1,b=a.C.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.D&&this.D.reset&&(I(this,"Resetting "+this.D.type),this.D.reset());this.f&&this.f.reset&&(I(this,"Resetting "+this.f.type),this.f.reset());for(var a=kb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.D&&c!==this.f&&c.reset&&(I(this,"Resetting "+c.type),c.reset())}L(this,-1)};
|
||||
h.start=function(a,b){for(var c=kb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}L(this,-1)};h.stop=function(a,b){for(var c=kb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}L(this,-1)};
|
||||
function L(a,b){if(a.f){var c=a.f,d=b||0,e=c.C.speed;e&&(0>=d||30<=(c.nc+=d))&&(e.textContent=c.A.T?c.lb.toFixed(2)+"Mhz":"Stopped",c.nc=0)}if(a.i&&(a=a.i,b=b||0,a.v)){c=a.f.A.T;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;e<a.f.g.length;e++)Ub(a,"R"+e,a.f.g[e]);e=kd(a.f);Ub(a,"PS",e);Ub(a,"NF",e&8?1:0,1);Ub(a,"ZF",e&4?1:0,1);Ub(a,"VF",e&2?1:0,1);Ub(a,"CF",e&1?1:0,1);a.j=0}kc(a,0<b&&c&&!d?a.f.ib:a.ra);fc(a,a.rb);b=a.f;b=b.Va?b.U&16?1:2:4;mc(a,"B22",b&1);mc(a,"B18",b&2);mc(a,"B16",b&4)}}
|
||||
h.na=function(a,b,c){var d=this;switch(b){case "power":return this.C[b]=c,c.onclick=function(){d.j||(d.A.ea?hk(d,!1,!0):qk(d,d.Qb))},!0;case "reset":return this.C[b]=c,c.onclick=function(){if(d.A.ea&&!d.j)if(d.b&&!d.G){var a=Da("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");hk(d,a,!0);!a&&d.P?window&&window.location.reload():(a||(d.w=!0),d.Qb(mk),d.w=!1)}else d.reset(),d.f&&d.f.Ra()},!0;case "save":if(pa(Ca(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.C[b]=c,c.onclick=function(){var a=nk(d,!0);if(a){var b=!!(d.b&&!d.G||d.P),c=hk(d,b);b?Sk(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function nk(a,b){var c=a.g;c||((c=Ka(Ck),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=Uk(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c}
|
||||
function Uk(a,b){a.g=null;b=Aa(Ca()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La(Ck,b.data),a.g=b.data)}catch(d){y(d.message+" ("+c+")")}return a.g}function pk(a){var b=null;a.g&&(b=Ca()+"/api/v1/user?req=load&user="+a.g+"&state="+Vk(a,"1.31.0"));return b}
|
||||
function Sk(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Vk(a,"1.31.0");d.data=c;b=Aa(Ca()+"/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.N("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.N(c),La(Ck,""),a.g=null)}}
|
||||
function Bh(a){var b;a=kb(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 Zd(a,b){if(a.Oa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Oa.focus();!b&&window&&window.scrollTo(c,d)}}var xk="failsafe",sk="validate",uk="timestamp",Ek="version",Fk="url",Ik="browser",Ck="user",wk=-1,mk=0,vk=1,zk=2,Tk=3;
|
||||
Ua(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 kk(g,d,!0);nb(g,f);g.L&&qk(g,g.Qb)}});Va.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=mb("Computer",c.id))&&c.R&&!c.A.ea&&c.Qb(wk)}});
|
||||
Va.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=mb("Computer",c.id))&&c.A.ea&&hk(c,!(!c.b||c.G),!0)}});function ie(a,b,c){this.id=a.id;this.b="";this.f={};this.g=this.C=!1;this.key=Vk(a,b,c);Ak(this,a.Dd)}h=ie.prototype;h.set=function(a,b){try{this.f[a]=b}catch(c){}};h.get=function(a){return this.f[a]||null};h.data=function(){return this.f};function ok(a,b){return b?(a.b=b,a.g=!0,a.C=!1,!0):a.g?!0:Ea()&&(b=Ka(a.key))?(a.b=b,a.g=!0):!1}
|
||||
function tk(a){var b=!0;if(!a.C)try{a.f=JSON.parse(a.b),a.C=!0}catch(c){y(c.message||c),b=!1}return b}function Bk(a){var b=!0;if(Ea()){var c=JSON.stringify(a.f);La(a.key,c)||(y("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.f?JSON.stringify(this.f):this.b};function Ak(a,b){a.b="";a.f={};a.g=a.C=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){Ak(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 Vk(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}var Wk=0;
|
||||
function Xk(a,b,c,d,e,f){e("Loading "+a+"...");Aa(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):Yk(k,a,b,c,d,e,f)})}
|
||||
function Yk(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(ib(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?Zk(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Zk(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Aa(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],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]);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);Zk(a,b,c)}})}else c(a,null)}
|
||||
function $k(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--Wk||Ya(!0));l=!1}var g,k,l=!0;Wk++;jb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c||
|
||||
(c="/versions/pdpjs/1.31.0/components.xsl");m=function(d,k){k?Xk(c,null,null,!1,e,function(d,l){l?(ib(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--Wk||Ya(!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),--Wk||Ya(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xk(b,a,d,!0,e,m):Yk(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return $k(a,b,c,d)};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.31.0/pdp11-dbg.map
|
||||
h.na=function(a,b,c){var d=this;switch(b){case "power":return this.C[b]=c,c.onclick=function(){d.j||(d.A.ea?ik(d,!1,!0):rk(d,d.Qb))},!0;case "reset":return this.C[b]=c,c.onclick=function(){if(d.A.ea&&!d.j)if(d.b&&!d.G){var a=Da("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ik(d,a,!0);!a&&d.P?window&&window.location.reload():(a||(d.w=!0),d.Qb(nk),d.w=!1)}else d.reset(),d.f&&d.f.Ra()},!0;case "save":if(pa(Ca(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.C[b]=c,c.onclick=function(){var a=ok(d,!0);if(a){var b=!!(d.b&&!d.G||d.P),c=ik(d,b);b?Tk(d,a,c):d.N("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function ok(a,b){var c=a.g;c||((c=Ka(Dk),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=Vk(a,c))||a.N("The user ID is invalid.")):b&&a.N("Browser local storage is not available"));return c}
|
||||
function Vk(a,b){a.g=null;b=Aa(Ca()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La(Dk,b.data),a.g=b.data)}catch(d){y(d.message+" ("+c+")")}return a.g}function qk(a){var b=null;a.g&&(b=Ca()+"/api/v1/user?req=load&user="+a.g+"&state="+Wk(a,"1.31.0"));return b}
|
||||
function Tk(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Wk(a,"1.31.0");d.data=c;b=Aa(Ca()+"/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.N("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.N(c),La(Dk,""),a.g=null)}}
|
||||
function Bh(a){var b;a=kb(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 Zd(a,b){if(a.Oa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Oa.focus();!b&&window&&window.scrollTo(c,d)}}var yk="failsafe",tk="validate",vk="timestamp",Fk="version",Gk="url",Jk="browser",Dk="user",xk=-1,nk=0,wk=1,Ak=2,Uk=3;
|
||||
Ua(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 lk(g,d,!0);nb(g,f);g.L&&rk(g,g.Qb)}});Va.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=mb("Computer",c.id))&&c.R&&!c.A.ea&&c.Qb(xk)}});
|
||||
Va.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=mb("Computer",c.id))&&c.A.ea&&ik(c,!(!c.b||c.G),!0)}});function ie(a,b,c){this.id=a.id;this.b="";this.f={};this.g=this.C=!1;this.key=Wk(a,b,c);Bk(this,a.Dd)}h=ie.prototype;h.set=function(a,b){try{this.f[a]=b}catch(c){}};h.get=function(a){return this.f[a]||null};h.data=function(){return this.f};function pk(a,b){return b?(a.b=b,a.g=!0,a.C=!1,!0):a.g?!0:Ea()&&(b=Ka(a.key))?(a.b=b,a.g=!0):!1}
|
||||
function uk(a){var b=!0;if(!a.C)try{a.f=JSON.parse(a.b),a.C=!0}catch(c){y(c.message||c),b=!1}return b}function Ck(a){var b=!0;if(Ea()){var c=JSON.stringify(a.f);La(a.key,c)||(y("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.f?JSON.stringify(this.f):this.b};function Bk(a,b){a.b="";a.f={};a.g=a.C=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){Bk(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 Wk(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}var Xk=0;
|
||||
function Yk(a,b,c,d,e,f){e("Loading "+a+"...");Aa(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):Zk(k,a,b,c,d,e,f)})}
|
||||
function Zk(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(ib(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?$k(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function $k(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Aa(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],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]);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);$k(a,b,c)}})}else c(a,null)}
|
||||
function al(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--Xk||Ya(!0));l=!1}var g,k,l=!0;Xk++;jb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c||
|
||||
(c="/versions/pdpjs/1.31.0/components.xsl");m=function(d,k){k?Yk(c,null,null,!1,e,function(d,l){l?(ib(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--Xk||Ya(!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),--Xk||Ya(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Yk(b,a,d,!0,e,m):Zk(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return l}window.embedPDP11=function(a,b,c,d){Ya(!1);return al(a,b,c,d)};window.enableEvents=Ya;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.31.0/pdp11-dbg.map
|
||||
|
|
|
|||
|
|
@ -39,47 +39,47 @@ var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[4
|
|||
"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,kc:65,Hf:66,Jf:67,fg:68,E:69,gg:70,hg:71,ig:72,jg:73,kg:74,lg:75,mg:76,ng:77,og:78,pg:79,qg:80,Q:81,rg:82,sg:83,tg:84,ug:85,vg:86,wg:87,xg:88,yg:89,Xc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,zg:97,Ag:98,Bg:99,d:100,e:101,Dg:102,Eg:103,Fg:104,Gg:105,Jg:106,k:107,Kg:108,Lg:109,n:110,Mg:111,p:112,q:113,r:114,Ng:115,t:116,Og:117,Pg:118,Qg:119,x:120,y:121,z:122,"{":123,
|
||||
"|":124,"}":125,"~":126,Mc:127};
|
||||
function r(a){var b=10,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 ja(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function u(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 v(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 ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function la(a,b){return-1!==a.indexOf(b,a.length-b.length)}function ma(a){return a.replace(/[&<>"']/g,function(a){return na[a]})}function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var na={"&":"&","<":"<",">":">",'"':""","'":"'"},pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",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 qa(){return Date.now()||+new Date}
|
||||
function ra(){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 x(a,b,c,d){c=void 0===c?!1:c;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 k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,
|
||||
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ja(a,b){var c="";b?11<b&&(b=11):b=a&-16777216?11:a&-65536?8:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function ka(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 u(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 la(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}function na(a){return a.replace(/[&<>"']/g,function(a){return oa[a]})}function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var oa={"&":"&","<":"<",">":">",'"':""","'":"'"},qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",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 ra(){return Date.now()||+new Date}
|
||||
function sa(){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 v(a,b,c,d){c=void 0===c?!1:c;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 k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.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,"+");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 sa(a,b){var c,d={N:null,ea:null,ja:null,ia: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.ja=g.load;d.ia=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&255,d.N[f++]=e[c]>>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&
|
||||
255,d.N[f++]=e[c]>>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ea=g.symbols;d.N.length?1==d.N.length&&(z(d.N[0]),d=null):(z("Empty resource: "+a),d=null)}catch(k){z("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)){z("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.N=e)}return d}
|
||||
function ta(){return"http://"+(window?window.location.host:"www.pcjs.org")}function z(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}function va(){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 ta(a,b){var c,d={N:null,ea:null,ja:null,ia: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.ja=g.load;d.ia=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&255,d.N[f++]=e[c]>>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c<e.length;c++)d.N[f++]=e[c]&
|
||||
255,d.N[f++]=e[c]>>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ea=g.symbols;d.N.length?1==d.N.length&&(y(d.N[0]),d=null):(y("Empty resource: "+a),d=null)}catch(k){y("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)){y("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.N=e)}return d}
|
||||
function ua(){return"http://"+(window?window.location.host:"www.pcjs.org")}function y(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}function wa(){if(null==xa){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}xa=a}return xa}
|
||||
function za(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)}return!1}
|
||||
function Ca(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}
|
||||
function Da(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ea(a){Fa.init.push(a)}function Ga(a){if(Ha)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){z(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ha&&a?(Ha=!0,Ja&&Ka("init"),La&&Ka("show")):Ha=a}function Ka(a){Fa[a]&&Ga(Fa[a])}var Fa={init:[],show:[],exit:[]},Ja=!1,La=!1,Ha=!0,wa=null;
|
||||
function Da(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ea(a){Fa.init.push(a)}function Ga(a){if(Ha)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){y(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ha&&a?(Ha=!0,Ja&&Ka("init"),La&&Ka("show")):Ha=a}function Ka(a){Fa[a]&&Ga(Fa[a])}var Fa={init:[],show:[],exit:[]},Ja=!1,La=!1,Ha=!0,xa=null;
|
||||
Da("onload",function(){Ja=!0;Ga(Fa.init)});Da("onpageshow",function(){La=!0;Ga(Fa.show)});Da(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ga(Fa.exit)});
|
||||
function A(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pc=b.comment;this.Uc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Ga=this.id:(this.Ha=this.id.substr(0,a),this.Ga=this.id.substr(a+1));this.l={ready:!1,Pa:!1,Yb:!1,R:!1,error:!1};this.xb=null;this.l.error=!1;this.j={};this.Nc=d||0;this.D=this.c=this.s=this.A=this.ab=null;B.push(this)}function Ma(a,b,c){Na[a]&&b&&(Na[a][b]=c)}
|
||||
function C(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<B.length;b++){var d=B[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Oa(a){if(void 0!==a){var b;for(b=0;b<B.length;b++)if(B[b].id===a)return B[b]}return null}function Pa(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<B.length;d++)if(c)c==B[d]&&(c=null);else if(!(a!=B[d].type||b&&B[d].id.indexOf(b)))return B[d]}return null}
|
||||
function D(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){z(c.message+" ("+a+")")}return b}function E(a,b){b=F(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=D(f))&&g.binding&&a.aa(g.type,g.binding,f,g.value),l=k.length}}}}
|
||||
function F(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}h=A.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
function z(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pc=b.comment;this.Uc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Ga=this.id:(this.Ha=this.id.substr(0,a),this.Ga=this.id.substr(a+1));this.l={ready:!1,Pa:!1,Yb:!1,R:!1,error:!1};this.xb=null;this.l.error=!1;this.j={};this.Nc=d||0;this.D=this.c=this.s=this.A=this.ab=null;A.push(this)}function Ma(a,b,c){Na[a]&&b&&(Na[a][b]=c)}
|
||||
function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<A.length;b++){var d=A[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Oa(a){if(void 0!==a){var b;for(b=0;b<A.length;b++)if(A[b].id===a)return A[b]}return null}function Pa(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<A.length;d++)if(c)c==A[d]&&(c=null);else if(!(a!=A[d].type||b&&A[d].id.indexOf(b)))return A[d]}return null}
|
||||
function C(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){y(c.message+" ("+a+")")}return b}function D(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=C(f))&&g.binding&&a.aa(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}h=z.prototype;h.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
h.aa=function(a,b,c){switch(b){case "clear":return this.j[b]||(this.j[b]=c,c.onclick=function(a){return function(){a.j.print&&(a.j.print.value="")}}(this)),!0;case "print":return this.j[b]||(this.ab=this.j[b]=c,c.value="",this.U=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.B=function(a){this.U(a,this.Ga)}),!0;default:return!1}};h.log=function(){};h.U=function(){};
|
||||
h.status=function(a){this.U(this.Ga+": "+a)};h.B=function(a,b,c){c=c||this.type;b||z((c?c+": ":"")+a)};function Qa(a,b){a.l.error=!0;a.B(b)}function Ra(a,b){b&&(a.l.ready?b():a.xb=b);return a.l.ready}function G(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.xb,a.xb=null,b&&b()))}function Sa(a,b){a.l.Yb?(a.l.Pa=!1,a.l.Yb=!1):a.l.error?a.U(a.toString()+" error"):a.l.Pa=b}h.Y=function(){return this.l.R=!0};h.ga=function(a,b){b&&(this.l.R=!1);return!0};var Ta=void 0,Ua={};
|
||||
if(window){Ta||(Ta=window.location.search.substr(1));for(var Va,Wa=/\+/g,Xa=/([^&=]+)=?([^&]*)/g;Va=Xa.exec(Ta);)Ua[decodeURIComponent(Va[1].replace(Wa," "))]=decodeURIComponent(Va[2].replace(Wa," "))}window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var Na=window?window.PCjs.Machines:{},B=window?window.PCjs.Components:[];
|
||||
h.status=function(a){this.U(this.Ga+": "+a)};h.B=function(a,b,c){c=c||this.type;b||y((c?c+": ":"")+a)};function Qa(a,b){a.l.error=!0;a.B(b)}function Ra(a,b){b&&(a.l.ready?b():a.xb=b);return a.l.ready}function F(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.xb,a.xb=null,b&&b()))}function Sa(a,b){a.l.Yb?(a.l.Pa=!1,a.l.Yb=!1):a.l.error?a.U(a.toString()+" error"):a.l.Pa=b}h.Y=function(){return this.l.R=!0};h.ga=function(a,b){b&&(this.l.R=!1);return!0};var Ta=void 0,Ua={};
|
||||
if(window){Ta||(Ta=window.location.search.substr(1));for(var Va,Wa=/\+/g,Xa=/([^&=]+)=?([^&]*)/g;Va=Xa.exec(Ta);)Ua[decodeURIComponent(Va[1].replace(Wa," "))]=decodeURIComponent(Va[2].replace(Wa," "))}window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var Na=window?window.PCjs.Machines:{},A=window?window.PCjs.Components:[];
|
||||
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,Za={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"};
|
||||
function $a(a){A.call(this,"Panel",a,0,512);this.ha=this.g=this.b=this.h=this.i=this.m=0;this.u=this.v=this.o=!1;this.w=ab;this.f={};this.a={START:[1,1,!0,!1,this.pd],STEP:[1,1,!1,!1,this.qd],ENABLE:[1,1,!1,!1,this.ld],CONT:[1,1,!0,!1,this.jd],DEP:[0,0,!0,!1,this.kd],EXAM:[1,1,!0,!1,this.md],LOAD:[1,1,!0,!1,this.od],TEST:[0,0,!0,!1,this.nd]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.rd,a];this.D=this.c=this.s=this.A=null}n($a,A);h=$a.prototype;h.reset=function(){this.stop()};
|
||||
function $a(a){z.call(this,"Panel",a,0,512);this.ha=this.g=this.b=this.h=this.i=this.m=0;this.u=this.v=this.o=!1;this.w=ab;this.f={};this.a={START:[1,1,!0,!1,this.pd],STEP:[1,1,!1,!1,this.qd],ENABLE:[1,1,!1,!1,this.ld],CONT:[1,1,!0,!1,this.jd],DEP:[0,0,!0,!1,this.kd],EXAM:[1,1,!0,!1,this.md],LOAD:[1,1,!0,!1,this.od],TEST:[0,0,!0,!1,this.nd]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.rd,a];this.D=this.c=this.s=this.A=null}n($a,z);h=$a.prototype;h.reset=function(){this.stop()};
|
||||
h.aa=function(a,b,c,d){if(this.A&&this.A.aa(a,b,c,d)||this.c&&this.c.aa(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.j[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){bb(a,
|
||||
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){cb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){bb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){cb(a,b)}}(this,b),!0):A.prototype.aa.call(this,a,b,c,d)}};h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;db(b,this,eb);fb(b,this.reset.bind(this));gb(this);hb(this)};h.Y=function(a,b){b||(ib(),this.reset());return!0};h.ga=function(){return!0};
|
||||
function jb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function gb(a,b){for(var c in a.f)jb(a,c,null!=b?b:a.f[c])}function kb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hb(a){for(var b in a.a)kb(a,b,a.a[b][1])}function lb(a,b,c,d){a.j[b]&&(void 0===c&&(Qa(a,"Value for "+b+" is invalid"),H(a.c)),c=8==(a.D&&a.D.h||8)?ja(c,d):u(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
|
||||
function bb(a,b){var c=a.a[b];kb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mb&&(a.u=b==nb,a.v=b==ob)}function cb(a,b){var c=a.a[b];c[2]&&c[3]&&(kb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.pd=function(a){a||this.c.l.P||(a=this.c,a.s.reset(),pb(a),this.a[qb]&&this.a[qb][1]&&rb(this.c))};h.qd=function(){};h.ld=function(a){a||H(this.c)};
|
||||
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){cb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){bb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){cb(a,b)}}(this,b),!0):z.prototype.aa.call(this,a,b,c,d)}};h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;db(b,this,eb);fb(b,this.reset.bind(this));gb(this);hb(this)};h.Y=function(a,b){b||(ib(),this.reset());return!0};h.ga=function(){return!0};
|
||||
function jb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function gb(a,b){for(var c in a.f)jb(a,c,null!=b?b:a.f[c])}function kb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hb(a){for(var b in a.a)kb(a,b,a.a[b][1])}function lb(a,b,c,d){a.j[b]&&(void 0===c&&(Qa(a,"Value for "+b+" is invalid"),G(a.c)),c=8==(a.D&&a.D.h||8)?ja(c,d):ka(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
|
||||
function bb(a,b){var c=a.a[b];kb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mb&&(a.u=b==nb,a.v=b==ob)}function cb(a,b){var c=a.a[b];c[2]&&c[3]&&(kb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.pd=function(a){a||this.c.l.P||(a=this.c,a.s.reset(),pb(a),this.a[qb]&&this.a[qb][1]&&rb(this.c))};h.qd=function(){};h.ld=function(a){a||G(this.c)};
|
||||
h.jd=function(a){if(!a&&!this.c.l.P)if(this.a[qb]&&this.a[qb][1])rb(this.c);else{a=this.D;var b;if(b=a)a.l.Pa&&(a.l.Yb=!0),b=!a.l.Pa;if(b)Sa(a,!0),a.f(0,null),Sa(a,!1);else try{var c=this.c.Rb(1);0<c&&(sb(this.c,c),tb(this.c,c,!0),ub(this.c,c))}catch(d){"number"!=typeof d&&Qa(this.c,d.stack||d.message)}this.stop();this.A&&vb(this.A)}};h.kd=function(a){if(a&&!this.c.l.P)if(this.u&&wb(this),a=xb(this,this.b),this.w==ab)yb(this.s,this.ha,a);else{var b=this.c,c=this.ha;b.$a++;b.s.ub(zb(b,c,4),a);b.$a--}};
|
||||
h.md=function(a){if(!a&&!this.c.l.P){this.v&&wb(this);if(this.w==ab)a=Ab(this.s,this.ha);else{a=this.c;var b=this.ha;a.$a++;b=a.s.tb(zb(a,b,2));a.$a--;a=b}xb(this,a)}};h.od=function(a){a||this.c.l.P||Bb(this,this.b)};h.nd=function(a){if(a)this.o=!0,gb(this,!0);else if(this.o=!1,gb(this),void 0!==this.j[Cb]){for(a=this.b=0;22>a;a++)this.a["S"+a][1]=0&1<<a?1:0;hb(this)}};h.rd=function(a,b){this.b=a?this.b|1<<b:this.b&~(1<<b)};
|
||||
function wb(a){var b=1145>a.c.wa?8:16,c=65472<=a.ha&&a.ha<65472+b,b=c?1:2,c=c?15:a.s.i;a.a[mb]&&a.a[mb][1]||(b=-b);Bb(a,a.ha&~c|a.ha+b&c)}function Bb(a,b){a.ha=b&a.s.i;b=a.ha;for(var c=0;22>c;c++)Db(a,"A"+c,b&1<<c)}function xb(a,b){a.g=b&65535;b=a.g;for(var c=0;16>c;c++)Db(a,"D"+c,b&1<<c);return a.g}function Db(a,b,c){a.f[b]=c;a.o||jb(a,b,c)}h.stop=function(){Bb(this,this.c.b[7])};h.setData=function(a,b){b?this.h=a:this.g=a};h.wd=function(a,b){return(b?this.h:this.b)&65535};
|
||||
h.Ge=function(a){this.h=a};function ib(){for(var a=!1,b=F(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=D(d),f=Oa(e.id);f||(a=!0,f=new $a(e));E(f,d);a&&G(f)}}var ab=7,Cb="S0",nb="DEP",qb="ENABLE",ob="EXAM",mb="STEP",Eb={},eb=(Eb[65400]=[null,null,$a.prototype.wd,$a.prototype.Ge,"CNSW"],Eb);Ea(ib);
|
||||
function Fb(a,b,c){A.call(this,"Bus",a,0,16);this.c=b;this.D=c;this.M=a.busWidth||16;this.F=1<<this.M;this.i=this.F-1;this.f=Gb;this.b=Math.log2(this.f);this.K=this.f>>2;this.h=this.f-1;this.v=this.F/this.f|0;this.Ba=[];this.o=0;this.u=!1;this.G=[];this.Yc=[Hb,Ib,Jb,Kb];this.a=this.g=[];this.C=this.w=this.m=this.H=this.I=0;a=new I(this);Lb(a);this.a=Array(this.v);this.g=Array(this.v);for(b=0;b<this.v;b++)this.a[b]=this.g[b]=a;this.C=this.F-Gb;Mb(this,this.C,Gb,Nb,this);this.I=this.H=(this.C&this.i)>>>
|
||||
this.b;this.w=0;this.m=this.i;G(this)}n(Fb,A);function Ob(a,b){if(b!=a.w){for(var c=0;c<a.v;c++)a.g[c]=a.a[c];a.w=0;a.m=a.i;b&&(a.w=b,b=1<<b,a.m=b-1,b-=Gb,a.I=(b&a.m)>>>a.b,a.g[a.I]=a.a[a.H])}}h=Fb.prototype;h.reset=function(){for(var a=0;a<this.G.length;a++)this.G[a]();Ob(this,16)};h.Y=function(a,b){b||this.reset();return!0};
|
||||
function Mb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.b;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.f,p=a.f-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Oa)return l.rb+=l.Oa-f,l.Oa=f,!0;if(f>=l.Oa+l.rb){p=l.size-(f-m);p>g&&(p=g);l.rb=f-l.Oa+p;f=m+a.f;g-=p;k++;continue}}return Pb(Qb,f,g)}f=new I(a,f,p,a.f,d,e);Lb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Rb[d]+" at "+ja(b)),!0):Pb(Sb,b,c)}h.Hc=function(a){return this.g[(a&this.m)>>>this.b].Fb(a&this.h,a)};
|
||||
h.Ge=function(a){this.h=a};function ib(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Oa(e.id);f||(a=!0,f=new $a(e));D(f,d);a&&F(f)}}var ab=7,Cb="S0",nb="DEP",qb="ENABLE",ob="EXAM",mb="STEP",Eb={},eb=(Eb[65400]=[null,null,$a.prototype.wd,$a.prototype.Ge,"CNSW"],Eb);Ea(ib);
|
||||
function Fb(a,b,c){z.call(this,"Bus",a,0,16);this.c=b;this.D=c;this.M=a.busWidth||16;this.F=1<<this.M;this.i=this.F-1;this.f=Gb;this.b=Math.log2(this.f);this.K=this.f>>2;this.h=this.f-1;this.v=this.F/this.f|0;this.Ba=[];this.o=0;this.u=!1;this.G=[];this.Yc=[Hb,Ib,Jb,Kb];this.a=this.g=[];this.C=this.w=this.m=this.H=this.I=0;a=new H(this);Lb(a);this.a=Array(this.v);this.g=Array(this.v);for(b=0;b<this.v;b++)this.a[b]=this.g[b]=a;this.C=this.F-Gb;Mb(this,this.C,Gb,Nb,this);this.I=this.H=(this.C&this.i)>>>
|
||||
this.b;this.w=0;this.m=this.i;F(this)}n(Fb,z);function Ob(a,b){if(b!=a.w){for(var c=0;c<a.v;c++)a.g[c]=a.a[c];a.w=0;a.m=a.i;b&&(a.w=b,b=1<<b,a.m=b-1,b-=Gb,a.I=(b&a.m)>>>a.b,a.g[a.I]=a.a[a.H])}}h=Fb.prototype;h.reset=function(){for(var a=0;a<this.G.length;a++)this.G[a]();Ob(this,16)};h.Y=function(a,b){b||this.reset();return!0};
|
||||
function Mb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.b;0<g&&k<a.a.length;){var l=a.a[k],m=k*a.f,p=a.f-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Oa)return l.rb+=l.Oa-f,l.Oa=f,!0;if(f>=l.Oa+l.rb){p=l.size-(f-m);p>g&&(p=g);l.rb=f-l.Oa+p;f=m+a.f;g-=p;k++;continue}}return Pb(Qb,f,g)}f=new H(a,f,p,a.f,d,e);Lb(f,l);a.a[k++]=f;f=m+a.f;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Rb[d]+" at "+ja(b)),!0):Pb(Sb,b,c)}h.Hc=function(a){return this.g[(a&this.m)>>>this.b].Fb(a&this.h,a)};
|
||||
h.tb=function(a){return this.g[(a&this.m)>>>this.b].V(a&this.h,a)};h.Ic=function(a,b){this.g[(a&this.m)>>>this.b].Nb(a&this.h,b,a)};h.ub=function(a,b){this.g[(a&this.m)>>>this.b].jb(a&this.h,b,a)};function Ab(a,b){a.u=!1;a.o++;b=a.a[(b&a.i)>>>a.b].bc(b&a.h,b);a.o--;return b}function Tb(a,b,c){a.u=!1;a.o++;a.a[(b&a.i)>>>a.b].Ob(b&a.h,c&255,b);a.o--}function yb(a,b,c){a.u=!1;a.o++;a.a[(b&a.i)>>>a.b].gc(b&a.h,c&65535,b);a.o--}
|
||||
function Ub(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.a[d];if(e.ua||e.dd){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;l[k++]=p-g;l[k++]=m;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Vb(a){for(var b=Wb,c=0,d=0;d<a.a.length;d++){var e=a.a[d];e.type==b&&(c=e.Oa+e.rb)}return c}
|
||||
function Xb(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&Yb;if(void 0!==a.Ba[p])return z("I/O address already registered: "+u(b,8,!0)),!1;var t=l||"unknown";t&&0<=m&&(t+=m++);a.Ba[p]=[d,e,f,g,t,k||16,!1]}return!0}
|
||||
function db(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.wa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],w=g[5]||1,y=0;y<w;y++,f+=2)if(t&&1<w&&(t=g[4]+y),!Xb(a,f,f,k,l,m,p,g[7]||b.Nc,t||b.Ga))return!1}}return!0}
|
||||
function fb(a,b){a.G.push(b)}function J(a,b,c){a.u=!0;a.o||(c&&(a.c.G|=c),K(a.c,4,0,b))}function Zb(a){var b=a.u;a.u=!1;return b}function Pb(a,b,c){z("Memory block error ("+a+": "+u(b)+","+u(c)+")");return!1}var Gb=8192,Yb=Gb-1,Qb=1,Sb=2;function Hb(a,b){var c=-1,d=this.controller,e=d.Ba[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.Ba[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 Ib(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!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.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Jb(a,b){var c=-1,d=this.controller;a=d.Ba[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 Kb(a,b,c){var d=!1,e=this.controller;a=e.Ba[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 L(a){A.call(this,"Device",a,0,256);this.a={Cg:0,dc:-1}}n(L,A);h=L.prototype;h.X=function(a,b,c,d){this.s=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.dc=ac(c,function(){e.a.cb|=128;e.a.cb&64&&M(e.c,e.a.Da);e.A&&vb(e.A,1);bc(e.c,e.a.dc,1E3/60)});this.a.Da=cc(c,64,6,524288);db(b,this,dc);fb(b,this.reset.bind(this));G(this)};
|
||||
function Xb(a,b,c,d,e,f,g,k,l){for(var m=b==c?-1:0;b<=c;b+=2){var p=b&Yb;if(void 0!==a.Ba[p])return y("I/O address already registered: "+ka(b,8,!0)),!1;var t=l||"unknown";t&&0<=m&&(t+=m++);a.Ba[p]=[d,e,f,g,t,k||16,!1]}return!0}
|
||||
function db(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.c.wa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],x=g[5]||1,w=0;w<x;w++,f+=2)if(t&&1<x&&(t=g[4]+w),!Xb(a,f,f,k,l,m,p,g[7]||b.Nc,t||b.Ga))return!1}}return!0}
|
||||
function fb(a,b){a.G.push(b)}function I(a,b,c){a.u=!0;a.o||(c&&(a.c.G|=c),J(a.c,4,0,b))}function Zb(a){var b=a.u;a.u=!1;return b}function Pb(a,b,c){y("Memory block error ("+a+": "+ka(b)+","+ka(c)+")");return!1}var Gb=8192,Yb=Gb-1,Qb=1,Sb=2;function Hb(a,b){var c=-1,d=this.controller,e=d.Ba[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.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255}
|
||||
function Ib(a,b,c){var d=!1,e=this.controller,f=e.Ba[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!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.Ba[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Jb(a,b){var c=-1,d=this.controller;a=d.Ba[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 Kb(a,b,c){var d=!1,e=this.controller;a=e.Ba[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 K(a){z.call(this,"Device",a,0,256);this.a={Cg:0,dc:-1}}n(K,z);h=K.prototype;h.X=function(a,b,c,d){this.s=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.dc=ac(c,function(){e.a.cb|=128;e.a.cb&64&&L(e.c,e.a.Da);e.A&&vb(e.A,1);bc(e.c,e.a.dc,1E3/60)});this.a.Da=cc(c,64,6,524288);db(b,this,dc);fb(b,this.reset.bind(this));F(this)};
|
||||
h.reset=function(){this.a.cb=128;bc(this.c,this.a.dc,1E3/60,!0)};h.Dd=function(){return this.a.cb};h.Ne=function(a){this.a.cb=a&192;this.a.cb&64||(a=this.a.Da)&&ec(this.c,a)};h.Fd=function(){var a=this.c,b=a.H;b&57344||(b=b&-3199|a.Wa<<5|a.Xa<<1);return b};h.Pe=function(a){fc(this.c,a&-129|this.c.H&128)};h.Gd=function(){var a=this.c;a.H&57344||(a.ob=a.F>>16&65535);a=a.ob;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Hd=function(){var a=this.c;a.H&57344||(a.pb=a.F&65535);return a.pb};h.Id=function(){return this.c.na};
|
||||
h.Qe=function(a){var b=this.c;1170>b.wa&&(a&=-49);b.na!=a&&(b.na=a,b.Ka=a&16?4194303:262143,gc(b))};h.pe=function(a){a=a>>1&63;var b=this.c.Na[a>>1];return a&1?b>>16:b&65535};h.zf=function(a,b){b=b>>1&63;var c=b>>1;this.c.Na[c]=b&1?this.c.Na[c]&65535|(a&63)<<16:this.c.Na[c]&-65536|a&65534};h.ie=function(a){return this.c.u[1][a>>1&7]};h.sf=function(a,b){this.c.u[1][b>>1&7]=a&65295};h.ge=function(a){return this.c.u[1][(a>>1&7)+8]};h.qf=function(a,b){this.c.u[1][(b>>1&7)+8]=a&65295};
|
||||
h.he=function(a){return this.c.I[1][a>>1&7]};h.rf=function(a,b){b=b>>1&7;this.c.I[1][b]=a;this.c.u[1][b]&=65295};h.fe=function(a){return this.c.I[1][(a>>1&7)+8]};h.pf=function(a,b){b=(b>>1&7)+8;this.c.I[1][b]=a;this.c.u[1][b]&=65295};h.Cd=function(a){return this.c.u[0][a>>1&7]};h.Me=function(a,b){this.c.u[0][b>>1&7]=a&65295};h.Ad=function(a){return this.c.u[0][(a>>1&7)+8]};h.Ke=function(a,b){this.c.u[0][(b>>1&7)+8]=a&65295};h.Bd=function(a){return this.c.I[0][a>>1&7]};
|
||||
|
|
@ -88,118 +88,118 @@ h.le=function(a){return this.c.I[3][(a>>1&7)+8]};h.vf=function(a,b){b=(b>>1&7)+8
|
|||
h.gb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ta[a]};h.ib=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ta[b]=a};h.Od=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.da[1]};h.We=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.da[1]=a};h.Pd=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.da[3]};h.Xe=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.da[3]=a};h.yd=function(a){return this.c.Mb[a-65504>>1]};
|
||||
h.Ie=function(a,b){this.c.Mb[b-65504>>1]=a};h.Cc=function(a){return 65520==a?(Vb(this.s)>>6)-1:0};h.Fc=function(){};h.ke=function(){return 1};h.uf=function(){};h.xd=function(){return this.c.G};h.He=function(){this.c.G=0};h.Ed=function(){return this.c.Lb};h.Oe=function(a,b){b&1||(a&=255);this.c.Lb=a};h.Jd=function(a,b){return b?0:this.c.bb};h.Re=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.bb=a};h.je=function(a,b){return b?0:this.c.Ma&65280};
|
||||
h.tf=function(a){this.c.Ma=a|255};h.Md=function(){return hc(this.c)};h.Ue=function(a){ic(this.c,a)};h.Ec=function(){};
|
||||
var N={},dc=(N[61568]=[null,null,L.prototype.pe,L.prototype.zf,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.ie,L.prototype.sf,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.ge,L.prototype.qf,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.he,L.prototype.rf,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.fe,L.prototype.pf,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.Cd,L.prototype.Me,"KIPDR",8,1145,64],N[62672]=[null,null,L.prototype.Ad,L.prototype.Ke,"KDPDR",8,1145,64],N[62688]=
|
||||
[null,null,L.prototype.Bd,L.prototype.Le,"KIPAR",8,1145,64],N[62704]=[null,null,L.prototype.zd,L.prototype.Je,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.Id,L.prototype.Qe,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.Dd,L.prototype.Ne,"LKS"],N[65402]=[null,null,L.prototype.Fd,L.prototype.Pe,"MMR0",1,1145,64],N[65404]=[null,null,L.prototype.Gd,L.prototype.Ec,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.Hd,L.prototype.Ec,"MMR2",1,1145,64],N[65408]=[null,null,L.prototype.oe,L.prototype.yf,
|
||||
"UIPDR",8,1145,64],N[65424]=[null,null,L.prototype.me,L.prototype.wf,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.ne,L.prototype.xf,"UIPAR",8,1145,64],N[65456]=[null,null,L.prototype.le,L.prototype.vf,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.fb,L.prototype.hb,"R0SET0"],N[65473]=[null,null,L.prototype.fb,L.prototype.hb,"R1SET0"],N[65474]=[null,null,L.prototype.fb,L.prototype.hb,"R2SET0"],N[65475]=[null,null,L.prototype.fb,L.prototype.hb,"R3SET0"],N[65476]=[null,null,L.prototype.fb,
|
||||
L.prototype.hb,"R4SET0"],N[65477]=[null,null,L.prototype.fb,L.prototype.hb,"R5SET0"],N[65478]=[null,null,L.prototype.Nd,L.prototype.Ve,"R6KERNEL"],N[65479]=[null,null,L.prototype.Qd,L.prototype.Ye,"R7KERNEL"],N[65480]=[null,null,L.prototype.gb,L.prototype.ib,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.gb,L.prototype.ib,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.gb,L.prototype.ib,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.gb,L.prototype.ib,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.gb,
|
||||
L.prototype.ib,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.gb,L.prototype.ib,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Od,L.prototype.We,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Pd,L.prototype.Xe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.yd,L.prototype.Ie,"CTRL",8,1170],N[65520]=[null,null,L.prototype.Cc,L.prototype.Fc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.Cc,L.prototype.Fc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ke,L.prototype.uf,"SYSID",1,1170],N[65526]=
|
||||
[null,null,L.prototype.xd,L.prototype.He,"ERR",1,1170],N[65528]=[null,null,L.prototype.Ed,L.prototype.Oe,"MBR",1,1170],N[65530]=[null,null,L.prototype.Jd,L.prototype.Re,"PIR"],N[65532]=[null,null,L.prototype.je,L.prototype.tf,"SLR"],N[65534]=[null,null,L.prototype.Md,L.prototype.Ue,"PSW"],N);
|
||||
Ea(function(){for(var a=F(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=D(d);switch(c.type){case "default":c=new L(c);E(c,d);break;case "pc11":c=new jc(c);E(c,d);break;case "rl11":c=new O(c);E(c,d);break;case "rk11":c=new P(c),E(c,d)}}});
|
||||
function I(a,b,c,d,e,f){this.a=a;this.id=kc+=2;this.c=null;this.Oa=b;this.rb=c;this.size=d||0;this.type=e||lc;this.h=e==mc;this.controller=null;this.Fb=this.i=this.$b;this.V=this.bc=this.ac;this.Nb=this.Ob=this.sb;this.jb=this.gc=this.fc;this.f=this.g=0;Lb(this);this.ua=this.dd=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],nc(this,f.Yc);else if(Ya)this.j=new ArrayBuffer(this.size),this.s=new DataView(this.j,0,this.size),this.b=new Uint8Array(this.j,0,this.size),this.A=new Uint16Array(this.j,
|
||||
0,this.size>>1),this.c=new Int32Array(this.j,0,this.size>>2),nc(this,oc?pc:qc);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;nc(this,rc)}else nc(this)}h=I.prototype;h.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.s.getInt32(b<<2,!0);else a=this.c;return a};
|
||||
var M={},dc=(M[61568]=[null,null,K.prototype.pe,K.prototype.zf,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.ie,K.prototype.sf,"SIPDR",8,1145,64],M[62608]=[null,null,K.prototype.ge,K.prototype.qf,"SDPDR",8,1145,64],M[62624]=[null,null,K.prototype.he,K.prototype.rf,"SIPAR",8,1145,64],M[62640]=[null,null,K.prototype.fe,K.prototype.pf,"SDPAR",8,1145,64],M[62656]=[null,null,K.prototype.Cd,K.prototype.Me,"KIPDR",8,1145,64],M[62672]=[null,null,K.prototype.Ad,K.prototype.Ke,"KDPDR",8,1145,64],M[62688]=
|
||||
[null,null,K.prototype.Bd,K.prototype.Le,"KIPAR",8,1145,64],M[62704]=[null,null,K.prototype.zd,K.prototype.Je,"KDPAR",8,1145,64],M[62798]=[null,null,K.prototype.Id,K.prototype.Qe,"MMR3",1,1145,64],M[65382]=[null,null,K.prototype.Dd,K.prototype.Ne,"LKS"],M[65402]=[null,null,K.prototype.Fd,K.prototype.Pe,"MMR0",1,1145,64],M[65404]=[null,null,K.prototype.Gd,K.prototype.Ec,"MMR1",1,1145,64],M[65406]=[null,null,K.prototype.Hd,K.prototype.Ec,"MMR2",1,1145,64],M[65408]=[null,null,K.prototype.oe,K.prototype.yf,
|
||||
"UIPDR",8,1145,64],M[65424]=[null,null,K.prototype.me,K.prototype.wf,"UDPDR",8,1145,64],M[65440]=[null,null,K.prototype.ne,K.prototype.xf,"UIPAR",8,1145,64],M[65456]=[null,null,K.prototype.le,K.prototype.vf,"UDPAR",8,1145,64],M[65472]=[null,null,K.prototype.fb,K.prototype.hb,"R0SET0"],M[65473]=[null,null,K.prototype.fb,K.prototype.hb,"R1SET0"],M[65474]=[null,null,K.prototype.fb,K.prototype.hb,"R2SET0"],M[65475]=[null,null,K.prototype.fb,K.prototype.hb,"R3SET0"],M[65476]=[null,null,K.prototype.fb,
|
||||
K.prototype.hb,"R4SET0"],M[65477]=[null,null,K.prototype.fb,K.prototype.hb,"R5SET0"],M[65478]=[null,null,K.prototype.Nd,K.prototype.Ve,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qd,K.prototype.Ye,"R7KERNEL"],M[65480]=[null,null,K.prototype.gb,K.prototype.ib,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.gb,K.prototype.ib,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.gb,K.prototype.ib,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.gb,K.prototype.ib,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.gb,
|
||||
K.prototype.ib,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.gb,K.prototype.ib,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Od,K.prototype.We,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Pd,K.prototype.Xe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.yd,K.prototype.Ie,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Cc,K.prototype.Fc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Cc,K.prototype.Fc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.ke,K.prototype.uf,"SYSID",1,1170],M[65526]=
|
||||
[null,null,K.prototype.xd,K.prototype.He,"ERR",1,1170],M[65528]=[null,null,K.prototype.Ed,K.prototype.Oe,"MBR",1,1170],M[65530]=[null,null,K.prototype.Jd,K.prototype.Re,"PIR"],M[65532]=[null,null,K.prototype.je,K.prototype.tf,"SLR"],M[65534]=[null,null,K.prototype.Md,K.prototype.Ue,"PSW"],M);
|
||||
Ea(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=C(d);switch(c.type){case "default":c=new K(c);D(c,d);break;case "pc11":c=new jc(c);D(c,d);break;case "rl11":c=new N(c);D(c,d);break;case "rk11":c=new O(c),D(c,d)}}});
|
||||
function H(a,b,c,d,e,f){this.a=a;this.id=kc+=2;this.c=null;this.Oa=b;this.rb=c;this.size=d||0;this.type=e||lc;this.h=e==mc;this.controller=null;this.Fb=this.i=this.$b;this.V=this.bc=this.ac;this.Nb=this.Ob=this.sb;this.jb=this.gc=this.fc;this.f=this.g=0;Lb(this);this.ua=this.dd=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.c=a[0],nc(this,f.Yc);else if(Ya)this.j=new ArrayBuffer(this.size),this.s=new DataView(this.j,0,this.size),this.b=new Uint8Array(this.j,0,this.size),this.A=new Uint16Array(this.j,
|
||||
0,this.size>>1),this.c=new Int32Array(this.j,0,this.size>>2),nc(this,oc?pc:qc);else{a=this.c=Array(this.size>>2);for(f=0;f<a.length;f++)a[f]=0;nc(this,rc)}else nc(this)}h=H.prototype;h.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.s.getInt32(b<<2,!0);else a=this.c;return a};
|
||||
h.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.s.setInt32(b<<2,a[b],!0);else this.c=a;return this.ua=!0}return!1};function nc(a,b){b||(b=sc);uc(a,b,void 0);vc(a,b,void 0)}function uc(a,b,c){c&&a.f||(a.Fb=b[0]||a.$b,a.V=b[2]||a.ac);if(c||void 0===c)a.i=b[0]||a.$b,a.bc=b[2]||a.ac}function vc(a,b,c){c&&a.g||(a.Nb=!a.h&&b[1]||a.sb,a.jb=!a.h&&b[3]||a.fc);if(c||void 0===c)a.Ob=b[1]||a.sb,a.gc=b[3]||a.fc}
|
||||
function Lb(a,b){a.f=a.g=0;b&&((a.f=b.f)&&uc(a,wc,!1),(a.g=b.g)&&vc(a,wc,!1))}h.$b=function(a,b){J(this.a,b,32);return 255};h.sb=function(a,b,c){J(this.a,c,32)};h.ac=function(a,b){return this.Fb(a++,b++)|this.Fb(a,b)<<8};h.fc=function(a,b,c){this.Nb(a++,b&255,c++);this.Nb(a,b>>8,c)};h.vd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.ue=function(a,b){a&1&&J(this.a,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8};
|
||||
h.Fe=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.ua=!0};h.Df=function(a,b,c){a&1&&J(this.a,c,64);c=a>>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<<a)|b<<a:(this.c[c]=this.c[c]&16777215|b<<24,c++,this.c[c]=this.c[c]&-256|b>>8);this.ua=!0};h.td=function(a,b){return this.i(a,b)};h.re=function(a,b){return this.bc(a,b)};h.De=function(a,b,c){this.h?this.sb(0,0,c):this.Ob(a,b,c)};h.Bf=function(a,b,c){this.h?this.sb(0,0,c):this.gc(a,b,c)};h.sd=function(a){return this.b[a]};
|
||||
h.ud=function(a){return this.b[a]};h.qe=function(a,b){a&1&&J(this.a,b,64);return this.s.getUint16(a,!0)};h.te=function(a,b){a&1&&J(this.a,b,64);return this.A[a>>1]};h.Ce=function(a,b){this.b[a]=b;this.ua=!0};h.Ee=function(a,b){this.b[a]=b;this.ua=!0};h.Af=function(a,b,c){a&1&&J(this.a,c,64);this.s.setUint16(a,b,!0);this.ua=!0};h.Cf=function(a,b,c){a&1&&J(this.a,c,64);this.A[a>>1]=b;this.ua=!0};
|
||||
var lc=0,Wb=1,mc=2,Nb=4,Rb=["NONE","RAM","ROM","VID","H/W"],kc=0,sc=[],rc=[I.prototype.vd,I.prototype.Fe,I.prototype.ue,I.prototype.Df],wc=[I.prototype.td,I.prototype.De,I.prototype.re,I.prototype.Bf];if(Ya)var qc=[I.prototype.sd,I.prototype.Ce,I.prototype.qe,I.prototype.Af],pc=[I.prototype.ud,I.prototype.Ee,I.prototype.te,I.prototype.Cf];var xc;if(Ya){var yc=new ArrayBuffer(2);(new DataView(yc)).setUint16(0,256,!0);xc=256===(new Uint16Array(yc))[0]}else xc=!1;var oc=xc;
|
||||
function zc(a,b){A.call(this,"CPU",a,0,1);b=a.cycles||b;var c=a.multiplier||1;this.hc=0;this.Ib=b;this.La=c;this.Ub=Math.round(this.Ib/1E4)/100;this.Va=this.Ub*this.La;this.Vb=this.nb=this.Ya=this.Jb=0;this.l.P=!1;this.l.cc=!1;this.l.Ca=a.autoStart;this.l.vb=!1;this.Db=this.Ta=0;this.Eb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.pa=[];this.sc=this.ye.bind(this);this.za=this.sa=this.ya=this.a=this.W=this.ra=this.kb=this.xa=this.Za=this.Wb=this.Ia=0;this.la=null;G(this)}n(zc,A);h=zc.prototype;
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.D=d;this.la=a.f;for(a=0;a<Ac.length;a++)(b=this.j[Ac[a]])&&this.A.aa(null,Ac[a],b);G(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.Y=function(a,b){var c=Bc(this.A,"autoStart");null!=c?this.l.Ca="true"==c?!0:"false"==c?!1:!!c:null==this.l.Ca&&(this.l.Ca=void 0===this.j.run);if(!b){if(a&&this.restore){Cc(this);if(!this.restore(a))return!1;Dc(this)}else this.reset();this.U("No debugger detected");this.l.Ca||this.U("CPU will not be auto-started, click Run to start")}return!0};
|
||||
h.ga=function(a){return a?this.save():!0};h.Ca=function(){return this.l.P?!0:this.l.Ca?(rb(this),!0):!1};h.zc=function(){return 0};function Dc(a){void 0===a.Eb&&(a.Eb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.l.vb=0<=a.Eb&&0<a.lb;a.l.vb&&(a.Db=0,a.Ta=a.Eb-a.za)}function ub(a,b){if(a.l.vb){var c=!1;a.Db=a.Db+a.zc()|0;a.Ta-=b;0>=a.Ta&&(a.Ta+=a.lb,c=!0);0<=a.mb&&a.mb<=Ec(a)&&(a.lb=a.mb=-1,Dc(a),H(a),c=!0);c&&a.U(Ec(a)+" cycles: checksum="+u(a.Db))}}
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.R)a=!0;else{var b=null,c,k=C(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.R);c++);c==k.length&&(b=a);z("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.xb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.P?H(d):rb(d))},!0;case "speed":return this.j[b]=
|
||||
function Lb(a,b){a.f=a.g=0;b&&((a.f=b.f)&&uc(a,wc,!1),(a.g=b.g)&&vc(a,wc,!1))}h.$b=function(a,b){I(this.a,b,32);return 255};h.sb=function(a,b,c){I(this.a,c,32)};h.ac=function(a,b){return this.Fb(a++,b++)|this.Fb(a,b)<<8};h.fc=function(a,b,c){this.Nb(a++,b&255,c++);this.Nb(a,b>>8,c)};h.vd=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.ue=function(a,b){a&1&&I(this.a,b,64);b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8};
|
||||
h.Fe=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<<a)|b<<a;this.ua=!0};h.Df=function(a,b,c){a&1&&I(this.a,c,64);c=a>>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<<a)|b<<a:(this.c[c]=this.c[c]&16777215|b<<24,c++,this.c[c]=this.c[c]&-256|b>>8);this.ua=!0};h.td=function(a,b){return this.i(a,b)};h.re=function(a,b){return this.bc(a,b)};h.De=function(a,b,c){this.h?this.sb(0,0,c):this.Ob(a,b,c)};h.Bf=function(a,b,c){this.h?this.sb(0,0,c):this.gc(a,b,c)};h.sd=function(a){return this.b[a]};
|
||||
h.ud=function(a){return this.b[a]};h.qe=function(a,b){a&1&&I(this.a,b,64);return this.s.getUint16(a,!0)};h.te=function(a,b){a&1&&I(this.a,b,64);return this.A[a>>1]};h.Ce=function(a,b){this.b[a]=b;this.ua=!0};h.Ee=function(a,b){this.b[a]=b;this.ua=!0};h.Af=function(a,b,c){a&1&&I(this.a,c,64);this.s.setUint16(a,b,!0);this.ua=!0};h.Cf=function(a,b,c){a&1&&I(this.a,c,64);this.A[a>>1]=b;this.ua=!0};
|
||||
var lc=0,Wb=1,mc=2,Nb=4,Rb=["NONE","RAM","ROM","VID","H/W"],kc=0,sc=[],rc=[H.prototype.vd,H.prototype.Fe,H.prototype.ue,H.prototype.Df],wc=[H.prototype.td,H.prototype.De,H.prototype.re,H.prototype.Bf];if(Ya)var qc=[H.prototype.sd,H.prototype.Ce,H.prototype.qe,H.prototype.Af],pc=[H.prototype.ud,H.prototype.Ee,H.prototype.te,H.prototype.Cf];var xc;if(Ya){var yc=new ArrayBuffer(2);(new DataView(yc)).setUint16(0,256,!0);xc=256===(new Uint16Array(yc))[0]}else xc=!1;var oc=xc;
|
||||
function zc(a,b){z.call(this,"CPU",a,0,1);b=a.cycles||b;var c=a.multiplier||1;this.hc=0;this.Ib=b;this.La=c;this.Ub=Math.round(this.Ib/1E4)/100;this.Va=this.Ub*this.La;this.Vb=this.nb=this.Ya=this.Jb=0;this.l.P=!1;this.l.cc=!1;this.l.Ca=a.autoStart;this.l.vb=!1;this.Db=this.Ta=0;this.Eb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.pa=[];this.sc=this.ye.bind(this);this.za=this.sa=this.ya=this.a=this.W=this.ra=this.kb=this.xa=this.Za=this.Wb=this.Ia=0;this.la=null;F(this)}n(zc,z);h=zc.prototype;
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.D=d;this.la=a.f;for(a=0;a<Ac.length;a++)(b=this.j[Ac[a]])&&this.A.aa(null,Ac[a],b);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.Y=function(a,b){var c=Bc(this.A,"autoStart");null!=c?this.l.Ca="true"==c?!0:"false"==c?!1:!!c:null==this.l.Ca&&(this.l.Ca=void 0===this.j.run);if(!b){if(a&&this.restore){Cc(this);if(!this.restore(a))return!1;Dc(this)}else this.reset();this.U("No debugger detected");this.l.Ca||this.U("CPU will not be auto-started, click Run to start")}return!0};
|
||||
h.ga=function(a){return a?this.save():!0};h.Ca=function(){return this.l.P?!0:this.l.Ca?(rb(this),!0):!1};h.zc=function(){return 0};function Dc(a){void 0===a.Eb&&(a.Eb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.l.vb=0<=a.Eb&&0<a.lb;a.l.vb&&(a.Db=0,a.Ta=a.Eb-a.za)}function ub(a,b){if(a.l.vb){var c=!1;a.Db=a.Db+a.zc()|0;a.Ta-=b;0>=a.Ta&&(a.Ta+=a.lb,c=!0);0<=a.mb&&a.mb<=Ec(a)&&(a.lb=a.mb=-1,Dc(a),G(a),c=!0);c&&a.U(Ec(a)+" cycles: checksum="+ka(a.Db))}}
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.R)a=!0;else{var b=null,c,k=B(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.R);c++);c==k.length&&(b=a);y("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.xb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.P?G(d):rb(d))},!0;case "speed":return this.j[b]=
|
||||
c,!0;case "setSpeed":return this.j[b]=c,c.onclick=function(){Fc(d,d.La<<1,!0)},c.textContent=this.Va.toFixed(2)+"Mhz",!0}return!1};function tb(a,b,c){a.za+=b;c&&(a.ya=a.a=a.W=0)}function Gc(a,b){var c=1;b&&1<a.La&&a.Ia&&(c=a.Ia/a.Ub);a.Vb=Math.round(1E3/Hc);a.nb=Math.floor(a.Ib/Hc*c);b||(a.Ya=a.nb);a.Jb=0}function Ec(a){return a.za+a.sa+a.ya-a.a}function Cc(a){a.Ia=0;a.Wb=0;a.za=a.sa=a.ya=a.a=a.W=0;Dc(a);Fc(a,1)}
|
||||
function Fc(a,b,c){if(void 0!==b){.8>a.Ia/a.Va&&(b=1);a.La=b;b=a.Ub*a.La;if(a.Va!=b){a.Va=b;b=a.Va.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.A&&Ic(a.A)}tb(a,a.sa);a.sa=0;a.ra=qa();a.xa=0;Gc(a)}function ac(a,b){var c=a.pa.length;a.pa.push([-1,b]);return c}function bc(a,b,c,d){0<=b&&b<a.pa.length&&(d||0>a.pa[b][0])&&(c=a.Ib*a.La/1E3*c|0,a.l.P&&(c+=Jc(a)),a.pa[b][0]=c)}
|
||||
function Fc(a,b,c){if(void 0!==b){.8>a.Ia/a.Va&&(b=1);a.La=b;b=a.Ub*a.La;if(a.Va!=b){a.Va=b;b=a.Va.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.A&&Ic(a.A)}tb(a,a.sa);a.sa=0;a.ra=ra();a.xa=0;Gc(a)}function ac(a,b){var c=a.pa.length;a.pa.push([-1,b]);return c}function bc(a,b,c,d){0<=b&&b<a.pa.length&&(d||0>a.pa[b][0])&&(c=a.Ib*a.La/1E3*c|0,a.l.P&&(c+=Jc(a)),a.pa[b][0]=c)}
|
||||
function sb(a,b){for(var c=a.pa.length-1;0<=c;c--){var d=a.pa[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Jc(a,b){var c=a.ya-=a.a;a.a=a.W=0;b&&(a.ya=0);return c}
|
||||
h.ye=function(){if(this.l.P){this.Jb>=this.Ib&&Gc(this,!0);this.Za=0;this.kb=qa();if(this.xa){var a=this.kb-this.xa;a>this.Vb&&(this.ra+=a,this.ra>this.kb&&(this.ra=this.kb))}try{do{for(var b,c=this.l.vb?1:this.nb,d=this.pa.length-1;0<=d;d--){var e=this.pa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Rb(b)}catch(f){if("number"!=typeof f)throw f;}b=Jc(this,!0);this.Za+=b;this.sa+=b;ub(this,b);sb(this,b);this.Ya-=b;if(0>=this.Ya){this.Ya+=this.nb;++this.Wb>=Kc&&(this.A&&vb(this.A,void 0),this.Wb=0);break}}while(this.l.P)}catch(f){H(this);
|
||||
this.A&&this.A.stop(qa(),Ec(this));Qa(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.sc;this.xa=qa();c=this.Vb;this.Za&&(c=Math.round(c*this.Za/this.nb));c-=this.xa-this.kb;if(d=this.xa-this.ra)this.Ia=Math.round(this.sa/(10*d))/100,864E5<=d&&(this.za=0,Fc(this));if(0>c||this.Ia<this.Va)-1E3>c&&(this.ra-=c),c=0;this.Jb+=this.Za;this.xa+=c;a(b,c)}}};
|
||||
function rb(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.U(a.toString()+" busy");else{Fc(a);a.l.P=!0;a.l.cc=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ra,Ec(a));a.D||a.status("Started");setTimeout(a.sc,0)}}h.Rb=function(){return 0};function H(a){var b=!1;if(a.l.P){Jc(a);tb(a,a.sa);a.sa=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(qa(),Ec(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Hc=30,Kc=15,Ac=["power","reset"];
|
||||
h.ye=function(){if(this.l.P){this.Jb>=this.Ib&&Gc(this,!0);this.Za=0;this.kb=ra();if(this.xa){var a=this.kb-this.xa;a>this.Vb&&(this.ra+=a,this.ra>this.kb&&(this.ra=this.kb))}try{do{for(var b,c=this.l.vb?1:this.nb,d=this.pa.length-1;0<=d;d--){var e=this.pa[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Rb(b)}catch(f){if("number"!=typeof f)throw f;}b=Jc(this,!0);this.Za+=b;this.sa+=b;ub(this,b);sb(this,b);this.Ya-=b;if(0>=this.Ya){this.Ya+=this.nb;++this.Wb>=Kc&&(this.A&&vb(this.A,void 0),this.Wb=0);break}}while(this.l.P)}catch(f){G(this);
|
||||
this.A&&this.A.stop(ra(),Ec(this));Qa(this,f.stack||f.message);return}if(this.l.P){a=setTimeout;b=this.sc;this.xa=ra();c=this.Vb;this.Za&&(c=Math.round(c*this.Za/this.nb));c-=this.xa-this.kb;if(d=this.xa-this.ra)this.Ia=Math.round(this.sa/(10*d))/100,864E5<=d&&(this.za=0,Fc(this));if(0>c||this.Ia<this.Va)-1E3>c&&(this.ra-=c),c=0;this.Jb+=this.Za;this.xa+=c;a(b,c)}}};
|
||||
function rb(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.P)a.U(a.toString()+" busy");else{Fc(a);a.l.P=!0;a.l.cc=!0;if(b=a.j.run)b.textContent="Halt";a.A&&a.A.start(a.ra,Ec(a));a.D||a.status("Started");setTimeout(a.sc,0)}}h.Rb=function(){return 0};function G(a){var b=!1;if(a.l.P){Jc(a);tb(a,a.sa);a.sa=0;a.l.P=!1;if(b=a.j.run)b.textContent="Run";a.A&&a.A.stop(ra(),Ec(a));b=!0;a.D||a.status("Stopped")}a.l.complete=void 0;return b}var Hc=30,Kc=15,Ac=["power","reset"];
|
||||
function Lc(a){var b=+a.model||1170;zc.call(this,a,6666667);this.wa=b;this.oc=a.addrReset||0;this.i=this.v=this.m=this.o=this.w=0;this.b=this.ta=this.da=[];this.C=0;this.qc=[];this.u=this.I=this.Na=this.Mb=[];this.Kb=this.Fa=this.F=this.nc=this.Ja=this.Wa=this.Xa=this.Ka=this.G=this.bb=this.Ma=this.H=this.ob=this.pb=this.na=this.Aa=this.h=this.f=this.Cb=this.K=this.M=this.g=this.Lb=0;this.rc=255;1120>=this.wa?(this.mc=Mc.bind(this),this.Ua=this.bd,this.Kb=8,this.rc=-1,this.uc=255,this.tc=0):(this.mc=
|
||||
Nc.bind(this),this.Ua=this.cd,this.uc=~(1792|(1145>this.wa?2048:0))&65535,this.tc=1145<=this.wa?2048:0);this.$a=0;this.ca=null;this.Tb=[];this.l.complete=!1;this.zb=this.ic=this.ed;this.Ab=this.jc=this.gd;this.Pb=this.Qb=this.Ae;this.Bb=this.Sb=this.Be;this.qa=this.yb=0;this.ma=this.Ac;this.V=this.Dc;this.jb=this.Gc;this.Wc=this.Vc=0}n(Lc,zc);h=Lc.prototype;h.X=function(a,b,c,d){zc.prototype.X.call(this,a,b,c,d);this.ic=b.Hc.bind(b);this.jc=b.tb.bind(b);this.Qb=b.Ic.bind(b);this.Sb=b.ub.bind(b)};
|
||||
h.Y=function(a,b){for(var c=192,d=0;d<this.Tb.length;d++){var e=this.Tb[d];0>e.ec&&(e.ec=c,c+=4)}return zc.prototype.Y.call(this,a,b)};
|
||||
h.reset=function(){this.status("Model "+this.wa);this.l.P&&H(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.oc,-1,-2,-3,-4,-5,-6,-7,-8];this.ta=[0,0,0,0,0,0];this.da=[0,0,0,0];this.C=0;this.qc=[4,2,0,1];this.u=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Na=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Mb=[0,0,0,0,0,0,0,0];this.h=this.f=this.Cb=this.K=this.M=this.g=this.Lb=0;this.Aa=-1;pb(this);Cc(this);this.l.error=!1;zc.prototype.reset.call(this)};function pb(a){a.H=0;a.ob=0;a.pb=0;a.na=0;a.G=0;a.bb=0;a.Ma=255;a.Ja=0;a.Wa=0;a.Xa=0;a.Ka=262143;a.Fa=0;a.F=0;a.ca=null;a.s&&(gc(a),a.nc=Vb(a.s))}
|
||||
h.reset=function(){this.status("Model "+this.wa);this.l.P&&G(this);this.v=65536;this.m=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.oc,-1,-2,-3,-4,-5,-6,-7,-8];this.ta=[0,0,0,0,0,0];this.da=[0,0,0,0];this.C=0;this.qc=[4,2,0,1];this.u=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.I=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Na=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Mb=[0,0,0,0,0,0,0,0];this.h=this.f=this.Cb=this.K=this.M=this.g=this.Lb=0;this.Aa=-1;pb(this);Cc(this);this.l.error=!1;zc.prototype.reset.call(this)};function pb(a){a.H=0;a.ob=0;a.pb=0;a.na=0;a.G=0;a.bb=0;a.Ma=255;a.Ja=0;a.Wa=0;a.Xa=0;a.Ka=262143;a.Fa=a.b[7];a.F=0;a.ca=null;a.s&&(gc(a),a.nc=Vb(a.s))}
|
||||
function gc(a){a.zb=a.ic;a.Ab=a.jc;a.Pb=a.Qb;a.Bb=a.Sb;a.Ja?(a.qa=65536,a.yb=a.na&16?4186112:253952,a.ma=a.Ac,a.V=a.Dc,a.jb=a.Gc,Ob(a.s,a.na&16?22:18)):(a.qa=0,a.yb=57344,a.ma=a.fd,a.V=a.se,a.jb=a.Ef,Ob(a.s,16))}function fc(a,b){b&=-3073;if(a.H!=b){b&57344&&!(a.H&57344)&&(a.ob=a.F>>16&65535,a.pb=a.F&65535);a.H=b;a.Wa=(b&96)>>5;a.Xa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Ja!=c&&(a.Ja=c,gc(a))}}
|
||||
function Oc(a,b,c){a.oc=b;a.s.reset();pb(a);Q(a,b);ic(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||rb(a)}else a.D?H(a)||a.D.g():!1===c&&H(a);!a.l.P&&a.la&&a.la.stop()}h.zc=function(){return 0};h.save=function(){var a=new R(this);a.set(0,[this.b,this.ta,this.da,this.Na,this.Mb,this.G,this.Lb,this.bb,this.Ma,hc(this),this.Aa,this.C,this.g,this.H,this.ob,this.pb,this.na,this.Wa,this.Xa,this.u,this.I,this.Ja,this.Ka,this.Fa,this.F]);a.set(1,[this.za,this.La]);a.set(2,Ub(this.s));return a.data()};
|
||||
h.restore=function(a){var b=a[1];this.za=b[1];Fc(this,b[3]);a:{b=this.s;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.K){for(var f=0,g=Array(b.K),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.a[d];if(!f||!f.restore(e)){z("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function S(a){return a.v&65536?1:0}function Pc(a){return a.w&32768?8:0}function Qc(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}function Q(a,b){a.b[7]=b&65535}
|
||||
function cc(a,b,c,d){c={ec:b,eb:c,message:d||0,next:null};c.name=Za[b];a.Tb.push(c);return c}function ec(a,b){var c=a.ca;if(c==b)a.ca=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ca&&(a.g|=1)}function M(a,b){if(b){if(b!=a.ca){var c=a.ca;if(!c||c.eb<=b.eb)b.next=c,a.ca=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}function Rc(a){return a.g&64?(K(a,168,64,-6),!0):a.g&32?(K(a,4,32,-5),!0):a.g&16?(K(a,12,16,-7),!0):!1}
|
||||
function hc(a){return a.i=a.i&63728|Pc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|S(a)}function ic(a,b){b&=a.uc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.tc)for(var c=a.ta.length;0<=--c;){var d=a.b[c];a.b[c]=a.ta[c];a.ta[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.da[c]=a.b[6],a.b[6]=a.da[a.C]);a.i=b;a.g&=-3;a.g|=a.ca?2:1}h.ba=function(a){this.w=this.o=a;this.m=0};h.Ea=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function Sc(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}
|
||||
function Tc(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function K(a,b,c,d){if(!a.$a){0>a.Aa?a.Aa=hc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.V(b|a.qa),f=a.V(b+2&65535|a.qa);ic(a,f&-12289|a.Aa>>2&12288);Uc(a,a.Aa);Uc(a,a.b[7]);Q(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Aa=-1;a.Wc=b;a.Vc=d;-1==d&&H(a);if(-4<=d)throw b;}}function Vc(a){var b=Wc(a),c=Wc(a);a.i&49152&&(c=c&-225|a.i&63712);Q(a,b);ic(a,c);a.g&=-17}
|
||||
function Xc(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Na[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||
function zb(a,b,c){var d,e,f;if(!(c&a.Ja))return f=b&65535,57344<=f&&(f|=a.yb),f;d=b>>13;a.na&a.qc[a.C]||(d&=7);e=a.u[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ka;3932160<=f&&(f=Xc(a,f));if(a.$a)return f;f>=a.nc&&f<a.yb?(a.G|=32,K(a,4,0,f)):f&1&&!(c&1)&&(a.G|=64,K(a,4,0,f));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.u[a.C][d]=e;if(f!=(4194170&a.Ka)||a.C)a.Wa=a.C,a.Xa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Wa<<5|a.Xa<<1,fc(a,a.H&-61695|g&61694)),K(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ka)||f>(4194239&a.Ka))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function Wc(a){var b=a.V(a.b[6]|a.qa);a.b[6]=a.b[6]+2&65535;return b}function Uc(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ua(4,-2,c);a.jb(c,b)}
|
||||
function Yc(a,b,c,d){var e,f,g=d&8?0:a.qa;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ua(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ua(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ua(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,6==c&&a.Ua(d,0,
|
||||
e),a.a-=6,e|g;case 7:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.qa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.bd=function(a,b,c){!this.C&&0>=b&&c<=this.Ma&&(this.g|=32)};h.cd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ma&&(c<=this.Ma-32?K(this,4,0,-4):(this.G|=8,this.g|=32)))};h.ed=function(a){return this.ic(a)};h.gd=function(a){return this.jc(a)};h.Ae=function(a,b){this.Qb(a,b)};h.Be=function(a,b){this.Sb(a,b)};
|
||||
function Oc(a,b,c){a.oc=b;a.s.reset();pb(a);P(a,b);ic(a,0);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.l.P||rb(a)}else a.D?G(a)||a.D.g():!1===c&&G(a);!a.l.P&&a.la&&a.la.stop()}h.zc=function(){return 0};h.save=function(){var a=new Q(this);a.set(0,[this.b,this.ta,this.da,this.Na,this.Mb,this.G,this.Lb,this.bb,this.Ma,hc(this),this.Aa,this.C,this.g,this.H,this.ob,this.pb,this.na,this.Wa,this.Xa,this.u,this.I,this.Ja,this.Ka,this.Fa,this.F]);a.set(1,[this.za,this.La]);a.set(2,Ub(this.s));return a.data()};
|
||||
h.restore=function(a){var b=a[1];this.za=b[1];Fc(this,b[3]);a:{b=this.s;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.K){for(var f=0,g=Array(b.K),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.a[d];if(!f||!f.restore(e)){y("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function R(a){return a.v&65536?1:0}function Pc(a){return a.w&32768?8:0}function Qc(a,b){var c=a.b[7];a.b[7]=c+b&65535;return c}
|
||||
function S(a,b,c){c&&(P(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}function P(a,b){a.b[7]=b&65535}function cc(a,b,c,d){c={ec:b,eb:c,message:d||0,next:null};c.name=Za[b];a.Tb.push(c);return c}function ec(a,b){var c=a.ca;if(c==b)a.ca=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.ca&&(a.g|=1)}function L(a,b){if(b){if(b!=a.ca){var c=a.ca;if(!c||c.eb<=b.eb)b.next=c,a.ca=b;else{do{var d=c.next;if(!d||d.eb<=b.eb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}}
|
||||
function Rc(a){return a.g&64?(J(a,168,64,-6),!0):a.g&32?(J(a,4,32,-5),!0):a.g&16?(J(a,12,16,-7),!0):!1}function hc(a){return a.i=a.i&63728|Pc(a)|(a.o&65535?0:4)|(a.m&32768?2:0)|R(a)}function ic(a,b){b&=a.uc;a.w=b<<12;a.o=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.tc)for(var c=a.ta.length;0<=--c;){var d=a.b[c];a.b[c]=a.ta[c];a.ta[c]=d}a.C=b>>14&3;c=a.i>>14&3;a.C!=c&&(a.da[c]=a.b[6],a.b[6]=a.da[a.C]);a.i=b;a.g&=-3;a.g|=a.ca?2:1}h.ba=function(a){this.w=this.o=a;this.m=0};
|
||||
h.Ea=function(a,b){this.w=this.o=this.v=a;this.m=b||0};function Sc(a,b){a.w=a.o=a.v=b;a.m=a.w^a.v>>1}function Tc(a,b,c,d){a.w=a.o=a.v=b;a.m=(c^d)&(d^b)}function J(a,b,c,d){if(!a.$a){0>a.Aa?a.Aa=hc(a):a.C||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.G|=4,a.b[6]=b=4);if(-1!=d){a.F=b|4143316992;a.C=0;var e=a.V(b|a.qa),f=a.V(b+2&65535|a.qa);ic(a,f&-12289|a.Aa>>2&12288);Uc(a,a.Aa);Uc(a,a.b[7]);P(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Aa=-1;a.Wc=b;a.Vc=d;-1==d&&G(a);if(-4<=d)throw b;}}
|
||||
function Vc(a){var b=Wc(a),c=Wc(a);a.i&49152&&(c=c&-225|a.i&63712);P(a,b);ic(a,c);a.g&=-17}function Xc(a,b){var c=b>>13&31;31>c&&(b=a.na&32?a.Na[c]+(b&8191)&4194303:b&-3932161);return b}
|
||||
function zb(a,b,c){var d,e,f;if(!(c&a.Ja))return f=b&65535,57344<=f&&(f|=a.yb),f;d=b>>13;a.na&a.qc[a.C]||(d&=7);e=a.u[a.C][d];f=(a.I[a.C][d]<<6)+(b&8191)&a.Ka;3932160<=f&&(f=Xc(a,f));if(a.$a)return f;f>=a.nc&&f<a.yb?(a.G|=32,J(a,4,0,f)):f&1&&!(c&1)&&(a.G|=64,J(a,4,0,f));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.u[a.C][d]=e;if(f!=(4194170&a.Ka)||a.C)a.Wa=a.C,a.Xa=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.H&57344||(g|=a.H&4096|a.Wa<<5|a.Xa<<1,fc(a,a.H&-61695|g&61694)),J(a,168,64,-2)),a.H&61440||!(f<(4191360&a.Ka)||f>(4194239&a.Ka))||(a.H|=4096,a.H&512&&(a.g|=64)));return f}function Wc(a){var b=a.V(a.b[6]|a.qa);a.b[6]=a.b[6]+2&65535;return b}function Uc(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.F=a.F&65535|(a.F&-65536)<<8|16121856;a.g&256||a.Ua(4,-2,c);a.jb(c,b)}
|
||||
function Yc(a,b,c,d){var e,f,g=d&8?0:a.qa;switch(b){case 0:return J(a,4,0,-3),0;case 1:return 6==c&&a.Ua(d,0,a.b[6]),a.a-=3,7==c?a.b[c]:a.b[c]|g;case 2:f=2;e=a.b[c];6==c&&a.Ua(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.b[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.b[c]+f&65535;6==c&&a.Ua(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.b[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,6==c&&a.Ua(d,0,
|
||||
e),a.a-=6,e|g;case 7:return e=a.V(Qc(a,2)),e=e+a.b[c]&65535,e=a.V(e|a.qa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.F=a.F&65535|(a.F&-65536)<<8|(f<<3&248|c)<<16;return e}h.bd=function(a,b,c){!this.C&&0>=b&&c<=this.Ma&&(this.g|=32)};h.cd=function(a,b,c){this.C||(65534<=c&&(c|=-65536),a&4&&c<=this.Ma&&(c<=this.Ma-32?J(this,4,0,-4):(this.G|=8,this.g|=32)))};h.ed=function(a){return this.ic(a)};h.gd=function(a){return this.jc(a)};h.Ae=function(a,b){this.Qb(a,b)};h.Be=function(a,b){this.Sb(a,b)};
|
||||
h.fd=function(a,b,c){return Yc(this,a,b,c)};h.Ac=function(a,b,c){return zb(this,Yc(this,a,b,c),c)};h.se=function(a){return this.s.tb(this.Fa=a)};h.Dc=function(a){return this.s.tb(this.Fa=zb(this,a,2))};h.Ef=function(a,b){this.s.ub(this.Fa=a,b)};h.Gc=function(a,b){this.s.ub(this.Fa=zb(this,a,4),b)};
|
||||
function Zc(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=Yc(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.C=a.i>>12&3,c=a.V(d|c&a.qa),a.C=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.da[a.i>>12&3];return c}function $c(a,b,c,d){a.F=a.F&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=Yc(a,b,e,4),c&65536||(e&=65535),a.C=a.i>>12&3,e=zb(a,e|c&65536,4),a.C=a.i>>14&3,a.Bb(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.da[a.i>>12&3]=d}
|
||||
function ad(a,b){b>>=6;var c=a.M=b&7;return(b=a.K=(b&56)>>3)?a.zb(a.ma(b,c,3)):a.b[c+a.Kb]&a.rc}function bd(a,b){var c;b>>=6;var d=a.M=b&7;(b=a.K=(b&56)>>3)?c=a.Ab(a.ma(b,d,2)):c=a.b[d+a.Kb];return c}function cd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return Yc(a,b,c,8)}function dd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.zb(a.ma(b,c,3)):a.b[c]&255}function ed(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Ab(a.ma(b,d,2)):c=a.b[d];return c}
|
||||
function T(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.Cb=a.ma(b,e,7),c=0>c?a.b[-c-1]&255:c,a.Pb(e,d.call(a,c,a.zb(e))),e&1&&a.a--):(b=a.b[e],c=0>c?a.b[-c-1]&255:c,a.b[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ma(b,e,6),a.Bb(e,d.call(a,0>c?a.b[-c-1]:c,a.Ab(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])}
|
||||
function fd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.ma(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Pb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function gd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ma(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Bb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))}function V(a,b,c){c&&(Q(a,a.b[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
h.Rb=function(a){this.l.complete=!0;var b=a?this.l.cc?0:1:-1;this.l.cc=!1;this.ya=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.bb&224)>>5,e=this.ca&&this.ca.eb>d?this.ca:null;e&&(c=e.ec,d=e.eb);d>(this.i&224)>>5?(this.g&8&&(Qc(this,2),this.g&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&ec(this,e),a=!0);this.ca||this.bb||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}if(this.g&112&&Rc(this)){if(this.g&
|
||||
4&&this.D.b(this.b[7],b)){H(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.mc(e)}while(0<this.a);return this.l.complete?this.ya-this.a:void 0===this.l.complete?0:-1};Ea(function(){for(var a=F(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Lc(d);E(d,c)}});function hd(a,b){var c=b+a;this.w=this.o=this.v=c;this.m=(a^c)&(b^c);return c&65535}
|
||||
function fd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.ma(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.Pb(d,c),d&1&&a.a--):(c?(c=0>c?a.b[-c-1]&255:c,a.b[f]=a.b[f]&~d|c<<24>>24&d):a.b[f]&=~d,e.call(a,c<<8))}function gd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ma(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.Bb(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))}
|
||||
h.Rb=function(a){this.l.complete=!0;var b=a?this.l.cc?0:1:-1;this.l.cc=!1;this.ya=this.a=a;this.g=this.g&-5|0;do{if(this.g){if(a=this.g&11)if(a=!1,this.g&2){var c=160,d=(this.bb&224)>>5,e=this.ca&&this.ca.eb>d?this.ca:null;e&&(c=e.ec,d=e.eb);d>(this.i&224)>>5?(this.g&8&&(Qc(this,2),this.g&=-9),J(this,c,0,-10),d=!0):d=!1;d&&(e&&ec(this,e),a=!0);this.ca||this.bb||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){G(this);break}if(0>b)break}if(this.g&112&&Rc(this)){if(this.g&
|
||||
4&&this.D.b(this.b[7],b)){G(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.F=this.b[7];e=this.V(a);this.b[7]=a+2&65535;this.mc(e)}while(0<this.a);return this.l.complete?this.ya-this.a:void 0===this.l.complete?0:-1};Ea(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Lc(d);D(d,c)}});function hd(a,b){var c=b+a;this.w=this.o=this.v=c;this.m=(a^c)&(b^c);return c&65535}
|
||||
function id(a,b){var c=b+a,d=c<<8;this.w=this.o=this.v=d;this.m=(a<<8^d)&(b<<8^d);return c&255}function jd(a,b){a=b<<1;Sc(this,a);return a&65535}function kd(a,b){a=b<<1;Sc(this,a<<8);return a&255}function ld(a,b){a=b&32768|b>>1|b<<16;Sc(this,a);return a&65535}function md(a,b){a=b&128|b>>1|b<<8;Sc(this,a<<8);return a&255}function nd(a,b){a=b&~a;this.ba(a);return a}function od(a,b){a=b&~a;this.ba(a<<8);return a}function pd(a,b){a|=b;this.ba(a);return a}function qd(a,b){a|=b;this.ba(a<<8);return a}
|
||||
function rd(a,b){a=~b|65536;this.Ea(a);return a&65535}function sd(a,b){a=~b|256;this.Ea(a<<8);return a&255}function td(a,b){this.w=this.o=a=b-a;this.m=b&(b^a);return a&65535}function ud(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.m=b&(b^c);return a&255}function vd(a,b){this.w=this.o=a=b+a;this.m=a&(b^a);return a&65535}function wd(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.m=c&(b<<8^c);return a&255}function xd(a,b){a=-b;this.Ea(a,a&b&32768);return a&65535}
|
||||
function yd(a,b){a=-b;this.Ea(a<<8,(a&b&128)<<8);return a&255}function zd(a,b){a=b<<1|this.v>>16&1;Sc(this,a);return a&65535}function Ad(a,b){a=b<<1|this.v>>16&1;Sc(this,a<<8);return a&255}function Bd(a,b){a=(this.v&65536|b)>>1|b<<16;Sc(this,a);return a&65535}function Cd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;Sc(this,a<<8);return a&255}function Dd(a,b){var c=b-a;Tc(this,c,a,b);return c&65535}function Ed(a,b){var c=b-a;Tc(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function Fd(a,b){this.w=this.o=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Gd(a,b){a^=b;this.ba(a);return a&65535}function Hd(a){U(this,a,bd(this,a),hd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
||||
function Id(a){var b=ed(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.m=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.v=c<<17-b,c>>=b;else if(b)if(16<b)this.m=c,c=0;else{this.v=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b}
|
||||
function Jd(a){var b=ed(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.v=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.m=32768)):d=c;this.b[a]=d>>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Kd(a){V(this,a,!S(this))}function Ld(a){V(this,a,S(this))}
|
||||
function Jd(a){var b=ed(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.v=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.m=32768)):d=c;this.b[a]=d>>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function Kd(a){S(this,a,!R(this))}function Ld(a){S(this,a,R(this))}
|
||||
function Md(a){U(this,a,bd(this,a),nd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Nd(a){T(this,a,ad(this,a),od);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Od(a){U(this,a,bd(this,a),pd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Pd(a){T(this,a,ad(this,a),qd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}
|
||||
function Qd(a){var b=bd(this,a);a=ed(this,a);this.ba((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Rd(a){var b=ad(this,a);a=dd(this,a);this.ba(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Sd(a){V(this,a,this.o&65535?0:4)}function Td(a){V(this,a,!Pc(this)==!(this.m&32768))}function Ud(a){V(this,a,!!(this.o&65535)&&!Pc(this)==!(this.m&32768))}
|
||||
function Vd(a){V(this,a,!S(this)&&!!(this.o&65535))}function Wd(a){V(this,a,(this.o&65535?0:4)||!Pc(this)!=!(this.m&32768))}function Xd(a){V(this,a,S(this)||(this.o&65535?0:4))}function Yd(a){V(this,a,!Pc(this)!=!(this.m&32768))}function Zd(a){V(this,a,Pc(this))}function $d(a){V(this,a,!!(this.o&65535))}function ae(a){V(this,a,!Pc(this))}function be(){K(this,12,0,-9)}function ce(a){V(this,a,!0)}function de(a){V(this,a,!(this.m&32768))}function ee(a){V(this,a,this.m&32768?2:0)}
|
||||
function W(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function fe(a){var b=bd(this,a);a=ed(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ge(a){var b=ad(this,a);a=dd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
||||
function he(a){var b=ed(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function ie(){K(this,24,0,-9);this.a-=20}
|
||||
function je(){this.i&49152?(this.G|=128,K(this,4,0,-8)):(this.la&&1120==this.wa&&this.la.setData(this.b[0],!0),this.D?this.D.i():H(this));this.a-=7}function ke(){K(this,16,0,-9);this.a-=20}var le=[0,7,7,10,7,11,9,13];function me(a){this.W=this.a;Q(this,cd(this,a));this.a=this.W-le[this.h]}var ne=[0,14,14,17,14,18,16,20];function oe(a){this.W=this.a;var b=cd(this,a);a=a>>6&7;Uc(this,this.b[a]);this.b[a]=this.b[7];Q(this,b);this.a=this.W-ne[this.h]}var pe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function Qd(a){var b=bd(this,a);a=ed(this,a);this.ba((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Rd(a){var b=ad(this,a);a=dd(this,a);this.ba(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function Sd(a){S(this,a,this.o&65535?0:4)}function Td(a){S(this,a,!Pc(this)==!(this.m&32768))}function Ud(a){S(this,a,!!(this.o&65535)&&!Pc(this)==!(this.m&32768))}
|
||||
function Vd(a){S(this,a,!R(this)&&!!(this.o&65535))}function Wd(a){S(this,a,(this.o&65535?0:4)||!Pc(this)!=!(this.m&32768))}function Xd(a){S(this,a,R(this)||(this.o&65535?0:4))}function Yd(a){S(this,a,!Pc(this)!=!(this.m&32768))}function Zd(a){S(this,a,Pc(this))}function $d(a){S(this,a,!!(this.o&65535))}function ae(a){S(this,a,!Pc(this))}function be(){J(this,12,0,-9)}function ce(a){S(this,a,!0)}function de(a){S(this,a,!(this.m&32768))}function ee(a){S(this,a,this.m&32768?2:0)}
|
||||
function V(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function fe(a){var b=bd(this,a);a=ed(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ge(a){var b=ad(this,a);a=dd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);Tc(this,c,a,b);this.a-=this.h?4+(this.M&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}
|
||||
function he(a){var b=ed(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.m=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.b[a]=d&65535,this.b[a|1]=c-d*b&65535,this.o=d>>16|d,this.w=d>>16):(this.m=32768,this.o=d>>15|d,this.w=c>>16,-1===b&&65534===this.b[a]&&(this.b[a]=this.b[a|1]=1));this.a-=53}else this.o=this.w=0,this.m=32768,this.v=65536,this.a-=7}function ie(){J(this,24,0,-9);this.a-=20}
|
||||
function je(){this.i&49152?(this.G|=128,J(this,4,0,-8)):(this.la&&1120==this.wa&&this.la.setData(this.b[0],!0),this.D?this.D.i():G(this));this.a-=7}function ke(){J(this,16,0,-9);this.a-=20}var le=[0,7,7,10,7,11,9,13];function me(a){this.W=this.a;P(this,cd(this,a));this.a=this.W-le[this.h]}var ne=[0,14,14,17,14,18,16,20];function oe(a){this.W=this.a;var b=cd(this,a);a=a>>6&7;Uc(this,this.b[a]);this.b[a]=this.b[7];P(this,b);this.a=this.W-ne[this.h]}var pe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function qe(a){var b=bd(this,a);this.W=this.a;gd(this,a,b,this.ba);this.a=this.W-pe[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function re(a){var b=ad(this,a);fd(this,a,b,65535,this.ba);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var se=[7,13,13,17,14,18,17,21];
|
||||
function te(a){var b=ed(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.b[a];c&32768&&(c|=-65536);b=~~(b*c);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767<b?65536:0;this.a-=23}function ue(){this.a-=5}function ve(){this.i&49152||(this.s.reset(),pb(this),this.la&&this.la.setData(this.b[0],!0));this.a-=667}function we(a){if(a&8)K(this,8,0,-9);else{var b=Wc(this);a&=7;7==a?Q(this,b):(Q(this,this.b[a]),this.b[a]=b);this.a-=9}}
|
||||
function xe(){Vc(this);this.a-=13}function X(a){a&1&&(this.v=65536);a&2&&(this.m=32768);a&4&&(this.o=0);a&8&&(this.w=32768);this.a-=5}function ye(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)Q(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ze(a){U(this,a,bd(this,a),Dd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ae(a){U(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}function Be(){K(this,28,0,-9)}
|
||||
function Ce(){this.la&&(this.la.ha=this.b[7],this.la.setData(this.b[0],!0));this.g|=8;Qc(this,-2);this.a-=3}function De(a){U(this,a,this.b[(a>>6&7)+this.Kb],Gd);this.a-=this.h?9:3+(7==this.f?2:0)}function Y(){K(this,8,0,-9)}function Mc(a){Ee[a>>12].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a&15].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)}
|
||||
function te(a){var b=ed(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.b[a];c&32768&&(c|=-65536);b=~~(b*c);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;this.w=b>>16;this.o=this.w|b;this.m=0;this.v=-32768>b||32767<b?65536:0;this.a-=23}function ue(){this.a-=5}function ve(){this.i&49152||(this.s.reset(),pb(this),this.la&&this.la.setData(this.b[0],!0));this.a-=667}function we(a){if(a&8)J(this,8,0,-9);else{var b=Wc(this);a&=7;7==a?P(this,b):(P(this,this.b[a]),this.b[a]=b);this.a-=9}}
|
||||
function xe(){Vc(this);this.a-=13}function W(a){a&1&&(this.v=65536);a&2&&(this.m=32768);a&4&&(this.o=0);a&8&&(this.w=32768);this.a-=5}function ye(a){var b=(a&448)>>6;if(this.b[b]=this.b[b]-1&65535)P(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ze(a){U(this,a,bd(this,a),Dd);this.a-=this.h?9+(this.M&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ae(a){U(this,a,0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)}function Be(){J(this,28,0,-9)}
|
||||
function Ce(){this.la&&(this.la.ha=this.b[7],this.la.setData(this.b[0],!0));this.g|=8;Qc(this,-2);this.a-=3}function De(a){U(this,a,this.b[(a>>6&7)+this.Kb],Gd);this.a-=this.h?9:3+(7==this.f?2:0)}function Y(){J(this,8,0,-9)}function Mc(a){Ee[a>>12].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a&15].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)}
|
||||
function Re(a){Se[a>>6&3].call(this,a)}function Te(a){Ue[a>>6&3].call(this,a)}
|
||||
var Ee=[function(a){Ve[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,Y,function(a){We[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],Ve=[function(a){Xe[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,Y,Y,Y],Ge=[function(a){gd(this,a,0,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,1,td);this.a-=this.h?9:3+(7==this.f?2:0)}],Ie=[function(a){U(this,a,0,xd);
|
||||
this.a-=this.h?11:6},function(a){U(this,a,S(this)?1:0,hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,S(this)?1:0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=ed(this,a);this.Ea(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Ke=[function(a){U(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,zd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,jd);this.a-=this.h?9:3+(7==this.f?2:0)}],Xe=[function(a){Ye[a&
|
||||
15].call(this,a)},Y,Y,Y,me,me,me,me,we,Y,Le,Ne,Ae,Ae,Ae,Ae],Ye=[je,Ce,xe,be,ke,ve,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Me=[ue,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},W,function(){this.o=1;this.a-=5},W,W,W,function(){this.w=0;this.a-=5},W,W,W,W,W,W,W],Oe=[ue,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},X,function(){this.o=0;this.a-=5},X,X,X,function(){this.w=32768;this.a-=5},X,X,X,X,X,X,X],We=[ae,Zd,Vd,Xd,de,ee,Kd,Ld,ie,Be,Pe,Re,Te,Y,Y,Y],Qe=[function(a){fd(this,a,0,
|
||||
255,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ud);this.a-=this.h?9:3+(7==this.f?2:0)}],Se=[function(a){T(this,a,0,yd);this.a-=this.h?11:6},function(a){T(this,a,S(this)?1:0,id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,S(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=dd(this,a);this.Ea(a<<8);this.a-=this.h?4:3+(7==this.f?
|
||||
this.a-=this.h?11:6},function(a){U(this,a,R(this)?1:0,hd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,R(this)?1:0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=ed(this,a);this.Ea(a);this.a-=this.h?4:3+(7==this.f?2:0)}],Ke=[function(a){U(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,zd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ld);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){U(this,a,0,jd);this.a-=this.h?9:3+(7==this.f?2:0)}],Xe=[function(a){Ye[a&
|
||||
15].call(this,a)},Y,Y,Y,me,me,me,me,we,Y,Le,Ne,Ae,Ae,Ae,Ae],Ye=[je,Ce,xe,be,ke,ve,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Me=[ue,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},V,function(){this.o=1;this.a-=5},V,V,V,function(){this.w=0;this.a-=5},V,V,V,V,V,V,V],Oe=[ue,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},W,function(){this.o=0;this.a-=5},W,W,W,function(){this.w=32768;this.a-=5},W,W,W,W,W,W,W],We=[ae,Zd,Vd,Xd,de,ee,Kd,Ld,ie,Be,Pe,Re,Te,Y,Y,Y],Qe=[function(a){fd(this,a,0,
|
||||
255,this.Ea);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ud);this.a-=this.h?9:3+(7==this.f?2:0)}],Se=[function(a){T(this,a,0,yd);this.a-=this.h?11:6},function(a){T(this,a,R(this)?1:0,id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,R(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=dd(this,a);this.Ea(a<<8);this.a-=this.h?4:3+(7==this.f?
|
||||
2:0)}],Ue=[function(a){T(this,a,0,Cd);this.a-=this.h?9+(this.Cb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){T(this,a,0,md);this.a-=this.h?9+(this.Cb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,kd);this.a-=this.h?9:3+(7==this.f?2:0)}];function Nc(a){Ze[a>>12].call(this,a)}
|
||||
var Ze=[function(a){$e[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,function(a){af[a>>8&15].call(this,a)},function(a){bf[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],$e=[function(a){cf[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.qa);Q(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=Zc(this,a,0);this.ba(a);Uc(this,a);this.a-=11},function(a){var b=Wc(this);this.W=
|
||||
this.a;this.ba(b);$c(this,a,0,b);this.a=this.W-se[this.h]},function(a){gd(this,a,Pc(this)?65535:0,this.ba);this.a-=this.h?9:3+(7==this.f?2:0)}],cf=[function(a){ef[a&15].call(this,a)},Y,Y,Y,me,me,me,me,we,function(a){a&8?(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5):K(this,8,0,-9)},Le,Ne,Ae,Ae,Ae,Ae],ef=[je,Ce,function(){Vc(this);this.g|=this.i&16;this.a-=13},be,ke,ve,xe,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],af=[te,te,he,he,Id,Id,Jd,Jd,De,De,Y,Y,Y,Y,ye,ye],bf=[ae,
|
||||
var Ze=[function(a){$e[a>>8&15].call(this,a)},qe,fe,Qd,Md,Od,Hd,function(a){af[a>>8&15].call(this,a)},function(a){bf[a>>8&15].call(this,a)},re,ge,Rd,Nd,Pd,ze,Y],$e=[function(a){cf[a>>4&15].call(this,a)},ce,$d,Sd,Td,Yd,Ud,Wd,oe,oe,Fe,He,Je,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.V(a|this.qa);P(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=Zc(this,a,0);this.ba(a);Uc(this,a);this.a-=11},function(a){var b=Wc(this);this.W=
|
||||
this.a;this.ba(b);$c(this,a,0,b);this.a=this.W-se[this.h]},function(a){gd(this,a,Pc(this)?65535:0,this.ba);this.a-=this.h?9:3+(7==this.f?2:0)}],cf=[function(a){ef[a&15].call(this,a)},Y,Y,Y,me,me,me,me,we,function(a){a&8?(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5):J(this,8,0,-9)},Le,Ne,Ae,Ae,Ae,Ae],ef=[je,Ce,function(){Vc(this);this.g|=this.i&16;this.a-=13},be,ke,ve,xe,function(){J(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],af=[te,te,he,he,Id,Id,Jd,Jd,De,De,Y,Y,Y,Y,ye,ye],bf=[ae,
|
||||
Zd,Vd,Xd,de,ee,Kd,Ld,ie,Be,Pe,Re,Te,function(a){ff[a>>6&3].call(this,a)},Y,Y],ff=[Y,function(a){a=Zc(this,a,65536);this.ba(a);Uc(this,a);this.a-=11},function(a){var b=Wc(this);this.W=this.a;this.ba(b);$c(this,a,65536,b);this.a=this.W-se[this.h]},Y];
|
||||
function gf(a){A.call(this,"ROM",a,0,128);this.ea=this.b=null;this.h=a.addr;this.a=a.size;this.i=!1;this.g=a.alias;this.f=a.file;this.m=v(this.f);if(this.f){a=this.f;var b=ka(this.m);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;x(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(Ma(c.Ha,a,b),(a=sa(a,b))?(c.b=a.N,c.ea=a.ea):c.f=null);hf(c)})}}n(gf,A);h=gf.prototype;
|
||||
function gf(a){z.call(this,"ROM",a,0,128);this.ea=this.b=null;this.h=a.addr;this.a=a.size;this.i=!1;this.g=a.alias;this.f=a.file;this.m=u(this.f);if(this.f){a=this.f;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.f=null):(Ma(c.Ha,a,b),(a=ta(a,b))?(c.b=a.N,c.ea=a.ea):c.f=null);hf(c)})}}n(gf,z);h=gf.prototype;
|
||||
h.X=function(a,b,c,d){this.s=b;this.c=c;this.D=d;hf(this)};h.Y=function(){this.ea&&(this.D&&this.D.a(this.id,this.h,this.a,this.ea),delete this.ea);return!0};h.ga=function(){return!0};
|
||||
function hf(a){if(!Ra(a)){if(a.f){if(!a.b||!a.s)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)Qa(a,"ROM size ("+u(a.b.length,8,!0)+") does not match specified size ("+u(a.a,8,!0)+")");else{var b;a:{b=a.h;a.status(a.a+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Gb){var c={};b=(c[b]=[gf.prototype.ee,gf.prototype.nf,null,null,null,a.a>>1],c);if(db(a.s,a,b)){b=a.i=!0;break a}}else if(Mb(a.s,b,a.a,mc)){for(c=0;c<a.b.length;c++)Tb(a.s,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?b.push(a.g):
|
||||
null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.s,g=d.a,k=[],l=d.h>>>f.b;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.f;f=d.s;d=d.a;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.f}}a.i||delete a.b}}}G(a)}}h.ee=function(a){return this.b[a-this.h]};h.nf=function(){};Ea(function(){for(var a=F(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new gf(d);E(d,c)}});
|
||||
function jf(a){A.call(this,"RAM",a);this.ea=this.b=null;this.f=a.addr;this.g=a.size;this.ja=a.load;this.ia=a.exec;this.h=!1;this.a=a.file;this.i=v(this.a);if(this.a){a=this.a;var b=ka(this.i);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;x(a,null,!0,function(a,b,f){f?(c.B("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(Ma(c.Ha,a,b),(a=sa(a,b))?(c.b=a.N,c.ea=a.ea,null==c.ja&&(c.ja=a.ja),null==c.ia&&(c.ia=a.ia)):c.a=null);kf(c)})}}
|
||||
n(jf,A);jf.prototype.X=function(a,b,c,d){this.s=b;this.c=c;this.D=d;kf(this)};jf.prototype.Y=function(){this.ea&&(this.D&&this.D.a(this.id,this.f,this.g,this.ea),delete this.ea);return!0};jf.prototype.ga=function(){return!0};function kf(a){if(a.s&&(!a.h&&a.g&&(Mb(a.s,a.f,a.g,Wb)?a.h=!0:a.g=0),!Ra(a))){if(!a.h)z("No RAM allocated");else if(a.a){if(!a.b||!a.s)return;lf(a,a.b,a.ja,a.ia,a.f)}G(a)}}
|
||||
function hf(a){if(!Ra(a)){if(a.f){if(!a.b||!a.s)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a)Qa(a,"ROM size ("+ka(a.b.length,8,!0)+") does not match specified size ("+ka(a.a,8,!0)+")");else{var b;a:{b=a.h;a.status(a.a+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Gb){var c={};b=(c[b]=[gf.prototype.ee,gf.prototype.nf,null,null,null,a.a>>1],c);if(db(a.s,a,b)){b=a.i=!0;break a}}else if(Mb(a.s,b,a.a,mc)){for(c=0;c<a.b.length;c++)Tb(a.s,b+c,a.b[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?b.push(a.g):
|
||||
null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.s,g=d.a,k=[],l=d.h>>>f.b;0<g&&l<f.a.length;)k.push(f.a[l++]),g-=f.f;f=d.s;d=d.a;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=k[g++];if(!l)break;f.a[e++]=l;d-=f.f}}a.i||delete a.b}}}F(a)}}h.ee=function(a){return this.b[a-this.h]};h.nf=function(){};Ea(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new gf(d);D(d,c)}});
|
||||
function jf(a){z.call(this,"RAM",a);this.ea=this.b=null;this.f=a.addr;this.g=a.size;this.ja=a.load;this.ia=a.exec;this.h=!1;this.a=a.file;this.i=u(this.a);if(this.a){a=this.a;var b=la(this.i);"json"!=b&&"hex"!=b&&(a=ua()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.B("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(Ma(c.Ha,a,b),(a=ta(a,b))?(c.b=a.N,c.ea=a.ea,null==c.ja&&(c.ja=a.ja),null==c.ia&&(c.ia=a.ia)):c.a=null);kf(c)})}}
|
||||
n(jf,z);jf.prototype.X=function(a,b,c,d){this.s=b;this.c=c;this.D=d;kf(this)};jf.prototype.Y=function(){this.ea&&(this.D&&this.D.a(this.id,this.f,this.g,this.ea),delete this.ea);return!0};jf.prototype.ga=function(){return!0};function kf(a){if(a.s&&(!a.h&&a.g&&(Mb(a.s,a.f,a.g,Wb)?a.h=!0:a.g=0),!Ra(a))){if(!a.h)y("No RAM allocated");else if(a.a){if(!a.b||!a.s)return;lf(a,a.b,a.ja,a.ia,a.f)}F(a)}}
|
||||
jf.prototype.reset=function(){if(this.h){for(var a=this.s,b=this.f,c=this.g,d=b&a.h,b=b>>>a.b;0<c&&b<a.a.length;){var e=a.a[b],f=c,g=0,k,d=d||0,g=(g||0)&255;void 0===f&&(f=e.size);if(Ya&&e.b)for(k=d;f--&&k<e.b.length;k++)e.b[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ob(d,g,e.Oa+d);c-=a.f;b++;d=0}this.b&&lf(this,this.b,this.ja,this.ia,this.f,!0)}};
|
||||
function lf(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),w=l,y=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)Tb(a.s,t++,b[w++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
|
||||
b.length;e++)Tb(a.s,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.c),f=!1;null!=d&&Oc(a.c,d,f)}return k}Ea(function(){for(var a=F(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new jf(d);E(d,c)}});function mf(a){A.call(this,"Keyboard",a,0,1024);G(this)}n(mf,A);mf.prototype.aa=function(){return!1};mf.prototype.X=function(a,b,c,d){this.A=a;this.c=c;this.D=d};Ea(function(){for(var a=F(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new mf(d);E(d,c)}});
|
||||
function Z(a){A.call(this,"SerialPort",a,0,262144);this.v=a.adapter;this.I=a.baudReceive||9600;this.da=a.baudTransmit||9600;this.ca=a.upperCase;this.f=this.i=null;this.M=a.tabSize;this.K=a.charBOL;this.m=0;this.u=!0;this.G=this.w=null;this.H=this.W=-1;this.o=this.a=this.b=0;this.g=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=nf;b&&(void 0===c&&(c="Panel"),(c=Pa(c,this.id))&&(b=c.j[b])&&this.aa(null,a,b))}this.h=this.C=this.F=null;this.exports={connect:this.Bc,receiveData:this.Gb,receiveStatus:this.xe}}
|
||||
n(Z,A);h=Z.prototype;
|
||||
function lf(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),x=l,w=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(w)for(;w--;)Tb(a.s,t++,b[x++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
|
||||
b.length;e++)Tb(a.s,c+e,b[e]);k=!0}if(k){if(null==d||g)G(a.c),f=!1;null!=d&&Oc(a.c,d,f)}return k}Ea(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new jf(d);D(d,c)}});function mf(a){z.call(this,"Keyboard",a,0,1024);F(this)}n(mf,z);mf.prototype.aa=function(){return!1};mf.prototype.X=function(a,b,c,d){this.A=a;this.c=c;this.D=d};Ea(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new mf(d);D(d,c)}});
|
||||
function Z(a){z.call(this,"SerialPort",a,0,262144);this.v=a.adapter;this.I=a.baudReceive||9600;this.da=a.baudTransmit||9600;this.ca=a.upperCase;this.f=this.i=null;this.M=a.tabSize;this.K=a.charBOL;this.m=0;this.u=!0;this.G=this.w=null;this.H=this.W=-1;this.o=this.a=this.b=0;this.g=[];var b=a.binding;if("console"==b)this.i="";else{var c;a=nf;b&&(void 0===c&&(c="Panel"),(c=Pa(c,this.id))&&(b=c.j[b])&&this.aa(null,a,b))}this.h=this.C=this.F=null;this.exports={connect:this.Bc,receiveData:this.Gb,receiveStatus:this.xe}}
|
||||
n(Z,z);h=Z.prototype;
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case nf:return this.j[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.lc:q.Mc:46==c?b=q.lc:a.ctrlKey&&c>=q.kc&&c<=q.Xc&&(b=c-(q.kc-q.Jc));b&&(a.preventDefault&&a.preventDefault(),d.Gb(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Lc&&(b=q.Kc);d.Gb(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
||||
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Gb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;var e=this;this.G=cc(this.c,this.v?-1:48,4,262144);this.H=ac(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.ca&&97<=a&&122>a&&(a-=32),bc(e.c,e.H,1E3/Math.round(e.I/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&M(c,e.G))});this.w=cc(this.c,this.v?-1:52,4,262144);this.W=ac(this.c,function(){e.b|=128;e.b&64&&M(c,e.w)});db(b,this,of,this.v?64832+8*(this.v-1)-65392:0);fb(b,this.reset.bind(this));G(this)};
|
||||
h.Bc=function(a){if(!this.h){var b=Bc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.Ga)return;c=oa(c[1]);if(this.h=Oa(c)){var e=this.h.exports;if(e){var f=e.connect;f&&f.call(this.h,this.u);if(this.C=e.receiveData){this.u=a;this.F=e.receiveStatus;this.status(this.Ha+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
h.Y=function(a,b){if(!b)if(this.Bc(this.u),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){pf(this)};h.save=function(){var a=new R(this);a.set(0,[]);return a.data()};h.restore=function(){return pf(this)};function pf(a){a.o=0;a.a=8192;a.b=128;a.g=[];return!0}
|
||||
h.Gb=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.g.push(b)}else this.g=this.g.concat(a);bc(this.c,this.H,1E3/Math.round(this.I/10));return!0};h.xe=function(a){var b=this.a;this.a&=-12289;a&32&&(this.a|=8192);a&256&&(this.a|=4096);b!=this.a&&(this.a|=32768,this.a&32&&M(this.c,this.G))};h.Sd=function(){var a=this.a&65534;this.a&=-32769;return a};
|
||||
h.$e=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.F&&b&6&&(b=0,b=this.u?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.F.call(this.h,b))};h.Rd=function(){this.a&=-129;return this.o};h.Ze=function(){};h.we=function(){return this.b};h.Gf=function(a){if(this.b&128)if(a&64)M(this.c,this.w);else{var b=this.w;b&&ec(this.c,b)}this.b=this.b&-70|a&69};h.ve=function(){return 0};
|
||||
h.Ff=function(a){a&=255;this.C&&this.C.call(this.h,a);a&=127;if(this.f)if(13==a)this.m=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.m&&this.m--;else{if(a){var b;b=(b=13!=a&&10!=a?pa[a]:null)?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.M||8,c=a-this.m%a,this.M&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;var e=this;this.G=cc(this.c,this.v?-1:48,4,262144);this.H=ac(this.c,function(){var a;a=-1;e.g.length&&(a=e.g.shift()&255,e.ca&&97<=a&&122>a&&(a-=32),bc(e.c,e.H,1E3/Math.round(e.I/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&L(c,e.G))});this.w=cc(this.c,this.v?-1:52,4,262144);this.W=ac(this.c,function(){e.b|=128;e.b&64&&L(c,e.w)});db(b,this,of,this.v?64832+8*(this.v-1)-65392:0);fb(b,this.reset.bind(this));F(this)};
|
||||
h.Bc=function(a){if(!this.h){var b=Bc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=pa(c[0]);if(d!=this.Ga)return;c=pa(c[1]);if(this.h=Oa(c)){var e=this.h.exports;if(e){var f=e.connect;f&&f.call(this.h,this.u);if(this.C=e.receiveData){this.u=a;this.F=e.receiveStatus;this.status(this.Ha+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
h.Y=function(a,b){if(!b)if(this.Bc(this.u),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){pf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return pf(this)};function pf(a){a.o=0;a.a=8192;a.b=128;a.g=[];return!0}
|
||||
h.Gb=function(a){if("number"==typeof a)this.g.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.g.push(b)}else this.g=this.g.concat(a);bc(this.c,this.H,1E3/Math.round(this.I/10));return!0};h.xe=function(a){var b=this.a;this.a&=-12289;a&32&&(this.a|=8192);a&256&&(this.a|=4096);b!=this.a&&(this.a|=32768,this.a&32&&L(this.c,this.G))};h.Sd=function(){var a=this.a&65534;this.a&=-32769;return a};
|
||||
h.$e=function(a){var b=a^this.a;this.a=this.a&-112|a&111;this.F&&b&6&&(b=0,b=this.u?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.F.call(this.h,b))};h.Rd=function(){this.a&=-129;return this.o};h.Ze=function(){};h.we=function(){return this.b};h.Gf=function(a){if(this.b&128)if(a&64)L(this.c,this.w);else{var b=this.w;b&&ec(this.c,b)}this.b=this.b&-70|a&69};h.ve=function(){return 0};
|
||||
h.Ff=function(a){a&=255;this.C&&this.C.call(this.h,a);a&=127;if(this.f)if(13==a)this.m=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.m&&this.m--;else{if(a){var b;13!=a&&10!=a&&(b=qa[a]);b=b?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.M||8,c=a-this.m%a,this.M&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=
|
||||
this.i){if(10==a||1024<=this.i.length)this.U(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}bc(this.c,this.W,1E3/Math.round(this.da/10));this.b&=-129};var nf="buffer",qf={},of=(qf[65392]=[null,null,Z.prototype.Sd,Z.prototype.$e,"RCSR"],qf[65394]=[null,null,Z.prototype.Rd,Z.prototype.Ze,"RBUF"],qf[65396]=[null,null,Z.prototype.we,Z.prototype.Gf,"XCSR"],qf[65398]=[null,null,Z.prototype.ve,Z.prototype.Ff,"XBUF"],qf);
|
||||
Ea(function(){for(var a=F(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Z(d);E(d,c)}});function jc(a){A.call(this,"PC11",a);this.C=rf(this,a.autoMount);this.b=0;this.I=a.baudReceive||3600;this.m=this.o=this.a=0;this.i=[];this.h=sf;this.f=tf;this.w=this.g="";this.N=this.ja=this.ia=null;this.G=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window;this.u=null;this.H=-1;this.v=null}n(jc,A);
|
||||
function rf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){z(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=jc.prototype;
|
||||
h.aa=function(a,b,c){var d=this,e=tf;switch(b){case "listTapes":return this.j[b]=c,c.onchange=function(){var a=d.j.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){z("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.j[b]=c,!0;case "readTape":e=uf;case "loadTape":return e||(e=vf),this.j[b]=c,c.onclick=
|
||||
function(){var a=d.j.listTapes;a&&wf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;wf(d,v(b,!0),b,vf,a)}return!1};return!0;case xf:return this.j[b]=c,!0}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;this.v=yf(a);var e=this;if(a=rf(this,Bc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.u=cc(this.c,56,4,4096);this.H=ac(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.m<e.i.length&&(e.o=e.i[e.m++]&255,zf(e,e.m/e.i.length*100),e.a|=128,e.a&=-2049,e.a&64&&M(e.c,e.u))});db(b,this,Af);fb(b,this.reset.bind(this));Bf(this,"None",sf,!0);this.F&&Bf(this,"Local Tape",Cf);Bf(this,"Remote Tape",Df);Ef(this)||G(this)};
|
||||
h.Y=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){this.a&=-2241;this.o=0};function Ef(a){a.b=0;var b=a.C.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.j.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=v(c,!0)}c&&b?Ff(a,b,c,vf,!0):Gf(a)}return!!a.b}
|
||||
function wf(a,b,c,d,e){if(c)if(c==Cf)a.B('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Df){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=v(c);a.status("Attempting to load "+c+' as "'+b+'"');a.h=Df}else a.h=c;Ff(a,b,c,d,!1,e)}else Hf(a,!1)}function Ff(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,Hf(a,!0),a.l.Pa?a.B("PC11 busy"):(e&&a.b++,If(a,b,c,d,f)?g++:a.l.Pa=!0);g&&Jf(a,a.w,a.g,a.f,a.N,a.ja,a.ia)}
|
||||
function If(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),Jf(a,b,c,d,e),a.h=Cf);Gf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!x(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ma(a.Ha,e,f),(e=sa(e,f))&&Jf(a,b,c,d,e.N,e.ja,e.ia));
|
||||
a.l.Pa=!1;a.b&&(a.b--,a.b||G(a));Gf(a)})}function Bf(a,b,c,d){if((a=a.j.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 Gf(a){var b=a.j.listTapes;if(b&&b.options){a=a.h||a.g;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 zf(a,b){b|=0;if(b!==a.G){var c=a.j[xf];c&&(c=(c=F(c,Kf))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Jf(a,b,c,d,e,f,g){a.w=b;a.g=c;a.f=d;a.N=e;a.ja=f;a.ia=g;d==uf?a.v&&lf(a.v,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.B('No valid memory address for tape "'+b+'"'):(a.m=0,a.i=e,a.status('Loaded tape "'+b+'"'),zf(a,0))}function Hf(a,b){if(a.g||!1===b)a.w="",a.g="",b||(a.f&&a.status(a.f==vf?"tape detached":"tape unloaded"),a.h=sf,a.f=tf,Gf(a))}h.save=function(){return(new R(this)).data()};
|
||||
h.restore=function(){return!0};h.Ld=function(){return this.a&65534};h.Te=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&M(this.c,this.u)):(this.a&=-129,this.a|=2048,this.o=0,bc(this.c,this.H,1E3/Math.round(this.I/10))));this.a=this.a&-66|a&65};h.Kd=function(){this.a&=-129;this.a|=2048;return this.o};h.Se=function(){};
|
||||
Ea(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Z(d);D(d,c)}});function jc(a){z.call(this,"PC11",a);this.C=rf(this,a.autoMount);this.b=0;this.I=a.baudReceive||3600;this.m=this.o=this.a=0;this.i=[];this.h=sf;this.f=tf;this.w=this.g="";this.N=this.ja=this.ia=null;this.G=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window;this.u=null;this.H=-1;this.v=null}n(jc,z);
|
||||
function rf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=jc.prototype;
|
||||
h.aa=function(a,b,c){var d=this,e=tf;switch(b){case "listTapes":return this.j[b]=c,c.onchange=function(){var a=d.j.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){y("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.j[b]=c,!0;case "readTape":e=uf;case "loadTape":return e||(e=vf),this.j[b]=c,c.onclick=
|
||||
function(){var a=d.j.listTapes;a&&wf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;wf(d,u(b,!0),b,vf,a)}return!1};return!0;case xf:return this.j[b]=c,!0}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;this.v=yf(a);var e=this;if(a=rf(this,Bc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.u=cc(this.c,56,4,4096);this.H=ac(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.m<e.i.length&&(e.o=e.i[e.m++]&255,zf(e,e.m/e.i.length*100),e.a|=128,e.a&=-2049,e.a&64&&L(e.c,e.u))});db(b,this,Af);fb(b,this.reset.bind(this));Bf(this,"None",sf,!0);this.F&&Bf(this,"Local Tape",Cf);Bf(this,"Remote Tape",Df);Ef(this)||F(this)};
|
||||
h.Y=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){this.a&=-2241;this.o=0};function Ef(a){a.b=0;var b=a.C.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.j.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=u(c,!0)}c&&b?Ff(a,b,c,vf,!0):Gf(a)}return!!a.b}
|
||||
function wf(a,b,c,d,e){if(c)if(c==Cf)a.B('Use "Choose File" and "Mount" to select and load a local tape.');else{if(c==Df){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"');a.h=Df}else a.h=c;Ff(a,b,c,d,!1,e)}else Hf(a,!1)}function Ff(a,b,c,d,e,f){var g=-1;if(a.g.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,Hf(a,!0),a.l.Pa?a.B("PC11 busy"):(e&&a.b++,If(a,b,c,d,f)?g++:a.l.Pa=!0);g&&Jf(a,a.w,a.g,a.f,a.N,a.ja,a.ia)}
|
||||
function If(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),Jf(a,b,c,d,e),a.h=Cf);Gf(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!!v(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.l.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ma(a.Ha,e,f),(e=ta(e,f))&&Jf(a,b,c,d,e.N,e.ja,e.ia));
|
||||
a.l.Pa=!1;a.b&&(a.b--,a.b||F(a));Gf(a)})}function Bf(a,b,c,d){if((a=a.j.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 Gf(a){var b=a.j.listTapes;if(b&&b.options){a=a.h||a.g;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 zf(a,b){b|=0;if(b!==a.G){var c=a.j[xf];c&&(c=(c=E(c,Kf))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Jf(a,b,c,d,e,f,g){a.w=b;a.g=c;a.f=d;a.N=e;a.ja=f;a.ia=g;d==uf?a.v&&lf(a.v,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.B('No valid memory address for tape "'+b+'"'):(a.m=0,a.i=e,a.status('Loaded tape "'+b+'"'),zf(a,0))}function Hf(a,b){if(a.g||!1===b)a.w="",a.g="",b||(a.f&&a.status(a.f==vf?"tape detached":"tape unloaded"),a.h=sf,a.f=tf,Gf(a))}h.save=function(){return(new Q(this)).data()};
|
||||
h.restore=function(){return!0};h.Ld=function(){return this.a&65534};h.Te=function(a){a&1&&(this.a&32768?(a&=-2,this.a&64&&L(this.c,this.u)):(this.a&=-129,this.a|=2048,this.o=0,bc(this.c,this.H,1E3/Math.round(this.I/10))));this.a=this.a&-66|a&65};h.Kd=function(){this.a&=-129;this.a|=2048;return this.o};h.Se=function(){};
|
||||
var sf="",Cf="?",Df="??",tf=0,vf=1,uf=2,xf="readProgress",Kf="pcjs-progress-bar",Lf={},Af=(Lf[65384]=[null,null,jc.prototype.Ld,jc.prototype.Te,"PRS"],Lf[65386]=[null,null,jc.prototype.Kd,jc.prototype.Se,"PRB"],Lf);
|
||||
function Mf(a,b,c){A.call(this,"Disk",{id:a.Ha+".disk"+u(++Nf,4)},0,8192);this.controller=a;this.A=a.A;this.D=a.D;this.h=b;this.ka=b.name;this.Z=this.Hb="";this.wb=b.wb;this.J=this.O=this.L=this.T=this.mode=0;this.a=[];this.f=null;this.g=!1;Of(this,c,b.J,b.O,b.L,b.T);this.b=this.i=null;G(this)}n(Mf,A);h=Mf.prototype;h.X=function(a,b,c,d){this.D=d};
|
||||
function Mf(a,b,c){z.call(this,"Disk",{id:a.Ha+".disk"+ka(++Nf,4)},0,8192);this.controller=a;this.A=a.A;this.D=a.D;this.h=b;this.ka=b.name;this.Z=this.Hb="";this.wb=b.wb;this.J=this.O=this.L=this.T=this.mode=0;this.a=[];this.f=null;this.g=!1;Of(this,c,b.J,b.O,b.L,b.T);this.b=this.i=null;F(this)}n(Mf,z);h=Mf.prototype;h.X=function(a,b,c,d){this.D=d};
|
||||
function Of(a,b,c,d,e,f){a.mode=b;a.J=c;a.O=d;a.L=e;a.T=f;a.a=[];if("preload"!=a.mode){b=Array(a.J);for(c=0;c<b.length;c++){d=Array(a.O);for(e=0;e<d.length;e++){f=Array(a.L);for(var g=1;g<=f.length;g++)f[g-1]=Pf(null,c,e,g,a.T,0);d[e]=f}b[c]=d}a.a=b}a.f=null}
|
||||
function Qf(a,b,c,d,e){var f=c;if(a.b)return!0;a.ka=b;a.Z=c;a.Hb=v(c);a.b=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.J=e[0];a.O=e[1];a.L=e[2];a.T=e[3]||512;c=a.T>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.O),y=0;y<w.length;y++)for(var xa=w[y]=Array(a.L),ya=0;ya<xa.length;ya++){for(var $b=Pf(null,d,y,ya+1,a.T,0),Mg=$b.data,tc=0;tc<c;tc++,f+=4)var Ng=Mg[tc]=b.getInt32(f,
|
||||
!0),e=e+Ng&-1;$b.fa=c;xa[ya]=$b}a.f=e;c=a}else a.B("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.ka,a.Z),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ka(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"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!x(f,
|
||||
function Qf(a,b,c,d,e){var f=c;if(a.b)return!0;a.ka=b;a.Z=c;a.Hb=u(c);a.b=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.J=e[0];a.O=e[1];a.L=e[2];a.T=e[3]||512;c=a.T>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.J);for(d=0;d<a.a.length;d++)for(var x=a.a[d]=Array(a.O),w=0;w<x.length;w++)for(var X=x[w]=Array(a.L),ya=0;ya<X.length;ya++){for(var $b=Pf(null,d,w,ya+1,a.T,0),Ng=$b.data,tc=0;tc<c;tc++,f+=4)var Og=Ng[tc]=b.getInt32(f,
|
||||
!0),e=e+Og&-1;$b.fa=c;X[ya]=$b}a.f=e;c=a}else a.B("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.h,c,a.ka,a.Z),a.b=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.wb?"":e)+"&format=json"));return!!v(f,
|
||||
null,!0,function(b,c,d){Rf(a,b,c,d)})}
|
||||
function Rf(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.R;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.ka+'" (error '+d+": "+b+")",f);else{Ma(a.controller.Ha,b,c);try{if(0<v(a.Hb,!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 k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ka]: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)z(k[0]);else{a.J=k.length;a.O=k[0].length;a.L=k[0][0].length;var l=k[0][0][0];a.T=l&&l.length||512;for(d=c=0;d<a.J;d++)for(f=0;f<a.O;f++)for(g=0;g<a.L;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var y=m<<2,xa=w.length;xa<y;xa++)w[xa]=p;Sf(l,w)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Pf(l,d,f);for(y=
|
||||
0;y<t.length;y++)c=c+t[y]&-1}a.a=k;a.f=c;e=a}else z("Empty disk image: "+a.ka)}catch(ya){z("Disk image error ("+b+"): "+ya.message)}}a.b&&(a.b.call(a.i,a.h,e,a.ka,a.Z),a.b=null)}function Pf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Hg=b;a.Ig=c;a.oa=a.fa=0;a.ua=!1;return a}
|
||||
function Rf(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.l.R;a.g=!1;if(d)a.controller.B('Unable to load disk "'+a.ka+'" (error '+d+": "+b+")",f);else{Ma(a.controller.Ha,b,c);try{if(0<u(a.Hb,!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 k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ka]: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)y(k[0]);else{a.J=k.length;a.O=k[0].length;a.L=k[0][0].length;var l=k[0][0][0];a.T=l&&l.length||512;for(d=c=0;d<a.J;d++)for(f=0;f<a.O;f++)for(g=0;g<a.L;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var x=l.bytes;if(void 0!==x&&x.length){for(var w=m<<2,X=x.length;X<w;X++)x[X]=p;Sf(l,x)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Pf(l,d,f);for(w=0;w<
|
||||
t.length;w++)c=c+t[w]&-1}a.a=k;a.f=c;e=a}else y("Empty disk image: "+a.ka)}catch(ya){y("Disk image error ("+b+"): "+ya.message)}}a.b&&(a.b.call(a.i,a.h,e,a.ka,a.Z),a.b=null)}function Pf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Hg=b;a.Ig=c;a.oa=a.fa=0;a.ua=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.h,g=this.a[a];if(g){var k=g[b];if(!k&&f.$c&&b<f.O)for(k=g[b]=Array(f.xc),g=0;g<k.length;g++)k[g]=Pf(null,a,b,g+1,f.Zb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.$c&&9==f.Xb&&(d=k[g]=Pf(null,a,b,f.Xb,f.Zb,0))}}e&&e(d,!1);return d};function Sf(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.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.fa?f<a.oa?(a.fa+=a.oa-f,a.oa=f):f>=a.oa+a.fa&&(a.fa+=f-(a.oa+a.fa)+1):(a.oa=f,a.fa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function Tf(a,b){var c=a.O*a.L,d=b/c|0;return d<a.J?(b%=c,a.seek(d,b/a.L|0,b%a.L+1)):null}function Uf(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 Vf(a){for(var b="",c=0,d;d=Tf(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(Uf(a,d,e));return btoa(b)}
|
||||
|
|
@ -207,72 +207,72 @@ h.save=function(){var a=0,b=[];b[a++]=[this.Z,this.f,this.J,this.O,this.L,this.T
|
|||
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?Of(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.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+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(k=this.a[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.oa=e;for(k.fa=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.B("Unable to restore disk '"+this.ka+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=Tf(this,a++);)Wf(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 Wf(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)}}var Nf=0;function P(a){A.call(this,"RK11",a,0,65536);this.o=Xf(this,a.autoMount);this.m=0;this.b=Array(8);this.u=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.w=this.g=this.a=this.i=this.h=this.f=this.v=0}n(P,A);
|
||||
function Xf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){z(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=P.prototype;
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){z("RK11 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.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&Yf(d,a)},
|
||||
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.vc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c);
|
||||
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),z(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,v(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=Xf(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);$f(this);this.Da=cc(this.c,144,5,65536);db(b,this,ag);fb(b,this.reset.bind(this));bg(this,"None",cg,!0);this.u&&bg(this,"Local Disk",dg);bg(this,"Remote Disk",eg);fg(this)||G(this)};
|
||||
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.b.length;a++)gg(this,a,!0);fg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new R(this)).data()};
|
||||
h.restore=function(a){return $f(this,a[0])};function fg(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.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=v(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)){!hg(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.m}
|
||||
function Zf(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==dg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==eg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=v(c);a.status("Attempting to load "+c+' as "'+b+'"')}hg(a,e,b,c,!1,d)}else gg(a,e)}
|
||||
function hg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,gg(a,b,!0),k.Ra?a.B("RK11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.m++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.m||G(this));Yf(this,a.Sa)};
|
||||
function Wf(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)}}var Nf=0;function O(a){z.call(this,"RK11",a,0,65536);this.o=Xf(this,a.autoMount);this.m=0;this.f=Array(8);this.u=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.w=this.b=this.a=this.i=this.h=this.g=this.v=0}n(O,z);
|
||||
function Xf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=O.prototype;
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("RK11 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.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&Yf(d,a)},
|
||||
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.f.length||!(a=d.f[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.vc(a,0,0,0,512,0,2))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.u){c.parentNode.removeChild(c);
|
||||
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.f&&((a=d.f[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),y(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.u)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=Xf(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.o[e]=a[e]);$f(this);this.Da=cc(this.c,144,5,65536);db(b,this,ag);fb(b,this.reset.bind(this));bg(this,"None",cg,!0);this.u&&bg(this,"Local Disk",dg);bg(this,"Remote Disk",eg);fg(this)||F(this)};
|
||||
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.f.length;a++)gg(this,a,!0);fg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new Q(this)).data()};
|
||||
h.restore=function(a){return $f(this,a[0])};function fg(a,b){b||(a.m=0);for(var c in a.o){var d=a.o[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.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=u(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)){!hg(a,g,f,e,!0)&&b&&F(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.m}
|
||||
function Zf(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.f.length)a.B("Unable to load the selected drive");else if(c)if(c==dg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==eg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}hg(a,e,b,c,!1,d)}else gg(a,e)}
|
||||
function hg(a,b,c,d,e,f){var g=-1,k=a.f[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,gg(a,b,!0),k.Ra?a.B("RK11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.m++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Pc)&&g++));return g}h.Pc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.m||F(this));Yf(this,a.Sa)};
|
||||
function bg(a,b,c,d){if((a=a.j.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 Yf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?dg:c.Z,!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 gg(a,b,c){var d=a.b[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RK"+b+" unloaded",c),Yf(a,b))}
|
||||
function $f(a,b){var c=0;b||(b=[]);a.w=b[c++]||2368;a.g=b[c++]||0;a.a=b[c++]||128;a.i=b[c++]||0;a.h=b[c++]||0;a.f=b[c++]||0;a.v=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.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=203;d.O=2;d.L=12;d.T=512;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=2368}return!0}
|
||||
h.vc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}var w,y;if(0>(w=a.read(p,t++))||0>(y=a.read(p,t++))){m=32;break}if(!k&&(yb(this.s,Xc(this.c,f),w|y<<8),Zb(this.s))){m=1024;break}t>=a.T&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Qc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){var w=Ab(this.s,Xc(this.c,f));if(Zb(this.s)){m=1024;break}f+=g;e--;if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}if(k){if(0>a.read(p,t++)||0>a.read(p,t++)){m=32;break}}else if(!a.write(p,t++,w&255)||!a.write(p,t++,w>>8)){m=32;break}t>=a.T&&(p=null)}return l?l(m,b,c,d,e,f):m};
|
||||
h.Oc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.f=this.f&-16|d&15;a&&(this.g=this.g|a|32768,this.a|=49152);return!0};h.Xd=function(){return this.w};h.ef=function(){};h.Yd=function(){return this.g};h.ff=function(){};h.Ud=function(){return this.a&61438};
|
||||
h.bf=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c=(this.f&57344)>>13,d=this.b[c],e,f,g,k,l,m;this.a&=-129;var p=this.a&14;switch(p){case 0:this.g=0;this.a=128;this.f=0;break;case 8:e=(this.f&8160)>>5;e>=d.J&&(this.g|=32832,this.a|=49152);break;case 10:case 4:b=this.vc;case 6:case 2:b||(b=this.Qc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,k=65536-this.i&65535,l=(this.a&48)<<12|this.h,m=this.a&2048?0:2,e>=d.J?(this.g|=32832,this.a|=49152):g>=d.L?(this.g|=32800,this.a|=49152):
|
||||
a=b.call(this,d,e,f,g,k,l,m,6<=p,this.Oc.bind(this))}this.w=d.status|(d.S?128:0)|c<<13|this.f&15;a&&(this.a&=-2,this.a|=128,this.a&64&&M(this.c,this.Da))}};h.Zd=function(){return this.i};h.gf=function(a){this.i=a};h.Td=function(){return this.h};h.af=function(a){this.h=a};h.Vd=function(){return this.f};h.cf=function(a){this.f=a};h.Wd=function(){return this.v};h.df=function(a){this.v=a};
|
||||
var cg="",dg="?",eg="??",ig={},ag=(ig[65280]=[null,null,P.prototype.Xd,P.prototype.ef,"RKDS"],ig[65282]=[null,null,P.prototype.Yd,P.prototype.ff,"RKER"],ig[65284]=[null,null,P.prototype.Ud,P.prototype.bf,"RKCS"],ig[65286]=[null,null,P.prototype.Zd,P.prototype.gf,"RKWC"],ig[65288]=[null,null,P.prototype.Td,P.prototype.af,"RKBA"],ig[65290]=[null,null,P.prototype.Vd,P.prototype.cf,"RKDA"],ig[65294]=[null,null,P.prototype.Wd,P.prototype.df,"RKDB"],ig);
|
||||
function O(a){A.call(this,"RL11",a,0,131072);this.u=jg(this,a.autoMount);this.o=0;this.b=Array(4);this.v=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.a=this.m=this.f=this.g=this.i=this.h=0}n(O,A);function jg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){z(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=O.prototype;
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){z("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.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&kg(d,a)},
|
||||
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&lg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.wc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c);
|
||||
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),z(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;lg(d,v(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=jg(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.u[e]=a[e]);mg(this);this.Da=cc(this.c,112,5,131072);db(b,this,ng);fb(b,this.reset.bind(this));og(this,"None",pg,!0);this.v&&og(this,"Local Disk",qg);og(this,"Remote Disk",rg);sg(this)||G(this)};
|
||||
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.b.length;a++)tg(this,a,!0);sg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.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";kg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){mg(this)};h.save=function(){return(new R(this)).data()};
|
||||
h.restore=function(a){return mg(this,a[0])};function sg(a,b){b||(a.o=0);for(var c in a.u){var d=a.u[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.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=v(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)){!ug(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.o}
|
||||
function lg(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==qg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==rg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=v(c);a.status("Attempting to load "+c+' as "'+b+'"')}ug(a,e,b,c,!1,d)}else tg(a,e)}
|
||||
function ug(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,tg(a,b,!0),k.Ra?a.B("RL11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.o++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Sc)&&g++));return g}h.Sc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.o||G(this));kg(this,a.Sa)};
|
||||
function og(a,b,c,d){if((a=a.j.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 kg(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?qg:c.Z,!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 tg(a,b,c){var d=a.b[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RL"+b+" unloaded",c),kg(a,b))}
|
||||
function mg(a,b){var c=0;b||(b=[]);a.a=b[c++]||129;a.m=b[c++]||0;a.f=b[c++]||0;a.g=b[c++]||0;a.i=b[c++]||0;a.h=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.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=512;d.O=2;d.L=40;d.T=256;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=29}return!0}
|
||||
function Yf(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?dg:c.Z,!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 gg(a,b,c){var d=a.f[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RK"+b+" unloaded",c),Yf(a,b))}
|
||||
function $f(a,b){var c=0;b||(b=[]);a.w=b[c++]||2368;a.b=b[c++]||0;a.a=b[c++]||128;a.i=b[c++]||0;a.h=b[c++]||0;a.g=b[c++]||0;a.v=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.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=203;d.O=2;d.L=12;d.T=512;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=2368}return!0}
|
||||
h.vc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}var x,w;if(0>(x=a.read(p,t++))||0>(w=a.read(p,t++))){m=32;break}if(!k&&(yb(this.s,Xc(this.c,f),x|w<<8),Zb(this.s))){m=1024;break}t>=a.T&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Qc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.S;var p=null,t;a||(m=128,e=0);for(;e;){var x=Ab(this.s,Xc(this.c,f));if(Zb(this.s)){m=1024;break}if(!p){if(b>=a.J){m=64;break}p=a.seek(b,c,d+1,!0);if(!p){m=4096;break}t=0;++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b))}if(k){var w,X;if(0>(w=a.read(p,t++))||0>(X=a.read(p,t++))){m=32;break}if(x!=(w|X<<8)){m=1;break}}else if(!a.write(p,t++,x&255)||!a.write(p,t++,x>>8)){m=32;break}t>=a.T&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m};
|
||||
h.Oc=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&-49|f>>12&48;this.i=65536-e&65535;this.g=this.g&-16|d&15;this.b|=a;ig(this);return!0};function ig(a){a.a&=-32769;a.b&&(a.b|=32768,a.a|=32768,a.b&32736&&(a.a|=16384))}h.Xd=function(){return this.w};h.ef=function(){};h.Yd=function(){return this.b};h.ff=function(){};h.Ud=function(){return this.a&61438};
|
||||
h.bf=function(a){this.a=this.a&-3968|a&3967;if(this.a&1){a=!0;var b,c,d=(this.g&57344)>>13,e=this.f[d],f,g,k,l,m,p;this.a&=-8321;this.b&=-4;switch(c=this.a&14){case 0:this.b=this.g=0;this.a=128;break;case 10:case 4:b=this.vc;case 6:case 2:b||(b=this.Qc);f=(this.g&8160)>>5;g=(this.g&16)>>4;k=this.g&15;l=65536-this.i&65535;m=(this.a&48)<<12|this.h;p=this.a&2048?0:2;if(f>=e.J){this.b|=64;break}if(k>=e.L){this.b|=32;break}a=b.call(this,e,f,g,k,l,m,p,6<=c,this.Oc.bind(this));break;case 8:f=(this.g&8160)>>
|
||||
5;f<e.J?this.a|=8192:this.b|=64;break;case 12:this.b=this.g=0,this.a=8320}this.w=e.status|(e.S?128:0)|d<<13|this.g&15;ig(this);a&&(this.a&=-2,this.a|=128,this.a&64&&L(this.c,this.Da))}};h.Zd=function(){return this.i};h.gf=function(a){this.i=a};h.Td=function(){return this.h};h.af=function(a){this.h=a};h.Vd=function(){return this.g};h.cf=function(a){this.g=a};h.Wd=function(){return this.v};h.df=function(a){this.v=a};
|
||||
var cg="",dg="?",eg="??",jg={},ag=(jg[65280]=[null,null,O.prototype.Xd,O.prototype.ef,"RKDS"],jg[65282]=[null,null,O.prototype.Yd,O.prototype.ff,"RKER"],jg[65284]=[null,null,O.prototype.Ud,O.prototype.bf,"RKCS"],jg[65286]=[null,null,O.prototype.Zd,O.prototype.gf,"RKWC"],jg[65288]=[null,null,O.prototype.Td,O.prototype.af,"RKBA"],jg[65290]=[null,null,O.prototype.Vd,O.prototype.cf,"RKDA"],jg[65294]=[null,null,O.prototype.Wd,O.prototype.df,"RKDB"],jg);
|
||||
function N(a){z.call(this,"RL11",a,0,131072);this.u=kg(this,a.autoMount);this.o=0;this.b=Array(4);this.v=!Ba("Mobi")&&window&&"FileReader"in window;this.Da=null;this.a=this.m=this.f=this.g=this.i=this.h=0}n(N,z);function kg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){y(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=N.prototype;
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){y("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.j[b]=c,c.onchange=function(){var a=r(c.value);null!=a&&lg(d,a)},
|
||||
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&mg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&r(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.B("Unable to boot the selected drive"):a.S?(Oc(d.c,0,!0),(a=d.wc(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.v){c.parentNode.removeChild(c);
|
||||
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.b&&((a=d.b[r(a.value)||0])?(a=a.S)?(a=Ca(Vf(a),a.Hb.replace(".json",".img")),y(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.v)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;mg(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.X=function(a,b,c,d){this.A=a;this.s=b;this.c=c;this.D=d;if(a=kg(this,Bc(this.A,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.u[e]=a[e]);ng(this);this.Da=cc(this.c,112,5,131072);db(b,this,og);fb(b,this.reset.bind(this));pg(this,"None",qg,!0);this.v&&pg(this,"Local Disk",rg);pg(this,"Remote Disk",sg);tg(this)||F(this)};
|
||||
h.Y=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.i){for(a=0;a<this.b.length;a++)ug(this,a,!0);tg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.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";lg(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){ng(this)};h.save=function(){return(new Q(this)).data()};
|
||||
h.restore=function(a){return ng(this,a[0])};function tg(a,b){b||(a.o=0);for(var c in a.u){var d=a.u[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.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=u(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)){!vg(a,g,f,e,!0)&&b&&F(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.o}
|
||||
function mg(a,b,c,d){var e=a.j.listDrives,e=e&&r(e.value);if(void 0===e||0>e||e>=a.b.length)a.B("Unable to load the selected drive");else if(c)if(c==rg)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==sg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}vg(a,e,b,c,!1,d)}else ug(a,e)}
|
||||
function vg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Z.toLowerCase()!=d.toLowerCase()&&(g++,ug(a,b,!0),k.Ra?a.B("RL11 busy"):(k.Ra=!0,e&&(k.Qa=!0,a.o++),k.va=!!f,Qf(new Mf(a,k,"preload"),c,d,f,a.Sc)&&g++));return g}h.Sc=function(a,b,c,d,e){a.Ra=!1;b&&(b.J>a.J||b.O>a.O)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Sa)),b=null);b?(a.S=b,a.ka=c,a.Z=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Sa),a.Qa||e),this.A&&Ic(this.A)):a.va=!1;a.Qa&&(a.Qa=!1,--this.o||F(this));lg(this,a.Sa)};
|
||||
function pg(a,b,c,d){if((a=a.j.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 lg(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=r(a.value),c=c.va?rg:c.Z,!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 ug(a,b,c){var d=a.b[b];if(d.S||!1===c)d.ka="",d.Z="",d.S=null,d.va=!1,c||(a.B("Drive RL"+b+" unloaded",c),lg(a,b))}
|
||||
function ng(a,b){var c=0;b||(b=[]);a.a=b[c++]||129;a.m=b[c++]||0;a.f=b[c++]||0;a.g=b[c++]||0;a.i=b[c++]||0;a.h=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.Sa=b;d.name=c.Ga;d.Ra=d.va=!1;d.J=512;d.O=2;d.L=40;d.T=256;d.wb=!0;d.ad=0;d.Zc=0;d.Xb=1;d.xc=d.L;d.Zb=d.T;d.hd=0;d.ze=null;d.S||(d.Z="");d.status=29}return!0}
|
||||
h.wc=function(a,b,c,d,e,f,g){var k=0;a=a.S;var l=null,m;a||(k=5120,e=0);for(;e;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var p,t;if(0>(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}yb(this.s,Xc(this.c,f),p|t<<8);if(Zb(this.s)){k=8192;break}f+=2;e--;if(m>=a.T&&(l=null,++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
||||
h.Tc=function(a,b,c,d,e,f,g){var k=0;a=a.S;var l=null,m;a||(k=5120,e=0);for(;e;){var p=Ab(this.s,Xc(this.c,f));if(Zb(this.s)){k=8192;break}f+=2;e--;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.T&&(l=null,++d>=a.L&&(d=0,++c>=a.O&&(c=0,++b>=a.J)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
|
||||
h.Rc=function(a,b,c,d,e,f){this.m=f&65535;this.a=this.a&-49|f>>12&48;this.h=f>>16&63;this.g=this.f=b<<7|(c?64:0)|d&63;this.i=65536-e&65535;a&&(this.a=this.a|a|32768);return!0};h.be=function(){return this.a&65535};
|
||||
h.kf=function(a){this.a=this.a&-1023|a&1022;this.h=this.h&60|(a&48)>>4;if(!(this.a&128)){a=!0;var b,c=this.b[(this.a&768)>>8],d=c.S,e,f,g;this.a&=-2;switch(this.a&14){case 4:this.i&8&&(this.a&=63);this.i=c.status|this.g&64|(d&&512==d.J?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.g=this.f&4?this.g+b:this.g-b,this.f=this.g=this.g&65408|c);break;case 8:this.i=this.g;break;case 12:b=this.wc;case 10:b||(b=this.Tc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.J||g>=d.L?
|
||||
this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Rc.bind(this)))}a&&(this.a|=129,this.a&64&&M(this.c,this.Da))}};h.$d=function(){return this.m};h.hf=function(a){this.m=a&65534};h.ce=function(){return this.f};h.lf=function(a){this.f=a};h.de=function(){return this.i};h.mf=function(a){this.i=a};h.ae=function(){return this.h};h.jf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4};
|
||||
var pg="",qg="?",rg="??",vg={},ng=(vg[63744]=[null,null,O.prototype.be,O.prototype.kf,"RLCS"],vg[63746]=[null,null,O.prototype.$d,O.prototype.hf,"RLBA"],vg[63748]=[null,null,O.prototype.ce,O.prototype.lf,"RLDA"],vg[63750]=[null,null,O.prototype.de,O.prototype.mf,"RLMP"],vg[63752]=[null,null,O.prototype.ae,O.prototype.jf,"RLBE"],vg);
|
||||
function wg(a,b,c){A.call(this,"Computer",a,0,33554432);this.l.R=!1;this.F=null;xg(this,b);this.w=Bc(this,"autoPower",a);this.g=0;this.K=a.busWidth||a.buswidth;this.a=yg;this.u=null;this.H=this.i=this.C=this.m=this.I=!1;this.h=null;this.M=Bc(this,"url")||"";(Math.random()+.1).toString(36);this.b=zg(this);if(this.c=Pa("CPU",this.id)){this.D=Pa("Debugger",this.id);this.s=new Fb({id:this.Ha+".bus",busWidth:this.K},this.c,this.D);var d,e=C(this.id);if((this.f=Pa("Panel",this.id))&&this.f.ab)for(b=0;b<
|
||||
this.a|=37888:(a=65536-this.i&65535,d=(this.h&63)<<16|this.m,a=b.call(this,c,e,f,g,a,d,this.Rc.bind(this)))}a&&(this.a|=129,this.a&64&&L(this.c,this.Da))}};h.$d=function(){return this.m};h.hf=function(a){this.m=a&65534};h.ce=function(){return this.f};h.lf=function(a){this.f=a};h.de=function(){return this.i};h.mf=function(a){this.i=a};h.ae=function(){return this.h};h.jf=function(a){this.h=a&63;this.a=this.a&-49|(this.h&3)<<4};
|
||||
var qg="",rg="?",sg="??",wg={},og=(wg[63744]=[null,null,N.prototype.be,N.prototype.kf,"RLCS"],wg[63746]=[null,null,N.prototype.$d,N.prototype.hf,"RLBA"],wg[63748]=[null,null,N.prototype.ce,N.prototype.lf,"RLDA"],wg[63750]=[null,null,N.prototype.de,N.prototype.mf,"RLMP"],wg[63752]=[null,null,N.prototype.ae,N.prototype.jf,"RLBE"],wg);
|
||||
function xg(a,b,c){z.call(this,"Computer",a,0,33554432);this.l.R=!1;this.F=null;yg(this,b);this.w=Bc(this,"autoPower",a);this.g=0;this.K=a.busWidth||a.buswidth;this.a=zg;this.u=null;this.H=this.i=this.C=this.m=this.I=!1;this.h=null;this.M=Bc(this,"url")||"";(Math.random()+.1).toString(36);this.b=Ag(this);if(this.c=Pa("CPU",this.id)){this.D=Pa("Debugger",this.id);this.s=new Fb({id:this.Ha+".bus",busWidth:this.K},this.c,this.D);var d,e=B(this.id);if((this.f=Pa("Panel",this.id))&&this.f.ab)for(b=0;b<
|
||||
e.length;b++)d=e[b],d.B=this.f.B,d.U=this.f.U,d.ab=this.f.ab;this.U("PDPjs v1.31.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.U("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.X&&d.X(this,this.s,this.c,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.o=d:this.a=parseInt(d,10));var f;if(a=Bc(this,"state")||(f=!0,a.state))b=this.G=
|
||||
a,f||(this.m=!0,this.a=yg),this.a&&(this.v=new R(this,"1.31.0"),Ag(this.v)?b=null:delete this.v);!b&&this.a&&(b=Bg(this))&&(this.m=!0);if(b){var g=this;x(b,null,!0,function(a,b,c){c?(g.o=null,g.m=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.u=b,g.I=!0);G(g)})}else G(this);this.j.power||(this.w=!0);!c&&this.w&&Cg(this,this.qb)}else z("Unable to find CPU component")}n(wg,A);
|
||||
function xg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){z(d.message+" ("+c+")")}}a.F=b}function Bc(a,b,c){var d=b.toLowerCase(),d=Ua[b]||Ua[d];void 0===d&&a.F&&(d=a.F[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Cg(a,b,c){for(var d=C(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Cg(a,b,c)});return}}b.call(a,c)}
|
||||
function Dg(a,b){var c=new R(a,"1.31.0",Eg);if(Ag(c)&&Fg(c)){var d=c.get(Gg),e=b?b.get(Gg):"unknown";d!=e&&(a.B("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=wg.prototype;
|
||||
h.qb=function(a){void 0===a&&(a=this.a||(this.u?Hg:yg));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.v||new R(this,"1.31.0");if(a==Ig)b=!0;else if(a>yg){if(Ag(d,this.u)){this.h=new R(this,"1.31.0",Jg);Ag(this.h)&&(Kg(this,d),a=Lg,Og(this.h));this.h.set(Gg,ra());Pg(this.h);var e=this.a&&!this.m;if(a==Hg||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Fg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ag(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.B("Error: "+g),"unable to verify user"==g&&(Aa(Qg,""),this.b=null)):this.U(f+": "+g),Og(d),Ag(d)?(c=Fg(d),e=!0):c=!1))}e&&Dg(this,c?d:null)}else a==Lg&&d.clear()}else Dg(this);delete this.u;delete this.v}e=C(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=Rg(this,g,d,b,c));b=[d,a,c];a!=Ig?Cg(this,this.yc,b):this.yc(b)}};
|
||||
function Rg(a,b,c,d,e){if(!b.l.R){b.l.R=!0;if(b.Y){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.Y(f,d)&&f&&(z("Unable to restore state for "+b.type),a.G&&!a.I?(c.clear(),a.a=yg,window&&window.location.reload()):a.C=!0,b.Y(null),e=!1)}if(!d&&b.pc)for(a=b.pc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.yc=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.l.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(Rg(this,this.c,b,c,a),vb(this),this.c.Ca());this.C&&(Kg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
||||
function Kg(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.b||"";b=b.toString();var d={app:"PDPjs",ver:"1.31.0"};d.url=a.M;d.user=c;d.type="bug";d.data=b;x("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Sg(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new R(a,"1.31.0"),g=new R(a,"1.31.0",Eg),k=ra();g.set(Gg,k);f.set(Gg,k);f.set(Tg,"1.31.0");f.set(Ug,window?window.location.href:null);f.set(Vg,window?window.navigator.userAgent:"");a.c&&a.c.ga&&(c&&H(a.c),d=a.c.ga(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.R=!1,!1===d&&(e=null)));for(var k=C(a.id),l=0;l<k.length;l++){var m=k[l];m.l.R&&(m.ga&&(d=m.ga(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.l.R=!1,!1===d&&(e=null)))}e&&
|
||||
(c?(k=d=!1,b?(a.b&&Wg(a,a.b,f.toString()),Pg(g)&&Pg(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==Xg),d&&f.clear(k)):e=f.toString());c&&(a.l.R=!1,b=a.j.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.s&&this.s.reset&&this.s.reset();this.c&&this.c.reset&&this.c.reset();for(var a=C(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.s&&c!==this.c&&c.reset&&c.reset()}vb(this,-1)};
|
||||
h.start=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}vb(this,-1)};h.stop=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}vb(this,-1)};
|
||||
a,f||(this.m=!0,this.a=zg),this.a&&(this.v=new Q(this,"1.31.0"),Bg(this.v)?b=null:delete this.v);!b&&this.a&&(b=Cg(this))&&(this.m=!0);if(b){var g=this;v(b,null,!0,function(a,b,c){c?(g.o=null,g.m=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.u=b,g.I=!0);F(g)})}else F(this);this.j.power||(this.w=!0);!c&&this.w&&Dg(this,this.qb)}else y("Unable to find CPU component")}n(xg,z);
|
||||
function yg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){y(d.message+" ("+c+")")}}a.F=b}function Bc(a,b,c){var d=b.toLowerCase(),d=Ua[b]||Ua[d];void 0===d&&a.F&&(d=a.F[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Dg(a,b,c){for(var d=B(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Dg(a,b,c)});return}}b.call(a,c)}
|
||||
function Eg(a,b){var c=new Q(a,"1.31.0",Fg);if(Bg(c)&&Gg(c)){var d=c.get(Hg),e=b?b.get(Hg):"unknown";d!=e&&(a.B("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=xg.prototype;
|
||||
h.qb=function(a){void 0===a&&(a=this.a||(this.u?Ig:zg));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.v||new Q(this,"1.31.0");if(a==Jg)b=!0;else if(a>zg){if(Bg(d,this.u)){this.h=new Q(this,"1.31.0",Kg);Bg(this.h)&&(Lg(this,d),a=Mg,Pg(this.h));this.h.set(Hg,sa());Qg(this.h);var e=this.a&&!this.m;if(a==Ig||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Gg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bg(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.B("Error: "+g),"unable to verify user"==g&&(Aa(Rg,""),this.b=null)):this.U(f+": "+g),Pg(d),Bg(d)?(c=Gg(d),e=!0):c=!1))}e&&Eg(this,c?d:null)}else a==Mg&&d.clear()}else Eg(this);delete this.u;delete this.v}e=B(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=Sg(this,g,d,b,c));b=[d,a,c];a!=Jg?Dg(this,this.yc,b):this.yc(b)}};
|
||||
function Sg(a,b,c,d,e){if(!b.l.R){b.l.R=!0;if(b.Y){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.Y(f,d)&&f&&(y("Unable to restore state for "+b.type),a.G&&!a.I?(c.clear(),a.a=zg,window&&window.location.reload()):a.C=!0,b.Y(null),e=!1)}if(!d&&b.pc)for(a=b.pc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.yc=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.l.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.c&&(Sg(this,this.c,b,c,a),vb(this),this.c.Ca());this.C&&(Lg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
|
||||
function Lg(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.b||"";b=b.toString();var d={app:"PDPjs",ver:"1.31.0"};d.url=a.M;d.user=c;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Tg(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new Q(a,"1.31.0"),g=new Q(a,"1.31.0",Fg),k=sa();g.set(Hg,k);f.set(Hg,k);f.set(Ug,"1.31.0");f.set(Vg,window?window.location.href:null);f.set(Wg,window?window.navigator.userAgent:"");a.c&&a.c.ga&&(c&&G(a.c),d=a.c.ga(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.l.R=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l<k.length;l++){var m=k[l];m.l.R&&(m.ga&&(d=m.ga(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.l.R=!1,!1===d&&(e=null)))}e&&
|
||||
(c?(k=d=!1,b?(a.b&&Xg(a,a.b,f.toString()),Qg(g)&&Qg(f)||(e=null,d=k=!0)):a.a&&(d=!0,k=a.a==Yg),d&&f.clear(k)):e=f.toString());c&&(a.l.R=!1,b=a.j.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.s&&this.s.reset&&this.s.reset();this.c&&this.c.reset&&this.c.reset();for(var a=B(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.s&&c!==this.c&&c.reset&&c.reset()}vb(this,-1)};
|
||||
h.start=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}vb(this,-1)};h.stop=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}vb(this,-1)};
|
||||
function vb(a,b){if(a.c){var c=a.c,d=b||0,e=c.j.speed;e&&(0>=d||30<=(c.hc+=d))&&(e.textContent=c.l.P?c.Ia.toFixed(2)+"Mhz":"Stopped",c.hc=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.l.P;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;e<a.c.b.length;e++)lb(a,"R"+e,a.c.b[e]);e=hc(a.c);lb(a,"PS",e);lb(a,"NF",e&8?1:0,1);lb(a,"ZF",e&4?1:0,1);lb(a,"VF",e&2?1:0,1);lb(a,"CF",e&1?1:0,1);a.i=0}Bb(a,0<b&&c&&!d?a.c.Fa:a.ha);xb(a,a.h);b=a.c;b=b.Ja?b.na&16?1:2:4;Db(a,"B22",b&1);Db(a,"B18",b&2);Db(a,"B16",b&4)}}
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.g||(d.l.R?Sg(d,!1,!0):Cg(d,d.qb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.l.R&&!d.g)if(d.a&&!d.o){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Sg(d,a,!0);!a&&d.G?window&&window.location.reload():(a||(d.i=!0),d.qb(yg),d.i=!1)}else d.reset(),d.c&&d.c.Ca()},!0;case "save":if(la(ta(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.j[b]=c,c.onclick=function(){var a=zg(d,!0);if(a){var b=!!(d.a&&!d.o||d.G),c=Sg(d,b);b?Wg(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function zg(a,b){var c=a.b;c||((c=za(Qg),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=Yg(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c}
|
||||
function Yg(a,b){a.b=null;b=x(ta()+"/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(Qg,b.data),a.b=b.data)}catch(d){z(d.message+" ("+c+")")}return a.b}function Bg(a){var b=null;a.b&&(b=ta()+"/api/v1/user?req=load&user="+a.b+"&state="+Zg(a,"1.31.0"));return b}
|
||||
function Wg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Zg(a,"1.31.0");d.data=c;b=x(ta()+"/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.B("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.B(c),Aa(Qg,""),a.b=null)}}
|
||||
function yf(a){var b;a=C(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 Ic(a){if(a.ab){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.ab.focus();window&&window.scrollTo(b,c)}}var Jg="failsafe",Eg="validate",Gg="timestamp",Tg="version",Ug="url",Vg="browser",Qg="user",Ig=-1,yg=0,Hg=1,Lg=2,Xg=3;
|
||||
Ea(function(){for(var a=F(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=D(c),c=F(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=D(f),g=new wg(g,d,!0);E(g,f);g.w&&Cg(g,g.qb)}});Fa.show.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Pa("Computer",c.id))&&c.H&&!c.l.R&&c.qb(Ig)}});Fa.exit.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Pa("Computer",c.id))&&c.l.R&&Sg(c,!(!c.a||c.o),!0)}});
|
||||
function R(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.j=!1;this.key=Zg(a,b,c);Og(this,a.Uc)}h=R.prototype;h.set=function(a,b){try{this.c[a]=b}catch(c){}};h.get=function(a){return this.c[a]||null};h.data=function(){return this.c};function Ag(a,b){return b?(a.a=b,a.b=!0,a.j=!1,!0):a.b?!0:va()&&(b=za(a.key))?(a.a=b,a.b=!0):!1}function Fg(a){var b=!0;if(!a.j)try{a.c=JSON.parse(a.a),a.j=!0}catch(c){z(c.message||c),b=!1}return b}
|
||||
function Pg(a){var b=!0;if(va()){var c=JSON.stringify(a.c);Aa(a.key,c)||(z("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function Og(a,b){a.a="";a.c={};a.b=a.j=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){Og(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 Zg(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}var $g=0;
|
||||
function ah(a,b,c,d,e,f){e("Loading "+a+"...");x(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):bh(k,a,b,c,d,e,f)})}
|
||||
function bh(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ma(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?ch(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function ch(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");x(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],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[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);ch(a,b,c)}})}else c(a,null)}
|
||||
function dh(a,b,c,d){function e(a){if(void 0===k){var b=g&&F(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=ma(a))}function f(a){e("Error: "+a);l&&(--$g||Ia(!0));l=!1}var g,k,l=!0;$g++;Na[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c||
|
||||
(c="/versions/pdpjs/1.31.0/components.xsl");m=function(d,k){k?ah(c,null,null,!1,e,function(d,l){l?(Ma(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--$g||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),--$g||Ia(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?ah(b,a,d,!0,e,m):bh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return dh(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.31.0/pdp11.map
|
||||
h.aa=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.g||(d.l.R?Tg(d,!1,!0):Dg(d,d.qb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.l.R&&!d.g)if(d.a&&!d.o){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Tg(d,a,!0);!a&&d.G?window&&window.location.reload():(a||(d.i=!0),d.qb(zg),d.i=!1)}else d.reset(),d.c&&d.c.Ca()},!0;case "save":if(ma(ua(),"pcjs.org"))c.parentNode.removeChild(c);
|
||||
else return this.j[b]=c,c.onclick=function(){var a=Ag(d,!0);if(a){var b=!!(d.a&&!d.o||d.G),c=Tg(d,b);b?Xg(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ag(a,b){var c=a.b;c||((c=za(Rg),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=Zg(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c}
|
||||
function Zg(a,b){a.b=null;b=v(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(Rg,b.data),a.b=b.data)}catch(d){y(d.message+" ("+c+")")}return a.b}function Cg(a){var b=null;a.b&&(b=ua()+"/api/v1/user?req=load&user="+a.b+"&state="+$g(a,"1.31.0"));return b}
|
||||
function Xg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=$g(a,"1.31.0");d.data=c;b=v(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.B("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.B(c),Aa(Rg,""),a.b=null)}}
|
||||
function yf(a){var b;a=B(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 Ic(a){if(a.ab){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.ab.focus();window&&window.scrollTo(b,c)}}var Kg="failsafe",Fg="validate",Hg="timestamp",Ug="version",Vg="url",Wg="browser",Rg="user",Jg=-1,zg=0,Ig=1,Mg=2,Yg=3;
|
||||
Ea(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=C(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=C(f),g=new xg(g,d,!0);D(g,f);g.w&&Dg(g,g.qb)}});Fa.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Pa("Computer",c.id))&&c.H&&!c.l.R&&c.qb(Jg)}});Fa.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Pa("Computer",c.id))&&c.l.R&&Tg(c,!(!c.a||c.o),!0)}});
|
||||
function Q(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.j=!1;this.key=$g(a,b,c);Pg(this,a.Uc)}h=Q.prototype;h.set=function(a,b){try{this.c[a]=b}catch(c){}};h.get=function(a){return this.c[a]||null};h.data=function(){return this.c};function Bg(a,b){return b?(a.a=b,a.b=!0,a.j=!1,!0):a.b?!0:wa()&&(b=za(a.key))?(a.a=b,a.b=!0):!1}function Gg(a){var b=!0;if(!a.j)try{a.c=JSON.parse(a.a),a.j=!0}catch(c){y(c.message||c),b=!1}return b}
|
||||
function Qg(a){var b=!0;if(wa()){var c=JSON.stringify(a.c);Aa(a.key,c)||(y("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function Pg(a,b){a.a="";a.c={};a.b=a.j=!1;b&&a.set("parms",b)}
|
||||
h.clear=function(a){Pg(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 $g(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}var ah=0;
|
||||
function bh(a,b,c,d,e,f){e("Loading "+a+"...");v(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):ch(k,a,b,c,d,e,f)})}
|
||||
function ch(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ma(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?dh(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function dh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");v(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],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[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);dh(a,b,c)}})}else c(a,null)}
|
||||
function eh(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=na(a))}function f(a){e("Error: "+a);l&&(--ah||Ia(!0));l=!1}var g,k,l=!0;ah++;Na[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));p.appendChild(t)}c||
|
||||
(c="/versions/pdpjs/1.31.0/components.xsl");m=function(d,k){k?bh(c,null,null,!1,e,function(d,l){l?(Ma(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ah||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),--ah||Ia(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bh(b,a,d,!0,e,m):ch(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(x){f(x.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return eh(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.31.0/pdp11.map
|
||||
|
|
|
|||
Loading…
Reference in a new issue