Birds Flying South

Date: 198x
Type: Program
Platform(s): TS 1000
Tags: Demo

Birds Flying South is a short animated display program that simulates a flock of birds migrating across the screen. In FAST mode, it plots 60 “<” characters at random positions (rows 0–17, columns 0–31) to represent birds in flight, then prints a title line at row 21. After switching back to SLOW mode, the program enters a loop that repeatedly scrolls a user-group credit string across line 23 using the system variable at address 16514 (accessed via USR) combined with a POKE to address 16418, likely manipulating display or scroll state to create a ticker effect. The program uses the ZX81’s FAST/SLOW mode switching to efficiently render the random bird positions before returning to normal display speed.


Program Analysis

Program Structure

The program divides into three distinct phases:

  1. Bird scatter (lines 10–50): Sets a variable, switches to FAST mode, and prints 60 "<" characters at random screen positions to simulate a flock of birds.
  2. Title display (line 41): Prints the program title "BIRDS FLYING SOUTH" at a fixed position (row 21, column 1) after the bird loop completes.
  3. Scrolling credit loop (lines 60–70): Continuously reads a system variable via USR 16514, POKEs address 16418, and reprints a user-group credit string on line 23, creating a repeating display effect.

Display Technique — Bird Rendering

Each bird is rendered as a "<" character, a common ASCII approximation of a bird in flight. The loop at lines 21–40 uses RND*17 and RND*31 to scatter birds across rows 0–17 and columns 0–31 respectively, leaving the bottom rows free for the title and credit lines. Running this loop in FAST mode suppresses display refresh during rendering, making all 60 birds appear to pop onto the screen simultaneously when SLOW mode resumes at line 50.

System Variable Manipulation

Line 60 captures the return value of USR 16514 into variable L. Address 16514 in the ZX81 system variable map is FRAMES (the frame counter, a 2-byte value). Using USR on a data address rather than a machine code routine is unconventional and will execute whatever byte happens to be at that address; the intent appears to be reading or triggering a timing or scroll mechanism. Line 61 then POKEs address 16418 (the DF_SZ system variable, which controls the lower display file size) to 0, effectively collapsing the lower display area. Together these lines manipulate the display to produce a scrolling or looping credit effect on line 23.

Credit String Anomaly

Lines 62 and 64 both print to AT 23,0. Line 62 uses individual inverse-video characters spelling S.I.G. Z8O SINCLAIR USERS GROUPE interspersed with solid block graphics (), while line 64 immediately overwrites the same position with a plain-text version of the same string. This double-print pattern, combined with the GOTO loop at line 70, suggests the intent was a flickering or ticker-style animation between the two representations, though in practice line 64 simply overwrites line 62 each iteration.

Key BASIC Idioms and Notable Details

  • LET A=31744 at line 10 sets a variable that is never subsequently referenced in the visible code, suggesting either a vestigial remnant or that it was intended for a machine code call.
  • The REM at line 1 contains what appears to be encoded data or machine code bytes embedded in the remark, a common ZX81 technique for storing routines or initialization data.
  • Lines 80–100 (CLEAR, SAVE, RUN) form a save/restart block that is unreachable during normal execution due to the infinite GOTO 60 loop at line 70; they would only execute if the program were manually directed to them.
  • The SAVE filename at line 90 includes inverse-digit characters, encoding file metadata in the filename field.

Bugs and Anomalies

  • Using USR 16514 on a system variable address rather than a legitimate machine code entry point is likely to cause unpredictable behavior or a crash, depending on the byte value stored there at runtime.
  • The variable L assigned at line 60 is never used elsewhere in the program.
  • The word “GROUPE” in the credit string is a non-standard spelling, likely a deliberate stylistic choice by the user group.

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Source Code

   1 REM ▞-E£RNDVAL ▘3 7# FASTSGN 7 GOSUB [K]F#7AT ( LOAD TAN 
  10 LET A=31744
  20 FAST
  21 FOR I=1 TO 60
  30 PRINT AT RND*17,RND*31;"<"
  40 NEXT I
  41 PRINT AT 21,1;"BIRDS FLYING SOUTH"
  50 SLOW
  60 LET L=USR 16514
  61 POKE 16418,0
  62 PRINT AT 23,0;"[S][.][I][.][G][.]█[Z][8][O]█[S][I][N][C][L][A][I][R]█[U][S][E][R][S]█[G][R][O][U][P][E]"
  64 PRINT AT 23,0;"S.I.G. Z8O SINCLAIR USERS GROUPE"
  70 GOTO 60
  80 CLEAR
  90 SAVE "1032[7]"
 100 RUN 

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

People

No people associated with this content.

Scroll to Top