diff --git a/apps/pdp11/tapes/README.md b/apps/pdp11/tapes/README.md index 0f122ca69..89a333a1a 100644 --- a/apps/pdp11/tapes/README.md +++ b/apps/pdp11/tapes/README.md @@ -42,7 +42,7 @@ p. 155, "PAPER TAPE SOFTWARE", the following software was available on paper tap - [IOX](iox/) (PDP-11 Input/Output eXecutive) - [PDP-11 BASIC](basic/) (Beginners All-purpose Symbolic Instruction Code) -There was a separate DEC publication, [PDP-11 Paper Tape Software Handbook](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Paper_Tape_Software_Handbook.pdf), +There was a separate DEC publication, [PDP-11 Paper Tape Software Handbook](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Paper_Tape_Software_Handbook_1976.pdf), that described all of the above software in greater detail, and it included some programs that the 1971 Handbook listed under "Disk Operating System" instead of "Paper Tape System", such as: diff --git a/apps/pdp11/tapes/absloader/README.md b/apps/pdp11/tapes/absloader/README.md index e276baea8..7a57e315e 100644 --- a/apps/pdp11/tapes/absloader/README.md +++ b/apps/pdp11/tapes/absloader/README.md @@ -43,7 +43,7 @@ we know about the "Absolute Format": [Other sites](http://www.retrocmp.com/stories/dec-pc05-papertape/242-dec-pc05-working-with-paper-tapes) have referred to this tape format as the "Standard Absolute" format, but I've not found that terminology used in any DEC publication. In fact, I think that term may have arisen from a misreading of instructions -found in DEC manuals like the ["MEM EXER 16K" Diagnostics Manual](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Mem-Exer-16k_Feb78.pdf): +found in DEC manuals like the ["MEM EXER 16K" Diagnostics Manual](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-9045F-MC_CZQMCFO_MEM_EXER_16K_Feb78.pdf): Load the program using any standard absolute loader. @@ -54,5 +54,5 @@ for which a specific address has been selected, based on the amount of RAM prese PCjs has archived the following Absolute Loader resources: - [Absolute Loader](DEC-11-L2PC-PO.json) -- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Absolute_Loader_Listing_Jun75.pdf) +- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA_ABSOLUTE_LOADER_LISTING_Jun75.pdf) - "APPENDIX D: THE BOOTSTRAP AND ABSOLUTE LOADERS" from the [PDP-11 BASIC PROGRAMMING MANUAL (December 1970)](http://archive.pcjs.org/pubs/dec/pdp11/basic/BASIC_Programming_Manual_Dec70.pdf) diff --git a/apps/pdp11/tapes/basic/README.md b/apps/pdp11/tapes/basic/README.md index 1bc8da470..01a959ff9 100644 --- a/apps/pdp11/tapes/basic/README.md +++ b/apps/pdp11/tapes/basic/README.md @@ -15,8 +15,8 @@ DEC PDP-11 BASIC [![DEC-11-AJPB-PB](DEC-11-AJPB-PB.jpg)](DEC-11-AJPB-PB.json) -According to the [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf), p. 160, -notable features of PDP-11 BASIC included: +According to the [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf), +p. 160, notable features of PDP-11 BASIC included: - Use of BASIC statements in immediate mode (no line number) - Ability to use any BASIC command (RUN, LIST, etc.) in deferred mode (with a line number) @@ -47,19 +47,19 @@ Debugging Notes ### PDPjs Debugger vs. SIMH -When I first tried to run BASIC in a PDPjs machine, it crashed almost immediately. It was attempting to use memory beyond -the 16Kb of installed RAM. After a bit of poking around, I found BASIC's memory sizing code here: +When I first tried to run BASIC in a PDPjs machine, it crashed almost immediately. It was attempting to use memory +beyond the 16Kb of installed RAM. After a bit of poking around, I found BASIC's memory sizing code here: 016142: 012701 160000 MOV #160000,R1 016146: 022626 CMP (SP)+,(SP)+ 016150: 014111 MOV -(R1),@R1 -The code sets R1 to highest possible RAM address and starts scanning backwards for the first valid memory location. However, -the scanning process wasn't clear to me at first glance, and the `CMP (SP)+,(SP)+` was a bit of a head-scratcher, so I decided -to do an instruction-by-instruction comparison with SIMH. +The code sets R1 to highest possible RAM address and starts scanning backwards for the first valid memory location. +However, the scanning process wasn't clear to me at first glance, and the `CMP (SP)+,(SP)+` was a bit of a +head-scratcher, so I decided to do an instruction-by-instruction comparison with SIMH. -After cloning the [SIMH project](https://github.com/simh/simh) and building the *pdp11* binary, I created a *pdp11.ini* text file -that contained: +After cloning the [SIMH project](https://github.com/simh/simh) and building the *pdp11* binary, I created a *pdp11.ini* +text file that contained: ECHO Configuring PDP-11/20 with 16Kb of RAM... SET CPU 11/20 @@ -154,15 +154,15 @@ After typing several "do tr" commands, I was surprised to see SIMH execution con Step expired, PC: 016150 (MOV -(R1),(R1)) -until I remembered that when the PDP-11 accesses an invalid address, it's supposed to trap to vector 000004, and that BASIC -must have modified vector 000004 to jump into the middle of this code. +until I remembered that when the PDP-11 accesses an invalid address, it's supposed to trap to vector 000004, and that +BASIC must have modified vector 000004 to jump into the middle of this code. -This code fragment was simply marching down the address space until it reached an address that didn't trap. The odd-looking -`CMP (SP)+,(SP)+` instruction was throwing away the PC and PSW that each trap pushed onto the stack, by effectively adding -4 to SP. +This code fragment was simply marching down the address space until it reached an address that didn't trap. The +odd-looking `CMP (SP)+,(SP)+` instruction was throwing away the PC and PSW that each trap pushed onto the stack, by +effectively adding 4 to SP. -The problem with PDPjs was that it wasn't generating a trap to vector 000004 when an invalid address was accessed. After fixing -that, I verified with the PDPjs Debugger that the memory sizing code was working properly: +The problem with PDPjs was that it wasn't generating a trap to vector 000004 when an invalid address was accessed. +After fixing that, I verified with the PDPjs Debugger that the memory sizing code was working properly: PDPjs v1.30.1 Copyright © 2012-2016 Jeff Parsons @@ -263,18 +263,19 @@ When the code starts, the TRAP instruction has already pushed two words onto the 0(SP): previous PC 2(SP): previous PSW -The first instruction, `MOV @SP,2(SP)`, copies the *previous PC* onto the *previous PSW*, which is where we'll eventually want -*previous PC*, so that the handler can eventually return with a simple `RTS PC`. +The first instruction, `MOV @SP,2(SP)`, copies the *previous PC* onto the *previous PSW*, which is where we'll +eventually want *previous PC*, so that the handler can eventually return with a simple `RTS PC`. -The next instruction, `SUB #2,@SP`, subtracts 2 from the original *previous PC*, so that it now points to the TRAP instruction. +The next instruction, `SUB #2,@SP`, subtracts 2 from the original *previous PC*, so that it now points to the TRAP +instruction. -Then `@(SP)+,-(SP)` fetches the TRAP instruction while also "popping" the original *previous PC* and then "pushing" TRAP -instruction onto the stack, overwriting the original *previous PC*. +Then `@(SP)+,-(SP)` fetches the TRAP instruction while also "popping" the original *previous PC* and then "pushing" +TRAP instruction onto the stack, overwriting the original *previous PC*. -The next few instructions shift the TRAP right to see if bit 0 is set, and if it is not, then the TRAP instruction is restored -by shifting it left again, and then a large offset is added to it, transforming the TRAP instruction (which is now known to be -an *even* value) into a jump table index. +The next few instructions shift the TRAP right to see if bit 0 is set, and if it is not, then the TRAP instruction +is restored by shifting it left again, and then a large offset is added to it, transforming the TRAP instruction (which +is now known to be an *even* value) into a jump table index. The final instruction, `MOV @(SP)+,PC`, moves the address at the jump table index into PC, while also removing the TRAP -instruction from the stack, leaving only the *previous PC* on the stack, so that when the TRAP handler is done, it can execute -`RTS PC` to return to the caller. +instruction from the stack, leaving only the *previous PC* on the stack, so that when the TRAP handler is done, it can +execute `RTS PC` to return to the caller. diff --git a/devices/pdp11/README.md b/devices/pdp11/README.md index 4d74858df..40588a503 100644 --- a/devices/pdp11/README.md +++ b/devices/pdp11/README.md @@ -12,7 +12,7 @@ PDP-11 Device Configurations * [Control Panels](panel/) * Serial Interface for Display Terminals [(DL11)](dl11/) * High-Speed Paper Tape Reader/Punch [(PC11)](pc11/) -* Disk Controllers ([RK11](rk11/), [RL11](rl11/)) +* Disk Controllers ([RK11](rk11/), [RL11](rl11/), [RX11](rx11/)) * [ROM Images](rom/) Sample machines include a diff --git a/devices/pdp11/machine/1170/panel/debugger/machine.xml b/devices/pdp11/machine/1170/panel/debugger/machine.xml index 7d6709620..c36804100 100644 --- a/devices/pdp11/machine/1170/panel/debugger/machine.xml +++ b/devices/pdp11/machine/1170/panel/debugger/machine.xml @@ -11,6 +11,7 @@ + diff --git a/devices/pdp11/machine/1170/panel/machine.xml b/devices/pdp11/machine/1170/panel/machine.xml index bba2dd9cc..a4aed4068 100644 --- a/devices/pdp11/machine/1170/panel/machine.xml +++ b/devices/pdp11/machine/1170/panel/machine.xml @@ -10,6 +10,7 @@ + diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml b/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml index 543e1117f..c47b8bac3 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml +++ b/devices/pdp11/machine/1170/vt100/debugger/machine-left.xml @@ -10,6 +10,7 @@ + diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine-right.xml b/devices/pdp11/machine/1170/vt100/debugger/machine-right.xml index 190bd5301..68c03e864 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/machine-right.xml +++ b/devices/pdp11/machine/1170/vt100/debugger/machine-right.xml @@ -10,6 +10,7 @@ + diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine.xml b/devices/pdp11/machine/1170/vt100/debugger/machine.xml index 433f7f5ed..5e858e30e 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/machine.xml +++ b/devices/pdp11/machine/1170/vt100/debugger/machine.xml @@ -10,6 +10,7 @@ + diff --git a/devices/pdp11/machine/1170/vt100/machine-left.xml b/devices/pdp11/machine/1170/vt100/machine-left.xml index c912ae466..07360da54 100644 --- a/devices/pdp11/machine/1170/vt100/machine-left.xml +++ b/devices/pdp11/machine/1170/vt100/machine-left.xml @@ -9,6 +9,7 @@ + diff --git a/devices/pdp11/machine/1170/vt100/machine-right.xml b/devices/pdp11/machine/1170/vt100/machine-right.xml index 5e84e0123..04f5f5760 100644 --- a/devices/pdp11/machine/1170/vt100/machine-right.xml +++ b/devices/pdp11/machine/1170/vt100/machine-right.xml @@ -9,6 +9,7 @@ + diff --git a/devices/pdp11/machine/1170/vt100/machine.xml b/devices/pdp11/machine/1170/vt100/machine.xml index 2afebf8c8..4dc95613b 100644 --- a/devices/pdp11/machine/1170/vt100/machine.xml +++ b/devices/pdp11/machine/1170/vt100/machine.xml @@ -9,6 +9,7 @@ + diff --git a/devices/pdp11/pc11/README.md b/devices/pdp11/pc11/README.md index 1645d2f3a..38cc778e0 100644 --- a/devices/pdp11/pc11/README.md +++ b/devices/pdp11/pc11/README.md @@ -44,3 +44,6 @@ used to control the device, such as choosing which tape should be "loaded" into ``` + +For details about the PC11 hardware, we relied upon the [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf), +p. 4-376 (p. 408 of the PDF). diff --git a/devices/pdp11/rk11/README.md b/devices/pdp11/rk11/README.md index 8fd7b1e71..4ef949ac5 100644 --- a/devices/pdp11/rk11/README.md +++ b/devices/pdp11/rk11/README.md @@ -7,9 +7,12 @@ permalink: /devices/pdp11/rk11/ RK11 Disk Controller -------------------- -The RK11 Disk Controller controls up to eight RK05 disk drives, which in turn read/write [RK03-KA](/disks/dec/rk03/) +The RK11 Disk Controller controls up to eight RK05 disk drives, which in turn read/write [RK03](/disks/dec/rk03/) disk cartridges. +RK03 disks are single-platter cartridges with 203 tracks per side, 12 sectors per track, and a sector size of 256 words +(512 bytes), for a total capacity of 2.38Mb (2,494,464 bytes). + Machines containing the [RK11 Component](/modules/pdp11/lib/rk11.js) include: - [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/)) diff --git a/devices/pdp11/rk11/default.xml b/devices/pdp11/rk11/default.xml index 8a498fff7..85498c45a 100644 --- a/devices/pdp11/rk11/default.xml +++ b/devices/pdp11/rk11/default.xml @@ -1,6 +1,5 @@ - - Disk Drive Controls + diff --git a/devices/pdp11/rl11/README.md b/devices/pdp11/rl11/README.md index 6c85544d7..a291cd84c 100644 --- a/devices/pdp11/rl11/README.md +++ b/devices/pdp11/rl11/README.md @@ -8,7 +8,13 @@ RL11 Disk Controller -------------------- The RL11 Disk Controller controls up to four RL01 or RL02 disk drives, which in turn read/write -[RL01K](/disks/dec/rl01k/) or [RL02K](/disks/dec/rl02k/) disk cartridges. +[RL01K](/disks/dec/rl01k/) or [RL02K](/disks/dec/rl02k/) disk cartridges, respectively. + +RL01K disks are single-platter cartridges with 256 tracks per side, 40 sectors per track, and a sector size of +256 bytes, for a total capacity of 5Mb (5,242,880 bytes). + +RL02K disks are single-platter cartridges with 512 tracks per side, 40 sectors per track, and a sector size of +256 bytes, for a total capacity of 10Mb (10,485,760 bytes). Machines containing the [RL11 Component](/modules/pdp11/lib/pc11.js) include: diff --git a/devices/pdp11/rx11/README.md b/devices/pdp11/rx11/README.md new file mode 100644 index 000000000..54946e1f0 --- /dev/null +++ b/devices/pdp11/rx11/README.md @@ -0,0 +1,175 @@ +--- +layout: page +title: RX11 Disk Controller +permalink: /devices/pdp11/rx11/ +--- + +RX11 Disk Controller +-------------------- + +The RX11 Disk Controller controls up to two RX01 disk drives, which in turn read/write 8-inch diskettes that DEC +merely describes as "compatible with the IBM 3740 family of equipment." We refer to them simply as RX01 diskettes. + +RX01 diskettes are single-sided, with a logical format of 77 tracks, 26 sectors per track, and a sector size of 128 +bytes, for a total capacity of 250Kb (256,256 bytes). + +> **SIDEBAR**: DEC's [documentation](/pubs/dec/pdp11/rx11/) claims a capacity of "256K bytes", but like many disk drive +manufacturers, they overstated the capacity by treating "K" as 1000 rather than 1024, which was its traditional meaning +within the computer industry at the time. DEC's own processor handbooks, for example, invariably used "K" to mean 1024. + +> Since 1998, standards organizations have been pushing the term "kibibyte" (abbreviated KiB) to mean 1024 bytes, +in an effort to redefine the "K" in "Kilobyte" (Kb) as 1000, but that doesn't change what the term commonly meant prior +to 1998. + +Machines containing the [RX11 Component](/modules/pdp11/lib/rx11.js) include: + +- [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/)) +- [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/) (with [Debugger](/devices/pdp11/machine/1170/vt100/debugger/)) + +PCjs has archived a selection of [RX01 Disk Images](/disks/dec/rx01/) for use by those machines, which are listed in +the following RX11 Device XML file: + +- [Default](/devices/pdp11/rx11/default.xml) + +which is typically referenced by a Machine XML file as: + +```xml + +``` + +Device XML files not only configure a device, but also list all the resource the device will use, and define UI elements +used to control the device, such as choosing which disks should be "auto-mounted" by the RX11 device. For example: + +```xml + + + Disk Drive Controls + + + + + + + + + + + + + + Load + Boot + + + + +``` + +Loading the RX11 Bootstrap +-------------------------- + +From the [RT-11 v4.0 Installation Manual (March 1981)](/pubs/dec/pdp11/rt11/), p. E-9: + + The procedure to deposit the RX11 disk bootstrap loader in memory depends on the type of processor you have. + If your computer is a PDP-11V/03, PDP-11/03, or LSI-11, see the PDP-11/03 user's manual for instructions. + + 1. Set the ENABLE/HALT switch to HALT. + + 2. Set the first address, 010000, in the switch register (see Table E-3). + + 3. Press the LOAD ADDR switch. + + 4. Set the contents for the first address (from Table E-3) in the switch register. + + 5. Lift the DEP switch. The computer automatically advances to the next address. + + 6. Set the contents for the next address (from Table E-3) in the switch register. + + 7. Lift the DEP switch. + + 8. Repeat steps 6 and 7 until you have deposited all the instructions. + + Now verify that you deposited the bootstrap program properly. + + 1. Set the first address, 001000, in the switch register. + + 2. Press the LOAD ADDR switch. + + 3. Press the EXAM switch to display the contents of that address in the data register. + + 4. Compare the number in the data register with the value for that address in Table E-3. + + 5. If the values are the same, press EXAM again to display the contents of the next address. + If the values are not the same, repeat the entire procedure for depositing the bootstrap. + Verify the contents of all the addresses in this way. If any instruction is incorrect, + repeat the entire deposit procedure. + + Once you have correctly deposited the bootstrap in memory, start the computer as follows: + + 1. Set the starting address, 001000, in the switch register. + + 2. Press the LOAD ADDR switch. + + 3. Set the ENABLE/HALT switch to ENABLE. + + 4. Press the START switch. + +Table E-3: RX-11 Bootstrap Loader +--------------------------------- + + Location Contents + + 001000 005000 + 001002 012701 + 001004 177170 + 001006 105711 + 001010 001776 + 001012 012711 + 001014 000003 + 001016 005711 + 001020 001776 + 001022 100405 + 001024 105711 + 001026 100004 + 001030 116120 + 001032 000002 + 001034 000770 + 001036 000000 + 001040 005000 + 001042 000110 + +Loading the RX-11 Bootstrap Loader +---------------------------------- + +Any PDP-11 machine using built-in PCjs Debugger makes it easy to enter the bootstrap code above. Paste +the following commands into the Debugger's command buffer: + + ew 1000 005000 012701 177170 105711 001776 012711 000003 005711 001776; + ew 1022 100405 105711 100004 116120 000002 000770 000000 005000 000110; + r pc 1000 + +You can then review (eg, disassemble) the bootstrap code: + + >> u 1000 1044 + 001000: 005000 CLR R0 + 001002: 012701 177170 MOV #177170,R1 + 001006: 105711 TSTB @R1 + 001010: 001776 BEQ 001006 + 001012: 012711 000003 MOV #3,@R1 + 001016: 005711 TST @R1 + 001020: 001776 BEQ 001016 + 001022: 100405 BMI 001036 + 001024: 105711 TSTB @R1 + 001026: 100004 BPL 001040 + 001030: 116120 000002 MOVB 2(R1),(R0)+ + 001034: 000770 BR 001016 + 001036: 000000 HALT + 001040: 005000 CLR R0 + 001042: 000110 JMP @R0 + +Last but not least, make sure you have successfully loaded an RX01 diskette image into drive DX0. Then execute the +bootstrap code with the Debugger's "g" command. + +Of course, if the machine also includes the RX11 Boot control, then all you *really* need to is select an +RX01 diskette, click "Load", wait for the diskette image to be successfully loaded (i.e., downloaded) and then click +"Boot". diff --git a/devices/pdp11/rx11/default.xml b/devices/pdp11/rx11/default.xml new file mode 100644 index 000000000..260346363 --- /dev/null +++ b/devices/pdp11/rx11/default.xml @@ -0,0 +1,22 @@ + + + Disk Drive Controls + + + + + + + + + + + + + + Load + Boot + + + + diff --git a/disks/dec/README.md b/disks/dec/README.md index 55cdda389..24fba9604 100644 --- a/disks/dec/README.md +++ b/disks/dec/README.md @@ -12,9 +12,14 @@ The DEC disk images we have archived are organized by type: * [RK03](rk03/) * [RL01K](rl01k/) * [RL02K](rl02k/) +* [RX01](rx01/) RK03 (or more precisely, RK03-KA) disks are single-platter cartridges with a capacity of 2.38Mb. They are used in RK05 disk drives in conjunction with an [RK11 Disk Controller](/devices/pdp11/rk11/). RL01K and RL02K disks are single-platter cartridges with capacities of 5Mb and 10Mb, respectively, They are used in RL01 and RL02 disk drives with an [RL11 Disk Controller](/devices/pdp11/rl11/). + +RX01 diskettes are single-sided, with 77 tracks per side, 26 sectors per track, and a sector size of 128 bytes, +for a total capacity of 250Kb (256,256 bytes). They are used in RX01 disk drives in conjunction with an +[RX11 Disk Controller](/devices/pdp11/rx11/). diff --git a/disks/dec/rx01/README.md b/disks/dec/rx01/README.md new file mode 100644 index 000000000..dce1082b6 --- /dev/null +++ b/disks/dec/rx01/README.md @@ -0,0 +1,135 @@ +--- +layout: page +title: DEC RX01 Disk Images +permalink: /disks/dec/rx01/ +--- + +DEC RX01 Disk Images +-------------------- + +RX01 diskettes are single-sided, with 77 tracks per side, 26 sectors per track, and a sector size of 128 bytes, +for a total capacity of 250Kb (256,256 bytes). They are used in RX01 disk drives in conjunction with an +[RX11 Disk Controller](/devices/pdp11/rx11/). + +Below is a summary of RX01 diskette images archived here. + +### RT-11 V3 [[Source](http://www.headcrashers.org/comp/rx01/)] + +#### RT-11 V3 SYS (1 OF 9) + + DXMNSJ.SYS 86 14-Aug-77 TT .SYS 2 14-Aug-77 + DP .SYS 2 14-Aug-77 DT .SYS 2 14-Aug-77 + DX .SYS 2 14-Aug-77 RF .SYS 2 14-Aug-77 + RK .SYS 2 14-Aug-77 DM .SYS 4 14-Aug-77 + DS .SYS 2 14-Aug-77 LP .SYS 2 14-Aug-77 + NL .SYS 2 14-Aug-77 STARTS.COM 1 11-Jul-77 + PIP .SAV 16 14-Aug-77 DUP .SAV 17 14-Aug-77 + DIR .SAV 17 14-Aug-77 SYSMAC.SML 37 14-Aug-77 + EDIT .SAV 21 14-Aug-77 MACRO .SAV 45 14-Aug-77 + CREF .SAV 6 14-Aug-77 LINK .SAV 29 16-Aug-77 + LIBR .SAV 18 14-Aug-77 FILEX .SAV 18 14-Aug-77 + SRCCOM.SAV 11 14-Aug-77 DUMP .SAV 7 14-Aug-77 + PATCH .SAV 9 14-Aug-77 HELP .SAV 21 14-Aug-77 + HELP .TEC 3 23-Jun-77 HELP .TXT 73 19-Jul-77 + DEMOBG.MAC 4 01-Aug-77 DEMOFG.MAC 5 01-Aug-77 + V2USER.TXT 2 13-Jul-77 + 31 Files, 468 Blocks + 12 Free blocks + +#### RT-11 V3 SYS (2 OF 9) + + RKMNSJ.SYS 86 14-Aug-77 RKMNFB.SYS 96 14-Aug-77 + RKMNXM.SYS 106 14-Aug-77 RKMNSJ.BL 82 14-Aug-77 + DMMNSJ.SYS 87 14-Aug-77 ODT .OBJ 9 14-Aug-77 + 6 Files, 466 Blocks + 14 Free blocks + +#### RT-11 V3 SYS (3 OF 9) + + DPMNXM.SYS 106 14-Aug-77 RFMNSJ.SYS 86 14-Aug-77 + RFMNFB.SYS 96 14-Aug-77 RFMNXM.SYS 106 14-Aug-77 + DTX .SYS 2 14-Aug-77 DPX .SYS 2 14-Aug-77 + DXX .SYS 3 14-Aug-77 RFX .SYS 2 14-Aug-77 + RKX .SYS 2 14-Aug-77 DMX .SYS 4 14-Aug-77 + DSX .SYS 2 14-Aug-77 LPX .SYS 2 14-Aug-77 + CR .SYS 3 14-Aug-77 CRX .SYS 3 14-Aug-77 + MT .SYS 8 14-Aug-77 MTX .SYS 9 14-Aug-77 + MTHD .SYS 3 14-Aug-77 MTHDX .SYS 4 14-Aug-77 + BA .SYS 7 14-Aug-77 BAX .SYS 7 14-Aug-77 + TT .MAC 9 14-Aug-77 DEMOED.TXT 1 09-May-77 + 22 Files, 467 Blocks + 13 Free blocks + +#### RT-11 V3 SYS (4 OF 9) + + DMMNFB.SYS 98 14-Aug-77 DMMNXM.SYS 108 14-Aug-77 + DXMNFB.SYS 97 14-Aug-77 DXMNXM.SYS 107 14-Aug-77 + SYE .SAV 50 14-Aug-77 NLX .SYS 2 14-Aug-77 + PC .SYS 2 14-Aug-77 PCX .SYS 2 14-Aug-77 + DEMOF1.FOR 2 28-Jan-77 + 9 Files, 468 Blocks + 12 Free blocks + +#### RT-11 V3 SYS (5 OF 9) + + DXMNSJ.BL 83 14-Aug-77 DTMNSJ.SYS 86 14-Aug-77 + DTMNFB.SYS 96 14-Aug-77 DTMNSJ.BL 82 14-Aug-77 + DSMNSJ.SYS 86 14-Aug-77 RF .MAC 6 14-Aug-77 + DM .MAC 19 14-Aug-77 DEMOSP.MAC 11 01-Aug-77 + 8 Files, 469 Blocks + 11 Free blocks + +#### RT-11 V3 SYS (6 OF 9) + + DSMNFB.SYS 96 14-Aug-77 DSMNXM.SYS 106 14-Aug-77 + DPMNSJ.SYS 86 14-Aug-77 DPMNFB.SYS 97 14-Aug-77 + DP .MAC 9 14-Aug-77 MUBRTE.OBJ 1 04-May-77 + MUBTAB.OBJ 1 04-May-77 MUBZN1.OBJ 1 04-May-77 + CT .MAC 32 14-Aug-77 TM .MAC 24 14-Aug-77 + MMHD .SYS 4 14-Aug-77 MMHDX .SYS 4 14-Aug-77 + PAT .SAV 7 14-Aug-77 + 13 Files, 468 Blocks + 12 Free blocks + +#### RT-11 V3 SYS (7 OF 9) + + KMON .MAC 118 14-Aug-77 USR .MAC 59 14-Aug-77 + RMONSJ.MAC 56 14-Aug-77 RMONFB.MAC 138 14-Aug-77 + EL .MAC 18 14-Aug-77 LP .MAC 7 14-Aug-77 + RK .MAC 7 14-Aug-77 DT .MAC 7 14-Aug-77 + DS .MAC 7 14-Aug-77 PC .MAC 6 14-Aug-77 + ERRUTL.SAV 6 14-Aug-77 MACFST.SAV 45 14-Aug-77 + 12 Files, 474 Blocks + 6 Free blocks + +#### RT-11 V3 SYS (8 OF 9) + + KMOVLY.MAC 153 14-Aug-77 BSTRAP.MAC 41 14-Aug-77 + MTTEMT.MAC 18 16-Aug-77 MTTINT.MAC 34 14-Aug-77 + TJ .MAC 28 14-Aug-77 NL .MAC 3 14-Aug-77 + DX .MAC 11 14-Aug-77 CR .MAC 14 14-Aug-77 + FSM .MAC 31 14-Aug-77 BATCH .MAC 98 14-Aug-77 + MUBET1.OBJ 1 04-May-77 MUBXT1.OBJ 1 04-May-77 + MUBZ1 .OBJ 1 04-May-77 MUBS1D.OBJ 1 04-May-77 + MUBLNK.COM 1 04-May-77 MM .SYS 9 14-Aug-77 + MMX .SYS 9 14-Aug-77 BA .MAC 19 14-Aug-77 + 18 Files, 473 Blocks + 7 Free blocks + +#### RT-11 V3 SYS (9 OF 9) + + SYSMAC.MAC 36 01-Aug-77 BATCH .SAV 25 14-Aug-77 + MAC8K .SAV 52 14-Aug-77 PSE .SAV 13 14-Aug-77 + SYSGEN.SAV 32 14-Aug-77 SYSGEN.CND 83 08-Aug-77 + SYSTBL.CND 26 08-Aug-77 VTMAC .MAC 7 01-Aug-77 + VTHDLR.OBJ 8 14-Aug-77 SYSF4 .OBJ 39 14-Aug-77 + MDUP .SAV 9 14-Aug-77 MDUP .MM 48 14-Aug-77 + MDUP .MT 48 14-Aug-77 MBOOT .BOT 1 14-Aug-77 + MSBOOT.BOT 3 14-Aug-77 STARTF.COM 1 10-Jun-77 + STARTX.COM 1 10-Jun-77 SJ .MAC 1 01-Aug-77 + FB .MAC 1 01-Aug-77 XM .MAC 1 01-Aug-77 + SYSDEV.MAC 1 24-Sep-76 CT .SYS 5 14-Aug-77 + CTX .SYS 6 14-Aug-77 TECO .SAV 27 14-Aug-77 + DEMOX1.MAC 5 01-Aug-77 + 25 Files, 479 Blocks + 1 Free blocks diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index 9f6801be2..1f626477d 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -44,10 +44,10 @@ http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017 */ var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]} -var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, -"+":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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];fa[191]=n["?"]; -fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"]; +var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39, +"(":40,")":41,"*":42,"+":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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120, +y:121,z:122,"{":123,"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"]; +fa[191]=n["?"];fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"]; function ga(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function ia(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d} function ja(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d}function q(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function r(a){return q(a,2,!0)}function ka(a){return q(a,4,!0)} diff --git a/docs/pcx86/examples/pcx86.js b/docs/pcx86/examples/pcx86.js index bda2ac5b1..f0b4b21d4 100644 --- a/docs/pcx86/examples/pcx86.js +++ b/docs/pcx86/examples/pcx86.js @@ -44,10 +44,10 @@ http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017 */ var k,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]} -var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, -"+":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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];p[192]=n["~"];p[219]=n["{"]; -p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"]; +var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39, +"(":40,")":41,"*":42,"+":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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120, +y:121,z:122,"{":123,"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"]; +p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"]; function fa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return la[a]})}function ma(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index 86af22cdc..da8fb3a27 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -1410,7 +1410,7 @@ class ComputerPDP11 extends Component { this.fReload = false; } else { this.reset(); - if (this.cpu) this.cpu.autoStart(); + if (this.cpu && !this.dbg) this.cpu.autoStart(); } } diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index c92e4eb81..72b244c24 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -567,13 +567,15 @@ class CPUStatePDP11 extends CPUPDP11 { } /** - * setReset(addr, fStart) + * setReset(addr, fStart, bUnit, addrStack) * * @this {CPUStatePDP11} * @param {number} addr - * @param {boolean|undefined} fStart (true if a "startable" image was just loaded, false if not) + * @param {boolean} [fStart] (true if a "startable" image was just loaded, false if not) + * @param {number} [bUnit] (boot unit #) + * @param {number} [addrStack] */ - setReset(addr, fStart) + setReset(addr, fStart, bUnit, addrStack) { this.addrReset = addr; @@ -583,18 +585,16 @@ class CPUStatePDP11 extends CPUPDP11 { this.resetCPU(); if (fStart) { - /* - * TODO: Review. I'm zeroing R2-R5 in the fStart case (ie, for boot code) simply because that's what I - * saw the PDP-11 Boot Monitor doing (see /apps/pdp11/boot/monitor/BOOTMON.mac). - */ - for (var i = 2; i <= 5; i++) { - this.regsGen[i] = 0; - } - if (!this.flags.powered) { - this.flags.autoStart = true; - } - else if (!this.flags.running) { - this.startCPU(); + this.regsGen[0] = bUnit || 0; + for (var i = 1; i <= 5; i++) this.regsGen[i] = 0; + this.regsGen[6] = addrStack || 0o2000; + if (!this.dbg) { + if (!this.flags.powered) { + this.flags.autoStart = true; + } + else if (!this.flags.running) { + this.startCPU(); + } } } else { @@ -2870,6 +2870,7 @@ class CPUStatePDP11 extends CPUPDP11 { data = (data < 0? (this.regsGen[-data-1] & 0xff): data); this.regsGen[reg] = (this.regsGen[reg] & ~writeFlags) | (((data << 24) >> 24) & writeFlags); } + //noinspection JSUnresolvedFunction fnFlags.call(this, data << 8); } else { var addr = this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE); diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index e6e6c45a9..514f6cc9b 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -513,6 +513,8 @@ var PDP11 = { RLMP: 0o174406, // RL11 Multi-Purpose Register RLBE: 0o174410, // RL11 Bus (Address) Extension Register (RLV12 controller only) DL11: 0o176500, // DL11 Additional Register Range (ends at 0o176676) + RXCS: 0o177170, // RX11 Command and Status Register + RXDB: 0o177172, // RX11 Data Buffer Register RKDS: 0o177400, // RK11 Drive Status Register RKER: 0o177402, // RK11 Error Register RKCS: 0o177404, // RK11 Control Status Register @@ -662,29 +664,28 @@ var PDP11 = { RVEC: 0o070, // reader vector PVEC: 0o074, // punch vector PRS: { // 177550: PC11 (and PR11) Reader Status Register - RE: 0x0001, // Reader Enable (W/O) - RIE: 0x0040, // Reader Interrupt Enable (allows the DONE and ERROR bits to trigger an interrupt) - DONE: 0x0080, // Done (R/O) - BUSY: 0x0800, // Busy (R/O) - ERROR: 0x8000, // Error (R/O) - CLEAR: 0x08C0, // bits cleared on INIT - RMASK: 0xFFFE, // bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readPRS()) - WMASK: 0x0041, // bits writable + RE: 0x0001, // (000001) Reader Enable (W/O) + IE: 0x0040, // (000100) Reader Interrupt Enable (allows the DONE and ERROR bits to trigger an interrupt) + DONE: 0x0080, // (000200) Done (R/O) + BUSY: 0x0800, // (004000) Busy (R/O) + ERROR: 0x8000, // (100000) Error (R/O) + CLEAR: 0x08C0, // (004300) bits cleared on INIT + RMASK: 0xFFFE, // (177776) bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readPRS()) + WMASK: 0x0041, // (000101) bits writable BAUD: 3600 }, PRB: { // 177552: PC11 (and PR11) Reader Buffer Register MASK: 0x00FF // Data }, PPS: { // 177554: PC11 Punch Status Register - /* - * TODO: Flesh this out if/when we add Paper Tape Punch support - */ + IE: 0x0040, // Interrupt Enable + RDY: 0x0080, // Ready + ERROR: 0x8000, // Error (eg, no tape in punch, or punch has no power) + WMASK: 0x0040, // bits writable BAUD: 600 }, PPB: { // 177556: PC11 Punch Buffer Register - /* - * TODO: Flesh this out if/when we add Paper Tape Punch support - */ + MASK: 0x00FF // Data } }, RK11: { // RK11 Disk Controller @@ -738,7 +739,7 @@ var PDP11 = { SCP: 0x2000, // (020000) Search Complete (R/O) HE: 0x4000, // (040000) Hard Error (R/O) ERR: 0x8000, // (100000) Composite Error (R/O) (set when any RKER bit is set) - UNUSED: 0x1200, // (120000) unused + UNUSED: 0x1200, // (011000) unused RMASK: 0xEFFE, // (167776) bits readable WMASK: 0x0F7F, // (007577) bits writable SHIFT: { @@ -772,6 +773,7 @@ var PDP11 = { PRI: 5, VEC: 0o160, DRIVES: 4, // maximum of 4 drives + PREFIX: "DY", RLCS: { // 174400: Control Status Register DRDY: 0x0001, // Drive Ready (R/O) FUNC: 0x000E, // Function Code (F2,F1,F0) (R/W) @@ -865,6 +867,76 @@ var PDP11 = { RDNC: 0b1110 // Read Data without Header Check } }, + RX11: { // RX11 Disk Controller + PRI: 5, + VEC: 0o264, + DRIVES: 2, // maximum of 2 drives + PREFIX: "DX", + RXCS: { // 177170: Command and Status Register + GO: 0x0001, // (000001) Go (W/O) + FUNC: 0x000E, // (000016) Function Code (F2,F1,F0) (W/O) + UNIT: 0x0010, // (000020) Unit Select (W/O) + DONE: 0x0020, // (000040) Done (R/O) + IE: 0x0040, // (000100) Interrupt Enable (R/W, cleared on INIT) + TR: 0x0080, // (000200) Transfer Request (R/O) + INIT: 0x4000, // (040000) RX11 Initialize (W/O) + ERR: 0x8000, // (100000) Error (R/O, cleared on INIT or command) + UNUSED: 0x3F00, // (037400) unused + RMASK: 0x80E0, // (100340) bits readable + WMASK: 0x405F // (040137) bits writable + }, + RXDB: { // 177172: Data Buffer Register + }, + RXTA: { + MASK: 0x007F + }, + RXSA: { + MASK: 0x001F + }, + RXES: { + /* + * The DRDY bit is only valid when retrieved via a Read Status function or at completion of Initialize when it indicates + * status of drive O. It is asserted if the unit currently selected exists, is properly supplied with power, has a diskette + * installed correctly, has its door closed, and has a diskette up to speed. + * + * If the Error bit was set in the RXCS but Error bits are not set in the RXES, then specific error conditions can be accessed via + * a Read Error Register function. + */ + CRC: 0x0001, // CRC error (RXES is moved to the RXDB, and Error and Done are asserted) + PARITY: 0x0002, // parity error (RXES is moved to the RXDB, and Error and Done are asserted) + ID: 0x0004, // Initialize Done (following a programmable or UNIBUS initialization, or a power failure) + DEL: 0x0040, // Deleted Data Detected + DRDY: 0x0080 // Drive Ready + }, + FUNC: { // NOTE: These function codes are pre-shifted to read/write directly from/to RXCS.FUNC + FILL: 0b0000, // Fill Buffer + EMPTY: 0b0010, // Empty Buffer + WRITE: 0b0100, // Write Sector + READ: 0b0110, // Read Sector + UNUSED: 0b1000, // UNUSED + RDSTAT: 0b1010, // Read Status + WRDEL: 0b1100, // Write Deleted Data Sector + RDERR: 0b1110 // Read Error Register + }, + ERROR: { + HOME0: 0o0010, // Drive 0 failed to see home on Initialize + HOME1: 0o0020, // Drive 1 failed to see home on Initialize + BAD_HOME: 0o0030, // Found home when stepping out 10 tracks for INIT + NO_TRACK: 0o0040, // Tried to access a track greater than 77 + FOUND_HOME: 0o0050, // Home was found before desired track was reached + SELF_DIAG: 0o0060, // Self-diagnostic error + NO_SECTOR: 0o0070, // Desired sector could not be found after looking at 52 headers (2 revolutions) + NO_SEP: 0o0110, // More than 40us and no SEP clock seen + NO_PREAM: 0o0120, // A preamble could not be found + NO_IOMARK: 0o0130, // Preamble found but no I/O mark found within allowable time span + CRC_HEADER: 0o0140, // CRC error on what we thought was a header + BAD_TRACK: 0o0150, // The header track address of a good header does not compare with the desired track + NO_ID: 0o0160, // Too many tries for an IDAM (identifies header) + NO_DATA: 0o0170, // Data AM not found in allotted time + CRC_DATA: 0o0200, // CRC error on reading the sector from the disk (No code appears in the ERREG). + BAD_PARITY: 0o0210 // All parity errors + } + }, VECTORS: { 0o060: "DL11R", 0o064: "DL11X", @@ -872,12 +944,31 @@ var PDP11 = { 0o074: "PC11X", 0o100: "KW11", 0o160: "RL11", - 0o220: "RK11" + 0o220: "RK11", + 0o264: "RX11" } }; -PDP11.RK11.RK05 = [203, 2, 12, 512, PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY]; -PDP11.RL11.RL02K = [512, 2, 40, 256, PDP11.RL11.RLMP.GS_ST.LOCKON | PDP11.RL11.RLMP.GS_BH | PDP11.RL11.RLMP.GS_HO]; +PDP11.RX11.RX01 = [ + "DX", + 77, 1, 26, 128, // disk geometry (CHSN: cylinders, heads, sectors/track, and bytes/sector) + 1, 0, 0, 128, // boot code location (cylinder, head, sector index (NOT sector number), and number of bytes) + 0 // default drive status +]; + +PDP11.RK11.RK05 = [ + "RK", + 203, 2, 12, 512, // disk geometry (CHSN: cylinders, heads, sectors/track, and bytes/sector) + 0, 0, 0, 512, // boot code location (cylinder, head, sector index (NOT sector number), and number of bytes) + PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.RRDY +]; + +PDP11.RL11.RL02K = [ + "RL", + 512, 2, 40, 256, // disk geometry (CHSN: cylinders, heads, sectors/track, and bytes/sector) + 0, 0, 0, 256, // boot code location (cylinder, head, sector index (NOT sector number), and number of bytes) + PDP11.RL11.RLMP.GS_ST.LOCKON | PDP11.RL11.RLMP.GS_BH | PDP11.RL11.RLMP.GS_HO +]; PDP11.ACCESS.READ_WORD = PDP11.ACCESS.WORD | PDP11.ACCESS.READ; // formerly READ_MODE (2) PDP11.ACCESS.READ_BYTE = PDP11.ACCESS.BYTE | PDP11.ACCESS.READ; // formerly READ_MODE (2) | BYTE_MODE (1) diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 3346f2603..24e662265 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -44,6 +44,7 @@ if (NODE) { var PC11 = require("./pc11"); var RL11 = require("./rl11"); var RK11 = require("./rk11"); + var RX11 = require("./rx11"); } class DevicePDP11 extends Component { @@ -1204,6 +1205,10 @@ class DevicePDP11 extends Component { device = new RK11(parmsDevice); Component.bindComponentControls(device, eDevice, PDP11.APPCLASS); break; + case 'rx11': + device = new RX11(parmsDevice); + Component.bindComponentControls(device, eDevice, PDP11.APPCLASS); + break; } } } diff --git a/modules/pdp11/lib/drive.js b/modules/pdp11/lib/drive.js index 2460868e2..ce4a74c6b 100644 --- a/modules/pdp11/lib/drive.js +++ b/modules/pdp11/lib/drive.js @@ -376,7 +376,8 @@ class DriveController extends Component { */ getDriveName(iDrive) { - return this.type.substr(0, 2) + iDrive; + var drive = this.aDrives[iDrive]; + return drive.sName || "---"; } /** @@ -554,11 +555,16 @@ class DriveController extends Component { * NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have * these or SMALLER values (subject to the limits of what the controller supports, of course). */ - drive.nCylinders = configDrive[0]; - drive.nHeads = configDrive[1]; - drive.nSectors = configDrive[2]; - drive.cbSector = configDrive[3]; - drive.status = configDrive[4]; + drive.sName = configDrive[i++] + iDrive; + drive.nCylinders = configDrive[i++]; + drive.nHeads = configDrive[i++]; + drive.nSectors = configDrive[i++]; + drive.cbSector = configDrive[i++]; + drive.iCylinderBoot = configDrive[i++]; + drive.iHeadBoot = configDrive[i++]; + drive.iSectorBoot = configDrive[i++]; + drive.cbSectorBoot = configDrive[i++]; + drive.status = configDrive[i++]; /* * The next group of properties are set by various controller command sequences. @@ -720,9 +726,9 @@ class DriveController extends Component { { if (!fRemount) this.cAutoMount = 0; for (var sDrive in this.configMount) { - var configDrive = this.configMount[sDrive]; - var sDiskPath = configDrive['path'] || ""; - var sDiskName = configDrive['name'] || this.findDisk(sDiskPath); + var configDisk = this.configMount[sDrive]; + var sDiskPath = configDisk['path'] || ""; + var sDiskName = configDisk['name'] || this.findDisk(sDiskPath); if (sDiskPath && sDiskName) { var iDrive = this.getDriveNumber(sDrive); if (iDrive >= 0 && iDrive < this.aDrives.length) { @@ -732,7 +738,7 @@ class DriveController extends Component { continue; } } - this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDrive) + ")"); + this.notice("Incorrect auto-mount settings for drive " + sDrive + " (" + JSON.stringify(configDisk) + ")"); } return !!this.cAutoMount; } @@ -814,8 +820,8 @@ class DriveController extends Component { * expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler, * a READY state is assured, and the readData() call shouldn't do anything to change that. */ - this.cpu.setReset(0, true); - var err = this.readData(drive, 0, 0, 0, 512, 0x0000, 2); + this.cpu.setReset(0, true, iDrive); + var err = this.readData(drive, drive.iCylinderBoot, drive.iHeadBoot, drive.iSectorBoot, drive.cbSectorBoot, 0x0000, 2); if (err) { this.notice("Unable to read the boot sector (" + err + ")"); } @@ -914,6 +920,11 @@ class DriveController extends Component { drive.sDiskName = sDiskName; drive.sDiskPath = sDiskPath; + /* + * Inform the controller implementation (eg, RX11) of the disk change. + */ + this.notifyLoad(drive.iDrive); + /* * Adding local disk image names to the disk list seems like a nice idea, but it's too confusing, * because then it looks like the "Mount" button should be able to (re)load them, and that can NEVER @@ -1117,6 +1128,11 @@ class DriveController extends Component { this.sDiskSource = DriveController.SOURCE.NONE; this.displayDisk(iDrive); } + + /* + * Inform the controller implementation (eg, RX11) of the disk removal. + */ + this.notifyUnload(iDrive); } } @@ -1217,10 +1233,34 @@ class DriveController extends Component { } } + /** + * notifyLoad(iDrive) + * + * Placeholder for subclasses. Called whenever DriveController has loaded a new disk into the specified drive. + * + * @this {RX11} + * @param {number} iDrive + */ + notifyLoad(iDrive) + { + } + + /** + * notifyUnload(iDrive) + * + * Placeholder for subclasses. Called whenever DriveController has unloaded a disk from the specified drive. + * + * @this {RX11} + * @param {number} iDrive + */ + notifyUnload(iDrive) + { + } + /** * readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) * - * Placeholder for subclasses. + * Placeholder for subclasses. Implementation is optional, but the automatic BOOT feature will be unavailable. * * @this {DriveController} * @param {Object} drive @@ -1236,13 +1276,13 @@ class DriveController extends Component { */ readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { - return false; + return -1; } /** * writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) * - * Placeholder for subclasses. + * Placeholder for subclasses. Implementation is optional. * * @this {DriveController} * @param {Object} drive @@ -1258,7 +1298,7 @@ class DriveController extends Component { */ writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { - return false; + return -1; } } diff --git a/modules/pdp11/lib/messages.js b/modules/pdp11/lib/messages.js index f4ca592f9..15faca8e2 100644 --- a/modules/pdp11/lib/messages.js +++ b/modules/pdp11/lib/messages.js @@ -48,10 +48,11 @@ var MessagesPDP11 = { WRITE: 0x00008000, RK11: 0x00010000, RL11: 0x00020000, - DL11: 0x00040000, - SERIAL: 0x00040000, - KW11: 0x00080000, - TIMER: 0x00080000, + RX11: 0x00040000, + DL11: 0x00100000, + SERIAL: 0x00100000, + KW11: 0x00200000, + TIMER: 0x00200000, SPEAKER: 0x01000000, COMPUTER: 0x02000000, LOG: 0x10000000, @@ -94,6 +95,7 @@ MessagesPDP11.CATEGORIES = { "write": MessagesPDP11.WRITE, "rk11": MessagesPDP11.RK11, "rl11": MessagesPDP11.RL11, + "rx11": MessagesPDP11.RX11, "dl11": MessagesPDP11.DL11, "serial": MessagesPDP11.SERIAL, "kw11": MessagesPDP11.KW11, diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index fc3fbdbd1..f82d8ecf2 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -64,9 +64,9 @@ class PC11 extends Component { */ constructor(parms) { - super("PC11", parms); + super("PC11", parms, MessagesPDP11.PC11); - this.sDevice = "PTR"; // TODO: Make the device name configurable + this.sDevice = "PTR"; // TODO: Make the device name configurable /* * We preliminarily parse and record any 'autoMount' object now, but we no longer process it @@ -76,10 +76,12 @@ class PC11 extends Component { this.cAutoMount = 0; this.nBaudReceive = +parms['baudReceive'] || PDP11.PC11.PRS.BAUD; - this.regPRS = 0; // PRS register - this.regPRB = 0; // PRB register - this.iTapeData = 0; // buffer index - this.aTapeData = []; // buffer for the PRB register + this.regPRS = 0; // PRS register + this.regPRB = 0; // PRB register + this.regPPS = PDP11.PC11.PPS.ERROR; // PPS register (TODO: Stop signaling error once punch is implemented) + this.regPPB = 0; // PPB register + this.iTapeData = 0; // buffer index + this.aTapeData = []; // buffer for the PRB register this.sTapeSource = PC11.SOURCE.NONE; this.nTapeTarget = PC11.TARGET.NONE; this.sTapeName = this.sTapePath = ""; @@ -434,6 +436,7 @@ class PC11 extends Component { loadTape(sTapeName, sTapePath, nTapeTarget, fAutoMount, file) { var nResult = -1; + if (this.sTapePath.toLowerCase() != sTapePath.toLowerCase() || this.nTapeTarget != nTapeTarget) { nResult++; @@ -493,7 +496,7 @@ class PC11 extends Component { pc11.finishRead(sTapeName, sTapePath, nTapeTarget, reader.result); }; reader.readAsArrayBuffer(file); - return true; + return false; } /* @@ -579,6 +582,7 @@ class PC11 extends Component { this.parseTape(sTapeName, sTapePath, nTapeTarget, aBytes); this.sTapeSource = PC11.SOURCE.LOCAL; } + this.flags.busy = false; this.displayTape(); } @@ -724,9 +728,12 @@ class PC11 extends Component { this.status('Read tape "' + sTapeName + '"'); return; } + this.iTapeData = 0; this.aTapeData = aBytes; - this.status('Loaded tape "' + sTapeName + '"'); + this.regPRS &= ~PDP11.PC11.PRS.ERROR; + + this.status('Loaded tape "' + sTapeName + '" (' + aBytes.length + " bytes)"); this.displayProgress(0); } @@ -820,13 +827,18 @@ class PC11 extends Component { * (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask * the data assigned to PRB with 0xff. */ - this.regPRB = this.aTapeData[this.iTapeData++] & 0xff; + this.regPRB = this.aTapeData[this.iTapeData] & 0xff; + if (this.messageEnabled()) this.printMessage(this.type + ".advanceReader(" + this.iTapeData + "): " + Str.toHexByte(this.regPRB), true); + this.iTapeData++; this.displayProgress(this.iTapeData / this.aTapeData.length * 100); - this.regPRS |= PDP11.PC11.PRS.DONE; - this.regPRS &= ~PDP11.PC11.PRS.BUSY; - if (this.regPRS & PDP11.PC11.PRS.RIE) { - this.cpu.setIRQ(this.irqReader); - } + } + else { + this.regPRS |= PDP11.PC11.PRS.ERROR; + } + this.regPRS |= PDP11.PC11.PRS.DONE; + this.regPRS &= ~PDP11.PC11.PRS.BUSY; + if (this.regPRS & PDP11.PC11.PRS.IE) { + this.cpu.setIRQ(this.irqReader); } } } @@ -868,7 +880,7 @@ class PC11 extends Component { */ if (this.regPRS & PDP11.PC11.PRS.ERROR) { data &= ~PDP11.PC11.PRS.RE; - if (this.regPRS & PDP11.PC11.PRS.RIE) { + if (this.regPRS & PDP11.PC11.PRS.IE) { this.cpu.setIRQ(this.irqReader); } } else { @@ -914,6 +926,63 @@ class PC11 extends Component { writePRB(data, addr) { } + + /** + * readPPS(addr) + * + * @this {PC11} + * @param {number} addr (eg, PDP11.UNIBUS.PPS or 177554) + * @return {number} + */ + readPPS(addr) + { + return this.regPPS; + } + + /** + * writePPS(data, addr) + * + * NOTE: This was originally added ONLY because when RT-11 v4.0 copies from device "PC:" (the paper tape reader), + * it executes the following code: + * + * 016010: 005037 177550 CLR @#177550 ;history=2 PRS + * 016014: 005037 177554 CLR @#177554 ;history=1 + * + * and as you can see, without this PPS handler, a TRAP to 4 would normally occur. I guess since we claim to be + * a PC11, that makes sense. But what about PDP-11 machines with only a PR11 (ie, a reader-only unit)? + * + * @this {PC11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.PPS or 177554) + */ + writePPS(data, addr) + { + this.regPPS = (this.regPPS & ~PDP11.PC11.PPS.WMASK) | (data & PDP11.PC11.PPS.WMASK); + } + + /** + * readPPB(addr) + * + * @this {PC11} + * @param {number} addr (eg, PDP11.UNIBUS.PPB or 177556) + * @return {number} + */ + readPPB(addr) + { + return this.regPPB; + } + + /** + * writePPB(data, addr) + * + * @this {PC11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.PPB or 177556) + */ + writePPB(data, addr) + { + this.regPPB = (data & PDP11.PC11.PPB.MASK); + } } /* @@ -944,7 +1013,9 @@ PC11.CSSCLASS = { */ PC11.UNIBUS_IOTABLE = { [PDP11.UNIBUS.PRS]: /* 177550 */ [null, null, PC11.prototype.readPRS, PC11.prototype.writePRS, "PRS"], - [PDP11.UNIBUS.PRB]: /* 177552 */ [null, null, PC11.prototype.readPRB, PC11.prototype.writePRB, "PRB"] + [PDP11.UNIBUS.PRB]: /* 177552 */ [null, null, PC11.prototype.readPRB, PC11.prototype.writePRB, "PRB"], + [PDP11.UNIBUS.PPS]: /* 177554 */ [null, null, PC11.prototype.readPPS, PC11.prototype.writePPS, "PPS"], + [PDP11.UNIBUS.PPB]: /* 177556 */ [null, null, PC11.prototype.readPPB, PC11.prototype.writePPB, "PPB"] }; if (NODE) module.exports = PC11; diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index d582ae652..fd7758373 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -230,12 +230,12 @@ class RK11 extends DriveController { */ readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { - var err = 0; + var nError = 0; var disk = drive.disk; var sector = null, ibSector; if (!disk) { - err = RK11.RKER.NXD; + nError = RK11.RKER.NXD; nWords = 0; } @@ -243,12 +243,12 @@ class RK11 extends DriveController { while (nWords) { if (!sector) { if (iCylinder >= disk.nCylinders) { - err = RK11.RKER.NXC; + nError = RK11.RKER.NXC; break; } sector = disk.seek(iCylinder, iHead, iSector + 1); if (!sector) { - err = RK11.RKER.SKE; + nError = RK11.RKER.SKE; break; } ibSector = 0; @@ -262,7 +262,7 @@ class RK11 extends DriveController { } var b0, b1; if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) { - err = RK11.RKER.NXS; + nError = RK11.RKER.NXS; break; } if (!fCheck) { @@ -277,7 +277,7 @@ class RK11 extends DriveController { } } if (this.bus.checkFault()) { - err = RK11.RKER.NXM; + nError = RK11.RKER.NXM; break; } } @@ -285,7 +285,7 @@ class RK11 extends DriveController { addr += inc; nWords--; } - return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err; + return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError; } /** @@ -305,29 +305,29 @@ class RK11 extends DriveController { */ writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { - var err = 0; + var nError = 0; var disk = drive.disk; var sector = null, ibSector; if (!disk) { - err = RK11.RKER.NXD; + nError = RK11.RKER.NXD; nWords = 0; } while (nWords) { var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr)); if (this.bus.checkFault()) { - err = RK11.RKER.NXM; + nError = RK11.RKER.NXM; break; } if (!sector) { if (iCylinder >= disk.nCylinders) { - err = RK11.RKER.NXC; + nError = RK11.RKER.NXC; break; } sector = disk.seek(iCylinder, iHead, iSector + 1, true); if (!sector) { - err = RK11.RKER.SKE; + nError = RK11.RKER.SKE; break; } ibSector = 0; @@ -342,7 +342,7 @@ class RK11 extends DriveController { if (fCheck) { var b0, b1; if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) { - err = RK11.RKER.NXS; + nError = RK11.RKER.NXS; break; } /* @@ -356,12 +356,12 @@ class RK11 extends DriveController { * trigger the RKCS HE (Hard Error) bit. This is all taken care of in updateErrors() now. */ if (data != (b0 | (b1 << 8))) { - err = RK11.RKER.WCE; + nError = RK11.RKER.WCE; break; } } else { if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) { - err = RK11.RKER.NXS; + nError = RK11.RKER.NXS; break; } } @@ -369,14 +369,14 @@ class RK11 extends DriveController { addr += inc; nWords--; } - return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err; + return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError; } /** - * doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr) + * doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr) * * @this {RK11} - * @param {number} err + * @param {number} nError * @param {number} iCylinder * @param {number} iHead * @param {number} iSector @@ -384,13 +384,13 @@ class RK11 extends DriveController { * @param {number} addr * @return {boolean} */ - doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr) + doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr) { this.regRKBA = addr & 0xffff; this.regRKCS = (this.regRKCS & ~RK11.RKCS.MEX) | ((addr >> (16 - RK11.RKCS.SHIFT.MEX)) & RK11.RKCS.MEX); this.regRKWC = (0x10000 - nWords) & 0xffff; this.regRKDA = (this.regRKDA & ~RK11.RKDA.SA) | (iSector & RK11.RKDA.SA); - this.regRKER |= err; + this.regRKER |= nError; this.updateErrors(); return true; } diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index a29536ee5..433aea665 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -227,13 +227,13 @@ class RL11 extends DriveController { */ readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { - var err = 0; + var nError = 0; var checksum = 0; var disk = drive.disk; var sector = null, ibSector; if (!disk) { - err = RL11.ERRC.HNF; // TODO: Review + nError = RL11.ERRC.HNF; // TODO: Review nWords = 0; } @@ -242,14 +242,14 @@ class RL11 extends DriveController { if (!sector) { sector = disk.seek(iCylinder, iHead, iSector + 1); if (!sector) { - err = RL11.ERRC.HNF; + nError = RL11.ERRC.HNF; break; } ibSector = 0; } var b0, b1, data; if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) { - err = RL11.ERRC.HNF; + nError = RL11.ERRC.HNF; break; } /* @@ -267,7 +267,7 @@ class RL11 extends DriveController { } } if (this.bus.checkFault()) { - err = RL11.ERRC.NXM; + nError = RL11.ERRC.NXM; break; } addr += 2; @@ -280,7 +280,7 @@ class RL11 extends DriveController { if (++iHead >= disk.nHeads) { iHead = 0; if (++iCylinder >= disk.nCylinders) { - err = RL11.ERRC.HNF; + nError = RL11.ERRC.HNF; break; } } @@ -292,7 +292,7 @@ class RL11 extends DriveController { console.log("checksum: " + (checksum|0)); } - return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err; + return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError; } /** @@ -312,13 +312,13 @@ class RL11 extends DriveController { */ writeData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) { - var err = 0; + var nError = 0; var checksum = 0; var disk = drive.disk; var sector = null, ibSector; if (!disk) { - err = RL11.ERRC.HNF; // TODO: Review + nError = RL11.ERRC.HNF; // TODO: Review nWords = 0; } @@ -331,7 +331,7 @@ class RL11 extends DriveController { */ var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr)); if (this.bus.checkFault()) { - err = RL11.ERRC.NXM; + nError = RL11.ERRC.NXM; break; } if (DEBUG && this.messageEnabled(MessagesPDP11.WRITE)) { @@ -348,13 +348,13 @@ class RL11 extends DriveController { if (!sector) { sector = disk.seek(iCylinder, iHead, iSector + 1, true); if (!sector) { - err = RL11.ERRC.HNF; + nError = RL11.ERRC.HNF; break; } ibSector = 0; } if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) { - err = RL11.ERRC.HNF; + nError = RL11.ERRC.HNF; break; } if (ibSector >= disk.cbSector) { @@ -364,7 +364,7 @@ class RL11 extends DriveController { if (++iHead >= disk.nHeads) { iHead = 0; if (++iCylinder >= disk.nCylinders) { - err = RL11.ERRC.HNF; + nError = RL11.ERRC.HNF; break; } } @@ -376,14 +376,14 @@ class RL11 extends DriveController { console.log("checksum: " + (checksum|0)); } - return done? done(err, iCylinder, iHead, iSector, nWords, addr) : err; + return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError; } /** - * doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr) + * doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr) * * @this {RL11} - * @param {number} err + * @param {number} nError * @param {number} iCylinder * @param {number} iHead * @param {number} iSector @@ -391,7 +391,7 @@ class RL11 extends DriveController { * @param {number} addr * @return {boolean} */ - doneReadWrite(err, iCylinder, iHead, iSector, nWords, addr) + doneReadWrite(nError, iCylinder, iHead, iSector, nWords, addr) { this.regRLBA = addr & 0xffff; this.regRLCS = (this.regRLCS & ~RL11.RLCS.BAE) | ((addr >> (16 - RL11.RLCS.SHIFT.BAE)) & RL11.RLCS.BAE); @@ -399,8 +399,8 @@ class RL11 extends DriveController { this.regRLDA = (iCylinder << RL11.RLDA.SHIFT.RW_CA) | (iHead? RL11.RLDA.RW_HS : 0) | (iSector & RL11.RLDA.RW_SA); this.tmpRLDA = this.regRLDA; this.regRLMP = (0x10000 - nWords) & 0xffff; - if (err) { - this.regRLCS |= err | RL11.RLCS.ERR; + if (nError) { + this.regRLCS |= nError | RL11.RLCS.ERR; } return true; } diff --git a/modules/pdp11/lib/rx11.js b/modules/pdp11/lib/rx11.js new file mode 100644 index 000000000..d626b7a8c --- /dev/null +++ b/modules/pdp11/lib/rx11.js @@ -0,0 +1,593 @@ +/** + * @fileoverview Implements the RX11 Disk Controller (for RX01 Diskettes) + * @author Jeff Parsons + * @copyright © Jeff Parsons 2012-2017 + * + * This file is part of PCjs, a computer emulation software project at . + * + * It has been adapted from the JavaScript PDP 11/70 Emulator written by Paul Nankervis + * (paulnank@hotmail.com) at . This code may be used + * freely provided the original authors are acknowledged in any modified source code. + * + * PCjs is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with PCjs. If not, + * see . + * + * You are required to include the above copyright notice in every modified copy of this work + * and to display that copyright notice when the software starts running; see COPYRIGHT in + * . + * + * Some PCjs files also attempt to load external resource files, such as character-image files, + * ROM files, and disk image files. Those external resource files are not considered part of PCjs + * for purposes of the GNU General Public License, and the author does not claim any copyright + * as to their contents. + */ + +"use strict"; + +if (NODE) { + var Str = require("../../shared/lib/strlib"); + var PDP11 = require("./defines"); + var MessagesPDP11 = require("./messages"); + var DriveController = require("./drive"); +} + +class RX11 extends DriveController { + /** + * RX11(parms) + * + * The RX11 component has the following component-specific (parms) properties: + * + * autoMount: one or more JSON-encoded objects, each containing 'name' and 'path' properties + * + * The RX11 Disk Controller controls up to two RX01 disk drives, which in turn read/write + * disk cartridges. See [RX11 Disk Controller Configuration Files](/devices/pdp11/rx11/). + * + * RX01 diskettes are single-sided, with 77 tracks per side, 26 sectors per track, and a sector size + * of 128 bytes, for a total capacity of 250Kb (256,256 bytes). See [RX01 Disk Images](/disks/dec/rx01/). + * + * @param {Object} parms + */ + constructor(parms) + { + super("RX11", parms, MessagesPDP11.RX11, PDP11.RX11, PDP11.RX11.RX01, RX11.UNIBUS_IOTABLE); + + /* + * Define all the registers required for this controller. + */ + this.regRXCS = this.regRXDB = 0; + this.regRXTA = this.regRXSA = this.regRXES = this.regError = 0; + + /* + * Whenever a command is issued, we record the function code internally here, and when the command + * is completed, we set the internal function code back to UNUSED. + */ + this.funCode = RX11.FUNC.UNUSED; // no function in progress (device is idle) + + this.iBuffer = 0; + /* + * We use the new ES6 fill() method to ensure that the buffer returns something reasonable if, for some + * strange reason, the first command we receive is an Empty Buffer command. + */ + this.abBuffer = new Array(128).fill(0); + } + + /** + * initController(aRegs) + * + * @this {RX11} + * @param {Array} [aRegs] + * @return {boolean} true if successful, false if failure + */ + initController(aRegs) + { + if (!aRegs) { + this.regRXCS = 0; + this.regRXDB = 0; + this.regRXTA = 1; + this.regRXSA = 1; + this.regRXES = 0; + this.regError = 0; + this.funCode = RX11.FUNC.READ; + this.iBuffer = 0; + this.cpu.clearIRQ(this.irq); + this.readSector(); + } + else { + /* + * ES6 ALERT: A handy destructuring assignment, which makes it easy to perform the inverse + * of what saveController() does when it collects a bunch of object properties into an array. + */ + [ + this.regRXCS, + this.regRXDB, + this.regRXTA, + this.regRXSA, + this.regRXES, + this.regError, + this.funCode, + this.iBuffer, + this.abBuffer + ] = aRegs; + } + return true; + } + + /** + * saveController() + * + * Basically, the inverse of initController(). + * + * @this {RX11} + * @return {Array} + */ + saveController() + { + return [ + this.regRXCS, + this.regRXDB, + this.regRXTA, + this.regRXSA, + this.regRXES, + this.regError, + this.funCode, + this.iBuffer, + this.abBuffer + ]; + } + + /** + * notifyLoad(iDrive) + * + * Called whenever DriveController has loaded a new disk into the specified drive. + * + * We're interested in this so that whenever a disk change occurs for drive 0, we can automatically + * refill the sector buffer with the data from sector 1 from track 1. + * + * @this {RX11} + * @param {number} iDrive + */ + notifyLoad(iDrive) + { + if (iDrive == 0) this.initController(); + } + + /** + * notifyUnload(iDrive) + * + * Called whenever DriveController has unloaded a disk from the specified drive. + * + * @this {RX11} + * @param {number} iDrive + */ + notifyUnload(iDrive) + { + } + + /** + * processCommand() + * + * @this {RX11} + */ + processCommand() + { + this.funCode = this.regRXCS & RX11.RXCS.FUNC; + this.regRXCS &= ~(RX11.RXCS.GO | RX11.RXCS.TR | RX11.RXCS.DONE | RX11.RXCS.ERR); + this.cpu.clearIRQ(this.irq); + + if (this.messageEnabled()) this.printMessage(this.type + ".processCommand(" + RX11.FUNCS[this.funCode >> 1]+ ")", true, true); + + switch(this.funCode) { + + case RX11.FUNC.FILL: + case RX11.FUNC.EMPTY: + case RX11.FUNC.READ: + case RX11.FUNC.WRITE: + case RX11.FUNC.WRDEL: + this.initCommand(); + break; + + case RX11.FUNC.RDSTAT: + this.readStatus(); + break; + + case RX11.FUNC.RDERR: + this.readError(); + break; + + default: + this.assert(this.funCode == RX11.FUNC.UNUSED); + break; + } + } + + /** + * initCommand() + * + * @this {RX11} + */ + initCommand() + { + this.iBuffer = 0; + } + + /** + * doneCommand(nError) + * + * @this {RX11} + * @param {number} [nError] + */ + doneCommand(nError) + { + if (nError) { + this.regError = nError; + this.regRXDB = this.regRXES; + this.regRXCS |= RX11.RXCS.ERR; + } + this.funCode = RX11.FUNC.UNUSED; + this.regRXCS |= RX11.RXCS.DONE; + if (this.regRXCS & RX11.RXCS.IE) this.cpu.setIRQ(this.irq); + } + + /** + * readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) + * + * This function is required ONLY if we want to support DriveController's bootSelectedDisk() function (and we do). + * + * @this {RX11} + * @param {Object} drive + * @param {number} iCylinder + * @param {number} iHead + * @param {number} iSector + * @param {number} nWords + * @param {number} addr + * @param {number} inc (normally 2, unless inhibited, in which case it's 0) + * @param {boolean} [fCheck] + * @param {function(...)} [done] + * @return {boolean|number} true if complete, false if queued (or if no done() is supplied, the error code, if any) + */ + readData(drive, iCylinder, iHead, iSector, nWords, addr, inc, fCheck, done) + { + var nError = 0; + var disk = drive.disk; + var sector = null, ibSector; + + if (this.messageEnabled()) this.printMessage(this.type + ".readData(" + iCylinder + ":" + iHead + ":" + iSector + ") " + Str.toOct(addr) + "--" + Str.toOct(addr + (nWords << 1)), true, true); + + if (!disk) { + nError = drive.iDrive? RX11.ERROR.HOME1 : RX11.ERROR.HOME0; + nWords = 0; + } + + var sWords = ""; + while (nWords) { + if (!sector) { + if (iCylinder >= disk.nCylinders) { + nError = RX11.ERROR.NO_TRACK; + break; + } + sector = disk.seek(iCylinder, iHead, iSector + 1); + if (!sector) { + nError = RX11.ERROR.NO_SECTOR; + break; + } + ibSector = 0; + if (++iSector >= disk.nSectors) { + iSector = 0; + if (++iHead >= disk.nHeads) { + iHead = 0; + ++iCylinder; + } + } + } + var b0, b1; + if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) { + nError = RX11.ERROR.NO_DATA; + break; + } + var data = b0 | (b1 << 8); + this.bus.setWordDirect(this.cpu.mapUnibus(addr), data); + if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + if (!sWords) sWords = Str.toOct(addr) + ": "; + sWords += Str.toOct(data) + ' '; + if (sWords.length >= 64) { + console.log(sWords); + sWords = ""; + } + } + if (ibSector >= disk.cbSector) sector = null; + addr += inc; + nWords--; + } + + return done? done(nError, iCylinder, iHead, iSector, nWords, addr) : nError; + } + + /** + * readSector() + * + * @this {RX11} + */ + readSector() + { + var nError = 0; + var iDrive = (this.regRXCS & RX11.RXCS.UNIT)? 1 : 0; + var drive = this.aDrives[iDrive]; + var disk = drive && drive.disk; + var iCylinder = this.regRXTA & RX11.RXTA.MASK, iHead = 0, nSector = this.regRXSA & RX11.RXSA.MASK; + + this.regRXES &= ~(RX11.RXES.CRC | RX11.RXES.PARITY | RX11.RXES.DEL | RX11.RXES.DRDY); + + if (disk) { + this.regRXES |= RX11.RXES.DRDY; + if (this.messageEnabled()) this.printMessage(this.type + ".readSector(" + iCylinder + ":" + iHead + ":" + nSector + ")", true, true); + this.assert(nSector); // RX sector numbers (unlike RK and RL) are supposed to be 1-based + var sector = disk.seek(iCylinder, iHead, nSector, true); + if (sector) { + var i = 0, nBytes = this.abBuffer.length; + while (i < nBytes) { + var b = disk.read(sector, i); + if (b < 0) { + nError = RX11.ERROR.NO_DATA; + break; + } + this.abBuffer[i++] = b; + } + if (sector.deleted) this.regRXES |= RX11.RXES.DEL; + } else { + nError = RX11.ERROR.NO_SECTOR; + } + } else { + nError = iDrive? RX11.ERROR.HOME1 : RX11.ERROR.HOME0; + } + this.doneCommand(nError); + } + + /** + * writeSector(fDeleted) + * + * @this {RX11} + * @param {boolean} fDeleted + */ + writeSector(fDeleted) + { + var nError = 0; + var iDrive = (this.regRXCS & RX11.RXCS.UNIT)? 1 : 0; + var drive = this.aDrives[iDrive]; + var disk = drive && drive.disk; + var iCylinder = this.regRXTA & RX11.RXTA.MASK, iHead = 0, nSector = this.regRXSA & RX11.RXSA.MASK; + + this.regRXES &= ~(RX11.RXES.CRC | RX11.RXES.PARITY | RX11.RXES.DEL | RX11.RXES.DRDY); + + if (disk) { + this.regRXES |= RX11.RXES.DRDY; + if (this.messageEnabled()) this.printMessage(this.type + ".writeSector(" + iCylinder + ":" + iHead + ":" + nSector + ")", true, true); + this.assert(nSector); // RX sector numbers (unlike RK and RL) are supposed to be 1-based + var sector = disk.seek(iCylinder, iHead, nSector, true); + if (sector) { + if (fDeleted) sector.deleted = true; + var i = 0, nBytes = this.abBuffer.length; + while (i < nBytes) { + var data = this.abBuffer[i]; + if (!disk.write(sector, i, data & 0xff)) { + nError = RX11.ERROR.NO_DATA; + break; + } + i++; + } + } else { + nError = RX11.ERROR.NO_SECTOR; + } + } else { + nError = iDrive? RX11.ERROR.HOME1 : RX11.ERROR.HOME0; + } + this.doneCommand(nError); + } + + /** + * readStatus() + * + * @this {RX11} + */ + readStatus() + { + var iDrive = (this.regRXCS & RX11.RXCS.UNIT)? 1 : 0; + var drive = this.aDrives[iDrive]; + + this.regRXES &= ~RX11.RXES.DRDY; + if (drive && drive.disk) this.regRXES |= RX11.RXES.DRDY; + + this.regRXDB = this.regRXES; + this.doneCommand(); + } + + /** + * readError() + * + * @this {RX11} + */ + readError() + { + this.regRXDB = this.regError; + this.doneCommand(); + } + + /** + * readRXCS(addr) + * + * @this {RX11} + * @param {number} addr (eg, PDP11.UNIBUS.RXCS or 177170) + * @param {boolean} [fPreWrite] + * @return {number} + */ + readRXCS(addr, fPreWrite) + { + var w = this.regRXCS; + + if (!fPreWrite) { + w &= RX11.RXCS.RMASK; + + switch (this.funCode) { + + case RX11.FUNC.FILL: + case RX11.FUNC.EMPTY: + if (this.iBuffer < this.abBuffer.length) { + this.regRXCS |= RX11.RXCS.TR; + } + break; + + case RX11.FUNC.READ: + case RX11.FUNC.WRITE: + case RX11.FUNC.WRDEL: + if (this.iBuffer < 2) { + this.regRXCS |= RX11.RXCS.TR; + } + break; + } + } + return w; + } + + /** + * writeRXCS(data, addr) + * + * @this {RX11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.RXCS or 177170) + */ + writeRXCS(data, addr) + { + this.regRXCS = (this.regRXCS & ~RX11.RXCS.WMASK) | (data & RX11.RXCS.WMASK); + + if (this.regRXCS & RX11.RXCS.INIT) { + this.initController(); + return; + } + + if ((this.regRXCS & RX11.RXCS.GO) && this.funCode == RX11.FUNC.UNUSED) { + this.processCommand(); + return; + } + + if (!(this.regRXCS & RX11.RXCS.IE)) { + this.cpu.clearIRQ(this.irq); + } + else if (this.regRXCS & RX11.RXCS.DONE) { + this.cpu.setIRQ(this.irq); + } + } + + /** + * readRXDB(addr) + * + * @this {RX11} + * @param {number} addr (eg, PDP11.UNIBUS.RXDB or 177172) + * @param {boolean} [fPreWrite] + * @return {number} + */ + readRXDB(addr, fPreWrite) + { + if (!fPreWrite) { + switch (this.funCode) { + + case RX11.FUNC.EMPTY: + if (this.regRXCS & RX11.RXCS.TR) { + this.regRXCS &= ~RX11.RXCS.TR; + this.assert(this.iBuffer < this.abBuffer.length); + this.regRXDB = this.abBuffer[this.iBuffer] & 0xff; + if (this.messageEnabled()) this.printMessage(this.type + ".readByte(" + this.iBuffer + "): " + Str.toHexByte(this.regRXDB), true, true); + if (++this.iBuffer >= this.abBuffer.length) { + this.doneCommand(); + } + } + break; + } + } + return this.regRXDB; + } + + /** + * writeRXDB(data, addr) + * + * @this {RX11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.RXDB or 177172) + */ + writeRXDB(data, addr) + { + switch(this.funCode) { + + case RX11.FUNC.FILL: + if (this.regRXCS & RX11.RXCS.TR) { + this.regRXCS &= ~RX11.RXCS.TR; + this.assert(this.iBuffer < this.abBuffer.length); + this.abBuffer[this.iBuffer] = data & 0xff; + if (this.messageEnabled()) this.printMessage(this.type + ".writeByte(" + this.iBuffer + "," + Str.toHexByte(data) + ")", true, true); + if (++this.iBuffer >= this.abBuffer.length) { + this.doneCommand(); + } + } + break; + + case RX11.FUNC.READ: + case RX11.FUNC.WRITE: + case RX11.FUNC.WRDEL: + if (this.regRXCS & RX11.RXCS.TR) { + this.regRXCS &= ~RX11.RXCS.TR; + + switch(this.iBuffer++) { + case 0: + this.regRXSA = data; + break; + + case 1: + this.regRXTA = data; + if (this.funCode == RX11.FUNC.READ) { + this.readSector(); + } else { + this.writeSector(this.funCode == RX11.FUNC.WRDEL); + } + break; + + default: + this.assert(false); + break; + } + } + break; + } + this.regRXDB = data; + } +} + +/* + * Alias RX11 definitions as class constants + */ +RX11.RXCS = PDP11.RX11.RXCS; // 177170: Command and Status Register +RX11.RXDB = PDP11.RX11.RXDB; // 177172: Data Buffer Register +RX11.RXTA = PDP11.RX11.RXTA; +RX11.RXSA = PDP11.RX11.RXSA; +RX11.RXES = PDP11.RX11.RXES; +RX11.FUNC = PDP11.RX11.FUNC; +RX11.ERROR = PDP11.RX11.ERROR; + +RX11.FUNCS = [ + "FILL", "EMPTY", "WRITE", "READ", "UNUSED", "RDSTAT", "WRDEL", "RDERR" +]; + +/* + * ES6 ALERT: As you can see below, I've finally started using computed property names. + */ +RX11.UNIBUS_IOTABLE = { + [PDP11.UNIBUS.RXCS]: /* 177170 */ [null, null, RX11.prototype.readRXCS, RX11.prototype.writeRXCS, "RXCS"], + [PDP11.UNIBUS.RXDB]: /* 177172 */ [null, null, RX11.prototype.readRXDB, RX11.prototype.writeRXDB, "RXDB"] +}; + +if (NODE) module.exports = RX11; diff --git a/modules/shared/lib/diskapi.js b/modules/shared/lib/diskapi.js index f06355871..69c9f8ef9 100644 --- a/modules/shared/lib/diskapi.js +++ b/modules/shared/lib/diskapi.js @@ -93,8 +93,9 @@ DiskAPI.DISK_FORMATS = { */ 21368320:[615,4,17], // PC AT 20Mb hard drive (type 2) /* - * Assorted DEC disk pack formats. + * Assorted DEC disk formats. */ + 256256: [77, 1,26,128], // RX01 single-platter diskette: 77 tracks, 1 head, 26 sectors/track, 128 bytes/sector, for a total of 256256 bytes 2494464: [203,2,12,512], // RK03 single-platter disk cartridge: 203 tracks, 2 heads, 12 sectors/track, 512 bytes/sector, for a total of 2494464 bytes 5242880: [256,2,40,256], // RL01K single-platter disk cartridge: 256 tracks, 2 heads, 40 sectors/track, 256 bytes/sector, for a total of 5242880 bytes 10485760:[512,2,40,256] // RL02K single-platter disk cartridge: 512 tracks, 2 heads, 40 sectors/track, 256 bytes/sector, for a total of 10485760 bytes diff --git a/package.json b/package.json index 9a1a0089c..c2795b196 100644 --- a/package.json +++ b/package.json @@ -203,6 +203,7 @@ "./modules/pdp11/lib/drive.js", "./modules/pdp11/lib/rk11.js", "./modules/pdp11/lib/rl11.js", + "./modules/pdp11/lib/rx11.js", "./modules/shared/lib/debugger.js", "./modules/pdp11/lib/debugger.js", "./modules/pdp11/lib/computer.js", diff --git a/pubs/dec/pdp11/README.md b/pubs/dec/pdp11/README.md index d343fb05e..7e468f1ad 100644 --- a/pubs/dec/pdp11/README.md +++ b/pubs/dec/pdp11/README.md @@ -4,7 +4,7 @@ title: DEC PDP-11 Publications and Papers permalink: /pubs/dec/pdp11/ --- -DEC PDP-11 Publications +PDP-11 Hardware Publications --- This page summarizes PDP-11 documentation that was useful in creating [PDPjs](/modules/pdp11/). In most cases, @@ -29,6 +29,35 @@ directory. If a PDF was not searchable, it was "OCR'ed" before being archived b - [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 KW11](kw11/) + +- [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/) + +- [M9312 Bootstrap/Terminator Module Technical Manual (Oct 1979)](http://archive.pcjs.org/pubs/dec/pdp11/m9312/M9312_Bootstrap_Terminator_Module_Technical_Manual.pdf) + +[PDP-11 RK11](rk11/) + +- [CXRKAG0 DEC/X11 RK11 MODULE (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/AC-E676G-MC_CXRKAG0-RK11_Sep78.pdf) +- [RK11-D and RK11-E Moving Head Disk Drive Controller Manual (Feb 1975)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/EK-RK11D-MM-002.pdf) + +[PDP-11 RL11](rl11/) + +- [RL01/RL02 User Guide (Sep 1981)](http://archive.pcjs.org/pubs/dec/pdp11/rl11/EK-RL012-UG-005_Sep81.pdf) + +[PDP-11 RX11](rx11/) + +- [RX8/RX11 floppy disk system user's manual (Nov 1976)](http://archive.pcjs.org/pubs/dec/pdp11/rx11/EK-RX01-OP-001_RX11UM_Nov76.pdf) + +[Other PDP-11 Peripherals](other/) + +- [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf) + +PDP-11 Software Publications +--- + [PDP-11 BASIC](basic/) - [PDP-11 BASIC Programming Manual (1970)](http://archive.pcjs.org/pubs/dec/pdp11/basic/BASIC_Programming_Manual_Dec70.pdf) @@ -49,44 +78,26 @@ directory. If a PDF was not searchable, it was "OCR'ed" before being archived b - [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)] +- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-9045F-MC_CZQMCFO_MEM_EXER_16K_Feb78.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) [[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/) - -- [M9312 Bootstrap/Terminator Module Technical Manual (Oct 1979)](http://archive.pcjs.org/pubs/dec/pdp11/m9312/M9312_Bootstrap_Terminator_Module_Technical_Manual.pdf) - -[PDP-11 MACRO-11](macro11/) +[MACRO-11](macro11/) - [MACRO-11 Reference Manual (Dec 1975)](http://archive.pcjs.org/pubs/dec/pdp11/macro11/MACRO11_Dec75.pdf) - [MACRO-11 Language Reference Manual (Mar 1983)](http://archive.pcjs.org/pubs/dec/pdp11/macro11/MACRO11_Mar83.pdf) -[PDP-11 PC11](pc11/) +[RT-11](rt11/) -- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Absolute_Loader_Listing_Jun75.pdf) -- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Mem-Exer-16k_Feb78.pdf) -- [PDP-11 Paper Tape Software Handbook (Apr 1976)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Paper_Tape_Software_Handbook.pdf) +- [RT-11 v4.0 Installation and System Generation Guide (Mar 1980)](http://archive.pcjs.org/pubs/dec/pdp11/rt11/AA-H376A-TC_RT-11_V4.0_Installation_Manual_Mar81.pdf) -[PDP-11 RK11](rk11/) - -- [CXRKAG0 DEC/X11 RK11 MODULE (Sep 1978)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/AC-E676G-MC_CXRKAG0-RK11_Sep78.pdf) -- [RK11-D and RK11-E Moving Head Disk Drive Controller Manual (Feb 1975)](http://archive.pcjs.org/pubs/dec/pdp11/rk11/EK-RK11D-MM-002.pdf) - -[PDP-11 RL11](rl11/) - -- [RL01/RL02 User Guide (Sep 1981)](http://archive.pcjs.org/pubs/dec/pdp11/rl11/EK-RL012-UG-005_Sep81.pdf) - ---- - -[Assorted PDP-11 Handbooks](other/) +[Other PDP-11 Software](other/) +- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA_ABSOLUTE_LOADER_LISTING_Jun75.pdf) - [PDP-11 Paper Tape Software Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Paper_Tape_Software_Handbook_1976.pdf) -- [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf) - [PDP-11 Software Handbook (1978)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Software_Handbook_1978.pdf) +PDP-11 Research Papers +--- + [Assorted PDP-11 Papers](papers/) diff --git a/pubs/dec/pdp11/diags/README.md b/pubs/dec/pdp11/diags/README.md index f6289f423..e36bc4dff 100644 --- a/pubs/dec/pdp11/diags/README.md +++ b/pubs/dec/pdp11/diags/README.md @@ -22,6 +22,7 @@ PDPjs development and testing relied on the following PDP-11 diagnostic publicat - [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)] +- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/diags/AC-9045F-MC_CZQMCFO_MEM_EXER_16K_Feb78.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/). diff --git a/pubs/dec/pdp11/other/README.md b/pubs/dec/pdp11/other/README.md index 56f36bd76..32f2791f6 100644 --- a/pubs/dec/pdp11/other/README.md +++ b/pubs/dec/pdp11/other/README.md @@ -9,6 +9,7 @@ DEC PDP-11 Assorted Handbooks PDPjs development and testing relied on the following PDP-11 publications: +- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA_ABSOLUTE_LOADER_LISTING_Jun75.pdf) - [PDP-11 Paper Tape Software Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Paper_Tape_Software_Handbook_1976.pdf) - [PDP-11 Peripherals Handbook (1976)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Peripherals_Handbook_1976.pdf) - [PDP-11 Software Handbook (1978)](http://archive.pcjs.org/pubs/dec/pdp11/other/PDP11_Software_Handbook_1978.pdf) diff --git a/pubs/dec/pdp11/pc11/README.md b/pubs/dec/pdp11/pc11/README.md deleted file mode 100644 index 0a6e448ec..000000000 --- a/pubs/dec/pdp11/pc11/README.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: page -title: DEC PDP-11 PC11 Paper Tape Reader -permalink: /pubs/dec/pdp11/pc11/ ---- - -DEC PDP-11 PC11 Paper Tape Reader ---- - -PDPjs development and testing relied on the following PDP-11 publications: - -- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Absolute_Loader_Listing_Jun75.pdf) -- [CZQMCF0 0-124K MEM EXER 16K (Feb 1978)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Mem-Exer-16k_Feb78.pdf) -- [PDP-11 Paper Tape Software Handbook (Apr 1976)](http://archive.pcjs.org/pubs/dec/pdp11/pc11/Paper_Tape_Software_Handbook.pdf) diff --git a/pubs/dec/pdp11/rt11/README.md b/pubs/dec/pdp11/rt11/README.md new file mode 100644 index 000000000..93a6b2548 --- /dev/null +++ b/pubs/dec/pdp11/rt11/README.md @@ -0,0 +1,12 @@ +--- +layout: page +title: DEC RT-11 Publications +permalink: /pubs/dec/pdp11/rt11/ +--- + +DEC RT-11 Publications +--- + +### RT-11 v4.0 + +- [RT-11 Installation and System Generation Guide (Mar 1980)](http://archive.pcjs.org/pubs/dec/pdp11/rt11/AA-H376A-TC_RT-11_V4.0_Installation_Manual_Mar81.pdf) diff --git a/pubs/dec/pdp11/rx11/README.md b/pubs/dec/pdp11/rx11/README.md new file mode 100644 index 000000000..643909426 --- /dev/null +++ b/pubs/dec/pdp11/rx11/README.md @@ -0,0 +1,12 @@ +--- +layout: page +title: DEC PDP-11 RX11 Disk Controller +permalink: /pubs/dec/pdp11/rx11/ +--- + +DEC PDP-11 RX11 Disk Controller +--- + +PDPjs development and testing relied on the following PDP-11 publications: + +- [RX8/RX11 floppy disk system user's manual (Nov 1976)](http://archive.pcjs.org/pubs/dec/pdp11/rx11/EK-RX01-OP-001_RX11UM_Nov76.pdf) diff --git a/versions/pcx86/1.33.1/pcx86-dbg.js b/versions/pcx86/1.33.1/pcx86-dbg.js index 9f6801be2..1f626477d 100644 --- a/versions/pcx86/1.33.1/pcx86-dbg.js +++ b/versions/pcx86/1.33.1/pcx86-dbg.js @@ -44,10 +44,10 @@ http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017 */ var l,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]} -var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, -"+":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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"];fa[191]=n["?"]; -fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"]; +var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={jp:0,lp:1,mp:2,hl:3,np:4,op:5,pp:6,qp:7,rp:8,sp:9,tp:10,up:11,vp:12,wp:13,xp:14,yp:15,zp:16,Ap:17,Bp:18,Cp:19,Dp:20,Ep:21,Fp:22,Gp:23,Hp:24,Ip:25,Jp:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39, +"(":40,")":41,"*":42,"+":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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,bn:108,fn:109,n:110,on:111,p:112,q:113,r:114,Lo:115,t:116,Oo:117,Po:118,Qo:119,x:120, +y:121,z:122,"{":123,"|":124,"}":125,"~":126,Kp:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var fa={};fa[n["1"]]=n["!"];fa[n["2"]]=n["@"];fa[n["3"]]=n["#"];fa[n["4"]]=n.$;fa[n["5"]]=n["%"];fa[n["6"]]=n["^"];fa[n["7"]]=n["&"];fa[n["8"]]=n["*"];fa[n["9"]]=n["("];fa[n["0"]]=n[")"];fa[186]=n[":"];fa[187]=n["+"];fa[188]=n["<"];fa[189]=n._;fa[190]=n[">"]; +fa[191]=n["?"];fa[192]=n["~"];fa[219]=n["{"];fa[220]=n["|"];fa[221]=n["}"];fa[222]=n['"'];fa[173]=n._;fa[61]=n["+"];fa[59]=n[":"]; function ga(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function ia(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d} function ja(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d}function q(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function r(a){return q(a,2,!0)}function ka(a){return q(a,4,!0)} diff --git a/versions/pcx86/1.33.1/pcx86.js b/versions/pcx86/1.33.1/pcx86.js index bda2ac5b1..f0b4b21d4 100644 --- a/versions/pcx86/1.33.1/pcx86.js +++ b/versions/pcx86/1.33.1/pcx86.js @@ -44,10 +44,10 @@ http://pcjs.org/modules/shared/lib/save.js (C) Jeff Parsons 2012-2017 */ var k,aa;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]} -var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, -"+":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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"];p[192]=n["~"];p[219]=n["{"]; -p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"]; +var da={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],256256:[77,1,26,128],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},n={Ln:0,Nn:1,On:2,Zj:3,Pn:4,Qn:5,Rn:6,Sn:7,Tn:8,Un:9,Vn:10,Wn:11,Xn:12,Yn:13,Zn:14,$n:15,ao:16,bo:17,co:18,eo:19,fo:20,ho:21,io:22,jo:23,ko:24,lo:25,mo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39, +"(":40,")":41,"*":42,"+":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,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Ol:109,n:110,Tl:111,p:112,q:113,r:114,nn:115,t:116,qn:117,rn:118,sn:119,x:120, +y:121,z:122,"{":123,"|":124,"}":125,"~":126,no:127},ea={};ea[173]=n["-"];ea[186]=n[";"];ea[187]=n["="];ea[189]=n["-"];ea[188]=n[","];ea[190]=n["."];ea[191]=n["/"];ea[192]=n["`"];ea[219]=n["["];ea[220]=n["\\"];ea[221]=n["]"];ea[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"]; +p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"]; function fa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ha(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return la[a]})}function ma(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} diff --git a/versions/pdpjs/1.33.1/pdp11-dbg.js b/versions/pdpjs/1.33.1/pdp11-dbg.js index 9051532e5..d7082659f 100644 --- a/versions/pdpjs/1.33.1/pdp11-dbg.js +++ b/versions/pdpjs/1.33.1/pdp11-dbg.js @@ -16,6 +16,7 @@ http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/rx11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2017 @@ -34,342 +35,354 @@ http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function fa(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ga(this)}});fa=function(){}}function ga(a){var b=0;return ha(function(){return b":62,"?":63,"@":64,nd:65,Fh:66,Ih:67,gi:68,E:69,mi:70,oi:71,Bi:72,Di:73,Ei:74,Fi:75,Gi:76,Ji:77,Li:78,Ni:79,Qi:80,Q:81,Si:82,Ui:83,bj:84,dj:85,fj:86,gj:87,kj:88,lj:89,Xe:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,mj:97,nj:98,qj:99,d:100,e:101,rj:102,sj:103,tj:104,uj:105,yj:106,k:107,zj:108,Aj:109,n:110,Bj:111,p:112,q:113,r:114,Cj:115,t:116,Fj:117,Gj:118,Hj:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,oe:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Cd=b.comment;this.Ue=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Eb=this.id:(this.pb=this.id.substr(0,a),this.Eb=this.id.substr(a+1));this.A={ready:!1,jb:!1,$c:!1,Z:!1,error:!1};this.yc=null;this.A.error=!1;this.fa=c||0;this.F=this.f=this.C=this.K=this.Qa=null;ua.push(this)}function va(a,b,c){xa[a]&&b&&(xa[a][b]=c)} -function ya(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function za(a){var b=!1;window&&(b=window.confirm(a));return b}function Aa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c":62,"?":63,"@":64,Fd:65,mi:66,ti:67,Ui:68,E:69,$i:70,cj:71,oj:72,qj:73,rj:74,sj:75,tj:76,wj:77,yj:78,Ej:79,Hj:80,Q:81,Jj:82,Mj:83,Vj:84,Xj:85,Zj:86,$j:87,dk:88,ek:89,tf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,fk:97,gk:98,jk:99,d:100,e:101,kk:102,lk:103,mk:104,nk:105,sk:106,k:107,tk:108,uk:109,n:110,vk:111,p:112,q:113,r:114,wk:115,t:116,zk:117,Ak:118,Bk:119,x:120, +y:121,z:122,"{":123,"|":124,"}":125,"~":126,cc:127};function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Sd=b.comment;this.rf=b;this.exports={};this.H=this.bindings={};a=this.id.indexOf(".");0>a?this.Mb=this.id:(this.wb=this.id.substr(0,a),this.Mb=this.id.substr(a+1));this.A={ready:!1,gb:!1,td:!1,aa:!1,error:!1};this.Kc=null;this.A.error=!1;this.ha=c||0;this.F=this.f=this.D=this.K=this.Ta=null;ma.push(this)}function oa(a,b,c){pa[a]&&b&&(pa[a][b]=c)} +function qa(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ra(a){var b=!1;window&&(b=window.confirm(a));return b}function ta(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=1,f--;return d}function E(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} -function Ra(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Sa(a){return F(a,4,!0)} -function Ta(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Xa[a]})}function Ya(a,b){return(a+" ").slice(0,b)} -function Za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Xa={"&":"&","<":"<",">":">",'"':""","'":"'"},$a={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 ab(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"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 fb(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, +function Ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=1,f--;return d}function E(a,b,c){var d="";b?11>=3;return(c?"0o":"")+d} +function Ga(a){var b=2,c="";b?10=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function Ha(a){return F(a,4,!0)} +function Ja(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Na[a]})}function Oa(a,b){return(a+" ").slice(0,b)} +function Pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Na={"&":"&","<":"<",">":">",'"':""","'":"'"},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(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"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 Xa(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 gb(a,b){var c,d={ba:null,ea:null,xa:null,wa: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.xa=g.load;d.wa=g.exec;if(e=g.bytes)d.ba=e;else if(e=g.words)for(d.ba=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ba=Array(4*e.length),f=c=0;c>8&255,d.ba[f++]=e[c]>>16&255,d.ba[f++]=e[c]>>24&255;else d.ba=g;d.ea=g.symbols;d.ba.length?1==d.ba.length&&(v(d.ba[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.pf,a];this.F=this.f=this.C=this.K=null;y(this)}p(Rb,q);h=Rb.prototype; -h.reset=function(a){this.stop();a&&Zb(this,this.Ta=0)}; -h.ua=function(a,b,c,d){if(this.K&&this.K.ua(a,b,c,d)||this.f&&this.f.ua(a,b,c,d)||this.F&&this.F.ua(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.H[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){$b(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ac(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){$b(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ac(a,b)}}(this,b),!0):q.prototype.ua.call(this,a,b,c,d)}};h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;bc(b,this,cc);dc(b,this.reset.bind(this));ec(this);fc(this)}; -h.Ca=function(a,b){if(!b)if(this.M&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.da,this.Ta,this.Ua]);return a.data()};h.restore=function(a){if(a=a[0])hc(this,this.da=a[0]),Zb(this,this.Ta=a[1]),ic(this,a[2]);return!0};function jc(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.i)jc(a,c,null!=b?b:a.i[c])} -function kc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function fc(a){for(var b in a.b)kc(a,b,a.b[b][1])}function lc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Aa||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function $b(a,b){var c=a.b[b];kc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=mc&&(a.G=b==nc,a.I=b==oc)} -function ac(a,b){var c=a.b[b];c[2]&&c[3]&&(kc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.mf=function(a){a||this.f.A.T||(a=this.f,a.C.reset(),pc(a),this.b[qc]&&this.b[qc][1]&&rc(this.f))};h.nf=function(){};h.hf=function(a){a||this.f.aa()}; -h.ff=function(a){if(!a&&!this.f.A.T)if(this.b[qc]&&this.b[qc][1])rc(this.f);else{if((a=this.F)&&!Ja(a,!0))Ka(a,!0),sc(a,0,null),Ka(a,!1);else try{var b=this.f.pc(1);0=a.f.ia?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.C.I;a.b[mc]&&a.b[mc][1]||(b=-b);hc(a,a.da&~c|a.da+b&c)} -function hc(a,b){a.da=b&a.C.I;if(a.B!==a.da){a.B=a.da;b=a.B;for(var c=0;22>c;c++)Mc(a,"A"+c,b&1<c;c++)Mc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.G=this.M/this.j|0;this.U=this.G-1;this.Na=[];this.la=0;this.D=!1;this.N=[];this.Ye=[Sc,Tc,Uc,Vc];this.b=this.v=[];this.B=this.L=this.w=this.O=this.P=0;a=new J(this);Wc(a,this.F);this.b=Array(this.G);this.v=Array(this.G);for(b=0;b>>this.g;this.L=0;this.w=this.I;y(this)}p(Qc,q);function Zc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.v[a.P]=a.b[a.O])}}h=Qc.prototype;h.reset=function(){for(var a=0;ab.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.za=g.load;d.ya=g.exec;if(e=g.bytes)d.ca=e;else if(e=g.words)for(d.ca=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ca=Array(4*e.length),f=c=0;c>8&255,d.ca[f++]=e[c]>>16&255,d.ca[f++]=e[c]>>24&255;else d.ca=g;d.ga=g.symbols;d.ca.length?1==d.ca.length&&(v(d.ca[0]),d=null):(v("Empty resource: "+a),d=null)}catch(k){v("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.b["S"+a]=[0,0,!1,!1,this.Pf,a];this.F=this.f=this.D=this.K=null;y(this)}p(Mb,r);h=Mb.prototype; +h.reset=function(a){this.stop();a&&Ob(this,this.Wa=0)}; +h.va=function(a,b,c,d){if(this.K&&this.K.va(a,b,c,d)||this.f&&this.f.va(a,b,c,d)||this.F&&this.F.va(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.H[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.H[b]=c,this.i[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.H[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, +b){return function(){Pb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Qb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Pb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Qb(a,b)}}(this,b),!0):r.prototype.va.call(this,a,b,c,d)}};h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;Rb(b,this,Sb);Tb(b,this.reset.bind(this));Ub(this);Vb(this)}; +h.Da=function(a,b){if(!b)if(this.M&&Wb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};h.Ca=function(a){return a?this.save():!0};h.save=function(){var a=new G(this);a.set(0,[this.fa,this.Wa,this.Xa]);return a.data()};h.restore=function(a){if(a=a[0])Xb(this,this.fa=a[0]),Ob(this,this.Wa=a[1]),Yb(this,a[2]);return!0};function ec(a,b,c){if(a=a.H[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Ub(a,b){for(var c in a.i)ec(a,c,null!=b?b:a.i[c])} +function fc(a,b,c){if(a=a.H[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Vb(a){for(var b in a.b)fc(a,b,a.b[b][1])}function gc(a,b,c,d){if(a.H[b]){var e=a.F&&a.F.Ba||8;c=c||0;c=8==e?E(c,d):F(c,d);a.H[b].textContent!=c&&(a.H[b].textContent=c)}}function Pb(a,b){var c=a.b[b];fc(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=hc&&(a.G=b==ic,a.I=b==jc)} +function Qb(a,b){var c=a.b[b];c[2]&&c[3]&&(fc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Nf=function(a){a||this.f.A.V||(a=this.f,a.D.reset(),kc(a),this.b[lc]&&this.b[lc][1]&&mc(this.f))};h.Of=function(){};h.Jf=function(a){a||this.f.ba()}; +h.Hf=function(a){if(!a&&!this.f.A.V)if(this.b[lc]&&this.b[lc][1])mc(this.f);else{if((a=this.F)&&!Ba(a,!0))Da(a,!0),nc(a,0,null),Da(a,!1);else try{var b=this.f.Ac(1);0=a.f.ka?8:16,c=65472<=a.fa&&a.fa<65472+b,b=c?1:2,c=c?15:a.D.I;a.b[hc]&&a.b[hc][1]||(b=-b);Xb(a,a.fa&~c|a.fa+b&c)} +function Xb(a,b){a.fa=b&a.D.I;if(a.B!==a.fa){a.B=a.fa;b=a.B;for(var c=0;22>c;c++)wc(a,"A"+c,b&1<c;c++)wc(a,"D"+c,b&1<c;c++)a.b["S"+c][1]=b&1<>2;this.i=this.j-1;this.G=this.M/this.j|0;this.S=this.G-1;this.Pa=[];this.na=0;this.C=!1;this.N=[];this.uf=[Cc,Dc,Ec,Fc];this.b=this.u=[];this.B=this.L=this.w=this.O=this.P=0;a=new I(this);Gc(a,this.F);this.b=Array(this.G);this.u=Array(this.G);for(b=0;b>>this.g;this.L=0;this.w=this.I;y(this)}p(Ac,r);function Jc(a,b){if(b!=a.L){for(var c=0;c>>a.g,a.u[a.P]=a.b[a.O])}}h=Ac.prototype;h.reset=function(){for(var a=0;a>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Ob+=l.J-f,l.J=f,!0;if(f>=l.J+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return ad(bd,f,g)}f=new J(a,f,n,a.j,d,e);Wc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+cd[d]+" at "+E(b)),!0):ad(dd,b,c)}h.od=function(a){return this.v[(a&this.w)>>>this.g].xb(a&this.i,a)}; -h.oc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Lb||b!=this.i?this.v[c].na(b,a):this.v[c++].xb(b,a)|this.v[c&this.U].xb(0,a+1)<<8};h.pd=function(a,b){this.v[(a&this.w)>>>this.g].zb(a&this.i,b,a)};h.Sb=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Lb||c!=this.i?this.v[d].Ab(c,b,a):(this.v[d++].zb(c,b&255,a),this.v[d&this.U].zb(0,b>>8&255,a+1))};function ed(a,b){return a.b[(b&a.I)>>>a.g]} -function zc(a,b){var c;a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|ed(a,b+1).K(0,b+1)<<8;a.la--;return c}function fd(a,b,c){a.D=!1;a.la++;ed(a,b).F(b&a.i,c&255,b);a.la--}function xc(a,b,c){a.D=!1;a.la++;var d=b&a.i,e=ed(a,b);Lb||d!=a.i?e.D(d,c&65535,b):(e.F(d,c&255,b),ed(a,b+1).F(0,c>>8&255,b+1));a.la--} -function $c(a){for(var b=0,c=[],d=0;da.f.ia)){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>8:e[2](f)&255):f&1&&(e=d.Na[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&A(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,3);c=255;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} -function Tc(a,b,c){var d=!1,e=this.controller,f=e.Na[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.Na[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&&A(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,5),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+K(this.f,c)+": "+K(this.f, -b),!0,!e.la))}function Uc(a,b){var c=-1,d=this.controller;a=d.Na[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+K(this.f,b)+"): "+K(this.f,c),!0,!d.la),c;d.La(b,16,2);c=65535;this.f&&A(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+K(this.f,b)+": "+K(this.f,c),!0,!d.la);return c} -function Vc(a,b,c){var d=!1,e=this.controller;a=e.Na[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&A(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0,!e.la):(e.La(c,16,4),this.f&&A(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+K(this.f,c)+": "+K(this.f,b),!0,!e.la))}function L(a){q.call(this,"Device",a,256);this.b={bb:128,ld:-1}}p(L,q);h=L.prototype; -h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.ld=ld(c,function(){e.b.bb|=128;e.b.bb&64&&md(e.f,e.b.Lb);e.K&&I(e.K,1);nd(e.f,e.b.ld,1E3/60)});this.b.Lb=od(c,64,6,524288);bc(b,this,pd);dc(b,this.reset.bind(this));d&&qd(d,64,function(a){var b=e.f;rd(e,"KIPDR",b.B[0],0,a[0]);rd(e,"KDPDR",b.B[0],8,a[0]);rd(e,"KIPAR",b.M[0],0,a[0]);rd(e,"KDPAR",b.M[0],8,a[0],!0);rd(e,"SIPDR",b.B[1],0,a[0]);rd(e,"SDPDR",b.B[1],8,a[0]);rd(e,"SIPAR",b.M[1],0,a[0]);rd(e,"SDPAR",b.M[1],8,a[0], -!0);rd(e,"UIPDR",b.B[3],0,a[0]);rd(e,"UDPDR",b.B[3],8,a[0]);rd(e,"UIPAR",b.M[3],0,a[0]);rd(e,"UDPAR",b.M[3],8,a[0],!0);b.V&32&&rd(e,"UNIMAP",b.Fa,-1,a[0])});y(this)};function rd(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Fa[a>>1];return a&1?b>>16:b&65535};h.wh=function(a,b){b=b>>1&63;var c=b>>1;this.f.Fa[c]=b&1?this.f.Fa[c]&65535|(a&63)<<16:this.f.Fa[c]&-65536|a&65534};h.gg=function(a){return this.f.B[1][a>>1&7]};h.ph=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.eg=function(a){return this.f.B[1][(a>>1&7)+8]};h.nh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.fg=function(a){return this.f.M[1][a>>1&7]}; -h.oh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.dg=function(a){return this.f.M[1][(a>>1&7)+8]};h.mh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Af=function(a){return this.f.B[0][a>>1&7]};h.Kg=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.Ig=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.zf=function(a){return this.f.M[0][a>>1&7]};h.Jg=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; -h.xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.Hg=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.mg=function(a){return this.f.B[3][a>>1&7]};h.vh=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.kg=function(a){return this.f.B[3][(a>>1&7)+8]};h.th=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.lg=function(a){return this.f.M[3][a>>1&7]};h.uh=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.jg=function(a){return this.f.M[3][(a>>1&7)+8]}; -h.sh=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Mb=function(a){a&=7;return this.f.w&2048?this.f.pa[a]:this.f.g[a]};h.Qb=function(a,b){b&=7;this.f.w&2048?this.f.pa[b]=a:this.f.g[b]=a};h.Lf=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.Tg=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.Of=function(){return this.f.g[7]};h.Wg=function(a){this.f.g[7]=a};h.Nb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.pa[a]}; -h.Rb=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.pa[b]=a};h.Mf=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ug=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.Nf=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Vg=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.wf=function(a){return this.f.lc[a-65504>>1]};h.Gg=function(a,b){this.f.lc[b-65504>>1]=a};h.de=function(a){return 65520==a?(gd(this.C)>>6)-1:0}; -h.ie=function(){};h.ig=function(){return 1};h.rh=function(){};h.vf=function(){return this.f.P};h.Fg=function(){this.f.P=0};h.Cf=function(){return this.f.ic};h.Mg=function(a,b){b&1||(a&=255);this.f.ic=a};h.Hf=function(a,b){return b?0:this.f.$a};h.Pg=function(a){zd(this.f,a)};h.hg=function(a,b){return b?0:this.f.va&65280};h.qh=function(a){this.f.va=a|255};h.Kf=function(){return Ad(this.f)};h.Sg=function(a){Bd(this.f,a)};h.he=function(a,b){A(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)}; -var N={},pd=(N[61568]=[null,null,L.prototype.ng,L.prototype.wh,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.gg,L.prototype.ph,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.eg,L.prototype.nh,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.fg,L.prototype.oh,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.dg,L.prototype.mh,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.Af,L.prototype.Kg,"KIPDR",8,1140,64],N[62672]=[null,null,L.prototype.yf,L.prototype.Ig,"KDPDR",8,1145,64],N[62688]= -[null,null,L.prototype.zf,L.prototype.Jg,"KIPAR",8,1140,64],N[62704]=[null,null,L.prototype.xf,L.prototype.Hg,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.Gf,L.prototype.Og,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.Bf,L.prototype.Lg,"LKS"],N[65402]=[null,null,L.prototype.Df,L.prototype.Ng,"MMR0",1,1140,64],N[65404]=[null,null,L.prototype.Ef,L.prototype.he,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.Ff,L.prototype.he,"MMR2",1,1140,64],N[65408]=[null,null,L.prototype.mg,L.prototype.vh, -"UIPDR",8,1140,64],N[65424]=[null,null,L.prototype.kg,L.prototype.th,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.lg,L.prototype.uh,"UIPAR",8,1140,64],N[65456]=[null,null,L.prototype.jg,L.prototype.sh,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Mb,L.prototype.Qb,"R0SET0"],N[65473]=[null,null,L.prototype.Mb,L.prototype.Qb,"R1SET0"],N[65474]=[null,null,L.prototype.Mb,L.prototype.Qb,"R2SET0"],N[65475]=[null,null,L.prototype.Mb,L.prototype.Qb,"R3SET0"],N[65476]=[null,null,L.prototype.Mb, -L.prototype.Qb,"R4SET0"],N[65477]=[null,null,L.prototype.Mb,L.prototype.Qb,"R5SET0"],N[65478]=[null,null,L.prototype.Lf,L.prototype.Tg,"R6KERNEL"],N[65479]=[null,null,L.prototype.Of,L.prototype.Wg,"R7KERNEL"],N[65480]=[null,null,L.prototype.Nb,L.prototype.Rb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Nb,L.prototype.Rb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Nb,L.prototype.Rb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Nb,L.prototype.Rb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Nb, -L.prototype.Rb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Nb,L.prototype.Rb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Mf,L.prototype.Ug,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Nf,L.prototype.Vg,"R6USER",1,1145],N[65504]=[null,null,L.prototype.wf,L.prototype.Gg,"CTRL",8,1170],N[65520]=[null,null,L.prototype.de,L.prototype.ie,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.de,L.prototype.ie,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ig,L.prototype.rh,"SYSID",1,1170],N[65526]= -[null,null,L.prototype.vf,L.prototype.Fg,"ERR",1,1170],N[65528]=[null,null,L.prototype.Cf,L.prototype.Mg,"MBR",1,1170],N[65530]=[null,null,L.prototype.Hf,L.prototype.Pg,"PIR"],N[65532]=[null,null,L.prototype.hg,L.prototype.qh,"SLR"],N[65534]=[null,null,L.prototype.Kf,L.prototype.Sg,"PSW"],N); -yb(function(){for(var a=x(document,w,"device"),b=0;b>1),this.b=new Int32Array(this.v,0,this.size>>2),Hd(this,Id?Jd:Kd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.tg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; -h.Dg=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.ab=!0};h.rf=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a);return this.K(a,b)};h.pg=function(a,b){this.f&&null!=this.J&&Zd(this.f,this.J+a,2);return this.B(a,b)}; -h.Bg=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a);this.j?this.Pb(0,b,c):this.F(a,b,c)};h.yh=function(a,b,c){this.f&&null!=this.J&&$d(this.f,this.J+a,2);this.j?this.Pb(0,b,c):this.D(a,b,c)};h.qf=function(a){return this.g[a]};h.sf=function(a,b){a=this.g[a];this.f&&A(this.f,32)&&D(this.f,"Memory.readByte("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.og=function(a,b){Kb&&a&1&&this.C.La(b,64,2);return this.w.getUint16(a,!0)}; -h.sg=function(a,b){Kb&&a&1&&this.C.La(b,64,2);a=!Lb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&A(this.f,32)&&D(this.f,"Memory.readWord("+K(this.f,b)+"): "+K(this.f,a),!0);return a};h.Ag=function(a,b){this.g[a]=b;this.ab=!0};h.Cg=function(a,b,c){this.g[a]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeByte("+K(this.f,c)+","+K(this.f,b)+")",!0)};h.xh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);this.w.setUint16(a,b,!0);this.ab=!0}; -h.zh=function(a,b,c){Kb&&a&1&&this.C.La(c,64,4);!Lb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.ab=!0;this.f&&A(this.f,32)&&D(this.f,"Memory.writeWord("+K(this.f,c)+","+K(this.f,b)+")",!0)};var Fd=0,hd=1,Gd=2,Yc=4,cd=["NONE","RAM","ROM","VID","H/W"],Ed=0,Md=[],Ld=[J.prototype.tf,J.prototype.Dg,J.prototype.tg,J.prototype.Ah],Xd=[J.prototype.rf,J.prototype.Bg,J.prototype.pg,J.prototype.yh]; -if(Gb)var Kd=[J.prototype.qf,J.prototype.Ag,J.prototype.og,J.prototype.xh],Jd=[J.prototype.sf,J.prototype.Cg,J.prototype.sg,J.prototype.zh];var ae;if(Gb){var be=new ArrayBuffer(2);(new DataView(be)).setUint16(0,256,!0);ae=256===(new Uint16Array(be))[0]}else ae=!1;var Id=ae; -function ce(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Kc=0;this.Ic=b;this.hb=c;this.Sc=Math.round(this.Ic/1E4)/100;this.sb=this.Sc*this.hb;this.Tc=this.dc=this.vb=this.Jc=0;this.A.T=this.A.Dc=!1;this.A.qa=a.autoStart;"string"==typeof this.A.qa&&(this.A.qa="true"==this.A.qa);this.A.Fb=!1;this.bc=this.Ib=0;this.cc=+a.csStart;this.Gb=+a.csInterval;this.Jb=+a.csStop;this.ha=[];this.Id=this.xg.bind(this);this.ib=this.Ia=this.gb=this.b=this.ja=this.Ha=this.ac=this.fb=this.Kb= -this.Uc=this.rb=0;this.ta=null;y(this)}p(ce,q);h=ce.prototype;h.za=function(a,b,c,d){this.K=a;this.C=b;this.F=d;this.ta=a.i;for(a=0;a=a.Ib&&(a.Ib+=a.Gb,c=!0);0<=a.Jb&&a.Jb<=ke(a)&&(a.Gb=a.Jb=-1,ge(a),a.aa(),c=!0);c&&a.u(ke(a)+" cycles: checksum="+F(a.bc))}} -h.ua=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.Z)a=!0;else{var b=null,c,k=Aa(a.id);for(c=0;ca.rb/a.sb?b=1:d=!0;a.hb=b;b=a.Sc*a.hb;if(a.sb!=b){a.sb=b;b=a.sb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.u("target speed: "+b)}c&&a.K&&oe(a.K)}uc(a,a.Ia);a.Ia=0;a.Ha=ya();a.fb=0;me(a);return d}function ld(a,b){var c=a.ha.length;a.ha.push([-1,b]);return c}function nd(a,b,c,d){0<=b&&ba.ha[b][0])&&(c=a.Ic*a.hb/1E3*c|0,a.A.T&&(c+=pe(a)),a.ha[b][0]=c)} -function qe(a,b){for(var c=a.ha.length-1;0<=c;c--){var d=a.ha[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function re(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function pe(a,b){var c=a.gb-=a.b;a.b=a.ja=0;b&&(a.gb=0);return c} -h.xg=function(){if(this.A.T){this.Jc>=this.Ic&&me(this,!0);this.Kb=0;this.ac=ya();if(this.fb){var a=this.ac-this.fb;a>this.Tc&&(this.Ha+=a,this.Ha>this.ac&&(this.Ha=this.ac))}try{do{var b=qe(this,this.A.Fb?1:this.dc);try{this.pc(b)}catch(e){if("number"!=typeof e)throw e;}b=pe(this,!0);this.Kb+=b;this.Ia+=b;vc(this,b);tc(this,b);this.vb-=b;if(0>=this.vb){this.vb+=this.dc;++this.Uc>=se&&(this.K&&I(this.K,void 0),this.Uc=0);break}}while(this.A.T)}catch(e){this.aa();this.K&&this.K.stop(ya(),ke(this)); -Ga(this,e.stack||e.message);return}if(this.A.T){a=setTimeout;b=this.Id;this.fb=ya();var c=this.Tc;this.Kb&&(c=Math.round(c*this.Kb/this.dc));var c=c-(this.fb-this.ac),d=this.fb-this.Ha;d&&(this.rb=Math.round(this.Ia/(10*d))/100,864E5<=d&&(this.ib=0,le(this)));if(0>c||this.rbc&&(this.Ha-=c),c=0;this.Jc+=this.Kb;this.fb+=c;a(b,c)}}}; -function rc(a,b){if(!Ha(a))if(a.A.T)a.u(a.toString()+" busy");else{le(a);a.A.T=!0;a.A.Dc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&oe(a.K,!0),a.K.start(a.Ha,ke(a)));a.F||a.status("Started");setTimeout(a.Id,0)}}h.pc=function(){return 0};h.aa=function(a){var b=!1;if(this.A.T){pe(this);uc(this,this.Ia);this.Ia=0;this.A.T=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(ya(),ke(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var ne=30,se=15,de=["power","reset"]; -function te(a){var b=+a.model||1170;ce.call(this,a,6666667);this.ia=b;this.Bd=+a.addrReset||0;this.Za=this.w=this.N=this.D=this.G=this.L=this.I=0;this.g=this.pa=this.W=[];this.M=this.B=this.Fa=this.lc=[];this.cb=this.O=this.zd=this.tb=this.ub=this.mb=this.eb=this.P=this.ic=this.$a=this.va=this.U=this.jc=this.kc=this.V=this.i=0;this.Ed=[4,2,0,1];this.mc=0;this.Fd=255;1120>=this.ia?(this.yd=ue.bind(this),this.Db=this.af,this.mc=8,this.Fd=-1,this.Md=255,this.Ld=0):(this.yd=ve.bind(this),this.Db=this.bf, -this.Md=~(1792|(1140>=this.ia?2048:0))&65535,this.Ld=1140e.yb&&(e.yb=c,c+=4)}return ce.prototype.Ca.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.ia);this.A.T&&this.aa();this.D=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Bd,-1,-2,-3,-4,-5,-6,-7,-8];this.pa=[0,0,0,0,0,0];this.W=[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.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.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.lc=[0,0,0,0,0,0,0,0];this.N=0;this.Za=-1;this.v=this.j=this.Hc=this.X=this.Y=this.i=this.ic=0;pc(this);fe(this);this.A.error=!1;ce.prototype.reset.call(this)};function pc(a){a.U=0;a.jc=0;a.kc=0;a.V=0;a.P=0;a.$a=0;a.va=255;a.tb=0;a.ub=0;a.mb=0;a.eb=262143;a.cb=a.g[7];a.O=0;a.R=null;a.C&&(we(a),a.zd=gd(a.C))} -function we(a){a.Xb=a.Lc;a.Yb=a.Mc;a.Ec=a.Nc;a.Zb=a.Qc;a.fc&&(a.Xb=a.Wd,a.Yb=a.ae);a.gc&&(a.Ec=a.fe,a.Zb=a.ge);a.tb?(a.Ga=65536,a.ob=a.V&16?4186112:253952,a.Ea=a.$d,a.na=a.fc?a.rg:a.gd,a.Ab=a.gc?a.Ch:a.md,Zc(a.C,a.V&16?22:18)):(a.Ga=0,a.ob=57344,a.Ea=a.df,a.na=a.fc?a.qg:a.ee,a.Ab=a.gc?a.Bh:a.je,Zc(a.C,16))}function td(a){var b=a.U;b&57344||(b=b&-3199|a.ub<<5|a.mb<<1);return b} -function ud(a,b){b&=-3073;if(a.U!=b){b&57344&&!(a.U&57344)&&(a.jc=a.O>>16&65535,a.kc=a.O&65535);a.U=b;a.ub=(b&96)>>5;a.mb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.tb!=c&&(a.tb=c,we(a))}}function wd(a){a.U&57344||(a.jc=a.O>>16&65535);a=a.jc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xd(a){a.U&57344||(a.kc=a.O&65535);return a.kc}function yd(a,b){1170>a.ia&&(b&=-49);a.V!=b&&(a.V=b,a.eb=b&16?4194303:262143,we(a))} -function xe(a,b,c){a.Bd=b;ye(a,b);Bd(a,0);a.C.reset();pc(a);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.A.Z?a.A.T||rc(a):a.A.qa=!0}else a.F&&a.A.Z?a.aa()||(he(a.F),I(a.K,-1)):!1===c&&a.aa();!a.A.T&&a.ta&&a.ta.stop()}h.Xd=function(){return 0}; -h.save=function(){var a=new G(this);a.set(0,[this.g,this.pa,this.W,this.M,this.B,this.Fa,this.lc,this.P,this.ic,this.$a,this.va,this.ub,this.mb,this.cb,this.i,this.O,this.Za,this.nc,this.qc]);a.set(1,[Ad(this),td(this),wd(this),xd(this),this.V]);a.set(2,[this.ib,this.hb,this.A.qa]);a.set(3,ze(this));a.set(4,re(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.g=b.next().value;this.pa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Fa=b.next().value;this.lc=b.next().value;this.P=b.next().value;this.ic=b.next().value;this.$a=b.next().value;this.va=b.next().value;this.ub=b.next().value;this.mb=b.next().value;this.cb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.Za=b.next().value;this.nc=b.next().value;this.qc=b.next().value;b=a[1];Bd(this,b[0]);ud(this,b[1]); -this.jc=b[2];this.kc=b[3];yd(this,b[4]);b=a[2];this.ib=b[0];le(this,b[1]);this.A.qa=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ye(a,b){a.g[7]=b&65535}function od(a,b,c,d){b={yb:b,kb:c,message:d||0,name:Pb[b],next:null};a.$b.push(b);return b}function Fe(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} -function md(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.kb<=b.kb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&A(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0)}}function sd(a,b){b&&(Fe(a,b),b.message&&A(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.yb)+",priority="+b.kb+")",!0,!0))}function ze(a){var b=[];for(a=a.R;a;)b.push(a.yb),a=a.next;return b} -function Ge(a){return a.i&64?(a.sa(168,64,-6),!0):a.i&32?(a.sa(4,32,-5),!0):a.i&16?(a.sa(12,16,-7),!0):!1}function Ad(a){return a.w=a.w&63728|De(a)|Ce(a)|Be(a)|Ae(a)}function Bd(a,b){b&=a.Md;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.D=b<<16;if((b^a.w)&a.Ld)for(var c=a.pa.length;0<=--c;){var d=a.g[c];a.g[c]=a.pa[c];a.pa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function zd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.$a=b} -h.Da=function(a){this.I=this.L=a;this.G=0};h.lb=function(a,b){this.I=this.L=this.D=a;this.G=b||0};function He(a,b){a.I=a.L=a.D=b;a.G=a.I^a.D>>1}function Ie(a,b,c,d){a.I=a.L=a.D=b;a.G=(c^d)&(d^b)} -h.sa=function(a,b,c){if(!this.oa){0>this.Za?this.Za=Ad(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.na(a|this.Ga),e=this.na(a+2&65535|this.Ga);Bd(this,e&-12289|this.Za>>2&12288);Je(this,this.Za);Je(this,this.g[7]);ye(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.Za=-1;this.nc=c;this.qc=a;-1==c&&this.aa();if(-4<=c)throw a;}}; -function Ke(a){var b=Le(a),c=Le(a);a.w&49152&&(c=c&-225|a.w&63712);ye(a,b);Bd(a,c);a.i&=-17}function Me(a,b){var c=b>>13&31;31>c&&(b=a.V&32?a.Fa[c]+(b&8191)&4194303:b&-3932161);return b} -function Ne(a,b,c){var d=[];if(c){c=Me(a,b);var e=b>>13&31;d.push(c);d.push(e);a.V&32&&(d.push(a.Fa[e]),d.push(b&8191))}else if(a.tb){var e=a.N<<1,f=b>>13;7>13;a.V&a.Ed[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.eb;3932160<=f&&(f=Me(a,f));if(a.oa)return f;f>=a.zd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.eb)||a.N)a.ub=a.N,a.mb=d;g&&(g&57344&&(0<=a.Za&&(g|=128),a.U&57344||(g|=a.U&4096|a.ub<<5|a.mb<<1,ud(a,a.U&-61695|g&61694)),a.sa(168,64,-2)),a.U&61440||!(f<(4191360&a.eb)||f>(4194239&a.eb))||(a.U|=4096,a.U&512&&(a.i|=64)));return f}function Le(a){var b=a.na(a.g[6]|a.Ga);a.g[6]=a.g[6]+2&65535;return b}function Je(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Db(4,-2,c);a.Ab(c,b)} -function Oe(a,b,c,d){var e,f,g=d&8?0:a.Ga;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.Db(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Db(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.na(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Db(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.na(e)|g;a.b-=8;break;case 6:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,6==c&&a.Db(d, -0,e),a.b-=6,e|g;case 7:return e=a.na(Ee(a,2)),e=e+a.g[c]&65535,e=a.na(e|a.Ga),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.af=function(a,b,c){!this.N&&0>=b&&c<=this.va&&(this.i|=32)};h.bf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.va&&(c<=this.va-32?this.sa(4,0,-4):(this.P|=8,this.i|=32)))};h.Wd=function(a){this.F&&Zd(this.F,a,1);return this.Lc(a)};h.ae=function(a){this.F&&Zd(this.F,a,2);return this.Mc(a)}; -h.fe=function(a,b){this.F&&$d(this.F,a,1);this.Nc(a,b)};h.ge=function(a,b){this.F&&$d(this.F,a,2);this.Qc(a,b)};function Ac(a,b){a.oa++;b=a.C.oc(yc(a,b,2));a.oa--;return b}function Pe(a,b){(b?--a.gc:--a.fc)||we(a)}h.df=function(a,b,c){return Oe(this,a,b,c)};h.$d=function(a,b,c){return yc(this,Oe(this,a,b,c),c)};h.ee=function(a){return this.C.oc(this.cb=a)};h.qg=function(a){this.F&&Zd(this.F,a,2);return this.ee(a)};h.gd=function(a){return this.C.oc(this.cb=yc(this,a,2))}; -h.rg=function(a){this.F&&Zd(this.F,a,2);return this.gd(a)};h.je=function(a,b){this.C.Sb(this.cb=a,b)};h.Bh=function(a,b){this.F&&$d(this.F,a,2);this.je(a,b)};h.md=function(a,b){this.C.Sb(this.cb=yc(this,a,4),b)};h.Ch=function(a,b){this.F&&$d(this.F,a,2);this.md(a,b)};function Qe(a,b,c){var d=a.j=b&7;(b=a.v=(b&56)>>3)?(d=Oe(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.na(d|c&a.Ga),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} -function Re(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=Oe(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=yc(a,e|c&65536,4),a.N=a.w>>14&3,a.Zb(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Se(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c+a.mc]&a.Fd}function Te(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d+a.mc];return c}function Ue(a,b){var c=a.j=b&7;b=a.v=(b&56)>>3;return Oe(a,b,c,8)} -function Ve(a,b){var c=a.j=b&7;return(b=a.v=(b&56)>>3)?a.Xb(a.Ea(b,c,3)):a.g[c]&255}function We(a,b){var c,d=a.j=b&7;(b=a.v=(b&56)>>3)?c=a.Yb(a.Ea(b,d,2)):c=a.g[d];return c}function Xe(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Hc=a.Ea(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Ec(e,d.call(a,c,a.Xb(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 R(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,6),a.Zb(e,d.call(a,0>c?a.g[-c-1]:c,a.Yb(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function tf(a,b,c,d,e){var f=a.j=b&7;(b=a.v=(b&56)>>3)?(d=a.Ea(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Ec(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 uf(a,b,c,d){var e=a.j=b&7;(b=a.v=(b&56)>>3)?(e=a.Ea(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.Zb(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} -h.pc=function(a){this.A.complete=!0;var b=this.F?vf(this.F)?1:this.A.Dc?-1:0:0,c=a?this.A.Dc?0:1:-1;this.A.Dc=!1;this.gb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(wf(this.F,this.g[7],c)){this.aa();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.$a&224)>>5,f=this.R&&this.R.kb>e?this.R:null;f&&(d=f.yb,e=f.kb);e>(this.w&224)>>5?(this.i&8&&(Ee(this,2),this.i&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Fe(this,f),a=!0);this.R||this.$a||(this.i&=-3)}else this.i& -1&&this.i++;if(a){if(this.i&4&&wf(this.F,this.g[7],c)){this.aa();break}if(0>c)break}if(this.i&112&&Ge(this)){if(this.i&4&&wf(this.F,this.g[7],c)){this.aa();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.na(a);this.g[7]=a+2&65535;this.yd(f)}while(0>1|b<<16;He(this,a);return a&65535}function Cf(a,b){a=b&128|b>>1|b<<8;He(this,a<<8);return a&255}function Df(a,b){a=b&~a;this.Da(a);return a}function Ef(a,b){a=b&~a;this.Da(a<<8);return a} -function Ff(a,b){a|=b;this.Da(a);return a}function Gf(a,b){a|=b;this.Da(a<<8);return a}function Hf(a,b){a=~b|65536;this.lb(a);return a&65535}function If(a,b){a=~b|256;this.lb(a<<8);return a&255}function Jf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Kf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function Lf(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Mf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255} -function Nf(a,b){a=-b;this.lb(a,a&b&32768);return a&65535}function Of(a,b){a=-b;this.lb(a<<8,(a&b&128)<<8);return a&255}function Pf(a,b){a=b<<1|this.D>>16&1;He(this,a);return a&65535}function Qf(a,b){a=b<<1|this.D>>16&1;He(this,a<<8);return a&255}function Rf(a,b){a=(this.D&65536|b)>>1|b<<16;He(this,a);return a&65535}function Sf(a,b){a=((this.D&65536)>>8|b)>>1|b<<8;He(this,a<<8);return a&255}function Tf(a,b){var c=b-a;Ie(this,c,a,b);return c&65535} -function Uf(a,b){var c=b-a;Ie(this,c<<8,a<<8,b<<8);return c&255}function Vf(a,b){this.I=this.L=b&65280;this.G=this.D=0;return(b<<8|b>>8)&65535}function Wf(a,b){a^=b;this.Da(a);return a&65535}function Xf(a){R(this,a,Te(this,a),xf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function Yf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.D=this.G=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.G=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.v?6:7)+b} -function Zf(a){var b=We(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=0;b&=63;if(b&32){b=64-b;32>b-1;this.D=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.v?6:7)+b}function $f(a){P(this,a,!Ae(this))}function ag(a){P(this,a,Ae(this))} -function bg(a){R(this,a,Te(this,a),Df);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function cg(a){Xe(this,a,Se(this,a),Ef);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function dg(a){R(this,a,Te(this,a),Ff);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function eg(a){Xe(this,a,Se(this,a),Gf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} -function fg(a){var b=Te(this,a);a=We(this,a);this.Da((0>b?this.g[-b-1]:b)&a);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function gg(a){var b=Se(this,a);a=Ve(this,a);this.Da(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function hg(a){P(this,a,Ce(this))}function ig(a){P(this,a,!De(this)==!Be(this))}function jg(a){P(this,a,!Ce(this)&&!De(this)==!Be(this))}function kg(a){P(this,a,!Ae(this)&&!Ce(this))} -function lg(a){P(this,a,Ce(this)||!De(this)!=!Be(this))}function mg(a){P(this,a,Ae(this)||Ce(this))}function ng(a){P(this,a,!De(this)!=!Be(this))}function og(a){P(this,a,De(this))}function pg(a){P(this,a,!Ce(this))}function qg(a){P(this,a,!De(this))}function rg(){this.sa(12,0,-9)}function sg(a){P(this,a,!0)}function tg(a){P(this,a,!Be(this))}function ug(a){P(this,a,Be(this))}function vg(a){a&1&&(this.D=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} -function wg(a){var b=Te(this,a);a=We(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function xg(a){var b=Se(this,a);a=Ve(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Ie(this,c,a,b);this.b-=this.v?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} -function yg(a){var b=We(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.D=this.G=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.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.D=65536,this.b-=7}function zg(){this.sa(24,0,-9);this.b-=20} -function Ag(){this.w&49152?(this.P|=128,this.sa(4,0,-8)):(this.ta&&1120==this.ia&&this.ta.setData(this.g[0],!0),this.F?Bg(this.F):this.aa());this.b-=7}function Cg(){this.sa(16,0,-9);this.b-=20}var Dg=[0,7,7,10,7,11,9,13];function Eg(a){this.ja=this.b;ye(this,Ue(this,a));this.b=this.ja-Dg[this.v]}var Fg=[0,14,14,17,14,18,16,20];function Gg(a){this.ja=this.b;var b=Ue(this,a);a=a>>6&7;Je(this,this.g[a]);this.g[a]=this.g[7];ye(this,b);this.b=this.ja-Fg[this.v]} -var Hg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ig(a){var b=Te(this,a);this.ja=this.b;uf(this,a,b,this.Da);this.b=this.ja-Hg[(this.X?8:0)+this.v]+(7!=this.j||this.v?0:2)}function Jg(a){var b=Se(this,a);tf(this,a,b,65535,this.Da);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Kg=[7,13,13,17,14,18,17,21]; -function Lg(a){var b=We(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.D=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ye(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Sg(a){R(this,a,Te(this,a),Tf);this.b-=this.v?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Tg(a){R(this,a,0,Vf);this.b-=this.v?9:3+(7==this.j?2:0)}function Ug(){this.sa(28,0,-9)} -function Vg(){this.ta&&(this.ta.kd(this.g[7],!0),this.ta.setData(this.g[0],!0));this.i|=8;Ee(this,-2);this.b-=3}function Wg(a){R(this,a,this.g[(a>>6&7)+this.mc],Wf);this.b-=this.v?9:3+(7==this.j?2:0)}function S(a){var b;if(b=this.F)b=this.F,A(b,1)?(D(b,"undefined opcode "+K(b,a),!0,!0),b=Bg(b)):b=!1;b||this.sa(8,0,-9)}function ue(a){Xg[a>>12].call(this,a)}function Yg(a){Zg[a>>6&3].call(this,a)}function $g(a){ah[a>>6&3].call(this,a)}function bh(a){ch[a>>6&3].call(this,a)} -function dh(a){eh[a&15].call(this,a)}function fh(a){gh[a&15].call(this,a)}function hh(a){ih[a>>6&3].call(this,a)}function jh(a){kh[a>>6&3].call(this,a)}function lh(a){mh[a>>6&3].call(this,a)} -var Xg=[function(a){nh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,S,function(a){oh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],nh=[function(a){ph[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,S,S,S],Zg=[function(a){uf(this,a,0,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Hf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Lf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,1,Jf);this.b-=this.v?9:3+(7==this.j?2:0)}],ah=[function(a){R(this,a,0,Nf); -this.b-=this.v?11:6},function(a){R(this,a,Ae(this)?1:0,xf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,Ae(this)?1:0,Tf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=We(this,a);this.lb(a);this.b-=this.v?4:3+(7==this.j?2:0)}],ch=[function(a){R(this,a,0,Rf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Pf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,Bf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){R(this,a,0,zf);this.b-=this.v?9:3+(7==this.j?2:0)}],ph= -[function(a){qh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,S,dh,fh,Tg,Tg,Tg,Tg],qh=[Ag,Vg,Pg,rg,Cg,Ng,S,S,S,S,S,S,S,S,S,S],eh=[Mg,function(){this.D=0;this.b-=5},function(){this.G=0;this.b-=5},vg,function(){this.L=1;this.b-=5},vg,vg,vg,function(){this.I=0;this.b-=5},vg,vg,vg,vg,vg,vg,vg],gh=[Mg,function(){this.D=65536;this.b-=5},function(){this.G=32768;this.b-=5},Qg,function(){this.L=0;this.b-=5},Qg,Qg,Qg,function(){this.I=32768;this.b-=5},Qg,Qg,Qg,Qg,Qg,Qg,Qg],oh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh, -lh,S,S,S],ih=[function(a){tf(this,a,0,255,this.lb);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,0,If);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,1,Mf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,1,Kf);this.b-=this.v?9:3+(7==this.j?2:0)}],kh=[function(a){Xe(this,a,0,Of);this.b-=this.v?11:6},function(a){Xe(this,a,Ae(this)?1:0,yf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,Ae(this)?1:0,Uf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){a=Ve(this, -a);this.lb(a<<8);this.b-=this.v?4:3+(7==this.j?2:0)}],mh=[function(a){Xe(this,a,0,Sf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){Xe(this,a,0,Qf);this.b-=this.v?9:3+(7==this.j?2:0)},function(a){Xe(this,a,0,Cf);this.b-=this.v?9+(this.Hc&1):3+(7==this.j?2:0)},function(a){Xe(this,a,0,Af);this.b-=this.v?9:3+(7==this.j?2:0)}];function ve(a){rh[a>>12].call(this,a)} -var rh=[function(a){sh[a>>8&15].call(this,a)},Ig,wg,fg,bg,dg,Xf,function(a){th[a>>8&15].call(this,a)},function(a){uh[a>>8&15].call(this,a)},Jg,xg,gg,cg,eg,Sg,S],sh=[function(a){vh[a>>4&15].call(this,a)},sg,pg,hg,ig,ng,jg,lg,Gg,Gg,Yg,$g,bh,function(a){wh[a>>6&3].call(this,a)},S,S],wh=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.na(a|this.Ga);ye(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Qe(this,a,0);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this); -this.ja=this.b;this.Da(b);Re(this,a,0,b);this.b=this.ja-Kg[this.v]},function(a){uf(this,a,De(this)?65535:0,this.Da);this.b-=this.v?9:3+(7==this.j?2:0)}],vh=[function(a){xh[a&15].call(this,a)},S,S,S,Eg,Eg,Eg,Eg,Og,function(a){!(a&8)||1145>this.ia?S.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},dh,fh,Tg,Tg,Tg,Tg],xh=[Ag,Vg,function(){Ke(this);this.i|=this.w&16;this.b-=13},rg,Cg,Ng,Pg,function(a){S.call(this,a)},S,S,S,S,S,S,S,S],th=[Lg,Lg,yg,yg,Yf,Yf,Zf,Zf, -Wg,Wg,S,S,S,S,Rg,Rg],uh=[qg,og,kg,mg,tg,ug,$f,ag,zg,Ug,hh,jh,lh,function(a){1145>this.ia?S.call(this,a):yh[a>>6&3].call(this,a)},S,S],yh=[function(a){S.call(this,a)},function(a){a=Qe(this,a,65536);this.Da(a);Je(this,a);this.b-=11},function(a){var b=Le(this);this.ja=this.b;this.Da(b);Re(this,a,65536,b);this.b=this.ja-Kg[this.v]},function(a){S.call(this,a)}]; -function zh(a){q.call(this,"ROM",a,128);this.ea=this.g=null;this.v=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ta(this.j);if(this.j){a=this.j;var b=Ua(this.B);"json"!=b&&"hex"!=b&&(a=hb()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;fb(a,null,!0,function(a,b,f){f?(c.S("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(va(c.pb,a,b),(a=gb(a,b))?(c.g=a.ba,c.ea=a.ea):c.j=null);Ah(c)})}}p(zh,q); -h=zh.prototype;h.za=function(a,b,c,d){this.C=b;this.f=c;this.F=d;Ah(this)};h.Ca=function(){this.ea&&(this.F&&Bh(this.F,this.id,this.v,this.b,this.ea),delete this.ea);return!0};h.Ba=function(){return!0}; -function Ah(a){if(!Ia(a)){if(a.j){if(!a.g||!a.C)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)Ga(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.v;if(57344<=b&&b<57344+Rc){var c={},c=(c[b]=[zh.prototype.cg,zh.prototype.lh,null,null,null,a.b>>1],c);if(bc(a.C,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Xc(a.C,b,a.b,Gd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){D(a,"invalid block at offset "+Sa(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,C=r-=6;0=b.length){D(a,"insufficient data for block at offset "+Sa(n),4096); -break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Sa(n),4096);break}if(C)for(D(a,"loading "+Sa(C)+" bytes at "+Sa(u)+"-"+Sa(u+C),4096);C--;)fd(a.C,u++,b[t++]&255);else u&1?g=!0:null==d&&(d=u),null!=d&&D(a,"starting address: "+Sa(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=ta.nd&&c<=ta.Xe&&(b=c-(ta.nd-ta.le));b&&(a.preventDefault&&a.preventDefault(),d.Bc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==ta.ne&&(b=ta.me);d.Bc(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.Bc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;var e=this;this.P=od(this.f,this.M?-1:48,4,262144);this.R=ld(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),nd(e.f,e.R,1E3/Math.round(e.U/10)));0<=a&&(e.D=a,e.b&128?e.D|=49152:e.b|=128,e.b&64&&md(c,e.P))});this.N=od(this.f,this.M?-1:52,4,262144);this.X=ld(this.f,function(){e.g|=128;e.g&64&&md(c,e.N)});bc(b,this,Ih,this.M?64832+8*(this.M-1)-65392:0);dc(b,this.reset.bind(this)); -y(this)};h.be=function(a){if(!this.j){var b=ee(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Za(c[0]);if(d!=this.Eb)return;c=Za(c[1]);if(this.j=Ba(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.pb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; -h.Ca=function(a,b){if(!b)if(this.be(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ba=function(a){return a?this.save():!0};h.reset=function(){Jh(this)};h.save=function(){var a=new G(this);a.set(0,[this.D,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Jh(this,a[0])};function Jh(a,b){b||(b=[0,8192,128,a.i]);b=ja(b);a.D=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} -h.Bc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Ya("",c)));this.V&&!this.B&&c&&(b=String.fromCharCode(this.V)+b);this.v.value+=b;this.v.scrollTop=this.v.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))}nd(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Hh="buffer",Kh={},Ih=(Kh[65392]=[null,null,Gh.prototype.Qf,Gh.prototype.Yg,"RCSR"],Kh[65394]=[null,null,Gh.prototype.Pf,Gh.prototype.Xg,"RBUF"],Kh[65396]=[null,null,Gh.prototype.vg,Gh.prototype.Eh,"XCSR"],Kh[65398]=[null,null,Gh.prototype.ug,Gh.prototype.Dh,"XBUF"],Kh); -yb(function(){for(var a=x(document,w,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Oh;case "loadTape":return e||(e=Ph),this.H[b]=c,c.onclick= -function(){var a=d.H.listTapes;a&&Qh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.H[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;Qh(d,Ta(b,!0),b,Ph,a)}return!1};return!0;case Rh:return this.H[b]=c,!0}return!1}; -h.za=function(a,b,c,d){this.K=a;this.C=b;this.f=c;this.F=d;this.I=Sh(a);var e=this;if(a=Lh(this,ee(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.M[f]=a[f]);this.G=od(this.f,56,4,4096);this.P=ld(this.f,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=Ua(c),f="json"==e||"gz"==e?encodeURI(c):hb()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!fb(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.Z;g?a.S('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(va(a.pb,e,f),(e=gb(e,f))&&ci(a,b,c,d,e.ba,e.xa, -e.wa));a.A.jb=!1;a.g&&(a.g--,a.g||y(a));$h(a)})}function Vh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ca);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ua(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"):Va(c,"/")&&(d="dir"),f=hb()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dd?"":e)+"&format=json"));return!!fb(f, -null,!0,function(b,c,d){ki(a,b,c,d)})} -function ki(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.Z;a.j=!1;if(d)a.controller.S('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{va(a.controller.pb,b,c);try{if(0g&&0c.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)v(k[0]);else{a.ca=k.length;a.ma=k[0].length;a.ga=k[0][0].length;var l=k[0][0][0];a.ya=l&&l.length||512;for(d=c=0;d>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,C=u.length;C>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ja?f=a.Sa+a.Ja&&(a.Ja+=f-(a.Sa+a.Ja)+1):(a.Sa=f,a.Ja=1);d[f]=d[f]&~(255<g)break;e|=g<=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;lb&&-2!=b&&this.controller.S("Unable to restore disk '"+this.Va+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=mi(this,a++);)oi(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 oi(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 gi=0;function Ii(a,b,c,d,e,f){q.call(this,a,b,c);this.L=Ki(this,b.autoMount);this.G=0;this.O=d;this.P=e;this.R=f;this.N=d.rd;this.g=Array(this.N);this.M=!mb("Mobi")&&window&&"FileReader"in window;this.v=[];this.Lb=null;this.exports={selectDrive:this.yg}}p(Ii,q); -function Ki(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=Ii.prototype; -h.ua=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.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){v(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.H[b]=c,c.onchange=function(){var a=La(c.value,10);null!=a&& -Li(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&Mi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&La(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.S("Unable to boot the selected drive"):a.ra?(xe(d.f,0,!0),(a=d.hc(a,0,0,0,512,0,2))&&d.S("Unable to read the boot sector ("+a+")")):d.S("Load a disk into the drive first")},!0;case "saveDisk":if(!this.M){c.parentNode.removeChild(c); -break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[La(a.value,10)||0])if(a=a.ra){var b;b="";for(var c=0,k;k=mi(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.g.length)a.S("Unable to load the selected drive");else if(c)if(c==Pi)a.S('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==Qi){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ta(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wi(a,e,b,c,!1,d)}else Si(a,e)} -function Wi(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Ma.toLowerCase()!=d.toLowerCase()&&(g++,Si(a,b,!0),k.cd?a.S(a.type+" busy"):(k.cd=!0,e&&(k.bd=!0,a.G++,A(a)&&D(a,"auto-loading disk: "+c)),k.Hb=!!f,ji(new fi(a,k,"preload"),c,d,f,a.Vd)&&g++));return g} -h.Vd=function(a,b,c,d,e){a.cd=!1;b&&(b.ca>a.ca||b.ma>a.ma)&&(this.S('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.zc)),b=null);b?(a.ra=b,a.Va=c,a.Ma=d,Xi(this,c,d,b),this.S('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.zc),a.bd||e),this.K&&oe(this.K)):a.Hb=!1;a.bd&&(a.bd=!1,--this.G||y(this));Li(this,a.zc)}; -function Ni(a,b,c,d){if((a=a.H.listDisks)&&a.options){for(var e=0;e=a.ca){m=U.rc;break}n=a.seek(b,c,d+1);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}var u,t;if(0>(u=a.read(n,r++))||0>(t=a.read(n,r++))){m=U.sc;break}if(!k&&(xc(this.C,Me(this.f,f),u|t<<8),kd(this.C))){m=U.Vb;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Fc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.ra;var n=null,r;a||(m=U.Ad,e=0);for(;e;){var u=zc(this.C,Me(this.f,f));if(kd(this.C)){m=U.Vb;break}if(!n){if(b>=a.ca){m=U.rc;break}n=a.seek(b,c,d+1,!0);if(!n){m=U.Jd;break}r=0;++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b))}if(k){var t,C;if(0>(t=a.read(n,r++))||0>(C=a.read(n,r++))){m=U.sc;break}if(u!=(t|C<<8)){m=U.Od;break}}else if(!a.write(n,r++,u&255)||!a.write(n,r++,u>>8)){m=U.sc;break}r>=a.ya&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.De=function(a,b,c,d,e,f){this.w=f&65535;this.b=this.b&~T.Cb|f>>16-T.ka.Cb&T.Cb;this.B=65536-e&65535;this.j=this.j&~aj.Xc|d&aj.Xc;this.i|=a;bj(this);return!0};function bj(a){a.b&=~T.Ub;a.i&&(a.i|=U.qe,a.b|=T.Ub,a.i&U.Oc&&(a.b|=T.Oc),A(a)&&D(a,a.type+": ERROR: "+E(a.i)))}h.Vf=function(){return this.I};h.dh=function(){};h.Wf=function(){return this.i};h.eh=function(){};h.Sf=function(){return this.b&T.Wc}; -h.$g=function(a){this.b=this.b&~T.qb|a&T.qb;if(this.b&T.vd){a=!0;var b,c,d="",e=(this.j&aj.nb)>>aj.ka.nb,f=this.g[e],g,k,l,m,n,r;this.b&=~(T.Xa|T.Yc);this.i&=~U.Oe;switch(c=this.b&T.Pa){case cj.ke:A(this)&&D(this,this.type+": CRESET("+e+")",!0);this.i=this.j=0;this.b=T.Xa;break;case cj.ze:d="RCHK";case cj.Be:d||(d="READ"),b=this.hc;case cj.Zc:d||(d="WCHK");case cj.We:d||(d="WRITE");b||(b=this.Fc);g=(this.j&aj.Tb)>>aj.ka.Tb;k=(this.j&aj.Pc)>>aj.ka.Pc;l=this.j&aj.Xc;m=65536-this.B&65535;n=(this.b&T.Cb)<< -16-T.ka.Cb|this.w;r=this.b&T.xe?0:2;A(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.ca){this.i|=U.rc;break}if(l>=f.ga){this.i|=U.sc;break}a=b.call(this,f,g,k,l,m,n,r,c>=cj.Zc,this.De.bind(this));break;case cj.xc:g=(this.j&aj.Tb)>>aj.ka.Tb;A(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(r=a.read(k,m++))){g=fj.Ya;break}xc(this.C,Me(this.f,f),n|r<<8);if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ca)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; -h.Fc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.ra;k=null;var m;a||(g=fj.Ya,e=0);for(;e;){var n=zc(this.C,Me(this.f,f));if(kd(this.C)){g=fj.Vb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=fj.Ya;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=fj.Ya;break}if(m>=a.ya&&(k=null,++d>=a.ga&&(d=0,++c>=a.ma&&(c=0,++b>=a.ca)))){g=fj.Ya;break}}return l?l(g,b,c,d,e,f):g}; -h.Ie=function(a,b,c,d,e,f){this.D=f&65535;this.b=this.b&~V.Wa|f>>16-V.ka.Wa&V.Wa;this.w=f>>16&gj.Vc;this.j=this.i=b<>V.ka.Wa;if(!(this.b&V.Xa)){a=!0;var b,c="",d=this.g[(this.b&V.nb)>>V.ka.nb],e=d.ra,f,g,k;this.b&=~V.Bb;switch(this.b&V.Pa){case ij.Se:this.B&jj.wd&&(this.b&=V.Bb|V.Pa|V.Wa);this.B=d.status|this.j&hj.wc|(e&&512==e.ca?jj.ue:0);break;case ij.xc:(this.i&hj.te)==hj.Pe&&(b=this.i&hj.Wb,c=(this.i&hj.Re)<<2,this.j=this.i&hj.Qe?this.j+b:this.j-b,this.i=this.j=this.j&hj.Wb|c);break;case ij.Ce:this.B=this.j;break;case ij.Ae:c="READ",b=this.hc; -case ij.Ve:c||(c="WRITE"),b||(b=this.Fc),f=this.i>>hj.ka.Wb,g=this.i&hj.wc?1:0,k=this.i&hj.Hd,!e||f>=e.ca||k>=e.ga?this.b=this.b|fj.Ya|V.Ub:(a=65536-this.B&65535,e=(this.w&gj.Vc)<<16|this.D,A(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.Ie.bind(this)))}a&&(this.b=this.b|V.Bb|V.Xa,this.b&V.Rc&&md(this.f,this.Lb))}};h.Yf=function(){return this.D};h.gh=function(a){this.D=a&kj.qb};h.ag=function(){return this.i}; -h.jh=function(a){this.i=a};h.bg=function(){return this.B};h.kh=function(a){this.B=a};h.Zf=function(){return this.w};h.hh=function(a){this.w=a&gj.Vc;this.b=this.b&~V.Wa|(this.w&3)<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.O?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(Za(b.substring(c,f))),c=f+1}}return a} -function oj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +function Hc(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.g;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.J)return l.Xb+=l.J-f,l.J=f,!0;if(f>=l.J+l.Xb){n=l.size-(f-m);n>g&&(n=g);l.Xb=f-l.J+n;f=m+a.j;g-=n;k++;continue}}return Wc(Xc,f,g)}f=new I(a,f,n,a.j,d,e);Gc(f,a.F,l);a.b[k++]=f;f=m+a.j;g-=n}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Yc[d]+" at "+E(b)),!0):Wc(Zc,b,c)}h.Gd=function(a){return this.u[(a&this.w)>>>this.g].Eb(a&this.i,a)}; +h.zc=function(a){var b=a&this.i,c=(a&this.w)>>>this.g;return Fb||b!=this.i?this.u[c].oa(b,a):this.u[c++].Eb(b,a)|this.u[c&this.S].Eb(0,a+1)<<8};h.Hd=function(a,b){this.u[(a&this.w)>>>this.g].Gb(a&this.i,b,a)};h.ac=function(a,b){var c=a&this.i,d=(a&this.w)>>>this.g;Fb||c!=this.i?this.u[d].Hb(c,b,a):(this.u[d++].Gb(c,b&255,a),this.u[d&this.S].Gb(0,b>>8&255,a+1))};function $c(a,b){return a.b[(b&a.I)>>>a.g]} +function uc(a,b){var c;a.C=!1;a.na++;var d=b&a.i,e=$c(a,b);Fb||d!=a.i?c=e.B(d,b):c=e.K(d,b)|$c(a,b+1).K(0,b+1)<<8;a.na--;return c}function ad(a,b,c){a.C=!1;a.na++;$c(a,b).F(b&a.i,c&255,b);a.na--}function sc(a,b,c){a.C=!1;a.na++;var d=b&a.i,e=$c(a,b);Fb||d!=a.i?e.C(d,c&65535,b):(e.F(d,c&255,b),$c(a,b+1).F(0,c>>8&255,b+1));a.na--} +function Vc(a){for(var b=0,c=[],d=0;da.f.ka)){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 q=g[4],t=g[5]||1,u=0;u>8:e[2](f)&255):f&1&&(e=d.Pa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.f&&z(this.f,16|e[5])&&D(this.f,e[4]+".readByte("+J(this.f,b)+"): "+J(this.f,c),!0,!d.na),c;d.Na(b,16,3);c=255;this.f&&z(this.f,16)&&D(this.f,"warning: unconverted read access to byte @"+J(this.f,b)+": "+J(this.f,c),!0,!d.na);return c} +function Dc(a,b,c){var d=!1,e=this.controller,f=e.Pa[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.Pa[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&&z(this.f,16|f[5])&&D(this.f,f[4]+".writeByte("+J(this.f,c)+","+J(this.f,b)+")",!0,!e.na):(e.Na(c,16,5),this.f&&z(this.f,16)&&D(this.f,"warning: unconverted write access to byte @"+J(this.f,c)+": "+J(this.f, +b),!0,!e.na))}function Ec(a,b){var c=-1,d=this.controller;a=d.Pa[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.f&&z(this.f,16|a[5])&&D(this.f,a[4]+".readWord("+J(this.f,b)+"): "+J(this.f,c),!0,!d.na),c;d.Na(b,16,2);c=65535;this.f&&z(this.f,16)&&D(this.f,"warning: unconverted read access to word @"+J(this.f,b)+": "+J(this.f,c),!0,!d.na);return c} +function Fc(a,b,c){var d=!1,e=this.controller;a=e.Pa[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.f&&z(this.f,16|a[5])&&D(this.f,a[4]+".writeWord("+J(this.f,c)+","+J(this.f,b)+")",!0,!e.na):(e.Na(c,16,4),this.f&&z(this.f,16)&&D(this.f,"warning: unconverted write access to word @"+J(this.f,c)+": "+J(this.f,b),!0,!e.na))}function L(a){r.call(this,"Device",a,256);this.b={ib:128,Dd:-1}}p(L,r);h=L.prototype; +h.Aa=function(a,b,c,d){this.D=b;this.K=a;this.f=c;this.F=d;var e=this;this.b.Dd=gd(c,function(){e.b.ib|=128;e.b.ib&64&&hd(e.f,e.b.Qa);e.K&&H(e.K,1);id(e.f,e.b.Dd,1E3/60)});this.b.Qa=jd(c,64,6,2097152);Rb(b,this,kd);Tb(b,this.reset.bind(this));d&&ld(d,64,function(a){var b=e.f;md(e,"KIPDR",b.B[0],0,a[0]);md(e,"KDPDR",b.B[0],8,a[0]);md(e,"KIPAR",b.M[0],0,a[0]);md(e,"KDPAR",b.M[0],8,a[0],!0);md(e,"SIPDR",b.B[1],0,a[0]);md(e,"SDPDR",b.B[1],8,a[0]);md(e,"SIPAR",b.M[1],0,a[0]);md(e,"SDPAR",b.M[1],8,a[0], +!0);md(e,"UIPDR",b.B[3],0,a[0]);md(e,"UDPDR",b.B[3],8,a[0]);md(e,"UIPAR",b.M[3],0,a[0]);md(e,"UDPAR",b.M[3],8,a[0],!0);b.U&32&&md(e,"UNIMAP",b.Ha,-1,a[0])});y(this)};function md(a,b,c,d,e,f){a=a.F;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",k=!1,l=0,m=8;0>d&&(e=c.length,d=0,k=!0,l=3,m=4);for(var n=0;n>1&63;var b=this.f.Ha[a>>1];return a&1?b>>16:b&65535};h.di=function(a,b){b=b>>1&63;var c=b>>1;this.f.Ha[c]=b&1?this.f.Ha[c]&65535|(a&63)<<16:this.f.Ha[c]&-65536|a&65534};h.Kg=function(a){return this.f.B[1][a>>1&7]};h.Xh=function(a,b){this.f.B[1][b>>1&7]=a&65295};h.Ig=function(a){return this.f.B[1][(a>>1&7)+8]};h.Vh=function(a,b){this.f.B[1][(b>>1&7)+8]=a&65295};h.Jg=function(a){return this.f.M[1][a>>1&7]}; +h.Wh=function(a,b){b=b>>1&7;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.Hg=function(a){return this.f.M[1][(a>>1&7)+8]};h.Uh=function(a,b){b=(b>>1&7)+8;this.f.M[1][b]=a;this.f.B[1][b]&=65295};h.$f=function(a){return this.f.B[0][a>>1&7]};h.oh=function(a,b){this.f.B[0][b>>1&7]=a&65295};h.Yf=function(a){return this.f.B[0][(a>>1&7)+8]};h.mh=function(a,b){this.f.B[0][(b>>1&7)+8]=a&65295};h.Zf=function(a){return this.f.M[0][a>>1&7]};h.nh=function(a,b){b=b>>1&7;this.f.M[0][b]=a;this.f.B[0][b]&=65295}; +h.Xf=function(a){return this.f.M[0][(a>>1&7)+8]};h.lh=function(a,b){b=(b>>1&7)+8;this.f.M[0][b]=a;this.f.B[0][b]&=65295};h.Qg=function(a){return this.f.B[3][a>>1&7]};h.ci=function(a,b){this.f.B[3][b>>1&7]=a&65295};h.Og=function(a){return this.f.B[3][(a>>1&7)+8]};h.ai=function(a,b){this.f.B[3][(b>>1&7)+8]=a&65295};h.Pg=function(a){return this.f.M[3][a>>1&7]};h.bi=function(a,b){b=b>>1&7;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Ng=function(a){return this.f.M[3][(a>>1&7)+8]}; +h.$h=function(a,b){b=(b>>1&7)+8;this.f.M[3][b]=a;this.f.B[3][b]&=65295};h.Vb=function(a){a&=7;return this.f.w&2048?this.f.qa[a]:this.f.g[a]};h.Zb=function(a,b){b&=7;this.f.w&2048?this.f.qa[b]=a:this.f.g[b]=a};h.mg=function(){return this.f.w&49152?this.f.W[0]:this.f.g[6]};h.zh=function(a){this.f.w&49152?this.f.W[0]=a:this.f.g[6]=a};h.pg=function(){return this.f.g[7]};h.Ch=function(a){this.f.g[7]=a};h.Wb=function(a){a&=7;return this.f.w&2048?this.f.g[a]:this.f.qa[a]}; +h.$b=function(a,b){b&=7;this.f.w&2048?this.f.g[b]=a:this.f.qa[b]=a};h.ng=function(){return 1==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[1]};h.Ah=function(a){1==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[1]=a};h.og=function(){return 3==(this.f.w&49152)>>14?this.f.g[6]:this.f.W[3]};h.Bh=function(a){3==(this.f.w&49152)>>14?this.f.g[6]=a:this.f.W[3]=a};h.Wf=function(a){return this.f.wc[a-65504>>1]};h.kh=function(a,b){this.f.wc[b-65504>>1]=a};h.te=function(a){return 65520==a?(bd(this.D)>>6)-1:0}; +h.ye=function(){};h.Mg=function(){return 1};h.Zh=function(){};h.Vf=function(){return this.f.P};h.jh=function(){this.f.P=0};h.bg=function(){return this.f.tc};h.qh=function(a,b){b&1||(a&=255);this.f.tc=a};h.gg=function(a,b){return b?0:this.f.eb};h.th=function(a){td(this.f,a)};h.Lg=function(a,b){return b?0:this.f.xa&65280};h.Yh=function(a){this.f.xa=a|255};h.lg=function(){return ud(this.f)};h.yh=function(a){vd(this.f,a)};h.xe=function(a,b){z(this)&&D(this,"writeIgnored("+E(b)+"): "+E(a),!0,!0)}; +var M={},kd=(M[61568]=[null,null,L.prototype.Rg,L.prototype.di,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.Kg,L.prototype.Xh,"SIPDR",8,1145,64],M[62608]=[null,null,L.prototype.Ig,L.prototype.Vh,"SDPDR",8,1145,64],M[62624]=[null,null,L.prototype.Jg,L.prototype.Wh,"SIPAR",8,1145,64],M[62640]=[null,null,L.prototype.Hg,L.prototype.Uh,"SDPAR",8,1145,64],M[62656]=[null,null,L.prototype.$f,L.prototype.oh,"KIPDR",8,1140,64],M[62672]=[null,null,L.prototype.Yf,L.prototype.mh,"KDPDR",8,1145,64],M[62688]= +[null,null,L.prototype.Zf,L.prototype.nh,"KIPAR",8,1140,64],M[62704]=[null,null,L.prototype.Xf,L.prototype.lh,"KDPAR",8,1145,64],M[62798]=[null,null,L.prototype.fg,L.prototype.sh,"MMR3",1,1145,64],M[65382]=[null,null,L.prototype.ag,L.prototype.ph,"LKS"],M[65402]=[null,null,L.prototype.cg,L.prototype.rh,"MMR0",1,1140,64],M[65404]=[null,null,L.prototype.dg,L.prototype.xe,"MMR1",1,1145,64],M[65406]=[null,null,L.prototype.eg,L.prototype.xe,"MMR2",1,1140,64],M[65408]=[null,null,L.prototype.Qg,L.prototype.ci, +"UIPDR",8,1140,64],M[65424]=[null,null,L.prototype.Og,L.prototype.ai,"UDPDR",8,1145,64],M[65440]=[null,null,L.prototype.Pg,L.prototype.bi,"UIPAR",8,1140,64],M[65456]=[null,null,L.prototype.Ng,L.prototype.$h,"UDPAR",8,1145,64],M[65472]=[null,null,L.prototype.Vb,L.prototype.Zb,"R0SET0"],M[65473]=[null,null,L.prototype.Vb,L.prototype.Zb,"R1SET0"],M[65474]=[null,null,L.prototype.Vb,L.prototype.Zb,"R2SET0"],M[65475]=[null,null,L.prototype.Vb,L.prototype.Zb,"R3SET0"],M[65476]=[null,null,L.prototype.Vb, +L.prototype.Zb,"R4SET0"],M[65477]=[null,null,L.prototype.Vb,L.prototype.Zb,"R5SET0"],M[65478]=[null,null,L.prototype.mg,L.prototype.zh,"R6KERNEL"],M[65479]=[null,null,L.prototype.pg,L.prototype.Ch,"R7KERNEL"],M[65480]=[null,null,L.prototype.Wb,L.prototype.$b,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Wb,L.prototype.$b,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Wb,L.prototype.$b,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Wb,L.prototype.$b,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Wb, +L.prototype.$b,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Wb,L.prototype.$b,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.ng,L.prototype.Ah,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.og,L.prototype.Bh,"R6USER",1,1145],M[65504]=[null,null,L.prototype.Wf,L.prototype.kh,"CTRL",8,1170],M[65520]=[null,null,L.prototype.te,L.prototype.ye,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.te,L.prototype.ye,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.Mg,L.prototype.Zh,"SYSID",1,1170],M[65526]= +[null,null,L.prototype.Vf,L.prototype.jh,"ERR",1,1170],M[65528]=[null,null,L.prototype.bg,L.prototype.qh,"MBR",1,1170],M[65530]=[null,null,L.prototype.gg,L.prototype.th,"PIR"],M[65532]=[null,null,L.prototype.Lg,L.prototype.Yh,"SLR"],M[65534]=[null,null,L.prototype.lg,L.prototype.yh,"PSW"],M); +mb(function(){for(var a=x(document,w,"device"),b=0;b>1),this.b=new Int32Array(this.u,0,this.size>>2),Dd(this,Ed?Fd:Gd);else{a=this.b=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.Tf=function(a){return this.b[a>>2]>>>((a&3)<<3)&255};h.Xg=function(a,b){Eb&&a&1&&this.D.Na(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8}; +h.hh=function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.hb=!0};h.Rf=function(a,b){this.f&&null!=this.J&&Nd(this.f,this.J+a);return this.K(a,b)};h.Tg=function(a,b){this.f&&null!=this.J&&Nd(this.f,this.J+a,2);return this.B(a,b)}; +h.fh=function(a,b,c){this.f&&null!=this.J&&Od(this.f,this.J+a);this.j?this.Yb(0,b,c):this.F(a,b,c)};h.fi=function(a,b,c){this.f&&null!=this.J&&Od(this.f,this.J+a,2);this.j?this.Yb(0,b,c):this.C(a,b,c)};h.Qf=function(a){return this.g[a]};h.Sf=function(a,b){a=this.g[a];this.f&&z(this.f,32)&&D(this.f,"Memory.readByte("+J(this.f,b)+"): "+J(this.f,a),!0);return a};h.Sg=function(a,b){Eb&&a&1&&this.D.Na(b,64,2);return this.w.getUint16(a,!0)}; +h.Wg=function(a,b){Eb&&a&1&&this.D.Na(b,64,2);a=!Fb&&a&1?this.g[a]|this.g[a+1]<<8:this.G[a>>1];this.f&&z(this.f,32)&&D(this.f,"Memory.readWord("+J(this.f,b)+"): "+J(this.f,a),!0);return a};h.eh=function(a,b){this.g[a]=b;this.hb=!0};h.gh=function(a,b,c){this.g[a]=b;this.hb=!0;this.f&&z(this.f,32)&&D(this.f,"Memory.writeByte("+J(this.f,c)+","+J(this.f,b)+")",!0)};h.ei=function(a,b,c){Eb&&a&1&&this.D.Na(c,64,4);this.w.setUint16(a,b,!0);this.hb=!0}; +h.gi=function(a,b,c){Eb&&a&1&&this.D.Na(c,64,4);!Fb&&a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.G[a>>1]=b;this.hb=!0;this.f&&z(this.f,32)&&D(this.f,"Memory.writeWord("+J(this.f,c)+","+J(this.f,b)+")",!0)};var Ad=0,cd=1,Bd=2,Ic=4,Yc=["NONE","RAM","ROM","VID","H/W"],zd=0,Id=[],Hd=[I.prototype.Tf,I.prototype.hh,I.prototype.Xg,I.prototype.hi],Ld=[I.prototype.Rf,I.prototype.fh,I.prototype.Tg,I.prototype.fi]; +if(ub)var Gd=[I.prototype.Qf,I.prototype.eh,I.prototype.Sg,I.prototype.ei],Fd=[I.prototype.Sf,I.prototype.gh,I.prototype.Wg,I.prototype.gi];var Pd;if(ub){var Qd=new ArrayBuffer(2);(new DataView(Qd)).setUint16(0,256,!0);Pd=256===(new Uint16Array(Qd))[0]}else Pd=!1;var Ed=Pd; +function Rd(a,b){r.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Xc=0;this.Uc=b;this.ob=c;this.hd=Math.round(this.Uc/1E4)/100;this.yb=this.hd*this.ob;this.jd=this.pc=this.Bb=this.Vc=0;this.A.V=this.A.Pc=!1;this.A.ra=a.autoStart;"string"==typeof this.A.ra&&(this.A.ra="true"==this.A.ra);this.A.Nb=!1;this.nc=this.Qb=0;this.oc=+a.csStart;this.Ob=+a.csInterval;this.Rb=+a.csStop;this.ia=[];this.Yd=this.ah.bind(this);this.pb=this.Ka=this.nb=this.b=this.la=this.Ja=this.mc=this.mb=this.Sb= +this.kd=this.xb=0;this.ta=null;y(this)}p(Rd,r);h=Rd.prototype;h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.F=d;this.ta=a.i;for(a=0;a=a.Qb&&(a.Qb+=a.Ob,c=!0);0<=a.Rb&&a.Rb<=ge(a)&&(a.Ob=a.Rb=-1,ce(a),a.ba(),c=!0);c&&a.v(ge(a)+" cycles: checksum="+F(a.nc))}} +h.va=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.H[b]=c,!0;case "run":return this.H[b]=c,c.onclick=function(){var a;if(a=d.K)if(a=d.K,a.A.aa)a=!0;else{var b=null,c,k=ta(a.id);for(c=0;ca.xb/a.yb?b=1:d=!0;a.ob=b;b=a.hd*a.ob;if(a.yb!=b){a.yb=b;b=a.yb.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.v("target speed: "+b)}c&&a.K&&ke(a.K)}pc(a,a.Ka);a.Ka=0;a.Ja=qa();a.mb=0;ie(a);return d}function gd(a,b){var c=a.ia.length;a.ia.push([-1,b]);return c}function id(a,b,c,d){0<=b&&ba.ia[b][0])&&(c=a.Uc*a.ob/1E3*c|0,a.A.V&&(c+=le(a)),a.ia[b][0]=c)} +function me(a,b){for(var c=a.ia.length-1;0<=c;c--){var d=a.ia[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function ne(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function le(a,b){var c=a.nb-=a.b;a.b=a.la=0;b&&(a.nb=0);return c} +h.ah=function(){if(this.A.V){this.Vc>=this.Uc&&ie(this,!0);this.Sb=0;this.mc=qa();if(this.mb){var a=this.mc-this.mb;a>this.jd&&(this.Ja+=a,this.Ja>this.mc&&(this.Ja=this.mc))}try{do{var b=me(this,this.A.Nb?1:this.pc);try{this.Ac(b)}catch(e){if("number"!=typeof e)throw e;}b=le(this,!0);this.Sb+=b;this.Ka+=b;qc(this,b);oc(this,b);this.Bb-=b;if(0>=this.Bb){this.Bb+=this.pc;++this.kd>=oe&&(this.K&&H(this.K,void 0),this.kd=0);break}}while(this.A.V)}catch(e){this.ba();this.K&&this.K.stop(qa(),ge(this)); +ya(this,e.stack||e.message);return}if(this.A.V){a=setTimeout;b=this.Yd;this.mb=qa();var c=this.jd;this.Sb&&(c=Math.round(c*this.Sb/this.pc));var c=c-(this.mb-this.mc),d=this.mb-this.Ja;d&&(this.xb=Math.round(this.Ka/(10*d))/100,864E5<=d&&(this.pb=0,he(this)));if(0>c||this.xbc&&(this.Ja-=c),c=0;this.Vc+=this.Sb;this.mb+=c;a(b,c)}}}; +function mc(a,b){if(!za(a))if(a.A.V)a.v(a.toString()+" busy");else{he(a);a.A.V=!0;a.A.Pc=!0;var c=a.H.run;c&&(c.textContent="Halt");a.K&&(b&&ke(a.K,!0),a.K.start(a.Ja,ge(a)));a.F||a.status("Started");setTimeout(a.Yd,0)}}h.Ac=function(){return 0};h.ba=function(a){var b=!1;if(this.A.V){le(this);pc(this,this.Ka);this.Ka=0;this.A.V=!1;if(b=this.H.run)b.textContent="Run";this.K&&this.K.stop(qa(),ge(this));b=!0;this.F||this.status("Stopped")}this.A.complete=a;return b};var je=30,oe=15,Sd=["power","reset"]; +function pe(a){var b=+a.model||1170;Rd.call(this,a,6666667);this.ka=b;this.Rd=+a.addrReset||0;this.cb=this.w=this.N=this.C=this.G=this.L=this.I=0;this.g=this.qa=this.W=[];this.M=this.B=this.Ha=this.wc=[];this.kb=this.O=this.Pd=this.zb=this.Ab=this.sb=this.lb=this.P=this.tc=this.eb=this.xa=this.S=this.uc=this.vc=this.U=this.i=0;this.Ud=[4,2,0,1];this.xc=0;this.Vd=255;1120>=this.ka?(this.Od=qe.bind(this),this.Lb=this.yf,this.xc=8,this.Vd=-1,this.be=255,this.ae=0):(this.Od=re.bind(this),this.Lb=this.zf, +this.be=~(1792|(1140>=this.ka?2048:0))&65535,this.ae=1140e.Fb&&(e.Fb=c,c+=4)}return Rd.prototype.Da.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.ka);this.A.V&&this.ba();this.C=65536;this.G=32768;this.L=65535;this.I=32768;this.w=15;this.g=[0,0,0,0,0,0,0,this.Rd,-1,-2,-3,-4,-5,-6,-7,-8];this.qa=[0,0,0,0,0,0];this.W=[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.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.Ha=[0,0,0,0,0,0,0,0,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.wc=[0,0,0,0,0,0,0,0];this.N=0;this.cb=-1;this.u=this.j=this.Tc=this.X=this.Y=this.i=this.tc=0;kc(this);Ud(this);this.A.error=!1;Rd.prototype.reset.call(this)};function kc(a){a.S=0;a.uc=0;a.vc=0;a.U=0;a.P=0;a.eb=0;a.xa=255;a.zb=0;a.Ab=0;a.sb=0;a.lb=262143;a.kb=a.g[7];a.O=0;a.R=null;a.D&&(se(a),a.Pd=bd(a.D))} +function se(a){a.ic=a.Yc;a.jc=a.$c;a.Qc=a.ad;a.kc=a.fd;a.rc&&(a.ic=a.ke,a.jc=a.pe);a.sc&&(a.Qc=a.ve,a.kc=a.we);a.zb?(a.Ia=65536,a.vb=a.U&16?4186112:253952,a.Ga=a.oe,a.oa=a.rc?a.Vg:a.Ad,a.Hb=a.sc?a.ji:a.Ed,Jc(a.D,a.U&16?22:18)):(a.Ia=0,a.vb=57344,a.Ga=a.Cf,a.oa=a.rc?a.Ug:a.ue,a.Hb=a.sc?a.ii:a.ze,Jc(a.D,16))}function od(a){var b=a.S;b&57344||(b=b&-3199|a.Ab<<5|a.sb<<1);return b} +function pd(a,b){b&=-3073;if(a.S!=b){b&57344&&!(a.S&57344)&&(a.uc=a.O>>16&65535,a.vc=a.O&65535);a.S=b;a.Ab=(b&96)>>5;a.sb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.zb!=c&&(a.zb=c,se(a))}}function qd(a){a.S&57344||(a.uc=a.O>>16&65535);a=a.uc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function rd(a){a.S&57344||(a.vc=a.O&65535);return a.vc}function sd(a,b){1170>a.ka&&(b&=-49);a.U!=b&&(a.U=b,a.lb=b&16?4194303:262143,se(a))} +function te(a,b,c,d){a.Rd=b;ue(a,b);vd(a,0);a.D.reset();kc(a);if(c){a.g[0]=d||0;for(b=1;5>=b;b++)a.g[b]=0;a.g[6]=1024;a.F||(a.A.aa?a.A.V||mc(a):a.A.ra=!0)}else a.F&&a.A.aa?a.ba()||(de(a.F),H(a.K,-1)):!1===c&&a.ba();!a.A.V&&a.ta&&a.ta.stop()}h.le=function(){return 0}; +h.save=function(){var a=new G(this);a.set(0,[this.g,this.qa,this.W,this.M,this.B,this.Ha,this.wc,this.P,this.tc,this.eb,this.xa,this.Ab,this.sb,this.kb,this.i,this.O,this.cb,this.yc,this.Bc]);a.set(1,[ud(this),od(this),qd(this),rd(this),this.U]);a.set(2,[this.pb,this.ob,this.A.ra]);a.set(3,ve(this));a.set(4,ne(this));return a.data()}; +h.restore=function(a){var b=ia(a[0]);this.g=b.next().value;this.qa=b.next().value;this.W=b.next().value;this.M=b.next().value;this.B=b.next().value;this.Ha=b.next().value;this.wc=b.next().value;this.P=b.next().value;this.tc=b.next().value;this.eb=b.next().value;this.xa=b.next().value;this.Ab=b.next().value;this.sb=b.next().value;this.kb=b.next().value;this.i=b.next().value;this.O=b.next().value;this.cb=b.next().value;this.yc=b.next().value;this.Bc=b.next().value;b=a[1];vd(this,b[0]);pd(this,b[1]); +this.uc=b[2];this.vc=b[3];sd(this,b[4]);b=a[2];this.pb=b[0];he(this,b[1]);this.A.ra=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.b-=2);a.b-=3}function ue(a,b){a.g[7]=b&65535}function jd(a,b,c,d){b={Fb:b,qb:c,message:d||0,name:Kb[b],next:null};a.lc.push(b);return b}function Ce(a,b){var c=a.R;if(c==b)a.R=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.R&&(a.i|=1)} +function hd(a,b){if(b){if(b!=a.R){var c=a.R;if(!c||c.qb<=b.qb)b.next=c,a.R=b;else{do{var d=c.next;if(!d||d.qb<=b.qb){b.next=d;c.next=b;break}c=d}while(c)}}a.i|=1;b.message&&z(a,b.message|8)&&D(a,"setIRQ(vector="+E(b.Fb)+",priority="+b.qb+")",!0,!0)}}function nd(a,b){b&&(Ce(a,b),b.message&&z(a,b.message|8)&&D(a,"clearIRQ(vector="+E(b.Fb)+",priority="+b.qb+")",!0,!0))}function ve(a){var b=[];for(a=a.R;a;)b.push(a.Fb),a=a.next;return b} +function De(a){return a.i&64?(a.sa(168,64,-6),!0):a.i&32?(a.sa(4,32,-5),!0):a.i&16?(a.sa(12,16,-7),!0):!1}function ud(a){return a.w=a.w&63728|ze(a)|ye(a)|xe(a)|we(a)}function vd(a,b){b&=a.be;a.I=b<<12;a.L=~b&4;a.G=b<<14;a.C=b<<16;if((b^a.w)&a.ae)for(var c=a.qa.length;0<=--c;){var d=a.g[c];a.g[c]=a.qa[c];a.qa[c]=d}a.N=b>>14&3;c=a.w>>14&3;a.N!=c&&(a.W[c]=a.g[6],a.g[6]=a.W[a.N]);a.w=b;a.i&=-3;a.i|=a.R?2:1}function td(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.i|=1}a.eb=b} +h.Ea=function(a){this.I=this.L=a;this.G=0};h.rb=function(a,b){this.I=this.L=this.C=a;this.G=b||0};function Ee(a,b){a.I=a.L=a.C=b;a.G=a.I^a.C>>1}function Fe(a,b,c,d){a.I=a.L=a.C=b;a.G=(c^d)&(d^b)} +h.sa=function(a,b,c){if(!this.pa){0>this.cb?this.cb=ud(this):this.N||(c=-4);-4==c&&(this.i&256&&(c=-1),this.i|=256,this.P|=4,this.g[6]=a=4);if(-1!=c){this.O=a|4143316992;this.N=0;var d=this.oa(a|this.Ia),e=this.oa(a+2&65535|this.Ia);vd(this,e&-12289|this.cb>>2&12288);Ge(this,this.cb);Ge(this,this.g[7]);ue(this,d)}this.b-=5;this.i&=~(b|19);this.i|=129;this.cb=-1;this.yc=c;this.Bc=a;-1==c&&this.ba();if(-4<=c)throw a;}}; +function He(a){var b=Ie(a),c=Ie(a);a.w&49152&&(c=c&-225|a.w&63712);ue(a,b);vd(a,c);a.i&=-17}function Je(a,b){var c=b>>13&31;31>c&&(b=a.U&32?a.Ha[c]+(b&8191)&4194303:b&-3932161);return b} +function Ke(a,b,c){var d=[];if(c){c=Je(a,b);var e=b>>13&31;d.push(c);d.push(e);a.U&32&&(d.push(a.Ha[e]),d.push(b&8191))}else if(a.zb){var e=a.N<<1,f=b>>13;7>13;a.U&a.Ud[a.N]||(d&=7);e=a.B[a.N][d];f=(a.M[a.N][d]<<6)+(b&8191)&a.lb;3932160<=f&&(f=Je(a,f));if(a.pa)return f;f>=a.Pd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.B[a.N][d]=e;if(f!=(4194170&a.lb)||a.N)a.Ab=a.N,a.sb=d;g&&(g&57344&&(0<=a.cb&&(g|=128),a.S&57344||(g|=a.S&4096|a.Ab<<5|a.sb<<1,pd(a,a.S&-61695|g&61694)),a.sa(168,64,-2)),a.S&61440||!(f<(4191360&a.lb)||f>(4194239&a.lb))||(a.S|=4096,a.S&512&&(a.i|=64)));return f}function Ie(a){var b=a.oa(a.g[6]|a.Ia);a.g[6]=a.g[6]+2&65535;return b}function Ge(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.O=a.O&65535|(a.O&-65536)<<8|16121856;a.i&256||a.Lb(4,-2,c);a.Hb(c,b)} +function Le(a,b,c,d){var e,f,g=d&8?0:a.Ia;switch(b){case 0:return a.sa(4,0,-3),0;case 1:return 6==c&&a.Lb(d,0,a.g[6]),a.b-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Lb(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.oa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Lb(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.oa(e)|g;a.b-=8;break;case 6:return e=a.oa(Ae(a,2)),e=e+a.g[c]&65535,6==c&&a.Lb(d, +0,e),a.b-=6,e|g;case 7:return e=a.oa(Ae(a,2)),e=e+a.g[c]&65535,e=a.oa(e|a.Ia),a.b-=10,e|g}a.g[c]=a.g[c]+f&65535;a.O=a.O&65535|(a.O&-65536)<<8|(f<<3&248|c)<<16;return e}h.yf=function(a,b,c){!this.N&&0>=b&&c<=this.xa&&(this.i|=32)};h.zf=function(a,b,c){this.N||(65534<=c&&(c|=-65536),a&4&&c<=this.xa&&(c<=this.xa-32?this.sa(4,0,-4):(this.P|=8,this.i|=32)))};h.ke=function(a){this.F&&Nd(this.F,a,1);return this.Yc(a)};h.pe=function(a){this.F&&Nd(this.F,a,2);return this.$c(a)}; +h.ve=function(a,b){this.F&&Od(this.F,a,1);this.ad(a,b)};h.we=function(a,b){this.F&&Od(this.F,a,2);this.fd(a,b)};function vc(a,b){a.pa++;b=a.D.zc(tc(a,b,2));a.pa--;return b}function Me(a,b){(b?--a.sc:--a.rc)||se(a)}h.Cf=function(a,b,c){return Le(this,a,b,c)};h.oe=function(a,b,c){return tc(this,Le(this,a,b,c),c)};h.ue=function(a){return this.D.zc(this.kb=a)};h.Ug=function(a){this.F&&Nd(this.F,a,2);return this.ue(a)};h.Ad=function(a){return this.D.zc(this.kb=tc(this,a,2))}; +h.Vg=function(a){this.F&&Nd(this.F,a,2);return this.Ad(a)};h.ze=function(a,b){this.D.ac(this.kb=a,b)};h.ii=function(a,b){this.F&&Od(this.F,a,2);this.ze(a,b)};h.Ed=function(a,b){this.D.ac(this.kb=tc(this,a,4),b)};h.ji=function(a,b){this.F&&Od(this.F,a,2);this.Ed(a,b)};function Ne(a,b,c){var d=a.j=b&7;(b=a.u=(b&56)>>3)?(d=Le(a,b,d,2),c&65536||61440!==(a.w&61440)&&(d&=65535),a.N=a.w>>12&3,c=a.oa(d|c&a.Ia),a.N=a.w>>14&3):c=6!=d||(a.w>>2&12288)===(a.w&12288)?a.g[d]:a.W[a.w>>12&3];return c} +function Oe(a,b,c,d){a.O=a.O&65535|1441792;var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=Le(a,b,e,4),c&65536||(e&=65535),a.N=a.w>>12&3,e=tc(a,e|c&65536,4),a.N=a.w>>14&3,a.kc(e,d)):6!=e||(a.w>>2&12288)===(a.w&12288)?a.g[e]=d:a.W[a.w>>12&3]=d}function Pe(a,b){b>>=6;var c=a.Y=b&7;return(b=a.X=(b&56)>>3)?a.ic(a.Ga(b,c,3)):a.g[c+a.xc]&a.Vd}function Qe(a,b){var c;b>>=6;var d=a.Y=b&7;(b=a.X=(b&56)>>3)?c=a.jc(a.Ga(b,d,2)):c=a.g[d+a.xc];return c}function Re(a,b){var c=a.j=b&7;b=a.u=(b&56)>>3;return Le(a,b,c,8)} +function Se(a,b){var c=a.j=b&7;return(b=a.u=(b&56)>>3)?a.ic(a.Ga(b,c,3)):a.g[c]&255}function Te(a,b){var c,d=a.j=b&7;(b=a.u=(b&56)>>3)?c=a.jc(a.Ga(b,d,2)):c=a.g[d];return c}function Ue(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Tc=a.Ga(b,e,7),c=0>c?a.g[-c-1]&255:c,a.Qc(e,d.call(a,c,a.ic(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 P(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ga(b,e,6),a.kc(e,d.call(a,0>c?a.g[-c-1]:c,a.jc(e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function Ve(a,b,c,d,e){var f=a.j=b&7;(b=a.u=(b&56)>>3)?(d=a.Ga(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),a.Qc(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 We(a,b,c,d){var e=a.j=b&7;(b=a.u=(b&56)>>3)?(e=a.Ga(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),a.kc(e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))} +h.Ac=function(a){this.A.complete=!0;var b=this.F?Xe(this.F)?1:this.A.Pc?-1:0:0,c=a?this.A.Pc?0:1:-1;this.A.Pc=!1;this.nb=this.b=a;this.i=this.i&-5|(b?4:0);do{if(this.i){if(this.i&4){if(Ye(this.F,this.g[7],c)){this.ba();break}++b||(this.i&=-5);c||c++}if(a=this.i&11)if(a=!1,this.i&2){var d=160,e=(this.eb&224)>>5,f=this.R&&this.R.qb>e?this.R:null;f&&(d=f.Fb,e=f.qb);e>(this.w&224)>>5?(this.i&8&&(Ae(this,2),this.i&=-9),this.sa(d,0,-10),e=!0):e=!1;e&&(f&&Ce(this,f),a=!0);this.R||this.eb||(this.i&=-3)}else this.i& +1&&this.i++;if(a){if(this.i&4&&Ye(this.F,this.g[7],c)){this.ba();break}if(0>c)break}if(this.i&112&&De(this)){if(this.i&4&&Ye(this.F,this.g[7],c)){this.ba();break}if(0>c)break}}this.i=this.i&15|this.w&16;a=this.O=this.g[7];f=this.oa(a);this.g[7]=a+2&65535;this.Od(f)}while(0>1|b<<16;Ee(this,a);return a&65535}function zf(a,b){a=b&128|b>>1|b<<8;Ee(this,a<<8);return a&255}function Af(a,b){a=b&~a;this.Ea(a);return a}function Bf(a,b){a=b&~a;this.Ea(a<<8);return a} +function Cf(a,b){a|=b;this.Ea(a);return a}function Df(a,b){a|=b;this.Ea(a<<8);return a}function Ef(a,b){a=~b|65536;this.rb(a);return a&65535}function Ff(a,b){a=~b|256;this.rb(a<<8);return a&255}function Gf(a,b){this.I=this.L=a=b-a;this.G=b&(b^a);return a&65535}function Hf(a,b){a=b-a;var c=a<<8;b<<=8;this.I=this.L=c;this.G=b&(b^c);return a&255}function If(a,b){this.I=this.L=a=b+a;this.G=a&(b^a);return a&65535}function Jf(a,b){a=b+a;var c=a<<8;this.I=this.L=c;this.G=c&(b<<8^c);return a&255} +function Kf(a,b){a=-b;this.rb(a,a&b&32768);return a&65535}function Lf(a,b){a=-b;this.rb(a<<8,(a&b&128)<<8);return a&255}function Mf(a,b){a=b<<1|this.C>>16&1;Ee(this,a);return a&65535}function Nf(a,b){a=b<<1|this.C>>16&1;Ee(this,a<<8);return a&255}function Of(a,b){a=(this.C&65536|b)>>1|b<<16;Ee(this,a);return a&65535}function Pf(a,b){a=((this.C&65536)>>8|b)>>1|b<<8;Ee(this,a<<8);return a&255}function Qf(a,b){var c=b-a;Fe(this,c,a,b);return c&65535} +function Rf(a,b){var c=b-a;Fe(this,c<<8,a<<8,b<<8);return c&255}function Sf(a,b){this.I=this.L=b&65280;this.G=this.C=0;return(b<<8|b>>8)&65535}function Tf(a,b){a^=b;this.Ea(a);return a&65535}function Uf(a){P(this,a,Qe(this,a),Ze);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function Vf(a){var b=Te(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.C=this.G=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.G=32768)}this.g[a]=c&65535;this.I=this.L=c;this.b-=(this.u?6:7)+b} +function Wf(a){var b=Te(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.C=this.G=0;b&=63;if(b&32){b=64-b;32>b-1;this.C=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.I=d>>16;this.L=d>>16|d;this.b-=(this.u?6:7)+b}function Xf(a){Be(this,a,!we(this))}function Yf(a){Be(this,a,we(this))} +function Zf(a){P(this,a,Qe(this,a),Af);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function $f(a){Ue(this,a,Pe(this,a),Bf);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function ag(a){P(this,a,Qe(this,a),Cf);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function bg(a){Ue(this,a,Pe(this,a),Df);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)} +function cg(a){var b=Qe(this,a);a=Te(this,a);this.Ea((0>b?this.g[-b-1]:b)&a);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function dg(a){var b=Pe(this,a);a=Se(this,a);this.Ea(((0>b?this.g[-b-1]&255:b)&a)<<8);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function eg(a){Be(this,a,ye(this))}function fg(a){Be(this,a,!ze(this)==!xe(this))}function gg(a){Be(this,a,!ye(this)&&!ze(this)==!xe(this))}function hg(a){Be(this,a,!we(this)&&!ye(this))} +function ig(a){Be(this,a,ye(this)||!ze(this)!=!xe(this))}function jg(a){Be(this,a,we(this)||ye(this))}function kg(a){Be(this,a,!ze(this)!=!xe(this))}function lg(a){Be(this,a,ze(this))}function mg(a){Be(this,a,!ye(this))}function ng(a){Be(this,a,!ze(this))}function og(){this.sa(12,0,-9)}function pg(a){Be(this,a,!0)}function qg(a){Be(this,a,!xe(this))}function rg(a){Be(this,a,xe(this))}function sg(a){a&1&&(this.C=0);a&2&&(this.G=0);a&4&&(this.L=1);a&8&&(this.I=0);this.b-=5} +function tg(a){var b=Qe(this,a);a=Te(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Fe(this,c,a,b);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)}function ug(a){var b=Pe(this,a);a=Se(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Fe(this,c,a,b);this.b-=this.u?4+(this.Y&&6<=this.j?1:0):(this.X?4:3)+(7==this.j?2:0)} +function vg(a){var b=Te(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.C=this.G=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.I=d>>16):(this.G=32768,this.L=d>>15|d,this.I=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.b-=53}else this.L=this.I=0,this.G=32768,this.C=65536,this.b-=7}function wg(){this.sa(24,0,-9);this.b-=20} +function xg(){this.w&49152?(this.P|=128,this.sa(4,0,-8)):(this.ta&&1120==this.ka&&this.ta.setData(this.g[0],!0),this.F?yg(this.F):this.ba());this.b-=7}function zg(){this.sa(16,0,-9);this.b-=20}var Ag=[0,7,7,10,7,11,9,13];function Bg(a){this.la=this.b;ue(this,Re(this,a));this.b=this.la-Ag[this.u]}var Cg=[0,14,14,17,14,18,16,20];function Dg(a){this.la=this.b;var b=Re(this,a);a=a>>6&7;Ge(this,this.g[a]);this.g[a]=this.g[7];ue(this,b);this.b=this.la-Cg[this.u]} +var Eg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Fg(a){var b=Qe(this,a);this.la=this.b;We(this,a,b,this.Ea);this.b=this.la-Eg[(this.X?8:0)+this.u]+(7!=this.j||this.u?0:2)}function Gg(a){var b=Pe(this,a);Ve(this,a,b,65535,this.Ea);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}var Hg=[7,13,13,17,14,18,17,21]; +function Ig(a){var b=Te(this,a);a=a>>6&7;b=(b<<16>>16)*(this.g[a]<<16>>16);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;b|=0;this.I=b>>16;this.L=this.I|b;this.G=0;this.C=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)ue(this,this.g[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Pg(a){P(this,a,Qe(this,a),Qf);this.b-=this.u?9+(this.Y&&6<=this.j?1:0):(this.X?5:3)+(7==this.j?2:0)}function Qg(a){P(this,a,0,Sf);this.b-=this.u?9:3+(7==this.j?2:0)}function Rg(){this.sa(28,0,-9)} +function Sg(){this.ta&&(this.ta.Cd(this.g[7],!0),this.ta.setData(this.g[0],!0));this.i|=8;Ae(this,-2);this.b-=3}function Tg(a){P(this,a,this.g[(a>>6&7)+this.xc],Tf);this.b-=this.u?9:3+(7==this.j?2:0)}function Q(a){var b;if(b=this.F)b=this.F,z(b,1)?(D(b,"undefined opcode "+J(b,a),!0,!0),b=yg(b)):b=!1;b||this.sa(8,0,-9)}function qe(a){Ug[a>>12].call(this,a)}function Vg(a){Wg[a>>6&3].call(this,a)}function Xg(a){Yg[a>>6&3].call(this,a)}function Zg(a){$g[a>>6&3].call(this,a)} +function ah(a){bh[a&15].call(this,a)}function ch(a){dh[a&15].call(this,a)}function eh(a){fh[a>>6&3].call(this,a)}function gh(a){hh[a>>6&3].call(this,a)}function ih(a){jh[a>>6&3].call(this,a)} +var Ug=[function(a){kh[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Uf,Q,function(a){lh[a>>8&15].call(this,a)},Gg,ug,dg,$f,bg,Pg,Q],kh=[function(a){mh[a>>4&15].call(this,a)},pg,mg,eg,fg,kg,gg,ig,Dg,Dg,Vg,Xg,Zg,Q,Q,Q],Wg=[function(a){We(this,a,0,this.rb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,Ef);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,1,If);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,1,Gf);this.b-=this.u?9:3+(7==this.j?2:0)}],Yg=[function(a){P(this,a,0,Kf); +this.b-=this.u?11:6},function(a){P(this,a,we(this)?1:0,Ze);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,we(this)?1:0,Qf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Te(this,a);this.rb(a);this.b-=this.u?4:3+(7==this.j?2:0)}],$g=[function(a){P(this,a,0,Of);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,Mf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,yf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){P(this,a,0,wf);this.b-=this.u?9:3+(7==this.j?2:0)}],mh= +[function(a){nh[a&15].call(this,a)},Q,Q,Q,Bg,Bg,Bg,Bg,Lg,Q,ah,ch,Qg,Qg,Qg,Qg],nh=[xg,Sg,Mg,og,zg,Kg,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q],bh=[Jg,function(){this.C=0;this.b-=5},function(){this.G=0;this.b-=5},sg,function(){this.L=1;this.b-=5},sg,sg,sg,function(){this.I=0;this.b-=5},sg,sg,sg,sg,sg,sg,sg],dh=[Jg,function(){this.C=65536;this.b-=5},function(){this.G=32768;this.b-=5},Ng,function(){this.L=0;this.b-=5},Ng,Ng,Ng,function(){this.I=32768;this.b-=5},Ng,Ng,Ng,Ng,Ng,Ng,Ng],lh=[ng,lg,hg,jg,qg,rg,Xf,Yf,wg,Rg,eh,gh, +ih,Q,Q,Q],fh=[function(a){Ve(this,a,0,255,this.rb);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,0,Ff);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,1,Jf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,1,Hf);this.b-=this.u?9:3+(7==this.j?2:0)}],hh=[function(a){Ue(this,a,0,Lf);this.b-=this.u?11:6},function(a){Ue(this,a,we(this)?1:0,$e);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,we(this)?1:0,Rf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){a=Se(this, +a);this.rb(a<<8);this.b-=this.u?4:3+(7==this.j?2:0)}],jh=[function(a){Ue(this,a,0,Pf);this.b-=this.u?9+(this.Tc&1):3+(7==this.j?2:0)},function(a){Ue(this,a,0,Nf);this.b-=this.u?9:3+(7==this.j?2:0)},function(a){Ue(this,a,0,zf);this.b-=this.u?9+(this.Tc&1):3+(7==this.j?2:0)},function(a){Ue(this,a,0,xf);this.b-=this.u?9:3+(7==this.j?2:0)}];function re(a){oh[a>>12].call(this,a)} +var oh=[function(a){ph[a>>8&15].call(this,a)},Fg,tg,cg,Zf,ag,Uf,function(a){qh[a>>8&15].call(this,a)},function(a){rh[a>>8&15].call(this,a)},Gg,ug,dg,$f,bg,Pg,Q],ph=[function(a){sh[a>>4&15].call(this,a)},pg,mg,eg,fg,kg,gg,ig,Dg,Dg,Vg,Xg,Zg,function(a){th[a>>6&3].call(this,a)},Q,Q],th=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.oa(a|this.Ia);ue(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.b-=8},function(a){a=Ne(this,a,0);this.Ea(a);Ge(this,a);this.b-=11},function(a){var b=Ie(this); +this.la=this.b;this.Ea(b);Oe(this,a,0,b);this.b=this.la-Hg[this.u]},function(a){We(this,a,ze(this)?65535:0,this.Ea);this.b-=this.u?9:3+(7==this.j?2:0)}],sh=[function(a){uh[a&15].call(this,a)},Q,Q,Q,Bg,Bg,Bg,Bg,Lg,function(a){!(a&8)||1145>this.ka?Q.call(this,a):(this.w&49152||(this.w=this.w&-225|(a&7)<<5,this.i|=1,this.i&=-3),this.b-=5)},ah,ch,Qg,Qg,Qg,Qg],uh=[xg,Sg,function(){He(this);this.i|=this.w&16;this.b-=13},og,zg,Kg,Mg,function(a){Q.call(this,a)},Q,Q,Q,Q,Q,Q,Q,Q],qh=[Ig,Ig,vg,vg,Vf,Vf,Wf,Wf, +Tg,Tg,Q,Q,Q,Q,Og,Og],rh=[ng,lg,hg,jg,qg,rg,Xf,Yf,wg,Rg,eh,gh,ih,function(a){1145>this.ka?Q.call(this,a):vh[a>>6&3].call(this,a)},Q,Q],vh=[function(a){Q.call(this,a)},function(a){a=Ne(this,a,65536);this.Ea(a);Ge(this,a);this.b-=11},function(a){var b=Ie(this);this.la=this.b;this.Ea(b);Oe(this,a,65536,b);this.b=this.la-Hg[this.u]},function(a){Q.call(this,a)}]; +function wh(a){r.call(this,"ROM",a,128);this.ga=this.g=null;this.u=+a.addr;this.b=+a.size;this.w=!1;this.i=a.alias;"string"==typeof this.i&&(this.i=eval(this.i));this.j=a.file;this.B=Ja(this.j);if(this.j){a=this.j;var b=Ka(this.B);"json"!=b&&"hex"!=b&&(a=Za()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;Xa(a,null,!0,function(a,b,f){f?(c.T("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(oa(c.wb,a,b),(a=Ya(a,b))?(c.g=a.ca,c.ga=a.ga):c.j=null);xh(c)})}}p(wh,r); +h=wh.prototype;h.Aa=function(a,b,c,d){this.D=b;this.f=c;this.F=d;xh(this)};h.Da=function(){this.ga&&(this.F&&yh(this.F,this.id,this.u,this.b,this.ga),delete this.ga);return!0};h.Ca=function(){return!0}; +function xh(a){if(!Aa(a)){if(a.j){if(!a.g||!a.D)return;a.b||(a.b=a.g.length);if(a.g.length!=a.b)ya(a,"ROM size ("+F(a.g.length,8,!0)+") does not match specified size ("+F(a.b,8,!0)+")");else{var b;a:{b=a.u;if(57344<=b&&b<57344+Bc){var c={},c=(c[b]=[wh.prototype.Eg,wh.prototype.Rh,null,null,null,a.b>>1],c);if(Rb(a.D,a,c)){a.status("Added "+a.b+"-byte ROM at "+E(b));b=a.w=!0;break a}}else if(Hc(a.D,b,a.b,Bd)){for(c=0;c>>f.g;0>>=f.g;0>>a.g;0=b.length){D(a,"invalid block at offset "+Ha(n),4096);break}for(var l=l+2,q=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((q&255)+(q>>8)+(t&255)+(t>>8)),u=l,C=q-=6;0=b.length){D(a,"insufficient data for block at offset "+Ha(n),4096); +break}m+=b[l++]&255;if(m&255){D(a,"invalid checksum ("+F(m,2,!0)+") for block at offset "+Ha(n),4096);break}if(C)for(D(a,"loading "+Ha(C)+" bytes at "+Ha(t)+"-"+Ha(t+C),4096);C--;)ad(a.D,t++,b[u++]&255);else t&1?g=!0:null==d&&(d=t),null!=d&&D(a,"starting address: "+Ha(d),4096);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e=la.Fd&&c<=la.tf&&(b=c-(la.Fd-la.Be));b&&(a.preventDefault&&a.preventDefault(),d.Lc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==la.De&&(b=la.Ce);d.Lc(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.Lc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;var e=this;this.P=jd(this.f,this.M?-1:48,4,1048576);this.R=gd(this.f,function(){var a;a=-1;e.i.length&&(a=e.i.shift()&255,D(e,"receiveByte("+F(a,2,!0)+")"),e.L&&97<=a&&122>a&&(a-=32),id(e.f,e.R,1E3/Math.round(e.S/10)));0<=a&&(e.C=a,e.b&128?e.C|=49152:e.b|=128,e.b&64&&hd(c,e.P))});this.N=jd(this.f,this.M?-1:52,4,1048576);this.X=gd(this.f,function(){e.g|=128;e.g&64&&hd(c,e.N)});Rb(b,this,Fh,this.M?64832+8*(this.M-1)-65392:0);Tb(b,this.reset.bind(this)); +y(this)};h.qe=function(a){if(!this.j){var b=Td(this.K,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Pa(c[0]);if(d!=this.Mb)return;c=Pa(c[1]);if(this.j=ua(c)){var e=this.j.exports;if(e){var f=e.connect;f&&f.call(this.j,this.I);if(this.G=e.receiveData){this.I=a;this.O=e.receiveStatus;this.status("Connected "+this.wb+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; +h.Da=function(a,b){if(!b)if(this.qe(this.I),!a)this.reset();else if(!this.restore(a))return!1;return!0};h.Ca=function(a){return a?this.save():!0};h.reset=function(){Gh(this)};h.save=function(){var a=new G(this);a.set(0,[this.C,this.b,this.g,this.i]);return a.data()};h.restore=function(a){return Gh(this,a[0])};function Gh(a,b){b||(b=[0,8192,128,a.i]);b=ia(b);a.C=b.next().value;a.b=b.next().value;a.g=b.next().value;a.i=b.next().value;return!0} +h.Lc=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.B%a,this.W&&(b=Oa("",c)));this.U&&!this.B&&c&&(b=String.fromCharCode(this.U)+b);this.u.value+=b;this.u.scrollTop=this.u.scrollHeight;this.B+=c}}else if(null!=this.w){if(10== +a||1024<=this.w.length)this.v(this.w),this.w="";10!=a&&(this.w+=String.fromCharCode(a))}id(this.f,this.X,1E3/Math.round(this.Y/10));this.g&=-129};var Eh="buffer",Hh={},Fh=(Hh[65392]=[null,null,Dh.prototype.rg,Dh.prototype.Eh,"RCSR"],Hh[65394]=[null,null,Dh.prototype.qg,Dh.prototype.Dh,"RBUF"],Hh[65396]=[null,null,Dh.prototype.Zg,Dh.prototype.li,"XCSR"],Hh[65398]=[null,null,Dh.prototype.Yg,Dh.prototype.ki,"XBUF"],Hh); +mb(function(){for(var a=x(document,w,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.H[b]=c,!0;case "readTape":e=Lh;case "loadTape":return e||(e=Mh),this.H[b]=c,c.onclick= +function(){var a=d.H.listTapes;a&&Nh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.H[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;Nh(d,Ja(b,!0),b,Mh,a)}return!1};return!0;case Oh:return this.H[b]=c,!0}return!1}; +h.Aa=function(a,b,c,d){this.K=a;this.D=b;this.f=c;this.F=d;this.I=Ph(a);var e=this;if(a=Ih(this,Td(this.K,"autoMount")))for(var f in a)"PTR"==f&&(this.N[f]=a[f]);this.G=jd(this.f,56,4,4096);this.S=gd(this.f,function(){1!=(e.b&32769)||e.b&128||(e.ic.indexOf("/api/v1/dump")&&(e=Ka(c),f="json"==e||"gz"==e?encodeURI(c):Za()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Xa(f,null,!0,function(e,f,g){var k=0>g&&!!a.K&&!a.K.A.aa;g?a.T('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(oa(a.wb,e,f),(e=Ya(e,f))&&$h(a,b,c,d, +e.ca,e.za,e.ya));a.A.gb=!1;a.g&&(a.g--,a.g||y(a));Xh(a)})}function Sh(a,b,c,d){if((a=a.H.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Z);for(d=0;dc.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=Za()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.xd?"":e)+"&format=json"));return!!Xa(f, +null,!0,function(b,c,d){hi(a,b,c,d)})} +function hi(a,b,c,d){var e=null,f=0>d&&!!a.K&&!a.K.A.aa;a.j=!1;if(d)a.controller.T('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{oa(a.controller.wb,b,c);try{if(0g&&0c.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)v(k[0]);else{a.Z=k.length;a.ja=k[0].length;a.ea=k[0][0].length;var l=k[0][0][0];a.ua=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var q=l.data;if(void 0===q){var t=l.bytes;if(void 0!==t&&t.length){for(var u=m<<2,C=t.length;C>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.j)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.La?f=a.Va+a.La&&(a.La+=f-(a.Va+a.La)+1):(a.Va=f,a.La=1);d[f]=d[f]&~(255<g)break;e|=g<=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;lb&&-2!=b&&this.controller.T("Unable to restore disk '"+this.Ya+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=ji(this,a++);)li(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 li(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 di=0;function mi(a,b,c,d,e,f){r.call(this,a,b,c);this.N=ni(this,b.autoMount);this.M=0;this.R=d;this.S=e;this.U=f;this.P=d.Wc;this.g=Array(this.P);this.O=!db("Mobi")&&window&&"FileReader"in window;this.B=[];this.Qa=null;this.exports={selectDrive:this.bh}}p(mi,r); +function ni(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){v(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=mi.prototype; +h.va=function(a,b,c){var d=this;switch(b){case "listDisks":return this.H[b]=c,c.onchange=function(){var a=d.H.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){v(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.H[b]=c,c.onchange=function(){var a=Ea(c.value,10);null!=a&& +oi(d,a)},!0;case "loadDisk":return this.H[b]=c,c.onclick=function(){var a=d.H.listDisks;a&&a.options&&pi(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.H[b]=c,c.onclick=function(){var a,b=d.H.listDrives,b=b&&Ea(b.value,10);null==b||0>b||b>=d.g.length||!(a=d.g[b])?d.T("Unable to boot the selected drive"):a.da?(te(d.f,0,!0,b),(a=d.Ub(a,a.Df,a.Ef,a.Ff,a.xf,0,2))&&d.T("Unable to read the boot sector ("+a+")")):d.T("Load a disk into the drive first")},!0;case "saveDisk":if(!this.O){c.parentNode.removeChild(c); +break}this.H[b]=c;c.onclick=function(){var a=d.H.listDrives;if(a&&a.options&&d.g)if(a=d.g[Ea(a.value,10)||0])if(a=a.da){var b;b="";for(var c=0,k;k=ji(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.g.length)a.T("Unable to load the selected drive");else if(c)if(c==si)a.T('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==ti){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Ja(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ti(a,e,b,c,!1,d)}else Pi(a,e)} +function Ti(a,b,c,d,e,f){var g=-1,k=a.g[b];k.Oa.toLowerCase()!=d.toLowerCase()&&(g++,Pi(a,b,!0),k.wd?a.T(a.type+" busy"):(k.wd=!0,e&&(k.vd=!0,a.M++,z(a)&&D(a,"auto-loading disk: "+c)),k.Pb=!!f,gi(new ci(a,k,"preload"),c,d,f,a.je)&&g++));return g} +h.je=function(a,b,c,d,e){a.wd=!1;b&&(b.Z>a.Z||b.ja>a.ja)&&(this.T('Disk "'+c+'" too large for drive '+(this.g[a.Tb].Nc||"---")),b=null);b?(a.da=b,a.Ya=c,a.Oa=d,this.se(a.Tb),Ui(this,c,d,b),this.T('Loaded disk "'+c+'" in drive '+(this.g[a.Tb].Nc||"---"),a.vd||e),this.K&&ke(this.K)):a.Pb=!1;a.vd&&(a.vd=!1,--this.M||y(this));oi(this,a.Tb)}; +function qi(a,b,c,d){if((a=a.H.listDisks)&&a.options){for(var e=0;e=a.Z){m=S.Cc;break}n=a.seek(b,c,d+1);if(!n){m=S.Zd;break}q=0;++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b))}var t,u;if(0>(t=a.read(n,q++))||0>(u=a.read(n,q++))){m=S.Dc;break}if(!k&&(sc(this.D,Je(this.f,f),t|u<<8),fd(this.D))){m=S.ec;break}q>=a.ua&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Rc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.da;var n=null,q;a||(m=S.Qd,e=0);for(;e;){var t=uc(this.D,Je(this.f,f));if(fd(this.D)){m=S.ec;break}if(!n){if(b>=a.Z){m=S.Cc;break}n=a.seek(b,c,d+1,!0);if(!n){m=S.Zd;break}q=0;++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b))}if(k){var u,C;if(0>(u=a.read(n,q++))||0>(C=a.read(n,q++))){m=S.Dc;break}if(t!=(u|C<<8)){m=S.ce;break}}else if(!a.write(n,q++,t&255)||!a.write(n,q++,t>>8)){m=S.Dc;break}q>=a.ua&&(n=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.Ve=function(a,b,c,d,e,f){this.u=f&65535;this.b=this.b&~R.Jb|f>>16-R.ma.Jb&R.Jb;this.w=65536-e&65535;this.j=this.j&~Yi.od|d&Yi.od;this.i|=a;Zi(this);return!0};function Zi(a){a.b&=~R.jb;a.i&&(a.i|=S.Fe,a.b|=R.jb,a.i&S.bd&&(a.b|=R.bd),z(a)&&D(a,a.type+": ERROR: "+E(a.i)))}h.wg=function(){return this.G};h.Jh=function(){};h.xg=function(){return this.i};h.Kh=function(){};h.tg=function(){return this.b&R.fc}; +h.Gh=function(a){this.b=this.b&~R.Sa|a&R.Sa;if(this.b&R.dc){a=!0;var b,c,d="",e=(this.j&Yi.tb)>>Yi.ma.tb,f=this.g[e],g,k,l,m,n,q;this.b&=~(R.$a|R.pd);this.i&=~S.lf;switch(c=this.b&R.wa){case $i.Ae:z(this)&&D(this,this.type+": CRESET("+e+")",!0);this.i=this.j=0;this.b=R.$a;break;case $i.Qe:d="RCHK";case $i.ub:d||(d="READ"),b=this.Ub;case $i.sd:d||(d="WCHK");case $i.hc:d||(d="WRITE");b||(b=this.Rc);g=(this.j&Yi.bc)>>Yi.ma.bc;k=(this.j&Yi.ed)>>Yi.ma.ed;l=this.j&Yi.od;m=65536-this.w&65535;n=(this.b&R.Jb)<< +16-R.ma.Jb|this.u;q=this.b&R.Me?0:2;z(this)&&D(this,this.type+": "+d+"("+g+":"+k+":"+l+") "+E(n)+"--"+E(n+(m<<1)),!0,!0);if(g>=f.Z){this.i|=S.Cc;break}if(l>=f.ea){this.i|=S.Dc;break}a=b.call(this,f,g,k,l,m,n,q,c>=$i.sd,this.Ve.bind(this));break;case $i.Ic:g=(this.j&Yi.bc)>>Yi.ma.bc;z(this)&&D(this,this.type+": SEEK("+g+")",!0);g(n=a.read(k,m++))||0>(q=a.read(k,m++))){g=cj.ab;break}sc(this.D,Je(this.f,f),n|q<<8);if(fd(this.D)){g=cj.ec;break}f+=2;e--;if(m>=a.ua&&(k=null,++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b>=a.Z)))){g=cj.ab;break}}return l?l(g,b,c,d,e,f):g}; +h.Rc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.da;k=null;var m;a||(g=cj.ab,e=0);for(;e;){var n=uc(this.D,Je(this.f,f));if(fd(this.D)){g=cj.ec;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=cj.ab;break}m=0}if(!a.write(k,m++,n&255)||!a.write(k,m++,n>>8)){g=cj.ab;break}if(m>=a.ua&&(k=null,++d>=a.ea&&(d=0,++c>=a.ja&&(c=0,++b>=a.Z)))){g=cj.ab;break}}return l?l(g,b,c,d,e,f):g}; +h.$e=function(a,b,c,d,e,f){this.C=f&65535;this.b=this.b&~U.Za|f>>16-U.ma.Za&U.Za;this.u=f>>16&dj.bb;this.j=this.i=b<>U.ma.Za;if(!(this.b&U.$a)){a=!0;var b,c="",d=this.g[(this.b&U.tb)>>U.ma.tb],e=d.da,f,g,k;this.b&=~U.Fa;switch(this.b&U.wa){case fj.qf:this.w&gj.Nd&&(this.b&=U.Fa|U.wa|U.Za);this.w=d.status|this.j&ej.Hc|(e&&512==e.Z?gj.Je:0);break;case fj.Ic:(this.i&ej.Ie)==ej.mf&&(b=this.i&ej.gc,c=(this.i&ej.pf)<<2,this.j=this.i&ej.nf?this.j+b:this.j-b,this.i=this.j=this.j&ej.gc|c);break;case fj.Ue:this.w=this.j;break;case fj.Re:c="READ",b=this.Ub; +case fj.sf:c||(c="WRITE"),b||(b=this.Rc),f=this.i>>ej.ma.gc,g=this.i&ej.Hc?1:0,k=this.i&ej.Xd,!e||f>=e.Z||k>=e.ea?this.b=this.b|cj.ab|U.jb:(a=65536-this.w&65535,e=(this.u&dj.bb)<<16|this.C,z(this)&&D(this,this.type+": "+c+"("+f+":"+g+":"+k+") "+E(e)+"--"+E(e+(a<<1)),!0,!0),a=b.call(this,d,f,g,k,a,e,2,!1,this.$e.bind(this)))}a&&(this.b=this.b|U.Fa|U.$a,this.b&U.Ib&&hd(this.f,this.Qa))}};h.zg=function(){return this.C};h.Mh=function(a){this.C=a&hj.Sa};h.Cg=function(){return this.i}; +h.Ph=function(a){this.i=a};h.Dg=function(){return this.w};h.Qh=function(a){this.w=a};h.Ag=function(){return this.u};h.Nh=function(a){this.u=a&dj.bb;this.b=this.b&~U.Za|(this.u&3)<=m.Z){k=mj.Oe;break}n=m.seek(b,c,d+1);if(!n){k=mj.md;break}q=0;++d>=m.ea&&(d=0,++c>=m.ja&&(c=0,++b))}var t;if(0>(a=m.read(n,q++))||0>(t=m.read(n,q++))){k=mj.ld;break}sc(this.D,Je(this.f,f),a|t<<8);q>=m.ua&&(n=null);f+=g;e--}return l?l(k,b,c,d,e,f):k}; +function kj(a){var b=0,c=a.b&W.qd?1:0,d=a.g[c],d=d&&d.da,e=a.I&nj.bb,f=a.G&oj.bb;a.i&=~(pj.Id|pj.Td|pj.cc|pj.Fa);if(d)if(a.i|=pj.Fa,z(a)&&D(a,a.type+".readSector("+e+":0:"+f+")",!0,!0),c=d.seek(e,0,f,!0)){e=0;for(f=a.w.length;eg){b=mj.ld;break}a.w[e++]=g}c.Af&&(a.i|=pj.cc)}else b=mj.md;else b=c?mj.dd:mj.cd;lj(a,b)} +h.Fg=function(a,b){a=this.b;if(!b)switch(a&=W.fc,this.j){case V.Zc:case V.EMPTY:this.uthis.u&&(this.b|=W.fb)}return a}; +h.Sh=function(a){this.b=this.b&~W.Sa|a&W.Sa;if(this.b&W.INIT)this.Db();else if(this.b&W.dc&&this.j==V.Kb)switch(this.j=this.b&W.wa,this.b&=~(W.dc|W.fb|W.DONE|W.jb),nd(this.f,this.Qa),z(this)&&D(this,this.type+".processCommand("+qj[this.j>>1]+")",!0,!0),this.j){case V.Zc:case V.EMPTY:case V.ub:case V.hc:case V.Jc:this.u=0;break;case V.Te:a=this.g[this.b&W.qd?1:0];this.i&=~pj.Fa;a&&a.da&&(this.i|=pj.Fa);this.C=this.i;lj(this);break;case V.Se:this.C=this.L,lj(this)}else this.b&W.Ib?this.b&W.DONE&&hd(this.f, +this.Qa):nd(this.f,this.Qa)};h.Gg=function(a,b){if(!b)switch(this.j){case V.EMPTY:this.b&W.fb&&(this.b&=~W.fb,this.C=this.w[this.u]&255,z(this)&&D(this,this.type+".readByte("+this.u+"): "+F(this.C,2,!0),!0,!0),++this.u>=this.w.length&&lj(this))}return this.C}; +h.Th=function(a){switch(this.j){case V.Zc:this.b&W.fb&&(this.b&=~W.fb,this.w[this.u]=a&255,z(this)&&D(this,this.type+".writeByte("+this.u+","+F(a,2,!0)+")",!0,!0),++this.u>=this.w.length&&lj(this));break;case V.ub:case V.hc:case V.Jc:if(this.b&W.fb)switch(this.b&=~W.fb,this.u++){case 0:this.G=a;break;case 1:if(this.I=a,this.j==V.ub)kj(this);else{var b=this.j==V.Jc,c=0,d=this.b&W.qd?1:0,e=this.g[d],e=e&&e.da,f=this.I&nj.bb,g=this.G&oj.bb;this.i&=~(pj.Id|pj.Td|pj.cc|pj.Fa);if(e)if(this.i|=pj.Fa,z(this)&& +D(this,this.type+".writeSector("+f+":0:"+g+")",!0,!0),d=e.seek(f,0,g,!0))for(b&&(d.Af=!0),b=0,f=this.w.length;ba.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.O?b="end":b=a.j[a.u+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(Pa(b.substring(c,f))),c=f+1}}return a} +function uj(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function pj(a,b,c){var d;if(b){b=qj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.u((null!=b?b+": ":"")+d);return e} -function uj(a,b){if(b)return tj(a,b,a.U[b]);var c=0;for(b in a.U)tj(a,b,a.U[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function vj(a){mj.call(this,a);this.Ea=!1;this.ha=!0;this.G=W();this.va=W();this.N=W();this.B=[];this.g=this.L=this.D=[];wj(this);this.P=this.Y=0;this.i=[];this.oa=void 0;xj(this);this.F=this;this.ia={};this.fa=this.Sd=0;this.R=null;this.M=[];yj(this,a.messages);this.ta=a.commands;this.Ha=zj;this.W=[];this.I=0;this.Ia=this.pa=null;this.w=this.Ga=this.Fa=this.X=this.ja=0;this.b=this.V=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return je(b,a)}):void 0===global[w]&&(global[w]= -function(a){return je(b,a)})}p(vj,mj);function Aj(a){a=a&&a.J;null==a&&(a=-1);return a}function W(a,b,c){return{J:void 0===a?null:a,Ka:void 0===b?!1:b,Ra:!1,Aa:c}}h=vj.prototype;h.kd=function(a,b){a.J=b;a.Ra=!1;a.Aa=void 0;return a};function Bj(a){return[a.J,a.Ka,a.Aa,a.Ra,a.Cc]}function Cj(a,b){var c=W(b[0],b[1],b[2]);c.Ra=b[3];b[4]&&(c.Pd=nj(a,c.Cc=b[4]));return c} -h.za=function(a,b,c,d){this.C=b;this.K=a;this.f=c;this.b=a.i;(a=ee(a,"messages"))&&yj(this,a);1140>this.f.ia&&(this.W=this.W.concat(Dj));1145>this.f.ia&&(this.W=this.W.concat(Ej));qd(this,16,function(a){a:{var b=d.C.b,c=a[0],e=a=0,l=b.length;if(c){a=Aj(Fj(d,c));if(-1===a){d.u("invalid address: "+c);break a}e=a>>>d.C.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=cd[c],n&&d.u(F(n.id,8)+" %"+F(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -h.Zd=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.pa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Lj:b=Ad(this.f);break;case Mj:b=c.$a;break;case Nj:b=c.P;break;case Oj:b=c.va&65280;break;case Pj:b=td(c);break;case Qj:b=wd(c);break;case Rj:b=xd(c);break;case Sj:b=c.V;break;case Tj:d&&(b=d.da);break;case Uj:d&&(b=d.Ta);break;case Vj:d&&Nc(d)&&(b=d.Ua)}}return b}; -h.message=function(a,b){b&&(a+=" @"+Ij(this,W(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.fa&1073741824)this.M.push(a);else{var c;if(this.fa&-2147483648&&this.f&&(c=this.f.A.T)||Ja(this,!0))this.aa(),c&&(a+=" (cpu halted)");this.u(a);this.f&&(a=this.f,pe(a),a.vb=0,a.K&&I(a.K,void 0))}}; -function xj(a){var b;if(!vf(a))a.i&&a.i.length&&a.u("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(Wj);for(b=0;b>8;a.u("trapped to "+K(a,c&255,1)+" ("+(0>d?Mb[-d]:K(a,d))+")")}a.G=W(a.f.g[7]);b&&1!=a.I?ak(a):bk(a)}}function Yj(a,b){var c;(c=!a.f||!Ia(a.f))||(c=a.f,c.A.Z?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):!Ha(a.f)}h.Ca=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; -h.Ba=function(a,b){b&&this.u(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){xj(this);this.X=0;this.R=null;this.w=0;this.G=W(this.f.g[7]);this.A.T=!1;ck(this);a||he(this)};h.save=function(){var a=new G(this);a.set(0,Bj(this.G));a.set(1,Bj(this.N));a.set(2,[this.j,this.O,this.fa]);a.set(3,this.B);return a.data()}; -h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=Cj(this,a[b++]),this.N=Cj(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.fa|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.u("running");this.A.T=!0;this.Fa=a;this.Ga=b}; -h.stop=function(a,b){if(this.A.T){this.A.T=!1;this.w=b-this.Ga;if(!this.I){b="stopped";if(this.w){a-=this.Fa;var c=0d&&(d=Ac(a.f,b)),65535!=(d&65535)&&(a.kd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function Bg(a){var b=a.f;if(b.A.T)throw ye(b,a.f.O&65535),a.aa(),-1;return!1}function Zd(a,b,c){dk(a,b,c||1,a.L)&&a.aa(!1)}function $d(a,b,c){dk(a,b,c||1,a.D)&&a.aa(!1)} -function wj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Pe(a.f,!1);a.L=["br"];if(a.D)for(b=1;b>>c.g],!0)):Pe(a.f,!0);a.D=["bw"];a.ja=0;a.Y=0} -h.wb=function(a,b,c){var d=!0;c||ek(this,a,b,!1,!0);if(a!=this.g){var e=Aj(b);if(-1===e)this.u("invalid address: "+Ij(this,b)),d=!1;else{var f=a==this.D;65535>>g.g].wb(e&g.i,f)}else e=this.f,(f?e.gc++:e.fc++)||we(e)}}d&&(a.push(b),c?b.Ra=!0:(fk(this,a,a.length-1,"set"),xj(this)));return d}; -function ek(a,b,c,d,e){var f=!1;c=Aj(c);for(var g=1;g>>d.g],b)):Pe(a.f,b));k.Ra||xj(a);break}}return f}function gk(a,b){for(var c=1;c>23)&65535,z=K(t,u);else if(B==mk)u=u.J-((f&63)<<1)&65535,z=K(t,u);else if(B==nk)z=K(t,f&7,1);else if(B==ok)z=K(t,f&63,1);else if(B==pk)z=K(t,f&255,1);else if(B=f&C,C&qk&&(B>>=6,C>>=6),C&Y){var C=null,H=B& -rk;switch(B&sk){case 0:z=Kj(H);break;case 8:z="@"+Kj(H);C=tk(t,t.f.g[H]);break;case 16:7>H?z="("+Kj(H)+")+":(B=t.Oa(u,2),z="#"+K(t,B,0,!0));break;case 24:7>H?z="@("+Kj(H)+")+":(B=t.Oa(u,2),z="@#"+K(t,B,0,!0),C=tk(t,B));break;case 32:z="-("+Kj(H)+")";break;case 40:z="@-("+Kj(H)+")";break;case 48:B=t.Oa(u,2);z=K(t,B,0,!0)+"("+Kj(H)+")";7==H&&(z=K(t,B=B+u.J&65535),C=tk(t,B));break;case 56:B=t.Oa(u,2),z="@"+K(t,B)+"("+Kj(H)+")",7==H&&(z="@"+K(t,B=B+u.J&65535),C=tk(t,Ac(t.f,B)))}C&&(z=[z,C])}t=z;if(!t|| -!t.length){k="INVALID";break}"string"!=typeof t&&(m=t[1],t=t[0]);0=a.f.ob&&b=c.B&&(b=c.Na[b&jd])&&(a=b[4]);return a}function uk(a,b){switch(b){case "N":a=De(a.f);break;case "Z":a=Ce(a.f);break;case "V":a=Be(a.f);break;case "C":a=Ae(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=Kj(b),c+="="+K(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+K(a,d.pa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+K(a,d.W[b-16]);else switch(b){case Lj:c="PS="+K(a,Ad(d));break;case Mj:c="PI="+K(a,d.$a);break;case Nj:c="ER="+K(a,d.P);break;case Oj:c="SL="+K(a,d.va&65280);break;case Pj:c="M0="+K(a,td(d));break;case Qj:c="M1="+K(a,wd(d));break;case Rj:c="M2="+K(a,xd(d));break;case Sj:c="M3="+K(a,d.V);break;case Tj:a.b&&(c="AR="+K(a,a.b.da,3));break;case Uj:a.b&&(c="DR="+ -K(a,a.b.Ta));break;case Vj:a.b&&Nc(a.b)&&(c="SR="+K(a,a.b.Ua,3))}c&&(c+=" ");return c}function vk(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,Lj)+Z(a,Mj)+Z(a,Oj);d+=uk(a,"T")+uk(a,"N")+uk(a,"Z")+uk(a,"V")+uk(a,"C");b&&(b=d,c=""+(Z(a,Pj)+Z(a,Qj)),c+=Z(a,Rj)+Z(a,Sj)+Z(a,Nj),c=c+"\n"+(Z(a,Vj)+Z(a,Tj)+Z(a,Uj)),d=b+("\n"+c));return d}h.Td=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=ab(n,l,a.Td);0>r&&n.splice(-(r+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({Dj:b,J:c,ef:d,ea:e,Qd:f})}function wk(a,b,c){var d=[],e=Aj(b)>>>0;for(b=0;b>>0,k=f.ef;if(e>=g&&eb)){e.g[b]= -g&65535;break}a.u("unknown register: "+f);return}I(a.K);a.u("updated registers:")}}a.u(vk(a,d));c&&(a.G=W(e.g[7]),bk(a,Ij(a,a.G)))}}function Ak(a,b){b=Za(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.u(m)}k[3]&&(g=k[3],f=null);f=ik(a,b,g,f);a.u(f);a.G=b;e-=b.J-l;c++}}} -function hk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.u(Zj+b):(a.O&&(a.u("ended assemble at "+Ij(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Ia(a)&&0n||"z"Na.length&&(a.u("note: only "+Na.length+" available"),wa=Na.length);Ca-=wa;0>Ca&&(null==Na[Na.length-1].J?(wa=Ca+wa,Ca=0):Ca+=Na.length);var af=[];"call"==ti&&(Bc=1E5,af=["CALL"]);for(void 0!==si&&a.u(wa+" instructions earlier:");0=Na.length&&(Ca=0);a.oa=wa;vi++;Bc--}}vi||(a.u("no "+ui+"history available"),a.oa=void 0)}else{var ia=Fj(a,Ma);if(ia)if("da"==bb){var bf=ia.Ka||65535M.length?(2qb&&(qb=0);65536ff?String.fromCharCode(ff):"."),Qd=Qd>>8}sb&&(sb+="\n");sb=cf?sb+(tb+","):sb+(Ma+": "+tb+(Pd?"":" "+ef))}sb&&a.u(sb);a.va=ia;a.Aa=dl}}}}break;case "e":if("else"== -g[0])break;var Wb,gf,hf,jf,kf=g[0],lf=g[1];"eb"==kf?(Wb=1,gf=255,hf=a.sd,jf=a.td):"e"==kf||"ew"==kf?(Wb=2,gf=65535,hf=a.Oa,jf=a.se):lf=null;if(null==lf)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 Rd=Fj(a,lf);if(Rd)for(var Sd=2;Sdof;){for(var ub=null,hl=256;65536>Hc.J>>>0;){pf.J=a.Oa(Hc,2);if(null==Hc.J||!hl--)break;if(!(pf.J&1)){for(var il=a,Td=pf,Ai=null,Ic=Td.J,Bi=Ic,qf=1;6>=qf&&Ic;qf++){if(2> ";yb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.u("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bIk){if(Jk(d,this.G)){this.v=new G(this,"1.33.1",Sk);Jk(this.v)&&(Tk(this,d),a=Uk,Vk(this.v));this.v.set(Pk,eb());Wk(this.v);var e=this.b&&!this.D;if(a==Qk||za("Click OK to restore the previous "+Hb+" machine state, or CANCEL to reset the machine.")){if(c=Ok(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Jk(d,g):("error"==f&&"no machine state"!= -g?(this.S("Error: "+g),"unable to verify user"==g&&(lb(Xk,""),this.g=null)):this.u(f+": "+g),Vk(d),Jk(d)?(c=Ok(d),e=!0):c=!1))}e&&Mk(this,c?d:null)}else a==Uk&&d.clear()}else Mk(this);delete this.G;delete this.B}e=Aa(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.Z=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(Yk(this,this.f,b,c,a),I(this,-2),this.f.qa());this.N&&(Tk(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.j=0}; -function Tk(a,b){if(za("There may be a problem with your "+Hb+" machine.\n\nTo help us diagnose it, click OK to send this "+Hb+" machine state to http://www.pcjs.org.")){var c=a.V;a=a.g||"";b=b.toString();var d={};d.app=Hb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;fb("http://www.pcjs.org/api/v1/report",d,!0)}} -function Ck(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.33.1"),g=new G(a,"1.33.1",Nk),k=eb();g.set(Pk,k);f.set(Pk,k);f.set(Zk,"1.33.1");f.set($k,window?window.location.href:null);f.set(cl,window?window.navigator.userAgent:"");a.f&&a.f.Ba&&(c&&(b&&(a.f.A.qa=a.f.A.T),a.f.aa()),d=a.f.Ba(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.Z=!1,!1===d&&(e=null)));for(var k=Aa(a.id),l=0;l=d||30<=(c.Kc+=d))&&(e.textContent=c.A.T?c.rb.toFixed(2)+"Mhz":"Stopped",c.Kc=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;eb?a.da=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");fb(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);tl(a,b,c)}})}else c(a,null)} -function ul(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Wa(a))}function f(a){e("Error: "+a);l&&(--ql||Cb(!0));l=!1}var g,k,l=!0;ql++;xa[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.33.1/components.xsl");m=function(d,k){k?rl(c,null,null,!1,e,function(d,l){l?(va(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--ql||Cb(!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),--ql||Cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?rl(b,a,d,!0,e,m):sl(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){Cb(!1);return ul(a,b,c,d)};window.findMachineComponent=function(a,b){return Da(b,a+".machine")};window.enableEvents=Cb;window.sendEvent=Eb;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11-dbg.map +function vj(a,b,c){var d;if(b){b=wj(a,b);for(var e=0,f=!1,g=b,k=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=8;d=F(c,0,!0)+" "+c+". "+E(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.v((null!=b?b+": ":"")+d);return e} +function Aj(a,b){if(b)return zj(a,b,a.S[b]);var c=0;for(b in a.S)zj(a,b,a.S[b]),c++;return 0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function Bj(a){sj.call(this,a);this.Ga=!1;this.ia=!0;this.G=X();this.xa=X();this.N=X();this.B=[];this.g=this.L=this.C=[];Cj(this);this.P=this.Y=0;this.i=[];this.pa=void 0;Dj(this);this.F=this;this.ka={};this.ha=this.ge=0;this.R=null;this.M=[];Ej(this,a.messages);this.ta=a.commands;this.Ja=Fj;this.W=[];this.I=0;this.Ka=this.qa=null;this.w=this.Ia=this.Ha=this.X=this.la=0;this.b=this.U=null;var b=this;window?void 0===window[w]&&(window[w]=function(a){return fe(b,a)}):void 0===global[w]&&(global[w]= +function(a){return fe(b,a)})}p(Bj,sj);function Gj(a){a=a&&a.J;null==a&&(a=-1);return a}function X(a,b,c){return{J:void 0===a?null:a,Ma:void 0===b?!1:b,Ua:!1,Ba:c}}h=Bj.prototype;h.Cd=function(a,b){a.J=b;a.Ua=!1;a.Ba=void 0;return a};function Hj(a){return[a.J,a.Ma,a.Ba,a.Ua,a.Mc]}function Ij(a,b){var c=X(b[0],b[1],b[2]);c.Ua=b[3];b[4]&&(c.de=tj(a,c.Mc=b[4]));return c} +h.Aa=function(a,b,c,d){this.D=b;this.K=a;this.f=c;this.b=a.i;(a=Td(a,"messages"))&&Ej(this,a);1140>this.f.ka&&(this.W=this.W.concat(Jj));1145>this.f.ka&&(this.W=this.W.concat(Kj));ld(this,16,function(a){a:{var b=d.D.b,c=a[0],e=a=0,l=b.length;if(c){a=Gj(Lj(d,c));if(-1===a){d.v("invalid address: "+c);break a}e=a>>>d.D.g;l=1}d.v("blockid physical blockaddr used size type");d.v("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.v("..."): +(c=n.type,m=Yc[c],n&&d.v(F(n.id,8)+" %"+F(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +h.ne=function(a){var b;if(0<=a)if(8>a)b=this.f.g[a];else if(16>a)b=this.f.qa[a-8];else if(20>a)b=this.f.W[a-16];else{var c=this.f,d=this.b;switch(a){case Rj:b=ud(this.f);break;case Sj:b=c.eb;break;case Tj:b=c.P;break;case Uj:b=c.xa&65280;break;case Vj:b=od(c);break;case Wj:b=qd(c);break;case Xj:b=rd(c);break;case Yj:b=c.U;break;case Zj:d&&(b=d.fa);break;case ak:d&&(b=d.Wa);break;case bk:d&&xc(d)&&(b=d.Xa)}}return b}; +h.message=function(a,b){b&&(a+=" @"+Oj(this,X(this.f.O&65535)));if(!this.R||a!=this.R)if(this.R=a,this.ha&1073741824)this.M.push(a);else{var c;if(this.ha&-2147483648&&this.f&&(c=this.f.A.V)||Ba(this,!0))this.ba(),c&&(a+=" (cpu halted)");this.v(a);this.f&&(a=this.f,le(a),a.Bb=0,a.K&&H(a.K,void 0))}}; +function Dj(a){var b;if(!Xe(a))a.i&&a.i.length&&a.v("instruction history buffer freed"),a.P=0,a.i=[];else if(!a.i||!a.i.length){a.i=Array(ck);for(b=0;b>8;a.v("trapped to "+J(a,c&255,1)+" ("+(0>d?Gb[-d]:J(a,d))+")")}a.G=X(a.f.g[7]);b&&1!=a.I?gk(a):hk(a)}}function ek(a,b){var c;(c=!a.f||!Aa(a.f))||(c=a.f,c.A.aa?c=!0:(c.v(c.toString()+" not powered"),c=!1),c=!c);return c||a.f.A.V?(b||a.v("cpu busy or unavailable, command ignored"),!1):!za(a.f)}h.Da=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0}; +h.Ca=function(a,b){b&&this.v(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Dj(this);this.X=0;this.R=null;this.w=0;this.G=X(this.f.g[7]);this.A.V=!1;ik(this);a||de(this)};h.save=function(){var a=new G(this);a.set(0,Hj(this.G));a.set(1,Hj(this.N));a.set(2,[this.j,this.O,this.ha]);a.set(3,this.B);return a.data()}; +h.restore=function(a){var b=0;void 0!==a[2]&&(this.G=Ij(this,a[b++]),this.N=Ij(this,a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.O=a[b][1],this.ha|=a[b][2]);a[3]&&(this.B=a[3]);return!0};h.start=function(a,b){this.I||this.v("running");this.A.V=!0;this.Ha=a;this.Ia=b}; +h.stop=function(a,b){if(this.A.V){this.A.V=!1;this.w=b-this.Ia;if(!this.I){b="stopped";if(this.w){a-=this.Ha;var c=0d&&(d=vc(a.f,b)),65535!=(d&65535)&&(a.Cd(a.i[a.P],b),++a.P==a.i.length&&(a.P=0)));return!1}function yg(a){var b=a.f;if(b.A.V)throw ue(b,a.f.O&65535),a.ba(),-1;return!1}function Nd(a,b,c){jk(a,b,c||1,a.L)&&a.ba(!1)}function Od(a,b,c){jk(a,b,c||1,a.C)&&a.ba(!1)} +function Cj(a){var b,c,d;a.g=["bp"];if(a.L)for(b=1;b>>c.g],!1)):Me(a.f,!1);a.L=["br"];if(a.C)for(b=1;b>>c.g],!0)):Me(a.f,!0);a.C=["bw"];a.la=0;a.Y=0} +h.Cb=function(a,b,c){var d=!0;c||kk(this,a,b,!1,!0);if(a!=this.g){var e=Gj(b);if(-1===e)this.v("invalid address: "+Oj(this,b)),d=!1;else{var f=a==this.C;65535>>g.g].Cb(e&g.i,f)}else e=this.f,(f?e.sc++:e.rc++)||se(e)}}d&&(a.push(b),c?b.Ua=!0:(lk(this,a,a.length-1,"set"),Dj(this)));return d}; +function kk(a,b,c,d,e){var f=!1;c=Gj(c);for(var g=1;g>>d.g],b)):Me(a.f,b));k.Ua||Dj(a);break}}return f}function mk(a,b){for(var c=1;c>23)&65535,A=J(u,t);else if(B==sk)t=t.J-((f&63)<<1)&65535,A=J(u,t);else if(B==tk)A=J(u,f&7,1);else if(B==uk)A=J(u,f&63,1);else if(B==vk)A=J(u,f&255,1);else if(B=f&C,C&wk&&(B>>=6,C>>=6),C&Z){var C=null,K=B& +xk;switch(B&yk){case 0:A=Qj(K);break;case 8:A="@"+Qj(K);C=zk(u,u.f.g[K]);break;case 16:7>K?A="("+Qj(K)+")+":(B=u.Ra(t,2),A="#"+J(u,B,0,!0));break;case 24:7>K?A="@("+Qj(K)+")+":(B=u.Ra(t,2),A="@#"+J(u,B,0,!0),C=zk(u,B));break;case 32:A="-("+Qj(K)+")";break;case 40:A="@-("+Qj(K)+")";break;case 48:B=u.Ra(t,2);A=J(u,B,0,!0)+"("+Qj(K)+")";7==K&&(A=J(u,B=B+t.J&65535),C=zk(u,B));break;case 56:B=u.Ra(t,2),A="@"+J(u,B)+"("+Qj(K)+")",7==K&&(A="@"+J(u,B=B+t.J&65535),C=zk(u,vc(u.f,B)))}C&&(A=[A,C])}u=A;if(!u|| +!u.length){k="INVALID";break}"string"!=typeof u&&(m=u[1],u=u[0]);0=a.f.vb&&b=c.B&&(b=c.Pa[b&ed])&&(a=b[4]);return a}function Ak(a,b){switch(b){case "N":a=ze(a.f);break;case "Z":a=ye(a.f);break;case "V":a=xe(a.f);break;case "C":a=we(a.f);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} +function Bk(a,b){var c="",d=a.f;if(8>b)c=Qj(b),c+="="+J(a,d.g[b]);else if(13>b)c="A"+(b-8)+"="+J(a,d.qa[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+J(a,d.W[b-16]);else switch(b){case Rj:c="PS="+J(a,ud(d));break;case Sj:c="PI="+J(a,d.eb);break;case Tj:c="ER="+J(a,d.P);break;case Uj:c="SL="+J(a,d.xa&65280);break;case Vj:c="M0="+J(a,od(d));break;case Wj:c="M1="+J(a,qd(d));break;case Xj:c="M2="+J(a,rd(d));break;case Yj:c="M3="+J(a,d.U);break;case Zj:a.b&&(c="AR="+J(a,a.b.fa,3));break;case ak:a.b&&(c="DR="+ +J(a,a.b.Wa));break;case bk:a.b&&xc(a.b)&&(c="SR="+J(a,a.b.Xa,3))}c&&(c+=" ");return c}function Ck(a,b){var c,d="";for(c=0;6>c;c++)d+=Bk(a,c);d=d+"\n"+(Bk(a,6)+Bk(a,7));d+=Bk(a,Rj)+Bk(a,Sj)+Bk(a,Uj);d+=Ak(a,"T")+Ak(a,"N")+Ak(a,"Z")+Ak(a,"V")+Ak(a,"C");b&&(b=d,c=""+(Bk(a,Vj)+Bk(a,Wj)),c+=Bk(a,Xj)+Bk(a,Yj)+Bk(a,Tj),c=c+"\n"+(Bk(a,bk)+Bk(a,Zj)+Bk(a,ak)),d=b+("\n"+c));return d}h.he=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],q=Ra(n,l,a.he);0>q&&n.splice(-(q+1),0,l)}m&&(k.a=m.replace(/''/g,'"'))}a.B.push({xk:b,J:c,Gf:d,ga:e,ee:f})}function Dk(a,b,c){var d=[],e=Gj(b)>>>0;for(b=0;b>>0,k=f.Gf;if(e>=g&&eb)){e.g[b]= +g&65535;break}a.v("unknown register: "+f);return}H(a.K);a.v("updated registers:")}}a.v(Ck(a,d));c&&(a.G=X(e.g[7]),hk(a,Oj(a,a.G)))}}function Hk(a,b){b=Pa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1k[0].indexOf("+"))){var m=k[0]+":";k[2]&&(m+=" "+k[2]);a.v(m)}k[3]&&(g=k[3],f=null);f=ok(a,b,g,f);a.v(f);a.G=b;e-=b.J-l;c++}}} +function nk(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.v(fk+b):(a.O&&(a.v("ended assemble at "+Oj(a,a.N)),a.G=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.R=null;if(Aa(a)&&0n||"z"Ta.length&&(a.v("note: only "+Ta.length+" available"),Ca=Ta.length);Ia-=Ca;0>Ia&&(null==Ta[Ta.length-1].J?(Ca=Ia+Ca,Ia=0):Ia+=Ta.length);var df=[];"call"==yi&&(Kc=1E5,df=["CALL"]);for(void 0!==xi&&a.v(Ca+" instructions earlier:");0=Ta.length&&(Ia=0);a.pa=Ca;Ai++;Kc--}}Ai||(a.v("no "+zi+"history available"),a.pa=void 0)}else{var na=Lj(a,Sa);if(na)if("da"==ib){var ef=na.Ma||65535O.length?(2xb&&(xb=0);65536jf?String.fromCharCode(jf):"."),Xd=Xd>>8}zb&&(zb+="\n");zb=ff?zb+(Ab+","):zb+(Sa+": "+Ab+(Wd?"":" "+hf))}zb&&a.v(zb);a.xa=na;a.Ba=kl}}}}break;case "e":if("else"== +g[0])break;var cc,kf,lf,mf,nf=g[0],of=g[1];"eb"==nf?(cc=1,kf=255,lf=a.Kd,mf=a.Ld):"e"==nf||"ew"==nf?(cc=2,kf=65535,lf=a.Ra,mf=a.He):of=null;if(null==of)a.v("edit memory commands:"),a.v("\teb [a] [...] edit bytes at address a"),a.v("\tew [a] [...] edit words at address a");else{var Yd=Lj(a,of);if(Yd)for(var Zd=2;Zdrf;){for(var Bb=null,ol=256;65536>Qc.J>>>0;){sf.J=a.Ra(Qc,2);if(null==Qc.J||!ol--)break;if(!(sf.J&1)){for(var pl=a,$d=sf,Fi=null,Rc=$d.J,Gi=Rc,tf=1;6>=tf&&Rc;tf++){if(2> ";mb(function(){for(var a=x(document,w,"debugger"),b=0;b\nLicense: GPL version 3 or later ");this.v("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bPk){if(Qk(d,this.G)){this.u=new G(this,"1.33.1",Zk);Qk(this.u)&&($k(this,d),a=al,bl(this.u));this.u.set(Wk,Wa());cl(this.u);var e=this.b&&!this.C;if(a==Xk||ra("Click OK to restore the previous "+wb+" machine state, or CANCEL to reset the machine.")){if(c=Vk(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Qk(d,g):("error"==f&&"no machine state"!= +g?(this.T("Error: "+g),"unable to verify user"==g&&(cb(dl,""),this.g=null)):this.v(f+": "+g),bl(d),Qk(d)?(c=Vk(d),e=!0):c=!1))}e&&Tk(this,c?d:null)}else a==al&&d.clear()}else Tk(this);delete this.G;delete this.B}e=ta(this.id);for(f=0;fa[1];a=a[2];this.P=!0;this.A.aa=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.f&&(el(this,this.f,b,c,a),H(this,-2),this.f.ra());this.N&&($k(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0}; +function $k(a,b){if(ra("There may be a problem with your "+wb+" machine.\n\nTo help us diagnose it, click OK to send this "+wb+" machine state to http://www.pcjs.org.")){var c=a.U;a=a.g||"";b=b.toString();var d={};d.app=wb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;Xa("http://www.pcjs.org/api/v1/report",d,!0)}} +function Jk(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new G(a,"1.33.1"),g=new G(a,"1.33.1",Uk),k=Wa();g.set(Wk,k);f.set(Wk,k);f.set(fl,"1.33.1");f.set(gl,window?window.location.href:null);f.set(jl,window?window.navigator.userAgent:"");a.f&&a.f.Ca&&(c&&(b&&(a.f.A.ra=a.f.A.V),a.f.ba()),d=a.f.Ca(b,c),"object"===typeof d&&f.set(a.f.id,d),c&&(a.f.A.aa=!1,!1===d&&(e=null)));for(var k=ta(a.id),l=0;l=d||30<=(c.Xc+=d))&&(e.textContent=c.A.V?c.xb.toFixed(2)+"Mhz":"Stopped",c.Xc=0)}if(a.i&&(a=a.i,b=b||0,a.u)){c=a.f.A.V;d=!!(a.f.i&8);if(0>=b||60<=(a.j+=b)){for(e=0;eb?a.fa=a.f.g[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Xa(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);Al(a,b,c)}})}else c(a,null)} +function Bl(a,b,c,d){function e(a){if(void 0===k){var b=g&&x(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ma(a))}function f(a){e("Error: "+a);l&&(--xl||qb(!0));l=!1}var g,k,l=!0;xl++;pa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=m:q.appendChild(document.createTextNode(m));n.appendChild(q)}c|| +(c="/versions/pdpjs/1.33.1/components.xsl");m=function(d,k){k?yl(c,null,null,!1,e,function(d,l){l?(oa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--xl||qb(!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),--xl||qb(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?yl(b,a,d,!0,e,m):zl(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){qb(!1);return Bl(a,b,c,d)};window.findMachineComponent=function(a,b){return va(b,a+".machine")};window.enableEvents=qb;window.sendEvent=sb;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11-dbg.map diff --git a/versions/pdpjs/1.33.1/pdp11.js b/versions/pdpjs/1.33.1/pdp11.js index e4ae90c9a..aa5b01143 100644 --- a/versions/pdpjs/1.33.1/pdp11.js +++ b/versions/pdpjs/1.33.1/pdp11.js @@ -16,6 +16,7 @@ http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2017 + http://pcjs.org/modules/pdp11/lib/rx11.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2017 @@ -34,251 +35,262 @@ http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2017 */ var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var ea=0;function da(a){return"jscomp_symbol_"+(a||"")+ea++} -function ga(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(this)}});ga=function(){}}function ha(a){var b=0;return ia(function(){return b":62,"?":63,"@":64,Nc:65,Ug:66,Xg:67,wh:68,E:69,Ch:70,Eh:71,Qh:72,Sh:73,Th:74,Uh:75,Vh:76,Yh:77,$h:78,bi:79,ei:80,Q:81,gi:82,ii:83,ri:84,ti:85,vi:86,wi:87,Ai:88,Bi:89,le:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ci:97,Di:98,Gi:99,d:100,e:101,Hi:102,Ii:103,Ji:104,Ki:105,Oi:106,k:107,Pi:108,Qi:109,n:110,Ri:111,p:112,q:113,r:114,Si:115,t:116,Ui:117,Vi:118,Wi:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Dd:127};function q(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zc=b.comment;this.he=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.Na=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.j={ready:!1,Va:!1,Ac:!1,O:!1,error:!1};this.Ub=null;this.j.error=!1;this.Xc=c||0;this.F=this.c=this.u=this.A=this.gb=null;r.push(this)}function ta(a,b,c){ua[a]&&b&&(ua[a][b]=c)} -function va(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}function xa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c":62,"?":63,"@":64,ed:65,Ch:66,Ih:67,ii:68,E:69,oi:70,si:71,Ei:72,Gi:73,Hi:74,Ii:75,Ji:76,Mi:77,Oi:78,Ui:79,Xi:80,Q:81,Zi:82,bj:83,kj:84,mj:85,oj:86,pj:87,tj:88,uj:89,Ge:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,vj:97,wj:98,zj:99,d:100,e:101,Aj:102,Bj:103,Cj:104,Dj:105,Hj:106,k:107,Ij:108,Jj:109,n:110,Kj:111,p:112,q:113,r:114,Lj:115,t:116,Nj:117,Oj:118,Pj:119,x:120, +y:121,z:122,"{":123,"|":124,"}":125,"~":126,Cb:127};function r(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pd=b.comment;this.Ee=b;this.exports={};this.o=this.bindings={};a=this.id.indexOf(".");0>a?this.ib=this.id:(this.Ua=this.id.substr(0,a),this.ib=this.id.substr(a+1));this.j={ready:!1,Ra:!1,Tc:!1,R:!1,error:!1};this.fc=null;this.j.error=!1;this.nd=c||0;this.D=this.c=this.u=this.A=this.ob=null;t.push(this)}function na(a,b,c){oa[a]&&b&&(oa[a][b]=c)} +function pa(){return Date.now()||+new Date}function u(a){window&&window.alert(a)}function qa(a){var b=!1;window&&(b=window.confirm(a));return b}function ra(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>=3;return""+c}function Ea(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} -function Fa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Ja[a]})}function Ka(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var Ja={"&":"&","<":"<",">":">",'"':""","'":"'"},Ma={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 Na(){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 Oa(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, +function wa(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function ya(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function za(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return Da[a]})}function Ea(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var Da={"&":"&","<":"<",">":">",'"':""","'":"'"},Fa={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 Ga(){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 Ha(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 Pa(a,b){var c,d={M:null,ga:null,ca:null,ba: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.ca=g.load;d.ba=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.ga=g.symbols;d.M.length?1==d.M.length&&(u(d.M[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.De,a];this.F=this.c=this.u=this.A=null;B(this)}n(lb,q);h=lb.prototype; -h.reset=function(a){this.stop();a&&nb(this,this.f=0)}; -h.ka=function(a,b,c,d){if(this.A&&this.A.ka(a,b,c,d)||this.c&&this.c.ka(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.m[b]=c,this.l++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.h[b]=d?1:0,this.l++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ob(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){pb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ob(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){pb(a,b)}}(this,b),!0):q.prototype.ka.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;qb(b,this,rb);sb(b,this.reset.bind(this));tb(this);ub(this)};h.ja=function(a,b){if(!b)if(this.D&&vb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; -h.ia=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.U,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])wb(this,this.U=a[0]),nb(this,this.f=a[1]),xb(this,a[2]);return!0};function yb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function tb(a,b){for(var c in a.h)yb(a,c,null!=b?b:a.h[c])}function zb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -function ub(a){for(var b in a.a)zb(a,b,a.a[b][1])}function Ab(a,b,c,d){if(a.m[b]){var e=a.F&&a.F.h||8;c=c||0;c=8==e?Da(c,d):Ea(c,d);a.m[b].textContent!=c&&(a.m[b].textContent=c)}}function ob(a,b){var c=a.a[b];zb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=Bb&&(a.w=b==Cb,a.B=b==Db)}function pb(a,b){var c=a.a[b];c[2]&&c[3]&&(zb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Be=function(a){a||this.c.j.L||(a=this.c,a.u.reset(),Eb(a),this.a[Fb]&&this.a[Fb][1]&&Gb(this.c))};h.Ce=function(){}; -h.xe=function(a){a||F(this.c)};h.ve=function(a){if(!a&&!this.c.j.L)if(this.a[Fb]&&this.a[Fb][1])Gb(this.c);else{a=this.F;var b;if(b=a)a.j.Va&&(a.j.Ac=!0),b=!a.j.Va;if(b)Ba(a,!0),a.f(0,null),Ba(a,!1);else try{var c=this.c.kc(1);0=a.c.pa?8:16,c=65472<=a.U&&a.U<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[Bb]&&a.a[Bb][1]||(b=-b);wb(a,a.U&~c|a.U+b&c)}function wb(a,b){a.U=b&a.u.v;if(a.s!==a.U){a.s=a.U;b=a.s;for(var c=0;22>c;c++)Pb(a,"A"+c,b&1<c;c++)Pb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.C/this.g|0;this.K=this.s-1;this.Ka=[];this.l=0;this.o=!1;this.D=[];this.me=[Ub,Vb,Wb,Xb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Yb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;B(this)}n(Sb,q);function ac(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Sb.prototype;h.reset=function(){for(var a=0;ab.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.ea=g.load;d.da=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>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ia=g.symbols;d.N.length?1==d.N.length&&(u(d.N[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca;a++)this.a["S"+a]=[0,0,!1,!1,this.cf,a];this.D=this.c=this.u=this.A=null;B(this)}n(gb,r);h=gb.prototype; +h.reset=function(a){this.stop();a&&ib(this,this.f=0)}; +h.ma=function(a,b,c,d){if(this.A&&this.A.ma(a,b,c,d)||this.c&&this.c.ma(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.h[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){jb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){kb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){jb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){kb(a,b)}}(this,b),!0):r.prototype.ma.call(this,a,b,c,d)}};h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;lb(b,this,mb);nb(b,this.reset.bind(this));ob(this);pb(this)};h.la=function(a,b){if(!b)if(this.F&&qb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0}; +h.ka=function(a){return a?this.save():!0};h.save=function(){var a=new E(this);a.set(0,[this.V,this.f,this.b]);return a.data()};h.restore=function(a){if(a=a[0])rb(this,this.V=a[0]),ib(this,this.f=a[1]),sb(this,a[2]);return!0};function tb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ob(a,b){for(var c in a.h)tb(a,c,null!=b?b:a.h[c])}function ub(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} +function pb(a){for(var b in a.a)ub(a,b,a.a[b][1])}function vb(a,b,c,d){if(a.o[b]){var e=a.D&&a.D.h||8;c=c||0;c=8==e?xa(c,d):ya(c,d);a.o[b].textContent!=c&&(a.o[b].textContent=c)}}function jb(a,b){var c=a.a[b];ub(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);b!=wb&&(a.w=b==xb,a.B=b==yb)}function kb(a,b){var c=a.a[b];c[2]&&c[3]&&(ub(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.af=function(a){a||this.c.j.M||(a=this.c,a.u.reset(),zb(a),this.a[Ab]&&this.a[Ab][1]&&Bb(this.c))};h.bf=function(){}; +h.Xe=function(a){a||F(this.c)};h.Ve=function(a){if(!a&&!this.c.j.M)if(this.a[Ab]&&this.a[Ab][1])Bb(this.c);else{a=this.D;var b;if(b=a)a.j.Ra&&(a.j.Tc=!0),b=!a.j.Ra;if(b)va(a,!0),a.f(0,null),va(a,!1);else try{var c=this.c.wc(1);0=a.c.sa?8:16,c=65472<=a.V&&a.V<65472+b,b=c?1:2,c=c?15:a.u.v;a.a[wb]&&a.a[wb][1]||(b=-b);rb(a,a.V&~c|a.V+b&c)}function rb(a,b){a.V=b&a.u.v;if(a.s!==a.V){a.s=a.V;b=a.s;for(var c=0;22>c;c++)Kb(a,"A"+c,b&1<c;c++)Kb(a,"D"+c,b&1<c;c++)a.a["S"+c][1]=b&1<>2;this.f=this.g-1;this.s=this.C/this.g|0;this.K=this.s-1;this.Qa=[];this.m=0;this.l=!1;this.F=[];this.He=[Pb,Qb,Rb,Sb];this.a=this.b=[];this.B=this.w=this.i=this.H=this.I=0;a=new G(this);Tb(a);this.a=Array(this.s);this.b=Array(this.s);for(b=0;b>>this.h;this.w=0;this.i=this.v;B(this)}n(Nb,r);function Wb(a,b){if(b!=a.w){for(var c=0;c>>a.h,a.b[a.I]=a.a[a.H])}}h=Nb.prototype;h.reset=function(){for(var a=0;a>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ua)return l.Hb+=l.Ua-f,l.Ua=f,!0;if(f>=l.Ua+l.Hb){p=l.size-(f-m);p>g&&(p=g);l.Hb=f-l.Ua+p;f=m+a.g;g-=p;k++;continue}}return cc(dc,f,g)}f=new G(a,f,p,a.g,d,e);Yb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+ec[d]+" at "+Da(b)),!0):cc(fc,b,c)}h.xd=function(a){return this.b[(a&this.i)>>>this.h].lb(a&this.f,a)}; -h.Kb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return jb||b!=this.f?this.b[c].W(b,a):this.b[c++].lb(b,a)|this.b[c&this.K].lb(0,a+1)<<8};h.yd=function(a,b){this.b[(a&this.i)>>>this.h].ob(a&this.f,b,a)};h.Lb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;jb||c!=this.f?this.b[d].rb(c,b,a):(this.b[d++].ob(c,b&255,a),this.b[d&this.K].ob(0,b>>8&255,a+1))};function gc(a,b){return a.a[(b&a.v)>>>a.h]} -function Ob(a,b){var c;a.o=!1;a.l++;var d=b&a.f,e=gc(a,b);jb||d!=a.f?c=e.l(d,b):c=e.i(d,b)|gc(a,b+1).i(0,b+1)<<8;a.l--;return c}function hc(a,b,c){a.o=!1;a.l++;gc(a,b).m(b&a.f,c&255,b);a.l--}function Mb(a,b,c){a.o=!1;a.l++;var d=b&a.f,e=gc(a,b);jb||d!=a.f?e.F(d,c&65535,b):(e.m(d,c&255,b),gc(a,b+1).m(0,c>>8&255,b+1));a.l--} -function bc(a){for(var b=0,c=[],d=0;da.c.pa)){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],z=g[5]||1,y=0;y>8:e[2](f)&255):f&1&&(e=d.Ka[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255} -function Vb(a,b,c){var d=!1,e=this.controller,f=e.Ka[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.Ka[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||H(e,c,16)}function Wb(a,b){var c=-1,d=this.controller;a=d.Ka[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;H(d,b,16);return 65535} -function Xb(a,b,c){var d=!1,e=this.controller;a=e.Ka[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||H(e,c,16)}function J(a){q.call(this,"Device",a,256);this.a={Da:128,Jc:-1}}n(J,q);h=J.prototype;h.ha=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.F=d;var e=this;this.a.Jc=nc(c,function(){e.a.Da|=128;e.a.Da&64&&oc(e.c,e.a.jb);e.A&&Kb(e.A,1);pc(e.c,e.a.Jc,1E3/60)});this.a.jb=qc(c,64,6,524288);qb(b,this,sc);sb(b,this.reset.bind(this));B(this)}; -h.ja=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.a.Da=128;pc(this.c,this.a.Jc,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Da]);return a.data()};h.restore=function(a){a=ja(a[0]);this.a.Da=a.next().value;return!0};h.Pe=function(){return this.a.Da};h.bg=function(a){this.a.Da=a&192;this.a.Da&64||(a=this.a.jb)&&tc(this.c,a)};h.Re=function(){return uc(this.c)}; -h.dg=function(a){vc(this.c,a&-129|this.c.J&128)};h.Se=function(){return wc(this.c)};h.Te=function(){return xc(this.c)};h.Ue=function(){return this.c.qa};h.eg=function(a){yc(this.c,a)};h.Df=function(a){a=a>>1&63;var b=this.c.Ja[a>>1];return a&1?b>>16:b&65535};h.Mg=function(a,b){b=b>>1&63;var c=b>>1;this.c.Ja[c]=b&1?this.c.Ja[c]&65535|(a&63)<<16:this.c.Ja[c]&-65536|a&65534};h.wf=function(a){return this.c.s[1][a>>1&7]};h.Fg=function(a,b){this.c.s[1][b>>1&7]=a&65295}; -h.uf=function(a){return this.c.s[1][(a>>1&7)+8]};h.Dg=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.vf=function(a){return this.c.H[1][a>>1&7]};h.Eg=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.tf=function(a){return this.c.H[1][(a>>1&7)+8]};h.Cg=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Oe=function(a){return this.c.s[0][a>>1&7]};h.ag=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.Me=function(a){return this.c.s[0][(a>>1&7)+8]}; -h.Zf=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.Ne=function(a){return this.c.H[0][a>>1&7]};h.$f=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Le=function(a){return this.c.H[0][(a>>1&7)+8]};h.Yf=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.Cf=function(a){return this.c.s[3][a>>1&7]};h.Lg=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.Af=function(a){return this.c.s[3][(a>>1&7)+8]};h.Jg=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; -h.Bf=function(a){return this.c.H[3][a>>1&7]};h.Kg=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.zf=function(a){return this.c.H[3][(a>>1&7)+8]};h.Ig=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.mb=function(a){a&=7;return this.c.i&2048?this.c.sa[a]:this.c.b[a]};h.pb=function(a,b){b&=7;this.c.i&2048?this.c.sa[b]=a:this.c.b[b]=a};h.Ze=function(){return this.c.i&49152?this.c.fa[0]:this.c.b[6]};h.jg=function(a){this.c.i&49152?this.c.fa[0]=a:this.c.b[6]=a}; -h.bf=function(){return this.c.b[7]};h.mg=function(a){this.c.b[7]=a};h.nb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.sa[a]};h.qb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.sa[b]=a};h.$e=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[1]};h.kg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[1]=a};h.af=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.fa[3]};h.lg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.fa[3]=a}; -h.Ke=function(a){return this.c.Eb[a-65504>>1]};h.Xf=function(a,b){this.c.Eb[b-65504>>1]=a};h.sd=function(a){return 65520==a?(ic(this.u)>>6)-1:0};h.vd=function(){};h.yf=function(){return 1};h.Hg=function(){};h.Je=function(){return this.c.D};h.Wf=function(){this.c.D=0};h.Qe=function(){return this.c.Bb};h.cg=function(a,b){b&1||(a&=255);this.c.Bb=a};h.Ve=function(a,b){return b?0:this.c.Sa};h.fg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.Sa=a}; -h.xf=function(a,b){return b?0:this.c.Ia&65280};h.Gg=function(a){this.c.Ia=a|255};h.Ye=function(){return zc(this.c)};h.ig=function(a){Ac(this.c,a)};h.ud=function(){}; -var K={},sc=(K[61568]=[null,null,J.prototype.Df,J.prototype.Mg,"UNIMAP",64,1170],K[62592]=[null,null,J.prototype.wf,J.prototype.Fg,"SIPDR",8,1145,64],K[62608]=[null,null,J.prototype.uf,J.prototype.Dg,"SDPDR",8,1145,64],K[62624]=[null,null,J.prototype.vf,J.prototype.Eg,"SIPAR",8,1145,64],K[62640]=[null,null,J.prototype.tf,J.prototype.Cg,"SDPAR",8,1145,64],K[62656]=[null,null,J.prototype.Oe,J.prototype.ag,"KIPDR",8,1140,64],K[62672]=[null,null,J.prototype.Me,J.prototype.Zf,"KDPDR",8,1145,64],K[62688]= -[null,null,J.prototype.Ne,J.prototype.$f,"KIPAR",8,1140,64],K[62704]=[null,null,J.prototype.Le,J.prototype.Yf,"KDPAR",8,1145,64],K[62798]=[null,null,J.prototype.Ue,J.prototype.eg,"MMR3",1,1145,64],K[65382]=[null,null,J.prototype.Pe,J.prototype.bg,"LKS"],K[65402]=[null,null,J.prototype.Re,J.prototype.dg,"MMR0",1,1140,64],K[65404]=[null,null,J.prototype.Se,J.prototype.ud,"MMR1",1,1145,64],K[65406]=[null,null,J.prototype.Te,J.prototype.ud,"MMR2",1,1140,64],K[65408]=[null,null,J.prototype.Cf,J.prototype.Lg, -"UIPDR",8,1140,64],K[65424]=[null,null,J.prototype.Af,J.prototype.Jg,"UDPDR",8,1145,64],K[65440]=[null,null,J.prototype.Bf,J.prototype.Kg,"UIPAR",8,1140,64],K[65456]=[null,null,J.prototype.zf,J.prototype.Ig,"UDPAR",8,1145,64],K[65472]=[null,null,J.prototype.mb,J.prototype.pb,"R0SET0"],K[65473]=[null,null,J.prototype.mb,J.prototype.pb,"R1SET0"],K[65474]=[null,null,J.prototype.mb,J.prototype.pb,"R2SET0"],K[65475]=[null,null,J.prototype.mb,J.prototype.pb,"R3SET0"],K[65476]=[null,null,J.prototype.mb, -J.prototype.pb,"R4SET0"],K[65477]=[null,null,J.prototype.mb,J.prototype.pb,"R5SET0"],K[65478]=[null,null,J.prototype.Ze,J.prototype.jg,"R6KERNEL"],K[65479]=[null,null,J.prototype.bf,J.prototype.mg,"R7KERNEL"],K[65480]=[null,null,J.prototype.nb,J.prototype.qb,"R0SET1",1,1145],K[65481]=[null,null,J.prototype.nb,J.prototype.qb,"R1SET1",1,1145],K[65482]=[null,null,J.prototype.nb,J.prototype.qb,"R2SET1",1,1145],K[65483]=[null,null,J.prototype.nb,J.prototype.qb,"R3SET1",1,1145],K[65484]=[null,null,J.prototype.nb, -J.prototype.qb,"R4SET1",1,1145],K[65485]=[null,null,J.prototype.nb,J.prototype.qb,"R5SET1",1,1145],K[65486]=[null,null,J.prototype.$e,J.prototype.kg,"R6SUPER",1,1145],K[65487]=[null,null,J.prototype.af,J.prototype.lg,"R6USER",1,1145],K[65504]=[null,null,J.prototype.Ke,J.prototype.Xf,"CTRL",8,1170],K[65520]=[null,null,J.prototype.sd,J.prototype.vd,"LSIZE",1,1170],K[65522]=[null,null,J.prototype.sd,J.prototype.vd,"HSIZE",1,1170],K[65524]=[null,null,J.prototype.yf,J.prototype.Hg,"SYSID",1,1170],K[65526]= -[null,null,J.prototype.Je,J.prototype.Wf,"ERR",1,1170],K[65528]=[null,null,J.prototype.Qe,J.prototype.cg,"MBR",1,1170],K[65530]=[null,null,J.prototype.Ve,J.prototype.fg,"PIR"],K[65532]=[null,null,J.prototype.xf,J.prototype.Gg,"SLR"],K[65534]=[null,null,J.prototype.Ye,J.prototype.ig,"PSW"],K); -Za(function(){for(var a=A(document,x,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),Fc(this,Gc?Hc:Ic);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.He=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.If=function(a,b){ib&&a&1&&H(this.b,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.Uf=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ca=!0};h.Fe=function(a,b){return this.i(a,b)};h.Ff=function(a,b){return this.l(a,b)};h.Sf=function(a,b,c){this.A?this.Jb(0,0,c):this.m(a,b,c)};h.Og=function(a,b,c){this.A?this.Jb(0,0,c):this.F(a,b,c)};h.Ee=function(a){return this.a[a]}; -h.Ge=function(a){return this.a[a]};h.Ef=function(a,b){ib&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.Hf=function(a,b){ib&&a&1&&H(this.b,b,64);return!jb&&a&1?this.a[a]|this.a[a+1]<<8:this.o[a>>1]};h.Rf=function(a,b){this.a[a]=b;this.Ca=!0};h.Tf=function(a,b){this.a[a]=b;this.Ca=!0};h.Ng=function(a,b,c){ib&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ca=!0};h.Pg=function(a,b,c){ib&&a&1&&H(this.b,c,64);!jb&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.o[a>>1]=b;this.Ca=!0}; -var Dc=0,jc=1,Ec=2,$b=4,ec=["NONE","RAM","ROM","VID","H/W"],Cc=0,Lc=[],Jc=[G.prototype.He,G.prototype.Uf,G.prototype.If,G.prototype.Qg],Oc=[G.prototype.Fe,G.prototype.Sf,G.prototype.Ff,G.prototype.Og];if(gb)var Ic=[G.prototype.Ee,G.prototype.Rf,G.prototype.Ef,G.prototype.Ng],Hc=[G.prototype.Ge,G.prototype.Tf,G.prototype.Hf,G.prototype.Pg];var Pc;if(gb){var Qc=new ArrayBuffer(2);(new DataView(Qc)).setUint16(0,256,!0);Pc=256===(new Uint16Array(Qc))[0]}else Pc=!1;var Gc=Pc; -function Rc(a,b){q.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Lc=0;this.ec=b;this.Ra=c;this.nc=Math.round(this.ec/1E4)/100;this.ab=this.nc*this.Ra;this.oc=this.Ab=this.eb=this.fc=0;this.j.L=this.j.Ic=!1;this.j.Y=a.autoStart;"string"==typeof this.j.Y&&(this.j.Y="true"==this.j.Y);this.j.Tb=!1;this.cc=this.cb=0;this.dc=+a.csStart;this.yb=+a.csInterval;this.zb=+a.csStop;this.X=[];this.bd=this.Mf.bind(this);this.Ha=this.Aa=this.Ga=this.a=this.aa=this.za=this.xb=this.Fa=this.fb=this.pc= -this.Oa=0;this.na=null;B(this)}n(Rc,q);h=Rc.prototype;h.ha=function(a,b,c,d){this.A=a;this.u=b;this.F=d;this.na=a.f;for(a=0;a=a.cb&&(a.cb+=a.yb,c=!0);0<=a.zb&&a.zb<=Wc(a)&&(a.yb=a.zb=-1,Vc(a),F(a),c=!0);c&&a.Z(Wc(a)+" cycles: checksum="+Ea(a.cc))}} -h.ka=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.O)a=!0;else{var b=null,c,k=xa(a.id);for(c=0;ca.Oa/a.ab&&(b=1);a.Ra=b;b=a.nc*a.Ra;if(a.ab!=b){a.ab=b;b=a.ab.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.Z("target speed: "+b)}c&&a.A&&$c(a.A)}Ib(a,a.Aa);a.Aa=0;a.za=va();a.Fa=0;Yc(a)}function nc(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function pc(a,b,c,d){0<=b&&ba.X[b][0])&&(c=a.ec*a.Ra/1E3*c|0,a.j.L&&(c+=ad(a)),a.X[b][0]=c)}function bd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ad(a,b){var c=a.Ga-=a.a;a.a=a.aa=0;b&&(a.Ga=0);return c} -h.Mf=function(){if(this.j.L){this.fc>=this.ec&&Yc(this,!0);this.fb=0;this.xb=va();if(this.Fa){var a=this.xb-this.Fa;a>this.oc&&(this.za+=a,this.za>this.xb&&(this.za=this.xb))}try{do{for(var b,c=this.j.Tb?1:this.Ab,d=this.X.length-1;0<=d;d--){var e=this.X[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.kc(b)}catch(f){if("number"!=typeof f)throw f;}b=ad(this,!0);this.fb+=b;this.Aa+=b;Jb(this,b);Hb(this,b);this.eb-=b;if(0>=this.eb){this.eb+=this.Ab;++this.pc>=cd&&(this.A&&Kb(this.A,void 0),this.pc=0);break}}while(this.j.L)}catch(f){F(this); -this.A&&this.A.stop(va(),Wc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.L){a=setTimeout;b=this.bd;this.Fa=va();c=this.oc;this.fb&&(c=Math.round(c*this.fb/this.Ab));c-=this.Fa-this.xb;if(d=this.Fa-this.za)this.Oa=Math.round(this.Aa/(10*d))/100,864E5<=d&&(this.Ha=0,Xc(this));if(0>c||this.Oac&&(this.za-=c),c=0;this.fc+=this.fb;this.Fa+=c;a(b,c)}}}; -function Gb(a){var b;a.j.error?(a.Z(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.L)a.Z(a.toString()+" busy");else{Xc(a);a.j.L=!0;a.j.Ic=!0;if(b=a.m.run)b.textContent="Halt";a.A&&a.A.start(a.za,Wc(a));a.F||a.status("Started");setTimeout(a.bd,0)}}h.kc=function(){return 0};function F(a){var b=!1;if(a.j.L){ad(a);Ib(a,a.Aa);a.Aa=0;a.j.L=!1;if(b=a.m.run)b.textContent="Run";a.A&&a.A.stop(va(),Wc(a));b=!0;a.F||a.status("Stopped")}a.j.complete=void 0;return b}var Zc=30,cd=15,Sc=["power","reset"]; -function dd(a){var b=+a.model||1170;Rc.call(this,a,6666667);this.pa=b;this.Wc=+a.addrReset||0;this.Ba=this.i=this.B=this.v=this.l=this.o=this.w=0;this.b=this.sa=this.fa=[];this.H=this.s=this.Ja=this.Eb=[];this.Ea=this.C=this.Vc=this.bb=this.Pa=this.Qa=this.Wa=this.D=this.Bb=this.Sa=this.Ia=this.J=this.Cb=this.Db=this.qa=this.g=0;this.ge=[4,2,0,1];this.hc=0;this.$c=255;1120>=this.pa?(this.Uc=ed.bind(this),this.Za=this.pe,this.hc=8,this.$c=-1,this.fd=255,this.cd=0):(this.Uc=fd.bind(this),this.Za=this.qe, -this.fd=~(1792|(1140>=this.pa?2048:0))&65535,this.cd=1140e.Ib&&(e.Ib=c,c+=4)}return Rc.prototype.ja.call(this,a,b)}; -h.reset=function(){this.status("Model "+this.pa);this.j.L&&F(this);this.v=65536;this.l=32768;this.o=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.Wc,-1,-2,-3,-4,-5,-6,-7,-8];this.sa=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,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.Ja=[0,0,0,0,0,0,0,0,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.Eb=[0,0,0,0,0,0,0,0];this.B=0;this.Ba=-1;this.h=this.f=this.bc=this.K=this.R=this.g=this.Bb=0;Eb(this);Uc(this);this.j.error=!1;Rc.prototype.reset.call(this)};function Eb(a){a.J=0;a.Cb=0;a.Db=0;a.qa=0;a.D=0;a.Sa=0;a.Ia=255;a.bb=0;a.Pa=0;a.Qa=0;a.Wa=262143;a.Ea=a.b[7];a.C=0;a.I=null;a.u&&(gd(a),a.Vc=ic(a.u))} -function gd(a){a.Yb=a.Mc;a.Zb=a.ic;a.jc=a.lc;a.$b=a.mc;a.bb?(a.xa=65536,a.Xb=a.qa&16?4186112:253952,a.oa=a.pd,a.W=a.td,a.rb=a.wd,ac(a.u,a.qa&16?22:18)):(a.xa=0,a.Xb=57344,a.oa=a.te,a.W=a.Gf,a.rb=a.Rg,ac(a.u,16))}function uc(a){var b=a.J;b&57344||(b=b&-3199|a.Pa<<5|a.Qa<<1);return b}function vc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Cb=a.C>>16&65535,a.Db=a.C&65535);a.J=b;a.Pa=(b&96)>>5;a.Qa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.bb!=c&&(a.bb=c,gd(a))}} -function wc(a){a.J&57344||(a.Cb=a.C>>16&65535);a=a.Cb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function xc(a){a.J&57344||(a.Db=a.C&65535);return a.Db}function yc(a,b){1170>a.pa&&(b&=-49);a.qa!=b&&(a.qa=b,a.Wa=b&16?4194303:262143,gd(a))}function hd(a,b,c){a.Wc=b;id(a,b);Ac(a,0);a.u.reset();Eb(a);if(c){for(b=2;5>=b;b++)a.b[b]=0;a.j.O?a.j.L||Gb(a):a.j.Y=!0}else a.F&&a.j.O?F(a)||(a.F.g(),Kb(a.A,-1)):!1===c&&F(a);!a.j.L&&a.na&&a.na.stop()}h.od=function(){return 0}; -h.save=function(){var a=new E(this);a.set(0,[this.b,this.sa,this.fa,this.H,this.s,this.Ja,this.Eb,this.D,this.Bb,this.Sa,this.Ia,this.Pa,this.Qa,this.Ea,this.g,this.C,this.Ba,this.sc,this.uc]);a.set(1,[zc(this),uc(this),wc(this),xc(this),this.qa]);a.set(2,[this.Ha,this.Ra,this.j.Y]);a.set(3,jd(this));a.set(4,bd(this));return a.data()}; -h.restore=function(a){var b=ja(a[0]);this.b=b.next().value;this.sa=b.next().value;this.fa=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Ja=b.next().value;this.Eb=b.next().value;this.D=b.next().value;this.Bb=b.next().value;this.Sa=b.next().value;this.Ia=b.next().value;this.Pa=b.next().value;this.Qa=b.next().value;this.Ea=b.next().value;this.g=b.next().value;this.C=b.next().value;this.Ba=b.next().value;this.sc=b.next().value;this.uc=b.next().value;b=a[1];Ac(this,b[0]);vc(this,b[1]); -this.Cb=b[2];this.Db=b[3];yc(this,b[4]);b=a[2];this.Ha=b[0];Xc(this,b[1]);this.j.Y=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function id(a,b){a.b[7]=b&65535}function qc(a,b,c,d){b={Ib:b,kb:c,message:d||0,name:kb[b],next:null};a.wb.push(b);return b}function tc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function oc(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.kb<=b.kb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.kb<=b.kb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} -function jd(a){var b=[];for(a=a.I;a;)b.push(a.Ib),a=a.next;return b}function nd(a){return a.g&64?(I(a,168,64,-6),!0):a.g&32?(I(a,4,32,-5),!0):a.g&16?(I(a,12,16,-7),!0):!1}function zc(a){return a.i=a.i&63728|ld(a)|(a.o&65535?0:4)|(a.l&32768?2:0)|kd(a)}function Ac(a,b){b&=a.fd;a.w=b<<12;a.o=~b&4;a.l=b<<14;a.v=b<<16;if((b^a.i)&a.cd)for(var c=a.sa.length;0<=--c;){var d=a.b[c];a.b[c]=a.sa[c];a.sa[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.fa[c]=a.b[6],a.b[6]=a.fa[a.B]);a.i=b;a.g&=-3;a.g|=a.I?2:1} -h.ea=function(a){this.w=this.o=a;this.l=0};h.La=function(a,b){this.w=this.o=this.v=a;this.l=b||0};function od(a,b){a.w=a.o=a.v=b;a.l=a.w^a.v>>1}function pd(a,b,c,d){a.w=a.o=a.v=b;a.l=(c^d)&(d^b)} -function I(a,b,c,d){if(!a.hb){0>a.Ba?a.Ba=zc(a):a.B||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.D|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.W(b|a.xa),f=a.W(b+2&65535|a.xa);Ac(a,f&-12289|a.Ba>>2&12288);qd(a,a.Ba);qd(a,a.b[7]);id(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Ba=-1;a.sc=d;a.uc=b;-1==d&&F(a);if(-4<=d)throw b;}}function rd(a){var b=sd(a),c=sd(a);a.i&49152&&(c=c&-225|a.i&63712);id(a,b);Ac(a,c);a.g&=-17} -function td(a,b){var c=b>>13&31;31>c&&(b=a.qa&32?a.Ja[c]+(b&8191)&4194303:b&-3932161);return b} -function Nb(a,b,c){var d,e,f;if(!(c&a.bb))return f=b&65535,57344<=f&&(f|=a.Xb),f;d=b>>13;a.qa&a.ge[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.Wa;3932160<=f&&(f=td(a,f));if(a.hb)return f;f>=a.Vc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.Wa)||a.B)a.Pa=a.B,a.Qa=d;g&&(g&57344&&(0<=a.Ba&&(g|=128),a.J&57344||(g|=a.J&4096|a.Pa<<5|a.Qa<<1,vc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.Wa)||f>(4194239&a.Wa))||(a.J|=4096,a.J&512&&(a.g|=64)));return f}function sd(a){var b=a.W(a.b[6]|a.xa);a.b[6]=a.b[6]+2&65535;return b}function qd(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.g&256||a.Za(4,-2,c);a.rb(c,b)} -function ud(a,b,c,d){var e,f,g=d&8?0:a.xa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.Za(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.Za(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.W(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.Za(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.W(e)|g;a.a-=8;break;case 6:return e=a.W(md(a,2)),e=e+a.b[c]&65535,6==c&&a.Za(d,0, -e),a.a-=6,e|g;case 7:return e=a.W(md(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.xa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.pe=function(a,b,c){!this.B&&0>=b&&c<=this.Ia&&(this.g|=32)};h.qe=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Ia&&(c<=this.Ia-32?I(this,4,0,-4):(this.D|=8,this.g|=32)))};h.se=function(a){return this.Mc(a)};h.ue=function(a){return this.ic(a)};h.Of=function(a,b){this.lc(a,b)};h.Qf=function(a,b){this.mc(a,b)}; -h.te=function(a,b,c){return ud(this,a,b,c)};h.pd=function(a,b,c){return Nb(this,ud(this,a,b,c),c)};h.Gf=function(a){return this.u.Kb(this.Ea=a)};h.td=function(a){return this.u.Kb(this.Ea=Nb(this,a,2))};h.Rg=function(a,b){this.u.Lb(this.Ea=a,b)};h.wd=function(a,b){this.u.Lb(this.Ea=Nb(this,a,4),b)}; -function vd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=ud(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.W(d|c&a.xa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.fa[a.i>>12&3];return c}function wd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=ud(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Nb(a,e|c&65536,4),a.B=a.i>>14&3,a.$b(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.fa[a.i>>12&3]=d} -function xd(a,b){b>>=6;var c=a.R=b&7;return(b=a.K=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c+a.hc]&a.$c}function yd(a,b){var c;b>>=6;var d=a.R=b&7;(b=a.K=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d+a.hc];return c}function zd(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return ud(a,b,c,8)}function Ad(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.Yb(a.oa(b,c,3)):a.b[c]&255}function Bd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.Zb(a.oa(b,d,2)):c=a.b[d];return c} -function O(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.bc=a.oa(b,e,7),c=0>c?a.b[-c-1]&255:c,a.jc(e,d.call(a,c,a.Yb(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 P(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,6),a.$b(e,d.call(a,0>c?a.b[-c-1]:c,a.Zb(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} -function Cd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.oa(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.jc(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 Dd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.oa(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.$b(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} -h.kc=function(a){this.j.complete=!0;var b=a?this.j.Ic?0:1:-1;this.j.Ic=!1;this.Ga=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.Sa&224)>>5,e=this.I&&this.I.kb>d?this.I:null;e&&(c=e.Ib,d=e.kb);d>(this.i&224)>>5?(this.g&8&&(md(this,2),this.g&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&tc(this,e),a=!0);this.I||this.Sa||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.g&112&&nd(this)){if(this.g& -4&&this.F.b(this.b[7],b)){F(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.C=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.Uc(e)}while(0>1|b<<16;od(this,a);return a&65535}function Jd(a,b){a=b&128|b>>1|b<<8;od(this,a<<8);return a&255}function Kd(a,b){a=b&~a;this.ea(a);return a}function Ld(a,b){a=b&~a;this.ea(a<<8);return a}function Md(a,b){a|=b;this.ea(a);return a}function Nd(a,b){a|=b;this.ea(a<<8);return a} -function Od(a,b){a=~b|65536;this.La(a);return a&65535}function Pd(a,b){a=~b|256;this.La(a<<8);return a&255}function Qd(a,b){this.w=this.o=a=b-a;this.l=b&(b^a);return a&65535}function Rd(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.o=c;this.l=b&(b^c);return a&255}function Sd(a,b){this.w=this.o=a=b+a;this.l=a&(b^a);return a&65535}function Td(a,b){a=b+a;var c=a<<8;this.w=this.o=c;this.l=c&(b<<8^c);return a&255}function Ud(a,b){a=-b;this.La(a,a&b&32768);return a&65535} -function Vd(a,b){a=-b;this.La(a<<8,(a&b&128)<<8);return a&255}function Wd(a,b){a=b<<1|this.v>>16&1;od(this,a);return a&65535}function Xd(a,b){a=b<<1|this.v>>16&1;od(this,a<<8);return a&255}function Yd(a,b){a=(this.v&65536|b)>>1|b<<16;od(this,a);return a&65535}function Zd(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;od(this,a<<8);return a&255}function $d(a,b){var c=b-a;pd(this,c,a,b);return c&65535}function ae(a,b){var c=b-a;pd(this,c<<8,a<<8,b<<8);return c&255} -function be(a,b){this.w=this.o=b&65280;this.l=this.v=0;return(b<<8|b>>8)&65535}function ce(a,b){a^=b;this.ea(a);return a&65535}function de(a){P(this,a,yd(this,a),Ed);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} -function ee(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a];c&32768&&(c|=4294901760);this.v=this.l=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.l=32768)}this.b[a]=c&65535;this.w=this.o=c;this.a-=(this.h?6:7)+b} -function fe(a){var b=Bd(this,a);a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=0;b&=63;if(b&32){b=64-b;32>b-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.o=d>>16|d;this.a-=(this.h?6:7)+b}function ge(a){N(this,a,!kd(this))}function he(a){N(this,a,kd(this))} -function ie(a){P(this,a,yd(this,a),Kd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function je(a){O(this,a,xd(this,a),Ld);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ke(a){P(this,a,yd(this,a),Md);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function le(a){O(this,a,xd(this,a),Nd);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} -function me(a){var b=yd(this,a);a=Bd(this,a);this.ea((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ne(a){var b=xd(this,a);a=Ad(this,a);this.ea(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function oe(a){N(this,a,this.o&65535?0:4)}function pe(a){N(this,a,!ld(this)==!(this.l&32768))}function qe(a){N(this,a,!!(this.o&65535)&&!ld(this)==!(this.l&32768))} -function re(a){N(this,a,!kd(this)&&!!(this.o&65535))}function se(a){N(this,a,(this.o&65535?0:4)||!ld(this)!=!(this.l&32768))}function te(a){N(this,a,kd(this)||(this.o&65535?0:4))}function ue(a){N(this,a,!ld(this)!=!(this.l&32768))}function ve(a){N(this,a,ld(this))}function we(a){N(this,a,!!(this.o&65535))}function xe(a){N(this,a,!ld(this))}function ye(){I(this,12,0,-9)}function ze(a){N(this,a,!0)}function Ae(a){N(this,a,!(this.l&32768))}function Be(a){N(this,a,this.l&32768?2:0)} -function Q(a){a&1&&(this.v=0);a&2&&(this.l=0);a&4&&(this.o=1);a&8&&(this.w=0);this.a-=5}function Ce(a){var b=yd(this,a);a=Bd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function De(a){var b=xd(this,a);a=Ad(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);pd(this,c,a,b);this.a-=this.h?4+(this.R&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)} -function Ee(a){var b=Bd(this,a);if(b){a=a>>6&7;var c=this.b[a]<<16|this.b[a|1];this.v=this.l=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.l=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.l=32768,this.v=65536,this.a-=7}function Fe(){I(this,24,0,-9);this.a-=20} -function Ge(){this.i&49152?(this.D|=128,I(this,4,0,-8)):(this.na&&1120==this.pa&&this.na.setData(this.b[0],!0),this.F?this.F.i():F(this));this.a-=7}function He(){I(this,16,0,-9);this.a-=20}var Ie=[0,7,7,10,7,11,9,13];function Je(a){this.aa=this.a;id(this,zd(this,a));this.a=this.aa-Ie[this.h]}var Ke=[0,14,14,17,14,18,16,20];function Le(a){this.aa=this.a;var b=zd(this,a);a=a>>6&7;qd(this,this.b[a]);this.b[a]=this.b[7];id(this,b);this.a=this.aa-Ke[this.h]} -var Me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Ne(a){var b=yd(this,a);this.aa=this.a;Dd(this,a,b,this.ea);this.a=this.aa-Me[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Oe(a){var b=xd(this,a);Cd(this,a,b,65535,this.ea);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Pe=[7,13,13,17,14,18,17,21]; -function Qe(a){var b=Bd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.o=this.w|b;this.l=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)id(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function We(a){P(this,a,yd(this,a),$d);this.a-=this.h?9+(this.R&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Xe(a){P(this,a,0,be);this.a-=this.h?9:3+(7==this.f?2:0)}function Ye(){I(this,28,0,-9)} -function Ze(){this.na&&(this.na.U=this.b[7],this.na.setData(this.b[0],!0));this.g|=8;md(this,-2);this.a-=3}function $e(a){P(this,a,this.b[(a>>6&7)+this.hc],ce);this.a-=this.h?9:3+(7==this.f?2:0)}function S(){I(this,8,0,-9)}function ed(a){af[a>>12].call(this,a)}function bf(a){cf[a>>6&3].call(this,a)}function df(a){ef[a>>6&3].call(this,a)}function ff(a){gf[a>>6&3].call(this,a)}function hf(a){jf[a&15].call(this,a)}function kf(a){lf[a&15].call(this,a)}function mf(a){nf[a>>6&3].call(this,a)} -function of(a){pf[a>>6&3].call(this,a)}function qf(a){rf[a>>6&3].call(this,a)} -var af=[function(a){sf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,S,function(a){tf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],sf=[function(a){uf[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,S,S,S],cf=[function(a){Dd(this,a,0,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Qd);this.a-=this.h?9:3+(7==this.f?2:0)}],ef=[function(a){P(this,a,0,Ud); -this.a-=this.h?11:6},function(a){P(this,a,kd(this)?1:0,Ed);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,kd(this)?1:0,$d);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Bd(this,a);this.La(a);this.a-=this.h?4:3+(7==this.f?2:0)}],gf=[function(a){P(this,a,0,Yd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Id);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Gd);this.a-=this.h?9:3+(7==this.f?2:0)}],uf= -[function(a){vf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,S,hf,kf,Xe,Xe,Xe,Xe],vf=[Ge,Ze,Ue,ye,He,Se,S,S,S,S,S,S,S,S,S,S],jf=[Re,function(){this.v=0;this.a-=5},function(){this.l=0;this.a-=5},Q,function(){this.o=1;this.a-=5},Q,Q,Q,function(){this.w=0;this.a-=5},Q,Q,Q,Q,Q,Q,Q],lf=[Re,function(){this.v=65536;this.a-=5},function(){this.l=32768;this.a-=5},R,function(){this.o=0;this.a-=5},R,R,R,function(){this.w=32768;this.a-=5},R,R,R,R,R,R,R],tf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,S,S,S],nf=[function(a){Cd(this, -a,0,255,this.La);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Pd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,1,Rd);this.a-=this.h?9:3+(7==this.f?2:0)}],pf=[function(a){O(this,a,0,Vd);this.a-=this.h?11:6},function(a){O(this,a,kd(this)?1:0,Fd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,kd(this)?1:0,ae);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=Ad(this,a);this.La(a<<8);this.a-=this.h?4:3+ -(7==this.f?2:0)}],rf=[function(a){O(this,a,0,Zd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){O(this,a,0,Jd);this.a-=this.h?9+(this.bc&1):3+(7==this.f?2:0)},function(a){O(this,a,0,Hd);this.a-=this.h?9:3+(7==this.f?2:0)}];function fd(a){wf[a>>12].call(this,a)} -var wf=[function(a){xf[a>>8&15].call(this,a)},Ne,Ce,me,ie,ke,de,function(a){yf[a>>8&15].call(this,a)},function(a){zf[a>>8&15].call(this,a)},Oe,De,ne,je,le,We,S],xf=[function(a){Af[a>>4&15].call(this,a)},ze,we,oe,pe,ue,qe,se,Le,Le,bf,df,ff,function(a){Bf[a>>6&3].call(this,a)},S,S],Bf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.xa);id(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=vd(this,a,0);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this); -this.aa=this.a;this.ea(b);wd(this,a,0,b);this.a=this.aa-Pe[this.h]},function(a){Dd(this,a,ld(this)?65535:0,this.ea);this.a-=this.h?9:3+(7==this.f?2:0)}],Af=[function(a){Cf[a&15].call(this,a)},S,S,S,Je,Je,Je,Je,Te,function(a){!(a&8)||1145>this.pa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},hf,kf,Xe,Xe,Xe,Xe],Cf=[Ge,Ze,function(){rd(this);this.g|=this.i&16;this.a-=13},ye,He,Se,Ue,function(){I(this,8,0,-9)},S,S,S,S,S,S,S,S],yf=[Qe,Qe,Ee,Ee,ee,ee,fe,fe, -$e,$e,S,S,S,S,Ve,Ve],zf=[xe,ve,re,te,Ae,Be,ge,he,Fe,Ye,mf,of,qf,function(a){1145>this.pa?I(this,8,0,-9):Df[a>>6&3].call(this,a)},S,S],Df=[function(){I(this,8,0,-9)},function(a){a=vd(this,a,65536);this.ea(a);qd(this,a);this.a-=11},function(a){var b=sd(this);this.aa=this.a;this.ea(b);wd(this,a,65536,b);this.a=this.aa-Pe[this.h]},function(){I(this,8,0,-9)}]; -function Ef(a){q.call(this,"ROM",a,128);this.ga=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.l=Fa(this.g);if(this.g){a=this.g;var b=Ga(this.l);"json"!=b&&"hex"!=b&&(a=Qa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Oa(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(ta(c.Na,a,b),(a=Pa(a,b))?(c.b=a.M,c.ga=a.ga):c.g=null);Ff(c)})}}n(Ef,q); -h=Ef.prototype;h.ha=function(a,b,c,d){this.u=b;this.c=c;this.F=d;Ff(this)};h.ja=function(){this.ga&&(this.F&&this.F.a(this.id,this.h,this.a,this.ga),delete this.ga);return!0};h.ia=function(){return!0}; -function Ff(a){if(!Aa(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+Ea(a.b.length,8,!0)+") does not match specified size ("+Ea(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Tb){var c={},c=(c[b]=[Ef.prototype.sf,Ef.prototype.Bg,null,null,null,a.a>>1],c);if(qb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+Da(b));b=a.i=!0;break a}}else if(Zb(a.u,b,a.a,Ec)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=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)),z=l,y=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)hc(a.u,t++,b[z++]&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++)hc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&hd(a.c,d,f)}return k}Za(function(){for(var a=A(document,x,"ram"),b=0;b=sa.Nc&&c<=sa.le&&(b=c-(sa.Nc-sa.Ad));b&&(a.preventDefault&&a.preventDefault(),d.ac(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.Cd&&(b=sa.Bd);d.ac(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.ac(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;var e=this;this.H=qc(this.c,this.B?-1:48,4,262144);this.I=nc(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),pc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.o=a,e.a&128?e.o|=49152:e.a|=128,e.a&64&&oc(c,e.H))});this.C=qc(this.c,this.B?-1:52,4,262144);this.X=nc(this.c,function(){e.b|=128;e.b&64&&oc(c,e.C)});qb(b,this,Lf,this.B?64832+8*(this.B-1)-65392:0);sb(b,this.reset.bind(this));B(this)}; -h.qd=function(a){if(!this.g){var b=Tc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ka(c[0]);if(d!=this.$a)return;c=Ka(c[1]);if(this.g=ya(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.v);if(this.s=e.receiveData){this.v=a;this.D=e.receiveStatus;this.status("Connected "+this.Na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.ja=function(a,b){if(!b)if(this.qd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ia=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){var a=new E(this);a.set(0,[this.o,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Mf(this,a[0])};function Mf(a,b){b||(b=[0,8192,128,a.f]);b=ja(b);a.o=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} -h.ac=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.l%a,this.R&&(b=" ".slice(0,c)));this.K&&!this.l&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!= -this.i){if(10==a||1024<=this.i.length)this.Z(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}pc(this.c,this.X,1E3/Math.round(this.aa/10));this.b&=-129};var Kf="buffer",Nf={},Lf=(Nf[65392]=[null,null,T.prototype.df,T.prototype.og,"RCSR"],Nf[65394]=[null,null,T.prototype.cf,T.prototype.ng,"RBUF"],Nf[65396]=[null,null,T.prototype.Kf,T.prototype.Tg,"XCSR"],Nf[65398]=[null,null,T.prototype.Jf,T.prototype.Sg,"XBUF"],Nf); -Za(function(){for(var a=A(document,x,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.m[b]=c,!0;case "readTape":e=Rf;case "loadTape":return e||(e=Sf),this.m[b]=c,c.onclick= -function(){var a=d.m.listTapes;a&&Tf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.m[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;Tf(d,Fa(b,!0),b,Sf,a)}return!1};return!0;case Uf:return this.m[b]=c,!0}return!1}; -h.ha=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.F=d;this.v=Vf(a);var e=this;if(a=Of(this,Tc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.B[f]=a[f]);this.s=qc(this.c,56,4,4096);this.H=nc(this.c,function(){1==(e.a&32769)&&!(e.a&128)&&e.lc.indexOf("/api/v1/dump")&&(e=Ga(c),f="json"==e||"gz"==e?encodeURI(c):Qa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Oa(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.O;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(ta(a.Na,e,f),(e=Pa(e,f))&&fg(a,b,c,d,e.M,e.ca,e.ba)); -a.j.Va=!1;a.b&&(a.b--,a.b||B(a));cg(a)})}function Yf(a,b,c,d){if((a=a.m.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.N);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Ga(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"):Ha(c,"/")&&(d="dir"),f=Qa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Dc?"":e)+"&format=json"));return!!Oa(f, -null,!0,function(b,c,d){ng(a,b,c,d)})} -function ng(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.O;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{ta(a.controller.Na,b,c);try{if(0g&&0c.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)u(k[0]);else{a.N=k.length;a.T=k[0].length;a.P=k[0][0].length;var l=k[0][0][0];a.da=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var z=l.bytes;if(void 0!==z&&z.length){for(var y=m<<2,fa=z.length;fa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.la?f=a.ta+a.la&&(a.la+=f-(a.ta+a.la)+1):(a.ta=f,a.la=1);d[f]=d[f]&~(255<g)break;e|=g<=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;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.ua+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=pg(this,a++);)rg(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 rg(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 jg=0;function sg(a,b,c,d,e,f){q.call(this,a,b,c);this.w=tg(this,b.autoMount);this.s=0;this.D=d;this.H=e;this.I=f;this.C=d.Pc;this.b=Array(this.C);this.B=!Va("Mobi")&&window&&"FileReader"in window;this.h=[];this.jb=null;this.exports={selectDrive:this.Nf}}n(sg,q); -function tg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=sg.prototype; -h.ka=function(a,b,c){var d=this;switch(b){case "listDisks":return this.m[b]=c,c.onchange=function(){var a=d.m.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){u(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.m[b]=c,c.onchange=function(){var a=Ca(c.value);null!=a&&ug(d, -a)},!0;case "loadDisk":return this.m[b]=c,c.onclick=function(){var a=d.m.listDisks;a&&a.options&&vg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.m[b]=c,c.onclick=function(){var a,b=d.m.listDrives,b=b&&Ca(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.G("Unable to boot the selected drive"):a.V?(hd(d.c,0,!0),(a=d.Gb(a,0,0,0,512,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.B){c.parentNode.removeChild(c); -break}this.m[b]=c;c.onclick=function(){var a=d.m.listDrives;if(a&&a.options&&d.b)if(a=d.b[Ca(a.value)||0])if(a=a.V){var b;b="";for(var c=0,k;k=pg(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if(c==yg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==zg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=Fa(c);a.status("Attempting to load "+c+' as "'+b+'"')}Fg(a,e,b,c,!1,d)}else Bg(a,e)} -function Fg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.ma.toLowerCase()!=d.toLowerCase()&&(g++,Bg(a,b,!0),k.Cc?a.G(a.type+" busy"):(k.Cc=!0,e&&(k.Bc=!0,a.s++),k.ib=!!f,mg(new ig(a,k,"preload"),c,d,f,a.nd)&&g++));return g} -h.nd=function(a,b,c,d,e){a.Cc=!1;b&&(b.N>a.N||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.type.substr(0,2)+a.Vb)),b=null);b?(a.V=b,a.ua=c,a.ma=d,Gg(this,c,d,b),this.G('Loaded disk "'+c+'" in drive '+(this.type.substr(0,2)+a.Vb),a.Bc||e),this.A&&$c(this.A)):a.ib=!1;a.Bc&&(a.Bc=!1,--this.s||B(this));ug(this,a.Vb)}; -function wg(a,b,c,d){if((a=a.m.listDisks)&&a.options){for(var e=0;e=a.N){m=V.Mb;break}p=a.seek(b,c,d+1);if(!p){m=V.gd;break}t=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}var z,y;if(0>(z=a.read(p,t++))||0>(y=a.read(p,t++))){m=V.Nb;break}if(!k&&(Mb(this.u,td(this.c,f),z|y<<8),mc(this.u))){m=V.ub;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.gc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.V;var p=null,t;a||(m=V.Yc,e=0);for(;e;){var z=Ob(this.u,td(this.c,f));if(mc(this.u)){m=V.ub;break}if(!p){if(b>=a.N){m=V.Mb;break}p=a.seek(b,c,d+1,!0);if(!p){m=V.gd;break}t=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var y,fa;if(0>(y=a.read(p,t++))||0>(fa=a.read(p,t++))){m=V.Nb;break}if(z!=(y|fa<<8)){m=V.kd;break}}else if(!a.write(p,t++,z&255)||!a.write(p,t++,z>>8)){m=V.Nb;break}t>=a.da&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; -h.Rd=function(a,b,c,d,e,f){this.i=f&65535;this.a=this.a&~U.Ya|f>>16-U.S.Ya&U.Ya;this.l=65536-e&65535;this.g=this.g&~W.xc|d&W.xc;this.f|=a;Kg(this);return!0};function Kg(a){a.a&=~U.tb;a.f&&(a.f|=V.Fd,a.a|=U.tb,a.f&V.qc&&(a.a|=U.qc))}h.jf=function(){return this.v};h.tg=function(){};h.kf=function(){return this.f};h.ug=function(){};h.ff=function(){return this.a&U.wc}; -h.qg=function(a){this.a=this.a&~U.Ta|a&U.Ta;if(this.a&U.Rc){a=!0;var b,c,d=(this.g&W.Ma)>>W.S.Ma,e=this.b[d],f,g,k,l,m,p;this.a&=~(U.wa|U.yc);this.f&=~V.be;switch(c=this.a&U.ra){case Lg.zd:this.f=this.g=0;this.a=U.wa;break;case Lg.Nd:case Lg.Pd:b=this.Gb;case Lg.zc:case Lg.ke:b||(b=this.gc);f=(this.g&W.sb)>>W.S.sb;g=(this.g&W.rc)>>W.S.rc;k=this.g&W.xc;l=65536-this.l&65535;m=(this.a&U.Ya)<<16-U.S.Ya|this.i;p=this.a&U.Ld?0:2;if(f>=e.N){this.f|=V.Mb;break}if(k>=e.P){this.f|=V.Nb;break}a=b.call(this, -e,f,g,k,l,m,p,c>=Lg.zc,this.Rd.bind(this));break;case Lg.Sb:f=(this.g&W.sb)>>W.S.sb;f(p=a.read(k,m++))||0>(t=a.read(k,m++))){g=Y.ya;break}Mb(this.u,td(this.c,f),p|t<<8);if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(m>=a.da&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; -h.gc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.V;k=null;var m;a||(g=Y.ya,e=0);for(;e;){var p=Ob(this.u,td(this.c,f));if(mc(this.u)){g=Y.ub;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Y.ya;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Y.ya;break}if(m>=a.da&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.N)))){g=Y.ya;break}}return l?l(g,b,c,d,e,f):g}; -h.Wd=function(a,b,c,d,e,f){this.o=f&65535;this.a=this.a&~X.va|f>>16-X.S.va&X.va;this.i=f>>16&Og.vc;this.g=this.f=b<>X.S.va;if(!(this.a&X.wa)){a=!0;var b,c=this.b[(this.a&X.Ma)>>X.S.Ma],d=c.V,e,f,g;this.a&=~X.Xa;switch(this.a&X.ra){case Pg.fe:this.l&Qg.Sc&&(this.a&=X.Xa|X.ra|X.va);this.l=c.status|this.g&Z.Rb|(d&&512==d.N?Qg.Id:0);break;case Pg.Sb:(this.f&Z.Hd)==Z.ce&&(b=this.f&Z.vb,c=(this.f&Z.ee)<<2,this.g=this.f&Z.de?this.g+b:this.g-b,this.f=this.g=this.g&Z.vb|c);break;case Pg.Qd:this.l=this.g;break;case Pg.Od:b=this.Gb;case Pg.je:b||(b=this.gc), -e=this.f>>Z.S.vb,f=this.f&Z.Rb?1:0,g=this.f&Z.ed,!d||e>=d.N||g>=d.P?this.a=this.a|Y.ya|X.tb:(a=65536-this.l&65535,d=(this.i&Og.vc)<<16|this.o,a=b.call(this,c,e,f,g,a,d,2,!1,this.Wd.bind(this)))}a&&(this.a=this.a|X.Xa|X.wa,this.a&X.tc&&oc(this.c,this.jb))}};h.mf=function(){return this.o};h.wg=function(a){this.o=a&Rg.Ta};h.qf=function(){return this.f};h.zg=function(a){this.f=a};h.rf=function(){return this.l};h.Ag=function(a){this.l=a};h.nf=function(){return this.i}; -h.xg=function(a){this.i=a&Og.vc;this.a=this.a&~X.va|(this.i&3)<\nLicense: GPL version 3 or later ");this.Z("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bWg){if(Xg(d,this.s)){this.h=new E(this,"1.33.1",fh);Xg(this.h)&&(ih(this,d),a=jh,kh(this.h));this.h.set(ch,Na());lh(this.h);var e=this.a&&!this.o;if(a==dh||wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=bh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xg(d,g):("error"==f&&"no machine state"!= -g?(this.G("Error: "+g),"unable to verify user"==g&&(Ua(mh,""),this.b=null)):this.Z(f+": "+g),kh(d),Xg(d)?(c=bh(d),e=!0):c=!1))}e&&$g(this,c?d:null)}else a==jh&&d.clear()}else $g(this);delete this.s;delete this.l}e=xa(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.O=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.c&&(nh(this,this.c,b,c,a),Kb(this,-2),this.c.Y());this.C&&(ih(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; -function ih(a,b){if(wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;Oa("http://www.pcjs.org/api/v1/report",d,!0)}} -function oh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.33.1"),g=new E(a,"1.33.1",ah),k=Na();g.set(ch,k);f.set(ch,k);f.set(ph,"1.33.1");f.set(qh,window?window.location.href:null);f.set(rh,window?window.navigator.userAgent:"");a.c&&a.c.ia&&(c&&(b&&(a.c.j.Y=a.c.j.L),F(a.c)),d=a.c.ia(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.O=!1,!1===d&&(e=null)));for(var k=xa(a.id),l=0;l=d||30<=(c.Lc+=d))&&(e.textContent=c.j.L?c.Oa.toFixed(2)+"Mhz":"Stopped",c.Lc=0)}if(a.f&&(a=a.f,b=b||0,a.l)){c=a.c.j.L;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.U=a.c.b[7]:0>>a.h;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.ab)return l.Sb+=l.ab-f,l.ab=f,!0;if(f>=l.ab+l.Sb){p=l.size-(f-m);p>g&&(p=g);l.Sb=f-l.ab+p;f=m+a.g;g-=p;k++;continue}}return Yb(Zb,f,g)}f=new G(a,f,p,a.g,d,e);Tb(f,l);a.a[k++]=f;f=m+a.g;g-=p}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+$b[d]+" at "+xa(b)),!0):Yb(ac,b,c)}h.Nd=function(a){return this.b[(a&this.i)>>>this.h].tb(a&this.f,a)}; +h.Vb=function(a){var b=a&this.f,c=(a&this.i)>>>this.h;return db||b!=this.f?this.b[c].W(b,a):this.b[c++].tb(b,a)|this.b[c&this.K].tb(0,a+1)<<8};h.Od=function(a,b){this.b[(a&this.i)>>>this.h].xb(a&this.f,b,a)};h.Wb=function(a,b){var c=a&this.f,d=(a&this.i)>>>this.h;db||c!=this.f?this.b[d].Ab(c,b,a):(this.b[d++].xb(c,b&255,a),this.b[d&this.K].xb(0,b>>8&255,a+1))};function bc(a,b){return a.a[(b&a.v)>>>a.h]} +function Jb(a,b){var c;a.l=!1;a.m++;var d=b&a.f,e=bc(a,b);db||d!=a.f?c=e.D(d,b):c=e.i(d,b)|bc(a,b+1).i(0,b+1)<<8;a.m--;return c}function cc(a,b,c){a.l=!1;a.m++;bc(a,b).o(b&a.f,c&255,b);a.m--}function Hb(a,b,c){a.l=!1;a.m++;var d=b&a.f,e=bc(a,b);db||d!=a.f?e.m(d,c&65535,b):(e.o(d,c&255,b),bc(a,b+1).o(0,c>>8&255,b+1));a.m--} +function Xb(a){for(var b=0,c=[],d=0;da.c.sa)){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 q=g[4],x=g[5]||1,A=0;A>8:e[2](f)&255):f&1&&(e=d.Qa[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;H(d,b,16);return 255} +function Qb(a,b,c){var d=!1,e=this.controller,f=e.Qa[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.Qa[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||H(e,c,16)}function Rb(a,b){var c=-1,d=this.controller;a=d.Qa[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;H(d,b,16);return 65535} +function Sb(a,b,c){var d=!1,e=this.controller;a=e.Qa[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||H(e,c,16)}function J(a){r.call(this,"Device",a,256);this.a={Ia:128,ad:-1}}n(J,r);h=J.prototype;h.ja=function(a,b,c,d){this.u=b;this.A=a;this.c=c;this.D=d;var e=this;this.a.ad=ic(c,function(){e.a.Ia|=128;e.a.Ia&64&&K(e.c,e.a.qa);e.A&&Fb(e.A,1);jc(e.c,e.a.ad,1E3/60)});this.a.qa=kc(c,64,6,2097152);lb(b,this,lc);nb(b,this.reset.bind(this));B(this)}; +h.la=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};h.ka=function(a){return a?this.save():!0};h.reset=function(){this.a.Ia=128;jc(this.c,this.a.ad,1E3/60,!0)};h.save=function(){var a=new E(this);a.set(0,[this.a.Ia]);return a.data()};h.restore=function(a){a=ia(a[0]);this.a.Ia=a.next().value;return!0};h.qf=function(){return this.a.Ia};h.Fg=function(a){this.a.Ia=a&192;this.a.Ia&64||(a=this.a.qa)&&mc(this.c,a)};h.sf=function(){return nc(this.c)}; +h.Hg=function(a){oc(this.c,a&-129|this.c.J&128)};h.tf=function(){return pc(this.c)};h.uf=function(){return qc(this.c)};h.vf=function(){return this.c.ta};h.Ig=function(a){rc(this.c,a)};h.gg=function(a){a=a>>1&63;var b=this.c.Pa[a>>1];return a&1?b>>16:b&65535};h.uh=function(a,b){b=b>>1&63;var c=b>>1;this.c.Pa[c]=b&1?this.c.Pa[c]&65535|(a&63)<<16:this.c.Pa[c]&-65536|a&65534};h.$f=function(a){return this.c.s[1][a>>1&7]};h.nh=function(a,b){this.c.s[1][b>>1&7]=a&65295}; +h.Yf=function(a){return this.c.s[1][(a>>1&7)+8]};h.lh=function(a,b){this.c.s[1][(b>>1&7)+8]=a&65295};h.Zf=function(a){return this.c.H[1][a>>1&7]};h.mh=function(a,b){b=b>>1&7;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.Xf=function(a){return this.c.H[1][(a>>1&7)+8]};h.kh=function(a,b){b=(b>>1&7)+8;this.c.H[1][b]=a;this.c.s[1][b]&=65295};h.pf=function(a){return this.c.s[0][a>>1&7]};h.Eg=function(a,b){this.c.s[0][b>>1&7]=a&65295};h.mf=function(a){return this.c.s[0][(a>>1&7)+8]}; +h.Cg=function(a,b){this.c.s[0][(b>>1&7)+8]=a&65295};h.nf=function(a){return this.c.H[0][a>>1&7]};h.Dg=function(a,b){b=b>>1&7;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.lf=function(a){return this.c.H[0][(a>>1&7)+8]};h.Bg=function(a,b){b=(b>>1&7)+8;this.c.H[0][b]=a;this.c.s[0][b]&=65295};h.fg=function(a){return this.c.s[3][a>>1&7]};h.th=function(a,b){this.c.s[3][b>>1&7]=a&65295};h.dg=function(a){return this.c.s[3][(a>>1&7)+8]};h.rh=function(a,b){this.c.s[3][(b>>1&7)+8]=a&65295}; +h.eg=function(a){return this.c.H[3][a>>1&7]};h.sh=function(a,b){b=b>>1&7;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.cg=function(a){return this.c.H[3][(a>>1&7)+8]};h.qh=function(a,b){b=(b>>1&7)+8;this.c.H[3][b]=a;this.c.s[3][b]&=65295};h.vb=function(a){a&=7;return this.c.i&2048?this.c.ua[a]:this.c.b[a]};h.yb=function(a,b){b&=7;this.c.i&2048?this.c.ua[b]=a:this.c.b[b]=a};h.Cf=function(){return this.c.i&49152?this.c.ga[0]:this.c.b[6]};h.Pg=function(a){this.c.i&49152?this.c.ga[0]=a:this.c.b[6]=a}; +h.Ff=function(){return this.c.b[7]};h.Sg=function(a){this.c.b[7]=a};h.wb=function(a){a&=7;return this.c.i&2048?this.c.b[a]:this.c.ua[a]};h.zb=function(a,b){b&=7;this.c.i&2048?this.c.b[b]=a:this.c.ua[b]=a};h.Df=function(){return 1==(this.c.i&49152)>>14?this.c.b[6]:this.c.ga[1]};h.Qg=function(a){1==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ga[1]=a};h.Ef=function(){return 3==(this.c.i&49152)>>14?this.c.b[6]:this.c.ga[3]};h.Rg=function(a){3==(this.c.i&49152)>>14?this.c.b[6]=a:this.c.ga[3]=a}; +h.kf=function(a){return this.c.Qb[a-65504>>1]};h.Ag=function(a,b){this.c.Qb[b-65504>>1]=a};h.Id=function(a){return 65520==a?(dc(this.u)>>6)-1:0};h.Ld=function(){};h.bg=function(){return 1};h.ph=function(){};h.jf=function(){return this.c.F};h.zg=function(){this.c.F=0};h.rf=function(){return this.c.Nb};h.Gg=function(a,b){b&1||(a&=255);this.c.Nb=a};h.wf=function(a,b){return b?0:this.c.$a};h.Jg=function(a){var b=this.c;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.g|=1}b.$a=a}; +h.ag=function(a,b){return b?0:this.c.Oa&65280};h.oh=function(a){this.c.Oa=a|255};h.Bf=function(){return sc(this.c)};h.Og=function(a){tc(this.c,a)};h.Kd=function(){}; +var L={},lc=(L[61568]=[null,null,J.prototype.gg,J.prototype.uh,"UNIMAP",64,1170],L[62592]=[null,null,J.prototype.$f,J.prototype.nh,"SIPDR",8,1145,64],L[62608]=[null,null,J.prototype.Yf,J.prototype.lh,"SDPDR",8,1145,64],L[62624]=[null,null,J.prototype.Zf,J.prototype.mh,"SIPAR",8,1145,64],L[62640]=[null,null,J.prototype.Xf,J.prototype.kh,"SDPAR",8,1145,64],L[62656]=[null,null,J.prototype.pf,J.prototype.Eg,"KIPDR",8,1140,64],L[62672]=[null,null,J.prototype.mf,J.prototype.Cg,"KDPDR",8,1145,64],L[62688]= +[null,null,J.prototype.nf,J.prototype.Dg,"KIPAR",8,1140,64],L[62704]=[null,null,J.prototype.lf,J.prototype.Bg,"KDPAR",8,1145,64],L[62798]=[null,null,J.prototype.vf,J.prototype.Ig,"MMR3",1,1145,64],L[65382]=[null,null,J.prototype.qf,J.prototype.Fg,"LKS"],L[65402]=[null,null,J.prototype.sf,J.prototype.Hg,"MMR0",1,1140,64],L[65404]=[null,null,J.prototype.tf,J.prototype.Kd,"MMR1",1,1145,64],L[65406]=[null,null,J.prototype.uf,J.prototype.Kd,"MMR2",1,1140,64],L[65408]=[null,null,J.prototype.fg,J.prototype.th, +"UIPDR",8,1140,64],L[65424]=[null,null,J.prototype.dg,J.prototype.rh,"UDPDR",8,1145,64],L[65440]=[null,null,J.prototype.eg,J.prototype.sh,"UIPAR",8,1140,64],L[65456]=[null,null,J.prototype.cg,J.prototype.qh,"UDPAR",8,1145,64],L[65472]=[null,null,J.prototype.vb,J.prototype.yb,"R0SET0"],L[65473]=[null,null,J.prototype.vb,J.prototype.yb,"R1SET0"],L[65474]=[null,null,J.prototype.vb,J.prototype.yb,"R2SET0"],L[65475]=[null,null,J.prototype.vb,J.prototype.yb,"R3SET0"],L[65476]=[null,null,J.prototype.vb, +J.prototype.yb,"R4SET0"],L[65477]=[null,null,J.prototype.vb,J.prototype.yb,"R5SET0"],L[65478]=[null,null,J.prototype.Cf,J.prototype.Pg,"R6KERNEL"],L[65479]=[null,null,J.prototype.Ff,J.prototype.Sg,"R7KERNEL"],L[65480]=[null,null,J.prototype.wb,J.prototype.zb,"R0SET1",1,1145],L[65481]=[null,null,J.prototype.wb,J.prototype.zb,"R1SET1",1,1145],L[65482]=[null,null,J.prototype.wb,J.prototype.zb,"R2SET1",1,1145],L[65483]=[null,null,J.prototype.wb,J.prototype.zb,"R3SET1",1,1145],L[65484]=[null,null,J.prototype.wb, +J.prototype.zb,"R4SET1",1,1145],L[65485]=[null,null,J.prototype.wb,J.prototype.zb,"R5SET1",1,1145],L[65486]=[null,null,J.prototype.Df,J.prototype.Qg,"R6SUPER",1,1145],L[65487]=[null,null,J.prototype.Ef,J.prototype.Rg,"R6USER",1,1145],L[65504]=[null,null,J.prototype.kf,J.prototype.Ag,"CTRL",8,1170],L[65520]=[null,null,J.prototype.Id,J.prototype.Ld,"LSIZE",1,1170],L[65522]=[null,null,J.prototype.Id,J.prototype.Ld,"HSIZE",1,1170],L[65524]=[null,null,J.prototype.bg,J.prototype.ph,"SYSID",1,1170],L[65526]= +[null,null,J.prototype.jf,J.prototype.zg,"ERR",1,1170],L[65528]=[null,null,J.prototype.rf,J.prototype.Gg,"MBR",1,1170],L[65530]=[null,null,J.prototype.wf,J.prototype.Jg,"PIR"],L[65532]=[null,null,J.prototype.ag,J.prototype.oh,"SLR"],L[65534]=[null,null,J.prototype.Bf,J.prototype.Og,"PSW"],L); +Ta(function(){for(var a=z(document,y,"device"),b=0;b>1),this.c=new Int32Array(this.f,0,this.size>>2),Ac(this,Bc?Cc:Dc);else{a=this.c=Array(this.size>>2);for(f=0;f>2),b=0;b>8,c)};h.gf=function(a){return this.c[a>>2]>>>((a&3)<<3)&255};h.lg=function(a,b){cb&&a&1&&H(this.b,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.xg=function(a,b){var c=a>>2;a=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2;a=(a&3)<<3;24>a?this.c[c]=this.c[c]&~(65535<>8);this.Ha=!0};h.ef=function(a,b){return this.i(a,b)};h.ig=function(a,b){return this.D(a,b)};h.vg=function(a,b,c){this.A?this.Ub(0,0,c):this.o(a,b,c)};h.wh=function(a,b,c){this.A?this.Ub(0,0,c):this.m(a,b,c)};h.df=function(a){return this.a[a]}; +h.ff=function(a){return this.a[a]};h.hg=function(a,b){cb&&a&1&&H(this.b,b,64);return this.u.getUint16(a,!0)};h.kg=function(a,b){cb&&a&1&&H(this.b,b,64);return!db&&a&1?this.a[a]|this.a[a+1]<<8:this.l[a>>1]};h.ug=function(a,b){this.a[a]=b;this.Ha=!0};h.wg=function(a,b){this.a[a]=b;this.Ha=!0};h.vh=function(a,b,c){cb&&a&1&&H(this.b,c,64);this.u.setUint16(a,b,!0);this.Ha=!0};h.xh=function(a,b,c){cb&&a&1&&H(this.b,c,64);!db&&a&1?(this.a[a]=b,this.a[a+1]=b>>8):this.l[a>>1]=b;this.Ha=!0}; +var yc=0,ec=1,zc=2,Vb=4,$b=["NONE","RAM","ROM","VID","H/W"],xc=0,Fc=[],Ec=[G.prototype.gf,G.prototype.xg,G.prototype.lg,G.prototype.yh],Ic=[G.prototype.ef,G.prototype.vg,G.prototype.ig,G.prototype.wh];if(ab)var Dc=[G.prototype.df,G.prototype.ug,G.prototype.hg,G.prototype.vh],Cc=[G.prototype.ff,G.prototype.wg,G.prototype.kg,G.prototype.xh];var Jc;if(ab){var Kc=new ArrayBuffer(2);(new DataView(Kc)).setUint16(0,256,!0);Jc=256===(new Uint16Array(Kc))[0]}else Jc=!1;var Bc=Jc; +function Mc(a,b){r.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.cd=0;this.qc=b;this.Za=c;this.Ac=Math.round(this.qc/1E4)/100;this.jb=this.Ac*this.Za;this.Cc=this.Mb=this.mb=this.rc=0;this.j.M=this.j.$c=!1;this.j.Y=a.autoStart;"string"==typeof this.j.Y&&(this.j.Y="true"==this.j.Y);this.j.ec=!1;this.oc=this.lb=0;this.pc=+a.csStart;this.Kb=+a.csInterval;this.Lb=+a.csStop;this.X=[];this.sd=this.pg.bind(this);this.Na=this.Da=this.Ma=this.a=this.ba=this.Ca=this.Jb=this.La=this.nb=this.Dc= +this.Wa=0;this.pa=null;B(this)}n(Mc,r);h=Mc.prototype;h.ja=function(a,b,c,d){this.A=a;this.u=b;this.D=d;this.pa=a.f;for(a=0;a=a.lb&&(a.lb+=a.Kb,c=!0);0<=a.Lb&&a.Lb<=Rc(a)&&(a.Kb=a.Lb=-1,Qc(a),F(a),c=!0);c&&a.aa(Rc(a)+" cycles: checksum="+ya(a.oc))}} +h.ma=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.j.R)a=!0;else{var b=null,c,k=ra(a.id);for(c=0;ca.Wa/a.jb&&(b=1);a.Za=b;b=a.Ac*a.Za;if(a.jb!=b){a.jb=b;b=a.jb.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.aa("target speed: "+b)}c&&a.A&&Vc(a.A)}Db(a,a.Da);a.Da=0;a.Ca=pa();a.La=0;Tc(a)}function ic(a,b){var c=a.X.length;a.X.push([-1,b]);return c}function jc(a,b,c,d){0<=b&&ba.X[b][0])&&(c=a.qc*a.Za/1E3*c|0,a.j.M&&(c+=Wc(a)),a.X[b][0]=c)}function Xc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Wc(a,b){var c=a.Ma-=a.a;a.a=a.ba=0;b&&(a.Ma=0);return c} +h.pg=function(){if(this.j.M){this.rc>=this.qc&&Tc(this,!0);this.nb=0;this.Jb=pa();if(this.La){var a=this.Jb-this.La;a>this.Cc&&(this.Ca+=a,this.Ca>this.Jb&&(this.Ca=this.Jb))}try{do{for(var b,c=this.j.ec?1:this.Mb,d=this.X.length-1;0<=d;d--){var e=this.X[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.wc(b)}catch(f){if("number"!=typeof f)throw f;}b=Wc(this,!0);this.nb+=b;this.Da+=b;Eb(this,b);Cb(this,b);this.mb-=b;if(0>=this.mb){this.mb+=this.Mb;++this.Dc>=Yc&&(this.A&&Fb(this.A,void 0),this.Dc=0);break}}while(this.j.M)}catch(f){F(this); +this.A&&this.A.stop(pa(),Rc(this));a=f.stack||f.message;this.j.error=!0;this.G(a);return}if(this.j.M){a=setTimeout;b=this.sd;this.La=pa();c=this.Cc;this.nb&&(c=Math.round(c*this.nb/this.Mb));c-=this.La-this.Jb;if(d=this.La-this.Ca)this.Wa=Math.round(this.Da/(10*d))/100,864E5<=d&&(this.Na=0,Sc(this));if(0>c||this.Wac&&(this.Ca-=c),c=0;this.rc+=this.nb;this.La+=c;a(b,c)}}}; +function Bb(a){var b;a.j.error?(a.aa(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.M)a.aa(a.toString()+" busy");else{Sc(a);a.j.M=!0;a.j.$c=!0;if(b=a.o.run)b.textContent="Halt";a.A&&a.A.start(a.Ca,Rc(a));a.D||a.status("Started");setTimeout(a.sd,0)}}h.wc=function(){return 0};function F(a){var b=!1;if(a.j.M){Wc(a);Db(a,a.Da);a.Da=0;a.j.M=!1;if(b=a.o.run)b.textContent="Run";a.A&&a.A.stop(pa(),Rc(a));b=!0;a.D||a.status("Stopped")}a.j.complete=void 0;return b}var Uc=30,Yc=15,Nc=["power","reset"]; +function Zc(a){var b=+a.model||1170;Mc.call(this,a,6666667);this.sa=b;this.md=+a.addrReset||0;this.Ea=this.i=this.B=this.v=this.m=this.l=this.w=0;this.b=this.ua=this.ga=[];this.H=this.s=this.Pa=this.Qb=[];this.Ka=this.C=this.ld=this.kb=this.Xa=this.Ya=this.cb=this.F=this.Nb=this.$a=this.Oa=this.J=this.Ob=this.Pb=this.ta=this.g=0;this.De=[4,2,0,1];this.tc=0;this.qd=255;1120>=this.sa?(this.kd=$c.bind(this),this.hb=this.Le,this.tc=8,this.qd=-1,this.wd=255,this.td=0):(this.kd=ad.bind(this),this.hb=this.Me, +this.wd=~(1792|(1140>=this.sa?2048:0))&65535,this.td=1140e.Tb&&(e.Tb=c,c+=4)}return Mc.prototype.la.call(this,a,b)}; +h.reset=function(){this.status("Model "+this.sa);this.j.M&&F(this);this.v=65536;this.m=32768;this.l=65535;this.w=32768;this.i=15;this.b=[0,0,0,0,0,0,0,this.md,-1,-2,-3,-4,-5,-6,-7,-8];this.ua=[0,0,0,0,0,0];this.ga=[0,0,0,0];this.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.s=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,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.Pa=[0,0,0,0,0,0,0,0,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.Qb=[0,0,0,0,0,0,0,0];this.B=0;this.Ea=-1;this.h=this.f=this.nc=this.K=this.S=this.g=this.Nb=0;zb(this);Pc(this);this.j.error=!1;Mc.prototype.reset.call(this)};function zb(a){a.J=0;a.Ob=0;a.Pb=0;a.ta=0;a.F=0;a.$a=0;a.Oa=255;a.kb=0;a.Xa=0;a.Ya=0;a.cb=262143;a.Ka=a.b[7];a.C=0;a.I=null;a.u&&(bd(a),a.ld=dc(a.u))} +function bd(a){a.hc=a.dd;a.ic=a.uc;a.vc=a.xc;a.jc=a.zc;a.kb?(a.Aa=65536,a.gc=a.ta&16?4186112:253952,a.ra=a.Ed,a.W=a.Jd,a.Ab=a.Md,Wb(a.u,a.ta&16?22:18)):(a.Aa=0,a.gc=57344,a.ra=a.Qe,a.W=a.jg,a.Ab=a.zh,Wb(a.u,16))}function nc(a){var b=a.J;b&57344||(b=b&-3199|a.Xa<<5|a.Ya<<1);return b}function oc(a,b){b&=-3073;if(a.J!=b){b&57344&&!(a.J&57344)&&(a.Ob=a.C>>16&65535,a.Pb=a.C&65535);a.J=b;a.Xa=(b&96)>>5;a.Ya=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.kb!=c&&(a.kb=c,bd(a))}} +function pc(a){a.J&57344||(a.Ob=a.C>>16&65535);a=a.Ob;a&65280&&(a=(a<<8|a>>8)&65535);return a}function qc(a){a.J&57344||(a.Pb=a.C&65535);return a.Pb}function rc(a,b){1170>a.sa&&(b&=-49);a.ta!=b&&(a.ta=b,a.cb=b&16?4194303:262143,bd(a))}function cd(a,b,c,d){a.md=b;dd(a,b);tc(a,0);a.u.reset();zb(a);if(c){a.b[0]=d||0;for(b=1;5>=b;b++)a.b[b]=0;a.b[6]=1024;a.D||(a.j.R?a.j.M||Bb(a):a.j.Y=!0)}else a.D&&a.j.R?F(a)||(a.D.g(),Fb(a.A,-1)):!1===c&&F(a);!a.j.M&&a.pa&&a.pa.stop()}h.Dd=function(){return 0}; +h.save=function(){var a=new E(this);a.set(0,[this.b,this.ua,this.ga,this.H,this.s,this.Pa,this.Qb,this.F,this.Nb,this.$a,this.Oa,this.Xa,this.Ya,this.Ka,this.g,this.C,this.Ea,this.Ic,this.Kc]);a.set(1,[sc(this),nc(this),pc(this),qc(this),this.ta]);a.set(2,[this.Na,this.Za,this.j.Y]);a.set(3,ed(this));a.set(4,Xc(this));return a.data()}; +h.restore=function(a){var b=ia(a[0]);this.b=b.next().value;this.ua=b.next().value;this.ga=b.next().value;this.H=b.next().value;this.s=b.next().value;this.Pa=b.next().value;this.Qb=b.next().value;this.F=b.next().value;this.Nb=b.next().value;this.$a=b.next().value;this.Oa=b.next().value;this.Xa=b.next().value;this.Ya=b.next().value;this.Ka=b.next().value;this.g=b.next().value;this.C=b.next().value;this.Ea=b.next().value;this.Ic=b.next().value;this.Kc=b.next().value;b=a[1];tc(this,b[0]);oc(this,b[1]); +this.Ob=b[2];this.Pb=b[3];rc(this,b[4]);b=a[2];this.Na=b[0];Sc(this,b[1]);this.j.Y=b[2];for(var b=a[3],c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>23)),a.a-=2);a.a-=3}function dd(a,b){a.b[7]=b&65535}function kc(a,b,c,d){b={Tb:b,sb:c,message:d||0,name:fb[b],next:null};a.Ib.push(b);return b}function mc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.g|=1)}function K(a,b){if(b){if(b!=a.I){var c=a.I;if(!c||c.sb<=b.sb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.sb<=b.sb){b.next=d;c.next=b;break}c=d}while(c)}}a.g|=1}} +function ed(a){var b=[];for(a=a.I;a;)b.push(a.Tb),a=a.next;return b}function id(a){return a.g&64?(I(a,168,64,-6),!0):a.g&32?(I(a,4,32,-5),!0):a.g&16?(I(a,12,16,-7),!0):!1}function sc(a){return a.i=a.i&63728|gd(a)|(a.l&65535?0:4)|(a.m&32768?2:0)|fd(a)}function tc(a,b){b&=a.wd;a.w=b<<12;a.l=~b&4;a.m=b<<14;a.v=b<<16;if((b^a.i)&a.td)for(var c=a.ua.length;0<=--c;){var d=a.b[c];a.b[c]=a.ua[c];a.ua[c]=d}a.B=b>>14&3;c=a.i>>14&3;a.B!=c&&(a.ga[c]=a.b[6],a.b[6]=a.ga[a.B]);a.i=b;a.g&=-3;a.g|=a.I?2:1} +h.fa=function(a){this.w=this.l=a;this.m=0};h.Sa=function(a,b){this.w=this.l=this.v=a;this.m=b||0};function jd(a,b){a.w=a.l=a.v=b;a.m=a.w^a.v>>1}function kd(a,b,c,d){a.w=a.l=a.v=b;a.m=(c^d)&(d^b)} +function I(a,b,c,d){if(!a.pb){0>a.Ea?a.Ea=sc(a):a.B||(d=-4);-4==d&&(a.g&256&&(d=-1),a.g|=256,a.F|=4,a.b[6]=b=4);if(-1!=d){a.C=b|4143316992;a.B=0;var e=a.W(b|a.Aa),f=a.W(b+2&65535|a.Aa);tc(a,f&-12289|a.Ea>>2&12288);ld(a,a.Ea);ld(a,a.b[7]);dd(a,e)}a.a-=5;a.g&=~(c|19);a.g|=129;a.Ea=-1;a.Ic=d;a.Kc=b;-1==d&&F(a);if(-4<=d)throw b;}}function md(a){var b=nd(a),c=nd(a);a.i&49152&&(c=c&-225|a.i&63712);dd(a,b);tc(a,c);a.g&=-17} +function od(a,b){var c=b>>13&31;31>c&&(b=a.ta&32?a.Pa[c]+(b&8191)&4194303:b&-3932161);return b} +function Ib(a,b,c){var d,e,f;if(!(c&a.kb))return f=b&65535,57344<=f&&(f|=a.gc),f;d=b>>13;a.ta&a.De[a.B]||(d&=7);e=a.s[a.B][d];f=(a.H[a.B][d]<<6)+(b&8191)&a.cb;3932160<=f&&(f=od(a,f));if(a.pb)return f;f>=a.ld&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.s[a.B][d]=e;if(f!=(4194170&a.cb)||a.B)a.Xa=a.B,a.Ya=d;g&&(g&57344&&(0<=a.Ea&&(g|=128),a.J&57344||(g|=a.J&4096|a.Xa<<5|a.Ya<<1,oc(a,a.J&-61695|g&61694)),I(a,168,64,-2)),a.J&61440||!(f<(4191360&a.cb)||f>(4194239&a.cb))||(a.J|=4096,a.J&512&&(a.g|=64)));return f}function nd(a){var b=a.W(a.b[6]|a.Aa);a.b[6]=a.b[6]+2&65535;return b}function ld(a,b){var c=a.b[6]-2&65535;a.b[6]=c;a.C=a.C&65535|(a.C&-65536)<<8|16121856;a.g&256||a.hb(4,-2,c);a.Ab(c,b)} +function pd(a,b,c,d){var e,f,g=d&8?0:a.Aa;switch(b){case 0:return I(a,4,0,-3),0;case 1:return 6==c&&a.hb(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.hb(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.W(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.hb(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.W(e)|g;a.a-=8;break;case 6:return e=a.W(hd(a,2)),e=e+a.b[c]&65535,6==c&&a.hb(d,0, +e),a.a-=6,e|g;case 7:return e=a.W(hd(a,2)),e=e+a.b[c]&65535,e=a.W(e|a.Aa),a.a-=10,e|g}a.b[c]=a.b[c]+f&65535;a.C=a.C&65535|(a.C&-65536)<<8|(f<<3&248|c)<<16;return e}h.Le=function(a,b,c){!this.B&&0>=b&&c<=this.Oa&&(this.g|=32)};h.Me=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.Oa&&(c<=this.Oa-32?I(this,4,0,-4):(this.F|=8,this.g|=32)))};h.Pe=function(a){return this.dd(a)};h.Re=function(a){return this.uc(a)};h.rg=function(a,b){this.xc(a,b)};h.tg=function(a,b){this.zc(a,b)}; +h.Qe=function(a,b,c){return pd(this,a,b,c)};h.Ed=function(a,b,c){return Ib(this,pd(this,a,b,c),c)};h.jg=function(a){return this.u.Vb(this.Ka=a)};h.Jd=function(a){return this.u.Vb(this.Ka=Ib(this,a,2))};h.zh=function(a,b){this.u.Wb(this.Ka=a,b)};h.Md=function(a,b){this.u.Wb(this.Ka=Ib(this,a,4),b)}; +function qd(a,b,c){var d=a.f=b&7;(b=a.h=(b&56)>>3)?(d=pd(a,b,d,2),c&65536||61440!==(a.i&61440)&&(d&=65535),a.B=a.i>>12&3,c=a.W(d|c&a.Aa),a.B=a.i>>14&3):c=6!=d||(a.i>>2&12288)===(a.i&12288)?a.b[d]:a.ga[a.i>>12&3];return c}function rd(a,b,c,d){a.C=a.C&65535|1441792;var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=pd(a,b,e,4),c&65536||(e&=65535),a.B=a.i>>12&3,e=Ib(a,e|c&65536,4),a.B=a.i>>14&3,a.jc(e,d)):6!=e||(a.i>>2&12288)===(a.i&12288)?a.b[e]=d:a.ga[a.i>>12&3]=d} +function sd(a,b){b>>=6;var c=a.S=b&7;return(b=a.K=(b&56)>>3)?a.hc(a.ra(b,c,3)):a.b[c+a.tc]&a.qd}function td(a,b){var c;b>>=6;var d=a.S=b&7;(b=a.K=(b&56)>>3)?c=a.ic(a.ra(b,d,2)):c=a.b[d+a.tc];return c}function ud(a,b){var c=a.f=b&7;b=a.h=(b&56)>>3;return pd(a,b,c,8)}function vd(a,b){var c=a.f=b&7;return(b=a.h=(b&56)>>3)?a.hc(a.ra(b,c,3)):a.b[c]&255}function wd(a,b){var c,d=a.f=b&7;(b=a.h=(b&56)>>3)?c=a.ic(a.ra(b,d,2)):c=a.b[d];return c} +function P(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.nc=a.ra(b,e,7),c=0>c?a.b[-c-1]&255:c,a.vc(e,d.call(a,c,a.hc(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 Q(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ra(b,e,6),a.jc(e,d.call(a,0>c?a.b[-c-1]:c,a.ic(e)))):a.b[e]=d.call(a,0>c?a.b[-c-1]:c,a.b[e])} +function xd(a,b,c,d,e){var f=a.f=b&7;(b=a.h=(b&56)>>3)?(d=a.ra(b,f,5),e.call(a,(c=0>c?a.b[-c-1]&255:c)<<8),a.vc(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 yd(a,b,c,d){var e=a.f=b&7;(b=a.h=(b&56)>>3)?(e=a.ra(b,e,4),d.call(a,c=0>c?a.b[-c-1]:c),a.jc(e,c)):(a.b[e]=c=0>c?a.b[-c-1]:c,d.call(a,c))} +h.wc=function(a){this.j.complete=!0;var b=a?this.j.$c?0:1:-1;this.j.$c=!1;this.Ma=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.$a&224)>>5,e=this.I&&this.I.sb>d?this.I:null;e&&(c=e.Tb,d=e.sb);d>(this.i&224)>>5?(this.g&8&&(hd(this,2),this.g&=-9),I(this,c,0,-10),d=!0):d=!1;d&&(e&&mc(this,e),a=!0);this.I||this.$a||(this.g&=-3)}else this.g&1&&this.g++;if(a){if(this.g&4&&this.D.b(this.b[7],b)){F(this);break}if(0>b)break}if(this.g&112&&id(this)){if(this.g& +4&&this.D.b(this.b[7],b)){F(this);break}if(0>b)break}}this.g=this.g&15|this.i&16;a=this.C=this.b[7];e=this.W(a);this.b[7]=a+2&65535;this.kd(e)}while(0>1|b<<16;jd(this,a);return a&65535}function Ed(a,b){a=b&128|b>>1|b<<8;jd(this,a<<8);return a&255}function Fd(a,b){a=b&~a;this.fa(a);return a}function Gd(a,b){a=b&~a;this.fa(a<<8);return a}function Hd(a,b){a|=b;this.fa(a);return a}function Id(a,b){a|=b;this.fa(a<<8);return a} +function Jd(a,b){a=~b|65536;this.Sa(a);return a&65535}function Kd(a,b){a=~b|256;this.Sa(a<<8);return a&255}function Ld(a,b){this.w=this.l=a=b-a;this.m=b&(b^a);return a&65535}function Md(a,b){a=b-a;var c=a<<8;b<<=8;this.w=this.l=c;this.m=b&(b^c);return a&255}function Nd(a,b){this.w=this.l=a=b+a;this.m=a&(b^a);return a&65535}function Od(a,b){a=b+a;var c=a<<8;this.w=this.l=c;this.m=c&(b<<8^c);return a&255}function Pd(a,b){a=-b;this.Sa(a,a&b&32768);return a&65535} +function Qd(a,b){a=-b;this.Sa(a<<8,(a&b&128)<<8);return a&255}function Rd(a,b){a=b<<1|this.v>>16&1;jd(this,a);return a&65535}function Sd(a,b){a=b<<1|this.v>>16&1;jd(this,a<<8);return a&255}function Td(a,b){a=(this.v&65536|b)>>1|b<<16;jd(this,a);return a&65535}function Ud(a,b){a=((this.v&65536)>>8|b)>>1|b<<8;jd(this,a<<8);return a&255}function Vd(a,b){var c=b-a;kd(this,c,a,b);return c&65535}function Wd(a,b){var c=b-a;kd(this,c<<8,a<<8,b<<8);return c&255} +function Xd(a,b){this.w=this.l=b&65280;this.m=this.v=0;return(b<<8|b>>8)&65535}function Yd(a,b){a^=b;this.fa(a);return a&65535}function Zd(a){Q(this,a,td(this,a),zd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} +function $d(a){var b=wd(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;else if(b)if(16>15&65535;d&&65535!==d&&(this.m=32768)}this.b[a]=c&65535;this.w=this.l=c;this.a-=(this.h?6:7)+b} +function ae(a){var b=wd(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-1;this.v=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.b[a|1]=d&65535;this.w=d>>16;this.l=d>>16|d;this.a-=(this.h?6:7)+b}function be(a){O(this,a,!fd(this))}function ce(a){O(this,a,fd(this))} +function de(a){Q(this,a,td(this,a),Fd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ee(a){P(this,a,sd(this,a),Gd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function fe(a){Q(this,a,td(this,a),Hd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function ge(a){P(this,a,sd(this,a),Id);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)} +function he(a){var b=td(this,a);a=wd(this,a);this.fa((0>b?this.b[-b-1]:b)&a);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ie(a){var b=sd(this,a);a=vd(this,a);this.fa(((0>b?this.b[-b-1]&255:b)&a)<<8);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function je(a){O(this,a,this.l&65535?0:4)}function ke(a){O(this,a,!gd(this)==!(this.m&32768))}function le(a){O(this,a,!!(this.l&65535)&&!gd(this)==!(this.m&32768))} +function me(a){O(this,a,!fd(this)&&!!(this.l&65535))}function ne(a){O(this,a,(this.l&65535?0:4)||!gd(this)!=!(this.m&32768))}function oe(a){O(this,a,fd(this)||(this.l&65535?0:4))}function pe(a){O(this,a,!gd(this)!=!(this.m&32768))}function qe(a){O(this,a,gd(this))}function re(a){O(this,a,!!(this.l&65535))}function se(a){O(this,a,!gd(this))}function te(){I(this,12,0,-9)}function ue(a){O(this,a,!0)}function ve(a){O(this,a,!(this.m&32768))}function we(a){O(this,a,this.m&32768?2:0)} +function xe(a){a&1&&(this.v=0);a&2&&(this.m=0);a&4&&(this.l=1);a&8&&(this.w=0);this.a-=5}function ye(a){var b=td(this,a);a=wd(this,a);var c=(b=0>b?this.b[-b-1]:b)-a;kd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)}function ze(a){var b=sd(this,a);a=vd(this,a);var c=(b=(0>b?this.b[-b-1]&255:b)<<8)-(a<<=8);kd(this,c,a,b);this.a-=this.h?4+(this.S&&6<=this.f?1:0):(this.K?4:3)+(7==this.f?2:0)} +function Ae(a){var b=wd(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.l=d>>16|d,this.w=d>>16):(this.m=32768,this.l=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.l=this.w=0,this.m=32768,this.v=65536,this.a-=7}function Be(){I(this,24,0,-9);this.a-=20} +function Ce(){this.i&49152?(this.F|=128,I(this,4,0,-8)):(this.pa&&1120==this.sa&&this.pa.setData(this.b[0],!0),this.D?this.D.i():F(this));this.a-=7}function De(){I(this,16,0,-9);this.a-=20}var Ee=[0,7,7,10,7,11,9,13];function Fe(a){this.ba=this.a;dd(this,ud(this,a));this.a=this.ba-Ee[this.h]}var Ge=[0,14,14,17,14,18,16,20];function He(a){this.ba=this.a;var b=ud(this,a);a=a>>6&7;ld(this,this.b[a]);this.b[a]=this.b[7];dd(this,b);this.a=this.ba-Ge[this.h]} +var Ie=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Je(a){var b=td(this,a);this.ba=this.a;yd(this,a,b,this.fa);this.a=this.ba-Ie[(this.K?8:0)+this.h]+(7!=this.f||this.h?0:2)}function Ke(a){var b=sd(this,a);xd(this,a,b,65535,this.fa);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}var Le=[7,13,13,17,14,18,17,21]; +function Me(a){var b=wd(this,a);a=a>>6&7;b=(b<<16>>16)*(this.b[a]<<16>>16);this.b[a]=b>>16&65535;this.b[a|1]=b&65535;b|=0;this.w=b>>16;this.l=this.w|b;this.m=0;this.v=-32768>b||32767>6;if(this.b[b]=this.b[b]-1&65535)dd(this,this.b[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Te(a){Q(this,a,td(this,a),Vd);this.a-=this.h?9+(this.S&&6<=this.f?1:0):(this.K?5:3)+(7==this.f?2:0)}function Ue(a){Q(this,a,0,Xd);this.a-=this.h?9:3+(7==this.f?2:0)}function Ve(){I(this,28,0,-9)} +function We(){this.pa&&(this.pa.V=this.b[7],this.pa.setData(this.b[0],!0));this.g|=8;hd(this,-2);this.a-=3}function Xe(a){Q(this,a,this.b[(a>>6&7)+this.tc],Yd);this.a-=this.h?9:3+(7==this.f?2:0)}function R(){I(this,8,0,-9)}function $c(a){Ye[a>>12].call(this,a)}function Ze(a){$e[a>>6&3].call(this,a)}function af(a){bf[a>>6&3].call(this,a)}function cf(a){df[a>>6&3].call(this,a)}function ef(a){ff[a&15].call(this,a)}function gf(a){hf[a&15].call(this,a)}function jf(a){kf[a>>6&3].call(this,a)} +function lf(a){mf[a>>6&3].call(this,a)}function nf(a){of[a>>6&3].call(this,a)} +var Ye=[function(a){pf[a>>8&15].call(this,a)},Je,ye,he,de,fe,Zd,R,function(a){qf[a>>8&15].call(this,a)},Ke,ze,ie,ee,ge,Te,R],pf=[function(a){rf[a>>4&15].call(this,a)},ue,re,je,ke,pe,le,ne,He,He,Ze,af,cf,R,R,R],$e=[function(a){yd(this,a,0,this.Sa);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Jd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Nd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Ld);this.a-=this.h?9:3+(7==this.f?2:0)}],bf=[function(a){Q(this,a,0,Pd); +this.a-=this.h?11:6},function(a){Q(this,a,fd(this)?1:0,zd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,fd(this)?1:0,Vd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=wd(this,a);this.Sa(a);this.a-=this.h?4:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,Td);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Rd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Dd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Bd);this.a-=this.h?9:3+(7==this.f?2:0)}],rf= +[function(a){sf[a&15].call(this,a)},R,R,R,Fe,Fe,Fe,Fe,Pe,R,ef,gf,Ue,Ue,Ue,Ue],sf=[Ce,We,Qe,te,De,Oe,R,R,R,R,R,R,R,R,R,R],ff=[Ne,function(){this.v=0;this.a-=5},function(){this.m=0;this.a-=5},xe,function(){this.l=1;this.a-=5},xe,xe,xe,function(){this.w=0;this.a-=5},xe,xe,xe,xe,xe,xe,xe],hf=[Ne,function(){this.v=65536;this.a-=5},function(){this.m=32768;this.a-=5},Re,function(){this.l=0;this.a-=5},Re,Re,Re,function(){this.w=32768;this.a-=5},Re,Re,Re,Re,Re,Re,Re],qf=[se,qe,me,oe,ve,we,be,ce,Be,Ve,jf,lf, +nf,R,R,R],kf=[function(a){xd(this,a,0,255,this.Sa);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Kd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Od);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Md);this.a-=this.h?9:3+(7==this.f?2:0)}],mf=[function(a){P(this,a,0,Qd);this.a-=this.h?11:6},function(a){P(this,a,fd(this)?1:0,Ad);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,fd(this)?1:0,Wd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){a=vd(this,a); +this.Sa(a<<8);this.a-=this.h?4:3+(7==this.f?2:0)}],of=[function(a){P(this,a,0,Ud);this.a-=this.h?9+(this.nc&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Sd);this.a-=this.h?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Ed);this.a-=this.h?9+(this.nc&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Cd);this.a-=this.h?9:3+(7==this.f?2:0)}];function ad(a){tf[a>>12].call(this,a)} +var tf=[function(a){uf[a>>8&15].call(this,a)},Je,ye,he,de,fe,Zd,function(a){vf[a>>8&15].call(this,a)},function(a){wf[a>>8&15].call(this,a)},Ke,ze,ie,ee,ge,Te,R],uf=[function(a){xf[a>>4&15].call(this,a)},ue,re,je,ke,pe,le,ne,He,He,Ze,af,cf,function(a){yf[a>>6&3].call(this,a)},R,R],yf=[function(a){a=this.b[7]+((a&63)<<1)&65535;var b=this.W(a|this.Aa);dd(this,this.b[5]);this.b[6]=a+2&65535;this.b[5]=b;this.a-=8},function(a){a=qd(this,a,0);this.fa(a);ld(this,a);this.a-=11},function(a){var b=nd(this); +this.ba=this.a;this.fa(b);rd(this,a,0,b);this.a=this.ba-Le[this.h]},function(a){yd(this,a,gd(this)?65535:0,this.fa);this.a-=this.h?9:3+(7==this.f?2:0)}],xf=[function(a){zf[a&15].call(this,a)},R,R,R,Fe,Fe,Fe,Fe,Pe,function(a){!(a&8)||1145>this.sa?I(this,8,0,-9):(this.i&49152||(this.i=this.i&-225|(a&7)<<5,this.g|=1,this.g&=-3),this.a-=5)},ef,gf,Ue,Ue,Ue,Ue],zf=[Ce,We,function(){md(this);this.g|=this.i&16;this.a-=13},te,De,Oe,Qe,function(){I(this,8,0,-9)},R,R,R,R,R,R,R,R],vf=[Me,Me,Ae,Ae,$d,$d,ae,ae, +Xe,Xe,R,R,R,R,Se,Se],wf=[se,qe,me,oe,ve,we,be,ce,Be,Ve,jf,lf,nf,function(a){1145>this.sa?I(this,8,0,-9):Af[a>>6&3].call(this,a)},R,R],Af=[function(){I(this,8,0,-9)},function(a){a=qd(this,a,65536);this.fa(a);ld(this,a);this.a-=11},function(a){var b=nd(this);this.ba=this.a;this.fa(b);rd(this,a,65536,b);this.a=this.ba-Le[this.h]},function(){I(this,8,0,-9)}]; +function Bf(a){r.call(this,"ROM",a,128);this.ia=this.b=null;this.h=+a.addr;this.a=+a.size;this.i=!1;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.g=a.file;this.m=za(this.g);if(this.g){a=this.g;var b=Aa(this.m);"json"!=b&&"hex"!=b&&(a=Ja()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Ha(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(na(c.Ua,a,b),(a=Ia(a,b))?(c.b=a.N,c.ia=a.ia):c.g=null);Cf(c)})}}n(Bf,r); +h=Bf.prototype;h.ja=function(a,b,c,d){this.u=b;this.c=c;this.D=d;Cf(this)};h.la=function(){this.ia&&(this.D&&this.D.a(this.id,this.h,this.a,this.ia),delete this.ia);return!0};h.ka=function(){return!0}; +function Cf(a){if(!ua(a)){if(a.g){if(!a.b||!a.u)return;a.a||(a.a=a.b.length);if(a.b.length!=a.a){var b="ROM size ("+ya(a.b.length,8,!0)+") does not match specified size ("+ya(a.a,8,!0)+")";a.j.error=!0;a.G(b)}else{a:{b=a.h;if(57344<=b&&b<57344+Ob){var c={},c=(c[b]=[Bf.prototype.Uf,Bf.prototype.hh,null,null,null,a.a>>1],c);if(lb(a.u,a,c)){a.status("Added "+a.a+"-byte ROM at "+xa(b));b=a.i=!0;break a}}else if(Ub(a.u,b,a.a,zc)){for(c=0;c>>f.h;0>>=f.h;0>>a.h;0=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,q=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(q&255)+(q>>8)),x=l,A=p-=6;0=b.length)break;m+=b[l++]&255;if(m&255)break;if(A)for(;A--;)cc(a.u,q++,b[x++]&255);else q&1?g=!0:null==d&&(d=q);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e< +b.length;e++)cc(a.u,c+e,b[e]);k=!0}if(k){if(null==d||g)F(a.c),f=!1;null!=d&&cd(a.c,d,f)}return k}Ta(function(){for(var a=z(document,y,"ram"),b=0;b=la.ed&&c<=la.Ge&&(b=c-(la.ed-la.Qd));b&&(a.preventDefault&&a.preventDefault(),d.kc(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==la.Sd&&(b=la.Rd);d.kc(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.kc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;var e=this;this.H=kc(this.c,this.B?-1:48,4,1048576);this.I=ic(this.c,function(){var a;a=-1;e.f.length&&(a=e.f.shift()&255,e.w&&97<=a&&122>a&&(a-=32),jc(e.c,e.I,1E3/Math.round(e.J/10)));0<=a&&(e.l=a,e.a&128?e.l|=49152:e.a|=128,e.a&64&&K(c,e.H))});this.C=kc(this.c,this.B?-1:52,4,1048576);this.X=ic(this.c,function(){e.b|=128;e.b&64&&K(c,e.C)});lb(b,this,Jf,this.B?64832+8*(this.B-1)-65392:0);nb(b,this.reset.bind(this));B(this)}; +h.Fd=function(a){if(!this.g){var b=Oc(this.A,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ea(c[0]);if(d!=this.ib)return;c=Ea(c[1]);if(this.g=sa(c)){var e=this.g.exports;if(e){var f=e.connect;f&&f.call(this.g,this.v);if(this.s=e.receiveData){this.v=a;this.F=e.receiveStatus;this.status("Connected "+this.Ua+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};h.la=function(a,b){if(!b)if(this.Fd(this.v),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ka=function(a){return a?this.save():!0};h.reset=function(){Kf(this)};h.save=function(){var a=new E(this);a.set(0,[this.l,this.a,this.b,this.f]);return a.data()};h.restore=function(a){return Kf(this,a[0])};function Kf(a,b){b||(b=[0,8192,128,a.f]);b=ia(b);a.l=b.next().value;a.a=b.next().value;a.b=b.next().value;a.f=b.next().value;return!0} +h.kc=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.m%a,this.S&&(b=" ".slice(0,c)));this.K&&!this.m&&c&&(b=String.fromCharCode(this.K)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!= +this.i){if(10==a||1024<=this.i.length)this.aa(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}jc(this.c,this.X,1E3/Math.round(this.ba/10));this.b&=-129};var If="buffer",Lf={},Jf=(Lf[65392]=[null,null,Hf.prototype.Hf,Hf.prototype.Ug,"RCSR"],Lf[65394]=[null,null,Hf.prototype.Gf,Hf.prototype.Tg,"RBUF"],Lf[65396]=[null,null,Hf.prototype.ng,Hf.prototype.Bh,"XCSR"],Lf[65398]=[null,null,Hf.prototype.mg,Hf.prototype.Ah,"XBUF"],Lf); +Ta(function(){for(var a=z(document,y,"serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "readTape":e=Pf;case "loadTape":return e||(e=Qf),this.o[b]=c,c.onclick= +function(){var a=d.o.listTapes;a&&Rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Rf(d,za(b,!0),b,Qf,a)}return!1};return!0;case Sf:return this.o[b]=c,!0}return!1}; +h.ja=function(a,b,c,d){this.A=a;this.u=b;this.c=c;this.D=d;this.v=Tf(a);var e=this;if(a=Mf(this,Oc(this.A,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.s=kc(this.c,56,4,4096);this.J=ic(this.c,function(){1!=(e.a&32769)||e.a&128||(e.hc.indexOf("/api/v1/dump")&&(e=Aa(c),f="json"==e||"gz"==e?encodeURI(c):Ja()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ha(f,null,!0,function(e,f,g){var k=0>g&&!!a.A&&!a.A.j.R;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(na(a.Ua,e,f),(e=Ia(e,f))&&dg(a,b,c,d, +e.N,e.ea,e.da));a.j.Ra=!1;a.b&&(a.b--,a.b||B(a));ag(a)})}function Wf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.L);for(d=0;dc.indexOf("/api/v1/dump")&&(b=Aa(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"):Ba(c,"/")&&(d="dir"),f=Ja()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Wc?"":e)+"&format=json"));return!!Ha(f, +null,!0,function(b,c,d){lg(a,b,c,d)})} +function lg(a,b,c,d){var e=null,f=0>d&&!!a.A&&!a.A.j.R;a.g=!1;if(d)a.controller.G('Unable to load disk "'+a.xa+'" (error '+d+": "+b+")",f);else{na(a.controller.Ua,b,c);try{if(0g&&0c.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)u(k[0]);else{a.L=k.length;a.T=k[0].length;a.P=k[0][0].length;var l=k[0][0][0];a.Z=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var q=l.data;if(void 0===q){var x=l.bytes;if(void 0!==x&&x.length){for(var A=m<<2,ma=x.length;ma>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.na?f=a.wa+a.na&&(a.na+=f-(a.wa+a.na)+1):(a.wa=f,a.na=1);d[f]=d[f]&~(255<g)break;e|=g<=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;lb&&-2!=b&&this.controller.G("Unable to restore disk '"+this.xa+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=ng(this,a++);)pg(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 pg(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 hg=0;function qg(a,b,c,d,e,f){r.call(this,a,b,c);this.C=rg(this,b.autoMount);this.B=0;this.I=d;this.J=e;this.K=f;this.H=d.yc;this.b=Array(this.H);this.F=!Oa("Mobi")&&window&&"FileReader"in window;this.m=[];this.qa=null;this.exports={selectDrive:this.qg}}n(qg,r); +function rg(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){u(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=qg.prototype; +h.ma=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){u(d.type+" option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=wa(c.value);null!=a&&sg(d, +a)},!0;case "loadDisk":return this.o[b]=c,c.onclick=function(){var a=d.o.listDisks;a&&a.options&&tg(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.o[b]=c,c.onclick=function(){var a,b=d.o.listDrives,b=b&&wa(b.value);null==b||0>b||b>=d.b.length||!(a=d.b[b])?d.G("Unable to boot the selected drive"):a.O?(cd(d.c,0,!0,b),(a=d.ub(a,a.Se,a.Te,a.Ue,a.Ke,0,2))&&d.G("Unable to read the boot sector ("+a+")")):d.G("Load a disk into the drive first")},!0;case "saveDisk":if(!this.F){c.parentNode.removeChild(c); +break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[wa(a.value)||0])if(a=a.O){var b;b="";for(var c=0,k;k=ng(a,c++);)for(var l=0,m=k.length;lg||9e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if(c==wg)a.G('Use "Choose File" and "Mount" to select and load a local disk.');else{if(c==xg){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=za(c);a.status("Attempting to load "+c+' as "'+b+'"')}Dg(a,e,b,c,!1,d)}else zg(a,e)} +function Dg(a,b,c,d,e,f){var g=-1,k=a.b[b];k.oa.toLowerCase()!=d.toLowerCase()&&(g++,zg(a,b,!0),k.Vc?a.G(a.type+" busy"):(k.Vc=!0,e&&(k.Uc=!0,a.B++),k.qb=!!f,kg(new gg(a,k,"preload"),c,d,f,a.Cd)&&g++));return g} +h.Cd=function(a,b,c,d,e){a.Vc=!1;b&&(b.L>a.L||b.T>a.T)&&(this.G('Disk "'+c+'" too large for drive '+(this.b[a.rb].lc||"---")),b=null);b?(a.O=b,a.xa=c,a.oa=d,this.Hd(a.rb),Eg(this,c,d,b),this.G('Loaded disk "'+c+'" in drive '+(this.b[a.rb].lc||"---"),a.Uc||e),this.A&&Vc(this.A)):a.qb=!1;a.Uc&&(a.Uc=!1,--this.B||B(this));sg(this,a.rb)}; +function ug(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e=a.L){m=T.Xb;break}p=a.seek(b,c,d+1);if(!p){m=T.xd;break}q=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}var x,A;if(0>(x=a.read(p,q++))||0>(A=a.read(p,q++))){m=T.Yb;break}if(!k&&(Hb(this.u,od(this.c,f),x|A<<8),hc(this.u))){m=T.Eb;break}q>=a.Z&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.sc=function(a,b,c,d,e,f,g,k,l){var m=0;a=a.O;var p=null,q;a||(m=T.od,e=0);for(;e;){var x=Jb(this.u,od(this.c,f));if(hc(this.u)){m=T.Eb;break}if(!p){if(b>=a.L){m=T.Xb;break}p=a.seek(b,c,d+1,!0);if(!p){m=T.xd;break}q=0;++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b))}if(k){var A,ma;if(0>(A=a.read(p,q++))||0>(ma=a.read(p,q++))){m=T.Yb;break}if(x!=(A|ma<<8)){m=T.zd;break}}else if(!a.write(p,q++,x&255)||!a.write(p,q++,x>>8)){m=T.Yb;break}q>=a.Z&&(p=null);f+=g;e--}return l?l(m,b,c,d,e,f):m}; +h.ie=function(a,b,c,d,e,f){this.h=f&65535;this.a=this.a&~S.fb|f>>16-S.U.fb&S.fb;this.i=65536-e&65535;this.g=this.g&~Ig.Oc|d&Ig.Oc;this.f|=a;Jg(this);return!0};function Jg(a){a.a&=~S.Ja;a.f&&(a.f|=T.Ud,a.a|=S.Ja,a.f&T.Ec&&(a.a|=S.Ec))}h.Mf=function(){return this.s};h.Zg=function(){};h.Nf=function(){return this.f};h.$g=function(){};h.Jf=function(){return this.a&S.Fb}; +h.Wg=function(a){this.a=this.a&~S.va|a&S.va;if(this.a&S.Db){a=!0;var b,c,d=(this.g&Ig.Ta)>>Ig.U.Ta,e=this.b[d],f,g,k,l,m,p;this.a&=~(S.za|S.Pc);this.f&=~T.ye;switch(c=this.a&S.ca){case Kg.Pd:this.f=this.g=0;this.a=S.za;break;case Kg.de:case Kg.Va:b=this.ub;case Kg.Sc:case Kg.Hb:b||(b=this.sc);f=(this.g&Ig.Bb)>>Ig.U.Bb;g=(this.g&Ig.Hc)>>Ig.U.Hc;k=this.g&Ig.Oc;l=65536-this.i&65535;m=(this.a&S.fb)<<16-S.U.fb|this.h;p=this.a&S.$d?0:2;if(f>=e.L){this.f|=T.Xb;break}if(k>=e.P){this.f|=T.Yb;break}a=b.call(this, +e,f,g,k,l,m,p,c>=Kg.Sc,this.ie.bind(this));break;case Kg.cc:f=(this.g&Ig.Bb)>>Ig.U.Bb;f(p=a.read(k,m++))||0>(q=a.read(k,m++))){g=Ng.Ba;break}Hb(this.u,od(this.c,f),p|q<<8);if(hc(this.u)){g=Ng.Eb;break}f+=2;e--;if(m>=a.Z&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.L)))){g=Ng.Ba;break}}return l?l(g,b,c,d,e,f):g}; +h.sc=function(a,b,c,d,e,f,g,k,l){g=0;a=a.O;k=null;var m;a||(g=Ng.Ba,e=0);for(;e;){var p=Jb(this.u,od(this.c,f));if(hc(this.u)){g=Ng.Eb;break}f+=2;e--;if(!k){k=a.seek(b,c,d+1,!0);if(!k){g=Ng.Ba;break}m=0}if(!a.write(k,m++,p&255)||!a.write(k,m++,p>>8)){g=Ng.Ba;break}if(m>=a.Z&&(k=null,++d>=a.P&&(d=0,++c>=a.T&&(c=0,++b>=a.L)))){g=Ng.Ba;break}}return l?l(g,b,c,d,e,f):g}; +h.ne=function(a,b,c,d,e,f){this.l=f&65535;this.a=this.a&~U.ya|f>>16-U.U.ya&U.ya;this.h=f>>16&Og.Fa;this.g=this.f=b<>U.U.ya;if(!(this.a&U.za)){a=!0;var b,c=this.b[(this.a&U.Ta)>>U.U.Ta],d=c.O,e,f,g;this.a&=~U.ha;switch(this.a&U.ca){case Pg.Ce:this.i&Qg.jd&&(this.a&=U.ha|U.ca|U.ya);this.i=c.status|this.g&V.bc|(d&&512==d.L?Qg.Xd:0);break;case Pg.cc:(this.f&V.Wd)==V.ze&&(b=this.f&V.Gb,c=(this.f&V.Be)<<2,this.g=this.f&V.Ae?this.g+b:this.g-b,this.f=this.g=this.g&V.Gb|c);break;case Pg.he:this.i=this.g;break;case Pg.ee:b=this.ub;case Pg.Fe:b||(b=this.sc), +e=this.f>>V.U.Gb,f=this.f&V.bc?1:0,g=this.f&V.vd,!d||e>=d.L||g>=d.P?this.a=this.a|Ng.Ba|U.Ja:(a=65536-this.i&65535,d=(this.h&Og.Fa)<<16|this.l,a=b.call(this,c,e,f,g,a,d,2,!1,this.ne.bind(this)))}a&&(this.a=this.a|U.ha|U.za,this.a&U.eb&&K(this.c,this.qa))}};h.Pf=function(){return this.l};h.bh=function(a){this.l=a&Rg.va};h.Sf=function(){return this.f};h.fh=function(a){this.f=a};h.Tf=function(){return this.i};h.gh=function(a){this.i=a};h.Qf=function(){return this.h}; +h.dh=function(a){this.h=a&Og.Fa;this.a=this.a&~U.ya|(this.h&3)<=m.L){k=Y.be;break}p=m.seek(b,c,d+1);if(!p){k=Y.Mc;break}q=0;++d>=m.P&&(d=0,++c>=m.T&&(c=0,++b))}var x;if(0>(a=m.read(p,q++))||0>(x=m.read(p,q++))){k=Y.Lc;break}Hb(this.u,od(this.c,f),a|x<<8);q>=m.Z&&(p=null);f+=g;e--}return l?l(k,b,c,d,e,f):k}; +function Ug(a){var b=0,c=a.a&X.Qc?1:0,d=a.b[c],d=d&&d.O,e=a.v&Wg.Fa,f=a.s&Xg.Fa;a.f&=~(Z.fd|Z.rd|Z.Cb|Z.ha);if(d)if(a.f|=Z.ha,c=d.seek(e,0,f,!0)){e=0;for(f=a.h.length;eg){b=Y.Lc;break}a.h[e++]=g}c.Ne&&(a.f|=Z.Cb)}else b=Y.Mc;else b=c?Y.Gc:Y.Fc;Vg(a,b)}h.Vf=function(a,b){a=this.a;if(!b)switch(a&=X.Fb,this.g){case W.Bc:case W.EMPTY:this.ithis.i&&(this.a|=X.Ga)}return a}; +h.ih=function(a){this.a=this.a&~X.va|a&X.va;if(this.a&X.INIT)this.bb();else if(this.a&X.Db&&this.g==W.gb)switch(this.g=this.a&X.ca,this.a&=~(X.Db|X.Ga|X.DONE|X.Ja),(a=this.qa)&&mc(this.c,a),this.g){case W.Bc:case W.EMPTY:case W.Va:case W.Hb:case W.dc:this.i=0;break;case W.ge:a=this.b[this.a&X.Qc?1:0];this.f&=~Z.ha;a&&a.O&&(this.f|=Z.ha);this.l=this.f;Vg(this);break;case W.fe:this.l=this.w,Vg(this)}else this.a&X.eb?this.a&X.DONE&&K(this.c,this.qa):(a=this.qa)&&mc(this.c,a)}; +h.Wf=function(a,b){if(!b)switch(this.g){case W.EMPTY:this.a&X.Ga&&(this.a&=~X.Ga,this.l=this.h[this.i]&255,++this.i>=this.h.length&&Vg(this))}return this.l}; +h.jh=function(a){switch(this.g){case W.Bc:this.a&X.Ga&&(this.a&=~X.Ga,this.h[this.i]=a&255,++this.i>=this.h.length&&Vg(this));break;case W.Va:case W.Hb:case W.dc:if(this.a&X.Ga)switch(this.a&=~X.Ga,this.i++){case 0:this.s=a;break;case 1:if(this.v=a,this.g==W.Va)Ug(this);else{var b=this.g==W.dc,c=0,d=this.a&X.Qc?1:0,e=this.b[d],e=e&&e.O,f=this.v&Wg.Fa,g=this.s&Xg.Fa;this.f&=~(Z.fd|Z.rd|Z.Cb|Z.ha);if(e)if(this.f|=Z.ha,d=e.seek(f,0,g,!0))for(b&&(d.Ne=!0),b=0,f=this.h.length;b\nLicense: GPL version 3 or later ");this.aa("Portions adapted from the PDP-11/70 Emulator by Paul Nankervis ");for(b=0;bbh){if(ch(d,this.s)){this.h=new E(this,"1.33.1",nh);ch(this.h)&&(oh(this,d),a=ph,qh(this.h));this.h.set(ih,Ga());rh(this.h);var e=this.a&&!this.l;if(a==jh||qa("Click OK to restore the previous "+bb+" machine state, or CANCEL to reset the machine.")){if(c=hh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ch(d,g):("error"==f&&"no machine state"!= +g?(this.G("Error: "+g),"unable to verify user"==g&&(Na(sh,""),this.b=null)):this.aa(f+": "+g),qh(d),ch(d)?(c=hh(d),e=!0):c=!1))}e&&fh(this,c?d:null)}else a==ph&&d.clear()}else fh(this);delete this.s;delete this.m}e=ra(this.id);for(f=0;fa[1];a=a[2];this.H=!0;this.j.R=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.c&&(th(this,this.c,b,c,a),Fb(this,-2),this.c.Y());this.C&&(oh(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0}; +function oh(a,b){if(qa("There may be a problem with your "+bb+" machine.\n\nTo help us diagnose it, click OK to send this "+bb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=bb;d.ver="1.33.1";d.url=c;d.user=a;d.type="bug";d.data=b;Ha("http://www.pcjs.org/api/v1/report",d,!0)}} +function uh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.33.1"),g=new E(a,"1.33.1",gh),k=Ga();g.set(ih,k);f.set(ih,k);f.set(vh,"1.33.1");f.set(wh,window?window.location.href:null);f.set(xh,window?window.navigator.userAgent:"");a.c&&a.c.ka&&(c&&(b&&(a.c.j.Y=a.c.j.M),F(a.c)),d=a.c.ka(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.R=!1,!1===d&&(e=null)));for(var k=ra(a.id),l=0;l=d||30<=(c.cd+=d))&&(e.textContent=c.j.M?c.Wa.toFixed(2)+"Mhz":"Stopped",c.cd=0)}if(a.f&&(a=a.f,b=b||0,a.m)){c=a.c.j.M;d=!!(a.c.g&8);if(0>=b||60<=(a.i+=b)){for(e=0;eb?a.V=a.c.b[7]:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Oa(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);zh(a,b,c)}})}else c(a,null)} -function Ah(a,b,c,d){function e(a){if(void 0===k){var b=g&&A(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ia(a))}function f(a){e("Error: "+a);l&&(--wh||cb(!0));l=!1}var g,k,l=!0;wh++;ua[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.33.1/components.xsl");m=function(d,k){k?xh(c,null,null,!1,e,function(d,l){l?(ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--wh||cb(!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),--wh||cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xh(b,a,d,!0,e,m):yh(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return Ah(a,b,c,d)};window.findMachineComponent=function(a,b){return za(b,a+".machine")};window.enableEvents=cb;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11.map +h.ma=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.g||(d.j.R?uh(d,!1,!0):eh(d,d.Rb))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.R&&!d.g)if(d.a&&!d.i){var a=qa("Click OK to save changes to this "+bb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");uh(d,a,!0);!a&&d.v?window&&window.location.reload():(a||(d.B=!0),d.Rb(bh),d.B=!1)}else d.reset(),d.c&&!d.D&&d.c.Y()},!0;case "save":if(Ba(Ja(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]= +c,c.onclick=function(){var a=ah(d,!0);if(a){var b=!!(d.a&&!d.i||d.v),c=uh(d,b);b?yh(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};function ah(a,b){var c=a.b;c||((c=Ma(sh),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=Ah(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c} +function Ah(a,b){a.b=null;b=Ha(Ja()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Na(sh,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function dh(a){var b=null;a.b&&(b=Ja()+"/api/v1/user?req=load&user="+a.b+"&state="+Bh(a,"1.33.1"));return b} +function yh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Bh(a,"1.33.1");d.data=c;b=Ha(Ja()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ha(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);Fh(a,b,c)}})}else c(a,null)} +function Gh(a,b,c,d){function e(a){if(void 0===k){var b=g&&z(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=Ca(a))}function f(a){e("Error: "+a);l&&(--Ch||Xa(!0));l=!1}var g,k,l=!0;Ch++;oa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],q=document.createElement("style");q.type="text/css";q.styleSheet?q.styleSheet.cssText=m:q.appendChild(document.createTextNode(m));p.appendChild(q)}c|| +(c="/versions/pdpjs/1.33.1/components.xsl");m=function(d,k){k?Dh(c,null,null,!1,e,function(d,l){l?(na(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--Ch||Xa(!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),--Ch||Xa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Dh(b,a,d,!0,e,m):Eh(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){Xa(!1);return Gh(a,b,c,d)};window.findMachineComponent=function(a,b){return ta(b,a+".machine")};window.enableEvents=Xa;window.sendEvent=Za;})();//# sourceMappingURL=/tmp/pdpjs/1.33.1/pdp11.map