From 0f4cbd6e7b335434e8f7bf812e0841cb273db698 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 15 Oct 2016 16:32:59 -0700 Subject: [PATCH] Added my first PDP-11 add-on device component (PC11) --- devices/pdp11/README.md | 7 +- .../machine/1120/test/debugger/machine.xml | 5 +- devices/pdp11/machine/1120/test/machine.xml | 4 +- .../machine/1170/panel/debugger/machine.xml | 4 +- devices/pdp11/machine/1170/panel/machine.xml | 4 +- .../machine/1170/test/debugger/machine.xml | 4 +- devices/pdp11/machine/1170/test/machine.xml | 4 +- .../machine/1170/vt100/debugger/machine.xml | 4 +- devices/pdp11/machine/1170/vt100/machine.xml | 4 +- devices/pdp11/rom/README.md | 10 + devices/pdp11/rom/test/README.md | 13 + devices/pdp11/rom/{custom => test}/boot.json | 0 devices/pdp11/rom/test/boot.lst | 538 ++++++++++++++++++ devices/pdp11/rom/{custom => test}/boot.mac | 0 devices/pdp11/rom/{custom => test}/makefile | 0 docs/pcx86/examples/components.xsl | 6 +- modules/pdp11/lib/debugger.js | 2 +- modules/pdp11/lib/defines.js | 17 + modules/pdp11/lib/device.js | 62 +- modules/pdp11/lib/pc11.js | 236 ++++++++ modules/shared/templates/components.xsl | 6 +- package.json | 1 + versions/pc8080/1.30.1/components.xsl | 6 +- versions/pcx86/1.30.1/components.xsl | 6 +- versions/pdpjs/1.30.1/components.xsl | 6 +- versions/pdpjs/1.30.1/pdp11-dbg.js | 411 ++++++------- versions/pdpjs/1.30.1/pdp11.js | 247 ++++---- 27 files changed, 1219 insertions(+), 388 deletions(-) create mode 100644 devices/pdp11/rom/README.md create mode 100644 devices/pdp11/rom/test/README.md rename devices/pdp11/rom/{custom => test}/boot.json (100%) create mode 100644 devices/pdp11/rom/test/boot.lst rename devices/pdp11/rom/{custom => test}/boot.mac (100%) rename devices/pdp11/rom/{custom => test}/makefile (100%) create mode 100644 modules/pdp11/lib/pc11.js diff --git a/devices/pdp11/README.md b/devices/pdp11/README.md index 14b462a76..69ffee6fb 100644 --- a/devices/pdp11/README.md +++ b/devices/pdp11/README.md @@ -7,4 +7,9 @@ permalink: /devices/pdp11/ PDP-11 Device Configurations ---------------------------- -See the list of [PDP-11 Machines](machine/) supported by [PDPjs](/modules/pdp11/), our PDP-11 emulation module. +PDP-11 resources used by [PDPjs](/modules/pdp11/), our PDP-11 emulation module, include: + +* [Loaders](loader/) +* [Machines](machine/) +* [Panels](panel/) +* [ROMs](rom/) diff --git a/devices/pdp11/machine/1120/test/debugger/machine.xml b/devices/pdp11/machine/1120/test/debugger/machine.xml index a0a3f4f2e..dc20b1d3d 100644 --- a/devices/pdp11/machine/1120/test/debugger/machine.xml +++ b/devices/pdp11/machine/1120/test/debugger/machine.xml @@ -5,8 +5,9 @@ - - + + + diff --git a/devices/pdp11/machine/1120/test/machine.xml b/devices/pdp11/machine/1120/test/machine.xml index 4deabff8e..9e25546f2 100644 --- a/devices/pdp11/machine/1120/test/machine.xml +++ b/devices/pdp11/machine/1120/test/machine.xml @@ -5,8 +5,8 @@ - - + + diff --git a/devices/pdp11/machine/1170/panel/debugger/machine.xml b/devices/pdp11/machine/1170/panel/debugger/machine.xml index 8615599f7..e5f973935 100644 --- a/devices/pdp11/machine/1170/panel/debugger/machine.xml +++ b/devices/pdp11/machine/1170/panel/debugger/machine.xml @@ -5,9 +5,9 @@ - + - + diff --git a/devices/pdp11/machine/1170/panel/machine.xml b/devices/pdp11/machine/1170/panel/machine.xml index 97dcd5ddb..e69c04ad2 100644 --- a/devices/pdp11/machine/1170/panel/machine.xml +++ b/devices/pdp11/machine/1170/panel/machine.xml @@ -5,9 +5,9 @@ - + - + diff --git a/devices/pdp11/machine/1170/test/debugger/machine.xml b/devices/pdp11/machine/1170/test/debugger/machine.xml index df5cb042c..7351f82e9 100644 --- a/devices/pdp11/machine/1170/test/debugger/machine.xml +++ b/devices/pdp11/machine/1170/test/debugger/machine.xml @@ -5,9 +5,9 @@ - + - + diff --git a/devices/pdp11/machine/1170/test/machine.xml b/devices/pdp11/machine/1170/test/machine.xml index bf6ca3e02..779fee551 100644 --- a/devices/pdp11/machine/1170/test/machine.xml +++ b/devices/pdp11/machine/1170/test/machine.xml @@ -5,9 +5,9 @@ - + - + diff --git a/devices/pdp11/machine/1170/vt100/debugger/machine.xml b/devices/pdp11/machine/1170/vt100/debugger/machine.xml index a4bcd50e8..3ef3ce4af 100644 --- a/devices/pdp11/machine/1170/vt100/debugger/machine.xml +++ b/devices/pdp11/machine/1170/vt100/debugger/machine.xml @@ -5,9 +5,9 @@ - + - + diff --git a/devices/pdp11/machine/1170/vt100/machine.xml b/devices/pdp11/machine/1170/vt100/machine.xml index 0630fba34..2f9362178 100644 --- a/devices/pdp11/machine/1170/vt100/machine.xml +++ b/devices/pdp11/machine/1170/vt100/machine.xml @@ -5,9 +5,9 @@ - + - + diff --git a/devices/pdp11/rom/README.md b/devices/pdp11/rom/README.md new file mode 100644 index 000000000..0907e7fe0 --- /dev/null +++ b/devices/pdp11/rom/README.md @@ -0,0 +1,10 @@ +--- +layout: page +title: PDP-11 ROMs +permalink: /devices/pdp11/rom/ +--- + +PDP-11 ROMs +----------- + +* [Test ROM](custom/) ([original version](http://skn.noip.me/pdp11/boot.mac) created by [Paul Nankervis](paulnank@hotmail.com)) diff --git a/devices/pdp11/rom/test/README.md b/devices/pdp11/rom/test/README.md new file mode 100644 index 000000000..343b55954 --- /dev/null +++ b/devices/pdp11/rom/test/README.md @@ -0,0 +1,13 @@ +--- +layout: page +title: PDP-11 Test ROM +permalink: /devices/pdp11/rom/test/ +--- + +PDP-11 Test ROM +--------------- + +This isn't a ROM so much as a read-only image that can be loaded in RAM by the ROM component. + +[BOOT.MAC](boot.mac) was cross-assembled with [MACRO11](https://github.com/shattered/macro11) to produce [BOOT.LST](boot.lst), +which was then processed by [FileDump](/modules/filedump/) to produce [BOOT.JSON](boot.json). diff --git a/devices/pdp11/rom/custom/boot.json b/devices/pdp11/rom/test/boot.json similarity index 100% rename from devices/pdp11/rom/custom/boot.json rename to devices/pdp11/rom/test/boot.json diff --git a/devices/pdp11/rom/test/boot.lst b/devices/pdp11/rom/test/boot.lst new file mode 100644 index 000000000..cc1d5876e --- /dev/null +++ b/devices/pdp11/rom/test/boot.lst @@ -0,0 +1,538 @@ + 1 ; BOOT LOADER CODE + 2 ; + 3 ; REBASE HIGHER LINK/BOT:140000 + 4 ; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING? + 5 + 6 177776 PSW = 177776 + 7 177564 DL11XCSR = 177564 + 8 000064 DL11VEC = 64 + 9 + 10 177546 KW11LKS = 177546 + 11 000100 KW11VEC = 100 + 12 + 13 .ASECT + 14 140000 .=140000 + 15 140000 000005 START: RESET ; 140000 + 16 140002 005037 177776 CLR @#PSW + 17 140006 012706 140000 MOV #START,SP + 18 140012 005037 177564 CLR @#DL11XCSR ; CLEAR THE XCSR + 19 140016 012700 141121 MOV #BANNER,R0 + 20 140022 004767 140150' JSR PC,PRINT + 21 140026 012737 140124 000100 MOV #CLKAST,@#KW11VEC + 22 140034 012737 000340 000102 MOV #340,@#KW11VEC+2 + 23 140042 052737 000100 177546 BIS #100,@#KW11LKS ; SET CLOCK TICKING + 24 + 25 140050 012700 141173 MOV #PROMPT,R0 + 26 140054 004767 140150' JSR PC,PRINT + 27 140060 162706 000256 SUB #256,SP + 28 140064 010600 MOV SP,R0 + 29 140066 004767 140244' JSR PC,INPUT + 30 140072 005000 CLR R0 + 31 140074 000001 1$: WAIT + 32 140076 005200 INC R0 + 33 140100 005767 140120' TST LGHTON + 34 140104 001773 BEQ 1$ + 35 140106 012746 054000 MOV #054000,-(SP) ; SUPER PRIORITY 0 ALT REG + 36 140112 016746 140120' MOV LGHTON,-(SP) ; CALL SUPER LOOP START + 37 140116 000002 RTI + 38 + 39 140120 000000 LGHTON: .WORD 0 + 40 140122 000000 CLKTIC: .WORD 0 + 41 + 42 CLKAST: ; 140124 + 43 140124 005267 140122' INC CLKTIC + 44 140130 000002 RTI + 45 + 46 ONECHR: + 47 140132 105737 177564 TSTB @#DL11XCSR ; 140132 + 48 140136 100375 BPL ONECHR + 49 140140 110037 177566 MOVB R0,@#177566 + 50 140144 000207 RTS PC + 51 + 52 140146 000000 PRTPTR: .WORD 0 ; 140146 + 53 + 54 PRINT: ; 140150 + 55 140150 132737 000100 177564 BITB #100,@#DL11XCSR + 56 140156 001374 BNE PRINT + 57 140160 010067 140146' MOV R0,PRTPTR + 58 140164 012737 140210 000064 MOV #PRTAST,@#DL11VEC + 59 140172 012737 000200 000066 MOV #200,@#DL11VEC+2 + 60 140200 152737 000100 177564 BISB #100,@#DL11XCSR + 61 140206 000207 RTS PC + 62 + 63 PRTAST: ; 140210 + 64 140210 105777 140146' TSTB @PRTPTR + 65 140214 001406 BEQ 2$ + 66 140216 117737 140146' 177566 MOVB @PRTPTR,@#177566 + 67 140224 005267 140146' INC PRTPTR + 68 140230 000002 RTI + 69 140232 105037 177564 2$: CLRB @#177564 + 70 140236 000002 RTI + 71 + 72 140240 000000 BUFFER: .WORD 0 ; INPUT BUFFER POINTER + 73 140242 000000 LENGTH: .WORD 0 ; INPUT BUFFER LENGTH + 74 + 75 INPUT: + 76 140244 010067 140240' MOV R0,BUFFER ; 140244 + 77 140250 005067 140242' CLR LENGTH + 78 140254 012737 140300 000060 MOV #INPAST,@#60 + 79 140262 012737 000200 000062 MOV #200,@#62 + 80 140270 152737 000100 177560 BISB #100,@#177560 + 81 140276 000207 RTS PC + 82 + 83 INPAST: ; 140300 + 84 140300 010046 MOV R0,-(SP) + 85 140302 113700 177562 MOVB @#177562,R0 + 86 140306 120027 000015 CMPB R0,#15 + 87 140312 001455 BEQ 7$ ; CARRIAGE RETURN + 88 140314 120027 000177 CMPB R0,#127. + 89 140320 001403 BEQ 2$ ; + 90 140322 120027 000010 CMPB R0,#10 + 91 140326 001012 BNE 4$ ; BACK SPACE + 92 140330 005767 140242' 2$: TST LENGTH ; DATA IN BUFFER? + 93 140334 001406 BEQ 3$ + 94 140336 005367 140242' DEC LENGTH ; LENGTH + 95 140342 012700 141037 MOV #DEL,R0 + 96 140346 004767 140150' JSR PC,PRINT + 97 140352 000453 3$: BR 9$ + 98 140354 120027 000040 4$: CMPB R0,#40 + 99 140360 002450 BLT 9$ ; BELOW SPACE + 100 140362 120027 000177 CMPB R0,#177 + 101 140366 002045 BGE 9$ ; SKIP STUFF TOO BIG + 102 140370 004767 140132' JSR PC,ONECHR ; ECHO CHAR + 103 140374 120027 000172 CMPB R0,#172 + 104 140400 003005 BGT 5$ ; ABOVE Z + 105 140402 120027 000141 CMPB R0,#141 + 106 140406 002402 BLT 5$ ; BELOW A + 107 140410 142700 000040 BICB #40,R0 ; CONVERT TO UPPER CASE + 108 140414 026727 140242' 000254 5$: CMP LENGTH,#254 + 109 140422 002027 BGE 9$ + 110 140424 110046 MOVB R0,-(SP) + 111 140426 016700 140240' MOV BUFFER,R0 + 112 140432 066700 140242' ADD LENGTH,R0 + 113 140436 112610 MOVB (SP)+,(R0) + 114 140440 005267 140242' INC LENGTH + 115 140444 000416 BR 9$ + 116 + 117 140446 016700 140240' 7$: MOV BUFFER,R0 + 118 140452 066700 140242' ADD LENGTH,R0 + 119 140456 105010 CLRB (R0) + 120 140460 012737 140506 000240 MOV #CMD,@#240 ; CALL CMD AT PRIORITY 2 + 121 140466 012737 000100 000242 MOV #100,@#242 + 122 140474 012737 002000 177772 MOV #2000,@#177772 + 123 140502 012600 9$: MOV (SP)+,R0 + 124 140504 000002 RTI + 125 + 126 CMD: ; 140506 + 127 140506 005037 177772 CLR @#177772 ; NO MORE PIR CALLS + 128 140512 010046 MOV R0,-(SP) + 129 140514 010146 MOV R1,-(SP) + 130 140516 010246 MOV R2,-(SP) + 131 140520 010346 MOV R3,-(SP) + 132 140522 010446 MOV R4,-(SP) + 133 140524 012700 141034 MOV #EOL,R0 + 134 140530 004767 140150' JSR PC,PRINT + 135 140534 132737 000100 177564 1$: BITB #100,@#177564 + 136 140542 001374 BNE 1$ + 137 140544 005004 CLR R4 + 138 140546 012703 141043 MOV #CMDLST,R3 ; CMD LIST + 139 140552 112300 3$: MOVB (R3)+,R0 + 140 140554 001431 BEQ 13$ + 141 140556 016702 140240' MOV BUFFER,R2 ; USER CMD + 142 140562 112201 4$: MOVB (R2)+,R1 + 143 140564 001431 BEQ 15$ ; NULL COMMAND? + 144 140566 120127 000040 CMPB R1,#40 + 145 140572 001773 BEQ 4$ ; SKIP SPACE + 146 140574 120001 5$: CMPB R0,R1 + 147 140576 001010 BNE 7$ + 148 140600 112300 MOVB (R3)+,R0 + 149 140602 001412 BEQ 9$ + 150 140604 112201 MOVB (R2)+,R1 + 151 140606 001410 BEQ 9$ + 152 140610 120127 000040 CMPB R1,#40 + 153 140614 001367 BNE 5$ + 154 140616 000404 BR 9$ + 155 140620 112300 7$: MOVB (R3)+,R0 + 156 140622 001376 BNE 7$ + 157 140624 005204 INC R4 + 158 140626 000751 BR 3$ + 159 140630 006304 9$: ASL R4 + 160 140632 004774 140700 JSR PC,@CMDTBL(R4) ; EXECUTE + 161 140636 000404 BR 15$ + 162 + 163 140640 012700 141077 13$: MOV #UNKMSG,R0 + 164 140644 004767 140150' JSR PC,PRINT + 165 + 166 140650 005067 140242' 15$: CLR LENGTH + 167 140654 012700 141173 MOV #PROMPT,R0 + 168 140660 004767 140150' JSR PC,PRINT + 169 140664 012604 MOV (SP)+,R4 + 170 140666 012603 MOV (SP)+,R3 + 171 140670 012602 MOV (SP)+,R2 + 172 140672 012601 MOV (SP)+,R1 + 173 140674 012600 MOV (SP)+,R0 + 174 140676 000002 RTI + 175 + 176 + 177 140700 142072 141266 141302 CMDTBL: .WORD BOOT,HALT,TEST,LIGHTS,HELP + 140706 141406 141254 + 178 140712 103 117 115 HLPMSG: .ASCIZ 'COMMANDS ARE BOOT, HALT, LIGHTS, TEST AND HELP'<15><12>'BOOT DEVICES ARE RK? RL? OR RP?'<15><12> + 140715 115 101 116 + 140720 104 123 040 + 140723 101 122 105 + 140726 040 102 117 + 140731 117 124 054 + 140734 040 110 101 + 140737 114 124 054 + 140742 040 114 111 + 140745 107 110 124 + 140750 123 054 040 + 140753 124 105 123 + 140756 124 040 101 + 140761 116 104 040 + 140764 110 105 114 + 140767 120 015 012 + 140772 102 117 117 + 140775 124 040 104 + 141000 105 126 111 + 141003 103 105 123 + 141006 040 101 122 + 141011 105 040 122 + 141014 113 077 040 + 141017 122 114 077 + 141022 040 117 122 + 141025 040 122 120 + 141030 077 015 012 + 141033 000 + 179 141034 015 012 000 EOL: .BYTE 15,12,0 + 180 141037 010 040 010 DEL: .BYTE 10,40,10,0 + 141042 000 + 181 141043 102 117 117 CMDLST: .ASCIZ 'BOOT' + 141046 124 000 + 182 141050 110 101 114 .ASCIZ 'HALT' + 141053 124 000 + 183 141055 124 105 123 .ASCIZ 'TEST' + 141060 124 000 + 184 141062 114 111 107 .ASCIZ 'LIGHTS' + 141065 110 124 123 + 141070 000 + 185 141071 110 105 114 .ASCIZ 'HELP' + 141074 120 000 + 186 141076 000 .BYTE 0 + 187 141077 125 116 113 UNKMSG: .ASCIZ 'UNKNOWN COMMAND'<12><15> + 141102 116 117 127 + 141105 116 040 103 + 141110 117 115 115 + 141113 101 116 104 + 141116 012 015 000 + 188 141121 120 101 125 BANNER: .ASCIZ 'PAUL NANKERVIS - PAULNANK@HOTMAIL.COM'<12><15><12><15> + 141124 114 040 116 + 141127 101 116 113 + 141132 105 122 126 + 141135 111 123 040 + 141140 055 040 120 + 141143 101 125 114 + 141146 116 101 116 + 141151 113 100 110 + 141154 117 124 115 + 141157 101 111 114 + 141162 056 103 117 + 141165 115 012 015 + 141170 012 015 000 + 189 141173 102 117 117 PROMPT: .ASCIZ 'BOOT> ' + 141176 124 076 040 + 141201 000 + 190 141202 125 116 113 BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15> + 141205 116 117 127 + 141210 116 040 102 + 141213 117 117 124 + 141216 040 104 105 + 141221 126 111 103 + 141224 105 012 015 + 141227 000 + 191 141230 040 040 040 PERMSG: .ASCIZ ' CLOCK TICKS'<12><15> + 141233 040 040 040 + 141236 103 114 117 + 141241 103 113 040 + 141244 124 111 103 + 141247 113 123 012 + 141252 015 000 + 192 + 193 .EVEN + 194 + 195 HELP: ; 141244 + 196 141254 012700 140712 MOV #HLPMSG,R0 + 197 141260 004767 140150' JSR PC,PRINT + 198 141264 000207 RTS PC + 199 + 200 HALT: ; 141260 + 201 141266 000000 HALT + 202 141270 012700 141034 MOV #EOL,R0 + 203 141274 004767 140150' JSR PC,PRINT + 204 141300 000207 RTS PC + 205 + 206 TEST: ; 141272 + 207 141302 005067 140122' CLR CLKTIC + 208 + 209 141306 012705 015000 MOV #15000,R5 + 210 141312 010537 177570 10$: MOV R5,@#177570 ; DISPLAY + 211 141316 010504 MOV R5,R4 + 212 141320 006204 ASR R4 + 213 141322 005000 15$: CLR R0 + 214 141324 010501 MOV R5,R1 + 215 141326 071004 DIV R4,R0 + 216 141330 010002 MOV R0,R2 + 217 141332 070204 MUL R4,R2 + 218 141334 060301 ADD R3,R1 + 219 141336 020105 CMP R1,R5 + 220 141340 001401 BEQ 20$ + 221 141342 000000 HALT + 222 141344 077412 20$: SOB R4,15$ + 223 141346 077517 SOB R5,10$ + 224 + 225 141350 012700 141235 MOV #PERMSG+5,R0 + 226 141354 016703 140122' MOV CLKTIC,R3 + 227 + 228 141360 005002 25$: CLR R2 ; 141350 + 229 141362 071227 000010 DIV #10,R2 + 230 141366 062703 000060 ADD #'0,R3 + 231 141372 110340 MOVB R3,-(R0) + 232 141374 010203 MOV R2,R3 + 233 141376 001370 BNE 25$ + 234 + 235 141400 004767 140150' JSR PC,PRINT + 236 141404 000207 RTS PC + 237 + 238 + 239 177572 MMR0=177572 + 240 177574 MMR1=177574 + 241 177576 MMR2=177576 + 242 172516 MMR3=172516 + 243 + 244 LIGHTS: ; 141376 + 245 141406 012703 077406 MOV #77406,R3 ; DEFAULT PDR + 246 141412 005002 CLR R2 + 247 141414 005001 CLR R1 + 248 141416 012700 000010 MOV #8.,R0 + 249 141422 010361 172300 1$: MOV R3,172300(R1) ; KERNEL I PDR + 250 141426 010261 172340 MOV R2,172340(R1) ; KERNEL I PAR + 251 141432 010361 172320 MOV R3,172320(R1) ; KERNEL D PDR + 252 141436 010261 172360 MOV R2,172360(R1) ; KERNEL D PAR + 253 141442 010361 172200 MOV R3,172200(R1) ; SUPER I PDR + 254 141446 010261 172240 MOV R2,172240(R1) ; SUPER I PAR + 255 141452 010361 172220 MOV R3,172220(R1) ; SUPER D PDR + 256 141456 010261 172260 MOV R2,172260(R1) ; SUPER D PAR + 257 141462 010361 177600 MOV R3,177600(R1) ; USER I PDR + 258 141466 010261 177640 MOV R2,177640(R1) ; USER I PAR + 259 141472 010361 177620 MOV R3,177620(R1) ; USER D PDR + 260 141476 010361 177660 MOV R3,177660(R1) ; USER D PAR + 261 141502 062702 000200 ADD #200,R2 + 262 141506 062701 000002 ADD #2,R1 + 263 141512 077035 SOB R0,1$ + 264 141514 052737 176000 172376 BIS #176000,@#172376 ; KERNEL D POINTS TO I/O SPACE + 265 141522 052737 176000 172276 BIS #176000,@#172276 ; SUPER D POINTS TO I/O SPACE + 266 141530 052737 176000 177676 BIS #176000,@#177676 ; USER D POINTS TO I/O SPACE + 267 141536 012737 000077 172516 MOV #77,@#MMR3 ; 77 FOR 22 BIT + 268 141544 012737 000001 177572 MOV #1,@#MMR0 + 269 + 270 141552 012737 001700 172244 MOV #1700,@#172244 ; BASE SUPER I (PAR 2) #40000 AT #170000 + 271 141560 012737 001700 172264 MOV #1700,@#172264 ; BASE SUPER D (PAR 2) #40000 AT #170000 + 272 141566 012737 010000 177776 MOV #010000,@#177776 ; SET PM TO SUPER + 273 + 274 141574 012703 040200 MOV #40200,R3 ; SUPER CODE ADDRESS + 275 141600 012702 141626 MOV #SUPERS,R2 ; ADDRESS SUPER CODE + 276 141604 012246 10$: MOV (R2)+,-(SP) + 277 141606 006623 MTPI (R3)+ + 278 141610 020227 142072 CMP R2,#SUPERE + 279 141614 103773 BLO 10$ + 280 + 281 141616 012767 040200 140120' MOV #40200,LGHTON ; CHANGE IDLE TASK + 282 141624 000207 RTS PC + 283 + 284 ; + 285 ; TO BE COPIED TO SUPER #40200 AT PHYSICAL #170000 + 286 ; #40000 TO #40200 FOR WAIT & JMP INSTRUCTIONS + 287 ; + 288 SUPERS: ; 141616 + 289 141626 012700 000037 MOV #37,R0 ; LOAD PATTERN + 290 141632 012701 174000 MOV #174000,R1 + 291 141636 032737 000001 177570 BIT #1,@#177570 + 292 141644 001414 BEQ 10$ + 293 141646 012700 007417 MOV #7417,R0 + 294 141652 010001 MOV R0,R1 + 295 141654 005101 COM R1 + 296 141656 032737 000002 177570 BIT #2,@#177570 + 297 141664 001404 BEQ 10$ + 298 141666 012700 036163 MOV #36163,R0 + 299 141672 012701 037000 MOV #37000,R1 + 300 141676 010102 10$: MOV R1,R2 + 301 141700 162702 000002 SUB #2,R2 + 302 141704 042702 000001 BIC #1,R2 ; WAIT ADDRESS + 303 141710 010203 MOV R2,R3 + 304 141712 042703 177701 BIC #177701,R3 ; ADDRESS OFFSET + 305 141716 012763 000001 040000 MOV #0000001,40000(R3) ; WRITE WAIT + 306 141724 062703 000002 ADD #2,R3 + 307 141730 012763 000113 040000 MOV #0000113,40000(R3) ; WRITE JMP (R3) + 308 + 309 141736 010204 MOV R2,R4 + 310 141740 072427 177772 ASH #-6,R4 + 311 141744 042704 177600 BIC #177600,R4 + 312 141750 012705 001700 MOV #1700,R5 + 313 141754 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR WAIT + 314 141756 010204 MOV R2,R4 + 315 141760 072427 177764 ASH #-12.,R4 + 316 141764 042704 177761 BIC #177761,R4 ; PAR SELECT OFFSET + 317 141770 010564 172240 MOV R5,172240(R4) ; SUPER I SPACE + 318 + 319 141774 010103 MOV R1,R3 + 320 141776 072327 177764 ASH #-12.,R3 + 321 142002 042703 177761 BIC #177761,R3 ; PAR SELECT OFFSET + 322 142006 020304 CMP R3,R4 ; SAME PAR + 323 142010 001412 BEQ 30$ + 324 142012 010104 MOV R1,R4 + 325 142014 072427 177772 ASH #-6,R4 + 326 142020 042704 177600 BIC #177600,R4 + 327 142024 012705 001700 MOV #1700,R5 + 328 142030 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR JMP + 329 142032 010563 172240 MOV R5,172240(R3) ; SUPER I SPACE + 330 30$: + 331 142036 012704 000003 MOV #3,R4 + 332 142042 063704 177570 ADD @#177570,R4 + 333 142046 012703 000002 MOV #2,R3 + 334 142052 060703 ADD PC,R3 + 335 142054 000112 40$: JMP (R2) + 336 142056 077402 SOB R4,40$ + 337 142060 010002 MOV R0,R2 + 338 142062 006002 ROR R2 ; ROTATE PATTERN + 339 142064 006101 ROL R1 + 340 142066 006000 ROR R0 + 341 142070 000702 BR 10$ + 342 SUPERE: + 343 + 344 BOOT: ; 142062 + 345 142072 005003 CLR R3 ; UNIT + 346 142074 112201 1$: MOVB (R2)+,R1 + 347 142076 001545 BEQ BOOTRK ; DEFAULT DEVICE IS RK0 + 348 142100 120127 000040 CMPB R1,#40 + 349 142104 001773 BEQ 1$ + 350 142106 120127 000122 CMPB R1,#'R + 351 142112 001405 BEQ 5$ + 352 + 353 142114 012700 141202 MOV #BADBOO,R0 + 354 142120 004767 140150' JSR PC,PRINT + 355 142124 000207 RTS PC + 356 + 357 142126 112201 5$: MOVB (R2)+,R1 ; HOPEFULLY K, L OR P + 358 142130 112200 7$: MOVB (R2)+,R0 ; DIGIT + 359 142132 001416 BEQ 9$ + 360 142134 120027 000040 CMPB R0,#40 + 361 142140 001413 BEQ 9$ + 362 142142 120027 000067 CMPB R0,#'7 + 363 142146 003031 BGT 11$ + 364 142150 162700 000060 SUB #'0,R0 + 365 142154 002426 BLT 11$ + 366 142156 006303 ASL R3 + 367 142160 006303 ASL R3 + 368 142162 006303 ASL R3 + 369 142164 050003 BIS R0,R3 ; PUT DIGIT INTO UNIT + 370 142166 000760 BR 7$ + 371 142170 005002 9$: CLR R2 + 372 142172 012722 000137 MOV #137,(R2)+ + 373 142176 012722 140000 MOV #START,(R2)+ + 374 142202 012722 140000 MOV #START,(R2)+ + 375 142206 005022 CLR (R2)+ + 376 142210 120127 000113 CMPB R1,#'K + 377 142214 001476 BEQ BOOTRK + 378 142216 120127 000114 CMPB R1,#'L + 379 142222 001410 BEQ BOOTRL + 380 142224 120127 000120 CMPB R1,#'P + 381 142230 001517 BEQ BOOTRP + 382 + 383 142232 012700 141077 11$: MOV #UNKMSG,R0 + 384 142236 004767 140150' JSR PC,PRINT + 385 142242 000207 RTS PC + 386 + 387 174400 RLCS=174400 + 388 BOOTRL: ; 142234 + 389 142244 000005 RESET + 390 142246 000303 SWAB R3 ; UNIT NUMBER + 391 142250 012701 174400 MOV #RLCS,R1 ; CSR + 392 142254 012761 000013 000004 MOV #13,4(R1) ; CLR ERR + 393 142262 052703 000004 BIS #4,R3 ; UNIT+GSTAT + 394 142266 010311 MOV R3,(R1) ; ISSUE CMD + 395 142270 105711 TSTB (R1) ; WAIT + 396 142272 100376 BPL .-2 + 397 142274 105003 CLRB R3 + 398 142276 052703 000010 BIS #10,R3 ; UNIT+RDHDR + 399 142302 010311 MOV R3,(R1) ; ISSUE CMD + 400 142304 105711 TSTB (R1) ; WAIT + 401 142306 100376 BPL .-2 + 402 142310 016102 000006 MOV 6(R1),R2 ; GET HDR + 403 142314 042702 000077 BIC #77,R2 ; CLR SECTOR + 404 142320 005202 INC R2 ; MAGIC BIT + 405 142322 010261 000004 MOV R2,4(R1) ; SEEK TO 0 + 406 142326 105003 CLRB R3 + 407 142330 052703 000006 BIS #6,R3 ; UNIT+SEEK + 408 142334 010311 MOV R3,(R1) ; ISSUE CMD + 409 142336 105711 TSTB (R1) ; WAIT + 410 142340 100376 BPL .-2 + 411 142342 005061 000002 CLR 2(R1) ; CLR BA + 412 142346 005061 000004 CLR 4(R1) ; CLR DA + 413 142352 012761 177000 000006 MOV #-512.,6(R1) ; SET WC + 414 142360 105003 CLRB R3 + 415 142362 052703 000014 BIS #14,R3 ; UNIT+READ + 416 142366 010311 MOV R3,(R1) ; ISSUE CMD + 417 142370 105711 TSTB (R1) ; WAIT + 418 142372 100376 BPL .-2 + 419 142374 042711 000377 BIC #377,(R1) + 420 142400 005002 CLR R2 + 421 142402 005003 CLR R3 + 422 142404 005004 CLR R4 + 423 142406 005005 CLR R5 + 424 142410 005007 CLR PC + 425 + 426 177412 RKDA=177412 + 427 000005 READGO=5 + 428 BOOTRK: + 429 142412 000005 RESET ; 142402 + 430 142414 000303 SWAB R3 ; UNIT NUMBER + 431 142416 006303 ASL R3 + 432 142420 006303 ASL R3 + 433 142422 006303 ASL R3 + 434 142424 006303 ASL R3 + 435 142426 006303 ASL R3 + 436 142430 012701 177412 MOV #RKDA,R1 ; CSR + 437 142434 010311 MOV R3,(R1) ; LOAD DA + 438 142436 005041 CLR -(R1) ; CLEAR BA + 439 142440 012741 177000 MOV #-256.*2,-(R1) ; LOAD WC + 440 142444 012741 000005 MOV #READGO,-(R1) ; READ & GO + 441 142450 005002 CLR R2 + 442 142452 005003 CLR R3 + 443 142454 005004 CLR R4 + 444 142456 005005 CLR R5 + 445 142460 105711 TSTB (R1) + 446 142462 100376 BPL .-2 + 447 142464 105011 CLRB (R1) + 448 142466 005007 CLR PC + 449 + 450 176700 RPCSR=0176700 + 451 BOOTRP: ; 142460 + 452 142470 000005 RESET + 453 142472 012701 176700 MOV #RPCSR, R1 + 454 142476 012761 000040 000010 MOV #0000040, 10(R1) ; RESET + 455 142504 010361 000010 MOV R3, 10(R1) ; SET UNIT + 456 142510 012711 000021 MOV #0000021, (R1) ; PACK ACK + 457 142514 012761 010000 000032 MOV #0010000, 32(R1) ; 16B MODE + 458 142522 012761 177000 000002 MOV #-512., 2(R1) ; SET WC + 459 142530 005061 000004 CLR 4(R1) ; CLR BA + 460 142534 005061 000006 CLR 6(R1) ; CLR DA + 461 142540 005061 000034 CLR 34(R1) ; CLR CYL + 462 142544 012711 000071 MOV #0000071, (R1) ; READ + 463 142550 105711 TSTB (R1) ; WAIT + 464 142552 100376 BPL .-2 + 465 142554 105011 CLRB (R1) + 466 142556 010300 MOV R3,R0 + 467 142560 005007 CLR PC + 468 + 469 .END START + 469 diff --git a/devices/pdp11/rom/custom/boot.mac b/devices/pdp11/rom/test/boot.mac similarity index 100% rename from devices/pdp11/rom/custom/boot.mac rename to devices/pdp11/rom/test/boot.mac diff --git a/devices/pdp11/rom/custom/makefile b/devices/pdp11/rom/test/makefile similarity index 100% rename from devices/pdp11/rom/custom/makefile rename to devices/pdp11/rom/test/makefile diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index 43f7691f9..a7246cf44 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -712,16 +712,16 @@ - + - + device - ,name:'' + ,type:'' diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index d66741a2f..7c0499d18 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1644,7 +1644,7 @@ if (DEBUGGER) { if (cpu.isRunning()) { cpu.setPC(this.cpu.getLastPC()); this.stopCPU(); - return true; + throw -1; // TODO: Review the appropriate-ness of throwing a bogus vector number in order to immediately stop the instruction } return false; }; diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 021bd0704..7446f09b7 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -425,6 +425,9 @@ var PDP11 = { LKS: 0o177546, // KW11-L Clock Status + PRS: 0o177550, // PC11/PR11 Reader Status Register + PRB: 0o177552, // PC11/PR11 Reader Buffer Register + RCSR: 0o177560, // Display Terminal: Receiver Status Register RBUF: 0o177562, // Display Terminal: Receiver Data Buffer Register XCSR: 0o177564, // Display Terminal: Transmitter Status Register @@ -507,6 +510,20 @@ var PDP11 = { SL: 0o177774, // Stack Limit Register PSW: 0o177776 // 777776 17777776 0x3FFFFE Processor Status Word }, + PC11: { // High Speed Reader & Punch (PR11 is a Reader-only unit) + PRS: { + 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 + WMASK: 0x0041 // bits writable + }, + PRB: { + MASK: 0x00FF // Data + } + }, DL11: { // Serial Line Interface (program compatible with the KL11 for control of console teleprinters) PRI: 4, RVEC: 0o60, diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 567d0115b..d892c0e7f 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -39,6 +39,7 @@ if (NODE) { var State = require("../../shared/lib/state"); var BusPDP11 = require("./bus"); var MessagesPDP11 = require("./messages"); + var PC11 = require("./pc11"); } /** @@ -137,6 +138,31 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.setReady(); }; +/** + * reset() + * + * @this {DevicePDP11} + */ +DevicePDP11.prototype.reset = function() +{ + this.console.misc = (this.console.misc & ~0x77) | 0x14; // kernel 16 bit + this.kw11.lks = 0; +}; + +/** + * kw11_interrupt() + * + * @this {DevicePDP11} + */ +DevicePDP11.prototype.kw11_interrupt = function() +{ + this.kw11.lks |= PDP11.KW11.LKS.MON; + if (this.kw11.lks & PDP11.KW11.LKS.IE) { + this.cpu.setTrigger(this.kw11.trigger); + this.cpu.setTimer(this.kw11.timer, 1000/60); + } +}; + /** * readLKS(addr) * @@ -1028,33 +1054,6 @@ DevicePDP11.prototype.writeIgnored = function(data, addr) } }; -/** - * kw11_interrupt() - * - * @this {DevicePDP11} - */ -DevicePDP11.prototype.kw11_interrupt = function() -{ - this.kw11.lks |= PDP11.KW11.LKS.MON; - if (this.kw11.lks & PDP11.KW11.LKS.IE) { - this.cpu.setTrigger(this.kw11.trigger); - this.cpu.setTimer(this.kw11.timer, 1000/60); - } -}; - -/** - * reset() - * - * Formerly reset_iopage(). - * - * @this {DevicePDP11} - */ -DevicePDP11.prototype.reset = function() -{ - this.console.misc = (this.console.misc & ~0x77) | 0x14; // kernel 16 bit - this.kw11.lks = 0; -}; - /* * ES6 ALERT: As you can see below, I've finally started using computed property names. */ @@ -1220,11 +1219,16 @@ DevicePDP11.init = function() { var aeDevice = Component.getElementsByClass(document, PDP11.APPCLASS, "device"); for (var iDevice = 0; iDevice < aeDevice.length; iDevice++) { + var device; var eDevice = aeDevice[iDevice]; var parmsDevice = Component.getComponentParms(eDevice); - switch(parmsDevice['name']) { + switch(parmsDevice['type']) { case 'default': - var device = new DevicePDP11(parmsDevice); + device = new DevicePDP11(parmsDevice); + Component.bindComponentControls(device, eDevice, PDP11.APPCLASS); + break; + case 'pc11': + device = new PC11(parmsDevice); Component.bindComponentControls(device, eDevice, PDP11.APPCLASS); break; } diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js new file mode 100644 index 000000000..e1e6f74c8 --- /dev/null +++ b/modules/pdp11/lib/pc11.js @@ -0,0 +1,236 @@ +/** + * @fileoverview Implements the PC11 High-Speed Paper Tape Reader/Punch + * @author Jeff Parsons + * @copyright © Jeff Parsons 2012-2016 + * + * This file is part of PCjs, a computer emulation software project at . + * + * 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 web = require("../../shared/lib/weblib"); + var Component = require("../../shared/lib/component"); + var State = require("../../shared/lib/state"); + var PDP11 = require("./defines"); + var MessagesPDP11 = require("./messages"); +} + +/** + * PC11(parms) + * + * @constructor + * @extends Component + * @param {Object} parms + */ +function PC11(parms) +{ + Component.call(this, "PC11", parms, PC11); + + /* + * TODO: Technically, the PC11 should have a timer that "clocks" data from the abReader buffer into the + * PRB register at the appropriate rate (300 CPS for the high-speed version, 10 CPS for the low-speed version). + */ + this.prs = 0; // PRS register + this.prb = 0; // PRB register + this.iReader = 0; // buffer index + this.abReader = []; // buffer for the PRB register +} + +Component.subclass(PC11); + +/** + * setBinding(sType, sBinding, control, sValue) + * + * @this {PC11} + * @param {string|null} sType is the type of the HTML control (eg, "button", "textarea", "register", "flag", "rled", etc) + * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "buffer") + * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) + * @param {string} [sValue] optional data value + * @return {boolean} true if binding was successful, false if unrecognized binding request + */ +PC11.prototype.setBinding = function(sType, sBinding, control, sValue) +{ + return false; +}; + +/** + * initBus(cmp, bus, cpu, dbg) + * + * @this {PC11} + * @param {ComputerPDP11} cmp + * @param {BusPDP11} bus + * @param {CPUStatePDP11} cpu + * @param {DebuggerPDP11} dbg + */ +PC11.prototype.initBus = function(cmp, bus, cpu, dbg) +{ + this.cmp = cmp; + this.bus = bus; + this.cpu = cpu; + this.dbg = dbg; + this.setReady(); +}; + +/** + * powerUp(data, fRepower) + * + * @this {PC11} + * @param {Object|null} data + * @param {boolean} [fRepower] + * @return {boolean} true if successful, false if failure + */ +PC11.prototype.powerUp = function(data, fRepower) +{ + if (!fRepower) { + if (!data || !this.restore) { + this.reset(); + } else { + if (!this.restore(data)) return false; + } + } + return true; +}; + +/** + * powerDown(fSave, fShutdown) + * + * @this {PC11} + * @param {boolean} [fSave] + * @param {boolean} [fShutdown] + * @return {Object|boolean} component state if fSave; otherwise, true if successful, false if failure + */ +PC11.prototype.powerDown = function(fSave, fShutdown) +{ + return fSave? this.save() : true; +}; + +/** + * reset() + * + * @this {PC11} + */ +PC11.prototype.reset = function() +{ + this.prs &= ~PDP11.PC11.PRS.CLEAR; + this.prb = 0; + this.iReader = 0; + this.abReader = []; +}; + +/** + * save() + * + * This implements save support for the PC11 component. + * + * @this {PC11} + * @return {Object} + */ +PC11.prototype.save = function() +{ + var state = new State(this); + return state.data(); +}; + +/** + * restore(data) + * + * This implements restore support for the PC11 component. + * + * @this {PC11} + * @param {Object} data + * @return {boolean} true if successful, false if failure + */ +PC11.prototype.restore = function(data) +{ + return true; +}; + +/** + * readPRS(addr) + * + * @this {PC11} + * @param {number} addr (eg, PDP11.UNIBUS.PRS or 177550) + * @return {number} + */ +PC11.prototype.readPRS = function(addr) +{ + return this.prs; +}; + +/** + * writePRS(data, addr) + * + * @this {PC11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.PRS or 177550) + */ +PC11.prototype.writePRS = function(data, addr) +{ + if (data & PDP11.PC11.PRS.RE) { + if (this.prs & PDP11.PC11.PRS.ERROR) { + data &= ~PDP11.PC11.PRS.RE; + // if (this.prs & PDP11.PC11.PRS.RIE) { + // TODO: Generate an interrupt + // } + } else { + this.prs &= ~PDP11.PC11.PRS.DONE; + this.prs |= PDP11.PC11.PRS.BUSY; + } + } + this.prs = (this.prs & ~PDP11.PC11.PRS.WMASK) | (data & PDP11.PC11.PRS.WMASK); +}; + +/** + * readPRB(addr) + * + * @this {PC11} + * @param {number} addr (eg, PDP11.UNIBUS.PRB or 177552) + * @return {number} + */ +PC11.prototype.readPRB = function(addr) +{ + return this.prb; +}; + +/** + * writePRB(data, addr) + * + * @this {PC11} + * @param {number} data + * @param {number} addr (eg, PDP11.UNIBUS.PRB or 177552) + */ +PC11.prototype.writePRB = function(data, addr) +{ +}; + +/* + * ES6 ALERT: As you can see below, I've finally started using computed property names. + */ +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"] +}; + +if (NODE) module.exports = PC11; diff --git a/modules/shared/templates/components.xsl b/modules/shared/templates/components.xsl index 7b72d6fb9..35c18170b 100644 --- a/modules/shared/templates/components.xsl +++ b/modules/shared/templates/components.xsl @@ -714,16 +714,16 @@ - + - + device - ,name:'' + ,type:'' diff --git a/package.json b/package.json index d9a488be1..f5171f3ce 100644 --- a/package.json +++ b/package.json @@ -197,6 +197,7 @@ "./modules/pdp11/lib/ram.js", "./modules/pdp11/lib/keyboard.js", "./modules/pdp11/lib/serialport.js", + "./modules/pdp11/lib/pc11.js", "./modules/shared/lib/debugger.js", "./modules/pdp11/lib/debugger.js", "./modules/pdp11/lib/computer.js", diff --git a/versions/pc8080/1.30.1/components.xsl b/versions/pc8080/1.30.1/components.xsl index 1bf53a560..2631d86f2 100644 --- a/versions/pc8080/1.30.1/components.xsl +++ b/versions/pc8080/1.30.1/components.xsl @@ -712,16 +712,16 @@ - + - + device - ,name:'' + ,type:'' diff --git a/versions/pcx86/1.30.1/components.xsl b/versions/pcx86/1.30.1/components.xsl index 3dc004f64..2fdfafed3 100644 --- a/versions/pcx86/1.30.1/components.xsl +++ b/versions/pcx86/1.30.1/components.xsl @@ -712,16 +712,16 @@ - + - + device - ,name:'' + ,type:'' diff --git a/versions/pdpjs/1.30.1/components.xsl b/versions/pdpjs/1.30.1/components.xsl index 0fe803637..2ed955772 100644 --- a/versions/pdpjs/1.30.1/components.xsl +++ b/versions/pdpjs/1.30.1/components.xsl @@ -712,16 +712,16 @@ - + - + device - ,name:'' + ,type:'' diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index 7209829a3..77ffbd639 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -24,11 +24,12 @@ http://pcjs.org/modules/pdp11/lib/ram.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/serialport.js (C) Jeff Parsons 2012-2016 + http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var 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)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function pa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ua(a){return a.replace(/[&<>"']/g,function(a){return ta[a]})}function wa(a,b){return(a+" ").slice(0,b)} @@ -40,216 +41,218 @@ function n(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window. function Ka(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function La(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ma(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.Ua=this.id:(this.Gb=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,jb:!1,Hb:!1,ha:!1,error:!1};this.xb=null;this.v.error=!1;this.J={};this.i=null;this.ia=d||0;t.push(this)}var cb=void 0,db={}; +function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Vb=b.comment;this.pc=b;b=this.id.indexOf(".");0>b?this.Ua=this.id:(this.Gb=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,jb:!1,Hb:!1,ha:!1,error:!1};this.xb=null;this.v.error=!1;this.J={};this.g=null;this.ia=d||0;t.push(this)}var cb=void 0,db={}; if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function u(a,b){b||(b=r);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ib=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ib={},t=[];function jb(a,b,c){ib[a]&&b&&(ib[a][b]=c)}function kb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.A=this.sa-1;this.D=this.H/this.sa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&E(this.i,64)&&B(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&E(this.i,64)&&B(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Qb(a,b){var c=-1,d=this.controller;(a=d.Ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&E(this.i,64)&&B(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&E(this.i,64)&&B(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Vb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.ga;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.w)return m.tb+=m.w-f,m.w=f,!0;if(f>=m.w+m.tb){q=m.size-(f-p);q>g&&(q=g);m.tb=f-m.w+q;f=p+a.sa;g-=q;l++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.sa,d,e);Sb(f,a.i,m);a.W[l++]=f;f=p+a.sa;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ga;0>>=a.ga;0>>this.ga].Cb(a&this.A,a)};h.zb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ga].Jb(a&this.A,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.ga].qa(a&this.A,a)}; -h.mb=function(a){var b=a&this.A,c=(a&this.f)>>>this.ga;this.C++;a=this.W[c].Kb(b,a);this.C--;return a};h.Db=function(a,b){this.W[(a&this.f)>>>this.ga].Fb(a&this.A,b&255,a)};h.rb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ga].Pb(a&this.A,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.ga].ub(a&this.A,b&65535,a)};h.Eb=function(a,b){var c=a&this.A,d=(a&this.f)>>>this.ga;this.C++;this.W[d].Qb(c,b&65535,a);this.C--}; -function kc(a){for(var b=0,c=[],d=0;da.b.Ya)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=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)));lc(a,e,e,g,l,m,p,f[4])}}}function nc(a,b){a.B.push(b)} -function oc(a,b){a.C||(a.i&&E(a.i,536870912)&&B(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.j={data:0,Ld:0,Bb:20,bd:0};this.f={Md:0,Ob:-1}}u(K);h=K.prototype; -h.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;var e=this;this.f.Ob=pc(c,function(){e.f.Ia|=128;e.f.Ia&64&&(qc(e.b,e.f.cd),rc(e.b,e.f.Ob,1E3/60))});this.f.cd=sc(64,6);mc(b,this,L);nc(b,this.reset.bind(this));G(this)};h.Ac=function(){var a=this.f.Ia;this.f.Ia&=-129;return a};h.md=function(a){this.f.Ia=a;a&64&&rc(this.b,this.f.Ob,1E3/60);this.f.Ia=a&-129};h.tc=function(a){return(a?this.j.bd:this.j.data)&65535};h.ed=function(a){this.j.data=a}; -h.Cc=function(){var a=this.b;return a.G&62337|a.ua<<5|a.va<<1};h.od=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ua=a>>5&3;b.va=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ja!=c&&(b.Ja=c,tc(b))}uc(this)};h.Dc=function(){var a=this.b.La;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ec=function(){return this.b.qb};h.Fc=function(){return this.b.Ma};h.pd=function(a){var b=this.b;1170>b.Ya&&(a&=-49);b.Ma!=a&&(b.Ma=a,a&16?(b.Wa=4194303,b.wa=3915776):(b.Wa=262143,b.wa=253952),tc(b));uc(this)}; -function uc(a){a.j.Bb=a.j.Bb&-8|(a.b.Ja?a.b.Ma&16?1:2:4)}h.Rc=function(a){return this.b.P[1][a>>1&7]};h.Bd=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Pc=function(a){return this.b.P[1][(a>>1&7)+8]};h.zd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Qc=function(a){return this.b.pa[1][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.b.pa[1][b]=a;this.b.P[1][b]&=65295};h.Oc=function(a){return this.b.pa[1][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.b.pa[1][b]=a;this.b.P[1][b]&=65295}; -h.zc=function(a){return this.b.P[0][a>>1&7]};h.ld=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.xc=function(a){return this.b.P[0][(a>>1&7)+8]};h.jd=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.yc=function(a){return this.b.pa[0][a>>1&7]};h.kd=function(a,b){b=b>>1&7;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.wc=function(a){return this.b.pa[0][(a>>1&7)+8]};h.hd=function(a,b){b=(b>>1&7)+8;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.Xc=function(a){return this.b.P[3][a>>1&7]}; -h.Hd=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.Vc=function(a){return this.b.P[3][(a>>1&7)+8]};h.Fd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Wc=function(a){return this.b.pa[3][a>>1&7]};h.Gd=function(a,b){b=b>>1&7;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.Uc=function(a){return this.b.pa[3][(a>>1&7)+8]};h.Ed=function(a,b){b=(b>>1&7)+8;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.bb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]}; -h.gb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Ic=function(){return this.b.L&49152?this.b.ta[0]:this.b.u[6]};h.sd=function(a){this.b.L&49152?this.b.ta[0]=a:this.b.u[6]=a};h.Lc=function(){return this.b.u[7]};h.vd=function(a){this.b.u[7]=a};h.cb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]};h.hb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Jc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.ta[1]}; -h.td=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ta[1]=a};h.Kc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.ta[3]};h.ud=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ta[3]=a};h.vc=function(a){return this.b.cc[a-65504>>1]};h.gd=function(a,b){this.b.cc[b-65504>>1]=a};h.$b=function(a){return 65520==a?61183:0};h.fc=function(){};h.Tc=function(){return 1};h.Dd=function(){};h.uc=function(){return this.b.Z};h.fd=function(){this.b.Z=0};h.Bc=function(){return this.b.bc}; -h.nd=function(a,b){b&1||(a&=255);this.b.bc=a};h.Gc=function(a){return a?this.b.Mb:0};h.qd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Mb=a;b.F|=2};h.Sc=function(a){return a?this.b.Na&65280:0};h.Cd=function(a){this.b.Na=a|255};h.Hc=function(){return Lb(this.b)};h.rd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.F|=128};h.ec=function(a,b){E(this)&&B(this,"writeIgnored("+oa(b)+"): "+oa(a),!0,!0)};h.reset=function(){this.j.Bb=this.j.Bb&-120|20;this.f.Ia=0}; -var M={},L=(M[62592]=[null,null,K.prototype.Rc,K.prototype.Bd,"SISDR",1145],M[62608]=[null,null,K.prototype.Pc,K.prototype.zd,"SDSDR",1145],M[62624]=[null,null,K.prototype.Qc,K.prototype.Ad,"SISAR",1145],M[62640]=[null,null,K.prototype.Oc,K.prototype.yd,"SDSAR",1145],M[62656]=[null,null,K.prototype.zc,K.prototype.ld,"KISDR",1145],M[62672]=[null,null,K.prototype.xc,K.prototype.jd,"KDSDR",1145],M[62688]=[null,null,K.prototype.yc,K.prototype.kd,"KISAR",1145],M[62704]=[null,null,K.prototype.wc,K.prototype.hd, -"KDSAR",1145],M[62798]=[null,null,K.prototype.Fc,K.prototype.pd,"MMR3",1145],M[65382]=[null,null,K.prototype.Ac,K.prototype.md,"LKS"],M[65400]=[null,null,K.prototype.tc,K.prototype.ed,"CNSL"],M[65402]=[null,null,K.prototype.Cc,K.prototype.od,"MMR0",1145],M[65404]=[null,null,K.prototype.Dc,K.prototype.ec,"MMR1",1145],M[65406]=[null,null,K.prototype.Ec,K.prototype.ec,"MMR2",1145],M[65408]=[null,null,K.prototype.Xc,K.prototype.Hd,"UISDR",1145],M[65424]=[null,null,K.prototype.Vc,K.prototype.Fd,"UDSDR", -1145],M[65440]=[null,null,K.prototype.Wc,K.prototype.Gd,"UISAR",1145],M[65456]=[null,null,K.prototype.Uc,K.prototype.Ed,"UDSAR",1145],M[65472]=[null,null,K.prototype.bb,K.prototype.gb,"R0SET0"],M[65473]=[null,null,K.prototype.bb,K.prototype.gb,"R1SET0"],M[65474]=[null,null,K.prototype.bb,K.prototype.gb,"R2SET0"],M[65475]=[null,null,K.prototype.bb,K.prototype.gb,"R3SET0"],M[65476]=[null,null,K.prototype.bb,K.prototype.gb,"R4SET0"],M[65477]=[null,null,K.prototype.bb,K.prototype.gb,"R5SET0"],M[65478]= -[null,null,K.prototype.Ic,K.prototype.sd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Lc,K.prototype.vd,"R7KERNEL"],M[65480]=[null,null,K.prototype.cb,K.prototype.hb,"R0SET1",1145],M[65481]=[null,null,K.prototype.cb,K.prototype.hb,"R1SET1",1145],M[65482]=[null,null,K.prototype.cb,K.prototype.hb,"R2SET1",1145],M[65483]=[null,null,K.prototype.cb,K.prototype.hb,"R3SET1",1145],M[65484]=[null,null,K.prototype.cb,K.prototype.hb,"R4SET1",1145],M[65485]=[null,null,K.prototype.cb,K.prototype.hb,"R5SET1",1145], -M[65486]=[null,null,K.prototype.Jc,K.prototype.td,"R6SUPER",1145],M[65487]=[null,null,K.prototype.Kc,K.prototype.ud,"R6USER",1145],M[65504]=[null,null,K.prototype.vc,K.prototype.gd,"CTRL",1170],M[65520]=[null,null,K.prototype.$b,K.prototype.fc,"LSIZE",1170],M[65522]=[null,null,K.prototype.$b,K.prototype.fc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Tc,K.prototype.Dd,"SYSID",1170],M[65526]=[null,null,K.prototype.uc,K.prototype.fd,"CPUERR",1170],M[65528]=[null,null,K.prototype.Bc,K.prototype.nd, -"MB",1170],M[65530]=[null,null,K.prototype.Gc,K.prototype.qd,"PIR"],M[65532]=[null,null,K.prototype.Sc,K.prototype.Cd,"SL"],M[65534]=[null,null,K.prototype.Hc,K.prototype.rd,"PSW"],M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624]; -L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688]; -L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440]; -L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456];L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];Ta(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),Cc(this,yc?Dc:Ec);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ja:function(a,b){a&1&&oc(this.A,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},ua: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.Ha=!0},T:function(a,b){if(this.i&&null!=this.w){var c=this.i;Jc(c,this.w+a,1,c.M)&&c.da(!0)}return this.Jb(a,b)},ba:function(a,b){if(this.i&&null!=this.w){var c=this.i;Jc(c,this.w+a,2,c.M)&&c.da(!0)}return this.Kb(a,b)},ma:function(a,b,c){if(this.i&&null!=this.w){var d=this.i;Jc(d,this.w+a, -1,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Pb(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.w){var d=this.i;Jc(d,this.w+a,2,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Qb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&E(this.i,128)&&B(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},aa:function(a,b){a&1&&oc(this.A,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&oc(this.A,b);a=this.I[a>>1];this.i&&E(this.i,128)&&B(this.i,"Memory.readWord("+ -J(this.i,b)+"): "+J(this.i,a),!0);return a},la:function(a,b){this.D[a]=b;this.Ha=!0},oa:function(a,b,c){this.D[a]=b;this.Ha=!0;this.i&&E(this.i,128)&&B(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&oc(this.A,c);this.G.setUint16(a,b,!0);this.Ha=!0},Ua:function(a,b,c){a&1&&oc(this.A,c);this.I[a>>1]=b;this.Ha=!0;this.i&&E(this.i,128)&&B(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; -function Sb(a,b,c){a.i=b;a.j=a.B=0;c&&((a.j=c.j)&&Ic(a,Hc,!1),(a.B=c.B)&&Gc(a,Hc,!1))}function Kc(a,b){b?--a.B||(a.Fb=a.f?a.J:a.Pb,a.ub=a.f?a.H:a.Qb):--a.j||(a.Cb=a.Jb,a.qa=a.Kb)}function Gc(a,b,c){c&&a.B||(a.Fb=!a.f&&b[1]||a.J,a.ub=!a.f&&b[3]||a.H);if(c||void 0===c)a.Pb=b[1]||a.J,a.Qb=b[3]||a.H}function Ic(a,b,c){c&&a.j||(a.Cb=b[0]||a.K,a.qa=b[2]||a.M);if(c||void 0===c)a.Jb=b[0]||a.K,a.Kb=b[2]||a.M}function Cc(a,b){b||(b=Lc);Ic(a,b,void 0);Gc(a,b,void 0)} -var Lc=[],Fc=[I.prototype.V,I.prototype.ua,I.prototype.ja,I.prototype.xa],Hc=[I.prototype.T,I.prototype.ma,I.prototype.ba,I.prototype.wa];if(Gb)var Ec=[I.prototype.R,I.prototype.la,I.prototype.aa,I.prototype.va],Dc=[I.prototype.U,I.prototype.oa,I.prototype.fa,I.prototype.Ua]; -function Mc(a,b){r.call(this,"CPU",a,Mc,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.Ka=c;this.Va=Math.round(this.Fa/1E4)/100;this.Ra=this.Va*this.Ka;this.v.ca=!1;this.v.Nb=!1;this.v.ib=a.autoStart;this.v.Xa=!1;this.nb=this.ja=0;this.ob=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.K=[];this.Ab=this.ad.bind(this);G(this)}u(Mc);var Nc=["power","reset"];h=Mc.prototype; -h.Da=function(a,b,c,d){this.B=a;this.A=b;this.i=d;for(b=0;b=a.ja&&(a.ja+=a.Za,c=!0);0<=a.$a&&a.$a<=Tc(a)&&(a.Za=a.$a=-1,Qc(a),a.da(),c=!0);c&&a.g(Tc(a)+" cycles: checksum="+k(a.nb))}} -h.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,l=kb(a.id);for(c=0;c>2;this.w=this.sa-1;this.D=this.H/this.sa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Nb,Ob,Pb,Qb];a=new J(this);Rb(a,this.g);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.g&&G(this.g,64)&&E(this.g,e[4]+".readByte("+K(this.g,b)+"): "+K(this.g,c),!0,!0),c;c=Tb(d,b,!0);this.g&&G(this.g,64)&&E(this.g,"warning: unconverted read access to byte @"+K(this.g,b)+": "+K(this.g,c),!0,!0);return c} +function Ob(a,b,c){var d=!1,e=this.controller,f=e.Ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.g&&G(this.g,64)&&E(this.g,f[4]+".writeByte("+K(this.g,c)+","+K(this.g,b)+")",!0,!0):(Tb(e,c,!0,b),this.g&&G(this.g,64)&&E(this.g,"warning: unconverted write access to byte @"+K(this.g,c)+": "+K(this.g,b),!0,!0))} +function Pb(a,b){var c=-1,d=this.controller;(a=d.Ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.g&&G(this.g,64)&&E(this.g,a[4]+".readWord("+K(this.g,b)+"): "+K(this.g,c),!0,!0),c;c=Tb(d,b,!1);this.g&&G(this.g,64)&&E(this.g,"warning: unconverted read access to word @"+K(this.g,b)+": "+K(this.g,c),!0,!0);return c} +function Qb(a,b,c){var d=!1,e=this.controller;if(a=e.Ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.g&&G(this.g,64)&&E(this.g,a[4]+".writeWord("+K(this.g,c)+","+K(this.g,b)+")",!0,!0):(Tb(e,c,!1,b),this.g&&G(this.g,64)&&E(this.g,"warning: unconverted write access to word @"+K(this.g,c)+": "+K(this.g,b),!0,!0))} +function Ub(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.ga;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.tb+=m.A-f,m.A=f,!0;if(f>=m.A+m.tb){q=m.size-(f-p);q>g&&(q=g);m.tb=f-m.A+q;f=p+a.sa;g-=q;l++;continue}}return $b(1,f,g)}f=new J(a,f,q,a.sa,d,e);Rb(f,a.g,m);a.W[l++]=f;f=p+a.sa;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ga;0>>=a.ga;0>>this.ga].Cb(a&this.w,a)};h.zb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ga].Jb(a&this.w,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.ga].ra(a&this.w,a)}; +h.mb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ga;this.C++;a=this.W[c].Kb(b,a);this.C--;return a};h.Db=function(a,b){this.W[(a&this.f)>>>this.ga].Fb(a&this.w,b&255,a)};h.rb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ga].Pb(a&this.w,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.ga].ub(a&this.w,b&65535,a)};h.Eb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ga;this.C++;this.W[d].Qb(c,b&65535,a);this.C--}; +function bc(a){for(var b=0,c=[],d=0;da.b.Ya)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=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)));kc(a,e,e,g,l,m,p,f[4])}}}function mc(a,b){a.B.push(b)} +function nc(a,b){a.C||(a.g&&G(a.g,536870912)&&E(a.g,"memory fault on address "+K(a.g,b),!0,!0),a.b.ea(4,b))}function $b(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function L(a){r.call(this,"Device",a,L,256);this.j={data:0,Ld:0,Bb:20,bd:0};this.f={Md:0,Ob:-1}}u(L);h=L.prototype; +h.Ba=function(a,b,c,d){this.w=b;this.b=c;this.g=d;var e=this;this.f.Ob=oc(c,function(){e.f.Ia|=128;e.f.Ia&64&&(pc(e.b,e.f.cd),qc(e.b,e.f.Ob,1E3/60))});this.f.cd=rc(64,6);lc(b,this,M);mc(b,this.reset.bind(this));H(this)};h.reset=function(){this.j.Bb=this.j.Bb&-120|20;this.f.Ia=0};h.Ac=function(){var a=this.f.Ia;this.f.Ia&=-129;return a};h.md=function(a){this.f.Ia=a;a&64&&qc(this.b,this.f.Ob,1E3/60);this.f.Ia=a&-129};h.tc=function(a){return(a?this.j.bd:this.j.data)&65535}; +h.ed=function(a){this.j.data=a};h.Cc=function(){var a=this.b;return a.G&62337|a.ua<<5|a.va<<1};h.od=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ua=a>>5&3;b.va=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ja!=c&&(b.Ja=c,sc(b))}tc(this)};h.Dc=function(){var a=this.b.La;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ec=function(){return this.b.qb};h.Fc=function(){return this.b.Ma}; +h.pd=function(a){var b=this.b;1170>b.Ya&&(a&=-49);b.Ma!=a&&(b.Ma=a,a&16?(b.Wa=4194303,b.wa=3915776):(b.Wa=262143,b.wa=253952),sc(b));tc(this)};function tc(a){a.j.Bb=a.j.Bb&-8|(a.b.Ja?a.b.Ma&16?1:2:4)}h.Rc=function(a){return this.b.P[1][a>>1&7]};h.Bd=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Pc=function(a){return this.b.P[1][(a>>1&7)+8]};h.zd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Qc=function(a){return this.b.qa[1][a>>1&7]}; +h.Ad=function(a,b){b=b>>1&7;this.b.qa[1][b]=a;this.b.P[1][b]&=65295};h.Oc=function(a){return this.b.qa[1][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.b.qa[1][b]=a;this.b.P[1][b]&=65295};h.zc=function(a){return this.b.P[0][a>>1&7]};h.ld=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.xc=function(a){return this.b.P[0][(a>>1&7)+8]};h.jd=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.yc=function(a){return this.b.qa[0][a>>1&7]};h.kd=function(a,b){b=b>>1&7;this.b.qa[0][b]=a;this.b.P[0][b]&=65295}; +h.wc=function(a){return this.b.qa[0][(a>>1&7)+8]};h.hd=function(a,b){b=(b>>1&7)+8;this.b.qa[0][b]=a;this.b.P[0][b]&=65295};h.Xc=function(a){return this.b.P[3][a>>1&7]};h.Hd=function(a,b){this.b.P[3][b>>1&7]=a&65295};h.Vc=function(a){return this.b.P[3][(a>>1&7)+8]};h.Fd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Wc=function(a){return this.b.qa[3][a>>1&7]};h.Gd=function(a,b){b=b>>1&7;this.b.qa[3][b]=a;this.b.P[3][b]&=65295};h.Uc=function(a){return this.b.qa[3][(a>>1&7)+8]}; +h.Ed=function(a,b){b=(b>>1&7)+8;this.b.qa[3][b]=a;this.b.P[3][b]&=65295};h.bb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.gb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};h.Ic=function(){return this.b.L&49152?this.b.ta[0]:this.b.u[6]};h.sd=function(a){this.b.L&49152?this.b.ta[0]=a:this.b.u[6]=a};h.Lc=function(){return this.b.u[7]};h.vd=function(a){this.b.u[7]=a};h.cb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; +h.hb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Jc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.ta[1]};h.td=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ta[1]=a};h.Kc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.ta[3]};h.ud=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ta[3]=a};h.vc=function(a){return this.b.cc[a-65504>>1]};h.gd=function(a,b){this.b.cc[b-65504>>1]=a};h.$b=function(a){return 65520==a?61183:0};h.fc=function(){}; +h.Tc=function(){return 1};h.Dd=function(){};h.uc=function(){return this.b.Z};h.fd=function(){this.b.Z=0};h.Bc=function(){return this.b.bc};h.nd=function(a,b){b&1||(a&=255);this.b.bc=a};h.Gc=function(a){return a?this.b.Mb:0};h.qd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Mb=a;b.F|=2};h.Sc=function(a){return a?this.b.Na&65280:0};h.Cd=function(a){this.b.Na=a|255};h.Hc=function(){return Kb(this.b)};h.rd=function(a){uc(this.b,a&-1809|Kb(this.b)&1808);this.b.F|=128}; +h.ec=function(a,b){G(this)&&E(this,"writeIgnored("+oa(b)+"): "+oa(a),!0,!0)}; +var N={},M=(N[62592]=[null,null,L.prototype.Rc,L.prototype.Bd,"SISDR",1145],N[62608]=[null,null,L.prototype.Pc,L.prototype.zd,"SDSDR",1145],N[62624]=[null,null,L.prototype.Qc,L.prototype.Ad,"SISAR",1145],N[62640]=[null,null,L.prototype.Oc,L.prototype.yd,"SDSAR",1145],N[62656]=[null,null,L.prototype.zc,L.prototype.ld,"KISDR",1145],N[62672]=[null,null,L.prototype.xc,L.prototype.jd,"KDSDR",1145],N[62688]=[null,null,L.prototype.yc,L.prototype.kd,"KISAR",1145],N[62704]=[null,null,L.prototype.wc,L.prototype.hd, +"KDSAR",1145],N[62798]=[null,null,L.prototype.Fc,L.prototype.pd,"MMR3",1145],N[65382]=[null,null,L.prototype.Ac,L.prototype.md,"LKS"],N[65400]=[null,null,L.prototype.tc,L.prototype.ed,"CNSL"],N[65402]=[null,null,L.prototype.Cc,L.prototype.od,"MMR0",1145],N[65404]=[null,null,L.prototype.Dc,L.prototype.ec,"MMR1",1145],N[65406]=[null,null,L.prototype.Ec,L.prototype.ec,"MMR2",1145],N[65408]=[null,null,L.prototype.Xc,L.prototype.Hd,"UISDR",1145],N[65424]=[null,null,L.prototype.Vc,L.prototype.Fd,"UDSDR", +1145],N[65440]=[null,null,L.prototype.Wc,L.prototype.Gd,"UISAR",1145],N[65456]=[null,null,L.prototype.Uc,L.prototype.Ed,"UDSAR",1145],N[65472]=[null,null,L.prototype.bb,L.prototype.gb,"R0SET0"],N[65473]=[null,null,L.prototype.bb,L.prototype.gb,"R1SET0"],N[65474]=[null,null,L.prototype.bb,L.prototype.gb,"R2SET0"],N[65475]=[null,null,L.prototype.bb,L.prototype.gb,"R3SET0"],N[65476]=[null,null,L.prototype.bb,L.prototype.gb,"R4SET0"],N[65477]=[null,null,L.prototype.bb,L.prototype.gb,"R5SET0"],N[65478]= +[null,null,L.prototype.Ic,L.prototype.sd,"R6KERNEL"],N[65479]=[null,null,L.prototype.Lc,L.prototype.vd,"R7KERNEL"],N[65480]=[null,null,L.prototype.cb,L.prototype.hb,"R0SET1",1145],N[65481]=[null,null,L.prototype.cb,L.prototype.hb,"R1SET1",1145],N[65482]=[null,null,L.prototype.cb,L.prototype.hb,"R2SET1",1145],N[65483]=[null,null,L.prototype.cb,L.prototype.hb,"R3SET1",1145],N[65484]=[null,null,L.prototype.cb,L.prototype.hb,"R4SET1",1145],N[65485]=[null,null,L.prototype.cb,L.prototype.hb,"R5SET1",1145], +N[65486]=[null,null,L.prototype.Jc,L.prototype.td,"R6SUPER",1145],N[65487]=[null,null,L.prototype.Kc,L.prototype.ud,"R6USER",1145],N[65504]=[null,null,L.prototype.vc,L.prototype.gd,"CTRL",1170],N[65520]=[null,null,L.prototype.$b,L.prototype.fc,"LSIZE",1170],N[65522]=[null,null,L.prototype.$b,L.prototype.fc,"HSIZE",1170],N[65524]=[null,null,L.prototype.Tc,L.prototype.Dd,"SYSID",1170],N[65526]=[null,null,L.prototype.uc,L.prototype.fd,"CPUERR",1170],N[65528]=[null,null,L.prototype.Bc,L.prototype.nd, +"MB",1170],N[65530]=[null,null,L.prototype.Gc,L.prototype.qd,"PIR"],N[65532]=[null,null,L.prototype.Sc,L.prototype.Cd,"SL"],N[65534]=[null,null,L.prototype.Hc,L.prototype.rd,"PSW"],N);M[62594]=M[62592];M[62596]=M[62592];M[62598]=M[62592];M[62600]=M[62592];M[62602]=M[62592];M[62604]=M[62592];M[62606]=M[62592];M[62610]=M[62608];M[62612]=M[62608];M[62614]=M[62608];M[62616]=M[62608];M[62618]=M[62608];M[62620]=M[62608];M[62622]=M[62608];M[62626]=M[62624];M[62628]=M[62624];M[62630]=M[62624];M[62632]=M[62624]; +M[62634]=M[62624];M[62636]=M[62624];M[62638]=M[62624];M[62642]=M[62640];M[62644]=M[62640];M[62646]=M[62640];M[62648]=M[62640];M[62650]=M[62640];M[62652]=M[62640];M[62654]=M[62640];M[62658]=M[62656];M[62660]=M[62656];M[62662]=M[62656];M[62664]=M[62656];M[62666]=M[62656];M[62668]=M[62656];M[62670]=M[62656];M[62674]=M[62672];M[62676]=M[62672];M[62678]=M[62672];M[62680]=M[62672];M[62682]=M[62672];M[62684]=M[62672];M[62686]=M[62672];M[62690]=M[62688];M[62692]=M[62688];M[62694]=M[62688];M[62696]=M[62688]; +M[62698]=M[62688];M[62700]=M[62688];M[62702]=M[62688];M[62706]=M[62704];M[62708]=M[62704];M[62710]=M[62704];M[62712]=M[62704];M[62714]=M[62704];M[62716]=M[62704];M[62718]=M[62704];M[65410]=M[65408];M[65412]=M[65408];M[65414]=M[65408];M[65416]=M[65408];M[65418]=M[65408];M[65420]=M[65408];M[65422]=M[65408];M[65426]=M[65424];M[65428]=M[65424];M[65430]=M[65424];M[65432]=M[65424];M[65434]=M[65424];M[65436]=M[65424];M[65438]=M[65424];M[65442]=M[65440];M[65444]=M[65440];M[65446]=M[65440];M[65448]=M[65440]; +M[65450]=M[65440];M[65452]=M[65440];M[65454]=M[65440];M[65458]=M[65456];M[65460]=M[65456];M[65462]=M[65456];M[65464]=M[65456];M[65466]=M[65456];M[65468]=M[65456];M[65470]=M[65456];M[65506]=M[65504];M[65508]=M[65504];M[65510]=M[65504];M[65512]=M[65504];M[65514]=M[65504];M[65516]=M[65504];M[65518]=M[65504];Ta(function(){for(var a=B(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,d>>2),Cc(this,yc?Dc:Ec);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ja:function(a,b){a&1&&nc(this.w,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},ua: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.Ha=!0},T:function(a,b){if(this.g&&null!=this.A){var c=this.g;Jc(c,this.A+a,1,c.M)&&c.da(!0)}return this.Jb(a,b)},ba:function(a,b){if(this.g&&null!=this.A){var c=this.g;Jc(c,this.A+a,2,c.M)&&c.da(!0)}return this.Kb(a,b)},ma:function(a,b,c){if(this.g&&null!=this.A){var d=this.g;Jc(d,this.A+a, +1,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Pb(a,b,c)},wa:function(a,b,c){if(this.g&&null!=this.A){var d=this.g;Jc(d,this.A+a,2,d.D)&&d.da(!0)}this.f?this.J(a,b,c):this.Qb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.g&&G(this.g,128)&&E(this.g,"Memory.readByte("+K(this.g,b)+"): "+K(this.g,a),!0);return a},aa:function(a,b){a&1&&nc(this.w,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&nc(this.w,b);a=this.I[a>>1];this.g&&G(this.g,128)&&E(this.g,"Memory.readWord("+ +K(this.g,b)+"): "+K(this.g,a),!0);return a},la:function(a,b){this.D[a]=b;this.Ha=!0},pa:function(a,b,c){this.D[a]=b;this.Ha=!0;this.g&&G(this.g,128)&&E(this.g,"Memory.writeByte("+K(this.g,c)+","+K(this.g,b)+")",!0)},va:function(a,b,c){a&1&&nc(this.w,c);this.G.setUint16(a,b,!0);this.Ha=!0},Ua:function(a,b,c){a&1&&nc(this.w,c);this.I[a>>1]=b;this.Ha=!0;this.g&&G(this.g,128)&&E(this.g,"Memory.writeWord("+K(this.g,c)+","+K(this.g,b)+")",!0)}}; +function Rb(a,b,c){a.g=b;a.j=a.B=0;c&&((a.j=c.j)&&Ic(a,Hc,!1),(a.B=c.B)&&Gc(a,Hc,!1))}function Kc(a,b){b?--a.B||(a.Fb=a.f?a.J:a.Pb,a.ub=a.f?a.H:a.Qb):--a.j||(a.Cb=a.Jb,a.ra=a.Kb)}function Gc(a,b,c){c&&a.B||(a.Fb=!a.f&&b[1]||a.J,a.ub=!a.f&&b[3]||a.H);if(c||void 0===c)a.Pb=b[1]||a.J,a.Qb=b[3]||a.H}function Ic(a,b,c){c&&a.j||(a.Cb=b[0]||a.K,a.ra=b[2]||a.M);if(c||void 0===c)a.Jb=b[0]||a.K,a.Kb=b[2]||a.M}function Cc(a,b){b||(b=Lc);Ic(a,b,void 0);Gc(a,b,void 0)} +var Lc=[],Fc=[J.prototype.V,J.prototype.ua,J.prototype.ja,J.prototype.za],Hc=[J.prototype.T,J.prototype.ma,J.prototype.ba,J.prototype.wa];if(Fb)var Ec=[J.prototype.R,J.prototype.la,J.prototype.aa,J.prototype.va],Dc=[J.prototype.U,J.prototype.pa,J.prototype.fa,J.prototype.Ua]; +function Mc(a,b){r.call(this,"CPU",a,Mc,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.Ka=c;this.Va=Math.round(this.Fa/1E4)/100;this.Ra=this.Va*this.Ka;this.v.ca=!1;this.v.Nb=!1;this.v.ib=a.autoStart;this.v.Xa=!1;this.nb=this.ja=0;this.ob=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.K=[];this.Ab=this.ad.bind(this);H(this)}u(Mc);var Nc=["power","reset"];h=Mc.prototype; +h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.g=d;for(b=0;b=a.ja&&(a.ja+=a.Za,c=!0);0<=a.$a&&a.$a<=Tc(a)&&(a.Za=a.$a=-1,Qc(a),a.da(),c=!0);c&&a.i(Tc(a)+" cycles: checksum="+k(a.nb))}} +h.oa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,l=kb(a.id);for(c=0;ca.V/a.Ra?b=1:d=!0;a.Ka=b;b=a.Va*a.Ka;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.B&&a.B.sb()}Vc(a,a.T);a.T=0;a.R=Aa();a.aa=0;Wc(a);return d}function pc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function rc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Fa*a.Ka/1E3*c|0,a.K[b][0]=c+Xc(a))} -function Yc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function rd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Xc(a,b){var c=a.ba-=a.b;a.b=0;b&&(a.ba=0);return c} -h.ad=function(){if(this.v.ca){this.kb>=this.Fa&&Wc(this,!0);this.oa=0;this.xa=Aa();if(this.aa){var a=this.xa-this.aa;a>this.wb&&(this.R+=a,this.R>this.xa&&(this.R=this.xa))}try{do{var b=Yc(this,this.v.Xa?1:this.Oa);try{this.fb(b)}catch(e){if("number"!=typeof e)throw e;}b=Xc(this,!0);this.oa+=b;this.T+=b;Sc(this,b);rd(this,b);this.la-=b;if(0>=this.la){this.la+=this.Oa;15<=++this.yb&&(this.B&&this.B.$(),this.yb=0);break}}while(this.v.ca)}catch(e){this.da();this.B&&this.B.stop(Aa(),Tc(this));Fb(this, -e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.Ab;this.aa=Aa();var c=this.wb;this.oa&&(c=Math.round(c*this.oa/this.Oa));var c=c-(this.aa-this.xa),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Uc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.kb+=this.oa;this.aa+=c;a(b,c)}}}; -h.eb=function(a){if(rb(this))return!1;if(this.v.ca)return this.g(this.toString()+" busy"),!1;Uc(this);this.v.ca=!0;this.v.Nb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,Tc(this)));setTimeout(this.Ab,0);return!0};h.fb=function(){return 0};h.da=function(a){if(this.v.ca){Xc(this);Vc(this,this.T);this.T=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(Aa(),Tc(this))}this.v.complete=a}; +function Pc(a){a.V=0;a.yb=0;a.fa=a.T=a.ba=a.b=0;Qc(a);Uc(a,1)}function Uc(a,b,c){var d=!1;if(void 0!==b){.8>a.V/a.Ra?b=1:d=!0;a.Ka=b;b=a.Va*a.Ka;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.sb()}Vc(a,a.T);a.T=0;a.R=Aa();a.aa=0;Wc(a);return d}function oc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function qc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Fa*a.Ka/1E3*c|0,a.K[b][0]=c+Xc(a))} +function Yc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Xc(a,b){var c=a.ba-=a.b;a.b=0;b&&(a.ba=0);return c} +h.ad=function(){if(this.v.ca){this.kb>=this.Fa&&Wc(this,!0);this.pa=0;this.za=Aa();if(this.aa){var a=this.za-this.aa;a>this.wb&&(this.R+=a,this.R>this.za&&(this.R=this.za))}try{do{var b=Yc(this,this.v.Xa?1:this.Oa);try{this.fb(b)}catch(e){if("number"!=typeof e)throw e;}b=Xc(this,!0);this.pa+=b;this.T+=b;Sc(this,b);Zc(this,b);this.la-=b;if(0>=this.la){this.la+=this.Oa;15<=++this.yb&&(this.B&&this.B.$(),this.yb=0);break}}while(this.v.ca)}catch(e){this.da();this.B&&this.B.stop(Aa(),Tc(this));rb(this, +e.stack||e.message);return}if(this.v.ca){a=setTimeout;b=this.Ab;this.aa=Aa();var c=this.wb;this.pa&&(c=Math.round(c*this.pa/this.Oa));var c=c-(this.aa-this.za),d=this.aa-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Uc(this)));if(0>c||this.Vc&&(this.R-=c),c=0;this.kb+=this.pa;this.aa+=c;a(b,c)}}}; +h.eb=function(a){if(qb(this))return!1;if(this.v.ca)return this.i(this.toString()+" busy"),!1;Uc(this);this.v.ca=!0;this.v.Nb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,Tc(this)));setTimeout(this.Ab,0);return!0};h.fb=function(){return 0};h.da=function(a){if(this.v.ca){Xc(this);Vc(this,this.T);this.T=0;this.v.ca=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(Aa(),Tc(this))}this.v.complete=a}; function sd(a){this.Ya=+a.model||1170;this.qc=a.resetAddr||0;Mc.call(this,a,6666667);this.decode=1120==this.Ya?td.bind(this):ud.bind(this);vd(this);this.C=0;this.U=null;this.v.complete=this.v.kc=!1}u(sd,Mc);h=sd.prototype;h.reset=function(){this.status("model "+this.Ya);this.v.ca&&this.da();vd(this);Pc(this);this.v.error=!1;this.parent.reset.call(this)}; -function vd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.qc];a.Ea=[0,0,0,0,0,0];a.ta=[0,0,0,0];a.D=0;a.va=0;a.oc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.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],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.rc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.cc=[0,0,0,0,0,0,0,0];a.bc=0;a.F=0;a.H=a.I=0;a.j=a.f=a.Ta=0;a.ma=-1;wd(a)}function wd(a){a.Na=255;a.Z=0;a.Mb=0;a.G=0;a.La=0;a.qb=0;a.Ma=0;a.Ja=0;a.ua=0;a.Wa=262143;a.wa=253952;a.F|=2;a.A&&tc(a)}function tc(a){a.Ja?(a.M=65536,a.Y=a.nc,a.qa=a.Yc,a.ub=a.Id,Vb(a.A,a.Ma&16?22:18)):(a.M=0,a.Y=a.mc,a.qa=a.ac,a.ub=a.gc,Vb(a.A,16))}h.Wb=function(){return 0}; -h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.Ka]);a.set(2,kc(this.A));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Uc(this,b[3]);a:{b=this.A;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.D!=c&&(a.ta[c]=a.u[6],a.u[6]=a.ta[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function Bd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function Cd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function Dd(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function Ed(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))} -h.ea=function(a,b){if(!this.C){var c=!1;0>this.ma?this.ma=Lb(this):this.D||(a=4,c=!0);this.G&57344||(this.La=63222,this.qb=a);this.D=0;var d=this.qa(a|this.M),e=this.qa(a+2&65535|this.M);vc(this,e&-12289|this.ma>>2&12288);c&&(this.Z|=4,this.u[6]=4);Fd(this,this.ma);Fd(this,this.u[7]);Ad(this,d);this.F&=-113;this.ma=-1;if(26!=b)throw a;}};function Gd(a){var b=Hd(a),c=Hd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);Ad(a,b);vc(a,c);a.F&=-17} -function Id(a,b,c){var d,e,f,g=0;d=b>>13;a.Ma&a.oc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.pa[a.D][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ma&32&&(f=a.rc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.wa&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? -192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.ua=a.D,a.va=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ua<<5|a.va<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.qa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.qa(e)|g; -a.b-=8;break;case 6:return e=zd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=zd(a),e=e+a.u[c]&65535,e=a.qa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.La=a.La<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.zb=function(a){if(!this.Ja)return this.A.zb(a);this.C++;a=Jd(this,Id(this,a,3));this.C--;return a}; -h.mb=function(a){if(!this.Ja)return this.A.mb(a);this.C++;a=this.ac(Id(this,a,2));this.C--;return a};h.rb=function(a,b){this.Ja?(this.C++,Kd(this,Id(this,a,5),b),this.C--):this.A.rb(a,b)};h.Eb=function(a,b){this.Ja?(this.C++,this.gc(Id(this,a,4),b),this.C--):this.A.Eb(a,b)};h.mc=function(a,b,c){return Ld(this,a,b,c)};h.nc=function(a,b,c){return Id(this,Ld(this,a,b,c),c)};h.ac=function(a){return this.A.ka(a)};h.Yc=function(a){return this.A.ka(Id(this,a,2))};h.gc=function(a,b){this.A.Sa(a,b&65535)}; -h.Id=function(a,b){this.A.Sa(Id(this,a,4),b)};function Md(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?(d=Ld(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.qa(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.ta[a.L>>12&3];return c}function Nd(a,b,c,d){a.G&57344||(a.La=22);var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=Ld(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Id(a,e|c&65536,4),a.D=a.L>>14&3,a.A.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.ta[a.L>>12&3]=d} -function Od(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Jd(a,a.Y(b,c,3)):a.u[c]&255}function Pd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]}function Qd(a,b){var c=a.f=b&7;b=a.j=(b&56)>>3;return Ld(a,b,c,8)}function Rd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?Jd(a,a.Y(b,c,3)):a.u[c]&255}function Sd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]} -function Q(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Ta=a.Y(b,e,7),Kd(a,e,d.call(a,c,Jd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Y(b,e,6),a.A.Sa(e,d.call(a,c,a.A.ka(e)))):a.u[e]=d.call(a,c,a.u[e])}function Td(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?Kd(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Ud(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?a.A.Sa(a.Y(b,d,4),c):a.u[d]=c&65535;return c} -function S(a,b,c){c&&(Ad(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.fb=function(a){this.v.complete=!0;var b=this.v.kc=this.i&&Vd(this.i),c=a?this.v.Nb?0:1:-1;this.v.Nb=!1;this.ba=this.b=a;do{if(b){if(Wd(this.i,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Mb&224)>>5;if(a=this.U&&this.U.ab>e?this.U:null)d=a.dd,e=a.ab;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1; -if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.La=0,this.qb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(zd(this))}while(0>1|b<<16;Dd(this,a);return a&65535}function be(a,b){a=b&2048|b>>1|b<<8;Dd(this,a<<8);return a&255}function ce(a,b){a=b&~a;P(this,a);return a}function de(a,b){a=b&~a;P(this,a<<8);return a}function ee(a,b){a|=b;P(this,a);return a}function fe(a,b){a|=b;P(this,a<<8);return a} -function ge(a,b){a=~b|65536;Bd(this,a);return a&65535}function he(a,b){a=~b|256;Bd(this,a<<8);return a&255}function ie(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function je(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function ke(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function le(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255} -function me(a,b){a=-b;Bd(this,a,a&b&32768);return a&65535}function ne(a,b){a=-b;Bd(this,a<<8,(a&b&128)<<8);return a&255}function oe(a,b){a=b<<1|this.N>>16&1;Dd(this,a);return a&65535}function pe(a,b){a=b<<1|this.N>>16&1;Dd(this,a<<8);return a&255}function qe(a,b){a=(this.N&65536|b)>>1|b<<16;Dd(this,a);return a&65535}function re(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;Dd(this,a<<8);return a&255}function se(a,b){var c=b-a;Ed(this,c,a,b);return c&65535} -function te(a,b){var c=b-a;Ed(this,c<<8,a<<8,b<<8);return c&255}function ue(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function ve(a,b){a^=b;P(this,a);return a&65535}function we(a){R(this,a,Pd(this,a),Xd);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function xe(a){var b=Sd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.j?6:7)+b} -function ye(a){var b=Sd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.j?6:7)+b}function ze(a){S(this,a,!O(this))}function Ae(a){S(this,a,O(this))} -function Be(a){R(this,a,Pd(this,a),ce);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ce(a){Q(this,a,Od(this,a),de);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){R(this,a,Pd(this,a),ee);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){Q(this,a,Od(this,a),fe);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function Fe(a){P(this,Pd(this,a)&Sd(this,a));this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ge(a){P(this,(Od(this,a)&Rd(this,a))<<8);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){S(this,a,yd(this))}function Ie(a){S(this,a,!this.Ca()==!xd(this))}function Je(a){S(this,a,!yd(this)&&!this.Ca()==!xd(this))}function Ke(a){S(this,a,!O(this)&&!yd(this))}function Le(a){S(this,a,yd(this)||!this.Ca()!=!xd(this))} -function Me(a){S(this,a,O(this)||yd(this))}function Ne(a){S(this,a,!this.Ca()!=!xd(this))}function Oe(a){S(this,a,this.Ca())}function Pe(a){S(this,a,!yd(this))}function Qe(a){S(this,a,!this.Ca())}function Re(){this.ea(12,1);this.b-=5}function Se(a){S(this,a,!0)}function Te(a){S(this,a,!xd(this))}function Ue(a){S(this,a,xd(this))}function U(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} -function Ve(a){var b=Pd(this,a);a=Sd(this,a);Ed(this,b-a,a,b);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function We(a){var b=Od(this,a)<<8;a=Rd(this,a)<<8;Ed(this,b-a,a,b);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} -function Xe(a){var b=Sd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}function Ye(){this.ea(24,2);this.b-=25}function Ze(){this.L&49152?(this.Z|=128,this.ea(4,3)):this.da();this.b-=7} -function $e(){this.ea(16,4);this.b-=25}var af=[0,7,7,10,7,11,9,13];function bf(a){var b=this.b;Ad(this,Qd(this,a));this.b=b-af[this.j]}var cf=[0,14,14,17,14,18,16,20];function df(a){var b=this.b,c=Qd(this,a);a=a>>6&7;Fd(this,this.u[a]);this.u[a]=this.u[7];Ad(this,c);this.b=b-cf[this.j]}var ef=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function ff(a){var b=Pd(this,a),c=this.b;P(this,Ud(this,a,b));this.b=c-ef[(this.H?8:0)+this.j]+(7!=this.f||this.j?0:2)} -function gf(a){var b=Od(this,a);P(this,Td(this,a,b,1)<<8);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var hf=[7,13,13,17,14,18,17,21];function jf(a){var b=Sd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)Ad(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function pf(a){R(this,a,Pd(this,a),se);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function qf(a){R(this,a,0,ue);this.b-=this.j?9:3+(7==this.f?2:0)}function rf(){this.ea(28,5);this.b-=5}function sf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function tf(a){R(this,a,Pd(this,a),ve);this.b-=this.j?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,B(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function td(a){uf[a>>12].call(this,a)}function vf(a){wf[a>>6&3].call(this,a)}function xf(a){yf[a>>6&3].call(this,a)} -function zf(a){Af[a>>6&3].call(this,a)}function Bf(a){Vf[a&15].call(this,a)}function Wf(a){Xf[a&15].call(this,a)}function Yf(a){Zf[a>>6&3].call(this,a)}function $f(a){ag[a>>6&3].call(this,a)}function bg(a){cg[a>>6&3].call(this,a)} -var uf=[function(a){dg[a>>8&15].call(this,a)},ff,Ve,Fe,Be,De,we,V,function(a){eg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,pf,V],dg=[function(a){fg[a>>4&15].call(this,a)},Se,Pe,He,Ie,Ne,Je,Le,df,df,vf,xf,zf,V,V,V],wf=[function(a){Bd(this,Ud(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ge);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ke);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ie);this.b-=this.j?9:3+(7==this.f?2:0)}],yf=[function(a){R(this,a,0, -me);this.b-=this.j?11:6},function(a){R(this,a,O(this)?1:0,Xd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,O(this)?1:0,se);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Bd(this,a);this.b-=this.j?4:3+(7==this.f?2:0)}],Af=[function(a){R(this,a,0,qe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,oe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ae);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Zd);this.b-=this.j?9:3+(7==this.f?2:0)}], -fg=[function(a){gg[a&15].call(this,a)},V,V,V,bf,bf,bf,bf,nf,V,Bf,Wf,qf,qf,qf,qf],gg=[Ze,sf,mf,Re,$e,lf,V,V,V,V,V,V,V,V,V,V],Vf=[kf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},U,function(){this.X=1;this.b-=5},U,U,U,function(){this.S=0;this.b-=5},U,U,U,U,U,U,U],Xf=[kf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],eg=[Qe,Oe,Ke,Me,Te,Ue,ze,Ae,Ye,rf,Yf,$f,bg,V,V,V],Zf=[function(a){Bd(this, -Td(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,he);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,le);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,je);this.b-=this.j?9:3+(7==this.f?2:0)}],ag=[function(a){Q(this,a,0,ne);this.b-=this.j?11:6},function(a){Q(this,a,O(this)?1:0,Yd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,O(this)?1:0,te);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Rd(this,a);Bd(this,a<<8);this.b-=this.j?4:3+(7==this.f? -2:0)}],cg=[function(a){Q(this,a,0,re);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,pe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,be);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,$d);this.b-=this.j?9:3+(7==this.f?2:0)}];function ud(a){hg[a>>12].call(this,a)} -var hg=[function(a){ig[a>>8&15].call(this,a)},ff,Ve,Fe,Be,De,we,function(a){jg[a>>8&15].call(this,a)},function(a){kg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,pf,V],ig=[function(a){lg[a>>4&15].call(this,a)},Se,Pe,He,Ie,Ne,Je,Le,df,df,vf,xf,zf,function(a){mg[a>>6&3].call(this,a)},V,V],mg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.M);Ad(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Md(this,a,0);Fd(this,a);P(this,a);this.b-=11},function(a){var b=Hd(this),c= -this.b;Nd(this,a,0,b);P(this,b);this.b=c-hf[this.j]},function(a){P(this,Ud(this,a,this.Ca?65535:0));this.b-=this.j?9:3+(7==this.f?2:0)}],lg=[function(a){ng[a&15].call(this,a)},V,V,V,bf,bf,bf,bf,nf,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Bf,Wf,qf,qf,qf,qf],ng=[Ze,sf,mf,Re,$e,lf,function(){Gd(this);this.b-=13},V,V,V,V,V,V,V,V,V],jg=[jf,jf,Xe,Xe,xe,xe,ye,ye,tf,tf,V,V,V,V,of,of],kg=[Qe,Oe,Ke,Me,Te,Ue,ze,Ae,Ye,rf,Yf,$f,bg,function(a){og[a>>6&3].call(this, -a)},V,V],og=[V,function(a){a=Md(this,a,65536);Fd(this,a);P(this,a);this.b-=11},function(a){var b=Hd(this),c=this.b;Nd(this,a,65536,b);P(this,b);this.b=c-hf[this.j]},V];function pg(a){r.call(this,"ROM",a,pg);this.f=null;this.D=a.addr;this.j=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=pa(this.C);if(this.C){a=this.C;var b=qa(this.H);"json"!=b&&"hex"!=b&&(a=sa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Fa(a,null,!0,function(a,b,f){qg(c,a,b,f)})}}u(pg); -pg.prototype.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;rg(this)};pg.prototype.Aa=function(){if(this.Ba){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.j,e=this.Ba,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=za(q,m,a.Sb);0>v&&q.splice(-(v+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Nd:b,w:c,sc:d,Ba:e,Rb:f})}delete this.Ba}return!0};pg.prototype.za=function(){return!0}; -function qg(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{jb(a.Gb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Ba=l.symbols;if(!a.f.length){n("Empty ROM: "+ -b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=xa(b[0]);if(c!=this.Ua)return;b=xa(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Gb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.za=function(a){return a?this.save():!0};h.reset=function(){wg(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return wg(this)};function wg(a){a.R=0;a.f=0;a.j=128;a.D=[];return!0}h.Lb=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=wa("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.g(this.G), -this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.j&=-129;rc(this.b,this.V,1)}};var xg={},vg=(xg[65392]=[null,null,Y.prototype.Nc,Y.prototype.xd,"RCSR"],xg[65394]=[null,null,Y.prototype.Mc,Y.prototype.wd,"RBUF"],xg[65396]=[null,null,Y.prototype.$c,Y.prototype.Kd,"XCSR"],xg[65398]=[null,null,Y.prototype.Zc,Y.prototype.Jd,"XBUF"],xg);Ta(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};yg.prototype.Xb=function(){return-1};yg.prototype.Yb=function(){}; -function Ag(a,b,c,d){if(c)if(b){0>a.C&&a.j.length&&(a.C=0);if(0>a.C||b!=a.j[a.C])a.j.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.j[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} -function Bg(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 vd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.qc];a.Ea=[0,0,0,0,0,0];a.ta=[0,0,0,0];a.D=0;a.va=0;a.oc=[4,2,0,1];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.qa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.rc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.cc=[0,0,0,0,0,0,0,0];a.bc=0;a.F=0;a.H=a.I=0;a.j=a.f=a.Ta=0;a.ma=-1;wd(a)}function wd(a){a.Na=255;a.Z=0;a.Mb=0;a.G=0;a.La=0;a.qb=0;a.Ma=0;a.Ja=0;a.ua=0;a.Wa=262143;a.wa=253952;a.F|=2;a.w&&sc(a)}function sc(a){a.Ja?(a.M=65536,a.Y=a.nc,a.ra=a.Yc,a.ub=a.Id,Ub(a.w,a.Ma&16?22:18)):(a.M=0,a.Y=a.mc,a.ra=a.ac,a.ub=a.gc,Ub(a.w,16))}h.Wb=function(){return 0}; +h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.fa,this.Ka]);a.set(2,bc(this.w));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Uc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.D!=c&&(a.ta[c]=a.u[6],a.u[6]=a.ta[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function Cd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function Dd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function Ed(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function Fd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))} +h.ea=function(a,b){if(!this.C){var c=!1;0>this.ma?this.ma=Kb(this):this.D||(a=4,c=!0);this.G&57344||(this.La=63222,this.qb=a);this.D=0;var d=this.ra(a|this.M),e=this.ra(a+2&65535|this.M);uc(this,e&-12289|this.ma>>2&12288);c&&(this.Z|=4,this.u[6]=4);Gd(this,this.ma);Gd(this,this.u[7]);Bd(this,d);this.F&=-113;this.ma=-1;if(26!=b)throw a;}};function Hd(a){var b=Id(a),c=Id(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);Bd(a,b);uc(a,c);a.F&=-17} +function Jd(a,b,c){var d,e,f,g=0;d=b>>13;a.Ma&a.oc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.qa[a.D][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ma&32&&(f=a.rc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.wa&&4186112>f&&(a.Z|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? +192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.D][d]=e;if(4194170!==f||a.D)a.ua=a.D,a.va=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ua<<5|a.va<<1),a.ea(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ra(e)|g; +a.b-=8;break;case 6:return e=Ad(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=Ad(a),e=e+a.u[c]&65535,e=a.ra(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.La=a.La<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32?(a.Z|=4,a.u[6]=4,a.ea(4,24)):(a.Z|=8,a.F|=64));return e}h.zb=function(a){if(!this.Ja)return this.w.zb(a);this.C++;a=Kd(this,Jd(this,a,3));this.C--;return a}; +h.mb=function(a){if(!this.Ja)return this.w.mb(a);this.C++;a=this.ac(Jd(this,a,2));this.C--;return a};h.rb=function(a,b){this.Ja?(this.C++,Ld(this,Jd(this,a,5),b),this.C--):this.w.rb(a,b)};h.Eb=function(a,b){this.Ja?(this.C++,this.gc(Jd(this,a,4),b),this.C--):this.w.Eb(a,b)};h.mc=function(a,b,c){return Md(this,a,b,c)};h.nc=function(a,b,c){return Jd(this,Md(this,a,b,c),c)};h.ac=function(a){return this.w.ka(a)};h.Yc=function(a){return this.w.ka(Jd(this,a,2))};h.gc=function(a,b){this.w.Sa(a,b&65535)}; +h.Id=function(a,b){this.w.Sa(Jd(this,a,4),b)};function Nd(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?(d=Md(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.ra(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.ta[a.L>>12&3];return c}function Od(a,b,c,d){a.G&57344||(a.La=22);var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=Md(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=Jd(a,e|c&65536,4),a.D=a.L>>14&3,a.w.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.ta[a.L>>12&3]=d} +function Pd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Qd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.ka(a.Y(b,c,2)):a.u[c]}function Rd(a,b){var c=a.f=b&7;b=a.j=(b&56)>>3;return Md(a,b,c,8)}function Sd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?Kd(a,a.Y(b,c,3)):a.u[c]&255}function Td(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?a.w.ka(a.Y(b,c,2)):a.u[c]} +function Q(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Ta=a.Y(b,e,7),Ld(a,e,d.call(a,c,Kd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Sa(e,d.call(a,c,a.w.ka(e)))):a.u[e]=d.call(a,c,a.u[e])}function Ud(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?Ld(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Vd(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?a.w.Sa(a.Y(b,d,4),c):a.u[d]=c&65535;return c} +function S(a,b,c){c&&(Bd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +h.fb=function(a){this.v.complete=!0;var b=this.v.kc=this.g&&Wd(this.g),c=a?this.v.Nb?0:1:-1;this.v.Nb=!1;this.ba=this.b=a;do{if(b){if(Xd(this.g,this.u[7],c)){this.da();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.ea(168,28):this.F&64?this.ea(4,30):this.F&16&&this.ea(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Mb&224)>>5;if(a=this.U&&this.U.ab>e?this.U:null)d=a.dd,e=a.ab;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.ea(d,26),e=!0):e=!1; +if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.La=0,this.qb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(Ad(this))}while(0>1|b<<16;Ed(this,a);return a&65535}function ce(a,b){a=b&2048|b>>1|b<<8;Ed(this,a<<8);return a&255}function de(a,b){a=b&~a;P(this,a);return a}function ee(a,b){a=b&~a;P(this,a<<8);return a}function fe(a,b){a|=b;P(this,a);return a}function ge(a,b){a|=b;P(this,a<<8);return a} +function he(a,b){a=~b|65536;Cd(this,a);return a&65535}function ie(a,b){a=~b|256;Cd(this,a<<8);return a&255}function je(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function ke(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function le(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function me(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255} +function ne(a,b){a=-b;Cd(this,a,a&b&32768);return a&65535}function oe(a,b){a=-b;Cd(this,a<<8,(a&b&128)<<8);return a&255}function pe(a,b){a=b<<1|this.N>>16&1;Ed(this,a);return a&65535}function qe(a,b){a=b<<1|this.N>>16&1;Ed(this,a<<8);return a&255}function re(a,b){a=(this.N&65536|b)>>1|b<<16;Ed(this,a);return a&65535}function se(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;Ed(this,a<<8);return a&255}function te(a,b){var c=b-a;Fd(this,c,a,b);return c&65535} +function ue(a,b){var c=b-a;Fd(this,c<<8,a<<8,b<<8);return c&255}function ve(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function we(a,b){a^=b;P(this,a);return a&65535}function xe(a){R(this,a,Qd(this,a),Yd);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function ye(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.j?6:7)+b} +function ze(a){var b=Td(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.j?6:7)+b}function Ae(a){S(this,a,!xd(this))}function Be(a){S(this,a,xd(this))} +function Ce(a){R(this,a,Qd(this,a),de);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function De(a){Q(this,a,Pd(this,a),ee);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ee(a){R(this,a,Qd(this,a),fe);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Pd(this,a),ge);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function Ge(a){P(this,Qd(this,a)&Td(this,a));this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function He(a){P(this,(Pd(this,a)&Sd(this,a))<<8);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ie(a){S(this,a,zd(this))}function Je(a){S(this,a,!this.Da()==!yd(this))}function Ke(a){S(this,a,!zd(this)&&!this.Da()==!yd(this))}function Le(a){S(this,a,!xd(this)&&!zd(this))}function Me(a){S(this,a,zd(this)||!this.Da()!=!yd(this))} +function Ne(a){S(this,a,xd(this)||zd(this))}function Oe(a){S(this,a,!this.Da()!=!yd(this))}function Pe(a){S(this,a,this.Da())}function Qe(a){S(this,a,!zd(this))}function Re(a){S(this,a,!this.Da())}function Se(){this.ea(12,1);this.b-=5}function Te(a){S(this,a,!0)}function Ue(a){S(this,a,!yd(this))}function Ve(a){S(this,a,yd(this))}function T(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5} +function We(a){var b=Qd(this,a);a=Td(this,a);Fd(this,b-a,a,b);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Xe(a){var b=Pd(this,a)<<8;a=Sd(this,a)<<8;Fd(this,b-a,a,b);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} +function Ye(a){var b=Td(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}function Ze(){this.ea(24,2);this.b-=25}function $e(){this.L&49152?(this.Z|=128,this.ea(4,3)):this.da();this.b-=7} +function af(){this.ea(16,4);this.b-=25}var bf=[0,7,7,10,7,11,9,13];function cf(a){var b=this.b;Bd(this,Rd(this,a));this.b=b-bf[this.j]}var df=[0,14,14,17,14,18,16,20];function ef(a){var b=this.b,c=Rd(this,a);a=a>>6&7;Gd(this,this.u[a]);this.u[a]=this.u[7];Bd(this,c);this.b=b-df[this.j]}var ff=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function gf(a){var b=Qd(this,a),c=this.b;P(this,Vd(this,a,b));this.b=c-ff[(this.H?8:0)+this.j]+(7!=this.f||this.j?0:2)} +function hf(a){var b=Pd(this,a);P(this,Ud(this,a,b,1)<<8);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var jf=[7,13,13,17,14,18,17,21];function kf(a){var b=Td(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)Bd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function qf(a){R(this,a,Qd(this,a),te);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function rf(a){R(this,a,0,ve);this.b-=this.j?9:3+(7==this.f?2:0)}function sf(){this.ea(28,5);this.b-=5}function tf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function uf(a){R(this,a,Qd(this,a),we);this.b-=this.j?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.g)b=this.g,E(b,"undefined opcode "+K(b,a),!0,!0),b=Zb(b);b||this.ea(8,6)}function td(a){vf[a>>12].call(this,a)}function wf(a){xf[a>>6&3].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)} +function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Wf[a&15].call(this,a)}function Xf(a){Yf[a&15].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)} +var vf=[function(a){eg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,V,function(a){fg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],eg=[function(a){gg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,V,V,V],xf=[function(a){Cd(this,Vd(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,he);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,le);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,je);this.b-=this.j?9:3+(7==this.f?2:0)}],zf=[function(a){R(this,a,0, +ne);this.b-=this.j?11:6},function(a){R(this,a,xd(this)?1:0,Yd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,xd(this)?1:0,te);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Td(this,a);Cd(this,a);this.b-=this.j?4:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0,re);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,pe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.j?9:3+(7==this.f?2:0)}], +gg=[function(a){hg[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,V,Cf,Xf,rf,rf,rf,rf],hg=[$e,tf,nf,Se,af,mf,V,V,V,V,V,V,V,V,V,V],Wf=[lf,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.S=0;this.b-=5},T,T,T,T,T,T,T],Yf=[lf,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.S=32768;this.b-=5},W,W,W,W,W,W,W],fg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Zf,ag,cg,V,V,V],$f=[function(a){Cd(this, +Ud(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ie);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ke);this.b-=this.j?9:3+(7==this.f?2:0)}],bg=[function(a){Q(this,a,0,oe);this.b-=this.j?11:6},function(a){Q(this,a,xd(this)?1:0,Zd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,xd(this)?1:0,ue);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Cd(this,a<<8);this.b-=this.j?4:3+(7== +this.f?2:0)}],dg=[function(a){Q(this,a,0,se);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,qe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.j?9:3+(7==this.f?2:0)}];function ud(a){ig[a>>12].call(this,a)} +var ig=[function(a){jg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,xe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},hf,Xe,He,De,Fe,qf,V],jg=[function(a){mg[a>>4&15].call(this,a)},Te,Qe,Ie,Je,Oe,Ke,Me,ef,ef,wf,yf,Af,function(a){ng[a>>6&3].call(this,a)},V,V],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.M);Bd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Nd(this,a,0);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c= +this.b;Od(this,a,0,b);P(this,b);this.b=c-jf[this.j]},function(a){P(this,Vd(this,a,this.Da?65535:0));this.b-=this.j?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},V,V,V,cf,cf,cf,cf,of,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):V.call(this,a)},Cf,Xf,rf,rf,rf,rf],og=[$e,tf,nf,Se,af,mf,function(){Hd(this);this.b-=13},V,V,V,V,V,V,V,V,V],kg=[kf,kf,Ye,Ye,ye,ye,ze,ze,uf,uf,V,V,V,V,pf,pf],lg=[Re,Pe,Le,Ne,Ue,Ve,Ae,Be,Ze,sf,Zf,ag,cg,function(a){pg[a>>6&3].call(this, +a)},V,V],pg=[V,function(a){a=Nd(this,a,65536);Gd(this,a);P(this,a);this.b-=11},function(a){var b=Id(this),c=this.b;Od(this,a,65536,b);P(this,b);this.b=c-jf[this.j]},V];function qg(a){r.call(this,"ROM",a,qg);this.f=null;this.D=a.addr;this.j=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=pa(this.C);if(this.C){a=this.C;var b=qa(this.H);"json"!=b&&"hex"!=b&&(a=sa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Fa(a,null,!0,function(a,b,f){rg(c,a,b,f)})}}u(qg); +qg.prototype.Ba=function(a,b,c,d){this.w=b;this.b=c;this.g=d;sg(this)};qg.prototype.ya=function(){if(this.Ca){if(this.g){var a=this.g,b=this.id,c=this.D,d=this.j,e=this.Ca,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=za(q,m,a.Sb);0>v&&q.splice(-(v+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Nd:b,A:c,sc:d,Ca:e,Rb:f})}delete this.Ca}return!0};qg.prototype.xa=function(){return!0}; +function rg(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{jb(a.Gb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Ca=l.symbols;if(!a.f.length){n("Empty ROM: "+ +b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=xa(b[0]);if(c!=this.Ua)return;b=xa(b[1]);if(this.I=lb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Gb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ya=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.xa=function(a){return a?this.save():!0};h.reset=function(){xg(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return xg(this)};function xg(a){a.R=0;a.f=0;a.j=128;a.D=[];return!0}h.Lb=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.T||8,c=a-this.H%a,this.T&&(b=wa("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.i(this.G), +this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.j&=-129;qc(this.b,this.V,1)}};var yg={},wg=(yg[65392]=[null,null,Y.prototype.Nc,Y.prototype.xd,"RCSR"],yg[65394]=[null,null,Y.prototype.Mc,Y.prototype.wd,"RBUF"],yg[65396]=[null,null,Y.prototype.$c,Y.prototype.Kd,"XCSR"],yg[65398]=[null,null,Y.prototype.Zc,Y.prototype.Jd,"XBUF"],yg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};zg.prototype.Xb=function(){return-1};zg.prototype.Yb=function(){}; +function Bg(a,b,c,d){if(c)if(b){0>a.C&&a.j.length&&(a.C=0);if(0>a.C||b!=a.j[a.C])a.j.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.j[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} +function Cg(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 Cg(a,b,c){var d;if(b){b=Dg(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+oa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function Gg(a,b){if(b)return Fg(a,b,a.aa[b]);var c=0;for(b in a.aa)Fg(a,b,a.aa[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+oa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function Hg(a,b){if(b)return Gg(a,b,a.aa[b]);var c=0;for(b in a.aa)Gg(a,b,a.aa[b]),c++;return 0this.b.Ya?Pg:[];Qg(this,function(a){a:{var b=d.A.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Rg(d,c));if(-1===a){d.g("invalid address: "+c);break a}e=a>>>d.A.ga;m=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.g("..."):(c=q.type,p=jc[c],q&&d.g(k(q.id,8)+" %"+k(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Yb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.ta[a-16]:20==a&&(b=Lb(this.b)));return b}; -h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.qb).w));this.ia&1073741824?this.ua.push(a):this.oa&&a==this.oa||(this.oa=a,this.ia&-2147483648&&(this.da(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Xc(a),a.la=0,a.B.$()))}; -function Jg(a){var b;if(Vd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.ga],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ga],!0);a.D=["bw"];a.Ta=0} -h.Pa=function(a,b,c){var d=!0;c||ah(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.g("invalid address: "+J(this,b.w)),d=!1;else{var f=this.A;f.W[e>>>f.ga].Pa(e&f.A,a==this.D)}}d&&(a.push(b),c?b.ya=!0:(bh(this,a,a.length-1,"set"),Jg(this)));return d};function ah(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ga],b==a.D));l.ya||Jg(a);break}}return f} -function ch(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==D)w=w.w-((f&63)<<1)&65535,y=J(x,w);else if(12288==D)y=J(x,f&7,1);else if(24576==D)y=J(x,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:y= -Wg(C);break;case 8:y="@"+Wg(C);break;case 16:7>C?y="("+Wg(C)+")+":(D=x.ka(w,2),y="#"+J(x,D,0,!0));break;case 24:7>C?y="@("+Wg(C)+")+":(D=x.ka(w,2),y="@#"+J(x,D,0,!0));break;case 32:y="-("+Wg(C)+")";break;case 40:y="@-("+Wg(C)+")";break;case 48:D=x.ka(w,2);y=J(x,D,0,!0)+"("+Wg(C)+")";7==C&&(y=[y,J(x,D+w.w&65535)]);break;case 56:D=x.ka(w,2),y="@"+J(x,D)+"("+Wg(C)+")",7==C&&(y=[y,J(x,D+w.w&65535)])}x=y;if(!x||!x.length){l="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=Wg(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.ta[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function hh(a){var b,c="";for(b=0;6>b;b++)c+=gh(a,b);c=c+"\n"+(gh(a,6)+gh(a,7)+gh(a,20));return c+=fh(a,"T")+fh(a,"N")+fh(a,"Z")+fh(a,"V")+fh(a,"C")}h.Sb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.sc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.g("unknown register: "+e);return}a.B.$();a.g("updated registers:")}a.g(hh(a));c&&(a.K=Z(d.u[7]),Zg(a,J(a,a.K.w)))}}function mh(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.g(p)}l[3]&&(g=l[3],f=null);f=eh(a,b,g,f);a.g(f);a.K=b;e-=b.w-m;c++}}} -function dh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.U&&(a.g("ended assemble at "+J(a,a.T.w)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.oa=null;if(qb(a)&&0q||"z"ia.length&&(a.g("note: only "+ia.length+" available"),X=ia.length);ba-=X;0>ba&&(null==ia[ia.length-1].w?(X=ba+X,ba=0):ba+=ia.length);var bd=[];"call"==Hf&&(sb=1E5,bd=["CALL"]);for(void 0!==Gf&&a.g(X+" instructions earlier:");0=ia.length&&(ba=0);a.Va=X;Jf++;sb--}}Jf||(a.g("no "+If+"history available"),a.Va=void 0)}else{var ub=Rg(a,ha);if(ub){var bc=0;Ca&&("l"==Ca.charAt(0)&&(Ca=Ca.substr(1)||Gh),bc=Eg(a,Ca)>>>0,65536>4||1;Ih--&&0ec?String.fromCharCode(ec):".";cc--}vb&&(vb+="\n");vb+=ha+" "+cd+(0==xb?" "+Mf:"")}vb&&a.g(vb);a.Oa=ub}}}}break;case "e":if("else"==g[0])break;var Za,ed,fd,gd,hd=g[0],id=g[1];"eb"==hd?(Za=1,ed=255,fd=a.lb,gd=a.Db):"e"==hd||"ew"==hd?(Za=2,ed=65535,fd=a.ka,gd=a.Sa):id=null;if(null==id)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var fc=Rg(a,id);if(fc)for(var gc=2;gc< -g.length;gc++){var yb=Cg(a,g[gc]);if(void 0===yb){a.g("unrecognized value: "+g[gc]);break}yb&~ed&&a.g("warning: "+k(yb)+" exceeds "+Za+"-byte value");var Jh=fd.call(a,fc);a.g("changing "+J(a,fc.w)+" from "+J(a,Jh,Za)+" to "+J(a,yb,Za));gd.call(a,fc,yb,Za)}}break;case "g":a:{var Nf=g[1],Kh=b;if(void 0!==Nf){var jd=Rg(a,Nf,!0);if(!jd)break a;Vg(a,jd,Kh);a.Pa(a.f,jd,!0)}a.eb(!0,c)}break;case "h":a.v.ca?(c||a.g("halting"),a.da()):pb(a,!0)||c||a.g("already halted");break;case "i":if("if"==g[0]){var kd; -var zb=b.substr(2),zb=xa(zb);Cg(a,zb)?(c||a.g("true: "+zb),kd=!0):(c||a.g("false: "+zb),kd=!1);kd||(d=!1);break}f=!0;break;case "k":var Lh=g[0];if("?"==g[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var ld=0,md=Z(),Ab=Z(a.b.u[6]);for(a.g("stack trace for "+J(a,Ab.w));10>ld;){for(var Da=null,Mh=256;65536>Ab.w>>>0;){md.w=a.ka(Ab,2);if(null==Ab.w||!Mh--)break;if(!(md.w&1)){for(var Nh=a,hc=md,Of=null,Bb=hc.w,Pf=Bb,nd=1;6>=nd&&Bb;nd++){if(2< -nd){hc.w=Bb;var ic=eh(Nh,hc);if(0<=ic.indexOf("JSR")){var Qf=ic.indexOf(" ");if(Bb+(ic.indexOf(" ",Qf+1)-Qf-1)/2==Pf){Of=ic;break}}}Bb-=2}hc.w=Pf;if(Da=Of)break}}if(!Da||null==Da)break;var Rf=null;if("ks"==Lh){var Sf=Da.match(/[0-9A-F]+$/);Sf&&(Rf=lh(a,Sf[0]))}Da=wa(Da,50)+" ;"+(Rf||"stack="+J(a,Ab.w));a.g(Da);ld++}ld||a.g("no return addresses found")}break;case "l":if("ln"==g[0]){lh(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var va=0;if("all"== -F)va=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in H)if(F==ja){va=H[ja];ka=!!(a.ia&va);break}if(!va){a.g("unknown message category: "+F);break a}}if(va)if("on"==g[2])a.ia|=va,ka=!0;else if("off"==g[2]&&(a.ia&=~va,ka=!1,1073741824==va)){for(var od=0;od\nLicense: GPL version 3 or later ");this.g("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;brh){if(th(d,this.I)){this.D=new N(this,"1.30.1","failsafe");th(this.D)&&(yh(this,d),a=2,zh(this.D));this.D.set("timestamp",Ea());Ah(this.D);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=xh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?th(d,g):("error"== -f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.j=null)):this.g(f+": "+g),zh(d),th(d)?(c=xh(d),e=!0):c=!1))}e&&wh(this,c?d:null)}else 2==a&&d.clear()}else wh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Bh(this,this.b,b,c,a),this.b.ib());this.T&&(yh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; -function yh(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.j||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Fa("http://www.pcjs.org/api/v1/report",d,!0)}} -function oh(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=Ea();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.da(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var l=kb(a.id),m=0;mthis.b.Ya?Qg:[];Rg(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Sg(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.ga;m=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.i("..."):(c=q.type,p=ac[c],q&&d.i(k(q.id,8)+" %"+k(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Yb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.ta[a-16]:20==a&&(b=Kb(this.b)));return b}; +h.message=function(a,b){b&&(a+=" @"+K(this,Z(this.b.qb).A));this.ia&1073741824?this.ua.push(a):this.pa&&a==this.pa||(this.pa=a,this.ia&-2147483648&&(this.da(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,Xc(a),a.la=0,a.B.$()))}; +function Kg(a){var b;if(Wd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.ga],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ga],!0);a.D=["bw"];a.Ta=0} +h.Pa=function(a,b,c){var d=!0;c||bh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.i("invalid address: "+K(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.ga].Pa(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Aa=!0:(ch(this,a,a.length-1,"set"),Kg(this)));return d};function bh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ga],b==a.D));l.Aa||Kg(a);break}}return f} +function dh(a,b){for(var c=1;c>23)&65535,y=K(x,w);else if(8192==D)w=w.A-((f&63)<<1)&65535,y=K(x,w);else if(12288==D)y=K(x,f&7,1);else if(24576==D)y=K(x,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:y= +Xg(C);break;case 8:y="@"+Xg(C);break;case 16:7>C?y="("+Xg(C)+")+":(D=x.ka(w,2),y="#"+K(x,D,0,!0));break;case 24:7>C?y="@("+Xg(C)+")+":(D=x.ka(w,2),y="@#"+K(x,D,0,!0));break;case 32:y="-("+Xg(C)+")";break;case 40:y="@-("+Xg(C)+")";break;case 48:D=x.ka(w,2);y=K(x,D,0,!0)+"("+Xg(C)+")";7==C&&(y=[y,K(x,D+w.A&65535)]);break;case 56:D=x.ka(w,2),y="@"+K(x,D)+"("+Xg(C)+")",7==C&&(y=[y,K(x,D+w.A&65535)])}x=y;if(!x||!x.length){l="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=Xg(b),c+="="+K(a,d.u[b])):13>b?c="A"+(b-8)+"="+K(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+K(a,d.ta[b-16]):20==b&&(c="PS="+K(a,Kb(d)));c&&(c+=" ");return c}function ih(a){var b,c="";for(b=0;6>b;b++)c+=hh(a,b);c=c+"\n"+(hh(a,6)+hh(a,7)+hh(a,20));return c+=gh(a,"T")+gh(a,"N")+gh(a,"Z")+gh(a,"V")+gh(a,"C")}h.Sb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.sc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}a.B.$();a.i("updated registers:")}a.i(ih(a));c&&(a.K=Z(d.u[7]),$g(a,K(a,a.K.A)))}}function nh(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.i(p)}l[3]&&(g=l[3],f=null);f=fh(a,b,g,f);a.i(f);a.K=b;e-=b.A-m;c++}}} +function eh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.U&&(a.i("ended assemble at "+K(a,a.T.A)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.pa=null;if(pb(a)&&0q||"z"ia.length&&(a.i("note: only "+ia.length+" available"),X=ia.length);ca-=X;0>ca&&(null==ia[ia.length-1].A?(X=ca+X,ca=0):ca+=ia.length);var cd=[];"call"==If&&(sb=1E5,cd=["CALL"]);for(void 0!==Hf&&a.i(X+" instructions earlier:");0=ia.length&&(ca=0);a.Va=X;Kf++;sb--}}Kf||(a.i("no "+Jf+"history available"),a.Va=void 0)}else{var ub=Sg(a,ha);if(ub){var cc=0;Ca&&("l"==Ca.charAt(0)&&(Ca=Ca.substr(1)||Hh),cc=Fg(a,Ca)>>>0,65536>4||1;Jh--&&0fc?String.fromCharCode(fc):".";dc--}vb&&(vb+="\n");vb+=ha+" "+dd+(0==xb?" "+Nf:"")}vb&&a.i(vb);a.Oa=ub}}}}break;case "e":if("else"==g[0])break;var Za,fd,gd,hd,id=g[0],jd=g[1];"eb"==id?(Za=1,fd=255,gd=a.lb,hd=a.Db):"e"==id||"ew"==id?(Za=2,fd=65535,gd=a.ka,hd=a.Sa):jd=null;if(null==jd)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var gc=Sg(a,jd);if(gc)for(var hc=2;hc< +g.length;hc++){var yb=Dg(a,g[hc]);if(void 0===yb){a.i("unrecognized value: "+g[hc]);break}yb&~fd&&a.i("warning: "+k(yb)+" exceeds "+Za+"-byte value");var Kh=gd.call(a,gc);a.i("changing "+K(a,gc.A)+" from "+K(a,Kh,Za)+" to "+K(a,yb,Za));hd.call(a,gc,yb,Za)}}break;case "g":a:{var Of=g[1],Lh=b;if(void 0!==Of){var kd=Sg(a,Of,!0);if(!kd)break a;Wg(a,kd,Lh);a.Pa(a.f,kd,!0)}a.eb(!0,c)}break;case "h":a.v.ca?(c||a.i("halting"),a.da()):ob(a,!0)||c||a.i("already halted");break;case "i":if("if"==g[0]){var ld; +var zb=b.substr(2),zb=xa(zb);Dg(a,zb)?(c||a.i("true: "+zb),ld=!0):(c||a.i("false: "+zb),ld=!1);ld||(d=!1);break}f=!0;break;case "k":var Mh=g[0];if("?"==g[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var md=0,nd=Z(),Ab=Z(a.b.u[6]);for(a.i("stack trace for "+K(a,Ab.A));10>md;){for(var Da=null,Nh=256;65536>Ab.A>>>0;){nd.A=a.ka(Ab,2);if(null==Ab.A||!Nh--)break;if(!(nd.A&1)){for(var Oh=a,ic=nd,Pf=null,Bb=ic.A,Qf=Bb,od=1;6>=od&&Bb;od++){if(2< +od){ic.A=Bb;var jc=fh(Oh,ic);if(0<=jc.indexOf("JSR")){var Rf=jc.indexOf(" ");if(Bb+(jc.indexOf(" ",Rf+1)-Rf-1)/2==Qf){Pf=jc;break}}}Bb-=2}ic.A=Qf;if(Da=Pf)break}}if(!Da||null==Da)break;var Sf=null;if("ks"==Mh){var Tf=Da.match(/[0-9A-F]+$/);Tf&&(Sf=mh(a,Tf[0]))}Da=wa(Da,50)+" ;"+(Sf||"stack="+K(a,Ab.A));a.i(Da);md++}md||a.i("no return addresses found")}break;case "l":if("ln"==g[0]){mh(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var va=0;if("all"== +F)va=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in I)if(F==ja){va=I[ja];ka=!!(a.ia&va);break}if(!va){a.i("unknown message category: "+F);break a}}if(va)if("on"==g[2])a.ia|=va,ka=!0;else if("off"==g[2]&&(a.ia&=~va,ka=!1,1073741824==va)){for(var pd=0;pd\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bsh){if(uh(d,this.I)){this.D=new O(this,"1.30.1","failsafe");uh(this.D)&&(zh(this,d),a=2,Ah(this.D));this.D.set("timestamp",Ea());Bh(this.D);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=yh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?uh(d,g):("error"== +f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.j=null)):this.i(f+": "+g),Ah(d),uh(d)?(c=yh(d),e=!0):c=!1))}e&&xh(this,c?d:null)}else 2==a&&d.clear()}else xh(this);delete this.I;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(Ch(this,this.b,b,c,a),this.b.ib());this.T&&(zh(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0}; +function zh(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.j||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Fa("http://www.pcjs.org/api/v1/report",d,!0)}} +function ph(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),l=Ea();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.xa&&(c&&a.b.da(),d=a.b.xa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var l=kb(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Fa(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Th(a,b,c)}})}else c(a,null)} -function Uh(a,b,c,d){function e(a){if(void 0===l){var b=g&&A(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ua(a))}function f(a){e("Error: "+a);m&&(--Fh||ab(!0));m=!1}var g,l,m=!0;Fh++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,l){l?Rh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Fh||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Fh||ab(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Rh(b,a,d,!0,e,p):Sh(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){ab(!1);return Uh(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map +h.oa=function(a,b,c){var d=this;switch(b){case "power":return this.J[b]=c,c.onclick=function(){d.B||(d.v.ha?ph(d,!1,!0):wh(d,d.pb))},!0;case "reset":return this.J[b]=c,c.onclick=function(){if(d.v.ha&&!d.B)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ph(d,a,!0);!a&&d.R?window&&window.location.reload():d.pb(sh)}else d.reset(),d.b&&d.b.ib()},!0;case "save":if(ra())c.parentNode.removeChild(c);else return this.J[b]= +c,c.onclick=function(){var a=th(d,!0);if(a){var b=!!(d.f&&!d.H||d.R),c=ph(d,b);b?Dh(d,a,c):d.na("Resume disabled, machine state not saved")}},!0}return!1}; +function th(a,b){var c=a.j;c||((c=Ja("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Eh(a,c))||a.na("The user ID is invalid.")):b&&a.na("Browser local storage is not available"));return c} +function Eh(a,b){a.j=null;b=Fa(sa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ka("user",b.data),a.j=b.data)}catch(d){n(d.message+" ("+c+")")}return a.j}function vh(a){var b=null;a.j&&(b=sa()+"/api/v1/user?req=load&user="+a.j+"&state="+Fh(a,"1.30.1"));return b} +function Dh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Fh(a,"1.30.1");d.data=c;b=Fa(sa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Fa(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Uh(a,b,c)}})}else c(a,null)} +function Vh(a,b,c,d){function e(a){if(void 0===l){var b=g&&B(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ua(a))}function f(a){e("Error: "+a);m&&(--Gh||ab(!0));m=!1}var g,l,m=!0;Gh++;ib[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");p=function(d,l){l?Sh(c,null,null,!1,e,function(d,m){m?(jb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Gh||ab(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Gh||ab(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Sh(b,a,d,!0,e,p):Th(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(w){f(w.message)}return m}window.embedPDP11=function(a,b,c,d){ab(!1);return Vh(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 4ed88e858..2bf5e0b94 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -24,6 +24,7 @@ http://pcjs.org/modules/pdp11/lib/ram.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/serialport.js (C) Jeff Parsons 2012-2016 + http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ @@ -43,31 +44,32 @@ function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name= if(window){Ha||(Ha=window.location.search.substr(1));for(var Ja,Ka=/\+/g,La=/([^&=]+)=?([^&]*)/g;Ja=La.exec(Ha);)Ia[decodeURIComponent(Ja[1].replace(Ka," "))]=decodeURIComponent(Ja[2].replace(Ka," "))}function Ma(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function x(a,b){b||(b=v);a.prototype=Ma(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Na=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Na={},w=[];function Oa(a,b,c){Na[a]&&b&&(Na[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.g=this.c-1;this.w=this.A/this.c|0;this.ha=[];this.R=0;this.o=[];this.vb=[Za,$a,ab,bb];a=new G(this);cb(a,this.G);this.b=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=eb(d,b)}function $a(a,b,c){var d=!1,e=this.controller,f=e.ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||eb(e,c)} -function ab(a,b){var c=-1,d=this.controller;(a=d.ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=eb(d,b)}function bb(a,b,c){var d=!1,e=this.controller;if(a=e.ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||eb(e,c)}function fb(a,b){if(b!=a.l){var c;a.l&&(c=(1<>>a.m;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.za)return n.Qa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Qa){t=n.size-(f-r);t>k&&(t=k);n.Qa=f-n.za+t;f=r+a.c;k-=t;l++;continue}}return kb(1,f,k)}f=new G(a,f,t,a.c,d,e);cb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var B;e="";B?10>>=a.m;0>>=a.m;0>>a.m].Ya(b&a.g,b)}function nb(a,b){return a.b[(b&a.i)>>>a.m].S(b&a.g,b)}Ya.prototype.bb=function(a,b){this.R++;this.b[(a&this.i)>>>this.m].sb(a&this.g,b&255,a);this.R--}; -function ob(a,b,c){a.b[(b&a.i)>>>a.m].Ra(b&a.g,c&65535,b)}function pb(a){for(var b=0,c=[],d=0;d>2;this.g=this.c-1;this.w=this.A/this.c|0;this.ia=[];this.R=0;this.o=[];this.vb=[Za,$a,ab,bb];a=new G(this);cb(a,this.G);this.b=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ia[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=eb(d,b)}function $a(a,b,c){var d=!1,e=this.controller,f=e.ia[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ia[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||eb(e,c)} +function ab(a,b){var c=-1,d=this.controller;(a=d.ia[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=eb(d,b)}function bb(a,b,c){var d=!1,e=this.controller;if(a=e.ia[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||eb(e,c)}function fb(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.l;0k&&(t=k);if(!e&&n&&n.size){if(n.type==d){if(f+k<=n.za)return n.Qa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Qa){t=n.size-(f-r);t>k&&(t=k);n.Qa=f-n.za+t;f=r+a.c;k-=t;l++;continue}}return kb(1,f,k)}f=new G(a,f,t,a.c,d,e);cb(f,a.G,n);a.b[l++]=f;f=r+a.c;k-=t}if(0>=k){c/=1024;var D;e="";D?10>>=a.l;0>>=a.l;0>>a.l].Ya(b&a.g,b)}function nb(a,b){return a.b[(b&a.i)>>>a.l].S(b&a.g,b)}Ya.prototype.bb=function(a,b){this.R++;this.b[(a&this.i)>>>this.l].sb(a&this.g,b&255,a);this.R--}; +function ob(a,b,c){a.b[(b&a.i)>>>a.l].Ra(b&a.g,c&65535,b)}function pb(a){for(var b=0,c=[],d=0;da.a.Ia)){var k=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));qb(a,e,e,k,l,n,r,f[4])}}}function sb(a,b){a.o.push(b)}function tb(a,b){a.R||H(a.a,4,b)} -function kb(a,b,c){p("Memory block error ("+a+": "+h(b)+","+h(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Xc:0,Pa:20,nc:0};this.b={$c:0,cb:-1}}x(I);g=I.prototype;g.ka=function(a,b,c,d){this.m=b;this.a=c;this.G=d;var e=this;this.b.cb=ub(c,function(){e.b.la|=128;e.b.la&64&&(vb(e.a,e.b.oc),wb(e.a,e.b.cb,1E3/60))});this.b.oc=xb(64,6);rb(b,this,J);sb(b,this.reset.bind(this));D(this)};g.Lb=function(){var a=this.b.la;this.b.la&=-129;return a}; -g.xc=function(a){this.b.la=a;a&64&&wb(this.a,this.b.cb,1E3/60);this.b.la=a&-129};g.Eb=function(a){return(a?this.c.nc:this.c.data)&65535};g.qc=function(a){this.c.data=a};g.Nb=function(){var a=this.a;return a.A&62337|a.Fa<<5|a.Ga<<1};g.zc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Fa=a>>5&3;b.Ga=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,yb(b))}zb(this)};g.Ob=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Pb=function(){return this.a.$a};g.Qb=function(){return this.a.na}; -g.Ac=function(a){var b=this.a;1170>b.Ia&&(a&=-49);b.na!=a&&(b.na=a,a&16?(b.Wa=4194303,b.Ha=3915776):(b.Wa=262143,b.Ha=253952),yb(b));zb(this)};function zb(a){a.c.Pa=a.c.Pa&-8|(a.a.Ba?a.a.na&16?1:2:4)}g.bc=function(a){return this.a.C[1][a>>1&7]};g.Mc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.$b=function(a){return this.a.C[1][(a>>1&7)+8]};g.Kc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.ac=function(a){return this.a.P[1][a>>1&7]};g.Lc=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295}; -g.Zb=function(a){return this.a.P[1][(a>>1&7)+8]};g.Jc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Kb=function(a){return this.a.C[0][a>>1&7]};g.wc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Ib=function(a){return this.a.C[0][(a>>1&7)+8]};g.uc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Jb=function(a){return this.a.P[0][a>>1&7]};g.vc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Hb=function(a){return this.a.P[0][(a>>1&7)+8]}; -g.tc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.hc=function(a){return this.a.C[3][a>>1&7]};g.Sc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.fc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Qc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.a.P[3][a>>1&7]};g.Rc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.ec=function(a){return this.a.P[3][(a>>1&7)+8]};g.Pc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295}; -g.ua=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Tb=function(){return this.a.u&49152?this.a.X[0]:this.a.f[6]};g.Dc=function(a){this.a.u&49152?this.a.X[0]=a:this.a.f[6]=a};g.Wb=function(){return this.a.f[7]};g.Gc=function(a){this.a.f[7]=a};g.va=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.xa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a}; -g.Ub=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[1]};g.Ec=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[1]=a};g.Vb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[3]};g.Fc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[3]=a};g.Gb=function(a){return this.a.pb[a-65504>>1]};g.sc=function(a,b){this.a.pb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.ub=function(){};g.dc=function(){return 1};g.Oc=function(){};g.Fb=function(){return this.a.F}; -g.rc=function(){this.a.F=0};g.Mb=function(){return this.a.ob};g.yc=function(a,b){b&1||(a&=255);this.a.ob=a};g.Rb=function(a){return a?this.a.ab:0};g.Bc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ab=a;b.j|=2};g.cc=function(a){return a?this.a.oa&65280:0};g.Nc=function(a){this.a.oa=a|255};g.Sb=function(){return Xa(this.a)};g.Cc=function(a){Ab(this.a,a&-1809|Xa(this.a)&1808);this.a.j|=128};g.tb=function(){};g.reset=function(){this.c.Pa=this.c.Pa&-120|20;this.b.la=0}; +function kb(a,b,c){p("Memory block error ("+a+": "+h(b)+","+h(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Xc:0,Pa:20,nc:0};this.b={$c:0,cb:-1}}x(I);g=I.prototype;g.ca=function(a,b,c,d){this.l=b;this.a=c;this.G=d;var e=this;this.b.cb=ub(c,function(){e.b.la|=128;e.b.la&64&&(vb(e.a,e.b.oc),wb(e.a,e.b.cb,1E3/60))});this.b.oc=xb(64,6);rb(b,this,J);sb(b,this.reset.bind(this));C(this)};g.reset=function(){this.c.Pa=this.c.Pa&-120|20;this.b.la=0}; +g.Lb=function(){var a=this.b.la;this.b.la&=-129;return a};g.xc=function(a){this.b.la=a;a&64&&wb(this.a,this.b.cb,1E3/60);this.b.la=a&-129};g.Eb=function(a){return(a?this.c.nc:this.c.data)&65535};g.qc=function(a){this.c.data=a};g.Nb=function(){var a=this.a;return a.A&62337|a.Fa<<5|a.Ga<<1};g.zc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Fa=a>>5&3;b.Ga=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,yb(b))}zb(this)}; +g.Ob=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Pb=function(){return this.a.$a};g.Qb=function(){return this.a.na};g.Ac=function(a){var b=this.a;1170>b.Ia&&(a&=-49);b.na!=a&&(b.na=a,a&16?(b.Wa=4194303,b.Ha=3915776):(b.Wa=262143,b.Ha=253952),yb(b));zb(this)};function zb(a){a.c.Pa=a.c.Pa&-8|(a.a.Ba?a.a.na&16?1:2:4)}g.bc=function(a){return this.a.C[1][a>>1&7]};g.Mc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.$b=function(a){return this.a.C[1][(a>>1&7)+8]}; +g.Kc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.ac=function(a){return this.a.P[1][a>>1&7]};g.Lc=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Zb=function(a){return this.a.P[1][(a>>1&7)+8]};g.Jc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Kb=function(a){return this.a.C[0][a>>1&7]};g.wc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Ib=function(a){return this.a.C[0][(a>>1&7)+8]};g.uc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295}; +g.Jb=function(a){return this.a.P[0][a>>1&7]};g.vc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Hb=function(a){return this.a.P[0][(a>>1&7)+8]};g.tc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.hc=function(a){return this.a.C[3][a>>1&7]};g.Sc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.fc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Qc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.a.P[3][a>>1&7]}; +g.Rc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.ec=function(a){return this.a.P[3][(a>>1&7)+8]};g.Pc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.ua=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Tb=function(){return this.a.u&49152?this.a.Z[0]:this.a.f[6]};g.Dc=function(a){this.a.u&49152?this.a.Z[0]=a:this.a.f[6]=a};g.Wb=function(){return this.a.f[7]}; +g.Gc=function(a){this.a.f[7]=a};g.va=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.xa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a};g.Ub=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.Z[1]};g.Ec=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.Z[1]=a};g.Vb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.Z[3]};g.Fc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.Z[3]=a};g.Gb=function(a){return this.a.pb[a-65504>>1]}; +g.sc=function(a,b){this.a.pb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.ub=function(){};g.dc=function(){return 1};g.Oc=function(){};g.Fb=function(){return this.a.F};g.rc=function(){this.a.F=0};g.Mb=function(){return this.a.ob};g.yc=function(a,b){b&1||(a&=255);this.a.ob=a};g.Rb=function(a){return a?this.a.ab:0};g.Bc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ab=a;b.j|=2};g.cc=function(a){return a?this.a.oa&65280:0};g.Nc=function(a){this.a.oa=a|255}; +g.Sb=function(){return Xa(this.a)};g.Cc=function(a){Ab(this.a,a&-1809|Xa(this.a)&1808);this.a.j|=128};g.tb=function(){}; var K={},J=(K[62592]=[null,null,I.prototype.bc,I.prototype.Mc,"SISDR",1145],K[62608]=[null,null,I.prototype.$b,I.prototype.Kc,"SDSDR",1145],K[62624]=[null,null,I.prototype.ac,I.prototype.Lc,"SISAR",1145],K[62640]=[null,null,I.prototype.Zb,I.prototype.Jc,"SDSAR",1145],K[62656]=[null,null,I.prototype.Kb,I.prototype.wc,"KISDR",1145],K[62672]=[null,null,I.prototype.Ib,I.prototype.uc,"KDSDR",1145],K[62688]=[null,null,I.prototype.Jb,I.prototype.vc,"KISAR",1145],K[62704]=[null,null,I.prototype.Hb,I.prototype.tc, "KDSAR",1145],K[62798]=[null,null,I.prototype.Qb,I.prototype.Ac,"MMR3",1145],K[65382]=[null,null,I.prototype.Lb,I.prototype.xc,"LKS"],K[65400]=[null,null,I.prototype.Eb,I.prototype.qc,"CNSL"],K[65402]=[null,null,I.prototype.Nb,I.prototype.zc,"MMR0",1145],K[65404]=[null,null,I.prototype.Ob,I.prototype.tb,"MMR1",1145],K[65406]=[null,null,I.prototype.Pb,I.prototype.tb,"MMR2",1145],K[65408]=[null,null,I.prototype.hc,I.prototype.Sc,"UISDR",1145],K[65424]=[null,null,I.prototype.fc,I.prototype.Qc,"UDSDR", 1145],K[65440]=[null,null,I.prototype.gc,I.prototype.Rc,"UISAR",1145],K[65456]=[null,null,I.prototype.ec,I.prototype.Pc,"UDSAR",1145],K[65472]=[null,null,I.prototype.ua,I.prototype.wa,"R0SET0"],K[65473]=[null,null,I.prototype.ua,I.prototype.wa,"R1SET0"],K[65474]=[null,null,I.prototype.ua,I.prototype.wa,"R2SET0"],K[65475]=[null,null,I.prototype.ua,I.prototype.wa,"R3SET0"],K[65476]=[null,null,I.prototype.ua,I.prototype.wa,"R4SET0"],K[65477]=[null,null,I.prototype.ua,I.prototype.wa,"R5SET0"],K[65478]= @@ -76,106 +78,107 @@ K[65486]=[null,null,I.prototype.Ub,I.prototype.Ec,"R6SUPER",1145],K[65487]=[null "MB",1170],K[65530]=[null,null,I.prototype.Rb,I.prototype.Bc,"PIR"],K[65532]=[null,null,I.prototype.cc,I.prototype.Nc,"SL"],K[65534]=[null,null,I.prototype.Sb,I.prototype.Cc,"PSW"],K);J[62594]=J[62592];J[62596]=J[62592];J[62598]=J[62592];J[62600]=J[62592];J[62602]=J[62592];J[62604]=J[62592];J[62606]=J[62592];J[62610]=J[62608];J[62612]=J[62608];J[62614]=J[62608];J[62616]=J[62608];J[62618]=J[62608];J[62620]=J[62608];J[62622]=J[62608];J[62626]=J[62624];J[62628]=J[62624];J[62630]=J[62624];J[62632]=J[62624]; J[62634]=J[62624];J[62636]=J[62624];J[62638]=J[62624];J[62642]=J[62640];J[62644]=J[62640];J[62646]=J[62640];J[62648]=J[62640];J[62650]=J[62640];J[62652]=J[62640];J[62654]=J[62640];J[62658]=J[62656];J[62660]=J[62656];J[62662]=J[62656];J[62664]=J[62656];J[62666]=J[62656];J[62668]=J[62656];J[62670]=J[62656];J[62674]=J[62672];J[62676]=J[62672];J[62678]=J[62672];J[62680]=J[62672];J[62682]=J[62672];J[62684]=J[62672];J[62686]=J[62672];J[62690]=J[62688];J[62692]=J[62688];J[62694]=J[62688];J[62696]=J[62688]; J[62698]=J[62688];J[62700]=J[62688];J[62702]=J[62688];J[62706]=J[62704];J[62708]=J[62704];J[62710]=J[62704];J[62712]=J[62704];J[62714]=J[62704];J[62716]=J[62704];J[62718]=J[62704];J[65410]=J[65408];J[65412]=J[65408];J[65414]=J[65408];J[65416]=J[65408];J[65418]=J[65408];J[65420]=J[65408];J[65422]=J[65408];J[65426]=J[65424];J[65428]=J[65424];J[65430]=J[65424];J[65432]=J[65424];J[65434]=J[65424];J[65436]=J[65424];J[65438]=J[65424];J[65442]=J[65440];J[65444]=J[65440];J[65446]=J[65440];J[65448]=J[65440]; -J[65450]=J[65440];J[65452]=J[65440];J[65454]=J[65440];J[65458]=J[65456];J[65460]=J[65456];J[65462]=J[65456];J[65464]=J[65456];J[65466]=J[65456];J[65468]=J[65456];J[65470]=J[65456];J[65506]=J[65504];J[65508]=J[65504];J[65510]=J[65504];J[65512]=J[65504];J[65514]=J[65504];J[65516]=J[65504];J[65518]=J[65504];u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),Hb(this,Db?Ib:Jb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},Y:function(a,b){a&1&&tb(this.m,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ia=!0},H:function(a,b){return this.I(a,b)}, -R:function(a,b){return this.V(a,b)},$:function(a,b,c){this.v||this.sb(a,b,c)},ga:function(a,b,c){this.v||this.pa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},N:function(a,b){a&1&&tb(this.m,b);return this.g.getUint16(a,!0)},W:function(a,b){a&1&&tb(this.m,b);return this.o[a>>1]},Z:function(a,b){this.c[a]=b;this.ia=!0},da:function(a,b){this.c[a]=b;this.ia=!0},fa:function(a,b,c){a&1&&tb(this.m,c);this.g.setUint16(a,b,!0);this.ia=!0},qa:function(a,b,c){a&1&&tb(this.m,c);this.o[a>> -1]=b;this.ia=!0}};function cb(a,b,c){a.G=b;a.i=a.l=0;c&&((a.i=c.i)&&Lb(a,Mb,!1),(a.l=c.l)&&Nb(a,Mb,!1))}function Nb(a,b,c){c&&a.l||(a.eb=!a.v&&b[1]||a.A,a.Ra=!a.v&&b[3]||a.B);if(c||void 0===c)a.sb=b[1]||a.A,a.pa=b[3]||a.B}function Lb(a,b,c){c&&a.i||(a.Ya=b[0]||a.w,a.S=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.V=b[2]||a.s}function Hb(a,b){b||(b=Ob);Lb(a,b,void 0);Nb(a,b,void 0)} -var Ob=[],Kb=[G.prototype.M,G.prototype.ea,G.prototype.Y,G.prototype.ra],Mb=[G.prototype.H,G.prototype.$,G.prototype.R,G.prototype.ga];if(Sa)var Jb=[G.prototype.D,G.prototype.Z,G.prototype.N,G.prototype.fa],Ib=[G.prototype.J,G.prototype.da,G.prototype.W,G.prototype.qa]; -function Pb(a,b){v.call(this,"CPU",a,Pb);var c=a.multiplier||1;this.La=a.cycles||b;this.$=c;this.Va=Math.round(this.La/1E4)/100;this.da=this.Va*this.$;this.h.T=!1;this.h.qb=!1;this.h.Aa=a.autoStart;this.h.Ma=!1;this.Ja=this.fa=0;this.Ka=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.H=[];this.mb=this.mc.bind(this);D(this)}x(Pb);var Qb=["power","reset"];g=Pb.prototype; -g.ka=function(a,b,c,d){this.w=a;this.m=b;this.G=d;for(b=0;ba.Y/a.da&&(b=1),a.$=b,b=a.Va*a.$,a.da!=b)){a.da=b;b=a.da.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.O("target speed: "+b)}a.J+=a.V;a.V=0;a.N=sa();a.Z=0;Wb(a)}function ub(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function wb(a,b,c){0<=b&&ba.H[b][0]&&(c=a.La*a.$/1E3*c|0,a.H[b][0]=c+Yb(a))}function Yb(a,b){var c=a.ea-=a.a;a.a=0;b&&(a.ea=0);return c} -g.mc=function(){if(this.h.T){this.Xa>=this.La&&Wb(this,!0);this.ya=0;this.Da=sa();if(this.Z){var a=this.Da-this.Z;a>this.kb&&(this.N+=a,this.N>this.Da&&(this.N=this.Da))}try{do{for(var b,c=this.h.Ma?1:this.Na,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.rb(b)}catch(n){if("number"!=typeof n)throw n;}b=Yb(this,!0);this.ya+=b;this.V+=b;a=b;if(this.h.Ma){var f=!1;this.Ja=this.Ja+this.hb()|0;this.fa-=a;0>=this.fa&&(this.fa+=this.pa,f=!0);0<=this.qa&&this.qa<=Xb(this)&& -(this.pa=this.qa=-1,Tb(this),E(this),f=!0);f&&this.O(Xb(this)+" cycles: checksum="+h(this.Ja))}for(var a=b,k=this.H.length-1;0<=k;k--){var l=this.H[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ra-=b;if(0>=this.ra){this.ra+=this.Na;15<=++this.lb&&(this.w&&this.w.ca(),this.lb=0);break}}while(this.h.T)}catch(n){E(this);this.w&&this.w.stop(sa(),Xb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.mb;this.Z=sa();d=this.kb;this.ya&&(d=Math.round(d*this.ya/ -this.Na));d-=this.Z-this.Da;if(e=this.Z-this.N)this.Y=Math.round(this.V/(10*e))/100,864E5<=e&&(this.J=0,Vb(this));if(0>d||this.Yd&&(this.N-=d),d=0;this.Xa+=this.ya;this.Z+=d;b(c,d)}}};function Ub(a){var b;a.h.error?(a.O(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.O(a.toString()+" busy");else{Vb(a);a.h.T=!0;a.h.qb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.N,Xb(a));setTimeout(a.mb,0)}}g.rb=function(){return 0}; -function E(a){if(a.h.T){Yb(a);a.J+=a.V;a.V=0;a.h.T=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(sa(),Xb(a))}a.h.complete=void 0}function Zb(a){this.Ia=+a.model||1170;this.Cb=a.resetAddr||0;Pb.call(this,a,6666667);this.decode=1120==this.Ia?$b.bind(this):ac.bind(this);bc(this);this.R=0;this.W=null;this.h.complete=this.h.wb=!1}x(Zb,Pb);g=Zb.prototype;g.reset=function(){this.status("model "+this.Ia);this.h.T&&E(this);bc(this);Sb(this);this.h.error=!1;this.parent.reset.call(this)}; -function bc(a){a.l=65536;a.g=32768;a.i=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.Cb];a.sa=[0,0,0,0,0,0];a.X=[0,0,0,0];a.s=0;a.Ga=0;a.Ab=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Db=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.pb=[0,0,0,0,0,0,0,0];a.ob=0;a.j=0;a.B=a.D=0;a.c=a.b=a.Ta=0;a.ga=-1;cc(a)}function cc(a){a.oa=255;a.F=0;a.ab=0;a.A=0;a.ma=0;a.$a=0;a.na=0;a.Ba=0;a.Fa=0;a.Wa=262143;a.Ha=253952;a.j|=2;a.m&&yb(a)}function yb(a){a.Ba?(a.M=65536,a.I=a.zb,a.S=a.jc,a.Ra=a.Uc,fb(a.m,a.na&16?22:18)):(a.M=0,a.I=a.yb,a.S=a.ic,a.Ra=a.Tc,fb(a.m,16))}g.hb=function(){return 0}; -g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.J,this.$]);a.set(2,pb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Vb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c>14&3;c=a.u>>14&3;a.s!=c&&(a.X[c]=a.f[6],a.f[6]=a.X[a.s]);a.u=b;a.j|=2}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.l=b,a.g=c||0)}function ec(a,b,c,d){a.j&128||(a.o=a.i=a.l=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.l=b,a.g=a.o^a.l>>1)}function fc(a,b,c,d){a.j&128||(a.o=a.i=a.l=b,a.g=(c^d)&(d^b))} -function H(a,b,c){if(!a.R){var d=!1;0>a.ga?a.ga=Xa(a):a.s||(b=4,d=!0);a.A&57344||(a.ma=63222,a.$a=b);a.s=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);Ab(a,f&-12289|a.ga>>2&12288);d&&(a.F|=4,a.f[6]=4);gc(a,a.ga);gc(a,a.f[7]);a.f[7]=e&65535;a.j&=-113;a.ga=-1;if(26!=c)throw b;}}function hc(a){var b=ic(a),c=ic(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;Ab(a,c);a.j&=-17} -function jc(a,b,c){var d,e,f,k=0;d=b>>13;a.na&a.Ab[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Db[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ha&&4186112>f&&(a.F|=32,H(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: -128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Fa=a.s,a.Ga=d;k&&(k&57344&&(0<=a.ga&&(k|=128),a.A&57344||(a.A=a.A|k|a.Fa<<5|a.Ga<<1),H(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.m].eb(b&a.g,c&255,b)}function ic(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b} -function gc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.ma=a.ma<<8|246);!a.s&&c<=a.oa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.S(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.S(e)|k;a.a-= -8;break;case 6:return e=dc(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=dc(a),e=e+a.f[c]&65535,e=a.S(e|a.M)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.ma=a.ma<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,24)):(a.F|=8,a.j|=64));return e}g.bb=function(a,b){this.Ba?(this.R++,kc(this,jc(this,a,5),b),this.R--):this.m.bb(a,b)};g.yb=function(a,b,c){return lc(this,a,b,c)};g.zb=function(a,b,c){return jc(this,lc(this,a,b,c),c)}; -g.ic=function(a){return nb(this.m,a)};g.jc=function(a){return nb(this.m,jc(this,a,2))};g.Tc=function(a,b){ob(this.m,a,b&65535)};g.Uc=function(a,b){ob(this.m,jc(this,a,4),b)};function mc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=lc(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.S(d|c&a.M),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.X[a.u>>12&3];return c} -function nc(a,b,c,d){a.A&57344||(a.ma=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=lc(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=jc(a,e|c&65536,4),a.s=a.u>>14&3,ob(a.m,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.X[a.u>>12&3]=d}function oc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=mb(a.m,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?nb(a.m,a.I(b,c,2)):a.f[c]}function pc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return lc(a,b,c,8)} -function qc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=mb(a.m,c)):a=a.f[c]&255;return a}function rc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?nb(a.m,a.I(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Ta=a.I(b,e,7),kc(a,e,d.call(a,c,mb(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),ob(a.m,e,d.call(a,c,nb(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} -function sc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?kc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function tc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?ob(a.m,a.I(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} -g.rb=function(a){this.h.complete=!0;this.h.wb=!1;this.h.qb=!1;this.ea=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168,28):this.j&64?H(this,4,30):this.j&16&&H(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.ab&224)>>5;if(a=this.W&&this.W.ta>c?this.W:null)b=a.pc,c=a.ta;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),H(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j& -1&&this.j++;this.A&57344||(this.ma=0,this.$a=this.f[7]);this.j=this.j&7|this.u&16;this.decode(dc(this))}while(0>1|b<<16;P(this,a);return a&65535}function zc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function Ac(a,b){a=b&~a;N(this,a);return a}function Bc(a,b){a=b&~a;N(this,a<<8);return a}function Cc(a,b){a|=b;N(this,a);return a}function Dc(a,b){a|=b;N(this,a<<8);return a}function Ec(a,b){a=~b|65536;O(this,a);return a&65535}function Fc(a,b){a=~b|256;O(this,a<<8);return a&255} -function Gc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function Hc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function Ic(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function Jc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function Kc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Lc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} -function Mc(a,b){a=b<<1|this.l>>16&1;P(this,a);return a&65535}function Nc(a,b){a=b<<1|this.l>>16&1;P(this,a<<8);return a&255}function Oc(a,b){a=(this.l&65536|b)>>1|b<<16;P(this,a);return a&65535}function Pc(a,b){a=((this.l&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Qc(a,b){var c=b-a;fc(this,c,a,b);return c&65535}function Rc(a,b){var c=b-a;fc(this,c<<8,a<<8,b<<8);return c&255}function Sc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.l=0);return(b<<8|b>>8)&65535} -function Tc(a,b){a^=b;N(this,a);return a&65535}function Uc(a){S(this,a,Q(this,a),uc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Vc(a){var b=rc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.l=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.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b} -function Wc(a){var b=rc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.l=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.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Xc(a){T(this,a,!M(this))}function Yc(a){T(this,a,M(this))} -function Zc(a){S(this,a,Q(this,a),Ac);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function $c(a){R(this,a,oc(this,a),Bc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ad(a){S(this,a,Q(this,a),Cc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function bd(a){R(this,a,oc(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function cd(a){N(this,Q(this,a)&rc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function dd(a){N(this,(oc(this,a)&qc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ed(a){T(this,a,this.i&65535?0:4)}function fd(a){T(this,a,!this.ja()==!(this.g&32768))}function gd(a){T(this,a,!!(this.i&65535)&&!this.ja()==!(this.g&32768))}function hd(a){T(this,a,!M(this)&&!!(this.i&65535))} -function id(a){T(this,a,(this.i&65535?0:4)||!this.ja()!=!(this.g&32768))}function jd(a){T(this,a,M(this)||(this.i&65535?0:4))}function kd(a){T(this,a,!this.ja()!=!(this.g&32768))}function ld(a){T(this,a,this.ja())}function md(a){T(this,a,!!(this.i&65535))}function nd(a){T(this,a,!this.ja())}function od(){H(this,12,1);this.a-=5}function pd(a){T(this,a,!0)}function qd(a){T(this,a,!(this.g&32768))}function rd(a){T(this,a,this.g&32768?2:0)} -function U(a){a&1&&(this.l=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}function sd(a){var b=Q(this,a);a=rc(this,a);fc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function td(a){var b=oc(this,a)<<8;a=qc(this,a)<<8;fc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} -function ud(a){var b=rc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.l=65536,this.a-=7}function vd(){H(this,24,2);this.a-=25}function wd(){this.u&49152?(this.F|=128,H(this,4,3)):E(this);this.a-=7} -function xd(){H(this,16,4);this.a-=25}var yd=[0,7,7,10,7,11,9,13];function V(a){var b=this.a;a=pc(this,a);this.f[7]=a&65535;this.a=b-yd[this.c]}var zd=[0,14,14,17,14,18,16,20];function Ad(a){var b=this.a,c=pc(this,a);a=a>>6&7;gc(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-zd[this.c]}var Bd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Cd(a){var b=Q(this,a),c=this.a;N(this,tc(this,a,b));this.a=c-Bd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)} -function Dd(a){var b=oc(this,a);N(this,sc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Ed=[7,13,13,17,14,18,17,21];function Fd(a){var b=rc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.l=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Md(a){S(this,a,Q(this,a),Qc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} -function X(a){S(this,a,0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)}function Nd(){H(this,28,5);this.a-=5}function Od(){this.j&4||this.w.ca();this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Pd(a){S(this,a,Q(this,a),Tc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){H(this,8,6)}function $b(a){Qd[a>>12].call(this,a)}function Rd(a){Sd[a>>6&3].call(this,a)}function Td(a){Ud[a>>6&3].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a&15].call(this,a)} -function Zd(a){$d[a&15].call(this,a)}function ae(a){be[a>>6&3].call(this,a)}function ce(a){de[a>>6&3].call(this,a)}function ee(a){fe[a>>6&3].call(this,a)} -var Qd=[function(a){ge[a>>8&15].call(this,a)},Cd,sd,cd,Zc,ad,Uc,Y,function(a){he[a>>8&15].call(this,a)},Dd,td,dd,$c,bd,Md,Y],ge=[function(a){ie[a>>4&15].call(this,a)},pd,md,ed,fd,kd,gd,id,Ad,Ad,Rd,Td,Vd,Y,Y,Y],Sd=[function(a){O(this,tc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Gc);this.a-=this.c?9:3+(7==this.b?2:0)}],Ud=[function(a){S(this,a,0,Kc); -this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=rc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Wd=[function(a){S(this,a,0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Mc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,wc);this.a-=this.c?9:3+(7==this.b?2:0)}],ie=[function(a){je[a& -15].call(this,a)},Y,Y,Y,V,V,V,V,Jd,Y,Xd,Zd,X,X,X,X],je=[wd,Od,Id,od,xd,Hd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Yd=[Gd,function(){this.l=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.i=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],$d=[Gd,function(){this.l=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],he=[nd,ld,hd,jd,qd,rd,Xc,Yc,vd,Nd,ae,ce,ee,Y,Y,Y],be=[function(a){O(this,sc(this,a,0)); -this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Hc);this.a-=this.c?9:3+(7==this.b?2:0)}],de=[function(a){R(this,a,0,Lc);this.a-=this.c?11:6},function(a){R(this,a,M(this)?1:0,vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,M(this)?1:0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=qc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],fe= -[function(a){R(this,a,0,Pc);this.a-=this.c?9+(this.Ta&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Nc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,zc);this.a-=this.c?9+(this.Ta&1):3+(7==this.b?2:0)},function(a){R(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)}];function ac(a){ke[a>>12].call(this,a)} -var ke=[function(a){le[a>>8&15].call(this,a)},Cd,sd,cd,Zc,ad,Uc,function(a){me[a>>8&15].call(this,a)},function(a){ne[a>>8&15].call(this,a)},Dd,td,dd,$c,bd,Md,Y],le=[function(a){oe[a>>4&15].call(this,a)},pd,md,ed,fd,kd,gd,id,Ad,Ad,Rd,Td,Vd,function(a){pe[a>>6&3].call(this,a)},Y,Y],pe=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.M);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=mc(this,a,0);gc(this,a);N(this,a);this.a-=11},function(a){var b=ic(this), -c=this.a;nc(this,a,0,b);N(this,b);this.a=c-Ed[this.c]},function(a){N(this,tc(this,a,this.ja?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],oe=[function(a){qe[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Jd,function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):H(this,8,6)},Xd,Zd,X,X,X,X],qe=[wd,Od,Id,od,xd,Hd,function(){hc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],me=[Fd,Fd,ud,ud,Vc,Vc,Wc,Wc,Pd,Pd,Y,Y,Y,Y,Kd,Kd],ne=[nd,ld,hd,jd,qd,rd,Xc,Yc,vd,Nd,ae,ce,ee,function(a){re[a>>6&3].call(this, -a)},Y,Y],re=[Y,function(a){a=mc(this,a,65536);gc(this,a);N(this,a);this.a-=11},function(a){var b=ic(this),c=this.a;nc(this,a,65536,b);N(this,b);this.a=c-Ed[this.c]},Y];function se(a){v.call(this,"ROM",a,se);this.b=null;this.o=a.addr;this.c=a.size;this.w=a.writable;this.g=a.alias;this.i=a.file;this.s=ka(this.i);if(this.i){a=this.i;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){te(c,a,b,f)})}}x(se); -se.prototype.ka=function(a,b,c,d){this.m=b;this.a=c;this.G=d;ue(this)};se.prototype.ba=function(){this.l&&(this.G&&this.G.a(this.id,this.o,this.c,this.l),delete this.l);return!0};se.prototype.aa=function(){return!0}; -function te(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Oa(a.Ua,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,k,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),k=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),k=e=0;e>8&255,a.b[k++]=f[e]>>16&255,a.b[k++]=f[e]>>24&255;else a.b=l;a.l=l.symbols;if(!a.b.length){p("Empty ROM: "+b); -return}if(1==a.b.length){p(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ea)return;b=qa(b[1]);if(this.s=Pa(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ba=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -g.aa=function(a){return a?this.save():!0};g.reset=function(){ze(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return ze(this)};function ze(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.Za=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),Ib(this,Eb?Jb:Kb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},$:function(a,b){a&1&&tb(this.l,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},fa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ja=!0},H:function(a,b){return this.I(a,b)}, +R:function(a,b){return this.V(a,b)},ba:function(a,b,c){this.v||this.sb(a,b,c)},ha:function(a,b,c){this.v||this.pa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},N:function(a,b){a&1&&tb(this.l,b);return this.g.getUint16(a,!0)},W:function(a,b){a&1&&tb(this.l,b);return this.o[a>>1]},aa:function(a,b){this.c[a]=b;this.ja=!0},ea:function(a,b){this.c[a]=b;this.ja=!0},ga:function(a,b,c){a&1&&tb(this.l,c);this.g.setUint16(a,b,!0);this.ja=!0},qa:function(a,b,c){a&1&&tb(this.l,c);this.o[a>> +1]=b;this.ja=!0}};function cb(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&Mb(a,Nb,!1),(a.m=c.m)&&Ob(a,Nb,!1))}function Ob(a,b,c){c&&a.m||(a.eb=!a.v&&b[1]||a.A,a.Ra=!a.v&&b[3]||a.B);if(c||void 0===c)a.sb=b[1]||a.A,a.pa=b[3]||a.B}function Mb(a,b,c){c&&a.i||(a.Ya=b[0]||a.w,a.S=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.V=b[2]||a.s}function Ib(a,b){b||(b=Pb);Mb(a,b,void 0);Ob(a,b,void 0)} +var Pb=[],Lb=[G.prototype.M,G.prototype.fa,G.prototype.$,G.prototype.ra],Nb=[G.prototype.H,G.prototype.ba,G.prototype.R,G.prototype.ha];if(Sa)var Kb=[G.prototype.D,G.prototype.aa,G.prototype.N,G.prototype.ga],Jb=[G.prototype.J,G.prototype.ea,G.prototype.W,G.prototype.qa]; +function Qb(a,b){v.call(this,"CPU",a,Qb);var c=a.multiplier||1;this.La=a.cycles||b;this.ba=c;this.Va=Math.round(this.La/1E4)/100;this.ea=this.Va*this.ba;this.h.T=!1;this.h.qb=!1;this.h.Aa=a.autoStart;this.h.Ma=!1;this.Ja=this.ga=0;this.Ka=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.H=[];this.mb=this.mc.bind(this);C(this)}x(Qb);var Rb=["power","reset"];g=Qb.prototype; +g.ca=function(a,b,c,d){this.w=a;this.l=b;this.G=d;for(b=0;ba.$/a.ea&&(b=1),a.ba=b,b=a.Va*a.ba,a.ea!=b)){a.ea=b;b=a.ea.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.O("target speed: "+b)}a.J+=a.V;a.V=0;a.N=sa();a.aa=0;Xb(a)}function ub(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function wb(a,b,c){0<=b&&ba.H[b][0]&&(c=a.La*a.ba/1E3*c|0,a.H[b][0]=c+Zb(a))}function Zb(a,b){var c=a.fa-=a.a;a.a=0;b&&(a.fa=0);return c} +g.mc=function(){if(this.h.T){this.Xa>=this.La&&Xb(this,!0);this.ya=0;this.Da=sa();if(this.aa){var a=this.Da-this.aa;a>this.kb&&(this.N+=a,this.N>this.Da&&(this.N=this.Da))}try{do{for(var b,c=this.h.Ma?1:this.Na,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.rb(b)}catch(n){if("number"!=typeof n)throw n;}b=Zb(this,!0);this.ya+=b;this.V+=b;a=b;if(this.h.Ma){var f=!1;this.Ja=this.Ja+this.hb()|0;this.ga-=a;0>=this.ga&&(this.ga+=this.pa,f=!0);0<=this.qa&&this.qa<=Yb(this)&& +(this.pa=this.qa=-1,Ub(this),E(this),f=!0);f&&this.O(Yb(this)+" cycles: checksum="+h(this.Ja))}for(var a=b,k=this.H.length-1;0<=k;k--){var l=this.H[k];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ra-=b;if(0>=this.ra){this.ra+=this.Na;15<=++this.lb&&(this.w&&this.w.da(),this.lb=0);break}}while(this.h.T)}catch(n){E(this);this.w&&this.w.stop(sa(),Yb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.mb;this.aa=sa();d=this.kb;this.ya&&(d=Math.round(d*this.ya/ +this.Na));d-=this.aa-this.Da;if(e=this.aa-this.N)this.$=Math.round(this.V/(10*e))/100,864E5<=e&&(this.J=0,Wb(this));if(0>d||this.$d&&(this.N-=d),d=0;this.Xa+=this.ya;this.aa+=d;b(c,d)}}};function Vb(a){var b;a.h.error?(a.O(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.O(a.toString()+" busy");else{Wb(a);a.h.T=!0;a.h.qb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.N,Yb(a));setTimeout(a.mb,0)}}g.rb=function(){return 0}; +function E(a){if(a.h.T){Zb(a);a.J+=a.V;a.V=0;a.h.T=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(sa(),Yb(a))}a.h.complete=void 0}function $b(a){this.Ia=+a.model||1170;this.Cb=a.resetAddr||0;Qb.call(this,a,6666667);this.decode=1120==this.Ia?ac.bind(this):bc.bind(this);cc(this);this.R=0;this.W=null;this.h.complete=this.h.wb=!1}x($b,Qb);g=$b.prototype;g.reset=function(){this.status("model "+this.Ia);this.h.T&&E(this);cc(this);Tb(this);this.h.error=!1;this.parent.reset.call(this)}; +function cc(a){a.m=65536;a.g=32768;a.i=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.Cb];a.sa=[0,0,0,0,0,0];a.Z=[0,0,0,0];a.s=0;a.Ga=0;a.Ab=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Db=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.pb=[0,0,0,0,0,0,0,0];a.ob=0;a.j=0;a.B=a.D=0;a.c=a.b=a.Ta=0;a.ha=-1;dc(a)}function dc(a){a.oa=255;a.F=0;a.ab=0;a.A=0;a.ma=0;a.$a=0;a.na=0;a.Ba=0;a.Fa=0;a.Wa=262143;a.Ha=253952;a.j|=2;a.l&&yb(a)}function yb(a){a.Ba?(a.M=65536,a.I=a.zb,a.S=a.jc,a.Ra=a.Uc,fb(a.l,a.na&16?22:18)):(a.M=0,a.I=a.yb,a.S=a.ic,a.Ra=a.Tc,fb(a.l,16))}g.hb=function(){return 0}; +g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.J,this.ba]);a.set(2,pb(this.l));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Wb(this,b[3]);a:{b=this.l;a=a[2];var c;for(c=0;c>14&3;c=a.u>>14&3;a.s!=c&&(a.Z[c]=a.f[6],a.f[6]=a.Z[a.s]);a.u=b;a.j|=2}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function fc(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function gc(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))} +function H(a,b,c){if(!a.R){var d=!1;0>a.ha?a.ha=Xa(a):a.s||(b=4,d=!0);a.A&57344||(a.ma=63222,a.$a=b);a.s=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);Ab(a,f&-12289|a.ha>>2&12288);d&&(a.F|=4,a.f[6]=4);hc(a,a.ha);hc(a,a.f[7]);a.f[7]=e&65535;a.j&=-113;a.ha=-1;if(26!=c)throw b;}}function ic(a){var b=jc(a),c=jc(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;Ab(a,c);a.j&=-17} +function kc(a,b,c){var d,e,f,k=0;d=b>>13;a.na&a.Ab[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Db[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ha&&4186112>f&&(a.F|=32,H(a,4,12))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192: +128;break;default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Fa=a.s,a.Ga=d;k&&(k&57344&&(0<=a.ha&&(k|=128),a.A&57344||(a.A=a.A|k|a.Fa<<5|a.Ga<<1),H(a,168,16)),a.A&61440||!(4191360>f||4194239>>a.l].eb(b&a.g,c&255,b)}function jc(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b} +function hc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.ma=a.ma<<8|246);!a.s&&c<=a.oa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.S(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.S(e)|k;a.a-= +8;break;case 6:return e=ec(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=ec(a),e=e+a.f[c]&65535,e=a.S(e|a.M)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.A&57344||(a.ma=a.ma<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,24)):(a.F|=8,a.j|=64));return e}g.bb=function(a,b){this.Ba?(this.R++,lc(this,kc(this,a,5),b),this.R--):this.l.bb(a,b)};g.yb=function(a,b,c){return mc(this,a,b,c)};g.zb=function(a,b,c){return kc(this,mc(this,a,b,c),c)}; +g.ic=function(a){return nb(this.l,a)};g.jc=function(a){return nb(this.l,kc(this,a,2))};g.Tc=function(a,b){ob(this.l,a,b&65535)};g.Uc=function(a,b){ob(this.l,kc(this,a,4),b)};function nc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=mc(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.S(d|c&a.M),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.Z[a.u>>12&3];return c} +function oc(a,b,c,d){a.A&57344||(a.ma=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=mc(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=kc(a,e|c&65536,4),a.s=a.u>>14&3,ob(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.Z[a.u>>12&3]=d}function pc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=mb(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?nb(a.l,a.I(b,c,2)):a.f[c]}function qc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return mc(a,b,c,8)} +function rc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=mb(a.l,c)):a=a.f[c]&255;return a}function sc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?nb(a.l,a.I(b,c,2)):a.f[c]}function R(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Ta=a.I(b,e,7),lc(a,e,d.call(a,c,mb(a.l,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),ob(a.l,e,d.call(a,c,nb(a.l,e)))):a.f[e]=d.call(a,c,a.f[e])} +function tc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?lc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?ob(a.l,a.I(b,d,4),c):a.f[d]=c&65535;return c}function T(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} +g.rb=function(a){this.h.complete=!0;this.h.wb=!1;this.h.qb=!1;this.fa=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168,28):this.j&64?H(this,4,30):this.j&16&&H(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.ab&224)>>5;if(a=this.W&&this.W.ta>c?this.W:null)b=a.pc,c=a.ta;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),H(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j& +1&&this.j++;this.A&57344||(this.ma=0,this.$a=this.f[7]);this.j=this.j&7|this.u&16;this.decode(ec(this))}while(0>1|b<<16;P(this,a);return a&65535}function Ac(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function Bc(a,b){a=b&~a;N(this,a);return a}function Cc(a,b){a=b&~a;N(this,a<<8);return a}function Dc(a,b){a|=b;N(this,a);return a}function Ec(a,b){a|=b;N(this,a<<8);return a}function Fc(a,b){a=~b|65536;O(this,a);return a&65535}function Gc(a,b){a=~b|256;O(this,a<<8);return a&255} +function Hc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function Ic(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function Jc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function Kc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function Lc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function Mc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255} +function Nc(a,b){a=b<<1|this.m>>16&1;P(this,a);return a&65535}function Oc(a,b){a=b<<1|this.m>>16&1;P(this,a<<8);return a&255}function Pc(a,b){a=(this.m&65536|b)>>1|b<<16;P(this,a);return a&65535}function Qc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Rc(a,b){var c=b-a;gc(this,c,a,b);return c&65535}function Sc(a,b){var c=b-a;gc(this,c<<8,a<<8,b<<8);return c&255}function Tc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535} +function Uc(a,b){a^=b;N(this,a);return a&65535}function Vc(a){S(this,a,Q(this,a),vc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Wc(a){var b=sc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=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.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b} +function Xc(a){var b=sc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=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.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Yc(a){T(this,a,!M(this))}function Zc(a){T(this,a,M(this))} +function $c(a){S(this,a,Q(this,a),Bc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ad(a){R(this,a,pc(this,a),Cc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function bd(a){S(this,a,Q(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function cd(a){R(this,a,pc(this,a),Ec);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function dd(a){N(this,Q(this,a)&sc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ed(a){N(this,(pc(this,a)&rc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function fd(a){T(this,a,this.i&65535?0:4)}function gd(a){T(this,a,!this.ka()==!(this.g&32768))}function hd(a){T(this,a,!!(this.i&65535)&&!this.ka()==!(this.g&32768))}function id(a){T(this,a,!M(this)&&!!(this.i&65535))} +function jd(a){T(this,a,(this.i&65535?0:4)||!this.ka()!=!(this.g&32768))}function kd(a){T(this,a,M(this)||(this.i&65535?0:4))}function ld(a){T(this,a,!this.ka()!=!(this.g&32768))}function md(a){T(this,a,this.ka())}function nd(a){T(this,a,!!(this.i&65535))}function od(a){T(this,a,!this.ka())}function pd(){H(this,12,1);this.a-=5}function qd(a){T(this,a,!0)}function rd(a){T(this,a,!(this.g&32768))}function sd(a){T(this,a,this.g&32768?2:0)} +function U(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}function td(a){var b=Q(this,a);a=sc(this,a);gc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ud(a){var b=pc(this,a)<<8;a=rc(this,a)<<8;gc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} +function vd(a){var b=sc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.m=65536,this.a-=7}function wd(){H(this,24,2);this.a-=25}function xd(){this.u&49152?(this.F|=128,H(this,4,3)):E(this);this.a-=7} +function yd(){H(this,16,4);this.a-=25}var zd=[0,7,7,10,7,11,9,13];function V(a){var b=this.a;a=qc(this,a);this.f[7]=a&65535;this.a=b-zd[this.c]}var Ad=[0,14,14,17,14,18,16,20];function Bd(a){var b=this.a,c=qc(this,a);a=a>>6&7;hc(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Ad[this.c]}var Cd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Dd(a){var b=Q(this,a),c=this.a;N(this,uc(this,a,b));this.a=c-Cd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)} +function Ed(a){var b=pc(this,a);N(this,tc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Fd=[7,13,13,17,14,18,17,21];function Gd(a){var b=sc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Nd(a){S(this,a,Q(this,a),Rc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} +function X(a){S(this,a,0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)}function Od(){H(this,28,5);this.a-=5}function Pd(){this.j&4||this.w.da();this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3}function Qd(a){S(this,a,Q(this,a),Uc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){H(this,8,6)}function ac(a){Rd[a>>12].call(this,a)}function Sd(a){Td[a>>6&3].call(this,a)}function Ud(a){Vd[a>>6&3].call(this,a)}function Wd(a){Xd[a>>6&3].call(this,a)}function Yd(a){Zd[a&15].call(this,a)} +function $d(a){ae[a&15].call(this,a)}function be(a){ce[a>>6&3].call(this,a)}function de(a){ee[a>>6&3].call(this,a)}function fe(a){ge[a>>6&3].call(this,a)} +var Rd=[function(a){he[a>>8&15].call(this,a)},Dd,td,dd,$c,bd,Vc,Y,function(a){ie[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Nd,Y],he=[function(a){je[a>>4&15].call(this,a)},qd,nd,fd,gd,ld,hd,jd,Bd,Bd,Sd,Ud,Wd,Y,Y,Y],Td=[function(a){O(this,uc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Hc);this.a-=this.c?9:3+(7==this.b?2:0)}],Vd=[function(a){S(this,a,0,Lc); +this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=sc(this,a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Xd=[function(a){S(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Nc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)}],je=[function(a){ke[a& +15].call(this,a)},Y,Y,Y,V,V,V,V,Kd,Y,Yd,$d,X,X,X,X],ke=[xd,Pd,Jd,pd,yd,Id,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Zd=[Hd,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},U,function(){this.i=1;this.a-=5},U,U,U,function(){this.o=0;this.a-=5},U,U,U,U,U,U,U],ae=[Hd,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],ie=[od,md,id,kd,rd,sd,Yc,Zc,wd,Od,be,de,fe,Y,Y,Y],ce=[function(a){O(this,tc(this,a,0)); +this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,1,Ic);this.a-=this.c?9:3+(7==this.b?2:0)}],ee=[function(a){R(this,a,0,Mc);this.a-=this.c?11:6},function(a){R(this,a,M(this)?1:0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,M(this)?1:0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=rc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],ge= +[function(a){R(this,a,0,Qc);this.a-=this.c?9+(this.Ta&1):3+(7==this.b?2:0)},function(a){R(this,a,0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){R(this,a,0,Ac);this.a-=this.c?9+(this.Ta&1):3+(7==this.b?2:0)},function(a){R(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)}];function bc(a){le[a>>12].call(this,a)} +var le=[function(a){me[a>>8&15].call(this,a)},Dd,td,dd,$c,bd,Vc,function(a){ne[a>>8&15].call(this,a)},function(a){oe[a>>8&15].call(this,a)},Ed,ud,ed,ad,cd,Nd,Y],me=[function(a){pe[a>>4&15].call(this,a)},qd,nd,fd,gd,ld,hd,jd,Bd,Bd,Sd,Ud,Wd,function(a){qe[a>>6&3].call(this,a)},Y,Y],qe=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.M);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=nc(this,a,0);hc(this,a);N(this,a);this.a-=11},function(a){var b=jc(this), +c=this.a;oc(this,a,0,b);N(this,b);this.a=c-Fd[this.c]},function(a){N(this,uc(this,a,this.ka?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],pe=[function(a){re[a&15].call(this,a)},Y,Y,Y,V,V,V,V,Kd,function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):H(this,8,6)},Yd,$d,X,X,X,X],re=[xd,Pd,Jd,pd,yd,Id,function(){ic(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],ne=[Gd,Gd,vd,vd,Wc,Wc,Xc,Xc,Qd,Qd,Y,Y,Y,Y,Ld,Ld],oe=[od,md,id,kd,rd,sd,Yc,Zc,wd,Od,be,de,fe,function(a){se[a>>6&3].call(this, +a)},Y,Y],se=[Y,function(a){a=nc(this,a,65536);hc(this,a);N(this,a);this.a-=11},function(a){var b=jc(this),c=this.a;oc(this,a,65536,b);N(this,b);this.a=c-Fd[this.c]},Y];function te(a){v.call(this,"ROM",a,te);this.b=null;this.o=a.addr;this.c=a.size;this.w=a.writable;this.g=a.alias;this.i=a.file;this.s=ka(this.i);if(this.i){a=this.i;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){ue(c,a,b,f)})}}x(te); +te.prototype.ca=function(a,b,c,d){this.l=b;this.a=c;this.G=d;ve(this)};te.prototype.Y=function(){this.m&&(this.G&&this.G.a(this.id,this.o,this.c,this.m),delete this.m);return!0};te.prototype.X=function(){return!0}; +function ue(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Oa(a.Ua,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,k,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),k=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),k=e=0;e>8&255,a.b[k++]=f[e]>>16&255,a.b[k++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){p("Empty ROM: "+b); +return}if(1==a.b.length){p(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ea)return;b=qa(b[1]);if(this.s=Pa(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.Y=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +g.X=function(a){return a?this.save():!0};g.reset=function(){Ae(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return Ae(this)};function Ae(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.Za=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.l){if(10==a||1024<=this.l.length)this.O(this.l), -this.l="";10!=a&&(this.l+=String.fromCharCode(a))}this.c&=-129;wb(this.a,this.J,1)}};var Ae={},ye=(Ae[65392]=[null,null,Z.prototype.Yb,Z.prototype.Ic,"RCSR"],Ae[65394]=[null,null,Z.prototype.Xb,Z.prototype.Hc,"RBUF"],Ae[65396]=[null,null,Z.prototype.lc,Z.prototype.Wc,"XCSR"],Ae[65398]=[null,null,Z.prototype.kc,Z.prototype.Vc,"XBUF"],Ae);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.O("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bDe){if(Fe(d,this.s)){this.l=new L(this,"1.30.1","failsafe");Fe(this.l)&&(Ke(this,d),a=2,Le(this.l));this.l.set("timestamp",ta());Me(this.l);var e=this.b&&!this.o;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Je(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Fe(d,k):("error"== -f&&"no machine state"!=k?(this.K("Error: "+k),"unable to verify user"==k&&(ya("user",""),this.c=null)):this.O(f+": "+k),Le(d),Fe(d)?(c=Je(d),e=!0):c=!1))}e&&Ie(this,c?d:null)}else 2==a&&d.clear()}else Ie(this);delete this.s;delete this.A}e=y(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.h.L=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Ne(this,this.a,b,c,a),this.a.Aa());this.H&&(Ke(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0}; -function Ke(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.N;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}} -function Oe(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),k=new L(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.aa&&(c&&E(a.a),d=a.a.aa(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],k);Ve(a,b,c)}})}else c(a,null)} -function We(a,b,c,d){function e(a){if(void 0===l){var b=k&&C(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--Se||Fa(!0));n=!1}var k,l,n=!0;Se++;Na[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],B=document.createElement("style");B.type="text/css";B.styleSheet?B.styleSheet.cssText=r:B.appendChild(document.createTextNode(r));t.appendChild(B)}c|| -(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?Te(c,null,null,!1,e,function(d,n){n?(Oa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--Se||Fa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--Se||Fa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Te(b,a,d,!0,e,r):Ue(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Ld){f(Ld.message)}return n}window.embedPDP11=function(a,b,c,d){Fa(!1);return We(a,b,c,d)};window.enableEvents=Fa;window.sendEvent=Ga;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map +g.Vc=function(a){if(a&=255){this.A&&this.A.call(this.s,a);if(this.g)if(13==a)this.o=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.O(this.m), +this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;wb(this.a,this.J,1)}};var Be={},ze=(Be[65392]=[null,null,Z.prototype.Yb,Z.prototype.Ic,"RCSR"],Be[65394]=[null,null,Z.prototype.Xb,Z.prototype.Hc,"RBUF"],Be[65396]=[null,null,Z.prototype.lc,Z.prototype.Wc,"XCSR"],Be[65398]=[null,null,Z.prototype.kc,Z.prototype.Vc,"XBUF"],Be);u(function(){for(var a=B(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.O("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bEe){if(Ge(d,this.s)){this.m=new L(this,"1.30.1","failsafe");Ge(this.m)&&(Le(this,d),a=2,Me(this.m));this.m.set("timestamp",ta());Ne(this.m);var e=this.b&&!this.o;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ke(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?Ge(d,k):("error"== +f&&"no machine state"!=k?(this.K("Error: "+k),"unable to verify user"==k&&(ya("user",""),this.c=null)):this.O(f+": "+k),Me(d),Ge(d)?(c=Ke(d),e=!0):c=!1))}e&&Je(this,c?d:null)}else 2==a&&d.clear()}else Je(this);delete this.s;delete this.A}e=y(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.h.L=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Oe(this,this.a,b,c,a),this.a.Aa());this.H&&(Le(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0}; +function Le(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.N;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}} +function Pe(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),k=new L(a,"1.30.1","validate"),l=ta();k.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.X&&(c&&E(a.a),d=a.a.X(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,k,l){if(l||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],r,t=/( [a-z]+=)(['"])(.*?)\2/g;r=t.exec(f);)n=0>n.indexOf(r[1])?n.replace(">",r[0]+">"):n.replace(new RegExp(r[1]+"(['\"])(.*?)\\1"),r[0]);l[0]!=n&&(k=k.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);We(a,b,c)}})}else c(a,null)} +function Xe(a,b,c,d){function e(a){if(void 0===l){var b=k&&B(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--Te||Fa(!0));n=!1}var k,l,n=!0;Te++;Na[a]={};try{if(k=document.getElementById(a)){var r;if("object"==typeof resources&&(r=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css";D.styleSheet?D.styleSheet.cssText=r:D.appendChild(document.createTextNode(r));t.appendChild(D)}c|| +(c="/versions/pdpjs/1.30.1/components.xsl");r=function(d,l){l?Ue(c,null,null,!1,e,function(d,n){n?(Oa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(k.outerHTML=n,--Te||Fa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--Te||Fa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ue(b,a,d,!0,e,r):Ve(b,null,a,d,!1,e,r)}else f("missing machine element: "+a)}catch(Md){f(Md.message)}return n}window.embedPDP11=function(a,b,c,d){Fa(!1);return Xe(a,b,c,d)};window.enableEvents=Fa;window.sendEvent=Ga;})();//# sourceMappingURL=/tmp/pdpjs/1.30.1/pdp11.map