/ Larson Scanner with the Acc and MQ registers / This PDP-8 version by Gordon Henderson, October 2017. / Used palbart to assemble: pal-2.13, 03 May 2015 / Table driven - easier than bit rotating.... /******************************************************************************** / Just in-case we get an interrupt we're not expecting? field 0 *0000 hlt / Autoincrement storage *0010 ptr, lars / Points to the Larson array / Other data storage *0100 larsAd, lars-1 / Holds the address of the data - 1. dCount, 0 tmp, 0 *0200 / As good a place as any to start / start: We initialise the autoincrement pointer to the Larson data / The value stored is the address - 1 start, cla cll / (Link cleared to keep display pretty) tad larsAd dca ptr / Cycle loop loop, cla tad i ptr / Auto-Increments ptr then reads in data it's pointing to dca tmp / Temporary store it tad tmp / Get it back again / End value? (is 7777) iac / 7777 -> 0000 (+ link) if end value sna cla / Skip non-zero acc (not hit the guard value) jmp start tad tmp / Re-read mql / .. and transfer to MQ tad tmp / Re-read so Acc also has value during delay / Longish delay isz dCount jmp .-1 isz dCount jmp .-1 isz dCount jmp .-1 isz dCount jmp .-1 jmp loop / Here we go again / Larson scanner data for a 12-bit register lars, 0000; 0001; 0003; 0007; 0016; 0034; 0070; 0160; 0340; 0700; 1600; 3400; 7000; 6000; 4000; 0000 0000; 4000; 6000; 7000; 3400; 1600; 0700; 0340; 0160; 0070; 0034; 0016; 0007; 0003; 0001; 0000 7777 / End value *0200 / Signals auto start address to the BIN loader $