BigStuff

Developer(s): Jack Keene
Date: 1985
Type: Program
Platform(s): TS 2068
Tags: Graphics

BIGSTUFF enlarges a SCREEN$ (loaded from tape at address 16384) into a giant 21 × 25.5-inch poster printed in eight strips on a 2040 printer via LPRINT. A 79-byte machine code routine, POKEd into RAM at address 32768, performs the actual screen-dump logic, with two bytes at addresses 32769 and 32772 controlling which vertical band (0–28 in steps of 4) is processed per pass. Eight UDGs (A–H) are defined with graduated dot-density patterns to represent shading and color intensity as dithered greyscale output. Between strips, a descending BEEP sweep signals completion of each pass.


Program Analysis

Program Structure

The program is split into clearly separated functional phases:

  1. Lines 1–6: Multi-line REM documentation block describing purpose, credits, and usage notes.
  2. Lines 10–110: Main runtime loop — prompts user, loads SCREEN$, iterates over 8 vertical strips, fires machine code, and beeps between strips.
  3. Lines 999–1080: UDG initialisation — clears memory below 32768, then POKEs 8 UDG definitions (A–H) read from DATA.
  4. Lines 1999–2020: Machine code loader — POKEs 79 bytes into address 32768 onward from DATA, then JUMPs back to line 10 to begin the main loop.
  5. Line 9999: SAVE entry point, using LINE 1000 so the program auto-runs from the UDG/machine-code setup phase on load.

Execution Flow

On auto-run the program enters at line 1000, sets up UDGs and machine code, then falls through to line 2020 which redirects to line 10. The user is prompted and the SCREEN$ is loaded at 16384. The outer FOR N=0 TO 28 STEP 4 loop (line 40) iterates 8 times, each time POKEing the current strip offset into the machine code at addresses 32769 and 32772 before calling RANDOMIZE USR 32768. After all strips are done, line 110 enters an infinite BEEP loop as a completion signal.

Machine Code Routine

The 79-byte routine at 32768 is a screen-dump driver. Two self-modifying bytes at offsets +1 and +4 (absolute addresses 32769 and 32772) are patched by the BASIC loop to select the vertical strip. The routine walks through the Spectrum’s non-linear display file layout, reads pixel data, maps each 3-bit value to a UDG character (base code 144, i.e., UDG “A”), and outputs it via the RST 10h (or equivalent) printer output mechanism (215 = RST $D7 in Spectrum ROM — the print-a-character restart).

A disassembly sketch of the DATA sequence reveals standard Z80 idioms: LD HL,16384 / LD DE,22528 for screen and attribute base addresses, nested loops using B and C registers for rows and columns, RLC instructions to shift pixel bits, and AND 07h to extract a 3-bit shade index added to 144 to select UDG A–H.

UDG Shading Scheme

Eight UDGs (A through H) represent a greyscale ramp from solid white (all pixels on) to solid black (all pixels off), with intermediate dithered patterns. The DATA values confirm this:

UDGDescriptionDATA bytes (hex)
ASolid whiteFF FF FF FF FF FF FF FF
BNear white, sparse holesFF DD FF F7 FF BF FD EF
CLight ditherFF AB FF D5 FF AB FF D5
DMedium ditherAA 55 AA 55 AA 55 AB 55
E50% halftone55 55 55 55 55 55 55 55
FDark dither00 54 00 2A 00 54 00 2A
GNear black, sparse dots00 22 00 08 00 40 02 10
HSolid black00 00 00 00 00 00 00 00

Key BASIC Idioms and Techniques

  • Self-modifying machine code via POKE: POKE 32769,N and POKE 32772,N at line 50 patch operand bytes inside the machine code routine to parametrise each strip without reloading the routine.
  • RANDOMIZE USR: Used at line 60 to call the machine code; return value is discarded. This is the standard Spectrum idiom for invoking Z80 routines from BASIC.
  • Multiple LPRINT statements: Lines 60 and 90 issue five blank LPRINTs before and after each machine-code dump to provide inter-strip spacing and paper feed.
  • Auto-run via LINE: SAVE "BIGSTUFF" LINE 1000 ensures setup code runs before the main loop on every load.
  • CLEAR 32767: Line 1000 sets RAMTOP just below the machine code workspace, protecting the routine at 32768 from being overwritten by BASIC or the stack.
  • Descending BEEP sweep: Lines 70–80 play a tone sweep from pitch 60 down to –20 in steps of –2 as audible progress feedback between strips.

Anomalies and Notes

  • Line 65 short-circuits the BEEP sweep after the final strip (N=28) with a direct GO TO 90, avoiding an unnecessary inter-strip delay at the end.
  • The loop FOR N=0 TO 28 STEP 4 produces values 0, 4, 8, 12, 16, 20, 24, 28 — eight iterations for eight strips, consistent with the described 8-strip poster output.
  • Line 998 contains a STOP that is never reached in normal execution; it likely serves as a safety barrier between the main loop and the setup routines during development or manual RUN.
  • The infinite loop at line 110 (BEEP .1,30: PAUSE 2: GO TO 110) provides a persistent audio completion signal; the user must break manually with BREAK.

Content

Appears On

One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained

Related Products

Related Articles

Related Content

Image Gallery

BigStuff

Source Code

    1 REM "BIGSTUFF"
    2 REM By Roland Lumby             Your Spectrum Magazine          May 85
    3 REM modified by Jack Keene      TSUG Ft Worth Texas             Data Expansion Sep 85
    4 REM Makes a giant printout      of SCREEN$  loaded,             Automatically  outputting       to the 2040 printer. 
    5 REM Be sure to have a           fresh roll of paper as the      printout will be in the         form of 8 strips to make        up a 21 x 25.5 inch print       when trimmed and mounted        together.
    6 REM A good source of            SCREEN$ is from title           screens of commercial           programs you may have.
   10 PRINT AT 10,0;"HUGE SCREEN$ FANCY PRINTER COPY"
   20 PRINT ''"HAVE PRINTER READY LOAD SCREEN$ "
   30 LOAD ""CODE 16384
   40 FOR N=0 TO 28 STEP 4
   50 POKE 32769,N: POKE 32772,N
   60 LPRINT : LPRINT : LPRINT : LPRINT : LPRINT : RANDOMIZE USR 32768
   65 IF N=28 THEN GO TO 90
   70 FOR T=60 TO -20 STEP -2
   80 BEEP .1,T: PAUSE 60: NEXT T
   90 LPRINT : LPRINT : LPRINT : LPRINT : LPRINT 
  100 NEXT N
  110 BEEP .1,30: PAUSE 2: GO TO 110
  998 STOP 
  999 REM udgs for shading and            color representation
 1000 CLEAR 32767: FOR U=USR "A" TO USR "H"+7: READ A: POKE U,A: NEXT U
 1010 DATA 255,255,255,255,255,255,255,255
 1020 DATA 255,221,255,247,255,191,253,239
 1030 DATA 255,171,255,213,255,171,255,213
 1040 DATA 170,85,170,85,170,85,171,85
 1050 DATA 85,85,85,85,85,85,85,85
 1060 DATA 0,84,0,42,0,84,0,42
 1070 DATA 0,34,0,8,0,64,2,16
 1080 DATA 0,0,0,0,0,0,0,0
 1999 REM screen dump machine                    code
 2000 FOR X=32768 TO 32847: READ C: POKE X,C: NEXT X
 2010 DATA 33,00,64,17,00,88,00,00,00,06,03,197,14,08,229,06,08,229,213,197,14,04,126,06,08,203,23,245,26,56,06,203,31,203,31,203,31,230,07,198,144,215,241,16,236,35,19,13,32,228,193,209,225,36,16,217,225,197,01,32,00,09,235,09,235,193,13,32,201,167,62,07,132,103,193,16,190,00,00,201
 2020 GO TO 10
 9998 REM SAVE with GO TO 9999
 9999 SAVE "BIGSTUFF" LINE 1000

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Scroll to Top