A.N.A.L.O.G. ISSUE 21 / AUGUST 1984 / PAGE 35
This month, ANALOG continues its custom of printing assembly-language games with Avalanche, a public-domain game of skill for one player.
Before typing anything, look at the listings accompanying this article.
Listing 1 is the BASIC data and data checking routine. This listing is used to create both cassette and disk versions of Avalanche. The data statements are listed in hexadecimal (base 16), so the program will fit in 16K cassette systems. This makes typing more difficult, but it’s a necessary evil.
Listing 2 is the assembly-language source code for Avalanche, created with the OSS MAC/65 assembler. You do not have to type this listing to play the game! It is included for those readers interested in assembly language.
Follow the instructions below to make either a cassette or disk version of Avalanche.
Plug a joystick in port 1 and press the fire button to start the game. Up at the top of the screen is a letter “N” which stands for normal play. Pressing the OPTION key will switch this to an “H,” which stands for hard play.
The object of Avalanche is to claim the whole side of the mountain as yours. You claim each square by moving Leroy onto a square and changing it to the object color. The object color is indicated by the flashing arrows in the upper left corner. On the first level, you just have to jump on a square once to change it to the object color. On level two, you must jump on it twice, and so on.
There are up to six different levels, each having four rounds. When you complete a round, you get a bonus of 1000 points. You’ll receive 25 points for changing the color of a square.
While you’re doing all this, you also have to avoid the falling rocks and Big George. Big George wears a baseball hat and will chase after you. The only way you can get rid of him is to make him follow you into the path of a rock. If a rock hits him, he is out of commission for now, but he’ll be back soon. There’s also a little green man called Henry. Henry won’t hurt you, but he will change the color of the squares back to their original. To stop him, all you have to do is touch him — and you’ll get 200 points.
You get an extra man at every 10,000 points. Leroy is moved via the joystick, in four diagonal directions. It may seem difficult to move at first, but you’ll get used to it after a while. Happy gaming!
10 REM *** AVALANCHE *** 20 TRAP 20:? "MAKE CASSETTE (0), OR DISK (1)";:INPUT DSK:IF DSK>1 THEN 20 30 TRAP 40000:DATA 0,1,2,3,4,5,6,7,8,9 ,0,0,0,0,0,0,0,10,11,12,13,14,15 40 DIM DAT$(91),HEX(22):FOR X=0 TO 22: READ N:HEX(X)=N:NEXT X:LINE=990:RESTOR E 1000:TRAP 120:? "CHECKING DATA" 50 LINE=LINE+10:? "LINE:";LINE:READ DA T$:IF LEN(DAT$)<>90 THEN 220 60 DATLIN=PEEK(183)+PEEK(184)*256:IF D ATLIN<>LINE THEN ? "LINE ";LINE;" MISS ING!":END 70 FOR X=1 TO 89 STEP 2:D1=ASC(DAT$(X, X))-48:D2=ASC(DAT$(X+1,X+1))-48:BYTE=H EX(D1)*16+HEX(D2) 80 IF PASS=2 THEN PUT #1,BYTE:NEXT X:R EAD CHKSUM:GOTO 50 90 TOTAL=TOTAL+BYTE:IF TOTAL>999 THEN TOTAL=TOTAL-1000 100 NEXT X:READ CHKSUM:IF TOTAL=CHKSUM THEN 50 110 GOTO 220 120 IF PEEK(195)<>6 THEN 220 130 IF PASS=0 THEN 170 140 IF NOT DSK THEN 160 150 PUT #1,224:PUT #1,2:PUT #1,225:PUT #1,2:PUT #1,0:PUT #1,32:CLOSE #1:END 160 FOR X=1 TO 116:PUT #1,0:NEXT X:CLO SE #1:END 170 IF NOT DSK THEN 200 180 ? "INSERT DISK WITH DOS, PRESS RET URN";:DIM IN$(1):INPUT IN$:OPEN #1,8,0 ,"D:AUTORUN.SYS" 190 PUT #1,255:PUT #1,255:PUT #1,0:PUT #1,32:PUT #1,99:PUT #1,52:GOTO 210 200 ? "READY CASSETTE AND PRESS RETURN ";:OPEN #1,8,128,"C:":RESTORE 230:FOR X=1 TO 40:READ N:PUT #1,N:NEXT X 210 ? :? "WRITING FILE":PASS=2:LINE=99 0:RESTORE 1000:TRAP 120:GOTO 50 220 ? "BAD DATA: LINE ";LINE:END 230 DATA 0,42,216,31,255,31,169,0,141, 47,2,169,60,141,2,211,169,0,141,231,2, 133,14,169,56,141,232,2 240 DATA 133,15,169,0,133,10,169,32,13 3,11,24,96 1000 DATA 2065E4A9008D08D2A9018584A9AE 858520CF2C20DA21208C23200F2320FA2220AD 23205D23A20FBDA6339D3E36,360 1010 DATA BDB6339DBA37BDC6339DCE37CA10 EBAD8402D013208C23200F2320FA22205D23A9 00854D4C8120AD1FD0C903D0,228 1020 DATA 19A585C9AED008A9A88585A901D0 06A9AE8585A900858420AA24A5858D0936A914 20D3214C3C2020BD2120C821,64 1030 DATA AD120609108D1236AD130609108D 2636A207BD74339D4236CA10F7A97820D32120 BD21A9148D0306AE1306BDD6,982 1040 DATA 338DD822BDDB338DE022BDE0338D E522BDE5338DEA2220BC2320F124A9018D1406 20AD23AD2006C901F0034C7A,23 1050 DATA 21EE130620E323207924A900854D AD1306C905D013EE1206A9018D1306AD120685 83200F234C1421A9008D0206,400 1060 DATA 200F234C812020C821A204BD7C33 9DBF37CA10F7AD120609108DC537A20BA9968D 00D2A9A88D01D2A91C8DD822,117 1070 DATA A9888DE022A90620D321A9328D00 D2A9888DD822A91C8DE022A90620D321CA10D0 A9008D01D220C821AD1206C9,195 1080 DATA 07D004A9068583A9008D20068D02 064C8120C902F0034C9B21C689A20FA9788D00 D28A09108D01D2A90520D321,414 1090 DATA CA10ED4CA221C689A9018D6F0220 7924A589D00EA208BD81339D4236CA10F74C3C 2020FA224C8120A213A9009D,121 1100 DATA 3C36CA10FA60A227A9009DB837CA 10FA608582A582D0FC60A200BD00E09D0038BD 00E19D0039CAD0F1A22FBDEA,942 1110 DATA 339D1838CA10F7A9388DF402A93E 8D2F02A9338D3102A9548D3002A9038D1DD0A9 388D07D4A9268DC002A9348D,623 1120 DATA C1028DC2028DC302A97C8D00D0A9 748D01D08D02D08D03D0A9018D6F02A90F8DC4 02A9288DC502A9888DC602A9,784 1130 DATA D68DC702A9228D0102A97D8D0002 A222A074A907205CE4A900AA9D00369DF036E8 E0F0D0F5A9C08D0ED460A582,393 1140 DATA F002C6824C62E448A9448D0AD48D 16D0A9228D0102A9928D0002684048A9588D0A D48D17D0A9228D0102A9A78D,269 1150 DATA 0002684048A5CB8D0AD4C928D012 A90085CBA5CC1006A90085CCF004A98E85CCA5 CC8D16D0E6CBA9228D0102A9,692 1160 DATA D68D0002684048A90E8D0AD48D16 D0A9FC8D17D0A9928D18D0A9428D19D0A9228D 0102A97D8D00026840A9468D,628 1170 DATA 2836A95D8D2936A58938E9010910 8D2A3660A9368581A9A98580A9018586A486B9 1A3491808810F8A586186902,355 1180 DATA C90FF0128586A5801869278580A5 81690085814C1B2320AA24A9008D12368D2636 A205BD90339D0C36BD96339D,791 1190 DATA 2036CA10F160A205A9109D0036BD 8A339D5036CA10F2A9348D6636A92F8D6736A9 078D8D36A9438D8E36A9448D,619 1200 DATA 8F36A9088D903660A9018D120685 838D1306A9048589A9008D1406A9028D5A06A9 608587A910858860A9008D01,774 1210 DATA D28D03D28D05D28D07D260A583C9 01F004C904D007ADE0228D942260C902F004C9 05D007ADE5228D942260ADEA,290 1220 DATA 228D942260A214BD28348D00D2A9 AA8D01D2BD3D3420D32120E624CA10E9A23C8E 00D220E624A90220D321E8E8,358 1230 DATA E8E05190EE8E00D220E624A90220 D321CACACAE039D0EEA9008DC802A9608587A2 0A8A09A08D01D2A90420D321,32 1240 DATA CA10F2A9008D01D2A209BD9C339D BD37CA10F7AD1C06186901C91AD018AD1B0618 6901C91AD00EAD1B06186901,363 1250 DATA 8D1B068D0136A9108D1C068D0236 A9C820D32160AD0136C588F002B00160E688E6 8920FA22A202A9208D00D2A0,32 1260 DATA 0F9809A08D01D2A90320D3218810 F2CA10EDA9008D01D260A5848D1C258D3325AD 1206C903D011AD1306C901F0,632 1270 DATA 04C903D006A9008D332560AD1206 C907D006A9008D1C2560C908F0E9C90990EAA9 008D1C25F0DEA58718690285,309 1280 DATA 878DC8026020322C20E32CAD2006 C900F00160AD2A06C901D0062058254C1525AD 78028D3106205825200226AD,882 1290 DATA 5706C901D00BA9008D5706204D27 4C2F25A9018D5706AD5806C901D00BA9008D58 062080254C4625A9018D5806,388 1300 DATA 20CA28200C3220453120262C2060 314CF724AD2606C901D00160AD3106C909D003 4C0E2FC905D0034C282FC906,853 1310 DATA D0034C5C2FC90AD0034C422F60AD 2706C901D00160AD3206C950F004EE320660AD 3606C901D0034CF525AD3906,95 1320 DATA C901F00EAD0AD2300160A9018D39 0620BA2EAD4206C901D0034CDE2520F42F20F4 2F20F42F20F42FAD0B06C96D,512 1330 DATA B00160A9018D42068D2706A9AF8D 2E0660A9018D3606AD0AD23008A9008D3C064C F525A9018D3C06AD3C06C901,359 1340 DATA D0034CB82F4CCC2FAD2806C901D0 0160AD3306C928F004EE330660AD4606C901D0 034CC826AD3406C901D0034C,732 1350 DATA 5326AD1306C902D0034C3A26C904 F0034C5326AD4506C932F012AD4706C902900B AD0AD23006EE45064CC826AD,894 1360 DATA 3706C901D0034CBB26AD3A06C901 F014AD0AD2300160A9018D3A068D3406EE4706 20CC2EAD4306C901D0034CA4,976 1370 DATA 26204930204930204930204930AD 0C06C96DB00160A9018D43068D2806A9AF8D2F 0660A9018D3706AD0AD23008,426 1380 DATA A9008D3D064CBB26A9018D3D06AD 3D06C901D0034C0D304C2130A9018D4606A900 8D4706AD4C06C901D0034C40,11 1390 DATA 27AD4B06C901F008A9018D4B0620 502DAD4D06C901D0034C172720493020493020 4930204930AD0C06C968B001,395 1400 DATA 60A9018D4D068D2806A9AF8D2F06 60A9018D4C06EE4A06EE4A06AD0AD2300EA900 8D4806EE490620502D4C4027,231 1410 DATA A9018D4806CE490620682DAD4806 C901D0034C0D304C2130AD2906C901D00160AD 5006C901D0034CF727AD3506,37 1420 DATA C901D0034C8227AD1306C903B003 4C8227AD4E06C9029008AD0AD230034CF727AD 3806C901D0034CEA27AD3B06,174 1430 DATA C901F014AD0AD2300160A9018D3B 068D3506EE4E0620ED2EAD4406C901D0034CD3 2720DE3020DE3020DE3020DE,533 1440 DATA 30AD0D06C96DB00160A9018D4406 8D2906A9AF8D300660A9018D3806AD0AD23008 A9008D3E064CEA27A9018D3E,486 1450 DATA 06AD3E06C901D0034C64304C7830 A9018D5006AD5306C901D0034CAF28AD5106C9 01F008A9018D510620B12DAD,512 1460 DATA 5206C901D0034C412820DE3020DE 3020DE3020DE30AD0D06C962B00160A9018D52 068D2906A9AF8D300660A901,558 1470 DATA 8D5306AD0006CD0406B032AD0106 CD0506F016901420B12DCE0406EE0506EE0506 A9008D4F064CAF2820DE2DCE,389 1480 DATA 0406CE0506CE0506A9028D4F064C AF28AD0106CD0506F016901420C92DEE0406EE 0506EE0506A9018D4F064CAF,14 1490 DATA 2820F32DEE0406CE0506CE0506A9 038D4F06AD4F06C900D0034C6430C901D0034C 7830C902D0034C8C304CA030,967 1500 DATA AD2606C901F0034CF029AD2D068D 01D2CE2D06AD2D06C9A0F0034CF029A9008D01 D28D26068D2A06A9088D0E06,237 1510 DATA AD04D0C900D00420732E6020DD2B AD1206C901D0034C3C29C902D0034C4C29C903 D0034C7F29C904D0034C6629,308 1520 DATA C905D0034CA329C906D0034CC629 C907D0034C7F294CC629AD04D0C901D006EE02 06202A314CF029AD04D0C901,830 1530 DATA D006202A314CF029C902D006EE02 062033314CF029AD04D0C901D009EE0206202A 314CF029CE02062018314CF0,841 1540 DATA 29AD04D0C901D006202A314CF029 C902D0062033314CF029C904D056EE0206203C 314CF029AD04D0C901D00620,145 1550 DATA 2A314CF029C902D009EE02062033 314CF029CE0206202A314CF029AD04D0C901D0 06202A314CF029C902D00620,172 1560 DATA 33314CF029C904D009EE0206203C 314CF029CE0206203331A200A000207F2BAD24 06C901F0034C1A2AAC0B06A2,820 1570 DATA 008A99003DE8C8E00AD0F7A9008D 3206A20020B82BAD4606C901D0034CBE2AA201 A002207F2BAD2406C901F003,237 1580 DATA 4C512AAC0C06A2008A99003EE8C8 E00AD0F7A9008D33068D3406A20120B82BAD50 06C901F029A202A004207F2B,522 1590 DATA AD2406C901F00160AC0D06A2008A 99003FC8E8E00AD0F7A9008D3506A20220B82B 60AD2906C901F00160AD3006,978 1600 DATA 8D07D2CE3006AD3006C9A0F00160 AD07D0C900D00CA9058D2306206E3220DA3160 A9008D07D28D29068D5306A9,387 1610 DATA 088D110660AD2806C901F0034C51 2AAD2F068D05D2CE2F06AD2F06C9A0F0034C51 2AA9008D05D2AD06D0C900D0,709 1620 DATA 3220802DA9008D4B068D4D068D46 068D4C068D28068D3306A90A8D4A06A9088D49 068D1006A92D8D0C06A9748D,163 1630 DATA 02D08D090660A9008D28068D4C06 A9088D1006AD06D0C901D0016020492BA94C85 8AA933858BAD49068D5906AD,255 1640 DATA 4A068D5A0620282E60AD1206C901 F013C902F017C903F01BC904F007C905F00B4C 732BAD06D0C902F01160AD06,646 1650 DATA D0C904F00960AD06D0C908F00160 CE020660BD2706C901F00160BD2E069903D2DE 2E06BD2E06C9A0F00160A900,409 1660 DATA 9903D2BD05D0C900D006A9018D24 0660A9009D27069D3606A9089D0F0660A9009D 36069D27069D39069D42068D,258 1670 DATA 2406A9089D0F06A92D9D0B06BD54 069D01D09D080660AD3106C909F00DC905F013 C906F023C90AF01560CE0006,373 1680 DATA EE0106EE010660EE0006EE0106EE 010660CE0006CE0106CE010660EE0006CE0106 CE010660AD00068D5906AD01,878 1690 DATA 068D5A0660A2FFAC030688D0FDCA D0F760AD1406C900D011A9008D0206A910A200 9D1A06E8E006D0F8A900A200,893 1700 DATA 9D2006E8E064D0F8A9088D0E068D 0F068D10068D1106A9098D0006A9088D0106A9 0A8D04068D05068D4A06A908,457 1710 DATA 8D4906A97C8D06068D00D0A9558D 0706A9748D08068D09068D01D08D02D08D5406 8D5506A9848D0A068D56068D,472 1720 DATA 03D0A92D8D0B068D0C068D0D0618 A9AA8D00D2690A8D02D2690A8D04D2690A8D06 D2A9018D1ED0A900A2FF9D00,790 1730 DATA 3C9D003D9D003E9D003FCAD0F160 AD2506C909F011AC0706A200BDA43299003CC8 E8E010D0F460AD2506C905F0,782 1740 DATA 1420A02DAC0706A200BDB4329900 3CC8E8E010D0F460AD2506C90AF01420A02DAC 0706A200BDC43299003CC8E8,589 1750 DATA E00FD0F460AD2506C906F01420A0 2DAC0706A200BDD33299003CC8E8E00FD0F460 20802DAC0C06A200BDE23299,700 1760 DATA 003EE8C8E00DD0F420902D602080 2DAC0C06A200BDEE3299003EC8E8E00DD0F420 902D60AC0C06A2008A99003E,592 1770 DATA E8C8E00FD0F760A90D8D1506A90B 8D2106A9C68DC20260AC0706A200A90099003C C8E8E014D0F76020182EAC0D,567 1780 DATA 06A200BDFA3299003FC8E8E012D0 F420082E6020182EAC0D06A200BD0C3399003F C8E8E012D0F46020182EAC0D,180 1790 DATA 06A200BD1E3399003FC8E8E012D0 F46020182EAC0D06A200BD303399003FC8E8E0 12D0F460A9138D1606A9108D,920 1800 DATA 1706A9568DC30260AC0D06A2008A 99003FC8E8E014D0F760AD5A068580A9008581 06800680A580858C06800680,635 1810 DATA 2681A58018658C8580A581690085 81A580186D59068580A58169008581A5801869 008580A58169368581A001B1,461 1820 DATA 8A918088B18A918060A9048D6F02 A9028D0306204B31A9AA8D01D2AD07068D00D2 C9F0F009209F2F20262C4C85,75 1830 DATA 2EA96F8D01D218A9828D00D26901 20262CC9D2D0F4A9008D00D28D01D2A9038D20 0660AC0B06A200BD42339900,639 1840 DATA 3DC8E8E00AD0F460AC0C06A200BD 423399003EE8C8E00AD0F4A90A8D1506A9088D 2106A9348DC20260AC0D06A2,616 1850 DATA 00BD423399003FC8E8E00AD0F4A9 0A8D1606A9088D1706A9348DC3026020E32CA9 018D2A0620762F209F2F209F,894 1860 DATA 2FCE0E06D00320F9306020FC2CA9 018D2A0620802F209F2F209F2FCE0E06D00320 F9306020182DA9018D2A0620,527 1870 DATA 762F208A2F208A2FCE0E06D00320 F9306020342DA9018D2A0620802F208A2F208A 2FCE0E06D00320F93060CE06,191 1880 DATA 06AD06068D00D060EE0606AD0606 8D00D060AC0706A200B9003C99FF3BE8C8E011 D0F4CE070660A20018AD0706,578 1890 DATA 690EA8B9003C99013C88E8E011D0 F4EE07066020E02F20F42F20F42FCE0F06D005 A200200D316020EA2F20F42F,109 1900 DATA 20F42FCE0F06D005A200200D3160 CE0806AD08068D01D060EE0806AD08068D01D0 60A20018AD0B066908A8B900,804 1910 DATA 3D99013D88E8E00AD0F4EE0B0660 203530204930204930CE1006D005A201200D31 60203F30204930204930CE10,389 1920 DATA 06D005A201200D3160CE0906AD09 068D02D060EE0906AD09068D02D060A20018AD 0C066D2106A8B9003E99013E,861 1930 DATA 88E8EC1506D0F3EE0C066020B430 20DE3020DE30CE1106D005A202200D316020BE 3020DE3020DE30CE1106D005,271 1940 DATA A202200D316020B43020C83020C8 30CE1106D005A202200D316020BE3020C83020 C830CE1106D005A202200D31,771 1950 DATA 60CE0A06AD0A068D03D060EE0A06 AD0A068D03D060AC0D06A200B9003F99FF3EC8 E8EC1606D0F3CE0D0660A200,318 1960 DATA 18AD0D066D1706A8B9003F99013F 88E8EC1606D0F3EE0D0660A9018D26068D2A06 A9AF8D2D06AD31068D250660,329 1970 DATA A9019D2706A9AF9D2E0660A94C85 8AA933858B20193220192C20282E60A94E858A A9334C1E31A950858AA9334C,489 1980 DATA 1E31A952858AA9334C1E31A9018D 1ED060A9008D03D28D02D28D05D28D04D28D07 D28D06D260AD0CD0C9019038,303 1990 DATA C904D015AD4606C901D00E20E72A A9028D2306206E324C9F31AD0CD0C908D007AD 5006C901F011AD2C06C904F0,747 2000 DATA 04EE2C0660A9028D200660A9008D 2C06AD5006C901D060AD0FD0C901D011AD2B06 C904F004EE2B0660A9028D20,927 2010 DATA 0660A9008D2B06AD0FD0C902903C C904D007AD4606C901F03120182EA9008D5006 8D29068D52068D51068D4E06,719 2020 DATA 8D5306A90A8D04068D0506A9088D 1106A92D8D0D06A9848D0A068D03D060AD0206 C91CD005A9018D200660A005,285 2030 DATA 18B91A066905C91AD015A9109900 36991A0688B91A06186901991A064C4332A915 990036991A0688B91A061869,594 2040 DATA 02C91AF007990036991A0660A910 990036991A0688B91A06186901C91AF0ED9900 36991A0660A00318B91A066D,323 2050 DATA 2306C91A902238E91A8D220618A9 106D2206990036991A06A9008D22068818B91A 066901C91AF0E4990036991A,929 2060 DATA 06600C1E3F2B2B3F2B371E1E1212 1B366C483078FCD4D4FCD4EC78784848D86C36 120E1F37371F0F1F1F0E0A2E,397 2070 DATA 3E1B0D0470F8ECECF8F0F8F87050 747CD8B020A050283C7E6A7E763C3C2436050A 143C7E567E6E3C3C246C0C1E,50 2080 DATA 1EFF2B2BFFFF2D333F1E12121B36 6C00307878FFD4D4FFFFB4CCFC784848D86C36 000C1E1EFF2F2FFF7F2F1F3F,44 2090 DATA 1E12127E361B00307878FFF4F4FF FEF4F8FC7848487E6CD800183C7EFFFFFF7E3C 1800030443448384C3C47070,520 2100 DATA 7046003606068606868686060606 06060606060606060606060606415433B2A5A1 A4B98085852C6536652CA7A1,525 2110 DATA ADA580AFB6A5B22328212E2725EC E5F6E5EC9AF2EFF5EEE49AA2AFAEB5B3001110 1010000000002136212C212E,776 2120 DATA 232825000000223900342F2D2D39 0022252E2E253434A1AEA1ACAFA780A3AFADB0 B5B4A9AEA7000F5A049C0086,624 2130 DATA F60C92001AA4765400C442226603 0F3F7F3F0F0300C0F0FCFEFCF0C00000060C18 300060000C1E3F2B3F1E1236,228 2140 DATA 080C7E7F7E0C080010307EFE7E30 100003040304030403040304030403043C2F00 2F3C483C0048404840484000,84 2150 DATA 5148514851480B0E070B07070707