Attempted to clean up mapUnibus() and bus-related faults; how well or ill-advised these changes are remains to be seen

This commit is contained in:
Jeff 2016-10-31 12:44:29 -07:00 committed by Jeff Parsons
commit daefc2992c
41 changed files with 1454 additions and 1476 deletions

View file

@ -9,7 +9,7 @@ PDP-11 Boot Images
The project contains the following PDP-11 boot images: The project contains the following PDP-11 boot images:
* [PDP-11 Boot Test](test/) * [PDP-11 Boot Monitor](monitor/)
* [DEC PDP-11 Bootstrap Loader](bootstrap/) * [DEC PDP-11 Bootstrap Loader](bootstrap/)
Boot code can be pre-loaded into any machine by including a `<ram>` component in the machine XML configuration file Boot code can be pre-loaded into any machine by including a `<ram>` component in the machine XML configuration file

View file

@ -1,9 +1,9 @@
037744: 016701 000026 MOV 26(PC),R1 ; @037776 037744: 016701 000026 MOV 037776,R1
037750: 012702 000352 MOV #352,R2 037750: 012702 000352 MOV #352,R2
037754: 005211 INC @R1 037754: 005211 INC @R1
037756: 105711 TSTB @R1 037756: 105711 TSTB @R1
037760: 100376 BPL 037756 037760: 100376 BPL 037756
037762: 116162 000002 037400 MOVB 2(R1),37400(R2) 037762: 116162 000002 037400 MOVB 2(R1),37400(R2)
037770: 005267 177756 INC 177756(PC) ; @037752 037770: 005267 177756 INC 037752
037774: 000765 BR 037750 037774: 000765 BR 037750
037776: 177550 .WORD 177550 037776: 177550 .WORD 177550

View file

@ -29,20 +29,20 @@ Here's what the **Bootstrap Loader** looks like:
037776 177550 037776 177550
Using any [PDPjs](/modules/pdpjs/) machine with the built-in Debugger, such as this Using any [PDPjs](/modules/pdpjs/) machine with the built-in Debugger, such as this
[PDP-11/20 Boot Test](/devices/pdp11/machine/1120/test/debugger/), the **Bootstrap Loader** [PDP-11/20 Boot Monitor](/devices/pdp11/machine/1120/monitor/debugger/), the **Bootstrap Loader**
is easily entered with a single Debugger EDIT ("e") command: is easily entered with a single Debugger EDIT ("e") command:
e 037744 016701 000026 012702 000352 005211 105711 100376 116162 000002 037400 005267 177756 000765 177550 e 037744 016701 000026 012702 000352 005211 105711 100376 116162 000002 037400 005267 177756 000765 177550
You can immediately disassemble the code using the Debugger's UNASSEMBLE ("u") command `u 037744 040000`: You can immediately disassemble the code using the Debugger's UNASSEMBLE ("u") command `u 037744 040000`:
037744: 016701 000026 MOV 26(PC),R1 ; @037776 037744: 016701 000026 MOV 037776,R1
037750: 012702 000352 MOV #352,R2 037750: 012702 000352 MOV #352,R2
037754: 005211 INC @R1 037754: 005211 INC @R1
037756: 105711 TSTB @R1 037756: 105711 TSTB @R1
037760: 100376 BPL 037756 037760: 100376 BPL 037756
037762: 116162 000002 037400 MOVB 2(R1),37400(R2) 037762: 116162 000002 037400 MOVB 2(R1),37400(R2)
037770: 005267 177756 INC 177756(PC) ; @037752 037770: 005267 177756 INC 037752
037774: 000765 BR 037750 037774: 000765 BR 037750
037776: 177550 .WORD 177550 037776: 177550 .WORD 177550

View file

@ -0,0 +1,89 @@
{"load":0xC000 /*140000*/,"exec":0xC000 /*140000*/,
"words":[
0x0005 /*000005*/,0x0A1F /*005037*/,0xFFFE /*177776*/,0x15C6 /*012706*/,0xC000 /*140000*/,0x0A1F /*005037*/,0xFF74 /*177564*/,0x15C0 /*012700*/,
0xC251 /*141121*/,0x09F7 /*004767*/,0x0052 /*000122*/,0x15DF /*012737*/,0xC054 /*140124*/,0x0040 /*000100*/,0x15DF /*012737*/,0x00E0 /*000340*/,
0x0042 /*000102*/,0x55DF /*052737*/,0x0040 /*000100*/,0xFF66 /*177546*/,0x15C0 /*012700*/,0xC269 /*141151*/,0x09F7 /*004767*/,0x0038 /*000070*/,
0xE5C6 /*162706*/,0x00AE /*000256*/,0x1180 /*010600*/,0x09F7 /*004767*/,0x006A /*000152*/,0x0A00 /*005000*/,0x0001 /*000001*/,0x0A80 /*005200*/,
0x0BF7 /*005767*/,0x000C /*000014*/,0x03FB /*001773*/,0x15E6 /*012746*/,0x5800 /*054000*/,0x1DE6 /*016746*/,0x0002 /*000002*/,0x0002 /*000002*/,
0x0000 /*000000*/,0x0000 /*000000*/,0x0AB7 /*005267*/,0xFFFA /*177772*/,0x0002 /*000002*/,0x8BDF /*105737*/,0xFF74 /*177564*/,0x80FD /*100375*/,
0x901F /*110037*/,0xFF76 /*177566*/,0x0087 /*000207*/,0x0000 /*000000*/,0xB5DF /*132737*/,0x0040 /*000100*/,0xFF74 /*177564*/,0x02FC /*001374*/,
0x1037 /*010067*/,0xFFF2 /*177762*/,0x15DF /*012737*/,0xC088 /*140210*/,0x0034 /*000064*/,0x15DF /*012737*/,0x0080 /*000200*/,0x0036 /*000066*/,
0xD5DF /*152737*/,0x0040 /*000100*/,0xFF74 /*177564*/,0x0087 /*000207*/,0x8BFF /*105777*/,0xFFDA /*177732*/,0x0306 /*001406*/,0x9FDF /*117737*/,
0xFFD4 /*177724*/,0xFF76 /*177566*/,0x0AB7 /*005267*/,0xFFCE /*177716*/,0x0002 /*000002*/,0x8A1F /*105037*/,0xFF74 /*177564*/,0x0002 /*000002*/,
0x0000 /*000000*/,0x0000 /*000000*/,0x1037 /*010067*/,0xFFF8 /*177770*/,0x0A37 /*005067*/,0xFFF6 /*177766*/,0x15DF /*012737*/,0xC0C0 /*140300*/,
0x0030 /*000060*/,0x15DF /*012737*/,0x0080 /*000200*/,0x0032 /*000062*/,0xD5DF /*152737*/,0x0040 /*000100*/,0xFF70 /*177560*/,0x0087 /*000207*/,
0x1026 /*010046*/,0x97C0 /*113700*/,0xFF72 /*177562*/,0xA017 /*120027*/,0x000D /*000015*/,0x032D /*001455*/,0xA017 /*120027*/,0x007F /*000177*/,
0x0303 /*001403*/,0xA017 /*120027*/,0x0008 /*000010*/,0x020A /*001012*/,0x0BF7 /*005767*/,0xFFC6 /*177706*/,0x0306 /*001406*/,0x0AF7 /*005367*/,
0xFFC0 /*177700*/,0x15C0 /*012700*/,0xC21F /*141037*/,0x09F7 /*004767*/,0xFF7E /*177576*/,0x012B /*000453*/,0xA017 /*120027*/,0x0020 /*000040*/,
0x0528 /*002450*/,0xA017 /*120027*/,0x007F /*000177*/,0x0425 /*002045*/,0x09F7 /*004767*/,0xFF5E /*177536*/,0xA017 /*120027*/,0x007A /*000172*/,
0x0605 /*003005*/,0xA017 /*120027*/,0x0061 /*000141*/,0x0502 /*002402*/,0xC5C0 /*142700*/,0x0020 /*000040*/,0x2DD7 /*026727*/,0xFF92 /*177622*/,
0x00AC /*000254*/,0x0417 /*002027*/,0x9026 /*110046*/,0x1DC0 /*016700*/,0xFF86 /*177606*/,0x6DC0 /*066700*/,0xFF84 /*177604*/,0x9588 /*112610*/,
0x0AB7 /*005267*/,0xFF7E /*177576*/,0x010E /*000416*/,0x1DC0 /*016700*/,0xFF76 /*177566*/,0x6DC0 /*066700*/,0xFF74 /*177564*/,0x8A08 /*105010*/,
0x15DF /*012737*/,0xC146 /*140506*/,0x00A0 /*000240*/,0x15DF /*012737*/,0x0040 /*000100*/,0x00A2 /*000242*/,0x15DF /*012737*/,0x0400 /*002000*/,
0xFFFA /*177772*/,0x1580 /*012600*/,0x0002 /*000002*/,0x0A1F /*005037*/,0xFFFA /*177772*/,0x1026 /*010046*/,0x1066 /*010146*/,0x10A6 /*010246*/,
0x10E6 /*010346*/,0x1126 /*010446*/,0x15C0 /*012700*/,0xC21C /*141034*/,0x09F7 /*004767*/,0xFF0C /*177414*/,0xB5DF /*132737*/,0x0040 /*000100*/,
0xFF74 /*177564*/,0x02FC /*001374*/,0x0A04 /*005004*/,0x15C3 /*012703*/,0xC223 /*141043*/,0x94C0 /*112300*/,0x0319 /*001431*/,0x1DC2 /*016702*/,
0xFF2E /*177456*/,0x9481 /*112201*/,0x0319 /*001431*/,0xA057 /*120127*/,0x0020 /*000040*/,0x03FB /*001773*/,0xA001 /*120001*/,0x0208 /*001010*/,
0x94C0 /*112300*/,0x030A /*001412*/,0x9481 /*112201*/,0x0308 /*001410*/,0xA057 /*120127*/,0x0020 /*000040*/,0x02F7 /*001367*/,0x0104 /*000404*/,
0x94C0 /*112300*/,0x02FE /*001376*/,0x0A84 /*005204*/,0x01E9 /*000751*/,0x0CC4 /*006304*/,0x09FC /*004774*/,0xC1C0 /*140700*/,0x0104 /*000404*/,
0x15C0 /*012700*/,0xC23F /*141077*/,0x09F7 /*004767*/,0xFEC0 /*177300*/,0x0A37 /*005067*/,0xFEF6 /*177366*/,0x15C0 /*012700*/,0xC269 /*141151*/,
0x09F7 /*004767*/,0xFEB4 /*177264*/,0x1584 /*012604*/,0x1583 /*012603*/,0x1582 /*012602*/,0x1581 /*012601*/,0x1580 /*012600*/,0x0002 /*000002*/,
0xC428 /*142050*/,0xC2A4 /*141244*/,0xC2B0 /*141260*/,0xC2F4 /*141364*/,0xC29A /*141232*/,0x4F43 /*047503*/,0x4D4D /*046515*/,0x4E41 /*047101*/,
0x5344 /*051504*/,0x4120 /*040440*/,0x4552 /*042522*/,0x4220 /*041040*/,0x4F4F /*047517*/,0x2C54 /*026124*/,0x4820 /*044040*/,0x4C41 /*046101*/,
0x2C54 /*026124*/,0x4C20 /*046040*/,0x4749 /*043511*/,0x5448 /*052110*/,0x2C53 /*026123*/,0x5420 /*052040*/,0x5345 /*051505*/,0x2054 /*020124*/,
0x4E41 /*047101*/,0x2044 /*020104*/,0x4548 /*042510*/,0x504C /*050114*/,0x0A0D /*005015*/,0x4F42 /*047502*/,0x544F /*052117*/,0x4420 /*042040*/,
0x5645 /*053105*/,0x4349 /*041511*/,0x5345 /*051505*/,0x4120 /*040440*/,0x4552 /*042522*/,0x5220 /*051040*/,0x3F4B /*037513*/,0x5220 /*051040*/,
0x3F4C /*037514*/,0x4F20 /*047440*/,0x2052 /*020122*/,0x5052 /*050122*/,0x0D3F /*006477*/,0x000A /*000012*/,0x0A0D /*005015*/,0x0800 /*004000*/,
0x0820 /*004040*/,0x4200 /*041000*/,0x4F4F /*047517*/,0x0054 /*000124*/,0x4148 /*040510*/,0x544C /*052114*/,0x5400 /*052000*/,0x5345 /*051505*/,
0x0054 /*000124*/,0x494C /*044514*/,0x4847 /*044107*/,0x5354 /*051524*/,0x4800 /*044000*/,0x4C45 /*046105*/,0x0050 /*000120*/,0x5500 /*052400*/,
0x4B4E /*045516*/,0x4F4E /*047516*/,0x4E57 /*047127*/,0x4320 /*041440*/,0x4D4F /*046517*/,0x414D /*040515*/,0x444E /*042116*/,0x0D0A /*006412*/,
0x5000 /*050000*/,0x5044 /*050104*/,0x312D /*030455*/,0x2031 /*020061*/,0x4F4D /*047515*/,0x494E /*044516*/,0x4F54 /*047524*/,0x2052 /*020122*/,
0x3156 /*030526*/,0x302E /*030056*/,0x0D0A /*006412*/,0x0D0A /*006412*/,0x4200 /*041000*/,0x4F4F /*047517*/,0x3E54 /*037124*/,0x0020 /*000040*/,
0x4E55 /*047125*/,0x4E4B /*047113*/,0x574F /*053517*/,0x204E /*020116*/,0x4F42 /*047502*/,0x544F /*052117*/,0x4420 /*042040*/,0x5645 /*053105*/,
0x4349 /*041511*/,0x0A45 /*005105*/,0x000D /*000015*/,0x2020 /*020040*/,0x2020 /*020040*/,0x2020 /*020040*/,0x4C43 /*046103*/,0x434F /*041517*/,
0x204B /*020113*/,0x4954 /*044524*/,0x4B43 /*045503*/,0x0A53 /*005123*/,0x000D /*000015*/,0x15C0 /*012700*/,0xC1CA /*140712*/,0x09F7 /*004767*/,
0xFDC6 /*176706*/,0x0087 /*000207*/,0x0000 /*000000*/,0x15C0 /*012700*/,0xC21C /*141034*/,0x09F7 /*004767*/,0xFDBA /*176672*/,0x0087 /*000207*/,
0x0A37 /*005067*/,0xFD9E /*176636*/,0x15C5 /*012705*/,0x1A00 /*015000*/,0x115F /*010537*/,0xFF78 /*177570*/,0x1144 /*010504*/,0x0C84 /*006204*/,
0x0A00 /*005000*/,0x1141 /*010501*/,0x7204 /*071004*/,0x1002 /*010002*/,0x7084 /*070204*/,0x60C1 /*060301*/,0x2045 /*020105*/,0x0301 /*001401*/,
0x0000 /*000000*/,0x7F0A /*077412*/,0x7F4F /*077517*/,0x15C0 /*012700*/,0xC28B /*141213*/,0x1DC3 /*016703*/,0xFD74 /*176564*/,0x0A02 /*005002*/,
0x7297 /*071227*/,0x0008 /*000010*/,0x65C3 /*062703*/,0x0030 /*000060*/,0x90E0 /*110340*/,0x1083 /*010203*/,0x02F8 /*001370*/,0x09F7 /*004767*/,
0xFD76 /*176566*/,0x0087 /*000207*/,0x15C3 /*012703*/,0x7F06 /*077406*/,0x0A02 /*005002*/,0x0A01 /*005001*/,0x15C0 /*012700*/,0x0008 /*000010*/,
0x10F1 /*010361*/,0xF4C0 /*172300*/,0x10B1 /*010261*/,0xF4E0 /*172340*/,0x10F1 /*010361*/,0xF4D0 /*172320*/,0x10B1 /*010261*/,0xF4F0 /*172360*/,
0x10F1 /*010361*/,0xF480 /*172200*/,0x10B1 /*010261*/,0xF4A0 /*172240*/,0x10F1 /*010361*/,0xF490 /*172220*/,0x10B1 /*010261*/,0xF4B0 /*172260*/,
0x10F1 /*010361*/,0xFF80 /*177600*/,0x10B1 /*010261*/,0xFFA0 /*177640*/,0x10F1 /*010361*/,0xFF90 /*177620*/,0x10F1 /*010361*/,0xFFB0 /*177660*/,
0x65C2 /*062702*/,0x0080 /*000200*/,0x65C1 /*062701*/,0x0002 /*000002*/,0x7E1D /*077035*/,0x55DF /*052737*/,0xFC00 /*176000*/,0xF4FE /*172376*/,
0x55DF /*052737*/,0xFC00 /*176000*/,0xF4BE /*172276*/,0x55DF /*052737*/,0xFC00 /*176000*/,0xFFBE /*177676*/,0x15DF /*012737*/,0x003F /*000077*/,
0xF54E /*172516*/,0x15DF /*012737*/,0x0001 /*000001*/,0xFF7A /*177572*/,0x15DF /*012737*/,0x03C0 /*001700*/,0xF4A4 /*172244*/,0x15DF /*012737*/,
0x03C0 /*001700*/,0xF4B4 /*172264*/,0x15DF /*012737*/,0x1000 /*010000*/,0xFFFE /*177776*/,0x15C3 /*012703*/,0x4080 /*040200*/,0x15C2 /*012702*/,
0xC384 /*141604*/,0x14A6 /*012246*/,0x0D93 /*006623*/,0x2097 /*020227*/,0xC428 /*142050*/,0x87FB /*103773*/,0x15F7 /*012767*/,0x4080 /*040200*/,
0xFCCE /*176316*/,0x0087 /*000207*/,0x15C0 /*012700*/,0x001F /*000037*/,0x15C1 /*012701*/,0xF800 /*174000*/,0x35DF /*032737*/,0x0001 /*000001*/,
0xFF78 /*177570*/,0x030C /*001414*/,0x15C0 /*012700*/,0x0F0F /*007417*/,0x1001 /*010001*/,0x0A41 /*005101*/,0x35DF /*032737*/,0x0002 /*000002*/,
0xFF78 /*177570*/,0x0304 /*001404*/,0x15C0 /*012700*/,0x3C73 /*036163*/,0x15C1 /*012701*/,0x3E00 /*037000*/,0x1042 /*010102*/,0xE5C2 /*162702*/,
0x0002 /*000002*/,0x45C2 /*042702*/,0x0001 /*000001*/,0x1083 /*010203*/,0x45C3 /*042703*/,0xFFC1 /*177701*/,0x15F3 /*012763*/,0x0001 /*000001*/,
0x4000 /*040000*/,0x65C3 /*062703*/,0x0002 /*000002*/,0x15F3 /*012763*/,0x004B /*000113*/,0x4000 /*040000*/,0x1084 /*010204*/,0x7517 /*072427*/,
0xFFFA /*177772*/,0x45C4 /*042704*/,0xFF80 /*177600*/,0x15C5 /*012705*/,0x03C0 /*001700*/,0xE105 /*160405*/,0x1084 /*010204*/,0x7517 /*072427*/,
0xFFF4 /*177764*/,0x45C4 /*042704*/,0xFFF1 /*177761*/,0x1174 /*010564*/,0xF4A0 /*172240*/,0x1043 /*010103*/,0x74D7 /*072327*/,0xFFF4 /*177764*/,
0x45C3 /*042703*/,0xFFF1 /*177761*/,0x20C4 /*020304*/,0x030A /*001412*/,0x1044 /*010104*/,0x7517 /*072427*/,0xFFFA /*177772*/,0x45C4 /*042704*/,
0xFF80 /*177600*/,0x15C5 /*012705*/,0x03C0 /*001700*/,0xE105 /*160405*/,0x1173 /*010563*/,0xF4A0 /*172240*/,0x15C4 /*012704*/,0x0003 /*000003*/,
0x67C4 /*063704*/,0xFF78 /*177570*/,0x15C3 /*012703*/,0x0002 /*000002*/,0x61C3 /*060703*/,0x004A /*000112*/,0x7F02 /*077402*/,0x1002 /*010002*/,
0x0C02 /*006002*/,0x0C41 /*006101*/,0x0C00 /*006000*/,0x01C2 /*000702*/,0x0A03 /*005003*/,0x9481 /*112201*/,0x0365 /*001545*/,0xA057 /*120127*/,
0x0020 /*000040*/,0x03FB /*001773*/,0xA057 /*120127*/,0x0052 /*000122*/,0x0305 /*001405*/,0x15C0 /*012700*/,0xC270 /*141160*/,0x09F7 /*004767*/,
0xFC26 /*176046*/,0x0087 /*000207*/,0x9481 /*112201*/,0x9480 /*112200*/,0x030E /*001416*/,0xA017 /*120027*/,0x0020 /*000040*/,0x030B /*001413*/,
0xA017 /*120027*/,0x0037 /*000067*/,0x0619 /*003031*/,0xE5C0 /*162700*/,0x0030 /*000060*/,0x0516 /*002426*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,
0x0CC3 /*006303*/,0x5003 /*050003*/,0x01F0 /*000760*/,0x0A02 /*005002*/,0x15D2 /*012722*/,0x005F /*000137*/,0x15D2 /*012722*/,0xC000 /*140000*/,
0x15D2 /*012722*/,0xC000 /*140000*/,0x0A12 /*005022*/,0xA057 /*120127*/,0x004B /*000113*/,0x033E /*001476*/,0xA057 /*120127*/,0x004C /*000114*/,
0x0308 /*001410*/,0xA057 /*120127*/,0x0050 /*000120*/,0x034F /*001517*/,0x15C0 /*012700*/,0xC23F /*141077*/,0x09F7 /*004767*/,0xFBD8 /*175730*/,
0x0087 /*000207*/,0x0005 /*000005*/,0x00C3 /*000303*/,0x15C1 /*012701*/,0xF900 /*174400*/,0x15F1 /*012761*/,0x000B /*000013*/,0x0004 /*000004*/,
0x55C3 /*052703*/,0x0004 /*000004*/,0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x8A03 /*105003*/,0x55C3 /*052703*/,0x0008 /*000010*/,
0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x1C42 /*016102*/,0x0006 /*000006*/,0x45C2 /*042702*/,0x003F /*000077*/,0x0A82 /*005202*/,
0x10B1 /*010261*/,0x0004 /*000004*/,0x8A03 /*105003*/,0x55C3 /*052703*/,0x0006 /*000006*/,0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,
0x0A31 /*005061*/,0x0002 /*000002*/,0x0A31 /*005061*/,0x0004 /*000004*/,0x15F1 /*012761*/,0xFE00 /*177000*/,0x0006 /*000006*/,0x8A03 /*105003*/,
0x55C3 /*052703*/,0x000C /*000014*/,0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x45C9 /*042711*/,0x00FF /*000377*/,0x0A02 /*005002*/,
0x0A03 /*005003*/,0x0A04 /*005004*/,0x0A05 /*005005*/,0x0A07 /*005007*/,0x0005 /*000005*/,0x00C3 /*000303*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,
0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x15C1 /*012701*/,0xFF0A /*177412*/,0x10C9 /*010311*/,0x0A21 /*005041*/,0x15E1 /*012741*/,
0xFE00 /*177000*/,0x15E1 /*012741*/,0x0005 /*000005*/,0x0A02 /*005002*/,0x0A03 /*005003*/,0x0A04 /*005004*/,0x0A05 /*005005*/,0x8BC9 /*105711*/,
0x80FE /*100376*/,0x8A09 /*105011*/,0x0A07 /*005007*/,0x0005 /*000005*/,0x15C1 /*012701*/,0xFDC0 /*176700*/,0x15F1 /*012761*/,0x0020 /*000040*/,
0x0008 /*000010*/,0x10F1 /*010361*/,0x0008 /*000010*/,0x15C9 /*012711*/,0x0011 /*000021*/,0x15F1 /*012761*/,0x1000 /*010000*/,0x001A /*000032*/,
0x15F1 /*012761*/,0xFE00 /*177000*/,0x0002 /*000002*/,0x0A31 /*005061*/,0x0004 /*000004*/,0x0A31 /*005061*/,0x0006 /*000006*/,0x0A31 /*005061*/,
0x001C /*000034*/,0x15C9 /*012711*/,0x0039 /*000071*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x8A09 /*105011*/,0x10C0 /*010300*/,0x0A07 /*005007*/]
}

View file

@ -0,0 +1,533 @@
1 ; BOOT MONITOR
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 141151 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 141151 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 142050 141244 141260 CMDTBL: .WORD BOOT,HALT,TEST,LIGHTS,HELP
140706 141364 141232
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 104 120 BANNER: .ASCIZ 'PDP-11 MONITOR V1.0'<12><15><12><15>
141124 055 061 061
141127 040 115 117
141132 116 111 124
141135 117 122 040
141140 126 061 056
141143 060 012 015
141146 012 015 000
189 ; 'ADAPTED FROM CODE BY PAUL NANKERVIS <PAULNANK@HOTMAIL.COM>'<12><15><12><15>
190 141151 102 117 117 PROMPT: .ASCIZ 'BOOT> '
141154 124 076 040
141157 000
191 141160 125 116 113 BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15>
141163 116 117 127
141166 116 040 102
141171 117 117 124
141174 040 104 105
141177 126 111 103
141202 105 012 015
141205 000
192 141206 040 040 040 PERMSG: .ASCIZ ' CLOCK TICKS'<12><15>
141211 040 040 040
141214 103 114 117
141217 103 113 040
141222 124 111 103
141225 113 123 012
141230 015 000
193
194 .EVEN
195
196 HELP: ; 141244
197 141232 012700 140712 MOV #HLPMSG,R0
198 141236 004767 140150' JSR PC,PRINT
199 141242 000207 RTS PC
200
201 HALT: ; 141260
202 141244 000000 HALT
203 141246 012700 141034 MOV #EOL,R0
204 141252 004767 140150' JSR PC,PRINT
205 141256 000207 RTS PC
206
207 TEST: ; 141272
208 141260 005067 140122' CLR CLKTIC
209
210 141264 012705 015000 MOV #15000,R5
211 141270 010537 177570 10$: MOV R5,@#177570 ; DISPLAY
212 141274 010504 MOV R5,R4
213 141276 006204 ASR R4
214 141300 005000 15$: CLR R0
215 141302 010501 MOV R5,R1
216 141304 071004 DIV R4,R0
217 141306 010002 MOV R0,R2
218 141310 070204 MUL R4,R2
219 141312 060301 ADD R3,R1
220 141314 020105 CMP R1,R5
221 141316 001401 BEQ 20$
222 141320 000000 HALT
223 141322 077412 20$: SOB R4,15$
224 141324 077517 SOB R5,10$
225
226 141326 012700 141213 MOV #PERMSG+5,R0
227 141332 016703 140122' MOV CLKTIC,R3
228
229 141336 005002 25$: CLR R2 ; 141350
230 141340 071227 000010 DIV #10,R2
231 141344 062703 000060 ADD #'0,R3
232 141350 110340 MOVB R3,-(R0)
233 141352 010203 MOV R2,R3
234 141354 001370 BNE 25$
235
236 141356 004767 140150' JSR PC,PRINT
237 141362 000207 RTS PC
238
239
240 177572 MMR0=177572
241 177574 MMR1=177574
242 177576 MMR2=177576
243 172516 MMR3=172516
244
245 LIGHTS: ; 141376
246 141364 012703 077406 MOV #77406,R3 ; DEFAULT PDR
247 141370 005002 CLR R2
248 141372 005001 CLR R1
249 141374 012700 000010 MOV #8.,R0
250 141400 010361 172300 1$: MOV R3,172300(R1) ; KERNEL I PDR
251 141404 010261 172340 MOV R2,172340(R1) ; KERNEL I PAR
252 141410 010361 172320 MOV R3,172320(R1) ; KERNEL D PDR
253 141414 010261 172360 MOV R2,172360(R1) ; KERNEL D PAR
254 141420 010361 172200 MOV R3,172200(R1) ; SUPER I PDR
255 141424 010261 172240 MOV R2,172240(R1) ; SUPER I PAR
256 141430 010361 172220 MOV R3,172220(R1) ; SUPER D PDR
257 141434 010261 172260 MOV R2,172260(R1) ; SUPER D PAR
258 141440 010361 177600 MOV R3,177600(R1) ; USER I PDR
259 141444 010261 177640 MOV R2,177640(R1) ; USER I PAR
260 141450 010361 177620 MOV R3,177620(R1) ; USER D PDR
261 141454 010361 177660 MOV R3,177660(R1) ; USER D PAR
262 141460 062702 000200 ADD #200,R2
263 141464 062701 000002 ADD #2,R1
264 141470 077035 SOB R0,1$
265 141472 052737 176000 172376 BIS #176000,@#172376 ; KERNEL D POINTS TO I/O SPACE
266 141500 052737 176000 172276 BIS #176000,@#172276 ; SUPER D POINTS TO I/O SPACE
267 141506 052737 176000 177676 BIS #176000,@#177676 ; USER D POINTS TO I/O SPACE
268 141514 012737 000077 172516 MOV #77,@#MMR3 ; 77 FOR 22 BIT
269 141522 012737 000001 177572 MOV #1,@#MMR0
270
271 141530 012737 001700 172244 MOV #1700,@#172244 ; BASE SUPER I (PAR 2) #40000 AT #170000
272 141536 012737 001700 172264 MOV #1700,@#172264 ; BASE SUPER D (PAR 2) #40000 AT #170000
273 141544 012737 010000 177776 MOV #010000,@#177776 ; SET PM TO SUPER
274
275 141552 012703 040200 MOV #40200,R3 ; SUPER CODE ADDRESS
276 141556 012702 141604 MOV #SUPERS,R2 ; ADDRESS SUPER CODE
277 141562 012246 10$: MOV (R2)+,-(SP)
278 141564 006623 MTPI (R3)+
279 141566 020227 142050 CMP R2,#SUPERE
280 141572 103773 BLO 10$
281
282 141574 012767 040200 140120' MOV #40200,LGHTON ; CHANGE IDLE TASK
283 141602 000207 RTS PC
284
285 ;
286 ; TO BE COPIED TO SUPER #40200 AT PHYSICAL #170000
287 ; #40000 TO #40200 FOR WAIT & JMP INSTRUCTIONS
288 ;
289 SUPERS: ; 141616
290 141604 012700 000037 MOV #37,R0 ; LOAD PATTERN
291 141610 012701 174000 MOV #174000,R1
292 141614 032737 000001 177570 BIT #1,@#177570
293 141622 001414 BEQ 10$
294 141624 012700 007417 MOV #7417,R0
295 141630 010001 MOV R0,R1
296 141632 005101 COM R1
297 141634 032737 000002 177570 BIT #2,@#177570
298 141642 001404 BEQ 10$
299 141644 012700 036163 MOV #36163,R0
300 141650 012701 037000 MOV #37000,R1
301 141654 010102 10$: MOV R1,R2
302 141656 162702 000002 SUB #2,R2
303 141662 042702 000001 BIC #1,R2 ; WAIT ADDRESS
304 141666 010203 MOV R2,R3
305 141670 042703 177701 BIC #177701,R3 ; ADDRESS OFFSET
306 141674 012763 000001 040000 MOV #0000001,40000(R3) ; WRITE WAIT
307 141702 062703 000002 ADD #2,R3
308 141706 012763 000113 040000 MOV #0000113,40000(R3) ; WRITE JMP (R3)
309
310 141714 010204 MOV R2,R4
311 141716 072427 177772 ASH #-6,R4
312 141722 042704 177600 BIC #177600,R4
313 141726 012705 001700 MOV #1700,R5
314 141732 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR WAIT
315 141734 010204 MOV R2,R4
316 141736 072427 177764 ASH #-12.,R4
317 141742 042704 177761 BIC #177761,R4 ; PAR SELECT OFFSET
318 141746 010564 172240 MOV R5,172240(R4) ; SUPER I SPACE
319
320 141752 010103 MOV R1,R3
321 141754 072327 177764 ASH #-12.,R3
322 141760 042703 177761 BIC #177761,R3 ; PAR SELECT OFFSET
323 141764 020304 CMP R3,R4 ; SAME PAR
324 141766 001412 BEQ 30$
325 141770 010104 MOV R1,R4
326 141772 072427 177772 ASH #-6,R4
327 141776 042704 177600 BIC #177600,R4
328 142002 012705 001700 MOV #1700,R5
329 142006 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR JMP
330 142010 010563 172240 MOV R5,172240(R3) ; SUPER I SPACE
331 30$:
332 142014 012704 000003 MOV #3,R4
333 142020 063704 177570 ADD @#177570,R4
334 142024 012703 000002 MOV #2,R3
335 142030 060703 ADD PC,R3
336 142032 000112 40$: JMP (R2)
337 142034 077402 SOB R4,40$
338 142036 010002 MOV R0,R2
339 142040 006002 ROR R2 ; ROTATE PATTERN
340 142042 006101 ROL R1
341 142044 006000 ROR R0
342 142046 000702 BR 10$
343 SUPERE:
344
345 BOOT: ; 142062
346 142050 005003 CLR R3 ; UNIT
347 142052 112201 1$: MOVB (R2)+,R1
348 142054 001545 BEQ BOOTRK ; DEFAULT DEVICE IS RK0
349 142056 120127 000040 CMPB R1,#40
350 142062 001773 BEQ 1$
351 142064 120127 000122 CMPB R1,#'R
352 142070 001405 BEQ 5$
353
354 142072 012700 141160 MOV #BADBOO,R0
355 142076 004767 140150' JSR PC,PRINT
356 142102 000207 RTS PC
357
358 142104 112201 5$: MOVB (R2)+,R1 ; HOPEFULLY K, L OR P
359 142106 112200 7$: MOVB (R2)+,R0 ; DIGIT
360 142110 001416 BEQ 9$
361 142112 120027 000040 CMPB R0,#40
362 142116 001413 BEQ 9$
363 142120 120027 000067 CMPB R0,#'7
364 142124 003031 BGT 11$
365 142126 162700 000060 SUB #'0,R0
366 142132 002426 BLT 11$
367 142134 006303 ASL R3
368 142136 006303 ASL R3
369 142140 006303 ASL R3
370 142142 050003 BIS R0,R3 ; PUT DIGIT INTO UNIT
371 142144 000760 BR 7$
372 142146 005002 9$: CLR R2
373 142150 012722 000137 MOV #137,(R2)+ ; STORE "JMP @#140000" INSTRUCTION AT ADDRESS 0
374 142154 012722 140000 MOV #START,(R2)+
375 142160 012722 140000 MOV #START,(R2)+ ; STORE #140000 IN VECTOR 4, IN CASE OF TRAP TO 4
376 142164 005022 CLR (R2)+
377 142166 120127 000113 CMPB R1,#'K
378 142172 001476 BEQ BOOTRK
379 142174 120127 000114 CMPB R1,#'L
380 142200 001410 BEQ BOOTRL
381 142202 120127 000120 CMPB R1,#'P
382 142206 001517 BEQ BOOTRP
383
384 142210 012700 141077 11$: MOV #UNKMSG,R0
385 142214 004767 140150' JSR PC,PRINT
386 142220 000207 RTS PC
387
388 174400 RLCS=174400
389 BOOTRL: ; 142326
390 142222 000005 RESET
391 142224 000303 SWAB R3 ; UNIT NUMBER
392 142226 012701 174400 MOV #RLCS,R1 ; CSR
393 142232 012761 000013 000004 MOV #13,4(R1) ; CLR ERR
394 142240 052703 000004 BIS #4,R3 ; UNIT+GSTAT
395 142244 010311 MOV R3,(R1) ; ISSUE CMD
396 142246 105711 TSTB (R1) ; WAIT
397 142250 100376 BPL .-2
398 142252 105003 CLRB R3
399 142254 052703 000010 BIS #10,R3 ; UNIT+RDHDR
400 142260 010311 MOV R3,(R1) ; ISSUE CMD
401 142262 105711 TSTB (R1) ; WAIT
402 142264 100376 BPL .-2
403 142266 016102 000006 MOV 6(R1),R2 ; GET HDR
404 142272 042702 000077 BIC #77,R2 ; CLR SECTOR
405 142276 005202 INC R2 ; MAGIC BIT
406 142300 010261 000004 MOV R2,4(R1) ; SEEK TO 0
407 142304 105003 CLRB R3
408 142306 052703 000006 BIS #6,R3 ; UNIT+SEEK
409 142312 010311 MOV R3,(R1) ; ISSUE CMD
410 142314 105711 TSTB (R1) ; WAIT
411 142316 100376 BPL .-2
412 142320 005061 000002 CLR 2(R1) ; CLR BA
413 142324 005061 000004 CLR 4(R1) ; CLR DA
414 142330 012761 177000 000006 MOV #-512.,6(R1) ; SET WC
415 142336 105003 CLRB R3
416 142340 052703 000014 BIS #14,R3 ; UNIT+READ
417 142344 010311 MOV R3,(R1) ; ISSUE CMD
418 142346 105711 TSTB (R1) ; WAIT
419 142350 100376 BPL .-2
420 142352 042711 000377 BIC #377,(R1)
421 142356 005002 CLR R2
422 142360 005003 CLR R3
423 142362 005004 CLR R4
424 142364 005005 CLR R5
425 142366 005007 CLR PC
426
427 177412 RKDA=177412
428 000005 READGO=5
429 BOOTRK:
430 142370 000005 RESET ; 142402
431 142372 000303 SWAB R3 ; UNIT NUMBER
432 142374 006303 ASL R3
433 142376 006303 ASL R3
434 142400 006303 ASL R3
435 142402 006303 ASL R3
436 142404 006303 ASL R3
437 142406 012701 177412 MOV #RKDA,R1 ; CSR
438 142412 010311 MOV R3,(R1) ; LOAD DA
439 142414 005041 CLR -(R1) ; CLEAR BA
440 142416 012741 177000 MOV #-256.*2,-(R1) ; LOAD WC
441 142422 012741 000005 MOV #READGO,-(R1) ; READ & GO
442 142426 005002 CLR R2
443 142430 005003 CLR R3
444 142432 005004 CLR R4
445 142434 005005 CLR R5
446 142436 105711 TSTB (R1)
447 142440 100376 BPL .-2
448 142442 105011 CLRB (R1)
449 142444 005007 CLR PC
450
451 176700 RPCSR=0176700
452 BOOTRP: ; 142460
453 142446 000005 RESET
454 142450 012701 176700 MOV #RPCSR, R1
455 142454 012761 000040 000010 MOV #0000040, 10(R1) ; RESET
456 142462 010361 000010 MOV R3, 10(R1) ; SET UNIT
457 142466 012711 000021 MOV #0000021, (R1) ; PACK ACK
458 142472 012761 010000 000032 MOV #0010000, 32(R1) ; 16B MODE
459 142500 012761 177000 000002 MOV #-512., 2(R1) ; SET WC
460 142506 005061 000004 CLR 4(R1) ; CLR BA
461 142512 005061 000006 CLR 6(R1) ; CLR DA
462 142516 005061 000034 CLR 34(R1) ; CLR CYL
463 142522 012711 000071 MOV #0000071, (R1) ; READ
464 142526 105711 TSTB (R1) ; WAIT
465 142530 100376 BPL .-2
466 142532 105011 CLRB (R1)
467 142534 010300 MOV R3,R0
468 142536 005007 CLR PC
469
470 .END START
470

View file

@ -1,4 +1,4 @@
; BOOT LOADER CODE ; BOOT MONITOR
; ;
; REBASE HIGHER LINK/BOT:140000 ; REBASE HIGHER LINK/BOT:140000
; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING? ; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING?
@ -185,7 +185,8 @@ CMDLST: .ASCIZ 'BOOT'
.ASCIZ 'HELP' .ASCIZ 'HELP'
.BYTE 0 .BYTE 0
UNKMSG: .ASCIZ 'UNKNOWN COMMAND'<12><15> UNKMSG: .ASCIZ 'UNKNOWN COMMAND'<12><15>
BANNER: .ASCIZ 'PDP-11 BOOT TEST FOR PDPjs'<12><15>'ADAPTED FROM CODE BY PAUL NANKERVIS <PAULNANK@HOTMAIL.COM>'<12><15><12><15> BANNER: .ASCIZ 'PDP-11 MONITOR V1.0'<12><15><12><15>
; 'ADAPTED FROM CODE BY PAUL NANKERVIS <PAULNANK@HOTMAIL.COM>'<12><15><12><15>
PROMPT: .ASCIZ 'BOOT> ' PROMPT: .ASCIZ 'BOOT> '
BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15> BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15>
PERMSG: .ASCIZ ' CLOCK TICKS'<12><15> PERMSG: .ASCIZ ' CLOCK TICKS'<12><15>

View file

@ -1,26 +1,26 @@
--- ---
layout: page layout: page
title: PDP-11 Boot Test title: PDP-11 Boot Monitor
permalink: /apps/pdp11/boot/test/ permalink: /apps/pdp11/boot/monitor/
redirect_from: redirect_from:
- /devices/pdp11/rom/test/ - /devices/pdp11/rom/test/
--- ---
PDP-11 Boot Test PDP-11 Boot Monitor
---------------- -------------------
[BOOTTEST.mac](BOOTTEST.mac) is based on [boot.mac](http://skn.noip.me/pdp11/boot.mac) written by [PDPJSMON.mac](PDPJSMON.mac) is a custom boot monitor/loader based on [boot.mac](http://skn.noip.me/pdp11/boot.mac) written by
[Paul Nankervis](mailto:paulnank@hotmail.com). It is used with all our initial PDP-11 boot tests. [Paul Nankervis](mailto:paulnank@hotmail.com). It is used with all our PDP-11 test machines.
[BOOTTEST.mac](BOOTTEST.mac) was cross-assembled with [MACRO11](https://github.com/shattered/macro11) to produce [PDPJSMON.mac](PDPJSMON.mac) was cross-assembled with [MACRO11](https://github.com/shattered/macro11) to produce
[BOOTTEST.lst](BOOTTEST.lst), which was then processed by [FileDump](/modules/filedump/) to produce [PDPJSMON.lst](PDPJSMON.lst), which was then processed by [FileDump](/modules/filedump/) to produce
[BOOTTEST.json](BOOTTEST.json). [PDPJSMON.json](PDPJSMON.json).
To see the Boot Test in action, try the [PDP-11/70 Boot Test (with Debugger)](/devices/pdp11/machine/1170/test/debugger/). To see the Boot Monitor in action, try the [PDP-11/70 Boot Monitor (with Debugger)](/devices/pdp11/machine/1170/monitor/debugger/).
The **BOOTTEST.mac** source code is shown below. The **PDPJSMON.mac** source code is shown below.
; BOOT LOADER CODE ; BOOT MONITOR
; ;
; REBASE HIGHER LINK/BOT:140000 ; REBASE HIGHER LINK/BOT:140000
; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING? ; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING?
@ -207,7 +207,8 @@ The **BOOTTEST.mac** source code is shown below.
.ASCIZ 'HELP' .ASCIZ 'HELP'
.BYTE 0 .BYTE 0
UNKMSG: .ASCIZ 'UNKNOWN COMMAND'<12><15> UNKMSG: .ASCIZ 'UNKNOWN COMMAND'<12><15>
BANNER: .ASCIZ 'PDP-11 BOOT TEST FOR PDPjs'<12><15>'ADAPTED FROM CODE BY PAUL NANKERVIS <PAULNANK@HOTMAIL.COM>'<12><15><12><15> BANNER: .ASCIZ 'PDP-11 MONITOR V1.0'<12><15><12><15>
; 'ADAPTED FROM CODE BY PAUL NANKERVIS <PAULNANK@HOTMAIL.COM>'<12><15><12><15>
PROMPT: .ASCIZ 'BOOT> ' PROMPT: .ASCIZ 'BOOT> '
BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15> BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15>
PERMSG: .ASCIZ ' CLOCK TICKS'<12><15> PERMSG: .ASCIZ ' CLOCK TICKS'<12><15>

View file

@ -0,0 +1,11 @@
#
# Don't have macro11? Make yourself a copy from https://github.com/shattered/macro11
#
all: PDPJSMON.json
PDPJSMON.lst: PDPJSMON.mac
macro11 PDPJSMON.mac -l PDPJSMON.lst
PDPJSMON.json: PDPJSMON.lst
node ../../../../modules/filedump/bin/filedump --file=PDPJSMON.lst --format=octal --output=PDPJSMON.json --overwrite

View file

@ -1,94 +0,0 @@
{"load":0xC000 /*140000*/,"exec":0xC000 /*140000*/,
"words":[
0x0005 /*000005*/,0x0A1F /*005037*/,0xFFFE /*177776*/,0x15C6 /*012706*/,0xC000 /*140000*/,0x0A1F /*005037*/,0xFF74 /*177564*/,0x15C0 /*012700*/,
0xC251 /*141121*/,0x09F7 /*004767*/,0x0052 /*000122*/,0x15DF /*012737*/,0xC054 /*140124*/,0x0040 /*000100*/,0x15DF /*012737*/,0x00E0 /*000340*/,
0x0042 /*000102*/,0x55DF /*052737*/,0x0040 /*000100*/,0xFF66 /*177546*/,0x15C0 /*012700*/,0xC2AC /*141254*/,0x09F7 /*004767*/,0x0038 /*000070*/,
0xE5C6 /*162706*/,0x00AE /*000256*/,0x1180 /*010600*/,0x09F7 /*004767*/,0x006A /*000152*/,0x0A00 /*005000*/,0x0001 /*000001*/,0x0A80 /*005200*/,
0x0BF7 /*005767*/,0x000C /*000014*/,0x03FB /*001773*/,0x15E6 /*012746*/,0x5800 /*054000*/,0x1DE6 /*016746*/,0x0002 /*000002*/,0x0002 /*000002*/,
0x0000 /*000000*/,0x0000 /*000000*/,0x0AB7 /*005267*/,0xFFFA /*177772*/,0x0002 /*000002*/,0x8BDF /*105737*/,0xFF74 /*177564*/,0x80FD /*100375*/,
0x901F /*110037*/,0xFF76 /*177566*/,0x0087 /*000207*/,0x0000 /*000000*/,0xB5DF /*132737*/,0x0040 /*000100*/,0xFF74 /*177564*/,0x02FC /*001374*/,
0x1037 /*010067*/,0xFFF2 /*177762*/,0x15DF /*012737*/,0xC088 /*140210*/,0x0034 /*000064*/,0x15DF /*012737*/,0x0080 /*000200*/,0x0036 /*000066*/,
0xD5DF /*152737*/,0x0040 /*000100*/,0xFF74 /*177564*/,0x0087 /*000207*/,0x8BFF /*105777*/,0xFFDA /*177732*/,0x0306 /*001406*/,0x9FDF /*117737*/,
0xFFD4 /*177724*/,0xFF76 /*177566*/,0x0AB7 /*005267*/,0xFFCE /*177716*/,0x0002 /*000002*/,0x8A1F /*105037*/,0xFF74 /*177564*/,0x0002 /*000002*/,
0x0000 /*000000*/,0x0000 /*000000*/,0x1037 /*010067*/,0xFFF8 /*177770*/,0x0A37 /*005067*/,0xFFF6 /*177766*/,0x15DF /*012737*/,0xC0C0 /*140300*/,
0x0030 /*000060*/,0x15DF /*012737*/,0x0080 /*000200*/,0x0032 /*000062*/,0xD5DF /*152737*/,0x0040 /*000100*/,0xFF70 /*177560*/,0x0087 /*000207*/,
0x1026 /*010046*/,0x97C0 /*113700*/,0xFF72 /*177562*/,0xA017 /*120027*/,0x000D /*000015*/,0x032D /*001455*/,0xA017 /*120027*/,0x007F /*000177*/,
0x0303 /*001403*/,0xA017 /*120027*/,0x0008 /*000010*/,0x020A /*001012*/,0x0BF7 /*005767*/,0xFFC6 /*177706*/,0x0306 /*001406*/,0x0AF7 /*005367*/,
0xFFC0 /*177700*/,0x15C0 /*012700*/,0xC21F /*141037*/,0x09F7 /*004767*/,0xFF7E /*177576*/,0x012B /*000453*/,0xA017 /*120027*/,0x0020 /*000040*/,
0x0528 /*002450*/,0xA017 /*120027*/,0x007F /*000177*/,0x0425 /*002045*/,0x09F7 /*004767*/,0xFF5E /*177536*/,0xA017 /*120027*/,0x007A /*000172*/,
0x0605 /*003005*/,0xA017 /*120027*/,0x0061 /*000141*/,0x0502 /*002402*/,0xC5C0 /*142700*/,0x0020 /*000040*/,0x2DD7 /*026727*/,0xFF92 /*177622*/,
0x00AC /*000254*/,0x0417 /*002027*/,0x9026 /*110046*/,0x1DC0 /*016700*/,0xFF86 /*177606*/,0x6DC0 /*066700*/,0xFF84 /*177604*/,0x9588 /*112610*/,
0x0AB7 /*005267*/,0xFF7E /*177576*/,0x010E /*000416*/,0x1DC0 /*016700*/,0xFF76 /*177566*/,0x6DC0 /*066700*/,0xFF74 /*177564*/,0x8A08 /*105010*/,
0x15DF /*012737*/,0xC146 /*140506*/,0x00A0 /*000240*/,0x15DF /*012737*/,0x0040 /*000100*/,0x00A2 /*000242*/,0x15DF /*012737*/,0x0400 /*002000*/,
0xFFFA /*177772*/,0x1580 /*012600*/,0x0002 /*000002*/,0x0A1F /*005037*/,0xFFFA /*177772*/,0x1026 /*010046*/,0x1066 /*010146*/,0x10A6 /*010246*/,
0x10E6 /*010346*/,0x1126 /*010446*/,0x15C0 /*012700*/,0xC21C /*141034*/,0x09F7 /*004767*/,0xFF0C /*177414*/,0xB5DF /*132737*/,0x0040 /*000100*/,
0xFF74 /*177564*/,0x02FC /*001374*/,0x0A04 /*005004*/,0x15C3 /*012703*/,0xC223 /*141043*/,0x94C0 /*112300*/,0x0319 /*001431*/,0x1DC2 /*016702*/,
0xFF2E /*177456*/,0x9481 /*112201*/,0x0319 /*001431*/,0xA057 /*120127*/,0x0020 /*000040*/,0x03FB /*001773*/,0xA001 /*120001*/,0x0208 /*001010*/,
0x94C0 /*112300*/,0x030A /*001412*/,0x9481 /*112201*/,0x0308 /*001410*/,0xA057 /*120127*/,0x0020 /*000040*/,0x02F7 /*001367*/,0x0104 /*000404*/,
0x94C0 /*112300*/,0x02FE /*001376*/,0x0A84 /*005204*/,0x01E9 /*000751*/,0x0CC4 /*006304*/,0x09FC /*004774*/,0xC1C0 /*140700*/,0x0104 /*000404*/,
0x15C0 /*012700*/,0xC23F /*141077*/,0x09F7 /*004767*/,0xFEC0 /*177300*/,0x0A37 /*005067*/,0xFEF6 /*177366*/,0x15C0 /*012700*/,0xC2AC /*141254*/,
0x09F7 /*004767*/,0xFEB4 /*177264*/,0x1584 /*012604*/,0x1583 /*012603*/,0x1582 /*012602*/,0x1581 /*012601*/,0x1580 /*012600*/,0x0002 /*000002*/,
0xC46C /*142154*/,0xC2E8 /*141350*/,0xC2F4 /*141364*/,0xC338 /*141470*/,0xC2DE /*141336*/,0x4F43 /*047503*/,0x4D4D /*046515*/,0x4E41 /*047101*/,
0x5344 /*051504*/,0x4120 /*040440*/,0x4552 /*042522*/,0x4220 /*041040*/,0x4F4F /*047517*/,0x2C54 /*026124*/,0x4820 /*044040*/,0x4C41 /*046101*/,
0x2C54 /*026124*/,0x4C20 /*046040*/,0x4749 /*043511*/,0x5448 /*052110*/,0x2C53 /*026123*/,0x5420 /*052040*/,0x5345 /*051505*/,0x2054 /*020124*/,
0x4E41 /*047101*/,0x2044 /*020104*/,0x4548 /*042510*/,0x504C /*050114*/,0x0A0D /*005015*/,0x4F42 /*047502*/,0x544F /*052117*/,0x4420 /*042040*/,
0x5645 /*053105*/,0x4349 /*041511*/,0x5345 /*051505*/,0x4120 /*040440*/,0x4552 /*042522*/,0x5220 /*051040*/,0x3F4B /*037513*/,0x5220 /*051040*/,
0x3F4C /*037514*/,0x4F20 /*047440*/,0x2052 /*020122*/,0x5052 /*050122*/,0x0D3F /*006477*/,0x000A /*000012*/,0x0A0D /*005015*/,0x0800 /*004000*/,
0x0820 /*004040*/,0x4200 /*041000*/,0x4F4F /*047517*/,0x0054 /*000124*/,0x4148 /*040510*/,0x544C /*052114*/,0x5400 /*052000*/,0x5345 /*051505*/,
0x0054 /*000124*/,0x494C /*044514*/,0x4847 /*044107*/,0x5354 /*051524*/,0x4800 /*044000*/,0x4C45 /*046105*/,0x0050 /*000120*/,0x5500 /*052400*/,
0x4B4E /*045516*/,0x4F4E /*047516*/,0x4E57 /*047127*/,0x4320 /*041440*/,0x4D4F /*046517*/,0x414D /*040515*/,0x444E /*042116*/,0x0D0A /*006412*/,
0x5000 /*050000*/,0x5044 /*050104*/,0x312D /*030455*/,0x2031 /*020061*/,0x4F42 /*047502*/,0x544F /*052117*/,0x5420 /*052040*/,0x5345 /*051505*/,
0x2054 /*020124*/,0x4F46 /*047506*/,0x2052 /*020122*/,0x4450 /*042120*/,0x6A50 /*065120*/,0x0A73 /*005163*/,0x410D /*040415*/,0x4144 /*040504*/,
0x5450 /*052120*/,0x4445 /*042105*/,0x4620 /*043040*/,0x4F52 /*047522*/,0x204D /*020115*/,0x4F43 /*047503*/,0x4544 /*042504*/,0x4220 /*041040*/,
0x2059 /*020131*/,0x4150 /*040520*/,0x4C55 /*046125*/,0x4E20 /*047040*/,0x4E41 /*047101*/,0x454B /*042513*/,0x5652 /*053122*/,0x5349 /*051511*/,
0x3C20 /*036040*/,0x4150 /*040520*/,0x4C55 /*046125*/,0x414E /*040516*/,0x4B4E /*045516*/,0x4840 /*044100*/,0x544F /*052117*/,0x414D /*040515*/,
0x4C49 /*046111*/,0x432E /*041456*/,0x4D4F /*046517*/,0x0A3E /*005076*/,0x0A0D /*005015*/,0x000D /*000015*/,0x4F42 /*047502*/,0x544F /*052117*/,
0x203E /*020076*/,0x5500 /*052400*/,0x4B4E /*045516*/,0x4F4E /*047516*/,0x4E57 /*047127*/,0x4220 /*041040*/,0x4F4F /*047517*/,0x2054 /*020124*/,
0x4544 /*042504*/,0x4956 /*044526*/,0x4543 /*042503*/,0x0D0A /*006412*/,0x2000 /*020000*/,0x2020 /*020040*/,0x2020 /*020040*/,0x4320 /*041440*/,
0x4F4C /*047514*/,0x4B43 /*045503*/,0x5420 /*052040*/,0x4349 /*041511*/,0x534B /*051513*/,0x0D0A /*006412*/,0x0000 /*000000*/,0x15C0 /*012700*/,
0xC1CA /*140712*/,0x09F7 /*004767*/,0xFD82 /*176602*/,0x0087 /*000207*/,0x0000 /*000000*/,0x15C0 /*012700*/,0xC21C /*141034*/,0x09F7 /*004767*/,
0xFD76 /*176566*/,0x0087 /*000207*/,0x0A37 /*005067*/,0xFD5A /*176532*/,0x15C5 /*012705*/,0x1A00 /*015000*/,0x115F /*010537*/,0xFF78 /*177570*/,
0x1144 /*010504*/,0x0C84 /*006204*/,0x0A00 /*005000*/,0x1141 /*010501*/,0x7204 /*071004*/,0x1002 /*010002*/,0x7084 /*070204*/,0x60C1 /*060301*/,
0x2045 /*020105*/,0x0301 /*001401*/,0x0000 /*000000*/,0x7F0A /*077412*/,0x7F4F /*077517*/,0x15C0 /*012700*/,0xC2CE /*141316*/,0x1DC3 /*016703*/,
0xFD30 /*176460*/,0x0A02 /*005002*/,0x7297 /*071227*/,0x0008 /*000010*/,0x65C3 /*062703*/,0x0030 /*000060*/,0x90E0 /*110340*/,0x1083 /*010203*/,
0x02F8 /*001370*/,0x09F7 /*004767*/,0xFD32 /*176462*/,0x0087 /*000207*/,0x15C3 /*012703*/,0x7F06 /*077406*/,0x0A02 /*005002*/,0x0A01 /*005001*/,
0x15C0 /*012700*/,0x0008 /*000010*/,0x10F1 /*010361*/,0xF4C0 /*172300*/,0x10B1 /*010261*/,0xF4E0 /*172340*/,0x10F1 /*010361*/,0xF4D0 /*172320*/,
0x10B1 /*010261*/,0xF4F0 /*172360*/,0x10F1 /*010361*/,0xF480 /*172200*/,0x10B1 /*010261*/,0xF4A0 /*172240*/,0x10F1 /*010361*/,0xF490 /*172220*/,
0x10B1 /*010261*/,0xF4B0 /*172260*/,0x10F1 /*010361*/,0xFF80 /*177600*/,0x10B1 /*010261*/,0xFFA0 /*177640*/,0x10F1 /*010361*/,0xFF90 /*177620*/,
0x10F1 /*010361*/,0xFFB0 /*177660*/,0x65C2 /*062702*/,0x0080 /*000200*/,0x65C1 /*062701*/,0x0002 /*000002*/,0x7E1D /*077035*/,0x55DF /*052737*/,
0xFC00 /*176000*/,0xF4FE /*172376*/,0x55DF /*052737*/,0xFC00 /*176000*/,0xF4BE /*172276*/,0x55DF /*052737*/,0xFC00 /*176000*/,0xFFBE /*177676*/,
0x15DF /*012737*/,0x003F /*000077*/,0xF54E /*172516*/,0x15DF /*012737*/,0x0001 /*000001*/,0xFF7A /*177572*/,0x15DF /*012737*/,0x03C0 /*001700*/,
0xF4A4 /*172244*/,0x15DF /*012737*/,0x03C0 /*001700*/,0xF4B4 /*172264*/,0x15DF /*012737*/,0x1000 /*010000*/,0xFFFE /*177776*/,0x15C3 /*012703*/,
0x4080 /*040200*/,0x15C2 /*012702*/,0xC3C8 /*141710*/,0x14A6 /*012246*/,0x0D93 /*006623*/,0x2097 /*020227*/,0xC46C /*142154*/,0x87FB /*103773*/,
0x15F7 /*012767*/,0x4080 /*040200*/,0xFC8A /*176212*/,0x0087 /*000207*/,0x15C0 /*012700*/,0x001F /*000037*/,0x15C1 /*012701*/,0xF800 /*174000*/,
0x35DF /*032737*/,0x0001 /*000001*/,0xFF78 /*177570*/,0x030C /*001414*/,0x15C0 /*012700*/,0x0F0F /*007417*/,0x1001 /*010001*/,0x0A41 /*005101*/,
0x35DF /*032737*/,0x0002 /*000002*/,0xFF78 /*177570*/,0x0304 /*001404*/,0x15C0 /*012700*/,0x3C73 /*036163*/,0x15C1 /*012701*/,0x3E00 /*037000*/,
0x1042 /*010102*/,0xE5C2 /*162702*/,0x0002 /*000002*/,0x45C2 /*042702*/,0x0001 /*000001*/,0x1083 /*010203*/,0x45C3 /*042703*/,0xFFC1 /*177701*/,
0x15F3 /*012763*/,0x0001 /*000001*/,0x4000 /*040000*/,0x65C3 /*062703*/,0x0002 /*000002*/,0x15F3 /*012763*/,0x004B /*000113*/,0x4000 /*040000*/,
0x1084 /*010204*/,0x7517 /*072427*/,0xFFFA /*177772*/,0x45C4 /*042704*/,0xFF80 /*177600*/,0x15C5 /*012705*/,0x03C0 /*001700*/,0xE105 /*160405*/,
0x1084 /*010204*/,0x7517 /*072427*/,0xFFF4 /*177764*/,0x45C4 /*042704*/,0xFFF1 /*177761*/,0x1174 /*010564*/,0xF4A0 /*172240*/,0x1043 /*010103*/,
0x74D7 /*072327*/,0xFFF4 /*177764*/,0x45C3 /*042703*/,0xFFF1 /*177761*/,0x20C4 /*020304*/,0x030A /*001412*/,0x1044 /*010104*/,0x7517 /*072427*/,
0xFFFA /*177772*/,0x45C4 /*042704*/,0xFF80 /*177600*/,0x15C5 /*012705*/,0x03C0 /*001700*/,0xE105 /*160405*/,0x1173 /*010563*/,0xF4A0 /*172240*/,
0x15C4 /*012704*/,0x0003 /*000003*/,0x67C4 /*063704*/,0xFF78 /*177570*/,0x15C3 /*012703*/,0x0002 /*000002*/,0x61C3 /*060703*/,0x004A /*000112*/,
0x7F02 /*077402*/,0x1002 /*010002*/,0x0C02 /*006002*/,0x0C41 /*006101*/,0x0C00 /*006000*/,0x01C2 /*000702*/,0x0A03 /*005003*/,0x9481 /*112201*/,
0x0365 /*001545*/,0xA057 /*120127*/,0x0020 /*000040*/,0x03FB /*001773*/,0xA057 /*120127*/,0x0052 /*000122*/,0x0305 /*001405*/,0x15C0 /*012700*/,
0xC2B3 /*141263*/,0x09F7 /*004767*/,0xFBE2 /*175742*/,0x0087 /*000207*/,0x9481 /*112201*/,0x9480 /*112200*/,0x030E /*001416*/,0xA017 /*120027*/,
0x0020 /*000040*/,0x030B /*001413*/,0xA017 /*120027*/,0x0037 /*000067*/,0x0619 /*003031*/,0xE5C0 /*162700*/,0x0030 /*000060*/,0x0516 /*002426*/,
0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x5003 /*050003*/,0x01F0 /*000760*/,0x0A02 /*005002*/,0x15D2 /*012722*/,0x005F /*000137*/,
0x15D2 /*012722*/,0xC000 /*140000*/,0x15D2 /*012722*/,0xC000 /*140000*/,0x0A12 /*005022*/,0xA057 /*120127*/,0x004B /*000113*/,0x033E /*001476*/,
0xA057 /*120127*/,0x004C /*000114*/,0x0308 /*001410*/,0xA057 /*120127*/,0x0050 /*000120*/,0x034F /*001517*/,0x15C0 /*012700*/,0xC23F /*141077*/,
0x09F7 /*004767*/,0xFB94 /*175624*/,0x0087 /*000207*/,0x0005 /*000005*/,0x00C3 /*000303*/,0x15C1 /*012701*/,0xF900 /*174400*/,0x15F1 /*012761*/,
0x000B /*000013*/,0x0004 /*000004*/,0x55C3 /*052703*/,0x0004 /*000004*/,0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x8A03 /*105003*/,
0x55C3 /*052703*/,0x0008 /*000010*/,0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x1C42 /*016102*/,0x0006 /*000006*/,0x45C2 /*042702*/,
0x003F /*000077*/,0x0A82 /*005202*/,0x10B1 /*010261*/,0x0004 /*000004*/,0x8A03 /*105003*/,0x55C3 /*052703*/,0x0006 /*000006*/,0x10C9 /*010311*/,
0x8BC9 /*105711*/,0x80FE /*100376*/,0x0A31 /*005061*/,0x0002 /*000002*/,0x0A31 /*005061*/,0x0004 /*000004*/,0x15F1 /*012761*/,0xFE00 /*177000*/,
0x0006 /*000006*/,0x8A03 /*105003*/,0x55C3 /*052703*/,0x000C /*000014*/,0x10C9 /*010311*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x45C9 /*042711*/,
0x00FF /*000377*/,0x0A02 /*005002*/,0x0A03 /*005003*/,0x0A04 /*005004*/,0x0A05 /*005005*/,0x0A07 /*005007*/,0x0005 /*000005*/,0x00C3 /*000303*/,
0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x0CC3 /*006303*/,0x15C1 /*012701*/,0xFF0A /*177412*/,0x10C9 /*010311*/,
0x0A21 /*005041*/,0x15E1 /*012741*/,0xFE00 /*177000*/,0x15E1 /*012741*/,0x0005 /*000005*/,0x0A02 /*005002*/,0x0A03 /*005003*/,0x0A04 /*005004*/,
0x0A05 /*005005*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x8A09 /*105011*/,0x0A07 /*005007*/,0x0005 /*000005*/,0x15C1 /*012701*/,0xFDC0 /*176700*/,
0x15F1 /*012761*/,0x0020 /*000040*/,0x0008 /*000010*/,0x10F1 /*010361*/,0x0008 /*000010*/,0x15C9 /*012711*/,0x0011 /*000021*/,0x15F1 /*012761*/,
0x1000 /*010000*/,0x001A /*000032*/,0x15F1 /*012761*/,0xFE00 /*177000*/,0x0002 /*000002*/,0x0A31 /*005061*/,0x0004 /*000004*/,0x0A31 /*005061*/,
0x0006 /*000006*/,0x0A31 /*005061*/,0x001C /*000034*/,0x15C9 /*012711*/,0x0039 /*000071*/,0x8BC9 /*105711*/,0x80FE /*100376*/,0x8A09 /*105011*/,
0x10C0 /*010300*/,0x0A07 /*005007*/]
}

View file

@ -1,555 +0,0 @@
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 141254 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 141254 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 142154 141350 141364 CMDTBL: .WORD BOOT,HALT,TEST,LIGHTS,HELP
140706 141470 141336
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 104 120 BANNER: .ASCIZ 'PDP-11 BOOT TEST FOR PDPjs'<12><15>'ADAPTED FROM CODE BY PAUL NANKERVIS <PAULNANK@HOTMAIL.COM>'<12><15><12><15>
141124 055 061 061
141127 040 102 117
141132 117 124 040
141135 124 105 123
141140 124 040 106
141143 117 122 040
141146 120 104 120
141151 152 163 012
141154 015 101 104
141157 101 120 124
141162 105 104 040
141165 106 122 117
141170 115 040 103
141173 117 104 105
141176 040 102 131
141201 040 120 101
141204 125 114 040
141207 116 101 116
141212 113 105 122
141215 126 111 123
141220 040 074 120
141223 101 125 114
141226 116 101 116
141231 113 100 110
141234 117 124 115
141237 101 111 114
141242 056 103 117
141245 115 076 012
141250 015 012 015
141253 000
189 141254 102 117 117 PROMPT: .ASCIZ 'BOOT> '
141257 124 076 040
141262 000
190 141263 125 116 113 BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15>
141266 116 117 127
141271 116 040 102
141274 117 117 124
141277 040 104 105
141302 126 111 103
141305 105 012 015
141310 000
191 141311 040 040 040 PERMSG: .ASCIZ ' CLOCK TICKS'<12><15>
141314 040 040 040
141317 103 114 117
141322 103 113 040
141325 124 111 103
141330 113 123 012
141333 015 000
192
193 141335 000 .EVEN
194
195 HELP: ; 141244
196 141336 012700 140712 MOV #HLPMSG,R0
197 141342 004767 140150' JSR PC,PRINT
198 141346 000207 RTS PC
199
200 HALT: ; 141260
201 141350 000000 HALT
202 141352 012700 141034 MOV #EOL,R0
203 141356 004767 140150' JSR PC,PRINT
204 141362 000207 RTS PC
205
206 TEST: ; 141272
207 141364 005067 140122' CLR CLKTIC
208
209 141370 012705 015000 MOV #15000,R5
210 141374 010537 177570 10$: MOV R5,@#177570 ; DISPLAY
211 141400 010504 MOV R5,R4
212 141402 006204 ASR R4
213 141404 005000 15$: CLR R0
214 141406 010501 MOV R5,R1
215 141410 071004 DIV R4,R0
216 141412 010002 MOV R0,R2
217 141414 070204 MUL R4,R2
218 141416 060301 ADD R3,R1
219 141420 020105 CMP R1,R5
220 141422 001401 BEQ 20$
221 141424 000000 HALT
222 141426 077412 20$: SOB R4,15$
223 141430 077517 SOB R5,10$
224
225 141432 012700 141316 MOV #PERMSG+5,R0
226 141436 016703 140122' MOV CLKTIC,R3
227
228 141442 005002 25$: CLR R2 ; 141350
229 141444 071227 000010 DIV #10,R2
230 141450 062703 000060 ADD #'0,R3
231 141454 110340 MOVB R3,-(R0)
232 141456 010203 MOV R2,R3
233 141460 001370 BNE 25$
234
235 141462 004767 140150' JSR PC,PRINT
236 141466 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 141470 012703 077406 MOV #77406,R3 ; DEFAULT PDR
246 141474 005002 CLR R2
247 141476 005001 CLR R1
248 141500 012700 000010 MOV #8.,R0
249 141504 010361 172300 1$: MOV R3,172300(R1) ; KERNEL I PDR
250 141510 010261 172340 MOV R2,172340(R1) ; KERNEL I PAR
251 141514 010361 172320 MOV R3,172320(R1) ; KERNEL D PDR
252 141520 010261 172360 MOV R2,172360(R1) ; KERNEL D PAR
253 141524 010361 172200 MOV R3,172200(R1) ; SUPER I PDR
254 141530 010261 172240 MOV R2,172240(R1) ; SUPER I PAR
255 141534 010361 172220 MOV R3,172220(R1) ; SUPER D PDR
256 141540 010261 172260 MOV R2,172260(R1) ; SUPER D PAR
257 141544 010361 177600 MOV R3,177600(R1) ; USER I PDR
258 141550 010261 177640 MOV R2,177640(R1) ; USER I PAR
259 141554 010361 177620 MOV R3,177620(R1) ; USER D PDR
260 141560 010361 177660 MOV R3,177660(R1) ; USER D PAR
261 141564 062702 000200 ADD #200,R2
262 141570 062701 000002 ADD #2,R1
263 141574 077035 SOB R0,1$
264 141576 052737 176000 172376 BIS #176000,@#172376 ; KERNEL D POINTS TO I/O SPACE
265 141604 052737 176000 172276 BIS #176000,@#172276 ; SUPER D POINTS TO I/O SPACE
266 141612 052737 176000 177676 BIS #176000,@#177676 ; USER D POINTS TO I/O SPACE
267 141620 012737 000077 172516 MOV #77,@#MMR3 ; 77 FOR 22 BIT
268 141626 012737 000001 177572 MOV #1,@#MMR0
269
270 141634 012737 001700 172244 MOV #1700,@#172244 ; BASE SUPER I (PAR 2) #40000 AT #170000
271 141642 012737 001700 172264 MOV #1700,@#172264 ; BASE SUPER D (PAR 2) #40000 AT #170000
272 141650 012737 010000 177776 MOV #010000,@#177776 ; SET PM TO SUPER
273
274 141656 012703 040200 MOV #40200,R3 ; SUPER CODE ADDRESS
275 141662 012702 141710 MOV #SUPERS,R2 ; ADDRESS SUPER CODE
276 141666 012246 10$: MOV (R2)+,-(SP)
277 141670 006623 MTPI (R3)+
278 141672 020227 142154 CMP R2,#SUPERE
279 141676 103773 BLO 10$
280
281 141700 012767 040200 140120' MOV #40200,LGHTON ; CHANGE IDLE TASK
282 141706 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 141710 012700 000037 MOV #37,R0 ; LOAD PATTERN
290 141714 012701 174000 MOV #174000,R1
291 141720 032737 000001 177570 BIT #1,@#177570
292 141726 001414 BEQ 10$
293 141730 012700 007417 MOV #7417,R0
294 141734 010001 MOV R0,R1
295 141736 005101 COM R1
296 141740 032737 000002 177570 BIT #2,@#177570
297 141746 001404 BEQ 10$
298 141750 012700 036163 MOV #36163,R0
299 141754 012701 037000 MOV #37000,R1
300 141760 010102 10$: MOV R1,R2
301 141762 162702 000002 SUB #2,R2
302 141766 042702 000001 BIC #1,R2 ; WAIT ADDRESS
303 141772 010203 MOV R2,R3
304 141774 042703 177701 BIC #177701,R3 ; ADDRESS OFFSET
305 142000 012763 000001 040000 MOV #0000001,40000(R3) ; WRITE WAIT
306 142006 062703 000002 ADD #2,R3
307 142012 012763 000113 040000 MOV #0000113,40000(R3) ; WRITE JMP (R3)
308
309 142020 010204 MOV R2,R4
310 142022 072427 177772 ASH #-6,R4
311 142026 042704 177600 BIC #177600,R4
312 142032 012705 001700 MOV #1700,R5
313 142036 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR WAIT
314 142040 010204 MOV R2,R4
315 142042 072427 177764 ASH #-12.,R4
316 142046 042704 177761 BIC #177761,R4 ; PAR SELECT OFFSET
317 142052 010564 172240 MOV R5,172240(R4) ; SUPER I SPACE
318
319 142056 010103 MOV R1,R3
320 142060 072327 177764 ASH #-12.,R3
321 142064 042703 177761 BIC #177761,R3 ; PAR SELECT OFFSET
322 142070 020304 CMP R3,R4 ; SAME PAR
323 142072 001412 BEQ 30$
324 142074 010104 MOV R1,R4
325 142076 072427 177772 ASH #-6,R4
326 142102 042704 177600 BIC #177600,R4
327 142106 012705 001700 MOV #1700,R5
328 142112 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR JMP
329 142114 010563 172240 MOV R5,172240(R3) ; SUPER I SPACE
330 30$:
331 142120 012704 000003 MOV #3,R4
332 142124 063704 177570 ADD @#177570,R4
333 142130 012703 000002 MOV #2,R3
334 142134 060703 ADD PC,R3
335 142136 000112 40$: JMP (R2)
336 142140 077402 SOB R4,40$
337 142142 010002 MOV R0,R2
338 142144 006002 ROR R2 ; ROTATE PATTERN
339 142146 006101 ROL R1
340 142150 006000 ROR R0
341 142152 000702 BR 10$
342 SUPERE:
343
344 BOOT: ; 142062
345 142154 005003 CLR R3 ; UNIT
346 142156 112201 1$: MOVB (R2)+,R1
347 142160 001545 BEQ BOOTRK ; DEFAULT DEVICE IS RK0
348 142162 120127 000040 CMPB R1,#40
349 142166 001773 BEQ 1$
350 142170 120127 000122 CMPB R1,#'R
351 142174 001405 BEQ 5$
352
353 142176 012700 141263 MOV #BADBOO,R0
354 142202 004767 140150' JSR PC,PRINT
355 142206 000207 RTS PC
356
357 142210 112201 5$: MOVB (R2)+,R1 ; HOPEFULLY K, L OR P
358 142212 112200 7$: MOVB (R2)+,R0 ; DIGIT
359 142214 001416 BEQ 9$
360 142216 120027 000040 CMPB R0,#40
361 142222 001413 BEQ 9$
362 142224 120027 000067 CMPB R0,#'7
363 142230 003031 BGT 11$
364 142232 162700 000060 SUB #'0,R0
365 142236 002426 BLT 11$
366 142240 006303 ASL R3
367 142242 006303 ASL R3
368 142244 006303 ASL R3
369 142246 050003 BIS R0,R3 ; PUT DIGIT INTO UNIT
370 142250 000760 BR 7$
371 142252 005002 9$: CLR R2
372 142254 012722 000137 MOV #137,(R2)+
373 142260 012722 140000 MOV #START,(R2)+
374 142264 012722 140000 MOV #START,(R2)+
375 142270 005022 CLR (R2)+
376 142272 120127 000113 CMPB R1,#'K
377 142276 001476 BEQ BOOTRK
378 142300 120127 000114 CMPB R1,#'L
379 142304 001410 BEQ BOOTRL
380 142306 120127 000120 CMPB R1,#'P
381 142312 001517 BEQ BOOTRP
382
383 142314 012700 141077 11$: MOV #UNKMSG,R0
384 142320 004767 140150' JSR PC,PRINT
385 142324 000207 RTS PC
386
387 174400 RLCS=174400
388 BOOTRL: ; 142234
389 142326 000005 RESET
390 142330 000303 SWAB R3 ; UNIT NUMBER
391 142332 012701 174400 MOV #RLCS,R1 ; CSR
392 142336 012761 000013 000004 MOV #13,4(R1) ; CLR ERR
393 142344 052703 000004 BIS #4,R3 ; UNIT+GSTAT
394 142350 010311 MOV R3,(R1) ; ISSUE CMD
395 142352 105711 TSTB (R1) ; WAIT
396 142354 100376 BPL .-2
397 142356 105003 CLRB R3
398 142360 052703 000010 BIS #10,R3 ; UNIT+RDHDR
399 142364 010311 MOV R3,(R1) ; ISSUE CMD
400 142366 105711 TSTB (R1) ; WAIT
401 142370 100376 BPL .-2
402 142372 016102 000006 MOV 6(R1),R2 ; GET HDR
403 142376 042702 000077 BIC #77,R2 ; CLR SECTOR
404 142402 005202 INC R2 ; MAGIC BIT
405 142404 010261 000004 MOV R2,4(R1) ; SEEK TO 0
406 142410 105003 CLRB R3
407 142412 052703 000006 BIS #6,R3 ; UNIT+SEEK
408 142416 010311 MOV R3,(R1) ; ISSUE CMD
409 142420 105711 TSTB (R1) ; WAIT
410 142422 100376 BPL .-2
411 142424 005061 000002 CLR 2(R1) ; CLR BA
412 142430 005061 000004 CLR 4(R1) ; CLR DA
413 142434 012761 177000 000006 MOV #-512.,6(R1) ; SET WC
414 142442 105003 CLRB R3
415 142444 052703 000014 BIS #14,R3 ; UNIT+READ
416 142450 010311 MOV R3,(R1) ; ISSUE CMD
417 142452 105711 TSTB (R1) ; WAIT
418 142454 100376 BPL .-2
419 142456 042711 000377 BIC #377,(R1)
420 142462 005002 CLR R2
421 142464 005003 CLR R3
422 142466 005004 CLR R4
423 142470 005005 CLR R5
424 142472 005007 CLR PC
425
426 177412 RKDA=177412
427 000005 READGO=5
428 BOOTRK:
429 142474 000005 RESET ; 142402
430 142476 000303 SWAB R3 ; UNIT NUMBER
431 142500 006303 ASL R3
432 142502 006303 ASL R3
433 142504 006303 ASL R3
434 142506 006303 ASL R3
435 142510 006303 ASL R3
436 142512 012701 177412 MOV #RKDA,R1 ; CSR
437 142516 010311 MOV R3,(R1) ; LOAD DA
438 142520 005041 CLR -(R1) ; CLEAR BA
439 142522 012741 177000 MOV #-256.*2,-(R1) ; LOAD WC
440 142526 012741 000005 MOV #READGO,-(R1) ; READ & GO
441 142532 005002 CLR R2
442 142534 005003 CLR R3
443 142536 005004 CLR R4
444 142540 005005 CLR R5
445 142542 105711 TSTB (R1)
446 142544 100376 BPL .-2
447 142546 105011 CLRB (R1)
448 142550 005007 CLR PC
449
450 176700 RPCSR=0176700
451 BOOTRP: ; 142460
452 142552 000005 RESET
453 142554 012701 176700 MOV #RPCSR, R1
454 142560 012761 000040 000010 MOV #0000040, 10(R1) ; RESET
455 142566 010361 000010 MOV R3, 10(R1) ; SET UNIT
456 142572 012711 000021 MOV #0000021, (R1) ; PACK ACK
457 142576 012761 010000 000032 MOV #0010000, 32(R1) ; 16B MODE
458 142604 012761 177000 000002 MOV #-512., 2(R1) ; SET WC
459 142612 005061 000004 CLR 4(R1) ; CLR BA
460 142616 005061 000006 CLR 6(R1) ; CLR DA
461 142622 005061 000034 CLR 34(R1) ; CLR CYL
462 142626 012711 000071 MOV #0000071, (R1) ; READ
463 142632 105711 TSTB (R1) ; WAIT
464 142634 100376 BPL .-2
465 142636 105011 CLRB (R1)
466 142640 010300 MOV R3,R0
467 142642 005007 CLR PC
468
469 .END START
469

View file

@ -1,11 +0,0 @@
#
# Don't have macro11? Make yourself a copy from https://github.com/shattered/macro11
#
all: BOOTTEST.json
BOOTTEST.lst: BOOTTEST.mac
macro11 BOOTTEST.mac -l BOOTTEST.lst
BOOTTEST.json: BOOTTEST.lst
node ../../../../modules/filedump/bin/filedump --file=BOOTTEST.lst --format=octal --output=BOOTTEST.json --overwrite

View file

@ -9,7 +9,7 @@ PDP-11/20 Machine Configurations
PDPjs is currently being tested with the following PDP-11/20 machine configurations: PDPjs is currently being tested with the following PDP-11/20 machine configurations:
* [PDP-11/20 Boot Test](/devices/pdp11/machine/1120/test/) (with [Debugger](/devices/pdp11/machine/1120/test/debugger/)) * [PDP-11/20 Boot Monitor](/devices/pdp11/machine/1120/monitor/) (with [Debugger](/devices/pdp11/machine/1120/monitor/debugger/))
* [PDP-11/20 Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/) (with [Debugger](/devices/pdp11/machine/1120/bootstrap/debugger/)) * [PDP-11/20 Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/) (with [Debugger](/devices/pdp11/machine/1120/bootstrap/debugger/))
* [PDP-11/20 BASIC Demo](/devices/pdp11/machine/1120/basic/) (with [Debugger](/devices/pdp11/machine/1120/basic/debugger/)) * [PDP-11/20 BASIC Demo](/devices/pdp11/machine/1120/basic/) (with [Debugger](/devices/pdp11/machine/1120/basic/debugger/))

View file

@ -0,0 +1,19 @@
---
layout: page
title: PDP-11/20 Boot Monitor
permalink: /devices/pdp11/machine/1120/monitor/
machines:
- id: test1120
type: pdp11
---
PDP-11/20 Boot Monitor
----------------------
The machine below pre-loads the [PDP-11 Boot Monitor](/apps/pdp11/boot/monitor/) into RAM:
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json" load="0xC000" exec="0xC000"/>
{% include machine.html id="test1120" %}
This machine is also available with our built-in [Debugger](debugger/).

View file

@ -0,0 +1,18 @@
---
layout: page
title: PDP-11/20 Boot Monitor with Debugger
permalink: /devices/pdp11/machine/1120/monitor/debugger/
machines:
- id: test1120
type: pdp11
debugger: true
---
PDP-11/20 Boot Monitor (with Debugger)
--------------------------------------
The machine below pre-loads the [PDP-11 Boot Monitor](/apps/pdp11/boot/monitor/) into RAM:
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json" load="0xC000" exec="0xC000"/>
{% include machine.html id="test1120" %}

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?> <?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?>
<machine id="test1120" class="pdp11" border="1" pos="center" background="#FAEBD7"> <machine id="test1120" class="pdp11" border="1" pos="center" background="#FAEBD7">
<name pos="center">PDP-11/20 Boot Test with 56Kb and Debugger</name> <name pos="center">PDP-11/20 Boot Monitor with 56Kb and Debugger</name>
<computer id="computer" busWidth="16"/> <computer id="computer" busWidth="16"/>
<cpu id="cpu" model="1120" cycles="6666667"/> <cpu id="cpu" model="1120" cycles="6666667"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<device id="pc11" type="pc11"/> <device id="pc11" type="pc11"/>
<serial id="dl11" adapter="0" binding="print"/> <serial id="dl11" adapter="0" binding="print"/>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?> <?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?>
<machine id="test1120" class="pdp11" border="1" pos="center" background="#FAEBD7"> <machine id="test1120" class="pdp11" border="1" pos="center" background="#FAEBD7">
<name pos="center">PDP-11/20 Boot Test with 56Kb</name> <name pos="center">PDP-11/20 Boot Monitor with 56Kb</name>
<computer id="computer" busWidth="16"/> <computer id="computer" busWidth="16"/>
<cpu id="cpu" model="1120" cycles="6666667" autoStart="true"/> <cpu id="cpu" model="1120" cycles="6666667" autoStart="true"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<device id="pc11" type="pc11"/> <device id="pc11" type="pc11"/>
<serial id="dl11" adapter="0" binding="print"/> <serial id="dl11" adapter="0" binding="print"/>

View file

@ -1,19 +0,0 @@
---
layout: page
title: PDP-11/20 Boot Test
permalink: /devices/pdp11/machine/1120/test/
machines:
- id: test1120
type: pdp11
---
PDP-11/20 Boot Test
-------------------
The machine below pre-loads the [PDP-11 Boot Test](/apps/pdp11/boot/test/) code into RAM:
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json" load="0xC000" exec="0xC000"/>
{% include machine.html id="test1120" %}
This machine is also available with our built-in [Debugger](debugger/).

View file

@ -1,18 +0,0 @@
---
layout: page
title: PDP-11/20 Boot Test with Debugger
permalink: /devices/pdp11/machine/1120/test/debugger/
machines:
- id: test1120
type: pdp11
debugger: true
---
PDP-11/20 Boot Test (with Debugger)
-----------------------------------
The machine below pre-loads the [PDP-11 Boot Test](/apps/pdp11/boot/test/) code into RAM:
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json" load="0xC000" exec="0xC000"/>
{% include machine.html id="test1120" %}

View file

@ -9,7 +9,7 @@ PDP-11/70 Machine Configurations
PDPjs is currently being tested with the following PDP-11/70 machine configurations: PDPjs is currently being tested with the following PDP-11/70 machine configurations:
* [PDP-11/70 Boot Test](/devices/pdp11/machine/1170/test/) (with [Debugger](/devices/pdp11/machine/1170/test/debugger/)) * [PDP-11/70 Boot Monitor](/devices/pdp11/machine/1170/monitor/) (with [Debugger](/devices/pdp11/machine/1170/monitor/debugger/))
* [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/)) * [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/))
* [PDP-11/70 "Server Array"](/devices/pdp11/machine/1170/array/) * [PDP-11/70 "Server Array"](/devices/pdp11/machine/1170/array/)
* [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/) (with [Debugger](/devices/pdp11/machine/1170/vt100/debugger/)) * [PDP-11/70 with VT100 Terminal](/devices/pdp11/machine/1170/vt100/) (with [Debugger](/devices/pdp11/machine/1170/vt100/debugger/))

View file

@ -1,7 +1,7 @@
--- ---
layout: page layout: page
title: PDP-11/70 Boot Test title: PDP-11/70 Boot Monitor
permalink: /devices/pdp11/machine/1170/test/ permalink: /devices/pdp11/machine/1170/monitor/
machines: machines:
- id: test1170 - id: test1170
type: pdp11 type: pdp11

View file

@ -1,7 +1,7 @@
--- ---
layout: page layout: page
title: PDP-11/70 Boot Test with Debugger title: PDP-11/70 Boot Monitor with Debugger
permalink: /devices/pdp11/machine/1170/test/debugger/ permalink: /devices/pdp11/machine/1170/monitor/debugger/
machines: machines:
- id: test1170 - id: test1170
type: pdp11 type: pdp11

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?> <?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?>
<machine id="test1170" class="pdp11" border="1" pos="center" background="#FAEBD7"> <machine id="test1170" class="pdp11" border="1" pos="center" background="#FAEBD7">
<name pos="center">PDP-11/70 Boot Test with Debugger</name> <name pos="center">PDP-11/70 Boot Monitor with Debugger</name>
<computer id="computer" busWidth="22"/> <computer id="computer" busWidth="22"/>
<cpu id="cpu" model="1170" cycles="6666667"/> <cpu id="cpu" model="1170" cycles="6666667"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<ram id="ram" addr="0x10000" size="0x34000"/> <ram id="ram" addr="0x10000" size="0x34000"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print"/> <serial id="dl11" adapter="0" binding="print"/>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?> <?xml-stylesheet type="text/xsl" href="/versions/pdpjs/1.30.2/machine.xsl"?>
<machine id="test1170" class="pdp11" border="1" pos="center" background="#FAEBD7"> <machine id="test1170" class="pdp11" border="1" pos="center" background="#FAEBD7">
<name pos="center">PDP-11/70 Boot Test</name> <name pos="center">PDP-11/70 Boot Monitor</name>
<computer id="computer" busWidth="22"/> <computer id="computer" busWidth="22"/>
<cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/> <cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<ram id="ram" addr="0x10000" size="0x34000"/> <ram id="ram" addr="0x10000" size="0x34000"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print"/> <serial id="dl11" adapter="0" binding="print"/>

View file

@ -4,7 +4,7 @@
<name pos="center">PDP-11/70 with Front Panel and Debugger</name> <name pos="center">PDP-11/70 with Front Panel and Debugger</name>
<computer id="computer" busWidth="22"/> <computer id="computer" busWidth="22"/>
<cpu id="cpu" model="1170" cycles="6666667"/> <cpu id="cpu" model="1170" cycles="6666667"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<ram id="ram" addr="0x10000" size="0x34000"/> <ram id="ram" addr="0x10000" size="0x34000"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print" upperCase="true"/> <serial id="dl11" adapter="0" binding="print" upperCase="true"/>

View file

@ -4,7 +4,7 @@
<name pos="center">PDP-11/70 with Front Panel</name> <name pos="center">PDP-11/70 with Front Panel</name>
<computer id="computer" busWidth="22"/> <computer id="computer" busWidth="22"/>
<cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/> <cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<ram id="ram" addr="0x10000" size="0x34000"/> <ram id="ram" addr="0x10000" size="0x34000"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print" upperCase="true"/> <serial id="dl11" adapter="0" binding="print" upperCase="true"/>

View file

@ -4,7 +4,7 @@
<name pos="center">PDP-11/70 with Front Panel</name> <name pos="center">PDP-11/70 with Front Panel</name>
<computer id="computer" busWidth="22"/> <computer id="computer" busWidth="22"/>
<cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/> <cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<ram id="ram" addr="0x10000" size="0x34000"/> <ram id="ram" addr="0x10000" size="0x34000"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<serial id="dl11" adapter="0"/> <serial id="dl11" adapter="0"/>

View file

@ -4,7 +4,7 @@
<name pos="center">PDP-11/70 with Front Panel</name> <name pos="center">PDP-11/70 with Front Panel</name>
<computer id="computer" busWidth="22"/> <computer id="computer" busWidth="22"/>
<cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/> <cpu id="cpu" model="1170" cycles="6666667" autoStart="true"/>
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json"/> <ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/monitor/PDPJSMON.json"/>
<ram id="ram" addr="0x10000" size="0x34000"/> <ram id="ram" addr="0x10000" size="0x34000"/>
<device id="default" type="default"/> <device id="default" type="default"/>
<serial id="dl11" adapter="0"/> <serial id="dl11" adapter="0"/>

View file

@ -0,0 +1,10 @@
---
layout: page
title: PDP-11/70 Control Panel with Debugger
permalink: /devices/pdp11/panel/1170/debugger/
---
PDP-11/70 Control Panel with Debugger
-------------------------------------
* [PDP-11/70 Front Panel with Debugger](front.xml)

View file

@ -8,3 +8,58 @@ PDP-11 Test Panels
------------------ ------------------
* [Terminal Test Panel](terminal.xml) (with [Debugger](debugger/terminal.xml)) * [Terminal Test Panel](terminal.xml) (with [Debugger](debugger/terminal.xml))
Toggle-Ins
----------
From the [PDP-11/70 Maintenance Service Guide](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Maintenance_Service_Guide_Apr88.pdf),
Chapter 4:
There are several useful toggle-ins that are probably not very well known. They are as follows:
Memory Management
Use the following toggle-in to verify the correct operation of Memory Management Relocation.
200/012737 MOV #400,@#177572 (load maint. bit in MMRO)
202/000400
204/177572
206/012737 MOV #070707,@#200 (move 070707 to virtual 200)
210/070707
212/000200
214/000000 HLT
300/000300 Preset loc 300 to 300
17772300/077406 Set Kernal I PDR 0 to R/W 4K page
17772340/000001 Set Kernal I PAR 0 to (Base address 100)
Load Address 200
Start Display = 000216 (Halt@214)
Load Address 300
Exam Display = 070707 ... Relocation works
Unibus Map Checkout
Use the following console operating procedure to verify the correct operation of the Unibus Map.
Load Address 500
Deposit 125252 Known Data
Load Address 17000500
Deposit 125252 Data Path Ok
Load Address 17000700
Deposit 070707 Known Data
Load Address 17770202 Map register 0 Hi
Deposit 000000 Relocation constant
Load Address 17770200 Map register 0 Lo
Deposit 000200 Relocation constant
Load Address 17772516 MMR3
Deposit 000040 Enable map
Load address 17000500 Relocates to 700
Examine 070707 ... Relocated ok

View file

@ -0,0 +1,10 @@
---
layout: page
title: PDP-11 Test Panel with Debugger
permalink: /devices/pdp11/panel/test/debugger/
---
PDP-11 Test Panel with Debugger
-------------------------------
* [Terminal Test Panel with Debugger](terminal.xml)

View file

@ -9,7 +9,7 @@ RL11 Disk Controller
Machines containing the [RL11 Component](/modules/pdp11/lib/pc11.js) include: Machines containing the [RL11 Component](/modules/pdp11/lib/pc11.js) include:
- [PDP-11/70 Boot Test](/devices/pdp11/machine/1170/test/) (with [Debugger](/devices/pdp11/machine/1170/test/debugger/)) - [PDP-11/70 Boot Monitor](/devices/pdp11/machine/1170/monitor/) (with [Debugger](/devices/pdp11/machine/1170/monitor/debugger/))
- [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/)) - [PDP-11/70 with Front Panel](/devices/pdp11/machine/1170/panel/) (with [Debugger](/devices/pdp11/machine/1170/panel/debugger/))
PCjs has archived a selection of [RL02K Disk Images](/disks/dec/rl02k/) for use by those machines, most of which are PCjs has archived a selection of [RL02K Disk Images](/disks/dec/rl02k/) for use by those machines, most of which are

View file

@ -84,39 +84,19 @@ function BusPDP11(parmsBus, cpu, dbg)
this.realIOPageBlocks = null; // this saves the memory blocks allocated for IOPAGE, so we can reuse them this.realIOPageBlocks = null; // this saves the memory blocks allocated for IOPAGE, so we can reuse them
/* /*
* Compute all BusPDP11 memory block parameters, based on the width of the bus. The entire * Compute all BusPDP11 memory block parameters now, based on the width of the bus.
* address space is divided into blocks, using a block size that is (hopefully) appropriate to
* the bus width. The following table summarizes our (original) simplistic calculations:
* *
* Bus Width Block Shift Block Size * Note that all PCjs machines divide their address space into blocks, using a block size appropriate for
* --------- ----------- ---------- * the machine's bus width. This allows us to efficiently allocate the entire address space, by reusing blocks
* 16 bits (64Kb address space): 10 1Kb (64 maximum blocks) * as appropriate, and to define to different address behaviors on a block-granular level.
* 18 bits (256Kb address space): 11 2Kb (128 maximum blocks)
* 20 bits (1Mb address space): 12 4Kb (256 maximum blocks)
* 22 bits (4Mb address space): 13 8Kb (512 maximum blocks)
* 24 bits (16Mb address space): 14 16Kb (1K maximum blocks)
* 32 bits (4Gb address space); 15 32Kb (128K maximum blocks)
* *
* The coarser block granularities (ie, 16Kb and 32Kb) may cause problems for certain RAM and/or ROM * For PDPjs machines, the ideal block size is 8Kb (IOPAGE_LENGTH), the size of the IOPAGE on all PDP-11 machines;
* allocations that are contiguous but are allocated out of order, or that have different controller * as a result, our IOController functions assume that all incoming offsets are within a single 8Kb block.
* requirements. Your choices, for the moment, are either to ensure the allocations are performed in
* order, or to choose smaller nBlockShift values (at the expense of a generating a larger block array).
*/ */
this.addrTotal = Math.pow(2, this.nBusWidth); this.addrTotal = Math.pow(2, this.nBusWidth);
this.nBusLimit = this.nBusMask = (this.addrTotal - 1) | 0; this.nBusLimit = this.nBusMask = (this.addrTotal - 1) | 0;
/*
* WARNING: Instead of dynamically calculating nBlockShift based on nBusWidth, as described above, we
* now force nBlockSize to IOPAGE_LENGTH, because that's what our IOController functions currently assume.
*
* this.nBlockShift = (this.nBusWidth >> 1) + 2;
* if (this.nBlockShift < 10) this.nBlockShift = 10;
* if (this.nBlockShift > 15) this.nBlockShift = 15;
* this.nBlockSize = 1 << this.nBlockShift;
*/
this.nBlockSize = BusPDP11.IOPAGE_LENGTH; this.nBlockSize = BusPDP11.IOPAGE_LENGTH;
this.nBlockShift = Math.log2(this.nBlockSize); // ES6 ALERT (alternatively: Math.log(this.nBlockSize) / Math.LN2) this.nBlockShift = Math.log2(this.nBlockSize); // ES6 ALERT (alternatively: Math.log(this.nBlockSize) / Math.LN2)
this.nBlockLen = this.nBlockSize >> 2; this.nBlockLen = this.nBlockSize >> 2;
this.nBlockLimit = this.nBlockSize - 1; this.nBlockLimit = this.nBlockSize - 1;
this.nBlockTotal = (this.addrTotal / this.nBlockSize) | 0; this.nBlockTotal = (this.addrTotal / this.nBlockSize) | 0;
@ -209,8 +189,8 @@ BusPDP11.IOHANDLER = {
/* /*
* These are our custom IOController functions for all IOPAGE accesses. They look up the IOPAGE * These are our custom IOController functions for all IOPAGE accesses. They look up the IOPAGE
* offset in the aIOHandlers table, and if an entry exists, they use the appropriate IOHANDLER indexes * offset in the aIOHandlers table, and if an entry exists, they use the appropriate IOHANDLER indexes
* (above) to locate the registered read/write handlers. If no handler is found, then unknownAccess() * (above) to locate the registered read/write handlers. If no handler is found, then fault() will
* is called, triggering a trap -- unless traps are disabled because direct access was requested * be called, triggering a trap -- unless traps are disabled because direct access was requested
* (eg, by the Debugger). * (eg, by the Debugger).
* *
* Handlers receive the original IOPAGE address that was used, although in most cases, it's ignored, * Handlers receive the original IOPAGE address that was used, although in most cases, it's ignored,
@ -282,7 +262,8 @@ BusPDP11.IOController = {
} }
return b; return b;
} }
b = bus.unknownAccess(addr, true); bus.fault(addr, PDP11.CPUERR.TIMEOUT, PDP11.ACCESS.READ_BYTE);
b = 0xff;
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage("warning: unconverted read access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true); this.dbg.printMessage("warning: unconverted read access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true);
} }
@ -355,7 +336,7 @@ BusPDP11.IOController = {
} }
return; return;
} }
bus.unknownAccess(addr, true, b); bus.fault(addr, PDP11.CPUERR.TIMEOUT, PDP11.ACCESS.WRITE_BYTE);
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage("warning: unconverted write access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true); this.dbg.printMessage("warning: unconverted write access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true);
} }
@ -387,7 +368,8 @@ BusPDP11.IOController = {
} }
return w; return w;
} }
w = bus.unknownAccess(addr, false); bus.fault(addr, PDP11.CPUERR.TIMEOUT, PDP11.ACCESS.READ_WORD);
w = 0xffff;
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage("warning: unconverted read access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true); this.dbg.printMessage("warning: unconverted read access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true);
} }
@ -423,7 +405,7 @@ BusPDP11.IOController = {
} }
return; return;
} }
bus.unknownAccess(addr, false, w); bus.fault(addr, PDP11.CPUERR.TIMEOUT, PDP11.ACCESS.WRITE_WORD);
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage("warning: unconverted write access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true); this.dbg.printMessage("warning: unconverted write access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true);
} }
@ -495,7 +477,7 @@ BusPDP11.prototype.setIOPageRange = function(nRange)
BusPDP11.prototype.getControllerBuffer = function(addr) BusPDP11.prototype.getControllerBuffer = function(addr)
{ {
/* /*
* No buffer is required for the IOPAGE; all accesses go to registered I/O handlers or to unknownAccess(). * No buffer is required for the IOPAGE; all accesses go to registered I/O handlers or to fault().
*/ */
return [null, 0]; return [null, 0];
}; };
@ -539,30 +521,6 @@ BusPDP11.prototype.reset = function()
this.setIOPageRange(16); this.setIOPageRange(16);
}; };
/**
* unknownAccess(addr, fByte, data)
*
* This is our default I/O handler, called when there's an IOPAGE access without a corresponding entry in aIOHandlers.
*
* @this {BusPDP11}
* @param {number} addr (ie, an IOPAGE address)
* @param {boolean} [fByte] (true if byte access, otherwise word)
* @param {number} [data] (undefined if read, otherwise write)
* @return {number}
*/
BusPDP11.prototype.unknownAccess = function(addr, fByte, data)
{
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) {
this.dbg.printMessage("warning: unknown I/O access (" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data, fByte?1:2) + ")", true, true);
this.dbg.stopInstruction();
}
if (!this.nDisableFaults) {
this.cpu.regErr |= PDP11.CPUERR.TIMEOUT;
this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr);
}
return 0;
};
/** /**
* powerUp(data, fRepower) * powerUp(data, fRepower)
* *
@ -910,13 +868,21 @@ BusPDP11.prototype.setMemoryBlocks = function(addr, size, aBlocks, type)
*/ */
BusPDP11.prototype.getByte = function(addr) BusPDP11.prototype.getByte = function(addr)
{ {
/*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map.
*/
if (addr >= BusPDP11.IOPAGE_UNIBUS) {
addr = this.cpu.mapUnibus(addr);
}
return this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr); return this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr);
}; };
/** /**
* getByteDirect(addr) * getByteDirect(addr)
* *
* This is useful for the Debugger and other components that want to bypass getByte() breakpoint detection. * This is useful for the Debugger and other components that want to access physical memory without side-effects.
* *
* @this {BusPDP11} * @this {BusPDP11}
* @param {number} addr is a physical address * @param {number} addr is a physical address
@ -940,6 +906,14 @@ BusPDP11.prototype.getByteDirect = function(addr)
*/ */
BusPDP11.prototype.getWord = function(addr) BusPDP11.prototype.getWord = function(addr)
{ {
/*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map.
*/
if (addr >= BusPDP11.IOPAGE_UNIBUS) {
addr = this.cpu.mapUnibus(addr);
}
var off = addr & this.nBlockLimit; var off = addr & this.nBlockLimit;
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
if (!PDP11.WORDBUS && off == this.nBlockLimit) { if (!PDP11.WORDBUS && off == this.nBlockLimit) {
@ -982,6 +956,14 @@ BusPDP11.prototype.getWordDirect = function(addr)
*/ */
BusPDP11.prototype.setByte = function(addr, b) BusPDP11.prototype.setByte = function(addr, b)
{ {
/*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map.
*/
if (addr >= BusPDP11.IOPAGE_UNIBUS) {
addr = this.cpu.mapUnibus(addr);
}
this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr); this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr);
}; };
@ -1012,6 +994,14 @@ BusPDP11.prototype.setByteDirect = function(addr, b)
*/ */
BusPDP11.prototype.setWord = function(addr, w) BusPDP11.prototype.setWord = function(addr, w)
{ {
/*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so we must pass the address through the
* UNIBUS relocation map.
*/
if (addr >= BusPDP11.IOPAGE_UNIBUS) {
addr = this.cpu.mapUnibus(addr);
}
var off = addr & this.nBlockLimit; var off = addr & this.nBlockLimit;
var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift;
if (!PDP11.WORDBUS && off == this.nBlockLimit) { if (!PDP11.WORDBUS && off == this.nBlockLimit) {
@ -1215,12 +1205,13 @@ BusPDP11.prototype.addIOTable = function(component, table)
* Don't install (ie, ignore) handlers for I/O addresses that are defined with a model number * Don't install (ie, ignore) handlers for I/O addresses that are defined with a model number
* that is "greater than" than the current model. * that is "greater than" than the current model.
*/ */
if (afn[5] && afn[5] > this.cpu.model) continue; if (afn[6] && afn[6] > this.cpu.model) continue;
var fnReadByte = afn[0]? afn[0].bind(component) : null; var fnReadByte = afn[0]? afn[0].bind(component) : null;
var fnWriteByte = afn[1]? afn[1].bind(component) : null; var fnWriteByte = afn[1]? afn[1].bind(component) : null;
var fnReadWord = afn[2]? afn[2].bind(component) : null; var fnReadWord = afn[2]? afn[2].bind(component) : null;
var fnWriteWord = afn[3]? afn[3].bind(component) : null; var fnWriteWord = afn[3]? afn[3].bind(component) : null;
var nRegs = afn[5] || 1;
/* /*
* As discussed in the IOController comments above, when handlers are being registered for the following * As discussed in the IOController comments above, when handlers are being registered for the following
@ -1242,7 +1233,12 @@ BusPDP11.prototype.addIOTable = function(component, table)
}(fnWriteWord); }(fnWriteWord);
} }
} }
this.addIOHandlers(addr, addr, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, afn[4]);
var sReg = afn[4];
for (var iReg = 0; iReg < nRegs; iReg++, addr += 2) {
if (sReg && nRegs > 1) sReg = afn[4] + iReg;
this.addIOHandlers(addr, addr, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sReg);
}
} }
}; };
@ -1258,24 +1254,26 @@ BusPDP11.prototype.addResetHandler = function(fnReset)
}; };
/** /**
* fault(addr, access) * fault(addr, err, access)
* *
* Memory interface for signaling alignment errors, invalid memory * Bus interface for signaling alignment errors, invalid memory, etc.
* *
* @this {BusPDP11} * @this {BusPDP11}
* @param {number} addr * @param {number} addr
* @param {number} [err]
* @param {number} [access] (for diagnostic purposes only) * @param {number} [access] (for diagnostic purposes only)
*/ */
BusPDP11.prototype.fault = function(addr, access) BusPDP11.prototype.fault = function(addr, err, access)
{ {
this.fFault = true;
if (!this.nDisableFaults) { if (!this.nDisableFaults) {
if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) {
this.dbg.printMessage("memory fault (" + access + ") on address " + this.dbg.toStrBase(addr), true, true); this.dbg.printMessage("memory fault (" + access + ") on address " + this.dbg.toStrBase(addr), true, true);
this.dbg.stopInstruction(); this.dbg.stopInstruction();
} }
if (err) this.cpu.regErr |= err;
this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr);
} }
this.fFault = true;
}; };
/** /**

View file

@ -200,7 +200,6 @@ CPUStatePDP11.prototype.initRegs = function()
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // user 3 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // user 3
]; ];
this.unibusMap = [ // 32 unibus map registers this.unibusMap = [ // 32 unibus map registers
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]; ];
this.regsControl = [ // various control registers (177740-177756) we don't really care about this.regsControl = [ // various control registers (177740-177756) we don't really care about
@ -242,10 +241,7 @@ CPUStatePDP11.prototype.resetRegs = function()
this.regMMR3 = 0; // 172516 this.regMMR3 = 0; // 172516
this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE this.mmuEnable = 0; // MMU enabled for PDP11.ACCESS.READ or PDP11.ACCESS.WRITE
this.mmuLastMode = 0; this.mmuLastMode = 0;
this.mmuMask = 0x3ffff; this.mmuMask = 0x3ffff;
this.mmuMemorySize = BusPDP11.IOPAGE_18BIT;
this.resetTriggers(); this.resetTriggers();
if (this.bus) this.setMemoryAccess(); if (this.bus) this.setMemoryAccess();
@ -359,13 +355,7 @@ CPUStatePDP11.prototype.setMMR3 = function(newMMR3)
} }
if (this.regMMR3 != newMMR3) { if (this.regMMR3 != newMMR3) {
this.regMMR3 = newMMR3; this.regMMR3 = newMMR3;
if (newMMR3 & PDP11.MMR3.MMU_22BIT) { this.mmuMask = (newMMR3 & PDP11.MMR3.MMU_22BIT)? 0x3fffff : 0x3ffff;
this.mmuMask = 0x3fffff;
this.mmuMemorySize = BusPDP11.MAX_MEMORY;
} else {
this.mmuMask = 0x3ffff;
this.mmuMemorySize = BusPDP11.IOPAGE_18BIT;
}
this.setMemoryAccess(); this.setMemoryAccess();
} }
}; };
@ -1242,24 +1232,45 @@ CPUStatePDP11.prototype.getTrapStatus = function()
}; };
/** /**
* mapUnibus(unibusAddress) * mapUnibus(addr)
*
* If bits 18-21 of addr are all set (which is implied by addr >= BusPDP11.IOPAGE_UNIBUS aka 0x3C0000),
* then we have a 22-bit address pointing to the top 256Kb range, so if the UNIBUS relocation map is enabled,
* we must pass the lower 18 bits of that address through the map.
*
* Since mapUnibus() only looks at the low 18 bits of addr, there's no need to mask addr first. Note that
* if bits 13-17 are all set, then the 18-bit address points to the top 8Kb of its 256Kb range, and mapUnibus()
* will return addr unchanged, since it should already be pointing to the top 8Kb of the 4Mb 22-bit range.
*
* From the PDP-11/70 Handbook:
*
* On the 11/44 and 11/70, there are a total of 31 mapping registers for address relocation. Each register is
* composed of a double 16-bit PDP-11 word (in consecutive locations) that holds the 22-bit base address. These
* registers have UNIBUS addresses in the range 770200 to 770372.
*
* If the UNIBUS map relocation is not enabled, an incoming 18-bit UNIBUS address has 4 leading zeroes added for
* referencing a 22-bit physical address. The lower 18 bits are the same. No relocation is performed.
*
* If UNIBUS map relocation is enabled, the five high order bits of the UNIBUS address are used to select one of the
* 31 mapping registers. The low-order 13 bits of the incoming address are used as an offset from the base address
* contained in the 22-bit mapping register. To form the physical address, the 13 low-order bits of the UNIBUS
* address are added to 22 bits of the selected mapping register to produce the 22-bit physical address. The lowest
* order bit of all mapping registers is always a zero, since relocation is always on word boundaries.
* *
* @this {CPUStatePDP11} * @this {CPUStatePDP11}
* @param {number} unibusAddress * @param {number} addr
* @return {number} * @return {number}
*/ */
CPUStatePDP11.prototype.mapUnibus = function(unibusAddress) CPUStatePDP11.prototype.mapUnibus = function(addr)
{ {
var idx = (unibusAddress >> 13) & 0x1f; var idx = (addr >> 13) & 0x1f;
if (idx < 31) { if (idx < 31) {
if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) { if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) {
unibusAddress = (this.unibusMap[idx] + (unibusAddress & 0x1ffe)) & 0x3ffffe; addr = (this.unibusMap[idx] + (addr & 0x1ffe)) & 0x3ffffe;
if (unibusAddress >= BusPDP11.IOPAGE_UNIBUS && unibusAddress < BusPDP11.IOPAGE_22BIT) this.panic(898); if (addr >= BusPDP11.IOPAGE_UNIBUS && addr < BusPDP11.IOPAGE_22BIT) this.panic(898);
} }
} else {
unibusAddress |= BusPDP11.IOPAGE_22BIT;
} }
return unibusAddress; return addr;
}; };
/** /**
@ -1287,8 +1298,8 @@ CPUStatePDP11.prototype.mapUnibus = function(unibusAddress)
* A PDP 11/70 is different to other PDP 11's in that the highest 18 bit space (017000000 & above) * A PDP 11/70 is different to other PDP 11's in that the highest 18 bit space (017000000 & above)
* maps directly to UNIBUS space - including low memory. This doesn't appear to be particularly * maps directly to UNIBUS space - including low memory. This doesn't appear to be particularly
* useful as it restricts maximum system memory - although it does appear to allow software * useful as it restricts maximum system memory - although it does appear to allow software
* testing of the unibus map. This feature also appears to confuse some OSes which test consecutive * testing of the unibus map. This feature also appears to confuse some OSes which test consecutive
* memory locations to find maximum memory - and on a full memory system find themselves accessing * memory locations to find maximum memory -- and on a full memory system find themselves accessing
* low memory again at high addresses. * low memory again at high addresses.
* *
* 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 MMR0 * 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 MMR0
@ -1318,26 +1329,6 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
pdr = this.mmuPDR[this.mmuMode][page]; pdr = this.mmuPDR[this.mmuMode][page];
physicalAddress = ((this.mmuPAR[this.mmuMode][page] << 6) + (virtualAddress & 0x1fff)) & this.mmuMask; physicalAddress = ((this.mmuPAR[this.mmuMode][page] << 6) + (virtualAddress & 0x1fff)) & this.mmuMask;
if (physicalAddress < this.mmuMemorySize) {
if ((physicalAddress & 1) && !(accessFlags & PDP11.ACCESS.BYTE)) {
this.regErr |= PDP11.CPUERR.ODDADDR;
this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR);
}
} else {
if (!(this.regMMR3 & 0x10)) {
if (physicalAddress >= BusPDP11.IOPAGE_18BIT) physicalAddress |= BusPDP11.IOPAGE_22BIT;
}
if (physicalAddress < BusPDP11.IOPAGE_22BIT) {
if (physicalAddress >= BusPDP11.IOPAGE_UNIBUS) {
physicalAddress = this.mapUnibus(physicalAddress & 0x3ffff); // 18bit unibus space
}
if (physicalAddress >= this.mmuMemorySize && physicalAddress < BusPDP11.IOPAGE_22BIT) {
this.regErr |= PDP11.CPUERR.NOMEMORY;
this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.NOMEMORY); // KB11-EM does this after ABORT handling - KB11-CM before
}
}
}
switch (pdr & 0x7) { switch (pdr & 0x7) {
case 1: // read-only with trap case 1: // read-only with trap
errorMask = 0x1000; // MMU trap errorMask = 0x1000; // MMU trap
@ -1365,18 +1356,19 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
} }
if ((pdr & 0x7f08) !== 0x7f00) { // skip checking most common case (hopefully) if ((pdr & 0x7f08) !== 0x7f00) { // skip checking most common case (hopefully)
if (pdr & 0x8) { // expand downwards if (pdr & 0x8) { // expand downwards
if (pdr & 0x7f00) { if (pdr & 0x7f00) {
if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) { if ((virtualAddress & 0x1fc0) < ((pdr >> 2) & 0x1fc0)) {
errorMask |= 0x4000; // page length error abort errorMask |= 0x4000; // page length error abort
} }
} }
} else { // expand upwards } else { // expand upwards
if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) { if ((virtualAddress & 0x1fc0) > ((pdr >> 2) & 0x1fc0)) {
errorMask |= 0x4000; // page length error abort errorMask |= 0x4000; // page length error abort
} }
} }
} }
// aborts and traps: log FIRST trap and MOST RECENT abort // aborts and traps: log FIRST trap and MOST RECENT abort
this.mmuPDR[this.mmuMode][page] = pdr; this.mmuPDR[this.mmuMode][page] = pdr;
@ -1384,13 +1376,15 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
this.mmuLastMode = this.mmuMode; this.mmuLastMode = this.mmuMode;
this.mmuLastPage = page; this.mmuLastPage = page;
} }
var fTrap = false;
if (errorMask) { if (errorMask) {
if (errorMask & 0xe000) { if (errorMask & 0xe000) {
if (this.trapPSW >= 0) errorMask |= 0x80; // Instruction complete if (this.trapPSW >= 0) errorMask |= 0x80; // Instruction complete
if (!(this.regMMR0 & 0xe000)) { if (!(this.regMMR0 & 0xe000)) {
this.regMMR0 |= errorMask | (this.mmuLastMode << 5) | (this.mmuLastPage << 1); this.regMMR0 |= errorMask | (this.mmuLastMode << 5) | (this.mmuLastPage << 1);
} }
this.trap(PDP11.TRAP.MMU, PDP11.REASON.MAPERROR); fTrap = true;
} }
if (!(this.regMMR0 & 0xf000)) { if (!(this.regMMR0 & 0xf000)) {
//if (physicalAddress < 017772200 || physicalAddress > 017777677) { //if (physicalAddress < 017772200 || physicalAddress > 017777677) {
@ -1401,6 +1395,9 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
} }
} }
} }
if (fTrap) { // don't trap until the end, because it throws an exception
this.trap(PDP11.TRAP.MMU, PDP11.REASON.MAPERROR);
}
} }
return physicalAddress; return physicalAddress;
}; };

View file

@ -364,6 +364,7 @@ var PDP11 = {
* For more details: https://github.com/google/closure-compiler/wiki/ECMAScript6 * For more details: https://github.com/google/closure-compiler/wiki/ECMAScript6
*/ */
UNIBUS: { //16-bit 18-bit 22-bit Hex Description UNIBUS: { //16-bit 18-bit 22-bit Hex Description
UNIMAP: 0o170200, // UNIBUS Mapping Registers (0-31) 64 words (ends at 0o170372)
SISDR0: 0o172200, // Supervisor I Space Descriptor Register 0 SISDR0: 0o172200, // Supervisor I Space Descriptor Register 0
SISDR1: 0o172202, // Supervisor I Space Descriptor Register 1 SISDR1: 0o172202, // Supervisor I Space Descriptor Register 1
SISDR2: 0o172204, // Supervisor I Space Descriptor Register 2 SISDR2: 0o172204, // Supervisor I Space Descriptor Register 2

View file

@ -321,6 +321,41 @@ DevicePDP11.prototype.updateConsoleMode = function()
this.console.misc = (this.console.misc & ~7) | bit; this.console.misc = (this.console.misc & ~7) | bit;
}; };
/**
* readUNIMAP(addr)
*
* NOTE: The UNIBUS map is 32 registers spread across 64 words, so we first calculate the word index.
*
* @this {DevicePDP11}
* @param {number} addr (eg, PDP11.UNIBUS.UNIMAP)
* @return {number}
*/
DevicePDP11.prototype.readUNIMAP = function(addr)
{
var word = (addr >> 1) & 0x3f, reg = word >> 1;
var data = this.cpu.unibusMap[reg];
return (word & 1)? (data >> 16) : (data & 0xffff);
};
/**
* writeUNIMAP(data, addr)
*
* NOTE: The UNIBUS map is 32 registers spread across 64 words, so we first calculate the word index.
*
* @this {DevicePDP11}
* @param {number} data
* @param {number} addr (eg, PDP11.UNIBUS.UNIMAP)
*/
DevicePDP11.prototype.writeUNIMAP = function(data, addr)
{
var word = (addr >> 1) & 0x3f, reg = word >> 1;
if (word & 1) {
this.cpu.unibusMap[reg] = (this.cpu.unibusMap[reg] & 0xffff) | ((data & 0x003f) << 16);
} else {
this.cpu.unibusMap[reg] = (this.cpu.unibusMap[reg] & ~0xffff) | (data & 0xfffe);
}
};
/** /**
* readSISDR(addr) * readSISDR(addr)
* *
@ -1059,24 +1094,25 @@ DevicePDP11.prototype.writeIgnored = function(data, addr)
* ES6 ALERT: As you can see below, I've finally started using computed property names. * ES6 ALERT: As you can see below, I've finally started using computed property names.
*/ */
DevicePDP11.UNIBUS_IOTABLE = { DevicePDP11.UNIBUS_IOTABLE = {
[PDP11.UNIBUS.SISDR0]: /* 172200 */ [null, null, DevicePDP11.prototype.readSISDR, DevicePDP11.prototype.writeSISDR, "SISDR", PDP11.MODEL_1145], [PDP11.UNIBUS.UNIMAP]: /* 170200 */ [null, null, DevicePDP11.prototype.readUNIMAP, DevicePDP11.prototype.writeUNIMAP, "UNIMAP", 64, PDP11.MODEL_1170],
[PDP11.UNIBUS.SDSDR0]: /* 172220 */ [null, null, DevicePDP11.prototype.readSDSDR, DevicePDP11.prototype.writeSDSDR, "SDSDR", PDP11.MODEL_1145], [PDP11.UNIBUS.SISDR0]: /* 172200 */ [null, null, DevicePDP11.prototype.readSISDR, DevicePDP11.prototype.writeSISDR, "SISDR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.SISAR0]: /* 172240 */ [null, null, DevicePDP11.prototype.readSISAR, DevicePDP11.prototype.writeSISAR, "SISAR", PDP11.MODEL_1145], [PDP11.UNIBUS.SDSDR0]: /* 172220 */ [null, null, DevicePDP11.prototype.readSDSDR, DevicePDP11.prototype.writeSDSDR, "SDSDR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.SDSAR0]: /* 172260 */ [null, null, DevicePDP11.prototype.readSDSAR, DevicePDP11.prototype.writeSDSAR, "SDSAR", PDP11.MODEL_1145], [PDP11.UNIBUS.SISAR0]: /* 172240 */ [null, null, DevicePDP11.prototype.readSISAR, DevicePDP11.prototype.writeSISAR, "SISAR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.KISDR0]: /* 172300 */ [null, null, DevicePDP11.prototype.readKISDR, DevicePDP11.prototype.writeKISDR, "KISDR", PDP11.MODEL_1145], [PDP11.UNIBUS.SDSAR0]: /* 172260 */ [null, null, DevicePDP11.prototype.readSDSAR, DevicePDP11.prototype.writeSDSAR, "SDSAR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.KDSDR0]: /* 172320 */ [null, null, DevicePDP11.prototype.readKDSDR, DevicePDP11.prototype.writeKDSDR, "KDSDR", PDP11.MODEL_1145], [PDP11.UNIBUS.KISDR0]: /* 172300 */ [null, null, DevicePDP11.prototype.readKISDR, DevicePDP11.prototype.writeKISDR, "KISDR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.KISAR0]: /* 172340 */ [null, null, DevicePDP11.prototype.readKISAR, DevicePDP11.prototype.writeKISAR, "KISAR", PDP11.MODEL_1145], [PDP11.UNIBUS.KDSDR0]: /* 172320 */ [null, null, DevicePDP11.prototype.readKDSDR, DevicePDP11.prototype.writeKDSDR, "KDSDR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.KDSAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDSAR, DevicePDP11.prototype.writeKDSAR, "KDSAR", PDP11.MODEL_1145], [PDP11.UNIBUS.KISAR0]: /* 172340 */ [null, null, DevicePDP11.prototype.readKISAR, DevicePDP11.prototype.writeKISAR, "KISAR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3", PDP11.MODEL_1145], [PDP11.UNIBUS.KDSAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDSAR, DevicePDP11.prototype.writeKDSAR, "KDSAR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.LKS]: /* 177546 */ [null, null, DevicePDP11.prototype.readLKS, DevicePDP11.prototype.writeLKS, "LKS"], [PDP11.UNIBUS.LKS]: /* 177546 */ [null, null, DevicePDP11.prototype.readLKS, DevicePDP11.prototype.writeLKS, "LKS"],
[PDP11.UNIBUS.CNSL]: /* 177570 */ [null, null, DevicePDP11.prototype.readCNSL, DevicePDP11.prototype.writeCNSL, "CNSL"], [PDP11.UNIBUS.CNSL]: /* 177570 */ [null, null, DevicePDP11.prototype.readCNSL, DevicePDP11.prototype.writeCNSL, "CNSL"],
[PDP11.UNIBUS.MMR0]: /* 177572 */ [null, null, DevicePDP11.prototype.readMMR0, DevicePDP11.prototype.writeMMR0, "MMR0", PDP11.MODEL_1145], [PDP11.UNIBUS.MMR0]: /* 177572 */ [null, null, DevicePDP11.prototype.readMMR0, DevicePDP11.prototype.writeMMR0, "MMR0", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1", PDP11.MODEL_1145], [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2", PDP11.MODEL_1145], [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.UISDR0]: /* 177600 */ [null, null, DevicePDP11.prototype.readUISDR, DevicePDP11.prototype.writeUISDR, "UISDR", PDP11.MODEL_1145], [PDP11.UNIBUS.UISDR0]: /* 177600 */ [null, null, DevicePDP11.prototype.readUISDR, DevicePDP11.prototype.writeUISDR, "UISDR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.UDSDR0]: /* 177620 */ [null, null, DevicePDP11.prototype.readUDSDR, DevicePDP11.prototype.writeUDSDR, "UDSDR", PDP11.MODEL_1145], [PDP11.UNIBUS.UDSDR0]: /* 177620 */ [null, null, DevicePDP11.prototype.readUDSDR, DevicePDP11.prototype.writeUDSDR, "UDSDR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.UISAR0]: /* 177640 */ [null, null, DevicePDP11.prototype.readUISAR, DevicePDP11.prototype.writeUISAR, "UISAR", PDP11.MODEL_1145], [PDP11.UNIBUS.UISAR0]: /* 177640 */ [null, null, DevicePDP11.prototype.readUISAR, DevicePDP11.prototype.writeUISAR, "UISAR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.UDSAR0]: /* 177660 */ [null, null, DevicePDP11.prototype.readUDSAR, DevicePDP11.prototype.writeUDSAR, "UDSAR", PDP11.MODEL_1145], [PDP11.UNIBUS.UDSAR0]: /* 177660 */ [null, null, DevicePDP11.prototype.readUDSAR, DevicePDP11.prototype.writeUDSAR, "UDSAR", 8, PDP11.MODEL_1145],
[PDP11.UNIBUS.R0SET0]: /* 177700 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R0SET0"], [PDP11.UNIBUS.R0SET0]: /* 177700 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R0SET0"],
[PDP11.UNIBUS.R1SET0]: /* 177701 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R1SET0"], [PDP11.UNIBUS.R1SET0]: /* 177701 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R1SET0"],
[PDP11.UNIBUS.R2SET0]: /* 177702 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R2SET0"], [PDP11.UNIBUS.R2SET0]: /* 177702 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R2SET0"],
@ -1085,121 +1121,25 @@ DevicePDP11.UNIBUS_IOTABLE = {
[PDP11.UNIBUS.R5SET0]: /* 177705 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R5SET0"], [PDP11.UNIBUS.R5SET0]: /* 177705 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R5SET0"],
[PDP11.UNIBUS.R6KERNEL]:/* 177706 */ [null, null, DevicePDP11.prototype.readR6KERNEL,DevicePDP11.prototype.writeR6KERNEL,"R6KERNEL"], [PDP11.UNIBUS.R6KERNEL]:/* 177706 */ [null, null, DevicePDP11.prototype.readR6KERNEL,DevicePDP11.prototype.writeR6KERNEL,"R6KERNEL"],
[PDP11.UNIBUS.R7KERNEL]:/* 177707 */ [null, null, DevicePDP11.prototype.readR7KERNEL,DevicePDP11.prototype.writeR7KERNEL,"R7KERNEL"], [PDP11.UNIBUS.R7KERNEL]:/* 177707 */ [null, null, DevicePDP11.prototype.readR7KERNEL,DevicePDP11.prototype.writeR7KERNEL,"R7KERNEL"],
[PDP11.UNIBUS.R0SET1]: /* 177710 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R0SET1", PDP11.MODEL_1145], [PDP11.UNIBUS.R0SET1]: /* 177710 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R0SET1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R1SET1]: /* 177711 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R1SET1", PDP11.MODEL_1145], [PDP11.UNIBUS.R1SET1]: /* 177711 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R1SET1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R2SET1]: /* 177712 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R2SET1", PDP11.MODEL_1145], [PDP11.UNIBUS.R2SET1]: /* 177712 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R2SET1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R3SET1]: /* 177713 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R3SET1", PDP11.MODEL_1145], [PDP11.UNIBUS.R3SET1]: /* 177713 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R3SET1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R4SET1]: /* 177714 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R4SET1", PDP11.MODEL_1145], [PDP11.UNIBUS.R4SET1]: /* 177714 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R4SET1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R5SET1]: /* 177715 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R5SET1", PDP11.MODEL_1145], [PDP11.UNIBUS.R5SET1]: /* 177715 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R5SET1", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R6SUPER]: /* 177716 */ [null, null, DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, "R6SUPER", PDP11.MODEL_1145], [PDP11.UNIBUS.R6SUPER]: /* 177716 */ [null, null, DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, "R6SUPER", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.R6USER]: /* 177717 */ [null, null, DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, "R6USER", PDP11.MODEL_1145], [PDP11.UNIBUS.R6USER]: /* 177717 */ [null, null, DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, "R6USER", 1, PDP11.MODEL_1145],
[PDP11.UNIBUS.LAERR]: /* 177740 */ [null, null, DevicePDP11.prototype.readCTRL, DevicePDP11.prototype.writeCTRL, "CTRL", PDP11.MODEL_1170], [PDP11.UNIBUS.LAERR]: /* 177740 */ [null, null, DevicePDP11.prototype.readCTRL, DevicePDP11.prototype.writeCTRL, "CTRL", 1, PDP11.MODEL_1170],
[PDP11.UNIBUS.LSIZE]: /* 177760 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "LSIZE", PDP11.MODEL_1170], [PDP11.UNIBUS.LSIZE]: /* 177760 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "LSIZE", 1, PDP11.MODEL_1170],
[PDP11.UNIBUS.HSIZE]: /* 177762 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "HSIZE", PDP11.MODEL_1170], [PDP11.UNIBUS.HSIZE]: /* 177762 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "HSIZE", 1, PDP11.MODEL_1170],
[PDP11.UNIBUS.SYSID]: /* 177764 */ [null, null, DevicePDP11.prototype.readSYSID, DevicePDP11.prototype.writeSYSID, "SYSID", PDP11.MODEL_1170], [PDP11.UNIBUS.SYSID]: /* 177764 */ [null, null, DevicePDP11.prototype.readSYSID, DevicePDP11.prototype.writeSYSID, "SYSID", 1, PDP11.MODEL_1170],
[PDP11.UNIBUS.CPUERR]: /* 177766 */ [null, null, DevicePDP11.prototype.readCPUERR, DevicePDP11.prototype.writeCPUERR, "CPUERR", PDP11.MODEL_1170], [PDP11.UNIBUS.CPUERR]: /* 177766 */ [null, null, DevicePDP11.prototype.readCPUERR, DevicePDP11.prototype.writeCPUERR, "CPUERR", 1, PDP11.MODEL_1170],
[PDP11.UNIBUS.MB]: /* 177770 */ [null, null, DevicePDP11.prototype.readMB, DevicePDP11.prototype.writeMB, "MB", PDP11.MODEL_1170], [PDP11.UNIBUS.MB]: /* 177770 */ [null, null, DevicePDP11.prototype.readMB, DevicePDP11.prototype.writeMB, "MB", 1, PDP11.MODEL_1170],
[PDP11.UNIBUS.PIR]: /* 177772 */ [null, null, DevicePDP11.prototype.readPIR, DevicePDP11.prototype.writePIR, "PIR"], [PDP11.UNIBUS.PIR]: /* 177772 */ [null, null, DevicePDP11.prototype.readPIR, DevicePDP11.prototype.writePIR, "PIR"],
[PDP11.UNIBUS.SL]: /* 177774 */ [null, null, DevicePDP11.prototype.readSL, DevicePDP11.prototype.writeSL, "SL"], [PDP11.UNIBUS.SL]: /* 177774 */ [null, null, DevicePDP11.prototype.readSL, DevicePDP11.prototype.writeSL, "SL"],
[PDP11.UNIBUS.PSW]: /* 177776 */ [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW, "PSW"] [PDP11.UNIBUS.PSW]: /* 177776 */ [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW, "PSW"]
}; };
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.SDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.KDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSDR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UISAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR1] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR2] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR3] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR4] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR5] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR6] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR7] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.UDSAR0];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.HAERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.HAERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.MEMERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.MEMERR] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];
DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.CACHEC] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR]; DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.CACHEC] = DevicePDP11.UNIBUS_IOTABLE[PDP11.UNIBUS.LAERR];

View file

@ -575,7 +575,9 @@ MemoryPDP11.prototype = {
* *
* TODO: Determine if we should have separate readByteNone(), readWordNone() and readLongNone() functions * TODO: Determine if we should have separate readByteNone(), readWordNone() and readLongNone() functions
* to return 0xff, 0xffff and 0xffffffff|0, respectively. This seems sufficient for now, as it seems unlikely * to return 0xff, 0xffff and 0xffffffff|0, respectively. This seems sufficient for now, as it seems unlikely
* that a system would require nonexistent memory locations to return ALL bits set. * that a system would require nonexistent memory locations to return ALL bits set. However, another factor
* is whether or not ODDADDR faults take precedence over NOMEMORY faults; if they do, then we need separate
* interfaces.
* *
* Also, I'm reluctant to address that potential issue by simply returning -1, because to date, the above * Also, I'm reluctant to address that potential issue by simply returning -1, because to date, the above
* Memory interfaces have always returned values that are properly masked to 8, 16 or 32 bits, respectively. * Memory interfaces have always returned values that are properly masked to 8, 16 or 32 bits, respectively.
@ -590,7 +592,7 @@ MemoryPDP11.prototype = {
this.dbg.printMessage("attempt to read invalid address " + this.dbg.toStrBase(addr), true); this.dbg.printMessage("attempt to read invalid address " + this.dbg.toStrBase(addr), true);
this.dbg.stopInstruction(); this.dbg.stopInstruction();
} }
this.bus.fault(addr, PDP11.ACCESS.READ); this.bus.fault(addr, PDP11.CPUERR.NOMEMORY, PDP11.ACCESS.READ);
return 0xff; return 0xff;
}, },
/** /**
@ -606,7 +608,7 @@ MemoryPDP11.prototype = {
this.dbg.printMessage("attempt to write " + this.dbg.toStrBase(v) + " to invalid addresses " + this.dbg.toStrBase(addr), true); this.dbg.printMessage("attempt to write " + this.dbg.toStrBase(v) + " to invalid addresses " + this.dbg.toStrBase(addr), true);
this.dbg.stopInstruction(); this.dbg.stopInstruction();
} }
this.bus.fault(addr, PDP11.ACCESS.WRITE); this.bus.fault(addr, PDP11.CPUERR.NOMEMORY, PDP11.ACCESS.WRITE);
}, },
/** /**
* readWordDefault(off, addr) * readWordDefault(off, addr)
@ -655,7 +657,7 @@ MemoryPDP11.prototype = {
*/ */
readWordMemory: function readWordMemory(off, addr) { readWordMemory: function readWordMemory(off, addr) {
if (PDP11.MEMFAULT && (off & 0x1)) { if (PDP11.MEMFAULT && (off & 0x1)) {
this.bus.fault(addr, PDP11.ACCESS.READ_WORD); this.bus.fault(addr, PDP11.CPUERR.ODDADDR, PDP11.ACCESS.READ_WORD);
} }
if (BYTEARRAYS) { if (BYTEARRAYS) {
return this.ab[off] | (this.ab[off + 1] << 8); return this.ab[off] | (this.ab[off + 1] << 8);
@ -699,7 +701,7 @@ MemoryPDP11.prototype = {
*/ */
writeWordMemory: function writeWordMemory(off, w, addr) { writeWordMemory: function writeWordMemory(off, w, addr) {
if (PDP11.MEMFAULT && (off & 0x1)) { if (PDP11.MEMFAULT && (off & 0x1)) {
this.bus.fault(addr, PDP11.ACCESS.WRITE_WORD); this.bus.fault(addr, PDP11.CPUERR.ODDADDR, PDP11.ACCESS.WRITE_WORD);
} }
if (BYTEARRAYS) { if (BYTEARRAYS) {
this.ab[off] = (w & 0xff); this.ab[off] = (w & 0xff);
@ -809,7 +811,7 @@ MemoryPDP11.prototype = {
*/ */
readWordBE: function readWordBE(off, addr) { readWordBE: function readWordBE(off, addr) {
if (PDP11.MEMFAULT && (off & 0x1)) { if (PDP11.MEMFAULT && (off & 0x1)) {
this.bus.fault(addr, PDP11.ACCESS.READ_WORD); this.bus.fault(addr, PDP11.CPUERR.ODDADDR, PDP11.ACCESS.READ_WORD);
} }
return this.dv.getUint16(off, true); return this.dv.getUint16(off, true);
}, },
@ -824,7 +826,7 @@ MemoryPDP11.prototype = {
readWordLE: function readWordLE(off, addr) { readWordLE: function readWordLE(off, addr) {
var w; var w;
if (PDP11.MEMFAULT && (off & 0x1)) { if (PDP11.MEMFAULT && (off & 0x1)) {
this.bus.fault(addr, PDP11.ACCESS.READ_WORD); this.bus.fault(addr, PDP11.CPUERR.ODDADDR, PDP11.ACCESS.READ_WORD);
} }
/* /*
* TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset
@ -877,7 +879,7 @@ MemoryPDP11.prototype = {
*/ */
writeWordBE: function writeWordBE(off, w, addr) { writeWordBE: function writeWordBE(off, w, addr) {
if (PDP11.MEMFAULT && (off & 0x1)) { if (PDP11.MEMFAULT && (off & 0x1)) {
this.bus.fault(addr, PDP11.ACCESS.WRITE_WORD); this.bus.fault(addr, PDP11.CPUERR.ODDADDR, PDP11.ACCESS.WRITE_WORD);
} }
this.dv.setUint16(off, w, true); this.dv.setUint16(off, w, true);
this.fDirty = true; this.fDirty = true;
@ -892,7 +894,7 @@ MemoryPDP11.prototype = {
*/ */
writeWordLE: function writeWordLE(off, w, addr) { writeWordLE: function writeWordLE(off, w, addr) {
if (PDP11.MEMFAULT && (off & 0x1)) { if (PDP11.MEMFAULT && (off & 0x1)) {
this.bus.fault(addr, PDP11.ACCESS.WRITE_WORD); this.bus.fault(addr, PDP11.CPUERR.ODDADDR, PDP11.ACCESS.WRITE_WORD);
} }
/* /*
* TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset

View file

@ -176,20 +176,20 @@ RAMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode)
{ {
if (nErrorCode) { if (nErrorCode) {
this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")"); this.notice("Unable to load RAM resource (error " + nErrorCode + ": " + sURL + ")");
return;
}
Component.addMachineResource(this.idMachine, sURL, sData);
var resource = web.parseMemoryResource(sURL, sData);
if (resource) {
this.abInit = resource.aBytes;
this.aSymbols = resource.aSymbols;
if (this.addrLoad == null) this.addrLoad = resource.addrLoad;
if (this.addrExec == null) this.addrExec = resource.addrExec;
} else {
this.sFilePath = null; this.sFilePath = null;
} }
else {
Component.addMachineResource(this.idMachine, sURL, sData);
var resource = web.parseMemoryResource(sURL, sData);
if (resource) {
this.abInit = resource.aBytes;
this.aSymbols = resource.aSymbols;
if (this.addrLoad == null) this.addrLoad = resource.addrLoad;
if (this.addrExec == null) this.addrExec = resource.addrExec;
} else {
this.sFilePath = null;
}
}
this.initRAM(); this.initRAM();
}; };

View file

@ -856,7 +856,6 @@ RL11.prototype.initDrive = function(drive, iDrive, data)
* The next group of properties are set by various controller command sequences. * The next group of properties are set by various controller command sequences.
*/ */
drive.bHead = 0; drive.bHead = 0;
drive.bCylinderSeek = 0;
drive.bCylinder = 0; drive.bCylinder = 0;
drive.bSector = 1; drive.bSector = 1;
drive.bSectorEnd = drive.nSectors; // aka EOT drive.bSectorEnd = drive.nSectors; // aka EOT
@ -1010,7 +1009,7 @@ RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add
while (nWords--) { while (nWords--) {
if (!sector) { if (!sector) {
sector = drive.disk.seek(iCylinder, iHead, iSector, true); sector = drive.disk.seek(iCylinder, iHead, iSector + 1);
if (!sector) { if (!sector) {
err = PDP11.RL11.ERRC.HNF; err = PDP11.RL11.ERRC.HNF;
break; break;
@ -1022,7 +1021,7 @@ RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add
err = PDP11.RL11.ERRC.HNF; err = PDP11.RL11.ERRC.HNF;
break; break;
} }
var data = this.bus.setWordDirect(this.cpu.mapUnibus(addr), b0 | (b1 << 8)); var data = this.bus.setWord(addr, b0 | (b1 << 8));
if (this.bus.checkFault()) { if (this.bus.checkFault()) {
err = PDP11.RL11.ERRC.NXM; err = PDP11.RL11.ERRC.NXM;
break; break;
@ -1065,14 +1064,14 @@ RL11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, ad
var sector = null, ibSector; var sector = null, ibSector;
while (nWords--) { while (nWords--) {
var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr)); var data = this.bus.getWord(addr);
if (this.bus.checkFault()) { if (this.bus.checkFault()) {
err = PDP11.RL11.ERRC.NXM; err = PDP11.RL11.ERRC.NXM;
break; break;
} }
addr += 2; addr += 2;
if (!sector) { if (!sector) {
sector = drive.disk.seek(iCylinder, iHead, iSector, true); sector = drive.disk.seek(iCylinder, iHead, iSector + 1, true);
if (!sector) { if (!sector) {
err = PDP11.RL11.ERRC.HNF; err = PDP11.RL11.ERRC.HNF;
break; break;

View file

@ -191,18 +191,18 @@ ROMPDP11.prototype.doneLoad = function(sURL, sData, nErrorCode)
{ {
if (nErrorCode) { if (nErrorCode) {
this.notice("Unable to load ROM resource (error " + nErrorCode + ": " + sURL + ")"); this.notice("Unable to load ROM resource (error " + nErrorCode + ": " + sURL + ")");
return;
}
Component.addMachineResource(this.idMachine, sURL, sData);
var resource = web.parseMemoryResource(sURL, sData);
if (resource) {
this.abInit = resource.aBytes;
this.aSymbols = resource.aSymbols;
} else {
this.sFilePath = null; this.sFilePath = null;
} }
else {
Component.addMachineResource(this.idMachine, sURL, sData);
var resource = web.parseMemoryResource(sURL, sData);
if (resource) {
this.abInit = resource.aBytes;
this.aSymbols = resource.aSymbols;
} else {
this.sFilePath = null;
}
}
this.initROM(); this.initROM();
}; };

View file

@ -31,287 +31,283 @@
http://pcjs.org/modules/pdp11/lib/computer.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 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016
*/ */
for(var k,ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var ga=da[ea];ga in ca||(ca[ga]={});ca=ca[ga]}var ha=da[da.length-1],ia=ca[ha],ka=ia?ia:function(a){return Math.log(a)/Math.LN2}; for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea<da.length-1;ea++){var fa=da[ea];fa in ca||(ca[fa]={});ca=ca[fa]}var ha=da[da.length-1],ia=ca[ha],ja=ia?ia:function(a){return Math.log(a)/Math.LN2};
ka!=ia&&null!=ka&&ba(ca,ha,{configurable:!0,writable:!0,value:ka});var la={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]}; ja!=ia&&null!=ja&&aa(ca,ha,{configurable:!0,writable:!0,value:ja});var la={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
function qa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&& function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ra(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function l(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} d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ra(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})} function sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ta(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ua(a,b){return-1!==a.indexOf(b,a.length-b.length)}var va={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})}
function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function xa(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ba=Date.now||function(){return+new Date};function Ca(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ba=Date.now||function(){return+new Date};function Ca(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function Ea(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== function Ea(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var m="",n;for(n in b)b.hasOwnProperty(n)&&(m&&(m+="&"),m+=n+"="+encodeURIComponent(b[n]));m=m.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(m)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
function Fa(a,b){var c,d={ea:null,ha:null,Ha:null,Ga:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ha=g.load;d.Ga=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]= function Fa(a,b){var c,d={da:null,ha:null,Ha:null,Ga:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ha=g.load;d.Ga=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c<e.length;c++)d.da[f++]=e[c]&255,d.da[f++]=e[c]>>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c<e.length;c++)d.da[f++]=
e[c]&255,d.ea[f++]=e[c]>>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ha=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ea=e)}return d} e[c]&255,d.da[f++]=e[c]>>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else d.da=g;d.ha=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.da=e)}return d}
function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ka(){if(null==Ia){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ia=a}return Ia} function Ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ha(a){var b=!1;window&&(b=window.confirm(a));return b}var Ia=null;function Ka(){if(null==Ia){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Ia=a}return Ia}
function Na(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Oa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()} function Na(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Oa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Qa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ra(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Sa={init:[],show:[],exit:[]},Ta=!1,Ua=!1,Va=!0;function Wa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Xa(a){Sa.init.push(a)} function Ra(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Sa={init:[],show:[],exit:[]},Ta=!1,Ua=!1,Va=!0;function Wa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Xa(a){Sa.init.push(a)}
function Ya(a){if(Va)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Za(a){!Va&&a?(Va=!0,Ta&&$a("init"),Ua&&$a("show")):Va=a}function $a(a){Sa[a]&&Ya(Sa[a])}Wa("onload",function(){Ta=!0;Ya(Sa.init)});Wa("onpageshow",function(){Ua=!0;Ya(Sa.show)});Wa(Pa("Opera")||Pa("iOS")?"onunload":"onbeforeunload",function(){Ya(Sa.exit)}); function Ya(a){if(Va)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Za(a){!Va&&a?(Va=!0,Ta&&$a("init"),Ua&&$a("show")):Va=a}function $a(a){Sa[a]&&Ya(Sa[a])}Wa("onload",function(){Ta=!0;Ya(Sa.init)});Wa("onpageshow",function(){Ua=!0;Ya(Sa.show)});Wa(Pa("Opera")||Pa("iOS")?"onunload":"onbeforeunload",function(){Ya(Sa.exit)});
function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.nc=b.comment;this.Qc=b;b=this.id.indexOf(".");0>b?this.cb=this.id:(this.Na=this.id.substr(0,b),this.cb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,Ua:!1,Wb:!1,ia:!1,error:!1};this.Ob=null;this.A.error=!1;this.G={};this.i=null;this.oa=d||0;t.push(this)}var ab=void 0,bb={}; function u(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.nc=b.comment;this.Qc=b;b=this.id.indexOf(".");0>b?this.cb=this.id:(this.Na=this.id.substr(0,b),this.cb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,Ua:!1,Xb:!1,ia:!1,error:!1};this.Nb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;v.push(this)}var ab=void 0,bb={};
if(window){ab||(ab=window.location.search.substr(1));for(var cb,jb=/\+/g,kb=/([^&=]+)=?([^&]*)/g;cb=kb.exec(ab);)bb[decodeURIComponent(cb[1].replace(jb," "))]=decodeURIComponent(cb[2].replace(jb," "))}function lb(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} if(window){ab||(ab=window.location.search.substr(1));for(var ib,jb=/\+/g,kb=/([^&=]+)=?([^&]*)/g;ib=kb.exec(ab);)bb[decodeURIComponent(ib[1].replace(jb," "))]=decodeURIComponent(ib[2].replace(jb," "))}function lb(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 w(a,b){b||(b=r);a.prototype=lb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var mb=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else mb={},t=[];function nb(a,b,c){mb[a]&&b&&(mb[a][b]=c)}function ob(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<t.length;b++){var d=t[b];a&&d.id.indexOf(a)||c.push(d)}return c} function z(a,b){b||(b=u);a.prototype=lb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var mb=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else mb={},v=[];function nb(a,b,c){mb[a]&&b&&(mb[a][b]=c)}function ob(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function pb(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 qb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<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 A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b} function pb(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}function qb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),m=0;m<h.length;m++)switch(g=h[m],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.sa(g.type,g.binding,f,g.value),m=h.length}}}} function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.sa(g.type,g.binding,f,g.value),l=h.length}}}}
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Oa=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Oa=this.G[b]=c,c.value="",this.j=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.O=function(a){this.j(a,this.cb)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.cb+": "+a)},O:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ea:function(){return this.A.ia=!0},Da:function(a,b){b&&(this.A.ia=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.oa;var c=a.i.oa&b;return!!b&&c===b||!!(c&a.i.Jc)}return!1} this.O=function(a){this.j(a,this.cb)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.cb+": "+a)},O:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ea:function(){return this.A.ia=!0},Da:function(a,b){b&&(this.A.ia=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.na;var c=a.i.na&b;return!!b&&c===b||!!(c&a.i.Jc)}return!1}
function rb(a,b){if(a.A.Wb)return a.A.Ua=!1,a.A.Wb=!1;if(a.A.error)return a.j(a.toString()+" error"),!1;a.A.Ua=b;return a.A.Ua}function sb(a,b){a.A.Ua&&(b?a.A.Wb=!0:void 0===b&&a.j(a.toString()+" busy"));return a.A.Ua}function G(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Ob,a.Ob=null,b&&b()))}function tb(a,b){b&&(a.A.ready?b():a.Ob=b);return a.A.ready}function ub(a){return a.A.error?(a.j(a.toString()+" error"),!0):!1}function vb(a,b){a.A.error=!0;a.O(b)} function rb(a,b){if(a.A.Xb)return a.A.Ua=!1,a.A.Xb=!1;if(a.A.error)return a.j(a.toString()+" error"),!1;a.A.Ua=b;return a.A.Ua}function sb(a,b){a.A.Ua&&(b?a.A.Xb=!0:void 0===b&&a.j(a.toString()+" busy"));return a.A.Ua}function H(a,b){a.A.error||(a.A.ready=!1!==b,a.A.ready&&(b=a.Nb,a.Nb=null,b&&b()))}function tb(a,b){b&&(a.A.ready?b():a.Nb=b);return a.A.ready}function ub(a){return a.A.error?(a.j(a.toString()+" error"),!0):!1}function vb(a,b){a.A.error=!0;a.O(b)}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b}); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,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 yb(a){r.call(this,"Panel",a,yb);this.f=0;this.A.kc=!0}w(yb);k=yb.prototype; var wb="undefined"!==typeof ArrayBuffer,xb={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 yb(a){u.call(this,"Panel",a,yb);this.f=0;this.A.lc=!0}z(yb);k=yb.prototype;
k.sa=function(a,b,c,d){if(this.B&&this.B.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.f++,!0;default:return"rled"==a?(this.G[b]=c,this.f++,!0):this.parent.sa.call(this,a,b,c,d)}};k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d};k.Ea=function(a,b){b||zb();return!0};k.Da=function(){return!0}; k.sa=function(a,b,c,d){if(this.B&&this.B.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.f++,!0;default:return"rled"==a?(this.G[b]=c,this.f++,!0):this.parent.sa.call(this,a,b,c,d)}};k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d};k.Ea=function(a,b){b||zb();return!0};k.Da=function(){return!0};
function Ab(a,b,c,d){if(a.G[b]){void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ja());var e=a.i&&a.i.$||8;c=!a.b.A.ga||a.A.kc?8==e?ra(c,d):l(c,d):"--------".substr(0,d||4);a.G[b].textContent!=c&&(a.G[b].textContent=c)}}function Bb(a,b,c,d){for(var e=0;e<d;e++){var f=a.G[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}} function Ab(a,b,c,d){if(a.G[b]){void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ja());var e=a.i&&a.i.Z||8;c=!a.b.A.ga||a.A.lc?8==e?ra(c,d):p(c,d):"--------".substr(0,d||4);a.G[b].textContent!=c&&(a.G[b].textContent=c)}}function Bb(a,b,c,d){for(var e=0;e<d;e++){var f=a.G[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
k.da=function(a){if(this.f&&(a||!this.b.A.ga||this.A.kc)){for(a=0;a<this.b.u.length;a++)Ab(this,"R"+a,this.b.u[a]);a=Cb(this.b);Ab(this,"PS",a);Ab(this,"NF",a&8?1:0,1);Ab(this,"ZF",a&4?1:0,1);Ab(this,"VF",a&2?1:0,1);Ab(this,"CF",a&1?1:0,1);Bb(this,"D",this.b.u[0],16);Bb(this,"A",this.b.u[7],22)}};function zb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=pb(e.id);f||(a=!0,f=new yb(e));C(f,d);a&&G(f)}}Xa(zb); k.ca=function(a){if(this.f&&(a||!this.b.A.ga||this.A.lc)){for(a=0;a<this.b.u.length;a++)Ab(this,"R"+a,this.b.u[a]);a=Cb(this.b);Ab(this,"PS",a);Ab(this,"NF",a&8?1:0,1);Ab(this,"ZF",a&4?1:0,1);Ab(this,"VF",a&2?1:0,1);Ab(this,"CF",a&1?1:0,1);Bb(this,"D",this.b.u[0],16);Bb(this,"A",this.b.u[7],22)}};function zb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=pb(e.id);f||(a=!0,f=new yb(e));C(f,d);a&&H(f)}}Xa(zb);
function Db(a,b,c){r.call(this,"Bus",a,Db,64);this.b=b;this.i=c;this.N=a.busWidth||16;this.v=0;this.L=[];this.I=null;this.J=Math.pow(2,this.N);this.g=this.J-1|0;this.xa=Rb;this.la=Math.log2(this.xa);this.K=this.xa>>2;this.w=this.xa-1;this.F=this.J/this.xa|0;this.Ta=[];this.f=0;this.B=!1;this.C=[];this.Gc=[Sb,Tb,Ub,Vb];a=new I(this);Wb(a,this.i);this.W=Array(this.F);for(b=0;b<this.F;b++)this.W[b]=a;G(this)}w(Db);var Rb=8192,Xb=Rb-1; function Db(a,b,c){u.call(this,"Bus",a,Db,64);this.b=b;this.i=c;this.N=a.busWidth||16;this.v=0;this.L=[];this.I=null;this.J=Math.pow(2,this.N);this.g=this.J-1|0;this.xa=Rb;this.ka=Math.log2(this.xa);this.K=this.xa>>2;this.w=this.xa-1;this.F=this.J/this.xa|0;this.Ta=[];this.f=0;this.B=!1;this.C=[];this.Gc=[Sb,Tb,Ub,Vb];a=new I(this);Wb(a,this.i);this.W=Array(this.F);for(b=0;b<this.F;b++)this.W[b]=a;H(this)}z(Db);var Rb=8192,Xb=Rb-1;
function Sb(a,b){var c=-1,d=this.controller,e=d.Ta[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.Ta[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Yb(d,b,!0);this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} function Sb(a,b){var c=-1,d=this.controller,e=d.Ta[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.Ta[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;K(d,b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
function Tb(a,b,c){var d=!1,e=this.controller,f=e.Ta[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.Ta[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&&F(this.i,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Yb(e,c,!0,b),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} function Tb(a,b,c){var d=!1,e=this.controller,f=e.Ta[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.Ta[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&&F(this.i,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(K(e,c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
function Ub(a,b){var c=-1,d=this.controller;(a=d.Ta[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&F(this.i,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Yb(d,b,!1);this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} function Ub(a,b){var c=-1,d=this.controller;(a=d.Ta[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&F(this.i,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;K(d,b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
function Vb(a,b,c){var d=!1,e=this.controller;if(a=e.Ta[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&&F(this.i,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Yb(e,c,!1,b),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} function Vb(a,b,c){var d=!1,e=this.controller;if(a=e.Ta[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&&F(this.i,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(K(e,c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
function Zb(a,b){if(b!=a.v){var c;a.v&&(c=(1<<a.v)-Rb,$b(a,c,Rb,a.L),a.v=0);b&&(a.v=b,c=(1<<b)-Rb,a.L=ac(a,c,Rb),a.I?$b(a,c,Rb,a.I):(bc(a,c,Rb,cc,a),a.I=ac(a,c,Rb)))}}k=Db.prototype;k.reset=function(){for(var a=0;a<this.C.length;a++)this.C[a]();Zb(this,16)};function Yb(a,b,c,d){a.i&&F(a.i,536870912)&&(E(a.i,"warning: unknown I/O access ("+J(a.i,b)+","+J(a.i,d,c?1:2)+")",!0,!0),dc(a.i));a.f||(a.b.Z|=16,a.b.ka(4,b));return 0}k.Ea=function(a,b){b||this.reset();return!0}; function Yb(a,b){if(b!=a.v){var c;a.v&&(c=(1<<a.v)-Rb,Zb(a,c,Rb,a.L),a.v=0);b&&(a.v=b,c=(1<<b)-Rb,a.L=$b(a,c,Rb),a.I?Zb(a,c,Rb,a.I):(ac(a,c,Rb,bc,a),a.I=$b(a,c,Rb)))}}k=Db.prototype;k.reset=function(){for(var a=0;a<this.C.length;a++)this.C[a]();Yb(this,16)};k.Ea=function(a,b){b||this.reset();return!0};
function bc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.la;0<g&&h<a.W.length;){var m=a.W[h],n=h*a.xa,p=a.xa-(f-n);p>g&&(p=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.D)return m.Jb+=m.D-f,m.D=f,!0;if(f>=m.D+m.Jb){p=m.size-(f-n);p>g&&(p=g);m.Jb=f-m.D+p;f=n+a.xa;g-=p;h++;continue}}return ec(1,f,g)}f=new I(a,f,p,a.xa,d,e);Wb(f,a.i,m);a.W[h++]=f;f=n+a.xa;g-=p}if(0>=g){c/=1024;var u;e="";u?10<u&&(u=10):u=c&-65536?10:5;if(null==c||isNaN(c))for(;0<u--;)e="?"+e;else for(;0<u--;)e=String.fromCharCode(c%10+48)+e,c/= function ac(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ka;0<g&&h<a.W.length;){var l=a.W[h],m=h*a.xa,n=a.xa-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.D)return l.Hb+=l.D-f,l.D=f,!0;if(f>=l.D+l.Hb){n=l.size-(f-m);n>g&&(n=g);l.Hb=f-l.D+n;f=m+a.xa;g-=n;h++;continue}}return cc(1,f,g)}f=new I(a,f,n,a.xa,d,e);Wb(f,a.i,l);a.W[h++]=f;f=m+a.xa;g-=n}if(0>=g){c/=1024;var r;e="";r?10<r&&(r=10):r=c&-65536?10:5;if(null==c||isNaN(c))for(;0<r--;)e="?"+e;else for(;0<r--;)e=String.fromCharCode(c%10+48)+e,c/=
10;a.status(e+"Kb "+fc[d]+" at "+ra(b));return!0}return ec(2,b,c)}function ac(a,b,c){var d=[];for(b>>>=a.la;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.xa;return d}function $b(a,b,c,d){var e=0;for(b>>>=a.la;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.xa}}k.Db=function(a){return this.W[(a&this.g)>>>this.la].Rb(a&this.w,a)};k.Pb=function(a){this.B=!1;this.f++;a=this.W[(a&this.g)>>>this.la].bc(a&this.w,a);this.f--;return a}; 10;a.status(e+"Kb "+dc[d]+" at "+ra(b));return!0}return cc(2,b,c)}function $b(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.xa;return d}function Zb(a,b,c,d){var e=0;for(b>>>=a.ka;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.xa}}k.Bb=function(a){3932160<=a&&(a=ec(this.b,a));return this.W[(a&this.g)>>>this.ka].Rb(a&this.w,a)};k.Pb=function(a){this.B=!1;this.f++;a=this.W[(a&this.g)>>>this.ka].cc(a&this.w,a);this.f--;return a};
k.pa=function(a){return this.W[(a&this.g)>>>this.la].ra(a&this.w,a)};k.ib=function(a){var b=a&this.w,c=(a&this.g)>>>this.la;this.B=!1;this.f++;a=this.W[c].cc(b,a);this.f--;return a};k.Sb=function(a,b){this.W[(a&this.g)>>>this.la].Ub(a&this.w,b&255,a)};k.kb=function(a,b){this.B=!1;this.f++;this.W[(a&this.g)>>>this.la].Vb(a&this.w,b&255,a);this.f--};k.mb=function(a,b){this.W[(a&this.g)>>>this.la].Kb(a&this.w,b&65535,a)}; k.oa=function(a){3932160<=a&&(a=ec(this.b,a));return this.W[(a&this.g)>>>this.ka].ra(a&this.w,a)};k.pb=function(a){var b=a&this.w,c=(a&this.g)>>>this.ka;this.B=!1;this.f++;a=this.W[c].dc(b,a);this.f--;return a};k.Sb=function(a,b){3932160<=a&&(a=ec(this.b,a));this.W[(a&this.g)>>>this.ka].Vb(a&this.w,b&255,a)};k.jb=function(a,b){this.B=!1;this.f++;this.W[(a&this.g)>>>this.ka].Wb(a&this.w,b&255,a);this.f--};
k.Ib=function(a,b){var c=a&this.w,d=(a&this.g)>>>this.la;this.B=!1;this.f++;this.W[d].gc(c,b&65535,a);this.f--};function gc(a){for(var b=0,c=[],d=0;d<a.F;d++){var e=a.W[d];if(e.Pa||e.Mc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,m=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;m[h++]=p-g;m[h++]=n;g=p}m.length<e.length&&(e=m)}c[f]=e}}return c} k.ab=function(a,b){3932160<=a&&(a=ec(this.b,a));this.W[(a&this.g)>>>this.ka].Ib(a&this.w,b&65535,a)};k.Tb=function(a,b){var c=a&this.w,d=(a&this.g)>>>this.ka;this.B=!1;this.f++;this.W[d].hc(c,b&65535,a);this.f--};function fc(a){for(var b=0,c=[],d=0;d<a.F;d++){var e=a.W[d];if(e.Pa||e.Mc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}
function hc(a,b,c,d,e,f,g,h){for(;b<=c;b+=2){var m=b&Xb;void 0!==a.Ta[m]?q("I/O address already registered: "+l(b,8,!0)):a.Ta[m]=[d,e,f,g,h||"unknown",!1]}} function gc(a,b,c,d,e,f,g,h){for(;b<=c;b+=2){var l=b&Xb;void 0!==a.Ta[l]?q("I/O address already registered: "+p(b,8,!0)):a.Ta[l]=[d,e,f,g,h||"unknown",!1]}}
function ic(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.b.qb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,n=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)),!h&&n&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));hc(a,e,e,g,h,m,n,f[4])}}}function jc(a,b){a.C.push(b)} function hc(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.qb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null,n=f[5]||1;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var r=f[4],t=0;t<n;t++,e+=2)r&&1<n&&(r=f[4]+t),gc(a,e,e,g,h,l,m,r)}}}function ic(a,b){a.C.push(b)}
function kc(a,b,c){a.f||(a.i&&F(a.i,64)&&(E(a.i,"memory fault ("+c+") on address "+J(a.i,b),!0,!0),dc(a.i)),a.b.ka(4,b));a.B=!0}function lc(a){var b=a.B;a.B=!1;return b}function ec(a,b,c){q("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Ce:0,Qb:20,Md:0};this.f={fa:0,fc:-1}}w(K);k=K.prototype; function K(a,b,c,d){a.B=!0;a.f||(a.i&&F(a.i,64)&&(E(a.i,"memory fault ("+d+") on address "+J(a.i,b),!0,!0),jc(a.i)),c&&(a.b.fa|=c),a.b.pa(4,b))}function kc(a){var b=a.B;a.B=!1;return b}function cc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function L(a){u.call(this,"Device",a,L,256);this.g={data:0,De:0,Qb:20,Md:0};this.f={ea:0,gc:-1}}z(L);k=L.prototype;
k.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.fc=mc(c,function(){e.f.Va|=128;e.f.Va&64&&(nc(e.b,e.f.Nd),oc(e.b,e.f.fc,1E3/60))});this.f.Nd=pc(64,6);ic(b,this,L);jc(b,this.reset.bind(this));G(this)};k.reset=function(){this.g.Qb=this.g.Qb&-120|20;this.f.Va=0};k.cd=function(){var a=this.f.Va;this.f.Va&=-129;return a};k.Xd=function(a){this.f.Va=a;a&64&&oc(this.b,this.f.fc,1E3/60);this.f.Va=a&-129};k.Vc=function(a){return(a?this.g.Md:this.g.data)&65535}; k.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.gc=lc(c,function(){e.f.Va|=128;e.f.Va&64&&(mc(e.b,e.f.Nd),nc(e.b,e.f.gc,1E3/60))});this.f.Nd=oc(64,6);hc(b,this,M);ic(b,this.reset.bind(this));H(this)};k.reset=function(){this.g.Qb=this.g.Qb&-120|20;this.f.Va=0};k.bd=function(){var a=this.f.Va;this.f.Va&=-129;return a};k.Xd=function(a){this.f.Va=a;a&64&&nc(this.b,this.f.gc,1E3/60);this.f.Va=a&-129};k.Uc=function(a){return(a?this.g.Md:this.g.data)&65535};
k.Pd=function(a){this.g.data=a};k.ed=function(){var a=this.b;return a.C&62337|a.Ja<<5|a.Ka<<1};k.Zd=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ja=a>>5&3;b.Ka=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Wa!=c&&(b.Wa=c,qc(b))}rc(this)};k.fd=function(){var a=this.b.Ya;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.gd=function(){return this.b.Hb};k.hd=function(){return this.b.Za}; k.Pd=function(a){this.g.data=a};k.dd=function(){var a=this.b;return a.C&62337|a.Ja<<5|a.Ka<<1};k.Zd=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ja=a>>5&3;b.Ka=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Wa!=c&&(b.Wa=c,pc(b))}qc(this)};k.ed=function(){var a=this.b.Ya;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.fd=function(){return this.b.Fb};k.gd=function(){return this.b.ib};k.$d=function(a){var b=this.b;1170>b.qb&&(a&=-49);b.ib!=a&&(b.ib=a,b.Mb=a&16?4194303:262143,pc(b));qc(this)};
k.$d=function(a){var b=this.b;1170>b.qb&&(a&=-49);b.Za!=a&&(b.Za=a,a&16?(b.Bb=4194303,b.eb=3915776):(b.Bb=262143,b.eb=253952),qc(b));rc(this)};function rc(a){a.g.Qb=a.g.Qb&-8|(a.b.Wa?a.b.Za&16?1:2:4)}k.Bd=function(a){return this.b.V[1][a>>1&7]};k.se=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.zd=function(a){return this.b.V[1][(a>>1&7)+8]};k.qe=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Ad=function(a){return this.b.wa[1][a>>1&7]}; function qc(a){a.g.Qb=a.g.Qb&-8|(a.b.Wa?a.b.ib&16?1:2:4)}k.Hd=function(a){a=a>>1&63;var b=this.b.Gb[a>>1];return a&1?b>>16:b&65535};k.ze=function(a,b){b=b>>1&63;var c=b>>1;this.b.Gb[c]=b&1?this.b.Gb[c]&65535|(a&63)<<16:this.b.Gb[c]&-65536|a&65534};k.Ad=function(a){return this.b.V[1][a>>1&7]};k.se=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.yd=function(a){return this.b.V[1][(a>>1&7)+8]};k.qe=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.zd=function(a){return this.b.wa[1][a>>1&7]};
k.re=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.yd=function(a){return this.b.wa[1][(a>>1&7)+8]};k.pe=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.bd=function(a){return this.b.V[0][a>>1&7]};k.Wd=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.$c=function(a){return this.b.V[0][(a>>1&7)+8]};k.Ud=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.ad=function(a){return this.b.wa[0][a>>1&7]};k.Vd=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.V[0][b]&=65295}; k.re=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.xd=function(a){return this.b.wa[1][(a>>1&7)+8]};k.pe=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.V[1][b]&=65295};k.ad=function(a){return this.b.V[0][a>>1&7]};k.Wd=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.Zc=function(a){return this.b.V[0][(a>>1&7)+8]};k.Ud=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.$c=function(a){return this.b.wa[0][a>>1&7]};k.Vd=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};
k.Zc=function(a){return this.b.wa[0][(a>>1&7)+8]};k.Td=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};k.Hd=function(a){return this.b.V[3][a>>1&7]};k.ye=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Fd=function(a){return this.b.V[3][(a>>1&7)+8]};k.we=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Gd=function(a){return this.b.wa[3][a>>1&7]};k.xe=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Ed=function(a){return this.b.wa[3][(a>>1&7)+8]}; k.Yc=function(a){return this.b.wa[0][(a>>1&7)+8]};k.Td=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.V[0][b]&=65295};k.Gd=function(a){return this.b.V[3][a>>1&7]};k.ye=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Ed=function(a){return this.b.V[3][(a>>1&7)+8]};k.we=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Fd=function(a){return this.b.wa[3][a>>1&7]};k.xe=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.Dd=function(a){return this.b.wa[3][(a>>1&7)+8]};
k.ve=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.ub=function(a){a&=7;return this.b.M&2048?this.b.Ra[a]:this.b.u[a]};k.yb=function(a,b){b&=7;this.b.M&2048?this.b.Ra[b]=a:this.b.u[b]=a};k.nd=function(){return this.b.M&49152?this.b.Fa[0]:this.b.u[6]};k.ee=function(a){this.b.M&49152?this.b.Fa[0]=a:this.b.u[6]=a};k.qd=function(){return this.b.u[7]};k.he=function(a){this.b.u[7]=a};k.vb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Ra[a]}; k.ve=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.V[3][b]&=65295};k.ub=function(a){a&=7;return this.b.M&2048?this.b.Ra[a]:this.b.u[a]};k.yb=function(a,b){b&=7;this.b.M&2048?this.b.Ra[b]=a:this.b.u[b]=a};k.md=function(){return this.b.M&49152?this.b.Fa[0]:this.b.u[6]};k.ee=function(a){this.b.M&49152?this.b.Fa[0]=a:this.b.u[6]=a};k.pd=function(){return this.b.u[7]};k.he=function(a){this.b.u[7]=a};k.vb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Ra[a]};
k.zb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Ra[b]=a};k.od=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Fa[1]};k.fe=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Fa[1]=a};k.pd=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Fa[3]};k.ge=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Fa[3]=a};k.Xc=function(a){return this.b.zc[a-65504>>1]};k.Rd=function(a,b){this.b.zc[b-65504>>1]=a};k.wc=function(a){return 65520==a?61183:0};k.Dc=function(){}; k.zb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Ra[b]=a};k.nd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Fa[1]};k.fe=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Fa[1]=a};k.od=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Fa[3]};k.ge=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Fa[3]=a};k.Wc=function(a){return this.b.zc[a-65504>>1]};k.Rd=function(a,b){this.b.zc[b-65504>>1]=a};k.wc=function(a){return 65520==a?61183:0};k.Dc=function(){};
k.Dd=function(){return 1};k.ue=function(){};k.Wc=function(){return this.b.Z};k.Qd=function(){this.b.Z=0};k.dd=function(){return this.b.yc};k.Yd=function(a,b){b&1||(a&=255);this.b.yc=a};k.jd=function(a){return a?this.b.ec:0};k.ae=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ec=a;b.H|=2};k.Cd=function(a){return a?this.b.$a&65280:0};k.te=function(a){this.b.$a=a|255};k.md=function(){return Cb(this.b)};k.de=function(a){sc(this.b,a&-1809|Cb(this.b)&1808);this.b.H|=128}; k.Cd=function(){return 1};k.ue=function(){};k.Vc=function(){return this.b.fa};k.Qd=function(){this.b.fa=0};k.cd=function(){return this.b.yc};k.Yd=function(a,b){b&1||(a&=255);this.b.yc=a};k.hd=function(a){return a?this.b.fc:0};k.ae=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.fc=a;b.H|=2};k.Bd=function(a){return a?this.b.Za&65280:0};k.te=function(a){this.b.Za=a|255};k.ld=function(){return Cb(this.b)};k.de=function(a){rc(this.b,a&-1809|Cb(this.b)&1808);this.b.H|=128};
k.Cc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; k.Cc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)};
var M={},L=(M[62592]=[null,null,K.prototype.Bd,K.prototype.se,"SISDR",1145],M[62608]=[null,null,K.prototype.zd,K.prototype.qe,"SDSDR",1145],M[62624]=[null,null,K.prototype.Ad,K.prototype.re,"SISAR",1145],M[62640]=[null,null,K.prototype.yd,K.prototype.pe,"SDSAR",1145],M[62656]=[null,null,K.prototype.bd,K.prototype.Wd,"KISDR",1145],M[62672]=[null,null,K.prototype.$c,K.prototype.Ud,"KDSDR",1145],M[62688]=[null,null,K.prototype.ad,K.prototype.Vd,"KISAR",1145],M[62704]=[null,null,K.prototype.Zc,K.prototype.Td, var N={},M=(N[61568]=[null,null,L.prototype.Hd,L.prototype.ze,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Ad,L.prototype.se,"SISDR",8,1145],N[62608]=[null,null,L.prototype.yd,L.prototype.qe,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.zd,L.prototype.re,"SISAR",8,1145],N[62640]=[null,null,L.prototype.xd,L.prototype.pe,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.ad,L.prototype.Wd,"KISDR",8,1145],N[62672]=[null,null,L.prototype.Zc,L.prototype.Ud,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.$c,
"KDSAR",1145],M[62798]=[null,null,K.prototype.hd,K.prototype.$d,"MMR3",1145],M[65382]=[null,null,K.prototype.cd,K.prototype.Xd,"LKS"],M[65400]=[null,null,K.prototype.Vc,K.prototype.Pd,"CNSL"],M[65402]=[null,null,K.prototype.ed,K.prototype.Zd,"MMR0",1145],M[65404]=[null,null,K.prototype.fd,K.prototype.Cc,"MMR1",1145],M[65406]=[null,null,K.prototype.gd,K.prototype.Cc,"MMR2",1145],M[65408]=[null,null,K.prototype.Hd,K.prototype.ye,"UISDR",1145],M[65424]=[null,null,K.prototype.Fd,K.prototype.we,"UDSDR", L.prototype.Vd,"KISAR",8,1145],N[62704]=[null,null,L.prototype.Yc,L.prototype.Td,"KDSAR",8,1145],N[62798]=[null,null,L.prototype.gd,L.prototype.$d,"MMR3",1,1145],N[65382]=[null,null,L.prototype.bd,L.prototype.Xd,"LKS"],N[65400]=[null,null,L.prototype.Uc,L.prototype.Pd,"CNSL"],N[65402]=[null,null,L.prototype.dd,L.prototype.Zd,"MMR0",1,1145],N[65404]=[null,null,L.prototype.ed,L.prototype.Cc,"MMR1",1,1145],N[65406]=[null,null,L.prototype.fd,L.prototype.Cc,"MMR2",1,1145],N[65408]=[null,null,L.prototype.Gd,
1145],M[65440]=[null,null,K.prototype.Gd,K.prototype.xe,"UISAR",1145],M[65456]=[null,null,K.prototype.Ed,K.prototype.ve,"UDSAR",1145],M[65472]=[null,null,K.prototype.ub,K.prototype.yb,"R0SET0"],M[65473]=[null,null,K.prototype.ub,K.prototype.yb,"R1SET0"],M[65474]=[null,null,K.prototype.ub,K.prototype.yb,"R2SET0"],M[65475]=[null,null,K.prototype.ub,K.prototype.yb,"R3SET0"],M[65476]=[null,null,K.prototype.ub,K.prototype.yb,"R4SET0"],M[65477]=[null,null,K.prototype.ub,K.prototype.yb,"R5SET0"],M[65478]= L.prototype.ye,"UISDR",8,1145],N[65424]=[null,null,L.prototype.Ed,L.prototype.we,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.Fd,L.prototype.xe,"UISAR",8,1145],N[65456]=[null,null,L.prototype.Dd,L.prototype.ve,"UDSAR",8,1145],N[65472]=[null,null,L.prototype.ub,L.prototype.yb,"R0SET0"],N[65473]=[null,null,L.prototype.ub,L.prototype.yb,"R1SET0"],N[65474]=[null,null,L.prototype.ub,L.prototype.yb,"R2SET0"],N[65475]=[null,null,L.prototype.ub,L.prototype.yb,"R3SET0"],N[65476]=[null,null,L.prototype.ub,
[null,null,K.prototype.nd,K.prototype.ee,"R6KERNEL"],M[65479]=[null,null,K.prototype.qd,K.prototype.he,"R7KERNEL"],M[65480]=[null,null,K.prototype.vb,K.prototype.zb,"R0SET1",1145],M[65481]=[null,null,K.prototype.vb,K.prototype.zb,"R1SET1",1145],M[65482]=[null,null,K.prototype.vb,K.prototype.zb,"R2SET1",1145],M[65483]=[null,null,K.prototype.vb,K.prototype.zb,"R3SET1",1145],M[65484]=[null,null,K.prototype.vb,K.prototype.zb,"R4SET1",1145],M[65485]=[null,null,K.prototype.vb,K.prototype.zb,"R5SET1",1145], L.prototype.yb,"R4SET0"],N[65477]=[null,null,L.prototype.ub,L.prototype.yb,"R5SET0"],N[65478]=[null,null,L.prototype.md,L.prototype.ee,"R6KERNEL"],N[65479]=[null,null,L.prototype.pd,L.prototype.he,"R7KERNEL"],N[65480]=[null,null,L.prototype.vb,L.prototype.zb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.vb,L.prototype.zb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.vb,L.prototype.zb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.vb,L.prototype.zb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.vb,
M[65486]=[null,null,K.prototype.od,K.prototype.fe,"R6SUPER",1145],M[65487]=[null,null,K.prototype.pd,K.prototype.ge,"R6USER",1145],M[65504]=[null,null,K.prototype.Xc,K.prototype.Rd,"CTRL",1170],M[65520]=[null,null,K.prototype.wc,K.prototype.Dc,"LSIZE",1170],M[65522]=[null,null,K.prototype.wc,K.prototype.Dc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Dd,K.prototype.ue,"SYSID",1170],M[65526]=[null,null,K.prototype.Wc,K.prototype.Qd,"CPUERR",1170],M[65528]=[null,null,K.prototype.dd,K.prototype.Yd, L.prototype.zb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.vb,L.prototype.zb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.nd,L.prototype.fe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.od,L.prototype.ge,"R6USER",1,1145],N[65504]=[null,null,L.prototype.Wc,L.prototype.Rd,"CTRL",1,1170],N[65520]=[null,null,L.prototype.wc,L.prototype.Dc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.wc,L.prototype.Dc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Cd,L.prototype.ue,"SYSID",1,1170],N[65526]=
"MB",1170],M[65530]=[null,null,K.prototype.jd,K.prototype.ae,"PIR"],M[65532]=[null,null,K.prototype.Cd,K.prototype.te,"SL"],M[65534]=[null,null,K.prototype.md,K.prototype.de,"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]; [null,null,L.prototype.Vc,L.prototype.Qd,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.cd,L.prototype.Yd,"MB",1,1170],N[65530]=[null,null,L.prototype.hd,L.prototype.ae,"PIR"],N[65532]=[null,null,L.prototype.Bd,L.prototype.te,"SL"],N[65534]=[null,null,L.prototype.ld,L.prototype.de,"PSW"],N);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];
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]; Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new sc(c);C(c,d);break;case "rl11":c=new O(c),C(c,d)}}});var tc;if(wb){var uc=new ArrayBuffer(2);(new DataView(uc)).setUint16(0,256,!0);tc=256===(new Uint16Array(uc))[0]}else tc=!1;var vc=tc;
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]; function I(a,b,c,d,e,f){this.w=a;this.id=Fc+=2;this.b=null;this.D=b;this.Hb=c;this.size=d||0;this.type=e||Gc;this.f=e==Hc;this.controller=null;Wb(this);this.Pa=this.Mc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Ic(this,f.Gc);else if(wb)this.C=new ArrayBuffer(this.size),this.F=new DataView(this.C,0,this.size),this.G=new Uint8Array(this.C,0,this.size),this.J=new Uint16Array(this.C,0,this.size>>1),this.b=new Int32Array(this.C,0,this.size>>2),Ic(this,vc?Jc:Kc);else{a=this.b=Array(this.size>>
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]; 2);for(f=0;f<a.length;f++)a[f]=0;Ic(this,Lc)}else Ic(this)}var Gc=0,Hc=2,bc=4,dc=["NONE","RAM","ROM","VID","H/W"],Fc=0;
Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);C(c,d);break;case "pc11":c=new tc(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var uc;if(wb){var vc=new ArrayBuffer(2);(new DataView(vc)).setUint16(0,256,!0);uc=256===(new Uint16Array(vc))[0]}else uc=!1;var Fc=uc; I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(wb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.F.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(wb)for(b=0;b<a.length;b++)this.F.setInt32(b<<2,a[b],!0);else this.b=a;return this.Pa=!0}return!1},gb:function(a,b){b?this.B++||Mc(this,Nc,!1):this.g++||Oc(this,Nc,!1)},K:function(a,b){this.i&&F(this.i,128)&&(E(this.i,
function I(a,b,c,d,e,f){this.w=a;this.id=Gc+=2;this.b=null;this.D=b;this.Jb=c;this.size=d||0;this.type=e||Hc;this.f=e==Ic;this.controller=null;Wb(this);this.Pa=this.Mc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],Jc(this,f.Gc);else if(wb)this.C=new ArrayBuffer(this.size),this.F=new DataView(this.C,0,this.size),this.G=new Uint8Array(this.C,0,this.size),this.J=new Uint16Array(this.C,0,this.size>>1),this.b=new Int32Array(this.C,0,this.size>>2),Jc(this,Fc?Kc:Lc);else{a=this.b=Array(this.size>> "attempt to read invalid address "+J(this.i,b),!0),jc(this.i));K(this.w,b,32,2);return 255},v:function(a,b,c){this.i&&F(this.i,128)&&(E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0),jc(this.i));K(this.w,c,32,4)},L:function(a,b){return this.Rb(a++,b++)|this.Rb(a,b)<<8},I:function(a,b,c){this.Vb(a++,b&255,c++);this.Vb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ba:function(a,b){a&1&&K(this.w,b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>
2);for(f=0;f<a.length;f++)a[f]=0;Jc(this,Mc)}else Jc(this)}var Hc=0,Ic=2,cc=4,fc=["NONE","RAM","ROM","VID","H/W"],Gc=0; a?c&65535:c&255|(this.b[b+1]&255)<<8},va:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Pa=!0},Ka:function(a,b,c){a&1&&K(this.w,c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Pa=!0},P:function(a,b){if(this.i&&null!=this.D){var c=this.i;Pc(c,this.D+a,1,c.L)&&c.ja(!0)}return this.cc(a,b)},Y:function(a,b){if(this.i&&null!=this.D){var c=this.i;Pc(c,this.D+a,2,c.L)&&c.ja(!0)}return this.dc(a,
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(wb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.F.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(wb)for(b=0;b<a.length;b++)this.F.setInt32(b<<2,a[b],!0);else this.b=a;return this.Pa=!0}return!1},hb:function(a,b){b?this.B++||Nc(this,Oc,!1):this.g++||Pc(this,Oc,!1)},K:function(a,b){this.i&&F(this.i,128)&&(E(this.i, b)},ma:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Pc(d,this.D+a,1,d.C)&&d.ja(!0)}this.f?this.v(a,b,c):this.Wb(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Pc(d,this.D+a,2,d.C)&&d.ja(!0)}this.f?this.v(a,b,c):this.hc(a,b,c)},N:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Na:function(a,b){a&1&&K(this.w,b,64,2);return this.F.getUint16(a,!0)},Z:function(a,b){a&1&&K(this.w,
"attempt to read invalid address "+J(this.i,b),!0),dc(this.i));kc(this.w,b,2);return 255},v:function(a,b,c){this.i&&F(this.i,128)&&(E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0),dc(this.i));kc(this.w,c,4)},L:function(a,b){return this.Rb(a++,b++)|this.Rb(a,b)<<8},I:function(a,b,c){this.Ub(a++,b&255,c++);this.Ub(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&kc(this.w,b,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535: b,64,2);a=this.J[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},la:function(a,b){this.G[a]=b;this.Pa=!0},ua:function(a,b,c){this.G[a]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},cb:function(a,b,c){a&1&&K(this.w,c,64,4);this.F.setUint16(a,b,!0);this.Pa=!0},Ja:function(a,b,c){a&1&&K(this.w,c,64,4);this.J[a>>1]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+
c&255|(this.b[b+1]&255)<<8},va:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Pa=!0},Ka:function(a,b,c){a&1&&kc(this.w,c,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Pa=!0},P:function(a,b){if(this.i&&null!=this.D){var c=this.i;Qc(c,this.D+a,1,c.L)&&c.ja(!0)}return this.bc(a,b)},Y:function(a,b){if(this.i&&null!=this.D){var c=this.i;Qc(c,this.D+a,2,c.L)&&c.ja(!0)}return this.cc(a, J(this.i,b)+")",!0)}};function Wb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Oc(a,Nc,!1),(a.B=c.B)&&Mc(a,Nc,!1))}function Qc(a,b){b?--a.B||(a.Vb=a.f?a.v:a.Wb,a.Ib=a.f?a.I:a.hc):--a.g||(a.Rb=a.cc,a.ra=a.dc)}function Mc(a,b,c){c&&a.B||(a.Vb=!a.f&&b[1]||a.v,a.Ib=!a.f&&b[3]||a.I);if(c||void 0===c)a.Wb=b[1]||a.v,a.hc=b[3]||a.I}function Oc(a,b,c){c&&a.g||(a.Rb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.cc=b[0]||a.K,a.dc=b[2]||a.L}function Ic(a,b){b||(b=Rc);Oc(a,b,void 0);Mc(a,b,void 0)}
b)},na:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Qc(d,this.D+a,1,d.C)&&d.ja(!0)}this.f?this.v(a,b,c):this.Vb(a,b,c)},za:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Qc(d,this.D+a,2,d.C)&&d.ja(!0)}this.f?this.v(a,b,c):this.gc(a,b,c)},N:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Na:function(a,b){a&1&&kc(this.w,b,2);return this.F.getUint16(a,!0)},$:function(a,b){a&1&&kc(this.w, var Rc=[],Lc=[I.prototype.S,I.prototype.va,I.prototype.ba,I.prototype.Ka],Nc=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.za];if(wb)var Kc=[I.prototype.N,I.prototype.la,I.prototype.Na,I.prototype.cb],Jc=[I.prototype.R,I.prototype.ua,I.prototype.Z,I.prototype.Ja];
b,2);a=this.J[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ma:function(a,b){this.G[a]=b;this.Pa=!0},ua:function(a,b,c){this.G[a]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},cb:function(a,b,c){a&1&&kc(this.w,c,4);this.F.setUint16(a,b,!0);this.Pa=!0},Ja:function(a,b,c){a&1&&kc(this.w,c,4);this.J[a>>1]=b;this.Pa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, function Sc(a,b){u.call(this,"CPU",a,Sc,1);var c=a.multiplier||1;this.fb=a.cycles||b;this.Xa=c;this.nb=Math.round(this.fb/1E4)/100;this.hb=this.nb*this.Xa;this.A.ga=!1;this.A.Ub=!1;this.A.mb=a.autoStart;this.A.ob=!1;this.Cb=this.ma=0;this.Db=a.csStart;this.rb=a.csInterval;this.sb=a.csStop;this.K=[];this.tc=this.Ld.bind(this);H(this)}z(Sc);var Tc=["power","reset"];k=Sc.prototype;
b)+")",!0)}};function Wb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Pc(a,Oc,!1),(a.B=c.B)&&Nc(a,Oc,!1))}function Rc(a,b){b?--a.B||(a.Ub=a.f?a.v:a.Vb,a.Kb=a.f?a.I:a.gc):--a.g||(a.Rb=a.bc,a.ra=a.cc)}function Nc(a,b,c){c&&a.B||(a.Ub=!a.f&&b[1]||a.v,a.Kb=!a.f&&b[3]||a.I);if(c||void 0===c)a.Vb=b[1]||a.v,a.gc=b[3]||a.I}function Pc(a,b,c){c&&a.g||(a.Rb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.bc=b[0]||a.K,a.cc=b[2]||a.L}function Jc(a,b){b||(b=Sc);Pc(a,b,void 0);Nc(a,b,void 0)} k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b<Tc.length;b++)(c=this.G[Tc[b]])&&this.B.sa(null,Tc[b],c);a=Uc(a,"autoStart");null!=a&&(this.A.mb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
var Sc=[],Mc=[I.prototype.S,I.prototype.va,I.prototype.ca,I.prototype.Ka],Oc=[I.prototype.P,I.prototype.na,I.prototype.Y,I.prototype.za];if(wb)var Lc=[I.prototype.N,I.prototype.ma,I.prototype.Na,I.prototype.cb],Kc=[I.prototype.R,I.prototype.ua,I.prototype.$,I.prototype.Ja]; k.Ea=function(a,b){if(!b){if(a&&this.restore){Vc(this);if(!this.restore(a))return!1;Wc(this)}else this.reset();this.i?(a=this.i,b=this.A.mb,a.fb=!0,a.j("Type ? for help with PDP11 Debugger commands"),a.ca(),b||a.kb(),a.Ka&&(b=a.Ka,a.Ka=null,Xc(a,b))):this.j("No debugger detected")}this.B.ca();return!0};k.Da=function(a){return a?this.save():!0};k.mb=function(){return this.A.mb||!this.i&&void 0===this.G.run?(this.wb(),!0):!1};k.pc=function(){return 0};
function Tc(a,b){r.call(this,"CPU",a,Tc,1);var c=a.multiplier||1;this.bb=a.cycles||b;this.Xa=c;this.Ab=Math.round(this.bb/1E4)/100;this.jb=this.Ab*this.Xa;this.A.ga=!1;this.A.Tb=!1;this.A.nb=a.autoStart;this.A.pb=!1;this.Eb=this.na=0;this.Fb=a.csStart;this.rb=a.csInterval;this.sb=a.csStop;this.K=[];this.uc=this.Ld.bind(this);G(this)}w(Tc);var Uc=["power","reset"];k=Tc.prototype; function Wc(a){void 0===a.Db&&(a.Db=0);void 0===a.rb&&(a.rb=-1);void 0===a.sb&&(a.sb=-1);a.A.ob=0<=a.Db&&0<a.rb;a.A.ob&&(a.Cb=0,a.ma=a.Db-a.la)}function Yc(a,b){if(a.A.ob){var c=!1;a.Cb=a.Cb+a.pc()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.rb,c=!0);0<=a.sb&&a.sb<=Zc(a)&&(a.rb=a.sb=-1,Wc(a),a.ja(),c=!0);c&&a.j(Zc(a)+" cycles: checksum="+p(a.Cb))}}
k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b<Uc.length;b++)(c=this.G[Uc[b]])&&this.B.sa(null,Uc[b],c);a=Vc(a,"autoStart");null!=a&&(this.A.nb="true"==a?!0:"false"==a?!1:!!a);G(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1}; k.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Nb?" (waiting for notification)":""))+".");a=!1}a&&(d.A.ga?d.ja():d.wb())},
k.Ea=function(a,b){if(!b){if(a&&this.restore){Wc(this);if(!this.restore(a))return!1;Xc(this)}else this.reset();this.i?(a=this.i,b=this.A.nb,a.fb=!0,a.j("Type ? for help with PDP11 Debugger commands"),a.da(),b||a.lb(),a.Ka&&(b=a.Ka,a.Ka=null,Yc(a,b))):this.j("No debugger detected")}this.B.da();return!0};k.Da=function(a){return a?this.save():!0};k.nb=function(){return this.A.nb||!this.i&&void 0===this.G.run?(this.wb(),!0):!1};k.oc=function(){return 0}; !0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){$c(d,d.Xa<<1,!0)},c.textContent=this.hb.toFixed(2)+"Mhz",!0}return!1};k.ca=function(){var a=this.G.speed;a&&(a.textContent=this.A.ga&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped")};function ad(a,b,c){a.la+=b;c&&(a.ba=a.b=a.J=0)}function bd(a,b){var c=1;b&&1<a.Xa&&a.Y&&(c=a.Y/a.nb);a.Ob=Math.round(1E3/30);a.bb=Math.floor(a.fb/30*c);b||(a.ua=a.bb);a.Ab=0}function Zc(a){return a.la+a.S+a.ba-a.b}
function Xc(a){void 0===a.Fb&&(a.Fb=0);void 0===a.rb&&(a.rb=-1);void 0===a.sb&&(a.sb=-1);a.A.pb=0<=a.Fb&&0<a.rb;a.A.pb&&(a.Eb=0,a.na=a.Fb-a.ma)}function Zc(a,b){if(a.A.pb){var c=!1;a.Eb=a.Eb+a.oc()|0;a.na-=b;0>=a.na&&(a.na+=a.rb,c=!0);0<=a.sb&&a.sb<=$c(a)&&(a.rb=a.sb=-1,Xc(a),a.ja(),c=!0);c&&a.j($c(a)+" cycles: checksum="+l(a.Eb))}} function Vc(a){a.Y=0;a.sc=0;a.la=a.S=a.ba=a.b=a.J=0;Wc(a);$c(a,1)}function $c(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.hb?b=1:d=!0;a.Xa=b;b=a.nb*a.Xa;if(a.hb!=b){a.hb=b;b=a.hb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.kb()}ad(a,a.S);a.S=0;a.R=Ba();a.Z=0;bd(a);return d}function lc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function nc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.fb*a.Xa/1E3*c|0,a.K[b][0]=c+cd(a))}
k.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.A.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.A.ia);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.A.ready?"powered yet":"ready yet"+(b.Ob?" (waiting for notification)":""))+".");a=!1}a&&(d.A.ga?d.ja():d.wb())}, function dd(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 ed(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 cd(a,b){var c=a.ba-=a.b;a.b=a.J=0;b&&(a.ba=0);return c}
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){ad(d,d.Xa<<1,!0)},c.textContent=this.jb.toFixed(2)+"Mhz",!0}return!1};k.da=function(){var a=this.G.speed;a&&(a.textContent=this.A.ga&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped")};function bd(a,b,c){a.ma+=b;c&&(a.ca=a.b=a.J=0)}function cd(a,b){var c=1;b&&1<a.Xa&&a.Y&&(c=a.Y/a.Ab);a.rc=Math.round(1E3/30);a.gb=Math.floor(a.bb/30*c);b||(a.ua=a.gb);a.Cb=0}function $c(a){return a.ma+a.S+a.ca-a.b} k.Ld=function(){if(this.A.ga){this.Ab>=this.fb&&bd(this,!0);this.za=0;this.eb=Ba();if(this.Z){var a=this.eb-this.Z;a>this.Ob&&(this.R+=a,this.R>this.eb&&(this.R=this.eb))}try{do{var b=dd(this,this.A.ob?1:this.bb);try{this.xb(b)}catch(e){if("number"!=typeof e)throw e;}b=cd(this,!0);this.za+=b;this.S+=b;Yc(this,b);ed(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.bb;15<=++this.sc&&(this.B&&this.B.ca(),this.sc=0);break}}while(this.A.ga)}catch(e){this.ja();this.B&&this.B.stop(Ba(),Zc(this));vb(this,
function Wc(a){a.Y=0;a.sc=0;a.ma=a.S=a.ca=a.b=a.J=0;Xc(a);ad(a,1)}function ad(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.jb?b=1:d=!0;a.Xa=b;b=a.Ab*a.Xa;if(a.jb!=b){a.jb=b;b=a.jb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.lb()}bd(a,a.S);a.S=0;a.R=Ba();a.$=0;cd(a);return d}function mc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function oc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c=a.bb*a.Xa/1E3*c|0,a.K[b][0]=c+dd(a))} e.stack||e.message);return}if(this.A.ga){a=setTimeout;b=this.tc;this.Z=Ba();var c=this.Ob;this.za&&(c=Math.round(c*this.za/this.bb));var c=c-(this.Z-this.eb),d=this.Z-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.la=0,$c(this)));if(0>c||this.Y<this.hb)-1E3>c&&(this.R-=c),c=0;this.Ab+=this.za;this.Z+=c;a(b,c)}}};
function ed(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 fd(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 dd(a,b){var c=a.ca-=a.b;a.b=a.J=0;b&&(a.ca=0);return c} k.wb=function(a){if(ub(this))return!1;if(this.A.ga)return this.j(this.toString()+" busy"),!1;$c(this);this.A.ga=!0;this.A.Ub=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.kb(!0),this.B.start(this.R,Zc(this)));setTimeout(this.tc,0);return!0};k.xb=function(){return 0};k.ja=function(a){var b=!1;if(this.A.ga){cd(this);ad(this,this.S);this.S=0;this.A.ga=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Ba(),Zc(this));b=!0}this.A.complete=a;return b};
k.Ld=function(){if(this.A.ga){this.Cb>=this.bb&&cd(this,!0);this.za=0;this.fb=Ba();if(this.$){var a=this.fb-this.$;a>this.rc&&(this.R+=a,this.R>this.fb&&(this.R=this.fb))}try{do{var b=ed(this,this.A.pb?1:this.gb);try{this.xb(b)}catch(e){if("number"!=typeof e)throw e;}b=dd(this,!0);this.za+=b;this.S+=b;Zc(this,b);fd(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.gb;15<=++this.sc&&(this.B&&this.B.da(),this.sc=0);break}}while(this.A.ga)}catch(e){this.ja();this.B&&this.B.stop(Ba(),$c(this));vb(this, function fd(a){this.qb=+a.model||1170;this.Jb=a.addrReset||0;Sc.call(this,a,6666667);this.decode=1120==this.qb?gd.bind(this):hd.bind(this);id(this);this.L=0;this.N=null;this.A.complete=!1}z(fd,Sc);k=fd.prototype;k.reset=function(){this.status("model "+this.qb);this.A.ga&&this.ja();id(this);Vc(this);this.A.error=!1;this.parent.reset.call(this)};
e.stack||e.message);return}if(this.A.ga){a=setTimeout;b=this.uc;this.$=Ba();var c=this.rc;this.za&&(c=Math.round(c*this.za/this.gb));var c=c-(this.$-this.fb),d=this.$-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ma=0,ad(this)));if(0>c||this.Y<this.jb)-1E3>c&&(this.R-=c),c=0;this.Cb+=this.za;this.$+=c;a(b,c)}}}; function id(a){a.T=65536;a.U=32768;a.$=65535;a.X=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Jb];a.Ra=[0,0,0,0,0,0];a.Fa=[0,0,0,0];a.v=0;a.Ka=0;a.Pc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.wa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Gb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
k.wb=function(a){if(ub(this))return!1;if(this.A.ga)return this.j(this.toString()+" busy"),!1;ad(this);this.A.ga=!0;this.A.Tb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.lb(!0),this.B.start(this.R,$c(this)));setTimeout(this.uc,0);return!0};k.xb=function(){return 0};k.ja=function(a){var b=!1;if(this.A.ga){dd(this);bd(this,this.S);this.S=0;this.A.ga=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Ba(),$c(this));b=!0}this.A.complete=a;return b}; 0,0,0,0,0,0,0,0,0];a.zc=[0,0,0,0,0,0,0,0];a.yc=0;a.H=0;a.F=a.I=0;a.g=a.f=a.lb=0;a.va=-1;jd(a)}function jd(a){a.Za=255;a.fa=0;a.fc=0;a.C=0;a.Ya=0;a.Fb=0;a.ib=0;a.Wa=0;a.Ja=0;a.Mb=262143;a.N=null;a.w&&pc(a)}function pc(a){a.Wa?(a.P=65536,a.aa=a.Oc,a.ra=a.Id,a.Ib=a.Ae,Yb(a.w,a.ib&16?22:18)):(a.P=0,a.aa=a.Nc,a.ra=a.xc,a.Ib=a.Ec,Yb(a.w,16))}function kd(a,b,c){a.Jb=b;P(a,b);!c&&a.i&&(a.ja()||a.i.ca())}k.pc=function(){return 0};
function gd(a){this.qb=+a.model||1170;this.Nb=a.addrReset||0;Tc.call(this,a,6666667);this.decode=1120==this.qb?hd.bind(this):id.bind(this);jd(this);this.L=0;this.N=null;this.A.complete=!1}w(gd,Tc);k=gd.prototype;k.reset=function(){this.status("model "+this.qb);this.A.ga&&this.ja();jd(this);Wc(this);this.A.error=!1;this.parent.reset.call(this)}; k.save=function(){var a=new R(this);a.set(0,[]);a.set(1,[this.la,this.Xa]);a.set(2,fc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.la=b[1];$c(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.K){for(var f=0,g=Array(b.K),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.W[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function ld(a){return a.T&65536?1:0}
function jd(a){a.T=65536;a.U=32768;a.aa=65535;a.X=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Nb];a.Ra=[0,0,0,0,0,0];a.Fa=[0,0,0,0];a.v=0;a.Ka=0;a.Pc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.wa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function md(a){return a.U&32768?2:0}function nd(a){return a.$&65535?0:4}k.Qa=function(){return this.X&32768?8:0};function od(a){var b=a.u[7];a.C&57344||(a.Ya=0,a.Fb=b);a.u[7]=b+2&65535;return a.ra(b)}function pd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function P(a,b){a.u[7]=b&65535}function oc(a,b){return{Od:a,tb:b,next:null}}function mc(a,b){if(b!=a.N){var c=a.N;if(!c||c.tb<=b.tb)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.tb<=b.tb){b.next=d;c.next=b;break}c=d}while(c)}}a.H|=2}
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.zc=[0,0,0,0,0,0,0,0];a.yc=0;a.H=0;a.F=a.I=0;a.g=a.f=a.ob=0;a.va=-1;kd(a)}function kd(a){a.$a=255;a.Z=0;a.ec=0;a.C=0;a.Ya=0;a.Hb=0;a.Za=0;a.Wa=0;a.Ja=0;a.Bb=262143;a.eb=253952;a.N=null;a.w&&qc(a)}function qc(a){a.Wa?(a.P=65536,a.ba=a.Oc,a.ra=a.Id,a.Kb=a.ze,Zb(a.w,a.Za&16?22:18)):(a.P=0,a.ba=a.Nc,a.ra=a.xc,a.Kb=a.Ec,Zb(a.w,16))}function ld(a,b,c){a.Nb=b;O(a,b);!c&&a.i&&(a.ja()||a.i.da())}k.oc=function(){return 0}; function Cb(a){return a.M=a.M&63728|a.Qa()|nd(a)|md(a)|ld(a)}function rc(a,b){a.X=b<<12;a.$=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.M)&2048)for(var c=a.Ra.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ra[c];a.Ra[c]=d}a.v=b>>14&3;c=a.M>>14&3;a.v!=c&&(a.Fa[c]=a.u[6],a.u[6]=a.Fa[a.v]);a.M=b;a.H|=2}function S(a,b){a.H&128||(a.X=a.$=b,a.U=0)}function qd(a,b,c){a.H&128||(a.X=a.$=a.T=b,a.U=c||0)}function rd(a,b,c,d){a.H&128||(a.X=a.$=a.T=b,a.U=(c^b)&(d^b))}function sd(a,b){a.H&128||(a.X=a.$=a.T=b,a.U=a.X^a.T>>1)}
k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ma,this.Xa]);a.set(2,gc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ma=b[1];ad(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.K){for(var f=0,g=Array(b.K),h=0;h<e.length-1;)for(var m=e[h++],n=e[h++];m--;)g[f++]=n;e=g}f=b.W[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function md(a){return a.T&65536?1:0} function td(a,b,c,d){a.H&128||(a.X=a.$=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.va?this.va=Cb(this):this.v||(a=4,c=!0);this.C&57344||(this.Ya=63222,this.Fb=a);this.v=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);rc(this,e&-12289|this.va>>2&12288);c&&(this.fa|=4,this.u[6]=4);ud(this,this.va);ud(this,this.u[7]);P(this,d);this.H&=-113;this.va=-1;this.H|=8;this.Tc=a;this.Rc=b;if(26!=b)throw a;}};
function nd(a){return a.U&32768?2:0}function od(a){return a.aa&65535?0:4}k.Qa=function(){return this.X&32768?8:0};function pd(a){var b=a.u[7];a.C&57344||(a.Ya=0,a.Hb=b);a.u[7]=b+2&65535;return a.ra(b)}function qd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function pc(a,b){return{Od:a,tb:b,next:null}}function nc(a,b){if(b!=a.N){var c=a.N;if(!c||c.tb<=b.tb)b.next=c,a.N=b;else{do{var d=c.next;if(!d||d.tb<=b.tb){b.next=d;c.next=b;break}c=d}while(c)}}a.H|=2} function vd(a){var b=wd(a),c=wd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);P(a,b);rc(a,c);a.H&=-17}function ec(a,b){var c=b>>13&31;31>c&&a.ib&32&&(b=a.Gb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
function Cb(a){return a.M=a.M&63728|a.Qa()|od(a)|nd(a)|md(a)}function sc(a,b){a.X=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.M)&2048)for(var c=a.Ra.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ra[c];a.Ra[c]=d}a.v=b>>14&3;c=a.M>>14&3;a.v!=c&&(a.Fa[c]=a.u[6],a.u[6]=a.Fa[a.v]);a.M=b;a.H|=2}function R(a,b){a.H&128||(a.X=a.aa=b,a.U=0)}function rd(a,b,c){a.H&128||(a.X=a.aa=a.T=b,a.U=c||0)}function sd(a,b,c,d){a.H&128||(a.X=a.aa=a.T=b,a.U=(c^b)&(d^b))} function Od(a,b,c){var d,e,f,g=0;d=b>>13;a.ib&a.Pc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.wa[a.v][d]<<6)+(b&8191)&a.Mb;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Ka=d;b=!1;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Ka<<1),b=!0),a.C&61440||!(4191360>
function td(a,b){a.H&128||(a.X=a.aa=a.T=b,a.U=a.X^a.T>>1)}function ud(a,b,c,d){a.H&128||(a.X=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.ka=function(a,b){if(!this.L){var c=!1;0>this.va?this.va=Cb(this):this.v||(a=4,c=!0);this.C&57344||(this.Ya=63222,this.Hb=a);this.v=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);sc(this,e&-12289|this.va>>2&12288);c&&(this.Z|=4,this.u[6]=4);vd(this,this.va);vd(this,this.u[7]);O(this,d);this.H&=-113;this.va=-1;this.H|=8;this.Tc=a;this.Sc=b;if(26!=b)throw a;}}; f||4194239<f)||(a.C|=4096,a.C&512&&(a.H|=32)),b&&a.pa(168,16));return f}function Pd(a,b){return a.w.Bb(b)}function Qd(a,b,c){b&1&&a.b--;a.w.Sb(b,c&255)}function wd(a){var b=a.ra(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b}function ud(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.C&57344||(a.Ya=a.Ya<<8|246);!a.v&&c<=a.Za&&4<c&&(c<=a.Za-32?(a.fa|=4,a.u[6]=4,a.pa(4,18)):(a.fa|=8,a.H|=4));a.Ib(c,b)}
function wd(a){var b=xd(a),c=xd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);O(a,b);sc(a,c);a.H&=-17}function Pd(a,b){var c=b>>13&31;31>c?a.Za&32&&(b=a.Uc[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} function Rd(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.pa(4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32||65534<=a.u[6]?(a.fa|=4,a.u[6]=4,a.pa(4,22)):(a.fa|=8,a.H|=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)|
function Qd(a,b,c){var d,e,f,g=0;d=b>>13;a.Za&a.Pc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.wa[a.v][d]<<6)+(b&8191)&a.Bb;f<a.eb?f&1&&!(c&1)&&(a.Z|=64,a.ka(4,10)):(a.Za&16||253952<=f&&(f|=4186112),4186112>f&&(3932160<=f&&(f=Pd(a,f&262143)),f>=a.eb&&4186112>f&&(a.Z|=32,a.ka(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|= g;a.b-=8;break;case 6:return e=a.ra(pd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(pd(a,2)),e=e+a.u[c]&65535,e=a.ra(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32?(a.fa|=4,a.u[6]=4,a.pa(4,24)):(a.fa|=8,a.H|=64));return e}k.Pb=function(a){if(!this.Wa)return this.w.Pb(a);this.L++;a=Pd(this,Od(this,a,3));this.L--;return a};
16384));a.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Ka=d;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Ka<<1),a.ka(168,16)),a.C&61440||!(4191360>f||4194239<f)||(a.C|=4096,a.C&512&&(a.H|=32)));return f}function Rd(a,b){return a.w.Db(b)}function Sd(a,b,c){b&1&&a.b--;a.w.Sb(b,c&255)}function xd(a){var b=a.ra(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b} k.pb=function(a){if(!this.Wa)return this.w.pb(a);this.L++;a=this.xc(Od(this,a,2));this.L--;return a};k.jb=function(a,b){this.Wa?(this.L++,Qd(this,Od(this,a,5),b),this.L--):this.w.jb(a,b)};k.Tb=function(a,b){this.Wa?(this.L++,this.Ec(Od(this,a,4),b),this.L--):this.w.Tb(a,b)};k.Nc=function(a,b,c){return Rd(this,a,b,c)};k.Oc=function(a,b,c){return Od(this,Rd(this,a,b,c),c)};k.xc=function(a){return this.w.oa(a)};k.Id=function(a){return this.w.oa(Od(this,a,2))};k.Ec=function(a,b){this.w.ab(a,b&65535)};
function vd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.C&57344||(a.Ya=a.Ya<<8|246);!a.v&&c<=a.$a&&4<c&&(c<=a.$a-32?(a.Z|=4,a.u[6]=4,a.ka(4,18)):(a.Z|=8,a.H|=4));a.Kb(c,b)} k.Ae=function(a,b){this.w.ab(Od(this,a,4),b)};function Sd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Rd(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.ra(d|c&a.P),a.v=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Fa[a.M>>12&3];return c}function Td(a,b,c,d){a.C&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Rd(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Od(a,e|c&65536,4),a.v=a.M>>14&3,a.w.ab(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Fa[a.M>>12&3]=d}
function Td(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.ka(4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.u[6]<=a.$a||65534<=a.u[6])&&(a.u[6]<=a.$a-32||65534<=a.u[6]?(a.Z|=4,a.u[6]=4,a.ka(4,22)):(a.Z|=8,a.H|=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; function Ud(a,b){b>>=6;var c=a.I=b&7;return(b=a.F=(b&56)>>3)?Pd(a,a.aa(b,c,3)):a.u[c]&255}function Vd(a,b){b>>=6;var c=a.I=b&7;return(b=a.F=(b&56)>>3)?a.w.oa(a.aa(b,c,2)):a.u[c]}function Wd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Rd(a,b,c,8)}function Xd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Pd(a,a.aa(b,c,3)):a.u[c]&255}function Yd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.aa(b,c,2)):a.u[c]}
a.b-=8;break;case 6:return e=a.ra(qd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(qd(a,2)),e=e+a.u[c]&65535,e=a.ra(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.$a||65534<=a.u[6])&&(a.u[6]<=a.$a-32?(a.Z|=4,a.u[6]=4,a.ka(4,24)):(a.Z|=8,a.H|=64));return e}k.Pb=function(a){if(!this.Wa)return this.w.Pb(a);this.L++;a=Rd(this,Qd(this,a,3));this.L--;return a}; function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.lb=a.aa(b,e,7),Qd(a,e,d.call(a,c,Pd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function U(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.ab(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function Zd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Qd(a,a.aa(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}
k.ib=function(a){if(!this.Wa)return this.w.ib(a);this.L++;a=this.xc(Qd(this,a,2));this.L--;return a};k.kb=function(a,b){this.Wa?(this.L++,Sd(this,Qd(this,a,5),b),this.L--):this.w.kb(a,b)};k.Ib=function(a,b){this.Wa?(this.L++,this.Ec(Qd(this,a,4),b),this.L--):this.w.Ib(a,b)};k.Nc=function(a,b,c){return Td(this,a,b,c)};k.Oc=function(a,b,c){return Qd(this,Td(this,a,b,c),c)};k.xc=function(a){return this.w.pa(a)};k.Id=function(a){return this.w.pa(Qd(this,a,2))};k.Ec=function(a,b){this.w.mb(a,b&65535)}; function $d(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ab(a.aa(b,d,4),c):a.u[d]=c&65535;return c}function V(a,b,c){c&&(P(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
k.ze=function(a,b){this.w.mb(Qd(this,a,4),b)};function Ud(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Td(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.ra(d|c&a.P),a.v=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Fa[a.M>>12&3];return c}function Vd(a,b,c,d){a.C&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Td(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Qd(a,e|c&65536,4),a.v=a.M>>14&3,a.w.mb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Fa[a.M>>12&3]=d} k.xb=function(a){this.A.complete=!0;var b=this.i&&ae(this.i)?1:this.A.Ub?-1:0,c=a?this.A.Ub?0:1:-1;this.A.Ub=!1;this.ba=this.b=a;do{if(b){if(this.i&&be(this.i,this.u[7],c)){this.ja();break}c||c++;b++}if(this.H){this.H&112&&(this.H&32?this.pa(168,28):this.H&64?this.pa(4,30):this.H&16&&this.pa(12,32),this.H&=-113);if(a=this.H&7){a=!1;if(this.H&2){this.H&=-3;var d=160,e=(this.fc&224)>>5,f=this.N&&this.N.tb>e?this.N:null;f&&(d=f.Od,e=f.tb);e>(this.M&224)>>5?(this.H&4&&(pd(this,2),this.H&=-5),this.pa(d,
function Wd(a,b){b>>=6;var c=a.I=b&7;return(b=a.F=(b&56)>>3)?Rd(a,a.ba(b,c,3)):a.u[c]&255}function Xd(a,b){b>>=6;var c=a.I=b&7;return(b=a.F=(b&56)>>3)?a.w.pa(a.ba(b,c,2)):a.u[c]}function Yd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Td(a,b,c,8)}function Zd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Rd(a,a.ba(b,c,3)):a.u[c]&255}function $d(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.pa(a.ba(b,c,2)):a.u[c]} 26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.N,f==a)this.N=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.H&1&&this.H++;a=a&&0>c}if(a)break}this.H=this.H&7|this.M&16;this.decode(od(this))}while(0<this.b);return this.A.complete?this.ba-this.b:void 0===this.A.complete?0:-1};Xa(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new fd(d);C(d,c)}});function ce(a,b){var c=b+a;rd(this,c,a,b);return c&65535}
function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ob=a.ba(b,e,7),Sd(a,e,d.call(a,c,Rd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.mb(e,d.call(a,c,a.w.pa(e)))):a.u[e]=d.call(a,c,a.u[e])}function ae(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Sd(a,a.ba(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c} function de(a,b){var c=b+a;rd(this,c<<8,a<<8,b<<8);return c&255}function ee(a,b){a=b<<1;sd(this,a);return a&65535}function fe(a,b){a=b<<1;sd(this,a<<8);return a&255}function ge(a,b){a=b&32768|b>>1|b<<16;sd(this,a);return a&65535}function he(a,b){a=b&2048|b>>1|b<<8;sd(this,a<<8);return a&255}function ie(a,b){a=b&~a;S(this,a);return a}function je(a,b){a=b&~a;S(this,a<<8);return a}function ke(a,b){a|=b;S(this,a);return a}function le(a,b){a|=b;S(this,a<<8);return a}
function be(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.mb(a.ba(b,d,4),c):a.u[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} function me(a,b){a=~b|65536;qd(this,a);return a&65535}function ne(a,b){a=~b|256;qd(this,a<<8);return a&255}function oe(a,b){a=b-a;this.H&128||(this.X=this.$=a,this.U=b&(b^a));return a&65535}function pe(a,b){a=b-a;var c=a<<8;b<<=8;this.H&128||(this.X=this.$=c,this.U=b&(b^c));return a&255}function qe(a,b){a=b+a;this.H&128||(this.X=this.$=a,this.U=a&(b^a));return a&65535}function re(a,b){a=b+a;var c=a<<8;this.H&128||(this.X=this.$=c,this.U=c&(b<<8^c));return a&255}
k.xb=function(a){this.A.complete=!0;var b=this.i&&ce(this.i)?1:this.A.Tb?-1:0,c=a?this.A.Tb?0:1:-1;this.A.Tb=!1;this.ca=this.b=a;do{if(b){if(this.i&&de(this.i,this.u[7],c)){this.ja();break}c||c++;b++}if(this.H){this.H&112&&(this.H&32?this.ka(168,28):this.H&64?this.ka(4,30):this.H&16&&this.ka(12,32),this.H&=-113);if(a=this.H&7){a=!1;if(this.H&2){this.H&=-3;var d=160,e=(this.ec&224)>>5,f=this.N&&this.N.tb>e?this.N:null;f&&(d=f.Od,e=f.tb);e>(this.M&224)>>5?(this.H&4&&(qd(this,2),this.H&=-5),this.ka(d, function se(a,b){a=-b;qd(this,a,a&b&32768);return a&65535}function te(a,b){a=-b;qd(this,a<<8,(a&b&128)<<8);return a&255}function ue(a,b){a=b<<1|this.T>>16&1;sd(this,a);return a&65535}function ve(a,b){a=b<<1|this.T>>16&1;sd(this,a<<8);return a&255}function we(a,b){a=(this.T&65536|b)>>1|b<<16;sd(this,a);return a&65535}function xe(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;sd(this,a<<8);return a&255}function ye(a,b){var c=b-a;td(this,c,a,b);return c&65535}
26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.N,f==a)this.N=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.H&1&&this.H++;a=a&&0>c}if(a)break}this.H=this.H&7|this.M&16;this.decode(pd(this))}while(0<this.b);return this.A.complete?this.ca-this.b:void 0===this.A.complete?0:-1};Xa(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new gd(d);C(d,c)}});function ee(a,b){var c=b+a;sd(this,c,a,b);return c&65535} function ze(a,b){var c=b-a;td(this,c<<8,a<<8,b<<8);return c&255}function Ae(a,b){this.H&128||(this.X=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Be(a,b){a^=b;S(this,a);return a&65535}function Ce(a){U(this,a,Vd(this,a),ce);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}
function fe(a,b){var c=b+a;sd(this,c<<8,a<<8,b<<8);return c&255}function ge(a,b){a=b<<1;td(this,a);return a&65535}function he(a,b){a=b<<1;td(this,a<<8);return a&255}function ie(a,b){a=b&32768|b>>1|b<<16;td(this,a);return a&65535}function je(a,b){a=b&2048|b>>1|b<<8;td(this,a<<8);return a&255}function ke(a,b){a=b&~a;R(this,a);return a}function le(a,b){a=b&~a;R(this,a<<8);return a}function me(a,b){a|=b;R(this,a);return a}function ne(a,b){a|=b;R(this,a<<8);return a} function De(a){var b=Yd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.$=c;this.b-=(this.g?6:7)+b}
function oe(a,b){a=~b|65536;rd(this,a);return a&65535}function pe(a,b){a=~b|256;rd(this,a<<8);return a&255}function qe(a,b){a=b-a;this.H&128||(this.X=this.aa=a,this.U=b&(b^a));return a&65535}function re(a,b){a=b-a;var c=a<<8;b<<=8;this.H&128||(this.X=this.aa=c,this.U=b&(b^c));return a&255}function se(a,b){a=b+a;this.H&128||(this.X=this.aa=a,this.U=a&(b^a));return a&65535}function te(a,b){a=b+a;var c=a<<8;this.H&128||(this.X=this.aa=c,this.U=c&(b<<8^c));return a&255} function Ee(a){var b=Yd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function Fe(a){V(this,a,!ld(this))}function Ge(a){V(this,a,ld(this))}
function ue(a,b){a=-b;rd(this,a,a&b&32768);return a&65535}function ve(a,b){a=-b;rd(this,a<<8,(a&b&128)<<8);return a&255}function we(a,b){a=b<<1|this.T>>16&1;td(this,a);return a&65535}function xe(a,b){a=b<<1|this.T>>16&1;td(this,a<<8);return a&255}function ye(a,b){a=(this.T&65536|b)>>1|b<<16;td(this,a);return a&65535}function ze(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;td(this,a<<8);return a&255}function Ae(a,b){var c=b-a;ud(this,c,a,b);return c&65535} function He(a){U(this,a,Vd(this,a),ie);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Ie(a){T(this,a,Ud(this,a),je);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Je(a){U(this,a,Vd(this,a),ke);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Ke(a){T(this,a,Ud(this,a),le);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}
function Be(a,b){var c=b-a;ud(this,c<<8,a<<8,b<<8);return c&255}function Ce(a,b){this.H&128||(this.X=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function De(a,b){a^=b;R(this,a);return a&65535}function Ee(a){T(this,a,Xd(this,a),ee);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} function Le(a){S(this,Vd(this,a)&Yd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Me(a){S(this,(Ud(this,a)&Xd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Ne(a){V(this,a,nd(this))}function Oe(a){V(this,a,!this.Qa()==!md(this))}function Pe(a){V(this,a,!nd(this)&&!this.Qa()==!md(this))}function Qe(a){V(this,a,!ld(this)&&!nd(this))}function Re(a){V(this,a,nd(this)||!this.Qa()!=!md(this))}
function Fe(a){var b=$d(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b} function Se(a){V(this,a,ld(this)||nd(this))}function Te(a){V(this,a,!this.Qa()!=!md(this))}function Ue(a){V(this,a,this.Qa())}function Ve(a){V(this,a,!nd(this))}function We(a){V(this,a,!this.Qa())}function Xe(){this.pa(12,1);this.b-=5}function Ye(a){V(this,a,!0)}function Ze(a){V(this,a,!md(this))}function $e(a){V(this,a,md(this))}function W(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.X=0);this.b-=5}
function Ge(a){var b=$d(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function He(a){U(this,a,!md(this))}function Ie(a){U(this,a,md(this))} function af(a){var b=Vd(this,a);a=Yd(this,a);td(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function bf(a){var b=Ud(this,a)<<8;a=Xd(this,a)<<8;td(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}
function Je(a){T(this,a,Xd(this,a),ke);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Ke(a){S(this,a,Wd(this,a),le);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Le(a){T(this,a,Xd(this,a),me);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function Me(a){S(this,a,Wd(this,a),ne);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} function cf(a){var b=Yd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.X=d>>16):(this.U=32768,this.$=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.X=0,this.U=32768,this.T=65536,this.b-=7}function df(){this.pa(24,2);this.b-=25}
function Ne(a){R(this,Xd(this,a)&$d(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Oe(a){R(this,(Wd(this,a)&Zd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Pe(a){U(this,a,od(this))}function Qe(a){U(this,a,!this.Qa()==!nd(this))}function Re(a){U(this,a,!od(this)&&!this.Qa()==!nd(this))}function Se(a){U(this,a,!md(this)&&!od(this))}function Te(a){U(this,a,od(this)||!this.Qa()!=!nd(this))} function ef(){this.M&49152?(this.fa|=128,this.pa(4,3)):this.i?jc(this.i):this.ja();this.b-=7}function ff(){this.pa(16,4);this.b-=25}var gf=[0,7,7,10,7,11,9,13];function hf(a){this.J=this.b;P(this,Wd(this,a));this.b=this.J-gf[this.g]}var jf=[0,14,14,17,14,18,16,20];function kf(a){this.J=this.b;var b=Wd(this,a);a=a>>6&7;ud(this,this.u[a]);this.u[a]=this.u[7];P(this,b);this.b=this.J-jf[this.g]}var lf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function Ue(a){U(this,a,md(this)||od(this))}function Ve(a){U(this,a,!this.Qa()!=!nd(this))}function We(a){U(this,a,this.Qa())}function Xe(a){U(this,a,!od(this))}function Ye(a){U(this,a,!this.Qa())}function Ze(){this.ka(12,1);this.b-=5}function $e(a){U(this,a,!0)}function af(a){U(this,a,!nd(this))}function bf(a){U(this,a,nd(this))}function V(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5} function mf(a){var b=Vd(this,a);this.J=this.b;S(this,$d(this,a,b));this.b=this.J-lf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function nf(a){var b=Ud(this,a);S(this,Zd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var of=[7,13,13,17,14,18,17,21];
function cf(a){var b=Xd(this,a);a=$d(this,a);ud(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function df(a){var b=Wd(this,a)<<8;a=Zd(this,a)<<8;ud(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} function pf(a){var b=Yd(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.H&128||(this.X=b>>16,this.$=this.X|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function qf(){this.b-=5}function rf(){this.M&49152||(jd(this),this.w.reset());this.b-=667}function sf(){vd(this);this.H|=this.M&16;this.b-=13}
function ef(a){var b=$d(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.X=d>>16):(this.U=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.U=32768,this.T=65536,this.b-=7}function ff(){this.ka(24,2);this.b-=25} function tf(a){if(a&8)X.call(this,a);else{var b=wd(this);a&=7;7==a?P(this,b):(P(this,this.u[a]),this.u[a]=b);this.b-=9}}function uf(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.$=0);a&8&&(this.X=32768);this.b-=5}function vf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)P(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function wf(a){U(this,a,Vd(this,a),ye);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}
function gf(){this.M&49152?(this.Z|=128,this.ka(4,3)):this.i?dc(this.i):this.ja();this.b-=7}function hf(){this.ka(16,4);this.b-=25}var jf=[0,7,7,10,7,11,9,13];function kf(a){this.J=this.b;O(this,Yd(this,a));this.b=this.J-jf[this.g]}var lf=[0,14,14,17,14,18,16,20];function mf(a){this.J=this.b;var b=Yd(this,a);a=a>>6&7;vd(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-lf[this.g]}var nf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function xf(a){U(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}function yf(){this.pa(28,5);this.b-=5}function zf(){this.H&4||this.B.ca();this.H|=4;pd(this,-2);this.b-=3}function Af(a){U(this,a,Vd(this,a),Be);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=jc(b);b||this.pa(8,6)}function gd(a){Bf[a>>12].call(this,a)}function Cf(a){Df[a>>6&3].call(this,a)}function Ef(a){Ff[a>>6&3].call(this,a)}
function of(a){var b=Xd(this,a);this.J=this.b;R(this,be(this,a,b));this.b=this.J-nf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function pf(a){var b=Wd(this,a);R(this,ae(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var qf=[7,13,13,17,14,18,17,21]; function Gf(a){Hf[a>>6&3].call(this,a)}function If(a){Jf[a&15].call(this,a)}function Kf(a){Lf[a&15].call(this,a)}function Mf(a){Nf[a>>6&3].call(this,a)}function Of(a){Pf[a>>6&3].call(this,a)}function Qf(a){Rf[a>>6&3].call(this,a)}
function rf(a){var b=$d(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.H&128||(this.X=b>>16,this.aa=this.X|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function sf(){this.b-=5}function tf(){this.M&49152||(kd(this),this.w.reset());this.b-=667}function uf(){wd(this);this.H|=this.M&16;this.b-=13} var Bf=[function(a){Sf[a>>8&15].call(this,a)},mf,af,Le,He,Je,Ce,X,function(a){Tf[a>>8&15].call(this,a)},nf,bf,Me,Ie,Ke,wf,X],Sf=[function(a){Uf[a>>4&15].call(this,a)},Ye,Ve,Ne,Oe,Te,Pe,Re,kf,kf,Cf,Ef,Gf,X,X,X],Df=[function(a){qd(this,$d(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,oe);this.b-=this.g?9:3+(7==this.f?2:0)}],Ff=[function(a){U(this,a,0,
function vf(a){if(a&8)W.call(this,a);else{var b=xd(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function X(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.X=32768);this.b-=5}function wf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function xf(a){T(this,a,Xd(this,a),Ae);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} se);this.b-=this.g?11:6},function(a){U(this,a,ld(this)?1:0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,ld(this)?1:0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Yd(this,a);qd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Hf=[function(a){U(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)}],
function yf(a){T(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}function zf(){this.ka(28,5);this.b-=5}function Af(){this.H&4||this.B.da();this.H|=4;qd(this,-2);this.b-=3}function Bf(a){T(this,a,Xd(this,a),De);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=dc(b);b||this.ka(8,6)}function hd(a){Cf[a>>12].call(this,a)}function Df(a){Ef[a>>6&3].call(this,a)}function Ff(a){Gf[a>>6&3].call(this,a)} Uf=[function(a){Vf[a&15].call(this,a)},X,X,X,hf,hf,hf,hf,tf,X,If,Kf,xf,xf,xf,xf],Vf=[ef,zf,sf,Xe,ff,rf,X,X,X,X,X,X,X,X,X,X],Jf=[qf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},W,function(){this.$=1;this.b-=5},W,W,W,function(){this.X=0;this.b-=5},W,W,W,W,W,W,W],Lf=[qf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},uf,function(){this.$=0;this.b-=5},uf,uf,uf,function(){this.X=32768;this.b-=5},uf,uf,uf,uf,uf,uf,uf],Tf=[We,Ue,Qe,Se,Ze,$e,Fe,Ge,df,yf,Mf,Of,Qf,X,X,
function Hf(a){If[a>>6&3].call(this,a)}function Jf(a){Kf[a&15].call(this,a)}function Lf(a){Mf[a&15].call(this,a)}function Nf(a){Of[a>>6&3].call(this,a)}function Pf(a){Qf[a>>6&3].call(this,a)}function Rf(a){Sf[a>>6&3].call(this,a)} X],Nf=[function(a){qd(this,Zd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,pe);this.b-=this.g?9:3+(7==this.f?2:0)}],Pf=[function(a){T(this,a,0,te);this.b-=this.g?11:6},function(a){T(this,a,ld(this)?1:0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,ld(this)?1:0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Xd(this,a);qd(this,a<<
var Cf=[function(a){Tf[a>>8&15].call(this,a)},of,cf,Ne,Je,Le,Ee,W,function(a){Uf[a>>8&15].call(this,a)},pf,df,Oe,Ke,Me,xf,W],Tf=[function(a){Vf[a>>4&15].call(this,a)},$e,Xe,Pe,Qe,Ve,Re,Te,mf,mf,Df,Ff,Hf,W,W,W],Ef=[function(a){rd(this,be(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,qe);this.b-=this.g?9:3+(7==this.f?2:0)}],Gf=[function(a){T(this,a,0, 8);this.b-=this.g?4:3+(7==this.f?2:0)}],Rf=[function(a){T(this,a,0,xe);this.b-=this.g?9+(this.lb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,he);this.b-=this.g?9+(this.lb&1):3+(7==this.f?2:0)},function(a){T(this,a,0,fe);this.b-=this.g?9:3+(7==this.f?2:0)}];function hd(a){Wf[a>>12].call(this,a)}
ue);this.b-=this.g?11:6},function(a){T(this,a,md(this)?1:0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,md(this)?1:0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=$d(this,a);rd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],If=[function(a){T(this,a,0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ge);this.b-=this.g?9:3+(7==this.f?2:0)}], var Wf=[function(a){Xf[a>>8&15].call(this,a)},mf,af,Le,He,Je,Ce,function(a){Yf[a>>8&15].call(this,a)},function(a){Zf[a>>8&15].call(this,a)},nf,bf,Me,Ie,Ke,wf,X],Xf=[function(a){$f[a>>4&15].call(this,a)},Ye,Ve,Ne,Oe,Te,Pe,Re,kf,kf,Cf,Ef,Gf,function(a){ag[a>>6&3].call(this,a)},X,X],ag=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);P(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Sd(this,a,0);ud(this,a);S(this,a);this.b-=11},function(a){var b=wd(this);this.J=
Vf=[function(a){Wf[a&15].call(this,a)},W,W,W,kf,kf,kf,kf,vf,W,Jf,Lf,yf,yf,yf,yf],Wf=[gf,Af,uf,Ze,hf,tf,W,W,W,W,W,W,W,W,W,W],Kf=[sf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},V,function(){this.aa=1;this.b-=5},V,V,V,function(){this.X=0;this.b-=5},V,V,V,V,V,V,V],Mf=[sf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},X,function(){this.aa=0;this.b-=5},X,X,X,function(){this.X=32768;this.b-=5},X,X,X,X,X,X,X],Uf=[Ye,We,Se,Ue,af,bf,He,Ie,ff,zf,Nf,Pf,Rf,W,W,W],Of=[function(a){rd(this, this.b;Td(this,a,0,b);S(this,b);this.b=this.J-of[this.g]},function(a){S(this,$d(this,a,this.Qa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],$f=[function(a){bg[a&15].call(this,a)},X,X,X,hf,hf,hf,hf,tf,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.H|=1),this.b-=5):X.call(this,a)},If,Kf,xf,xf,xf,xf],bg=[ef,zf,sf,Xe,ff,rf,function(){vd(this);this.b-=13},X,X,X,X,X,X,X,X,X],Yf=[pf,pf,cf,cf,De,De,Ee,Ee,Af,Af,X,X,X,X,vf,vf],Zf=[We,Ue,Qe,Se,Ze,$e,Fe,Ge,df,yf,Mf,Of,Qf,function(a){cg[a>>
ae(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,re);this.b-=this.g?9:3+(7==this.f?2:0)}],Qf=[function(a){S(this,a,0,ve);this.b-=this.g?11:6},function(a){S(this,a,md(this)?1:0,fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,md(this)?1:0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Zd(this,a);rd(this,a<<8);this.b-=this.g?4:3+(7== 6&3].call(this,a)},X,X],cg=[X,function(a){a=Sd(this,a,65536);ud(this,a);S(this,a);this.b-=11},function(a){var b=wd(this);this.J=this.b;Td(this,a,65536,b);S(this,b);this.b=this.J-of[this.g]},X];
this.f?2:0)}],Sf=[function(a){S(this,a,0,ze);this.b-=this.g?9+(this.ob&1):3+(7==this.f?2:0)},function(a){S(this,a,0,xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,je);this.b-=this.g?9+(this.ob&1):3+(7==this.f?2:0)},function(a){S(this,a,0,he);this.b-=this.g?9:3+(7==this.f?2:0)}];function id(a){Xf[a>>12].call(this,a)} function dg(a){u.call(this,"ROM",a,dg);this.ha=this.f=null;this.C=a.addr;this.g=a.size;this.v=a.alias;this.B=a.file;this.F=sa(this.B);if(this.B){a=this.B;var b=ta(this.F);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?c.O("Unable to load ROM resource (error "+f+": "+a+")"):(nb(c.Na,a,b),(a=Fa(a,b))?(c.f=a.da,c.ha=a.ha):c.B=null,eg(c))})}}z(dg);dg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;eg(this)};
var Xf=[function(a){Yf[a>>8&15].call(this,a)},of,cf,Ne,Je,Le,Ee,function(a){Zf[a>>8&15].call(this,a)},function(a){$f[a>>8&15].call(this,a)},pf,df,Oe,Ke,Me,xf,W],Yf=[function(a){ag[a>>4&15].call(this,a)},$e,Xe,Pe,Qe,Ve,Re,Te,mf,mf,Df,Ff,Hf,function(a){bg[a>>6&3].call(this,a)},W,W],bg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ud(this,a,0);vd(this,a);R(this,a);this.b-=11},function(a){var b=xd(this);this.J= dg.prototype.Ea=function(){this.ha&&(this.i&&fg(this.i,this.id,this.C,this.g,this.ha),delete this.ha);return!0};dg.prototype.Da=function(){return!0};
this.b;Vd(this,a,0,b);R(this,b);this.b=this.J-qf[this.g]},function(a){R(this,be(this,a,this.Qa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],ag=[function(a){cg[a&15].call(this,a)},W,W,W,kf,kf,kf,kf,vf,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.H|=1),this.b-=5):W.call(this,a)},Jf,Lf,yf,yf,yf,yf],cg=[gf,Af,uf,Ze,hf,tf,function(){wd(this);this.b-=13},W,W,W,W,W,W,W,W,W],Zf=[rf,rf,ef,ef,Fe,Fe,Ge,Ge,Bf,Bf,W,W,W,W,wf,wf],$f=[Ye,We,Se,Ue,af,bf,He,Ie,ff,zf,Nf,Pf,Rf,function(a){dg[a>> function eg(a){if(!tb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)vb(a,"ROM size ("+p(a.f.length,8,!0)+") does not match specified size ("+p(a.g,8,!0)+")");else{var b;b=a.C;if(ac(a.w,b,a.g,Hc)){var c;for(c=0;c<a.f.length;c++)a.w.jb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.v?b.push(a.v):null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){var d=a,e=b[c],f=$b(d.w,d.C,d.g);Zb(d.w,e,d.g,f)}delete a.f}}}H(a)}}
6&3].call(this,a)},W,W],dg=[W,function(a){a=Ud(this,a,65536);vd(this,a);R(this,a);this.b-=11},function(a){var b=xd(this);this.J=this.b;Vd(this,a,65536,b);R(this,b);this.b=this.J-qf[this.g]},W]; Xa(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new dg(d);C(d,c)}});
function eg(a){r.call(this,"ROM",a,eg);this.ha=this.f=null;this.C=a.addr;this.g=a.size;this.v=a.alias;this.B=a.file;this.F=sa(this.B);if(this.B){a=this.B;var b=ta(this.F);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?c.O("Unable to load ROM resource (error "+f+": "+a+")"):(nb(c.Na,a,b),(a=Fa(a,b))?(c.f=a.ea,c.ha=a.ha):c.B=null,fg(c))})}}w(eg);eg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;fg(this)}; function gg(a){u.call(this,"RAM",a,gg);this.ha=this.g=null;this.B=a.addr;this.C=a.size;this.Ha=a.load;this.Ga=a.exec;this.v=!1;this.f=a.file;this.F=sa(this.f);if(this.f){a=this.f;var b=ta(this.F);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?c.O("Unable to load RAM resource (error "+f+": "+a+")"):(nb(c.Na,a,b),(a=Fa(a,b))?(c.g=a.da,c.ha=a.ha,null==c.Ha&&(c.Ha=a.Ha),null==c.Ga&&(c.Ga=a.Ga)):c.f=null,hg(c))})}}z(gg);
eg.prototype.Ea=function(){this.ha&&(this.i&&gg(this.i,this.id,this.C,this.g,this.ha),delete this.ha);return!0};eg.prototype.Da=function(){return!0}; gg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;hg(this)};gg.prototype.Ea=function(){this.ha&&(this.i&&fg(this.i,this.id,this.B,this.C,this.ha),delete this.ha);return!0};gg.prototype.Da=function(){return!0};function hg(a){if(a.w&&(!a.v&&a.C&&ac(a.w,a.B,a.C,1)&&(a.v=!0),!tb(a))){if(!a.v)q("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;Bg(a,a.g,a.Ha,a.Ga,a.B)}H(a)}}
function fg(a){if(!tb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)vb(a,"ROM size ("+l(a.f.length,8,!0)+") does not match specified size ("+l(a.g,8,!0)+")");else{var b;b=a.C;if(bc(a.w,b,a.g,Ic)){var c;for(c=0;c<a.f.length;c++)a.w.kb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.v?b.push(a.v):null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){var d=a,e=b[c],f=ac(d.w,d.C,d.g);$b(d.w,e,d.g,f)}delete a.f}}}G(a)}} gg.prototype.reset=function(){if(this.v){for(var a=this.w,b=this.B,c=this.C,d=b&a.w,b=b>>>a.ka;0<c&&b<a.W.length;){var e=a.W[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(wb)for(g=d;f--&&g<e.G.length;g++)e.G[g]=0;else for(g=d;f--&&g<e.size;g++)e.Wb(d,0,e.D+d);c-=a.xa;b++;d=0}this.g&&Bg(this,this.g,this.Ha,this.Ga,this.B,!0)}};
Xa(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new eg(d);C(d,c)}}); function Bg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),r=h,t=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.jb(n++,b[r++]&255);else n&1?a.b.ja():kd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.b.jb(c+
function hg(a){r.call(this,"RAM",a,hg);this.ha=this.g=null;this.B=a.addr;this.C=a.size;this.Ha=a.load;this.Ga=a.exec;this.v=!1;this.f=a.file;this.F=sa(this.f);if(this.f){a=this.f;var b=ta(this.F);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?c.O("Unable to load RAM resource (error "+f+": "+a+")"):(nb(c.Na,a,b),(a=Fa(a,b))?(c.g=a.ea,c.ha=a.ha,null==c.Ha&&(c.Ha=a.Ha),null==c.Ga&&(c.Ga=a.Ga)):c.f=null,ig(c))})}}w(hg); e,b[e]);null!=d&&kd(a.b,d,f);g=!0}return g}Xa(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new gg(d);C(d,c)}});function Cg(a){u.call(this,"Keyboard",a,Cg,65536);H(this)}z(Cg);Cg.prototype.sa=function(){return!1};Cg.prototype.Ca=function(a,b,c,d){this.B=a;this.b=c;this.i=d};Xa(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Cg(d);C(d,c)}});
hg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;ig(this)};hg.prototype.Ea=function(){this.ha&&(this.i&&gg(this.i,this.id,this.B,this.C,this.ha),delete this.ha);return!0};hg.prototype.Da=function(){return!0};function ig(a){if(a.w&&(!a.v&&a.C&&bc(a.w,a.B,a.C,1)&&(a.v=!0),!tb(a))){if(!a.v)q("No RAM allocated");else if(a.f){if(!a.g||!a.w)return;Cg(a,a.g,a.Ha,a.Ga,a.B)}G(a)}} function Y(a){this.N=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.ba=a.upperCase;this.v=this.F=null;this.S=a.tabSize;this.P=a.charBOL;this.I=0;u.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.F="";else{var c;a=Dg;b&&(void 0===c&&(c="Panel"),(c=qb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.J=this.L=null;this.exports={connect:this.uc,receiveData:this.ec}}z(Y);var Dg="buffer";k=Y.prototype;
hg.prototype.reset=function(){if(this.v){for(var a=this.w,b=this.B,c=this.C,d=b&a.w,b=b>>>a.la;0<c&&b<a.W.length;){var e=a.W[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(wb)for(g=d;f--&&g<e.G.length;g++)e.G[g]=0;else for(g=d;f--&&g<e.size;g++)e.Vb(d,0,e.D+d);c-=a.xa;b++;d=0}this.g&&Cg(this,this.g,this.Ha,this.Ga,this.B,!0)}}; k.sa=function(a,b,c){var d=this;switch(b){case Dg:return this.G[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.ec(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ec(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
function Cg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var m=b[h]&255|(b[h+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(h+6>=b.length)break;for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,p=b[h++]&255|(b[h++]&255)<<8,m=m+((n&255)+(n>>8)+(p&255)+(p>>8)),u=h,v=n-=6;0<n&&h<b.length;)m+=b[h++]&255,n--;if(n||h>=b.length)break;m+=b[h++]&255;if(m&255)break;if(v)for(;v--;)a.b.kb(p++,b[u++]&255);else p&1?a.b.ja():ld(a.b,p,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.b.kb(c+ k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;var e=this;this.la=oc(48,4);this.Y=lc(this.b,function(){e.f&128||!e.C.length||(e.K=e.C.shift()&255,e.ba&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&mc(e.b,e.la))});this.ma=oc(52,4);this.Z=lc(this.b,function(){e.g|=128;e.g&64&&mc(e.b,e.ma)});hc(b,this,Eg);H(this)};
e,b[e]);null!=d&&ld(a.b,d,f);g=!0}return g}Xa(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new hg(d);C(d,c)}});function Dg(a){r.call(this,"Keyboard",a,Dg,65536);G(this)}w(Dg);Dg.prototype.sa=function(){return!1};Dg.prototype.Ca=function(a,b,c,d){this.B=a;this.b=c;this.i=d};Xa(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Dg(d);C(d,c)}}); k.uc=function(){if(!this.J){var a=Uc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.cb)return;b=ya(b[1]);if(this.J=pb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ea=function(a,b){if(!b)if(this.uc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
function Y(a){this.N=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.ca=a.upperCase;this.v=this.F=null;this.S=a.tabSize;this.P=a.charBOL;this.I=0;r.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.F="";else{var c;a=Eg;b&&(void 0===c&&(c="Panel"),(c=qb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.J=this.L=null;this.exports={connect:this.tc,receiveData:this.dc}}w(Y);var Eg="buffer";k=Y.prototype; k.Da=function(a){return a?this.save():!0};k.reset=function(){Fg(this)};k.save=function(){var a=new R(this);a.set(0,[]);return a.data()};k.restore=function(){return Fg(this)};function Fg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.ec=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.C.push(a.charCodeAt(b));else this.C=this.C.concat(a);nc(this.b,this.Y,1E3/Math.round(this.N/10));return!0};k.rd=function(){return this.f&65534};
k.sa=function(a,b,c){var d=this;switch(b){case Eg:return this.G[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.dc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.dc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; k.je=function(a){this.f=this.f&-112|a&111};k.qd=function(){this.f&=-129;0<this.C.length&&nc(this.b,this.Y,1E3/Math.round(this.N/10));return this.K};k.ie=function(){};k.Kd=function(){return this.g};k.Ce=function(a){128==(this.g&192)&&a&64&&nc(this.b,this.Z,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Jd=function(){return 0};
k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;var e=this;this.ma=pc(48,4);this.Y=mc(this.b,function(){e.f&128||!e.C.length||(e.K=e.C.shift()&255,e.ca&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&nc(e.b,e.ma))});this.na=pc(52,4);this.$=mc(this.b,function(){e.g|=128;e.g&64&&nc(e.b,e.na)});ic(b,this,Fg);G(this)}; k.Be=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.J,a);if(this.v)if(13==a)this.I=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.I&&this.I--;else{var b;b=(b=za[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.I%a,this.S&&(b=xa("",c)));this.P&&!this.I&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.I+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.j(this.F),
k.tc=function(){if(!this.J){var a=Vc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.cb)return;b=ya(b[1]);if(this.J=pb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ea=function(a,b){if(!b)if(this.tc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;nc(this.b,this.Z,1E3/Math.round(this.R/10))}};var Gg={},Eg=(Gg[65392]=[null,null,Y.prototype.rd,Y.prototype.je,"RCSR"],Gg[65394]=[null,null,Y.prototype.qd,Y.prototype.ie,"RBUF"],Gg[65396]=[null,null,Y.prototype.Kd,Y.prototype.Ce,"XCSR"],Gg[65398]=[null,null,Y.prototype.Jd,Y.prototype.Be,"XBUF"],Gg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Y(d);C(d,c)}});
k.Da=function(a){return a?this.save():!0};k.reset=function(){Gg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Gg(this)};function Gg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.dc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.C.push(a.charCodeAt(b));else this.C=this.C.concat(a);oc(this.b,this.Y,1E3/Math.round(this.N/10));return!0};k.sd=function(){return this.f&65534}; function sc(a){u.call(this,"PC11",a,sc);this.g=a.autoMount||null;this.F=0;this.Z=a.baudReceive||3600;this.K=this.L=this.f=0;this.J=[];this.I=Hg;this.v=Ig;this.N=this.C="";this.da=this.Ha=this.Ga=null;this.R=-1;this.P=!Pa("Mobi")&&window&&"FileReader"in window}z(sc);var Hg="",Ig=0;k=sc.prototype;
k.je=function(a){this.f=this.f&-112|a&111};k.rd=function(){this.f&=-129;0<this.C.length&&oc(this.b,this.Y,1E3/Math.round(this.N/10));return this.K};k.ie=function(){};k.Kd=function(){return this.g};k.Be=function(a){128==(this.g&192)&&a&64&&oc(this.b,this.$,1E3/Math.round(this.R/10));this.g=this.g&-70|a&69};k.Jd=function(){return 0}; k.sa=function(a,b,c){var d=this,e=Ig;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
k.Ae=function(a){if(a&=255){E(this,"transmitByte("+l(a,2,!0)+")");this.L&&this.L.call(this.J,a);if(this.v)if(13==a)this.I=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.I&&this.I--;else{var b;b=(b=za[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.I%a,this.S&&(b=xa("",c)));this.P&&!this.I&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.I+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.j(this.F), function(){var a=d.G.listTapes;a&&Jg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Jg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;oc(this.b,this.$,1E3/Math.round(this.R/10))}};var Hg={},Fg=(Hg[65392]=[null,null,Y.prototype.sd,Y.prototype.je,"RCSR"],Hg[65394]=[null,null,Y.prototype.rd,Y.prototype.ie,"RBUF"],Hg[65396]=[null,null,Y.prototype.Kd,Y.prototype.Be,"XCSR"],Hg[65398]=[null,null,Y.prototype.Jd,Y.prototype.Ae,"XBUF"],Hg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Y(d);C(d,c)}}); k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Kg(a);var e=this;if((this.g=Uc(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=oc(56,4);this.ba=lc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.J.length&&(e.L=e.J[e.K++]&255,Lg(e,e.K/e.J.length*100),e.f|=128,e.f&=-2049,e.f&64&&mc(e.b,e.Y))});hc(b,this,Mg);Ng(this,"None",Hg,!0);this.P&&Ng(this,"Local Tape",
function tc(a){r.call(this,"PC11",a,tc);this.g=a.autoMount||null;this.F=0;this.$=a.baudReceive||3600;this.K=this.L=this.f=0;this.J=[];this.I=Ig;this.v=Jg;this.N=this.C="";this.ea=this.Ha=this.Ga=null;this.R=-1;this.P=!Pa("Mobi")&&window&&"FileReader"in window}w(tc);var Ig="",Jg=0;k=tc.prototype; "?");Ng(this,"Remote Tape","??");Og(this)||H(this)};k.Ea=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Da=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function Og(a){a.F=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=sa(b,!0)}b&&c?Pg(a,c,b,1,!0):Qg(a)}return!!a.F}
k.sa=function(a,b,c){var d=this,e=Jg;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(m){q("PC11 option error: "+m.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= function Jg(a,b,c,d,e){if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.I="??"}else a.I=c;Pg(a,b,c,d,!1,e)}else Rg(a,!1)}
function(){var a=d.G.listTapes;a&&Kg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Kg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; function Pg(a,b,c,d,e,f){var g=-1;if(a.C.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,Rg(a,!0),a.A.Ua?a.O("PC11 busy"):(e&&(a.F++,F(a)&&E(a,"auto-loading tape: "+b)),Sg(a,b,c,d,f)?g++:a.A.Ua=!0);g&&Tg(a,a.N,a.C,a.v,a.da,a.Ha,a.Ga)}
k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Lg(a);var e=this;if((this.g=Vc(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=pc(56,4);this.ca=mc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.J.length&&(e.L=e.J[e.K++]&255,Mg(e,e.K/e.J.length*100),e.f|=128,e.f&=-2049,e.f&64&&nc(e.b,e.Y))});ic(b,this,Ng);Og(this,"None",Ig,!0);this.P&&Og(this,"Local Tape", function Sg(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Tg(a,b,c,d,e),a.I="?");Qg(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Na,e,f),(e=Fa(e,f))&&Tg(a,b,c,d,e.da,e.Ha,
"?");Og(this,"Remote Tape","??");Pg(this)||G(this)};k.Ea=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Da=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function Pg(a){a.F=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=sa(b,!0)}b&&c?Qg(a,c,b,1,!0):Rg(a)}return!!a.F} e.Ga));a.A.Ua=!1;a.F&&(a.F--,a.F||H(a));Qg(a)})}function Ng(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Kg(a,b,c,d,e){if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.I="??"}else a.I=c;Qg(a,b,c,d,!1,e)}else Sg(a,!1)} function Qg(a){var b=a.G.listTapes;if(b&&b.options){a=a.I||a.C;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Lg(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
function Qg(a,b,c,d,e,f){var g=-1;if(a.C.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,Sg(a,!0),a.A.Ua?a.O("PC11 busy"):(e&&(a.F++,F(a)&&E(a,"auto-loading tape: "+b)),Tg(a,b,c,d,f)?g++:a.A.Ua=!0);g&&Ug(a,a.N,a.C,a.v,a.ea,a.Ha,a.Ga)} function Tg(a,b,c,d,e,f,g){a.N=b;a.C=c;a.v=d;a.da=e;a.Ha=f;a.Ga=g;2==d?a.S&&Bg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.N="",a.C="",a.I=Hg,a.v=Ig,a.O("No load address available for tape: "+b)):(a.K=0,a.J=e,a.status("tape attached: "+b),Lg(a,0))}function Rg(a,b){if(a.C||!1===b)a.N="",a.C="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.I=Hg,a.v=Ig,Qg(a))}k.save=function(){return(new R(this)).data()};k.restore=function(){return!0};k.kd=function(){return this.f&65534};
function Tg(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Ug(a,b,c,d,e),a.I="?");Rg(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Na,e,f),(e=Fa(e,f))&&Ug(a,b,c,d,e.ea,e.Ha, k.ce=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&mc(this.b,this.Y)):(this.f&=-129,this.f|=2048,this.L=0,nc(this.b,this.ba,1E3/Math.round(this.Z/10))));this.f=this.f&-66|a&65};k.jd=function(){this.f&=-129;this.f|=2048;return this.L};k.be=function(){};var Ug={},Mg=(Ug[65384]=[null,null,sc.prototype.kd,sc.prototype.ce,"PRS"],Ug[65386]=[null,null,sc.prototype.jd,sc.prototype.be,"PRB"],Ug);
e.Ga));a.A.Ua=!1;a.F&&(a.F--,a.F||G(a));Rg(a)})}function Og(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function Vg(a,b,c){u.call(this,"Disk",{id:a.Na+".disk"+p(++Wg,4)},Vg,2097152);this.controller=a;this.B=a.B;this.i=a.i;this.v=b;this.Sa=b.name;this.ac=b.ac;Xg(this,c,b.ta,b.ya,b.qa,b.Ia);H(this)}var Wg=0;z(Vg);k=Vg.prototype;k.Ca=function(a,b,c,d){this.i=d};
function Rg(a){var b=a.G.listTapes;if(b&&b.options){a=a.I||a.C;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Mg(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}} function Xg(a,b,c,d,e,f){a.mode=b;a.ta=c;a.ya=d;a.qa=e;a.Ia=f;a.b=[];if("preload"!=a.mode){b=Array(a.ta);for(c=0;c<b.length;c++){d=Array(a.ya);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=Yg(null,c,e,g,a.Ia,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
function Ug(a,b,c,d,e,f,g){a.N=b;a.C=c;a.v=d;a.ea=e;a.Ha=f;a.Ga=g;2==d?a.S&&Cg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.N="",a.C="",a.I=Ig,a.v=Jg,a.O("No load address available for tape: "+b)):(a.K=0,a.J=e,a.status("tape attached: "+b),Mg(a,0))}function Sg(a,b){if(a.C||!1===b)a.N="",a.C="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.I=Ig,a.v=Jg,Rg(a))}k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};k.ld=function(){return this.f&65534}; function Zg(a,b,c,d,e){var f=c;if(a.w)return!0;a.Sa=b;a.$a=c;a.Bc=sa(c);a.w=e;a.C=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=la[d];if(e){a.ta=e[0];a.ya=e[1];a.qa=e[2];a.Ia=e[3]||512;c=a.Ia>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ta);for(d=0;d<a.b.length;d++)for(var t=a.b[d]=Array(a.ya),w=0;w<t.length;w++)for(var y=t[w]=Array(a.qa),x=0;x<y.length;x++){for(var A=Yg(null,d,w,x+1,a.Ia,0),ka=A.data,Ja=0;Ja<c;Ja++,f+=4)var Q=ka[Ja]=b.getInt32(f,
k.ce=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&nc(this.b,this.Y)):(this.f&=-129,this.f|=2048,this.L=0,oc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.kd=function(){this.f&=-129;this.f|=2048;return this.L};k.be=function(){};var Vg={},Ng=(Vg[65384]=[null,null,tc.prototype.ld,tc.prototype.ce,"PRS"],Vg[65386]=[null,null,tc.prototype.kd,tc.prototype.be,"PRB"],Vg); !0),e=e+Q&-1;A.Aa=c;y[x]=A}a.f=e;c=a}else a.O("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Sa,a.$a),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ac?"":e)+"&format=json"));return!!Ea(f,
function Wg(a,b,c){r.call(this,"Disk",{id:a.Na+".disk"+l(++Xg,4)},Wg,2097152);this.controller=a;this.B=a.B;this.i=a.i;this.v=b;this.Sa=b.name;this.$b=b.$b;Yg(this,c,b.ta,b.ya,b.qa,b.Ia);G(this)}var Xg=0;w(Wg);k=Wg.prototype;k.Ca=function(a,b,c,d){this.i=d}; null,!0,function(b,c,d){$g(a,b,c,d)})}
function Yg(a,b,c,d,e,f){a.mode=b;a.ta=c;a.ya=d;a.qa=e;a.Ia=f;a.b=[];if("preload"!=a.mode){b=Array(a.ta);for(c=0;c<b.length;c++){d=Array(a.ya);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=Zg(null,c,e,g,a.Ia,0);d[e]=f}b[c]=d}a.b=b}a.f=null} function $g(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Sa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Na,b,c);try{if(0<sa(a.Bc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Sa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
function $g(a,b,c,d,e){var f=c;if(a.w)return!0;a.Sa=b;a.ab=c;a.Bc=sa(c);a.w=e;a.C=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=la[d];if(e){a.ta=e[0];a.ya=e[1];a.qa=e[2];a.Ia=e[3]||512;c=a.Ia>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ta);for(d=0;d<a.b.length;d++)for(var v=a.b[d]=Array(a.ya),x=0;x<v.length;x++)for(var z=v[x]=Array(a.qa),y=0;y<z.length;y++){for(var B=Zg(null,d,x,y+1,a.Ia,0),ja=B.data,Ja=0;Ja<c;Ja++,f+=4)var Q=ja[Ja]=b.getInt32(f, c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ta=h.length;a.ya=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ia=l&&l.length||512;for(d=c=0;d<a.ta;d++)for(f=0;f<a.ya;f++)for(g=0;g<a.qa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y<w;y++)t[y]=n;ah(l,t)}else r=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=r;delete l.bytes}Yg(l,d,f);for(w=
!0),e=e+Q&-1;B.Aa=c;z[y]=B}a.f=e;c=a}else a.O("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Sa,a.ab),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ta(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.$b?"":e)+"&format=json"));return!!Ea(f, 0;w<r.length;w++)c=c+r[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Sa)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.w&&(a.w.call(a.C,a.v,e,a.Sa,a.$a),a.w=null)}function Yg(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ge=b;a.He=c;a.Ma=a.Aa=0;a.Pa=!1;return a}
null,!0,function(b,c,d){ah(a,b,c,d)})} k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.Hc&&b<f.ya)for(h=g[b]=Array(f.Ic),g=0;g<h.length;g++)h[g]=Yg(null,a,b,g+1,f.vc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Hc&&9==f.jc&&(d=h[g]=Yg(null,a,b,f.jc,f.vc,0))}}e&&e(d,!1);return d};function ah(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
function ah(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Sa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Na,b,c);try{if(0<sa(a.Bc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Sa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ta=h.length;a.ya=h[0].length;a.qa=h[0][0].length;var m=h[0][0][0];a.Ia=m&&m.length||512;for(d=c=0;d<a.ta;d++)for(f=0;f<a.ya;f++)for(g=0;g<a.qa;g++)if(m=h[d][f][g]){var n=m.length;void 0===n&&(n=m.length=512);var n=n>>2,p=m.pattern;void 0===p&&(p=m.pattern=0);var u=m.data;if(void 0===u){var v=m.bytes;if(void 0!==v&&v.length){for(var x=n<<2,z=v.length;z<x;z++)v[z]=p;bh(m,v)}else u=[],p=m.pattern=p|p<<8|p<<16|p<<24,m.data=u;delete m.bytes}Zg(m,d,f);for(x=
0;x<u.length;x++)c=c+u[x]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Sa)}catch(y){q("Disk image error ("+b+"): "+y.message)}}a.w&&(a.w.call(a.C,a.v,e,a.Sa,a.ab),a.w=null)}function Zg(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ge=b;a.He=c;a.Ma=a.Aa=0;a.Pa=!1;return a}
k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.Hc&&b<f.ya)for(h=g[b]=Array(f.Ic),g=0;g<h.length;g++)h[g]=Zg(null,a,b,g+1,f.vc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Hc&&9==f.ic&&(d=h[g]=Zg(null,a,b,f.ic,f.vc,0))}}e&&e(d,!1);return d};function bh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Aa?f<a.Ma?(a.Aa+=a.Ma-f,a.Ma=f):f>=a.Ma+a.Aa&&(a.Aa+=f-(a.Ma+a.Aa)+1):(a.Ma=f,a.Aa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Aa?f<a.Ma?(a.Aa+=a.Ma-f,a.Ma=f):f>=a.Ma+a.Aa&&(a.Aa+=f-(a.Ma+a.Aa)+1):(a.Ma=f,a.Aa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function ch(a,b){var c=a.ya*a.qa,d=b/c|0;return d<a.ta?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function dh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e} function bh(a,b){var c=a.ya*a.qa,d=b/c|0;return d<a.ta?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function ch(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
k.save=function(){var a=0,b=[];b[a++]=[this.ab,this.f,this.ta,this.ya,this.qa,this.Ia];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Aa){for(var h=[],m=0,n=g.Ma,p=g.Ma+g.Aa;n<p;)h[m++]=g.data[n++];b[a++]=[d,e,f,g.Ma,h]}}return b}; k.save=function(){var a=0,b=[];b[a++]=[this.$a,this.f,this.ta,this.ya,this.qa,this.Ia];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Aa){for(var h=[],l=0,m=g.Ma,n=g.Ma+g.Aa;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Ma,h]}}return b};
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?Yg(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],m=g[f++],n=g[f++];if(h>=this.b.length||m>=this.b[h].length||n>=this.b[h][m].length){c="sector (CHS="+h+":"+m+":"+n+") out of range ("+ k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?Xg(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][m][n]){for(m=h.data.length;m<e;)h.data[m++]=h.pattern;m=0;h.Ma=e;for(h.Aa=f.length;e<g;)h.data[e++]=f[m++];b++}}}0>b&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Sa+": "+c);return b}; b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.Ma=e;for(h.Aa=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Sa+": "+c);return b};
k.toJSON=function(){var a;a=0;for(var b;b=ch(this,a++);)eh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; k.toJSON=function(){var a;a=0;for(var b;b=bh(this,a++);)dh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function eh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){r.call(this,"RL11",a,N,2097152);this.v=a.autoMount||null;this.I=0;this.f=Array(1);this.L=!Pa("Mobi")&&window&&"FileReader"in window}w(N);k=N.prototype; function dh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function O(a){u.call(this,"RL11",a,O,2097152);this.v=a.autoMount||null;this.I=0;this.f=Array(1);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(O);k=O.prototype;
k.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&fh(d,a)},!0;case "loadDrive":return this.G[b]= k.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&eh(d,a)},!0;case "loadDrive":return this.G[b]=
c,c.onclick=function(){var a=d.G.listDisks;a&&gh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[qa(a.value,10)||0])if(a=a.Ba){var b;b="";for(var c=0,h;h=ch(a,c++);)for(var m=0,n=h.length;m<n;m++)b+=String.fromCharCode(dh(a,h,m));b=btoa(b);a=a.Bc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"), c,c.onclick=function(){var a=d.G.listDisks;a&&fh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[ma(a.value,10)||0])if(a=a.Ba){var b;b="";for(var c=0,h;h=bh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(ch(a,h,l));b=btoa(b);a=a.Bc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.O("No disk loaded in drive.");else d.O("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= "string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.O("No disk loaded in drive.");else d.O("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;gh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;fh(d,sa(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;if((this.v=Vc(this.B,"autoMount")||this.v)&&"string"==typeof this.v)try{this.v=eval("("+this.v+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.v+")"),this.v=null}hh(this);this.P=pc(112,5);ic(b,this,ih);jh(this,"None","",!0);this.L&&jh(this,"Local Disk","?");jh(this,"Remote Disk","??");kh(this)||G(this)}; k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;if((this.v=Uc(this.B,"autoMount")||this.v)&&"string"==typeof this.v)try{this.v=eval("("+this.v+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.v+")"),this.v=null}gh(this);this.P=oc(112,5);hc(b,this,hh);ih(this,"None","",!0);this.L&&ih(this,"Local Disk","?");ih(this,"Remote Disk","??");jh(this)||H(this)};
k.Ea=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.mc){for(a=0;a<this.f.length;a++)lh(this,a,!0);kh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;1>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";fh(this,0)}}return!0};k.Da=function(a){return a?this.save():!0};k.reset=function(){hh(this)};k.save=function(){return(new P(this)).data()}; k.Ea=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.oc){for(a=0;a<this.f.length;a++)kh(this,a,!0);jh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;1>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";eh(this,0)}}return!0};k.Da=function(a){return a?this.save():!0};k.reset=function(){gh(this)};k.save=function(){return(new R(this)).data()};
k.restore=function(a){return hh(this,a[0])};function kh(a,b){b||(a.I=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!mh(a,g,f,e,!0)&&b&&G(a,!1);continue}a.O("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.I} k.restore=function(a){return gh(this,a[0])};function jh(a,b){b||(a.I=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=sa(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!lh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.O("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.I}
function gh(a,b,c,d){var e=a.G.listDrives,e=e&&qa(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}mh(a,e,b,c,!1,d)}else lh(a,e)} function fh(a,b,c,d){var e=a.G.listDrives,e=e&&ma(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}lh(a,e,b,c,!1,d)}else kh(a,e)}
function mh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.ab.toLowerCase()!=d.toLowerCase()&&(g++,lh(a,b,!0),h.Zb?a.O("RL11 busy"):(h.Zb=!0,e&&(h.Yb=!0,a.I++,F(a)&&E(a,"auto-loading disk: "+c)),h.Lb=!!f,$g(new Wg(a,h,"preload"),c,d,f,a.Kc)&&g++));return g} function lh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.$a.toLowerCase()!=d.toLowerCase()&&(g++,kh(a,b,!0),h.$b?a.O("RL11 busy"):(h.$b=!0,e&&(h.Zb=!0,a.I++,F(a)&&E(a,"auto-loading disk: "+c)),h.Kb=!!f,Zg(new Vg(a,h,"preload"),c,d,f,a.Kc)&&g++));return g}
k.Kc=function(a,b,c,d,e){var f;a.Zb=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ta||f[1]>a.ya)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.ac)),b=null);b?(a.Ba=b,a.Sa=c,a.ab=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.ac),a.Yb||e),this.B&&this.B.lb()):a.Lb=!1;a.Yb&&(a.Yb=!1,--this.I||G(this));fh(this,a.ac)}; k.Kc=function(a,b,c,d,e){var f;a.$b=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ta||f[1]>a.ya)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.bc)),b=null);b?(a.Ba=b,a.Sa=c,a.$a=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.bc),a.Zb||e),this.B&&this.B.kb()):a.Kb=!1;a.Zb&&(a.Zb=!1,--this.I||H(this));eh(this,a.bc)};
function jh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function ih(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function fh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=qa(a.value,10),c=c.Lb?"?":c.ab,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function lh(a,b,c){var d=a.f[b];if(d.Ba||!1===c)d.Sa="",d.ab="",d.Ba=null,d.Lb=!1,c||(a.O("Drive RL"+b+" unloaded",c),fh(a,b))} function eh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=ma(a.value,10),c=c.Kb?"?":c.$a,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function kh(a,b,c){var d=a.f[b];if(d.Ba||!1===c)d.Sa="",d.$a="",d.Ba=null,d.Kb=!1,c||(a.O("Drive RL"+b+" unloaded",c),eh(a,b))}
function hh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.J=b[c++]||0;a.g=b[c++]||0;a.C=b[c++]||0;a.F=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.ac=b;d.Zb=d.Lb=!1;d.name=c.cb;d.ta=512;d.ya=2;d.qa=40;d.Ia=256;d.$b=!0;d.Fe=0;d.Ee=0;d.De=0;d.ic=1;d.Ic=d.qa;d.vc=d.Ia;d.Ie=0;d.Ke=null;d.Ba||(d.ab="");d.status=29|(512==d.ta?128:0)}return!0} function gh(a,b){var c=0;b||(b=[]);a.ea=b[c++]||0;a.J=b[c++]||0;a.g=b[c++]||0;a.C=b[c++]||0;a.F=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.bc=b;d.$b=d.Kb=!1;d.name=c.cb;d.ta=512;d.ya=2;d.qa=40;d.Ia=256;d.ac=!0;d.Fe=0;d.Ee=0;d.jc=1;d.Ic=d.qa;d.vc=d.Ia;d.Ie=0;d.Ke=null;d.Ba||(d.$a="");d.status=29|(512==d.ta?128:0)}return!0}
k.Lc=function(a,b,c,d,e,f){this.J=f&65535;this.fa=this.fa&-49|f>>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.F=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; k.Lc=function(a,b,c,d,e,f){this.J=f&65535;this.ea=this.ea&-49|f>>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.F=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0};
k.Yc=function(a,b,c,d,e,f,g){for(var h=0,m=a.Ba,n=null,p;e--;){if(!n){n=a.Ba.seek(b,c,d,!0);if(!n){h=5120;break}p=0}var u,v;if(0>(u=a.Ba.read(n,p++))||0>(v=a.Ba.read(n,p++))){h=5120;break}this.w.Ib(Pd(this.b,f),u|v<<8);if(lc(this.w)){h=8192;break}f+=2;if(p>=m.Ia&&(n=null,++d>=m.qa&&(d=0,++c>=m.ya&&(c=0,++b>=m.ta)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.Xc=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ba,m=null,n;e--;){if(!m){m=a.Ba.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ba.read(m,n++))||0>(t=a.Ba.read(m,n++))){h=5120;break}this.w.ab(f,r|t<<8);if(kc(this.w)){h=8192;break}f+=2;if(n>=l.Ia&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ta)))){h=5120;break}}return g(h,b,c,d,e,f)};
k.Sd=function(a,b,c,d,e,f,g){for(var h=0,m=a.Ba,n=null,p;e--;){var u=this.w.ib(Pd(this.b,f));if(lc(this.w)){h=8192;break}f+=2;if(!n){n=a.Ba.seek(b,c,d,!0);if(!n){h=5120;break}p=0}if(!a.Ba.write(n,p++,u&255)||!a.Ba.write(n,p++,u>>8)){h=5120;break}if(p>=m.Ia&&(n=null,++d>=m.qa&&(d=0,++c>=m.ya&&(c=0,++b>=m.ta)))){h=5120;break}}return g(h,b,c,d,e,f)};k.vd=function(){return this.fa&65535}; k.Sd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ba,m=null,n;e--;){var r=this.w.oa(f);if(kc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ba.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ba.write(m,n++,r&255)||!a.Ba.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ia&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ta)))){h=5120;break}}return g(h,b,c,d,e,f)};k.ud=function(){return this.ea&65535};
k.me=function(a){this.fa=this.fa&-1023|a&1022;this.N=this.N&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.F=c.status|this.C&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.C=this.g&4?this.C+b:this.C-b,this.g=this.C=this.C&65408|c);break;case 8:this.F=this.C;break;case 12:b=this.Yc;case 10:b||(b=this.Sd),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ta||f>=c.qa?this.fa|=37888: k.me=function(a){this.ea=this.ea&-1023|a&1022;this.N=this.N&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.F=c.status|this.C&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.C=this.g&4?this.C+b:this.C-b,this.g=this.C=this.C&65408|c);break;case 8:this.F=this.C;break;case 12:b=this.Xc;case 10:b||(b=this.Sd),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ta||f>=c.qa?this.ea|=37888:
(g=(this.K&63)<<16|this.J,a=65536-this.F&65535,a=b.call(this,c,d,e,f,a,g,this.Lc.bind(this)))}a&&(this.fa|=129,this.fa&64&&nc(this.b,this.P))}};k.td=function(){return this.J};k.ke=function(a){this.J=a&65534};k.wd=function(){return this.g};k.ne=function(a){this.g=a};k.xd=function(){return this.F};k.oe=function(a){this.F=a};k.ud=function(){return this.K};k.le=function(a){this.K=a&63}; (g=(this.K&63)<<16|this.J,a=65536-this.F&65535,a=b.call(this,c,d,e,f,a,g,this.Lc.bind(this)))}a&&(this.ea|=129,this.ea&64&&mc(this.b,this.P))}};k.sd=function(){return this.J};k.ke=function(a){this.J=a&65534};k.vd=function(){return this.g};k.ne=function(a){this.g=a};k.wd=function(){return this.F};k.oe=function(a){this.F=a};k.td=function(){return this.K};k.le=function(a){this.K=a&63};
var nh={},ih=(nh[63744]=[null,null,N.prototype.vd,N.prototype.me,"RLCS"],nh[63746]=[null,null,N.prototype.td,N.prototype.ke,"RLBA"],nh[65284]=[null,null,N.prototype.wd,N.prototype.ne,"RLDA"],nh[65286]=[null,null,N.prototype.xd,N.prototype.oe,"RLMP"],nh[65288]=[null,null,N.prototype.ud,N.prototype.le,"RLBE"],nh);function oh(a){r.call(this,"Debugger",a,oh);this.$=a.base||16;this.za=!1;this.J=0;this.P=!1;this.v=-1;this.g=[];this.S={}}w(oh); var mh={},hh=(mh[63744]=[null,null,O.prototype.ud,O.prototype.me,"RLCS"],mh[63746]=[null,null,O.prototype.sd,O.prototype.ke,"RLBA"],mh[65284]=[null,null,O.prototype.vd,O.prototype.ne,"RLDA"],mh[65286]=[null,null,O.prototype.wd,O.prototype.oe,"RLMP"],mh[65288]=[null,null,O.prototype.td,O.prototype.le,"RLBE"],mh);function nh(a){u.call(this,"Debugger",a,nh);this.Z=a.base||16;this.za=!1;this.J=0;this.P=!1;this.v=-1;this.g=[];this.S={}}z(nh);
var ph={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};oh.prototype.pc=function(){return-1};oh.prototype.qc=function(){}; var oh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};nh.prototype.qc=function(){return-1};nh.prototype.rc=function(){};
function qh(a,b,c,d){if(c)if(b){0>a.v&&a.g.length&&(a.v=0);if(0>a.v||b!=a.g[a.v])a.g.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.g[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a} function ph(a,b,c,d){if(c)if(b){0>a.v&&a.g.length&&(a.v=0);if(0>a.v||b!=a.g[a.v])a.g.splice(0,0,b),a.v=0;a.v--}else a.P?b="end":b=a.g[a.v+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ya(b.substring(c,f))),c=f+1}}return a}
function rh(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 qh(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} 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 sh(a,b,c){var d;if(b){b=th(a,b);for(var e=0,f=!1,g=b,h=[],m=[],n=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<n.length;){var p=n[e++],u=p.length,p=ya(p);if(!p){f=!0;break}p=uh(a,p,null,!1===c);if(void 0===p){f=!0;c=!1;break}h.push(p);if(e==n.length)break;var p=n[e++],v=p.length;m.length&&ph[p]<ph[m[m.length-1]]&&rh(h,m,1);m.push(p);b=b.substr(u+v)}rh(h,m)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&vh(a,null, function rh(a,b,c){var d;if(b){b=sh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=ya(n);if(!n){f=!0;break}n=th(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],t=n.length;l.length&&oh[n]<oh[l[l.length-1]]&&qh(h,l,1);l.push(n);b=b.substr(r+t)}qh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&uh(a,null,
d))}return d}function th(a,b){for(var c,d=a.za?"(":"{",e=a.za?")":"}",f=new RegExp(a.za?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=sh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a} d))}return d}function sh(a,b){for(var c,d=a.za?"(":"{",e=a.za?")":"}",f=new RegExp(a.za?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=rh(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
function uh(a,b,c,d){var e;null!=b?(e=a.pc(b),0<=e?e=a.qc(e):(e=a.S[b],null==e&&(e=qa(b,a.$))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e} function th(a,b,c,d){var e;null!=b?(e=a.qc(b),0<=e?e=a.rc(e):(e=a.S[b],null==e&&(e=ma(b,a.Z))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
function vh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var m=d&255,n=8,p="";n?32<n&&(n=32):n=32;if(null==m||isNaN(m))for(;0<n--;)p="?"+p;else for(;0<n--;)p=(m&1?"1":"0")+p,m>>=1;g=p+g;d>>=8}d=l(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function wh(a,b){if(b)return vh(a,b,a.S[b]);var c=0;for(b in a.S)vh(a,b,a.S[b]),c++;return 0<c} function uh(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function vh(a,b){if(b)return uh(a,b,a.S[b]);var c=0;for(b in a.S)uh(a,b,a.S[b]),c++;return 0<c}
function J(a,b,c,d){switch(a.$){case 8:a=ra(b,3*c);break;case 10:a=b.toString();break;default:a=l(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d} function J(a,b,c,d){switch(a.Z){case 8:a=ra(b,3*c);break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
function xh(a){oh.call(this,a);this.fb=!1;this.za=!0;this.K=Z(0);this.eb=Z(0);this.N=Z(0);this.I=[];this.f=this.L=this.C=[];yh(this);this.na=0;zh(this);this.Ja={};Ah(this,a.messages);this.Ka=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Yc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Yc(b,a)})}w(xh,oh); function wh(a){nh.call(this,a);this.fb=!1;this.za=!0;this.K=Z(0);this.eb=Z(0);this.N=Z(0);this.I=[];this.f=this.L=this.C=[];xh(this);this.ma=0;yh(this);this.Ja={};zh(this,a.messages);this.Ka=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Xc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Xc(b,a)})}z(wh,nh);
var Bh={"?":"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"},Ch=".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(" "), var Ah={"?":"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"},Bh=".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(" "),
Dh={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], Ch={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74, 33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,
63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Eh=[0],Fh= 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]}},Dh=[0],Eh=
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=xh.prototype; [58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=wh.prototype;
k.Ca=function(a,b,c,d){this.w=b;this.b=c;this.B=a;(a=Vc(a,"messages"))&&Ah(this,a);this.ob=Dh;this.Ab=1145>this.b.qb?Fh:[];Gh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.ba(Hh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.la;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,n=0;m--;){var p=b[e];p.type==c?n++||d.j("..."):(c=p.type,n=fc[c],p&&d.j(l(p.id,8)+" %"+l(e<<d.w.la, k.Ca=function(a,b,c,d){this.w=b;this.b=c;this.B=a;(a=Uc(a,"messages"))&&zh(this,a);this.nb=Ch;this.Ab=1145>this.b.qb?Eh:[];Fh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(Gh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=dc[c],n&&d.j(p(n.id,8)+" %"+p(e<<d.w.ka,
8)+" %%"+l(p.D,8)+" "+l(p.Jb,4,!0)+" "+l(p.size,4,!0)+" "+n),c!=Hc&&(c=-1),n=0);a+=d.w.xa;e++}}});G(this)}; 8)+" %%"+p(n.D,8)+" "+p(n.Hb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=Gc&&(c=-1),m=0);a+=d.w.xa;e++}}});H(this)};
k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Yc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.v<d.g.length-1&&(b=d.g[++d.v])):40==a.keyCode&&(0<d.v?b=d.g[--d.v]:(b="",d.v=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ra(c,function(){if(d.ma){var a=d.ma.value; k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.la=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Xc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.v<d.g.length-1&&(b=d.g[++d.v])):40==a.keyCode&&(0<d.v?b=d.g[--d.v]:(b="",d.v=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.G[b]=c,Ra(c,function(){if(d.la){var a=d.la.value;
d.ma.value="";Yc(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ra(c,function(a){var b=!1;sb(d,!0)||(rb(d,!0),b=d.xb(a?1:0),rb(d,!1));return b}),!0}return!1};k.lb=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.D;null==a&&(a=-1);return a};k.Db=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Mb?this.w.Pb(d):this.b.Pb(d),b&&Ih(a,b));return c}; d.la.value="";Xc(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ra(c,function(a){var b=!1;sb(d,!0)||(rb(d,!0),b=d.xb(a?1:0),rb(d,!1));return b}),!0}return!1};k.kb=function(a){if(this.la){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.la.focus();!a&&window&&window.scrollTo(b,c)}};k.aa=function(a){a=a&&a.D;null==a&&(a=-1);return a};k.Bb=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Lb?this.w.Pb(d):this.b.Pb(d),b&&Hh(a,b));return c};
k.pa=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Mb?this.w.ib(d):this.b.ib(d),b&&Ih(a,b));return c};k.Sb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Mb?this.w.kb(d,b):this.b.kb(d,b),c&&Ih(a,c),this.B.da(!0))};k.mb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Mb?this.w.Ib(d,b):this.b.Ib(d,b),c&&Ih(a,c),this.B.da(!0))};function Z(a,b){return{D:a,Mb:b,La:!1}}function Jh(a){return[a.D,a.La]}function Kh(a){return{D:a[0],La:a[1]}} k.oa=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Lb?this.w.pb(d):this.b.pb(d),b&&Hh(a,b));return c};k.Sb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Lb?this.w.jb(d,b):this.b.jb(d,b),c&&Hh(a,c),this.B.ca(!0))};k.ab=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Lb?this.w.Tb(d,b):this.b.Tb(d,b),c&&Hh(a,c),this.B.ca(!0))};function Z(a,b){return{D:a,Lb:b,La:!1}}function Ih(a){return[a.D,a.La]}function Jh(a){return{D:a[0],La:a[1]}}
function Hh(a,b,c){var d,e=(c?a.K:a.eb).D;c=!1;if(void 0!==b){b=th(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.I.length;e++){var g=a.I[e].ha[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=sh(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Lh(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Fc=qh(a,b.Ac=c[2]))}function Ih(a,b){null!=a.D&&(a.D+=b||1)} function Gh(a,b,c){var d,e=(c?a.K:a.eb).D;c=!1;if(void 0!==b){b=sh(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.I.length;e++){var g=a.I[e].ha[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=rh(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Kh(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Fc=ph(a,b.Ac=c[2]))}function Hh(a,b){null!=a.D&&(a.D+=b||1)}
function Ah(a,b){a.i=a;a.oa=a.Jc=536870912;a.ca=null;a.ua=[];b=qh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in xb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.oa|=xb[c],a.j(c+" messages enabled"))}}function Gh(a,b){for(var c in xb)if(64==xb[c]){a.Ja[c]=b;break}} function zh(a,b){a.i=a;a.na=a.Jc=536870912;a.ba=null;a.ua=[];b=ph(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in xb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.na|=xb[c],a.j(c+" messages enabled"))}}function Fh(a,b){for(var c in xb)if(64==xb[c]){a.Ja[c]=b;break}}
k.pc=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 Mh(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.qc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ra[a-8]:20>a?b=this.b.Fa[a-16]:20==a&&(b=Cb(this.b)));return b}; k.qc=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 Lh(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.rc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ra[a-8]:20>a?b=this.b.Fa[a-16]:20==a&&(b=Cb(this.b)));return b};
k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Hb).D));this.oa&1073741824?this.ua.push(a):this.ca&&a==this.ca||(this.ca=a,this.oa&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,dd(a),a.ua=0,a.B.da()))};function zh(a){var b;if(!ce(a))a.F&&a.F.length&&a.j("instruction history buffer freed"),a.Y=0,a.F=[];else if(!a.F||!a.F.length){a.F=Array(1E3);for(b=0;b<a.F.length;b++)a.F[b]=Z();a.Y=0;a.j("instruction history buffer allocated")}} k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Fb).D));this.na&1073741824?this.ua.push(a):this.ba&&a==this.ba||(this.ba=a,this.na&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,cd(a),a.ua=0,a.B.ca()))};function yh(a){var b;if(!ae(a))a.F&&a.F.length&&a.j("instruction history buffer freed"),a.Y=0,a.F=[];else if(!a.F||!a.F.length){a.F=Array(1E3);for(b=0;b<a.F.length;b++)a.F[b]=Z();a.Y=0;a.j("instruction history buffer allocated")}}
k.wb=function(a,b){if(!Nh(this,b))return!1;this.b.wb(a);return!0};k.xb=function(a,b,c){if(!Nh(this))return!1;this.J=0;a||ce(this)&&de(this,this.b.u[7],0);try{a=ed(this.b,a);var d=this.b.xb(a);0<d&&(fd(this.b,a),this.J+=d,bd(this.b,d,!0),Zc(this.b,d),this.va++)}catch(e){"number"!=typeof e&&(this.J=0,vb(this.b,e.stack||e.message))}!1!==c&&this.B.da();this.da(b||!1);return 0<this.J};k.ja=function(a){this.b&&this.b.ja(a)}; k.wb=function(a,b){if(!Mh(this,b))return!1;this.b.wb(a);return!0};k.xb=function(a,b,c){if(!Mh(this))return!1;this.J=0;a||ae(this)&&be(this,this.b.u[7],0);try{a=dd(this.b,a);var d=this.b.xb(a);0<d&&(ed(this.b,a),this.J+=d,ad(this.b,d,!0),Yc(this.b,d),this.va++)}catch(e){"number"!=typeof e&&(this.J=0,vb(this.b,e.stack||e.message))}!1!==c&&this.B.ca();this.ca(b||!1);return 0<this.J};k.ja=function(a){this.b&&this.b.ja(a)};
k.da=function(a){if(this.fb){void 0===a&&(a=!0);var b;b=this.b;if(b=b.H&8?b.Tc|b.Sc<<8:0){var c=b>>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Z(this.b.u[7]);a&&1!=this.R?Oh(this):Ph(this)}};function Nh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.ga?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ea=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.ca=function(a){if(this.fb){void 0===a&&(a=!0);var b;b=this.b;if(b=b.H&8?b.Tc|b.Rc<<8:0){var c=b>>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Z(this.b.u[7]);a&&1!=this.R?Nh(this):Oh(this)}};function Mh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.ga?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ea=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
k.Da=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){zh(this);this.va=0;this.ca=null;this.J=0;this.K=Z(this.b.u[7]);this.A.ga=!1;Qh(this);a||this.da()};k.save=function(){var a=new P(this);a.set(0,Jh(this.K));a.set(1,Jh(this.N));a.set(2,[this.g,this.P,this.oa]);a.set(3,this.I);return a.data()}; k.Da=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){yh(this);this.va=0;this.ba=null;this.J=0;this.K=Z(this.b.u[7]);this.A.ga=!1;Ph(this);a||this.ca()};k.save=function(){var a=new R(this);a.set(0,Ih(this.K));a.set(1,Ih(this.N));a.set(2,[this.g,this.P,this.na]);a.set(3,this.I);return a.data()};
k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Kh(a[b++]),this.N=Kh(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.P=a[b][1],this.oa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.A.ga=!0;this.Bb=a;this.Cb=b}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Jh(a[b++]),this.N=Jh(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.P=a[b][1],this.na|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.A.ga=!0;this.Jb=a;this.Mb=b};
k.stop=function(a,b){if(this.A.ga){this.A.ga=!1;this.J=b-this.Cb;if(!this.R){b="stopped";if(this.J){a-=this.Bb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";ce(this)&&(b+=this.va+" instructions, ",this.va=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}this.da(!0);this.lb();Qh(this,this.b.u[7]);this.ca=null}};function ce(a){return 1<a.f.length||!!a.na} k.stop=function(a,b){if(this.A.ga){this.A.ga=!1;this.J=b-this.Mb;if(!this.R){b="stopped";if(this.J){a-=this.Jb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";ae(this)&&(b+=this.va+" instructions, ",this.va=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}this.ca(!0);this.kb();Ph(this,this.b.u[7]);this.ba=null}};function ae(a){return 1<a.f.length||!!a.ma}
function de(a,b,c){var d=-1;c||(d=a.b.ib(b),0==d&&(b=qd(a.b,2)));if(0<c&&(a.na&&!--a.na||Qc(a,b,1,a.f)))return!0;0<=c&&a.F.length&&(a.va++,0>d&&(d=a.b.ib(b)),65535!=(d&65535)&&(c=a.F[a.Y],c.D=b,c.La=!1,++a.Y==a.F.length&&(a.Y=0)));return!1}function dc(a){var b=a.b;if(b.A.ga)throw O(b,a.b.Hb),a.ja(),-1;return!1} function be(a,b,c){var d=-1;c||(d=a.b.pb(b),0==d&&(b=pd(a.b,2)));if(0<c&&(a.ma&&!--a.ma||Pc(a,b,1,a.f)))return!0;0<=c&&a.F.length&&(a.va++,0>d&&(d=a.b.pb(b)),65535!=(d&65535)&&(c=a.F[a.Y],c.D=b,c.La=!1,++a.Y==a.F.length&&(a.Y=0)));return!1}function jc(a){var b=a.b;if(b.A.ga)throw P(b,a.b.Fb),a.ja(),-1;return!1}
function yh(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b<a.L.length;b++){c=a.L[b];var d=a.w;c=a.ba(c);Rc(d.W[c>>>d.la],!1)}a.L=["br"];if(a.C)for(b=1;b<a.C.length;b++)c=a.C[b],d=a.w,c=a.ba(c),Rc(d.W[c>>>d.la],!0);a.C=["bw"];a.bb=0}k.hb=function(a,b,c){var d=!0;c||Rh(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.D)),d=!1;else{var f=this.w;f.W[e>>>f.la].hb(e&f.w,a==this.C)}}d&&(a.push(b),c?b.La=!0:(Sh(this,a,a.length-1,"set"),zh(this)));return d}; function xh(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b<a.L.length;b++){c=a.L[b];var d=a.w;c=a.aa(c);Qc(d.W[c>>>d.ka],!1)}a.L=["br"];if(a.C)for(b=1;b<a.C.length;b++)c=a.C[b],d=a.w,c=a.aa(c),Qc(d.W[c>>>d.ka],!0);a.C=["bw"];a.bb=0}k.gb=function(a,b,c){var d=!0;c||Qh(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.D)),d=!1;else{var f=this.w;f.W[e>>>f.ka].gb(e&f.w,a==this.C)}}d&&(a.push(b),c?b.La=!0:(Rh(this,a,a.length-1,"set"),yh(this)));return d};
function Rh(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.La)){f=!0;h.La||e||Sh(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Rc(d.W[c>>>d.la],b==a.C));h.La||zh(a);break}}return f}function Th(a,b){for(var c=1;c<b.length;c++)Sh(a,b,c);return b.length-1}function Sh(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.D)+(d?" "+d:c.Ac?' "'+c.Ac+'"':""))} function Qh(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.aa(h)&&(!d||h.La)){f=!0;h.La||e||Rh(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Qc(d.W[c>>>d.ka],b==a.C));h.La||yh(a);break}}return f}function Sh(a,b){for(var c=1;c<b.length;c++)Rh(a,b,c);return b.length-1}function Rh(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.D)+(d?" "+d:c.Ac?' "'+c.Ac+'"':""))}
function Qh(a,b){if(void 0!==b)Qc(a,b,1,a.f,!0),a.R=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.La){if(!Rh(a,a.f,c,!0))break;b=0}}} function Ph(a,b){if(void 0!==b)Pc(a,b,1,a.f,!0),a.R=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.La){if(!Qh(a,a.f,c,!0))break;b=0}}}
function Qc(a,b,c,d,e){var f=!1;if(!a.bb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.La)for(var m=a.ba(h),n=0;n<c;n++)if(b+n==m){var p,f=!0;h.La&&(Rh(a,d,h,!0),e=!0);if(p=h.Fc){for(var f=!1,u=0;u<p.length;u++)if(!Uh(a,p[u],!0)){if(p[u].indexOf("if")){f=!0;break}for(var v=u+1;v<p.length&&p[v].indexOf("else");v++)u++;if(v==p.length){f=!0;break}}a.b.A.ga||(f=!0)}if(f){e||Sh(a,d,g,"hit");break}}}a.bb--;return f} function Pc(a,b,c,d,e){var f=!1;if(!a.bb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.La)for(var l=a.aa(h),m=0;m<c;m++)if(b+m==l){var n,f=!0;h.La&&(Qh(a,d,h,!0),e=!0);if(n=h.Fc){for(var f=!1,r=0;r<n.length;r++)if(!Th(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var t=r+1;t<n.length&&n[t].indexOf("else");t++)r++;if(t==n.length){f=!0;break}}a.b.A.ga||(f=!0)}if(f){e||Rh(a,d,g,"hit");break}}}a.bb--;return f}
function Vh(a,b,c,d){var e=Z(b.D),f=a.pa(b,2),g,h;for(h in a.ob)if(g=a.ob[h][f&h])break;g||(g=Eh);var m=g[0];0<=a.Ab.indexOf(m)&&(g=Eh,m=g[0]);var n=h="",p=Ch[m],u=g.length-1;m||u||(h=J(a,f));for(m=1;m<=u;m++){var v=g[m];if(void 0!==v){var x;x=a;var z=v,v=b,y="",B=z&61440;if(4096==B)v=v.D+((f&255)<<24>>23)&65535,y=J(x,v);else if(8192==B)v=v.D-((f&63)<<1)&65535,y=J(x,v);else if(12288==B)y=J(x,f&7,1);else if(24576==B)y=J(x,f&63,1);else if(32768==B)y=J(x,f&255,1);else if(B=f&z,z&4032&&(B>>=6,z>>=6), function Uh(a,b,c,d){var e=Z(b.D),f=a.oa(b,2),g,h;for(h in a.nb)if(g=a.nb[h][f&h])break;g||(g=Dh);var l=g[0];0<=a.Ab.indexOf(l)&&(g=Dh,l=g[0]);var m=h="",n=Bh[l],r=g.length-1;l||r||(h=J(a,f));for(l=1;l<=r;l++){var t=g[l];if(void 0!==t){var w;w=a;var y=t,t=b,x="",A=y&61440;if(4096==A)t=t.D+((f&255)<<24>>23)&65535,x=J(w,t);else if(8192==A)t=t.D-((f&63)<<1)&65535,x=J(w,t);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6),
z&63)switch(z=B&7,B&56){case 0:y=Mh(z);break;case 8:y="@"+Mh(z);break;case 16:7>z?y="("+Mh(z)+")+":(B=x.pa(v,2),y="#"+J(x,B,0,!0));break;case 24:7>z?y="@("+Mh(z)+")+":(B=x.pa(v,2),y="@#"+J(x,B,0,!0));break;case 32:y="-("+Mh(z)+")";break;case 40:y="@-("+Mh(z)+")";break;case 48:B=x.pa(v,2);y=J(x,B,0,!0)+"("+Mh(z)+")";7==z&&(y=J(x,B+v.D&65535));break;case 56:B=x.pa(v,2),y="@"+J(x,B)+"("+Mh(z)+")",7==z&&(y="@"+J(x,B+v.D&65535))}x=y;if(!x||!x.length){h="INVALID";break}"string"!=typeof x&&(n=x[1],x=x[0]); y&63)switch(y=A&7,A&56){case 0:x=Lh(y);break;case 8:x="@"+Lh(y);break;case 16:7>y?x="("+Lh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Lh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Lh(y)+")";break;case 40:x="@-("+Lh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Lh(y)+")";7==y&&(x=J(w,A+t.D&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Lh(y)+")",7==y&&(x="@"+J(w,A+t.D&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
0<h.length&&(h+=",");h+=x||"???"}}f="";g=J(a,e.D)+":";if(-1!==e.D&&-1!==b.D){do if(f+=" "+J(a,a.pa(e,2)),null==e.D)break;while(e.D!=b.D)}g+=xa(f,24);g+=xa(p,5);h&&(g+=" "+h);if(c||n)g=xa(g,60)+";"+(c||""),g=a.b.A.pb?g+("cycles="+$c(a.b).toString()+" cs="+l(a.b.Eb)):g+(null!=d?"="+d.toString():""),n&&(g+=" @"+n);return g}function Wh(a,b){switch(b){case "N":a=a.b.Qa();break;case "Z":a=od(a.b);break;case "V":a=nd(a.b);break;case "C":a=md(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "} 0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.D)+":";if(-1!==e.D&&-1!==b.D){do if(f+=" "+J(a,a.oa(e,2)),null==e.D)break;while(e.D!=b.D)}g+=xa(f,24);g+=xa(n,5);h&&(g+=" "+h);if(c||m)g=xa(g,60)+";"+(c||""),g=a.b.A.ob?g+("cycles="+Zc(a.b).toString()+" cs="+p(a.b.Cb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function Vh(a,b){switch(b){case "N":a=a.b.Qa();break;case "Z":a=nd(a.b);break;case "V":a=md(a.b);break;case "C":a=ld(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
function Xh(a,b){var c="",d=a.b;8>b?(c=Mh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ra[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Fa[b-16]):20==b&&(c="PS="+J(a,Cb(d)));c&&(c+=" ");return c}function Yh(a){var b,c="";for(b=0;6>b;b++)c+=Xh(a,b);c=c+"\n"+(Xh(a,6)+Xh(a,7)+Xh(a,20));return c+=Wh(a,"T")+Wh(a,"N")+Wh(a,"Z")+Wh(a,"V")+Wh(a,"C")}k.jc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}; function Wh(a,b){var c="",d=a.b;8>b?(c=Lh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ra[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Fa[b-16]):20==b&&(c="PS="+J(a,Cb(d)));c&&(c+=" ");return c}function Xh(a){var b,c="";for(b=0;6>b;b++)c+=Wh(a,b);c=c+"\n"+(Wh(a,6)+Wh(a,7)+Wh(a,20));return c+=Vh(a,"T")+Vh(a,"N")+Vh(a,"Z")+Vh(a,"V")+Vh(a,"C")}k.kc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function gg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var m=h.o,n=h.a;if(void 0!==m){var p=f,m=[m>>>0,g],u=Aa(p,m,a.jc);0>u&&p.splice(-(u+1),0,m)}n&&(h.a=n.replace(/''/g,'"'))}a.I.push({Je:b,D:c,Rc:d,ha:e,hc:f})}function Zh(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.D>>>0,h=f.Rc;if(e>=g&&e<g+h){e=Aa(f.hc,[e-g],a.jc);0<=e?$h(a,b,e,d):c&&(e=~e,$h(a,b,e-1,d),$h(a,b,e,d));break}}return d} function fg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=Aa(n,l,a.kc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Je:b,D:c,Sc:d,ha:e,ic:f})}function Yh(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.D>>>0,h=f.Sc;if(e>=g&&e<g+h){e=Aa(f.ic,[e-g],a.kc);0<=e?Zh(a,b,e,d):c&&(e=~e,Zh(a,b,e-1,d),Zh(a,b,e,d));break}}return d}
function $h(a,b,c,d){var e={},f=a.I[b].hc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ha[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function ai(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return wh(a)||a.j("no variables"),!0;if(!c[2])return wh(a,c[1]);if(!c[3])return delete a.S[c[1]],!0;b=sh(a,c[3]);return void 0!==b?(a.S[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1} function Zh(a,b,c,d){var e={},f=a.I[b].ic,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ha[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function $h(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return vh(a)||a.j("no variables"),!0;if(!c[2])return vh(a,c[1]);if(!c[3])return delete a.S[c[1]],!0;b=rh(a,c[3]);return void 0!==b?(a.S[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
function bi(a,b,c){var d=null;if(b=Hh(a,b,!0)){a.ba(b);var e=Zh(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.D-e[1])&&(g=" + "+l(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.D)&&(g=" - "+l(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d} function ai(a,b,c){var d=null;if(b=Gh(a,b,!0)){a.aa(b);var e=Yh(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.D-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.D)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
function Oh(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=sh(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":O(d,f);a.K=Z(d.u[7]);break;case "N":d.X=f?32768:0;break;case "Z":d.aa= function Nh(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.j("missing value for "+b[1]);return}f=rh(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":P(d,f);a.K=Z(d.u[7]);break;case "N":d.X=f?32768:0;break;case "Z":d.$=
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=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.j("unknown register: "+e);return}a.B.da();a.j("updated registers:")}a.j(Yh(a));c&&(a.K=Z(d.u[7]),Ph(a,J(a,a.K.D)))}}function ci(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):vh(a,null,c[2].charCodeAt(0)):sh(a,b,!0)} f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=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.j("unknown register: "+e);return}a.B.ca();a.j("updated registers:")}a.j(Xh(a));c&&(a.K=Z(d.u[7]),Oh(a,J(a,a.K.D)))}}function bi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):uh(a,null,c[2].charCodeAt(0)):rh(a,b,!0)}
function di(a,b,c){var d="t"!=b;c=uh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Qa(c,function(){return rb(a,!0)&&a.xb(e,d,!1)},function(){a.B.da();rb(a,!1)})} function ci(a,b,c){var d="t"!=b;c=th(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Qa(c,function(){return rb(a,!0)&&a.xb(e,d,!1)},function(){a.B.ca();rb(a,!1)})}
function Ph(a,b,c,d){if(b=Hh(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=uh(a,c.substr(1)),null!=c&&(d=c);else{d=Hh(a,c,!0);if(!d||d.D<b.D)return;e=d.D-b.D;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=sb(a,!1)||a.R?a.J:null;var g=null!=f?"cycles":null,h=Zh(a,b),m=b.D;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var n=h[0]+":";h[2]&&(n+=" "+h[2]);a.j(n)}h[3]&&(g=h[3],f=null);f=Vh(a,b,g,f);a.j(f);a.K=b;e-=b.D-m;c++}}} function Oh(a,b,c,d){if(b=Gh(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=th(a,c.substr(1)),null!=c&&(d=c);else{d=Gh(a,c,!0);if(!d||d.D<b.D)return;e=d.D-b.D;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=sb(a,!1)||a.R?a.J:null;var g=null!=f?"cycles":null,h=Yh(a,b),l=b.D;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=Uh(a,b,g,f);a.j(f);a.K=b;e-=b.D-l;c++}}}
function Uh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.P&&(a.j("ended assemble at "+J(a,a.N.D)),a.K=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ca=null;if(tb(a)&&0<b.length){a.P&&(b="a "+J(a,a.N.D)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],m=h.charAt(0),n=1;n<h.length;n++){var p=h.charAt(n);if("?"==m||"r"==m||"a">p||"z"<p){g[0]=h.substr(n);g.unshift(h.substr(0,n));break}}switch(g[0].charAt(0)){case "a":var u= function Th(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.P&&(a.j("ended assemble at "+J(a,a.N.D)),a.K=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ba=null;if(tb(a)&&0<b.length){a.P&&(b="a "+J(a,a.N.D)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var r=
Hh(a,g[1],!0);if(u)if(a.N=u,void 0===g[2])a.j("begin assemble at "+J(a,u.D)),a.P=!0,a.B.da();else{var v;a.j("not supported yet");v=[];if(v.length){for(var x=0;x<v.length;x++)a.Sb(u,v[x],1);a.j(Vh(a,a.N))}}break;case "b":a:{var z=g[0],y=g[1],B=b;if("?"==y)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"), Gh(a,g[1],!0);if(r)if(a.N=r,void 0===g[2])a.j("begin assemble at "+J(a,r.D)),a.P=!0,a.B.ca();else{var t;a.j("not supported yet");t=[];if(t.length){for(var w=0;w<t.length;w++)a.Sb(r,t[w],1);a.j(Uh(a,a.N))}}break;case "b":a:{var y=g[0],x=g[1],A=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ja=z.charAt(1);if("l"==ja){var Ja;Ja=0+Th(a,a.f);Ja+=Th(a,a.L);(Ja+=Th(a,a.C))||a.j("no breakpoints")}else if("n"==ja)a.na=uh(a,y),a.j("break after "+a.na+" instruction(s)");else if(void 0===y)a.j("missing breakpoint address");else{var Q=Z();if("*"!=y&&(Q=Hh(a,y,!0),!Q))break a;"c"==ja?null==Q.D?(yh(a),a.j("all breakpoints cleared")):Rh(a,a.f,Q)||Rh(a,a.L,Q)||Rh(a,a.C,Q)||a.j("breakpoint missing: "+J(a,Q.D)):null!=Q.D&&(Lh(a,Q,B),"p"==ja?a.hb(a.f, a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ka=y.charAt(1);if("l"==ka){var Ja;Ja=0+Sh(a,a.f);Ja+=Sh(a,a.L);(Ja+=Sh(a,a.C))||a.j("no breakpoints")}else if("n"==ka)a.ma=th(a,x),a.j("break after "+a.ma+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var Q=Z();if("*"!=x&&(Q=Gh(a,x,!0),!Q))break a;"c"==ka?null==Q.D?(xh(a),a.j("all breakpoints cleared")):Qh(a,a.f,Q)||Qh(a,a.L,Q)||Qh(a,a.C,Q)||a.j("breakpoint missing: "+J(a,Q.D)):null!=Q.D&&(Kh(a,Q,A),"p"==ka?a.gb(a.f,
Q):"r"==ja?a.hb(a.L,Q):"w"==ja?a.hb(a.C,Q):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var db,eb=g[0],ma=g[1],La=g[2],wi=g[3];if("?"==ma){var fb="";for(db in xb)a.Ja[db]&&(fb&&(fb+=","),fb+=db);fb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history"); Q):"r"==ka?a.gb(a.L,Q):"w"==ka?a.gb(a.C,Q):a.j("unknown breakpoint command: "+ka))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var cb,db=g[0],na=g[1],La=g[2],vi=g[3];if("?"==na){var eb="";for(cb in xb)a.Ja[cb]&&(eb&&(eb+=","),eb+=cb);eb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
fb.length&&a.j("dump extension commands:\n\t"+fb)}else if("state"==ma){var jg=ei(a.B,!0);"console"==La?console.log(jg):(a.Oa&&(a.Oa.value=""),a.j(jg))}else if("symbols"==ma)for(var yd=0;yd<a.I.length;yd++){var zd=a.I[yd],gb;for(gb in zd.ha)if("."!=gb.charAt(0)){var kg=zd.ha[gb].o;if(void 0!==kg){var lg=zd.ha[gb].l;lg&&(gb=lg);a.j(J(a,kg)+" "+gb)}}}else{if("d"==eb){for(db in xb)if(g[1]==db){var mg=a.Ja[db];mg?(g.shift(),g.shift(),mg(g)):a.j("no dump registered for "+ma);break a}ma||(eb=a.Nb||"db")}else a.Nb= eb.length&&a.j("dump extension commands:\n\t"+eb)}else if("state"==na){var ig=di(a.B,!0);"console"==La?console.log(ig):(a.Oa&&(a.Oa.value=""),a.j(ig))}else if("symbols"==na)for(var xd=0;xd<a.I.length;xd++){var yd=a.I[xd],fb;for(fb in yd.ha)if("."!=fb.charAt(0)){var jg=yd.ha[fb].o;if(void 0!==jg){var kg=yd.ha[fb].l;kg&&(fb=kg);a.j(J(a,jg)+" "+fb)}}}else{if("d"==db){for(cb in xb)if(g[1]==cb){var lg=a.Ja[cb];lg?(g.shift(),g.shift(),lg(g)):a.j("no dump registered for "+na);break a}na||(db=a.Ob||"db")}else a.Ob=
eb;if("dh"==eb){var ng=ma,og=La,pg="",qg=0,fa=a.Y,na=a.F;if(na.length){var aa=+ng||a.gb,Eb=+og||10;isNaN(aa)?aa=Eb:pg="more ";aa>na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);fa-=aa;0>fa&&(null==na[na.length-1].D?(aa=fa+aa,fa=0):fa+=na.length);var Ad=[];"call"==og&&(Eb=1E5,Ad=["CALL"]);for(void 0!==ng&&a.j(aa+" instructions earlier:");0<Eb&&fa!=a.Y;){var rg=na[fa++];if(null==rg.D)break;var Fb=Z(rg.D),xi=aa--,sg=Vh(a,Fb,"history",xi);(!Ad.length||0<=sg.indexOf(Ad[0]))&&a.j(sg); db;if("dh"==db){var mg=na,ng=La,og="",pg=0,ga=a.Y,oa=a.F;if(oa.length){var ba=+mg||a.lb,Eb=+ng||10;isNaN(ba)?ba=Eb:og="more ";ba>oa.length&&(a.j("note: only "+oa.length+" available"),ba=oa.length);ga-=ba;0>ga&&(null==oa[oa.length-1].D?(ba=ga+ba,ga=0):ga+=oa.length);var zd=[];"call"==ng&&(Eb=1E5,zd=["CALL"]);for(void 0!==mg&&a.j(ba+" instructions earlier:");0<Eb&&ga!=a.Y;){var qg=oa[ga++];if(null==qg.D)break;var Fb=Z(qg.D),wi=ba--,rg=Uh(a,Fb,"history",wi);(!zd.length||0<=rg.indexOf(zd[0]))&&a.j(rg);
Fb.Xb&&(fa+=Fb.Xb,Eb-=Fb.Xb,aa-=Fb.Xb);fa>=na.length&&(fa=0);a.gb=aa;qg++;Eb--}}qg||(a.j("no "+pg+"history available"),a.gb=void 0)}else{var Gb=Hh(a,ma);if(Gb){var wc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||wi),wc=uh(a,La)>>>0,65536<wc&&(wc=65536));for(var Hb="",hb="dd"==eb?4:"dw"==eb?2:1,xc=hb*wc||128,yi=xc+15>>4||1;yi--&&0<xc;){var yc=0,Ib=0,Jb,Bd="",tg="",ma=J(a,Gb.D);for(Jb=4==hb?16:a.$;0<Jb&&0<xc;Jb--){var zc=1,Ac=1==hb?a.Db(Gb,zc):a.pa(Gb,zc=2),yc=yc|Ac<<(Ib<<3),Ib=Ib+zc;Ib==hb&&(Bd+=J(a, Fb.Yb&&(ga+=Fb.Yb,Eb-=Fb.Yb,ba-=Fb.Yb);ga>=oa.length&&(ga=0);a.lb=ba;pg++;Eb--}}pg||(a.j("no "+og+"history available"),a.lb=void 0)}else{var Gb=Gh(a,na);if(Gb){var wc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||vi),wc=th(a,La)>>>0,65536<wc&&(wc=65536));for(var Hb="",gb="dd"==db?4:"dw"==db?2:1,xc=gb*wc||128,xi=xc+15>>4||1;xi--&&0<xc;){var yc=0,Ib=0,Jb,Ad="",sg="",na=J(a,Gb.D);for(Jb=4==gb?16:a.Z;0<Jb&&0<xc;Jb--){var zc=1,Ac=1==gb?a.Bb(Gb,zc):a.oa(Gb,zc=2),yc=yc|Ac<<(Ib<<3),Ib=Ib+zc;Ib==gb&&(Ad+=J(a,
yc,hb),Bd+=1==hb?9==Jb?"-":" ":" ",yc=Ib=0);tg+=32<=Ac&&128>Ac?String.fromCharCode(Ac):".";xc-=zc}Hb&&(Hb+="\n");Hb+=ma+" "+Bd+(0==Jb?" "+tg:"")}Hb&&a.j(Hb);a.eb=Gb}}}}break;case "e":if("else"==g[0])break;var ib,Cd,Dd,Ed,Fd=g[0],Gd=g[1];"eb"==Fd?(ib=1,Cd=255,Dd=a.Db,Ed=a.Sb):"e"==Fd||"ew"==Fd?(ib=2,Cd=65535,Dd=a.pa,Ed=a.mb):Gd=null;if(null==Gd)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Bc=Hh(a,Gd);if(Bc)for(var Cc= yc,gb),Ad+=1==gb?9==Jb?"-":" ":" ",yc=Ib=0);sg+=32<=Ac&&128>Ac?String.fromCharCode(Ac):".";xc-=zc}Hb&&(Hb+="\n");Hb+=na+" "+Ad+(0==Jb?" "+sg:"")}Hb&&a.j(Hb);a.eb=Gb}}}}break;case "e":if("else"==g[0])break;var hb,Bd,Cd,Dd,Ed=g[0],Fd=g[1];"eb"==Ed?(hb=1,Bd=255,Cd=a.Bb,Dd=a.Sb):"e"==Ed||"ew"==Ed?(hb=2,Bd=65535,Cd=a.oa,Dd=a.ab):Fd=null;if(null==Fd)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Bc=Gh(a,Fd);if(Bc)for(var Cc=
2;Cc<g.length;Cc++){var Kb=sh(a,g[Cc]);if(void 0===Kb){a.j("unrecognized value: "+g[Cc]);break}Kb&~Cd&&a.j("warning: "+l(Kb)+" exceeds "+ib+"-byte value");var zi=Dd.call(a,Bc);a.j("changing "+J(a,Bc.D)+" from "+J(a,zi,ib)+" to "+J(a,Kb,ib));Ed.call(a,Bc,Kb,ib)}}break;case "g":a:{var ug=g[1],Ai=b;if(void 0!==ug){var Hd=Hh(a,ug,!0);if(!Hd)break a;Lh(a,Hd,Ai);a.hb(a.f,Hd,!0)}a.wb(!0,c)}break;case "h":a.A.ga?(c||a.j("halting"),a.ja()):sb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Id; 2;Cc<g.length;Cc++){var Kb=rh(a,g[Cc]);if(void 0===Kb){a.j("unrecognized value: "+g[Cc]);break}Kb&~Bd&&a.j("warning: "+p(Kb)+" exceeds "+hb+"-byte value");var yi=Cd.call(a,Bc);a.j("changing "+J(a,Bc.D)+" from "+J(a,yi,hb)+" to "+J(a,Kb,hb));Dd.call(a,Bc,Kb,hb)}}break;case "g":a:{var tg=g[1],zi=b;if(void 0!==tg){var Gd=Gh(a,tg,!0);if(!Gd)break a;Kh(a,Gd,zi);a.gb(a.f,Gd,!0)}a.wb(!0,c)}break;case "h":a.A.ga?(c||a.j("halting"),a.ja()):sb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Hd;
var Lb=b.substr(2),Lb=ya(Lb);sh(a,Lb)?(c||a.j("true: "+Lb),Id=!0):(c||a.j("false: "+Lb),Id=!1);Id||(d=!1);break}f=!0;break;case "k":var Bi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Jd=0,Kd=Z(),Mb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Mb.D));10>Jd;){for(var Ma=null,Ci=256;65536>Mb.D>>>0;){Kd.D=a.pa(Mb,2);if(null==Mb.D||!Ci--)break;if(!(Kd.D&1)){for(var Di=a,Dc=Kd,vg=null,Nb=Dc.D,wg=Nb,Ld=1;6>=Ld&&Nb;Ld++){if(2< var Lb=b.substr(2),Lb=ya(Lb);rh(a,Lb)?(c||a.j("true: "+Lb),Hd=!0):(c||a.j("false: "+Lb),Hd=!1);Hd||(d=!1);break}f=!0;break;case "k":var Ai=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Id=0,Jd=Z(),Mb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Mb.D));10>Id;){for(var Ma=null,Bi=256;65536>Mb.D>>>0;){Jd.D=a.oa(Mb,2);if(null==Mb.D||!Bi--)break;if(!(Jd.D&1)){for(var Ci=a,Dc=Jd,ug=null,Nb=Dc.D,vg=Nb,Kd=1;6>=Kd&&Nb;Kd++){if(2<
Ld){Dc.D=Nb;var Ec=Vh(Di,Dc);if(0<=Ec.indexOf("JSR")){var xg=Ec.indexOf(" ");if(Nb+(Ec.indexOf(" ",xg+1)-xg-1)/2==wg){vg=Ec;break}}}Nb-=2}Dc.D=wg;if(Ma=vg)break}}if(!Ma||null==Ma)break;var yg=null;if("ks"==Bi){var zg=Ma.match(/[0-9A-F]+$/);zg&&(yg=bi(a,zg[0]))}Ma=xa(Ma,50)+" ;"+(yg||"stack="+J(a,Mb.D));a.j(Ma);Jd++}Jd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){bi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,H=g[1];"?"==H&&(H=void 0);if(void 0!==H){var Da=0;if("all"== Kd){Dc.D=Nb;var Ec=Uh(Ci,Dc);if(0<=Ec.indexOf("JSR")){var wg=Ec.indexOf(" ");if(Nb+(Ec.indexOf(" ",wg+1)-wg-1)/2==vg){ug=Ec;break}}}Nb-=2}Dc.D=vg;if(Ma=ug)break}}if(!Ma||null==Ma)break;var xg=null;if("ks"==Ai){var yg=Ma.match(/[0-9A-F]+$/);yg&&(xg=ai(a,yg[0]))}Ma=xa(Ma,50)+" ;"+(xg||"stack="+J(a,Mb.D));a.j(Ma);Id++}Id||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){ai(a,g[1],!0);break}f=!0;break;case "m":a:{var pa,qa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"==
H)Da=1878917119,H=null;else if("on"==H)pa=!0,H=null;else if("off"==H)pa=!1,H=null;else{"keys"==H&&(H="key");"kbd"==H&&(H="keyboard");for(oa in xb)if(H==oa){Da=xb[oa];pa=!!(a.oa&Da);break}if(!Da){a.j("unknown message category: "+H);break a}}if(Da)if("on"==g[2])a.oa|=Da,pa=!0;else if("off"==g[2]&&(a.oa&=~Da,pa=!1,1073741824==Da)){for(var Md=0;Md<a.ua.length;Md++)a.j(a.ua[Md]);a.ua=[]}}var Ei=0,Ob="";for(oa in xb)if(!H||H==oa){var Fi=!!(a.oa&xb[oa]);if(null===pa||pa==Fi)Ob&&(Ob+=","),++Ei%10||(Ob+="\n\t"), G)Da=1878917119,G=null;else if("on"==G)qa=!0,G=null;else if("off"==G)qa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(pa in xb)if(G==pa){Da=xb[pa];qa=!!(a.na&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.na|=Da,qa=!0;else if("off"==g[2]&&(a.na&=~Da,qa=!1,1073741824==Da)){for(var Ld=0;Ld<a.ua.length;Ld++)a.j(a.ua[Ld]);a.ua=[]}}var Di=0,Ob="";for(pa in xb)if(!G||G==pa){var Ei=!!(a.na&xb[pa]);if(null===qa||qa==Ei)Ob&&(Ob+=","),++Di%10||(Ob+="\n\t"),
"key"==oa&&(oa="keys"),Ob+=oa}void 0===H&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Ob||"none"));zh(a)}break;case "p":if("print"==g[0]){ci(a,b.substr(5));break}var Gi="pr"==g[0]?1:0;if(a.R)a.j("step in progress");else{var Ag=Z(a.b.u[7]);a.Db(Ag);a.R?(a.hb(a.f,Ag,!0),a.wb()||(a.B&&a.B.lb(),a.R=0)):di(a,Gi?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}Oh(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Pb= "key"==pa&&(pa="keys"),Ob+=pa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==qa?qa?"messages on: ":"messages off: ":"message categories:\n\t")+(Ob||"none"));yh(a)}break;case "p":if("print"==g[0]){bi(a,b.substr(5));break}var Fi="pr"==g[0]?1:0;if(a.R)a.j("step in progress");else{var zg=Z(a.b.u[7]);a.Bb(zg);a.R?(a.gb(a.f,zg,!0),a.wb()||(a.B&&a.B.kb(),a.R=0)):ci(a,Fi?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}Nh(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Pb=
+g[2];if(8==Pb||10==Pb||16==Pb)a.$=Pb;else{a.j("invalid base: "+Pb);break}}a.j("default base: "+a.$);break;case "cs":var Qb;void 0!==g[3]&&(Qb=+g[3]);switch(g[2]){case "int":a.b.rb=Qb;break;case "start":a.b.Fb=Qb;break;case "stop":a.b.sb=Qb;break;default:a.j("unknown cs option");break a}void 0!==Qb&&Xc(a.b);a.j("checksums "+(a.b.A.pb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(ad(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.jb.toFixed(2)+ +g[2];if(8==Pb||10==Pb||16==Pb)a.Z=Pb;else{a.j("invalid base: "+Pb);break}}a.j("default base: "+a.Z);break;case "cs":var Qb;void 0!==g[3]&&(Qb=+g[3]);switch(g[2]){case "int":a.b.rb=Qb;break;case "start":a.b.Db=Qb;break;case "stop":a.b.sb=Qb;break;default:a.j("unknown cs option");break a}void 0!==Qb&&Wc(a.b);a.j("checksums "+(a.b.A.ob?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&($c(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.hb.toFixed(2)+
"Mhz")+" ("+a.b.Xa+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":di(a,g[0],g[1]);break;case "u":Ph(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ai(a,b.substr(3))||(d=!1);break}if("ver"== "Mhz")+" ("+a.b.Xa+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":ci(a,g[0],g[1]);break;case "u":Oh(a,g[1],g[2],8);break;case "v":if("var"==g[0]){$h(a,b.substr(3))||(d=!1);break}if("ver"==
g[0]){a.j("PDPjs version 1.30.2 ("+a.b.qb+",RELEASE"+(wb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){ci(a,b.substr(1));break}var Nd="commands:",Od;for(Od in Bh)Nd+="\n"+xa(Od,9)+Bh[Od];ce(a)||(Nd+="\nnote: history disabled if no exec breakpoints");a.j(Nd);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Bg){a.j("debugger error: "+(Bg.stack||Bg.message)),d=!1}return d} g[0]){a.j("PDPjs version 1.30.2 ("+a.b.qb+",RELEASE"+(wb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){bi(a,b.substr(1));break}var Md="commands:",Nd;for(Nd in Ah)Md+="\n"+xa(Nd,9)+Ah[Nd];ae(a)||(Md+="\nnote: history disabled if no exec breakpoints");a.j(Md);break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Ag){a.j("debugger error: "+(Ag.stack||Ag.message)),d=!1}return d}
function Yc(a,b,c){b=qh(a,b,c);for(var d in b)if(!Uh(a,b[+d]))return!1;return!0}Xa(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new xh(d);C(d,c)}}); function Xc(a,b,c){b=ph(a,b,c);for(var d in b)if(!Th(a,b[+d]))return!1;return!0}Xa(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new wh(d);C(d,c)}});
function fi(a,b,c){r.call(this,"Computer",a,fi,67108864);this.A.ia=!1;gi(this,b);this.L=Vc(this,"autoPower",a);this.B=0;this.Y=a.busWidth||a.buswidth;this.f=hi;this.J=null;this.F=this.R=!1;this.$=Vc(this,"url")||"";(Math.random()+.1).toString(36);this.g=ii(this);if(this.b=qb("CPU",this.id)){this.i=qb("Debugger",this.id);this.w=new Db({id:this.Na+".bus",busWidth:this.Y},this.b,this.i);var d,e=ob(this.id);if((this.v=qb("Panel",this.id))&&this.v.Oa)for(b=0;b<e.length;b++)d=e[b],d.O=this.v.O,d.j=this.v.j, function ei(a,b,c){u.call(this,"Computer",a,ei,67108864);this.A.ia=!1;fi(this,b);this.L=Uc(this,"autoPower",a);this.B=0;this.Y=a.busWidth||a.buswidth;this.f=gi;this.J=null;this.F=this.R=!1;this.Z=Uc(this,"url")||"";(Math.random()+.1).toString(36);this.g=hi(this);if(this.b=qb("CPU",this.id)){this.i=qb("Debugger",this.id);this.w=new Db({id:this.Na+".bus",busWidth:this.Y},this.b,this.i);var d,e=ob(this.id);if((this.v=qb("Panel",this.id))&&this.v.Oa)for(b=0;b<e.length;b++)d=e[b],d.O=this.v.O,d.j=this.v.j,
d.Oa=this.v.Oa;this.j("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ca&&d.Ca(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.I=d:this.f=parseInt(d,10));var f;if(a=Vc(this,"state")||(f=!0,a.state))b=this.N=a,f||(this.F=!0,this.f=hi),this.f&&(this.K= d.Oa=this.v.Oa;this.j("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ca&&d.Ca(this,this.w,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.I=d:this.f=parseInt(d,10));var f;if(a=Uc(this,"state")||(f=!0,a.state))b=this.N=a,f||(this.F=!0,this.f=gi),this.f&&(this.K=
new P(this,"1.30.2"),ji(this.K)?b=null:delete this.K);!b&&this.f&&(b=ki(this))&&(this.F=!0);if(b){var g=this;Ea(b,null,!0,function(a,b,c){c?(g.I=null,g.F=!1,g.O("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.J=b,g.R=!0);G(g)})}else G(this);this.G.power||(this.L=!0);!c&&this.L&&li(this,this.Gb)}else q("Unable to find CPU component")}w(fi);var hi=0; new R(this,"1.30.2"),ii(this.K)?b=null:delete this.K);!b&&this.f&&(b=ji(this))&&(this.F=!0);if(b){var g=this;Ea(b,null,!0,function(a,b,c){c?(g.I=null,g.F=!1,g.O("Unable to load machine state from server (error "+c+(b?": "+ya(b):"")+")")):(g.J=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&ki(this,this.Eb)}else q("Unable to find CPU component")}z(ei);var gi=0;
function gi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function Vc(a,b,c){var d=b.toLowerCase(),d=bb[b]||bb[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function li(a,b,c){for(var d=ob(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!tb(f)){tb(f,function(){li(a,b,c)});return}}b.call(a,c)} function fi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function Uc(a,b,c){var d=b.toLowerCase(),d=bb[b]||bb[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ki(a,b,c){for(var d=ob(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!tb(f)){tb(f,function(){ki(a,b,c)});return}}b.call(a,c)}
function mi(a,b){var c=new P(a,"1.30.2","validate");if(ji(c)&&ni(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.O("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=fi.prototype; function li(a,b){var c=new R(a,"1.30.2","validate");if(ii(c)&&mi(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.O("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=ei.prototype;
k.Gb=function(a){void 0===a&&(a=this.f||(this.J?1:hi));if(!this.B){this.B++;var b=!1,c=!1;this.P=!1;var d=this.K||new P(this,"1.30.2");if(-1==a)b=!0;else if(a>hi){if(ji(d,this.J)){this.C=new P(this,"1.30.2","failsafe");ji(this.C)&&(oi(this,d),a=2,pi(this.C));this.C.set("timestamp",Ca());qi(this.C);var e=this.f&&!this.F;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ni(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ji(d,g):("error"== k.Eb=function(a){void 0===a&&(a=this.f||(this.J?1:gi));if(!this.B){this.B++;var b=!1,c=!1;this.P=!1;var d=this.K||new R(this,"1.30.2");if(-1==a)b=!0;else if(a>gi){if(ii(d,this.J)){this.C=new R(this,"1.30.2","failsafe");ii(this.C)&&(ni(this,d),a=2,oi(this.C));this.C.set("timestamp",Ca());pi(this.C);var e=this.f&&!this.F;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=mi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ii(d,g):("error"==
f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.g=null)):this.j(f+": "+g),pi(d),ji(d)?(c=ni(d),e=!0):c=!1))}e&&mi(this,c?d:null)}else 2==a&&d.clear()}else mi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=ri(this,g,d,b,c));b=[d,a,c];-1!=a?li(this,this.lc,b):this.lc(b)}}; f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.g=null)):this.j(f+": "+g),oi(d),ii(d)?(c=mi(d),e=!0):c=!1))}e&&li(this,c?d:null)}else 2==a&&d.clear()}else li(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=qi(this,g,d,b,c));b=[d,a,c];-1!=a?ki(this,this.mc,b):this.mc(b)}};
function ri(a,b,c,d,e){if(!b.A.ia){b.A.ia=!0;if(b.Ea){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.Ea(f,d)&&f&&(q("Unable to restore state for "+b.type),a.N&&!a.R?(c.clear(),a.f=hi,window&&window.location.reload()):a.P=!0,b.Ea(null),e=!1)}if(!d&&b.nc)for(a=b.nc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function qi(a,b,c,d,e){if(!b.A.ia){b.A.ia=!0;if(b.Ea){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.Ea(f,d)&&f&&(q("Unable to restore state for "+b.type),a.N&&!a.R?(c.clear(),a.f=gi,window&&window.location.reload()):a.P=!0,b.Ea(null),e=!1)}if(!d&&b.nc)for(a=b.nc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
k.lc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(ri(this,this.b,b,c,a),this.b.nb());this.P&&(oi(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.B=0}; k.mc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ba=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(qi(this,this.b,b,c,a),this.b.mb());this.P&&(ni(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.B=0};
function oi(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} function ni(a,b){if(Ha("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.Z;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}}
function ei(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Da&&(c&&a.b.ja(),d=a.b.Da(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=ob(a.id),m=0;m<h.length;m++){var n=h[m];n.A.ia&&(n.Da&&(d=n.Da(b,c),"object"===typeof d&&f.set(n.id, function di(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new R(a,"1.30.2"),g=new R(a,"1.30.2","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Da&&(c&&a.b.ja(),d=a.b.Da(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;l<h.length;l++){var m=h[l];m.A.ia&&(m.Da&&(d=m.Da(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(n.A.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&si(a,a.g,f.toString()),qi(g)&&qi(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.A.ia=!1,b=a.G.power)&&(b.textContent="Power");a.B=0;return e}k.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());for(var a=ob(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())}}; d)),c&&(m.A.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&ri(a,a.g,f.toString()),pi(g)&&pi(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.A.ia=!1,b=a.G.power)&&(b.textContent="Power");a.B=0;return e}k.reset=function(){this.w&&this.w.reset&&(E(this,"Resetting "+this.w.type),this.w.reset());for(var a=ob(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())}};
k.start=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.da(!0)};k.stop=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.da(!0)}; k.start=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ca(!0)};k.stop=function(a,b){for(var c=ob(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ca(!0)};
k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.B||(d.A.ia?ei(d,!1,!0):li(d,d.Gb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.B)if(d.f&&!d.I){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ei(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.mc=!0),d.Gb(hi),d.mc=!1)}else d.reset(),d.b&&d.b.nb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c); k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.B||(d.A.ia?di(d,!1,!0):ki(d,d.Eb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.A.ia&&!d.B)if(d.f&&!d.I){var a=Ha("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");di(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.oc=!0),d.Eb(gi),d.oc=!1)}else d.reset(),d.b&&d.b.mb()},!0;case "save":if(ua(Ga(),"pcjs.org"))c.parentNode.removeChild(c);
else return this.G[b]=c,c.onclick=function(){var a=ii(d,!0);if(a){var b=!!(d.f&&!d.I||d.N),c=ei(d,b);b?si(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1}; else return this.G[b]=c,c.onclick=function(){var a=hi(d,!0);if(a){var b=!!(d.f&&!d.I||d.N),c=di(d,b);b?ri(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1};
function ii(a,b){var c=a.g;c||((c=Na("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=ti(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c} function hi(a,b){var c=a.g;c||((c=Na("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=si(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c}
function ti(a,b){a.g=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function ki(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+ui(a,"1.30.2"));return b} function si(a,b){a.g=null;b=Ea(Ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Oa("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function ji(a){var b=null;a.g&&(b=Ga()+"/api/v1/user?req=load&user="+a.g+"&state="+ti(a,"1.30.2"));return b}
function si(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ui(a,"1.30.2");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.O("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.O(c),Oa("user",""),a.g=null)}} function ri(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ti(a,"1.30.2");d.data=c;b=Ea(Ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.O("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.O(c),Oa("user",""),a.g=null)}}
function Lg(a){var b;a=ob(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.lb=function(a){if(this.Oa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Oa.focus();!a&&window&&window.scrollTo(b,c)}};k.da=function(a){this.b&&this.b.da(a);this.v&&this.v.da(a)}; function Kg(a){var b;a=ob(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.kb=function(a){if(this.Oa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Oa.focus();!a&&window&&window.scrollTo(b,c)}};k.ca=function(a){this.b&&this.b.ca(a);this.v&&this.v.ca(a)};
Xa(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new fi(g,d,!0);C(g,f);g.L&&li(g,g.Gb)}});Sa.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=qb("Computer",c.id))&&c.ca&&!c.A.ia&&c.Gb(-1)}}); Xa(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new ei(g,d,!0);C(g,f);g.L&&ki(g,g.Eb)}});Sa.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.ba&&!c.A.ia&&c.Eb(-1)}});
Sa.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=qb("Computer",c.id))&&c.A.ia&&ei(c,!(!c.f||c.I),!0)}});function P(a,b,c){this.id=a.id;this.key=ui(a,b,c);this.i=a.i;pi(this,a.Qc)}function ui(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} Sa.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=qb("Computer",c.id))&&c.A.ia&&di(c,!(!c.f||c.I),!0)}});function R(a,b,c){this.id=a.id;this.key=ti(a,b,c);this.i=a.i;oi(this,a.Qc)}function ti(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){pi(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, R.prototype={constructor:R,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){oi(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 pi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function qi(a){var b=!0;if(Ka()){var c=JSON.stringify(a[a.id]);Oa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ni(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function ji(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ka()&&(b=Na(a.key))?(a[a.id]=b,a.b=!0):!1}var vi=0; 1);c=0}}};function oi(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function pi(a){var b=!0;if(Ka()){var c=JSON.stringify(a[a.id]);Oa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function mi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function ii(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ka()&&(b=Na(a.key))?(a[a.id]=b,a.b=!0):!1}var ui=0;
function Hi(a,b,c,d,e,f){e("Loading "+a+"...");Ea(a,null,!0,function(g,h,m){m?(h||(h="unable to load "+a+" ("+m+")"),f(h,null)):Ii(h,a,b,c,d,e,f)})} function Gi(a,b,c,d,e,f){e("Loading "+a+"...");Ea(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Hi(h,a,b,c,d,e,f)})}
function Ii(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(nb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function Hi(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(nb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Ji(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)} a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Ii(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function Ji(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=h[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)m=0>m.indexOf(n[1])?m.replace(">",n[0]+">"):m.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=m&&(g=g.replace(h[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, function Ii(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ea(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);Ji(a,b,c)}})}else c(a,null)} "");a=a.replace(d[0],g);Ii(a,b,c)}})}else c(a,null)}
function Ki(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);m&&(--vi||Za(!0));m=!1}var g,h,m=!0;vi++;mb[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| function Ji(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--ui||Za(!0));l=!1}var g,h,l=!0;ui++;mb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c||
(c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,h){h?Hi(c,null,null,!1,e,function(d,m){m?(nb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=h.transformNode(m))?(g.outerHTML=m,--vi||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--vi||Za(!0)):f("invalid machine element: "+ (c="/versions/pdpjs/1.30.2/components.xsl");m=function(d,h){h?Gi(c,null,null,!1,e,function(d,l){l?(nb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--ui||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--ui||Za(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Hi(b,a,d,!0,e,n):Ii(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(v){f(v.message)}return m}window.embedPDP11=function(a,b,c,d){Za(!1);return Ki(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Gi(b,a,d,!0,e,m):Hi(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return Ji(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map

View file

@ -31,210 +31,205 @@
http://pcjs.org/modules/pdp11/lib/computer.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 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)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da<ca.length-1;da++){var ea=ca[da];ea in ba||(ba[ea]={});ba=ba[ea]}var fa=ca[ca.length-1],ga=ba[fa],ha=ga?ga:function(a){return Math.log(a)/Math.LN2}; for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da<ca.length-1;da++){var ea=ca[da];ea in ba||(ba[ea]={});ba=ba[ea]}var fa=ca[ca.length-1],ga=ba[fa],ha=ga?ga:function(a){return Math.log(a)/Math.LN2};
ha!=ga&&null!=ha&&aa(ba,fa,{configurable:!0,writable:!0,value:ha});var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]}; ha!=ga&&null!=ha&&aa(ba,fa,{configurable:!0,writable:!0,value:ha});var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
function ja(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2== function ja(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ka(a,b){var c="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function 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} e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ka(a,b){var c="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function m(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 n(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function la(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}var na={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})} function q(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function la(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}var na={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})}
function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ra=Date.now||function(){return+new Date}; function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ra=Date.now||function(){return+new Date};
function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function r(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== function r(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g} typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
function ta(a,b){var c,d={L:null,W:null,fa:null,ea:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.fa=g.load;d.ea=g.exec;if(e=g.bytes)d.L=e;else if(e=g.words)for(d.L=Array(2*e.length),f=c=0;c<e.length;c++)d.L[f++]=e[c]&255,d.L[f++]=e[c]>>8&255;else if(e=g.data)for(d.L=Array(4*e.length),f=c=0;c<e.length;c++)d.L[f++]=e[c]&255, function ta(a,b){var c,d={K:null,W:null,fa:null,ea:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.fa=g.load;d.ea=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,
d.L[f++]=e[c]>>8&255,d.L[f++]=e[c]>>16&255,d.L[f++]=e[c]>>24&255;else d.L=g;d.W=g.symbols;d.L.length?1==d.L.length&&(t(d.L[0]),d=null):(t("Empty resource: "+a),d=null)}catch(l){t("Resource data error ("+a+"): "+l.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){t("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.L=e)}return d} d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W=g.symbols;d.K.length?1==d.K.length&&(u(d.K[0]),d=null):(u("Empty resource: "+a),d=null)}catch(h){u("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d}
function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}var xa=null;function ya(){if(null==xa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}xa=a}return xa} function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function u(a){window&&window.alert(a)}function wa(a){var b=!1;window&&(b=window.confirm(a));return b}var xa=null;function ya(){if(null==xa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}xa=a}return xa}
function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var w={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0; function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var Ca={init:[],show:[],exit:[]},Da=!1,Ea=!1,Fa=!0;
function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){w.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){w[a]&&Ha(w[a])}Fa("onload",function(){Ca=!0;Ha(w.init)});Fa("onpageshow",function(){Da=!0;Ha(w.show)}); function Ga(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ha(a){Ca.init.push(a)}function Ia(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ja(a){!Fa&&a?(Fa=!0,Da&&Ka("init"),Ea&&Ka("show")):Fa=a}function Ka(a){Ca[a]&&Ia(Ca[a])}Ga("onload",function(){Da=!0;Ia(Ca.init)});Ga("onpageshow",function(){Ea=!0;Ia(Ca.show)});
Fa(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ha(w.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Lb=b.comment;this.jc=b;b=this.id.indexOf(".");0>b?this.Na=this.id:(this.na=this.id.substr(0,b),this.Na=this.id.substr(b+1));this[a]=c;this.l={ready:!1,lb:!1,Xd:!1,P:!1,error:!1};this.hb=null;this.l.error=!1;this.o={};this.F=null;y.push(this)}var Ka=void 0,La={}; Ga(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ia(Ca.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ib=b.comment;this.dc=b;b=this.id.indexOf(".");0>b?this.Da=this.id:(this.na=this.id.substr(0,b),this.Da=this.id.substr(b+1));this[a]=c;this.l={ready:!1,kb:!1,Td:!1,P:!1,error:!1};this.gb=null;this.l.error=!1;this.o={};this.F=null;y.push(this)}var La=void 0,Ma={};
if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} if(window){La||(La=window.location.search.substr(1));for(var Na,Oa=/\+/g,Pa=/([^&=]+)=?([^&]*)/g;Na=Pa.exec(La);)Ma[decodeURIComponent(Na[1].replace(Oa," "))]=decodeURIComponent(Na[2].replace(Oa," "))}function Qa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function A(a,b){b||(b=x);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},y=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c} function z(a,b){b||(b=x);a.prototype=Qa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ra=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Ra={},y=[];function Sa(a,b,c){Ra[a]&&b&&(Ra[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function Sa(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ta(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function C(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b} function Ta(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ua(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b}
function D(a,b){b=E(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=C(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),m=l.length}}}} function C(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),l=h.length}}}}
function E(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c} function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Ta=this.o[b]=c,c.value="",this.U=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c), x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Ra=this.o[b]=c,c.value="",this.U=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.C=function(a){this.U(a,this.Na)}),!0;default:return!1}},log:function(){},U:function(){},status:function(a){this.U(this.Na+": "+a)},C:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ja:function(){return this.l.P=!0},ia:function(a,b){b&&(this.l.P=!1);return!0}};function F(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.hb,a.hb=null,b&&b()))}function Ua(a,b){b&&(a.l.ready?b():a.hb=b);return a.l.ready} this.C=function(a){this.U(a,this.Da)}),!0;default:return!1}},log:function(){},U:function(){},status:function(a){this.U(this.Da+": "+a)},C:function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)},ja:function(){return this.l.P=!0},ia:function(a,b){b&&(this.l.P=!1);return!0}};function E(a,b){a.l.error||(a.l.ready=!1!==b,a.l.ready&&(b=a.gb,a.gb=null,b&&b()))}function Va(a,b){b&&(a.l.ready?b():a.gb=b);return a.l.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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Va="undefined"!==typeof ArrayBuffer;function Wa(a){x.call(this,"Panel",a,Wa);this.b=0;this.l.Fb=!0}A(Wa);h=Wa.prototype; 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 Wa="undefined"!==typeof ArrayBuffer;function Xa(a){x.call(this,"Panel",a,Xa);this.b=0;this.l.Cb=!0}z(Xa);k=Xa.prototype;
h.Z=function(a,b,c,d){if(this.j&&this.j.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.b++,!0;default:return"rled"==a?(this.o[b]=c,this.b++,!0):this.parent.Z.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.F=d};h.ja=function(a,b){b||Xa();return!0};h.ia=function(){return!0}; k.Z=function(a,b,c,d){if(this.j&&this.j.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.b++,!0;default:return"rled"==a?(this.o[b]=c,this.b++,!0):this.parent.Z.call(this,a,b,c,d)}};k.ha=function(a,b,c,d){this.j=a;this.i=b;this.a=c;this.F=d};k.ja=function(a,b){b||Ya();return!0};k.ia=function(){return!0};
function Ya(a,b,c,d){if(a.o[b]){void 0===c&&(a.l.error=!0,a.C("Value for "+b+" is invalid"),G(a.a));var e=a.F&&a.F.h||8;c=!a.a.l.da||a.l.Fb?8==e?ka(c,d):k(c,d):"--------".substr(0,d||4);a.o[b].textContent!=c&&(a.o[b].textContent=c)}}function Za(a,b,c,d){for(var e=0;e<d;e++){var f=a.o[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}} function Za(a,b,c,d){if(a.o[b]){void 0===c&&(a.l.error=!0,a.C("Value for "+b+" is invalid"),F(a.a));var e=a.F&&a.F.b||8;c=!a.a.l.da||a.l.Cb?8==e?ka(c,d):m(c,d):"--------".substr(0,d||4);a.o[b].textContent!=c&&(a.o[b].textContent=c)}}function $a(a,b,c,d){for(var e=0;e<d;e++){var f=a.o[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
h.ma=function(a){if(this.b&&(a||!this.a.l.da||this.l.Fb)){for(a=0;a<this.a.g.length;a++)Ya(this,"R"+a,this.a.g[a]);a=$a(this.a);Ya(this,"PS",a);Ya(this,"NF",a&8?1:0,1);Ya(this,"ZF",a&4?1:0,1);Ya(this,"VF",a&2?1:0,1);Ya(this,"CF",a&1?1:0,1);Za(this,"D",this.a.g[0],16);Za(this,"A",this.a.g[7],22)}};function Xa(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=C(d),f=Sa(e.id);f||(a=!0,f=new Wa(e));D(f,d);a&&F(f)}}Ga(Xa); k.ma=function(a){if(this.b&&(a||!this.a.l.da||this.l.Cb)){for(a=0;a<this.a.f.length;a++)Za(this,"R"+a,this.a.f[a]);a=ab(this.a);Za(this,"PS",a);Za(this,"NF",a&8?1:0,1);Za(this,"ZF",a&4?1:0,1);Za(this,"VF",a&2?1:0,1);Za(this,"CF",a&1?1:0,1);$a(this,"D",this.a.f[0],16);$a(this,"A",this.a.f[7],22)}};function Ya(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Ta(e.id);f||(a=!0,f=new Xa(e));C(f,d);a&&E(f)}}Ha(Ya);
function ab(a,b,c){x.call(this,"Bus",a,ab);this.a=b;this.F=c;this.K=a.busWidth||16;this.s=0;this.J=[];this.A=null;this.D=Math.pow(2,this.K);this.i=this.D-1|0;this.b=H;this.c=Math.log2(this.b);this.G=this.b>>2;this.j=this.b-1;this.w=this.D/this.b|0;this.xa=[];this.f=0;this.m=!1;this.v=[];this.ac=[bb,cb,db,eb];a=new I(this);fb(a,this.F);this.h=Array(this.w);for(b=0;b<this.w;b++)this.h[b]=a;F(this)}A(ab);var H=8192,gb=H-1; function bb(a,b,c){x.call(this,"Bus",a,bb);this.a=b;this.F=c;this.J=a.busWidth||16;this.h=0;this.I=[];this.A=null;this.D=Math.pow(2,this.J);this.g=this.D-1|0;this.i=G;this.c=Math.log2(this.i);this.G=this.i>>2;this.j=this.i-1;this.v=this.D/this.i|0;this.xa=[];this.w=0;this.m=!1;this.u=[];this.Vb=[cb,db,eb,fb];a=new H(this);gb(a,this.F);this.b=Array(this.v);for(b=0;b<this.v;b++)this.b[b]=a;E(this)}z(bb);var G=8192,hb=G-1;
function bb(a,b){var c=-1,d=this.controller,e=d.xa[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.xa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=hb(d,b)}function cb(a,b,c){var d=!1,e=this.controller,f=e.xa[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.xa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||hb(e,c)} function cb(a,b){var c=-1,d=this.controller,e=d.xa[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.xa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;I(d,b,16);return 255}function db(a,b,c){var d=!1,e=this.controller,f=e.xa[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.xa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||I(e,c,16)}
function db(a,b){var c=-1,d=this.controller;(a=d.xa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=hb(d,b)}function eb(a,b,c){var d=!1,e=this.controller;if(a=e.xa[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||hb(e,c)}function ib(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,jb(a,c,H,a.J),a.s=0);b&&(a.s=b,c=(1<<b)-H,a.J=kb(a,c,H),a.A?jb(a,c,H,a.A):(lb(a,c,H,mb,a),a.A=kb(a,c,H)))}}h=ab.prototype; function eb(a,b){var c=-1,d=this.controller;(a=d.xa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;I(d,b,16);return 65535}function fb(a,b,c){var d=!1,e=this.controller;if(a=e.xa[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||I(e,c,16)}function ib(a,b){if(b!=a.h){var c;a.h&&(c=(1<<a.h)-G,jb(a,c,G,a.I),a.h=0);b&&(a.h=b,c=(1<<b)-G,a.I=kb(a,c,G),a.A?jb(a,c,G,a.A):(lb(a,c,G,mb,a),a.A=kb(a,c,G)))}}
h.reset=function(){for(var a=0;a<this.v.length;a++)this.v[a]();ib(this,16)};function hb(a,b){a.f||(a.a.I|=16,J(a.a,4,b));return 0}h.ja=function(a,b){b||this.reset();return!0}; bb.prototype.reset=function(){for(var a=0;a<this.u.length;a++)this.u[a]();ib(this,16)};bb.prototype.ja=function(a,b){b||this.reset();return!0};
function lb(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.c;0<g&&l<a.h.length;){var m=a.h[l],p=l*a.b,q=a.b-(f-p);q>g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.Ha)return m.jb+=m.Ha-f,m.Ha=f,!0;if(f>=m.Ha+m.jb){q=m.size-(f-p);q>g&&(q=g);m.jb=f-m.Ha+q;f=p+a.b;g-=q;l++;continue}}return nb(1,f,g)}f=new I(a,f,q,a.b,d,e);fb(f,a.F,m);a.h[l++]=f;f=p+a.b;g-=q}if(0>=g){c/=1024;var u;e="";u?10<u&&(u=10):u=c&-65536?10:5;if(null==c||isNaN(c))for(;0<u--;)e="?"+e;else for(;0<u--;)e=String.fromCharCode(c%10+48)+e,c/= function lb(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.c;0<g&&h<a.b.length;){var l=a.b[h],n=h*a.i,p=a.i-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ha)return l.ib+=l.Ha-f,l.Ha=f,!0;if(f>=l.Ha+l.ib){p=l.size-(f-n);p>g&&(p=g);l.ib=f-l.Ha+p;f=n+a.i;g-=p;h++;continue}}return nb(1,f,g)}f=new H(a,f,p,a.i,d,e);gb(f,a.F,l);a.b[h++]=f;f=n+a.i;g-=p}if(0>=g){c/=1024;var t;e="";t?10<t&&(t=10):t=c&-65536?10:5;if(null==c||isNaN(c))for(;0<t--;)e="?"+e;else for(;0<t--;)e=String.fromCharCode(c%10+48)+e,c/=
10;a.status(e+"Kb "+ob[d]+" at "+ka(b));return!0}return nb(2,b,c)}function kb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function jb(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function pb(a,b){return a.h[(b&a.i)>>>a.c].vb(b&a.j,b)}function qb(a,b){return a.h[(b&a.i)>>>a.c].V(b&a.j,b)}h.qb=function(a){var b=a&this.j,c=(a&this.i)>>>this.c;this.m=!1;this.f++;a=this.h[c].Rb(b,a);this.f--;return a}; 10;a.status(e+"Kb "+ob[d]+" at "+ka(b));return!0}return nb(2,b,c)}function kb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.i;return d}function jb(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.i}}function pb(a,b){3932160<=b&&(b=qb(a.a,b));return a.b[(b&a.g)>>>a.c].tb(b&a.j,b)}function rb(a,b){3932160<=b&&(b=qb(a.a,b));return a.b[(b&a.g)>>>a.c].V(b&a.j,b)}
h.Va=function(a,b){this.m=!1;this.f++;this.h[(a&this.i)>>>this.c].Db(a&this.j,b&255,a);this.f--};function rb(a,b,c){a.h[(b&a.i)>>>a.c].kb(b&a.j,c&65535,b)}h.zb=function(a,b){var c=a&this.j,d=(a&this.i)>>>this.c;this.m=!1;this.f++;this.h[d].Zb(c,b&65535,a);this.f--}; bb.prototype.Ua=function(a,b){this.m=!1;this.w++;this.b[(a&this.g)>>>this.c].Ab(a&this.j,b&255,a);this.w--};function sb(a,b,c){3932160<=b&&(b=qb(a.a,b));a.b[(b&a.g)>>>a.c].jb(b&a.j,c&65535,b)}function tb(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.b[d];if(e.ra||e.$b){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[h++]=p-g;l[h++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}
function sb(a){for(var b=0,c=[],d=0;d<a.w;d++){var e=a.h[d];if(e.sa||e.fc){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 tb(a,b,c,d,e,f,g,l){for(;b<=c;b+=2){var m=b&gb;void 0!==a.xa[m]?t("I/O address already registered: "+k(b,8,!0)):a.xa[m]=[d,e,f,g,l||"unknown",!1]}} function ub(a,b,c,d,e,f,g,h){for(;b<=c;b+=2){var l=b&hb;void 0!==a.xa[l]?u("I/O address already registered: "+m(b,8,!0)):a.xa[l]=[d,e,f,g,h||"unknown",!1]}}
function ub(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Za)){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)));tb(a,e,e,g,l,m,p,f[4])}}}function vb(a,b){a.v.push(b)}function wb(a,b){a.f||J(a.a,4,b);a.m=!0}function xb(a){var b=a.m;a.m=!1;return b} function vb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.a.Za)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null,p=f[5]||1;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&n&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=f[4],w=0;w<p;w++,e+=2)t&&1<p&&(t=f[4]+w),ub(a,e,e,g,h,l,n,t)}}}function wb(a,b){a.u.push(b)}
function nb(a,b,c){t("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){x.call(this,"Device",a,K);this.c={data:0,Td:0,ib:20,bd:0};this.b={M:0,Bb:-1}}A(K);h=K.prototype;h.ha=function(a,b,c,d){this.h=b;this.a=c;this.F=d;var e=this;this.b.Bb=yb(c,function(){e.b.za|=128;e.b.za&64&&(zb(e.a,e.b.cd),Ab(e.a,e.b.Bb,1E3/60))});this.b.cd=Bb(64,6);ub(b,this,L);vb(b,this.reset.bind(this));F(this)};h.reset=function(){this.c.ib=this.c.ib&-120|20;this.b.za=0}; function I(a,b,c){a.m=!0;a.w||(c&&(a.a.M|=c),J(a.a,4,b))}function xb(a){var b=a.m;a.m=!1;return b}function nb(a,b,c){u("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function K(a){x.call(this,"Device",a,K);this.c={data:0,Qd:0,hb:20,Xc:0};this.b={L:0,yb:-1}}z(K);k=K.prototype;k.ha=function(a,b,c,d){this.i=b;this.a=c;this.F=d;var e=this;this.b.yb=yb(c,function(){e.b.za|=128;e.b.za&64&&(zb(e.a,e.b.Yc),Ab(e.a,e.b.yb,1E3/60))});this.b.Yc=Bb(64,6);vb(b,this,L);wb(b,this.reset.bind(this));E(this)};
h.tc=function(){var a=this.b.za;this.b.za&=-129;return a};h.nd=function(a){this.b.za=a;a&64&&Ab(this.a,this.b.Bb,1E3/60);this.b.za=a&-129};h.lc=function(a){return(a?this.c.bd:this.c.data)&65535};h.ed=function(a){this.c.data=a};h.vc=function(){var a=this.a;return a.w&62337|a.Xa<<5|a.Ya<<1};h.pd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.Xa=a>>5&3;b.Ya=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ea!=c&&(b.Ea=c,Cb(b))}Db(this)}; k.reset=function(){this.c.hb=this.c.hb&-120|20;this.b.za=0};k.mc=function(){var a=this.b.za;this.b.za&=-129;return a};k.hd=function(a){this.b.za=a;a&64&&Ab(this.a,this.b.yb,1E3/60);this.b.za=a&-129};k.ec=function(a){return(a?this.c.Xc:this.c.data)&65535};k.$c=function(a){this.c.data=a};k.oc=function(){var a=this.a;return a.w&62337|a.Xa<<5|a.Ya<<1};k.kd=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.Xa=a>>5&3;b.Ya=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Sa!=c&&(b.Sa=c,Cb(b))}Db(this)};
h.wc=function(){var a=this.a.Aa;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.xc=function(){return this.a.xb};h.yc=function(){return this.a.Ba};h.qd=function(a){var b=this.a;1170>b.Za&&(a&=-49);b.Ba!=a&&(b.Ba=a,a&16?(b.tb=4194303,b.Wa=3915776):(b.tb=262143,b.Wa=253952),Cb(b));Db(this)};function Db(a){a.c.ib=a.c.ib&-8|(a.a.Ea?a.a.Ba&16?1:2:4)}h.Rc=function(a){return this.a.H[1][a>>1&7]};h.Jd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Pc=function(a){return this.a.H[1][(a>>1&7)+8]}; k.pc=function(){var a=this.a.Aa;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.qc=function(){return this.a.vb};k.rc=function(){return this.a.Fa};k.ld=function(a){var b=this.a;1170>b.Za&&(a&=-49);b.Fa!=a&&(b.Fa=a,b.Jb=a&16?4194303:262143,Cb(b));Db(this)};function Db(a){a.c.hb=a.c.hb&-8|(a.a.Sa?a.a.Fa&16?1:2:4)}k.Rc=function(a){a=a>>1&63;var b=this.a.Va[a>>1];return a&1?b>>16:b&65535};k.Ld=function(a,b){b=b>>1&63;var c=b>>1;this.a.Va[c]=b&1?this.a.Va[c]&65535|(a&63)<<16:this.a.Va[c]&-65536|a&65534};
h.Hd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.Qc=function(a){return this.a.X[1][a>>1&7]};h.Id=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Oc=function(a){return this.a.X[1][(a>>1&7)+8]};h.Gd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.sc=function(a){return this.a.H[0][a>>1&7]};h.md=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.qc=function(a){return this.a.H[0][(a>>1&7)+8]};h.kd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295}; k.Kc=function(a){return this.a.H[1][a>>1&7]};k.Ed=function(a,b){this.a.H[1][b>>1&7]=a&65295};k.Ic=function(a){return this.a.H[1][(a>>1&7)+8]};k.Cd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};k.Jc=function(a){return this.a.X[1][a>>1&7]};k.Dd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};k.Hc=function(a){return this.a.X[1][(a>>1&7)+8]};k.Bd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};k.lc=function(a){return this.a.H[0][a>>1&7]};
h.rc=function(a){return this.a.X[0][a>>1&7]};h.ld=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.pc=function(a){return this.a.X[0][(a>>1&7)+8]};h.jd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Xc=function(a){return this.a.H[3][a>>1&7]};h.Pd=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Vc=function(a){return this.a.H[3][(a>>1&7)+8]};h.Nd=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Wc=function(a){return this.a.X[3][a>>1&7]}; k.gd=function(a,b){this.a.H[0][b>>1&7]=a&65295};k.jc=function(a){return this.a.H[0][(a>>1&7)+8]};k.ed=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};k.kc=function(a){return this.a.X[0][a>>1&7]};k.fd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};k.ic=function(a){return this.a.X[0][(a>>1&7)+8]};k.dd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};k.Qc=function(a){return this.a.H[3][a>>1&7]};k.Kd=function(a,b){this.a.H[3][b>>1&7]=a&65295};
h.Od=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Uc=function(a){return this.a.X[3][(a>>1&7)+8]};h.Md=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ja=function(a){a&=7;return this.a.B&2048?this.a.Fa[a]:this.a.g[a]};h.La=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.g[b]=a};h.Dc=function(){return this.a.B&49152?this.a.la[0]:this.a.g[6]};h.vd=function(a){this.a.B&49152?this.a.la[0]=a:this.a.g[6]=a};h.Gc=function(){return this.a.g[7]}; k.Oc=function(a){return this.a.H[3][(a>>1&7)+8]};k.Id=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};k.Pc=function(a){return this.a.X[3][a>>1&7]};k.Jd=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};k.Nc=function(a){return this.a.X[3][(a>>1&7)+8]};k.Hd=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};k.Ja=function(a){a&=7;return this.a.B&2048?this.a.Ga[a]:this.a.f[a]};k.La=function(a,b){b&=7;this.a.B&2048?this.a.Ga[b]=a:this.a.f[b]=a};
h.yd=function(a){this.a.g[7]=a};h.Ka=function(a){a&=7;return this.a.B&2048?this.a.g[a]:this.a.Fa[a]};h.Ma=function(a,b){b&=7;this.a.B&2048?this.a.g[b]=a:this.a.Fa[b]=a};h.Ec=function(){return 1==(this.a.B&49152)>>14?this.a.g[6]:this.a.la[1]};h.wd=function(a){1==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.la[1]=a};h.Fc=function(){return 3==(this.a.B&49152)>>14?this.a.g[6]:this.a.la[3]};h.xd=function(a){3==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.la[3]=a};h.nc=function(a){return this.a.Ub[a-65504>>1]}; k.wc=function(){return this.a.B&49152?this.a.la[0]:this.a.f[6]};k.qd=function(a){this.a.B&49152?this.a.la[0]=a:this.a.f[6]=a};k.zc=function(){return this.a.f[7]};k.td=function(a){this.a.f[7]=a};k.Ka=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Ga[a]};k.Ma=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Ga[b]=a};k.xc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.la[1]};k.rd=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.la[1]=a};
h.gd=function(a,b){this.a.Ub[b-65504>>1]=a};h.Qb=function(a){return 65520==a?61183:0};h.Yb=function(){};h.Tc=function(){return 1};h.Ld=function(){};h.mc=function(){return this.a.I};h.fd=function(){this.a.I=0};h.uc=function(){return this.a.Tb};h.od=function(a,b){b&1||(a&=255);this.a.Tb=a};h.zc=function(a){return a?this.a.yb:0};h.rd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.yb=a;b.u|=2};h.Sc=function(a){return a?this.a.Ca&65280:0};h.Kd=function(a){this.a.Ca=a|255}; k.yc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.la[3]};k.sd=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.la[3]=a};k.gc=function(a){return this.a.Qb[a-65504>>1]};k.bd=function(a,b){this.a.Qb[b-65504>>1]=a};k.Ob=function(a){return 65520==a?61183:0};k.Ub=function(){};k.Mc=function(){return 1};k.Gd=function(){};k.fc=function(){return this.a.M};k.ad=function(){this.a.M=0};k.nc=function(){return this.a.Pb};k.jd=function(a,b){b&1||(a&=255);this.a.Pb=a};
h.Cc=function(){return $a(this.a)};h.ud=function(a){Eb(this.a,a&-1809|$a(this.a)&1808);this.a.u|=128};h.Xb=function(){}; k.sc=function(a){return a?this.a.wb:0};k.md=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.wb=a;b.s|=2};k.Lc=function(a){return a?this.a.Ba&65280:0};k.Fd=function(a){this.a.Ba=a|255};k.vc=function(){return ab(this.a)};k.pd=function(a){Eb(this.a,a&-1809|ab(this.a)&1808);this.a.s|=128};k.Tb=function(){};
var M={},L=(M[62592]=[null,null,K.prototype.Rc,K.prototype.Jd,"SISDR",1145],M[62608]=[null,null,K.prototype.Pc,K.prototype.Hd,"SDSDR",1145],M[62624]=[null,null,K.prototype.Qc,K.prototype.Id,"SISAR",1145],M[62640]=[null,null,K.prototype.Oc,K.prototype.Gd,"SDSAR",1145],M[62656]=[null,null,K.prototype.sc,K.prototype.md,"KISDR",1145],M[62672]=[null,null,K.prototype.qc,K.prototype.kd,"KDSDR",1145],M[62688]=[null,null,K.prototype.rc,K.prototype.ld,"KISAR",1145],M[62704]=[null,null,K.prototype.pc,K.prototype.jd, var M={},L=(M[61568]=[null,null,K.prototype.Rc,K.prototype.Ld,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Kc,K.prototype.Ed,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Ic,K.prototype.Cd,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Jc,K.prototype.Dd,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Hc,K.prototype.Bd,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.lc,K.prototype.gd,"KISDR",8,1145],M[62672]=[null,null,K.prototype.jc,K.prototype.ed,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.kc,
"KDSAR",1145],M[62798]=[null,null,K.prototype.yc,K.prototype.qd,"MMR3",1145],M[65382]=[null,null,K.prototype.tc,K.prototype.nd,"LKS"],M[65400]=[null,null,K.prototype.lc,K.prototype.ed,"CNSL"],M[65402]=[null,null,K.prototype.vc,K.prototype.pd,"MMR0",1145],M[65404]=[null,null,K.prototype.wc,K.prototype.Xb,"MMR1",1145],M[65406]=[null,null,K.prototype.xc,K.prototype.Xb,"MMR2",1145],M[65408]=[null,null,K.prototype.Xc,K.prototype.Pd,"UISDR",1145],M[65424]=[null,null,K.prototype.Vc,K.prototype.Nd,"UDSDR", K.prototype.fd,"KISAR",8,1145],M[62704]=[null,null,K.prototype.ic,K.prototype.dd,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.rc,K.prototype.ld,"MMR3",1,1145],M[65382]=[null,null,K.prototype.mc,K.prototype.hd,"LKS"],M[65400]=[null,null,K.prototype.ec,K.prototype.$c,"CNSL"],M[65402]=[null,null,K.prototype.oc,K.prototype.kd,"MMR0",1,1145],M[65404]=[null,null,K.prototype.pc,K.prototype.Tb,"MMR1",1,1145],M[65406]=[null,null,K.prototype.qc,K.prototype.Tb,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Qc,
1145],M[65440]=[null,null,K.prototype.Wc,K.prototype.Od,"UISAR",1145],M[65456]=[null,null,K.prototype.Uc,K.prototype.Md,"UDSAR",1145],M[65472]=[null,null,K.prototype.Ja,K.prototype.La,"R0SET0"],M[65473]=[null,null,K.prototype.Ja,K.prototype.La,"R1SET0"],M[65474]=[null,null,K.prototype.Ja,K.prototype.La,"R2SET0"],M[65475]=[null,null,K.prototype.Ja,K.prototype.La,"R3SET0"],M[65476]=[null,null,K.prototype.Ja,K.prototype.La,"R4SET0"],M[65477]=[null,null,K.prototype.Ja,K.prototype.La,"R5SET0"],M[65478]= K.prototype.Kd,"UISDR",8,1145],M[65424]=[null,null,K.prototype.Oc,K.prototype.Id,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.Pc,K.prototype.Jd,"UISAR",8,1145],M[65456]=[null,null,K.prototype.Nc,K.prototype.Hd,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.Ja,K.prototype.La,"R0SET0"],M[65473]=[null,null,K.prototype.Ja,K.prototype.La,"R1SET0"],M[65474]=[null,null,K.prototype.Ja,K.prototype.La,"R2SET0"],M[65475]=[null,null,K.prototype.Ja,K.prototype.La,"R3SET0"],M[65476]=[null,null,K.prototype.Ja,
[null,null,K.prototype.Dc,K.prototype.vd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Gc,K.prototype.yd,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ka,K.prototype.Ma,"R0SET1",1145],M[65481]=[null,null,K.prototype.Ka,K.prototype.Ma,"R1SET1",1145],M[65482]=[null,null,K.prototype.Ka,K.prototype.Ma,"R2SET1",1145],M[65483]=[null,null,K.prototype.Ka,K.prototype.Ma,"R3SET1",1145],M[65484]=[null,null,K.prototype.Ka,K.prototype.Ma,"R4SET1",1145],M[65485]=[null,null,K.prototype.Ka,K.prototype.Ma,"R5SET1",1145], K.prototype.La,"R4SET0"],M[65477]=[null,null,K.prototype.Ja,K.prototype.La,"R5SET0"],M[65478]=[null,null,K.prototype.wc,K.prototype.qd,"R6KERNEL"],M[65479]=[null,null,K.prototype.zc,K.prototype.td,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ka,K.prototype.Ma,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ka,K.prototype.Ma,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ka,K.prototype.Ma,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ka,K.prototype.Ma,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ka,
M[65486]=[null,null,K.prototype.Ec,K.prototype.wd,"R6SUPER",1145],M[65487]=[null,null,K.prototype.Fc,K.prototype.xd,"R6USER",1145],M[65504]=[null,null,K.prototype.nc,K.prototype.gd,"CTRL",1170],M[65520]=[null,null,K.prototype.Qb,K.prototype.Yb,"LSIZE",1170],M[65522]=[null,null,K.prototype.Qb,K.prototype.Yb,"HSIZE",1170],M[65524]=[null,null,K.prototype.Tc,K.prototype.Ld,"SYSID",1170],M[65526]=[null,null,K.prototype.mc,K.prototype.fd,"CPUERR",1170],M[65528]=[null,null,K.prototype.uc,K.prototype.od, K.prototype.Ma,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ka,K.prototype.Ma,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.xc,K.prototype.rd,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.yc,K.prototype.sd,"R6USER",1,1145],M[65504]=[null,null,K.prototype.gc,K.prototype.bd,"CTRL",1,1170],M[65520]=[null,null,K.prototype.Ob,K.prototype.Ub,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Ob,K.prototype.Ub,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Mc,K.prototype.Gd,"SYSID",1,1170],M[65526]=
"MB",1170],M[65530]=[null,null,K.prototype.zc,K.prototype.rd,"PIR"],M[65532]=[null,null,K.prototype.Sc,K.prototype.Kd,"SL"],M[65534]=[null,null,K.prototype.Cc,K.prototype.ud,"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]; [null,null,K.prototype.fc,K.prototype.ad,"CPUERR",1,1170],M[65528]=[null,null,K.prototype.nc,K.prototype.jd,"MB",1,1170],M[65530]=[null,null,K.prototype.sc,K.prototype.md,"PIR"],M[65532]=[null,null,K.prototype.Lc,K.prototype.Fd,"SL"],M[65534]=[null,null,K.prototype.vc,K.prototype.pd,"PSW"],M);L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];
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]; Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new K(c);C(c,d);break;case "pc11":c=new Fb(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var Gb;if(Wa){var Hb=new ArrayBuffer(2);(new DataView(Hb)).setUint16(0,256,!0);Gb=256===(new Uint16Array(Hb))[0]}else Gb=!1;var Ib=Gb;
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]; function H(a,b,c,d,e,f){this.i=a;this.id=Jb+=2;this.a=null;this.Ha=b;this.ib=c;this.size=d||0;this.type=e||Kb;this.j=e==Lb;this.controller=null;gb(this);this.ra=this.$b=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],Mb(this,f.Vb);else if(Wa)this.o=new ArrayBuffer(this.size),this.c=new DataView(this.o,0,this.size),this.b=new Uint8Array(this.o,0,this.size),this.u=new Uint16Array(this.o,0,this.size>>1),this.a=new Int32Array(this.o,0,this.size>>2),Mb(this,Ib?Nb:Ob);else{a=this.a=Array(this.size>>
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];
Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=C(d);switch(c.type){case "default":c=new K(c);D(c,d);break;case "pc11":c=new Fb(c);D(c,d);break;case "rl11":c=new N(c),D(c,d)}}});var Gb;if(Va){var Hb=new ArrayBuffer(2);(new DataView(Hb)).setUint16(0,256,!0);Gb=256===(new Uint16Array(Hb))[0]}else Gb=!1;var Ib=Gb;
function I(a,b,c,d,e,f){this.h=a;this.id=Jb+=2;this.a=null;this.Ha=b;this.jb=c;this.size=d||0;this.type=e||Kb;this.j=e==Lb;this.controller=null;fb(this);this.sa=this.fc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],Mb(this,f.ac);else if(Va)this.o=new ArrayBuffer(this.size),this.c=new DataView(this.o,0,this.size),this.b=new Uint8Array(this.o,0,this.size),this.s=new Uint16Array(this.o,0,this.size>>1),this.a=new Int32Array(this.o,0,this.size>>2),Mb(this,Ib?Nb:Ob);else{a=this.a=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;Mb(this,Pb)}else Mb(this)}var Kb=0,Lb=2,mb=4,ob=["NONE","RAM","ROM","VID","H/W"],Jb=0; 2);for(f=0;f<a.length;f++)a[f]=0;Mb(this,Pb)}else Mb(this)}var Kb=0,Lb=2,mb=4,ob=["NONE","RAM","ROM","VID","H/W"],Jb=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Va)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Va)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.sa=!0}return!1},v:function(a,b){wb(this.h,b);return 255},f:function(a,b,c){wb(this.h,c)},w:function(a,b){return this.vb(a++,b++)|this.vb(a, H.prototype={constructor:H,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Wa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Wa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.ra=!0}return!1},v:function(a,b){I(this.i,b,32);return 255},g:function(a,b,c){I(this.i,c,32)},w:function(a,b){return this.tb(a++,b++)|
b)<<8},A:function(a,b,c){this.Cb(a++,b&255,c++);this.Cb(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&wb(this.h,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},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.sa=!0},wa:function(a,b,c){a&1&&wb(this.h,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.sa= this.tb(a,b)<<8},A:function(a,b,c){this.zb(a++,b&255,c++);this.zb(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},na:function(a,b){a&1&&I(this.i,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ta:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ra=!0},Ea:function(a,b,c){a&1&&I(this.i,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
!0},G:function(a,b){return this.J(a,b)},R:function(a,b){return this.Rb(a,b)},oa:function(a,b,c){this.j?this.f(a,b,c):this.Db(a,b,c)},ua:function(a,b,c){this.j?this.f(a,b,c):this.Zb(a,b,c)},D:function(a){return this.b[a]},K:function(a){return this.b[a]},O:function(a,b){a&1&&wb(this.h,b);return this.c.getUint16(a,!0)},$:function(a,b){a&1&&wb(this.h,b);return this.s[a>>1]},na:function(a,b){this.b[a]=b;this.sa=!0},pa:function(a,b){this.b[a]=b;this.sa=!0},ra:function(a,b,c){a&1&&wb(this.h,c);this.c.setUint16(a, b>>8);this.ra=!0},G:function(a,b){return this.I(a,b)},R:function(a,b){return this.$(a,b)},pa:function(a,b,c){this.j?this.g(a,b,c):this.Ab(a,b,c)},va:function(a,b,c){this.j?this.g(a,b,c):this.wa(a,b,c)},D:function(a){return this.b[a]},J:function(a){return this.b[a]},O:function(a,b){a&1&&I(this.i,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&I(this.i,b,64);return this.u[a>>1]},oa:function(a,b){this.b[a]=b;this.ra=!0},qa:function(a,b){this.b[a]=b;this.ra=!0},ua:function(a,b,c){a&1&&I(this.i,
b,!0);this.sa=!0},va:function(a,b,c){a&1&&wb(this.h,c);this.s[a>>1]=b;this.sa=!0}};function fb(a,b,c){a.F=b;a.i=a.m=0;c&&((a.i=c.i)&&Qb(a,Rb,!1),(a.m=c.m)&&Sb(a,Rb,!1))}function Sb(a,b,c){c&&a.m||(a.Cb=!a.j&&b[1]||a.f,a.kb=!a.j&&b[3]||a.A);if(c||void 0===c)a.Db=b[1]||a.f,a.Zb=b[3]||a.A}function Qb(a,b,c){c&&a.i||(a.vb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.J=b[0]||a.v,a.Rb=b[2]||a.w}function Mb(a,b){b||(b=Tb);Qb(a,b,void 0);Sb(a,b,void 0)} c,64);this.c.setUint16(a,b,!0);this.ra=!0},Da:function(a,b,c){a&1&&I(this.i,c,64);this.u[a>>1]=b;this.ra=!0}};function gb(a,b,c){a.F=b;a.h=a.m=0;c&&((a.h=c.h)&&Qb(a,Rb,!1),(a.m=c.m)&&Sb(a,Rb,!1))}function Sb(a,b,c){c&&a.m||(a.zb=!a.j&&b[1]||a.g,a.jb=!a.j&&b[3]||a.A);if(c||void 0===c)a.Ab=b[1]||a.g,a.wa=b[3]||a.A}function Qb(a,b,c){c&&a.h||(a.tb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.$=b[2]||a.w}function Mb(a,b){b||(b=Tb);Qb(a,b,void 0);Sb(a,b,void 0)}
var Tb=[],Pb=[I.prototype.N,I.prototype.qa,I.prototype.aa,I.prototype.wa],Rb=[I.prototype.G,I.prototype.oa,I.prototype.R,I.prototype.ua];if(Va)var Ob=[I.prototype.D,I.prototype.na,I.prototype.O,I.prototype.ra],Nb=[I.prototype.K,I.prototype.pa,I.prototype.$,I.prototype.va]; var Tb=[],Pb=[H.prototype.N,H.prototype.ta,H.prototype.na,H.prototype.Ea],Rb=[H.prototype.G,H.prototype.pa,H.prototype.R,H.prototype.va];if(Wa)var Ob=[H.prototype.D,H.prototype.oa,H.prototype.O,H.prototype.ua],Nb=[H.prototype.J,H.prototype.qa,H.prototype.aa,H.prototype.Da];
function Ub(a,b){x.call(this,"CPU",a,Ub);var c=a.multiplier||1;this.eb=a.cycles||b;this.qa=c;this.rb=Math.round(this.eb/1E4)/100;this.ua=this.rb*this.qa;this.l.da=!1;this.l.Ab=!1;this.l.Sa=a.autoStart;this.l.bb=!1;this.ab=this.wa=0;this.cb=a.csStart;this.Oa=a.csInterval;this.Pa=a.csStop;this.J=[];this.Pb=this.ad.bind(this);F(this)}A(Ub);var Vb=["power","reset"];h=Ub.prototype; function Ub(a,b){x.call(this,"CPU",a,Ub);var c=a.multiplier||1;this.bb=a.cycles||b;this.qa=c;this.pb=Math.round(this.bb/1E4)/100;this.ta=this.pb*this.qa;this.l.da=!1;this.l.xb=!1;this.l.Qa=a.autoStart;this.l.cb=!1;this.$a=this.va=0;this.ab=a.csStart;this.Ea=a.csInterval;this.Na=a.csStop;this.I=[];this.Nb=this.Wc.bind(this);E(this)}z(Ub);var Vb=["power","reset"];k=Ub.prototype;
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.F=d;for(b=0;b<Vb.length;b++)(c=this.o[Vb[b]])&&this.j.Z(null,Vb[b],c);a=Wb(a,"autoStart");null!=a&&(this.l.Sa="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ja=function(a,b){if(!b){if(a&&this.restore){Xb(this);if(!this.restore(a))return!1;$b(this)}else this.reset();this.U("No debugger detected")}this.j.ma();return!0};h.ia=function(a){return a?this.save():!0}; k.ha=function(a,b,c,d){this.j=a;this.i=b;this.F=d;for(b=0;b<Vb.length;b++)(c=this.o[Vb[b]])&&this.j.Z(null,Vb[b],c);a=Wb(a,"autoStart");null!=a&&(this.l.Qa="true"==a?!0:"false"==a?!1:!!a);E(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.ja=function(a,b){if(!b){if(a&&this.restore){Zb(this);if(!this.restore(a))return!1;$b(this)}else this.reset();this.U("No debugger detected")}this.j.ma();return!0};k.ia=function(a){return a?this.save():!0};
h.Sa=function(){return this.l.Sa||void 0===this.o.run?(ac(this),!0):!1};h.Ib=function(){return 0};function $b(a){void 0===a.cb&&(a.cb=0);void 0===a.Oa&&(a.Oa=-1);void 0===a.Pa&&(a.Pa=-1);a.l.bb=0<=a.cb&&0<a.Oa;a.l.bb&&(a.ab=0,a.wa=a.cb-a.N)} k.Qa=function(){return this.l.Qa||void 0===this.o.run?(ac(this),!0):!1};k.Fb=function(){return 0};function $b(a){void 0===a.ab&&(a.ab=0);void 0===a.Ea&&(a.Ea=-1);void 0===a.Na&&(a.Na=-1);a.l.cb=0<=a.ab&&0<a.Ea;a.l.cb&&(a.$a=0,a.va=a.ab-a.N)}
h.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.j)if(a=d.j,a.l.P)a=!0;else{var b=null,c,l=B(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.l.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.l.P);c++);c==l.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.hb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.da?G(d):ac(d))},!0;case "speed":return this.o[b]= k.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.j)if(a=d.j,a.l.P)a=!0;else{var b=null,c,h=A(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.l.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.l.P);c++);c==h.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.gb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.da?F(d):ac(d))},!0;case "speed":return this.o[b]=
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){bc(d,d.qa<<1,!0)},c.textContent=this.ua.toFixed(2)+"Mhz",!0}return!1};h.ma=function(){var a=this.o.speed;a&&(a.textContent=this.l.da&&this.oa?this.oa.toFixed(2)+"Mhz":"Stopped")};function cc(a,b){var c=1;b&&1<a.qa&&a.oa&&(c=a.oa/a.rb);a.Mb=Math.round(1E3/30);a.gb=Math.floor(a.eb/30*c);b||(a.Qa=a.gb);a.ub=0}function dc(a){return a.N+a.aa+a.va-a.a}function Xb(a){a.oa=0;a.Ob=0;a.N=a.aa=a.va=a.a=a.G=0;$b(a);bc(a,1)} c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){bc(d,d.qa<<1,!0)},c.textContent=this.ta.toFixed(2)+"Mhz",!0}return!1};k.ma=function(){var a=this.o.speed;a&&(a.textContent=this.l.da&&this.oa?this.oa.toFixed(2)+"Mhz":"Stopped")};function cc(a,b){var c=1;b&&1<a.qa&&a.oa&&(c=a.oa/a.pb);a.Kb=Math.round(1E3/30);a.eb=Math.floor(a.bb/30*c);b||(a.Oa=a.eb);a.qb=0}function dc(a){return a.N+a.aa+a.ua-a.a}function Zb(a){a.oa=0;a.Lb=0;a.N=a.aa=a.ua=a.a=a.G=0;$b(a);bc(a,1)}
function bc(a,b,c){if(void 0!==b){.8>a.oa/a.ua&&(b=1);a.qa=b;b=a.rb*a.qa;if(a.ua!=b){a.ua=b;b=a.ua.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.j&&ec(a.j)}a.N+=a.aa;a.aa=0;a.$=ra();a.pa=0;cc(a)}function yb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ab(a,b,c){0<=b&&b<a.J.length&&0>a.J[b][0]&&(c=a.eb*a.qa/1E3*c|0,a.J[b][0]=c+fc(a))}function fc(a,b){var c=a.va-=a.a;a.a=a.G=0;b&&(a.va=0);return c} function bc(a,b,c){if(void 0!==b){.8>a.oa/a.ta&&(b=1);a.qa=b;b=a.pb*a.qa;if(a.ta!=b){a.ta=b;b=a.ta.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.j&&ec(a.j)}a.N+=a.aa;a.aa=0;a.$=ra();a.pa=0;cc(a)}function yb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Ab(a,b,c){0<=b&&b<a.I.length&&0>a.I[b][0]&&(c=a.bb*a.qa/1E3*c|0,a.I[b][0]=c+fc(a))}function fc(a,b){var c=a.ua-=a.a;a.a=a.G=0;b&&(a.ua=0);return c}
h.ad=function(){if(this.l.da){this.ub>=this.eb&&cc(this,!0);this.Ra=0;this.$a=ra();if(this.pa){var a=this.$a-this.pa;a>this.Mb&&(this.$+=a,this.$>this.$a&&(this.$=this.$a))}try{do{for(var b,c=this.l.bb?1:this.gb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Wb(b)}catch(m){if("number"!=typeof m)throw m;}b=fc(this,!0);this.Ra+=b;this.aa+=b;a=b;if(this.l.bb){var f=!1;this.ab=this.ab+this.Ib()|0;this.wa-=a;0>=this.wa&&(this.wa+=this.Oa,f=!0);0<=this.Pa&&this.Pa<=dc(this)&& k.Wc=function(){if(this.l.da){this.qb>=this.bb&&cc(this,!0);this.Pa=0;this.Wa=ra();if(this.pa){var a=this.Wa-this.pa;a>this.Kb&&(this.$+=a,this.$>this.Wa&&(this.$=this.Wa))}try{do{for(var b,c=this.l.cb?1:this.eb,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Sb(b)}catch(l){if("number"!=typeof l)throw l;}b=fc(this,!0);this.Pa+=b;this.aa+=b;a=b;if(this.l.cb){var f=!1;this.$a=this.$a+this.Fb()|0;this.va-=a;0>=this.va&&(this.va+=this.Ea,f=!0);0<=this.Na&&this.Na<=dc(this)&&
(this.Oa=this.Pa=-1,$b(this),G(this),f=!0);f&&this.U(dc(this)+" cycles: checksum="+k(this.ab))}for(var a=b,g=this.J.length-1;0<=g;g--){var l=this.J[g];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Qa-=b;if(0>=this.Qa){this.Qa+=this.gb;15<=++this.Ob&&(this.j&&this.j.ma(),this.Ob=0);break}}while(this.l.da)}catch(m){G(this);this.j&&this.j.stop(ra(),dc(this));b=m.stack||m.message;this.l.error=!0;this.C(b);return}if(this.l.da){b=setTimeout;c=this.Pb;this.pa=ra();d=this.Mb;this.Ra&&(d=Math.round(d*this.Ra/ (this.Ea=this.Na=-1,$b(this),F(this),f=!0);f&&this.U(dc(this)+" cycles: checksum="+m(this.$a))}for(var a=b,g=this.I.length-1;0<=g;g--){var h=this.I[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Oa-=b;if(0>=this.Oa){this.Oa+=this.eb;15<=++this.Lb&&(this.j&&this.j.ma(),this.Lb=0);break}}while(this.l.da)}catch(l){F(this);this.j&&this.j.stop(ra(),dc(this));b=l.stack||l.message;this.l.error=!0;this.C(b);return}if(this.l.da){b=setTimeout;c=this.Nb;this.pa=ra();d=this.Kb;this.Pa&&(d=Math.round(d*this.Pa/
this.gb));d-=this.pa-this.$a;if(e=this.pa-this.$)this.oa=Math.round(this.aa/(10*e))/100,864E5<=e&&(this.N=0,bc(this));if(0>d||this.oa<this.ua)-1E3>d&&(this.$-=d),d=0;this.ub+=this.Ra;this.pa+=d;b(c,d)}}};function ac(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.da)a.U(a.toString()+" busy");else{bc(a);a.l.da=!0;a.l.Ab=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.$,dc(a));setTimeout(a.Pb,0)}}h.Wb=function(){return 0}; this.eb));d-=this.pa-this.Wa;if(e=this.pa-this.$)this.oa=Math.round(this.aa/(10*e))/100,864E5<=e&&(this.N=0,bc(this));if(0>d||this.oa<this.ta)-1E3>d&&(this.$-=d),d=0;this.qb+=this.Pa;this.pa+=d;b(c,d)}}};function ac(a){var b;a.l.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.da)a.U(a.toString()+" busy");else{bc(a);a.l.da=!0;a.l.xb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.$,dc(a));setTimeout(a.Nb,0)}}k.Sb=function(){return 0};
function G(a){var b=!1;if(a.l.da){fc(a);a.N+=a.aa;a.aa=0;a.l.da=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),dc(a));b=!0}a.l.complete=void 0;return b}function gc(a){this.Za=+a.model||1170;this.Kb=a.addrReset||0;Ub.call(this,a,6666667);this.decode=1120==this.Za?hc.bind(this):ic.bind(this);jc(this);this.ra=0;this.O=null;this.l.complete=!1}A(gc,Ub);h=gc.prototype;h.reset=function(){this.status("model "+this.Za);this.l.da&&G(this);jc(this);Xb(this);this.l.error=!1;this.parent.reset.call(this)}; function F(a){var b=!1;if(a.l.da){fc(a);a.N+=a.aa;a.aa=0;a.l.da=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),dc(a));b=!0}a.l.complete=void 0;return b}function gc(a){this.Za=+a.model||1170;this.Gb=a.addrReset||0;Ub.call(this,a,6666667);this.decode=1120==this.Za?hc.bind(this):ic.bind(this);jc(this);this.rb=0;this.O=null;this.l.complete=!1}z(gc,Ub);k=gc.prototype;k.reset=function(){this.status("model "+this.Za);this.l.da&&F(this);jc(this);Zb(this);this.l.error=!1;this.parent.reset.call(this)};
function jc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.B=15;a.g=[0,0,0,0,0,0,0,a.Kb];a.Fa=[0,0,0,0,0,0];a.la=[0,0,0,0];a.v=0;a.Ya=0;a.ic=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.kc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, function jc(a){a.m=65536;a.g=32768;a.h=65535;a.u=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Gb];a.Ga=[0,0,0,0,0,0];a.la=[0,0,0,0];a.v=0;a.Ya=0;a.cc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Va=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.Ub=[0,0,0,0,0,0,0,0];a.Tb=0;a.u=0;a.A=a.D=0;a.c=a.b=a.pb=0;a.Ga=-1;kc(a)}function kc(a){a.Ca=255;a.I=0;a.yb=0;a.w=0;a.Aa=0;a.xb=0;a.Ba=0;a.Ea=0;a.Xa=0;a.tb=262143;a.Wa=253952;a.O=null;a.h&&Cb(a)}function Cb(a){a.Ea?(a.R=65536,a.K=a.hc,a.V=a.Yc,a.kb=a.Qd,ib(a.h,a.Ba&16?22:18)):(a.R=0,a.K=a.gc,a.V=a.Sb,a.kb=a.$b,ib(a.h,16))}function lc(a,b,c){a.Kb=b;O(a,b);!c&&a.F&&(G(a)||a.F.ma())}h.Ib=function(){return 0}; 0,0,0,0,0,0,0,0,0];a.Qb=[0,0,0,0,0,0,0,0];a.Pb=0;a.s=0;a.A=a.D=0;a.c=a.b=a.lb=0;a.wa=-1;kc(a)}function kc(a){a.Ba=255;a.M=0;a.wb=0;a.w=0;a.Aa=0;a.vb=0;a.Fa=0;a.Sa=0;a.Xa=0;a.Jb=262143;a.O=null;a.i&&Cb(a)}function Cb(a){a.Sa?(a.R=65536,a.J=a.bc,a.V=a.Tc,a.jb=a.Nd,ib(a.i,a.Fa&16?22:18)):(a.R=0,a.J=a.ac,a.V=a.Sc,a.jb=a.Md,ib(a.i,16))}function lc(a,b,c){a.Gb=b;O(a,b);!c&&a.F&&(F(a)||a.F.ma())}k.Fb=function(){return 0};
h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.N,this.qa]);a.set(2,sb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.N=b[1];bc(this,b[3]);a:{b=this.h;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.G){for(var f=0,g=Array(b.G),l=0;l<e.length-1;)for(var m=e[l++],p=e[l++];m--;)g[f++]=p;e=g}f=b.h[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Q(a){return a.m&65536?1:0} k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.N,this.qa]);a.set(2,tb(this.i));return a.data()};k.restore=function(a){var b=a[1];this.N=b[1];bc(this,b[3]);a:{b=this.i;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.G){for(var f=0,g=Array(b.G),h=0;h<e.length-1;)for(var l=e[h++],n=e[h++];l--;)g[f++]=n;e=g}f=b.b[d];if(!f||!f.restore(e)){u("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Q(a){return a.m&65536?1:0}
h.ya=function(){return this.s&32768?8:0};function mc(a){var b=a.g[7];a.w&57344||(a.Aa=0,a.xb=b);a.g[7]=b+2&65535;return a.V(b)}function nc(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function O(a,b){a.g[7]=b&65535}function Bb(a,b){return{dd:a,Ia:b,next:null}}function zb(a,b){if(b!=a.O){var c=a.O;if(!c||c.Ia<=b.Ia)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Ia<=b.Ia){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=2}function $a(a){return a.B=a.B&63728|a.ya()|(a.i&65535?0:4)|(a.f&32768?2:0)|Q(a)} k.ya=function(){return this.u&32768?8:0};function mc(a){var b=a.f[7];a.w&57344||(a.Aa=0,a.vb=b);a.f[7]=b+2&65535;return a.V(b)}function nc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function O(a,b){a.f[7]=b&65535}function Bb(a,b){return{Zc:a,Ia:b,next:null}}function zb(a,b){if(b!=a.O){var c=a.O;if(!c||c.Ia<=b.Ia)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Ia<=b.Ia){b.next=d;c.next=b;break}c=d}while(c)}}a.s|=2}function ab(a){return a.B=a.B&63728|a.ya()|(a.h&65535?0:4)|(a.g&32768?2:0)|Q(a)}
function Eb(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.g[c];a.g[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.la[c]=a.g[6],a.g[6]=a.la[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function oc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function pc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function qc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function rc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} function Eb(a,b){a.u=b<<12;a.h=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ga.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ga[c];a.Ga[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.la[c]=a.f[6],a.f[6]=a.la[a.v]);a.B=b;a.s|=2}function R(a,b){a.s&128||(a.u=a.h=b,a.g=0)}function oc(a,b,c){a.s&128||(a.u=a.h=a.m=b,a.g=c||0)}function pc(a,b,c,d){a.s&128||(a.u=a.h=a.m=b,a.g=(c^b)&(d^b))}function qc(a,b){a.s&128||(a.u=a.h=a.m=b,a.g=a.u^a.m>>1)}function rc(a,b,c,d){a.s&128||(a.u=a.h=a.m=b,a.g=(c^d)&(d^b))}
function J(a,b,c){if(!a.ra){var d=!1;0>a.Ga?a.Ga=$a(a):a.v||(b=4,d=!0);a.w&57344||(a.Aa=63222,a.xb=b);a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);Eb(a,f&-12289|a.Ga>>2&12288);d&&(a.I|=4,a.g[6]=4);sc(a,a.Ga);sc(a,a.g[7]);O(a,e);a.u&=-113;a.Ga=-1;a.u|=8;if(26!=c)throw b;}}function tc(a){var b=uc(a),c=uc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Eb(a,c);a.u&=-17} function J(a,b,c){if(!a.rb){var d=!1;0>a.wa?a.wa=ab(a):a.v||(b=4,d=!0);a.w&57344||(a.Aa=63222,a.vb=b);a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);Eb(a,f&-12289|a.wa>>2&12288);d&&(a.M|=4,a.f[6]=4);sc(a,a.wa);sc(a,a.f[7]);O(a,e);a.s&=-113;a.wa=-1;a.s|=8;if(26!=c)throw b;}}function tc(a){var b=uc(a),c=uc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Eb(a,c);a.s&=-17}
function vc(a,b){var c=b>>13&31;31>c?a.Ba&32&&(b=a.kc[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} function qb(a,b){var c=b>>13&31;31>c&&a.Fa&32&&(b=a.Va[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
function wc(a,b,c){var d,e,f,g=0;d=b>>13;a.Ba&a.ic[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.tb;f<a.Wa?f&1&&!(c&1)&&(a.I|=64,J(a,4,10)):(a.Ba&16||253952<=f&&(f|=4186112),4186112>f&&(3932160<=f&&(f=vc(a,f&262143)),f>=a.Wa&&4186112>f&&(a.I|=32,J(a,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|= function vc(a,b,c){var d,e,f,g=0;d=b>>13;a.Fa&a.cc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Jb;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(4194170!==f||a.v)a.Xa=a.v,a.Ya=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.w&57344||(a.w=a.w|g|a.Xa<<5|a.Ya<<1),b=!0),a.w&61440||!(4191360>
16384));a.H[a.v][d]=e;if(4194170!==f||a.v)a.Xa=a.v,a.Ya=d;g&&(g&57344&&(0<=a.Ga&&(g|=128),a.w&57344||(a.w=a.w|g|a.Xa<<5|a.Ya<<1),J(a,168,16)),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.u|=32)));return f}function xc(a,b,c){b&1&&a.a--;a=a.h;a.h[(b&a.i)>>>a.c].Cb(b&a.j,c&255,b)}function uc(a){var b=a.V(a.g[6]|a.R);a.g[6]=a.g[6]+2&65535;return b} f||4194239<f)||(a.w|=4096,a.w&512&&(a.s|=32)),b&&J(a,168,16));return f}function wc(a,b,c){b&1&&a.a--;a=a.i;c&=255;3932160<=b&&(b=qb(a.a,b));a.b[(b&a.g)>>>a.c].zb(b&a.j,c&255,b)}function uc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function sc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.w&57344||(a.Aa=a.Aa<<8|246);!a.v&&c<=a.Ba&&4<c&&(c<=a.Ba-32?(a.M|=4,a.f[6]=4,J(a,4,18)):(a.M|=8,a.s|=4));a.jb(c,b)}
function sc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w&57344||(a.Aa=a.Aa<<8|246);!a.v&&c<=a.Ca&&4<c&&(c<=a.Ca-32?(a.I|=4,a.g[6]=4,J(a,4,18)):(a.I|=8,a.u|=4));a.kb(c,b)} function xc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return J(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.f[6]<=a.Ba||65534<=a.f[6])&&(a.f[6]<=a.Ba-32||65534<=a.f[6]?(a.M|=4,a.f[6]=4,J(a,4,22)):(a.M|=8,a.s|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=g);e=a.V(e)|g;a.a-=
function yc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return J(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.g[6]<=a.Ca||65534<=a.g[6])&&(a.g[6]<=a.Ca-32||65534<=a.g[6]?(a.I|=4,a.g[6]=4,J(a,4,22)):(a.I|=8,a.u|=64)),a.a-=3,7===c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!==c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!==c&&(e|=g);e=a.V(e)|g;a.a-= 8;break;case 6:return e=a.V(nc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(nc(a,2)),e=e+a.f[c]&65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!g||a.w&57344||(a.Aa=a.Aa<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.Ba||65534<=a.f[6])&&(a.f[6]<=a.Ba-32?(a.M|=4,a.f[6]=4,J(a,4,24)):(a.M|=8,a.s|=64));return e}k.Ua=function(a,b){this.Sa?(this.rb++,wc(this,vc(this,a,5),b),this.rb--):this.i.Ua(a,b)};k.ac=function(a,b,c){return xc(this,a,b,c)};
8;break;case 6:return e=a.V(nc(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.V(nc(a,2)),e=e+a.g[c]&65535,e=a.V(e|a.R)|g,a.a-=10,e}a.g[c]=a.g[c]+f&65535;!g||a.w&57344||(a.Aa=a.Aa<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.g[6]<=a.Ca||65534<=a.g[6])&&(a.g[6]<=a.Ca-32?(a.I|=4,a.g[6]=4,J(a,4,24)):(a.I|=8,a.u|=64));return e}h.qb=function(a){if(!this.Ea)return this.h.qb(a);this.ra++;a=this.Sb(wc(this,a,2));this.ra--;return a}; k.bc=function(a,b,c){return vc(this,xc(this,a,b,c),c)};k.Sc=function(a){return rb(this.i,a)};k.Tc=function(a){return rb(this.i,vc(this,a,2))};k.Md=function(a,b){sb(this.i,a,b&65535)};k.Nd=function(a,b){sb(this.i,vc(this,a,4),b)};function yc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=xc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.la[a.B>>12&3];return c}
h.Va=function(a,b){this.Ea?(this.ra++,xc(this,wc(this,a,5),b),this.ra--):this.h.Va(a,b)};h.zb=function(a,b){this.Ea?(this.ra++,this.$b(wc(this,a,4),b),this.ra--):this.h.zb(a,b)};h.gc=function(a,b,c){return yc(this,a,b,c)};h.hc=function(a,b,c){return wc(this,yc(this,a,b,c),c)};h.Sb=function(a){return qb(this.h,a)};h.Yc=function(a){return qb(this.h,wc(this,a,2))};h.$b=function(a,b){rb(this.h,a,b&65535)};h.Qd=function(a,b){rb(this.h,wc(this,a,4),b)}; function zc(a,b,c,d){a.w&57344||(a.Aa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=xc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=vc(a,e|c&65536,4),a.v=a.B>>14&3,sb(a.i,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.la[a.B>>12&3]=d}function Ac(a,b){b>>=6;var c=a.D=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=pb(a.i,c)):a=a.f[c]&255;return a}function Bc(a,b){b>>=6;var c=a.D=b&7;return(b=a.A=(b&56)>>3)?rb(a.i,a.J(b,c,2)):a.f[c]}function Cc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return xc(a,b,c,8)}
function zc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=yc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.g[d]:a.la[a.B>>12&3];return c}function Ac(a,b,c,d){a.w&57344||(a.Aa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=yc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=wc(a,e|c&65536,4),a.v=a.B>>14&3,rb(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.g[e]=d:a.la[a.B>>12&3]=d} function Dc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=pb(a.i,c)):a=a.f[c]&255;return a}function Ec(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?rb(a.i,a.J(b,c,2)):a.f[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.lb=a.J(b,e,7),wc(a,e,d.call(a,c,pb(a.i,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),sb(a.i,e,d.call(a,c,rb(a.i,e)))):a.f[e]=d.call(a,c,a.f[e])}
function Bc(a,b){b>>=6;var c=a.D=b&7;(b=a.A=(b&56)>>3)?(c=a.K(b,c,3),a=pb(a.h,c)):a=a.g[c]&255;return a}function Cc(a,b){b>>=6;var c=a.D=b&7;return(b=a.A=(b&56)>>3)?qb(a.h,a.K(b,c,2)):a.g[c]}function Dc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return yc(a,b,c,8)}function Ec(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.K(b,c,3),a=pb(a.h,c)):a=a.g[c]&255;return a}function Fc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?qb(a.h,a.K(b,c,2)):a.g[c]} function Fc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?wc(a,a.J(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 Gc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?sb(a.i,a.J(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(O(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.pb=a.K(b,e,7),xc(a,e,d.call(a,c,pb(a.h,e)))):a.g[e]=a.g[e]&65280|d.call(a,c,a.g[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.K(b,e,6),rb(a.h,e,d.call(a,c,qb(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Gc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?xc(a,a.K(b,e,5),c):a.g[e]=c?d&1?c<<24>>24&65535:a.g[e]&-256|c&255:a.g[e]&-256;return c} k.Sb=function(a){this.l.complete=!0;var b=a?this.l.xb?0:1:-1;this.l.xb=!1;this.ua=this.a=a;do{if(this.s){this.s&112&&(this.s&32?J(this,168,28):this.s&64?J(this,4,30):this.s&16&&J(this,12,32),this.s&=-113);if(a=this.s&7){a=!1;if(this.s&2){this.s&=-3;var c=160,d=(this.wb&224)>>5,e=this.O&&this.O.Ia>d?this.O:null;e&&(c=e.Zc,d=e.Ia);d>(this.B&224)>>5?(this.s&4&&(nc(this,2),this.s&=-5),J(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.O,e==a)this.O=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=
function Hc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?rb(a.h,a.K(b,d,4),c):a.g[d]=c&65535;return c}function V(a,b,c){c&&(O(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} d}a=!0}}else this.s&1&&this.s++;a=a&&0>b}if(a)break}this.s=this.s&7|this.B&16;this.decode(mc(this))}while(0<this.a);return this.l.complete?this.ua-this.a:void 0===this.l.complete?0:-1};Ha(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new gc(d);C(d,c)}});function Hc(a,b){var c=b+a;pc(this,c,a,b);return c&65535}function Ic(a,b){var c=b+a;pc(this,c<<8,a<<8,b<<8);return c&255}function Jc(a,b){a=b<<1;qc(this,a);return a&65535}
h.Wb=function(a){this.l.complete=!0;var b=a?this.l.Ab?0:1:-1;this.l.Ab=!1;this.va=this.a=a;do{if(this.u){this.u&112&&(this.u&32?J(this,168,28):this.u&64?J(this,4,30):this.u&16&&J(this,12,32),this.u&=-113);if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.yb&224)>>5,e=this.O&&this.O.Ia>d?this.O:null;e&&(c=e.dd,d=e.Ia);d>(this.B&224)>>5?(this.u&4&&(nc(this,2),this.u&=-5),J(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.O,e==a)this.O=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= function Kc(a,b){a=b<<1;qc(this,a<<8);return a&255}function Lc(a,b){a=b&32768|b>>1|b<<16;qc(this,a);return a&65535}function Mc(a,b){a=b&2048|b>>1|b<<8;qc(this,a<<8);return a&255}function Nc(a,b){a=b&~a;R(this,a);return a}function Oc(a,b){a=b&~a;R(this,a<<8);return a}function Pc(a,b){a|=b;R(this,a);return a}function Qc(a,b){a|=b;R(this,a<<8);return a}function Rc(a,b){a=~b|65536;oc(this,a);return a&65535}function Sc(a,b){a=~b|256;oc(this,a<<8);return a&255}
d}a=!0}}else this.u&1&&this.u++;a=a&&0>b}if(a)break}this.u=this.u&7|this.B&16;this.decode(mc(this))}while(0<this.a);return this.l.complete?this.va-this.a:void 0===this.l.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new gc(d);D(d,c)}});function Ic(a,b){var c=b+a;pc(this,c,a,b);return c&65535}function Jc(a,b){var c=b+a;pc(this,c<<8,a<<8,b<<8);return c&255}function Kc(a,b){a=b<<1;qc(this,a);return a&65535} function Tc(a,b){a=b-a;this.s&128||(this.u=this.h=a,this.g=b&(b^a));return a&65535}function Uc(a,b){a=b-a;var c=a<<8;b<<=8;this.s&128||(this.u=this.h=c,this.g=b&(b^c));return a&255}function Vc(a,b){a=b+a;this.s&128||(this.u=this.h=a,this.g=a&(b^a));return a&65535}function Wc(a,b){a=b+a;var c=a<<8;this.s&128||(this.u=this.h=c,this.g=c&(b<<8^c));return a&255}function Xc(a,b){a=-b;oc(this,a,a&b&32768);return a&65535}function Yc(a,b){a=-b;oc(this,a<<8,(a&b&128)<<8);return a&255}
function Lc(a,b){a=b<<1;qc(this,a<<8);return a&255}function Mc(a,b){a=b&32768|b>>1|b<<16;qc(this,a);return a&65535}function Nc(a,b){a=b&2048|b>>1|b<<8;qc(this,a<<8);return a&255}function Oc(a,b){a=b&~a;R(this,a);return a}function Pc(a,b){a=b&~a;R(this,a<<8);return a}function Qc(a,b){a|=b;R(this,a);return a}function Rc(a,b){a|=b;R(this,a<<8);return a}function Sc(a,b){a=~b|65536;oc(this,a);return a&65535}function Tc(a,b){a=~b|256;oc(this,a<<8);return a&255} function Zc(a,b){a=b<<1|this.m>>16&1;qc(this,a);return a&65535}function $c(a,b){a=b<<1|this.m>>16&1;qc(this,a<<8);return a&255}function ad(a,b){a=(this.m&65536|b)>>1|b<<16;qc(this,a);return a&65535}function bd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;qc(this,a<<8);return a&255}function cd(a,b){var c=b-a;rc(this,c,a,b);return c&65535}function dd(a,b){var c=b-a;rc(this,c<<8,a<<8,b<<8);return c&255}function ed(a,b){this.s&128||(this.u=this.h=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}
function Uc(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function Vc(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.f=b&(b^c));return a&255}function Wc(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function Xc(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function Yc(a,b){a=-b;oc(this,a,a&b&32768);return a&65535}function Zc(a,b){a=-b;oc(this,a<<8,(a&b&128)<<8);return a&255} function fd(a,b){a^=b;R(this,a);return a&65535}function gd(a){U(this,a,Bc(this,a),Hc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function hd(a){var b=Ec(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.u=this.h=c;this.a-=(this.c?6:7)+b}
function $c(a,b){a=b<<1|this.m>>16&1;qc(this,a);return a&65535}function ad(a,b){a=b<<1|this.m>>16&1;qc(this,a<<8);return a&255}function bd(a,b){a=(this.m&65536|b)>>1|b<<16;qc(this,a);return a&65535}function cd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;qc(this,a<<8);return a&255}function dd(a,b){var c=b-a;rc(this,c,a,b);return c&65535}function ed(a,b){var c=b-a;rc(this,c<<8,a<<8,b<<8);return c&255}function fd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} function id(a){var b=Ec(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.u=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function jd(a){V(this,a,!Q(this))}function kd(a){V(this,a,Q(this))}
function gd(a,b){a^=b;R(this,a);return a&65535}function hd(a){U(this,a,Cc(this,a),Ic);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function id(a){var b=Fc(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function ld(a){U(this,a,Bc(this,a),Nc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function md(a){T(this,a,Ac(this,a),Oc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function nd(a){U(this,a,Bc(this,a),Pc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function od(a){T(this,a,Ac(this,a),Qc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
function jd(a){var b=Fc(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function kd(a){V(this,a,!Q(this))}function ld(a){V(this,a,Q(this))} function pd(a){R(this,Bc(this,a)&Ec(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function qd(a){R(this,(Ac(this,a)&Dc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function rd(a){V(this,a,this.h&65535?0:4)}function sd(a){V(this,a,!this.ya()==!(this.g&32768))}function td(a){V(this,a,!!(this.h&65535)&&!this.ya()==!(this.g&32768))}function ud(a){V(this,a,!Q(this)&&!!(this.h&65535))}
function md(a){U(this,a,Cc(this,a),Oc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function nd(a){T(this,a,Bc(this,a),Pc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function od(a){U(this,a,Cc(this,a),Qc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function pd(a){T(this,a,Bc(this,a),Rc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function vd(a){V(this,a,(this.h&65535?0:4)||!this.ya()!=!(this.g&32768))}function wd(a){V(this,a,Q(this)||(this.h&65535?0:4))}function xd(a){V(this,a,!this.ya()!=!(this.g&32768))}function yd(a){V(this,a,this.ya())}function zd(a){V(this,a,!!(this.h&65535))}function Ad(a){V(this,a,!this.ya())}function Bd(){J(this,12,1);this.a-=5}function Cd(a){V(this,a,!0)}function Dd(a){V(this,a,!(this.g&32768))}function Ed(a){V(this,a,this.g&32768?2:0)}
function qd(a){R(this,Cc(this,a)&Fc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function rd(a){R(this,(Bc(this,a)&Ec(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function sd(a){V(this,a,this.i&65535?0:4)}function td(a){V(this,a,!this.ya()==!(this.f&32768))}function ud(a){V(this,a,!!(this.i&65535)&&!this.ya()==!(this.f&32768))}function vd(a){V(this,a,!Q(this)&&!!(this.i&65535))} function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.u=0);this.a-=5}function Fd(a){var b=Bc(this,a);a=Ec(this,a);rc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Gd(a){var b=Ac(this,a)<<8;a=Dc(this,a)<<8;rc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}
function wd(a){V(this,a,(this.i&65535?0:4)||!this.ya()!=!(this.f&32768))}function xd(a){V(this,a,Q(this)||(this.i&65535?0:4))}function yd(a){V(this,a,!this.ya()!=!(this.f&32768))}function zd(a){V(this,a,this.ya())}function Ad(a){V(this,a,!!(this.i&65535))}function Bd(a){V(this,a,!this.ya())}function Cd(){J(this,12,1);this.a-=5}function Dd(a){V(this,a,!0)}function Ed(a){V(this,a,!(this.f&32768))}function Fd(a){V(this,a,this.f&32768?2:0)} function Hd(a){var b=Ec(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.h=d>>16|d,this.u=d>>16):(this.g=32768,this.h=d>>15|d,this.u=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.u=0,this.g=32768,this.m=65536,this.a-=7}function Id(){J(this,24,2);this.a-=25}
function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Gd(a){var b=Cc(this,a);a=Fc(this,a);rc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Hd(a){var b=Bc(this,a)<<8;a=Ec(this,a)<<8;rc(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)} function Jd(){this.B&49152?(this.M|=128,J(this,4,3)):this.F?this.F.i():F(this);this.a-=7}function Kd(){J(this,16,4);this.a-=25}var Ld=[0,7,7,10,7,11,9,13];function Md(a){this.G=this.a;O(this,Cc(this,a));this.a=this.G-Ld[this.c]}var Nd=[0,14,14,17,14,18,16,20];function Od(a){this.G=this.a;var b=Cc(this,a);a=a>>6&7;sc(this,this.f[a]);this.f[a]=this.f[7];O(this,b);this.a=this.G-Nd[this.c]}var Pd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function Id(a){var b=Fc(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function Jd(){J(this,24,2);this.a-=25} function Qd(a){var b=Bc(this,a);this.G=this.a;R(this,Gc(this,a,b));this.a=this.G-Pd[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Rd(a){var b=Ac(this,a);R(this,Fc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var Sd=[7,13,13,17,14,18,17,21];
function Kd(){this.B&49152?(this.I|=128,J(this,4,3)):this.F?this.F.b():G(this);this.a-=7}function Ld(){J(this,16,4);this.a-=25}var Md=[0,7,7,10,7,11,9,13];function Nd(a){this.G=this.a;O(this,Dc(this,a));this.a=this.G-Md[this.c]}var Od=[0,14,14,17,14,18,16,20];function Pd(a){this.G=this.a;var b=Dc(this,a);a=a>>6&7;sc(this,this.g[a]);this.g[a]=this.g[7];O(this,b);this.a=this.G-Od[this.c]}var Qd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function Td(a){var b=Ec(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.s&128||(this.u=b>>16,this.h=this.u|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function Ud(){this.a-=5}function Vd(){this.B&49152||(kc(this),this.i.reset());this.a-=667}function Wd(){tc(this);this.s|=this.B&16;this.a-=13}
function Rd(a){var b=Cc(this,a);this.G=this.a;R(this,Hc(this,a,b));this.a=this.G-Qd[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Sd(a){var b=Bc(this,a);R(this,Gc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var Td=[7,13,13,17,14,18,17,21]; function Xd(a){if(a&8)J(this,8,6);else{var b=uc(this);a&=7;7==a?O(this,b):(O(this,this.f[a]),this.f[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.h=0);a&8&&(this.u=32768);this.a-=5}function Yd(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)O(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Zd(a){U(this,a,Bc(this,a),cd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
function Ud(a){var b=Fc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function Vd(){this.a-=5}function Wd(){this.B&49152||(kc(this),this.h.reset());this.a-=667}function Xd(){tc(this);this.u|=this.B&16;this.a-=13} function $d(a){U(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)}function ae(){J(this,28,5);this.a-=5}function be(){this.s&4||this.j.ma();this.s|=4;nc(this,-2);this.a-=3}function ce(a){U(this,a,Bc(this,a),fd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,6)}function hc(a){de[a>>12].call(this,a)}function ee(a){fe[a>>6&3].call(this,a)}function ge(a){he[a>>6&3].call(this,a)}function ie(a){je[a>>6&3].call(this,a)}function ke(a){le[a&15].call(this,a)}function me(a){ne[a&15].call(this,a)}
function Yd(a){if(a&8)J(this,8,6);else{var b=uc(this);a&=7;7==a?O(this,b):(O(this,this.g[a]),this.g[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function Zd(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)O(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function $d(a){U(this,a,Cc(this,a),dd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} function oe(a){pe[a>>6&3].call(this,a)}function qe(a){re[a>>6&3].call(this,a)}function se(a){te[a>>6&3].call(this,a)}
function ae(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}function be(){J(this,28,5);this.a-=5}function ce(){this.u&4||this.j.ma();this.u|=4;nc(this,-2);this.a-=3}function de(a){U(this,a,Cc(this,a),gd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,6)}function hc(a){ee[a>>12].call(this,a)}function fe(a){ge[a>>6&3].call(this,a)}function he(a){ie[a>>6&3].call(this,a)}function je(a){ke[a>>6&3].call(this,a)}function le(a){me[a&15].call(this,a)}function ne(a){oe[a&15].call(this,a)} var de=[function(a){ue[a>>8&15].call(this,a)},Qd,Fd,pd,ld,nd,gd,Y,function(a){ve[a>>8&15].call(this,a)},Rd,Gd,qd,md,od,Zd,Y],ue=[function(a){we[a>>4&15].call(this,a)},Cd,zd,rd,sd,xd,td,vd,Od,Od,ee,ge,ie,Y,Y,Y],fe=[function(a){oc(this,Gc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Tc);this.a-=this.c?9:3+(7==this.b?2:0)}],he=[function(a){U(this,a,0,
function pe(a){qe[a>>6&3].call(this,a)}function re(a){se[a>>6&3].call(this,a)}function te(a){ue[a>>6&3].call(this,a)} Xc);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Ec(this,a);oc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],je=[function(a){U(this,a,0,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],
var ee=[function(a){ve[a>>8&15].call(this,a)},Rd,Gd,qd,md,od,hd,Y,function(a){we[a>>8&15].call(this,a)},Sd,Hd,rd,nd,pd,$d,Y],ve=[function(a){xe[a>>4&15].call(this,a)},Dd,Ad,sd,td,yd,ud,wd,Pd,Pd,fe,he,je,Y,Y,Y],ge=[function(a){oc(this,Hc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}],ie=[function(a){U(this,a,0, we=[function(a){xe[a&15].call(this,a)},Y,Y,Y,Md,Md,Md,Md,Xd,Y,ke,me,$d,$d,$d,$d],xe=[Jd,be,Wd,Bd,Kd,Vd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],le=[Ud,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.u=0;this.a-=5},W,W,W,W,W,W,W],ne=[Ud,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.u=32768;this.a-=5},X,X,X,X,X,X,X],ve=[Ad,yd,ud,wd,Dd,Ed,jd,kd,Id,ae,oe,qe,se,Y,Y,Y],pe=[function(a){oc(this,
Yc);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Fc(this,a);oc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],ke=[function(a){U(this,a,0,bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Mc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}], Fc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Uc);this.a-=this.c?9:3+(7==this.b?2:0)}],re=[function(a){T(this,a,0,Yc);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Dc(this,a);oc(this,a<<8);this.a-=this.c?4:3+(7==this.b?
xe=[function(a){ye[a&15].call(this,a)},Y,Y,Y,Nd,Nd,Nd,Nd,Yd,Y,le,ne,ae,ae,ae,ae],ye=[Kd,ce,Xd,Cd,Ld,Wd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],me=[Vd,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],oe=[Vd,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],we=[Bd,zd,vd,xd,Ed,Fd,kd,ld,Jd,be,pe,re,te,Y,Y,Y],qe=[function(a){oc(this, 2:0)}],te=[function(a){T(this,a,0,bd);this.a-=this.c?9+(this.lb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,$c);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Mc);this.a-=this.c?9+(this.lb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}];function ic(a){ye[a>>12].call(this,a)}
Gc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Vc);this.a-=this.c?9:3+(7==this.b?2:0)}],se=[function(a){T(this,a,0,Zc);this.a-=this.c?11:6},function(a){T(this,a,Q(this)?1:0,Jc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,Q(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Ec(this,a);oc(this,a<<8);this.a-=this.c?4:3+(7==this.b? var ye=[function(a){ze[a>>8&15].call(this,a)},Qd,Fd,pd,ld,nd,gd,function(a){Ae[a>>8&15].call(this,a)},function(a){Be[a>>8&15].call(this,a)},Rd,Gd,qd,md,od,Zd,Y],ze=[function(a){Ce[a>>4&15].call(this,a)},Cd,zd,rd,sd,xd,td,vd,Od,Od,ee,ge,ie,function(a){De[a>>6&3].call(this,a)},Y,Y],De=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);O(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=yc(this,a,0);sc(this,a);R(this,a);this.a-=11},function(a){var b=uc(this);this.G=
2:0)}],ue=[function(a){T(this,a,0,cd);this.a-=this.c?9+(this.pb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Nc);this.a-=this.c?9+(this.pb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Lc);this.a-=this.c?9:3+(7==this.b?2:0)}];function ic(a){ze[a>>12].call(this,a)} this.a;zc(this,a,0,b);R(this,b);this.a=this.G-Sd[this.c]},function(a){R(this,Gc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ce=[function(a){Ee[a&15].call(this,a)},Y,Y,Y,Md,Md,Md,Md,Xd,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.s|=1),this.a-=5):J(this,8,6)},ke,me,$d,$d,$d,$d],Ee=[Jd,be,Wd,Bd,Kd,Vd,function(){tc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Ae=[Td,Td,Hd,Hd,hd,hd,id,id,ce,ce,Y,Y,Y,Y,Yd,Yd],Be=[Ad,yd,ud,wd,Dd,Ed,jd,kd,Id,ae,oe,qe,se,function(a){Fe[a>>6&
var ze=[function(a){Ae[a>>8&15].call(this,a)},Rd,Gd,qd,md,od,hd,function(a){Be[a>>8&15].call(this,a)},function(a){Ce[a>>8&15].call(this,a)},Sd,Hd,rd,nd,pd,$d,Y],Ae=[function(a){De[a>>4&15].call(this,a)},Dd,Ad,sd,td,yd,ud,wd,Pd,Pd,fe,he,je,function(a){Ee[a>>6&3].call(this,a)},Y,Y],Ee=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);O(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=zc(this,a,0);sc(this,a);R(this,a);this.a-=11},function(a){var b=uc(this);this.G= 3].call(this,a)},Y,Y],Fe=[Y,function(a){a=yc(this,a,65536);sc(this,a);R(this,a);this.a-=11},function(a){var b=uc(this);this.G=this.a;zc(this,a,65536,b);R(this,b);this.a=this.G-Sd[this.c]},Y];
this.a;Ac(this,a,0,b);R(this,b);this.a=this.G-Td[this.c]},function(a){R(this,Hc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],De=[function(a){Fe[a&15].call(this,a)},Y,Y,Y,Nd,Nd,Nd,Nd,Yd,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):J(this,8,6)},le,ne,ae,ae,ae,ae],Fe=[Kd,ce,Xd,Cd,Ld,Wd,function(){tc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Be=[Ud,Ud,Id,Id,id,id,jd,jd,de,de,Y,Y,Y,Y,Zd,Zd],Ce=[Bd,zd,vd,xd,Ed,Fd,kd,ld,Jd,be,pe,re,te,function(a){Ge[a>>6& function Ge(a){x.call(this,"ROM",a,Ge);this.W=this.b=null;this.h=a.addr;this.c=a.size;this.g=a.alias;this.j=a.file;this.m=q(this.j);if(this.j){a=this.j;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?c.C("Unable to load ROM resource (error "+f+": "+a+")"):(Sa(c.na,a,b),(a=ta(a,b))?(c.b=a.K,c.W=a.W):c.j=null,He(c))})}}z(Ge);Ge.prototype.ha=function(a,b,c,d){this.i=b;this.a=c;this.F=d;He(this)};
3].call(this,a)},Y,Y],Ge=[Y,function(a){a=zc(this,a,65536);sc(this,a);R(this,a);this.a-=11},function(a){var b=uc(this);this.G=this.a;Ac(this,a,65536,b);R(this,b);this.a=this.G-Td[this.c]},Y]; Ge.prototype.ja=function(){this.W&&(this.F&&this.F.a(this.id,this.h,this.c,this.W),delete this.W);return!0};Ge.prototype.ia=function(){return!0};
function He(a){x.call(this,"ROM",a,He);this.W=this.b=null;this.i=a.addr;this.c=a.size;this.f=a.alias;this.j=a.file;this.m=n(this.j);if(this.j){a=this.j;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?c.C("Unable to load ROM resource (error "+f+": "+a+")"):(Ra(c.na,a,b),(a=ta(a,b))?(c.b=a.L,c.W=a.W):c.j=null,Ie(c))})}}A(He);He.prototype.ha=function(a,b,c,d){this.h=b;this.a=c;this.F=d;Ie(this)}; function He(a){if(!Va(a)){if(a.j){if(!a.b||!a.i)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+m(a.b.length,8,!0)+") does not match specified size ("+m(a.c,8,!0)+")";a.l.error=!0;a.C(b)}else{b=a.h;if(lb(a.i,b,a.c,Lb)){var c;for(c=0;c<a.b.length;c++)a.i.Ua(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=kb(d.i,d.h,d.c);jb(d.i,e,d.c,f)}delete a.b}}}E(a)}}
He.prototype.ja=function(){this.W&&(this.F&&this.F.a(this.id,this.i,this.c,this.W),delete this.W);return!0};He.prototype.ia=function(){return!0}; Ha(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ge(d);C(d,c)}});
function Ie(a){if(!Ua(a)){if(a.j){if(!a.b||!a.h)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+k(a.b.length,8,!0)+") does not match specified size ("+k(a.c,8,!0)+")";a.l.error=!0;a.C(b)}else{b=a.i;if(lb(a.h,b,a.c,Lb)){var c;for(c=0;c<a.b.length;c++)a.h.Va(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){var d=a,e=b[c],f=kb(d.h,d.i,d.c);jb(d.h,e,d.c,f)}delete a.b}}}F(a)}} function Ie(a){x.call(this,"RAM",a,Ie);this.W=this.c=null;this.j=a.addr;this.h=a.size;this.fa=a.load;this.ea=a.exec;this.g=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?c.C("Unable to load RAM resource (error "+f+": "+a+")"):(Sa(c.na,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.fa&&(c.fa=a.fa),null==c.ea&&(c.ea=a.ea)):c.b=null,Je(c))})}}z(Ie);
Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new He(d);D(d,c)}}); Ie.prototype.ha=function(a,b,c,d){this.i=b;this.a=c;this.F=d;Je(this)};Ie.prototype.ja=function(){this.W&&(this.F&&this.F.a(this.id,this.j,this.h,this.W),delete this.W);return!0};Ie.prototype.ia=function(){return!0};function Je(a){if(a.i&&(!a.g&&a.h&&lb(a.i,a.j,a.h,1)&&(a.g=!0),!Va(a))){if(!a.g)u("No RAM allocated");else if(a.b){if(!a.c||!a.i)return;Ke(a,a.c,a.fa,a.ea,a.j)}E(a)}}
function Je(a){x.call(this,"RAM",a,Je);this.W=this.c=null;this.j=a.addr;this.i=a.size;this.fa=a.load;this.ea=a.exec;this.f=!1;this.b=a.file;this.m=n(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?c.C("Unable to load RAM resource (error "+f+": "+a+")"):(Ra(c.na,a,b),(a=ta(a,b))?(c.c=a.L,c.W=a.W,null==c.fa&&(c.fa=a.fa),null==c.ea&&(c.ea=a.ea)):c.b=null,Ke(c))})}}A(Je); Ie.prototype.reset=function(){if(this.g){for(var a=this.i,b=this.j,c=this.h,d=b&a.j,b=b>>>a.c;0<c&&b<a.b.length;){var e=a.b[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(Wa)for(g=d;f--&&g<e.b.length;g++)e.b[g]=0;else for(g=d;f--&&g<e.size;g++)e.Ab(d,0,e.Ha+d);c-=a.i;b++;d=0}this.c&&Ke(this,this.c,this.fa,this.ea,this.j,!0)}};
Je.prototype.ha=function(a,b,c,d){this.h=b;this.a=c;this.F=d;Ke(this)};Je.prototype.ja=function(){this.W&&(this.F&&this.F.a(this.id,this.j,this.i,this.W),delete this.W);return!0};Je.prototype.ia=function(){return!0};function Ke(a){if(a.h&&(!a.f&&a.i&&lb(a.h,a.j,a.i,1)&&(a.f=!0),!Ua(a))){if(!a.f)t("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;Le(a,a.c,a.fa,a.ea,a.j)}F(a)}} function Ke(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,p=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=h,w=n-=6;0<n&&h<b.length;)l+=b[h++]&255,n--;if(n||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ua(p++,b[t++]&255);else p&1?F(a.a):lc(a.a,p,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Ua(c+
Je.prototype.reset=function(){if(this.f){for(var a=this.h,b=this.j,c=this.i,d=b&a.j,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b],f=c,g,d=d||0;void 0===f&&(f=e.size);if(Va)for(g=d;f--&&g<e.b.length;g++)e.b[g]=0;else for(g=d;f--&&g<e.size;g++)e.Db(d,0,e.Ha+d);c-=a.b;b++;d=0}this.c&&Le(this,this.c,this.fa,this.ea,this.j,!0)}}; e,b[e]);null!=d&&lc(a.a,d,f);g=!0}return g}Ha(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ie(d);C(d,c)}});function Le(a){x.call(this,"Keyboard",a,Le);E(this)}z(Le);Le.prototype.Z=function(){return!1};Le.prototype.ha=function(a,b,c,d){this.j=a;this.a=c;this.F=d};Ha(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Le(d);C(d,c)}});
function Le(a,b,c,d,e,f){var g=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,q=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(q&255)+(q>>8)),u=l,z=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(z)for(;z--;)a.a.Va(q++,b[u++]&255);else q&1?G(a.a):lc(a.a,q,f);g=!0}else l++;else l+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Va(c+ function Z(a){this.D=a.baudReceive||9600;this.I=a.baudTransmit||9600;this.R=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.G=a.charBOL;this.u=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=Me;b&&(void 0===c&&(c="Panel"),(c=Ua(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Hb,receiveData:this.ub}}z(Z);var Me="buffer";k=Z.prototype;
e,b[e]);null!=d&&lc(a.a,d,f);g=!0}return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Je(d);D(d,c)}});function Me(a){x.call(this,"Keyboard",a,Me);F(this)}A(Me);Me.prototype.Z=function(){return!1};Me.prototype.ha=function(a,b,c,d){this.j=a;this.a=c;this.F=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Me(d);D(d,c)}}); k.Z=function(a,b,c){var d=this;switch(b){case Me:return this.o[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.ub(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ub(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
function Z(a){this.D=a.baudReceive||9600;this.J=a.baudTransmit||9600;this.R=a.upperCase;this.f=this.m=null;this.K=a.tabSize;this.G=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=Ne;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Jb,receiveData:this.wb}}A(Z);var Ne="buffer";h=Z.prototype; k.ha=function(a,b,c,d){this.j=a;this.i=b;this.a=c;this.F=d;var e=this;this.$=Bb(48,4);this.N=yb(this.a,function(){e.b&128||!e.h.length||(e.w=e.h.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&zb(e.a,e.$))});this.aa=Bb(52,4);this.O=yb(this.a,function(){e.c|=128;e.c&64&&zb(e.a,e.aa)});vb(b,this,Ne);E(this)};
h.Z=function(a,b,c){var d=this;switch(b){case Ne:return this.o[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.wb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.wb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1}; k.Hb=function(){if(!this.v){var a=Wb(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Da)return;b=pa(b[1]);if(this.v=Ta(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.ja=function(a,b){if(!b)if(this.Hb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.F=d;var e=this;this.$=Bb(48,4);this.N=yb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.R&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&zb(e.a,e.$))});this.aa=Bb(52,4);this.O=yb(this.a,function(){e.c|=128;e.c&64&&zb(e.a,e.aa)});ub(b,this,Oe);F(this)}; k.ia=function(a){return a?this.save():!0};k.reset=function(){Oe(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Oe(this)};function Oe(a){a.w=0;a.b=0;a.c=128;a.h=[];return!0}k.ub=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.h.push(a.charCodeAt(b));else this.h=this.h.concat(a);Ab(this.a,this.N,1E3/Math.round(this.D/10));return!0};k.Bc=function(){return this.b&65534};
h.Jb=function(){if(!this.v){var a=Wb(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Na)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.na+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ja=function(a,b){if(!b)if(this.Jb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.vd=function(a){this.b=this.b&-112|a&111};k.Ac=function(){this.b&=-129;0<this.h.length&&Ab(this.a,this.N,1E3/Math.round(this.D/10));return this.w};k.ud=function(){};k.Vc=function(){return this.c};k.Pd=function(a){128==(this.c&192)&&a&64&&Ab(this.a,this.O,1E3/Math.round(this.I/10));this.c=this.c&-70|a&69};k.Uc=function(){return 0};
h.ia=function(a){return a?this.save():!0};h.reset=function(){Pe(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return Pe(this)};function Pe(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.wb=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);Ab(this.a,this.N,1E3/Math.round(this.D/10));return!0};h.Ic=function(){return this.b&65534}; k.Od=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.g)if(13==a)this.u=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.u&&this.u--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.u%a,this.J&&(b=" ".slice(0,c)));this.G&&!this.u&&c&&(b=String.fromCharCode(this.G)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.u+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.U(this.m),
h.Ad=function(a){this.b=this.b&-112|a&111};h.Hc=function(){this.b&=-129;0<this.i.length&&Ab(this.a,this.N,1E3/Math.round(this.D/10));return this.w};h.zd=function(){};h.$c=function(){return this.c};h.Sd=function(a){128==(this.c&192)&&a&64&&Ab(this.a,this.O,1E3/Math.round(this.J/10));this.c=this.c&-70|a&69};h.Zc=function(){return 0}; this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ab(this.a,this.O,1E3/Math.round(this.I/10))}};var Pe={},Ne=(Pe[65392]=[null,null,Z.prototype.Bc,Z.prototype.vd,"RCSR"],Pe[65394]=[null,null,Z.prototype.Ac,Z.prototype.ud,"RBUF"],Pe[65396]=[null,null,Z.prototype.Vc,Z.prototype.Pd,"XCSR"],Pe[65398]=[null,null,Z.prototype.Uc,Z.prototype.Od,"XBUF"],Pe);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}});
h.Rd=function(a){if(a&=255){this.A&&this.A.call(this.v,a);if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.K||8,c=a-this.s%a,this.K&&(b=" ".slice(0,c)));this.G&&!this.s&&c&&(b=String.fromCharCode(this.G)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.U(this.m), function Fb(a){x.call(this,"PC11",a,Fb);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.u=Qe;this.g=Re;this.D=this.h="";this.K=this.fa=this.ea=null;this.I=-1;this.G=!Ba("Mobi")&&window&&"FileReader"in window}z(Fb);var Qe="",Re=0;k=Fb.prototype;
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ab(this.a,this.O,1E3/Math.round(this.J/10))}};var Qe={},Oe=(Qe[65392]=[null,null,Z.prototype.Ic,Z.prototype.Ad,"RCSR"],Qe[65394]=[null,null,Z.prototype.Hc,Z.prototype.zd,"RBUF"],Qe[65396]=[null,null,Z.prototype.$c,Z.prototype.Sd,"XCSR"],Qe[65398]=[null,null,Z.prototype.Zc,Z.prototype.Rd,"XBUF"],Qe);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=C(c),d=new Z(d);D(d,c)}}); k.Z=function(a,b,c){var d=this,e=Re;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){u("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
function Fb(a){x.call(this,"PC11",a,Fb);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=Re;this.f=Se;this.D=this.i="";this.L=this.fa=this.ea=null;this.J=-1;this.G=!Ba("Mobi")&&window&&"FileReader"in window}A(Fb);var Re="",Se=0;h=Fb.prototype; d.o.listTapes;a&&Se(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.G){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Se(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
h.Z=function(a,b,c){var d=this,e=Se;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(m){t("PC11 option error: "+m.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a= k.ha=function(a,b,c,d){this.j=a;this.i=b;this.a=c;this.F=d;this.J=Te(a);var e=this;if((this.c=Wb(this.j,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){u("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.N=Bb(56,4);this.R=yb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,Ue(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&zb(e.a,e.N))});vb(b,this,Ve);We(this,"None",Qe,!0);this.G&&We(this,"Local Tape","?");
d.o.listTapes;a&&Te(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.G){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Te(d,n(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; We(this,"Remote Tape","??");Xe(this)||E(this)};k.ja=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.ia=function(a){return a?this.save():!0};k.reset=function(){this.b&=-2241;this.A=0};function Xe(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=q(b,!0)}b&&c?Ye(a,c,b,1,!0):Ze(a)}return!!a.m}
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.F=d;this.K=Ue(a);var e=this;if((this.c=Wb(this.j,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.N=Bb(56,4);this.R=yb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,Ve(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&zb(e.a,e.N))});ub(b,this,We);Xe(this,"None",Re,!0);this.G&&Xe(this,"Local Tape","?"); function Se(a,b,c,d,e){if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.u="??"}else a.u=c;Ye(a,b,c,d,!1,e)}else $e(a,!1)}function Ye(a,b,c,d,e,f){var g=-1;if(a.h.toLowerCase()!=c.toLowerCase()||a.g!=d)g++,$e(a,!0),a.l.kb?a.C("PC11 busy"):(e&&a.m++,af(a,b,c,d,f)?g++:a.l.kb=!0);g&&bf(a,a.D,a.h,a.g,a.K,a.fa,a.ea)}
Xe(this,"Remote Tape","??");Ye(this)||F(this)};h.ja=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function Ye(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=n(b,!0)}b&&c?Ze(a,c,b,1,!0):$e(a)}return!!a.m} function af(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),bf(a,b,c,d,e),a.u="?");Ze(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var h=0>g&&a.j&&!a.j.l.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(Sa(a.na,e,f),(e=ta(e,f))&&bf(a,b,c,d,e.K,e.fa,e.ea));
function Te(a,b,c,d,e){if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=n(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;Ze(a,b,c,d,!1,e)}else af(a,!1)}function Ze(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,af(a,!0),a.l.lb?a.C("PC11 busy"):(e&&a.m++,bf(a,b,c,d,f)?g++:a.l.lb=!0);g&&cf(a,a.D,a.i,a.f,a.L,a.fa,a.ea)} a.l.kb=!1;a.m&&(a.m--,a.m||E(a));Ze(a)})}function We(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function Ze(a){var b=a.o.listTapes;if(b&&b.options){a=a.u||a.h;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
function bf(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),cf(a,b,c,d,e),a.s="?");$e(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var l=0>g&&a.j&&!a.j.l.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",l):(Ra(a.na,e,f),(e=ta(e,f))&&cf(a,b,c,d,e.L,e.fa,e.ea)); function Ue(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function bf(a,b,c,d,e,f,g){a.D=b;a.h=c;a.g=d;a.K=e;a.fa=f;a.ea=g;2==d?a.J&&Ke(a.J,e,f,g)?a.status("tape loaded: "+b):(a.D="",a.h="",a.u=Qe,a.g=Re,a.C("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),Ue(a,0))}
a.l.lb=!1;a.m&&(a.m--,a.m||F(a));$e(a)})}function Xe(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function $e(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}} function $e(a,b){if(a.h||!1===b)a.D="",a.h="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.u=Qe,a.g=Re,Ze(a))}k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};k.uc=function(){return this.b&65534};k.od=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&zb(this.a,this.N)):(this.b&=-129,this.b|=2048,this.A=0,Ab(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};k.tc=function(){this.b&=-129;this.b|=2048;return this.A};k.nd=function(){};
function Ve(a,b){b|=0;if(b!==a.J){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.J=b}}function cf(a,b,c,d,e,f,g){a.D=b;a.i=c;a.f=d;a.L=e;a.fa=f;a.ea=g;2==d?a.K&&Le(a.K,e,f,g)?a.status("tape loaded: "+b):(a.D="",a.i="",a.s=Re,a.f=Se,a.C("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),Ve(a,0))} var cf={},Ve=(cf[65384]=[null,null,Fb.prototype.uc,Fb.prototype.od,"PRS"],cf[65386]=[null,null,Fb.prototype.tc,Fb.prototype.nd,"PRB"],cf);function df(a,b,c){x.call(this,"Disk",{id:a.na+".disk"+m(++ef,4)},df);this.controller=a;this.j=a.j;this.F=a.F;this.g=b;this.sa=b.name;this.ob=b.ob;ff(this,c,b.T,b.Y,b.S,b.ga);E(this)}var ef=0;z(df);k=df.prototype;k.ha=function(a,b,c,d){this.F=d};
function af(a,b){if(a.i||!1===b)a.D="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.s=Re,a.f=Se,$e(a))}h.save=function(){return(new P(this)).data()};h.restore=function(){return!0};h.Bc=function(){return this.b&65534};h.td=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&zb(this.a,this.N)):(this.b&=-129,this.b|=2048,this.A=0,Ab(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};h.Ac=function(){this.b&=-129;this.b|=2048;return this.A};h.sd=function(){}; function ff(a,b,c,d,e,f){a.mode=b;a.T=c;a.Y=d;a.S=e;a.ga=f;a.a=[];if("preload"!=a.mode){b=Array(a.T);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=gf(null,c,e,g,a.ga,0);d[e]=f}b[c]=d}a.a=b}a.i=null}
var df={},We=(df[65384]=[null,null,Fb.prototype.Bc,Fb.prototype.td,"PRS"],df[65386]=[null,null,Fb.prototype.Ac,Fb.prototype.sd,"PRB"],df);function ef(a,b,c){x.call(this,"Disk",{id:a.na+".disk"+k(++ff,4)},ef);this.controller=a;this.j=a.j;this.F=a.F;this.f=b;this.ta=b.name;this.ob=b.ob;gf(this,c,b.T,b.Y,b.S,b.ga);F(this)}var ff=0;A(ef);h=ef.prototype;h.ha=function(a,b,c,d){this.F=d}; function hf(a,b,c,d,e){var f=c;if(a.b)return!0;a.sa=b;a.Ca=c;a.Rb=q(c);a.b=e;a.h=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.T=e[0];a.Y=e[1];a.S=e[2];a.ga=e[3]||512;c=a.ga>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.T);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),S=0;S<w.length;S++)for(var ua=w[S]=Array(a.S),va=0;va<ua.length;va++){for(var Xb=gf(null,d,S,va+1,a.ga,0),Kf=Xb.data,Yb=0;Yb<c;Yb++,f+=4)var Lf=Kf[Yb]=b.getInt32(f,
function gf(a,b,c,d,e,f){a.mode=b;a.T=c;a.Y=d;a.S=e;a.ga=f;a.a=[];if("preload"!=a.mode){b=Array(a.T);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=hf(null,c,e,g,a.ga,0);d[e]=f}b[c]=d}a.a=b}a.b=null} !0),e=e+Lf&-1;Xb.ba=c;ua[va]=Xb}a.i=e;c=a}else a.C("Unrecognized disk format ("+d+" bytes)");a.b&&(a.b.call(a.controller,a.g,c,a.sa,a.Ca),a.b=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ob?"":e)+"&format=json"));return!!r(f,
function jf(a,b,c,d,e){var f=c;if(a.h)return!0;a.ta=b;a.Da=c;a.Vb=n(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.T=e[0];a.Y=e[1];a.S=e[2];a.ga=e[3]||512;c=a.ga>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.T);for(d=0;d<a.a.length;d++)for(var z=a.a[d]=Array(a.Y),S=0;S<z.length;S++)for(var ua=z[S]=Array(a.S),va=0;va<ua.length;va++){for(var Yb=hf(null,d,S,va+1,a.ga,0),Lf=Yb.data,Zb=0;Zb<c;Zb++,f+=4)var Mf=Lf[Zb]=b.getInt32(f, null,!0,function(b,c,d){jf(a,b,c,d)})}
!0),e=e+Mf&-1;Yb.ba=c;ua[va]=Yb}a.b=e;c=a}else a.C("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.f,c,a.ta,a.Da),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.ob?"":e)+"&format=json"));return!!r(f, function jf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.P;if(d)a.controller.C('Unable to load disk "'+a.sa+'" (error '+d+": "+b+")",f);else{Sa(a.controller.na,b,c);try{if(0<q(a.Rb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.sa]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
null,!0,function(b,c,d){kf(a,b,c,d)})} c+")");if(h.length)if(1==h.length)u(h[0]);else{a.T=h.length;a.Y=h[0].length;a.S=h[0][0].length;var l=h[0][0][0];a.ga=l&&l.length||512;for(d=c=0;d<a.T;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=h[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var S=n<<2,ua=w.length;ua<S;ua++)w[ua]=p;kf(l,w)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}gf(l,d,f);for(S=
function kf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.P;if(d)a.controller.C('Unable to load disk "'+a.ta+'" (error '+d+": "+b+")",f);else{Ra(a.controller.na,b,c);try{if(0<n(a.Vb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var l;"<"==c.substr(0,1)?l=["Missing disk image: "+a.ta]:l=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ 0;S<t.length;S++)c=c+t[S]&-1}a.a=h;a.i=c;e=a}else u("Empty disk image: "+a.sa)}catch(va){u("Disk image error ("+b+"): "+va.message)}}a.b&&(a.b.call(a.h,a.g,e,a.sa,a.Ca),a.b=null)}function gf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Ud=b;a.Vd=c;a.ka=a.ba=0;a.ra=!1;return a}
c+")");if(l.length)if(1==l.length)t(l[0]);else{a.T=l.length;a.Y=l[0].length;a.S=l[0][0].length;var m=l[0][0][0];a.ga=m&&m.length||512;for(d=c=0;d<a.T;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(m=l[d][f][g]){var p=m.length;void 0===p&&(p=m.length=512);var p=p>>2,q=m.pattern;void 0===q&&(q=m.pattern=0);var u=m.data;if(void 0===u){var z=m.bytes;if(void 0!==z&&z.length){for(var S=p<<2,ua=z.length;ua<S;ua++)z[ua]=q;lf(m,z)}else u=[],q=m.pattern=q|q<<8|q<<16|q<<24,m.data=u;delete m.bytes}hf(m,d,f);for(S= k.seek=function(a,b,c,d,e){d=null;var f=this.g,g=this.a[a];if(g){var h=g[b];if(!h&&f.Wb&&b<f.Y)for(h=g[b]=Array(f.Xb),g=0;g<h.length;g++)h[g]=gf(null,a,b,g+1,f.Mb,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Wb&&9==f.Bb&&(d=h[g]=gf(null,a,b,f.Bb,f.Mb,0))}}e&&e(d,!1);return d};function kf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
0;S<u.length;S++)c=c+u[S]&-1}a.a=l;a.b=c;e=a}else t("Empty disk image: "+a.ta)}catch(va){t("Disk image error ("+b+"): "+va.message)}}a.h&&(a.h.call(a.i,a.f,e,a.ta,a.Da),a.h=null)}function hf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Yd=b;a.Zd=c;a.ka=a.ba=0;a.sa=!1;return a} k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f<a.ka?(a.ba+=a.ka-f,a.ka=f):f>=a.ka+a.ba&&(a.ba+=f-(a.ka+a.ba)+1):(a.ka=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var l=g[b];if(!l&&f.bc&&b<f.Y)for(l=g[b]=Array(f.cc),g=0;g<l.length;g++)l[g]=hf(null,a,b,g+1,f.Nb,0);if(l){for(g=0;g<l.length;g++)if(l[g]&&l[g].sector==c){d=l[g];break}!d&&f.bc&&9==f.Eb&&(d=l[g]=hf(null,a,b,f.Eb,f.Nb,0))}}e&&e(d,!1);return d};function lf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e} function lf(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.T?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function mf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}k.save=function(){var a=0,b=[];b[a++]=[this.Ca,this.i,this.T,this.Y,this.S,this.ga];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var h=[],l=0,n=g.ka,p=g.ka+g.ba;n<p;)h[l++]=g.data[n++];b[a++]=[d,e,f,g.ka,h]}}return b};
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f<a.ka?(a.ba+=a.ka-f,a.ka=f):f>=a.ka+a.ba&&(a.ba+=f-(a.ka+a.ba)+1):(a.ka=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null}; k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?ff(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.i&&e[1]!=this.i&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.i+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],n=g[f++];if(h>=this.a.length||l>=this.a[h].length||n>=this.a[h][l].length){c="sector (CHS="+h+":"+l+":"+n+") out of range ("+
function mf(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.T?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function nf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}h.save=function(){var a=0,b=[];b[a++]=[this.Da,this.b,this.T,this.Y,this.S,this.ga];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ba){for(var l=[],m=0,p=g.ka,q=g.ka+g.ba;p<q;)l[m++]=g.data[p++];b[a++]=[d,e,f,g.ka,l]}}return b}; b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.a[h][l][n]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.ka=e;for(h.ba=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.C("Unable to restore disk '"+this.sa+": "+c);return b};
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?gf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],l=g[f++],m=g[f++],p=g[f++];if(l>=this.a.length||m>=this.a[l].length||p>=this.a[l][m].length){c="sector (CHS="+l+":"+m+":"+p+") out of range ("+ k.toJSON=function(){var a;a=0;for(var b;b=lf(this,a++);)nf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(l=this.a[l][m][p]){for(m=l.data.length;m<e;)l.data[m++]=l.pattern;m=0;l.ka=e;for(l.ba=f.length;e<g;)l.data[e++]=f[m++];b++}}}0>b&&-2!=b&&this.controller.C("Unable to restore disk '"+this.ta+": "+c);return b}; function nf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RL11",a,N);this.g=a.autoMount||null;this.u=0;this.b=Array(1);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype;
h.toJSON=function(){var a;a=0;for(var b;b=mf(this,a++);)of(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; k.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){u("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&of(d,a)},!0;case "loadDrive":return this.o[b]=
function of(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RL11",a,N);this.f=a.autoMount||null;this.s=0;this.b=Array(1);this.A=!Ba("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; c,c.onclick=function(){var a=d.o.listDisks;a&&pf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,h;h=lf(a,c++);)for(var l=0,n=h.length;l<n;l++)b+=String.fromCharCode(mf(a,h,l));b=btoa(b);a=a.Rb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
h.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(l){t("RL11 option error: "+l.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&pf(d,a)},!0;case "loadDrive":return this.o[b]= typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");u(a)}else d.C("No disk loaded in drive.");else d.C("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),
c,c.onclick=function(){var a=d.o.listDisks;a&&qf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,l;l=mf(a,c++);)for(var m=0,p=l.length;m<p;m++)b+=String.fromCharCode(nf(a,l,m));b=btoa(b);a=a.Vb.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!= c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;pf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");t(a)}else d.C("No disk loaded in drive.");else d.C("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}), k.ha=function(a,b,c,d){this.j=a;this.i=b;this.a=c;this.F=d;if((this.g=Wb(this.j,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){u("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}qf(this);this.G=Bb(112,5);vb(b,this,rf);sf(this,"None","",!0);this.A&&sf(this,"Local Disk","?");sf(this,"Remote Disk","??");tf(this)||E(this)};
c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;qf(d,n(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; k.ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.j.Eb){for(a=0;a<this.b.length;a++)uf(this,a,!0);tf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;1>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";of(this,0)}}return!0};k.ia=function(a){return a?this.save():!0};k.reset=function(){qf(this)};k.save=function(){return(new P(this)).data()};
h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.F=d;if((this.f=Wb(this.j,"autoMount")||this.f)&&"string"==typeof this.f)try{this.f=eval("("+this.f+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.f+")"),this.f=null}rf(this);this.G=Bb(112,5);ub(b,this,sf);tf(this,"None","",!0);this.A&&tf(this,"Local Disk","?");tf(this,"Remote Disk","??");uf(this)||F(this)}; k.restore=function(a){return qf(this,a[0])};function tf(a,b){b||(a.u=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=q(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!vf(a,g,f,e,!0)&&b&&E(a,!1);continue}a.C("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.u}
h.ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.j.Hb){for(a=0;a<this.b.length;a++)vf(this,a,!0);uf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;1>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";pf(this,0)}}return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){rf(this)};h.save=function(){return(new P(this)).data()}; function pf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}vf(a,e,b,c,!1,d)}else uf(a,e)}
h.restore=function(a){return rf(this,a[0])};function uf(a,b){b||(a.s=0);if(a.f)for(var c in a.f){var d=a.f[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var l=f.options[g];if(l.value==e){f=l.text;break a}}f=n(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.b.length)){!wf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.C("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s} function vf(a,b,c,d,e,f){var g=-1,h=a.b[b];h.Ca.toLowerCase()!=d.toLowerCase()&&(g++,uf(a,b,!0),h.nb?a.C("RL11 busy"):(h.nb=!0,e&&(h.mb=!0,a.u++),h.fb=!!f,hf(new df(a,h,"preload"),c,d,f,a.Yb)&&g++));return g}
function qf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=n(c);a.status("Attempting to load "+c+' as "'+b+'"')}wf(a,e,b,c,!1,d)}else vf(a,e)} k.Yb=function(a,b,c,d,e){var f;a.nb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.T||f[1]>a.Y)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.sb)),b=null);b?(a.ca=b,a.sa=c,a.Ca=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.sb),a.mb||e),this.j&&ec(this.j)):a.fb=!1;a.mb&&(a.mb=!1,--this.u||E(this));of(this,a.sb)};
function wf(a,b,c,d,e,f){var g=-1,l=a.b[b];l.Da.toLowerCase()!=d.toLowerCase()&&(g++,vf(a,b,!0),l.nb?a.C("RL11 busy"):(l.nb=!0,e&&(l.mb=!0,a.s++),l.fb=!!f,jf(new ef(a,l,"preload"),c,d,f,a.dc)&&g++));return g} function sf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
h.dc=function(a,b,c,d,e){var f;a.nb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.T||f[1]>a.Y)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.sb)),b=null);b?(a.ca=b,a.ta=c,a.Da=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.sb),a.mb||e),this.j&&ec(this.j)):a.fb=!1;a.mb&&(a.mb=!1,--this.s||F(this));pf(this,a.sb)}; function of(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.fb?"?":c.Ca,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function uf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.sa="",d.Ca="",d.ca=null,d.fb=!1,c||(a.C("Drive RL"+b+" unloaded",c),of(a,b))}
function tf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}} function qf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.h=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.sb=b;d.nb=d.fb=!1;d.name=c.Da;d.T=512;d.Y=2;d.S=40;d.ga=256;d.ob=!0;d.Sd=0;d.Rd=0;d.Bb=1;d.Xb=d.S;d.Mb=d.ga;d.Wd=0;d.Xd=null;d.ca||(d.Ca="");d.status=29|(512==d.T?128:0)}return!0}
function pf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.fb?"?":c.Da,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function vf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.ta="",d.Da="",d.ca=null,d.fb=!1,c||(a.C("Drive RL"+b+" unloaded",c),pf(a,b))} k.Zb=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.h=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
function rf(a,b){var c=0;b||(b=[]);a.M=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.sb=b;d.nb=d.fb=!1;d.name=c.Na;d.T=512;d.Y=2;d.S=40;d.ga=256;d.ob=!0;d.Wd=0;d.Vd=0;d.Ud=0;d.Eb=1;d.cc=d.S;d.Nb=d.ga;d.$d=0;d.ae=null;d.ca||(d.Da="");d.status=29|(512==d.T?128:0)}return!0} k.hc=function(a,b,c,d,e,f,g){for(var h=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){h=5120;break}p=0}var t,w;if(0>(t=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){h=5120;break}sb(this.i,f,t|w<<8);if(xb(this.i)){h=8192;break}f+=2;if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.T)))){h=5120;break}}return g(h,b,c,d,e,f)};
h.ec=function(a,b,c,d,e,f){this.v=f&65535;this.M=this.M&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; k.cd=function(a,b,c,d,e,f,g){for(var h=0,l=a.ca,n=null,p;e--;){var t=rb(this.i,f);if(xb(this.i)){h=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){h=5120;break}p=0}if(!a.ca.write(n,p++,t&255)||!a.ca.write(n,p++,t>>8)){h=5120;break}if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.T)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Ec=function(){return this.L&65535};
h.oc=function(a,b,c,d,e,f,g){for(var l=0,m=a.ca,p=null,q;e--;){if(!p){p=a.ca.seek(b,c,d,!0);if(!p){l=5120;break}q=0}var u,z;if(0>(u=a.ca.read(p,q++))||0>(z=a.ca.read(p,q++))){l=5120;break}this.h.zb(vc(this.a,f),u|z<<8);if(xb(this.h)){l=8192;break}f+=2;if(q>=m.ga&&(p=null,++d>=m.S&&(d=0,++c>=m.Y&&(c=0,++b>=m.T)))){l=5120;break}}return g(l,b,c,d,e,f)}; k.yd=function(a){this.L=this.L&-1023|a&1022;this.D=this.D&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.h&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.h=this.c&4?this.h+b:this.h-b,this.c=this.h=this.h&65408|c);break;case 8:this.m=this.h;break;case 12:b=this.hc;case 10:b||(b=this.cd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.T||f>=c.S?this.L|=37888:(g=(this.w&
h.hd=function(a,b,c,d,e,f,g){for(var l=0,m=a.ca,p=null,q;e--;){var u=this.h.qb(vc(this.a,f));if(xb(this.h)){l=8192;break}f+=2;if(!p){p=a.ca.seek(b,c,d,!0);if(!p){l=5120;break}q=0}if(!a.ca.write(p,q++,u&255)||!a.ca.write(p,q++,u>>8)){l=5120;break}if(q>=m.ga&&(p=null,++d>=m.S&&(d=0,++c>=m.Y&&(c=0,++b>=m.T)))){l=5120;break}}return g(l,b,c,d,e,f)};h.Lc=function(){return this.M&65535}; 63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.Zb.bind(this)))}a&&(this.L|=129,this.L&64&&zb(this.a,this.G))}};k.Cc=function(){return this.v};k.wd=function(a){this.v=a&65534};k.Fc=function(){return this.c};k.zd=function(a){this.c=a};k.Gc=function(){return this.m};k.Ad=function(a){this.m=a};k.Dc=function(){return this.w};k.xd=function(a){this.w=a&63};
h.Dd=function(a){this.M=this.M&-1023|a&1022;this.D=this.D&-4|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.b[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.c&8&&(this.M&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.oc;case 10:b||(b=this.hd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.T||f>=c.S?this.M|=37888:(g=(this.w& var wf={},rf=(wf[63744]=[null,null,N.prototype.Ec,N.prototype.yd,"RLCS"],wf[63746]=[null,null,N.prototype.Cc,N.prototype.wd,"RLBA"],wf[65284]=[null,null,N.prototype.Fc,N.prototype.zd,"RLDA"],wf[65286]=[null,null,N.prototype.Gc,N.prototype.Ad,"RLMP"],wf[65288]=[null,null,N.prototype.Dc,N.prototype.xd,"RLBE"],wf);
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ec.bind(this)))}a&&(this.M|=129,this.M&64&&zb(this.a,this.G))}};h.Jc=function(){return this.v};h.Bd=function(a){this.v=a&65534};h.Mc=function(){return this.c};h.Ed=function(a){this.c=a};h.Nc=function(){return this.m};h.Fd=function(a){this.m=a};h.Kc=function(){return this.w};h.Cd=function(a){this.w=a&63}; function xf(a,b,c){x.call(this,"Computer",a,xf);this.l.P=!1;yf(this,b);this.A=Wb(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=zf;this.v=null;this.m=this.I=!1;this.O=Wb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Af(this);if(this.a=Ua("CPU",this.id)){this.F=Ua("Debugger",this.id);this.i=new bb({id:this.na+".bus",busWidth:this.N},this.a,this.F);var d,e=A(this.id);if((this.g=Ua("Panel",this.id))&&this.g.Ra)for(b=0;b<e.length;b++)d=e[b],d.C=this.g.C,d.U=this.g.U,d.Ra=this.g.Ra;
var xf={},sf=(xf[63744]=[null,null,N.prototype.Lc,N.prototype.Dd,"RLCS"],xf[63746]=[null,null,N.prototype.Jc,N.prototype.Bd,"RLBA"],xf[65284]=[null,null,N.prototype.Mc,N.prototype.Ed,"RLDA"],xf[65286]=[null,null,N.prototype.Nc,N.prototype.Fd,"RLMP"],xf[65288]=[null,null,N.prototype.Kc,N.prototype.Cd,"RLBE"],xf); this.U("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.U("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ha&&d.ha(this,this.i,this.a,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.u=d:this.b=parseInt(d,10));var f;if(a=Wb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.m=!0,this.b=zf),this.b&&(this.w=new P(this,
function yf(a,b,c){x.call(this,"Computer",a,yf);this.l.P=!1;zf(this,b);this.A=Wb(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=Af;this.v=null;this.m=this.J=!1;this.O=Wb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Bf(this);if(this.a=Ta("CPU",this.id)){this.F=Ta("Debugger",this.id);this.h=new ab({id:this.na+".bus",busWidth:this.N},this.a,this.F);var d,e=B(this.id);if((this.f=Ta("Panel",this.id))&&this.f.Ta)for(b=0;b<e.length;b++)d=e[b],d.C=this.f.C,d.U=this.f.U,d.Ta=this.f.Ta; "1.30.2"),Bf(this.w)?b=null:delete this.w);!b&&this.b&&(b=Cf(this))&&(this.m=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.u=null,g.m=!1,g.C("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.v=b,g.I=!0);E(g)})}else E(this);this.o.power||(this.A=!0);!c&&this.A&&Df(this,this.Ta)}else u("Unable to find CPU component")}z(xf);var zf=0;
this.U("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.U("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ha&&d.ha(this,this.h,this.a,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=Wb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.m=!0,this.b=Af),this.b&&(this.w=new P(this, function yf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.J=b}function Wb(a,b,c){var d=b.toLowerCase(),d=Ma[b]||Ma[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Df(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Df(a,b,c)});return}}b.call(a,c)}
"1.30.2"),Cf(this.w)?b=null:delete this.w);!b&&this.b&&(b=Df(this))&&(this.m=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.s=null,g.m=!1,g.C("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.v=b,g.J=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Ef(this,this.Ua)}else t("Unable to find CPU component")}A(yf);var Af=0; function Ef(a,b){var c=new P(a,"1.30.2","validate");if(Bf(c)&&Ff(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.C("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=xf.prototype;
function zf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.K=b}function Wb(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.K&&(d=a.K[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Ef(a,b,c){for(var d=B(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ua(f)){Ua(f,function(){Ef(a,b,c)});return}}b.call(a,c)} k.Ta=function(a){void 0===a&&(a=this.b||(this.v?1:zf));if(!this.j){this.j++;var b=!1,c=!1;this.G=!1;var d=this.w||new P(this,"1.30.2");if(-1==a)b=!0;else if(a>zf){if(Bf(d,this.v)){this.h=new P(this,"1.30.2","failsafe");Bf(this.h)&&(Gf(this,d),a=2,Hf(this.h));this.h.set("timestamp",sa());If(this.h);var e=this.b&&!this.m;if(1==a||wa("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ff(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Bf(d,g):("error"==
function Ff(a,b){var c=new P(a,"1.30.2","validate");if(Cf(c)&&Gf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.C("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=yf.prototype; f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.U(f+": "+g),Hf(d),Bf(d)?(c=Ff(d),e=!0):c=!1))}e&&Ef(this,c?d:null)}else 2==a&&d.clear()}else Ef(this);delete this.v;delete this.w}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=Jf(this,g,d,b,c));b=[d,a,c];-1!=a?Df(this,this.Db,b):this.Db(b)}};
h.Ua=function(a){void 0===a&&(a=this.b||(this.v?1:Af));if(!this.j){this.j++;var b=!1,c=!1;this.G=!1;var d=this.w||new P(this,"1.30.2");if(-1==a)b=!0;else if(a>Af){if(Cf(d,this.v)){this.i=new P(this,"1.30.2","failsafe");Cf(this.i)&&(Hf(this,d),a=2,If(this.i));this.i.set("timestamp",sa());Jf(this.i);var e=this.b&&!this.m;if(1==a||wa("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Gf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Cf(d,g):("error"== function Jf(a,b,c,d,e){if(!b.l.P){b.l.P=!0;if(b.ja){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.ja(f,d)&&f&&(u("Unable to restore state for "+b.type),a.D&&!a.I?(c.clear(),a.b=zf,window&&window.location.reload()):a.G=!0,b.ja(null),e=!1)}if(!d&&b.Ib)for(a=b.Ib.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.U(f+": "+g),If(d),Cf(d)?(c=Gf(d),e=!0):c=!1))}e&&Ff(this,c?d:null)}else 2==a&&d.clear()}else Ff(this);delete this.v;delete this.w}e=B(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=Kf(this,g,d,b,c));b=[d,a,c];-1!=a?Ef(this,this.Gb,b):this.Gb(b)}}; k.Db=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.l.P=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Jf(this,this.a,b,c,a),this.a.Qa());this.G&&(Gf(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.j=0};
function Kf(a,b,c,d,e){if(!b.l.P){b.l.P=!0;if(b.ja){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.ja(f,d)&&f&&(t("Unable to restore state for "+b.type),a.D&&!a.J?(c.clear(),a.b=Af,window&&window.location.reload()):a.G=!0,b.ja(null),e=!1)}if(!d&&b.Lb)for(a=b.Lb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e} function Gf(a,b){if(wa("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.2"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
h.Gb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.l.P=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Kf(this,this.a,b,c,a),this.a.Sa());this.G&&(Hf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.j=0}; function Mf(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&F(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.P=!1,!1===d&&(e=null)));for(var h=A(a.id),l=0;l<h.length;l++){var n=h[l];n.l.P&&(n.ia&&(d=n.ia(b,c),"object"===typeof d&&f.set(n.id,
function Hf(a,b){if(wa("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.2"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} d)),c&&(n.l.P=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.c&&Nf(a,a.c,f.toString()),If(g)&&If(f)||(e=null,d=h=!0)):a.b&&(d=!0,h=3==a.b),d&&f.clear(h)):e=f.toString());c&&(a.l.P=!1,b=a.o.power)&&(b.textContent="Power");a.j=0;return e}k.reset=function(){this.i&&this.i.reset&&this.i.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.i&&c.reset&&c.reset()}};k.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ma(!0)};
function Nf(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),l=sa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ia&&(c&&G(a.a),d=a.a.ia(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.l.P=!1,!1===d&&(e=null)));for(var l=B(a.id),m=0;m<l.length;m++){var p=l[m];p.l.P&&(p.ia&&(d=p.ia(b,c),"object"===typeof d&&f.set(p.id, k.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ma(!0)};
d)),c&&(p.l.P=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Of(a,a.c,f.toString()),Jf(g)&&Jf(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.l.P=!1,b=a.o.power)&&(b.textContent="Power");a.j=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();for(var a=B(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c.reset&&c.reset()}};h.start=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ma(!0)}; k.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.j||(d.l.P?Mf(d,!1,!0):Df(d,d.Ta))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.l.P&&!d.j)if(d.b&&!d.u){var a=wa("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Mf(d,a,!0);!a&&d.D?window&&window.location.reload():(a||(d.Eb=!0),d.Ta(zf),d.Eb=!1)}else d.reset(),d.a&&d.a.Qa()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);
h.stop=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ma(!0)}; else return this.o[b]=c,c.onclick=function(){var a=Af(d,!0);if(a){var b=!!(d.b&&!d.u||d.D),c=Mf(d,b);b?Nf(d,a,c):d.C("Resume disabled, machine state not saved")}},!0}return!1};
h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.j||(d.l.P?Nf(d,!1,!0):Ef(d,d.Ua))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.l.P&&!d.j)if(d.b&&!d.s){var a=wa("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Nf(d,a,!0);!a&&d.D?window&&window.location.reload():(a||(d.Hb=!0),d.Ua(Af),d.Hb=!1)}else d.reset(),d.a&&d.a.Sa()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c); function Af(a,b){var c=a.c;c||((c=za("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=Of(a,c))||a.C("The user ID is invalid.")):b&&a.C("Browser local storage is not available"));return c}
else return this.o[b]=c,c.onclick=function(){var a=Bf(d,!0);if(a){var b=!!(d.b&&!d.s||d.D),c=Nf(d,b);b?Of(d,a,c):d.C("Resume disabled, machine state not saved")}},!0}return!1}; function Of(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){u(d.message+" ("+c+")")}return a.c}function Cf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+Pf(a,"1.30.2"));return b}
function Bf(a,b){var c=a.c;c||((c=za("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=Pf(a,c))||a.C("The user ID is invalid.")):b&&a.C("Browser local storage is not available"));return c} function Nf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Pf(a,"1.30.2");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.C("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.C(c),Aa("user",""),a.c=null)}}
function Pf(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Df(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+Qf(a,"1.30.2"));return b} function Te(a){var b;a=A(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function ec(a){if(a.Ra){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Ra.focus();window&&window.scrollTo(b,c)}}k.ma=function(a){this.a&&this.a.ma(a);this.g&&this.g.ma(a)};
function Of(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Qf(a,"1.30.2");d.data=c;b=r(v()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.C("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.C(c),Aa("user",""),a.c=null)}} Ha(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new xf(g,d,!0);C(g,f);g.A&&Df(g,g.Ta)}});Ca.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ua("Computer",c.id))&&c.R&&!c.l.P&&c.Ta(-1)}});Ca.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ua("Computer",c.id))&&c.l.P&&Mf(c,!(!c.b||c.u),!0)}});
function Ue(a){var b;a=B(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function ec(a){if(a.Ta){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Ta.focus();window&&window.scrollTo(b,c)}}h.ma=function(a){this.a&&this.a.ma(a);this.f&&this.f.ma(a)}; function P(a,b,c){this.id=a.id;this.key=Pf(a,b,c);this.F=a.F;Hf(this,a.dc)}function Pf(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}
Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=C(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=C(f),g=new yf(g,d,!0);D(g,f);g.A&&Ef(g,g.Ua)}});w.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.l.P&&c.Ua(-1)}});w.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=C(a[b]);(c=Ta("Computer",c.id))&&c.l.P&&Nf(c,!(!c.b||c.s),!0)}}); P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Hf(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,
function P(a,b,c){this.id=a.id;this.key=Qf(a,b,c);this.F=a.F;If(this,a.jc)}function Qf(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} 1);c=0}}};function Hf(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function If(a){var b=!0;if(ya()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ff(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){u(c.message||c),b=!1}return b}function Bf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:ya()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var Qf=0;
P.prototype={constructor:P,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){If(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, function Rf(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Sf(h,a,b,c,d,e,f)})}
1);c=0}}};function If(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Jf(a){var b=!0;if(ya()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Gf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Cf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:ya()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var Rf=0; function Sf(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(Sa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
function Sf(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),f(l,null)):Tf(l,a,b,c,d,e,f)})} a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Tf(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function Tf(a,b,c,d,e,f,g){function l(a,f){if(f)g(f,null);else{c&&(Ra(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"), function Tf(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
a=a.replace(/(<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?Uf(a,f,l):l(a,null):g("no data"+(b?" for file: "+b:""),null)} "");a=a.replace(d[0],g);Tf(a,b,c)}})}else c(a,null)}
function Uf(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,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]*/, function Uf(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--Qf||Ja(!0));l=!1}var g,h,l=!0;Qf++;Ra[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));p.appendChild(t)}c||
"");a=a.replace(d[0],g);Uf(a,b,c)}})}else c(a,null)} (c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,h){h?Rf(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Qf||Ja(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Qf||Ja(!0)):f("invalid machine element: "+
function Vf(a,b,c,d){function e(a){if(void 0===l){var b=g&&E(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=oa(a))}function f(a){e("Error: "+a);m&&(--Rf||Ia(!0));m=!1}var g,l,m=!0;Rf++;Qa[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=p:u.appendChild(document.createTextNode(p));q.appendChild(u)}c|| a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Rf(b,a,d,!0,e,n):Sf(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ja(!1);return Uf(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map
(c="/versions/pdpjs/1.30.2/components.xsl");p=function(d,l){l?Sf(c,null,null,!1,e,function(d,m){m?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Rf||Ia(!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),--Rf||Ia(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Sf(b,a,d,!0,e,p):Tf(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(z){f(z.message)}return m}window.embedPDP11=function(a,b,c,d){Ia(!1);return Vf(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map