Okay, I've got a page (128 words) of #PDP8 code that will generate a truncated Soundex hash of any ASCII or 6-bit TEXT string.
Since I have only 12 bits to store it, and the consonant classifiers are from 1-6, that takes 3 bits per digit. I'm using 5 bits to store the initial, so I get two digits plus a final bit just to distinguish if there was a third digit or not.
I coded this up in awk first to test it, with a giant `switch` statement (only in gawk, alas) mapping letters to digits. But in PAL assembler for the PDP-8, I decided instead to make a table like so:
```
ALPHBT, 2170; /CBA@
2173; /GFED
2277; /KJIH
7554; /ONML
2621; /SRQP
7173; /WVUT
0272; /[ZYX
0000; /_^]\
```
Basically the characters in this section of the character set are there in reverse order. The top three bits of the 5-bit char values indicate which word of this table to load in, and the last two indicate how many times to shift right by 3 before masking off the 3 least-significant bits. So the letter D is `04`, which means we get word `1` and shift it `0` times before pulling out the octal digit `3` (which is correct!)
Most of the code is tests for various bit patterns to see if we need to keep shifting or if we care (is it even a letter? Is it a vowel? Is it the same digit we saw last time? `H` and `W` are special cases...)








