Commodore 64 Users Guide C64 03 Beginning Basic Programming

c64-users_guide-03-beginning_basic_programming

c64-users_guide-03-beginning_basic_programming

c64-users_guide-03-beginning_basic_programming

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 10

Scroll down to view the document on your mobile browser.
Up to now we've performed some simple operations by entering asingle line of instructions into the computer. Once .:j:aIlI~U. was de-pressed, the operation that we specified was performed immediately.This is called the IMMEDIATE or CALCULATORmode.But to accomplish anything significant, we must be able to have thecomputer operate with more than a single line statement. A number ofstatements combined together is called a PROGRAM and allows you touse the full power of the Commodore 64.To see how easy it is to write your first Commodore 64 program, trythis:Clear the screen by holding the _key, and then depressing theItJ.~fj:[.],',I:I key.Type NEW and press .~j:alll=!/.. (This just clears out any numbers thatmight have been left in the computer from your experimenting.)Now type the following exactly as shown (Remember to hit .:j:alll~j/.after each line)f1121 ?"CONNODORE 64" I2121 GOTO 1121.Now, type RUN and hit .~j:alll:j/.-watch what happens. Your screenwill come alive with COMMODORE 64. After you've finished watchingthe display, hit .~m/'I.'t(ll:l to stop the program.A number of important concepts were introduced in this short pro-gram that are the basis for all programming.Notice that here we preceded each statement with a number. ThisLINEnumber tells the computer in what order to work with each state-ment. These numbers are also a reference point, in case the programneeds to get back to a particular line. line numbers can be any wholenumber (integer) value between 0-63,999.1~ PRINT "COMMODORE 64"r L STATEMENTLINE NUMBER32I

Navigation menu