Basic_Programming_1979_Atari_US_a
Basic_Programming_1979_Atari_US_a
GAMEPROGRAMTM CARTRIDGE
LIMITEDNINETYDAYWARRANW
ATARI,INC.("Alari")warrantslotheorlglnalconsumerpurchaserthalyourATARlo GamePrognmcrnrldgr
ls free from any defects in materialorworkmanshlptorap6rlod of ninetydaysfrom thodetgof purch$a. ltlny
such dafect is dlscoverodwlthln the warranty poriod,Atari's sole obllgation wlll b6 to replecc lhc orrtrldga
fre€ of chargs on rocsiptof the cartrldge(chargesprepald,lf mailedor shippsd)wllh prool of datc ol purohrlc
at eltherlhe retall store whsre the cartridge was purchassd or at one ot the ATAFI Beglonal Scrvlcc Ccnlc.!
llsted below:
Atarl, Inc. Atarl. lnc.
1312Crossman Ave 43 Belmont Dr.
Sunnyvale, CA 9/086 Somerset, NJ 08873
Atari, Inc. Atarl. lnc.
5400 Newoort Dr. 21@ East Dlvlslon St
Suite 1 Arlington, TX 76001
Rolling Meadows, lL 60008
Thls warranty shall not apply if ths cartrldge(l) has been mlsussd or shows signs of sxcssslve wclri (ll) hl!
baan damaged by belng us6d wllh any products not supplled by ATARI,or (lll) has been damagadby balng
servlcedor modifled by anyono otherthan an ATARI RaglonalServiceCenter.
A N Y A P P L I C A B L EI M P L I E DW A R R A N T I E S .I N C L U D I N GW A R R A N T I E SO F M E R C H A N T A B I L I T Y
AND
FITNESS.ARE HEREBYLIMITEDTO NINETY DAYS FROM THE DATEOF PURCHASE.CONSEOUENTIAL
OR INCIDENTALDAMAGESRESULTINGFROM A BREACHOF ANY APPLICABLEEXPRESSOR IMPLIED
WARBANTIESARE HEREBYEXCLUDED.
Soms slates do not allow llmltatlons on how long an lmpllsd wananty lasts ordo not allow the cxclurlon ot
llmltatlons of incidsntal or consequentlaldamages,so ths abovs limltatlons orsxcluslonE may noi rpply lo
you.
Thls warranty glves you speclllc legal rlghts and you may also have othsr rlghts whlch v.ry trom rtrlc to
state.
/t\
ATARI'
A WarnerCommunicationsCompanV
@
A T A R Il,N C . ,C o n s u m e D
r ivision
P O Box 427, Sunnyvale, CA 94086
3. CONSOTECONTnOF
4. DISPLAY R.EGIONS
5. THE CURSOR
6. R,UNNINGA PR.OGRAM
andAudiovisual@ 1979,ATARI,lNC.
Program,
I. INTR,ODUCTION
BASICPROGRAMMING is an in- it needsto carrY
the instructions
to teach
tooldesigned
structional out somesimpletasks.
Keeoin mindthat BASICPRO-
GRAMMING hasa limitedamount
of memoryin comparison to more
sophisticatedcomputersystems.lt
an excellentinslruc-
is, however,
programs. theessen-
tionatdevicefor learning
tialsof computer programming.
Computer programsare simplya
Thepro-
seriesof instructions. NOTE:ThisGameProgramrM car-
gramscontroltheflowof informa- tridoemavcausesometelevision
tlonwithinthecomputer. BASIC lf thisoc-
scr6enstir "roll" slightly.
PROGRAMMING allowsyouto curs,adjustment of the VERTICAL
givetheVideoComputer System HOLDmaybe necessary.
2. USINGTHECONTR.OIIER.S 3. CONSOTECONTROLS
To connectthe two controllers,
slidethe tongueof the leftcon- GAMESELECTSWITCH
trollerintothe grooveon the right Pressgameselectto erasea switchis placedin thea position,
controller.Thetwo KeyboardCon- programandresetallvalues. thetitlesof eachregionwilldisap-
trollers,lockedtogether,forma pearfromthedisplay andthe
24-kevkevboardusedto enter GAMERESETSWITCH GRAPHICS regionwillcomeinto
yourprogiamand to controlthe vrew.
displayon yourtelevision screen. Pressingthegameresetswitch
erasesallvaluesandreturnsa 0ro- Therightdifficultyswitchhasno
Removethe Keyboard Controller gramto itsbeginning
withouteras- functionin thisGameProgram car-
labelsfromthe enveloPe. Place ingtheprogram. tridge.
the labelmarkedLEFToverthe
Keyboardpluggedintothe LEFT DIFFICULTY SWITCHES TVTYPESWITCH
CONTROLLER jackat the rearof yourprogram,
Placethe Beforebeginning Setthisswitchto color if youhave
vourcomputerconsole. placetheleft difficultyswitchin
\ labelmarkedRIGHToverthe set.Setit to bw if
a colortelevision
\ theb position.
Thiswillshowyou youareusinga blackandwhite
Keyboardpluggedintothe RIGHT whereeachregionis on yourdis-
CONTROLLER jack at the rearof play.Whentheleft difficulty set.
television
yourcomputerconsole.
4. DISPLAYREGIONS
Thedisplayis dividedintosix 4 . TheOUTPUTregionwill show coloredcommands or inoutson of the regions:STATUS,PRG
regions: youtheoutputbeingproduced your Keyboard.
Thewhitemodeis GRAM,STACK,VARIABLES,
as yourprogramis beingrun. usedto giveyourcomputer com- OUTPUT, andGRAPHICS. Let's
1. ThePROGRAM regionis used mands,the othermodesare used startwith the STATUSregion.
to givethe computeryour TheSTATUSregionshowsyou to insertsymbolsintoyourprogram. Pushthe STATUSkeyonceand
instructions. the amountof memory the STATUSregionwill disappear
at anytimefor your
available MOVINGTHECURSOR FROM fromthe screenandthe PRO-
2. TheSTACKregionwillgiveyou program.Thisregionwillalso
the temporaryresultsof your REGIONTO REGION GRAMregionwill moveto the top
Makesurethe left difficulty of the display.
switchis in the b oosition
andturn
vourconsoleunitoff andthenon Pushthe PROGRAMkeyand the
STATIJS Sr1'Flggl_g : rt3 bgain.Pushthe FoRWARDkey PROGRAM regionwilldisaPpear
SYf-lEEl-S :65 SFEEE:38 andthe STACKregionwill move
andthecursorwillmovefrom
1I
PROGRAMto STACK.PuShthE to the top of the display.Pushthe
FORWARD keyagainandthe cur- STACKkey and the STACKregion
sor will movefromSTACKto willdisappear andthe
VARIABLES. Pushthe keyagain VARIABLES regionwillmoveto
andthe cursorwillmovefrom thetop of thedisplay. Pushthe
VARIABLESto OUTPUT. VARIABLES keyandthe
VARIABLES regionwilldisappear
By pushingthe BACK\/ARD key causingtheOUTPUTregionto
vou can movethe cursorbackto moveto the top of the display.
ine PnOenRM region.TheFOR-
WARDand BACKWARDkeyscan Removethe oUTPUTregionby
programas the computeris giveyou the speedof execution be pushedoncefor eachregionor oushinq the OUTPUTkev.Thiswill
running it. of yourprogram. helddown. blsocaluse theGRAPHIeSregion
to be fullyvisibleon thedisplay.
3. TheVARIABLES regionwill 6. TheGRAPHICS regionhastwo Nowplacethe left difficulty PushtheGRAPHIGS keyto
giveyou thevalueof each coloredsquares whichcan be switchintothea position.The removetheGRAPHICSregion.
variable itemin yourprogram movedaroundunderyourPro- titlesof eachregionwilldisappear Yourdisplayshouldshowno regions.
as it is beingrun. gramcontrol. anda portionof theGRAPHIoS
regionwillappear.Stepthe cursor Nowpushthe STACKkey.The
througheachof the regionsagain. STACKregionwill reappearon
Noticethatthe cursorwillnot
5. THECURSOR moveintotheGRAPHICSregion.
yourdisplay.Removethe STACK
region,andbringup theOUTPUT
andVARIABLES You
regions.
Placethe left difficultyswitch times.Thecolorof thecursorwill REMOVING THEREGIONS maydisplayor removeany region
intothe b positionandturnyour changefromwhiteto red,fromred FROMTHE DISPLAY withthe left difficultyswitchin
consoleoff andthenon again.In to blue,fromblueto green,and Placethe left difficultyswitch eitherthea or b position.
the PROGRAM regionthereis a fromgreento whiteagain. intothe b position againandturn
whiterectangle. Thisis the cursor. yourconsoleunitoff andthenon. to notethatwhether
It is important
Locatethe shlft controlkey at the Thecursoris usedto inputyour On the left sideof the Keyboard or notthevariousregionsare dis-
centerof the bottomrowon the program. Eachof thefourcolors are a seriesof commands (white playedhasno effecton the execu-
Pushthiskeyfour
leftcontroller. to the
on the shiftkey corresponds mode)that correspond witfteach tionof a program.
A PR.OGR,AM
6. R,UNNING
Let'sdo a simpleprogram.Make Usingthe linethatyou havejust Thecursoris directlyto the right
surethe left dlfficultyswitchis in enteredintoyourprogram, let'sdo of the 2 in line2. Nowinout
the b positionand turnyourcon- an exercise. Pushthe ERASEkey PRINTusingthe greenmode.
soleunitoff andthenon again. once.Thecursorwillmovefrom Then,withthe bluemode,inputA
line2 directlyto the rightof the2 andgo to a NewLine.Your
Removethe STACKVARIABLES, on line1. Pushthe ERASEkey displaywilllooklikethis:
OUTPUT,and GRAPHICSregions againandthe2 will be erased
fromthe display.Thecursorwill fromthe program. Nowenter1,
be in the whitemodeand to the usingthe redmode.Changethe
rightof the number1 in the PRO cursorto the whitemodeandus-
GRAMregion.Changethecursor ingthe BAoKWARDkey,move STATIJS
to the bluemodeand pushthe A thecursoruntilit is directlyto the SYFIEDI-=}:54
key.TheletterA will appearon the riEhtof the B in the program. Push
displaynextto the 1. (Eachlineis the ERASEkeyandthe letterwill t-rFl+fl-t-t-
numbered, makingit possibleto be removedfromthe program. 2 F F i n tA
seewhereone lineendsandthe Nowreplaceit withA (bluemode). 3I
nextonebegins.)Nowchangethe In the whitemode,usethe FOR-
cursorto the red modeand push WARDkeyto moveto the endof
the * key.A smallarrowwill ap- line1 andinoutNew Line.
pearnextto the A. Nowgo back
to blueand inputB. Changing the Remember thatthecursorshould
cursorto red,input+ andthe not be on the symbolto be erased
number2. Nowgo backto the butdirectlyto the rightof it. Your
whitemodeandinputNew Line. screendisplaywillnowlooklike Now,withthe cursorin thegreen
You mustalwaysbe in thewhite this: mode,inputGOTOandthen,in
modein orderto starta new line the redmode,input1. Beforewe
In yourprogram. do anythingelse,let's lookat the
displayagain.
Yourdisplayshouldlooklikethis:
,l noticethatthe programwillprint
the currentvalueof NOTEin the
VARIABLES region.
10
Withthe lF andTHENcommands, Runthe program.Noticethatthe In thisprogramwe havegiventwo In somecaseswe can puttwo
we are instructingthe program sameresultsare achieved,except IF/THENcommands. lf the condi- commands on oneline,as in line1
thatlF something happens THEN that the notesare spacedevenly. tionsset uo in thefirstcommand andline2 in theaboveprogram.In
else.In this
it is to do something lf you wantthe programto give are notmet(line4) the computer thiswaywe can savesomeof the
case,lF Noteis morethan6, vou the valueof c in the oUTPUT willmoveto the nextline(line5). memoryfor laterin the program.
THEN Noteis to be changedto 0. iegion,inputPrintG andClearas Givenenoughmemory, therecan
Startthe programandwatchit be instructionsanywhere in the pro- be severalcommandsbetween
ingworkedin the STACKregion. gram.To cut downon theflickerin anytwo IF/THENcommands.
Noticethat as the valueof Note theOUTPUTregionas the Pro-
gramis givingyouthevalue,insert
rs. ii{sfrN{;'tH#,Ktr,t'
reaches7, it becomesmorethan
( >) 6 andthe programchanges a comma,(greenmode)afterthe
thevalueto 0. valuein thePrintline.PrintC.
Let'sdo anotherprogramto You mayuse any letterof the ANffi ffffitrTNT
ffifl,IN€T"HSNS
achievethesameresultin a dif- alphabet for thevariablein your
ferentway.Inputthefollowing: programs. Thefollowing program TheKEYfunction(redmode)is Startthe programandpushsome
hasall the keyfunctionswe have usedto inouta variable whilethe of the keyson the rightsideof the
learnedso far andusesnearlyall programis running. Theprogram Keyboard. Withpracticeyoumay
the available "memory"in the willevaluateKEYand reolaceit be ableto playa tune.
I Hote +- C computer. Afterentering thispro witha numberthatyou inputfrom
2 C +-C{-a oram.removethe oroqramfrom
5If C>TThenC+-0 the rightsideof the Keyboard.lf TheKEYfunctioncan alsobe
4 Eoto -a t-hedisplay,bringdp t[e STATUS, no numberis inoutted, thenthe usedfor programming in the
STACK,andOUTPUTregions, programwillreadKEYas 0, GRAPHICS regionas we willsee
and runthe program. later.
Here'sa simpleprogramusingthe
KEYfunction: Trythisprogramusingthe KEY,
NOTE.andPRINTfunctions:
--
r SYI'|EOI-S:SEl II SYFlElll-S:54
a l9r+-.17 trlEEr r SPEEEI:5El
2 Flole.-fl Frint D I
.3 D+-E -I- r
I Fl +- ]c-Eg
4 If II ) 7 Then Eioto I- -|- If Hec > ElThEn l'{ote {- 2 l{ote {- Fl Print A
I l+.eg 3If A:Ef T h e nE l e a r
5 If Il { E}Then Eioto 2 r ZEotoI-I 4 Eoto I-
I
|
L--
Nowlet'smakea minormodifica- set the SPEEDat 8 and inputthe Let'schangethe programslightly
tionin the program.In line2, in- followingprogram: a comma(,)at the end
by inputting
serta comma(,)afterPrintA and of line1 andline2. Theprogram
starttheprogram. By inserting the now lookslikethis:
commahereyou havetoldthe pro-
gramthat you wantas manyof the
variablesprintedon onelineas
oossible. r I- Print "F|" I I- Frint "4",
r a Frint '|trs" I ? Frint "IS",
r 3 Fri.tfl 3 FrintA
r 4 H+-f|-|-t-r 4 Ft+ A -fI_ I
r s Etenr 5 trlenr
r 6 Eoto I- tE Eoto I-
L )
to
15
Removethe programfrom the lF the squaresHlT,whichtheydo 1. x + (Highest) A 5+3x2Mod7
screenandmakesurethe periodically.
To HIT meansthe 2 . + - s :x 2 = 6
t h e f i r s t s t e p i3
GRAPHICS regionis fullyvisible. squaresmustoccupythe same 3. Mod the secondstepis: 5 + 6 = 1 1
Setthe speedat 60 and runthe coordinates.Otherwise (ELSE)the 4 . =
5. * (lewest) thethirdsteois: 11 Mod7 = 4
program.Thisprogramshowsyou computeris instructed to playthe A = 4
oneway to movethe squareson 7 note.whichit willdo untilthe
the field.lt alsorevealshowthe squareshit. UsingParenthesis However,the sameequationwith
HIT andELSEfunctions maybe Usingparenthesis (greenmode, parenthesis inserted,is workedout
put to use. (RemoveELSENOTE* 7 from givesprior-
left sideof Keyboard), differentlyandgivesa different
line5 andnote2 willbe played ity to whichevernumbersthe answerfor A.
In line5 the programis instructing whenthe souareshitand no other oarenthesis surroundwhenwork- A (5 + 3)x 2Mod7
thecomouter to soundthe2 note notewillbe sounded.) ingout an equation.
f i r s t s t e p : 5+ 3 = 8
Forexample, whenworkingout s e c o n d s t e o :x8 2 = 1 6
the following
equation: thirdstep:16 Mod7 = 2
I I. USINGTHEMOD FUNCTION A = 2
L__ ) L )
PONG@GAME
(Ball & Paddle)
L-_ ) L ) E__ )
19 20