scene.org File Archive

File download

<root>­/­parties­/­2025­/­vccc25­/­christmas_challenge/atsampson_decpdp-11_unixv4c_172b_vc3-2025.zip

File size:
8 586 bytes (8.38K)
File date:
2025-12-30 23:34:07
Download count:
all-time: 2

Preview

  • a.out 602B
  • c5-code.png 3.52K
  • c5-result.png 1.20K
  • c5.c 172B
  • c5.kr.c 417B
  • file_id.diz 1.62K

file_id.diz

A Star for UNIX v4

Author:   atsampson
Category: Christmas Challenge
System:   DEC PDP-11/45, running UNIX v4
Language: C
Len source code: 172
Len exe file:    602
Instructions:
  Follow the instructions here to boot up UNIX v4 in simh:
    https://gunkies.org/wiki/UNIX_Fourth_Edition
  Log in as root. Then do:
    chdir /tmp
    cat >star.c   (paste in c5.c, then press Ctrl-D)
    cc star.c
    a.out
  Not that different in principle from a modern UNIX, really!
Description:
  When VCCC was announced this year, I realised that the recently-discovered
  UNIX v4 tape was due to be read a few days before the submission deadline, and
  thought it'd be nice to use it for an entry if reading the tape worked out.
  It did, so here you go. (If it hadn't worked out, this would have been an
  entry for some other early C system.)

  c5.kr.c is the original version I wrote using a modern C compiler in K&R C.
  It uses four-way symmetry, with one quarter of the pattern stored as a bit
  pattern in an array, which is drawn using a pair of recursive functions with
  a few IOCCC-style tricks to shorten the code a bit.

  UNIX v4 has an early C compiler which didn't like one of the ?: constructs
  I'd used, but also doesn't want the usual = when initialising an array,
  which saves another byte.
Comments:
  Thank you to everybody who's worked on recovering UNIX v4 over the last
  couple of months: in particular to Robert Ricci who found the tape at Utah,
  Al Kossow at CHM who read and decoded the tape using Len Shustek's tools, and
  aap who managed to extract an RK05 disk image from it within a few hours.