--- title: "Feast Of Classics" id: 59111 type: "computer_media" slug: "feast-of-classics" url: "http://localhost/computer_media/feast-of-classics/" markdown_url: "http://localhost/computer_media/feast-of-classics.md" published_at: "2025-02-27T13:00:05+00:00" modified_at: "2026-03-30T21:42:42+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2025/02/feast-of-classics.png" excerpt: "Play one of seven tunes." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Byte Power" slug: "byte-power" taxonomy: "post_tag" url: "http://localhost/tag/byte-power/" - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Eric Boisvert" slug: "boisvert-eric" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-eric/" genre: - name: "Music" slug: "music" taxonomy: "genre" url: "http://localhost/type/music/" media_contents: - id: 50603 title: "Byte Power August 1986" type: "computer_media" url: "http://localhost/computer_media/byte-power-august-1986/" media_type: "Program" programmers: - name: "Eric Boisvert" slug: "boisvert-eric" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-eric/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Feast%20of%20Classics%20%281986%29%28Byte%20Power%20Aug%201986%29%28TS2068%29%28CA%29%28Program%29.zip" mediadate: "1986" producer_company: - id: 25181 title: "Byte Power" type: "company" url: "http://localhost/company/byte-power/" images: - url: "http://localhost/wp-content/uploads/2025/02/feast-of-classics.png" article_media: - id: 59035 title: "Feast Of Classics" type: "article" url: "http://localhost/article/feast-of-classics/" media_type_tags: "Music" --- # Feast Of Classics This program is a self-displaying art/demo piece that encodes a complete machine code routine inside a REM statement at line 0, which is then executed via RANDOMIZE USR 38808. Line 1 checks a system variable (PEEK 23681) to detect whether the program is running in the correct context before transferring control to the embedded machine code. Line 2 provides a fallback that lists line 9999, which saves and verifies the program to tape under the filename “FEAST” with auto-run at line 1. *** ## Program Analysis ### Program Structure The program consists of just four lines, but the vast majority of its content lives in the `REM` statement at line 0: 1. **Line 0** — A `REM` statement containing a large binary/machine code payload encoded as a sequence of BASIC keywords, graphic characters, and raw bytes. 2. **Line 1** — The entry point: checks `PEEK 23681` and, if non-zero, clears the display, jumps to the machine code at address 38808 via `RANDOMIZE USR 38808`, then executes `NEW`. 3. **Line 2** — A fallback: `CLS`, then `LIST 9999` (which jumps to that line), followed by `STOP`. 4. **Line 9999** — Saves the program to tape as `"FEAST"` with `LINE 1` (auto-run), then verifies it. ### Machine Code in REM Storing machine code inside a `REM` statement at line 0 is a classic Sinclair technique. The BASIC line header gives the routine a fixed, predictable address in RAM. The call `RANDOMIZE USR 38808` transfers execution directly into this data. The address 38808 (0x9798) falls within the upper RAM area, consistent with the program being loaded at a specific base address and the REM payload starting at a known offset from the program start. The REM payload is extremely large — spanning most of line 0 — and contains structured binary data interspersed with what the tokeniser interprets as BASIC keywords and graphic characters. This is a common artifact of machine code stored in a BASIC program: the Z80 opcodes happen to match BASIC token values when disassembled as text. ### Key BASIC Idioms - `PEEK 23681` — System variable address. Address 23681 (0x5C41) is `RASP`/`PIP` in the system variables area. Checking it non-zero may be used as a flag to detect a specific machine state or that the program has already been initialised. - `RANDOMIZE USR 38808` — Standard idiom for calling a machine code routine from BASIC; `RANDOMIZE` discards the return value cleanly. - `LIST 9999` at line 2 — Because line 9999 exists, this causes the interpreter to jump to and execute line 9999, acting as a `GO TO` substitute. The subsequent `STOP` on line 2 is never reached under normal flow. - `SAVE "FEAST" LINE 1` — Saves the program with auto-run at line 1, so the machine code executes immediately on loading. - `NEW` after `RANDOMIZE USR` — Cleans up BASIC memory after the machine code routine returns, preventing further BASIC execution. ### Notable Techniques - **Self-saving**: Line 9999 saves and immediately verifies the tape image, making the program self-distributing from within the BASIC listing. - **Guard condition**: The `IF PEEK 23681<>0` check at line 1 provides a conditional gate before launching the machine code, likely preventing execution in an unsuitable environment. - **REM as data store**: The entire machine code payload — which appears to be a substantial graphics or animation routine based on the density of block graphic characters (`▚`, `▙`, `▛`, etc.) — is stored in the line 0 `REM`, invisible during normal operation. - **Block graphics in payload**: Numerous Spectrum block graphic characters (chars 128–143) appear within the REM data, suggesting the machine code constructs or renders a graphical display. ### Potential Anomalies - The `NEW` at the end of line 1 will erase the BASIC program from memory after the machine code returns. This is intentional for demos that only need BASIC as a loader. - Line 2’s `STOP` is unreachable under normal flow and serves only as a safety net if line 9999 does not exist. - The title `"FEAST"` suggests this may be a named demo or game rather than a utility. ## Source Code ``` 0 REM @!gh GO SUB VAL <> LPRINT ▚ LPRINT 3000USR USR USR NOT < CAT 003USR 0USR ▚ COPY USR ?USR USR 0000 LIST USR COPY LLIST COPY LPRINT g NEW 3USR DRAW NOT ?0 LIST 0 CAT TO USR DRAW USR LPRINT LLIST ▚xf▚`03? DRAW NOT NOT 0 LIST LIST DRAW <0? COPY ▝ COPY ▜ BORDER ▝ RANDOMIZE LPRINT x LPRINT 0 DRAW 0USR USR NOT USR 0 LIST DRAW LIST ?< CAT DRAW NEXT USR RETURN 00USR <00 00USR 00USR USR LPRINT ▝ SAVE LPRINT FREE COPY LPRINT `` DRAW 00USR USR 0I$CHR$ D▘D\a'0C\c▌ PLAY JI<>$p DIM , IF D\c\a PLAY JI? COPY COPY LPRINT ` COPY COPY RETURN @STICK\iSCREEN$ )<>$CBIN \c\a▘D\aBIN \aA\c▌ PLAY JO) H)$▛BIN \c\a$J SAVE 8 ▙ @\c\k "B)B\c\a▌D\aA* PLAY JH)$H)BIN ▌\ap$BH USR XUSR @PEEK \j LPRINT "A AND 8A▝ LLIST ▀`qVAL$ 8LN READ ▗ CONTINUE \kIINKEY$8 AND \iH 0@ USR USR "@> 8AUSR USR TO 0USR USR LPRINT @ LINE INPUT \qD@ ")A▙8`SIN USR a LPRINT ,&@I,b DEF FN LEN J AND ,a &$LEN ▛VAL &USR \iA&\iLEN \q LET ▝\b 6c AND , LPRINT ic▙SIN USR a LPRINT ,&@ $\a$`") LPRINT ,aATTR LIST VAL$ REM LPRINT CONTINUE LPRINT SCREEN$ HSCREEN$ ▌SCREEN$ VAL$ LPRINT VAL$ $rD\cG$I \b<> C<>$pa$0J@a)L $JDVAL HPOINT PLAY A)$J@G$\c>\a▞ DIM \b$\cG$I \b<> C<>$p&$$\a PLAY ▀ ")0@\c\cD PLAY FN ▌SCREEN$ AT VAL$ @ LINE LSCREEN$ LINE VAL$ LPRINT SCREEN$ BIN J\q REM AT \q LINE >=SCREEN$ PLAY ▞$KBIN \c\a ERASE D PLAY I LET )I) Ha$\aKUSR a)D$KBIN \aH DIM PLAY C▞$J@SCREEN$ I<\b *\bPOINT LET $SGN ERASE D PLAY I LET )I) H"BIN $\a PLAY a*POINT \c\cD PLAY FN ▌SCREEN$ ▗SCREEN$ @ PLAY HFN DN\qSCREEN$ ▗ SCREEN$ NVAL$ ▗"AJ\c\a\cD PLAY I "▝)I)$H)A$\aJAD)$ri PLAY A$IUSR "SCREEN$ I \a@"\c)▝$\q\cD PLAY I "▝)I)$H&B$p PLAY *BPOINT BIN $FN SCREEN$ INPUT ▗ REM @ PLAY HVAL$ ▌*\q CONTINUE DH\qVAL$ ▗\qSCREEN$ BFN ▗C▚▗I▀ha▗\kI b AND LN 3▚\c AND \iHB&LN 3USR \i LLIST H@"▞INKEY$\ik "c AND LN 08B&LN `NOT a▗\kI b AND LN 3▚\c AND \iHB\k READ ▚8A AND LN 08`N▖ INPUT ▘▙*`BIN N REM REM FN NEW n\q STOP ▚@ ` ▙ LPRINT INT ▌tO▌\h CONTINUE u CONTINUE OINT \ht▌KINT MERGE MERGE ▌KtINT OuIN u\huOu.u STOP \h LET ▌ LET t LET K LET ' LET INT .O.INT t LET O\hO LET t.O\hO. CONTINUE CONTINUE \h STOP \\\o STOP CONTINUE STOP \o LET .tINT t LET tINT t\st CONTINUE u CONTINUE OINT t▌INT SCREEN$ OSCREEN$ ▌'Kt▌tINT t' INVERSE INT OR INVERSE OR INVERSE MERGE Kt▌tINT t' INVERSE INT OR INVERSE MERGE ' MERGE OR \dRNDINT OR INT INVERSE INT \dn]bnbn REM \dRNDINT OR INT INVERSE 'tINT n\dINT \hINT K. INVERSE INT OR LET K▌ STOP SAVE RND OR \d CONTINUE O STOP t' LET OR INVERSE INVERSE ' INVERSE ' INVERSE 9 INVERSE 9 INVERSE ▌▌ LET \oBIN O STOP Orr▌INT ' LET ▌' LET 9_▌INT STOP STOP O STOP ▌' LET 9▌9 INVERSE LET ' LET OR \d SAVE \d\d\mCODE OR INVERSE LET ' LET OR \d OR LET '\h\d OR MERGE ' MERGE OR \d INVERSE '\d' INVERSE '\d' MERGE 'RND' MERGE 'RND'INT INVERSE INT \dn\dINT INVERSE STOP n\dCODE INVERSE CODE \dnRND INVERSE n INVERSE RND INVERSE n INVERSE CODE INVERSE SAVE INVERSE CODE INVERSE SAVE INVERSE /LN u\h\\O\hIN uIN OINT STOP \\O\\\h\\INT K.'K'K_▌INT STOP \\O\\\h\\INT K.'K_INT _' INVERSE LET .'.K. INVERSE RND\dRND\dRND\d OR INVERSE LET .'.RND INVERSE .K INVERSE .KINT .KINT \\KINT \\DRNDCODE RND\dRNDCODE RNDu.K_K'K_KUbRND\d\dRNDINT OR INT \dn\d SAVE \dRNDINT OR INVERSE '\d' INVERSE '\d' MERGE 'RND' MERGE '\d' LET 'CODE ' LET 'CODE 'nINT nINT .K OR K.K OR K' MOVE SAVE MOVE ' MOVE SAVE MOVE 9tINT t9t INVERSE tt INVERSE n INVERSE t INVERSE n INVERSE t INVERSE INT \dnI]nI]n'RND OR MERGE Ktu CONTINUE OINT t▌INT SCREEN$ OSCREEN$ ▌'Kt▌tINT t' INVERSE INT OR INVERSE OR INVERSE MERGE Kt▌tINT t' INVERSE INT OR INVERSE MERGE Kt▌tINT t' INVERSE INT OR INVERSE MERGE ' MERGE OR \dRNDINT OR INT INVERSE INT \dn]b REM n\dINT OR INVERSE 't▌INT RETURN _9'__▌INT MERGE INT ▌_IN IN rOINT MERGE _▌INT MERGE rOOIN IN MERGE __9'__▌INT MERGE INT ▌_IN IN rOINT MERGE _▌INT MERGE rOOIN IN MERGE _'9_''9_▌_▌INT MERGE ▌▌▌_▌INT MERGE MERGE ▌ MERGE ▌'▌' REM '▌▌' REM '9_''9''9_t99'9_▌INT MERGE _▌INT MERGE rO'IN IN MERGE _'9_''9_▌_▌INT MERGE ▌▌▌_▌INT MERGE MERGE ▌ MERGE ▌'▌' REM '▌▌' REM '9_''9''9_t99'9_▌INT MERGE _▌INT MERGE rOOIN IN MERGE _ RETURN COPY IN rOINT MERGE rIN r MERGE LET MERGE \s MERGE \s LET MERGE _▌INT MERGE ▌INT MERGE rINT MERGE rIN DrIN uSCREEN$ IN DIN D MERGE \s▌_9'9_▌_▌INT MERGE INT 'INT MERGE '9' MERGE '_9O_Or▌rIN INT IN CONTINUE IN rOINT MERGE rIN CONTINUE Drr. RETURN ▌▌_ RETURN ▌_K'K_K▌\s RETURN ▌▌▌ SAVE INVERSE SAVE \s SAVE ▌ SAVE 'K'_\s▌▌_ RETURN ▌_K'K_K▌\s RETURN ▌▌▌ SAVE INVERSE SAVE \s SAVE ▌ SAVE 'K'_\s__K RETURN 99_9' RETURN ▌▌▌ SAVE SAVE INVERSE 'K_K'INT INT INVERSE INVERSE INT INVERSE INVERSE ▌ SAVE SAVE LET SAVE SAVE INT LET ''O''KK_▌INT ▌ LET INT INT INT INT LET LET ▌'' LET '' LET ' LET INT KKKO MERGE __O__O_O\h\hINT LET O_\s RETURN ▌▌__99'▌''▌'▌▌ SAVE INVERSE 'K_ SAVE 'K_▌'K_▌\s▌_K''K_▌▌__K RETURN 99_9' RETURN ▌▌▌ SAVE SAVE INVERSE 'K_K'INT INT INVERSE INVERSE INT INVERSE INVERSE ▌ SAVE SAVE LET SAVE SAVE INT LET ''O''KK_▌INT ▌ LET INT INT INT INT LET LET ▌'' LET '' LET ' LET INT KKKO MERGE __O__O_O\h\hINT LET O_\s RETURN ▌▌__99'▌''▌'▌▌ SAVE INVERSE 'K_ SAVE 'K_▌'K_▌\s▌_K''K_▌▌ RETURN _\s MERGE ▌\s MERGE _\s▌ MERGE __\s MERGE ▌\s_t9_9 REM 9_ RETURN _\s MERGE ▌\s MERGE _\s▌ MERGE __\s MERGE ▌\s_t9_9 REM 9_ RETURN REM SAVE REM _ MERGE _\s_▌_ MERGE REM SAVE REM _ MERGE _\s_▌___\s_▌ MERGE REM SAVE REM _ MERGE _\s_▌_ MERGE REM SAVE REM _ MERGE _\s_▌___\s_▌ MERGE OR INVERSE REM ' REM INVERSE REM ' REM INVERSE OR INVERSE REM OR REM ' REM INVERSE REM ' OR INVERSE REM '' REM INVERSE REM OR ' REM INVERSE OR REM INVERSE OR ' OR OR OR REM '_ REM INVERSE REM INVERSE REM ' OR INVERSE REM '' REM INVERSE REM OR ' RETURN FLASH ▗'>=Qo▗ATTR ▌ RESTORE FOR FOR LLIST s#r+<> RESTORE ATN FOR GO SUB B PAUSE RESTORE >bkLN CLS EXP SAVE STOP ATN RESTORE FOR B0 CLS MERGE !j\\>w!H\\>w!▟\\>w STEP REM > OPEN # RETURN NOT CODE \j!\\>w!5\h GO SUB [C\h STEP i\h!7\h GO SUB [5\h FOR GO SUB \q FOR 6!5\h GO SUB [5\h STEP i\h!9\h GO SUB [5\h FOR GO SUB \q FOR 6!5\h GO SUB [5\h STEP i\h!;\h GO SUB [5\h FOR GO SUB \q FOR 6!5\h GO SUB [5\h STEP i\h!;\h GO SUB [;\h@ STEP z\h> OPEN # PRINT > OPEN # PLOT > OPEN # PRINT :9\h OPEN # PLOT > OPEN # PRINT :7\h OPEN # PLOT > OPEN # PRINT >> OPEN # PLOT *7\hATN GO SUB RCHR$ S\iNOT w\j!=\h STEP i\h> OPEN # PRINT :=\h OPEN # PLOT !?\h STEP i\h!;\h GO SUB [;\h STEP s\h!?\h GO SUB [?\h STEP s\h*?\hATN GO SUB R LINE \n\iNOT t\i!=\h GO SUB [=\h STEP i\h*=\hATN GO SUB R LINE EXP \iNOT _\i!A\h:\\w#6*A\hATN GO SUB R LINE ERASE \iNOT RESTORE \j!;\h GO SUB [;\h STEP s\h*;\h GO SUB R IF LOAD \iNOT EXP \i!=\h STEP i\h> OPEN # PRINT :=\h OPEN # PLOT !?\h STEP i\h!?\h GO SUB [?\h STEP s\h*?\hATN GO SUB R LINE ,\jNOT !=\h GO SUB [=\h STEP s\h*=\hATN GO SUB R LINE H\jNOT CLS \i*5\h GO SUB [E\hATN GO SUB R LINE X\jNOT <=\h*G\hATN GO SUB RCHR$ t\j!5\h GO SUB [C\h STEP i\hNOT <=\hNOT CODE \j!A\h:\\w#6*A\hATN GO SUB R LINE \a\jNOT RESTORE \j!;\h GO SUB [;\h STEP s\h*;\hATN GO SUB R LINE AT \jNOT w\jNOT H\j!=\h STEP i\h STEP █\l!C\h▀ STEP i\h!E\h▗ STEP i\h!G\h STEP i\hNOT TAN \h> OPEN # PRINT >? OPEN # PLOT !G\h STEP i\h*A\hATN GO SUB RCHR$ /\k!=\h STEP i\h STEP █\l!C\h▗ STEP i\h!E\h▌ STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ e\k!=\h STEP i\h STEP █\l!C\h▌ STEP i\h!E\h▟ STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ \l\k!=\h STEP i\h STEP █\l!C\h▟ STEP i\h!E\h▙ STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ MOVE \k!=\h STEP i\h STEP █\l!C\h▙ STEP i\h!E\h\e STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ \l!=\h STEP i\h STEP █\l!C\h\e STEP i\h!E\h\g STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ =\l!=\h STEP i\h STEP █\l!C\h\g STEP i\h!E\h\h STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ ©\l!=\h STEP i\h STEP █\l!C\h▗ STEP i\h!E\h\h STEP i\h!G\h STEP i\hNOT TAN \h*A\hATN GO SUB RCHR$ ▄\l<>NOT CODE \j STEP [h>> BEEP >=\h BEEP > BEEP \h STEP FLASH !> BEEP !;\h STEP i\h!;\h GO SUB [;\h STEP s\h*;\hATN GO SUB R LINE VERIFY \lNOT INT \l<>@ 1 IF PEEK 23681<>0 THEN PRINT AT 0,0;: RANDOMIZE USR 38808: NEW 2 CLS : LIST 9999: STOP 9999 SAVE "FEAST" LINE 1: VERIFY "FEAST" ```