PDP-8: count number of set bits in a word

Kyle Owen kylevowen at gmail.com
Fri Apr 5 10:59:10 CDT 2019


Just wondering if anyone has come up with a fast way to count the number of
1s in a word on a PDP-8. The obvious way is looping 12 times, rotating the
word through the link or sign bit, incrementing a count based on the value
of the link or sign.

With a small lookup table, you can reduce the total number of loops by
counting multiple groups of bits at a time, but this of course comes with
the cost of using more memory. Any other suggestions?

Much appreciated,

Kyle


More information about the cctalk mailing list