Added my first PDP-11 add-on device component (PC11)
This commit is contained in:
parent
b79146880d
commit
0f4cbd6e7b
27 changed files with 1219 additions and 388 deletions
|
|
@ -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/)
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
<computer id="computer" busWidth="16"/>
|
||||
<cpu id="cpu" model="1120" cycles="6666667" resetAddr="0xC000"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<device id="default" name="default"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<device id="default" type="default"/>
|
||||
<device id="pc11" type="pc11"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/test/debugger/terminal.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
<computer id="computer" busWidth="16"/>
|
||||
<cpu id="cpu" model="1120" cycles="6666667" resetAddr="0xC000" autoStart="true"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<device id="default" name="default"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/test/terminal.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<computer id="computer" busWidth="22"/>
|
||||
<cpu id="cpu" model="1170" cycles="6666667" resetAddr="0xC000"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||
<device id="default" name="default"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<computer id="computer" busWidth="22"/>
|
||||
<cpu id="cpu" model="1170" cycles="6666667" resetAddr="0xC000" autoStart="true"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||
<device id="default" name="default"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/front.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<computer id="computer" busWidth="22"/>
|
||||
<cpu id="cpu" model="1170" cycles="6666667" resetAddr="0xC000"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||
<device id="default" name="default"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/test/debugger/terminal.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<computer id="computer" busWidth="22"/>
|
||||
<cpu id="cpu" model="1170" cycles="6666667" resetAddr="0xC000" autoStart="true"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||
<device id="default" name="default"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pdp11/panel/test/terminal.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<computer id="computer" busWidth="22"/>
|
||||
<cpu id="cpu" model="1170" cycles="6666667" resetAddr="0xC000" autoStart="true"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||
<device id="default" name="default"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/debugger/front.xml"/>
|
||||
<debugger id="debugger" base="8" messages="" commands=""/>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<computer id="computer" busWidth="22"/>
|
||||
<cpu id="cpu" model="1170" cycles="6666667" resetAddr="0xC000" autoStart="true"/>
|
||||
<ram id="ram" addr="0x0000" size="0xC000"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/custom/boot.json" writable="true"/>
|
||||
<rom id="rom" addr="0xC000" file="/devices/pdp11/rom/test/boot.json" writable="true"/>
|
||||
<ram id="ram" addr="0x10000" size="0x34000"/>
|
||||
<device id="default" name="default"/>
|
||||
<device id="default" type="default"/>
|
||||
<serial id="dl11" adapter="0"/>
|
||||
<panel ref="/devices/pdp11/panel/1170/front.xml"/>
|
||||
</machine>
|
||||
|
|
|
|||
10
devices/pdp11/rom/README.md
Normal file
10
devices/pdp11/rom/README.md
Normal file
|
|
@ -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))
|
||||
13
devices/pdp11/rom/test/README.md
Normal file
13
devices/pdp11/rom/test/README.md
Normal file
|
|
@ -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).
|
||||
538
devices/pdp11/rom/test/boot.lst
Normal file
538
devices/pdp11/rom/test/boot.lst
Normal file
|
|
@ -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$ ; <DEL>
|
||||
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
|
||||
|
|
@ -712,16 +712,16 @@
|
|||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,name:'<xsl:value-of select="$name"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
236
modules/pdp11/lib/pc11.js
Normal file
236
modules/pdp11/lib/pc11.js
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
/**
|
||||
* @fileoverview Implements the PC11 High-Speed Paper Tape Reader/Punch
|
||||
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a>
|
||||
* @copyright © Jeff Parsons 2012-2016
|
||||
*
|
||||
* This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/gpl.html>.
|
||||
*
|
||||
* 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
|
||||
* <http://pcjs.org/modules/shared/lib/defines.js>.
|
||||
*
|
||||
* 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;
|
||||
|
|
@ -714,16 +714,16 @@
|
|||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,name:'<xsl:value-of select="$name"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -712,16 +712,16 @@
|
|||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,name:'<xsl:value-of select="$name"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -712,16 +712,16 @@
|
|||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,name:'<xsl:value-of select="$name"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -712,16 +712,16 @@
|
|||
|
||||
<xsl:template match="device[not(@ref)]">
|
||||
<xsl:param name="machine" select="''"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
|
||||
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="component">
|
||||
<xsl:with-param name="machine" select="$machine"/>
|
||||
<xsl:with-param name="class">device</xsl:with-param>
|
||||
<xsl:with-param name="parms">,name:'<xsl:value-of select="$name"/>'</xsl:with-param>
|
||||
<xsl:with-param name="parms">,type:'<xsl:value-of select="$type"/>'</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
|
|
@ -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<da.length-1;ea++){var fa=da[ea];fa in ca||(ca[fa]={});ca=ca[fa]}var ga=da[da.length-1],la=ca[ga],ma=la?la:function(a){return Math.log(a)/Math.LN2};
|
||||
ma!=la&&null!=ma&&aa(ca,ga,{configurable:!0,writable:!0,value:ma});
|
||||
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)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ba||(ba[fa]={});ba=ba[fa]}var ga=da[da.length-1],la=ba[ga],ma=la?la:function(a){return Math.log(a)/Math.LN2};
|
||||
ma!=la&&null!=ma&&aa(ba,ga,{configurable:!0,writable:!0,value:ma});
|
||||
function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function oa(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function k(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function pa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function qa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ra(){var a=sa();return-1!==a.indexOf("pcjs.org",a.length-8)}var ta={"&":"&","<":"<",">":">",'"':""","'":"'"};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));0<a?setTimeout(d,0):c()}d()}
|
||||
function Na(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Oa={init:[],show:[],exit:[]},Pa=!1,Qa=!1,Ra=!0;function Sa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ta(a){Oa.init.push(a)}
|
||||
function $a(a){if(Ra)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){n(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ab(a){!Ra&&a?(Ra=!0,Pa&&bb("init"),Qa&&bb("show")):Ra=a}function bb(a){Oa[a]&&$a(Oa[a])}Sa("onload",function(){Pa=!0;$a(Oa.init)});Sa("onpageshow",function(){Qa=!0;$a(Oa.show)});Sa(La("Opera")||La("iOS")?"onunload":"onbeforeunload",function(){$a(Oa.exit)});
|
||||
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.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<t.length;b++){var d=t[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function lb(a){if(void 0!==a){var b;for(b=0;b<t.length;b++)if(t[b].id===a)return t[b]}return null}function mb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<t.length;d++)if(c)c==t[d]&&(c=null);else if(!(a!=t[d].type||b&&t[d].id.indexOf(b)))return t[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){n(c.message+" ("+a+")")}return b}
|
||||
function nb(a,b){b=A(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=z(f))&&g.binding&&a.ra(g.type,g.binding,f,g.value),m=l.length}}}}
|
||||
function A(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ra:function(a,b,c){switch(b){case "clear":return this.J[b]||(this.J[b]=c,c.onclick=function(a){return function(){a.J.print&&(a.J.print.value="")}}(this)),!0;case "print":return this.J[b]||(this.Qa=this.J[b]=c,c.value="",this.g=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.na=function(a){this.g(a,this.Ua)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.Ua+": "+a)},na:function(a,b,c){c=c||this.type;b||n((c?c+": ":"")+a)},Aa:function(){return this.v.ha=!0},za:function(a,b){b&&(this.v.ha=!1);return!0}};function B(a,b,c,d){a.i&&(!0===c||E(a,c|0))&&a.i.message(b,d)}function E(a,b){if(a.i){a===a.i?b|=0:b=b||a.ia;var c=a.i.ia&b;return!!b&&c===b||!!(c&a.i.jc)}return!1}
|
||||
function ob(a,b){if(a.v.Hb)return a.v.jb=!1,a.v.Hb=!1;if(a.v.error)return a.g(a.toString()+" error"),!1;a.v.jb=b;return a.v.jb}function pb(a,b){a.v.jb&&(b?a.v.Hb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.v.jb}function G(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.xb;a.xb=null;b&&b()}}function qb(a,b){b&&(a.v.ready?b():a.xb=b);return a.v.ready}function rb(a){return a.v.error?(a.g(a.toString()+" error"),!0):!1}function Fb(a,b){a.v.error=!0;a.na(b)}
|
||||
function A(a,b){b=B(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=z(f))&&g.binding&&a.oa(g.type,g.binding,f,g.value),m=l.length}}}}
|
||||
function B(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},oa:function(a,b,c){switch(b){case "clear":return this.J[b]||(this.J[b]=c,c.onclick=function(a){return function(){a.J.print&&(a.J.print.value="")}}(this)),!0;case "print":return this.J[b]||(this.Qa=this.J[b]=c,c.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.na=function(a){this.i(a,this.Ua)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.Ua+": "+a)},na:function(a,b,c){c=c||this.type;b||n((c?c+": ":"")+a)},ya:function(){return this.v.ha=!0},xa:function(a,b){b&&(this.v.ha=!1);return!0}};function E(a,b,c,d){a.g&&(!0===c||G(a,c|0))&&a.g.message(b,d)}function G(a,b){if(a.g){a===a.g?b|=0:b=b||a.ia;var c=a.g.ia&b;return!!b&&c===b||!!(c&a.g.jc)}return!1}
|
||||
function nb(a,b){if(a.v.Hb)return a.v.jb=!1,a.v.Hb=!1;if(a.v.error)return a.i(a.toString()+" error"),!1;a.v.jb=b;return a.v.jb}function ob(a,b){a.v.jb&&(b?a.v.Hb=!0:void 0===b&&a.i(a.toString()+" busy"));return a.v.jb}function H(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.xb;a.xb=null;b&&b()}}function pb(a,b){b&&(a.v.ready?b():a.xb=b);return a.v.ready}function qb(a){return a.v.error?(a.i(a.toString()+" error"),!0):!1}function rb(a,b){a.v.error=!0;a.na(b)}
|
||||
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
||||
var Gb="undefined"!==typeof ArrayBuffer,H={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function Hb(a){r.call(this,"Panel",a,Hb);this.f=0;this.v.Tb=!0}u(Hb);h=Hb.prototype;
|
||||
h.ra=function(a,b,c,d){if(this.B&&this.B.ra(a,b,c,d)||this.b&&this.b.ra(a,b,c,d)||this.i&&this.i.ra(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.J[b]=c,this.f++,!0;default:return"rled"==a?(this.J[b]=c,this.f++,!0):this.parent.ra.call(this,a,b,c,d)}};h.Da=function(a,b,c,d){this.B=a;this.A=b;this.b=c;this.i=d};h.Aa=function(a,b){b||Ib();return!0};h.za=function(){return!0};
|
||||
function Jb(a,b,c,d){if(a.J[b]){void 0===c&&(Fb(a,"Value for "+b+" is invalid"),a.b.da());var e=a.i&&a.i.ja||8;c=!a.b.v.ca||a.v.Tb?8==e?oa(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}}function Kb(a,b,c,d){for(var e=0;e<d;e++){var f=a.J[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
h.$=function(a){if(this.f&&(a||!this.b.v.ca||this.v.Tb)){for(a=0;a<this.b.u.length;a++)Jb(this,"R"+a,this.b.u[a]);a=Lb(this.b);Jb(this,"PS",a);Jb(this,"NF",a&8?1:0,1);Jb(this,"ZF",a&4?1:0,1);Jb(this,"VF",a&2?1:0,1);Jb(this,"CF",a&1?1:0,1);Kb(this,"D",this.b.u[0],16);Kb(this,"A",this.b.u[7],22)}};function Ib(){for(var a=!1,b=A(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=lb(e.id);f||(a=!0,f=new Hb(e));nb(f,d);a&&G(f)}}Ta(Ib);
|
||||
function Mb(a,b,c){r.call(this,"Bus",a,Mb,64);this.b=b;this.i=c;this.M=a.busWidth||16;this.j=0;this.K=[];this.G=null;this.H=Math.pow(2,this.M);this.f=this.H-1|0;this.sa=Nb;this.ga=Math.log2(this.sa);this.I=this.sa>>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<this.D;b++)this.W[b]=a;G(this)}u(Mb);var Nb=8192,Tb=Nb-1;
|
||||
function Ob(a,b){var c=-1,d=this.controller,e=d.Ga[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>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.j)-Nb,Wb(a,c,Nb,a.K),a.j=0);b&&(a.j=b,c=(1<<b)-Nb,a.K=Xb(a,c,Nb),a.G?Wb(a,c,Nb,a.G):(Yb(a,c,Nb,Zb,a),a.G=Xb(a,c,Nb)))}}h=Mb.prototype;h.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();Vb(this,16)};function Ub(a,b,c,d){if(a.i&&E(a.i,536870912)&&(B(a.i,"warning: unknown I/O access ("+J(a.i,b)+","+J(a.i,d,c?1:2)+")",!0,!0),$b(a.i)))return 0;a.C||a.b.ea(4,b);return 0}h.Aa=function(a,b){b||this.reset();return!0};
|
||||
function Yb(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.ga;0<g&&l<a.W.length;){var m=a.W[l],p=l*a.sa,q=a.sa-(f-p);q>g&&(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<v&&(v=10):v=c&-65536?10:5;if(null==c||isNaN(c))for(;0<v--;)e="?"+e;else for(;0<v--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+jc[d]+" at "+oa(b));return!0}return ac(2,b,c)}function Xb(a,b,c){var d=[];for(b>>>=a.ga;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.sa;return d}function Wb(a,b,c,d){var e=0;for(b>>>=a.ga;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.sa}}h.lb=function(a){return this.W[(a&this.f)>>>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;d<a.D;d++){var e=a.W[d];if(e.Ha||e.lc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,l=0,m=[];g<e.length;){for(var p=e[g],q=g+1;q<e.length&&e[q]===p;)q++;m[l++]=q-g;m[l++]=p;g=q}m.length<e.length&&(e=m)}c[f]=e}}return c}function lc(a,b,c,d,e,f,g,l){for(;b<=c;b+=2){var m=b&Tb;void 0!==a.Ga[m]?n("I/O address already registered: "+k(b,8,!0)):a.Ga[m]=[d,e,f,g,l||"unknown",!1]}}
|
||||
function mc(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.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<a.length;b++){var c=a[b],d=z(c);switch(d.name){case "default":d=new K(d),nb(d,c)}}});var wc;
|
||||
if(Gb){var xc=new ArrayBuffer(2);(new DataView(xc)).setUint16(0,256,!0);wc=256===(new Uint16Array(xc))[0]}else wc=!1;var yc=wc;
|
||||
function I(a,b,c,d,e,f){this.A=a;this.id=zc+=2;this.b=null;this.w=b;this.tb=c;this.size=d||0;this.type=e||Ac;this.f=e==Bc;this.controller=null;Sb(this);this.Ha=this.lc=!1;if(d)if(f)this.controller=f,this.b=null,Cc(this,f.ic);else if(Gb)this.C=new ArrayBuffer(d),this.G=new DataView(this.C,0,d),this.D=new Uint8Array(this.C,0,d),this.I=new Uint16Array(this.C,0,d>>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<this.b.length;a++)this.b[a]=0;Cc(this,Fc)}else Cc(this)}
|
||||
var Ac=0,Bc=2,Zb=4,jc=["NONE","RAM","ROM","VID","H/W"],zc=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Gb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Gb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ha=!0}return!1},Pa:function(a,b){b?this.B++||Gc(this,Hc,!1):this.j++||Ic(this,Hc,!1)},K:function(){this.i&&E(this.i,128)&&(B(this.i,"attempt to read invalid block %"+
|
||||
k(this.w),!0),this.i.da());return 255},J:function(a,b){this.i&&E(this.i,128)&&(B(this.i,"attempt to write "+k(b,4,!0)+" to invalid block %"+k(this.w),!0),this.i.da())},M:function(a,b){return this.Cb(a++,b++)|this.Cb(a,b)<<8},H:function(a,b,c){this.Fb(a++,b&255,c++);this.Fb(a,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<<a)|b<<a;this.Ha=!0},xa:function(a,b,c){a&1&&oc(this.A,c);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.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<Nc.length;b++)(c=this.J[Nc[b]])&&this.B.ra(null,Nc[b],c);a=Oc(a,"autoStart");null!=a&&(this.v.ib="true"==a?!0:"false"==a?!1:!!a);G(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.Aa=function(a,b){if(!b){if(a&&this.restore){Pc(this);if(!this.restore(a))return!1;Qc(this)}else this.reset();this.i?(a=this.i,a.g("Type ? for help with PDP11 Debugger commands"),a.$(),a.Fa&&(b=a.Fa,a.Fa=null,Rc(a,b))):this.g("No debugger detected")}this.B.$();return!0};h.za=function(a){return a?this.save():!0};h.ib=function(){return this.v.ib||!this.i&&void 0===this.J.run?(this.eb(!0),!0):!1};h.Wb=function(){return 0};
|
||||
function Qc(a){void 0===a.ob&&(a.ob=0);void 0===a.Za&&(a.Za=-1);void 0===a.$a&&(a.$a=-1);a.v.Xa=0<=a.ob&&0<a.Za;a.v.Xa&&(a.nb=0,a.ja=a.ob-a.fa)}function Sc(a,b){if(a.v.Xa){var c=!1;a.nb=a.nb+a.Wb()|0;a.ja-=b;0>=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<l.length&&(b=l[c],b===a||b.v.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.v.ha);c++);c==l.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.xb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ca?d.da():d.eb())},
|
||||
var Fb="undefined"!==typeof ArrayBuffer,I={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function Gb(a){r.call(this,"Panel",a,Gb);this.f=0;this.v.Tb=!0}u(Gb);h=Gb.prototype;
|
||||
h.oa=function(a,b,c,d){if(this.B&&this.B.oa(a,b,c,d)||this.b&&this.b.oa(a,b,c,d)||this.g&&this.g.oa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.J[b]=c,this.f++,!0;default:return"rled"==a?(this.J[b]=c,this.f++,!0):this.parent.oa.call(this,a,b,c,d)}};h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.g=d};h.ya=function(a,b){b||Hb();return!0};h.xa=function(){return!0};
|
||||
function Ib(a,b,c,d){if(a.J[b]){void 0===c&&(rb(a,"Value for "+b+" is invalid"),a.b.da());var e=a.g&&a.g.ja||8;c=!a.b.v.ca||a.v.Tb?8==e?oa(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}}function Jb(a,b,c,d){for(var e=0;e<d;e++){var f=a.J[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
h.$=function(a){if(this.f&&(a||!this.b.v.ca||this.v.Tb)){for(a=0;a<this.b.u.length;a++)Ib(this,"R"+a,this.b.u[a]);a=Kb(this.b);Ib(this,"PS",a);Ib(this,"NF",a&8?1:0,1);Ib(this,"ZF",a&4?1:0,1);Ib(this,"VF",a&2?1:0,1);Ib(this,"CF",a&1?1:0,1);Jb(this,"D",this.b.u[0],16);Jb(this,"A",this.b.u[7],22)}};function Hb(){for(var a=!1,b=B(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=lb(e.id);f||(a=!0,f=new Gb(e));A(f,d);a&&H(f)}}Ta(Hb);
|
||||
function Lb(a,b,c){r.call(this,"Bus",a,Lb,64);this.b=b;this.g=c;this.M=a.busWidth||16;this.j=0;this.K=[];this.G=null;this.H=Math.pow(2,this.M);this.f=this.H-1|0;this.sa=Mb;this.ga=Math.log2(this.sa);this.I=this.sa>>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<this.D;b++)this.W[b]=a;H(this)}u(Lb);var Mb=8192,Sb=Mb-1;
|
||||
function Nb(a,b){var c=-1,d=this.controller,e=d.Ga[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>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.j)-Mb,Vb(a,c,Mb,a.K),a.j=0);b&&(a.j=b,c=(1<<b)-Mb,a.K=Wb(a,c,Mb),a.G?Vb(a,c,Mb,a.G):(Xb(a,c,Mb,Yb,a),a.G=Wb(a,c,Mb)))}}h=Lb.prototype;h.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();Ub(this,16)};function Tb(a,b,c,d){if(a.g&&G(a.g,536870912)&&(E(a.g,"warning: unknown I/O access ("+K(a.g,b)+","+K(a.g,d,c?1:2)+")",!0,!0),Zb(a.g)))return 0;a.C||a.b.ea(4,b);return 0}h.ya=function(a,b){b||this.reset();return!0};
|
||||
function Xb(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.ga;0<g&&l<a.W.length;){var m=a.W[l],p=l*a.sa,q=a.sa-(f-p);q>g&&(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<v&&(v=10):v=c&-65536?10:5;if(null==c||isNaN(c))for(;0<v--;)e="?"+e;else for(;0<v--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+ac[d]+" at "+oa(b));return!0}return $b(2,b,c)}function Wb(a,b,c){var d=[];for(b>>>=a.ga;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.sa;return d}function Vb(a,b,c,d){var e=0;for(b>>>=a.ga;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.sa}}h.lb=function(a){return this.W[(a&this.f)>>>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;d<a.D;d++){var e=a.W[d];if(e.Ha||e.lc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,l=0,m=[];g<e.length;){for(var p=e[g],q=g+1;q<e.length&&e[q]===p;)q++;m[l++]=q-g;m[l++]=p;g=q}m.length<e.length&&(e=m)}c[f]=e}}return c}function kc(a,b,c,d,e,f,g,l){for(;b<=c;b+=2){var m=b&Sb;void 0!==a.Ga[m]?n("I/O address already registered: "+k(b,8,!0)):a.Ga[m]=[d,e,f,g,l||"unknown",!1]}}
|
||||
function lc(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.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<a.length;b++){var c,d=a[b];c=z(d);switch(c.type){case "default":c=new L(c);A(c,d);break;case "pc11":c=new vc(c),A(c,d)}}});var wc;
|
||||
if(Fb){var xc=new ArrayBuffer(2);(new DataView(xc)).setUint16(0,256,!0);wc=256===(new Uint16Array(xc))[0]}else wc=!1;var yc=wc;
|
||||
function J(a,b,c,d,e,f){this.w=a;this.id=zc+=2;this.b=null;this.A=b;this.tb=c;this.size=d||0;this.type=e||Ac;this.f=e==Bc;this.controller=null;Rb(this);this.Ha=this.lc=!1;if(d)if(f)this.controller=f,this.b=null,Cc(this,f.ic);else if(Fb)this.C=new ArrayBuffer(d),this.G=new DataView(this.C,0,d),this.D=new Uint8Array(this.C,0,d),this.I=new Uint16Array(this.C,0,d>>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<this.b.length;a++)this.b[a]=0;Cc(this,Fc)}else Cc(this)}
|
||||
var Ac=0,Bc=2,Yb=4,ac=["NONE","RAM","ROM","VID","H/W"],zc=0;
|
||||
J.prototype={constructor:J,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Fb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Fb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ha=!0}return!1},Pa:function(a,b){b?this.B++||Gc(this,Hc,!1):this.j++||Ic(this,Hc,!1)},K:function(){this.g&&G(this.g,128)&&(E(this.g,"attempt to read invalid block %"+
|
||||
k(this.A),!0),this.g.da());return 255},J:function(a,b){this.g&&G(this.g,128)&&(E(this.g,"attempt to write "+k(b,4,!0)+" to invalid block %"+k(this.A),!0),this.g.da())},M:function(a,b){return this.Cb(a++,b++)|this.Cb(a,b)<<8},H:function(a,b,c){this.Fb(a++,b&255,c++);this.Fb(a,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<<a)|b<<a;this.Ha=!0},za:function(a,b,c){a&1&&nc(this.w,c);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.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<Nc.length;b++)(c=this.J[Nc[b]])&&this.B.oa(null,Nc[b],c);a=Oc(a,"autoStart");null!=a&&(this.v.ib="true"==a?!0:"false"==a?!1:!!a);H(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.ya=function(a,b){if(!b){if(a&&this.restore){Pc(this);if(!this.restore(a))return!1;Qc(this)}else this.reset();this.g?(a=this.g,a.i("Type ? for help with PDP11 Debugger commands"),a.$(),a.Fa&&(b=a.Fa,a.Fa=null,Rc(a,b))):this.i("No debugger detected")}this.B.$();return!0};h.xa=function(a){return a?this.save():!0};h.ib=function(){return this.v.ib||!this.g&&void 0===this.J.run?(this.eb(!0),!0):!1};h.Wb=function(){return 0};
|
||||
function Qc(a){void 0===a.ob&&(a.ob=0);void 0===a.Za&&(a.Za=-1);void 0===a.$a&&(a.$a=-1);a.v.Xa=0<=a.ob&&0<a.Za;a.v.Xa&&(a.nb=0,a.ja=a.ob-a.fa)}function Sc(a,b){if(a.v.Xa){var c=!1;a.nb=a.nb+a.Wb()|0;a.ja-=b;0>=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;c<l.length&&(b=l[c],b===a||b.v.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.v.ha);c++);c==l.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.xb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ca?d.da():d.eb())},
|
||||
!0;case "speed":return this.J[b]=c,!0;case "setSpeed":return this.J[b]=c,c.onclick=function(){Uc(d,d.Ka<<1,!0)},c.textContent=this.Ra.toFixed(2)+"Mhz",!0}return!1};h.$=function(){var a=this.J.speed;a&&(a.textContent=this.v.ca&&this.V?this.V.toFixed(2)+"Mhz":"Stopped")};function Vc(a,b,c){a.fa+=b;c&&(a.ba=a.b=0)}function Wc(a,b){var c=1;b&&1<a.Ka&&a.V&&(c=a.V/a.Va);a.wb=Math.round(1E3/30);a.Oa=Math.floor(a.Fa/30*c);b||(a.la=a.Oa);a.kb=0}function Tc(a){return a.fa+a.T+a.ba-a.b}
|
||||
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.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&&b<a.K.length&&0>a.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.V<this.Ra)-1E3>c&&(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&&b<a.K.length&&0>a.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.V<this.Ra)-1E3>c&&(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<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),l=0;l<e.length-1;)for(var m=e[l++],p=e[l++];m--;)g[f++]=p;e=g}f=b.W[d];if(!f||!f.restore(e)){n("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function O(a){return a.N&65536?1:0}
|
||||
function xd(a){return a.O&32768?2:0}function yd(a){return a.X&65535?0:4}h.Ca=function(){return this.S&32768?8:0};function zd(a){var b=a.qa(a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function Ad(a,b){a.u[7]=b&65535}function sc(a,b){return{dd:a,ab:b,next:null}}function qc(a,b){if(b!=a.U){var c=a.U;if(!c||c.ab<=b.ab)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.ab<=b.ab){b.next=d;c.next=b;break}c=d}while(c)}}a.F|=2}function Lb(a){return a.L=a.L&63728|a.Ca()|yd(a)|xd(a)|O(a)}
|
||||
function vc(a,b){a.S=b<<12;a.X=~b&4;a.O=b<<14;a.N=b<<16;if((b^a.L)&2048)for(var c=a.Ea.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ea[c];a.Ea[c]=d}a.D=b>>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(f<a.wa)f&1&&!(c&1)&&(a.Z|=64,a.ea(4,10));else if(a.Ma&16||253952<=f&&(f|=4186112),4186112>f){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||4194239<f)||(a.G|=4096,a.G&512&&(a.F|=32)));return f}function Jd(a,b){return a.A.lb(b)}function Kd(a,b,c){b&1&&a.b--;a.A.Db(b,c&255)}function Hd(a){var b=a.qa(a.u[6]|a.M);a.u[6]=a.u[6]+2&65535;return b}
|
||||
function Fd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.G&57344||(a.La=a.La<<8|246);!a.D&&c<=a.Na&&4<c&&(c<=a.Na-32?(a.Z|=4,a.u[6]=4,a.ea(4,18)):(a.Z|=8,a.F|=4));a.ub(c,b)}
|
||||
function Ld(a,b,c,d){var e,f,g=d&8?0:a.M;switch(b){case 0:return a.ea(4,20),0;case 1:return 6===c&&!a.D&&d&4&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32||65534<=a.u[6]?(a.Z|=4,a.u[6]=4,a.ea(4,22)):(a.Z|=8,a.F|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.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<this.b);return this.v.complete?this.ba-this.b:void 0===this.v.complete?0:-1};Ta(function(){for(var a=A(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new sd(d);nb(d,c)}});function Xd(a,b){var c=b+a;Cd(this,c,a,b);return c&65535}
|
||||
function Yd(a,b){var c=b+a;Cd(this,c<<8,a<<8,b<<8);return c&255}function Zd(a,b){a=b<<1;Dd(this,a);return a&65535}function $d(a,b){a=b<<1;Dd(this,a<<8);return a&255}function ae(a,b){a=b&32768|b>>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&&(b=16),this.N=c<<17-b,c>>=b;else if(b)if(16<b)this.O=c,c=0;else{this.N=c<<=b;var d=c>>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&&(b=32);var d=c>>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.N=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.O=32768)):d=c;this.u[a]=d>>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<b?65536:0);this.b-=23}function kf(){this.b-=5}function lf(){this.L&49152||(wd(this),this.A.reset());this.b-=667}
|
||||
function mf(){Gd(this);this.F|=this.L&16;this.b-=13}function nf(a){if(a&8)V.call(this,a);else{var b=Hd(this);a&=7;Ad(this,this.u[a]);this.u[a]=b;this.b-=9}}function W(a){a&1&&(this.N=65536);a&2&&(this.O=32768);a&4&&(this.X=0);a&8&&(this.S=32768);this.b-=5}function of(a){var b=(a&448)>>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<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[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.length;e++)a.f[e]=na(b[e],16);rg(a)}}
|
||||
function rg(a){if(!qb(a))if(!a.C)G(a);else if(a.f&&a.A){a.j||(a.j=a.f.length);if(a.f.length!=a.j)Fb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.j,8,!0)+")");else{var b;b=a.D;if(Yb(a.A,b,a.j,a.G?1:Bc)){var c;for(c=0;c<a.f.length;c++)a.A.rb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.B?b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Xb(d.A,d.D,d.j);Wb(d.A,e,d.j,f)}delete a.f}}G(a)}}
|
||||
Ta(function(){for(var a=A(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new pg(d);nb(d,c)}});function sg(a){r.call(this,"RAM",a,sg);this.B=a.addr;this.j=a.size;this.f=!1}u(sg);sg.prototype.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;!this.f&&this.j&&Yb(this.A,this.B,this.j,1)&&(this.f=!0);this.f||n("No RAM allocated");G(this)};sg.prototype.Aa=function(){return!0};sg.prototype.za=function(){return!0};sg.prototype.reset=function(){};
|
||||
Ta(function(){for(var a=A(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new sg(d);nb(d,c)}});function tg(a){r.call(this,"Keyboard",a,tg,65536);G(this)}u(tg);tg.prototype.ra=function(){return!1};tg.prototype.Da=function(a,b,c,d){this.B=a;this.b=c;this.i=d};Ta(function(){for(var a=A(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new tg(d);nb(d,c)}});
|
||||
function Y(a){this.C=this.G=null;this.T=a.tabSize;this.M=a.charBOL;this.H=0;r.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=ug;b&&(void 0===c&&(c="Panel"),(c=mb(c,this.id))&&(b=c.J[b])&&this.ra(null,a,b))}this.I=this.K=null;this.exports={connect:this.Zb,receiveData:this.Lb}}u(Y);var ug="buffer";h=Y.prototype;
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case ug:return this.J[b]=this.C=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Lb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Lb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Da=function(a,b,c,d){this.B=a;this.A=b;this.b=c;this.i=d;var e=this;this.aa=sc(48,4);this.U=pc(this.b,function(){e.f&128||!e.D.length||(e.R=e.D.shift(),e.f|=128,e.f&64&&qc(e.b,e.aa))});this.ba=sc(52,4);this.V=pc(this.b,function(){e.j|=128;e.j&64&&qc(e.b,e.ba)});mc(b,this,vg);G(this)};
|
||||
h.Zb=function(){if(!this.I){var a=Oc(this.B,"connection");if(a){var b=a.split("->");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<a.length;b++)this.D.push(a.charCodeAt(b));else this.D=this.D.concat(a);rc(this.b,this.U,1);return!0};h.Nc=function(){return this.f&65535};h.xd=function(a){this.f=this.f&-112|a&111};
|
||||
h.Mc=function(){this.f&=-129;0<this.D.length&&rc(this.b,this.U,1);return this.R};h.wd=function(){};h.$c=function(){return this.j};h.Kd=function(a){128==(this.j&192)&&a&64&&rc(this.b,this.V,1);this.j=this.j&-70|a&69};h.Zc=function(){return 0};
|
||||
h.Jd=function(a){if(a&=255){B(this,"transmitByte("+k(a,2,!0)+")");this.K&&this.K.call(this.I,a);if(this.C)if(13==a)this.H=0;else if(8==a)this.C.value=this.C.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.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<a.length;b++){var c=a[b],d=z(c),d=new Y(d);nb(d,c)}});
|
||||
function yg(a){r.call(this,"Debugger",a,yg);this.ja=a.base||16;this.wa=!1;this.R=this.va=this.H=0;this.U=!1;this.C=-1;this.j=[];this.aa={}}u(yg);var zg={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":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<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
||||
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<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),l=0;l<e.length-1;)for(var m=e[l++],p=e[l++];m--;)g[f++]=p;e=g}f=b.W[d];if(!f||!f.restore(e)){n("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function xd(a){return a.N&65536?1:0}
|
||||
function yd(a){return a.O&32768?2:0}function zd(a){return a.X&65535?0:4}h.Da=function(){return this.S&32768?8:0};function Ad(a){var b=a.ra(a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function Bd(a,b){a.u[7]=b&65535}function rc(a,b){return{dd:a,ab:b,next:null}}function pc(a,b){if(b!=a.U){var c=a.U;if(!c||c.ab<=b.ab)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.ab<=b.ab){b.next=d;c.next=b;break}c=d}while(c)}}a.F|=2}function Kb(a){return a.L=a.L&63728|a.Da()|zd(a)|yd(a)|xd(a)}
|
||||
function uc(a,b){a.S=b<<12;a.X=~b&4;a.O=b<<14;a.N=b<<16;if((b^a.L)&2048)for(var c=a.Ea.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ea[c];a.Ea[c]=d}a.D=b>>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(f<a.wa)f&1&&!(c&1)&&(a.Z|=64,a.ea(4,10));else if(a.Ma&16||253952<=f&&(f|=4186112),4186112>f){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||4194239<f)||(a.G|=4096,a.G&512&&(a.F|=32)));return f}function Kd(a,b){return a.w.lb(b)}function Ld(a,b,c){b&1&&a.b--;a.w.Db(b,c&255)}function Id(a){var b=a.ra(a.u[6]|a.M);a.u[6]=a.u[6]+2&65535;return b}
|
||||
function Gd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.G&57344||(a.La=a.La<<8|246);!a.D&&c<=a.Na&&4<c&&(c<=a.Na-32?(a.Z|=4,a.u[6]=4,a.ea(4,18)):(a.Z|=8,a.F|=4));a.ub(c,b)}
|
||||
function Md(a,b,c,d){var e,f,g=d&8?0:a.M;switch(b){case 0:return a.ea(4,20),0;case 1:return 6===c&&!a.D&&d&4&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32||65534<=a.u[6]?(a.Z|=4,a.u[6]=4,a.ea(4,22)):(a.Z|=8,a.F|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.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<this.b);return this.v.complete?this.ba-this.b:void 0===this.v.complete?0:-1};Ta(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new sd(d);A(d,c)}});function Yd(a,b){var c=b+a;Dd(this,c,a,b);return c&65535}
|
||||
function Zd(a,b){var c=b+a;Dd(this,c<<8,a<<8,b<<8);return c&255}function $d(a,b){a=b<<1;Ed(this,a);return a&65535}function ae(a,b){a=b<<1;Ed(this,a<<8);return a&255}function be(a,b){a=b&32768|b>>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&&(b=16),this.N=c<<17-b,c>>=b;else if(b)if(16<b)this.O=c,c=0;else{this.N=c<<=b;var d=c>>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&&(b=32);var d=c>>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.N=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.O=32768)):d=c;this.u[a]=d>>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<b?65536:0);this.b-=23}function lf(){this.b-=5}function mf(){this.L&49152||(wd(this),this.w.reset());this.b-=667}
|
||||
function nf(){Hd(this);this.F|=this.L&16;this.b-=13}function of(a){if(a&8)V.call(this,a);else{var b=Id(this);a&=7;Bd(this,this.u[a]);this.u[a]=b;this.b-=9}}function W(a){a&1&&(this.N=65536);a&2&&(this.O=32768);a&4&&(this.X=0);a&8&&(this.S=32768);this.b-=5}function pf(a){var b=(a&448)>>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<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[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.length;e++)a.f[e]=na(b[e],16);sg(a)}}
|
||||
function sg(a){if(!pb(a))if(!a.C)H(a);else if(a.f&&a.w){a.j||(a.j=a.f.length);if(a.f.length!=a.j)rb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.j,8,!0)+")");else{var b;b=a.D;if(Xb(a.w,b,a.j,a.G?1:Bc)){var c;for(c=0;c<a.f.length;c++)a.w.rb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.B?b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Wb(d.w,d.D,d.j);Vb(d.w,e,d.j,f)}delete a.f}}H(a)}}
|
||||
Ta(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new qg(d);A(d,c)}});function tg(a){r.call(this,"RAM",a,tg);this.B=a.addr;this.j=a.size;this.f=!1}u(tg);tg.prototype.Ba=function(a,b,c,d){this.w=b;this.b=c;this.g=d;!this.f&&this.j&&Xb(this.w,this.B,this.j,1)&&(this.f=!0);this.f||n("No RAM allocated");H(this)};tg.prototype.ya=function(){return!0};tg.prototype.xa=function(){return!0};tg.prototype.reset=function(){};
|
||||
Ta(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new tg(d);A(d,c)}});function ug(a){r.call(this,"Keyboard",a,ug,65536);H(this)}u(ug);ug.prototype.oa=function(){return!1};ug.prototype.Ba=function(a,b,c,d){this.B=a;this.b=c;this.g=d};Ta(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new ug(d);A(d,c)}});
|
||||
function Y(a){this.C=this.G=null;this.T=a.tabSize;this.M=a.charBOL;this.H=0;r.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=vg;b&&(void 0===c&&(c="Panel"),(c=mb(c,this.id))&&(b=c.J[b])&&this.oa(null,a,b))}this.I=this.K=null;this.exports={connect:this.Zb,receiveData:this.Lb}}u(Y);var vg="buffer";h=Y.prototype;
|
||||
h.oa=function(a,b,c){var d=this;switch(b){case vg:return this.J[b]=this.C=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Lb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Lb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.g=d;var e=this;this.aa=rc(48,4);this.U=oc(this.b,function(){e.f&128||!e.D.length||(e.R=e.D.shift(),e.f|=128,e.f&64&&pc(e.b,e.aa))});this.ba=rc(52,4);this.V=oc(this.b,function(){e.j|=128;e.j&64&&pc(e.b,e.ba)});lc(b,this,wg);H(this)};
|
||||
h.Zb=function(){if(!this.I){var a=Oc(this.B,"connection");if(a){var b=a.split("->");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<a.length;b++)this.D.push(a.charCodeAt(b));else this.D=this.D.concat(a);qc(this.b,this.U,1);return!0};h.Nc=function(){return this.f&65535};h.xd=function(a){this.f=this.f&-112|a&111};
|
||||
h.Mc=function(){this.f&=-129;0<this.D.length&&qc(this.b,this.U,1);return this.R};h.wd=function(){};h.$c=function(){return this.j};h.Kd=function(a){128==(this.j&192)&&a&64&&qc(this.b,this.V,1);this.j=this.j&-70|a&69};h.Zc=function(){return 0};
|
||||
h.Jd=function(a){if(a&=255){E(this,"transmitByte("+k(a,2,!0)+")");this.K&&this.K.call(this.I,a);if(this.C)if(13==a)this.H=0;else if(8==a)this.C.value=this.C.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.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<a.length;b++){var c=a[b],d=z(c),d=new Y(d);A(d,c)}});function vc(a){r.call(this,"PC11",a,vc);this.f=0}u(vc);
|
||||
h=vc.prototype;h.oa=function(){return!1};h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.g=d;H(this)};h.ya=function(a,b){if(!b)if(!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(){this.f&=-2241};h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};
|
||||
function zg(a){r.call(this,"Debugger",a,zg);this.ja=a.base||16;this.wa=!1;this.R=this.va=this.H=0;this.U=!1;this.C=-1;this.j=[];this.aa={}}u(zg);var Ag={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":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<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
|
||||
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
||||
function 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<p.length;){var q=p[e++],v=q.length,q=xa(q);if(!q){f=!0;break}q=Eg(a,q,null,!1===c);if(void 0===q){f=!0;c=!1;break}l.push(q);if(e==p.length)break;var q=p[e++],w=q.length;m.length&&zg[q]<zg[m[m.length-1]]&&Bg(l,m,1);m.push(q);b=b.substr(v+w)}Bg(l,m)&&1==l.length||(f=!0);f?c&&a.g("error parsing '"+g+"' at character "+(g.length-b.length)):(d=l.pop(),c&&Fg(a,null,
|
||||
d))}return d}function Dg(a,b){for(var c,d=a.wa?"(":"{",e=a.wa?")":"}",f=new RegExp(a.wa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Cg(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.R-a.va}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||
function Eg(a,b,c,d){var e;null!=b?(e=a.Xb(b),0<=e?e=a.Yb(e):(e=a.aa[b],null==e&&(e=na(b,a.ja))),null!=e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e}
|
||||
function Fg(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var l=0;l<f;l++){g&&(g=","+g);var m=d&255,p=8,q="";p?32<p&&(p=32):p=32;if(null==m||isNaN(m))for(;0<p--;)q="?"+q;else for(;0<p--;)q=(m&1?"1":"0")+q,m>>=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<c}
|
||||
function J(a,b,c,d){switch(a.ja){case 8:a=oa(b,3*c);break;case 10:a=b.toString();break;default:a=k(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}function Hg(a){yg.call(this,a);this.wa=!0;this.K=Z(0);this.Oa=Z(0);this.T=Z(0);this.G=[];this.f=this.M=this.D=[];Ig(this);this.ma=0;Jg(this);this.xa={};Kg(this,a.messages);this.Fa=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Rc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Rc(b,a)})}
|
||||
u(Hg,yg);
|
||||
var Lg={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Mg=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),Ng=
|
||||
function Dg(a,b,c){var d;if(b){b=Eg(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<p.length;){var q=p[e++],v=q.length,q=xa(q);if(!q){f=!0;break}q=Fg(a,q,null,!1===c);if(void 0===q){f=!0;c=!1;break}l.push(q);if(e==p.length)break;var q=p[e++],w=q.length;m.length&&Ag[q]<Ag[m[m.length-1]]&&Cg(l,m,1);m.push(q);b=b.substr(v+w)}Cg(l,m)&&1==l.length||(f=!0);f?c&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(d=l.pop(),c&&Gg(a,null,
|
||||
d))}return d}function Eg(a,b){for(var c,d=a.wa?"(":"{",e=a.wa?")":"}",f=new RegExp(a.wa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Dg(a,c[1]);b=b.replace(d+c[1]+e,null!=g?K(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.R-a.va}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||
function Fg(a,b,c,d){var e;null!=b?(e=a.Xb(b),0<=e?e=a.Yb(e):(e=a.aa[b],null==e&&(e=na(b,a.ja))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
||||
function Gg(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var l=0;l<f;l++){g&&(g=","+g);var m=d&255,p=8,q="";p?32<p&&(p=32):p=32;if(null==m||isNaN(m))for(;0<p--;)q="?"+q;else for(;0<p--;)q=(m&1?"1":"0")+q,m>>=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 0<c}
|
||||
function K(a,b,c,d){switch(a.ja){case 8:a=oa(b,3*c);break;case 10:a=b.toString();break;default:a=k(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}function Ig(a){zg.call(this,a);this.wa=!0;this.K=Z(0);this.Oa=Z(0);this.T=Z(0);this.G=[];this.f=this.M=this.D=[];Jg(this);this.ma=0;Kg(this);this.za={};Lg(this,a.messages);this.Fa=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Rc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Rc(b,a)})}
|
||||
u(Ig,zg);
|
||||
var Mg={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Ng=".WORD ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),Og=
|
||||
{61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],33024:[23,
|
||||
4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106],35072:[107]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,63],35904:[72,63],
|
||||
35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Og=[0],Pg=[58,60,65,96,108,
|
||||
110,100,101,102,103,104,105,59,64];h=Hg.prototype;
|
||||
h.Da=function(a,b,c,d){this.A=b;this.b=c;this.B=a;(a=Oc(a,"messages"))&&Kg(this,a);this.Wa=Ng;this.kb=1145>this.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.A.ga,
|
||||
8)+" %%"+k(q.w,8)+" "+k(q.tb,4,!0)+" "+k(q.size,4,!0)+" "+p),c!=Ac&&(c=-1),p=0);a+=d.A.sa;e++}}});G(this)};
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case "debugInput":return this.la=this.J[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Rc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.j.length-1&&(b=d.j[++d.C])):40==a.keyCode&&(0<d.C?b=d.j[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.J[b]=c,Na(c,function(){if(d.la){var a=d.la.value;
|
||||
d.la.value="";Rc(d,a,!0);return!0}return!1}),!0;case "step":return this.J[b]=c,Na(c,function(a){var b=!1;pb(d,!0)||(ob(d,!0),b=d.fb(a?1:0),ob(d,!1));return b}),!0}return!1};h.sb=function(){this.la&&this.la.focus()};h.Y=function(a){a=a&&a.w;null==a&&(a=-1);return a};h.lb=function(a,b){var c=255,d=this.Y(a,!1,1);-1!==d&&(c=a.vb?this.A.zb(d):this.b.zb(d),b&&Sg(a,b));return c};h.ka=function(a,b){var c=65535,d=this.Y(a,!1,2);-1!==d&&(c=a.vb?this.A.mb(d):this.b.mb(d),b&&Sg(a,b));return c};
|
||||
h.Db=function(a,b,c){var d=this.Y(a,!0,1);-1!==d&&(a.vb?this.A.rb(d,b):this.b.rb(d,b),c&&Sg(a,c),this.B.$(!0))};h.Sa=function(a,b,c){var d=this.Y(a,!0,2);-1!==d&&(a.vb?this.A.Eb(d,b):this.b.Eb(d,b),c&&Sg(a,c),this.B.$(!0))};function Z(a,b){return{w:a,vb:b,ya:!1}}function Tg(a){return[a.w,a.ya]}function Ug(a){return{w:a[0],ya:a[1]}}
|
||||
function Rg(a,b,c){var d,e=(c?a.K:a.Oa).w;c=!1;if(void 0!==b){b=Dg(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.G.length;e++){var g=a.G[e].Ba[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Cg(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Vg(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.hc=Ag(a,b.dc=c[2]))}function Sg(a,b){null!=a.w&&(a.w+=b||1)}
|
||||
function Kg(a,b){a.i=a;a.ia=a.jc=536870912;a.oa=null;a.ua=[];b=Ag(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in H){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ia|=H[c],a.g(c+" messages enabled"))}}function Qg(a,b){for(var c in H)if(64==H[c]){a.xa[c]=b;break}}
|
||||
h.Xb=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Wg(a){return 6>a?"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<a.I.length;b++)a.I[b]=Z();a.fa=0;a.g("instruction history buffer allocated")}if(!a.ba||!a.ba.length)for(a.ba=Array(256),b=0;b<a.ba.length;b++)a.ba[b]=[b,0]}else a.I&&a.I.length&&a.g("instruction history buffer freed"),a.fa=0,a.I=[],a.ba=[]}h.eb=function(a,b){if(!Xg(this,b))return!1;this.b.eb(a);return!0};
|
||||
h.fb=function(a,b,c){if(!Xg(this))return!1;this.H=0;a||Vd(this)&&Wd(this,this.b.u[7],0);try{a=Yc(this.b,a);var d=this.b.fb(a);0<d&&(rd(this.b,a),this.H+=d,Vc(this.b,d,!0),Sc(this.b,d),this.R++)}catch(e){"number"!=typeof e&&(this.H=0,Fb(this.b,e.stack||e.message))}!1!==c&&this.B.$();this.$(b||!1);return 0<this.H};h.da=function(a){this.b&&this.b.da(a)};h.$=function(a){void 0===a&&(a=!0);this.K=Z(this.b.u[7]);a&&1!=this.V?Yg(this):Zg(this)};
|
||||
function Xg(a,b){var c;(c=!a.b||!qb(a.b))||(c=a.b,c.v.ha?c=!0:(c.g(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.v.ca?(b||a.g("cpu busy or unavailable, command ignored"),!1):!rb(a.b)}h.Aa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};h.za=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Jg(this);this.R=this.va=0;this.oa=null;this.H=0;this.K=Z(this.b.u[7]);this.v.ca=!1;$g(this);a||this.$()};
|
||||
h.save=function(){var a=new N(this);a.set(0,Tg(this.K));a.set(1,Tg(this.T));a.set(2,[this.j,this.U,this.ia]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Ug(a[b++]),this.T=Ug(a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.U=a[b][1],this.ia|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.g("running");this.v.ca=!0;this.wb=a;this.yb=b};
|
||||
h.stop=function(a,b){if(this.v.ca){this.v.ca=!1;this.H=b-this.yb;if(!this.V){b="stopped";if(this.H){a-=this.wb;var c=0<a?Math.round(1E3*this.H/a):0;b+=" (";Vd(this)&&(b+=this.R+" opcodes, ",this.va-=this.R,this.R=0);b+=this.H+" cycles, "+a+" ms, "+c+" hz)"}else E(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.g(b)}this.$(!0);this.sb();$g(this,this.b.u[7])}};function Vd(a){return 1<a.f.length||!!a.ma}
|
||||
function Wd(a,b,c){var d=a.b;if(0<c&&(a.ma&&!--a.ma||Jc(a,b,1,a.f)))return!0;0<=c&&a.ba.length&&(a.R++,null!=a.b.mb(b)&&(b=a.I[a.fa],b.w=d.u[7],b.ya=!1,++a.fa==a.I.length&&(a.fa=0)));return!1}function $b(a){var b=a.b;return b.v.ca?(Ad(b,a.b.qb),a.da(),!0):!1}function Ig(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.A;c=a.Y(c);Kc(d.W[c>>>d.ga],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.A,c=a.Y(c),Kc(d.W[c>>>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<b.length;g++){var l=b[g];if(c==a.Y(l)&&(!d||l.ya)){f=!0;l.ya||e||bh(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.A,Kc(d.W[c>>>d.ga],b==a.D));l.ya||Jg(a);break}}return f}
|
||||
function ch(a,b){for(var c=1;c<b.length;c++)bh(a,b,c);return b.length-1}function bh(a,b,c,d){c=b[c];a.g(b[0]+" "+J(a,c.w)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}function $g(a,b){if(void 0!==b)Jc(a,b,1,a.f,!0),a.V=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.ya){if(!ah(a,a.f,c,!0))break;b=0}}}
|
||||
function Jc(a,b,c,d,e){var f=!1;if(!a.Ta++)for(var g=1;!f&&g<d.length;g++){var l=d[g];if(!e||l.ya)for(var m=a.Y(l),p=0;p<c;p++)if(b+p==m){var q,f=!0;l.ya&&(ah(a,d,l,!0),e=!0);if(q=l.hc){for(var f=!1,v=0;v<q.length;v++)if(!dh(a,q[v],!0)){if(q[v].indexOf("if")){f=!0;break}for(var w=v+1;w<q.length&&q[w].indexOf("else");w++)v++;if(w==q.length){f=!0;break}}a.b.v.ca||(f=!0)}if(f){e||bh(a,d,g,"hit");break}}}a.Ta--;return f}
|
||||
function eh(a,b,c,d){var e=Z(b.w),f=a.ka(b,2),g,l;for(l in a.Wa)if(g=a.Wa[l][f&l])break;g||(g=Og);var m=g[0];0<=a.kb.indexOf(m)&&(g=Og,m=g[0]);var p=l="",q=Mg[m],v=g.length-1;m||v||(l=J(a,f));for(m=1;m<=v;m++){var w=g[m];if(void 0!==w){var x;x=a;var C=w,w=b,y="",D=C&61440;if(4096==D)w=w.w+((f&255)<<24>>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]);0<l.length&&(l+=",");l+=x||
|
||||
"???"}}f="";g=J(a,e.w)+":";if(-1!==e.w&&-1!==b.w){do if(f+=" "+J(a,a.ka(e,2)),null==e.w)break;while(e.w!=b.w)}g+=wa(f,24);g+=wa(q,5);l&&(g+=" "+l);if(c||p)g=wa(g,60)+";"+(c||""),g=a.b.v.Xa?g+("cycles="+Tc(a.b).toString()+" cs="+k(a.b.nb)):g+(null!=d?"="+d.toString():""),p&&(g+=" @"+p);return g}function fh(a,b){switch(b){case "N":a=a.b.Ca();break;case "Z":a=yd(a.b);break;case "V":a=xd(a.b);break;case "C":a=O(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function gh(a,b){var c="",d=a.b;8>b?(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]<b[0]?-1:0};
|
||||
function ih(a,b,c){var d=[],e=a.Y(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.w>>>0,l=f.sc;if(e>=g&&e<g+l){e=za(f.Rb,[e-g],a.Sb);0<=e?jh(a,b,e,d):c&&(e=~e,jh(a,b,e-1,d),jh(a,b,e,d));break}}return d}function jh(a,b,c,d){var e={},f=a.G[b].Rb,g=0,l=null;0<=c&&c<f.length&&(g=f[c][0],l=f[c][1]);l&&(e=a.G[b].Ba[l],l="."==l.charAt(0)?null:e.l||l);d.push(l);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function kh(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Gg(a)||a.g("no variables"),!0;if(!c[2])return Gg(a,c[1]);if(!c[3])return delete a.aa[c[1]],!0;b=Cg(a,c[3]);return void 0!==b?(a.aa[c[1]]=b,!0):!1}a.g("invalid assignment:"+b);return!1}
|
||||
function lh(a,b,c){var d=null;if(b=Rg(a,b,!0)){a.Y(b);var e=ih(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.w-e[1])&&(g=" + "+k(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.g(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.w)&&(g=" - "+k(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
|
||||
function Yg(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.g("missing value for "+b[1]);return}f=Cg(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":Ad(d,f);a.K=Z(d.u[7]);break;case "N":d.S=f?32768:0;break;
|
||||
case "Z":d.X=f?0:1;break;case "V":d.O=f?32768:0;break;case "C":d.N=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){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?1<c[2].length?a.g(c[2]):Fg(a,null,c[2].charCodeAt(0)):Cg(a,b,!0)}
|
||||
function nh(a,b,c){var d="t"!=b;c=Eg(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ma(c,function(){return ob(a,!0)&&a.fb(e,d,!1)},function(){a.B.$();ob(a,!1)})}
|
||||
function Zg(a,b,c,d){if(b=Rg(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Eg(a,c.substr(1)),null!=c&&(d=c);else{d=Rg(a,c,!0);if(!d||d.w<b.w)return;e=d.w-b.w;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=pb(a,!1)||a.V?a.H:null;var g=null!=f?"cycles":null,l=ih(a,b),m=b.w;if(l[0]&&d&&(!c&&d||0>l[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)&&0<b.length){a.U&&(b="a "+J(a,a.T.w)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var l=g[0],m=l.charAt(0),p=1;p<l.length;p++){var q=l.charAt(p);if("?"==m||"r"==m||"a">q||"z"<q){g[0]=l.substr(p);g.unshift(l.substr(0,p));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var v=
|
||||
Rg(a,g[1],!0);if(v)if(a.T=v,void 0===g[2])a.g("begin assemble at "+J(a,v.w)),a.U=!0,a.B.$();else{var w;a.g("not supported yet");w=[];if(w.length){for(var x=0;x<w.length;x++)a.Db(v,w[x],1);a.g(eh(a,a.T))}}break;case "b":a:{var C=g[0],y=g[1],D=b;if("?"==y)a.g("breakpoint commands:"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),a.g("\tbc [a]\tclear breakpoint at addr [a]"),a.g("\tbl\tlist all breakpoints"),
|
||||
a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var Ba=C.charAt(1);if("l"==Ba){var Zc;Zc=0+ch(a,a.f);Zc+=ch(a,a.M);(Zc+=ch(a,a.D))||a.g("no breakpoints")}else if("n"==Ba)a.ma=Eg(a,y),a.g("break after "+a.ma+" instruction(s)");else if(void 0===y)a.g("missing breakpoint address");else{var T=Z();if("*"!=y&&(T=Rg(a,y,!0),!T))break a;"c"==Ba?null==T.w?(Ig(a),a.g("all breakpoints cleared")):ah(a,a.f,T)||ah(a,a.M,T)||ah(a,a.D,T)||a.g("breakpoint missing: "+J(a,T.w)):null!=T.w&&(Vg(a,T,D),"p"==Ba?a.Pa(a.f,
|
||||
T):"r"==Ba?a.Pa(a.M,T):"w"==Ba?a.Pa(a.D,T):a.g("unknown breakpoint command: "+Ba))}}}break;case "c":a.Qa&&(a.Qa.value="");break;case "d":a:{var Ua,Va=g[0],ha=g[1],Ca=g[2],Gh=g[3];if("?"==ha){var Wa="";for(Ua in H)a.xa[Ua]&&(Wa&&(Wa+=","),Wa+=Ua);Wa+=",state,symbols";a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");Wa.length&&
|
||||
a.g("dump extension commands:\n\t"+Wa)}else if("state"==ha){var Cf=oh(a.B,!0);"console"==Ca?console.log(Cf):(a.Qa&&(a.Qa.value=""),a.g(Cf))}else if("symbols"==ha)for(var $c=0;$c<a.G.length;$c++){var ad=a.G[$c],Xa;for(Xa in ad.Ba)if("."!=Xa.charAt(0)){var Df=ad.Ba[Xa].o;if(void 0!==Df){var Ef=ad.Ba[Xa].l;Ef&&(Xa=Ef);a.g(J(a,Df)+" "+Xa)}}}else{if("d"==Va){for(Ua in H)if(g[1]==Ua){var Ff=a.xa[Ua];Ff?(g.shift(),g.shift(),Ff(g)):a.g("no dump registered for "+ha);break a}ha||(Va=a.Ab||"db")}else a.Ab=Va;
|
||||
if("dh"==Va){var Gf=ha,Hf=Ca,If="",Jf=0,ba=a.fa,ia=a.I;if(ia.length){var X=+Gf||a.Va,sb=+Hf||10;isNaN(X)?X=sb:If="more ";X>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<sb&&ba!=a.fa;){var Kf=ia[ba++];if(null==Kf.w)break;var tb=Z(Kf.w),Hh=X--,Lf=eh(a,tb,"history",Hh);(!bd.length||0<=Lf.indexOf(bd[0]))&&a.g(Lf);tb.Ib&&(ba+=
|
||||
tb.Ib,sb-=tb.Ib,X-=tb.Ib);ba>=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<bc&&(bc=65536));for(var vb="",Ya="dd"==Va?4:"dw"==Va?2:1,cc=Ya*bc||128,Ih=cc+15>>4||1;Ih--&&0<cc;){var dc=0,wb=0,xb,cd="",Mf="",ha=J(a,ub.w);for(xb=4==Ya?16:a.ja;0<xb&&0<cc;xb--){var dd,ec=2==Ya?a.ka(ub,dd=2):a.lb(ub,dd=1),dc=dc|ec<<(wb<<3),wb=wb+dd;wb==Ya&&(cd+=J(a,dc,Ya),cd+=
|
||||
1==Ya?9==xb?"-":" ":" ",dc=wb=0);Mf+=32<=ec&&128>ec?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<a.ua.length;od++)a.g(a.ua[od]);a.ua=[]}}var Oh=0,Cb="";for(ja in H)if(!F||F==ja){var Ph=!!(a.ia&H[ja]);if(null===ka||ka==Ph)Cb&&(Cb+=","),++Oh%10||(Cb+="\n\t"),
|
||||
"key"==ja&&(ja="keys"),Cb+=ja}void 0===F&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==ka?ka?"messages on: ":"messages off: ":"message categories:\n\t")+(Cb||"none"));Jg(a)}break;case "p":if("print"==g[0]){mh(a,b.substr(5));break}var Qh="pr"==g[0]?1:0;if(a.V)a.g("step in progress");else{var Tf=Z(a.b.u[7]);a.lb(Tf);a.V?(a.Pa(a.f,Tf,!0),a.eb()||(a.B&&a.B.sb(),a.V=0)):nh(a,Qh?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}Yg(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Db=
|
||||
+g[2];if(8==Db||10==Db||16==Db)a.ja=Db;else{a.g("invalid base: "+Db);break}}a.g("default base: "+a.ja);break;case "cs":var Eb;void 0!==g[3]&&(Eb=+g[3]);switch(g[2]){case "int":a.b.Za=Eb;break;case "start":a.b.ob=Eb;break;case "stop":a.b.$a=Eb;break;default:a.g("unknown cs option");break a}void 0!==Eb&&Qc(a.b);a.g("checksums "+(a.b.v.Xa?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Uc(a.b,+g[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.Ra.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.Ka+"x)");break;default:if(g[1]){a.g("unknown option: "+g[1]);break}case "?":a.g("debugger options:"),a.g("\tbase #\t\tset default base to #"),a.g("\tcs int #\tset checksum cycle interval to #"),a.g("\tcs start #\tset checksum cycle start count to #"),a.g("\tcs stop #\tset checksum cycle stop count to #"),a.g("\tsp #\t\tset speed multiplier to #")}break;case "t":nh(a,g[0],g[1]);break;case "u":Zg(a,g[1],g[2],8);break;case "v":if("var"==g[0]){kh(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.g("PDPjs version 1.30.1 ("+a.b.Ya+",RELEASE"+(Gb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){mh(a,b.substr(1));break}var pd="commands:",qd;for(qd in Lg)pd+="\n"+wa(qd,9)+Lg[qd];Vd(a)||(pd+="\nnote: history disabled if no exec breakpoints");a.g(pd);break;default:f=!0}f&&(a.g("unknown command: "+b),d=!1)}}catch(Uf){a.g("debugger error: "+(Uf.stack||Uf.message)),d=!1}return d}
|
||||
function Rc(a,b,c){b=Ag(a,b,c);for(var d in b)if(!dh(a,b[+d]))return!1;return!0}Ta(function(){for(var a=A(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Hg(d);nb(d,c)}});
|
||||
function ph(a,b,c){r.call(this,"Computer",a,ph,67108864);this.v.ha=!1;qh(this,b);this.M=Oc(this,"autoPower",a);this.B=0;this.aa=a.busWidth||a.buswidth;this.f=rh;this.I=null;this.G=this.U=!1;this.ba=Oc(this,"url")||"";(Math.random()+.1).toString(36);this.j=sh(this);if(this.b=mb("CPU",this.id)){this.i=mb("Debugger",this.id);this.A=new Mb({id:this.Gb+".bus",busWidth:this.aa},this.b,this.i);var d,e=kb(this.id);if((this.C=mb("Panel",this.id))&&this.C.Qa)for(b=0;b<e.length;b++)d=e[b],d.na=this.C.na,d.g=
|
||||
this.C.g,d.Qa=this.C.Qa;this.g("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.g("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Da&&d.Da(this,this.A,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Oc(this,"state")||(f=!0,a.state))b=this.R=a,f||(this.G=!0,this.f=rh),this.f&&
|
||||
(this.K=new N(this,"1.30.1"),th(this.K)?b=null:delete this.K);!b&&this.f&&(b=uh(this))&&(this.G=!0);if(b){var g=this;Fa(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.na("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.U=!0);G(g)})}else G(this);this.J.power||(this.M=!0);!c&&this.M&&vh(this,this.pb)}else n("Unable to find CPU component")}u(ph);var rh=0;
|
||||
function qh(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){n(d.message+" ("+c+")")}}a.V=b}function Oc(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.V&&(d=a.V[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function vh(a,b,c){for(var d=kb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!qb(f)){qb(f,function(){vh(a,b,c)});return}}b.call(a,c)}
|
||||
function wh(a,b){var c=new N(a,"1.30.1","validate");if(th(c)&&xh(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.na("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=ph.prototype;
|
||||
h.pb=function(a){void 0===a&&(a=this.f||(this.I?1:rh));if(!this.B){this.B++;var b=!1,c=!1;this.T=!1;var d=this.K||new N(this,"1.30.1");if(-1==a)b=!0;else if(a>rh){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;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Bh(this,g,d,b,c));b=[d,a,c];-1!=a?vh(this,this.Ub,b):this.Ub(b)}};
|
||||
function Bh(a,b,c,d,e){if(!b.v.ha){b.v.ha=!0;if(b.Aa){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Aa(f,d)&&f&&(n("Unable to restore state for "+b.type),a.R&&!a.U?(c.clear(),a.f=rh,window&&window.location.reload()):a.T=!0,b.Aa(null),e=!1)}if(!d&&b.Vb)for(a=b.Vb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Ub=function(a){var b=a[0],c=0>a[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;m<l.length;m++){var p=l[m];p.v.ha&&(p.za&&(d=p.za(b,c),"object"===typeof d&&f.set(p.id,
|
||||
d)),c&&(p.v.ha=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.j&&Ch(a,a.j,f.toString()),Ah(g)&&Ah(f)||(e=null,d=l=!0)):a.f&&(d=!0,l=3==a.f),d&&f.clear(l)):e=f.toString());c&&(a.v.ha=!1,b=a.J.power)&&(b.textContent="Power");a.B=0;return e}h.reset=function(){this.A&&this.A.reset&&(B(this,"Resetting "+this.A.type),this.A.reset());for(var a=kb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.A&&c.reset&&(B(this,"Resetting "+c.type),c.reset())}};
|
||||
35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Pg=[0],Qg=[58,60,65,96,108,
|
||||
110,100,101,102,103,104,105,59,64];h=Ig.prototype;
|
||||
h.Ba=function(a,b,c,d){this.w=b;this.b=c;this.B=a;(a=Oc(a,"messages"))&&Lg(this,a);this.Wa=Og;this.kb=1145>this.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.w.ga,
|
||||
8)+" %%"+k(q.A,8)+" "+k(q.tb,4,!0)+" "+k(q.size,4,!0)+" "+p),c!=Ac&&(c=-1),p=0);a+=d.w.sa;e++}}});H(this)};
|
||||
h.oa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.la=this.J[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Rc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.j.length-1&&(b=d.j[++d.C])):40==a.keyCode&&(0<d.C?b=d.j[--d.C]:(b="",d.C=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.J[b]=c,Na(c,function(){if(d.la){var a=d.la.value;
|
||||
d.la.value="";Rc(d,a,!0);return!0}return!1}),!0;case "step":return this.J[b]=c,Na(c,function(a){var b=!1;ob(d,!0)||(nb(d,!0),b=d.fb(a?1:0),nb(d,!1));return b}),!0}return!1};h.sb=function(){this.la&&this.la.focus()};h.Y=function(a){a=a&&a.A;null==a&&(a=-1);return a};h.lb=function(a,b){var c=255,d=this.Y(a,!1,1);-1!==d&&(c=a.vb?this.w.zb(d):this.b.zb(d),b&&Tg(a,b));return c};h.ka=function(a,b){var c=65535,d=this.Y(a,!1,2);-1!==d&&(c=a.vb?this.w.mb(d):this.b.mb(d),b&&Tg(a,b));return c};
|
||||
h.Db=function(a,b,c){var d=this.Y(a,!0,1);-1!==d&&(a.vb?this.w.rb(d,b):this.b.rb(d,b),c&&Tg(a,c),this.B.$(!0))};h.Sa=function(a,b,c){var d=this.Y(a,!0,2);-1!==d&&(a.vb?this.w.Eb(d,b):this.b.Eb(d,b),c&&Tg(a,c),this.B.$(!0))};function Z(a,b){return{A:a,vb:b,Aa:!1}}function Ug(a){return[a.A,a.Aa]}function Vg(a){return{A:a[0],Aa:a[1]}}
|
||||
function Sg(a,b,c){var d,e=(c?a.K:a.Oa).A;c=!1;if(void 0!==b){b=Eg(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.G.length;e++){var g=a.G[e].Ca[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Dg(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Wg(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.hc=Bg(a,b.dc=c[2]))}function Tg(a,b){null!=a.A&&(a.A+=b||1)}
|
||||
function Lg(a,b){a.g=a;a.ia=a.jc=536870912;a.pa=null;a.ua=[];b=Bg(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in I){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ia|=I[c],a.i(c+" messages enabled"))}}function Rg(a,b){for(var c in I)if(64==I[c]){a.za[c]=b;break}}
|
||||
h.Xb=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Xg(a){return 6>a?"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<a.I.length;b++)a.I[b]=Z();a.fa=0;a.i("instruction history buffer allocated")}if(!a.ba||!a.ba.length)for(a.ba=Array(256),b=0;b<a.ba.length;b++)a.ba[b]=[b,0]}else a.I&&a.I.length&&a.i("instruction history buffer freed"),a.fa=0,a.I=[],a.ba=[]}h.eb=function(a,b){if(!Yg(this,b))return!1;this.b.eb(a);return!0};
|
||||
h.fb=function(a,b,c){if(!Yg(this))return!1;this.H=0;a||Wd(this)&&Xd(this,this.b.u[7],0);try{a=Yc(this.b,a);var d=this.b.fb(a);0<d&&(Zc(this.b,a),this.H+=d,Vc(this.b,d,!0),Sc(this.b,d),this.R++)}catch(e){"number"!=typeof e&&(this.H=0,rb(this.b,e.stack||e.message))}!1!==c&&this.B.$();this.$(b||!1);return 0<this.H};h.da=function(a){this.b&&this.b.da(a)};h.$=function(a){void 0===a&&(a=!0);this.K=Z(this.b.u[7]);a&&1!=this.V?Zg(this):$g(this)};
|
||||
function Yg(a,b){var c;(c=!a.b||!pb(a.b))||(c=a.b,c.v.ha?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.v.ca?(b||a.i("cpu busy or unavailable, command ignored"),!1):!qb(a.b)}h.ya=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};h.xa=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Kg(this);this.R=this.va=0;this.pa=null;this.H=0;this.K=Z(this.b.u[7]);this.v.ca=!1;ah(this);a||this.$()};
|
||||
h.save=function(){var a=new O(this);a.set(0,Ug(this.K));a.set(1,Ug(this.T));a.set(2,[this.j,this.U,this.ia]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Vg(a[b++]),this.T=Vg(a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.U=a[b][1],this.ia|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.i("running");this.v.ca=!0;this.wb=a;this.yb=b};
|
||||
h.stop=function(a,b){if(this.v.ca){this.v.ca=!1;this.H=b-this.yb;if(!this.V){b="stopped";if(this.H){a-=this.wb;var c=0<a?Math.round(1E3*this.H/a):0;b+=" (";Wd(this)&&(b+=this.R+" opcodes, ",this.va-=this.R,this.R=0);b+=this.H+" cycles, "+a+" ms, "+c+" hz)"}else G(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}this.$(!0);this.sb();ah(this,this.b.u[7])}};function Wd(a){return 1<a.f.length||!!a.ma}
|
||||
function Xd(a,b,c){var d=a.b;if(0<c&&(a.ma&&!--a.ma||Jc(a,b,1,a.f)))return!0;0<=c&&a.ba.length&&(a.R++,null!=a.b.mb(b)&&(b=a.I[a.fa],b.A=d.u[7],b.Aa=!1,++a.fa==a.I.length&&(a.fa=0)));return!1}function Zb(a){var b=a.b;if(b.v.ca)throw Bd(b,a.b.qb),a.da(),-1;return!1}function Jg(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.w;c=a.Y(c);Kc(d.W[c>>>d.ga],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.w,c=a.Y(c),Kc(d.W[c>>>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<b.length;g++){var l=b[g];if(c==a.Y(l)&&(!d||l.Aa)){f=!0;l.Aa||e||ch(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Kc(d.W[c>>>d.ga],b==a.D));l.Aa||Kg(a);break}}return f}
|
||||
function dh(a,b){for(var c=1;c<b.length;c++)ch(a,b,c);return b.length-1}function ch(a,b,c,d){c=b[c];a.i(b[0]+" "+K(a,c.A)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}function ah(a,b){if(void 0!==b)Jc(a,b,1,a.f,!0),a.V=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Aa){if(!bh(a,a.f,c,!0))break;b=0}}}
|
||||
function Jc(a,b,c,d,e){var f=!1;if(!a.Ta++)for(var g=1;!f&&g<d.length;g++){var l=d[g];if(!e||l.Aa)for(var m=a.Y(l),p=0;p<c;p++)if(b+p==m){var q,f=!0;l.Aa&&(bh(a,d,l,!0),e=!0);if(q=l.hc){for(var f=!1,v=0;v<q.length;v++)if(!eh(a,q[v],!0)){if(q[v].indexOf("if")){f=!0;break}for(var w=v+1;w<q.length&&q[w].indexOf("else");w++)v++;if(w==q.length){f=!0;break}}a.b.v.ca||(f=!0)}if(f){e||ch(a,d,g,"hit");break}}}a.Ta--;return f}
|
||||
function fh(a,b,c,d){var e=Z(b.A),f=a.ka(b,2),g,l;for(l in a.Wa)if(g=a.Wa[l][f&l])break;g||(g=Pg);var m=g[0];0<=a.kb.indexOf(m)&&(g=Pg,m=g[0]);var p=l="",q=Ng[m],v=g.length-1;m||v||(l=K(a,f));for(m=1;m<=v;m++){var w=g[m];if(void 0!==w){var x;x=a;var C=w,w=b,y="",D=C&61440;if(4096==D)w=w.A+((f&255)<<24>>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]);0<l.length&&(l+=",");l+=x||
|
||||
"???"}}f="";g=K(a,e.A)+":";if(-1!==e.A&&-1!==b.A){do if(f+=" "+K(a,a.ka(e,2)),null==e.A)break;while(e.A!=b.A)}g+=wa(f,24);g+=wa(q,5);l&&(g+=" "+l);if(c||p)g=wa(g,60)+";"+(c||""),g=a.b.v.Xa?g+("cycles="+Tc(a.b).toString()+" cs="+k(a.b.nb)):g+(null!=d?"="+d.toString():""),p&&(g+=" @"+p);return g}function gh(a,b){switch(b){case "N":a=a.b.Da();break;case "Z":a=zd(a.b);break;case "V":a=yd(a.b);break;case "C":a=xd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function hh(a,b){var c="",d=a.b;8>b?(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]<b[0]?-1:0};
|
||||
function jh(a,b,c){var d=[],e=a.Y(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.A>>>0,l=f.sc;if(e>=g&&e<g+l){e=za(f.Rb,[e-g],a.Sb);0<=e?kh(a,b,e,d):c&&(e=~e,kh(a,b,e-1,d),kh(a,b,e,d));break}}return d}function kh(a,b,c,d){var e={},f=a.G[b].Rb,g=0,l=null;0<=c&&c<f.length&&(g=f[c][0],l=f[c][1]);l&&(e=a.G[b].Ca[l],l="."==l.charAt(0)?null:e.l||l);d.push(l);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function lh(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Hg(a)||a.i("no variables"),!0;if(!c[2])return Hg(a,c[1]);if(!c[3])return delete a.aa[c[1]],!0;b=Dg(a,c[3]);return void 0!==b?(a.aa[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||
function mh(a,b,c){var d=null;if(b=Sg(a,b,!0)){a.Y(b);var e=jh(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.A-e[1])&&(g=" + "+k(f,4,!0)),f=e[0]+" ("+K(a,e[1])+")"+g,c&&a.i(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.A)&&(g=" - "+k(f,4,!0)),f=e[4]+" ("+K(a,e[5])+")"+g,c&&a.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
|
||||
function Zg(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}f=Dg(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":Bd(d,f);a.K=Z(d.u[7]);break;case "N":d.S=f?32768:0;break;
|
||||
case "Z":d.X=f?0:1;break;case "V":d.O=f?32768:0;break;case "C":d.N=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){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?1<c[2].length?a.i(c[2]):Gg(a,null,c[2].charCodeAt(0)):Dg(a,b,!0)}
|
||||
function oh(a,b,c){var d="t"!=b;c=Fg(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ma(c,function(){return nb(a,!0)&&a.fb(e,d,!1)},function(){a.B.$();nb(a,!1)})}
|
||||
function $g(a,b,c,d){if(b=Sg(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Fg(a,c.substr(1)),null!=c&&(d=c);else{d=Sg(a,c,!0);if(!d||d.A<b.A)return;e=d.A-b.A;if(256<e){a.i("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=ob(a,!1)||a.V?a.H:null;var g=null!=f?"cycles":null,l=jh(a,b),m=b.A;if(l[0]&&d&&(!c&&d||0>l[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)&&0<b.length){a.U&&(b="a "+K(a,a.T.A)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var l=g[0],m=l.charAt(0),p=1;p<l.length;p++){var q=l.charAt(p);if("?"==m||"r"==m||"a">q||"z"<q){g[0]=l.substr(p);g.unshift(l.substr(0,p));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var v=
|
||||
Sg(a,g[1],!0);if(v)if(a.T=v,void 0===g[2])a.i("begin assemble at "+K(a,v.A)),a.U=!0,a.B.$();else{var w;a.i("not supported yet");w=[];if(w.length){for(var x=0;x<w.length;x++)a.Db(v,w[x],1);a.i(fh(a,a.T))}}break;case "b":a:{var C=g[0],y=g[1],D=b;if("?"==y)a.i("breakpoint commands:"),a.i("\tbp [a]\tset exec breakpoint at addr [a]"),a.i("\tbr [a]\tset read breakpoint at addr [a]"),a.i("\tbw [a]\tset write breakpoint at addr [a]"),a.i("\tbc [a]\tclear breakpoint at addr [a]"),a.i("\tbl\tlist all breakpoints"),
|
||||
a.i("\tbn [n]\tbreak after [n] instruction(s)");else{var Ba=C.charAt(1);if("l"==Ba){var $c;$c=0+dh(a,a.f);$c+=dh(a,a.M);($c+=dh(a,a.D))||a.i("no breakpoints")}else if("n"==Ba)a.ma=Fg(a,y),a.i("break after "+a.ma+" instruction(s)");else if(void 0===y)a.i("missing breakpoint address");else{var U=Z();if("*"!=y&&(U=Sg(a,y,!0),!U))break a;"c"==Ba?null==U.A?(Jg(a),a.i("all breakpoints cleared")):bh(a,a.f,U)||bh(a,a.M,U)||bh(a,a.D,U)||a.i("breakpoint missing: "+K(a,U.A)):null!=U.A&&(Wg(a,U,D),"p"==Ba?a.Pa(a.f,
|
||||
U):"r"==Ba?a.Pa(a.M,U):"w"==Ba?a.Pa(a.D,U):a.i("unknown breakpoint command: "+Ba))}}}break;case "c":a.Qa&&(a.Qa.value="");break;case "d":a:{var Ua,Va=g[0],ha=g[1],Ca=g[2],Hh=g[3];if("?"==ha){var Wa="";for(Ua in I)a.za[Ua]&&(Wa&&(Wa+=","),Wa+=Ua);Wa+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");Wa.length&&
|
||||
a.i("dump extension commands:\n\t"+Wa)}else if("state"==ha){var Df=ph(a.B,!0);"console"==Ca?console.log(Df):(a.Qa&&(a.Qa.value=""),a.i(Df))}else if("symbols"==ha)for(var ad=0;ad<a.G.length;ad++){var bd=a.G[ad],Xa;for(Xa in bd.Ca)if("."!=Xa.charAt(0)){var Ef=bd.Ca[Xa].o;if(void 0!==Ef){var Ff=bd.Ca[Xa].l;Ff&&(Xa=Ff);a.i(K(a,Ef)+" "+Xa)}}}else{if("d"==Va){for(Ua in I)if(g[1]==Ua){var Gf=a.za[Ua];Gf?(g.shift(),g.shift(),Gf(g)):a.i("no dump registered for "+ha);break a}ha||(Va=a.Ab||"db")}else a.Ab=Va;
|
||||
if("dh"==Va){var Hf=ha,If=Ca,Jf="",Kf=0,ca=a.fa,ia=a.I;if(ia.length){var X=+Hf||a.Va,sb=+If||10;isNaN(X)?X=sb:Jf="more ";X>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<sb&&ca!=a.fa;){var Lf=ia[ca++];if(null==Lf.A)break;var tb=Z(Lf.A),Ih=X--,Mf=fh(a,tb,"history",Ih);(!cd.length||0<=Mf.indexOf(cd[0]))&&a.i(Mf);tb.Ib&&(ca+=
|
||||
tb.Ib,sb-=tb.Ib,X-=tb.Ib);ca>=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<cc&&(cc=65536));for(var vb="",Ya="dd"==Va?4:"dw"==Va?2:1,dc=Ya*cc||128,Jh=dc+15>>4||1;Jh--&&0<dc;){var ec=0,wb=0,xb,dd="",Nf="",ha=K(a,ub.A);for(xb=4==Ya?16:a.ja;0<xb&&0<dc;xb--){var ed,fc=2==Ya?a.ka(ub,ed=2):a.lb(ub,ed=1),ec=ec|fc<<(wb<<3),wb=wb+ed;wb==Ya&&(dd+=K(a,ec,Ya),dd+=
|
||||
1==Ya?9==xb?"-":" ":" ",ec=wb=0);Nf+=32<=fc&&128>fc?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<a.ua.length;pd++)a.i(a.ua[pd]);a.ua=[]}}var Ph=0,Cb="";for(ja in I)if(!F||F==ja){var Qh=!!(a.ia&I[ja]);if(null===ka||ka==Qh)Cb&&(Cb+=","),++Ph%10||(Cb+="\n\t"),
|
||||
"key"==ja&&(ja="keys"),Cb+=ja}void 0===F&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==ka?ka?"messages on: ":"messages off: ":"message categories:\n\t")+(Cb||"none"));Kg(a)}break;case "p":if("print"==g[0]){nh(a,b.substr(5));break}var Rh="pr"==g[0]?1:0;if(a.V)a.i("step in progress");else{var Uf=Z(a.b.u[7]);a.lb(Uf);a.V?(a.Pa(a.f,Uf,!0),a.eb()||(a.B&&a.B.sb(),a.V=0)):oh(a,Rh?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}Zg(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Db=
|
||||
+g[2];if(8==Db||10==Db||16==Db)a.ja=Db;else{a.i("invalid base: "+Db);break}}a.i("default base: "+a.ja);break;case "cs":var Eb;void 0!==g[3]&&(Eb=+g[3]);switch(g[2]){case "int":a.b.Za=Eb;break;case "start":a.b.ob=Eb;break;case "stop":a.b.$a=Eb;break;default:a.i("unknown cs option");break a}void 0!==Eb&&Qc(a.b);a.i("checksums "+(a.b.v.Xa?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Uc(a.b,+g[2])||a.i("warning: using 1x multiplier, previous target not reached"));a.i("target speed: "+(a.b.Ra.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.Ka+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":oh(a,g[0],g[1]);break;case "u":$g(a,g[1],g[2],8);break;case "v":if("var"==g[0]){lh(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.i("PDPjs version 1.30.1 ("+a.b.Ya+",RELEASE"+(Fb?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){nh(a,b.substr(1));break}var qd="commands:",rd;for(rd in Mg)qd+="\n"+wa(rd,9)+Mg[rd];Wd(a)||(qd+="\nnote: history disabled if no exec breakpoints");a.i(qd);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(Vf){a.i("debugger error: "+(Vf.stack||Vf.message)),d=!1}return d}
|
||||
function Rc(a,b,c){b=Bg(a,b,c);for(var d in b)if(!eh(a,b[+d]))return!1;return!0}Ta(function(){for(var a=B(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Ig(d);A(d,c)}});
|
||||
function qh(a,b,c){r.call(this,"Computer",a,qh,67108864);this.v.ha=!1;rh(this,b);this.M=Oc(this,"autoPower",a);this.B=0;this.aa=a.busWidth||a.buswidth;this.f=sh;this.I=null;this.G=this.U=!1;this.ba=Oc(this,"url")||"";(Math.random()+.1).toString(36);this.j=th(this);if(this.b=mb("CPU",this.id)){this.g=mb("Debugger",this.id);this.w=new Lb({id:this.Gb+".bus",busWidth:this.aa},this.b,this.g);var d,e=kb(this.id);if((this.C=mb("Panel",this.id))&&this.C.Qa)for(b=0;b<e.length;b++)d=e[b],d.na=this.C.na,d.i=
|
||||
this.C.i,d.Qa=this.C.Qa;this.i("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ba&&d.Ba(this,this.w,this.b,this.g);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Oc(this,"state")||(f=!0,a.state))b=this.R=a,f||(this.G=!0,this.f=sh),this.f&&
|
||||
(this.K=new O(this,"1.30.1"),uh(this.K)?b=null:delete this.K);!b&&this.f&&(b=vh(this))&&(this.G=!0);if(b){var g=this;Fa(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.na("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.U=!0);H(g)})}else H(this);this.J.power||(this.M=!0);!c&&this.M&&wh(this,this.pb)}else n("Unable to find CPU component")}u(qh);var sh=0;
|
||||
function rh(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){n(d.message+" ("+c+")")}}a.V=b}function Oc(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.V&&(d=a.V[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function wh(a,b,c){for(var d=kb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!pb(f)){pb(f,function(){wh(a,b,c)});return}}b.call(a,c)}
|
||||
function xh(a,b){var c=new O(a,"1.30.1","validate");if(uh(c)&&yh(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.na("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=qh.prototype;
|
||||
h.pb=function(a){void 0===a&&(a=this.f||(this.I?1:sh));if(!this.B){this.B++;var b=!1,c=!1;this.T=!1;var d=this.K||new O(this,"1.30.1");if(-1==a)b=!0;else if(a>sh){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;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ch(this,g,d,b,c));b=[d,a,c];-1!=a?wh(this,this.Ub,b):this.Ub(b)}};
|
||||
function Ch(a,b,c,d,e){if(!b.v.ha){b.v.ha=!0;if(b.ya){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ya(f,d)&&f&&(n("Unable to restore state for "+b.type),a.R&&!a.U?(c.clear(),a.f=sh,window&&window.location.reload()):a.T=!0,b.ya(null),e=!1)}if(!d&&b.Vb)for(a=b.Vb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Ub=function(a){var b=a[0],c=0>a[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;m<l.length;m++){var p=l[m];p.v.ha&&(p.xa&&(d=p.xa(b,c),"object"===typeof d&&f.set(p.id,
|
||||
d)),c&&(p.v.ha=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.j&&Dh(a,a.j,f.toString()),Bh(g)&&Bh(f)||(e=null,d=l=!0)):a.f&&(d=!0,l=3==a.f),d&&f.clear(l)):e=f.toString());c&&(a.v.ha=!1,b=a.J.power)&&(b.textContent="Power");a.B=0;return e}h.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());for(var a=kb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}};
|
||||
h.start=function(a,b){for(var c=kb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.$(!0)};h.stop=function(a,b){for(var c=kb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.$(!0)};
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case "power":return this.J[b]=c,c.onclick=function(){d.B||(d.v.ha?oh(d,!1,!0):vh(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.");oh(d,a,!0);!a&&d.R?window&&window.location.reload():d.pb(rh)}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=sh(d,!0);if(a){var b=!!(d.f&&!d.H||d.R),c=oh(d,b);b?Ch(d,a,c):d.na("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function sh(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=Dh(a,c))||a.na("The user ID is invalid.")):b&&a.na("Browser local storage is not available"));return c}
|
||||
function Dh(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 uh(a){var b=null;a.j&&(b=sa()+"/api/v1/user?req=load&user="+a.j+"&state="+Eh(a,"1.30.1"));return b}
|
||||
function Ch(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Eh(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");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.na(c),Ka("user",""),a.j=null)}}h.sb=function(){};
|
||||
h.$=function(a){this.b&&this.b.$(a);this.C&&this.C.$(a)};Ta(function(){for(var a=A(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=A(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new ph(g,d,!0);nb(g,f);g.M&&vh(g,g.pb)}});Oa.show.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.fa&&!c.v.ha&&c.pb(-1)}});
|
||||
Oa.exit.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.v.ha&&oh(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Eh(a,b,c);this.i=a.i;zh(this,a.pc)}function Eh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){zh(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function zh(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ah(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Ka(a.key,c)||(n("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function xh(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){n(c.message||c),b=!1}return b}function th(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Fh=0;
|
||||
function Rh(a,b,c,d,e,f){e("Loading "+a+"...");Fa(a,null,!0,function(g,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),f(l,null)):Sh(l,a,b,c,d,e,f)})}
|
||||
function Sh(a,b,c,d,e,f,g){function l(a,f){if(f)g(f,null);else{c&&(jb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Th(a,f,l):l(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Th(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.na(c),Ka("user",""),a.j=null)}}h.sb=function(){};
|
||||
h.$=function(a){this.b&&this.b.$(a);this.C&&this.C.$(a)};Ta(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=B(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new qh(g,d,!0);A(g,f);g.M&&wh(g,g.pb)}});Oa.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.fa&&!c.v.ha&&c.pb(-1)}});
|
||||
Oa.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.v.ha&&ph(c,!(!c.f||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=Fh(a,b,c);this.g=a.g;Ah(this,a.pc)}function Fh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Ah(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Ah(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Bh(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Ka(a.key,c)||(n("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function yh(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){n(c.message||c),b=!1}return b}function uh(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Gh=0;
|
||||
function Sh(a,b,c,d,e,f){e("Loading "+a+"...");Fa(a,null,!0,function(g,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),f(l,null)):Th(l,a,b,c,d,e,f)})}
|
||||
function Th(a,b,c,d,e,f,g){function l(a,f){if(f)g(f,null);else{c&&(jb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){f=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Uh(a,f,l):l(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function Uh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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
|
||||
|
|
|
|||
|
|
@ -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<w.length;b++){var d=w[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function Pa(a){if(void 0!==a){var b;for(b=0;b<w.length;b++)if(w[b].id===a)return w[b]}return null}function Qa(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<w.length;d++)if(c)c==w[d]&&(c=null);else if(!(a!=w[d].type||b&&w[d].id.indexOf(b)))return w[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){p(c.message+" ("+a+")")}return b}
|
||||
function A(a,b){b=C(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var k=f.getAttribute("class");if(k)for(var l=k.split(" "),n=0;n<l.length;n++)switch(k=l[n],k){case "pdp11-binding":(k=z(f))&&k.binding&&a.U(k.type,k.binding,f,k.value),n=l.length}}}}
|
||||
function C(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
function A(a,b){b=B(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var k=f.getAttribute("class");if(k)for(var l=k.split(" "),n=0;n<l.length;n++)switch(k=l[n],k){case "pdp11-binding":(k=z(f))&&k.binding&&a.U(k.type,k.binding,f,k.value),n=l.length}}}}
|
||||
function B(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
||||
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},U:function(a,b,c){switch(b){case "clear":return this.v[b]||(this.v[b]=c,c.onclick=function(a){return function(){a.v.print&&(a.v.print.value="")}}(this)),!0;case "print":return this.v[b]||(this.Sa=this.v[b]=c,c.value="",this.O=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
||||
this.K=function(a){this.O(a,this.Ea)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.Ea+": "+a)},K:function(a,b,c){c=c||this.type;b||p((c?c+": ":"")+a)},ba:function(){return this.h.L=!0},aa:function(a,b){b&&(this.h.L=!1);return!0}};function D(a){if(!a.h.error&&(a.h.ready=!0,a.h.ready)){var b=a.Oa;a.Oa=null;b&&b()}}function Ra(a,b){b&&(a.h.ready?b():a.Oa=b);return a.h.ready}
|
||||
this.K=function(a){this.O(a,this.Ea)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.Ea+": "+a)},K:function(a,b,c){c=c||this.type;b||p((c?c+": ":"")+a)},Y:function(){return this.h.L=!0},X:function(a,b){b&&(this.h.L=!1);return!0}};function C(a){if(!a.h.error&&(a.h.ready=!0,a.h.ready)){var b=a.Oa;a.Oa=null;b&&b()}}function Ra(a,b){b&&(a.h.ready?b():a.Oa=b);return a.h.ready}
|
||||
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
||||
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Sa="undefined"!==typeof ArrayBuffer;function Ta(a){v.call(this,"Panel",a,Ta);this.b=0;this.h.fb=!0}x(Ta);g=Ta.prototype;
|
||||
g.U=function(a,b,c,d){if(this.w&&this.w.U(a,b,c,d)||this.a&&this.a.U(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.U.call(this,a,b,c,d)}};g.ka=function(a,b,c,d){this.w=a;this.m=b;this.a=c;this.G=d};g.ba=function(a,b){b||Ua();return!0};g.aa=function(){return!0};
|
||||
g.U=function(a,b,c,d){if(this.w&&this.w.U(a,b,c,d)||this.a&&this.a.U(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.U.call(this,a,b,c,d)}};g.ca=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.G=d};g.Y=function(a,b){b||Ua();return!0};g.X=function(){return!0};
|
||||
function Va(a,b,c,d){if(a.v[b]){void 0===c&&(a.h.error=!0,a.K("Value for "+b+" is invalid"),E(a.a));var e=a.G&&a.G.b||8;c=!a.a.h.T||a.h.fb?8==e?ja(c,d):h(c,d):"--------".substr(0,d||4);a.v[b].textContent!=c&&(a.v[b].textContent=c)}}function Wa(a,b,c,d){for(var e=0;e<d;e++){var f=a.v[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
g.ca=function(a){if(this.b&&(a||!this.a.h.T||this.h.fb)){for(a=0;a<this.a.f.length;a++)Va(this,"R"+a,this.a.f[a]);a=Xa(this.a);Va(this,"PS",a);Va(this,"NF",a&8?1:0,1);Va(this,"ZF",a&4?1:0,1);Va(this,"VF",a&2?1:0,1);Va(this,"CF",a&1?1:0,1);Wa(this,"D",this.a.f[0],16);Wa(this,"A",this.a.f[7],22)}};function Ua(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=Pa(e.id);f||(a=!0,f=new Ta(e));A(f,d);a&&D(f)}}u(Ua);
|
||||
function Ya(a,b,c){v.call(this,"Bus",a,Ya);this.a=b;this.G=c;this.H=a.busWidth||16;this.l=0;this.D=[];this.s=null;this.A=Math.pow(2,this.H);this.i=this.A-1|0;this.c=F;this.m=Math.log2(this.c);this.B=this.c>>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<this.w;b++)this.b[b]=a;D(this)}x(Ya);var F=8192,db=F-1;
|
||||
function Za(a,b){var c=-1,d=this.controller,e=d.ha[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>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.l)-F,gb(a,c,F,a.D),a.l=0);b&&(a.l=b,c=(1<<b)-F,a.D=hb(a,c,F),a.s?gb(a,c,F,a.s):(ib(a,c,F,jb,a),a.s=hb(a,c,F)))}}
|
||||
Ya.prototype.reset=function(){for(var a=0;a<this.o.length;a++)this.o[a]();fb(this,16)};function eb(a,b){a.R||H(a.a,4,b);return 0}Ya.prototype.ba=function(a,b){b||this.reset();return!0};
|
||||
function ib(a,b,c,d,e){for(var f=b,k=c,l=f>>>a.m;0<k&&l<a.b.length;){var n=a.b[l],r=l*a.c,t=a.c-(f-r);t>k&&(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<B&&(B=10):B=c&-65536?10:5;if(null==c||isNaN(c))for(;0<B--;)e="?"+e;else for(;0<B--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+lb[d]+" at "+ja(b));return!0}return kb(2,b,c)}function hb(a,b,c){var d=[];for(b>>>=a.m;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.c;return d}function gb(a,b,c,d){var e=0;for(b>>>=a.m;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.c}}function mb(a,b){return a.b[(b&a.i)>>>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<a.w;d++){var e=a.b[d];if(e.ia||e.xb){c[b++]=d;var f=b++;if(e=e.save()){for(var k=0,l=0,n=[];k<e.length;){for(var r=e[k],t=k+1;t<e.length&&e[t]===r;)t++;n[l++]=t-k;n[l++]=r;k=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function qb(a,b,c,d,e,f,k,l){for(;b<=c;b+=2){var n=b&db;void 0!==a.ha[n]?p("I/O address already registered: "+h(b,8,!0)):a.ha[n]=[d,e,f,k,l||"unknown",!1]}}
|
||||
g.da=function(a){if(this.b&&(a||!this.a.h.T||this.h.fb)){for(a=0;a<this.a.f.length;a++)Va(this,"R"+a,this.a.f[a]);a=Xa(this.a);Va(this,"PS",a);Va(this,"NF",a&8?1:0,1);Va(this,"ZF",a&4?1:0,1);Va(this,"VF",a&2?1:0,1);Va(this,"CF",a&1?1:0,1);Wa(this,"D",this.a.f[0],16);Wa(this,"A",this.a.f[7],22)}};function Ua(){for(var a=!1,b=B(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=Pa(e.id);f||(a=!0,f=new Ta(e));A(f,d);a&&C(f)}}u(Ua);
|
||||
function Ya(a,b,c){v.call(this,"Bus",a,Ya);this.a=b;this.G=c;this.H=a.busWidth||16;this.m=0;this.D=[];this.s=null;this.A=Math.pow(2,this.H);this.i=this.A-1|0;this.c=F;this.l=Math.log2(this.c);this.B=this.c>>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<this.w;b++)this.b[b]=a;C(this)}x(Ya);var F=8192,db=F-1;
|
||||
function Za(a,b){var c=-1,d=this.controller,e=d.ia[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>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.m)-F,gb(a,c,F,a.D),a.m=0);b&&(a.m=b,c=(1<<b)-F,a.D=hb(a,c,F),a.s?gb(a,c,F,a.s):(ib(a,c,F,jb,a),a.s=hb(a,c,F)))}}
|
||||
Ya.prototype.reset=function(){for(var a=0;a<this.o.length;a++)this.o[a]();fb(this,16)};function eb(a,b){a.R||H(a.a,4,b);return 0}Ya.prototype.Y=function(a,b){b||this.reset();return!0};
|
||||
function ib(a,b,c,d,e){for(var f=b,k=c,l=f>>>a.l;0<k&&l<a.b.length;){var n=a.b[l],r=l*a.c,t=a.c-(f-r);t>k&&(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<D&&(D=10):D=c&-65536?10:5;if(null==c||isNaN(c))for(;0<D--;)e="?"+e;else for(;0<D--;)e=String.fromCharCode(c%10+48)+e,c/=
|
||||
10;a.status(e+"Kb "+lb[d]+" at "+ja(b));return!0}return kb(2,b,c)}function hb(a,b,c){var d=[];for(b>>>=a.l;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.c;return d}function gb(a,b,c,d){var e=0;for(b>>>=a.l;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.c}}function mb(a,b){return a.b[(b&a.i)>>>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;d<a.w;d++){var e=a.b[d];if(e.ja||e.xb){c[b++]=d;var f=b++;if(e=e.save()){for(var k=0,l=0,n=[];k<e.length;){for(var r=e[k],t=k+1;t<e.length&&e[t]===r;)t++;n[l++]=t-k;n[l++]=r;k=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function qb(a,b,c,d,e,f,k,l){for(;b<=c;b+=2){var n=b&db;void 0!==a.ia[n]?p("I/O address already registered: "+h(b,8,!0)):a.ia[n]=[d,e,f,k,l||"unknown",!1]}}
|
||||
function rb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.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<a.length;b++){var c=a[b],d=z(c);switch(d.name){case "default":d=new I(d),A(d,c)}}});var Bb;
|
||||
if(Sa){var Cb=new ArrayBuffer(2);(new DataView(Cb)).setUint16(0,256,!0);Bb=256===(new Uint16Array(Cb))[0]}else Bb=!1;var Db=Bb;
|
||||
function G(a,b,c,d,e,f){this.m=a;this.id=Eb+=2;this.a=null;this.za=b;this.Qa=c;this.size=d||0;this.type=e||Fb;this.v=e==Gb;this.controller=null;cb(this);this.ia=this.xb=!1;if(d)if(f)this.controller=f,this.a=null,Hb(this,f.vb);else if(Sa)this.b=new ArrayBuffer(d),this.g=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>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<this.a.length;a++)this.a[a]=0;Hb(this,Kb)}else Hb(this)}
|
||||
var Fb=0,Gb=2,jb=4,lb=["NONE","RAM","ROM","VID","H/W"],Eb=0;
|
||||
G.prototype={constructor:G,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Sa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Sa)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.ia=!0}return!1},w:function(){return 255},A:function(){},s:function(a,b){return this.Ya(a++,b++)|this.Ya(a,b)<<8},B:function(a,b,c){this.eb(a++,
|
||||
b&255,c++);this.eb(a,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<<a)|b<<a;this.ia=!0},ra:function(a,b,c){a&1&&tb(this.m,c);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.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;b<Qb.length;b++)(c=this.v[Qb[b]])&&this.w.U(null,Qb[b],c);a=Rb(a,"autoStart");null!=a&&(this.h.Aa="true"==a?!0:"false"==a?!1:!!a);D(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.ba=function(a,b){if(!b){if(a&&this.restore){Sb(this);if(!this.restore(a))return!1;Tb(this)}else this.reset();this.O("No debugger detected")}this.w.ca();return!0};g.aa=function(a){return a?this.save():!0};
|
||||
g.Aa=function(){return this.h.Aa||void 0===this.v.run?(Ub(this),!0):!1};g.hb=function(){return 0};function Tb(a){void 0===a.Ka&&(a.Ka=0);void 0===a.pa&&(a.pa=-1);void 0===a.qa&&(a.qa=-1);a.h.Ma=0<=a.Ka&&0<a.pa;a.h.Ma&&(a.Ja=0,a.fa=a.Ka-a.J)}
|
||||
g.U=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.v[b]=c,!0;case "run":return this.v[b]=c,c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.h.L)a=!0;else{var b=null,c,l=y(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.h.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.h.L);c++);c==l.length&&(b=a);p("The "+b.type+" component ("+b.id+") is not "+(b.h.ready?"powered yet":"ready yet"+(b.Oa?" (waiting for notification)":""))+".");a=!1}a&&(d.h.T?E(d):Ub(d))},!0;case "speed":return this.v[b]=
|
||||
c,!0;case "setSpeed":return this.v[b]=c,c.onclick=function(){Vb(d,d.$<<1)},c.textContent=this.da.toFixed(2)+"Mhz",!0}return!1};g.ca=function(){var a=this.v.speed;a&&(a.textContent=this.h.T&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped")};function Wb(a,b){var c=1;b&&1<a.$&&a.Y&&(c=a.Y/a.Va);a.kb=Math.round(1E3/30);a.Na=Math.floor(a.La/30*c);b||(a.ra=a.Na);a.Xa=0}function Xb(a){return a.J+a.V+a.ea-a.a}function Sb(a){a.Y=0;a.lb=0;a.J=a.V=a.ea=a.a=0;Tb(a);Vb(a,1)}
|
||||
function Vb(a,b){if(void 0!==b&&(.8>a.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&&b<a.H.length&&0>a.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.Y<this.da)-1E3>d&&(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<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.B){for(var f=0,k=Array(b.B),l=0;l<e.length-1;)for(var n=e[l++],r=e[l++];n--;)k[f++]=r;e=k}f=b.b[d];if(!f||!f.restore(e)){p("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function M(a){return a.l&65536?1:0}
|
||||
g.ja=function(){return this.o&32768?8:0};function dc(a){var b=a.S(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}function xb(a,b){return{pc:a,ta:b,next:null}}function vb(a,b){if(b!=a.W){var c=a.W;if(!c||c.ta<=b.ta)b.next=c,a.W=b;else{do{var d=c.next;if(!d||d.ta<=b.ta){b.next=d;c.next=b;break}c=d}while(c)}}a.j|=2}function Xa(a){return a.u=a.u&63728|a.ja()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)}
|
||||
function Ab(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.l=b<<16;if((b^a.u)&2048)for(var c=a.sa.length;0<=--c;){var d=a.f[c];a.f[c]=a.sa[c];a.sa[c]=d}a.s=b>>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(f<a.Ha)f&1&&!(c&1)&&(a.F|=64,H(a,4,10));else if(a.na&16||253952<=f&&(f|=4186112),4186112>f){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<f)||(a.A|=4096,a.A&512&&(a.j|=32)));return f}function kc(a,b,c){b&1&&a.a--;a=a.m;a.b[(b&a.i)>>>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&&4<c&&(c<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,18)):(a.F|=8,a.j|=4));a.Ra(c,b)}
|
||||
function lc(a,b,c,d){var e,f,k=d&8?0:a.M;switch(b){case 0:return H(a,4,20),0;case 1:return 6===c&&!a.s&&d&4&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,H(a,4,22)):(a.F|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|k;case 2:f=2;e=a.f[c];7!==c&&(e|=k,6>c&&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<this.a);return this.h.complete?this.ea-this.a:void 0===this.h.complete?0:-1};u(function(){for(var a=C(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Zb(d);A(d,c)}});function uc(a,b){var c=b+a;ec(this,c,a,b);return c&65535}function vc(a,b){var c=b+a;ec(this,c<<8,a<<8,b<<8);return c&255}function wc(a,b){a=b<<1;P(this,a);return a&65535}
|
||||
function xc(a,b){a=b<<1;P(this,a<<8);return a&255}function yc(a,b){a=b&32768|b>>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&&(b=16),this.l=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.l=c<<=b;var d=c>>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&&(b=32);var d=c>>b-1;this.l=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.l=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>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<b?65536:0);this.a-=23}function Gd(){this.a-=5}function Hd(){this.u&49152||(cc(this),this.m.reset());this.a-=667}
|
||||
function Id(){hc(this);this.j|=this.u&16;this.a-=13}function Jd(a){if(a&8)H(this,8,6);else{var b=ic(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}}function W(a){a&1&&(this.l=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.o=32768);this.a-=5}function Kd(a){var b=(a&448)>>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<f.length;e++)a.b[k++]=f[e]&255,a.b[k++]=f[e]>>8&255;else if(f=l.data)for(a.b=Array(4*f.length),k=e=0;e<f.length;e++)a.b[k++]=f[e]&255,a.b[k++]=f[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.length;e++)a.b[e]=ia(b[e]);ue(a)}}
|
||||
function ue(a){if(!Ra(a))if(!a.i)D(a);else if(a.b&&a.m){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+h(a.b.length,8,!0)+") does not match specified size ("+h(a.c,8,!0)+")";a.h.error=!0;a.K(b)}else{b=a.o;if(ib(a.m,b,a.c,a.w?1:Gb)){var c;for(c=0;c<a.b.length;c++)a.m.bb(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){var d=a,e=b[c],f=hb(d.m,d.o,d.c);gb(d.m,e,d.c,f)}delete a.b}}D(a)}}
|
||||
u(function(){for(var a=C(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new se(d);A(d,c)}});function ve(a){v.call(this,"RAM",a,ve);this.g=a.addr;this.c=a.size;this.b=!1}x(ve);ve.prototype.ka=function(a,b,c,d){this.m=b;this.a=c;this.G=d;!this.b&&this.c&&ib(this.m,this.g,this.c,1)&&(this.b=!0);this.b||p("No RAM allocated");D(this)};ve.prototype.ba=function(){return!0};ve.prototype.aa=function(){return!0};ve.prototype.reset=function(){};
|
||||
u(function(){for(var a=C(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new ve(d);A(d,c)}});function we(a){v.call(this,"Keyboard",a,we);D(this)}x(we);we.prototype.U=function(){return!1};we.prototype.ka=function(a,b,c,d){this.w=a;this.a=c;this.G=d};u(function(){for(var a=C(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new we(d);A(d,c)}});
|
||||
function Z(a){this.g=this.l=null;this.H=a.tabSize;this.B=a.charBOL;this.o=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.l="";else{var c;a=xe;b&&(void 0===c&&(c="Panel"),(c=Qa(c,this.id))&&(b=c.v[b])&&this.U(null,a,b))}this.s=this.A=null;this.exports={connect:this.ib,receiveData:this.Za}}x(Z);var xe="buffer";g=Z.prototype;
|
||||
g.U=function(a,b,c){var d=this;switch(b){case xe:return this.v[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Za(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Za(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
g.ka=function(a,b,c,d){this.w=a;this.m=b;this.a=c;this.G=d;var e=this;this.M=xb(48,4);this.I=ub(this.a,function(){e.b&128||!e.i.length||(e.D=e.i.shift(),e.b|=128,e.b&64&&vb(e.a,e.M))});this.N=xb(52,4);this.J=ub(this.a,function(){e.c|=128;e.c&64&&vb(e.a,e.N)});rb(b,this,ye);D(this)};
|
||||
g.ib=function(){if(!this.s){var a=Rb(this.w,"connection");if(a){var b=a.split("->");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<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);wb(this.a,this.I,1);return!0};g.Yb=function(){return this.b&65535};g.Ic=function(a){this.b=this.b&-112|a&111};
|
||||
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=B(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=z(d);switch(c.type){case "default":c=new I(c);A(c,d);break;case "pc11":c=new Bb(c),A(c,d)}}});var Cb;
|
||||
if(Sa){var Db=new ArrayBuffer(2);(new DataView(Db)).setUint16(0,256,!0);Cb=256===(new Uint16Array(Db))[0]}else Cb=!1;var Eb=Cb;
|
||||
function G(a,b,c,d,e,f){this.l=a;this.id=Fb+=2;this.a=null;this.za=b;this.Qa=c;this.size=d||0;this.type=e||Gb;this.v=e==Hb;this.controller=null;cb(this);this.ja=this.xb=!1;if(d)if(f)this.controller=f,this.a=null,Ib(this,f.vb);else if(Sa)this.b=new ArrayBuffer(d),this.g=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>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<this.a.length;a++)this.a[a]=0;Ib(this,Lb)}else Ib(this)}
|
||||
var Gb=0,Hb=2,jb=4,lb=["NONE","RAM","ROM","VID","H/W"],Fb=0;
|
||||
G.prototype={constructor:G,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Sa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Sa)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.ja=!0}return!1},w:function(){return 255},A:function(){},s:function(a,b){return this.Ya(a++,b++)|this.Ya(a,b)<<8},B:function(a,b,c){this.eb(a++,
|
||||
b&255,c++);this.eb(a,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<<a)|b<<a;this.ja=!0},ra:function(a,b,c){a&1&&tb(this.l,c);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.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;b<Rb.length;b++)(c=this.v[Rb[b]])&&this.w.U(null,Rb[b],c);a=Sb(a,"autoStart");null!=a&&(this.h.Aa="true"==a?!0:"false"==a?!1:!!a);C(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.Y=function(a,b){if(!b){if(a&&this.restore){Tb(this);if(!this.restore(a))return!1;Ub(this)}else this.reset();this.O("No debugger detected")}this.w.da();return!0};g.X=function(a){return a?this.save():!0};
|
||||
g.Aa=function(){return this.h.Aa||void 0===this.v.run?(Vb(this),!0):!1};g.hb=function(){return 0};function Ub(a){void 0===a.Ka&&(a.Ka=0);void 0===a.pa&&(a.pa=-1);void 0===a.qa&&(a.qa=-1);a.h.Ma=0<=a.Ka&&0<a.pa;a.h.Ma&&(a.Ja=0,a.ga=a.Ka-a.J)}
|
||||
g.U=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.v[b]=c,!0;case "run":return this.v[b]=c,c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.h.L)a=!0;else{var b=null,c,l=y(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.h.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.h.L);c++);c==l.length&&(b=a);p("The "+b.type+" component ("+b.id+") is not "+(b.h.ready?"powered yet":"ready yet"+(b.Oa?" (waiting for notification)":""))+".");a=!1}a&&(d.h.T?E(d):Vb(d))},!0;case "speed":return this.v[b]=
|
||||
c,!0;case "setSpeed":return this.v[b]=c,c.onclick=function(){Wb(d,d.ba<<1)},c.textContent=this.ea.toFixed(2)+"Mhz",!0}return!1};g.da=function(){var a=this.v.speed;a&&(a.textContent=this.h.T&&this.$?this.$.toFixed(2)+"Mhz":"Stopped")};function Xb(a,b){var c=1;b&&1<a.ba&&a.$&&(c=a.$/a.Va);a.kb=Math.round(1E3/30);a.Na=Math.floor(a.La/30*c);b||(a.ra=a.Na);a.Xa=0}function Yb(a){return a.J+a.V+a.fa-a.a}function Tb(a){a.$=0;a.lb=0;a.J=a.V=a.fa=a.a=0;Ub(a);Wb(a,1)}
|
||||
function Wb(a,b){if(void 0!==b&&(.8>a.$/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&&b<a.H.length&&0>a.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.$<this.ea)-1E3>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<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.B){for(var f=0,k=Array(b.B),l=0;l<e.length-1;)for(var n=e[l++],r=e[l++];n--;)k[f++]=r;e=k}f=b.b[d];if(!f||!f.restore(e)){p("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function M(a){return a.m&65536?1:0}
|
||||
g.ka=function(){return this.o&32768?8:0};function ec(a){var b=a.S(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}function xb(a,b){return{pc:a,ta:b,next:null}}function vb(a,b){if(b!=a.W){var c=a.W;if(!c||c.ta<=b.ta)b.next=c,a.W=b;else{do{var d=c.next;if(!d||d.ta<=b.ta){b.next=d;c.next=b;break}c=d}while(c)}}a.j|=2}function Xa(a){return a.u=a.u&63728|a.ka()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)}
|
||||
function Ab(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.u)&2048)for(var c=a.sa.length;0<=--c;){var d=a.f[c];a.f[c]=a.sa[c];a.sa[c]=d}a.s=b>>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(f<a.Ha)f&1&&!(c&1)&&(a.F|=64,H(a,4,10));else if(a.na&16||253952<=f&&(f|=4186112),4186112>f){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<f)||(a.A|=4096,a.A&512&&(a.j|=32)));return f}function lc(a,b,c){b&1&&a.a--;a=a.l;a.b[(b&a.i)>>>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&&4<c&&(c<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,18)):(a.F|=8,a.j|=4));a.Ra(c,b)}
|
||||
function mc(a,b,c,d){var e,f,k=d&8?0:a.M;switch(b){case 0:return H(a,4,20),0;case 1:return 6===c&&!a.s&&d&4&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,H(a,4,22)):(a.F|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|k;case 2:f=2;e=a.f[c];7!==c&&(e|=k,6>c&&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<this.a);return this.h.complete?this.fa-this.a:void 0===this.h.complete?0:-1};u(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new $b(d);A(d,c)}});function vc(a,b){var c=b+a;fc(this,c,a,b);return c&65535}function wc(a,b){var c=b+a;fc(this,c<<8,a<<8,b<<8);return c&255}function xc(a,b){a=b<<1;P(this,a);return a&65535}
|
||||
function yc(a,b){a=b<<1;P(this,a<<8);return a&255}function zc(a,b){a=b&32768|b>>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&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>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&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>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<b?65536:0);this.a-=23}function Hd(){this.a-=5}function Id(){this.u&49152||(dc(this),this.l.reset());this.a-=667}
|
||||
function Jd(){ic(this);this.j|=this.u&16;this.a-=13}function Kd(a){if(a&8)H(this,8,6);else{var b=jc(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}}function W(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.o=32768);this.a-=5}function Ld(a){var b=(a&448)>>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<f.length;e++)a.b[k++]=f[e]&255,a.b[k++]=f[e]>>8&255;else if(f=l.data)for(a.b=Array(4*f.length),k=e=0;e<f.length;e++)a.b[k++]=f[e]&255,a.b[k++]=f[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.length;e++)a.b[e]=ia(b[e]);ve(a)}}
|
||||
function ve(a){if(!Ra(a))if(!a.i)C(a);else if(a.b&&a.l){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+h(a.b.length,8,!0)+") does not match specified size ("+h(a.c,8,!0)+")";a.h.error=!0;a.K(b)}else{b=a.o;if(ib(a.l,b,a.c,a.w?1:Hb)){var c;for(c=0;c<a.b.length;c++)a.l.bb(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){var d=a,e=b[c],f=hb(d.l,d.o,d.c);gb(d.l,e,d.c,f)}delete a.b}}C(a)}}
|
||||
u(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new te(d);A(d,c)}});function we(a){v.call(this,"RAM",a,we);this.g=a.addr;this.c=a.size;this.b=!1}x(we);we.prototype.ca=function(a,b,c,d){this.l=b;this.a=c;this.G=d;!this.b&&this.c&&ib(this.l,this.g,this.c,1)&&(this.b=!0);this.b||p("No RAM allocated");C(this)};we.prototype.Y=function(){return!0};we.prototype.X=function(){return!0};we.prototype.reset=function(){};
|
||||
u(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new we(d);A(d,c)}});function xe(a){v.call(this,"Keyboard",a,xe);C(this)}x(xe);xe.prototype.U=function(){return!1};xe.prototype.ca=function(a,b,c,d){this.w=a;this.a=c;this.G=d};u(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new xe(d);A(d,c)}});
|
||||
function Z(a){this.g=this.m=null;this.H=a.tabSize;this.B=a.charBOL;this.o=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=ye;b&&(void 0===c&&(c="Panel"),(c=Qa(c,this.id))&&(b=c.v[b])&&this.U(null,a,b))}this.s=this.A=null;this.exports={connect:this.ib,receiveData:this.Za}}x(Z);var ye="buffer";g=Z.prototype;
|
||||
g.U=function(a,b,c){var d=this;switch(b){case ye:return this.v[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Za(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Za(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
g.ca=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.G=d;var e=this;this.M=xb(48,4);this.I=ub(this.a,function(){e.b&128||!e.i.length||(e.D=e.i.shift(),e.b|=128,e.b&64&&vb(e.a,e.M))});this.N=xb(52,4);this.J=ub(this.a,function(){e.c|=128;e.c&64&&vb(e.a,e.N)});rb(b,this,ze);C(this)};
|
||||
g.ib=function(){if(!this.s){var a=Sb(this.w,"connection");if(a){var b=a.split("->");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<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);wb(this.a,this.I,1);return!0};g.Yb=function(){return this.b&65535};g.Ic=function(a){this.b=this.b&-112|a&111};
|
||||
g.Xb=function(){this.b&=-129;0<this.i.length&&wb(this.a,this.I,1);return this.D};g.Hc=function(){};g.lc=function(){return this.c};g.Wc=function(a){128==(this.c&192)&&a&64&&wb(this.a,this.J,1);this.c=this.c&-70|a&69};g.kc=function(){return 0};
|
||||
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<this.o&&this.o--;else{var b;b=(b=ra[a])?"<"+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<a.length;b++){var c=a[b],d=z(c),d=new Z(d);A(d,c)}});
|
||||
function Be(a,b,c){v.call(this,"Computer",a,Be);this.h.L=!1;Ce(this,b);this.B=Rb(this,"autoPower",a);this.g=0;this.M=a.busWidth||a.buswidth;this.b=De;this.s=null;this.o=this.I=!1;this.N=Rb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Ee(this);if(this.a=Qa("CPU",this.id)){this.G=Qa("Debugger",this.id);this.m=new Ya({id:this.Ua+".bus",busWidth:this.M},this.a,this.G);var d,e=y(this.id);if((this.i=Qa("Panel",this.id))&&this.i.Sa)for(b=0;b<e.length;b++)d=e[b],d.K=this.i.K,d.O=this.i.O,d.Sa=this.i.Sa;
|
||||
this.O("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.O("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ka&&d.ka(this,this.m,this.a,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=Rb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=De),this.b&&(this.A=new L(this,
|
||||
"1.30.1"),Fe(this.A)?b=null:delete this.A);!b&&this.b&&(b=Ge(this))&&(this.o=!0);if(b){var k=this;m(b,null,!0,function(a,b,c){c?(k.w=null,k.o=!1,k.K("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(k.s=b,k.I=!0);D(k)})}else D(this);this.v.power||(this.B=!0);!c&&this.B&&He(this,this.Ca)}else p("Unable to find CPU component")}x(Be);var De=0;
|
||||
function Ce(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){p(d.message+" ("+c+")")}}a.J=b}function Rb(a,b,c){var d=b.toLowerCase(),d=Ia[b]||Ia[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function He(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){He(a,b,c)});return}}b.call(a,c)}
|
||||
function Ie(a,b){var c=new L(a,"1.30.1","validate");if(Fe(c)&&Je(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=Be.prototype;
|
||||
g.Ca=function(a){void 0===a&&(a=this.b||(this.s?1:De));if(!this.g){this.g++;var b=!1,c=!1;this.H=!1;var d=this.A||new L(this,"1.30.1");if(-1==a)b=!0;else if(a>De){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;f<e.length;f++)k=e[f],k!==this&&k!=this.a&&(c=Ne(this,k,d,b,c));b=[d,a,c];-1!=a?He(this,this.gb,b):this.gb(b)}};
|
||||
function Ne(a,b,c,d,e){if(!b.h.L){b.h.L=!0;if(b.ba){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ba(f,d)&&f&&(p("Unable to restore state for "+b.type),a.D&&!a.I?(c.clear(),a.b=De,window&&window.location.reload()):a.H=!0,b.ba(null),e=!1)}if(!d&&b.jb)for(a=b.jb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.gb=function(a){var b=a[0],c=0>a[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;n<l.length;n++){var r=l[n];r.h.L&&(r.aa&&(d=r.aa(b,c),"object"===typeof d&&f.set(r.id,
|
||||
d)),c&&(r.h.L=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Pe(a,a.c,f.toString()),Me(k)&&Me(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.h.L=!1,b=a.v.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.m&&this.m.reset&&this.m.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.m&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ca(!0)};
|
||||
g.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ca(!0)};
|
||||
g.U=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.h.L?Oe(d,!1,!0):He(d,d.Ca))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.w){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Oe(d,a,!0);!a&&d.D?window&&window.location.reload():d.Ca(De)}else d.reset(),d.a&&d.a.Aa()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.v[b]=
|
||||
c,c.onclick=function(){var a=Ee(d,!0);if(a){var b=!!(d.b&&!d.w||d.D),c=Oe(d,b);b?Pe(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ee(a,b){var c=a.c;c||((c=xa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Qe(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
||||
function Qe(a,b){a.c=null;b=m(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.c=b.data)}catch(d){p(d.message+" ("+c+")")}return a.c}function Ge(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+Re(a,"1.30.1"));return b}
|
||||
function Pe(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Re(a,"1.30.1");d.data=c;b=m(na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.K("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.K(c),ya("user",""),a.c=null)}}
|
||||
g.ca=function(a){this.a&&this.a.ca(a);this.i&&this.i.ca(a)};u(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],k=z(f),k=new Be(k,d,!0);A(k,f);k.B&&He(k,k.Ca)}});q.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Qa("Computer",c.id))&&c.R&&!c.h.L&&c.Ca(-1)}});
|
||||
q.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Qa("Computer",c.id))&&c.h.L&&Oe(c,!(!c.b||c.w),!0)}});function L(a,b,c){this.id=a.id;this.key=Re(a,b,c);this.G=a.G;Le(this,a.Bb)}function Re(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
L.prototype={constructor:L,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Le(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Le(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Me(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);ya(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Je(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function Fe(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=xa(a.key))?(a[a.id]=b,a.a=!0):!1}var Se=0;
|
||||
function Te(a,b,c,d,e,f){e("Loading "+a+"...");m(a,null,!0,function(k,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Ue(l,a,b,c,d,e,f)})}
|
||||
function Ue(a,b,c,d,e,f,k){function l(a,f){if(f)k(f,null);else{c&&(Oa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,f)}}a?e?Ve(a,f,l):l(a,null):k("no data"+(b?" for file: "+b:""),null)}
|
||||
function Ve(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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<this.o&&this.o--;else{var b;b=(b=ra[a])?"<"+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.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<a.length;b++){var c=a[b],d=z(c),d=new Z(d);A(d,c)}});function Bb(a){v.call(this,"PC11",a,Bb);this.b=0}x(Bb);
|
||||
g=Bb.prototype;g.U=function(){return!1};g.ca=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.G=d;C(this)};g.Y=function(a,b){if(!b)if(!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(){this.b&=-2241};g.save=function(){return(new L(this)).data()};g.restore=function(){return!0};
|
||||
function Ce(a,b,c){v.call(this,"Computer",a,Ce);this.h.L=!1;De(this,b);this.B=Sb(this,"autoPower",a);this.g=0;this.M=a.busWidth||a.buswidth;this.b=Ee;this.s=null;this.o=this.I=!1;this.N=Sb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Fe(this);if(this.a=Qa("CPU",this.id)){this.G=Qa("Debugger",this.id);this.l=new Ya({id:this.Ua+".bus",busWidth:this.M},this.a,this.G);var d,e=y(this.id);if((this.i=Qa("Panel",this.id))&&this.i.Sa)for(b=0;b<e.length;b++)d=e[b],d.K=this.i.K,d.O=this.i.O,d.Sa=this.i.Sa;
|
||||
this.O("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.O("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ca&&d.ca(this,this.l,this.a,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=Sb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=Ee),this.b&&(this.A=new L(this,
|
||||
"1.30.1"),Ge(this.A)?b=null:delete this.A);!b&&this.b&&(b=He(this))&&(this.o=!0);if(b){var k=this;m(b,null,!0,function(a,b,c){c?(k.w=null,k.o=!1,k.K("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(k.s=b,k.I=!0);C(k)})}else C(this);this.v.power||(this.B=!0);!c&&this.B&&Ie(this,this.Ca)}else p("Unable to find CPU component")}x(Ce);var Ee=0;
|
||||
function De(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){p(d.message+" ("+c+")")}}a.J=b}function Sb(a,b,c){var d=b.toLowerCase(),d=Ia[b]||Ia[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ie(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ra(f)){Ra(f,function(){Ie(a,b,c)});return}}b.call(a,c)}
|
||||
function Je(a,b){var c=new L(a,"1.30.1","validate");if(Ge(c)&&Ke(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=Ce.prototype;
|
||||
g.Ca=function(a){void 0===a&&(a=this.b||(this.s?1:Ee));if(!this.g){this.g++;var b=!1,c=!1;this.H=!1;var d=this.A||new L(this,"1.30.1");if(-1==a)b=!0;else if(a>Ee){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;f<e.length;f++)k=e[f],k!==this&&k!=this.a&&(c=Oe(this,k,d,b,c));b=[d,a,c];-1!=a?Ie(this,this.gb,b):this.gb(b)}};
|
||||
function Oe(a,b,c,d,e){if(!b.h.L){b.h.L=!0;if(b.Y){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Y(f,d)&&f&&(p("Unable to restore state for "+b.type),a.D&&!a.I?(c.clear(),a.b=Ee,window&&window.location.reload()):a.H=!0,b.Y(null),e=!1)}if(!d&&b.jb)for(a=b.jb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.gb=function(a){var b=a[0],c=0>a[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;n<l.length;n++){var r=l[n];r.h.L&&(r.X&&(d=r.X(b,c),"object"===typeof d&&f.set(r.id,
|
||||
d)),c&&(r.h.L=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Qe(a,a.c,f.toString()),Ne(k)&&Ne(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.h.L=!1,b=a.v.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.l&&this.l.reset&&this.l.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.l&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.da(!0)};
|
||||
g.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.da(!0)};
|
||||
g.U=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.h.L?Pe(d,!1,!0):Ie(d,d.Ca))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.w){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Pe(d,a,!0);!a&&d.D?window&&window.location.reload():d.Ca(Ee)}else d.reset(),d.a&&d.a.Aa()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.v[b]=
|
||||
c,c.onclick=function(){var a=Fe(d,!0);if(a){var b=!!(d.b&&!d.w||d.D),c=Pe(d,b);b?Qe(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Fe(a,b){var c=a.c;c||((c=xa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Re(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
||||
function Re(a,b){a.c=null;b=m(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.c=b.data)}catch(d){p(d.message+" ("+c+")")}return a.c}function He(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+Se(a,"1.30.1"));return b}
|
||||
function Qe(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Se(a,"1.30.1");d.data=c;b=m(na()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.K("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.K(c),ya("user",""),a.c=null)}}
|
||||
g.da=function(a){this.a&&this.a.da(a);this.i&&this.i.da(a)};u(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=B(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],k=z(f),k=new Ce(k,d,!0);A(k,f);k.B&&Ie(k,k.Ca)}});q.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Qa("Computer",c.id))&&c.R&&!c.h.L&&c.Ca(-1)}});
|
||||
q.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Qa("Computer",c.id))&&c.h.L&&Pe(c,!(!c.b||c.w),!0)}});function L(a,b,c){this.id=a.id;this.key=Se(a,b,c);this.G=a.G;Me(this,a.Bb)}function Se(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
L.prototype={constructor:L,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Me(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
||||
1);c=0}}};function Me(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Ne(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);ya(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ke(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function Ge(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=xa(a.key))?(a[a.id]=b,a.a=!0):!1}var Te=0;
|
||||
function Ue(a,b,c,d,e,f){e("Loading "+a+"...");m(a,null,!0,function(k,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Ve(l,a,b,c,d,e,f)})}
|
||||
function Ve(a,b,c,d,e,f,k){function l(a,f){if(f)k(f,null);else{c&&(Oa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,f)}}a?e?We(a,f,l):l(a,null):k("no data"+(b?" for file: "+b:""),null)}
|
||||
function We(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/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
|
||||
|
|
|
|||
Loading…
Reference in a new issue