Page 1 1 2 / Larson Scanner with the Acc and MQ registers 3 4 / This PDP-8 version by Gordon Henderson, October 2017. 5 / Used palbart to assemble: pal-2.13, 03 May 2015 6 7 / Table driven - easier than bit rotating.... 8 /******************************************************************************** 9 10 11 / Just in-case we get an interrupt we're not expecting? 12 13 field 0 14 0000 *0000 15 00000 7402 hlt 16 17 / Autoincrement storage 18 19 0010 *0010 20 21 00010 0226 ptr, lars / Points to the Larson array 22 23 / Other data storage 24 25 0100 *0100 26 27 00100 0225 larsAd, lars-1 / Holds the address of the data - 1. 28 29 00101 0000 dCount, 0 30 00102 0000 tmp, 0 31 32 33 0200 *0200 / As good a place as any to start 34 35 / start: We initialise the autoincrement pointer to the Larson data 36 / The value stored is the address - 1 37 38 00200 7300 start, cla cll / (Link cleared to keep display pretty) 39 00201 1100 tad larsAd 40 00202 3010 dca ptr 41 42 / Cycle loop 43 44 00203 7200 loop, cla 45 00204 1410 tad i ptr / Auto-Increments ptr then reads in data it's pointing to 46 00205 3102 dca tmp / Temporary store it 47 00206 1102 tad tmp / Get it back again 48 49 / End value? (is 7777) 50 Page 2 51 00207 7001 iac / 7777 -> 0000 (+ link) if end value 52 00210 7650 sna cla / Skip non-zero acc (not hit the guard value) 53 00211 5200 jmp start 54 55 00212 1102 tad tmp / Re-read 56 00213 7421 mql / .. and transfer to MQ 57 00214 1102 tad tmp / Re-read so Acc also has value during delay 58 59 / Longish delay 60 61 00215 2101 isz dCount 62 00216 5215 jmp .-1 63 00217 2101 isz dCount 64 00220 5217 jmp .-1 65 00221 2101 isz dCount 66 00222 5221 jmp .-1 67 00223 2101 isz dCount 68 00224 5223 jmp .-1 69 70 00225 5203 jmp loop / Here we go again 71 72 / Larson scanner data for a 12-bit register 73 74 00226 0000 lars, 0000; 0001; 0003; 0007; 0016; 0034; 0070; 0160; 0340; 0700; 1600; 3400; 7000; 6000; 4000; 0000 00227 0001 00230 0003 00231 0007 00232 0016 00233 0034 00234 0070 00235 0160 00236 0340 00237 0700 00240 1600 00241 3400 00242 7000 00243 6000 00244 4000 00245 0000 75 00246 0000 0000; 4000; 6000; 7000; 3400; 1600; 0700; 0340; 0160; 0070; 0034; 0016; 0007; 0003; 0001; 0000 00247 4000 00250 6000 00251 7000 00252 3400 00253 1600 00254 0700 00255 0340 00256 0160 00257 0070 00260 0034 Page 3 00261 0016 00262 0007 00263 0003 00264 0001 00265 0000 76 77 00266 7777 7777 / End value 78 79 0200 *0200 / Signals auto start address to the BIN loader 80 $ No detected errors No links generated Page 4 Cross Reference 1 A 29 DCOUNT 61 63 65 67 2 A 74 LARS 21 27 3 A 27 LARSAD 39 4 A 44 LOOP 70 5 A 21 PTR 40 45 6 A 38 START 53 7 A 30 TMP 46 47 55 57