scene.org File Archive

File download

<root>­/­parties­/­2024­/­vccc24­/­christmas_challenge/jghd_rt11_pdp11_100b_vc3-2024.zip

File size:
58 057 bytes (56.70K)
File date:
2024-12-29 14:13:04
Download count:
all-time: 0

Preview

  • XMAS2024/ dir
  • XMAS2024/fileidd.txt 1.60K
  • XMAS2024/xmas2024d 612B
  • XMAS2024/xmas2024d-lst.gif 30.92K
  • XMAS2024/xmas2024d.gif 21.25K
  • XMAS2024/xmas2024d.lst 10.77K
  • XMAS2024/xmas2024d.mac 1.42K

file_id.diz

Author:            Jonathan Harston
Category:          Christmas Challenge
System:            PDP11 running RT11
Language:          PDP11 machine code
Source length:     1450 bytes
File length:       612 bytes
Executable length: 100 bytes

Instructions:
Copy the file 'xmas2024d' to a RT11 system as 'xmas24.sav'. Run by typing
'run xmas24'. The example is show running on a Soviet UKNC Electronia home
computer via emulation.

Description:
The program is four nested loops, looping between each block of characters,
each line of characters, each line, and each block of lines.

The output counter is toggled between 0 and 7 to output either 1 or 8 copies
of each loop: either a character horizontally or a line vertically.

The two characters used on a line are both held in a single 16-bit register,
and SWAB is used to toggle between which one is output. At the end of each
set of lines the "+-" and "! " characters are toggled between.

It turns out that to toggle between "+-" and "! " you can XOR with &0D0A,
which just happens to be the CR/LF sequence used at the end of each line,
so this is used on the return from printing the end-of-line sequence to
swap between the two character pairs.

Code space is saved by inlining all the calls to TTYOUT instead of the one
word overhead of a subroutine. If you could depend on the output device
expanding TABs into spaces, the eight spaces in the "ribbon" string could
be replaced with a single 9 byte, saving 7 bytes in the program length.
However, it's nice that the code is an exact round 100 bytes long.

The code has the standard 512-byte boiler-plate header to run on a RT11.