This is a demonstration program for “Extended BASIC,” a machine-code extension for the ZX81/TS1000 authored by Frits Beniest, showcasing the additional commands it provides. The program’s BASIC lines act primarily as a driver: nearly all graphical and I/O work is delegated to machine code via the recurring GOSUB 0 idiom, where line 0 begins with a USR call that transfers control to the extension’s Z80 routines embedded in a large REM block. The extended commands exposed through REM statements include DRAW, FILL, FIL, UNDRAW, SCROLL, MOVE, CIRCLE, PAPER, UNPAPER, RESTORE, READ, PRINT AT, CLS, and OUT, all parsed and executed by the machine code. The demo cycles through animated sequences—logo drawing, fill-pattern flicker, scrolling text spelling out character-per-second statistics, a shooting sequence, and synthesiser output via OUT to the AY or similar sound hardware—before looping back to line 10. Data for animation sequences and music note values is stored in REM DATA blocks at lines 4000, 4010, and 5000, read back at runtime by the extended BASIC READ command.
Program Analysis
Overall Architecture
The program is a demonstration of an Extended BASIC package written by Frits Beniest. Its structure is unusual: almost no visible work happens in conventional BASIC statements. Instead, nearly every action is performed by calling GOSUB 0, which reaches line 0. Line 0 contains IF USR . THEN RETURN; the USR . expression calls the machine-code interpreter embedded in the program (the dot resolves to a stored numeric value representing the entry point). The interpreter then reads the command text stored in the REM statement on the line immediately following the GOSUB 0 call, executes it, and returns. This means every REM after a GOSUB 0 is not a comment but an extended-BASIC command string.
Machine Code (Line REM Block)
The large This is a demonstration program for “Extended BASIC,” a machine-code extension for the ZX81/TS1000 authored by Frits Beniest, showcasing the additional commands it provides. The program’s BASIC lines act primarily as a driver: nearly all graphical and I/O work is delegated to machine code via the recurring GOSUB 0 idiom, where line 0 begins with a USR call that transfers control to the extension’s Z80 routines embedded in a large REM block. The extended commands exposed through REM statements include DRAW, FILL, FIL, UNDRAW, SCROLL, MOVE, CIRCLE, PAPER, UNPAPER, RESTORE, READ, PRINT AT, CLS, and OUT, all parsed and executed by the machine code. The demo cycles through animated sequences—logo drawing, fill-pattern flicker, scrolling text spelling out character-per-second statistics, a shooting sequence, and synthesiser output via OUT to the AY or similar sound hardware—before looping back to line 10. Data for animation sequences and music note values is stored in REM DATA blocks at lines 4000, 4010, and 5000, read back at runtime by the extended BASIC READ command. The program is a demonstration of an Extended BASIC package written by Frits Beniest. Its structure is unusual: almost no visible work happens in conventional BASIC statements. Instead, nearly every action is performed by calling The large The following commands appear inside The entire demo is structured as a sequence of paired lines: a Lines Lines 7005–7050 implement a short musical phrase subroutine. It restores and reads pairs of values Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.REM on the unnumbered line (line 0 area, before line 1) contains several hundred bytes of Z80 machine code — the entire Extended BASIC interpreter/runtime. Key entry points visible in the hex stream include calls to ROM routines (e.g., \CD\A7
Skip to content
= CALL 0E A7h, the ZX81 error handler area) and structured dispatcher logic. The code handles command parsing, coordinate arithmetic for graphics primitives, OUT port writes for sound/hardware control, and data READ/RESTORE operations against Extended Basic Demo
Program Analysis
Overall Architecture
GOSUB 0, which reaches line 0. Line 0 contains IF USR . THEN RETURN; the USR . expression calls the machine-code interpreter embedded in the program (the dot resolves to a stored numeric value representing the entry point). The interpreter then reads the command text stored in the REM statement on the line immediately following the GOSUB 0 call, executes it, and returns. This means every REM after a GOSUB 0 is not a comment but an extended-BASIC command string.Machine Code (Line REM Block)
REM on the unnumbered line (line 0 area, before line 1) contains several hundred bytes of Z80 machine code — the entire Extended BASIC interpreter/runtime. Key entry points visible in the hex stream include calls to ROM routines (e.g., \CD\A7\0E = CALL 0E A7h, the ZX81 error handler area) and structured dispatcher logic. The code handles command parsing, coordinate arithmetic for graphics primitives, OUT port writes for sound/hardware control, and data READ/RESTORE operations against REM DATA lines.Extended BASIC Commands Used
REM strings and are executed by the machine-code interpreter:
DRAW / UNDRAW — draw and erase line sequences by coordinate listsFILL / FIL — fill rectangular screen regions with a specified characterSCROLL — scroll the screen by a given number of linesCLS — clear screen via the extended systemRESTORE / READ — read from REM DATA blocks at specified line numbersPRINT AT — positioned print within the extended command streamOUT — direct hardware port output (used for border colour and sound chip control)MOVE — animated character movementCIRLE (sic) — circle drawing (apparent typo in source for CIRCLE)PAPER / UNPAPER — area attribute-style fill/clearGOSUB 0 Dispatch Idiom
GOSUB 0 line followed by a REM line containing the extended command. The machine code in the interpreter presumably uses the return address on the stack to locate the REM text on the following line, execute it, then perform a true return to the BASIC line after the GOSUB. This is a well-known technique for embedding interpreted sub-languages in ZX81 BASIC without altering the BASIC line structure.DATA Storage in REM Lines
4000, 4010, and 5000 hold REM DATA blocks. The extended READ and RESTORE commands target these by line number (e.g., RESTORE;4000, RESTORE;5000). Line 4000 stores string data for the animation (labels such as “UNDRAW”, “ZX-81”, “COPYRIGHT 1983”, author name variants). Line 4010 stores the “SHOOTING IN EXTENDED-BASIC” title screen strings plus a count value (63). Line 5000 stores numeric pairs used as note/duration data for the sound output routine at lines 7005–7050.Sound / Hardware Output
L, J from REM DATA at line 5000, then outputs them to hardware ports via OUT;219,0,223,J,219,1,223,L. Port 219 (0xDB) with sub-addressing via port 223 (0xDF) is consistent with an AY-style sound chip or the ZX81’s own port-mapped hardware. Lines 7100–7190 provide a short descending tone sweep (H from 250 to 0 step −80) also sent via OUT;223,H.Demo Sequence Structure
GOTO 10 to loopVariable Usage
Variable Role A$–G$String data read from REM DATA at line 4000/4010 (labels, decorative strings) AInitialised to 0; used as fill-character argument (A) meaning space/clear in extended commandsNGeneral loop counter (FOR loops at lines 20, 705, 755, 825, 862, 870) KBorder colour ramp value (line 26: K=6*N); also inner loop counterSOuter loop counter / step counter in several sections WDelay loop variable and outer animation counter HSound sweep value (250 to 0 step −80) J, LNote frequency/duration values read from DATA at line 5000 MMiddle loop counter in lines 579–640 Notable Anomalies
REM CIRLE;N,N,N, — “CIRLE” appears to be a typo for “CIRCLE”; whether the interpreter accepts this abbreviation or it is a genuine spelling error in the source is unclear.FOR/NEXT loops (FOR W=1 TO 5 : NEXT W) used purely as delay loops, a standard ZX81 timing technique.(A) in extended commands refers to the BASIC variable A (value 0 = space character), used to clear filled regions.GOTO 10 making the demo an infinite loop; lines 900–910 (SAVE and RUN) are only reachable manually.Source Code
0 IF USR . THEN RETURN FROM EX. BASIC AUT: FRITS BENIEST (C) 070/988735 %V%E%R%S%I%E% %2%.%17676%-%-!!RND%E6C""73''''''5E' POKE 6D' U£RND47U(RNDLEN SCROLL %SCOS INT $.'.'INKEY$( SAVE INT 7C 76C''7( POKE INT 7D6USR RNDTAN Y. %SATN 62INKEY$%(4FFLN 5AINKEY$$COS 2~~57LN NINKEY$$COS 26457LN NINKEY$TAN FLN 5AINKEY$ RETURN COS 477A..>=62INKEY$( IF TAN 6USR RNDLN '44COS RETURN :TAN TAN PLOT SQR Y3 PLOT SQR INT 3 AT STR$ LN ATN INKEY$LN INKEY$LN EXP INKEY$.'=VAL FAST STR$ .''',%Y4~~LN LN INKEY$<( PLOT AT AT AT TAN SGN LPRINT <<<<<AT ( STOP INT . CLEAR ACS 5'./. CLEAR ACS 5LEN C3%J4D FOR FAST LN EXP INKEY$%;INKEY$ RETURN OASN 7846INT . CLEAR Q5' C3M46; FOR LN 67457BTAN R7846UND5DPI 7 TO 6ABS RNDLN STOP 44775E756YC%U' **<72F73. FOR LN **,,5675E GOSUB 53:'RNDLN LLIST RND7777) PRINT 4BLN 6FINKEY$C3SGN 45 COPY VAL STR$ LN LN INKEY$LN ' INKEY$ FAST LN RUN 45 LPRINT SGN ><AT ( GOSUB TAN F. %SC: FLN EXP INKEY$ RETURN ,COS INT 7D5E7567B RETURN C.'%>K''7A%(**INT 75 CLEAR ACS 5'.C3C4B CLEAR ACS 5LEN / RUN U5RNDACS ./: U5RNDACS SIN M5RNDC3 REM 42FE 0C8F5CD2015F1CD1D15EF 534CDA7 EC9EBCDEF40CD9042CDA542CDB242CDCE42CD4C4920EFC911D840 6 4D5CD 842CDCD41CD 141CD 64912D1C9EB 61ACD364223 622CD3642C921DB407E2B96 6 04E5F2B7E2B96577E2A C40 9 E213DC8 918FBC9E53ADC4043CD F4E10FBE1 9E51520F4E1C97EB9D8CF75C5C3C645C9EBCDEF4011D840 6 4D5CD 842D1EB2346234E702B712B 0 E40CDE04223CDE042 E3023CDE04223CDE04221D840113D40 6 2CD744513 6 2CD74451E 0213E40CD48452323CD4845233A3F4077CD4845213C407316 0CB46201E3A40405FCD5B45ED53454016 03A42405FCD5B45ED534740D53A4340181B3A3D405FCD5B45ED53454016 03A43405FCD5B45ED534740D53A4240C1CD6842ED434940213C40CB4620 ECB4E28 2CBDECB562810CBE618 CCB4E28 2CBE6CB5628 2CBDE114B40237E12232323137E12213C40CB4620 53A434018 33A424047 4 02A4540113F 019224540CDE542CD4C49C25449C923 6 311E9434E1AB9C0231310F8C929263923235E23562319C932323232232323237EFEEAC93232CDCD417EFE76C9323232E52323EBA72A1440ED52E1C93232322AD640CDF2 9EB22D640C932323232C6402AD640CD4149C8F52A104022D640CD C44DC5D44F1CD4149C8F5CD1B4418EFC932E52323EB2A C40A7ED52E1C93232CF72CF 1EBCDEF40221640CD754718 9CDEC43CD4D44DC5B44E5CDF84320 5CDDA4328 3E118E9D1CDEF40 0 0 0 022DE40C92432323232CD1D152A1C40 1 5 0ED42221C40ED5BD64013EDB0C93232322ADE40CD 24420 723CD7444CDCD41221640CDBA46DF22DE40FE1AC8CF7DEBCDEF40CDCD41CD 141CD2242CD68472AD440CD4B4120EFC92A104022D6402A 240C9C5CB38 4CB39 C3E1990472A C401121 018 11910FD5919C1CD99463E2F90473E 1CB2830 23E 4CB2930 1 7F57E 7FE1030 6 F30 2EE8F47CD914628 5F12FA018 2F1B0FE 838 2EE8F77C99677C9CB7E20 3CBCEC9CB8EC97E2B9638 5CB132318 5CB137E23962377C996 6 7A7CB13CB1210F9C92396 6 7A7CB1ACB1B10F9C94B40ED7E12231310FAC92A4540ED5B49403A3C40CB5F20 31918 797ED5230 2676C224540EBCD6745C9C53A3C40CB4720 5214B4018 3214C40CB6720 33418 135CD7B45213C407BCB4620 5324C4018 3324B40ED4B4B40CDED44C110CBC9E5EB5E2356EBD1 1DD45C5E92AD440CDCD41FE E20 6CDCD41C3FE412AD240221640 1 1 0C9CD F4638 5CD164118 ACD2242CD2A44CD174679C91B1B1B5F2B3E2596237BC9CD1E46CDA7 EC92A1C40 1 5 0 9221C40ED42EB2AD64023EDB0C91B 0CD4F4E2A C402322 E403E 032DC401E201618 E21CDCE42C92336 12336212336 0CDAE42C9ED5B C402121 01319 1F7 2EDB0 620EB36 02310FBCD3648C9C9 0 0 0EBCDEF4011D840 6 1D5CD 842D11A3C47C5CD5A46C110F9C93A2140CB47C93D3DCD914620 97EE678FE 0C836 0C97EE678FE 0C8C1C9CDAD4838 4CDD8 9C9E1C9FE1628 9FE1520 1E7CDD914C9E7CDD914E5CD851BCDA01AE1C92ADE40237EFE7620 523CD7444232B22DE40C91B2ADE4023CDF54622DE40C91B1B 1 0 07EFE1AC8FE7620 2CF7D 32318F21B1B2AD640234E36 0234636 02378B1C460 AC92AD6402371237023CD9E 9C91B1B2B7EA728FBCDCE1438 2CF70C620CD2C44237E23B628 3CD 847CDD44623E5CDE846C5CD1A47C1E178B1C8ED5BD640131313EDB0C91BCD2A44CDAC44CD9644C9FE D20 5CD284718 3CD5E47C9E7CDBA46DF22D4407EFE1A28 2CF7DCD8A1520 578FE4038 2CF146069CDD8 9C97EFE7620 1231ACB7728 23E8F771323 B78B1C8D5ED5B3C40ED5219D138E1D5C522 E40CD5A462A E40C1D118D2 0EBCDEF40CD5548CDCD41CD 141CD2242FE DF5CC1C42CD28494FF1F57928 2C620C620CD2C44F1F5C42E49F1CC3B49EB2A10402B223C402A E40CDA74722 E40CD12482AD440CD4B412B20BBC9A72A E40ED5B C4013ED521121 03E18ED5238 33D18F9323A40197B95323940C91B1B1B3A3A40FE1820 62A C402318 9A72A E401121 0ED5222 E40CD1248C9CF17E5CD1C42FE3920F6CD1C42FE2628 2E1C9E111D840D5 6 2CD 842E1 E18CDE04223 E20CDE0422A C40233AD840FE 028 7471121 01910FD3AD94016 05F1922 E40CD12482AD440C91B1B1BEB2BCDEF4011D840 6 1D5CD 842CDCD41CD 141CD2242CD2A44D11A4FED78CD93442AD440CD4B412B20DAC9BCEBCDEF4011D840 6 2D5CD 842E14E2346FDCB3B7628 8ED41 0D3FE7618 CCB41F5CC2B FF1ED41CC23 F2AD440CD4B412B20D0C9CF73CB4028FACD2242CB48C0FE1120F02B2B3E10BE20E92323D5CD 146D1CB77C83E8FC9CDCE14D8CF70CD1E46CDD51BE5CDA314E1C91B234E234623C9BEC8FE60D8CBFFBECBBFC92AD440CD4B412BC9E521D940545D7E1B122323137E12E11BD51313 6 2C3F442251CEBCDEF40CD904211D840D5213C40EB 1 4 0EDB0D1CDA542CDB242227B40D52AD44011DD40 6 1CD 8424F1B1B1AD9D1D9 0FE2A28 EFE3C28 AFE332826FE382822CF16C5D9C1D9FE2A28 2CBC8FD7021213E40 6 21E21CDC54A2A7B40CD5E4AC3124AF5C5E1C5D1 6 5CD5D4519E5D9C1D9 6 0F1FE3820 2CBC0FD7021213C40 6 21E19CDC54A2A7B40FDCB214628 FD9D5D9C11121 018 11910FD227B40CD374ACD4C49C811DC40CDCD41CD 141CD 64912C37549ED5B1040ED52193FD8ED5B C40ED5219C9D9C5D5D9E5CDA44AA7FDCB214628 31918 2ED52CD264A38 5113C40EBEDB0CDFA4A20E1C3AA4E3ADD40FE 0C8CDA44A79D5C15FFDCB214EF5CC7D4AF1C48F4ACDFA4A20E8C9CD5F4EC8 04B113C40BEC8EBEDA0EBE018F7CD5B4EC84B113B40EB 9EBBEC8EBEDA8EBE018F7F7D9D5D9C1 6 0C52A7B40E5113C40EDB0E1C1C5 0 0 0 0 0 0 0 0D9C5D9D1C1C920 E7E81BB38 27B3D77231C10F418 D7E3D9130 33E 2903C772310F311D840213C40 1 4 0EDB0C92B16 0193E76EDB9C9 0 0 02A7B401121 0FDCB214620 31918 2ED52227B40D915D9C91B1B1121 018 11910FD227B40C940C9C9113C40EBC9EBCDEF4011D840 6 3D5CD 842CD5A4CE11E 3D516 05EC5CD5B45C1237B 2 37A 2 3D11D20ECCD5B4BCD4C4920D5C9 0 0 0 6CA97C5ED5B3C40CB4FC4D24B 6 5CD69452A3E40CB4F20 8ED5230 9CBC718 51930 2CB87223E40EBCB47C4D24B 6 5CD69452A3C40CB4720 71930 ACB8F18 6ED5230 2CBCF223C40F5ED5B4240CDBB4132454097B22018ED5B40402A3E40CDBB4132444097B220 7ED4B4440CDD94BF1C1108DC921FFFFED52EBC9972148405E2356EBED42C8EB702B713E3FB9D83E2FB8D8CDED44C91B32343B6E4935372EC547283138B441343A39CF4829372656422B2E31314E372A26CA442E3319A248372A385F44382837A0413A33295D42282E3749423A33285042312A2B644C372E2C684C322E296C4C302A3E9341352635394E3A3335354E283435474E1B213C4070237023E5C1C93E 218 63E 118 23E 4322140C3EF4C2A3C4097E5CD 013BADC44422AD84062EBED524D44E1C9D5CDCD41CD 141CD2242FE DC42C42CD1C42CD2849C620CD2C44D17D12137C12132AD440C9CDE24CC87EF5CD3B49C52A3C40E5CD B47E1C178B120 2F1C9E5C5CD1D47C1E1F1E5C5CD3344C1D1232323CD5747C9 0 0 02A3E403A3C40BDC03A3D40BCC9EBCDEF40113C40CD8B4CCD8B4C11D840 6 1FDCB215628 1 4CD 842CDB04CCD3A4DCD1D4DCD4F4DCD4C4920D7C9FDCB2146C8CD744C30 4CD B47C9CD344D4B42CD60 AC92371237023C9FDCB214EC8CD744CD8C54B42CD344D 9C1CD60 AC9FDCB2156C8CD224D21D8407E23BE38 72A3C40CD B47C9477E902B77CD3F4DC9CDBB 2444D513E 014C8CDBD 77EC9CDCD41CD 141CD2242FE D20 DCD1C42CD2849C620CD2C4437C9CD2A44373FC9CD 24ED8237E 0 6 0CDC242CD264AC91CEBCDEF40FDCB2146F528 B11D840 6 2CD 8422AD440CD7E4D3818F120 ACD6F4DD61C30 19718 7CD9E4D7E30 197CD9344C9CD B47F128 7CD9E4D7ED818 5CD6F4DB7C8 1 1 0CD1A472AD64023232377C921D8403E20BED84E3E 0B93FC9FDCB214628 37723C9FDCB214E28 7BE20 236 023C9F597BE20 4F17723C9F123C93E 118 53E 218 197FD7721C37A42EBCD4841C8CF1BCD404E1618C36B 8CD404E2139403621233618C92B16 019533E76BEC8979228 336 015FDCB214E28 22B2B23 D28 218E73E753CC91BD51121 0FDCB214628 31918 2ED52D1C9D5E560691121 0ED527CB5444DE1D1C9C5E59743772310FCE1C1C9E1D1D5421121 0FDCB214620 918 11910FD18 4ED5210FCD1C178B1C8D5CD264AD138 3CD9F4ECD8F4EC815C8CD7E4E18EB1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B
1 LET A$=""
2 LET B$=""
3 LET C$=""
4 LET D$=""
5 LET E$=""
6 LET F$=""
7 LET G$=""
9 LET A=0
10 GOSUB 0
11 REM OUT;219,0,223,0,219,7,223,254,219,8,223,15,:FILL;1,25,1,33,##,2,24,2,32,(A),:DRAW;14,44,4,44,4,28,14,28,:DRAW;5,36,14,36,:DRAW;15,43,15,37,:DRAW;15,35,15,29,:DRAW;18,28,18,43,:DRAW;19,44,28,44,:DRAW;29,43,29,28,:DRAW;19,36,28,36,:DRAW;43,44,33,44,:DRAW;32,43,32,37,:DRAW;33,36,42,36,:DRAW;43,35,43,29,:DRAW;42,28,32,28,:DRAW;46,44,46,28,:DRAW;59,44,50,44,:DRAW;49,43,49,29,:DRAW;50,28,59,28,:FILL;12,23,3,31,% ,13,16,10,23,@@,:RESTORE;4000,:READ;A$,B$,C$,D$,E$,F$,G$,
20 FOR N=1 TO 40
25 PRINT AT 16,13;;B$;AT 20,8;C$;AT 13,10;D$;AT 18,5;E$;AT 13,10;F$;AT 18,5;G$
26 LET K=6*N
28 GOSUB 0
29 REM OUT;219,0,223,K,
30 NEXT N
40 GOSUB 0
41 REM OUT;219,7,223,255,:CLS:FIL;1,25,1,2,% ,2,25,2,3,% ,3,25,3,4,% ,4,25,4,5,% ,5,25,5,6,% ,6,25,6,7,% ,7,25,7,8,% ,8,25,8,9,% ,9,25,9,10,% ,10,25,10,11,% ,11,25,11,12,% ,12,25,12,13,% ,13,25,13,14,% ,14,25,14,15,% ,15,25,15,16,% ,16,25,16,17,% ,17,25,17,18,% ,18,25,18,19,% ,19,25,19,20,% ,20,25,20,21,% ,21,25,21,22,% ,22,25,22,23,% ,23,25,23,24,% ,
44 GOSUB 0
45 REM FIL;1,25,32,33,% ,1,24,31,32,% ,1,23,30,31,% ,1,22,29,30,% ,1,21,28,29,% ,1,20,27,28,% ,1,19,26,27,% ,1,18,25,26,% ,1,17,24,25,% ,1,16,23,24,% ,1,15,22,23,% ,1,14,21,22,% ,1,13,20,21,% ,1,12,19,20,% ,1,11,18,19,% ,1,10,17,18,% ,1,9,16,17,% ,1,8,15,16,% ,1,7,14,15,% ,1,6,13,14,% ,1,5,12,13,% ,1,4,11,12,% ,1,3,10,11,% ,18,25,1,10,##,1,8,24,33,##,9,17,12,22,##,
50 FOR S=1 TO 6
51 FOR K=1 TO 6
52 GOSUB 0
53 REM FIL;10,11,14,20,.',10,16,20,21,.',15,16,14,20,.',10,16,13,14,.',2,6,15,23,: ,20,24,11,19, :,2,7,25,32,(A),19,24,2,9,% ,8,17,2,7,<,9,18,27,32,>,1,3,1,10,!!,23,25,24,33,;;,
55 PRINT AT 11,14;"DEMO";AT 12,14;"%F%I%L%L"
56 GOSUB 0
57 REM FIL;10,11,14,20,'.,10,16,20,21,'.,15,16,14,20,'.,10,16,13,14,'.,2,6,15,23, :,20,24,11,19,: ,2,7,25,32,% ,19,24,2,9,(A),8,17,2,7,>,9,18,27,32,<,1,3,1,10,;;,23,25,24,33,!!,
58 NEXT K
60 FOR K=1 TO 6
61 GOSUB 0
62 REM FIL;10,11,14,20,.',10,16,20,21,.',15,16,14,20,.',10,16,13,14,.',2,6,15,23,: ,20,24,11,19, :,8,17,2,7,<,9,18,27,32,>,1,3,1,10,!!,23,25,24,33,;;,
63 PRINT AT 11,14;"%D%E%M%O";AT 12,14;"FILL"
64 GOSUB 0
65 REM FIL;10,11,14,20,'.,10,16,20,21,'.,15,16,14,20,'.,10,16,13,14,'.,2,6,15,23, :,20,24,11,19,: ,8,17,2,7,>,9,18,27,32,<,1,3,1,10,;;,23,25,24,33,!!,
66 NEXT K
68 NEXT S
80 GOSUB 0
81 REM FIL;9,17,8,26,##,10,16,9,25,(A),
82 PRINT AT 10,9;"THIS PROGRAM";AT 12,11;"RUNS IN";AT 14,18;"%B%A%S%I%C"
85 LET S=1
86 GOSUB 0
87 REM FIL;1,3,1,10,*,23,25,24,33,*,2,8,24,32,':,18,24,2,10,:.,8,17,2,7,*,9,18,27,32,*,
88 PRINT AT 14,9;"%E%X%T%E%N%D%E%D"
89 GOSUB 0
90 REM FIL;2,8,24,32,(A),23,25,24,33,##,
91 PRINT AT 3,25;"DRAW";AT 3,10;"%I%N";AT 20,20;"%O%U%T"
92 GOSUB 0
93 REM FIL;8,17,2,7,(A),9,18,27,32,(A),
94 PRINT AT 14,9;"% % % % % % % % ";AT 9,3;"%R";AT 10,3;"%E";AT 11,3;"%A";AT 12,3;"%D";AT 10,28;"%D";AT 11,28;"%A";AT 12,28;"%T";AT 13,28;"%A"
95 GOSUB 0
96 REM FIL;18,24,2,10,(A),1,3,1,10,##,
97 PRINT AT 20,2;"UNDRAW"
98 PRINT AT 14,9;"%E%X%T%E%N%D%E%D"
108 LET S=S+1
109 IF S<11 THEN GOTO 86
110 PRINT AT 6,16;"SCROLL";AT 17,11;"FILL";AT 2,1;"RESTORE";AT 21,24;"CLS"
115 GOSUB 0
116 REM FIL;11,14,10,24,% ,15,16,10,24,(A),
120 PRINT AT 11,9;"EXTENDED BASIC"
300 FOR W=0 TO 2
310 GOSUB 7100
320 NEXT W
500 GOSUB 0
501 REM CLS:DRAW;7,45,2,45,2,38,7,38,:DRAW;8,44,8,39,:DRAW;7,33,2,33,2,26,:DRAW;8,32,8,30,:DRAW;8,28,8,26,:DRAW;3,29,7,29,:DRAW;7,21,3,21,:DRAW;2,20,2,14,:DRAW;8,20,8,14,:DRAW;3,17,7,17,:DRAW;2,9,2,3,:DRAW;3,2,4,2,:DRAW;5,3,5,5,:DRAW;6,2,7,2,:DRAW;8,3,8,9,:DRAW;60,45,55,45,55,38,60,38,:DRAW;61,44,61,39,:DRAW;61,33,55,33,55,26,61,26,:DRAW;56,30,59,30,:DRAW;55,20,55,14,:DRAW;56,21,57,21,:DRAW;58,20,58,14,:DRAW;59,21,60,21,:DRAW;61,20,61,14,:DRAW;60,9,56,9,:DRAW;55,8,55,3,:DRAW;56,2,60,2,:DRAW;61,3,61,8,:DRAW;0,47,63,47,63,0,0,0,0,46,
524 LET S=0
525 GOSUB 0
526 REM FILL;2,24,6,28,(A),:DRAW;10,45,53,2,:DRAW;53,45,10,2,:DRAW;27,45,36,45,:DRAW;36,44,27,35,:DRAW;27,34,36,34,:DRAW;37,13,26,2,:DRAW;26,13,37,2,:DRAW;18,31,13,31,:DRAW;12,30,12,24,19,24,19,30,:DRAW;11,23,11,17,:DRAW;12,16,19,16,:DRAW;20,17,20,23,:DRAW;48,16,48,31,46,29,
527 LET S=S+1
528 IF S<16 THEN GOTO 525
547 LET S=0
548 GOSUB 0
549 REM FILL;2,24,6,28,(A),:DRAW;33,23,33,22,30,22,30,25,35,25,35,20,28,20,28,27,37,27,37,18,26,18,26,29,39,29,39,16,24,16,24,31,41,31,41,14,22,14,22,33,43,33,43,12,20,12,20,35,45,35,45,10,18,10,18,37,47,37,47,8,16,8,16,39,49,39,49,6,14,6,14,41,51,41,51,4,12,4,12,43,53,43,53,2,10,2,10,45,53,45,
550 GOSUB 0
551 REM PRINT AT;12,13,A$,:UNDRAW;33,23,33,22,30,22,30,25,35,25,35,20,28,20,28,27,37,27,37,18,26,18,26,29,39,29,39,16,24,16,24,31,41,31,41,14,22,14,22,33,43,33,43,12,20,12,20,35,45,35,45,10,18,10,18,37,47,37,47,8,16,8,16,39,49,39,49,6,14,6,14,41,51,41,51,4,12,4,12,43,53,43,53,2,10,2,10,45,53,45,
552 LET S=S+1
553 IF S<6 THEN GOTO 548
574 FOR K=1 TO 3
575 GOSUB 0
576 REM FILL;2,24,6,28,(A),:DRAW;13,42,49,42,49,6,13,6,13,41,:DRAW;25,41,25,7,:DRAW;37,41,37,7,:DRAW;14,30,48,30,:DRAW;14,18,48,18,
579 FOR M=1 TO 3
580 GOSUB 0
581 REM DRAW;46,39,40,33,:DRAW;40,39,46,33,:DRAW;28,39,28,33,34,33,34,39,29,39,:DRAW;46,27,40,21,:DRAW;40,27,46,21,:DRAW;40,15,40,9,46,9,46,15,41,15,:DRAW;34,27,28,21,:DRAW;28,27,34,21,:DRAW;16,27,16,21,22,21,22,27,17,27,:DRAW;22,15,16,9,:DRAW;16,15,22,9,
585 FOR N=1 TO 4
590 GOSUB 0
591 REM DRAW;40,39,46,33,:DRAW;46,39,40,33,:DRAW;28,27,34,21,:DRAW;34,27,28,21,:DRAW;16,15,22,9,:DRAW;22,15,16,9,
592 GOSUB 7100
595 GOSUB 0
596 REM FIL;4,9,20,25,(A),10,15,14,19,(A),16,21,8,13,(A),
600 FOR W=1 TO 5
601 NEXT W
605 NEXT N
625 GOSUB 0
626 REM FIL;4,9,14,19,(A),10,15,8,13,(A),16,21,20,25,(A),10,15,20,25,(A),
630 FOR W=1 TO 5
631 NEXT W
640 NEXT M
645 NEXT K
700 GOSUB 0
701 REM CLS
705 FOR N=1 TO 10
710 GOSUB 0
711 REM SCROLL;10,:DRAW;17,12,11,12,11,0,17,0,:DRAW;18,11,18,1,:DRAW;29,12,22,12,22,0,29,0,:DRAW;23,6,29,6,:DRAW;33,11,33,0,:DRAW;34,12,36,12,:DRAW;37,11,37,0,:DRAW;38,12,40,12,:DRAW;41,11,41,0,:DRAW;45,11,45,1,:DRAW;46,0,51,0,:DRAW;52,1,52,11,:DRAW;51,12,46,12,:SCROLL;10,:DRAW;10,12,4,12,:DRAW;3,11,3,7,:DRAW;4,6,9,6,:DRAW;10,5,10,1,:DRAW;9,0,3,0,:DRAW;20,12,14,12,:DRAW;13,11,13,1,:DRAW;14,0,20,0,:DRAW;29,12,23,12,23,0,:DRAW;30,11,30,7,:DRAW;29,6,24,6,:DRAW;30,5,30,0,:DRAW;33,11,33,1,:DRAW;34,0,39,0,:DRAW;40,1,40,11,:DRAW;39,12,34,12,:DRAW;43,12,43,0,50,0,:DRAW;53,12,53,0,60,0,:SCROLL;2,
712 GOSUB 7100
714 NEXT N
750 PRINT AT 0,0;"%6%,%0%0%0% %C%H%R%.%/%S%E%C% %I%N% %E%X%T%E%N%D%E%D% %B%A%S%I%C"
755 FOR N=1 TO 10
800 GOSUB 0
811 REM FIL;2,25,1,33,0,2,25,1,33,1,2,25,1,33,2,2,25,1,33,3,2,25,1,33,4,2,25,1,33,5,2,25,1,33,6,2,25,1,33,7,2,25,1,33,8,2,25,1,33,9,2,25,1,33,A,2,25,1,33,B,2,25,1,33,C,2,25,1,33,D,2,25,1,33,E,2,25,1,33,F,2,25,1,33,G,2,25,1,33,H,2,25,1,33,I,2,25,1,33,J,2,25,1,33,K,2,25,1,33,L,2,25,1,33,M,2,25,1,33,N,2,25,1,33,O,2,25,1,33,P,2,25,1,33,Q,2,25,1,33,R,2,25,1,33,S,2,25,1,33,T,2,25,1,33,U,2,25,1,33,V,2,25,1,33,W,2,25,1,33,X,2,25,1,33,Y,2,25,1,33,Z,2,25,1,33,(A),
812 FOR W=1 TO 10
813 NEXT W
815 NEXT N
816 GOSUB 0
817 REM CLS:RESTORE;4010,:READ;A$,B$,C$,S,:PRINT;A$,B$,:PRINT AT;15,11,C$,:OUT;219,7,223,199,219,8,223,16,219,9,223,16,219,10,223,16,219,12,223,40,
825 FOR N=1 TO S
850 GOSUB 0
851 REM OUT;219,13,223,0,:DRAW;32,0,N,45,:UNDRAW;32,0,N,45,
852 NEXT N
855 GOSUB 0
856 REM OUT;219,7,223,255,
860 GOSUB 0
861 REM FILL;1,25,1,33,@@,
862 FOR N=1 TO 17
863 GOSUB 0
864 REM MOVE;1,25,1,16,W,1,:MOVE;1,25,16,33,E,1,
865 NEXT N
870 FOR N=1 TO 50 STEP 2
872 GOSUB 0
873 REM CIRLE;N,N,N,
874 NEXT N
880 GOSUB 0
881 REM PAPER;1,25,1,33,%=,:UNPAPER;1,25,1,33,*,
890 GOTO 10
900 SAVE "DEM%O"
910 RUN
4000 REM DATA;%U%N%D%R%A%W,ZX-81,COPYRIGHT 1983,%U%P%-%-%G%R%A%D%I%N%G,AUTHOR:% % FRITS BENIEST,UP--GRADING,%A%U%T%H%O%R%:% % %F%R%I%T%S% %B%E%N%I%E%S%T,
4010 REM DATA;% % %S%H%O%O%T%I%N%G% %I%N% %E%X%T%E%N%D%E%D%-%B%A%S%I%C% % % % , '..''..''.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'..''.'.'.'.'.'. ******************************,:..:.:.:.:.:.:.:.:.:.:,63,
5000 REM DATA;2,5,1,205,1,146,1,89,0,201,3,8,3,209,3,209,0,201,3,209,
7005 LET J=0
7006 LET L=0
7007 GOSUB 0
7008 REM RESTORE;5000,:OUT;219,1,223,0,219,0,223,0,219,8,223,15,219,7,223,254,
7010 FOR N=1 TO 10
7020 GOSUB 0
7021 REM READ;L,J,:OUT;219,0,223,J,219,1,223,L,
7030 NEXT N
7040 GOSUB 0
7041 REM OUT;219,0,223,0,219,1,223,0,219,7,223,255,
7050 RETURN
7100 GOSUB 0
7101 REM OUT;219,7,223,254,219,8,223,15,219,1,223,0,219,0,223,0,
7110 FOR H=250 TO 0 STEP -80
7111 GOSUB 0
7112 REM OUT;223,H,
7120 NEXT H
7190 RETURN REM DATA lines.
Extended BASIC Commands Used
The following commands appear inside REM strings and are executed by the machine-code interpreter:
DRAW/UNDRAW— draw and erase line sequences by coordinate listsFILL/FIL— fill rectangular screen regions with a specified characterSCROLL— scroll the screen by a given number of linesCLS— clear screen via the extended systemRESTORE/READ— read fromREM DATAblocks at specified line numbersPRINT AT— positioned print within the extended command streamOUT— direct hardware port output (used for border colour and sound chip control)MOVE— animated character movementCIRLE(sic) — circle drawing (apparent typo in source for CIRCLE)PAPER/UNPAPER— area attribute-style fill/clear
GOSUB 0 Dispatch Idiom
The entire demo is structured as a sequence of paired lines: a GOSUB 0 line followed by a REM line containing the extended command. The machine code in the interpreter presumably uses the return address on the stack to locate the REM text on the following line, execute it, then perform a true return to the BASIC line after the GOSUB. This is a well-known technique for embedding interpreted sub-languages in ZX81 BASIC without altering the BASIC line structure.
DATA Storage in REM Lines
Lines 4000, 4010, and 5000 hold REM DATA blocks. The extended READ and RESTORE commands target these by line number (e.g., RESTORE;4000, RESTORE;5000). Line 4000 stores string data for the animation (labels such as “UNDRAW”, “ZX-81”, “COPYRIGHT 1983”, author name variants). Line 4010 stores the “SHOOTING IN EXTENDED-BASIC” title screen strings plus a count value (63). Line 5000 stores numeric pairs used as note/duration data for the sound output routine at lines 7005–7050.
Sound / Hardware Output
Lines 7005–7050 implement a short musical phrase subroutine. It restores and reads pairs of values L, J from REM DATA at line 5000, then outputs them to hardware ports via OUT;219,0,223,J,219,1,223,L. Port 219 (0xDB) with sub-addressing via port 223 (0xDF) is consistent with an AY-style sound chip or the ZX81’s own port-mapped hardware. Lines 7100–7190 provide a short descending tone sweep (H from 250 to 0 step −80) also sent via OUT;223,H.
Demo Sequence Structure
- Lines 10–30: Draw the Extended BASIC logo, animate a colour-ramp on the border (K=6*N, output to port)
- Lines 40–68: CLS, diagonal fill wipe, animated DEMO/FILL flicker loop (6 outer × 6/6 inner iterations)
- Lines 80–109: Info screen showing “THIS PROGRAM RUNS IN EXTENDED BASIC” with animated fill borders, repeated 10 times
- Lines 110–120: Summary screen listing SCROLL, FILL, RESTORE, CLS commands
- Lines 300–320: Three calls to the sound subroutine at 7100
- Lines 500–553: Full-screen drawing of “FB” monogram / geometric pattern with expanding square spiral animation
- Lines 574–645: 3×3×4 nested loop drawing and erasing cross/grid patterns with fill transitions
- Lines 700–714: Scrolling character-set display with two-pass SCROLL and DRAW of letter outlines
- Lines 750–815: Colour-cycling fill across all 37 fill characters (0–9, A–Z, (A)) with short delay loop
- Lines 816–890: Music playback, shooting animation with DRAW/UNDRAW, CIRCLE spiral, PAPER/UNPAPER flash, then
GOTO 10to loop
Variable Usage
| Variable | Role |
|---|---|
A$–G$ | String data read from REM DATA at line 4000/4010 (labels, decorative strings) |
A | Initialised to 0; used as fill-character argument (A) meaning space/clear in extended commands |
N | General loop counter (FOR loops at lines 20, 705, 755, 825, 862, 870) |
K | Border colour ramp value (line 26: K=6*N); also inner loop counter |
S | Outer loop counter / step counter in several sections |
W | Delay loop variable and outer animation counter |
H | Sound sweep value (250 to 0 step −80) |
J, L | Note frequency/duration values read from DATA at line 5000 |
M | Middle loop counter in lines 579–640 |
Notable Anomalies
- Line 873 contains
REM CIRLE;N,N,N,— “CIRLE” appears to be a typo for “CIRCLE”; whether the interpreter accepts this abbreviation or it is a genuine spelling error in the source is unclear. - Lines 600–601 and 630–631 are empty
FOR/NEXTloops (FOR W=1 TO 5 : NEXT W) used purely as delay loops, a standard ZX81 timing technique. - The fill character argument
(A)in extended commands refers to the BASIC variableA(value 0 = space character), used to clear filled regions. - Line 890 is
GOTO 10making the demo an infinite loop; lines 900–910 (SAVEandRUN) are only reachable manually.
Source Code
0 IF USR . THEN RETURN FROM EX. BASIC AUT: FRITS BENIEST (C) 070/988735 %V%E%R%S%I%E% %2%.%17676%-%-!!RND%E6C""73''''''5E' POKE 6D' U£RND47U(RNDLEN SCROLL %SCOS INT $.'.'INKEY$( SAVE INT 7C 76C''7( POKE INT 7D6USR RNDTAN Y. %SATN 62INKEY$%(4FFLN 5AINKEY$$COS 2~~57LN NINKEY$$COS 26457LN NINKEY$TAN FLN 5AINKEY$ RETURN COS 477A..>=62INKEY$( IF TAN 6USR RNDLN '44COS RETURN :TAN TAN PLOT SQR Y3 PLOT SQR INT 3 AT STR$ LN ATN INKEY$LN INKEY$LN EXP INKEY$.'=VAL FAST STR$ .''',%Y4~~LN LN INKEY$<( PLOT AT AT AT TAN SGN LPRINT <<<<<AT ( STOP INT . CLEAR ACS 5'./. CLEAR ACS 5LEN C3%J4D FOR FAST LN EXP INKEY$%;INKEY$ RETURN OASN 7846INT . CLEAR Q5' C3M46; FOR LN 67457BTAN R7846UND5DPI 7 TO 6ABS RNDLN STOP 44775E756YC%U' **<72F73. FOR LN **,,5675E GOSUB 53:'RNDLN LLIST RND7777) PRINT 4BLN 6FINKEY$C3SGN 45 COPY VAL STR$ LN LN INKEY$LN ' INKEY$ FAST LN RUN 45 LPRINT SGN ><AT ( GOSUB TAN F. %SC: FLN EXP INKEY$ RETURN ,COS INT 7D5E7567B RETURN C.'%>K''7A%(**INT 75 CLEAR ACS 5'.C3C4B CLEAR ACS 5LEN / RUN U5RNDACS ./: U5RNDACS SIN M5RNDC3 REM 42FE 0C8F5CD2015F1CD1D15EF 534CDA7 EC9EBCDEF40CD9042CDA542CDB242CDCE42CD4C4920EFC911D840 6 4D5CD 842CDCD41CD 141CD 64912D1C9EB 61ACD364223 622CD3642C921DB407E2B96 6 04E5F2B7E2B96577E2A C40 9 E213DC8 918FBC9E53ADC4043CD F4E10FBE1 9E51520F4E1C97EB9D8CF75C5C3C645C9EBCDEF4011D840 6 4D5CD 842D1EB2346234E702B712B 0 E40CDE04223CDE042 E3023CDE04223CDE04221D840113D40 6 2CD744513 6 2CD74451E 0213E40CD48452323CD4845233A3F4077CD4845213C407316 0CB46201E3A40405FCD5B45ED53454016 03A42405FCD5B45ED534740D53A4340181B3A3D405FCD5B45ED53454016 03A43405FCD5B45ED534740D53A4240C1CD6842ED434940213C40CB4620 ECB4E28 2CBDECB562810CBE618 CCB4E28 2CBE6CB5628 2CBDE114B40237E12232323137E12213C40CB4620 53A434018 33A424047 4 02A4540113F 019224540CDE542CD4C49C25449C923 6 311E9434E1AB9C0231310F8C929263923235E23562319C932323232232323237EFEEAC93232CDCD417EFE76C9323232E52323EBA72A1440ED52E1C93232322AD640CDF2 9EB22D640C932323232C6402AD640CD4149C8F52A104022D640CD C44DC5D44F1CD4149C8F5CD1B4418EFC932E52323EB2A C40A7ED52E1C93232CF72CF 1EBCDEF40221640CD754718 9CDEC43CD4D44DC5B44E5CDF84320 5CDDA4328 3E118E9D1CDEF40 0 0 0 022DE40C92432323232CD1D152A1C40 1 5 0ED42221C40ED5BD64013EDB0C93232322ADE40CD 24420 723CD7444CDCD41221640CDBA46DF22DE40FE1AC8CF7DEBCDEF40CDCD41CD 141CD2242CD68472AD440CD4B4120EFC92A104022D6402A 240C9C5CB38 4CB39 C3E1990472A C401121 018 11910FD5919C1CD99463E2F90473E 1CB2830 23E 4CB2930 1 7F57E 7FE1030 6 F30 2EE8F47CD914628 5F12FA018 2F1B0FE 838 2EE8F77C99677C9CB7E20 3CBCEC9CB8EC97E2B9638 5CB132318 5CB137E23962377C996 6 7A7CB13CB1210F9C92396 6 7A7CB1ACB1B10F9C94B40ED7E12231310FAC92A4540ED5B49403A3C40CB5F20 31918 797ED5230 2676C224540EBCD6745C9C53A3C40CB4720 5214B4018 3214C40CB6720 33418 135CD7B45213C407BCB4620 5324C4018 3324B40ED4B4B40CDED44C110CBC9E5EB5E2356EBD1 1DD45C5E92AD440CDCD41FE E20 6CDCD41C3FE412AD240221640 1 1 0C9CD F4638 5CD164118 ACD2242CD2A44CD174679C91B1B1B5F2B3E2596237BC9CD1E46CDA7 EC92A1C40 1 5 0 9221C40ED42EB2AD64023EDB0C91B 0CD4F4E2A C402322 E403E 032DC401E201618 E21CDCE42C92336 12336212336 0CDAE42C9ED5B C402121 01319 1F7 2EDB0 620EB36 02310FBCD3648C9C9 0 0 0EBCDEF4011D840 6 1D5CD 842D11A3C47C5CD5A46C110F9C93A2140CB47C93D3DCD914620 97EE678FE 0C836 0C97EE678FE 0C8C1C9CDAD4838 4CDD8 9C9E1C9FE1628 9FE1520 1E7CDD914C9E7CDD914E5CD851BCDA01AE1C92ADE40237EFE7620 523CD7444232B22DE40C91B2ADE4023CDF54622DE40C91B1B 1 0 07EFE1AC8FE7620 2CF7D 32318F21B1B2AD640234E36 0234636 02378B1C460 AC92AD6402371237023CD9E 9C91B1B2B7EA728FBCDCE1438 2CF70C620CD2C44237E23B628 3CD 847CDD44623E5CDE846C5CD1A47C1E178B1C8ED5BD640131313EDB0C91BCD2A44CDAC44CD9644C9FE D20 5CD284718 3CD5E47C9E7CDBA46DF22D4407EFE1A28 2CF7DCD8A1520 578FE4038 2CF146069CDD8 9C97EFE7620 1231ACB7728 23E8F771323 B78B1C8D5ED5B3C40ED5219D138E1D5C522 E40CD5A462A E40C1D118D2 0EBCDEF40CD5548CDCD41CD 141CD2242FE DF5CC1C42CD28494FF1F57928 2C620C620CD2C44F1F5C42E49F1CC3B49EB2A10402B223C402A E40CDA74722 E40CD12482AD440CD4B412B20BBC9A72A E40ED5B C4013ED521121 03E18ED5238 33D18F9323A40197B95323940C91B1B1B3A3A40FE1820 62A C402318 9A72A E401121 0ED5222 E40CD1248C9CF17E5CD1C42FE3920F6CD1C42FE2628 2E1C9E111D840D5 6 2CD 842E1 E18CDE04223 E20CDE0422A C40233AD840FE 028 7471121 01910FD3AD94016 05F1922 E40CD12482AD440C91B1B1BEB2BCDEF4011D840 6 1D5CD 842CDCD41CD 141CD2242CD2A44D11A4FED78CD93442AD440CD4B412B20DAC9BCEBCDEF4011D840 6 2D5CD 842E14E2346FDCB3B7628 8ED41 0D3FE7618 CCB41F5CC2B FF1ED41CC23 F2AD440CD4B412B20D0C9CF73CB4028FACD2242CB48C0FE1120F02B2B3E10BE20E92323D5CD 146D1CB77C83E8FC9CDCE14D8CF70CD1E46CDD51BE5CDA314E1C91B234E234623C9BEC8FE60D8CBFFBECBBFC92AD440CD4B412BC9E521D940545D7E1B122323137E12E11BD51313 6 2C3F442251CEBCDEF40CD904211D840D5213C40EB 1 4 0EDB0D1CDA542CDB242227B40D52AD44011DD40 6 1CD 8424F1B1B1AD9D1D9 0FE2A28 EFE3C28 AFE332826FE382822CF16C5D9C1D9FE2A28 2CBC8FD7021213E40 6 21E21CDC54A2A7B40CD5E4AC3124AF5C5E1C5D1 6 5CD5D4519E5D9C1D9 6 0F1FE3820 2CBC0FD7021213C40 6 21E19CDC54A2A7B40FDCB214628 FD9D5D9C11121 018 11910FD227B40CD374ACD4C49C811DC40CDCD41CD 141CD 64912C37549ED5B1040ED52193FD8ED5B C40ED5219C9D9C5D5D9E5CDA44AA7FDCB214628 31918 2ED52CD264A38 5113C40EBEDB0CDFA4A20E1C3AA4E3ADD40FE 0C8CDA44A79D5C15FFDCB214EF5CC7D4AF1C48F4ACDFA4A20E8C9CD5F4EC8 04B113C40BEC8EBEDA0EBE018F7CD5B4EC84B113B40EB 9EBBEC8EBEDA8EBE018F7F7D9D5D9C1 6 0C52A7B40E5113C40EDB0E1C1C5 0 0 0 0 0 0 0 0D9C5D9D1C1C920 E7E81BB38 27B3D77231C10F418 D7E3D9130 33E 2903C772310F311D840213C40 1 4 0EDB0C92B16 0193E76EDB9C9 0 0 02A7B401121 0FDCB214620 31918 2ED52227B40D915D9C91B1B1121 018 11910FD227B40C940C9C9113C40EBC9EBCDEF4011D840 6 3D5CD 842CD5A4CE11E 3D516 05EC5CD5B45C1237B 2 37A 2 3D11D20ECCD5B4BCD4C4920D5C9 0 0 0 6CA97C5ED5B3C40CB4FC4D24B 6 5CD69452A3E40CB4F20 8ED5230 9CBC718 51930 2CB87223E40EBCB47C4D24B 6 5CD69452A3C40CB4720 71930 ACB8F18 6ED5230 2CBCF223C40F5ED5B4240CDBB4132454097B22018ED5B40402A3E40CDBB4132444097B220 7ED4B4440CDD94BF1C1108DC921FFFFED52EBC9972148405E2356EBED42C8EB702B713E3FB9D83E2FB8D8CDED44C91B32343B6E4935372EC547283138B441343A39CF4829372656422B2E31314E372A26CA442E3319A248372A385F44382837A0413A33295D42282E3749423A33285042312A2B644C372E2C684C322E296C4C302A3E9341352635394E3A3335354E283435474E1B213C4070237023E5C1C93E 218 63E 118 23E 4322140C3EF4C2A3C4097E5CD 013BADC44422AD84062EBED524D44E1C9D5CDCD41CD 141CD2242FE DC42C42CD1C42CD2849C620CD2C44D17D12137C12132AD440C9CDE24CC87EF5CD3B49C52A3C40E5CD B47E1C178B120 2F1C9E5C5CD1D47C1E1F1E5C5CD3344C1D1232323CD5747C9 0 0 02A3E403A3C40BDC03A3D40BCC9EBCDEF40113C40CD8B4CCD8B4C11D840 6 1FDCB215628 1 4CD 842CDB04CCD3A4DCD1D4DCD4F4DCD4C4920D7C9FDCB2146C8CD744C30 4CD B47C9CD344D4B42CD60 AC92371237023C9FDCB214EC8CD744CD8C54B42CD344D 9C1CD60 AC9FDCB2156C8CD224D21D8407E23BE38 72A3C40CD B47C9477E902B77CD3F4DC9CDBB 2444D513E 014C8CDBD 77EC9CDCD41CD 141CD2242FE D20 DCD1C42CD2849C620CD2C4437C9CD2A44373FC9CD 24ED8237E 0 6 0CDC242CD264AC91CEBCDEF40FDCB2146F528 B11D840 6 2CD 8422AD440CD7E4D3818F120 ACD6F4DD61C30 19718 7CD9E4D7E30 197CD9344C9CD B47F128 7CD9E4D7ED818 5CD6F4DB7C8 1 1 0CD1A472AD64023232377C921D8403E20BED84E3E 0B93FC9FDCB214628 37723C9FDCB214E28 7BE20 236 023C9F597BE20 4F17723C9F123C93E 118 53E 218 197FD7721C37A42EBCD4841C8CF1BCD404E1618C36B 8CD404E2139403621233618C92B16 019533E76BEC8979228 336 015FDCB214E28 22B2B23 D28 218E73E753CC91BD51121 0FDCB214628 31918 2ED52D1C9D5E560691121 0ED527CB5444DE1D1C9C5E59743772310FCE1C1C9E1D1D5421121 0FDCB214620 918 11910FD18 4ED5210FCD1C178B1C8D5CD264AD138 3CD9F4ECD8F4EC815C8CD7E4E18EB1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B
1 LET A$=""
2 LET B$=""
3 LET C$=""
4 LET D$=""
5 LET E$=""
6 LET F$=""
7 LET G$=""
9 LET A=0
10 GOSUB 0
11 REM OUT;219,0,223,0,219,7,223,254,219,8,223,15,:FILL;1,25,1,33,##,2,24,2,32,(A),:DRAW;14,44,4,44,4,28,14,28,:DRAW;5,36,14,36,:DRAW;15,43,15,37,:DRAW;15,35,15,29,:DRAW;18,28,18,43,:DRAW;19,44,28,44,:DRAW;29,43,29,28,:DRAW;19,36,28,36,:DRAW;43,44,33,44,:DRAW;32,43,32,37,:DRAW;33,36,42,36,:DRAW;43,35,43,29,:DRAW;42,28,32,28,:DRAW;46,44,46,28,:DRAW;59,44,50,44,:DRAW;49,43,49,29,:DRAW;50,28,59,28,:FILL;12,23,3,31,% ,13,16,10,23,@@,:RESTORE;4000,:READ;A$,B$,C$,D$,E$,F$,G$,
20 FOR N=1 TO 40
25 PRINT AT 16,13;;B$;AT 20,8;C$;AT 13,10;D$;AT 18,5;E$;AT 13,10;F$;AT 18,5;G$
26 LET K=6*N
28 GOSUB 0
29 REM OUT;219,0,223,K,
30 NEXT N
40 GOSUB 0
41 REM OUT;219,7,223,255,:CLS:FIL;1,25,1,2,% ,2,25,2,3,% ,3,25,3,4,% ,4,25,4,5,% ,5,25,5,6,% ,6,25,6,7,% ,7,25,7,8,% ,8,25,8,9,% ,9,25,9,10,% ,10,25,10,11,% ,11,25,11,12,% ,12,25,12,13,% ,13,25,13,14,% ,14,25,14,15,% ,15,25,15,16,% ,16,25,16,17,% ,17,25,17,18,% ,18,25,18,19,% ,19,25,19,20,% ,20,25,20,21,% ,21,25,21,22,% ,22,25,22,23,% ,23,25,23,24,% ,
44 GOSUB 0
45 REM FIL;1,25,32,33,% ,1,24,31,32,% ,1,23,30,31,% ,1,22,29,30,% ,1,21,28,29,% ,1,20,27,28,% ,1,19,26,27,% ,1,18,25,26,% ,1,17,24,25,% ,1,16,23,24,% ,1,15,22,23,% ,1,14,21,22,% ,1,13,20,21,% ,1,12,19,20,% ,1,11,18,19,% ,1,10,17,18,% ,1,9,16,17,% ,1,8,15,16,% ,1,7,14,15,% ,1,6,13,14,% ,1,5,12,13,% ,1,4,11,12,% ,1,3,10,11,% ,18,25,1,10,##,1,8,24,33,##,9,17,12,22,##,
50 FOR S=1 TO 6
51 FOR K=1 TO 6
52 GOSUB 0
53 REM FIL;10,11,14,20,.',10,16,20,21,.',15,16,14,20,.',10,16,13,14,.',2,6,15,23,: ,20,24,11,19, :,2,7,25,32,(A),19,24,2,9,% ,8,17,2,7,<,9,18,27,32,>,1,3,1,10,!!,23,25,24,33,;;,
55 PRINT AT 11,14;"DEMO";AT 12,14;"%F%I%L%L"
56 GOSUB 0
57 REM FIL;10,11,14,20,'.,10,16,20,21,'.,15,16,14,20,'.,10,16,13,14,'.,2,6,15,23, :,20,24,11,19,: ,2,7,25,32,% ,19,24,2,9,(A),8,17,2,7,>,9,18,27,32,<,1,3,1,10,;;,23,25,24,33,!!,
58 NEXT K
60 FOR K=1 TO 6
61 GOSUB 0
62 REM FIL;10,11,14,20,.',10,16,20,21,.',15,16,14,20,.',10,16,13,14,.',2,6,15,23,: ,20,24,11,19, :,8,17,2,7,<,9,18,27,32,>,1,3,1,10,!!,23,25,24,33,;;,
63 PRINT AT 11,14;"%D%E%M%O";AT 12,14;"FILL"
64 GOSUB 0
65 REM FIL;10,11,14,20,'.,10,16,20,21,'.,15,16,14,20,'.,10,16,13,14,'.,2,6,15,23, :,20,24,11,19,: ,8,17,2,7,>,9,18,27,32,<,1,3,1,10,;;,23,25,24,33,!!,
66 NEXT K
68 NEXT S
80 GOSUB 0
81 REM FIL;9,17,8,26,##,10,16,9,25,(A),
82 PRINT AT 10,9;"THIS PROGRAM";AT 12,11;"RUNS IN";AT 14,18;"%B%A%S%I%C"
85 LET S=1
86 GOSUB 0
87 REM FIL;1,3,1,10,*,23,25,24,33,*,2,8,24,32,':,18,24,2,10,:.,8,17,2,7,*,9,18,27,32,*,
88 PRINT AT 14,9;"%E%X%T%E%N%D%E%D"
89 GOSUB 0
90 REM FIL;2,8,24,32,(A),23,25,24,33,##,
91 PRINT AT 3,25;"DRAW";AT 3,10;"%I%N";AT 20,20;"%O%U%T"
92 GOSUB 0
93 REM FIL;8,17,2,7,(A),9,18,27,32,(A),
94 PRINT AT 14,9;"% % % % % % % % ";AT 9,3;"%R";AT 10,3;"%E";AT 11,3;"%A";AT 12,3;"%D";AT 10,28;"%D";AT 11,28;"%A";AT 12,28;"%T";AT 13,28;"%A"
95 GOSUB 0
96 REM FIL;18,24,2,10,(A),1,3,1,10,##,
97 PRINT AT 20,2;"UNDRAW"
98 PRINT AT 14,9;"%E%X%T%E%N%D%E%D"
108 LET S=S+1
109 IF S<11 THEN GOTO 86
110 PRINT AT 6,16;"SCROLL";AT 17,11;"FILL";AT 2,1;"RESTORE";AT 21,24;"CLS"
115 GOSUB 0
116 REM FIL;11,14,10,24,% ,15,16,10,24,(A),
120 PRINT AT 11,9;"EXTENDED BASIC"
300 FOR W=0 TO 2
310 GOSUB 7100
320 NEXT W
500 GOSUB 0
501 REM CLS:DRAW;7,45,2,45,2,38,7,38,:DRAW;8,44,8,39,:DRAW;7,33,2,33,2,26,:DRAW;8,32,8,30,:DRAW;8,28,8,26,:DRAW;3,29,7,29,:DRAW;7,21,3,21,:DRAW;2,20,2,14,:DRAW;8,20,8,14,:DRAW;3,17,7,17,:DRAW;2,9,2,3,:DRAW;3,2,4,2,:DRAW;5,3,5,5,:DRAW;6,2,7,2,:DRAW;8,3,8,9,:DRAW;60,45,55,45,55,38,60,38,:DRAW;61,44,61,39,:DRAW;61,33,55,33,55,26,61,26,:DRAW;56,30,59,30,:DRAW;55,20,55,14,:DRAW;56,21,57,21,:DRAW;58,20,58,14,:DRAW;59,21,60,21,:DRAW;61,20,61,14,:DRAW;60,9,56,9,:DRAW;55,8,55,3,:DRAW;56,2,60,2,:DRAW;61,3,61,8,:DRAW;0,47,63,47,63,0,0,0,0,46,
524 LET S=0
525 GOSUB 0
526 REM FILL;2,24,6,28,(A),:DRAW;10,45,53,2,:DRAW;53,45,10,2,:DRAW;27,45,36,45,:DRAW;36,44,27,35,:DRAW;27,34,36,34,:DRAW;37,13,26,2,:DRAW;26,13,37,2,:DRAW;18,31,13,31,:DRAW;12,30,12,24,19,24,19,30,:DRAW;11,23,11,17,:DRAW;12,16,19,16,:DRAW;20,17,20,23,:DRAW;48,16,48,31,46,29,
527 LET S=S+1
528 IF S<16 THEN GOTO 525
547 LET S=0
548 GOSUB 0
549 REM FILL;2,24,6,28,(A),:DRAW;33,23,33,22,30,22,30,25,35,25,35,20,28,20,28,27,37,27,37,18,26,18,26,29,39,29,39,16,24,16,24,31,41,31,41,14,22,14,22,33,43,33,43,12,20,12,20,35,45,35,45,10,18,10,18,37,47,37,47,8,16,8,16,39,49,39,49,6,14,6,14,41,51,41,51,4,12,4,12,43,53,43,53,2,10,2,10,45,53,45,
550 GOSUB 0
551 REM PRINT AT;12,13,A$,:UNDRAW;33,23,33,22,30,22,30,25,35,25,35,20,28,20,28,27,37,27,37,18,26,18,26,29,39,29,39,16,24,16,24,31,41,31,41,14,22,14,22,33,43,33,43,12,20,12,20,35,45,35,45,10,18,10,18,37,47,37,47,8,16,8,16,39,49,39,49,6,14,6,14,41,51,41,51,4,12,4,12,43,53,43,53,2,10,2,10,45,53,45,
552 LET S=S+1
553 IF S<6 THEN GOTO 548
574 FOR K=1 TO 3
575 GOSUB 0
576 REM FILL;2,24,6,28,(A),:DRAW;13,42,49,42,49,6,13,6,13,41,:DRAW;25,41,25,7,:DRAW;37,41,37,7,:DRAW;14,30,48,30,:DRAW;14,18,48,18,
579 FOR M=1 TO 3
580 GOSUB 0
581 REM DRAW;46,39,40,33,:DRAW;40,39,46,33,:DRAW;28,39,28,33,34,33,34,39,29,39,:DRAW;46,27,40,21,:DRAW;40,27,46,21,:DRAW;40,15,40,9,46,9,46,15,41,15,:DRAW;34,27,28,21,:DRAW;28,27,34,21,:DRAW;16,27,16,21,22,21,22,27,17,27,:DRAW;22,15,16,9,:DRAW;16,15,22,9,
585 FOR N=1 TO 4
590 GOSUB 0
591 REM DRAW;40,39,46,33,:DRAW;46,39,40,33,:DRAW;28,27,34,21,:DRAW;34,27,28,21,:DRAW;16,15,22,9,:DRAW;22,15,16,9,
592 GOSUB 7100
595 GOSUB 0
596 REM FIL;4,9,20,25,(A),10,15,14,19,(A),16,21,8,13,(A),
600 FOR W=1 TO 5
601 NEXT W
605 NEXT N
625 GOSUB 0
626 REM FIL;4,9,14,19,(A),10,15,8,13,(A),16,21,20,25,(A),10,15,20,25,(A),
630 FOR W=1 TO 5
631 NEXT W
640 NEXT M
645 NEXT K
700 GOSUB 0
701 REM CLS
705 FOR N=1 TO 10
710 GOSUB 0
711 REM SCROLL;10,:DRAW;17,12,11,12,11,0,17,0,:DRAW;18,11,18,1,:DRAW;29,12,22,12,22,0,29,0,:DRAW;23,6,29,6,:DRAW;33,11,33,0,:DRAW;34,12,36,12,:DRAW;37,11,37,0,:DRAW;38,12,40,12,:DRAW;41,11,41,0,:DRAW;45,11,45,1,:DRAW;46,0,51,0,:DRAW;52,1,52,11,:DRAW;51,12,46,12,:SCROLL;10,:DRAW;10,12,4,12,:DRAW;3,11,3,7,:DRAW;4,6,9,6,:DRAW;10,5,10,1,:DRAW;9,0,3,0,:DRAW;20,12,14,12,:DRAW;13,11,13,1,:DRAW;14,0,20,0,:DRAW;29,12,23,12,23,0,:DRAW;30,11,30,7,:DRAW;29,6,24,6,:DRAW;30,5,30,0,:DRAW;33,11,33,1,:DRAW;34,0,39,0,:DRAW;40,1,40,11,:DRAW;39,12,34,12,:DRAW;43,12,43,0,50,0,:DRAW;53,12,53,0,60,0,:SCROLL;2,
712 GOSUB 7100
714 NEXT N
750 PRINT AT 0,0;"%6%,%0%0%0% %C%H%R%.%/%S%E%C% %I%N% %E%X%T%E%N%D%E%D% %B%A%S%I%C"
755 FOR N=1 TO 10
800 GOSUB 0
811 REM FIL;2,25,1,33,0,2,25,1,33,1,2,25,1,33,2,2,25,1,33,3,2,25,1,33,4,2,25,1,33,5,2,25,1,33,6,2,25,1,33,7,2,25,1,33,8,2,25,1,33,9,2,25,1,33,A,2,25,1,33,B,2,25,1,33,C,2,25,1,33,D,2,25,1,33,E,2,25,1,33,F,2,25,1,33,G,2,25,1,33,H,2,25,1,33,I,2,25,1,33,J,2,25,1,33,K,2,25,1,33,L,2,25,1,33,M,2,25,1,33,N,2,25,1,33,O,2,25,1,33,P,2,25,1,33,Q,2,25,1,33,R,2,25,1,33,S,2,25,1,33,T,2,25,1,33,U,2,25,1,33,V,2,25,1,33,W,2,25,1,33,X,2,25,1,33,Y,2,25,1,33,Z,2,25,1,33,(A),
812 FOR W=1 TO 10
813 NEXT W
815 NEXT N
816 GOSUB 0
817 REM CLS:RESTORE;4010,:READ;A$,B$,C$,S,:PRINT;A$,B$,:PRINT AT;15,11,C$,:OUT;219,7,223,199,219,8,223,16,219,9,223,16,219,10,223,16,219,12,223,40,
825 FOR N=1 TO S
850 GOSUB 0
851 REM OUT;219,13,223,0,:DRAW;32,0,N,45,:UNDRAW;32,0,N,45,
852 NEXT N
855 GOSUB 0
856 REM OUT;219,7,223,255,
860 GOSUB 0
861 REM FILL;1,25,1,33,@@,
862 FOR N=1 TO 17
863 GOSUB 0
864 REM MOVE;1,25,1,16,W,1,:MOVE;1,25,16,33,E,1,
865 NEXT N
870 FOR N=1 TO 50 STEP 2
872 GOSUB 0
873 REM CIRLE;N,N,N,
874 NEXT N
880 GOSUB 0
881 REM PAPER;1,25,1,33,%=,:UNPAPER;1,25,1,33,*,
890 GOTO 10
900 SAVE "DEM%O"
910 RUN
4000 REM DATA;%U%N%D%R%A%W,ZX-81,COPYRIGHT 1983,%U%P%-%-%G%R%A%D%I%N%G,AUTHOR:% % FRITS BENIEST,UP--GRADING,%A%U%T%H%O%R%:% % %F%R%I%T%S% %B%E%N%I%E%S%T,
4010 REM DATA;% % %S%H%O%O%T%I%N%G% %I%N% %E%X%T%E%N%D%E%D%-%B%A%S%I%C% % % % , '..''..''.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'..''.'.'.'.'.'. ******************************,:..:.:.:.:.:.:.:.:.:.:,63,
5000 REM DATA;2,5,1,205,1,146,1,89,0,201,3,8,3,209,3,209,0,201,3,209,
7005 LET J=0
7006 LET L=0
7007 GOSUB 0
7008 REM RESTORE;5000,:OUT;219,1,223,0,219,0,223,0,219,8,223,15,219,7,223,254,
7010 FOR N=1 TO 10
7020 GOSUB 0
7021 REM READ;L,J,:OUT;219,0,223,J,219,1,223,L,
7030 NEXT N
7040 GOSUB 0
7041 REM OUT;219,0,223,0,219,1,223,0,219,7,223,255,
7050 RETURN
7100 GOSUB 0
7101 REM OUT;219,7,223,254,219,8,223,15,219,1,223,0,219,0,223,0,
7110 FOR H=250 TO 0 STEP -80
7111 GOSUB 0
7112 REM OUT;223,H,
7120 NEXT H
7190 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

