From d5c7bf0b5dd581c9c976423e794bae0226230d51 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 2 Nov 2016 13:35:50 -0700 Subject: [PATCH] More Front Panel improvements --- apps/pdp11/boot/monitor/PDPJSMON.json | 171 +-- apps/pdp11/boot/monitor/PDPJSMON.lst | 1044 +++++++++-------- apps/pdp11/boot/monitor/PDPJSMON.mac | 4 +- apps/pdp11/boot/monitor/README.md | 4 +- .../machine/1170/panel/debugger/machine.xml | 2 +- devices/pdp11/panel/1170/debugger/front.xml | 94 +- devices/pdp11/panel/1170/front.xml | 90 +- docs/pcx86/examples/components.css | 13 +- modules/pdp11/lib/bus.js | 41 +- modules/pdp11/lib/cpu.js | 8 +- modules/pdp11/lib/cpuops.js | 2 +- modules/pdp11/lib/cpustate.js | 2 - modules/pdp11/lib/debugger.js | 15 +- modules/pdp11/lib/memory.js | 2 - modules/pdp11/lib/messages.js | 2 + modules/pdp11/lib/panel.js | 346 ++++-- modules/pdp11/lib/rl11.js | 10 +- modules/shared/templates/components.css | 13 +- versions/pc8080/1.30.2/components.css | 13 +- versions/pcx86/1.30.2/components.css | 13 +- versions/pdpjs/1.30.2/components.css | 13 +- versions/pdpjs/1.30.2/pdp11-dbg.js | 530 ++++----- versions/pdpjs/1.30.2/pdp11.js | 381 +++--- 23 files changed, 1523 insertions(+), 1290 deletions(-) diff --git a/apps/pdp11/boot/monitor/PDPJSMON.json b/apps/pdp11/boot/monitor/PDPJSMON.json index 226df4d83..cf008c34c 100644 --- a/apps/pdp11/boot/monitor/PDPJSMON.json +++ b/apps/pdp11/boot/monitor/PDPJSMON.json @@ -1,89 +1,90 @@ {"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*/] +0xC255 /*141125*/,0x09F7 /*004767*/,0x0056 /*000126*/,0x15DF /*012737*/,0xC058 /*140130*/,0x0040 /*000100*/,0x15DF /*012737*/,0x00E0 /*000340*/, +0x0042 /*000102*/,0x55DF /*052737*/,0x0040 /*000100*/,0xFF66 /*177546*/,0x15C0 /*012700*/,0xC26D /*141155*/,0x09F7 /*004767*/,0x003C /*000074*/, +0xE5C6 /*162706*/,0x00AE /*000256*/,0x1180 /*010600*/,0x09F7 /*004767*/,0x006E /*000156*/,0x0A00 /*005000*/,0x101F /*010037*/,0xFF78 /*177570*/, +0x0001 /*000001*/,0x0A80 /*005200*/,0x0BF7 /*005767*/,0x000C /*000014*/,0x03F9 /*001771*/,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*/,0xC08C /*140214*/,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*/,0xC0C4 /*140304*/,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*/,0xC223 /*141043*/,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*/,0xC14A /*140512*/,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*/,0xC220 /*141040*/,0x09F7 /*004767*/,0xFF0C /*177414*/, +0xB5DF /*132737*/,0x0040 /*000100*/,0xFF74 /*177564*/,0x02FC /*001374*/,0x0A04 /*005004*/,0x15C3 /*012703*/,0xC227 /*141047*/,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*/, +0xC1C4 /*140704*/,0x0104 /*000404*/,0x15C0 /*012700*/,0xC243 /*141103*/,0x09F7 /*004767*/,0xFEC0 /*177300*/,0x0A37 /*005067*/,0xFEF6 /*177366*/, +0x15C0 /*012700*/,0xC26D /*141155*/,0x09F7 /*004767*/,0xFEB4 /*177264*/,0x1584 /*012604*/,0x1583 /*012603*/,0x1582 /*012602*/,0x1581 /*012601*/, +0x1580 /*012600*/,0x0002 /*000002*/,0xC42C /*142054*/,0xC2A8 /*141250*/,0xC2B4 /*141264*/,0xC2F8 /*141370*/,0xC29E /*141236*/,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*/, +0xC1CE /*140716*/,0x09F7 /*004767*/,0xFDC6 /*176706*/,0x0087 /*000207*/,0x0000 /*000000*/,0x15C0 /*012700*/,0xC220 /*141040*/,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*/,0xC28F /*141217*/,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*/,0xC388 /*141610*/,0x14A6 /*012246*/,0x0D93 /*006623*/,0x2097 /*020227*/,0xC42C /*142054*/,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*/, +0xC274 /*141164*/,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*/,0xC243 /*141103*/, +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*/] } \ No newline at end of file diff --git a/apps/pdp11/boot/monitor/PDPJSMON.lst b/apps/pdp11/boot/monitor/PDPJSMON.lst index 5fda0e322..4cff7f1ac 100644 --- a/apps/pdp11/boot/monitor/PDPJSMON.lst +++ b/apps/pdp11/boot/monitor/PDPJSMON.lst @@ -4,530 +4,532 @@ 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 + 7 177570 CNSW = 177570 + 8 177564 DL11XCSR = 177564 + 9 000064 DL11VEC = 64 + 10 + 11 177546 KW11LKS = 177546 + 12 000100 KW11VEC = 100 + 13 + 14 .ASECT + 15 140000 .=140000 + 16 140000 000005 START: RESET ; 140000 + 17 140002 005037 177776 CLR @#PSW + 18 140006 012706 140000 MOV #START,SP + 19 140012 005037 177564 CLR @#DL11XCSR ; CLEAR THE XCSR + 20 140016 012700 141125 MOV #BANNER,R0 + 21 140022 004767 140154' JSR PC,PRINT + 22 140026 012737 140130 000100 MOV #CLKAST,@#KW11VEC + 23 140034 012737 000340 000102 MOV #340,@#KW11VEC+2 + 24 140042 052737 000100 177546 BIS #100,@#KW11LKS ; SET CLOCK TICKING + 25 + 26 140050 012700 141155 MOV #PROMPT,R0 + 27 140054 004767 140154' JSR PC,PRINT + 28 140060 162706 000256 SUB #256,SP + 29 140064 010600 MOV SP,R0 + 30 140066 004767 140250' JSR PC,INPUT + 31 140072 005000 CLR R0 + 32 140074 010037 177570 1$: MOV R0,@#CNSW ; UPDATE THE FRONT PANEL DATA DISPLAY WITH R0 + 33 140100 000001 WAIT + 34 140102 005200 INC R0 + 35 140104 005767 140124' TST LGHTON + 36 140110 001771 BEQ 1$ + 37 140112 012746 054000 MOV #054000,-(SP) ; SUPER PRIORITY 0 ALT REG + 38 140116 016746 140124' MOV LGHTON,-(SP) ; CALL SUPER LOOP START + 39 140122 000002 RTI + 40 + 41 140124 000000 LGHTON: .WORD 0 + 42 140126 000000 CLKTIC: .WORD 0 + 43 + 44 CLKAST: ; 140124 + 45 140130 005267 140126' INC CLKTIC + 46 140134 000002 RTI + 47 + 48 ONECHR: + 49 140136 105737 177564 TSTB @#DL11XCSR ; 140132 + 50 140142 100375 BPL ONECHR + 51 140144 110037 177566 MOVB R0,@#177566 + 52 140150 000207 RTS PC 53 - 54 PRINT: ; 140150 - 55 140150 132737 000100 177564 BITB #100,@#DL11XCSR - 56 140156 001374 BNE PRINT - 57 140160 010067 140146' MOV R0,PRTPTR - 58 140164 012737 140210 000064 MOV #PRTAST,@#DL11VEC - 59 140172 012737 000200 000066 MOV #200,@#DL11VEC+2 - 60 140200 152737 000100 177564 BISB #100,@#DL11XCSR - 61 140206 000207 RTS PC - 62 - 63 PRTAST: ; 140210 - 64 140210 105777 140146' TSTB @PRTPTR - 65 140214 001406 BEQ 2$ - 66 140216 117737 140146' 177566 MOVB @PRTPTR,@#177566 - 67 140224 005267 140146' INC PRTPTR - 68 140230 000002 RTI - 69 140232 105037 177564 2$: CLRB @#177564 - 70 140236 000002 RTI - 71 - 72 140240 000000 BUFFER: .WORD 0 ; INPUT BUFFER POINTER - 73 140242 000000 LENGTH: .WORD 0 ; INPUT BUFFER LENGTH - 74 - 75 INPUT: - 76 140244 010067 140240' MOV R0,BUFFER ; 140244 - 77 140250 005067 140242' CLR LENGTH - 78 140254 012737 140300 000060 MOV #INPAST,@#60 - 79 140262 012737 000200 000062 MOV #200,@#62 - 80 140270 152737 000100 177560 BISB #100,@#177560 - 81 140276 000207 RTS PC - 82 - 83 INPAST: ; 140300 - 84 140300 010046 MOV R0,-(SP) - 85 140302 113700 177562 MOVB @#177562,R0 - 86 140306 120027 000015 CMPB R0,#15 - 87 140312 001455 BEQ 7$ ; CARRIAGE RETURN - 88 140314 120027 000177 CMPB R0,#127. - 89 140320 001403 BEQ 2$ ; - 90 140322 120027 000010 CMPB R0,#10 - 91 140326 001012 BNE 4$ ; BACK SPACE - 92 140330 005767 140242' 2$: TST LENGTH ; DATA IN BUFFER? - 93 140334 001406 BEQ 3$ - 94 140336 005367 140242' DEC LENGTH ; LENGTH - 95 140342 012700 141037 MOV #DEL,R0 - 96 140346 004767 140150' JSR PC,PRINT - 97 140352 000453 3$: BR 9$ - 98 140354 120027 000040 4$: CMPB R0,#40 - 99 140360 002450 BLT 9$ ; BELOW SPACE - 100 140362 120027 000177 CMPB R0,#177 - 101 140366 002045 BGE 9$ ; SKIP STUFF TOO BIG - 102 140370 004767 140132' JSR PC,ONECHR ; ECHO CHAR - 103 140374 120027 000172 CMPB R0,#172 - 104 140400 003005 BGT 5$ ; ABOVE Z - 105 140402 120027 000141 CMPB R0,#141 - 106 140406 002402 BLT 5$ ; BELOW A - 107 140410 142700 000040 BICB #40,R0 ; CONVERT TO UPPER CASE - 108 140414 026727 140242' 000254 5$: CMP LENGTH,#254 - 109 140422 002027 BGE 9$ - 110 140424 110046 MOVB R0,-(SP) - 111 140426 016700 140240' MOV BUFFER,R0 - 112 140432 066700 140242' ADD LENGTH,R0 - 113 140436 112610 MOVB (SP)+,(R0) - 114 140440 005267 140242' INC LENGTH - 115 140444 000416 BR 9$ - 116 - 117 140446 016700 140240' 7$: MOV BUFFER,R0 - 118 140452 066700 140242' ADD LENGTH,R0 - 119 140456 105010 CLRB (R0) - 120 140460 012737 140506 000240 MOV #CMD,@#240 ; CALL CMD AT PRIORITY 2 - 121 140466 012737 000100 000242 MOV #100,@#242 - 122 140474 012737 002000 177772 MOV #2000,@#177772 - 123 140502 012600 9$: MOV (SP)+,R0 - 124 140504 000002 RTI - 125 - 126 CMD: ; 140506 - 127 140506 005037 177772 CLR @#177772 ; NO MORE PIR CALLS - 128 140512 010046 MOV R0,-(SP) - 129 140514 010146 MOV R1,-(SP) - 130 140516 010246 MOV R2,-(SP) - 131 140520 010346 MOV R3,-(SP) - 132 140522 010446 MOV R4,-(SP) - 133 140524 012700 141034 MOV #EOL,R0 - 134 140530 004767 140150' JSR PC,PRINT - 135 140534 132737 000100 177564 1$: BITB #100,@#177564 - 136 140542 001374 BNE 1$ - 137 140544 005004 CLR R4 - 138 140546 012703 141043 MOV #CMDLST,R3 ; CMD LIST - 139 140552 112300 3$: MOVB (R3)+,R0 - 140 140554 001431 BEQ 13$ - 141 140556 016702 140240' MOV BUFFER,R2 ; USER CMD - 142 140562 112201 4$: MOVB (R2)+,R1 - 143 140564 001431 BEQ 15$ ; NULL COMMAND? - 144 140566 120127 000040 CMPB R1,#40 - 145 140572 001773 BEQ 4$ ; SKIP SPACE - 146 140574 120001 5$: CMPB R0,R1 - 147 140576 001010 BNE 7$ - 148 140600 112300 MOVB (R3)+,R0 - 149 140602 001412 BEQ 9$ - 150 140604 112201 MOVB (R2)+,R1 - 151 140606 001410 BEQ 9$ - 152 140610 120127 000040 CMPB R1,#40 - 153 140614 001367 BNE 5$ - 154 140616 000404 BR 9$ - 155 140620 112300 7$: MOVB (R3)+,R0 - 156 140622 001376 BNE 7$ - 157 140624 005204 INC R4 - 158 140626 000751 BR 3$ - 159 140630 006304 9$: ASL R4 - 160 140632 004774 140700 JSR PC,@CMDTBL(R4) ; EXECUTE - 161 140636 000404 BR 15$ - 162 - 163 140640 012700 141077 13$: MOV #UNKMSG,R0 - 164 140644 004767 140150' JSR PC,PRINT - 165 - 166 140650 005067 140242' 15$: CLR LENGTH - 167 140654 012700 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 '<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 + 54 140152 000000 PRTPTR: .WORD 0 ; 140146 + 55 + 56 PRINT: ; 140150 + 57 140154 132737 000100 177564 BITB #100,@#DL11XCSR + 58 140162 001374 BNE PRINT + 59 140164 010067 140152' MOV R0,PRTPTR + 60 140170 012737 140214 000064 MOV #PRTAST,@#DL11VEC + 61 140176 012737 000200 000066 MOV #200,@#DL11VEC+2 + 62 140204 152737 000100 177564 BISB #100,@#DL11XCSR + 63 140212 000207 RTS PC + 64 + 65 PRTAST: ; 140210 + 66 140214 105777 140152' TSTB @PRTPTR + 67 140220 001406 BEQ 2$ + 68 140222 117737 140152' 177566 MOVB @PRTPTR,@#177566 + 69 140230 005267 140152' INC PRTPTR + 70 140234 000002 RTI + 71 140236 105037 177564 2$: CLRB @#177564 + 72 140242 000002 RTI + 73 + 74 140244 000000 BUFFER: .WORD 0 ; INPUT BUFFER POINTER + 75 140246 000000 LENGTH: .WORD 0 ; INPUT BUFFER LENGTH + 76 + 77 INPUT: + 78 140250 010067 140244' MOV R0,BUFFER ; 140244 + 79 140254 005067 140246' CLR LENGTH + 80 140260 012737 140304 000060 MOV #INPAST,@#60 + 81 140266 012737 000200 000062 MOV #200,@#62 + 82 140274 152737 000100 177560 BISB #100,@#177560 + 83 140302 000207 RTS PC + 84 + 85 INPAST: ; 140300 + 86 140304 010046 MOV R0,-(SP) + 87 140306 113700 177562 MOVB @#177562,R0 + 88 140312 120027 000015 CMPB R0,#15 + 89 140316 001455 BEQ 7$ ; CARRIAGE RETURN + 90 140320 120027 000177 CMPB R0,#127. + 91 140324 001403 BEQ 2$ ; + 92 140326 120027 000010 CMPB R0,#10 + 93 140332 001012 BNE 4$ ; BACK SPACE + 94 140334 005767 140246' 2$: TST LENGTH ; DATA IN BUFFER? + 95 140340 001406 BEQ 3$ + 96 140342 005367 140246' DEC LENGTH ; LENGTH + 97 140346 012700 141043 MOV #DEL,R0 + 98 140352 004767 140154' JSR PC,PRINT + 99 140356 000453 3$: BR 9$ + 100 140360 120027 000040 4$: CMPB R0,#40 + 101 140364 002450 BLT 9$ ; BELOW SPACE + 102 140366 120027 000177 CMPB R0,#177 + 103 140372 002045 BGE 9$ ; SKIP STUFF TOO BIG + 104 140374 004767 140136' JSR PC,ONECHR ; ECHO CHAR + 105 140400 120027 000172 CMPB R0,#172 + 106 140404 003005 BGT 5$ ; ABOVE Z + 107 140406 120027 000141 CMPB R0,#141 + 108 140412 002402 BLT 5$ ; BELOW A + 109 140414 142700 000040 BICB #40,R0 ; CONVERT TO UPPER CASE + 110 140420 026727 140246' 000254 5$: CMP LENGTH,#254 + 111 140426 002027 BGE 9$ + 112 140430 110046 MOVB R0,-(SP) + 113 140432 016700 140244' MOV BUFFER,R0 + 114 140436 066700 140246' ADD LENGTH,R0 + 115 140442 112610 MOVB (SP)+,(R0) + 116 140444 005267 140246' INC LENGTH + 117 140450 000416 BR 9$ + 118 + 119 140452 016700 140244' 7$: MOV BUFFER,R0 + 120 140456 066700 140246' ADD LENGTH,R0 + 121 140462 105010 CLRB (R0) + 122 140464 012737 140512 000240 MOV #CMD,@#240 ; CALL CMD AT PRIORITY 2 + 123 140472 012737 000100 000242 MOV #100,@#242 + 124 140500 012737 002000 177772 MOV #2000,@#177772 + 125 140506 012600 9$: MOV (SP)+,R0 + 126 140510 000002 RTI + 127 + 128 CMD: ; 140506 + 129 140512 005037 177772 CLR @#177772 ; NO MORE PIR CALLS + 130 140516 010046 MOV R0,-(SP) + 131 140520 010146 MOV R1,-(SP) + 132 140522 010246 MOV R2,-(SP) + 133 140524 010346 MOV R3,-(SP) + 134 140526 010446 MOV R4,-(SP) + 135 140530 012700 141040 MOV #EOL,R0 + 136 140534 004767 140154' JSR PC,PRINT + 137 140540 132737 000100 177564 1$: BITB #100,@#177564 + 138 140546 001374 BNE 1$ + 139 140550 005004 CLR R4 + 140 140552 012703 141047 MOV #CMDLST,R3 ; CMD LIST + 141 140556 112300 3$: MOVB (R3)+,R0 + 142 140560 001431 BEQ 13$ + 143 140562 016702 140244' MOV BUFFER,R2 ; USER CMD + 144 140566 112201 4$: MOVB (R2)+,R1 + 145 140570 001431 BEQ 15$ ; NULL COMMAND? + 146 140572 120127 000040 CMPB R1,#40 + 147 140576 001773 BEQ 4$ ; SKIP SPACE + 148 140600 120001 5$: CMPB R0,R1 + 149 140602 001010 BNE 7$ + 150 140604 112300 MOVB (R3)+,R0 + 151 140606 001412 BEQ 9$ + 152 140610 112201 MOVB (R2)+,R1 + 153 140612 001410 BEQ 9$ + 154 140614 120127 000040 CMPB R1,#40 + 155 140620 001367 BNE 5$ + 156 140622 000404 BR 9$ + 157 140624 112300 7$: MOVB (R3)+,R0 + 158 140626 001376 BNE 7$ + 159 140630 005204 INC R4 + 160 140632 000751 BR 3$ + 161 140634 006304 9$: ASL R4 + 162 140636 004774 140704 JSR PC,@CMDTBL(R4) ; EXECUTE + 163 140642 000404 BR 15$ + 164 + 165 140644 012700 141103 13$: MOV #UNKMSG,R0 + 166 140650 004767 140154' JSR PC,PRINT + 167 + 168 140654 005067 140246' 15$: CLR LENGTH + 169 140660 012700 141155 MOV #PROMPT,R0 + 170 140664 004767 140154' JSR PC,PRINT + 171 140670 012604 MOV (SP)+,R4 + 172 140672 012603 MOV (SP)+,R3 + 173 140674 012602 MOV (SP)+,R2 + 174 140676 012601 MOV (SP)+,R1 + 175 140700 012600 MOV (SP)+,R0 + 176 140702 000002 RTI + 177 + 178 + 179 140704 142054 141250 141264 CMDTBL: .WORD BOOT,HALT,TEST,LIGHTS,HELP + 140712 141370 141236 + 180 140716 103 117 115 HLPMSG: .ASCIZ 'COMMANDS ARE BOOT, HALT, LIGHTS, TEST AND HELP'<15><12>'BOOT DEVICES ARE RK? RL? OR RP?'<15><12> + 140721 115 101 116 + 140724 104 123 040 + 140727 101 122 105 + 140732 040 102 117 + 140735 117 124 054 + 140740 040 110 101 + 140743 114 124 054 + 140746 040 114 111 + 140751 107 110 124 + 140754 123 054 040 + 140757 124 105 123 + 140762 124 040 101 + 140765 116 104 040 + 140770 110 105 114 + 140773 120 015 012 + 140776 102 117 117 + 141001 124 040 104 + 141004 105 126 111 + 141007 103 105 123 + 141012 040 101 122 + 141015 105 040 122 + 141020 113 077 040 + 141023 122 114 077 + 141026 040 117 122 + 141031 040 122 120 + 141034 077 015 012 + 141037 000 + 181 141040 015 012 000 EOL: .BYTE 15,12,0 + 182 141043 010 040 010 DEL: .BYTE 10,40,10,0 + 141046 000 + 183 141047 102 117 117 CMDLST: .ASCIZ 'BOOT' + 141052 124 000 + 184 141054 110 101 114 .ASCIZ 'HALT' + 141057 124 000 + 185 141061 124 105 123 .ASCIZ 'TEST' + 141064 124 000 + 186 141066 114 111 107 .ASCIZ 'LIGHTS' + 141071 110 124 123 + 141074 000 + 187 141075 110 105 114 .ASCIZ 'HELP' + 141100 120 000 + 188 141102 000 .BYTE 0 + 189 141103 125 116 113 UNKMSG: .ASCIZ 'UNKNOWN COMMAND'<12><15> + 141106 116 117 127 + 141111 116 040 103 + 141114 117 115 115 + 141117 101 116 104 + 141122 012 015 000 + 190 141125 120 104 120 BANNER: .ASCIZ 'PDP-11 MONITOR V1.0'<12><15><12><15> + 141130 055 061 061 + 141133 040 115 117 + 141136 116 111 124 + 141141 117 122 040 + 141144 126 061 056 + 141147 060 012 015 + 141152 012 015 000 + 191 ; 'ADAPTED FROM CODE BY PAUL NANKERVIS '<12><15><12><15> + 192 141155 102 117 117 PROMPT: .ASCIZ 'BOOT> ' + 141160 124 076 040 + 141163 000 + 193 141164 125 116 113 BADBOO: .ASCIZ 'UNKNOWN BOOT DEVICE'<12><15> + 141167 116 117 127 + 141172 116 040 102 + 141175 117 117 124 + 141200 040 104 105 + 141203 126 111 103 + 141206 105 012 015 + 141211 000 + 194 141212 040 040 040 PERMSG: .ASCIZ ' CLOCK TICKS'<12><15> + 141215 040 040 040 + 141220 103 114 117 + 141223 103 113 040 + 141226 124 111 103 + 141231 113 123 012 + 141234 015 000 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 + 196 .EVEN + 197 + 198 HELP: ; 141244 + 199 141236 012700 140716 MOV #HLPMSG,R0 + 200 141242 004767 140154' JSR PC,PRINT + 201 141246 000207 RTS PC + 202 + 203 HALT: ; 141260 + 204 141250 000000 HALT + 205 141252 012700 141040 MOV #EOL,R0 + 206 141256 004767 140154' JSR PC,PRINT + 207 141262 000207 RTS PC + 208 + 209 TEST: ; 141272 + 210 141264 005067 140126' CLR CLKTIC + 211 + 212 141270 012705 015000 MOV #15000,R5 + 213 141274 010537 177570 10$: MOV R5,@#177570 ; DISPLAY + 214 141300 010504 MOV R5,R4 + 215 141302 006204 ASR R4 + 216 141304 005000 15$: CLR R0 + 217 141306 010501 MOV R5,R1 + 218 141310 071004 DIV R4,R0 + 219 141312 010002 MOV R0,R2 + 220 141314 070204 MUL R4,R2 + 221 141316 060301 ADD R3,R1 + 222 141320 020105 CMP R1,R5 + 223 141322 001401 BEQ 20$ + 224 141324 000000 HALT + 225 141326 077412 20$: SOB R4,15$ + 226 141330 077517 SOB R5,10$ + 227 + 228 141332 012700 141217 MOV #PERMSG+5,R0 + 229 141336 016703 140126' MOV CLKTIC,R3 + 230 + 231 141342 005002 25$: CLR R2 ; 141350 + 232 141344 071227 000010 DIV #10,R2 + 233 141350 062703 000060 ADD #'0,R3 + 234 141354 110340 MOVB R3,-(R0) + 235 141356 010203 MOV R2,R3 + 236 141360 001370 BNE 25$ + 237 + 238 141362 004767 140154' JSR PC,PRINT + 239 141366 000207 RTS PC + 240 + 241 + 242 177572 MMR0=177572 + 243 177574 MMR1=177574 + 244 177576 MMR2=177576 + 245 172516 MMR3=172516 + 246 + 247 LIGHTS: ; 141376 + 248 141370 012703 077406 MOV #77406,R3 ; DEFAULT PDR + 249 141374 005002 CLR R2 + 250 141376 005001 CLR R1 + 251 141400 012700 000010 MOV #8.,R0 + 252 141404 010361 172300 1$: MOV R3,172300(R1) ; KERNEL I PDR + 253 141410 010261 172340 MOV R2,172340(R1) ; KERNEL I PAR + 254 141414 010361 172320 MOV R3,172320(R1) ; KERNEL D PDR + 255 141420 010261 172360 MOV R2,172360(R1) ; KERNEL D PAR + 256 141424 010361 172200 MOV R3,172200(R1) ; SUPER I PDR + 257 141430 010261 172240 MOV R2,172240(R1) ; SUPER I PAR + 258 141434 010361 172220 MOV R3,172220(R1) ; SUPER D PDR + 259 141440 010261 172260 MOV R2,172260(R1) ; SUPER D PAR + 260 141444 010361 177600 MOV R3,177600(R1) ; USER I PDR + 261 141450 010261 177640 MOV R2,177640(R1) ; USER I PAR + 262 141454 010361 177620 MOV R3,177620(R1) ; USER D PDR + 263 141460 010361 177660 MOV R3,177660(R1) ; USER D PAR + 264 141464 062702 000200 ADD #200,R2 + 265 141470 062701 000002 ADD #2,R1 + 266 141474 077035 SOB R0,1$ + 267 141476 052737 176000 172376 BIS #176000,@#172376 ; KERNEL D POINTS TO I/O SPACE + 268 141504 052737 176000 172276 BIS #176000,@#172276 ; SUPER D POINTS TO I/O SPACE + 269 141512 052737 176000 177676 BIS #176000,@#177676 ; USER D POINTS TO I/O SPACE + 270 141520 012737 000077 172516 MOV #77,@#MMR3 ; 77 FOR 22 BIT + 271 141526 012737 000001 177572 MOV #1,@#MMR0 + 272 + 273 141534 012737 001700 172244 MOV #1700,@#172244 ; BASE SUPER I (PAR 2) #40000 AT #170000 + 274 141542 012737 001700 172264 MOV #1700,@#172264 ; BASE SUPER D (PAR 2) #40000 AT #170000 + 275 141550 012737 010000 177776 MOV #010000,@#177776 ; SET PM TO SUPER + 276 + 277 141556 012703 040200 MOV #40200,R3 ; SUPER CODE ADDRESS + 278 141562 012702 141610 MOV #SUPERS,R2 ; ADDRESS SUPER CODE + 279 141566 012246 10$: MOV (R2)+,-(SP) + 280 141570 006623 MTPI (R3)+ + 281 141572 020227 142054 CMP R2,#SUPERE + 282 141576 103773 BLO 10$ + 283 + 284 141600 012767 040200 140124' MOV #40200,LGHTON ; CHANGE IDLE TASK + 285 141606 000207 RTS PC + 286 + 287 ; + 288 ; TO BE COPIED TO SUPER #40200 AT PHYSICAL #170000 + 289 ; #40000 TO #40200 FOR WAIT & JMP INSTRUCTIONS + 290 ; + 291 SUPERS: ; 141616 + 292 141610 012700 000037 MOV #37,R0 ; LOAD PATTERN + 293 141614 012701 174000 MOV #174000,R1 + 294 141620 032737 000001 177570 BIT #1,@#177570 + 295 141626 001414 BEQ 10$ + 296 141630 012700 007417 MOV #7417,R0 + 297 141634 010001 MOV R0,R1 + 298 141636 005101 COM R1 + 299 141640 032737 000002 177570 BIT #2,@#177570 + 300 141646 001404 BEQ 10$ + 301 141650 012700 036163 MOV #36163,R0 + 302 141654 012701 037000 MOV #37000,R1 + 303 141660 010102 10$: MOV R1,R2 + 304 141662 162702 000002 SUB #2,R2 + 305 141666 042702 000001 BIC #1,R2 ; WAIT ADDRESS + 306 141672 010203 MOV R2,R3 + 307 141674 042703 177701 BIC #177701,R3 ; ADDRESS OFFSET + 308 141700 012763 000001 040000 MOV #0000001,40000(R3) ; WRITE WAIT + 309 141706 062703 000002 ADD #2,R3 + 310 141712 012763 000113 040000 MOV #0000113,40000(R3) ; WRITE JMP (R3) + 311 + 312 141720 010204 MOV R2,R4 + 313 141722 072427 177772 ASH #-6,R4 + 314 141726 042704 177600 BIC #177600,R4 + 315 141732 012705 001700 MOV #1700,R5 + 316 141736 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR WAIT + 317 141740 010204 MOV R2,R4 + 318 141742 072427 177764 ASH #-12.,R4 + 319 141746 042704 177761 BIC #177761,R4 ; PAR SELECT OFFSET + 320 141752 010564 172240 MOV R5,172240(R4) ; SUPER I SPACE + 321 + 322 141756 010103 MOV R1,R3 + 323 141760 072327 177764 ASH #-12.,R3 + 324 141764 042703 177761 BIC #177761,R3 ; PAR SELECT OFFSET + 325 141770 020304 CMP R3,R4 ; SAME PAR + 326 141772 001412 BEQ 30$ + 327 141774 010104 MOV R1,R4 + 328 141776 072427 177772 ASH #-6,R4 + 329 142002 042704 177600 BIC #177600,R4 + 330 142006 012705 001700 MOV #1700,R5 + 331 142012 160405 SUB R4,R5 ; PAR ADDRESS BASE FOR JMP + 332 142014 010563 172240 MOV R5,172240(R3) ; SUPER I SPACE + 333 30$: + 334 142020 012704 000003 MOV #3,R4 + 335 142024 063704 177570 ADD @#177570,R4 + 336 142030 012703 000002 MOV #2,R3 + 337 142034 060703 ADD PC,R3 + 338 142036 000112 40$: JMP (R2) + 339 142040 077402 SOB R4,40$ + 340 142042 010002 MOV R0,R2 + 341 142044 006002 ROR R2 ; ROTATE PATTERN + 342 142046 006101 ROL R1 + 343 142050 006000 ROR R0 + 344 142052 000702 BR 10$ + 345 SUPERE: + 346 + 347 BOOT: ; 142062 + 348 142054 005003 CLR R3 ; UNIT + 349 142056 112201 1$: MOVB (R2)+,R1 + 350 142060 001545 BEQ BOOTRK ; DEFAULT DEVICE IS RK0 + 351 142062 120127 000040 CMPB R1,#40 + 352 142066 001773 BEQ 1$ + 353 142070 120127 000122 CMPB R1,#'R + 354 142074 001405 BEQ 5$ + 355 + 356 142076 012700 141164 MOV #BADBOO,R0 + 357 142102 004767 140154' JSR PC,PRINT + 358 142106 000207 RTS PC + 359 + 360 142110 112201 5$: MOVB (R2)+,R1 ; HOPEFULLY K, L OR P + 361 142112 112200 7$: MOVB (R2)+,R0 ; DIGIT + 362 142114 001416 BEQ 9$ + 363 142116 120027 000040 CMPB R0,#40 + 364 142122 001413 BEQ 9$ + 365 142124 120027 000067 CMPB R0,#'7 + 366 142130 003031 BGT 11$ + 367 142132 162700 000060 SUB #'0,R0 + 368 142136 002426 BLT 11$ 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 + 370 142142 006303 ASL R3 + 371 142144 006303 ASL R3 + 372 142146 050003 BIS R0,R3 ; PUT DIGIT INTO UNIT + 373 142150 000760 BR 7$ + 374 142152 005002 9$: CLR R2 + 375 142154 012722 000137 MOV #137,(R2)+ ; STORE "JMP @#140000" INSTRUCTION AT ADDRESS 0 + 376 142160 012722 140000 MOV #START,(R2)+ + 377 142164 012722 140000 MOV #START,(R2)+ ; STORE #140000 IN VECTOR 4, IN CASE OF TRAP TO 4 + 378 142170 005022 CLR (R2)+ + 379 142172 120127 000113 CMPB R1,#'K + 380 142176 001476 BEQ BOOTRK + 381 142200 120127 000114 CMPB R1,#'L + 382 142204 001410 BEQ BOOTRL + 383 142206 120127 000120 CMPB R1,#'P + 384 142212 001517 BEQ BOOTRP + 385 + 386 142214 012700 141103 11$: MOV #UNKMSG,R0 + 387 142220 004767 140154' JSR PC,PRINT + 388 142224 000207 RTS PC + 389 + 390 174400 RLCS=174400 + 391 BOOTRL: ; 142326 + 392 142226 000005 RESET + 393 142230 000303 SWAB R3 ; UNIT NUMBER + 394 142232 012701 174400 MOV #RLCS,R1 ; CSR + 395 142236 012761 000013 000004 MOV #13,4(R1) ; CLR ERR + 396 142244 052703 000004 BIS #4,R3 ; UNIT+GSTAT + 397 142250 010311 MOV R3,(R1) ; ISSUE CMD + 398 142252 105711 TSTB (R1) ; WAIT + 399 142254 100376 BPL .-2 + 400 142256 105003 CLRB R3 + 401 142260 052703 000010 BIS #10,R3 ; UNIT+RDHDR + 402 142264 010311 MOV R3,(R1) ; ISSUE CMD + 403 142266 105711 TSTB (R1) ; WAIT + 404 142270 100376 BPL .-2 + 405 142272 016102 000006 MOV 6(R1),R2 ; GET HDR + 406 142276 042702 000077 BIC #77,R2 ; CLR SECTOR + 407 142302 005202 INC R2 ; MAGIC BIT + 408 142304 010261 000004 MOV R2,4(R1) ; SEEK TO 0 + 409 142310 105003 CLRB R3 + 410 142312 052703 000006 BIS #6,R3 ; UNIT+SEEK + 411 142316 010311 MOV R3,(R1) ; ISSUE CMD + 412 142320 105711 TSTB (R1) ; WAIT + 413 142322 100376 BPL .-2 + 414 142324 005061 000002 CLR 2(R1) ; CLR BA + 415 142330 005061 000004 CLR 4(R1) ; CLR DA + 416 142334 012761 177000 000006 MOV #-512.,6(R1) ; SET WC + 417 142342 105003 CLRB R3 + 418 142344 052703 000014 BIS #14,R3 ; UNIT+READ + 419 142350 010311 MOV R3,(R1) ; ISSUE CMD + 420 142352 105711 TSTB (R1) ; WAIT + 421 142354 100376 BPL .-2 + 422 142356 042711 000377 BIC #377,(R1) + 423 142362 005002 CLR R2 + 424 142364 005003 CLR R3 + 425 142366 005004 CLR R4 + 426 142370 005005 CLR R5 + 427 142372 005007 CLR PC + 428 + 429 177412 RKDA=177412 + 430 000005 READGO=5 + 431 BOOTRK: + 432 142374 000005 RESET ; 142402 + 433 142376 000303 SWAB R3 ; UNIT NUMBER 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 + 437 142406 006303 ASL R3 + 438 142410 006303 ASL R3 + 439 142412 012701 177412 MOV #RKDA,R1 ; CSR + 440 142416 010311 MOV R3,(R1) ; LOAD DA + 441 142420 005041 CLR -(R1) ; CLEAR BA + 442 142422 012741 177000 MOV #-256.*2,-(R1) ; LOAD WC + 443 142426 012741 000005 MOV #READGO,-(R1) ; READ & GO + 444 142432 005002 CLR R2 + 445 142434 005003 CLR R3 + 446 142436 005004 CLR R4 + 447 142440 005005 CLR R5 + 448 142442 105711 TSTB (R1) + 449 142444 100376 BPL .-2 + 450 142446 105011 CLRB (R1) + 451 142450 005007 CLR PC + 452 + 453 176700 RPCSR=0176700 + 454 BOOTRP: ; 142460 + 455 142452 000005 RESET + 456 142454 012701 176700 MOV #RPCSR, R1 + 457 142460 012761 000040 000010 MOV #0000040, 10(R1) ; RESET + 458 142466 010361 000010 MOV R3, 10(R1) ; SET UNIT + 459 142472 012711 000021 MOV #0000021, (R1) ; PACK ACK + 460 142476 012761 010000 000032 MOV #0010000, 32(R1) ; 16B MODE + 461 142504 012761 177000 000002 MOV #-512., 2(R1) ; SET WC + 462 142512 005061 000004 CLR 4(R1) ; CLR BA + 463 142516 005061 000006 CLR 6(R1) ; CLR DA + 464 142522 005061 000034 CLR 34(R1) ; CLR CYL + 465 142526 012711 000071 MOV #0000071, (R1) ; READ + 466 142532 105711 TSTB (R1) ; WAIT + 467 142534 100376 BPL .-2 + 468 142536 105011 CLRB (R1) + 469 142540 010300 MOV R3,R0 + 470 142542 005007 CLR PC + 471 + 472 .END START + 472 diff --git a/apps/pdp11/boot/monitor/PDPJSMON.mac b/apps/pdp11/boot/monitor/PDPJSMON.mac index 22a1da5f1..4aa1e2456 100644 --- a/apps/pdp11/boot/monitor/PDPJSMON.mac +++ b/apps/pdp11/boot/monitor/PDPJSMON.mac @@ -4,6 +4,7 @@ ; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING? PSW = 177776 +CNSW = 177570 DL11XCSR = 177564 DL11VEC = 64 @@ -28,7 +29,8 @@ START: RESET ; 140000 MOV SP,R0 JSR PC,INPUT CLR R0 -1$: WAIT +1$: MOV R0,@#CNSW ; UPDATE THE FRONT PANEL DATA DISPLAY WITH R0 + WAIT INC R0 TST LGHTON BEQ 1$ diff --git a/apps/pdp11/boot/monitor/README.md b/apps/pdp11/boot/monitor/README.md index a4983b42f..eb8d34ad5 100644 --- a/apps/pdp11/boot/monitor/README.md +++ b/apps/pdp11/boot/monitor/README.md @@ -26,6 +26,7 @@ The **PDPJSMON.mac** source code is shown below. ; WANT PERFORMANCE COUNTER - CLOCK TICKS TO DO SOMETHING? PSW = 177776 + CNSW = 177570 DL11XCSR = 177564 DL11VEC = 64 @@ -50,7 +51,8 @@ The **PDPJSMON.mac** source code is shown below. MOV SP,R0 JSR PC,INPUT CLR R0 - 1$: WAIT + 1$: MOV R0,@#CNSW ; UPDATE THE FRONT PANEL DATA DISPLAY WITH R0 + WAIT INC R0 TST LGHTON BEQ 1$ diff --git a/devices/pdp11/machine/1170/panel/debugger/machine.xml b/devices/pdp11/machine/1170/panel/debugger/machine.xml index dcac05d60..846aab7b4 100644 --- a/devices/pdp11/machine/1170/panel/debugger/machine.xml +++ b/devices/pdp11/machine/1170/panel/debugger/machine.xml @@ -9,7 +9,7 @@ - + diff --git a/devices/pdp11/panel/1170/debugger/front.xml b/devices/pdp11/panel/1170/debugger/front.xml index 2908d39e2..205904fa4 100644 --- a/devices/pdp11/panel/1170/debugger/front.xml +++ b/devices/pdp11/panel/1170/debugger/front.xml @@ -2,105 +2,133 @@ Control Panel - - - - + + 16 + 18 + 22 + + + + + + KRNL + SUPR + USER + + + + + + ADDRESS - + . - + . - + . - + . - + . - + . - + . - - - - + + LED1 + LED2 + LED3 + + + + + + LED4 + LED5 + LED6 + + + + + + DATA - + . - + . - + . - + . - + . - - START + + STRT STEP - ENABLE + E/H - + CONT DEP EXAM @@ -108,13 +136,13 @@ - + LOAD TEST - + 0 1 2 @@ -122,7 +150,7 @@ - + 3 4 5 @@ -130,7 +158,7 @@ - + 6 7 8 @@ -138,7 +166,7 @@ - + 9 10 11 @@ -146,7 +174,7 @@ - + 12 13 14 @@ -154,7 +182,7 @@ - + 15 16 17 @@ -162,7 +190,7 @@ - + 18 19 20 @@ -170,7 +198,7 @@ - + 21 diff --git a/devices/pdp11/panel/1170/front.xml b/devices/pdp11/panel/1170/front.xml index 616ae5d1d..5aad69e5e 100644 --- a/devices/pdp11/panel/1170/front.xml +++ b/devices/pdp11/panel/1170/front.xml @@ -2,97 +2,125 @@ Control Panel - - - - + + 16 + 18 + 22 + + + + + + KRNL + SUPR + USER + + + + + + ADDRESS - + . - + . - + . - + . - + . - + . - + . - - - - + + LED1 + LED2 + LED3 + + + + + + LED4 + LED5 + LED6 + + + + + + DATA - + . - + . - + . - + . - + . - + START STEP ENABLE @@ -100,7 +128,7 @@ - + CONT DEP EXAM @@ -108,13 +136,13 @@ - + LOAD TEST - + 0 1 2 @@ -122,7 +150,7 @@ - + 3 4 5 @@ -130,7 +158,7 @@ - + 6 7 8 @@ -138,7 +166,7 @@ - + 9 10 11 @@ -146,7 +174,7 @@ - + 12 13 14 @@ -154,7 +182,7 @@ - + 15 16 17 @@ -162,7 +190,7 @@ - + 18 19 20 @@ -170,7 +198,7 @@ - + 21 diff --git a/docs/pcx86/examples/components.css b/docs/pcx86/examples/components.css index 11db5cd24..b40fd1375 100644 --- a/docs/pcx86/examples/components.css +++ b/docs/pcx86/examples/components.css @@ -124,9 +124,14 @@ color: #ffffff; background-color: #404040; } -.pcjs-tripled { +.pcjs-triplet { padding: 1px; } +.pcjs-ledlbl { + text-align: center; + font-size: 40%; + background-color: #000000; +} .pcjs-ledlbl0 { text-align: right; font-size: 50%; @@ -142,6 +147,8 @@ font-size: x-small; line-height: 32px; background-color: #000000; + border-bottom-left-radius: 20%; + border-bottom-right-radius: 20%; } .pcjs-led { float: left; @@ -168,8 +175,10 @@ .pcjs-swlbl { text-align: center; font-size: 40%; - line-height: 32px; + line-height: 16px; background-color: #000000; + border-top-left-radius: 20%; + border-top-right-radius: 20%; } .pcjs-swpad { height: 32px; diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index feb47dcc3..db6e78d7f 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -117,14 +117,16 @@ function BusPDP11(parmsBus, cpu, dbg) * Memory access handlers must service the entire block; see the setAccess() function in the Memory * component for details. * - * Finally, for debugging purposes, if an I/O address has a symbolic name, it will be saved here: + * Finally, for debugging purposes, if an I/O address has a symbolic name and message category, + * they will be saved here: * * [4]: symbolic name of I/O address + * [5]: message category * * UPDATE: The Debugger wants to piggy-back on these arrays to indicate addresses for which it wants * notification. In those cases, the following additional element will be set: * - * [5]: true to break on I/O, false to ignore I/O + * [6]: true to break on I/O, false to ignore I/O * * The false case is important if fIOBreakAll is set, because it allows the Debugger to selectively * ignore specific addresses. @@ -183,7 +185,9 @@ BusPDP11.IOHANDLER = { WRITE_BYTE: 1, READ_WORD: 2, WRITE_WORD: 3, - NAME: 4 + NAME: 4, + MSG_CATEGORY: 5, + DBG_BREAK: 6 }; /* @@ -257,14 +261,14 @@ BusPDP11.IOController = { } } if (b >= 0) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true, true); } return b; } 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(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage("warning: unconverted read access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true); } return b; @@ -331,13 +335,13 @@ BusPDP11.IOController = { } } if (fWrite) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true, true); } return; } 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(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage("warning: unconverted write access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b), true, true); } }, @@ -363,14 +367,14 @@ BusPDP11.IOController = { } } if (w >= 0) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true, true); } return w; } 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(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage("warning: unconverted read access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true); } return w; @@ -400,13 +404,13 @@ BusPDP11.IOController = { } } if (fWrite) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true, true); } return; } 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(afn[BusPDP11.IOHANDLER.MSG_CATEGORY])) { this.dbg.printMessage("warning: unconverted write access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w), true, true); } } @@ -1172,8 +1176,9 @@ BusPDP11.prototype.restoreMemory = function(a) * @param {function(number)|null|undefined} fnReadWord * @param {function(number,number)|null|undefined} fnWriteWord * @param {string} [sName] + * @param {number} [msgCategory] */ -BusPDP11.prototype.addIOHandlers = function(start, end, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sName) +BusPDP11.prototype.addIOHandlers = function(start, end, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sName, msgCategory) { for (var addr = start; addr <= end; addr += 2) { var off = addr & BusPDP11.IOPAGE_MASK; @@ -1181,21 +1186,22 @@ BusPDP11.prototype.addIOHandlers = function(start, end, fnReadByte, fnWriteByte, Component.warning("I/O address already registered: " + str.toHexLong(addr)); continue; } - this.aIOHandlers[off] = [fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sName || "unknown", false]; + this.aIOHandlers[off] = [fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sName || "unknown", msgCategory, false]; if (MAXDEBUG) this.log("addIOHandlers(" + str.toHexLong(addr) + ")"); } }; /** - * addIOTable(component, table) + * addIOTable(component, table, msgCategory) * * Add I/O notification handlers from the specified table (a batch version of addIOHandlers). * * @this {BusPDP11} * @param {Component} component * @param {Object} table + * @param {number} [msgCategory] (default is BUS) */ -BusPDP11.prototype.addIOTable = function(component, table) +BusPDP11.prototype.addIOTable = function(component, table, msgCategory) { for (var port in table) { var addr = +port; @@ -1237,7 +1243,7 @@ BusPDP11.prototype.addIOTable = function(component, table) 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); + this.addIOHandlers(addr, addr, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, sReg, msgCategory || MessagesPDP11.BUS); } } }; @@ -1267,9 +1273,8 @@ BusPDP11.prototype.fault = function(addr, err, access) { this.fFault = true; if (!this.nDisableFaults) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.FAULT)) { this.dbg.printMessage("memory fault (" + access + ") on address " + this.dbg.toStrBase(addr), true, true); - this.dbg.stopInstruction(); } if (err) this.cpu.regErr |= err; this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 5d484d360..c94e8886c 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -186,7 +186,6 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.cmp = cmp; this.bus = bus; this.dbg = dbg; - this.panel = cmp.panel; for (var i = 0; i < CPUPDP11.BUTTONS.length; i++) { var control = this.bindings[CPUPDP11.BUTTONS[i]]; @@ -283,6 +282,9 @@ CPUPDP11.prototype.powerUp = function(data, fRepower) * is now responsible for managing a component's fPowered flag, not us. * * this.flags.powered = true; + * + * And we don't have to worry whether this.cmp is set, because powerUp() handlers are never called + * before initBus() handlers. */ this.cmp.updateStatus(); return true; @@ -1077,7 +1079,7 @@ CPUPDP11.prototype.runCPU = function() nCycles = this.endBurst(true); /* - * Add nCycles to nCyclesThisRun, as well as nRunCycles (the cycle count since the CPU first started). + * Add nCycles to nCyclesThisRun, as well as nRunCycles (the cycle count since the CPU started). */ this.nCyclesThisRun += nCycles; this.nRunCycles += nCycles; @@ -1207,7 +1209,7 @@ CPUPDP11.prototype.yieldCPU = function() * odd for those messages to show CPU state changes if the Control Panel, Video display, etc, does not, * so I've added this call to try to keep things looking synchronized. */ - this.cmp.updateStatus(); + if (this.cmp) this.cmp.updateStatus(); }; if (NODE) module.exports = CPUPDP11; diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index fb1e604e6..c5b2a0a1e 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -1760,7 +1760,7 @@ PDP11.opWAIT = function(opCode) /* * Since here we're actually transitioning to WAIT, let's update the Panel's LEDs (well, OK, among other things). */ - this.cmp.updateStatus(); + if (this.cmp) this.cmp.updateStatus(); } this.opFlags |= PDP11.OPFLAG.WAIT; this.advancePC(-2); diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 38cc223e8..1cc7ca70d 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -310,7 +310,6 @@ CPUStatePDP11.prototype.setMMR0 = function(newMMR0) this.mmuEnable = mmuEnable; this.setMemoryAccess(); } - if (this.panel) this.panel.updateStatus(); } }; @@ -358,7 +357,6 @@ CPUStatePDP11.prototype.setMMR3 = function(newMMR3) this.regMMR3 = newMMR3; this.mmuMask = (newMMR3 & PDP11.MMR3.MMU_22BIT)? 0x3fffff : 0x3ffff; this.setMemoryAccess(); - if (this.panel) this.panel.updateStatus(); } }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 799cb0fdb..cf73a1112 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -43,8 +43,8 @@ if (DEBUGGER) { var State = require("../../shared/lib/state"); var PDP11 = require("./defines"); var CPUPDP11 = require("./cpu"); - var MessagesPDP11 = require("./messages"); var MemoryPDP11 = require("./memory"); + var MessagesPDP11 = require("./messages"); } } @@ -1212,7 +1212,7 @@ if (DEBUGGER) { if (this.sMessagePrev && sMessage == this.sMessagePrev) return; this.sMessagePrev = sMessage; - if (this.bitsMessage & MessagesPDP11.HALT) { + if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && this.cpu.isRunning()) { this.stopCPU(); sMessage += " (cpu halted)"; } @@ -1334,7 +1334,7 @@ if (DEBUGGER) { nCycles = this.cpu.getBurstCycles(nCycles); var nCyclesStep = this.cpu.stepCPU(nCycles); if (nCyclesStep > 0) { - this.cpu.updateTimers(nCycles); + this.cpu.updateTimers(nCyclesStep); this.nCycles += nCyclesStep; this.cpu.addCycles(nCyclesStep, true); this.cpu.updateChecksum(nCyclesStep); @@ -1358,7 +1358,13 @@ if (DEBUGGER) { * and then update our own state. Normally, the only time fUpdateStatus will be false is when doTrace() * is calling us in a loop, in which case it will perform its own updateStatus() when it's done. */ - if (fUpdateStatus !== false) this.cmp.updateStatus(); + if (fUpdateStatus !== false) { + /* + * Make an effort to keep any Front Panel in sync with us. + */ + if (this.cmp.panel && this.cmp.panel.stop) this.cmp.panel.stop(); + this.cmp.updateStatus(); + } this.updateStatus(fRegs || false); return (this.nCycles > 0); @@ -3660,6 +3666,7 @@ if (DEBUGGER) { * with displayLiveRegs enabled, so once the repeat count has been exhausted, we must * perform a final updateStatus(). */ + if (dbg.cmp.panel && dbg.cmp.panel.stop) dbg.cmp.panel.stop(); dbg.cmp.updateStatus(); dbg.setBusy(false); } diff --git a/modules/pdp11/lib/memory.js b/modules/pdp11/lib/memory.js index 4282183f0..550782b80 100644 --- a/modules/pdp11/lib/memory.js +++ b/modules/pdp11/lib/memory.js @@ -590,7 +590,6 @@ MemoryPDP11.prototype = { readNone: function readNone(off, addr) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY) /* && !off */) { this.dbg.printMessage("attempt to read invalid address " + this.dbg.toStrBase(addr), true); - this.dbg.stopInstruction(); } this.bus.fault(addr, PDP11.CPUERR.NOMEMORY, PDP11.ACCESS.READ); return 0xff; @@ -606,7 +605,6 @@ MemoryPDP11.prototype = { writeNone: function writeNone(off, v, addr) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY) /* && !off */) { this.dbg.printMessage("attempt to write " + this.dbg.toStrBase(v) + " to invalid addresses " + this.dbg.toStrBase(addr), true); - this.dbg.stopInstruction(); } this.bus.fault(addr, PDP11.CPUERR.NOMEMORY, PDP11.ACCESS.WRITE); }, diff --git a/modules/pdp11/lib/messages.js b/modules/pdp11/lib/messages.js index da6ef0375..cde75534d 100644 --- a/modules/pdp11/lib/messages.js +++ b/modules/pdp11/lib/messages.js @@ -35,6 +35,7 @@ var MessagesPDP11 = { CPU: 0x00000001, TRAP: 0x00000010, + FAULT: 0x00000020, BUS: 0x00000040, MEMORY: 0x00000080, DEVICE: 0x00000100, @@ -67,6 +68,7 @@ var MessagesPDP11 = { MessagesPDP11.CATEGORIES = { "cpu": MessagesPDP11.CPU, "trap": MessagesPDP11.TRAP, + "fault": MessagesPDP11.FAULT, "bus": MessagesPDP11.BUS, "memory": MessagesPDP11.MEMORY, "device": MessagesPDP11.DEVICE, diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 09feb0a64..92aa6ba57 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -71,7 +71,7 @@ function PanelPDP11(parmsPanel) * * regAddr is an internal register containing the contents of the Front Panel's ADDRESS display, * and regData corresponds to the DATA display. They are updated by setAddr() and setData(), - * which in turn take care of calling updateLEDArray(). + * which in turn take care of calling setLEDArray(). */ this.regCNSW = 0; this.regAddr = this.regData = 0; @@ -82,28 +82,28 @@ function PanelPDP11(parmsPanel) * * 0 if off, 1 if on * - * initBus() will call updateLEDs() to ensure that every LED is set to its initial value. + * initBus() will call displayLEDs() to ensure that every LED is set to its initial value. */ this.leds = {}; /* * Every switch has an array associated with it: * - * [0]: initial/current value of switch (0 if down, 1 if up) + * [0]: initial/current value of switch (0 if "down", 1 if "up") * [1]: true if the switch is momentary, false if not - * [2]: true if the switch is currently being pressed, false if not + * [2]: true if the switch is currently pressed, false if released * [3]: optional handler to call whenever the switch is pressed or released * [4]: optional switch index (used with CNSW switches 'S0' through 'S21') * - * initBus() will call updateSwitches() to ensure that every switch is the position represented below. + * initBus() will call displaySwitches() to ensure that every switch is the position represented below. * * NOTE: Not all switches have the same "process" criteria. For example, 'TEST' will perform a lamp test - * when it is momentarily pressed "up", whereas 'LOAD [ADRS]' will load the address register from the switch + * when it is momentarily pressed "up", whereas 'LOAD [ADRS]' will load the ADDRESS register from the SWITCH * register when it is momentarily pressed "down". * - * This means that processLampTest(value) must act when value == 1, whereas processLoadAddr(value) must - * act when value == 0. You can infer all this from the table below, because the initial value of any - * momentary switch is its "passive" value, so the opposite is its "active" value. + * This means that processLampTest(value) must act when value == 1 ("up"), whereas processLoadAddr(value) + * must act when value == 0 ("down"). You can infer all this from the table below, because the initial value + * of any momentary switch is its "inactive" value, so the opposite is its "active" value. */ this.switches = { 'START': [1, true, false, this.processStart], @@ -127,9 +127,9 @@ Component.subclass(PanelPDP11); * * this.getSwitch(PanelPDP11.SWITCH.ENABLE) * - * However, I haven't filled out this table, primarily because the only switches we need to query - * are the non-momentary ones (eg, ENABLE and STEP), and EXAM and DEP (because they have special - * "step" behavior when pressed more than once in a row). + * I haven't filled out this table, primarily it only needs to list switches we actually query + * (eg, non-momentary ones like 'ENABLE' and 'STEP', and 'EXAM' and 'DEP' since they have special + * "step" behavior when pressed more than once in a row). Ditto for the LED table. */ PanelPDP11.SWITCH = { DEP: 'DEP', @@ -138,6 +138,12 @@ PanelPDP11.SWITCH = { STEP: 'STEP' }; +PanelPDP11.LED = { + B16: 'B16', + B18: 'B18', + B22: 'B22' +}; + /** * getSwitch(name) * @@ -275,8 +281,8 @@ PanelPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) bus.addIOTable(this, PanelPDP11.UNIBUS_IOTABLE); bus.addResetHandler(this.reset.bind(this)); - this.updateLEDs(); - this.updateSwitches(); + this.displayLEDs(); + this.displaySwitches(); }; /** @@ -301,7 +307,11 @@ PanelPDP11.prototype.powerUp = function(data, fRepower) * currently unnecessary, since we've added reset() to the addResetHandler() list. * * this.reset(); + * + * In the meantime, simulate a call to our stop() handler, to update the panel's ADDRESS register + * with the new PC. */ + this.stop(); } return true; }; @@ -320,7 +330,66 @@ PanelPDP11.prototype.powerDown = function(fSave, fShutdown) }; /** - * updateValue(sLabel, nValue, cch) + * displayLED(sBinding, value) + * + * @this {PanelPDP11} + * @param {string} sBinding + * @param {boolean|number} value (true or non-zero if the LED should be on, false or zero if off) + */ +PanelPDP11.prototype.displayLED = function(sBinding, value) +{ + var control = this.bindings[sBinding]; + if (control) { + /* + * TODO: Add support for user-definable LED colors? + */ + control.style.backgroundColor = (value? "#ff0000" : "#000000"); + } +}; + +/** + * displayLEDs(override) + * + * @this {PanelPDP11} + * @param {boolean|number|null} [override] (true turn on all LEDs, false to turn off all LEDs, null or undefined for normal LED activity) + */ +PanelPDP11.prototype.displayLEDs = function(override) +{ + for (var sBinding in this.leds) { + this.displayLED(sBinding, override != null? override : this.leds[sBinding]); + } +}; + +/** + * displaySwitch(sBinding, value) + * + * @this {PanelPDP11} + * @param {string} sBinding + * @param {boolean|number} value (true if the switch should be "up" (on), false if "down" (off)) + */ +PanelPDP11.prototype.displaySwitch = function(sBinding, value) +{ + var control = this.bindings[sBinding]; + if (control) { + control.style.marginTop = (value? "0px" : "20px"); + control.style.backgroundColor = (value? "#00ff00" : "#228B22"); + } +}; + +/** + * displaySwitches() + * + * @this {PanelPDP11} + */ +PanelPDP11.prototype.displaySwitches = function() +{ + for (var sBinding in this.switches) { + this.displaySwitch(sBinding, this.switches[sBinding][0]); + } +}; + +/** + * displayValue(sLabel, nValue, cch) * * This is principally for displaying register values, but in reality, it can be used to display any * numeric value bound to the given label. @@ -330,7 +399,7 @@ PanelPDP11.prototype.powerDown = function(fSave, fShutdown) * @param {number} nValue * @param {number} [cch] */ -PanelPDP11.prototype.updateValue = function(sLabel, nValue, cch) +PanelPDP11.prototype.displayValue = function(sLabel, nValue, cch) { if (this.bindings[sLabel]) { if (nValue === undefined) { @@ -354,69 +423,6 @@ PanelPDP11.prototype.updateValue = function(sLabel, nValue, cch) } }; -/** - * setLED(sBinding, value) - * - * @this {PanelPDP11} - * @param {string} sBinding - * @param {boolean|number} value (true if the LED should be on, false if off) - */ -PanelPDP11.prototype.setLED = function(sBinding, value) -{ - var control = this.bindings[sBinding]; - if (control) { - /* - * TODO: Add support for user-definable LED colors? - */ - control.style.backgroundColor = (value? "#ff0000" : "#000000"); - } -}; - -/** - * updateLEDs(override) - * - * @this {PanelPDP11} - * @param {boolean|number|null} [override] (true turn on all LEDs, false to turn off all LEDs, null or undefined for normal LED activity) - */ -PanelPDP11.prototype.updateLEDs = function(override) -{ - for (var sBinding in this.leds) { - this.setLED(sBinding, override != null? override : this.leds[sBinding]); - } -}; - -/** - * updateLEDArray(sPrefix, data, nLEDs) - * - * @this {PanelPDP11} - * @param {string} sPrefix - * @param {number} data - * @param {number} nLEDs - */ -PanelPDP11.prototype.updateLEDArray = function(sPrefix, data, nLEDs) -{ - for (var i = 0; i < nLEDs; i++) { - var sBinding = sPrefix + i; - this.setLED(sBinding, data & (1 << i)); - } -}; - -/** - * setSwitch(sBinding, value) - * - * @this {PanelPDP11} - * @param {string} sBinding - * @param {boolean|number} value (true if the switch should be "up" (on), false if "down" (off)) - */ -PanelPDP11.prototype.setSwitch = function(sBinding, value) -{ - var control = this.bindings[sBinding]; - if (control) { - control.style.marginTop = (value? "0px" : "20px"); - control.style.backgroundColor = (value? "#00ff00" : "#228B22"); - } -}; - /** * pressSwitch(sBinding) * @@ -426,9 +432,22 @@ PanelPDP11.prototype.setSwitch = function(sBinding, value) PanelPDP11.prototype.pressSwitch = function(sBinding) { var sw = this.switches[sBinding]; - this.setSwitch(sBinding, sw[0] = 1 - sw[0]); + + /* + * Set the new switch value in sw[0] and then immediately display it + */ + this.displaySwitch(sBinding, (sw[0] = 1 - sw[0])); + + /* + * Mark the switch as "pressed" + */ sw[2] = true; + + /* + * Call the appropriate process handler with the current switch value (sw[0]) + */ if (sw[3]) sw[3].call(this, sw[0], sw[4]); + this.fDeposit = (sBinding == PanelPDP11.SWITCH.DEP); this.fExamine = (sBinding == PanelPDP11.SWITCH.EXAM); }; @@ -448,13 +467,23 @@ PanelPDP11.prototype.releaseSwitch = function(sBinding) * we receive EITHER of those events AND the switch is marked momentary (sw[1]) AND the switch is pressed (sw[2]), * then we must flip the switch back to its original value. * - * Otherwise, the only thing we have to do is mark the switch as no longer "pressed" (ie, set sw[2] to false). + * Otherwise, the only thing we have to do is mark the switch as "released" (ie, set sw[2] to false). */ var sw = this.switches[sBinding]; if (sw[1] && sw[2]) { - this.setSwitch(sBinding, sw[0] = 1 - sw[0]); + /* + * Set the new switch value in sw[0] and then immediately display it + */ + this.displaySwitch(sBinding, (sw[0] = 1 - sw[0])); + + /* + * Call the appropriate process handler with the current switch value (sw[0]) + */ if (sw[3]) sw[3].call(this, sw[0], sw[4]); } + /* + * Mark the switch as "released" + */ sw[2] = false; }; @@ -499,6 +528,10 @@ PanelPDP11.prototype.processStart = function(value, index) */ PanelPDP11.prototype.processStep = function(value, index) { + /* + * There's really nothing for us to do here, because the normal press and release handlers + * already record the state of this switch, so it can be queried as needed, using getSwitch(). + */ }; /** @@ -532,20 +565,60 @@ PanelPDP11.prototype.processEnable = function(value, index) PanelPDP11.prototype.processContinue = function(value, index) { if (!value && !this.cpu.isRunning()) { + /* + * TODO: Technically, we're also supposed to check the 'STEP' switch to determine if we should + * step one instruction or just one cycle, but we don't currently have the ability to do the latter. + */ if (!this.getSwitch(PanelPDP11.SWITCH.ENABLE)) { /* - * TODO: Technically, we're also supposed to check the 'STEP' switch to determine if we should - * step one instruction or just one cycle, but we don't currently have the ability to do the latter. + * Using the Debugger's stepCPU() function is more convenient, and has the pleasant side-effect + * of updating the debugger's display; however, not all machines with a Front Panel will necessarily + * also have the Debugger loaded. */ var dbg = this.dbg; if (dbg && !dbg.isBusy(true)) { dbg.setBusy(true); dbg.stepCPU(0); dbg.setBusy(false); - } else { - this.cpu.stepCPU(1); - this.updateStatus(); } + else { + /* + * For this tiny single-instruction burst, mimic what runCPU() does. + */ + try { + var nCyclesStep = this.cpu.stepCPU(1); + if (nCyclesStep > 0) { + this.cpu.updateTimers(nCyclesStep); + this.cpu.addCycles(nCyclesStep, true); + this.cpu.updateChecksum(nCyclesStep); + } + } + catch(exception) { + /* + * We assume that any numeric exception was explicitly thrown by the CPU to interrupt the + * current instruction. For all other exceptions, we attempt a stack dump. + */ + if (typeof exception != "number") { + var e = exception; + this.cpu.setError(e.stack || e.message); + } + } + } + + /* + * Simulate a call to our stop() handler, to update the panel's ADDRESS register with the new PC. + */ + this.stop(); + + /* + * Going through the normal channels (ie, the Computer's updateStatus() interface) ensures that ALL + * updateStatus() handlers will be called, including ours. + * + * NOTE: If we used the Debugger's stepCPU() function, then that includes a call to updateStatus(); + * unfortunately, it will have happened BEFORE we called stop() to update the ADDRESS register, so we + * still need to call it again. + */ + if (this.cmp) this.cmp.updateStatus(); } else { this.cpu.startCPU(); @@ -610,7 +683,7 @@ PanelPDP11.prototype.processLoadAddr = function(value, index) */ PanelPDP11.prototype.processLampTest = function(value, index) { - this.updateLEDs(value || null); + this.displayLEDs(value || null); }; /** @@ -639,7 +712,7 @@ PanelPDP11.prototype.processSwitchReg = function(value, index) PanelPDP11.prototype.setAddr = function(value) { this.regAddr = value & this.bus.nBusMask; - this.updateLEDArray("A", this.regAddr, 22); + this.setLEDArray("A", this.regAddr, 22); return this.regAddr; }; @@ -653,13 +726,64 @@ PanelPDP11.prototype.setAddr = function(value) PanelPDP11.prototype.setData = function(value) { this.regData = value & 0xffff; - this.updateLEDArray("D", this.regData, 16); + this.setLEDArray("D", this.regData, 16); return this.regData; }; +/** + * setLED(sBinding, value) + * + * @this {PanelPDP11} + * @param {string} sBinding + * @param {number} value + * @return {number} + */ +PanelPDP11.prototype.setLED = function(sBinding, value) +{ + this.leds[sBinding] = value; + if (!this.fLampTest) this.displayLED(sBinding, value); + return value; +}; + +/** + * setLEDArray(sPrefix, data, nLEDs) + * + * @this {PanelPDP11} + * @param {string} sPrefix + * @param {number} data + * @param {number} nLEDs + */ +PanelPDP11.prototype.setLEDArray = function(sPrefix, data, nLEDs) +{ + for (var i = 0; i < nLEDs; i++) { + var sBinding = sPrefix + i; + this.setLED(sBinding, data & (1 << i)); + } +}; + +/** + * stop(ms, nCycles) + * + * This is a notification handler, called by the Computer, to inform us the CPU has now stopped. + * + * @this {PanelPDP11} + * @param {number} [ms] + * @param {number} [nCycles] + */ +PanelPDP11.prototype.stop = function(ms, nCycles) +{ + this.setAddr(this.cpu.regsGen[7]); + /* + * TODO: Consider an option to call setData() with the current opcode as well; presumably that wouldn't be + * normal Front Panel behavior, but it could be useful for debugging. + */ +}; + /** * updateStatus(fForce) * + * Called by the Computer component at appropriate intervals to update any register displays, LEDs, etc. + * * @this {PanelPDP11} * @param {boolean} [fForce] (true will display registers even if the CPU is running and "live" registers are not enabled) */ @@ -668,39 +792,27 @@ PanelPDP11.prototype.updateStatus = function(fForce) if (this.cLiveRegs) { if (fForce || !this.cpu.isRunning() || this.fDisplayLiveRegs) { for (var i = 0; i < this.cpu.regsGen.length; i++) { - this.updateValue('R'+i, this.cpu.regsGen[i]); + this.displayValue('R'+i, this.cpu.regsGen[i]); } var regPSW = this.cpu.getPSW(); - this.updateValue("PS", regPSW); - this.updateValue("NF", (regPSW & PDP11.PSW.NF)? 1 : 0, 1); - this.updateValue("ZF", (regPSW & PDP11.PSW.ZF)? 1 : 0, 1); - this.updateValue("VF", (regPSW & PDP11.PSW.VF)? 1 : 0, 1); - this.updateValue("CF", (regPSW & PDP11.PSW.CF)? 1 : 0, 1); - if (!this.fLampTest) { - this.setData(this.cpu.regsGen[0]); - this.setAddr(this.cpu.regsGen[7]); - /* - * Set bit to 1 (22-bit), 2 (18-bit), or 4 (16-bit) - */ - var bit = this.cpu.mmuEnable? ((this.cpu.regMMR3 & PDP11.MMR3.MMU_22BIT)? 1 : 2) : 4; - // this.misc = (this.misc & ~7) | bit; - } + this.displayValue("PS", regPSW); + this.displayValue("NF", (regPSW & PDP11.PSW.NF)? 1 : 0, 1); + this.displayValue("ZF", (regPSW & PDP11.PSW.ZF)? 1 : 0, 1); + this.displayValue("VF", (regPSW & PDP11.PSW.VF)? 1 : 0, 1); + this.displayValue("CF", (regPSW & PDP11.PSW.CF)? 1 : 0, 1); + this.setLEDArray("D", this.regData, 16); + this.setLEDArray("A", this.regAddr, 22); + /* + * Set bit to 1 (22-bit), 2 (18-bit), or 4 (16-bit) + */ + var bit = this.cpu.mmuEnable? ((this.cpu.regMMR3 & PDP11.MMR3.MMU_22BIT)? 1 : 2) : 4; + this.setLED(PanelPDP11.LED.B22, bit & 1); + this.setLED(PanelPDP11.LED.B18, bit & 2); + this.setLED(PanelPDP11.LED.B16, bit & 4); } } }; -/** - * updateSwitches() - * - * @this {PanelPDP11} - */ -PanelPDP11.prototype.updateSwitches = function() -{ - for (var sBinding in this.switches) { - this.setSwitch(sBinding, this.switches[sBinding][0]); - } -}; - /** * readCNSW(addr) * diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index cd5c9db5e..108924e4b 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -55,16 +55,16 @@ function RL11(parms) Component.call(this, "RL11", parms, RL11, MessagesPDP11.DISK); /* - * We record any 'autoMount' object now, but we no longer parse it until initBus(), because the - * Computer's getMachineParm() service may have an override for us. + * We record any 'autoMount' object now, but we no longer parse it until initBus(), + * because the Computer's getMachineParm() service may have an override for us. */ this.configMount = parms['autoMount'] || null; this.cAutoMount = 0; /* - * TODO: Make this configurable + * The RL11 has two Drive Select bits, representing up to four drives. */ - this.nDrives = 1; + this.nDrives = 4; this.aDrives = new Array(this.nDrives); this.fLocalDisks = (!web.isMobile() && window && 'FileReader' in window); @@ -282,7 +282,7 @@ RL11.prototype.initBus = function(cmp, bus, cpu, dbg) this.triggerInterrupt = this.cpu.addTrigger(PDP11.RL11.VEC, PDP11.RL11.PRI); - bus.addIOTable(this, RL11.UNIBUS_IOTABLE); + bus.addIOTable(this, RL11.UNIBUS_IOTABLE, MessagesPDP11.DISK); this.addDisk("None", RL11.SOURCE.NONE, true); if (this.fLocalDisks) this.addDisk("Local Disk", RL11.SOURCE.LOCAL); diff --git a/modules/shared/templates/components.css b/modules/shared/templates/components.css index 21f04854f..440d2b8b7 100644 --- a/modules/shared/templates/components.css +++ b/modules/shared/templates/components.css @@ -129,9 +129,14 @@ color: #ffffff; background-color: #404040; } -.pcjs-tripled { +.pcjs-triplet { padding: 1px; } +.pcjs-ledlbl { + text-align: center; + font-size: 40%; + background-color: #000000; +} .pcjs-ledlbl0 { text-align: right; font-size: 50%; @@ -147,6 +152,8 @@ font-size: x-small; line-height: 32px; background-color: #000000; + border-bottom-left-radius: 20%; + border-bottom-right-radius: 20%; } .pcjs-led { float: left; @@ -173,8 +180,10 @@ .pcjs-swlbl { text-align: center; font-size: 40%; - line-height: 32px; + line-height: 16px; background-color: #000000; + border-top-left-radius: 20%; + border-top-right-radius: 20%; } .pcjs-swpad { height: 32px; diff --git a/versions/pc8080/1.30.2/components.css b/versions/pc8080/1.30.2/components.css index 11db5cd24..b40fd1375 100644 --- a/versions/pc8080/1.30.2/components.css +++ b/versions/pc8080/1.30.2/components.css @@ -124,9 +124,14 @@ color: #ffffff; background-color: #404040; } -.pcjs-tripled { +.pcjs-triplet { padding: 1px; } +.pcjs-ledlbl { + text-align: center; + font-size: 40%; + background-color: #000000; +} .pcjs-ledlbl0 { text-align: right; font-size: 50%; @@ -142,6 +147,8 @@ font-size: x-small; line-height: 32px; background-color: #000000; + border-bottom-left-radius: 20%; + border-bottom-right-radius: 20%; } .pcjs-led { float: left; @@ -168,8 +175,10 @@ .pcjs-swlbl { text-align: center; font-size: 40%; - line-height: 32px; + line-height: 16px; background-color: #000000; + border-top-left-radius: 20%; + border-top-right-radius: 20%; } .pcjs-swpad { height: 32px; diff --git a/versions/pcx86/1.30.2/components.css b/versions/pcx86/1.30.2/components.css index 11db5cd24..b40fd1375 100644 --- a/versions/pcx86/1.30.2/components.css +++ b/versions/pcx86/1.30.2/components.css @@ -124,9 +124,14 @@ color: #ffffff; background-color: #404040; } -.pcjs-tripled { +.pcjs-triplet { padding: 1px; } +.pcjs-ledlbl { + text-align: center; + font-size: 40%; + background-color: #000000; +} .pcjs-ledlbl0 { text-align: right; font-size: 50%; @@ -142,6 +147,8 @@ font-size: x-small; line-height: 32px; background-color: #000000; + border-bottom-left-radius: 20%; + border-bottom-right-radius: 20%; } .pcjs-led { float: left; @@ -168,8 +175,10 @@ .pcjs-swlbl { text-align: center; font-size: 40%; - line-height: 32px; + line-height: 16px; background-color: #000000; + border-top-left-radius: 20%; + border-top-right-radius: 20%; } .pcjs-swpad { height: 32px; diff --git a/versions/pdpjs/1.30.2/components.css b/versions/pdpjs/1.30.2/components.css index 11db5cd24..b40fd1375 100644 --- a/versions/pdpjs/1.30.2/components.css +++ b/versions/pdpjs/1.30.2/components.css @@ -124,9 +124,14 @@ color: #ffffff; background-color: #404040; } -.pcjs-tripled { +.pcjs-triplet { padding: 1px; } +.pcjs-ledlbl { + text-align: center; + font-size: 40%; + background-color: #000000; +} .pcjs-ledlbl0 { text-align: right; font-size: 50%; @@ -142,6 +147,8 @@ font-size: x-small; line-height: 32px; background-color: #000000; + border-bottom-left-radius: 20%; + border-bottom-right-radius: 20%; } .pcjs-led { float: left; @@ -168,8 +175,10 @@ .pcjs-swlbl { text-align: center; font-size: 40%; - line-height: 32px; + line-height: 16px; background-color: #000000; + border-top-left-radius: 20%; + border-top-right-radius: 20%; } .pcjs-swpad { height: 32px; diff --git a/versions/pdpjs/1.30.2/pdp11-dbg.js b/versions/pdpjs/1.30.2/pdp11-dbg.js index ce64b8d1a..2b68aaadb 100644 --- a/versions/pdpjs/1.30.2/pdp11-dbg.js +++ b/versions/pdpjs/1.30.2/pdp11-dbg.js @@ -31,287 +31,287 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var 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>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=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":">",'"':""","'":"'"};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 Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function 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 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,ia:null,Ja:null,Ia:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Ja=g.load;d.Ia=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ia=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;cb?this.fb=this.id:(this.Na=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.A={ready:!1,Va:!1,Wb:!1,ja:!1,error:!1};this.Pb=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,db=/\+/g,kb=/([^&=]+)=?([^&]*)/g;cb=kb.exec(ab);)bb[decodeURIComponent(cb[1].replace(db," "))]=decodeURIComponent(cb[2].replace(db," "))}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 u(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.oc=b.comment;this.Rc=b;b=this.id.indexOf(".");0>b?this.ib=this.id:(this.Pa=this.id.substr(0,b),this.ib=this.id.substr(b+1));this[a]=c;this.B={ready:!1,Xa:!1,Zb:!1,ja:!1,error:!1};this.Rb=null;this.B.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} 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;ba;a++)this.f["S"+a]=[0,!1,!1,this.bd,a]}z(yb);k=yb.prototype;k.reset=function(){this.L=this.L&-120|20}; -k.sa=function(a,b,c,d){if(this.C&&this.C.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.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.I[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c= -a.f[b];zb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.J="DEP"==b;a.K="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.f[b];c[1]&&c[2]&&(zb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.sa.call(this,a,b,c,d)}};k.Da=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d;Ab(b,this,Bb);Cb(b,this.reset.bind(this));Db(this);for(var e in this.f)zb(this,e,this.f[e][0])};k.Fa=function(a,b){b||Eb();return!0};k.Ea=function(){return!0}; -function Fb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ha()),c=8==(a.i&&a.i.$||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}function Gb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Db(a,b){for(var c in a.I)Gb(a,c,null!=b?b:a.I[c])}function zb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -k.$c=function(a){a||this.b.A.ca||(this.w.reset(),Ub(this.b),this.f.ENABLE&&this.f.ENABLE[0]&&this.b.bb())};k.ad=function(){};k.Wc=function(a){a||this.b.ha()};k.Uc=function(a){a||this.b.A.ca||(this.f.ENABLE&&this.f.ENABLE[0]?this.b.bb():(a=this.i)&&!sb(a,!0)?(rb(a,!0),a.cb(0),rb(a,!1)):(this.b.cb(1),this.Z()))};k.Vc=function(a){a&&!this.b.A.ca&&(this.J&&Vb(this,this.g+2),this.w.Ib(this.g,Wb(this,this.v)))};k.Xc=function(a){a||this.b.A.ca||(this.K&&Vb(this,this.g+2),Wb(this,this.w.lb(this.g)))}; -k.Zc=function(a){a||this.b.A.ca||Vb(this,this.v)};k.Yc=function(a){Db(this,a||null)};k.bd=function(a,b){this.v=a?this.v|1<c;c++)Gb(a,"A"+c,b&1<c;c++)Gb(a,"D"+c,b&1<>2;this.w=this.ya-1;this.B=this.I/this.ya|0;this.Ua=[];this.f=0;this.g=!1;this.v=[];this.Gc=[ac,bc,cc,dc];a=new I(this);ec(a,this.i);this.X=Array(this.B);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ua[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 bc(a,b,c){var d=!1,e=this.controller,f=e.Ua[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.Ua[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 cc(a,b){var c=-1,d=this.controller;(a=d.Ua[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 dc(a,b,c){var d=!1,e=this.controller;if(a=e.Ua[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 gc(a,b){if(b!=a.C){var c;a.C&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Kb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Kb){n=l.size-(f-m);n>g&&(n=g);l.Kb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return lc(1,f,g)}f=new I(a,f,n,a.ya,d,e);ec(f,a.i,l);a.X[h++]=f;f=m+a.ya;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.ka;0>>=a.ka;0>>this.ka].Rb(a&this.w,a)};k.Qb=function(a){this.g=!1;this.f++;a=this.X[(a&this.Ra)>>>this.ka].bc(a&this.w,a);this.f--;return a}; -k.oa=function(a){3932160<=a&&(a=nc(this.b,a));return this.X[(a&this.Ra)>>>this.ka].ra(a&this.w,a)};k.lb=function(a){var b=a&this.w,c=(a&this.Ra)>>>this.ka;this.g=!1;this.f++;a=this.X[c].cc(b,a);this.f--;return a};k.Sb=function(a,b){3932160<=a&&(a=nc(this.b,a));this.X[(a&this.Ra)>>>this.ka].Ub(a&this.w,b&255,a)};k.nb=function(a,b){this.g=!1;this.f++;this.X[(a&this.Ra)>>>this.ka].Vb(a&this.w,b&255,a);this.f--}; -k.ab=function(a,b){3932160<=a&&(a=nc(this.b,a));this.X[(a&this.Ra)>>>this.ka].Lb(a&this.w,b&65535,a)};k.Ib=function(a,b){var c=a&this.w,d=(a&this.Ra)>>>this.ka;this.g=!1;this.f++;this.X[d].gc(c,b&65535,a);this.f--};function oc(a){for(var b=0,c=[],d=0;da.b.rb)){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>5&3;b.hb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.da!=c&&(b.da=c,wc(b));b.I&&b.I.Z()}};k.od=function(){var a=this.b.Ya;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.pd=function(){return this.b.Hb};k.qd=function(){return this.b.xb};k.he=function(a){var b=this.b;1170>b.rb&&(a&=-49);b.xb!=a&&(b.xb=a,b.qc=a&16?4194303:262143,wc(b),b.I&&b.I.Z())};k.Qd=function(a){a=a>>1&63;var b=this.b.Jb[a>>1];return a&1?b>>16:b&65535}; -k.He=function(a,b){b=b>>1&63;var c=b>>1;this.b.Jb[c]=b&1?this.b.Jb[c]&65535|(a&63)<<16:this.b.Jb[c]&-65536|a&65534};k.Jd=function(a){return this.b.V[1][a>>1&7]};k.Ae=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Hd=function(a){return this.b.V[1][(a>>1&7)+8]};k.ye=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Id=function(a){return this.b.xa[1][a>>1&7]};k.ze=function(a,b){b=b>>1&7;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.Gd=function(a){return this.b.xa[1][(a>>1&7)+8]}; -k.xe=function(a,b){b=(b>>1&7)+8;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.kd=function(a){return this.b.V[0][a>>1&7]};k.de=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.hd=function(a){return this.b.V[0][(a>>1&7)+8]};k.be=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.jd=function(a){return this.b.xa[0][a>>1&7]};k.ce=function(a,b){b=b>>1&7;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};k.gd=function(a){return this.b.xa[0][(a>>1&7)+8]};k.ae=function(a,b){b=(b>>1&7)+8;this.b.xa[0][b]=a;this.b.V[0][b]&=65295}; -k.Pd=function(a){return this.b.V[3][a>>1&7]};k.Ge=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Nd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ee=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Od=function(a){return this.b.xa[3][a>>1&7]};k.Fe=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Md=function(a){return this.b.xa[3][(a>>1&7)+8]};k.De=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.vb=function(a){a&=7;return this.b.M&2048?this.b.Sa[a]:this.b.u[a]}; -k.yb=function(a,b){b&=7;this.b.M&2048?this.b.Sa[b]=a:this.b.u[b]=a};k.vd=function(){return this.b.M&49152?this.b.Ga[0]:this.b.u[6]};k.me=function(a){this.b.M&49152?this.b.Ga[0]=a:this.b.u[6]=a};k.yd=function(){return this.b.u[7]};k.pe=function(a){this.b.u[7]=a};k.wb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Sa[a]};k.zb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Sa[b]=a};k.wd=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ga[1]}; -k.ne=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ga[1]=a};k.xd=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Ga[3]};k.oe=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Ga[3]=a};k.ed=function(a){return this.b.zc[a-65504>>1]};k.Zd=function(a,b){this.b.zc[b-65504>>1]=a};k.wc=function(a){return 65520==a?61183:0};k.Dc=function(){};k.Ld=function(){return 1};k.Ce=function(){};k.dd=function(){return this.b.ga};k.Yd=function(){this.b.ga=0};k.md=function(){return this.b.yc}; -k.fe=function(a,b){b&1||(a&=255);this.b.yc=a};k.rd=function(a){return a?this.b.ec:0};k.ie=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.Kd=function(a){return a?this.b.Za&65280:0};k.Be=function(a){this.b.Za=a|255};k.ud=function(){return Xb(this.b)};k.le=function(a){xc(this.b,a&-1809|Xb(this.b)&1808);this.b.H|=128};k.Cc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; -var N={},M=(N[61568]=[null,null,L.prototype.Qd,L.prototype.He,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Jd,L.prototype.Ae,"SISDR",8,1145],N[62608]=[null,null,L.prototype.Hd,L.prototype.ye,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.Id,L.prototype.ze,"SISAR",8,1145],N[62640]=[null,null,L.prototype.Gd,L.prototype.xe,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.kd,L.prototype.de,"KISDR",8,1145],N[62672]=[null,null,L.prototype.hd,L.prototype.be,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.jd, -L.prototype.ce,"KISAR",8,1145],N[62704]=[null,null,L.prototype.gd,L.prototype.ae,"KDSAR",8,1145],N[62798]=[null,null,L.prototype.qd,L.prototype.he,"MMR3",1,1145],N[65382]=[null,null,L.prototype.ld,L.prototype.ee,"LKS"],N[65402]=[null,null,L.prototype.nd,L.prototype.ge,"MMR0",1,1145],N[65404]=[null,null,L.prototype.od,L.prototype.Cc,"MMR1",1,1145],N[65406]=[null,null,L.prototype.pd,L.prototype.Cc,"MMR2",1,1145],N[65408]=[null,null,L.prototype.Pd,L.prototype.Ge,"UISDR",8,1145],N[65424]=[null,null,L.prototype.Nd, -L.prototype.Ee,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.Od,L.prototype.Fe,"UISAR",8,1145],N[65456]=[null,null,L.prototype.Md,L.prototype.De,"UDSAR",8,1145],N[65472]=[null,null,L.prototype.vb,L.prototype.yb,"R0SET0"],N[65473]=[null,null,L.prototype.vb,L.prototype.yb,"R1SET0"],N[65474]=[null,null,L.prototype.vb,L.prototype.yb,"R2SET0"],N[65475]=[null,null,L.prototype.vb,L.prototype.yb,"R3SET0"],N[65476]=[null,null,L.prototype.vb,L.prototype.yb,"R4SET0"],N[65477]=[null,null,L.prototype.vb,L.prototype.yb, -"R5SET0"],N[65478]=[null,null,L.prototype.vd,L.prototype.me,"R6KERNEL"],N[65479]=[null,null,L.prototype.yd,L.prototype.pe,"R7KERNEL"],N[65480]=[null,null,L.prototype.wb,L.prototype.zb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.wb,L.prototype.zb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.wb,L.prototype.zb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.wb,L.prototype.zb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.wb,L.prototype.zb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.wb, -L.prototype.zb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.wd,L.prototype.ne,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.xd,L.prototype.oe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.ed,L.prototype.Zd,"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.Ld,L.prototype.Ce,"SYSID",1,1170],N[65526]=[null,null,L.prototype.dd,L.prototype.Yd,"CPUERR",1,1170],N[65528]= -[null,null,L.prototype.md,L.prototype.fe,"MB",1,1170],N[65530]=[null,null,L.prototype.rd,L.prototype.ie,"PIR"],N[65532]=[null,null,L.prototype.Kd,L.prototype.Be,"SL"],N[65534]=[null,null,L.prototype.ud,L.prototype.le,"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]; -Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),Oc(this,Kc?Pc:Qc);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da: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> -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<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Pa=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;Vc(c,this.F+a,1,c.L)&&c.ha(!0)}return this.bc(a,b)},Na:function(a,b){if(this.i&&null!=this.F){var c=this.i;Vc(c,this.F+a,2,c.L)&&c.ha(!0)}return this.cc(a, -b)},ma:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;Vc(d,this.F+a,1,d.B)&&d.ha(!0)}this.f?this.v(a,b,c):this.Vb(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;Vc(d,this.F+a,2,d.B)&&d.ha(!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},W:function(a,b){a&1&&K(this.w,b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&K(this.w, -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},ta: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)},wa:function(a,b,c){a&1&&K(this.w,c,64,4);this.D.setUint16(a,b,!0);this.Pa=!0},fb: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)+","+ -J(this.i,b)+")",!0)}};function ec(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&Uc(a,Tc,!1),(a.C=c.C)&&Sc(a,Tc,!1))}function Wc(a,b){b?--a.C||(a.Ub=a.f?a.v:a.Vb,a.Lb=a.f?a.I:a.gc):--a.g||(a.Rb=a.bc,a.ra=a.cc)}function Sc(a,b,c){c&&a.C||(a.Ub=!a.f&&b[1]||a.v,a.Lb=!a.f&&b[3]||a.I);if(c||void 0===c)a.Vb=b[1]||a.v,a.gc=b[3]||a.I}function Uc(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 Oc(a,b){b||(b=Xc);Uc(a,b,void 0);Sc(a,b,void 0)} -var Xc=[],Rc=[I.prototype.S,I.prototype.va,I.prototype.da,I.prototype.Ha],Tc=[I.prototype.O,I.prototype.ma,I.prototype.Na,I.prototype.Aa];if(wb)var Qc=[I.prototype.N,I.prototype.la,I.prototype.W,I.prototype.wa],Pc=[I.prototype.R,I.prototype.ta,I.prototype.$,I.prototype.fb]; -function Yc(a,b){u.call(this,"CPU",a,Yc,1);var c=a.multiplier||1;this.ib=a.cycles||b;this.Xa=c;this.Bb=Math.round(this.ib/1E4)/100;this.mb=this.Bb*this.Xa;this.A.ca=!1;this.A.Tb=!1;this.A.pb=a.autoStart;this.A.qb=!1;this.Eb=this.va=0;this.Fb=a.csStart;this.sb=a.csInterval;this.tb=a.csStop;this.L=[];this.uc=this.Ud.bind(this);H(this)}z(Yc);var Zc=["power","reset"];k=Yc.prototype; -k.Da=function(a,b,c,d){this.C=a;this.w=b;this.i=d;this.I=a.I;for(b=0;b=a.va&&(a.va+=a.sb,c=!0);0<=a.tb&&a.tb<=ed(a)&&(a.sb=a.tb=-1,bd(a),a.ha(),c=!0);c&&a.j(ed(a)+" cycles: checksum="+p(a.Eb))}} -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.C)if(a=d.C,a.A.ja)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.$/a.mb?b=1:d=!0;a.Xa=b;b=a.Bb*a.Xa;if(a.mb!=b){a.mb=b;b=a.mb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.ob()}gd(a,a.W);a.W=0;a.S=Ba();a.la=0;hd(a);return d}function sc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function uc(a,b,c){0<=b&&ba.L[b][0]&&(c=a.ib*a.Xa/1E3*c|0,a.L[b][0]=c+id(a))} -function jd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function kd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function id(a,b){var c=a.ma-=a.b;a.b=a.K=0;b&&(a.ma=0);return c} -k.Ud=function(){if(this.A.ca){this.Cb>=this.ib&&hd(this,!0);this.Ha=0;this.eb=Ba();if(this.la){var a=this.eb-this.la;a>this.rc&&(this.S+=a,this.S>this.eb&&(this.S=this.eb))}try{do{var b=jd(this,this.A.qb?1:this.kb);try{this.cb(b)}catch(e){if("number"!=typeof e)throw e;}b=id(this,!0);this.Ha+=b;this.W+=b;dd(this,b);kd(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.kb;15<=++this.tc&&(this.C&&this.C.Z(),this.tc=0);break}}while(this.A.ca)}catch(e){this.ha();this.C&&this.C.stop(Ba(),ed(this));vb(this, -e.stack||e.message);return}if(this.A.ca){a=setTimeout;b=this.uc;this.la=Ba();var c=this.rc;this.Ha&&(c=Math.round(c*this.Ha/this.kb));var c=c-(this.la-this.eb),d=this.la-this.S;d&&(this.$=Math.round(this.W/(10*d))/100,864E5<=d&&(this.ta=0,fd(this)));if(0>c||this.$c&&(this.S-=c),c=0;this.Cb+=this.Ha;this.la+=c;a(b,c)}}}; -k.bb=function(a){if(ub(this))return!1;if(this.A.ca)return this.j(this.toString()+" busy"),!1;fd(this);this.A.ca=!0;this.A.Tb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.ob(!0),this.C.start(this.S,ed(this)));setTimeout(this.uc,0);return!0};k.cb=function(){return 0};k.ha=function(a){var b=!1;if(this.A.ca){id(this);gd(this,this.W);this.W=0;this.A.ca=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Ba(),ed(this));b=!0}this.A.complete=a;return b}; -function ld(a){this.rb=+a.model||1170;this.Ob=a.addrReset||0;Yc.call(this,a,6666667);this.decode=1120==this.rb?md.bind(this):nd.bind(this);od(this);this.N=0;this.O=null;this.A.complete=!1}z(ld,Yc);k=ld.prototype;k.reset=function(){this.status("model "+this.rb);this.A.ca&&this.ha();od(this);ad(this);this.A.error=!1;this.parent.reset.call(this)}; -function od(a){a.T=65536;a.U=32768;a.aa=65535;a.Y=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Ob];a.Sa=[0,0,0,0,0,0];a.Ga=[0,0,0,0];a.v=0;a.hb=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.xa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Jb=[0,0,0,0,0,0,0,0,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.D=a.J=0;a.g=a.f=a.Ab=0;a.Aa=-1;Ub(a)}function Ub(a){a.Za=255;a.ga=0;a.ec=0;a.B=0;a.Ya=0;a.Hb=0;a.xb=0;a.da=0;a.gb=0;a.qc=262143;a.O=null;a.w&&wc(a)}function wc(a){a.da?(a.R=65536,a.ba=a.Oc,a.ra=a.Rd,a.Lb=a.Ie,gc(a.w,a.xb&16?22:18)):(a.R=0,a.ba=a.Nc,a.ra=a.xc,a.Lb=a.Ec,gc(a.w,16))}function pd(a,b,c){a.Ob=b;P(a,b);!c&&a.i&&(a.ha()||a.i.Z())}k.nc=function(){return 0}; -k.save=function(){var a=new R(this);a.set(0,[]);a.set(1,[this.ta,this.Xa]);a.set(2,oc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ta=b[1];fd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.v!=c&&(a.Ga[c]=a.u[6],a.u[6]=a.Ga[a.v]);a.M=b;a.H|=2}function S(a,b){a.H&128||(a.Y=a.aa=b,a.U=0)}function vd(a,b,c){a.H&128||(a.Y=a.aa=a.T=b,a.U=c||0)}function wd(a,b,c,d){a.H&128||(a.Y=a.aa=a.T=b,a.U=(c^b)&(d^b))} -function xd(a,b){a.H&128||(a.Y=a.aa=a.T=b,a.U=a.Y^a.T>>1)}function yd(a,b,c,d){a.H&128||(a.Y=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.N){var c=!1;0>this.Aa?this.Aa=Xb(this):this.v||(a=4,c=!0);this.B&57344||(this.Ya=63222,this.Hb=a);this.v=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);xc(this,e&-12289|this.Aa>>2&12288);c&&(this.ga|=4,this.u[6]=4);zd(this,this.Aa);zd(this,this.u[7]);P(this,d);this.H&=-113;this.Aa=-1;this.H|=8;this.Tc=a;this.Sc=b;if(26!=b)throw a;}}; -function Ad(a){var b=Bd(a),c=Bd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);P(a,b);xc(a,c);a.H&=-17}function nc(a,b){var c=b>>13&31;31>c&&a.xb&32&&(b=a.Jb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Td(a,b,c){var d,e,f,g=0;d=b>>13;a.xb&a.Pc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.qc;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.gb=a.v,a.hb=d;b=!1;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.B&57344||(a.B=a.B|g|a.gb<<5|a.hb<<1),b=!0),a.B&61440||!(4191360> -f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.ra(e)| -g;a.b-=8;break;case 6:return e=a.ra(ud(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(ud(a,2)),e=e+a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.B&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.ga|=4,a.u[6]=4,a.pa(4,24)):(a.ga|=8,a.H|=64));return e}k.Qb=function(a){if(!this.da)return this.w.Qb(a);this.N++;a=Ud(this,Td(this,a,3));this.N--;return a}; -k.lb=function(a){if(!this.da)return this.w.lb(a);this.N++;a=this.xc(Td(this,a,2));this.N--;return a};k.nb=function(a,b){this.da?(this.N++,Vd(this,Td(this,a,5),b),this.N--):this.w.nb(a,b)};k.Ib=function(a,b){this.da?(this.N++,this.Ec(Td(this,a,4),b),this.N--):this.w.Ib(a,b)};k.Nc=function(a,b,c){return Wd(this,a,b,c)};k.Oc=function(a,b,c){return Td(this,Wd(this,a,b,c),c)};k.xc=function(a){return this.w.oa(a)};k.Rd=function(a){return this.w.oa(Td(this,a,2))};k.Ec=function(a,b){this.w.ab(a,b&65535)}; -k.Ie=function(a,b){this.w.ab(Td(this,a,4),b)};function Xd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Wd(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.v=a.M>>12&3,c=a.ra(d|c&a.R),a.v=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Ga[a.M>>12&3];return c}function Yd(a,b,c,d){a.B&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Wd(a,b,e,4),c&65536||(e&=65535),a.v=a.M>>12&3,e=Td(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.Ga[a.M>>12&3]=d} -function Zd(a,b){b>>=6;var c=a.J=b&7;return(b=a.D=(b&56)>>3)?Ud(a,a.ba(b,c,3)):a.u[c]&255}function $d(a,b){b>>=6;var c=a.J=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}function ae(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Wd(a,b,c,8)}function be(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ud(a,a.ba(b,c,3)):a.u[c]&255}function ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]} -function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Ab=a.ba(b,e,7),Vd(a,e,d.call(a,c,Ud(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.ba(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 de(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Vd(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 ee(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ab(a.ba(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.cb=function(a){this.A.complete=!0;var b=this.i&&fe(this.i)?1:this.A.Tb?-1:0,c=a?this.A.Tb?0:1:-1;this.A.Tb=!1;this.ma=this.b=a;do{if(b){if(this.i&&ge(this.i,this.u[7],c)){this.ha();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.ec&224)>>5,f=this.O&&this.O.ub>e?this.O:null;f&&(d=f.Wd,e=f.ub);e>(this.M&224)>>5?(this.H&4&&(ud(this,2),this.H&=-5),this.pa(d, -26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.O,f==a)this.O=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(td(this))}while(0>1|b<<16;xd(this,a);return a&65535}function me(a,b){a=b&2048|b>>1|b<<8;xd(this,a<<8);return a&255}function ne(a,b){a=b&~a;S(this,a);return a}function oe(a,b){a=b&~a;S(this,a<<8);return a}function pe(a,b){a|=b;S(this,a);return a}function qe(a,b){a|=b;S(this,a<<8);return a} -function re(a,b){a=~b|65536;vd(this,a);return a&65535}function se(a,b){a=~b|256;vd(this,a<<8);return a&255}function te(a,b){a=b-a;this.H&128||(this.Y=this.aa=a,this.U=b&(b^a));return a&65535}function ue(a,b){a=b-a;var c=a<<8;b<<=8;this.H&128||(this.Y=this.aa=c,this.U=b&(b^c));return a&255}function ve(a,b){a=b+a;this.H&128||(this.Y=this.aa=a,this.U=a&(b^a));return a&65535}function we(a,b){a=b+a;var c=a<<8;this.H&128||(this.Y=this.aa=c,this.U=c&(b<<8^c));return a&255} -function xe(a,b){a=-b;vd(this,a,a&b&32768);return a&65535}function ye(a,b){a=-b;vd(this,a<<8,(a&b&128)<<8);return a&255}function ze(a,b){a=b<<1|this.T>>16&1;xd(this,a);return a&65535}function Ae(a,b){a=b<<1|this.T>>16&1;xd(this,a<<8);return a&255}function Be(a,b){a=(this.T&65536|b)>>1|b<<16;xd(this,a);return a&65535}function Ce(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;xd(this,a<<8);return a&255}function De(a,b){var c=b-a;yd(this,c,a,b);return c&65535} -function Ee(a,b){var c=b-a;yd(this,c<<8,a<<8,b<<8);return c&255}function Fe(a,b){this.H&128||(this.Y=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ge(a,b){a^=b;S(this,a);return a&65535}function He(a){U(this,a,$d(this,a),he);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function Ie(a){var b=ce(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;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Y=this.aa=c;this.b-=(this.g?6:7)+b} -function Je(a){var b=ce(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-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.Y=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Ke(a){V(this,a,!qd(this))}function Le(a){V(this,a,qd(this))} -function Me(a){U(this,a,$d(this,a),ne);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ne(a){T(this,a,Zd(this,a),oe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Oe(a){U(this,a,$d(this,a),pe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Pe(a){T(this,a,Zd(this,a),qe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function Qe(a){S(this,$d(this,a)&ce(this,a));this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Re(a){S(this,(Zd(this,a)&be(this,a))<<8);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Se(a){V(this,a,sd(this))}function Te(a){V(this,a,!this.Qa()==!rd(this))}function Ue(a){V(this,a,!sd(this)&&!this.Qa()==!rd(this))}function Ve(a){V(this,a,!qd(this)&&!sd(this))}function We(a){V(this,a,sd(this)||!this.Qa()!=!rd(this))} -function Xe(a){V(this,a,qd(this)||sd(this))}function Ye(a){V(this,a,!this.Qa()!=!rd(this))}function Ze(a){V(this,a,this.Qa())}function $e(a){V(this,a,!sd(this))}function af(a){V(this,a,!this.Qa())}function bf(){this.pa(12,1);this.b-=5}function cf(a){V(this,a,!0)}function df(a){V(this,a,!rd(this))}function ef(a){V(this,a,rd(this))}function W(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Y=0);this.b-=5} -function ff(a){var b=$d(this,a);a=ce(this,a);yd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function gf(a){var b=Zd(this,a)<<8;a=be(this,a)<<8;yd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} -function hf(a){var b=ce(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.Y=d>>16):(this.U=32768,this.aa=d>>15|d,this.Y=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.Y=0,this.U=32768,this.T=65536,this.b-=7}function jf(){this.pa(24,2);this.b-=25} -function kf(){this.M&49152?(this.ga|=128,this.pa(4,3)):this.i?qc(this.i):this.ha();this.b-=7}function lf(){this.pa(16,4);this.b-=25}var mf=[0,7,7,10,7,11,9,13];function nf(a){this.K=this.b;P(this,ae(this,a));this.b=this.K-mf[this.g]}var of=[0,14,14,17,14,18,16,20];function pf(a){this.K=this.b;var b=ae(this,a);a=a>>6&7;zd(this,this.u[a]);this.u[a]=this.u[7];P(this,b);this.b=this.K-of[this.g]}var qf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function rf(a){var b=$d(this,a);this.K=this.b;S(this,ee(this,a,b));this.b=this.K-qf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function sf(a){var b=Zd(this,a);S(this,de(this,a,b,1)<<8);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var tf=[7,13,13,17,14,18,17,21]; -function uf(a){var b=ce(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.Y=b>>16,this.aa=this.Y|b,this.U=0,this.T=-32768>b||32767>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 Bf(a){U(this,a,$d(this,a),De);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} -function Cf(a){U(this,a,0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)}function Df(){this.pa(28,5);this.b-=5}function Ef(){this.H&4||this.C.Z();this.H|=4;ud(this,-2);this.b-=3}function Ff(a){U(this,a,$d(this,a),Ge);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=qc(b);b||this.pa(8,6)}function md(a){Gf[a>>12].call(this,a)}function Hf(a){If[a>>6&3].call(this,a)}function Jf(a){Kf[a>>6&3].call(this,a)} -function Lf(a){Mf[a>>6&3].call(this,a)}function Nf(a){Of[a&15].call(this,a)}function Pf(a){Qf[a&15].call(this,a)}function Rf(a){Sf[a>>6&3].call(this,a)}function Tf(a){Uf[a>>6&3].call(this,a)}function Vf(a){Wf[a>>6&3].call(this,a)} -var Gf=[function(a){Xf[a>>8&15].call(this,a)},rf,ff,Qe,Me,Oe,He,X,function(a){Yf[a>>8&15].call(this,a)},sf,gf,Re,Ne,Pe,Bf,X],Xf=[function(a){Zf[a>>4&15].call(this,a)},cf,$e,Se,Te,Ye,Ue,We,pf,pf,Hf,Jf,Lf,X,X,X],If=[function(a){vd(this,ee(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,1,te);this.b-=this.g?9:3+(7==this.f?2:0)}],Kf=[function(a){U(this,a,0, -xe);this.b-=this.g?11:6},function(a){U(this,a,qd(this)?1:0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,qd(this)?1:0,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ce(this,a);vd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Mf=[function(a){U(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){U(this,a,0,je);this.b-=this.g?9:3+(7==this.f?2:0)}], -Zf=[function(a){$f[a&15].call(this,a)},X,X,X,nf,nf,nf,nf,yf,X,Nf,Pf,Cf,Cf,Cf,Cf],$f=[kf,Ef,xf,bf,lf,wf,X,X,X,X,X,X,X,X,X,X],Of=[vf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},W,function(){this.aa=1;this.b-=5},W,W,W,function(){this.Y=0;this.b-=5},W,W,W,W,W,W,W],Qf=[vf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},zf,function(){this.aa=0;this.b-=5},zf,zf,zf,function(){this.Y=32768;this.b-=5},zf,zf,zf,zf,zf,zf,zf],Yf=[af,Ze,Ve,Xe,df,ef,Ke,Le,jf,Df,Rf,Tf,Vf,X, -X,X],Sf=[function(a){vd(this,de(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ue);this.b-=this.g?9:3+(7==this.f?2:0)}],Uf=[function(a){T(this,a,0,ye);this.b-=this.g?11:6},function(a){T(this,a,qd(this)?1:0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,qd(this)?1:0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=be(this,a);vd(this, -a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Wf=[function(a){T(this,a,0,Ce);this.b-=this.g?9+(this.Ab&1):3+(7==this.f?2:0)},function(a){T(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,me);this.b-=this.g?9+(this.Ab&1):3+(7==this.f?2:0)},function(a){T(this,a,0,ke);this.b-=this.g?9:3+(7==this.f?2:0)}];function nd(a){ag[a>>12].call(this,a)} -var ag=[function(a){bg[a>>8&15].call(this,a)},rf,ff,Qe,Me,Oe,He,function(a){cg[a>>8&15].call(this,a)},function(a){dg[a>>8&15].call(this,a)},sf,gf,Re,Ne,Pe,Bf,X],bg=[function(a){eg[a>>4&15].call(this,a)},cf,$e,Se,Te,Ye,Ue,We,pf,pf,Hf,Jf,Lf,function(a){fg[a>>6&3].call(this,a)},X,X],fg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);P(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Xd(this,a,0);zd(this,a);S(this,a);this.b-=11},function(a){var b=Bd(this);this.K= -this.b;Yd(this,a,0,b);S(this,b);this.b=this.K-tf[this.g]},function(a){S(this,ee(this,a,this.Qa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],eg=[function(a){gg[a&15].call(this,a)},X,X,X,nf,nf,nf,nf,yf,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)},Nf,Pf,Cf,Cf,Cf,Cf],gg=[kf,Ef,xf,bf,lf,wf,function(){Ad(this);this.b-=13},X,X,X,X,X,X,X,X,X],cg=[uf,uf,hf,hf,Ie,Ie,Je,Je,Ff,Ff,X,X,X,X,Af,Af],dg=[af,Ze,Ve,Xe,df,ef,Ke,Le,jf,Df,Rf,Tf,Vf,function(a){hg[a>> -6&3].call(this,a)},X,X],hg=[X,function(a){a=Xd(this,a,65536);zd(this,a);S(this,a);this.b-=11},function(a){var b=Bd(this);this.K=this.b;Yd(this,a,65536,b);S(this,b);this.b=this.K-tf[this.g]},X]; -function ig(a){u.call(this,"ROM",a,ig);this.ia=this.f=null;this.B=a.addr;this.g=a.size;this.v=a.alias;this.C=a.file;this.D=sa(this.C);if(this.C){a=this.C;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(nb(c.Na,a,b),(a=Fa(a,b))?(c.f=a.ea,c.ia=a.ia):c.C=null);jg(c)})}}z(ig);ig.prototype.Da=function(a,b,c,d){this.w=b;this.b=c;this.i=d;jg(this)}; -ig.prototype.Fa=function(){this.ia&&(this.i&&kg(this.i,this.id,this.B,this.g,this.ia),delete this.ia);return!0};ig.prototype.Ea=function(){return!0}; -function jg(a){if(!tb(a)){if(a.C){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.B;if(jc(a.w,b,a.g,Nc)){var c;for(c=0;c>>a.ka;0=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=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.nb(n++,b[r++]&255);else n&1?a.b.ha():pd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&tc(e.b,e.la))});this.ma=vc(52,4);this.$=sc(this.b,function(){e.g|=128;e.g&64&&tc(e.b,e.ma)});Ab(b,this,Jg);H(this)}; -k.sc=function(){if(!this.J){var a=$c(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.fb)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.Fa=function(a,b){if(!b)if(this.sc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ea=function(a){return a?this.save():!0};k.reset=function(){Kg(this)};k.save=function(){var a=new R(this);a.set(0,[]);return a.data()};k.restore=function(){return Kg(this)};function Kg(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.dc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.I%a,this.S&&(b=xa("",c)));this.O&&!this.I&&c&&(b=String.fromCharCode(this.O)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.I+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), -this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;uc(this.b,this.$,1E3/Math.round(this.R/10))}};var Lg={},Jg=(Lg[65392]=[null,null,Y.prototype.Ad,Y.prototype.re,"RCSR"],Lg[65394]=[null,null,Y.prototype.zd,Y.prototype.qe,"RBUF"],Lg[65396]=[null,null,Y.prototype.Td,Y.prototype.Ke,"XCSR"],Lg[65398]=[null,null,Y.prototype.Sd,Y.prototype.Je,"XBUF"],Lg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");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(){var a=d.G.listTapes;a&&Og(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){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;Og(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; -k.Da=function(a,b,c,d){this.C=a;this.w=b;this.b=c;this.i=d;this.S=Pg(a);var e=this;if((this.g=$c(this.C,"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.W=vc(56,4);this.da=sc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.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.C&&!a.C.A.ja;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Na,e,f),(e=Fa(e,f))&&Yg(a,b,c,d,e.ea,e.Ja, -e.Ia));a.A.Va=!1;a.D&&(a.D--,a.D||H(a));Vg(a)})}function Sg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;dc.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, -null,!0,function(b,c,d){eh(a,b,c,d)})} -function eh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.A.ja;if(d)a.controller.P('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{nb(a.controller.Na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.za=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ka=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f=a.Ma+a.Ba&&(a.Ba+=f-(a.Ma+a.Ba)+1):(a.Ma=f,a.Ba=1);d[f]=d[f]&~(255<g)break;e|=g<=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][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ta+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=gh(this,a++);)ih(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 ih(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=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&jh(d,a)},!0;case "loadDrive":return this.G[b]= -c,c.onclick=function(){var a=d.G.listDisks;a&&kh(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.Ca){var b;b="";for(var c=0,h;h=gh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";jh(this,0)}}return!0};k.Ea=function(a){return a?this.save():!0};k.reset=function(){lh(this)};k.save=function(){return(new R(this)).data()}; -k.restore=function(a){return lh(this,a[0])};function oh(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;gg||9e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('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+'"')}qh(a,e,b,c,!1,d)}else ph(a,e)} -function qh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.$a.toLowerCase()!=d.toLowerCase()&&(g++,ph(a,b,!0),h.Zb?a.P("RL11 busy"):(h.Zb=!0,e&&(h.Yb=!0,a.I++,F(a)&&E(a,"auto-loading disk: "+c)),h.Mb=!!f,dh(new $g(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.ua||f[1]>a.za)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.ac)),b=null);b?(a.Ca=b,a.Ta=c,a.$a=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.ac),a.Yb||e),this.C&&this.C.ob()):a.Mb=!1;a.Yb&&(a.Yb=!1,--this.I||H(this));jh(this,a.ac)}; -function nh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; -k.fd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ca.read(m,n++))||0>(t=a.Ca.read(m,n++))){h=5120;break}this.w.ab(f,r|t<<8);if(rc(this.w)){h=8192;break}f+=2;if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.za&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.$d=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var r=this.w.oa(f);if(rc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,r&255)||!a.Ca.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.za&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Dd=function(){return this.fa&65535}; -k.ue=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.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.fd;case 10:b||(b=this.$d),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ua||f>=c.qa?this.fa|=37888: -(g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Lc.bind(this)))}a&&(this.fa|=129,this.fa&64&&tc(this.b,this.O))}};k.Bd=function(){return this.J};k.se=function(a){this.J=a&65534};k.Ed=function(){return this.g};k.ve=function(a){this.g=a};k.Fd=function(){return this.D};k.we=function(a){this.D=a};k.Cd=function(){return this.K};k.te=function(a){this.K=a&63}; -var rh={},mh=(rh[63744]=[null,null,O.prototype.Dd,O.prototype.ue,"RLCS"],rh[63746]=[null,null,O.prototype.Bd,O.prototype.se,"RLBA"],rh[65284]=[null,null,O.prototype.Ed,O.prototype.ve,"RLDA"],rh[65286]=[null,null,O.prototype.Fd,O.prototype.we,"RLMP"],rh[65288]=[null,null,O.prototype.Cd,O.prototype.te,"RLBE"],rh);function sh(a){u.call(this,"Debugger",a,sh);this.$=a.base||16;this.wa=!1;this.J=0;this.O=!1;this.v=-1;this.g=[];this.S={}}z(sh); -var th={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};sh.prototype.oc=function(){return-1};sh.prototype.pc=function(){}; -function uh(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.O?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 vh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +var wb="undefined"!==typeof ArrayBuffer,xb={cpu:1,trap:16,fault:32,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.H=0;this.K=this.J=!1;this.g=this.C=this.w=0;this.L=20;this.D={};this.f={START:[1,!0,!1,this.ad],STEP:[1,!1,!1,this.bd],ENABLE:[1,!1,!1,this.Xc],CONT:[1,!0,!1,this.Vc],DEP:[0,!0,!1,this.Wc],EXAM:[1,!0,!1,this.Yc],LOAD:[1,!0,!1,this.$c],TEST:[0,!0,!1,this.Zc]};for(a=0;22>a;a++)this.f["S"+a]=[0,!1,!1,this.cd,a]}z(yb);k=yb.prototype;k.reset=function(){this.L=this.L&-120|20}; +k.sa=function(a,b,c,d){if(this.u&&this.u.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.H++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.D[b]=d?1:0,this.H++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c= +a.f[b];zb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.J="DEP"==b;a.K="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.f[b];c[1]&&c[2]&&(zb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.sa.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.u=a;this.A=b;this.b=c;this.i=d;Ab(b,this,Bb);Cb(b,this.reset.bind(this));Db(this);for(var e in this.f)zb(this,e,this.f[e][0])};k.Ga=function(a,b){b||(Eb(),this.stop());return!0}; +k.Fa=function(){return!0};function Fb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Db(a,b){for(var c in a.D)Fb(a,c,null!=b?b:a.D[c])}function zb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Tb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ha()),c=8==(a.i&&a.i.$||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} +k.ad=function(a){a||this.b.B.Z||(this.A.reset(),Ub(this.b),this.f.ENABLE&&this.f.ENABLE[0]&&this.b.fb())};k.bd=function(){};k.Xc=function(a){a||this.b.ha()};k.Vc=function(a){if(!a&&!this.b.B.Z)if(this.f.ENABLE&&this.f.ENABLE[0])this.b.fb();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.gb(0),rb(a,!1);else try{var b=this.b.gb(1);0>2;this.A=this.xa-1;this.C=this.H/this.xa|0;this.Wa=[];this.u=0;this.f=!1;this.w=[];this.Hc=[fc,gc,hc,ic];a=new I(this);jc(a,this.i);this.W=Array(this.C);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Wa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function gc(a,b,c){var d=!1,e=this.controller,f=e.Wa[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.Wa[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,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function hc(a,b){var c=-1,d=this.controller;(a=d.Wa[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,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function ic(a,b,c){var d=!1,e=this.controller;if(a=e.Wa[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,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function lc(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Lb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.F+n;f=m+a.xa;g-=n;h++;continue}}return qc(1,f,g)}f=new I(a,f,n,a.xa,d,e);jc(f,a.i,l);a.W[h++]=f;f=m+a.xa;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.ka;0>>=a.ka;0>>this.ka].Ub(a&this.A,a)};k.Tb=function(a){this.f=!1;this.u++;a=this.W[(a&this.Ta)>>>this.ka].ec(a&this.A,a);this.u--;return a}; +k.oa=function(a){3932160<=a&&(a=sc(this.b,a));return this.W[(a&this.Ta)>>>this.ka].ra(a&this.A,a)};k.mb=function(a){var b=a&this.A,c=(a&this.Ta)>>>this.ka;this.f=!1;this.u++;a=this.W[c].fc(b,a);this.u--;return a};k.Vb=function(a,b){3932160<=a&&(a=sc(this.b,a));this.W[(a&this.Ta)>>>this.ka].Xb(a&this.A,b&255,a)};k.pb=function(a,b){this.f=!1;this.u++;this.W[(a&this.Ta)>>>this.ka].Yb(a&this.A,b&255,a);this.u--}; +k.eb=function(a,b){3932160<=a&&(a=sc(this.b,a));this.W[(a&this.Ta)>>>this.ka].Mb(a&this.A,b&65535,a)};k.Jb=function(a,b){var c=a&this.A,d=(a&this.Ta)>>>this.ka;this.f=!1;this.u++;this.W[d].jc(c,b&65535,a);this.u--};function tc(a){for(var b=0,c=[],d=0;da.b.vb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null,r=g[5]||1;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=g[4],w=0;w>5&3;b.Ma=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Za!=c&&(b.Za=c,Jc(b))}};k.pd=function(){var a=this.b.ab;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.qd=function(){return this.b.Ib};k.rd=function(){return this.b.ob};k.ie=function(a){var b=this.b;1170>b.vb&&(a&=-49);b.ob!=a&&(b.ob=a,b.Qb=a&16?4194303:262143,Jc(b))};k.Rd=function(a){a=a>>1&63;var b=this.b.Kb[a>>1];return a&1?b>>16:b&65535}; +k.Ie=function(a,b){b=b>>1&63;var c=b>>1;this.b.Kb[c]=b&1?this.b.Kb[c]&65535|(a&63)<<16:this.b.Kb[c]&-65536|a&65534};k.Kd=function(a){return this.b.U[1][a>>1&7]};k.Be=function(a,b){this.b.U[1][b>>1&7]=a&65295};k.Id=function(a){return this.b.U[1][(a>>1&7)+8]};k.ze=function(a,b){this.b.U[1][(b>>1&7)+8]=a&65295};k.Jd=function(a){return this.b.wa[1][a>>1&7]};k.Ae=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.U[1][b]&=65295};k.Hd=function(a){return this.b.wa[1][(a>>1&7)+8]}; +k.ye=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.U[1][b]&=65295};k.ld=function(a){return this.b.U[0][a>>1&7]};k.ee=function(a,b){this.b.U[0][b>>1&7]=a&65295};k.jd=function(a){return this.b.U[0][(a>>1&7)+8]};k.ce=function(a,b){this.b.U[0][(b>>1&7)+8]=a&65295};k.kd=function(a){return this.b.wa[0][a>>1&7]};k.de=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.U[0][b]&=65295};k.hd=function(a){return this.b.wa[0][(a>>1&7)+8]};k.be=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.U[0][b]&=65295}; +k.Qd=function(a){return this.b.U[3][a>>1&7]};k.He=function(a,b){this.b.U[3][b>>1&7]=a&65295};k.Od=function(a){return this.b.U[3][(a>>1&7)+8]};k.Fe=function(a,b){this.b.U[3][(b>>1&7)+8]=a&65295};k.Pd=function(a){return this.b.wa[3][a>>1&7]};k.Ge=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.U[3][b]&=65295};k.Nd=function(a){return this.b.wa[3][(a>>1&7)+8]};k.Ee=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.U[3][b]&=65295};k.zb=function(a){a&=7;return this.b.M&2048?this.b.Ua[a]:this.b.v[a]}; +k.Bb=function(a,b){b&=7;this.b.M&2048?this.b.Ua[b]=a:this.b.v[b]=a};k.wd=function(){return this.b.M&49152?this.b.Ha[0]:this.b.v[6]};k.ne=function(a){this.b.M&49152?this.b.Ha[0]=a:this.b.v[6]=a};k.zd=function(){return this.b.v[7]};k.qe=function(a){this.b.v[7]=a};k.Ab=function(a){a&=7;return this.b.M&2048?this.b.v[a]:this.b.Ua[a]};k.Cb=function(a,b){b&=7;this.b.M&2048?this.b.v[b]=a:this.b.Ua[b]=a};k.xd=function(){return 1==(this.b.M&49152)>>14?this.b.v[6]:this.b.Ha[1]}; +k.oe=function(a){1==(this.b.M&49152)>>14?this.b.v[6]=a:this.b.Ha[1]=a};k.yd=function(){return 3==(this.b.M&49152)>>14?this.b.v[6]:this.b.Ha[3]};k.pe=function(a){3==(this.b.M&49152)>>14?this.b.v[6]=a:this.b.Ha[3]=a};k.fd=function(a){return this.b.Ac[a-65504>>1]};k.$d=function(a,b){this.b.Ac[b-65504>>1]=a};k.xc=function(a){return 65520==a?61183:0};k.Ec=function(){};k.Md=function(){return 1};k.De=function(){};k.ed=function(){return this.b.ga};k.Zd=function(){this.b.ga=0};k.nd=function(){return this.b.zc}; +k.ge=function(a,b){b&1||(a&=255);this.b.zc=a};k.sd=function(a){return a?this.b.hc:0};k.je=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.hc=a;b.I|=2};k.Ld=function(a){return a?this.b.bb&65280:0};k.Ce=function(a){this.b.bb=a|255};k.vd=function(){return bc(this.b)};k.me=function(a){Kc(this.b,a&-1809|bc(this.b)&1808);this.b.I|=128};k.Dc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; +var M={},L=(M[61568]=[null,null,K.prototype.Rd,K.prototype.Ie,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Kd,K.prototype.Be,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Id,K.prototype.ze,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Jd,K.prototype.Ae,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Hd,K.prototype.ye,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.ld,K.prototype.ee,"KISDR",8,1145],M[62672]=[null,null,K.prototype.jd,K.prototype.ce,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.kd, +K.prototype.de,"KISAR",8,1145],M[62704]=[null,null,K.prototype.hd,K.prototype.be,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.rd,K.prototype.ie,"MMR3",1,1145],M[65382]=[null,null,K.prototype.md,K.prototype.fe,"LKS"],M[65402]=[null,null,K.prototype.od,K.prototype.he,"MMR0",1,1145],M[65404]=[null,null,K.prototype.pd,K.prototype.Dc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.qd,K.prototype.Dc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Qd,K.prototype.He,"UISDR",8,1145],M[65424]=[null,null,K.prototype.Od, +K.prototype.Fe,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.Pd,K.prototype.Ge,"UISAR",8,1145],M[65456]=[null,null,K.prototype.Nd,K.prototype.Ee,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.zb,K.prototype.Bb,"R0SET0"],M[65473]=[null,null,K.prototype.zb,K.prototype.Bb,"R1SET0"],M[65474]=[null,null,K.prototype.zb,K.prototype.Bb,"R2SET0"],M[65475]=[null,null,K.prototype.zb,K.prototype.Bb,"R3SET0"],M[65476]=[null,null,K.prototype.zb,K.prototype.Bb,"R4SET0"],M[65477]=[null,null,K.prototype.zb,K.prototype.Bb, +"R5SET0"],M[65478]=[null,null,K.prototype.wd,K.prototype.ne,"R6KERNEL"],M[65479]=[null,null,K.prototype.zd,K.prototype.qe,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ab,K.prototype.Cb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ab,K.prototype.Cb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ab,K.prototype.Cb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ab,K.prototype.Cb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ab,K.prototype.Cb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ab, +K.prototype.Cb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.xd,K.prototype.oe,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.yd,K.prototype.pe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.fd,K.prototype.$d,"CTRL",1,1170],M[65520]=[null,null,K.prototype.xc,K.prototype.Ec,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.xc,K.prototype.Ec,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Md,K.prototype.De,"SYSID",1,1170],M[65526]=[null,null,K.prototype.ed,K.prototype.Zd,"CPUERR",1,1170],M[65528]= +[null,null,K.prototype.nd,K.prototype.ge,"MB",1,1170],M[65530]=[null,null,K.prototype.sd,K.prototype.je,"PIR"],M[65532]=[null,null,K.prototype.Ld,K.prototype.Ce,"SL"],M[65534]=[null,null,K.prototype.vd,K.prototype.me,"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]; +Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,this.size>>2),Sc(this,Oc?Tc:Uc);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da:function(a,b){a&1&&this.A.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ +1]&255)<<8},va:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ra=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;Zc(c,this.F+a,1,c.L)&&c.ha(!0)}return this.ec(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;Zc(c,this.F+a,2,c.L)&&c.ha(!0)}return this.fc(a,b)},ma:function(a, +b,c){if(this.i&&null!=this.F){var d=this.i;Zc(d,this.F+a,1,d.C)&&d.ha(!0)}this.u?this.w(a,b,c):this.Yb(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;Zc(d,this.F+a,2,d.C)&&d.ha(!0)}this.u?this.w(a,b,c):this.jc(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},Pa:function(a,b){a&1&&this.A.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.A.Da(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.Ra=!0},ua:function(a,b,c){this.G[a]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ib:function(a,b,c){a&1&&this.A.Da(c,64,4);this.D.setUint16(a,b,!0);this.Ra=!0},La:function(a,b,c){a&1&&this.A.Da(c,64,4);this.J[a>>1]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, +b)+")",!0)}};function jc(a,b,c){a.i=b;a.f=a.g=0;c&&((a.f=c.f)&&Yc(a,Xc,!1),(a.g=c.g)&&Wc(a,Xc,!1))}function $c(a,b){b?--a.g||(a.Xb=a.u?a.w:a.Yb,a.Mb=a.u?a.H:a.jc):--a.f||(a.Ub=a.ec,a.ra=a.fc)}function Wc(a,b,c){c&&a.g||(a.Xb=!a.u&&b[1]||a.w,a.Mb=!a.u&&b[3]||a.H);if(c||void 0===c)a.Yb=b[1]||a.w,a.jc=b[3]||a.H}function Yc(a,b,c){c&&a.f||(a.Ub=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.ec=b[0]||a.K,a.fc=b[2]||a.L}function Sc(a,b){b||(b=ad);Yc(a,b,void 0);Wc(a,b,void 0)} +var ad=[],Vc=[I.prototype.V,I.prototype.va,I.prototype.da,I.prototype.Ma],Xc=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.Aa];if(wb)var Uc=[I.prototype.N,I.prototype.la,I.prototype.Pa,I.prototype.ib],Tc=[I.prototype.R,I.prototype.ua,I.prototype.$,I.prototype.La]; +function bd(a,b){u.call(this,"CPU",a,bd,1);var c=a.multiplier||1;this.kb=a.cycles||b;this.$a=c;this.tb=Math.round(this.kb/1E4)/100;this.nb=this.tb*this.$a;this.B.Z=!1;this.B.Wb=!1;this.B.sb=a.autoStart;this.B.ub=!1;this.Fb=this.ma=0;this.Gb=a.csStart;this.wb=a.csInterval;this.xb=a.csStop;this.K=[];this.uc=this.Vd.bind(this);H(this)}z(bd);var cd=["power","reset"];k=bd.prototype; +k.Ea=function(a,b,c,d){this.u=a;this.A=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.wb,c=!0);0<=a.xb&&a.xb<=hd(a)&&(a.wb=a.xb=-1,fd(a),a.ha(),c=!0);c&&a.j(hd(a)+" cycles: checksum="+p(a.Fb))}} +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.u)if(a=d.u,a.B.ja)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.Y/a.nb?b=1:d=!0;a.$a=b;b=a.tb*a.$a;if(a.nb!=b){a.nb=b;b=a.nb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.u&&a.u.qb()}Wb(a,a.V);a.V=0;a.R=Ba();a.$=0;jd(a);return d}function wc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function yc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.kb*a.$a/1E3*c|0,a.K[b][0]=c+kd(a))} +function ld(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 Vb(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 kd(a,b){var c=a.da-=a.b;a.b=a.J=0;b&&(a.da=0);return c} +k.Vd=function(){if(this.B.Z){this.Db>=this.kb&&jd(this,!0);this.Aa=0;this.jb=Ba();if(this.$){var a=this.jb-this.$;a>this.Sb&&(this.R+=a,this.R>this.jb&&(this.R=this.jb))}try{do{var b=ld(this,this.B.ub?1:this.hb);try{this.gb(b)}catch(e){if("number"!=typeof e)throw e;}b=kd(this,!0);this.Aa+=b;this.V+=b;Xb(this,b);Vb(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.hb;15<=++this.tc&&(this.u&&this.u.ca(),this.tc=0);break}}while(this.B.Z)}catch(e){this.ha();this.u&&this.u.stop(Ba(),hd(this));vb(this,e.stack|| +e.message);return}if(this.B.Z){a=setTimeout;b=this.uc;this.$=Ba();var c=this.Sb;this.Aa&&(c=Math.round(c*this.Aa/this.hb));var c=c-(this.$-this.jb),d=this.$-this.R;d&&(this.Y=Math.round(this.V/(10*d))/100,864E5<=d&&(this.la=0,id(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.Db+=this.Aa;this.$+=c;a(b,c)}}}; +k.fb=function(a){if(ub(this))return!1;if(this.B.Z)return this.j(this.toString()+" busy"),!1;id(this);this.B.Z=!0;this.B.Wb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.u&&(a&&this.u.qb(!0),this.u.start(this.R,hd(this)));setTimeout(this.uc,0);return!0};k.gb=function(){return 0};k.ha=function(a){var b=!1;if(this.B.Z){kd(this);Wb(this,this.V);this.V=0;this.B.Z=!1;if(b=this.G.run)b.textContent="Run";this.u&&this.u.stop(Ba(),hd(this));b=!0}this.B.complete=a;return b}; +function md(a){this.vb=+a.model||1170;this.Nb=a.addrReset||0;bd.call(this,a,6666667);this.decode=1120==this.vb?nd.bind(this):od.bind(this);pd(this);this.L=0;this.N=null;this.B.complete=!1}z(md,bd);k=md.prototype;k.reset=function(){this.status("model "+this.vb);this.B.Z&&this.ha();pd(this);ed(this);this.B.error=!1;this.parent.reset.call(this)}; +function pd(a){a.S=65536;a.T=32768;a.aa=65535;a.X=32768;a.M=15;a.v=[0,0,0,0,0,0,0,a.Nb];a.Ua=[0,0,0,0,0,0];a.Ha=[0,0,0,0];a.w=0;a.Ma=0;a.Qc=[4,2,0,1];a.U=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[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.Kb=[0,0,0,0,0,0,0,0,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.Ac=[0,0,0,0,0,0,0,0];a.zc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.rb=0;a.va=-1;Ub(a)}function Ub(a){a.bb=255;a.ga=0;a.hc=0;a.C=0;a.ab=0;a.Ib=0;a.ob=0;a.Za=0;a.La=0;a.Qb=262143;a.N=null;a.A&&Jc(a)}function Jc(a){a.Za?(a.P=65536,a.ba=a.Pc,a.ra=a.Sd,a.Mb=a.Je,lc(a.A,a.ob&16?22:18)):(a.P=0,a.ba=a.Oc,a.ra=a.yc,a.Mb=a.Fc,lc(a.A,16))}function qd(a,b,c){a.Nb=b;O(a,b);!c&&a.i&&(a.ha()||a.i.ca())}k.qc=function(){return 0}; +k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.la,this.$a]);a.set(2,tc(this.A));return a.data()};k.restore=function(a){var b=a[1];this.la=b[1];id(this,b[3]);a:{b=this.A;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.w!=c&&(a.Ha[c]=a.v[6],a.v[6]=a.Ha[a.w]);a.M=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.aa=b,a.T=0)}function wd(a,b,c){a.I&128||(a.X=a.aa=a.S=b,a.T=c||0)}function xd(a,b,c,d){a.I&128||(a.X=a.aa=a.S=b,a.T=(c^b)&(d^b))} +function yd(a,b){a.I&128||(a.X=a.aa=a.S=b,a.T=a.X^a.S>>1)}function zd(a,b,c,d){a.I&128||(a.X=a.aa=a.S=b,a.T=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.va?this.va=bc(this):this.w||(a=4,c=!0);this.C&57344||(this.ab=63222,this.Ib=a);this.w=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);Kc(this,e&-12289|this.va>>2&12288);c&&(this.ga|=4,this.v[6]=4);Ad(this,this.va);Ad(this,this.v[7]);O(this,d);this.I&=-113;this.va=-1;this.I|=8;this.Uc=a;this.Sc=b;if(26!=b)throw a;}}; +function Bd(a){var b=Td(a),c=Td(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);O(a,b);Kc(a,c);a.I&=-17}function sc(a,b){var c=b>>13&31;31>c&&a.ob&32&&(b=a.Kb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Ud(a,b,c){var d,e,f,g=0;d=b>>13;a.ob&a.Qc[a.w]||(d&=7);e=a.U[a.w][d];f=(a.wa[a.w][d]<<6)+(b&8191)&a.Qb;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.U[a.w][d]=e;if(4194170!==f||a.w)a.La=a.w,a.Ma=d;b=!1;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.La<<5|a.Ma<<1),b=!0),a.C&61440||!(4191360> +f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.v[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.v[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.v[c]-2&65535;7!==c&&(e|=g);e=a.ra(e)| +g;a.b-=8;break;case 6:return e=a.ra(vd(a,2)),e=e+a.v[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(vd(a,2)),e=e+a.v[c]&65535,e=a.ra(e|a.P)|g,a.b-=10,e}a.v[c]=a.v[c]+f&65535;!g||a.C&57344||(a.ab=a.ab<<8|f<<3&248|c);6==c&&!a.w&&d&4&&0>=f&&(a.v[6]<=a.bb||65534<=a.v[6])&&(a.v[6]<=a.bb-32?(a.ga|=4,a.v[6]=4,a.pa(4,24)):(a.ga|=8,a.I|=64));return e}k.Tb=function(a){if(!this.Za)return this.A.Tb(a);this.L++;a=Vd(this,Ud(this,a,3));this.L--;return a}; +k.mb=function(a){if(!this.Za)return this.A.mb(a);this.L++;a=this.yc(Ud(this,a,2));this.L--;return a};k.pb=function(a,b){this.Za?(this.L++,Wd(this,Ud(this,a,5),b),this.L--):this.A.pb(a,b)};k.Jb=function(a,b){this.Za?(this.L++,this.Fc(Ud(this,a,4),b),this.L--):this.A.Jb(a,b)};k.Oc=function(a,b,c){return Xd(this,a,b,c)};k.Pc=function(a,b,c){return Ud(this,Xd(this,a,b,c),c)};k.yc=function(a){return this.A.oa(a)};k.Sd=function(a){return this.A.oa(Ud(this,a,2))};k.Fc=function(a,b){this.A.eb(a,b&65535)}; +k.Je=function(a,b){this.A.eb(Ud(this,a,4),b)};function Yd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Xd(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.w=a.M>>12&3,c=a.ra(d|c&a.P),a.w=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.v[d]:a.Ha[a.M>>12&3];return c}function Zd(a,b,c,d){a.C&57344||(a.ab=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Xd(a,b,e,4),c&65536||(e&=65535),a.w=a.M>>12&3,e=Ud(a,e|c&65536,4),a.w=a.M>>14&3,a.A.eb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.v[e]=d:a.Ha[a.M>>12&3]=d} +function $d(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?Vd(a,a.ba(b,c,3)):a.v[c]&255}function ae(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.A.oa(a.ba(b,c,2)):a.v[c]}function be(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Xd(a,b,c,8)}function ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Vd(a,a.ba(b,c,3)):a.v[c]&255}function de(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.A.oa(a.ba(b,c,2)):a.v[c]} +function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.rb=a.ba(b,e,7),Wd(a,e,d.call(a,c,Vd(a,e)))):a.v[e]=a.v[e]&65280|d.call(a,c,a.v[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.A.eb(e,d.call(a,c,a.A.oa(e)))):a.v[e]=d.call(a,c,a.v[e])}function ee(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Wd(a,a.ba(b,e,5),c):a.v[e]=c?d&1?c<<24>>24&65535:a.v[e]&-256|c&255:a.v[e]&-256;return c} +function fe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.A.eb(a.ba(b,d,4),c):a.v[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.v[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.gb=function(a){this.B.complete=!0;var b=this.i&&ge(this.i)?1:this.B.Wb?-1:0,c=a?this.B.Wb?0:1:-1;this.B.Wb=!1;this.da=this.b=a;do{if(b){if(this.i&&he(this.i,this.v[7],c)){this.ha();break}c||c++;b++}if(this.I){this.I&112&&(this.I&32?this.pa(168,28):this.I&64?this.pa(4,30):this.I&16&&this.pa(12,32),this.I&=-113);if(a=this.I&7){a=!1;if(this.I&2){this.I&=-3;var d=160,e=(this.hc&224)>>5,f=this.N&&this.N.yb>e?this.N:null;f&&(d=f.Xd,e=f.yb);e>(this.M&224)>>5?(this.I&4&&(vd(this,2),this.I&=-5),this.pa(d, +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.I&1&&this.I++;a=a&&0>c}if(a)break}this.I=this.I&7|this.M&16;this.decode(ud(this))}while(0>1|b<<16;yd(this,a);return a&65535}function ne(a,b){a=b&2048|b>>1|b<<8;yd(this,a<<8);return a&255}function oe(a,b){a=b&~a;R(this,a);return a}function pe(a,b){a=b&~a;R(this,a<<8);return a}function qe(a,b){a|=b;R(this,a);return a}function re(a,b){a|=b;R(this,a<<8);return a} +function se(a,b){a=~b|65536;wd(this,a);return a&65535}function te(a,b){a=~b|256;wd(this,a<<8);return a&255}function ue(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.T=b&(b^a));return a&65535}function ve(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.aa=c,this.T=b&(b^c));return a&255}function we(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.T=a&(b^a));return a&65535}function xe(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.aa=c,this.T=c&(b<<8^c));return a&255} +function ye(a,b){a=-b;wd(this,a,a&b&32768);return a&65535}function ze(a,b){a=-b;wd(this,a<<8,(a&b&128)<<8);return a&255}function Ae(a,b){a=b<<1|this.S>>16&1;yd(this,a);return a&65535}function Be(a,b){a=b<<1|this.S>>16&1;yd(this,a<<8);return a&255}function Ce(a,b){a=(this.S&65536|b)>>1|b<<16;yd(this,a);return a&65535}function De(a,b){a=((this.S&65536)>>8|b)>>1|b<<8;yd(this,a<<8);return a&255}function Ee(a,b){var c=b-a;zd(this,c,a,b);return c&65535} +function Fe(a,b){var c=b-a;zd(this,c<<8,a<<8,b<<8);return c&255}function Ge(a,b){this.I&128||(this.X=this.aa=b&65280,this.T=this.S=0);return(b<<8|b>>8)&65535}function He(a,b){a^=b;R(this,a);return a&65535}function Ie(a){T(this,a,ae(this,a),ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Je(a){var b=de(this,a);a=a>>6&7;var c=this.v[a];c&32768&&(c|=4294901760);this.S=this.T=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.T=32768)}this.v[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b} +function Ke(a){var b=de(this,a);a=a>>6&7;var c=this.v[a]<<16|this.v[a|1];this.S=this.T=0;b&=63;if(b&32){b=64-b;32>b-1;this.S=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.v[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Le(a){U(this,a,!rd(this))}function Me(a){U(this,a,rd(this))} +function Ne(a){T(this,a,ae(this,a),oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Oe(a){S(this,a,$d(this,a),pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Pe(a){T(this,a,ae(this,a),qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Qe(a){S(this,a,$d(this,a),re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Re(a){R(this,ae(this,a)&de(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Se(a){R(this,($d(this,a)&ce(this,a))<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Te(a){U(this,a,td(this))}function Ue(a){U(this,a,!this.Sa()==!sd(this))}function Ve(a){U(this,a,!td(this)&&!this.Sa()==!sd(this))}function We(a){U(this,a,!rd(this)&&!td(this))}function Xe(a){U(this,a,td(this)||!this.Sa()!=!sd(this))} +function Ye(a){U(this,a,rd(this)||td(this))}function Ze(a){U(this,a,!this.Sa()!=!sd(this))}function $e(a){U(this,a,this.Sa())}function af(a){U(this,a,!td(this))}function bf(a){U(this,a,!this.Sa())}function cf(){this.pa(12,1);this.b-=5}function df(a){U(this,a,!0)}function ef(a){U(this,a,!sd(this))}function ff(a){U(this,a,sd(this))}function V(a){a&1&&(this.S=0);a&2&&(this.T=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5} +function gf(a){var b=ae(this,a);a=de(this,a);zd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function hf(a){var b=$d(this,a)<<8;a=ce(this,a)<<8;zd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} +function jf(a){var b=de(this,a);if(b){a=a>>6&7;var c=this.v[a]<<16|this.v[a|1];this.S=this.T=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.v[a]=d&65535,this.v[a|1]=c-d*b&65535,this.aa=d>>16|d,this.X=d>>16):(this.T=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.v[a]&&(this.v[a]=this.v[a|1]=1));this.b-=53}else this.aa=this.X=0,this.T=32768,this.S=65536,this.b-=7}function kf(){this.pa(24,2);this.b-=25} +function lf(){this.M&49152?(this.ga|=128,this.pa(4,3)):this.i?mf(this.i):this.ha();this.b-=7}function nf(){this.pa(16,4);this.b-=25}var of=[0,7,7,10,7,11,9,13];function pf(a){this.J=this.b;O(this,be(this,a));this.b=this.J-of[this.g]}var qf=[0,14,14,17,14,18,16,20];function rf(a){this.J=this.b;var b=be(this,a);a=a>>6&7;Ad(this,this.v[a]);this.v[a]=this.v[7];O(this,b);this.b=this.J-qf[this.g]}var sf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function tf(a){var b=ae(this,a);this.J=this.b;R(this,fe(this,a,b));this.b=this.J-sf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function uf(a){var b=$d(this,a);R(this,ee(this,a,b,1)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var vf=[7,13,13,17,14,18,17,21]; +function wf(a){var b=de(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.v[a];c&32768&&(c|=-65536);b=~~(b*c);this.v[a]=b>>16&65535;this.v[a|1]=b&65535;this.I&128||(this.X=b>>16,this.aa=this.X|b,this.T=0,this.S=-32768>b||32767>6;if(this.v[b]=this.v[b]-1&65535)O(this,this.v[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Cf(a){T(this,a,ae(this,a),Ee);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} +function Df(a){T(this,a,0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)}function Ef(){this.pa(28,5);this.b-=5}function Ff(){this.I&4||this.u&&this.u.ca();this.I|=4;vd(this,-2);this.b-=3}function Gf(a){T(this,a,ae(this,a),He);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=mf(b);b||this.pa(8,6)}function nd(a){Hf[a>>12].call(this,a)}function If(a){Jf[a>>6&3].call(this,a)}function Kf(a){Lf[a>>6&3].call(this,a)} +function Mf(a){Nf[a>>6&3].call(this,a)}function Of(a){Pf[a&15].call(this,a)}function Qf(a){Rf[a&15].call(this,a)}function Sf(a){Tf[a>>6&3].call(this,a)}function Uf(a){Vf[a>>6&3].call(this,a)}function Wf(a){Xf[a>>6&3].call(this,a)} +var Hf=[function(a){Yf[a>>8&15].call(this,a)},tf,gf,Re,Ne,Pe,Ie,W,function(a){Zf[a>>8&15].call(this,a)},uf,hf,Se,Oe,Qe,Cf,W],Yf=[function(a){$f[a>>4&15].call(this,a)},df,af,Te,Ue,Ze,Ve,Xe,rf,rf,If,Kf,Mf,W,W,W],Jf=[function(a){wd(this,fe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ue);this.b-=this.g?9:3+(7==this.f?2:0)}],Lf=[function(a){T(this,a,0, +ye);this.b-=this.g?11:6},function(a){T(this,a,rd(this)?1:0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,rd(this)?1:0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=de(this,a);wd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Nf=[function(a){T(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ke);this.b-=this.g?9:3+(7==this.f?2:0)}], +$f=[function(a){ag[a&15].call(this,a)},W,W,W,pf,pf,pf,pf,Af,W,Of,Qf,Df,Df,Df,Df],ag=[lf,Ff,zf,cf,nf,yf,W,W,W,W,W,W,W,W,W,W],Pf=[xf,function(){this.S=0;this.b-=5},function(){this.T=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],Rf=[xf,function(){this.S=65536;this.b-=5},function(){this.T=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],Zf=[bf,$e,We,Ye,ef,ff,Le,Me,kf,Ef,Sf,Uf,Wf,W,W,W],Tf=[function(a){wd(this, +ee(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,ve);this.b-=this.g?9:3+(7==this.f?2:0)}],Vf=[function(a){S(this,a,0,ze);this.b-=this.g?11:6},function(a){S(this,a,rd(this)?1:0,je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,rd(this)?1:0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ce(this,a);wd(this,a<<8);this.b-=this.g?4:3+(7== +this.f?2:0)}],Xf=[function(a){S(this,a,0,De);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ne);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,le);this.b-=this.g?9:3+(7==this.f?2:0)}];function od(a){bg[a>>12].call(this,a)} +var bg=[function(a){cg[a>>8&15].call(this,a)},tf,gf,Re,Ne,Pe,Ie,function(a){dg[a>>8&15].call(this,a)},function(a){eg[a>>8&15].call(this,a)},uf,hf,Se,Oe,Qe,Cf,W],cg=[function(a){fg[a>>4&15].call(this,a)},df,af,Te,Ue,Ze,Ve,Xe,rf,rf,If,Kf,Mf,function(a){gg[a>>6&3].call(this,a)},W,W],gg=[function(a){a=this.v[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);O(this,this.v[5]);this.v[6]=a+2&65535;this.v[5]=b;this.b-=8},function(a){a=Yd(this,a,0);Ad(this,a);R(this,a);this.b-=11},function(a){var b=Td(this);this.J= +this.b;Zd(this,a,0,b);R(this,b);this.b=this.J-vf[this.g]},function(a){R(this,fe(this,a,this.Sa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],fg=[function(a){hg[a&15].call(this,a)},W,W,W,pf,pf,pf,pf,Af,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.I|=1),this.b-=5):W.call(this,a)},Of,Qf,Df,Df,Df,Df],hg=[lf,Ff,zf,cf,nf,yf,function(){Bd(this);this.b-=13},W,W,W,W,W,W,W,W,W],dg=[wf,wf,jf,jf,Je,Je,Ke,Ke,Gf,Gf,W,W,W,W,Bf,Bf],eg=[bf,$e,We,Ye,ef,ff,Le,Me,kf,Ef,Sf,Uf,Wf,function(a){ig[a>> +6&3].call(this,a)},W,W],ig=[W,function(a){a=Yd(this,a,65536);Ad(this,a);R(this,a);this.b-=11},function(a){var b=Td(this);this.J=this.b;Zd(this,a,65536,b);R(this,b);this.b=this.J-vf[this.g]},W]; +function jg(a){u.call(this,"ROM",a,jg);this.ia=this.u=null;this.C=a.addr;this.f=a.size;this.w=a.alias;this.g=a.file;this.D=sa(this.g);if(this.g){a=this.g;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.g+"&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+")"),c.g=null):(nb(c.Pa,a,b),(a=Fa(a,b))?(c.u=a.ea,c.ia=a.ia):c.g=null);kg(c)})}}z(jg);jg.prototype.Ea=function(a,b,c,d){this.A=b;this.b=c;this.i=d;kg(this)}; +jg.prototype.Ga=function(){this.ia&&(this.i&&lg(this.i,this.id,this.C,this.f,this.ia),delete this.ia);return!0};jg.prototype.Fa=function(){return!0}; +function kg(a){if(!tb(a)){if(a.g){if(!a.u||!a.A)return;a.f||(a.f=a.u.length);if(a.u.length!=a.f)vb(a,"ROM size ("+p(a.u.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;b=a.C;if(oc(a.A,b,a.f,Rc)){var c;for(c=0;c>>a.ka;0=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=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.pb(n++,b[r++]&255);else n&1?a.b.ha():qd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&xc(e.b,e.la))});this.ma=Ic(52,4);this.$=wc(this.b,function(){e.g|=128;e.g&64&&xc(e.b,e.ma)});Ab(b,this,Kg);H(this)}; +k.vc=function(){if(!this.J){var a=dd(this.u,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ib)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.Pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.vc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Fa=function(a){return a?this.save():!0};k.reset=function(){Lg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Lg(this)};function Lg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.gc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.V||8,c=a-this.H%a,this.V&&(b=xa("",c)));this.P&&!this.H&&c&&(b=String.fromCharCode(this.P)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), +this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;yc(this.b,this.$,1E3/Math.round(this.R/10))}};var Mg={},Kg=(Mg[65392]=[null,null,Y.prototype.Bd,Y.prototype.se,"RCSR"],Mg[65394]=[null,null,Y.prototype.Ad,Y.prototype.re,"RBUF"],Mg[65396]=[null,null,Y.prototype.Ud,Y.prototype.Le,"XCSR"],Mg[65398]=[null,null,Y.prototype.Td,Y.prototype.Ke,"XBUF"],Mg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");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(){var a=d.G.listTapes;a&&Pg(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;Pg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; +k.Ea=function(a,b,c,d){this.u=a;this.A=b;this.b=c;this.i=d;this.V=Qg(a);var e=this;if((this.g=dd(this.u,"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=Ic(56,4);this.da=wc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.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.u&&!a.u.B.ja;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Pa,e,f),(e=Fa(e,f))&&Zg(a,b,c,d,e.ea,e.Ja, +e.Ia));a.B.Xa=!1;a.D&&(a.D--,a.D||H(a));Wg(a)})}function Tg(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ta);for(d=0;dc.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.cc?"":e)+"&format=json"));return!!Ea(f, +null,!0,function(b,c,d){fh(a,b,c,d)})} +function fh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.u&&!a.u.B.ja;if(d)a.controller.O('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{nb(a.controller.Pa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(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.Ka=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var w=m<<2,y=t.length;y>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f=a.Oa+a.Ba&&(a.Ba+=f-(a.Oa+a.Ba)+1):(a.Oa=f,a.Ba=1);d[f]=d[f]&~(255<g)break;e|=g<=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][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Va+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=hh(this,a++);)jh(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 jh(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){u.call(this,"RL11",a,N,2097152);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(N);k=N.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=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&kh(d,a)},!0;case "loadDrive":return this.G[b]= +c,c.onclick=function(){var a=d.G.listDisks;a&&lh(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.Ca){var b;b="";for(var c=0,h;h=hh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";kh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){mh(this)};k.save=function(){return(new P(this)).data()}; +k.restore=function(a){return mh(this,a[0])};function ph(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||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+'"')}rh(a,e,b,c,!1,d)}else qh(a,e)} +function rh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.cb.toLowerCase()!=d.toLowerCase()&&(g++,qh(a,b,!0),h.bc?a.O("RL11 busy"):(h.bc=!0,e&&(h.ac=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Ob=!!f,eh(new ah(a,h,"preload"),c,d,f,a.Lc)&&g++));return g} +k.Lc=function(a,b,c,d,e){var f;a.bc=!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.dc)),b=null);b?(a.Ca=b,a.Va=c,a.cb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.dc),a.ac||e),this.u&&this.u.qb()):a.Ob=!1;a.ac&&(a.ac=!1,--this.H||H(this));kh(this,a.dc)}; +function oh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0}; +k.gd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Ca.read(m,n++))||0>(t=a.Ca.read(m,n++))){h=5120;break}this.A.eb(f,r|t<<8);if(vc(this.A)){h=8192;break}f+=2;if(n>=l.Ka&&(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.ae=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var r=this.A.oa(f);if(vc(this.A)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,r&255)||!a.Ca.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ka&&(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.Ed=function(){return this.fa&65535}; +k.ve=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.D=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.D=this.C;break;case 12:b=this.gd;case 10:b||(b=this.ae),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ta||f>=c.qa?this.fa|=37888: +(g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Mc.bind(this)))}a&&(this.fa|=129,this.fa&64&&xc(this.b,this.P))}};k.Cd=function(){return this.J};k.te=function(a){this.J=a&65534};k.Fd=function(){return this.g};k.we=function(a){this.g=a};k.Gd=function(){return this.D};k.xe=function(a){this.D=a};k.Dd=function(){return this.K};k.ue=function(a){this.K=a&63}; +var sh={},nh=(sh[63744]=[null,null,N.prototype.Ed,N.prototype.ve,"RLCS"],sh[63746]=[null,null,N.prototype.Cd,N.prototype.te,"RLBA"],sh[65284]=[null,null,N.prototype.Fd,N.prototype.we,"RLDA"],sh[65286]=[null,null,N.prototype.Gd,N.prototype.xe,"RLMP"],sh[65288]=[null,null,N.prototype.Dd,N.prototype.ue,"RLBE"],sh);function th(a){u.call(this,"Debugger",a,th);this.$=a.base||16;this.Aa=!1;this.J=0;this.P=!1;this.w=-1;this.g=[];this.V={}}z(th); +var uh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};th.prototype.rc=function(){return-1};th.prototype.sc=function(){}; +function vh(a,b,c,d){if(c)if(b){0>a.w&&a.g.length&&(a.w=0);if(0>a.w||b!=a.g[a.w])a.g.splice(0,0,b),a.w=0;a.w--}else a.P?b="end":b=a.g[a.w+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 wh(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} -function wh(a,b,c){var d;if(b){b=xh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=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 Ah(a,b){if(b)return zh(a,b,a.S[b]);var c=0;for(b in a.S)zh(a,b,a.S[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=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 Bh(a,b){if(b)return Ah(a,b,a.V[b]);var c=0;for(b in a.V)Ah(a,b,a.V[b]),c++;return 0this.b.rb?Jh:[];Kh(this,function(a){a:{var b=d.w.X,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Lh(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=mc[c],n&&d.j(p(n.id,8)+" %"+p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.pc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Sa[a-8]:20>a?b=this.b.Ga[a-16]:20==a&&(b=Xb(this.b)));return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Hb).F));this.na&1073741824?this.ta.push(a):this.da&&a==this.da||(this.da=a,this.na&-2147483648&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,id(a),a.wa=0,a.C.Z()))};function Dh(a){var b;if(!fe(a))a.D&&a.D.length&&a.j("instruction history buffer freed"),a.W=0,a.D=[];else if(!a.D||!a.D.length){a.D=Array(1E3);for(b=0;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?Sh(this):Th(this)}};function Rh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ja?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.ca?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Fa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ea=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Dh(this);this.va=0;this.da=null;this.J=0;this.K=Z(this.b.u[7]);this.A.ca=!1;Uh(this);a||this.Z()};k.save=function(){var a=new R(this);a.set(0,Nh(this.K));a.set(1,Nh(this.N));a.set(2,[this.g,this.O,this.na]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Oh(a[b++]),this.N=Oh(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.O=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.ca=!0;this.Bb=a;this.Cb=b}; -k.stop=function(a,b){if(this.A.ca){this.A.ca=!1;this.J=b-this.Cb;if(!this.R){b="stopped";if(this.J){a-=this.Bb;var c=0d&&(d=a.b.lb(b)),65535!=(d&65535)&&(c=a.D[a.W],c.F=b,c.La=!1,++a.W==a.D.length&&(a.W=0)));return!1}function qc(a){var b=a.b;if(b.A.ca)throw P(b,a.b.Hb),a.ha(),-1;return!1} -function Ch(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b>>d.ka],!1)}a.L=["br"];if(a.B)for(b=1;b>>d.ka],!0);a.B=["bw"];a.eb=0}k.jb=function(a,b,c){var d=!0;c||Vh(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.X[e>>>f.ka].jb(e&f.w,a==this.B)}}d&&(a.push(b),c?b.La=!0:(Wh(this,a,a.length-1,"set"),Dh(this)));return d}; -function Vh(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ka],b==a.B));h.La||Dh(a);break}}return f}function Xh(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.F-((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), -y&63)switch(y=A&7,A&56){case 0:x=Qh(y);break;case 8:x="@"+Qh(y);break;case 16:7>y?x="("+Qh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Qh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Qh(y)+")";break;case 40:x="@-("+Qh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Qh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Qh(y)+")",7==y&&(x="@"+J(w,A+t.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); -0b?(c=Qh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Sa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ga[b-16]):20==b&&(c="PS="+J(a,Xb(d)));c&&(c+=" ");return c}function bi(a){var b,c="";for(b=0;6>b;b++)c+=ai(a,b);c=c+"\n"+(ai(a,6)+ai(a,7)+ai(a,20));return c+=$h(a,"T")+$h(a,"N")+$h(a,"Z")+$h(a,"V")+$h(a,"C")}k.jc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.jc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Qe:b,F:c,Qc:d,ia:e,hc:f})}function ci(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b>>0,h=f.Qc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.Z();a.j("updated registers:")}a.j(bi(a));c&&(a.K=Z(d.u[7]),Th(a,J(a,a.K.F)))}}function gi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=Zh(a,b,g,f);a.j(f);a.K=b;e-=b.F-l;c++}}} -function Yh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.O&&(a.j("ended assemble at "+J(a,a.N.F)),a.K=a.N,a.O=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.da=null;if(tb(a)&&0n||"z"oa.length&&(a.j("note: only "+oa.length+" available"),ba=oa.length);ga-=ba;0>ga&&(null==oa[oa.length-1].F?(ba=ga+ba,ga=0):ga+=oa.length);var Ed=[];"call"==sg&&(Hb=1E5,Ed=["CALL"]);for(void 0!==rg&&a.j(ba+" instructions earlier:");0=oa.length&&(ga=0);a.ib=ba;ug++;Hb--}}ug||(a.j("no "+tg+"history available"),a.ib=void 0)}else{var Jb=Lh(a,na);if(Jb){var yc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||Ai),yc=yh(a,La)>>>0,65536>4||1;Ci--&&0Cc?String.fromCharCode(Cc):".";zc-=Bc}Kb&&(Kb+="\n");Kb+=na+" "+Fd+(0==Mb?" "+xg:"")}Kb&&a.j(Kb);a.gb=Jb}}}}break;case "e":if("else"==g[0])break;var jb,Gd,Hd,Id,Jd=g[0],Kd=g[1];"eb"==Jd?(jb=1,Gd=255,Hd=a.Db,Id=a.Sb):"e"==Jd||"ew"==Jd?(jb=2,Gd=65535,Hd=a.oa,Id=a.ab):Kd=null;if(null==Kd)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 Dc=Lh(a,Kd);if(Dc)for(var Ec= -2;EcNd;){for(var Ma=null,Gi=256;65536>Pb.F>>>0;){Od.F=a.oa(Pb,2);if(null==Pb.F||!Gi--)break;if(!(Od.F&1)){for(var Hi=a,Fc=Od,zg=null,Qb=Fc.F,Ag=Qb,Pd=1;6>=Pd&&Qb;Pd++){if(2< -Pd){Fc.F=Qb;var Gc=Zh(Hi,Fc);if(0<=Gc.indexOf("JSR")){var Bg=Gc.indexOf(" ");if(Qb+(Gc.indexOf(" ",Bg+1)-Bg-1)/2==Ag){zg=Gc;break}}}Qb-=2}Fc.F=Ag;if(Ma=zg)break}}if(!Ma||null==Ma)break;var Cg=null;if("ks"==Fi){var Dg=Ma.match(/[0-9A-F]+$/);Dg&&(Cg=fi(a,Dg[0]))}Ma=xa(Ma,50)+" ;"+(Cg||"stack="+J(a,Pb.F));a.j(Ma);Nd++}Nd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){fi(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"== -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 Qd=0;Qd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bli){if(ni(d,this.J)){this.v=new R(this,"1.30.2","failsafe");ni(this.v)&&(si(this,d),a=2,ti(this.v));this.v.set("timestamp",Ca());ui(this.v);var e=this.f&&!this.B;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ri(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ni(d,g):("error"== -f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.g=null)):this.j(f+": "+g),ti(d),ni(d)?(c=ri(d),e=!0):c=!1))}e&&qi(this,c?d:null)}else 2==a&&d.clear()}else qi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.A.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(vi(this,this.b,b,c,a),this.b.pb());this.O&&(si(this,b),b.clear());!c&&this.v&&(this.v.clear(),delete this.v);this.C=0}; -function si(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 ii(a,b,c){var d,e="none";if(a.C)return null;a.C--;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.Ea&&(c&&a.b.ha(),d=a.b.Ea(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ja=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");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);Ni(a,b,c)}})}else c(a,null)} -function Oi(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&&(--zi||Za(!0));l=!1}var g,h,l=!0;zi++;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");m=function(d,h){h?Li(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,--zi||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),--zi||Za(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Li(b,a,d,!0,e,m):Mi(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 Oi(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map +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]}},Jh=[0],Kh= +[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Ch.prototype; +k.Ea=function(a,b,c,d){this.A=b;this.b=c;this.u=a;(a=dd(a,"messages"))&&Fh(this,a);this.tb=Ih;this.Db=1145>this.b.vb?Kh:[];Lh(this,function(a){a:{var b=d.A.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Mh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.A.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=rc[c],n&&d.j(p(n.id,8)+" %"+p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.sc=function(a){var b;0<=a&&(8>a?b=this.b.v[a]:16>a?b=this.b.Ua[a-8]:20>a?b=this.b.Ha[a-16]:20==a&&(b=bc(this.b)));return b}; +k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Ib).F));this.na&1073741824?this.ua.push(a):this.da&&a==this.da||(this.da=a,this.na&-2147483648&&this.b&&this.b.B.Z&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,kd(a),a.ua=0,a.u&&a.u.ca()))};function Eh(a){var b;if(!ge(a))a.D&&a.D.length&&a.j("instruction history buffer freed"),a.Y=0,a.D=[];else if(!a.D||!a.D.length){a.D=Array(1E3);for(b=0;b>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Z(this.b.v[7]);a&&1!=this.R?Th(this):Uh(this)}};function Sh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.B.ja?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.B.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Eh(this);this.va=0;this.da=null;this.J=0;this.K=Z(this.b.v[7]);this.B.Z=!1;Vh(this);a||this.ca()};k.save=function(){var a=new P(this);a.set(0,Oh(this.K));a.set(1,Oh(this.N));a.set(2,[this.g,this.P,this.na]);a.set(3,this.H);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Ph(a[b++]),this.N=Ph(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.H=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.B.Z=!0;this.Nb=a;this.Qb=b}; +k.stop=function(a,b){if(this.B.Z){this.B.Z=!1;this.J=b-this.Qb;if(!this.R){b="stopped";if(this.J){a-=this.Nb;var c=0d&&(d=a.b.mb(b)),65535!=(d&65535)&&(c=a.D[a.Y],c.F=b,c.Na=!1,++a.Y==a.D.length&&(a.Y=0)));return!1}function mf(a){var b=a.b;if(b.B.Z)throw O(b,a.b.Ib),a.ha(),-1;return!1} +function Dh(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b>>d.ka],!1)}a.L=["br"];if(a.C)for(b=1;b>>d.ka],!0);a.C=["bw"];a.hb=0}k.lb=function(a,b,c){var d=!0;c||Wh(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.A;f.W[e>>>f.ka].lb(e&f.A,a==this.C)}}d&&(a.push(b),c?b.Na=!0:(Xh(this,a,a.length-1,"set"),Eh(this)));return d}; +function Wh(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ka],b==a.C));h.Na||Eh(a);break}}return f}function Yh(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.F-((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), +y&63)switch(y=A&7,A&56){case 0:x=Rh(y);break;case 8:x="@"+Rh(y);break;case 16:7>y?x="("+Rh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Rh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Rh(y)+")";break;case 40:x="@-("+Rh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Rh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Rh(y)+")",7==y&&(x="@"+J(w,A+t.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); +0b?(c=Rh(b),c+="="+J(a,d.v[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ua[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ha[b-16]):20==b&&(c="PS="+J(a,bc(d)));c&&(c+=" ");return c}function ci(a){var b,c="";for(b=0;6>b;b++)c+=bi(a,b);c=c+"\n"+(bi(a,6)+bi(a,7)+bi(a,20));return c+=ai(a,"T")+ai(a,"N")+ai(a,"Z")+ai(a,"V")+ai(a,"C")}k.mc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.mc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({Re:b,F:c,Tc:d,ia:e,kc:f})}function di(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b>>0,h=f.Tc;if(e>=g&&eb)){d.v[b]=f&65535;break}a.j("unknown register: "+e);return}a.u.ca();a.j("updated registers:")}a.j(ci(a));c&&(a.K=Z(d.v[7]),Uh(a,J(a,a.K.F)))}}function hi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=$h(a,b,g,f);a.j(f);a.K=b;e-=b.F-l;c++}}} +function Zh(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.F)),a.K=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.da=null;if(tb(a)&&0n||"z"na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);fa-=aa;0>fa&&(null==na[na.length-1].F?(aa=fa+aa,fa=0):fa+=na.length);var Ed=[];"call"==tg&&(Gb=1E5,Ed=["CALL"]);for(void 0!==sg&&a.j(aa+" instructions earlier:");0=na.length&&(fa=0);a.rb=aa;vg++;Gb--}}vg||(a.j("no "+ug+"history available"),a.rb=void 0)}else{var Ib=Mh(a,ma);if(Ib){var zc=0;Ka&&("l"==Ka.charAt(0)&&(Ka=Ka.substr(1)||Bi),zc=zh(a,Ka)>>>0,65536>4||1;Di--&&0Dc?String.fromCharCode(Dc):".";Ac-=Cc}Jb&&(Jb+="\n");Jb+=ma+" "+Fd+(0==Lb?" "+yg:"")}Jb&&a.j(Jb);a.jb=Ib}}}}break;case "e":if("else"==g[0])break;var ib,Gd,Hd,Id,Jd=g[0],Kd=g[1];"eb"==Jd?(ib=1,Gd=255,Hd=a.Eb,Id=a.Vb):"e"==Jd||"ew"==Jd?(ib=2,Gd=65535,Hd=a.oa,Id=a.eb):Kd=null;if(null==Kd)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 Ec=Mh(a,Kd);if(Ec)for(var Fc= +2;FcNd;){for(var La=null,Hi=256;65536>Ob.F>>>0;){Od.F=a.oa(Ob,2);if(null==Ob.F||!Hi--)break;if(!(Od.F&1)){for(var Ii=a,Gc=Od,Ag=null,Pb=Gc.F,Bg=Pb,Pd=1;6>=Pd&&Pb;Pd++){if(2< +Pd){Gc.F=Pb;var Hc=$h(Ii,Gc);if(0<=Hc.indexOf("JSR")){var Cg=Hc.indexOf(" ");if(Pb+(Hc.indexOf(" ",Cg+1)-Cg-1)/2==Bg){Ag=Hc;break}}}Pb-=2}Gc.F=Bg;if(La=Ag)break}}if(!La||null==La)break;var Dg=null;if("ks"==Gi){var Eg=La.match(/[0-9A-F]+$/);Eg&&(Dg=gi(a,Eg[0]))}La=xa(La,50)+" ;"+(Dg||"stack="+J(a,Ob.F));a.j(La);Nd++}Nd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){gi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"== +G)Ca=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in xb)if(G==oa){Ca=xb[oa];pa=!!(a.na&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.na|=Ca,pa=!0;else if("off"==g[2]&&(a.na&=~Ca,pa=!1,1073741824==Ca)){for(var Qd=0;Qd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bmi){if(oi(d,this.H)){this.w=new P(this,"1.30.2","failsafe");oi(this.w)&&(ti(this,d),a=2,ui(this.w));this.w.set("timestamp",Da());vi(this.w);var e=this.u&&!this.C;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=si(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?oi(d,g):("error"== +f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.f=null)):this.j(f+": "+g),ui(d),oi(d)?(c=si(d),e=!0):c=!1))}e&&ri(this,c?d:null)}else 2==a&&d.clear()}else ri(this);delete this.H;delete this.J}e=ob(this.id);for(f=0;fa[1];a=a[2];this.$=!0;this.B.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(wi(this,this.b,b,c,a),this.b.sb());this.N&&(ti(this,b),b.clear());!c&&this.w&&(this.w.clear(),delete this.w);this.g=0}; +function ti(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.f||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.Y;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} +function ji(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=Da();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.Fa&&(c&&a.b.ha(),d=a.b.Fa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.B.ja=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");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);Oi(a,b,c)}})}else c(a,null)} +function Pi(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&&(--Ai||Za(!0));l=!1}var g,h,l=!0;Ai++;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");m=function(d,h){h?Mi(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,--Ai||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),--Ai||Za(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Mi(b,a,d,!0,e,m):Ni(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 Pi(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.2/pdp11.js b/versions/pdpjs/1.30.2/pdp11.js index 985012bc0..ba641b160 100644 --- a/versions/pdpjs/1.30.2/pdp11.js +++ b/versions/pdpjs/1.30.2/pdp11.js @@ -40,202 +40,203 @@ function pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} 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 k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function ta(a,b){var c,d={K:null,X:null,ga:null,fa: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.ga=g.load;d.fa=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>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;cb.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>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.X=g.symbols;d.K.length?1==d.K.length&&(u(d.K[0]),d=null):(u("Empty resource: "+a),d=null)}catch(k){u("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Qa=this.id:(this.oa=this.id.substr(0,b),this.Qa=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Ea:!1,ob:!1,P:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.C=null;y.push(this)}var La=void 0,Ma={}; +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.Lb=b.comment;this.jc=b;b=this.id.indexOf(".");0>b?this.Pa=this.id:(this.na=this.id.substr(0,b),this.Pa=this.id.substr(b+1));this[a]=c;this.l={ready:!1,Ea:!1,nb:!1,O:!1,error:!1};this.jb=null;this.l.error=!1;this.o={};this.C=null;y.push(this)}var La=void 0,Ma={}; 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 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;ba;a++)this.b["S"+a]=[0,!1,!1,this.rc,a]}z(Ya);h=Ya.prototype;h.reset=function(){this.A=this.A&-120|20}; -h.$=function(a,b,c,d){if(this.l&&this.l.$(a,b,c,d)||this.a&&this.a.$(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.o[b]=c,this.m++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.s[b]=d?1:0,this.m++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c=a.b[b];Za(a, -b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.v="DEP"==b;a.w="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.b[b];c[1]&&c[2]&&(Za(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.C=d;$a(b,this,ab);bb(b,this.reset.bind(this));cb(this);for(var e in this.b)Za(this,e,this.b[e][0])};h.ka=function(a,b){b||db();return!0};h.ja=function(){return!0}; -function eb(a,b,c,d){a.o[b]&&(void 0===c&&(a.j.error=!0,a.D("Value for "+b+" is invalid"),F(a.a)),c=8==(a.C&&a.C.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}function fb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function cb(a,b){for(var c in a.s)fb(a,c,null!=b?b:a.s[c])}function Za(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"} -h.pc=function(a){a||this.a.j.U||(this.h.reset(),gb(this.a),this.b.ENABLE&&this.b.ENABLE[0]&&hb(this.a))};h.qc=function(){};h.lc=function(a){a||F(this.a)};h.jc=function(a){if(!a&&!this.a.j.U)if(this.b.ENABLE&&this.b.ENABLE[0])hb(this.a);else{a=this.C;var b;if(b=a)a.j.Ea&&(a.j.ob=!0),b=!a.j.Ea;b?(Va(a,!0),a.lb(0),Va(a,!1)):(this.a.lb(1),this.aa())}};h.kc=function(a){a&&!this.a.j.U&&(this.v&&ib(this,this.c+2),this.h.Bb(this.c,jb(this,this.f)))}; -h.mc=function(a){a||this.a.j.U||(this.w&&ib(this,this.c+2),jb(this,this.h.sb(this.c)))};h.oc=function(a){a||this.a.j.U||ib(this,this.f)};h.nc=function(a){cb(this,a||null)};h.rc=function(a,b){this.f=a?this.f|1<c;c++)fb(a,"A"+c,b&1<c;c++)fb(a,"D"+c,b&1<>2;this.l=this.b-1;this.v=this.A/this.b|0;this.xa=[];this.f=0;this.i=!1;this.s=[];this.bc=[nb,ob,pb,qb];a=new H(this);rb(a,this.C);this.h=Array(this.v);for(b=0;b>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 ob(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 pb(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 qb(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 tb(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ja)return l.mb+=l.Ja-f,l.Ja=f,!0;if(f>=l.Ja+l.mb){p=l.size-(f-n);p>g&&(p=g);l.mb=f-l.Ja+p;f=n+a.b;g-=p;k++;continue}}return yb(1,f,g)}f=new H(a,f,p,a.b,d,e);rb(f,a.C,l);a.h[k++]=f;f=n+a.b;g-=p}if(0>=g){c/=1024;var t;e="";t?10>>=a.c;0>>=a.c;0>>a.c].xb(b&a.l,b)}function Cb(a,b){3932160<=b&&(b=Bb(a.a,b));return a.h[(b&a.Aa)>>>a.c].W(b&a.l,b)} -h.sb=function(a){var b=a&this.l,c=(a&this.Aa)>>>this.c;this.i=!1;this.f++;a=this.h[c].Tb(b,a);this.f--;return a};h.Ya=function(a,b){this.i=!1;this.f++;this.h[(a&this.Aa)>>>this.c].Fb(a&this.l,b&255,a);this.f--};function Db(a,b,c){3932160<=b&&(b=Bb(a.a,b));a.h[(b&a.Aa)>>>a.c].nb(b&a.l,c&65535,b)}h.Bb=function(a,b){var c=a&this.l,d=(a&this.Aa)>>>this.c;this.i=!1;this.f++;this.h[d].$b(c,b&65535,a);this.f--}; -function Eb(a){for(var b=0,c=[],d=0;da.a.bb)){var g=f[0]?f[0].bind(b):null,k=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)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=f[4],w=0;w>5&3;b.ab=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.wa!=c&&(b.wa=c,Lb(b));b.G&&b.G.aa()}};h.Fc=function(){var a=this.a.Ba;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Gc=function(){return this.a.zb};h.Hc=function(){return this.a.Na}; -h.zd=function(a){var b=this.a;1170>b.bb&&(a&=-49);b.Na!=a&&(b.Na=a,b.Nb=a&16?4194303:262143,Lb(b),b.G&&b.G.aa())};h.gd=function(a){a=a>>1&63;var b=this.a.Za[a>>1];return a&1?b>>16:b&65535};h.Zd=function(a,b){b=b>>1&63;var c=b>>1;this.a.Za[c]=b&1?this.a.Za[c]&65535|(a&63)<<16:this.a.Za[c]&-65536|a&65534};h.$c=function(a){return this.a.H[1][a>>1&7]};h.Sd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Yc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Qd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; -h.Zc=function(a){return this.a.Y[1][a>>1&7]};h.Rd=function(a,b){b=b>>1&7;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Xc=function(a){return this.a.Y[1][(a>>1&7)+8]};h.Pd=function(a,b){b=(b>>1&7)+8;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Bc=function(a){return this.a.H[0][a>>1&7]};h.vd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.zc=function(a){return this.a.H[0][(a>>1&7)+8]};h.td=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Ac=function(a){return this.a.Y[0][a>>1&7]}; -h.ud=function(a,b){b=b>>1&7;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.yc=function(a){return this.a.Y[0][(a>>1&7)+8]};h.sd=function(a,b){b=(b>>1&7)+8;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.fd=function(a){return this.a.H[3][a>>1&7]};h.Yd=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.dd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Wd=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.ed=function(a){return this.a.Y[3][a>>1&7]};h.Xd=function(a,b){b=b>>1&7;this.a.Y[3][b]=a;this.a.H[3][b]&=65295}; -h.cd=function(a){return this.a.Y[3][(a>>1&7)+8]};h.Vd=function(a,b){b=(b>>1&7)+8;this.a.Y[3][b]=a;this.a.H[3][b]&=65295};h.La=function(a){a&=7;return this.a.B&2048?this.a.Fa[a]:this.a.g[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.g[b]=a};h.Mc=function(){return this.a.B&49152?this.a.na[0]:this.a.g[6]};h.Ed=function(a){this.a.B&49152?this.a.na[0]=a:this.a.g[6]=a};h.Pc=function(){return this.a.g[7]};h.Hd=function(a){this.a.g[7]=a}; -h.Ma=function(a){a&=7;return this.a.B&2048?this.a.g[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.g[b]=a:this.a.Fa[b]=a};h.Nc=function(){return 1==(this.a.B&49152)>>14?this.a.g[6]:this.a.na[1]};h.Fd=function(a){1==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.na[1]=a};h.Oc=function(){return 3==(this.a.B&49152)>>14?this.a.g[6]:this.a.na[3]};h.Gd=function(a){3==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.na[3]=a};h.wc=function(a){return this.a.Wb[a-65504>>1]}; -h.qd=function(a,b){this.a.Wb[b-65504>>1]=a};h.Sb=function(a){return 65520==a?61183:0};h.Zb=function(){};h.bd=function(){return 1};h.Ud=function(){};h.vc=function(){return this.a.M};h.pd=function(){this.a.M=0};h.Dc=function(){return this.a.Vb};h.xd=function(a,b){b&1||(a&=255);this.a.Vb=a};h.Ic=function(a){return a?this.a.Ab:0};h.Ad=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Ab=a;b.u|=2};h.ad=function(a){return a?this.a.Ca&65280:0};h.Td=function(a){this.a.Ca=a|255}; -h.Lc=function(){return kb(this.a)};h.Dd=function(a){Mb(this.a,a&-1809|kb(this.a)&1808);this.a.u|=128};h.Yb=function(){}; -var M={},L=(M[61568]=[null,null,K.prototype.gd,K.prototype.Zd,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.$c,K.prototype.Sd,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Yc,K.prototype.Qd,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Zc,K.prototype.Rd,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Xc,K.prototype.Pd,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.Bc,K.prototype.vd,"KISDR",8,1145],M[62672]=[null,null,K.prototype.zc,K.prototype.td,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.Ac, -K.prototype.ud,"KISAR",8,1145],M[62704]=[null,null,K.prototype.yc,K.prototype.sd,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.Hc,K.prototype.zd,"MMR3",1,1145],M[65382]=[null,null,K.prototype.Cc,K.prototype.wd,"LKS"],M[65402]=[null,null,K.prototype.Ec,K.prototype.yd,"MMR0",1,1145],M[65404]=[null,null,K.prototype.Fc,K.prototype.Yb,"MMR1",1,1145],M[65406]=[null,null,K.prototype.Gc,K.prototype.Yb,"MMR2",1,1145],M[65408]=[null,null,K.prototype.fd,K.prototype.Yd,"UISDR",8,1145],M[65424]=[null,null,K.prototype.dd, -K.prototype.Wd,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.ed,K.prototype.Xd,"UISAR",8,1145],M[65456]=[null,null,K.prototype.cd,K.prototype.Vd,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.La,K.prototype.Oa,"R0SET0"],M[65473]=[null,null,K.prototype.La,K.prototype.Oa,"R1SET0"],M[65474]=[null,null,K.prototype.La,K.prototype.Oa,"R2SET0"],M[65475]=[null,null,K.prototype.La,K.prototype.Oa,"R3SET0"],M[65476]=[null,null,K.prototype.La,K.prototype.Oa,"R4SET0"],M[65477]=[null,null,K.prototype.La,K.prototype.Oa, -"R5SET0"],M[65478]=[null,null,K.prototype.Mc,K.prototype.Ed,"R6KERNEL"],M[65479]=[null,null,K.prototype.Pc,K.prototype.Hd,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ma,K.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ma,K.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ma,K.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ma,K.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ma,K.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ma, -K.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Nc,K.prototype.Fd,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Oc,K.prototype.Gd,"R6USER",1,1145],M[65504]=[null,null,K.prototype.wc,K.prototype.qd,"CTRL",1,1170],M[65520]=[null,null,K.prototype.Sb,K.prototype.Zb,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Sb,K.prototype.Zb,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.bd,K.prototype.Ud,"SYSID",1,1170],M[65526]=[null,null,K.prototype.vc,K.prototype.pd,"CPUERR",1,1170],M[65528]= -[null,null,K.prototype.Dc,K.prototype.xd,"MB",1,1170],M[65530]=[null,null,K.prototype.Ic,K.prototype.Ad,"PIR"],M[65532]=[null,null,K.prototype.ad,K.prototype.Td,"SL"],M[65534]=[null,null,K.prototype.Lc,K.prototype.Dd,"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]; -Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),Ub(this,Qb?Vb:Wb);else{a=this.a=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&I(this.h,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},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ta=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Tb(a,b)},oa:function(a,b,c){this.l?this.f(a,b,c):this.Fb(a,b,c)},sa:function(a,b,c){this.l?this.f(a,b,c):this.$b(a,b,c)},G:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&I(this.h,b,64);return this.c.getUint16(a,!0)},ba:function(a,b){a&1&&I(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.ta=!0},pa:function(a,b){this.o[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&I(this.h, -c,64);this.c.setUint16(a,b,!0);this.ta=!0},va:function(a,b,c){a&1&&I(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function rb(a,b,c){a.C=b;a.i=a.m=0;c&&((a.i=c.i)&&Yb(a,Zb,!1),(a.m=c.m)&&$b(a,Zb,!1))}function $b(a,b,c){c&&a.m||(a.Eb=!a.l&&b[1]||a.f,a.nb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Fb=b[1]||a.f,a.$b=b[3]||a.A}function Yb(a,b,c){c&&a.i||(a.xb=b[0]||a.v,a.W=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Tb=b[2]||a.w}function Ub(a,b){b||(b=ac);Yb(a,b,void 0);$b(a,b,void 0)} -var ac=[],Xb=[H.prototype.N,H.prototype.qa,H.prototype.ca,H.prototype.wa],Zb=[H.prototype.F,H.prototype.oa,H.prototype.R,H.prototype.sa];if(Xa)var Wb=[H.prototype.G,H.prototype.la,H.prototype.O,H.prototype.ra],Vb=[H.prototype.J,H.prototype.pa,H.prototype.ba,H.prototype.va]; -function bc(a,b){x.call(this,"CPU",a,bc);var c=a.multiplier||1;this.ib=a.cycles||b;this.ra=c;this.vb=Math.round(this.ib/1E4)/100;this.va=this.vb*this.ra;this.j.U=!1;this.j.Cb=!1;this.j.Va=a.autoStart;this.j.eb=!1;this.fb=this.Ha=0;this.gb=a.csStart;this.Ra=a.csInterval;this.Sa=a.csStop;this.J=[];this.Rb=this.ld.bind(this);E(this)}z(bc);var ec=["power","reset"];h=bc.prototype; -h.ia=function(a,b,c,d){this.l=a;this.h=b;this.C=d;this.G=a.G;for(b=0;ba.pa/a.va&&(b=1);a.ra=b;b=a.vb*a.ra;if(a.va!=b){a.va=b;b=a.va.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&lc(a.l)}a.O+=a.la;a.la=0;a.ca=ra();a.qa=0;jc(a)}function Hb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Jb(a,b,c){0<=b&&ba.J[b][0]&&(c=a.ib*a.ra/1E3*c|0,a.J[b][0]=c+mc(a))}function mc(a,b){var c=a.Ga-=a.a;a.a=a.I=0;b&&(a.Ga=0);return c} -h.ld=function(){if(this.j.U){this.wb>=this.ib&&jc(this,!0);this.Ua=0;this.cb=ra();if(this.qa){var a=this.cb-this.qa;a>this.Pb&&(this.ca+=a,this.ca>this.cb&&(this.ca=this.cb))}try{do{for(var b,c=this.j.eb?1:this.kb,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.lb(b)}catch(l){if("number"!=typeof l)throw l;}b=mc(this,!0);this.Ua+=b;this.la+=b;a=b;if(this.j.eb){var f=!1;this.fb=this.fb+this.Jb()|0;this.Ha-=a;0>=this.Ha&&(this.Ha+=this.Ra,f=!0);0<=this.Sa&&this.Sa<= -kc(this)&&(this.Ra=this.Sa=-1,hc(this),F(this),f=!0);f&&this.T(kc(this)+" cycles: checksum="+m(this.fb))}for(var a=b,g=this.J.length-1;0<=g;g--){var k=this.J[g];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.Ta-=b;if(0>=this.Ta){this.Ta+=this.kb;15<=++this.Qb&&(this.l&&this.l.aa(),this.Qb=0);break}}while(this.j.U)}catch(l){F(this);this.l&&this.l.stop(ra(),kc(this));b=l.stack||l.message;this.j.error=!0;this.D(b);return}if(this.j.U){b=setTimeout;c=this.Rb;this.qa=ra();d=this.Pb;this.Ua&&(d=Math.round(d* -this.Ua/this.kb));d-=this.qa-this.cb;if(e=this.qa-this.ca)this.pa=Math.round(this.la/(10*e))/100,864E5<=e&&(this.O=0,ic(this));if(0>d||this.pad&&(this.ca-=d),d=0;this.wb+=this.Ua;this.qa+=d;b(c,d)}}};function hb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.U)a.T(a.toString()+" busy");else{ic(a);a.j.U=!0;a.j.Cb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.ca,kc(a));setTimeout(a.Rb,0)}}h.lb=function(){return 0}; -function F(a){var b=!1;if(a.j.U){mc(a);a.O+=a.la;a.la=0;a.j.U=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),kc(a));b=!0}a.j.complete=void 0;return b}function nc(a){this.bb=+a.model||1170;this.Lb=a.addrReset||0;bc.call(this,a,6666667);this.decode=1120==this.bb?oc.bind(this):pc.bind(this);qc(this);this.sa=0;this.R=null;this.j.complete=!1}z(nc,bc);h=nc.prototype;h.reset=function(){this.status("model "+this.bb);this.j.U&&F(this);qc(this);gc(this);this.j.error=!1;this.parent.reset.call(this)}; -function qc(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.Lb];a.Fa=[0,0,0,0,0,0];a.na=[0,0,0,0];a.v=0;a.ab=0;a.sc=[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.Y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Za=[0,0,0,0,0,0,0,0,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.Wb=[0,0,0,0,0,0,0,0];a.Vb=0;a.u=0;a.A=a.F=0;a.c=a.b=a.tb=0;a.Ia=-1;gb(a)}function gb(a){a.Ca=255;a.M=0;a.Ab=0;a.w=0;a.Ba=0;a.zb=0;a.Na=0;a.wa=0;a.$a=0;a.Nb=262143;a.R=null;a.h&&Lb(a)}function Lb(a){a.wa?(a.ba=65536,a.N=a.ic,a.W=a.hd,a.nb=a.$d,tb(a.h,a.Na&16?22:18)):(a.ba=0,a.N=a.hc,a.W=a.Ub,a.nb=a.ac,tb(a.h,16))}function rc(a,b,c){a.Lb=b;O(a,b);!c&&a.C&&(F(a)||a.C.aa())}h.Jb=function(){return 0}; -h.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.O,this.ra]);a.set(2,Eb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.O=b[1];ic(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.na[c]=a.g[6],a.g[6]=a.na[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function uc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function vc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function wc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function xc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} -function J(a,b,c){if(!a.sa){var d=!1;0>a.Ia?a.Ia=kb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ba=63222,a.zb=b);a.v=0;var e=a.W(b|a.ba),f=a.W(b+2&65535|a.ba);Mb(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);yc(a,a.Ia);yc(a,a.g[7]);O(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function zc(a){var b=Ac(a),c=Ac(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);O(a,b);Mb(a,c);a.u&=-17} -function Bb(a,b){var c=b>>13&31;31>c&&a.Na&32&&(b=a.Za[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} -function Bc(a,b,c){var d,e,f,g=0;d=b>>13;a.Na&a.sc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[a.v][d]<<6)+(b&8191)&a.Nb;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.$a=a.v,a.ab=d;b=!1;g&&(g&57344&&(0<=a.Ia&&(g|=128),a.w&57344||(a.w=a.w|g|a.$a<<5|a.ab<<1),b=!0),a.w&61440||!(4191360> -f||4194239>>a.c].Eb(b&a.l,c&255,b)}function Ac(a){var b=a.W(a.g[6]|a.ba);a.g[6]=a.g[6]+2&65535;return b}function yc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w&57344||(a.Ba=a.Ba<<8|246);!a.v&&c<=a.Ca&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.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.W(e)|g;a.a-= -8;break;case 6:return e=a.W(tc(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.W(tc(a,2)),e=e+a.g[c]&65535,e=a.W(e|a.ba)|g,a.a-=10,e}a.g[c]=a.g[c]+f&65535;!g||a.w&57344||(a.Ba=a.Ba<<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.M|=4,a.g[6]=4,J(a,4,24)):(a.M|=8,a.u|=64));return e}h.sb=function(a){if(!this.wa)return this.h.sb(a);this.sa++;a=this.Ub(Bc(this,a,2));this.sa--;return a}; -h.Ya=function(a,b){this.wa?(this.sa++,Cc(this,Bc(this,a,5),b),this.sa--):this.h.Ya(a,b)};h.Bb=function(a,b){this.wa?(this.sa++,this.ac(Bc(this,a,4),b),this.sa--):this.h.Bb(a,b)};h.hc=function(a,b,c){return Dc(this,a,b,c)};h.ic=function(a,b,c){return Bc(this,Dc(this,a,b,c),c)};h.Ub=function(a){return Cb(this.h,a)};h.hd=function(a){return Cb(this.h,Bc(this,a,2))};h.ac=function(a,b){Db(this.h,a,b&65535)};h.$d=function(a,b){Db(this.h,Bc(this,a,4),b)}; -function Ec(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Dc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.ba),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.g[d]:a.na[a.B>>12&3];return c}function Fc(a,b,c,d){a.w&57344||(a.Ba=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Dc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Bc(a,e|c&65536,4),a.v=a.B>>14&3,Db(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.g[e]=d:a.na[a.B>>12&3]=d} -function Gc(a,b){b>>=6;var c=a.F=b&7;(b=a.A=(b&56)>>3)?(c=a.N(b,c,3),a=Ab(a.h,c)):a=a.g[c]&255;return a}function Hc(a,b){b>>=6;var c=a.F=b&7;return(b=a.A=(b&56)>>3)?Cb(a.h,a.N(b,c,2)):a.g[c]}function Ic(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Dc(a,b,c,8)}function Jc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.N(b,c,3),a=Ab(a.h,c)):a=a.g[c]&255;return a}function Kc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Cb(a.h,a.N(b,c,2)):a.g[c]} -function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.tb=a.N(b,e,7),Cc(a,e,d.call(a,c,Ab(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.N(b,e,6),Db(a.h,e,d.call(a,c,Cb(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Lc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Cc(a,a.N(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} -function Mc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Db(a.h,a.N(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} -h.lb=function(a){this.j.complete=!0;var b=a?this.j.Cb?0:1:-1;this.j.Cb=!1;this.Ga=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.Ab&224)>>5,e=this.R&&this.R.Ka>d?this.R:null;e&&(c=e.nd,d=e.Ka);d>(this.B&224)>>5?(this.u&4&&(tc(this,2),this.u&=-5),J(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.R,e==a)this.R=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= -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(sc(this))}while(0>1|b<<16;wc(this,a);return a&65535}function Sc(a,b){a=b&2048|b>>1|b<<8;wc(this,a<<8);return a&255}function Tc(a,b){a=b&~a;R(this,a);return a}function Uc(a,b){a=b&~a;R(this,a<<8);return a}function Vc(a,b){a|=b;R(this,a);return a}function Wc(a,b){a|=b;R(this,a<<8);return a}function Xc(a,b){a=~b|65536;uc(this,a);return a&65535}function Yc(a,b){a=~b|256;uc(this,a<<8);return a&255} -function Zc(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function $c(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 ad(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function bd(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 cd(a,b){a=-b;uc(this,a,a&b&32768);return a&65535}function dd(a,b){a=-b;uc(this,a<<8,(a&b&128)<<8);return a&255} -function ed(a,b){a=b<<1|this.m>>16&1;wc(this,a);return a&65535}function fd(a,b){a=b<<1|this.m>>16&1;wc(this,a<<8);return a&255}function gd(a,b){a=(this.m&65536|b)>>1|b<<16;wc(this,a);return a&65535}function hd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;wc(this,a<<8);return a&255}function id(a,b){var c=b-a;xc(this,c,a,b);return c&65535}function jd(a,b){var c=b-a;xc(this,c<<8,a<<8,b<<8);return c&255}function kd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} -function ld(a,b){a^=b;R(this,a);return a&65535}function md(a){U(this,a,Hc(this,a),Nc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function nd(a){var b=Kc(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;else if(b)if(16>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 od(a){var b=Kc(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-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function pd(a){V(this,a,!Q(this))}function qd(a){V(this,a,Q(this))} -function rd(a){U(this,a,Hc(this,a),Tc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function sd(a){S(this,a,Gc(this,a),Uc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function td(a){U(this,a,Hc(this,a),Vc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function ud(a){S(this,a,Gc(this,a),Wc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} -function vd(a){R(this,Hc(this,a)&Kc(this,a));this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function wd(a){R(this,(Gc(this,a)&Jc(this,a))<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function xd(a){V(this,a,this.i&65535?0:4)}function yd(a){V(this,a,!this.ya()==!(this.f&32768))}function zd(a){V(this,a,!!(this.i&65535)&&!this.ya()==!(this.f&32768))}function Ad(a){V(this,a,!Q(this)&&!!(this.i&65535))} -function Bd(a){V(this,a,(this.i&65535?0:4)||!this.ya()!=!(this.f&32768))}function Cd(a){V(this,a,Q(this)||(this.i&65535?0:4))}function Dd(a){V(this,a,!this.ya()!=!(this.f&32768))}function Ed(a){V(this,a,this.ya())}function Fd(a){V(this,a,!!(this.i&65535))}function Gd(a){V(this,a,!this.ya())}function Hd(){J(this,12,1);this.a-=5}function Id(a){V(this,a,!0)}function Jd(a){V(this,a,!(this.f&32768))}function Kd(a){V(this,a,this.f&32768?2:0)} -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 Ld(a){var b=Hc(this,a);a=Kc(this,a);xc(this,b-a,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Md(a){var b=Gc(this,a)<<8;a=Jc(this,a)<<8;xc(this,b-a,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)} -function Nd(a){var b=Kc(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 Od(){J(this,24,2);this.a-=25} -function Pd(){this.B&49152?(this.M|=128,J(this,4,3)):this.C?this.C.b():F(this);this.a-=7}function Qd(){J(this,16,4);this.a-=25}var Rd=[0,7,7,10,7,11,9,13];function Sd(a){this.I=this.a;O(this,Ic(this,a));this.a=this.I-Rd[this.c]}var Td=[0,14,14,17,14,18,16,20];function Ud(a){this.I=this.a;var b=Ic(this,a);a=a>>6&7;yc(this,this.g[a]);this.g[a]=this.g[7];O(this,b);this.a=this.I-Td[this.c]}var Vd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function Wd(a){var b=Hc(this,a);this.I=this.a;R(this,Mc(this,a,b));this.a=this.I-Vd[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Xd(a){var b=Gc(this,a);R(this,Lc(this,a,b,1)<<8);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var Yd=[7,13,13,17,14,18,17,21]; -function Zd(a){var b=Kc(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>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 ee(a){U(this,a,Hc(this,a),id);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} -function fe(a){U(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)}function ge(){J(this,28,5);this.a-=5}function he(){this.u&4||this.l.aa();this.u|=4;tc(this,-2);this.a-=3}function ie(a){U(this,a,Hc(this,a),ld);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,6)}function oc(a){je[a>>12].call(this,a)}function ke(a){le[a>>6&3].call(this,a)}function me(a){ne[a>>6&3].call(this,a)}function oe(a){pe[a>>6&3].call(this,a)}function qe(a){re[a&15].call(this,a)}function se(a){te[a&15].call(this,a)} -function ue(a){ve[a>>6&3].call(this,a)}function we(a){xe[a>>6&3].call(this,a)}function ye(a){ze[a>>6&3].call(this,a)} -var je=[function(a){Ae[a>>8&15].call(this,a)},Wd,Ld,vd,rd,td,md,Y,function(a){Be[a>>8&15].call(this,a)},Xd,Md,wd,sd,ud,ee,Y],Ae=[function(a){Ce[a>>4&15].call(this,a)},Id,Fd,xd,yd,Dd,zd,Bd,Ud,Ud,ke,me,oe,Y,Y,Y],le=[function(a){uc(this,Mc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Zc);this.a-=this.c?9:3+(7==this.b?2:0)}],ne=[function(a){U(this,a,0, -cd);this.a-=this.c?11:6},function(a){U(this,a,Q(this)?1:0,Nc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,Q(this)?1:0,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Kc(this,a);uc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],pe=[function(a){U(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ed);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,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)}], -Ce=[function(a){De[a&15].call(this,a)},Y,Y,Y,Sd,Sd,Sd,Sd,ce,Y,qe,se,fe,fe,fe,fe],De=[Pd,he,be,Hd,Qd,ae,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],re=[$d,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],te=[$d,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],Be=[Gd,Ed,Ad,Cd,Jd,Kd,pd,qd,Od,ge,ue,we,ye,Y,Y,Y],ve=[function(a){uc(this, -Lc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,$c);this.a-=this.c?9:3+(7==this.b?2:0)}],xe=[function(a){S(this,a,0,dd);this.a-=this.c?11:6},function(a){S(this,a,Q(this)?1:0,Oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,Q(this)?1:0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Jc(this,a);uc(this,a<<8);this.a-=this.c?4:3+(7==this.b? -2:0)}],ze=[function(a){S(this,a,0,hd);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Sc);this.a-=this.c?9+(this.tb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)}];function pc(a){Ee[a>>12].call(this,a)} -var Ee=[function(a){Fe[a>>8&15].call(this,a)},Wd,Ld,vd,rd,td,md,function(a){Ge[a>>8&15].call(this,a)},function(a){He[a>>8&15].call(this,a)},Xd,Md,wd,sd,ud,ee,Y],Fe=[function(a){Ie[a>>4&15].call(this,a)},Id,Fd,xd,yd,Dd,zd,Bd,Ud,Ud,ke,me,oe,function(a){Je[a>>6&3].call(this,a)},Y,Y],Je=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.W(a|this.ba);O(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Ec(this,a,0);yc(this,a);R(this,a);this.a-=11},function(a){var b=Ac(this);this.I= -this.a;Fc(this,a,0,b);R(this,b);this.a=this.I-Yd[this.c]},function(a){R(this,Mc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ie=[function(a){Ke[a&15].call(this,a)},Y,Y,Y,Sd,Sd,Sd,Sd,ce,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)},qe,se,fe,fe,fe,fe],Ke=[Pd,he,be,Hd,Qd,ae,function(){zc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Ge=[Zd,Zd,Nd,Nd,nd,nd,od,od,ie,ie,Y,Y,Y,Y,de,de],He=[Gd,Ed,Ad,Cd,Jd,Kd,pd,qd,Od,ge,ue,we,ye,function(a){Le[a>>6& -3].call(this,a)},Y,Y],Le=[Y,function(a){a=Ec(this,a,65536);yc(this,a);R(this,a);this.a-=11},function(a){var b=Ac(this);this.I=this.a;Fc(this,a,65536,b);R(this,b);this.a=this.I-Yd[this.c]},Y]; -function Me(a){x.call(this,"ROM",a,Me);this.X=this.b=null;this.i=a.addr;this.c=a.size;this.f=a.alias;this.l=a.file;this.m=q(this.l);if(this.l){a=this.l;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.D("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Sa(c.oa,a,b),(a=ta(a,b))?(c.b=a.K,c.X=a.X):c.l=null);Ne(c)})}}z(Me);Me.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.C=d;Ne(this)}; -Me.prototype.ka=function(){this.X&&(this.C&&this.C.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Me.prototype.ja=function(){return!0}; -function Ne(a){if(!Wa(a)){if(a.l){if(!a.b||!a.h)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.j.error=!0;a.D(b)}else{b=a.i;if(wb(a.h,b,a.c,Tb)){var c;for(c=0;c>>a.c;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=k,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Ya(p++,b[t++]&255);else p&1?F(a.a):rc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&Ib(e.a,e.ba))});this.ca=Kb(52,4);this.O=Hb(this.a,function(){e.c|=128;e.c&64&&Ib(e.a,e.ca)});$a(b,this,Te);E(this)}; -h.Kb=function(){if(!this.v){var a=fc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Qa)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.oa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Kb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ja=function(a){return a?this.save():!0};h.reset=function(){Ue(this)};h.save=function(){var a=new P(this);a.set(0,[]);return a.data()};h.restore=function(){return Ue(this)};function Ue(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.yb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.F&&!this.s&&c&&(b=String.fromCharCode(this.F)+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.T(this.m), -this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Jb(this.a,this.O,1E3/Math.round(this.I/10))}};var Ve={},Te=(Ve[65392]=[null,null,Z.prototype.Rc,Z.prototype.Jd,"RCSR"],Ve[65394]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RBUF"],Ve[65396]=[null,null,Z.prototype.kd,Z.prototype.be,"XCSR"],Ve[65398]=[null,null,Z.prototype.jd,Z.prototype.ae,"XBUF"],Ve);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");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= -d.o.listTapes;a&&Ye(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ye(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; -h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.C=d;this.J=Ze(a);var e=this;if((this.c=fc(this.l,"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=Kb(56,4);this.R=Hb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.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 k=0>g&&a.l&&!a.l.j.P;g?a.D('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.oa,e,f),(e=ta(e,f))&&hf(a,b,c,d,e.K,e.ga,e.fa)); -a.j.Ea=!1;a.m&&(a.m--,a.m||E(a));ef(a)})}function bf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;dc.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.rb?"":e)+"&format=json"));return!!r(f, -null,!0,function(b,c,d){pf(a,b,c,d)})} -function pf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.P;if(d)a.controller.D('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{Sa(a.controller.oa,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)u(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var T=n<<2,va=w.length;va>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.da?f=a.ma+a.da&&(a.da+=f-(a.ma+a.da)+1):(a.ma=f,a.da=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ -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(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.D("Unable to restore disk '"+this.ua+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=rf(this,a++);)tf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function tf(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}z(N);h=N.prototype; -h.$=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(k){u("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&uf(d,a)},!0;case "loadDrive":return this.o[b]= -c,c.onclick=function(){var a=d.o.listDisks;a&&vf(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.ea){var b;b="";for(var c=0,k;k=rf(a,c++);)for(var l=0,n=k.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";uf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){wf(this)};h.save=function(){return(new P(this)).data()}; -h.restore=function(a){return wf(this,a[0])};function zf(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;gg||9e||e>=a.b.length)a.D("Unable to load the selected drive");else if(c)if("?"==c)a.D('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+'"')}Bf(a,e,b,c,!1,d)}else Af(a,e)} -function Bf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Da.toLowerCase()!=d.toLowerCase()&&(g++,Af(a,b,!0),k.qb?a.D("RL11 busy"):(k.qb=!0,e&&(k.pb=!0,a.s++),k.hb=!!f,of(new kf(a,k,"preload"),c,d,f,a.ec)&&g++));return g} -h.ec=function(a,b,c,d,e){var f;a.qb=!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.V||f[1]>a.Z)&&(this.D('Disk "'+c+'" too large for drive '+("RL"+a.ub)),b=null);b?(a.ea=b,a.ua=c,a.Da=d,this.D('Mounted disk "'+c+'" in drive '+("RL"+a.ub),a.pb||e),this.l&&lc(this.l)):a.hb=!1;a.pb&&(a.pb=!1,--this.s||E(this));uf(this,a.ub)}; -function yf(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>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.L=this.L|a|32768);return!0}; -h.xc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ea,n=null,p;e--;){if(!n){n=a.ea.seek(b,c,d+1);if(!n){k=5120;break}p=0}var t,w;if(0>(t=a.ea.read(n,p++))||0>(w=a.ea.read(n,p++))){k=5120;break}Db(this.h,f,t|w<<8);if(Gb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.rd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ea,n=null,p;e--;){var t=Cb(this.h,f);if(Gb(this.h)){k=8192;break}f+=2;if(!n){n=a.ea.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ea.write(n,p++,t&255)||!a.ea.write(n,p++,t>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Uc=function(){return this.L&65535}; -h.Md=function(a){this.L=this.L&-1023|a&1022;this.G=this.G&-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.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.xc;case 10:b||(b=this.rd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.V||f>=c.S?this.L|=37888:(g=(this.w& -63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.fc.bind(this)))}a&&(this.L|=129,this.L&64&&Ib(this.a,this.F))}};h.Sc=function(){return this.v};h.Kd=function(a){this.v=a&65534};h.Vc=function(){return this.c};h.Nd=function(a){this.c=a};h.Wc=function(){return this.m};h.Od=function(a){this.m=a};h.Tc=function(){return this.w};h.Ld=function(a){this.w=a&63}; -var Cf={},xf=(Cf[63744]=[null,null,N.prototype.Uc,N.prototype.Md,"RLCS"],Cf[63746]=[null,null,N.prototype.Sc,N.prototype.Kd,"RLBA"],Cf[65284]=[null,null,N.prototype.Vc,N.prototype.Nd,"RLDA"],Cf[65286]=[null,null,N.prototype.Wc,N.prototype.Od,"RLMP"],Cf[65288]=[null,null,N.prototype.Tc,N.prototype.Ld,"RLBE"],Cf); -function Df(a,b,c){x.call(this,"Computer",a,Df);this.j.P=!1;Ef(this,b);this.w=fc(this,"autoPower",a);this.l=0;this.N=a.busWidth||a.buswidth;this.b=Ff;this.s=null;this.i=this.I=!1;this.O=fc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Gf(this);if(this.a=Ua("CPU",this.id)){this.C=Ua("Debugger",this.id);this.h=new mb({id:this.oa+".bus",busWidth:this.N},this.a,this.C);var d,e=A(this.id);if((this.G=Ua("Panel",this.id))&&this.G.Wa)for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bFf){if(Hf(d,this.s)){this.f=new P(this,"1.30.2","failsafe");Hf(this.f)&&(Mf(this,d),a=2,Nf(this.f));this.f.set("timestamp",sa());Of(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Lf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Hf(d,g):("error"== -f&&"no machine state"!=g?(this.D("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Nf(d),Hf(d)?(c=Lf(d),e=!0):c=!1))}e&&Kf(this,c?d:null)}else 2==a&&d.clear()}else Kf(this);delete this.s;delete this.v}e=A(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.j.P=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Pf(this,this.a,b,c,a),this.a.Va());this.F&&(Mf(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; -function Mf(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} -function Sf(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);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.ja&&(c&&F(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.P=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],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]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Zf(a,b,c)}})}else c(a,null)} -function $f(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--Wf||Ja(!0));l=!1}var g,k,l=!0;Wf++;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|| -(c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,k){k?Xf(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--Wf||Ja(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Wf||Ja(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Xf(b,a,d,!0,e,n):Yf(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 $f(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map +x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},$: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.Va=this.o[b]=c,c.value="",this.T=function(a){return function(b,c){8192a;a++)this.b["S"+a]=[0,!1,!1,this.sc,a]}z(Za);h=Za.prototype;h.reset=function(){this.A=this.A&-120|20}; +h.$=function(a,b,c,d){if(this.j&&this.j.$(a,b,c,d)||this.a&&this.a.$(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.s++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.m[b]=d?1:0,this.s++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c=a.b[b];$a(a, +b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.v="DEP"==b;a.w="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.b[b];c[1]&&c[2]&&($a(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.$.call(this,a,b,c,d)}};h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.C=d;ab(b,this,bb);cb(b,this.reset.bind(this));db(this);for(var e in this.b)$a(this,e,this.b[e][0])};h.ja=function(a,b){b||(eb(),this.stop());return!0};h.ia=function(){return!0}; +function fb(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function db(a,b){for(var c in a.m)fb(a,c,null!=b?b:a.m[c])}function $a(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a,b,c,d){a.o[b]&&(void 0===c&&(Xa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.C&&a.C.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))} +h.qc=function(a){a||this.a.l.U||(this.h.reset(),hb(this.a),this.b.ENABLE&&this.b.ENABLE[0]&&ib(this.a))};h.rc=function(){};h.mc=function(a){a||G(this.a)};h.kc=function(a){if(!a&&!this.a.l.U)if(this.b.ENABLE&&this.b.ENABLE[0])ib(this.a);else{a=this.C;var b;if(b=a)a.l.Ea&&(a.l.nb=!0),b=!a.l.Ea;if(b)Va(a,!0),a.kb(0),Va(a,!1);else try{var c=this.a.kb(1);0>2;this.j=this.b-1;this.v=this.A/this.b|0;this.xa=[];this.f=0;this.i=!1;this.s=[];this.ac=[tb,ub,vb,wb];a=new I(this);xb(a,this.C);this.h=Array(this.v);for(b=0;b>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;J(d,b,16);return 255}function ub(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||J(e,c,16)} +function vb(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;J(d,b,16);return 65535}function wb(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||J(e,c,16)}function zb(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.c;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ja)return l.lb+=l.Ja-f,l.Ja=f,!0;if(f>=l.Ja+l.lb){p=l.size-(f-n);p>g&&(p=g);l.lb=f-l.Ja+p;f=n+a.b;g-=p;k++;continue}}return Eb(1,f,g)}f=new I(a,f,p,a.b,d,e);xb(f,a.C,l);a.h[k++]=f;f=n+a.b;g-=p}if(0>=g){c/=1024;var t;e="";t?10>>=a.c;0>>=a.c;0>>a.c].wb(b&a.j,b)}function Ib(a,b){3932160<=b&&(b=Hb(a.a,b));return a.h[(b&a.Aa)>>>a.c].W(b&a.j,b)} +h.tb=function(a){var b=a&this.j,c=(a&this.Aa)>>>this.c;this.i=!1;this.f++;a=this.h[c].Sb(b,a);this.f--;return a};h.Xa=function(a,b){this.i=!1;this.f++;this.h[(a&this.Aa)>>>this.c].Eb(a&this.j,b&255,a);this.f--};function Jb(a,b,c){3932160<=b&&(b=Hb(a.a,b));a.h[(b&a.Aa)>>>a.c].mb(b&a.j,c&65535,b)}h.Ab=function(a,b){var c=a&this.j,d=(a&this.Aa)>>>this.c;this.i=!1;this.f++;this.h[d].Zb(c,b&65535,a);this.f--}; +function Kb(a){for(var b=0,c=[],d=0;da.a.Za)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null,t=g[5]||1;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var w=g[4],E=0;E>5&3;b.ab=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Fa!=c&&(b.Fa=c,Sb(b))}};h.Ec=function(){var a=this.a.Ba;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Fc=function(){return this.a.yb};h.Gc=function(){return this.a.Ga}; +h.yd=function(a){var b=this.a;1170>b.Za&&(a&=-49);b.Ga!=a&&(b.Ga=a,b.Mb=a&16?4194303:262143,Sb(b))};h.fd=function(a){a=a>>1&63;var b=this.a.Ya[a>>1];return a&1?b>>16:b&65535};h.Yd=function(a,b){b=b>>1&63;var c=b>>1;this.a.Ya[c]=b&1?this.a.Ya[c]&65535|(a&63)<<16:this.a.Ya[c]&-65536|a&65534};h.Zc=function(a){return this.a.H[1][a>>1&7]};h.Rd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Xc=function(a){return this.a.H[1][(a>>1&7)+8]};h.Pd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; +h.Yc=function(a){return this.a.Y[1][a>>1&7]};h.Qd=function(a,b){b=b>>1&7;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Wc=function(a){return this.a.Y[1][(a>>1&7)+8]};h.Od=function(a,b){b=(b>>1&7)+8;this.a.Y[1][b]=a;this.a.H[1][b]&=65295};h.Ac=function(a){return this.a.H[0][a>>1&7]};h.ud=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.yc=function(a){return this.a.H[0][(a>>1&7)+8]};h.sd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.zc=function(a){return this.a.Y[0][a>>1&7]}; +h.td=function(a,b){b=b>>1&7;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.xc=function(a){return this.a.Y[0][(a>>1&7)+8]};h.rd=function(a,b){b=(b>>1&7)+8;this.a.Y[0][b]=a;this.a.H[0][b]&=65295};h.ed=function(a){return this.a.H[3][a>>1&7]};h.Xd=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.cd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Vd=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.dd=function(a){return this.a.Y[3][a>>1&7]};h.Wd=function(a,b){b=b>>1&7;this.a.Y[3][b]=a;this.a.H[3][b]&=65295}; +h.bd=function(a){return this.a.Y[3][(a>>1&7)+8]};h.Ud=function(a,b){b=(b>>1&7)+8;this.a.Y[3][b]=a;this.a.H[3][b]&=65295};h.La=function(a){a&=7;return this.a.B&2048?this.a.Ha[a]:this.a.g[a]};h.Na=function(a,b){b&=7;this.a.B&2048?this.a.Ha[b]=a:this.a.g[b]=a};h.Lc=function(){return this.a.B&49152?this.a.ma[0]:this.a.g[6]};h.Dd=function(a){this.a.B&49152?this.a.ma[0]=a:this.a.g[6]=a};h.Oc=function(){return this.a.g[7]};h.Gd=function(a){this.a.g[7]=a}; +h.Ma=function(a){a&=7;return this.a.B&2048?this.a.g[a]:this.a.Ha[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.g[b]=a:this.a.Ha[b]=a};h.Mc=function(){return 1==(this.a.B&49152)>>14?this.a.g[6]:this.a.ma[1]};h.Ed=function(a){1==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.ma[1]=a};h.Nc=function(){return 3==(this.a.B&49152)>>14?this.a.g[6]:this.a.ma[3]};h.Fd=function(a){3==(this.a.B&49152)>>14?this.a.g[6]=a:this.a.ma[3]=a};h.vc=function(a){return this.a.Vb[a-65504>>1]}; +h.pd=function(a,b){this.a.Vb[b-65504>>1]=a};h.Rb=function(a){return 65520==a?61183:0};h.Yb=function(){};h.ad=function(){return 1};h.Td=function(){};h.uc=function(){return this.a.M};h.od=function(){this.a.M=0};h.Cc=function(){return this.a.Ub};h.wd=function(a,b){b&1||(a&=255);this.a.Ub=a};h.Hc=function(a){return a?this.a.zb:0};h.zd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.zb=a;b.u|=2};h.$c=function(a){return a?this.a.Ca&65280:0};h.Sd=function(a){this.a.Ca=a|255}; +h.Kc=function(){return qb(this.a)};h.Cd=function(a){Tb(this.a,a&-1809|qb(this.a)&1808);this.a.u|=128};h.Xb=function(){}; +var N={},M=(N[61568]=[null,null,L.prototype.fd,L.prototype.Yd,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Zc,L.prototype.Rd,"SISDR",8,1145],N[62608]=[null,null,L.prototype.Xc,L.prototype.Pd,"SDSDR",8,1145],N[62624]=[null,null,L.prototype.Yc,L.prototype.Qd,"SISAR",8,1145],N[62640]=[null,null,L.prototype.Wc,L.prototype.Od,"SDSAR",8,1145],N[62656]=[null,null,L.prototype.Ac,L.prototype.ud,"KISDR",8,1145],N[62672]=[null,null,L.prototype.yc,L.prototype.sd,"KDSDR",8,1145],N[62688]=[null,null,L.prototype.zc, +L.prototype.td,"KISAR",8,1145],N[62704]=[null,null,L.prototype.xc,L.prototype.rd,"KDSAR",8,1145],N[62798]=[null,null,L.prototype.Gc,L.prototype.yd,"MMR3",1,1145],N[65382]=[null,null,L.prototype.Bc,L.prototype.vd,"LKS"],N[65402]=[null,null,L.prototype.Dc,L.prototype.xd,"MMR0",1,1145],N[65404]=[null,null,L.prototype.Ec,L.prototype.Xb,"MMR1",1,1145],N[65406]=[null,null,L.prototype.Fc,L.prototype.Xb,"MMR2",1,1145],N[65408]=[null,null,L.prototype.ed,L.prototype.Xd,"UISDR",8,1145],N[65424]=[null,null,L.prototype.cd, +L.prototype.Vd,"UDSDR",8,1145],N[65440]=[null,null,L.prototype.dd,L.prototype.Wd,"UISAR",8,1145],N[65456]=[null,null,L.prototype.bd,L.prototype.Ud,"UDSAR",8,1145],N[65472]=[null,null,L.prototype.La,L.prototype.Na,"R0SET0"],N[65473]=[null,null,L.prototype.La,L.prototype.Na,"R1SET0"],N[65474]=[null,null,L.prototype.La,L.prototype.Na,"R2SET0"],N[65475]=[null,null,L.prototype.La,L.prototype.Na,"R3SET0"],N[65476]=[null,null,L.prototype.La,L.prototype.Na,"R4SET0"],N[65477]=[null,null,L.prototype.La,L.prototype.Na, +"R5SET0"],N[65478]=[null,null,L.prototype.Lc,L.prototype.Dd,"R6KERNEL"],N[65479]=[null,null,L.prototype.Oc,L.prototype.Gd,"R7KERNEL"],N[65480]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Ma, +L.prototype.Oa,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.Mc,L.prototype.Ed,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.Nc,L.prototype.Fd,"R6USER",1,1145],N[65504]=[null,null,L.prototype.vc,L.prototype.pd,"CTRL",1,1170],N[65520]=[null,null,L.prototype.Rb,L.prototype.Yb,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.Rb,L.prototype.Yb,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.ad,L.prototype.Td,"SYSID",1,1170],N[65526]=[null,null,L.prototype.uc,L.prototype.od,"CPUERR",1,1170],N[65528]= +[null,null,L.prototype.Cc,L.prototype.wd,"MB",1,1170],N[65530]=[null,null,L.prototype.Hc,L.prototype.zd,"PIR"],N[65532]=[null,null,L.prototype.$c,L.prototype.Sd,"SL"],N[65534]=[null,null,L.prototype.Kc,L.prototype.Cd,"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]; +Ha(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),ac(this,Xb?bc:cc);else{a=this.a=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},na:function(a,b){a&1&&J(this.h,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},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ta=!0},G:function(a,b){return this.I(a,b)},R:function(a,b){return this.Sb(a,b)},oa:function(a,b,c){this.j?this.f(a,b,c):this.Eb(a,b,c)},sa:function(a,b,c){this.j?this.f(a,b,c):this.Zb(a,b,c)},D:function(a){return this.o[a]},J:function(a){return this.o[a]},P:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},aa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},da:function(a,b){this.o[a]=b;this.ta=!0},pa:function(a,b){this.o[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&J(this.h, +c,64);this.c.setUint16(a,b,!0);this.ta=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function xb(a,b,c){a.C=b;a.i=a.m=0;c&&((a.i=c.i)&&ec(a,gc,!1),(a.m=c.m)&&hc(a,gc,!1))}function hc(a,b,c){c&&a.m||(a.Db=!a.j&&b[1]||a.f,a.mb=!a.j&&b[3]||a.A);if(c||void 0===c)a.Eb=b[1]||a.f,a.Zb=b[3]||a.A}function ec(a,b,c){c&&a.i||(a.wb=b[0]||a.v,a.W=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Sb=b[2]||a.w}function ac(a,b){b||(b=ic);ec(a,b,void 0);hc(a,b,void 0)} +var ic=[],dc=[I.prototype.N,I.prototype.qa,I.prototype.na,I.prototype.wa],gc=[I.prototype.G,I.prototype.oa,I.prototype.R,I.prototype.sa];if(Ya)var cc=[I.prototype.D,I.prototype.da,I.prototype.P,I.prototype.ra],bc=[I.prototype.J,I.prototype.pa,I.prototype.aa,I.prototype.va]; +function jc(a,b){x.call(this,"CPU",a,jc);var c=a.multiplier||1;this.gb=a.cycles||b;this.qa=c;this.sb=Math.round(this.gb/1E4)/100;this.va=this.sb*this.qa;this.l.U=!1;this.l.Bb=!1;this.l.Ua=a.autoStart;this.l.fb=!1;this.cb=this.wa=0;this.eb=a.csStart;this.Qa=a.csInterval;this.Ra=a.csStop;this.I=[];this.Qb=this.kd.bind(this);F(this)}z(jc);var kc=["power","reset"];h=jc.prototype; +h.ha=function(a,b,c,d){this.j=a;this.h=b;this.C=d;for(b=0;b=a.wa&&(a.wa+=a.Qa,c=!0);0<=a.Ra&&a.Ra<=oc(a)&&(a.Qa=a.Ra=-1,nc(a),G(a),c=!0);c&&a.T(oc(a)+" cycles: checksum="+m(a.cb))}} +h.$=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.O)a=!0;else{var b=null,c,k=A(a.id);for(c=0;ca.da/a.va&&(b=1);a.qa=b;b=a.sb*a.qa;if(a.va!=b){a.va=b;b=a.va.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.j&&rc(a.j)}kb(a,a.aa);a.aa=0;a.R=ra();a.oa=0;qc(a)}function Nb(a,b){var c=a.I.length;a.I.push([-1,b]);return c}function Pb(a,b,c){0<=b&&ba.I[b][0]&&(c=a.gb*a.qa/1E3*c|0,a.I[b][0]=c+sc(a))} +function jb(a,b){for(var c=a.I.length-1;0<=c;c--){var d=a.I[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function sc(a,b){var c=a.pa-=a.a;a.a=a.G=0;b&&(a.pa=0);return c} +h.kd=function(){if(this.l.U){this.ub>=this.gb&&qc(this,!0);this.Ta=0;this.bb=ra();if(this.oa){var a=this.bb-this.oa;a>this.Nb&&(this.R+=a,this.R>this.bb&&(this.R=this.bb))}try{do{for(var b,c=this.l.fb?1:this.hb,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.kb(b)}catch(f){if("number"!=typeof f)throw f;}b=sc(this,!0);this.Ta+=b;this.aa+=b;lb(this,b);jb(this,b);this.Sa-=b;if(0>=this.Sa){this.Sa+=this.hb;15<=++this.Ob&&(this.j&&this.j.ka(),this.Ob=0);break}}while(this.l.U)}catch(f){G(this); +this.j&&this.j.stop(ra(),oc(this));Xa(this,f.stack||f.message);return}if(this.l.U){a=setTimeout;b=this.Qb;this.oa=ra();c=this.Nb;this.Ta&&(c=Math.round(c*this.Ta/this.hb));c-=this.oa-this.bb;if(d=this.oa-this.R)this.da=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.sa=0,pc(this));if(0>c||this.dac&&(this.R-=c),c=0;this.ub+=this.Ta;this.oa+=c;a(b,c)}}}; +function ib(a){var b;a.l.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.l.U)a.T(a.toString()+" busy");else{pc(a);a.l.U=!0;a.l.Bb=!0;if(b=a.o.run)b.textContent="Halt";a.j&&a.j.start(a.R,oc(a));setTimeout(a.Qb,0)}}h.kb=function(){return 0};function G(a){var b=!1;if(a.l.U){sc(a);kb(a,a.aa);a.aa=0;a.l.U=!1;if(b=a.o.run)b.textContent="Run";a.j&&a.j.stop(ra(),oc(a));b=!0}a.l.complete=void 0;return b} +function tc(a){this.Za=+a.model||1170;this.Jb=a.addrReset||0;jc.call(this,a,6666667);this.decode=1120==this.Za?uc.bind(this):vc.bind(this);wc(this);this.ra=0;this.N=null;this.l.complete=!1}z(tc,jc);h=tc.prototype;h.reset=function(){this.status("model "+this.Za);this.l.U&&G(this);wc(this);mc(this);this.l.error=!1;this.parent.reset.call(this)}; +function wc(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.Jb];a.Ha=[0,0,0,0,0,0];a.ma=[0,0,0,0];a.v=0;a.ab=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.Y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Ya=[0,0,0,0,0,0,0,0,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.Vb=[0,0,0,0,0,0,0,0];a.Ub=0;a.u=0;a.A=a.D=0;a.c=a.b=a.rb=0;a.Ia=-1;hb(a)}function hb(a){a.Ca=255;a.M=0;a.zb=0;a.w=0;a.Ba=0;a.yb=0;a.Ga=0;a.Fa=0;a.$a=0;a.Mb=262143;a.N=null;a.h&&Sb(a)}function Sb(a){a.Fa?(a.P=65536,a.J=a.hc,a.W=a.gd,a.mb=a.Zd,zb(a.h,a.Ga&16?22:18)):(a.P=0,a.J=a.gc,a.W=a.Tb,a.mb=a.$b,zb(a.h,16))}function xc(a,b,c){a.Jb=b;P(a,b);!c&&a.C&&(G(a)||a.C.ka())}h.Ib=function(){return 0}; +h.save=function(){var a=new Q(this);a.set(0,[]);a.set(1,[this.sa,this.qa]);a.set(2,Kb(this.h));return a.data()};h.restore=function(a){var b=a[1];this.sa=b[1];pc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.B>>14&3;a.v!=c&&(a.ma[c]=a.g[6],a.g[6]=a.ma[a.v]);a.B=b;a.u|=2}function S(a,b){a.u&128||(a.s=a.i=b,a.f=0)}function Ac(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.f=c||0)}function Bc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Cc(a,b){a.u&128||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Dc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} +function K(a,b,c){if(!a.ra){var d=!1;0>a.Ia?a.Ia=qb(a):a.v||(b=4,d=!0);a.w&57344||(a.Ba=63222,a.yb=b);a.v=0;var e=a.W(b|a.P),f=a.W(b+2&65535|a.P);Tb(a,f&-12289|a.Ia>>2&12288);d&&(a.M|=4,a.g[6]=4);Ec(a,a.Ia);Ec(a,a.g[7]);P(a,e);a.u&=-113;a.Ia=-1;a.u|=8;if(26!=c)throw b;}}function Fc(a){var b=Gc(a),c=Gc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);P(a,b);Tb(a,c);a.u&=-17} +function Hb(a,b){var c=b>>13&31;31>c&&a.Ga&32&&(b=a.Ya[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} +function Hc(a,b,c){var d,e,f,g=0;d=b>>13;a.Ga&a.ic[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Y[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.H[a.v][d]=e;if(4194170!==f||a.v)a.$a=a.v,a.ab=d;b=!1;g&&(g&57344&&(0<=a.Ia&&(g|=128),a.w&57344||(a.w=a.w|g|a.$a<<5|a.ab<<1),b=!0),a.w&61440||!(4191360> +f||4194239>>a.c].Db(b&a.j,c&255,b)}function Gc(a){var b=a.W(a.g[6]|a.P);a.g[6]=a.g[6]+2&65535;return b}function Ec(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w&57344||(a.Ba=a.Ba<<8|246);!a.v&&c<=a.Ca&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.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.W(e)|g;a.a-= +8;break;case 6:return e=a.W(zc(a,2)),e=e+a.g[c]&65535|g,a.a-=6,e;case 7:return e=a.W(zc(a,2)),e=e+a.g[c]&65535,e=a.W(e|a.P)|g,a.a-=10,e}a.g[c]=a.g[c]+f&65535;!g||a.w&57344||(a.Ba=a.Ba<<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.M|=4,a.g[6]=4,K(a,4,24)):(a.M|=8,a.u|=64));return e}h.tb=function(a){if(!this.Fa)return this.h.tb(a);this.ra++;a=this.Tb(Hc(this,a,2));this.ra--;return a}; +h.Xa=function(a,b){this.Fa?(this.ra++,Ic(this,Hc(this,a,5),b),this.ra--):this.h.Xa(a,b)};h.Ab=function(a,b){this.Fa?(this.ra++,this.$b(Hc(this,a,4),b),this.ra--):this.h.Ab(a,b)};h.gc=function(a,b,c){return Jc(this,a,b,c)};h.hc=function(a,b,c){return Hc(this,Jc(this,a,b,c),c)};h.Tb=function(a){return Ib(this.h,a)};h.gd=function(a){return Ib(this.h,Hc(this,a,2))};h.$b=function(a,b){Jb(this.h,a,b&65535)};h.Zd=function(a,b){Jb(this.h,Hc(this,a,4),b)}; +function Kc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Jc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.W(d|c&a.P),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.g[d]:a.ma[a.B>>12&3];return c}function Lc(a,b,c,d){a.w&57344||(a.Ba=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Jc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Hc(a,e|c&65536,4),a.v=a.B>>14&3,Jb(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.g[e]=d:a.ma[a.B>>12&3]=d} +function Mc(a,b){b>>=6;var c=a.D=b&7;(b=a.A=(b&56)>>3)?(c=a.J(b,c,3),a=Gb(a.h,c)):a=a.g[c]&255;return a}function Nc(a,b){b>>=6;var c=a.D=b&7;return(b=a.A=(b&56)>>3)?Ib(a.h,a.J(b,c,2)):a.g[c]}function Oc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Jc(a,b,c,8)}function Pc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=Gb(a.h,c)):a=a.g[c]&255;return a}function Qc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Ib(a.h,a.J(b,c,2)):a.g[c]} +function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.rb=a.J(b,e,7),Ic(a,e,d.call(a,c,Gb(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.J(b,e,6),Jb(a.h,e,d.call(a,c,Ib(a.h,e)))):a.g[e]=d.call(a,c,a.g[e])}function Rc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Ic(a,a.J(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} +function Sc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?Jb(a.h,a.J(b,d,4),c):a.g[d]=c&65535;return c}function V(a,b,c){c&&(P(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} +h.kb=function(a){this.l.complete=!0;var b=a?this.l.Bb?0:1:-1;this.l.Bb=!1;this.pa=this.a=a;do{if(this.u){this.u&112&&(this.u&32?K(this,168,28):this.u&64?K(this,4,30):this.u&16&&K(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.zb&224)>>5,e=this.N&&this.N.Ka>d?this.N:null;e&&(c=e.md,d=e.Ka);d>(this.B&224)>>5?(this.u&4&&(zc(this,2),this.u&=-5),K(this,c,26),d=!0):d=!1;if(d){if(e)if(a=e,e=this.N,e==a)this.N=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e= +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(yc(this))}while(0>1|b<<16;Cc(this,a);return a&65535}function Yc(a,b){a=b&2048|b>>1|b<<8;Cc(this,a<<8);return a&255}function Zc(a,b){a=b&~a;S(this,a);return a}function $c(a,b){a=b&~a;S(this,a<<8);return a}function ad(a,b){a|=b;S(this,a);return a}function bd(a,b){a|=b;S(this,a<<8);return a}function cd(a,b){a=~b|65536;Ac(this,a);return a&65535}function dd(a,b){a=~b|256;Ac(this,a<<8);return a&255} +function ed(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.f=b&(b^a));return a&65535}function fd(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 gd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function hd(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 id(a,b){a=-b;Ac(this,a,a&b&32768);return a&65535}function jd(a,b){a=-b;Ac(this,a<<8,(a&b&128)<<8);return a&255} +function kd(a,b){a=b<<1|this.m>>16&1;Cc(this,a);return a&65535}function ld(a,b){a=b<<1|this.m>>16&1;Cc(this,a<<8);return a&255}function md(a,b){a=(this.m&65536|b)>>1|b<<16;Cc(this,a);return a&65535}function nd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Cc(this,a<<8);return a&255}function od(a,b){var c=b-a;Dc(this,c,a,b);return c&65535}function pd(a,b){var c=b-a;Dc(this,c<<8,a<<8,b<<8);return c&255}function qd(a,b){this.u&128||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535} +function rd(a,b){a^=b;S(this,a);return a&65535}function sd(a){U(this,a,Nc(this,a),Tc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function td(a){var b=Qc(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;else if(b)if(16>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 ud(a){var b=Qc(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-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function vd(a){V(this,a,!R(this))}function wd(a){V(this,a,R(this))} +function xd(a){U(this,a,Nc(this,a),Zc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function yd(a){T(this,a,Mc(this,a),$c);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function zd(a){U(this,a,Nc(this,a),ad);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Ad(a){T(this,a,Mc(this,a),bd);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} +function Bd(a){S(this,Nc(this,a)&Qc(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Cd(a){S(this,(Mc(this,a)&Pc(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 Dd(a){V(this,a,this.i&65535?0:4)}function Ed(a){V(this,a,!this.ya()==!(this.f&32768))}function Fd(a){V(this,a,!!(this.i&65535)&&!this.ya()==!(this.f&32768))}function Gd(a){V(this,a,!R(this)&&!!(this.i&65535))} +function Hd(a){V(this,a,(this.i&65535?0:4)||!this.ya()!=!(this.f&32768))}function Id(a){V(this,a,R(this)||(this.i&65535?0:4))}function Jd(a){V(this,a,!this.ya()!=!(this.f&32768))}function Kd(a){V(this,a,this.ya())}function Ld(a){V(this,a,!!(this.i&65535))}function Md(a){V(this,a,!this.ya())}function Nd(){K(this,12,1);this.a-=5}function Od(a){V(this,a,!0)}function Pd(a){V(this,a,!(this.f&32768))}function Qd(a){V(this,a,this.f&32768?2:0)} +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 Rd(a){var b=Nc(this,a);a=Qc(this,a);Dc(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 Sd(a){var b=Mc(this,a)<<8;a=Pc(this,a)<<8;Dc(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 Td(a){var b=Qc(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 Ud(){K(this,24,2);this.a-=25} +function Vd(){this.B&49152?(this.M|=128,K(this,4,3)):this.C?this.C.b():G(this);this.a-=7}function Wd(){K(this,16,4);this.a-=25}var Xd=[0,7,7,10,7,11,9,13];function Yd(a){this.G=this.a;P(this,Oc(this,a));this.a=this.G-Xd[this.c]}var Zd=[0,14,14,17,14,18,16,20];function $d(a){this.G=this.a;var b=Oc(this,a);a=a>>6&7;Ec(this,this.g[a]);this.g[a]=this.g[7];P(this,b);this.a=this.G-Zd[this.c]}var ae=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function be(a){var b=Nc(this,a);this.G=this.a;S(this,Sc(this,a,b));this.a=this.G-ae[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ce(a){var b=Mc(this,a);S(this,Rc(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 de=[7,13,13,17,14,18,17,21]; +function ee(a){var b=Qc(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>6;if(this.g[b]=this.g[b]-1&65535)P(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ke(a){U(this,a,Nc(this,a),od);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)} +function le(a){U(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)}function me(){K(this,28,5);this.a-=5}function ne(){this.u&4||this.j&&this.j.ka();this.u|=4;zc(this,-2);this.a-=3}function oe(a){U(this,a,Nc(this,a),rd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,6)}function uc(a){pe[a>>12].call(this,a)}function qe(a){re[a>>6&3].call(this,a)}function se(a){te[a>>6&3].call(this,a)}function ue(a){ve[a>>6&3].call(this,a)}function we(a){xe[a&15].call(this,a)} +function ye(a){ze[a&15].call(this,a)}function Ae(a){Be[a>>6&3].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)} +var pe=[function(a){Ge[a>>8&15].call(this,a)},be,Rd,Bd,xd,zd,sd,Y,function(a){He[a>>8&15].call(this,a)},ce,Sd,Cd,yd,Ad,ke,Y],Ge=[function(a){Ie[a>>4&15].call(this,a)},Od,Ld,Dd,Ed,Jd,Fd,Hd,$d,$d,qe,se,ue,Y,Y,Y],re=[function(a){Ac(this,Sc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,ed);this.a-=this.c?9:3+(7==this.b?2:0)}],te=[function(a){U(this,a,0, +id);this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Qc(this,a);Ac(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],ve=[function(a){U(this,a,0,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Vc);this.a-=this.c?9:3+(7==this.b?2:0)}], +Ie=[function(a){Je[a&15].call(this,a)},Y,Y,Y,Yd,Yd,Yd,Yd,ie,Y,we,ye,le,le,le,le],Je=[Vd,ne,he,Nd,Wd,ge,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],xe=[fe,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],ze=[fe,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],He=[Md,Kd,Gd,Id,Pd,Qd,vd,wd,Ud,me,Ae,Ce,Ee,Y,Y,Y],Be=[function(a){Ac(this, +Rc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,fd);this.a-=this.c?9:3+(7==this.b?2:0)}],De=[function(a){T(this,a,0,jd);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Pc(this,a);Ac(this,a<<8);this.a-=this.c?4:3+(7==this.b? +2:0)}],Fe=[function(a){T(this,a,0,nd);this.a-=this.c?9+(this.rb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,ld);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Yc);this.a-=this.c?9+(this.rb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Wc);this.a-=this.c?9:3+(7==this.b?2:0)}];function vc(a){Ke[a>>12].call(this,a)} +var Ke=[function(a){Le[a>>8&15].call(this,a)},be,Rd,Bd,xd,zd,sd,function(a){Me[a>>8&15].call(this,a)},function(a){Ne[a>>8&15].call(this,a)},ce,Sd,Cd,yd,Ad,ke,Y],Le=[function(a){Oe[a>>4&15].call(this,a)},Od,Ld,Dd,Ed,Jd,Fd,Hd,$d,$d,qe,se,ue,function(a){Pe[a>>6&3].call(this,a)},Y,Y],Pe=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.W(a|this.P);P(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Kc(this,a,0);Ec(this,a);S(this,a);this.a-=11},function(a){var b=Gc(this);this.G= +this.a;Lc(this,a,0,b);S(this,b);this.a=this.G-de[this.c]},function(a){S(this,Sc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Oe=[function(a){Qe[a&15].call(this,a)},Y,Y,Y,Yd,Yd,Yd,Yd,ie,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,6)},we,ye,le,le,le,le],Qe=[Vd,ne,he,Nd,Wd,ge,function(){Fc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Me=[ee,ee,Td,Td,td,td,ud,ud,oe,oe,Y,Y,Y,Y,je,je],Ne=[Md,Kd,Gd,Id,Pd,Qd,vd,wd,Ud,me,Ae,Ce,Ee,function(a){Re[a>>6& +3].call(this,a)},Y,Y],Re=[Y,function(a){a=Kc(this,a,65536);Ec(this,a);S(this,a);this.a-=11},function(a){var b=Gc(this);this.G=this.a;Lc(this,a,65536,b);S(this,b);this.a=this.G-de[this.c]},Y]; +function Se(a){x.call(this,"ROM",a,Se);this.X=this.b=null;this.i=a.addr;this.c=a.size;this.f=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.F("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Sa(c.na,a,b),(a=ta(a,b))?(c.b=a.K,c.X=a.X):c.j=null);Te(c)})}}z(Se);Se.prototype.ha=function(a,b,c,d){this.h=b;this.a=c;this.C=d;Te(this)}; +Se.prototype.ja=function(){this.X&&(this.C&&this.C.a(this.id,this.i,this.c,this.X),delete this.X);return!0};Se.prototype.ia=function(){return!0}; +function Te(a){if(!Wa(a)){if(a.j){if(!a.b||!a.h)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c)Xa(a,"ROM size ("+m(a.b.length,8,!0)+") does not match specified size ("+m(a.c,8,!0)+")");else{var b;b=a.i;if(Cb(a.h,b,a.c,$b)){var c;for(c=0;c>>a.c;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),t=k,w=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Xa(p++,b[t++]&255);else p&1?G(a.a):xc(a.a,p,f);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.w&&(e.w-=32),e.b|=128,e.b&64&&Ob(e.a,e.aa))});this.da=Qb(52,4);this.P=Nb(this.a,function(){e.c|=128;e.c&64&&Ob(e.a,e.da)});ab(b,this,Ze);F(this)}; +h.Kb=function(){if(!this.v){var a=lc(this.j,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.Pa)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)}}};h.ja=function(a,b){if(!b)if(this.Kb(),!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(){$e(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return $e(this)};function $e(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.xb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(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.T(this.m), +this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Pb(this.a,this.P,1E3/Math.round(this.I/10))}};var af={},Ze=(af[65392]=[null,null,Z.prototype.Qc,Z.prototype.Id,"RCSR"],af[65394]=[null,null,Z.prototype.Pc,Z.prototype.Hd,"RBUF"],af[65396]=[null,null,Z.prototype.jd,Z.prototype.ae,"XCSR"],af[65398]=[null,null,Z.prototype.hd,Z.prototype.$d,"XBUF"],af);Ha(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");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= +d.o.listTapes;a&&df(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;df(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1}; +h.ha=function(a,b,c,d){this.j=a;this.h=b;this.a=c;this.C=d;this.J=ef(a);var e=this;if((this.c=lc(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=Qb(56,4);this.R=Nb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.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 k=0>g&&a.j&&!a.j.l.O;g?a.F('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Sa(a.na,e,f),(e=ta(e,f))&&of(a,b,c,d,e.K,e.fa,e.ea)); +a.l.Ea=!1;a.m&&(a.m--,a.m||F(a));lf(a)})}function hf(a,b,c,d){if((a=a.o.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.V);for(d=0;dc.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.qb?"":e)+"&format=json"));return!!r(f, +null,!0,function(b,c,d){vf(a,b,c,d)})} +function vf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.j&&!a.j.l.O;if(d)a.controller.F('Unable to load disk "'+a.ua+'" (error '+d+": "+b+")",f);else{Sa(a.controller.na,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)u(k[0]);else{a.V=k.length;a.Z=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ga=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var w=l.bytes;if(void 0!==w&&w.length){for(var E=n<<2,va=w.length;va>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ba?f=a.la+a.ba&&(a.ba+=f-(a.la+a.ba)+1):(a.la=f,a.ba=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ +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(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.F("Unable to restore disk '"+this.ua+": "+c);return b}; +h.toJSON=function(){var a;a=0;for(var b;b=xf(this,a++);)zf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function zf(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){x.call(this,"RL11",a,O);this.f=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Ba("Mobi")&&window&&"FileReader"in window}z(O);h=O.prototype; +h.$=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(k){u("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Af(d,a)},!0;case "loadDrive":return this.o[b]= +c,c.onclick=function(){var a=d.o.listDisks;a&&Bf(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,k;k=xf(a,c++);)for(var l=0,n=k.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Af(this,0)}}return!0};h.ia=function(a){return a?this.save():!0};h.reset=function(){Cf(this)};h.save=function(){return(new Q(this)).data()}; +h.restore=function(a){return Cf(this,a[0])};function Ff(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;gg||9e||e>=a.b.length)a.F("Unable to load the selected drive");else if(c)if("?"==c)a.F('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+'"')}Hf(a,e,b,c,!1,d)}else Gf(a,e)} +function Hf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Da.toLowerCase()!=d.toLowerCase()&&(g++,Gf(a,b,!0),k.pb?a.F("RL11 busy"):(k.pb=!0,e&&(k.ob=!0,a.s++),k.ib=!!f,uf(new qf(a,k,"preload"),c,d,f,a.dc)&&g++));return g} +h.dc=function(a,b,c,d,e){var f;a.pb=!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.V||f[1]>a.Z)&&(this.F('Disk "'+c+'" too large for drive '+("RL"+a.vb)),b=null);b?(a.ca=b,a.ua=c,a.Da=d,this.F('Mounted disk "'+c+'" in drive '+("RL"+a.vb),a.ob||e),this.j&&rc(this.j)):a.ib=!1;a.ob&&(a.ob=!1,--this.s||F(this));Af(this,a.vb)}; +function Ef(a,b,c,d){if((a=a.o.listDisks)&&a.options){for(var e=0;e>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.L=this.L|a|32768);return!0}; +h.wc=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var t,w;if(0>(t=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Jb(this.h,f,t|w<<8);if(Mb(this.h)){k=8192;break}f+=2;if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)}; +h.qd=function(a,b,c,d,e,f,g){for(var k=0,l=a.ca,n=null,p;e--;){var t=Ib(this.h,f);if(Mb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,t&255)||!a.ca.write(n,p++,t>>8)){k=5120;break}if(p>=l.ga&&(n=null,++d>=l.S&&(d=0,++c>=l.Z&&(c=0,++b>=l.V)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Tc=function(){return this.L&65535}; +h.Ld=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.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.wc;case 10:b||(b=this.qd),d=this.c>>7,e=this.c&64?0:1,f=this.c&63,d>=c.V||f>=c.S?this.L|=37888:(g=(this.w& +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.L|=129,this.L&64&&Ob(this.a,this.G))}};h.Rc=function(){return this.v};h.Jd=function(a){this.v=a&65534};h.Uc=function(){return this.c};h.Md=function(a){this.c=a};h.Vc=function(){return this.m};h.Nd=function(a){this.m=a};h.Sc=function(){return this.w};h.Kd=function(a){this.w=a&63}; +var If={},Df=(If[63744]=[null,null,O.prototype.Tc,O.prototype.Ld,"RLCS"],If[63746]=[null,null,O.prototype.Rc,O.prototype.Jd,"RLBA"],If[65284]=[null,null,O.prototype.Uc,O.prototype.Md,"RLDA"],If[65286]=[null,null,O.prototype.Vc,O.prototype.Nd,"RLMP"],If[65288]=[null,null,O.prototype.Sc,O.prototype.Kd,"RLBE"],If); +function Jf(a,b,c){x.call(this,"Computer",a,Jf);this.l.O=!1;Kf(this,b);this.A=lc(this,"autoPower",a);this.j=0;this.N=a.busWidth||a.buswidth;this.b=Lf;this.v=null;this.m=this.I=!1;this.P=lc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Mf(this);if(this.a=Ua("CPU",this.id)){this.C=Ua("Debugger",this.id);this.h=new sb({id:this.na+".bus",busWidth:this.N},this.a,this.C);var d,e=A(this.id);if((this.f=Ua("Panel",this.id))&&this.f.Va)for(b=0;b\nLicense: GPL version 3 or later ");this.T("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bLf){if(Nf(d,this.v)){this.i=new Q(this,"1.30.2","failsafe");Nf(this.i)&&(Sf(this,d),a=2,Tf(this.i));this.i.set("timestamp",sa());Uf(this.i);var e=this.b&&!this.m;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Rf(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Nf(d,g):("error"== +f&&"no machine state"!=g?(this.F("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.T(f+": "+g),Tf(d),Nf(d)?(c=Rf(d),e=!0):c=!1))}e&&Qf(this,c?d:null)}else 2==a&&d.clear()}else Qf(this);delete this.v;delete this.w}e=A(this.id);for(f=0;fa[1];a=a[2];this.R=!0;this.l.O=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(Vf(this,this.a,b,c,a),this.a.Ua());this.G&&(Sf(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.j=0}; +function Sf(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.P;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} +function Yf(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new Q(a,"1.30.2"),g=new Q(a,"1.30.2","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);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.O=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],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]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);eg(a,b,c)}})}else c(a,null)} +function fg(a,b,c,d){function e(a){if(void 0===k){var b=g&&D(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--bg||Ja(!0));l=!1}var g,k,l=!0;bg++;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|| +(c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,k){k?cg(c,null,null,!1,e,function(d,l){l?(Sa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--bg||Ja(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--bg||Ja(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?cg(b,a,d,!0,e,n):dg(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 fg(a,b,c,d)};window.enableEvents=Ja;window.sendEvent=Ka;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map