The PDP-8 Crystal

Author:   atsampson
Category: Christmas Challenge
System:   DEC PDP-8
Language: PAL Assembler
Len source code: 888
Len exe file:    358
Len code only:   79.5
Instructions:
 cryst.bin should work on any bare-metal PDP-8 with a console teletype. You
 can load it in the simh PDP-8 emulator by running pdp8 and typing:
   load cryst.bin
   run 200
Description:
 The PDP-8 is a 12-bit machine. The code is 53 words, equivalent to 79.5 8-bit
 bytes.

 It relies on the pattern repeating every 6 characters, which divides neatly
 into the PDP-8's 12-bit words. Two copies of the first line of the pattern
 are kept in A and B and rotated in opposite directions for each X position.
 As each line is 19 characters long, the patterns are naturally offset by 1
 for each Y position. B is rotated another 4 places at the end of each line,
 so it moves in the opposite direction from A.

 The program was cross-assembled using palbart.
Comments:
 This is only a little shorter (counting bits) than my PDP-10 version; while the
 instructions are one-third the size, it needs a subroutine to do a 12-bit
 rotate rather than the PDP-8's normal 13-bit rotate.