How_to_Program_Commodore_64_BASIC_for_Beginners.pdf
(
47116 KB
)
Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
How to Program Your
COMMODORE 64®
BASIC for Beginners
Carl Shipman
AboutThis Book 2
1 The Keyboard ... Includescolor-selectiontable 3
2 HOW TO Write A Simple Program ... Simplifieddisk-driveandcassette-operatinginstructions 12
3 HOW A Program Makes A Decision ... Usingrelationaloperatorsandlogicaloperators 26
4 LOOPS ... Howtosetupandcontrolloopstodonearlyanything 41
5 Entering And Editing Program LJneS ... Includescontrol-symboltablesforreference 56
6 ASCII Codes ... WithCommodoreASCIIcodetables 69
7 Screen-Display Codes ... Withscreen-displaycodetables 84
8 HOW TO Input Data From The Keyboard ...Howtheusercontrolsprogramoperation 104
9 Arrays ... Howtostoreandretrievelargeamountsofdatainanorderlyway 115
10 Strings And Things ... Powerfulstring-manipulationmethods 127
11 Mathematical Operations ... Includesusefulroundoffroutines 147
12 Screen Displays And MenUS ... Fourwaystodisplayamenuandmakechoices 161
13 Sorting Routines ... Howtosortdataitemsandkeeptheminorder 173
14 Disk And Cassette Files ... Usedtomakeapermanentrecordofprogramsanddata 188
15 Using A Disk Drive ... Sequentialandrelativedatafiles.Automaticdisk-formattingprogram 190
16 Using A Cassette Recorder ... Storeprogramsanddataontape.Indexprogramfortapefiles 221
17 Using A Printer ... Listprograms,printunderprogramcontrolandasatypewriter 238
18 BinaryAnd Logical Operations ... Advancedcomputer-controlmethods 250
19 Sprites And BitGraphiCS ... DesignanddisplaycolorgraphicsusingaSprite-maker"program 266
20 SOUndAnd MusiC ... Makebeeps,soundeffectsandmusic.Includesa"music-maker"program 282
21 Programming And Debugging Techniques ... Essentialinformationtohelpyoufindbugs.. 305
Appendixes ... Indispensabletables,chartsanddiagramsforbetterprogramming
309
Index
332
NOTICE:Theinformationcontained inthisbookistrueandcompletetothebestofourknowledge.Allrecommendationsaremadewithout
anyguaranteesonthepartoftheauthororHPBooks.TheauthorandHPBooksdisclaimallliabilityincurredinconnectionwiththeuseofthis
information. Commodore 64 is a registered trademark of Commodore Electronics Ltd.
All rightsreserved. Nopartofthisworkmaybe reproducedortransmitted in anyform byanymeans, electronicormechanical, including
photocopyingandrecording,orbyanyinformation-storageorretrievalsystem,withoutwrittenpermissionfromthePublisher,exceptinthe
case of brief quotations embodied in critical articles or reviews.
Published by Knight-Ridder Press, a division of HPBooks, Inc.
P.O. Box 5367, Tucson, Arizona 85703 602/888-2150
ISBN: 0-89586-310-3 Library of Congress Catalog No. 83-82483
©1983 HPBooks, Inc. Printed in USA
Book Design: Paul Fitzgerald
7 8 9 10 11 12 13
AboutThisBook
Thisbookisforbeginners.Noprogrammingorcomputerknowledgeisnecessarybecauseit
startsatthebeginning. Youlearnwhatyouneedtoknowinasimpleandinterestingway. Bythe
end, youcanbewritingyourownprogramsusingcolor, graphics, soundandmusic.
LearnhowtoprogramyourcomputerinBASIC, thestandardprogramminglanguageforthe
Commodore 64. Becomefamiliarwithyourcomputersoyoucanusepurchasedprogramsinplug-in
cartridges, oncassetteorondisk.
SeeandlearnhowtouseaCommodorediskdrive,acassetterecorderandtheCommodore
graphicsprinterwithyourcomputer.Buttheseaccessoriesarenotrequiredtostartusingand
enjoyingyourcomputer.
Youwillenjoythesimpleprogrammingexamplesthatyoutypeandthenrunonyourcomputer.
Yourunderstandingisreinforcedbydoing.Placethisbookbesideyourcomputerwhiletypingand
runningtheexamples.
Whenyoufinish,youwillknowalotaboutcomputersandhowtousethem.You'llbeableto
getmaximumenjoymentandbenefitfromyourCommodore64.
WHATDOESBASICMEAN?
ThewordBASICisformedfromtheinitialsofitsfullname, Beginner'sAil-purposeSymbolic
Instruction Code. ThatiswhyBASICiswrittenincapitalletters.
TheBASICprogramminglanguagewasdevelopedatDartmouthCollegeinthe 1960sbyJohn
G. KemenyandThomasE. Kurtz. Itsoriginalpurposewastoteachtheideasofprogrammingby
usingaprogramminglanguagethatwassimpleandeasytounderstand.
Itprovedsousefulthatitwasadoptedbycomputermakersandgraduallybecameapractical
programminglanguageratherthanjustateachingmethod.Today, BASIChasmaturedandbecome
oneofseveralstandardprogramminglanguages.Itisthestandardlanguageforpersonalcomputers.
MorecomputersandcomputerprogrammersuseBASICthananyotherprogramminglanguage.
VERSIONSOFBASIC
ThereareseveralversionsofBASIC,sometimescalleddialects. Theyaresimilar.And,ifyou
understandone,youcanquicklylearntouseanother.
Usually,allcomputermodelsmadebyonemanufacturerusethesameorsimilarversions.But
theBASICusedbyonebrandmaydifferfromthatusedbyotherbrands.Thisbookuses
CommodoreBASIC,sometimescalledCBMBASIC, meaningCommodoreBusinessMachines
BASIC.
TheKeyboard
I'llbeginbyexplainingthekeyboardandhowitisused.Youcontrolandcommunicatewith
yourcomputerthroughthekeyboardbytypingBASICwords.
ThenIdiscussanddemonstrateBASICwordsintheorderyoushouldlearnthem.BASICisa
languagethatmustbelearnedlikeanyotherlanguage.Firstyoulearnthemeaningsofafewwords.
Thenyoulearntousethewordsingroups, likesentences.
AsyoubuildyourvocabularyofBASICwords,youwillgraduallyincreaseyourunderstanding
ofcomputers—howtheyworkandhowtoprogramthem.Whenyoudoitstep-by-step,it'seasy.
GETTINGREADY
Ifyourcomputerisnew,unpackitandconnectthekeyboardtoaTVsetorvideomonitor,
followingtheinstructionsinthe User'sGuide packagedwiththekeyboard.Iwillusetheword
display tomeantheTVsetorvideomonitor,whicheveryouareusing.
Turnonthedisplayandthenthecomputer.Thecomputeron-offswitchisontherightsideof
thekeyboard.Alwaysturnonthedisplayandotheraccessoriesfirst.Thenturnonthecomputer.
Thedisplayshouldshowadark-bluerectanglewithalight-blueborder.Thedark-bluerectangle
istheactiveareaofthescreenwherelettersandothercharactersaredisplayed.Atthetopofthe
screen,youshouldsee
**** COMMODORE 64BASICV2 ****
64K RAM SYSTEM 38911 BASIC BYTES FREE
READY.
Lettersandnumbersarethesamecolorasthelight-blueborder.Youmayadjustcontrolsonthe
displaysocolorsareaccurateandcharactersonthescreenareclearandeasytoread.
WHATDOESTHESCREEN DISPLAY MEAN?
ThemessageonthescreentellsyouthatyouareusingaCommodore64—whichisprobablynot
asurprise. BASICV2meansthatthe BASICprogramminglanguageisreadytouseandthatitis
Version2.IfCommodoreintroducesadifferentversionofBASIC, sometimeinthefuture,itwill
becalledV2.1 orV3 orsomethingsimilartodistinguishitfromthepresentversion.
Plik z chomika:
Teemu1.huusko
Inne pliki z tego folderu:
1541_Users_Guide.pdf
(34354 KB)
30_Hour_Basic_Commodore_64_Edition.pdf
(24150 KB)
A_Pocket_Handbook_for_the_Commodore_64.pdf
(14948 KB)
1001_Things_to_do_with_your_Commodore_64.pdf
(7837 KB)
101_Programming_Tips_and_Tricks.pdf
(3618 KB)
Inne foldery tego chomika:
Commodore 64 High Voltage SID Collection 79
Gamebase64_v18
Zgłoś jeśli
naruszono regulamin