Summary of Contents for Commodore Computers 264 Series
Page 1
I Commodore 264 Series iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiillliiillilliillliliiiliillilliiliiliilliiiltiliiiiliiilinil Preliminary UsersManual fscommodore ^COMPUTERS...
Page 2
USER’SGUIDE STATEMENT "This equipment generates and uses radio frequency energy. If it is not properly installed and used in strict accordance with the manufacturer’s instructions, this equipment may interfere with radio and television reception. This machine has been tested and found to comply with the limits for a Class B computing device in accordance with the specifications in Subpart J of Part 15 of FCC Rules, which are designed to provide reasonable protection against such interference in a residential installation.
Page 3
INTRODUCTION YOU’LL ADORE YOUR COMMODORE 264! Welcome to the Commodore family! Whether you’re a beginner or an expert, you'll be surprised how easy it is to use your Commodore 264 computer. The Commodore 264 is easy to program . . . but you don’t have to be a programmer to use it.
Page 4
Built-in Software You may have purchased your Commodore 264 with one of several built-in software packages that are ready to use as soon as you turn on your computer. If your computer has built-in software, a separate manual describing how to use the software is included. Built-in software on the Commodore 264 is a Commodore first! Commodore Software on Cartridge For a long time, video games were the only software programs available on...
Page 5
The MAGIC DESK • If you’re a new computerist and you want to use your computer for wordprocessing, calculations and other functions, but you really don’t want to learn any special commands or instructions...try MAGIC DESK. This unique Commodore software system uses PICTURES of familiar objects instead of written commands, and uses the computer Keyboard like a typewriter.
TABLE OF CONTENTS Unpacking and Setting Up the Commodore 264 CHAPTER 1 Using the Keyboard and the S creen ....CHAPTER 2 Getting to Know Your Commodore 264 ... CHAPTER 3 CHAPTER 4 Using S o ftw are......- ......B eginningB A SIC ..........CHAPTER 5 Using Graphics and C olor........
Page 7
CHAPTER UNPACKING AND SETTING UP THE COMMODORE 264 Unpacking your Commodore 264. Getting to know the switches and sockets. Setting up your Commodore 264. Troubleshooting chart.
Page 8
UNPACKING YOUR COMMODORE 264 Now that you’ve opened the box containing your new C-264 box and found this manual, the first thing that you should do is check to make sure that you have ail the items on this list. You should have: 1.
Page 9
GETTING TO KNOW THE SWITCHES AND SOCKETS THE RIGHT SIDE OF YOUR C-264 THE ON/O FF SWITCH Your C-264 should be turned off when you Install or remove cartridges or any peripheral device such as a printer or disk drive. The OFF position is marked so you can be sure when your machine is off.
Page 10
THE BACK OF YOUR COMPUTER The sockets on the back of your computer connect a variety of accessories to your Commodore 264. Each connector is different. Be sure you plug each accessory into the right socket. THE POWER SOCKET The round end of the power cable fits in here. The power cable Is the one connected to the power supply box.
Page 11
SETTING UP YOUR C-264 • You need to set up your C-264 somewhere with access to at least two wall plugs: one for your C-264 and one for your TV or monitor. • If you're installing a disk drive and a printer, you'll need additional wall plugs.
Page 12
Once you’ve attached the switch box to the TV, you never have to do it again. When you want to use the computer, just move the switch to COMPUTER. When you want to watch TV, just move the switch to the TV position.
Page 13
TROUBLESHOOTING CHART Symptom Cause Remedy In d ic a to r Light C o m p u te r not “ O n ” M a k e sure p ow er sw itch not ‘O n ” is in “O n ” p osition C h ec k p o w e r so cket for P o w e r c a b le not p lugged loose or d is c o n n e c te d...
CHAPTER USING THE KEYBOARD AND THE SCREEN A tour of the keyboard. The special keys. The graphics keys. The programmable function keys. The HELP key.
Page 15
TRY TYPING THIS ON YOUR KEYBOARD: 1 PRINT “your name” press the M>|l|;™ key pressthe iiH M 'B key 2 PRINT “HAS A NEW 264" pressthe B aiM fli key A TOUR OF THE KEYBOARD Many of the keys on the C-264 keyboard are like the keys on a typewriter, but every key can do more than a typewriter can.
Page 16
The SHIFT key gets upper case letters when you are in upper/lowercase text mode. You can tell you’re in this mode when the letters you type are in lower case except when you use the SHIFT key. You can go back and forth between uppercase/graphics and upper/lowercase text modes by pressing the SHIFT and @ 5] key at the same time.
Page 17
CLR/HOME When you press this key, the cursor immediately moves to the top left corner of the screen. This is called the HOME position. Your screen stays the same. If you hold down the SHIFT key and press CLR/HOME, not only does the cursor move to HOME, but the screen clears.
Page 18
THE COLOR KEYS You can change the colors of the letters and numbers on the screen to any one ot the 16 colors available on your C-264. It’s simple to do: • If you want one of the 8 colors listed on the TOP row on the front of the color keys (like BLacK), just hold down the CTRL key and then press the color key with the color you want.
Page 19
ESCAPE Use the ESCape key to perform many special screen editing functions, such as setting the top and bottom of a display window. Press the ESCape key and one of the letter keys listed below: A Automatic insert mode B Set the bottom of the screen window C Cancel automatic insert mode D Delete current line Insert a line...
Page 20
upper case letters without using the SHIFT key. The SHIFT key lets you type graphics, not uppercase letters. There are two graphic symbols on each graphics key: • To print the graphic symbol on the right, hold down the SHIFT key while you press the key.
Page 21
When you press HELP, the line with the error is displayed on the screen with the error printed in reverse. For example: 7SYNTAX ERROR IN LINE 10 C-264 displays this HELP You press HELP C-264 displays this with your HflPRONT "COMMODORE COMPUTERS” error highlighted...
CHAPTER GETTING TO KNOW YOUR COMMODORE • Some simple C-264 programs. • How to correct typing mistakes. • Introduction to the C-264 text screen. • More about PRINTing on the screen. • Introduction to color and reverse printing.
Page 23
TRY TYPING THIS PROGRAM: Type this program exactly as it appears here. Don’t leave out the numbers at the beginning of the line. Be sure to press the RETURN key at the end of each line. This line tells your computer to print C-26^ on the TV screen.
Page 24
Now your screen should be pink and an ellipse should have been drawn on the screen. Try this: Type LIST. The program is listed at the bottom of the screen. Use the cursor key to move to the number 10 at the end of line 30. Change 10 to 50, Press RETURN, Move the cursor to a blank line.
Page 25
HOW TO CORRECT TYPING MISTAKES If you make a mistake when you’re typing something, there are several ways to make changes. YOU CAN RETYPE A LINE anytime, even after you've RUN the program. The C-264 automatically replaces the old line with the new one. The C-264 doesn’t put the new line in the same place as the old one, and the old one still appears on the screen, but the C-264 ignores it.
Page 26
YOU CAN EDIT A LINE. Use the cursor keys to move to the place in the line that you want to change. Now just type over what you want to change. Press RETURN when you finish. ^ ;'V NOTE: You don’t have to be at the end of the line to press RETURN. Your C-264 will remember the whole iine even if you press RETURN in the middle of the line.
Page 27
YOU CAN OPEN UP SPACES IN A WORD OR LINE with the INST Key (get this insert key by holding down SHIFT while you press INST/DEL). Hold the Keys down until you open up as many spaces as you need. (Notice that the cursor stays in the same place while spaces open up to the right.) Then just type what you want to insert.
Page 28
A SIMPLE C-264 PROGRAM Now that you’ve experimented a little with your C-264, here’s a simple program to try: STEP 1: Clear the screen by holding down the SHIFT key while you press the CLR/HOME key. This erases your screen. STEP 2: Clear out old programs by typing NEW.
Page 29
INTRODUCTION TO THE C-264 TEXT SCREEN Try typing this program: RETURN RETURN ^pmssSHIFTand^S?f 1 PRINT “ | > ”; RETURN 2 GOTO 1 RETURN Now your screen fills with hearts. When the entire screen is covered with hearts, press the RUN/STOP key to end the program. This program shows you how big yourC-264'sscreen is.
Page 30
The C-264 has 1000 different positions on the screen for letters, numbers, graphic symbols, etc. NOTE: Sometimes you'll type a particularly long line on your C-264, such as this: 1 PRINT “ ANTIDISESTABLISHMENTARIANISM OPPOSES ANARCHY” You’ll notice that as you type this, you run out of room on one row. But keep typing;...
Page 31
MORE ABOUT PRINTING ON THE SCREEN Try typing this program: RETURN READY. RETURN 1 PRINT “A’V'B" RETURN 2 PRINT “A”;“B” RETURN AB <r If line 1 and line 2 seems so much alike, why is there such a difference in what they PRINT on the screen? The difference is in the punctuation between the items this program PRINTs.
Page 32
Here’s what happens if the first PRINT item is 12 letters long and the second item is separated by a comma: PRINT “ABCDEFGHIJKL”,“M ” PRINTs this: ABCDEFGHIJKL print print print zone 1 zone 2 zone 3 Now clear your screen and type this program: 1 PRINT 1,2 2 PRINT 1;2 This program shows you two new things:...
Page 33
INTRODUCTION TO COLOR AND REVERSE PRINTING The C-264 can display numbers, letters and graphic symbols in 16 different colors. You can also display all these characters in reverse. STEP 1. Clear your screen by pressing SHIFT and CLR/HOME. STEP 2. Hold down the CTRL key and press the RVS ON key: E FFk I <...
Page 34
Try typing some letter in reverse. Just hold down CTRL and RVS ON to turn on reverse, and then type whatever you want. Reverse letters make excellent headlines. You can also use them to highlight special words and numbers. Try this: 10 PRINT “0 20 GOTO 10 Now press RUN/STOP and replace line 20 with this line to make letters flash...
CHAPTER USING SOFTWARE • Introduction. • How to use built-in software. • How to load cartridges. • How to load cassette tapes. • How to save programs on cassette tapes. • How to load programs from diskette. • How to header a diskette. •...
Page 36
INTRODUCTION The family of software available for your C-264 is growing quickly. Your dealer can keep you up-to-date on new products and inform you about the features of software that's currently available. Your Commodore 264 can use software that is built-in or that is recorded on CARTRIDGES, CASSETTE TAPES, and DISKETTES that are available from your Commodore dealer.
Page 37
STEP 1 TURN OFF your C-264. IMPORTANT: YOU MUST TURN OFF YOUR COMPUTER BEFORE YOU INSERT OR REMOVE CARTRIDGES. IF YOU DON’T, YOU MAY DAMAGE THE CARTRIDGE AND THE COMPUTER. STEP 2. Holding the cartridge with the nameplate facing UP, insert the cartridge firmly in the cartridge slot on the back of your computer.
Page 38
HOW TO LOAD CASSETTE TAPES A variety of software products for the C-264 is available on cassette tapes. These cassette tapes look just like the ones with recorded music that you can play on a stereo. Cassette tapes run in the Datassette tape recorder, available from your Commodore dealer.
Page 39
HOW TO SAVE PROGRAMS ON CASSETTE TAPES When you write a program and want to save it on cassette tape, follow these steps: STEP 1. Type: SAVE “program name” The program name you use can be anything you want, but can be no more than 16 letters and/or numbers long.
Page 40
HOW TO LOAD PROGRAMS FROM DISKETTE Disks are fast and easy to use. Be sure to handle your disks and your disk drive carefully. The steps are the same for loading all disks: STEP 1. Make sure that your disk drive is ON. STEP 2.
Page 41
HOW TO HEADER A DISKETTE HEADERING prepares your new BLANK disk for use. IMPORTANT: DO NOT HEADER A DISK THAT HAS ANYTHING ON IT UNLESS YOU WANT TO ERASE THE ENTIRE DISK. HEADERING ERASES EVERYTHING ALREADY ON A DISK. To HEADER a disk, enter this command exactly as it appears. Type your own disk name and disk id number, which are explained below.
Page 42
HOW TO SAVE PROGRAMS ON DISKETTE When you want to reuse a program you’ve written, be sure to SAVE It before you LOAD another program. If you don’t you’ll lose the program. When you change a previously SAVEd program, you have to SAVE it again if you want to keep the new version.
CHAPTER BEGINNING BASIC • Doing calculations on your C-264. • Immediate mode. • Using var|ables. • Inputting information. • Using loops: FOR . . . NEXT...
Page 44
DOING CALCULATIONS ON YOUR C-264 You can use PRINT to do more than just display what you put in quotation marks. You can use your C-264 like a simple calculator. Besides the standard + and - signs, your C-264 uses the * sign for multiplication and the / sign for division and fractions.
Page 45
Since lhe calculation in line 1 is in quotes, the C-264 just PRINTs the problem as if it were any text: exactly as it appears between the quotation marks. The problem isn’t solved, and no space is left for the numbers’ sign. Now move the cursor back to line 1 and change the line so it looks like this: , ^ ^ ^ io n T fo rg e t the semicolon) 1 PRINT “2*3+ 1 = ";2*3 + 1...
Page 46
SCIENTIFIC NOTATION What did the C-264 mean by the E-03 part of the above answer ? The C-264 displays decimal numbers in the range - 999,999,999 to 999,999,999 in standard numerals, but numbers beyond this range are automatically displayed in scientific notation. This special notation lets the C-264 display large numbers in fewer digits.
Page 47
IMMEDIATE MODE You can put any calculation in a program, or get an immediate answer by typing PRINT and the problem without a line number, like this: PRINT 343 PRINT 24/(6 + 2) When you don’t have a line number before a BASIC statement, you don’t have to type RUN to teli the computer to follow the instruction.
Page 48
PROGRAMMINQ TIP You can abbreviate PRINT (and many other BASIC commands.) The abbreviation for PRINT is the question marK. For example: ? 1/4*3 is the same as PRINT 1/4*3 Other BASIC abbreviations are listed in Appendix C. MORE ABOUT MATHEMATICAL CALCULATIONS The last example shows that you can perform more than one calculation in one line.
Page 49
USING VARIABLES The example 36*(12 + (A/3)) shows one of the most powerful features of a computer. When we used a letter instead of a number in a mathematical problem, we used a VARIABLE. A variable stands for a value: 10A = 3 20 PRINT "TOTAL:";A*4 TOTAL: 12...
Page 50
INPUTTING INFORMATION The last example showed you a new BASIC statement, and a new way to enter information. INPUT lets you enter words and numbers WHILE the program is running. The greatest advantage to this is the reusability INPUTting brings to programs. For example, if the last program had the line PRINT "OCTOBER 31”, you’d have to change the line before you executed the program whenever the date isn’t October 31.
Page 51
Line 40 tells the computer to go bacK to line 10 so you can INPUT another value for X$. You don’t have to include a message in an INPUT statement. When you don’t, the computer displays a question mark to tell you it’s waiting for data INPUT.
Page 52
20 PRINT “COMMODORE COMPUTERS ”;“COUNTER 30 NEXT CT 40 PRINT “FINAL COUNTER VALUE = ";CT COMMODORE COMPUTERS COUNTER = 1 COMMODORE COMPUTERS COUNTER = 2 COMMODORE COMPUTERS COUNTER = 3 COMMODORE COMPUTERS COUNTER = 4 FINAL COUNTER VALUE = 5 Ordinarily, every time a FOR .
CHAPTER USING GRAPHICS AND COLOR • Keyboard colors • Graphics characters • Character animation • Controlling colors • High resolution graphics • Points, lines, and labels • Squares, circles, polygons, and painting • Multi-colorgraphics...
Page 54
KEYBOARD COLORS You can change the color qJ the characters on the screen to improve readability or to find a color combination you like. Here’s how to see how the different color characters look on your screen: STEP 1. Hold down the CTRL key. STEP 2.
Page 55
GRAPHIC CHARACTERS Each letter key contains 2 different graphic characters, as do the @, - , *, keys. To print graphic characters, you must hold down the SHIFT or £ [C «| key while you press the key for the graphic symbol you want. When your C-264 is in uppercase/graphic mode, hold down SHIFT and press a letter key to display the graphic character on the right side of that letter key.
Page 56
Exercise 4: Two Crosses Step 1: Press down the SHIFT LOCK key. It should stay down. Step 2: Hit M, then SPACE, then N, then SPACE, then — . Hit the BMB:M key. Step 3: Step 4: Hit SPACE, then V, then SPACE, then *, then + , then Step 5: Hit the BTfHI'M key.
Page 57
• Exercise 5: Half Bar Step 1: Hold down the key with one hand during the whole exercise. Step 2: Hit D, then t, then I, then F. Step 3: Hit the C S S S 9 key. Exercise 6: Wedge fe l key and hit T, then Y, then U.
Page 58
CHARACTER ANIMATION Movies are really a sequence of still pictures. Each picture is a little different from the one that came before. The projector shows each picture for a very short time, then goes on to the next one. The scene becomes animated. Computer animation works the same way.
Page 59
* Exercise 9: Jumping Jacks ^ Type NEW and hit RETURN. Remember to hit RETURN after each line. E3BI 10 PRIMT " R9S| M QSS| 1 ] " 20 PRINT " SPACE g] + SPACE " E3S| 30 PRINT " iBBI N SPACE M "...
Page 60
Exercise 11: Moving Ball Type NEW and hit RETURN. Remember to hit RETURN after each line. 10 PRINT " QQ| 20 PRINT ■ SPACE SHIM £= C R S R 30 FOR L=1 TO 50 NEXT 40 GOTO 20 Type RUN and hit the RETURN key. Hit the STOP key when you want the program to stop moving the ball.
Page 61
Each color also has an adjustable brighlness level, called the luminance. You can add a number from 0 (darkest) through 7 (brightest) after the color number to vary the color. Type COLOR 4, 3, 0 and hit RETURN. The border becomes a dark red.
Page 62
HIGH RESOLUTION GRAPHICS The C-264 screen contains 25 rows of 40 characters each, or 1000 total character positions on the screen. Each character is formed out of single dots, with 8 rows of 8 dots each making an entire character. Vour screen has a total of 320 dots on each row, and 200 rows, or 64,000 dots all together.
Page 63
You can switch back and forth from graphics to text using the GRAPHIC command. The command GRAPHIC 0 switches the screen back to text, while GRAPHIC 2 switches back to high-res without erasing the screen. Adding ,1 after the command erases the screen. In general, the GRAPHIC command looks like this: GRAPHIC mode, clear Mode...
Page 64
POINTS, LINES, AND LABELS Type the commands GRAPHIC 2,1: DRAW 1,0,0 and hit RETURN. Look closely at the upper left corner of the screen. The C-264 drew a black dot there. In the DRAW command, the first number ls either 1 (draw a dot) or 0 (erase a dot).
Page 65
Exercise 14: Sine Curve Type NEW and hit RETURN. Remember to hit the RETURN key after each line, then type RUN. 10 COLOR 0,1 20 COLOR 1,2 30 GRAPHIC 1,1 40 LOCATE 0,100 50 FOR X = 1 TO 319 60 Y= INT( 100+ 99* SIN( X/20)) 70 DRAW 1 TO X,Y 80 NEXT...
Page 66
Exercise 15: Sine Plot Don’t type NEW after exercise 9. Just change line 70 to: 70 DRAW 1, X, Y This program plots the same curve using points instead of lines. USING TEXT IN GRAPHS Your graphs will be more attractive if you use words to label them. You can use the CHAR command to mix text right into a high resolution drawing.
Page 67
SQUARES, CIRCLES, POLYGONS, AND PAINTING DRAWING RECTANGLES Using the DRAW command, you can draw pictures by plotting many dots or lines. To draw a square, you can use the command DRAW 1,0,0 TO 100,0 TO 100,100 TO 0,100 TO 0,0. The C-264 includes a command to make It easier to draw squares and other rectangular shapes.
Page 68
Exercise 18: Colored Boxes Type NEW then hit RETURN. Don’t forget to hit the RETURN key after each line. Type RUN and hit RETURN at the end. 5 TRAP 60 10 GRAPHIC 2,1 20 DEF FNA(X)= INT( RND(1)* X) 30 COLOR 1, FNA(15)+1 40 BOX 1, FNA(320), FNA(160), FNA(320), FNA(160),, 1 50 GOTO 30 60 COLOR 1,2,3: GRAPHIC 0...
Page 69
Exercise 19: Polygons Type NEW then hit RETURN. Don’t forget to hit the RETURN key after each line. Type RUN and hit RETURN at the end. 10 GRAPHIC 271 20 INPUT"HOW MANY SIDES";A 30 IF A<2 OR A>100 THEN PRINT "DON’T BE RIDICULOUS" GOTO 20 40 CIRCLE 1,160,80,40,33,,,,360/A 50 GOTO 20...
Page 70
Exercise 21: Rotating Circles Type NEW then hit RETURN. Don’t forget to hit the RETURN key after each line. Type RUN and hit RETURN at the end. 10 COLOR 0,1 20 COLOR 1,2 30 GRAPHIC 1,1 40 A = RND(1)* 20+ 10 50 FCR L=0 TO 359 STEP A 60 CIRCLE 1, 160, 100, 80, 40,,, L 70 NEXT...
Page 71
In the last exercise, we created the 5-ring symbol of the Olympic games. By adding some PAINT statements to the program we can color in only the areas between the rings. Exercise 22: Olympic Painter Type in the program in Exercise 20, then add the&e lines: 110 FOR L=0 TO 2 120 PAINT 1 ,120 + 35 * L, 75 130 NEXT...
Page 72
Exercise 23: Multi-color Olympics Type NEW then hit RETURN. Don’t forget to hit the RETURN key after each line. Type RUN and hit RETURN at the end. 10 COLOR 0,1 20 GRAPHIC 4,1 30 FOR L=1 TO 5 40 Q=L: IF Q>3 THEN Q=Q-3 50 COLOR Q,L + 1 60 Y=50 70 IF L=2 OR L=4 THEN Y=100...
CHAPTER MAKING SOUND AND MUSIC ON THE C-264 • Introduction • Making some music • The C-264 music machine...
Page 74
INTRODUCTION Here is a short program lo make music on the C-264. Just type the program exactly as it looks, and remember to press RETURN at the end of each line. When the program is entered, type RUN and the press RETURN. When the program asks you to enter a number, type any number from 0 to 1023 and press RETURN.
Page 75
The VOL command controls the volume of the notes that the C-264 will play. Think of the first three letters of the word ‘volume’ to remember the VOL “ command. The number that comes after VOL is the setting for the volume. Think o<...
Page 76
Here is a chart that shows all of the notes in one scale, along with the note value to use. For examplerif you want to play an *E\ you would look for ‘E’ on the chart and then read across to 854. The 854 would be the note value to use in the SOUND command.
Page 77
MAKING SOME MUSIC Now that we’ve looked at the commands that the C-264 uses for making sound, let's make some music. Here are a couple of programs to type: The first program turns the keys from 1 through 8 into a piano. Type in the program and then type RUN.
Page 78
Here is a program that plays a song by reading a list of DATA statements. The DATA statements are in pairs. The first number is the note value for the SOUND command and the second number is the duration for the SOUND command.
Page 79
This program plays notes going up and down scales at different speeds, and displays some color bars along with them. 10 A$=" 20 VOL7 3 0 DO 40 D=INT(RND(0)*5)+2:REM DURATIuN 50 S=INT(RND(0)*300)+700 :REM START 60 R=INT(RND(0) (1020-S)) REM RANGE • 70 P*INT(RND(0)*30)+5 :REM STEP 80 T*SGN(RND(1)-.5):IFT=0THEN80 •...
Page 80
The last program is a little longer. This is the “GREAT C-264 MUSIC MACHINE”. The C-264 Music Machine G O S U B l 0 0 0 F O R X = 1 T 0 9 : R E A D N ( X ) : N E X T C H A R 1 , 8 , 1 , "...
Page 82
CONTROLLING THE SPEED OF YOUR PROGRAMS (FOR . . . NEXT) Did you ever want to SLOW DOWN a program? You can control the speed of your program by using a special two-part command called a time delay loop. Time delay loops use the FOR . . . NEXT command to tell the computer to pause and count to some number before continuing, slowing down your program.
Page 83
TIP: To make the messages flash faster, try changing the number 500 in Lines 15 and 25 to the number 100. • AN EASY SOUND EFFECT (FOR . . . NEXT . . . STEP) FOR .. . NEXT . . . STEP can be used creatively in sound effects. In this *■...
Page 84
UNDERSTANDING RANDOM NUMBERS Take 10 pieces of paper and wrile a number from 1 to 10 on each piece. Next, put the 10 pieces of paper into a hat or other container where you can't see them. Now, cover your eyes and draw out one piece of paper. What number did you get? That number is a RANDOM number.
Page 85
AN EASY RANDOM NUMBER FORMULA Here’s a simple formula for generating random numbers in any range you want. You can use this formula almost anywhere you would use a variable or number in your program. INT(RANGE*RND(1))+ LOWER LIMIT The INT command tells the computer to cut off any decimal places and only give you whole numbers like 1, 45, or 320, instead of numbers like 1.223, 45.6677, or 320.59.
Page 86
GRAPHICS PROGRAM USING COLOR, GRAPHIC, SCNCLR, AND CIRCLE This program draws a circle on your screen: 10 GRAPHIC1,1 20 COLORO,14: COLOR1,1: COLOR4,1 30 CIRCLE1,160,100,65,50 LINE 10 sets the computer to GRAPHIC1 "high resolution” graphics and clears the graphic screen of any previous graphics that might have been drawn there.
Page 87
CONCENTRIC CIRCLES (COLOR, GRAPHIC, SCNCLR, CIRCLE) One of the fun things you can do to impress your friends is to use your computer’s graphic capabilities to create interesting patterns and designs. This program creates beautiful concentric circles with exquisite optical effects.
Page 88
CIRCLE PATTERNS Here are a couple of one line programs that show off the circle command. 10 GRAPHIC1,1:FOR T = 1 TO 180 STEP6: CIRCLE1,80,80,60,60 , , , T,120:NEXT 10 GRAPHIC1,1:FOR T = 1 TO 180 STEP6: CIRCLE1,80,80,60,60 ,, , 120,I:NEXT PRINTING THE CURSOR IN SCREEN POSITIONING The key to positioning a word or graphic image where you want it on the...
Page 89
CHANGING COLORS When you turn on your C-264, the screen is BLUE and the characters on the screen are BLACK. As the last program showed, you can change these colors. Your C-264 has 16 colors each with 8 luminance levels (except black), so there are a lot of different color combinations.
Page 90
USING THE SEMICOLON The semicolon is very important in BASIC. Sometimes it might be the answer to one of those sticky programming problems. The semicolon prevents BASIC from moving the cursor to the beginning of the next line after executing a statement. A common use is when you CLEAR THE SCREEN.
Page 91
PRINTING GRAPHICS SIDE-BY-SIDE Let's explore another use of the semicolon, this time with graphics. Type the word NEW and press RETURN. We want to PRINT 40 hyphens across the screen, to maKe an attractive border or dividing line between two parts of a program we’re writing.
Page 92
INPUTS WITHOUT QUESTION MARKS Here’s a really handy programming technique — using INPUT statements WITHOUT question marks. Traditional INPUT statements have built-in question marks which typically appear on the NEXT LINE after the “prompt” or question, as in this sample program: 10 PRINT"<SHIFT>...
Page 93
USING COMMODORE BUSINESS GRAPHICS Your Commodore computer has a full set of keyboard graphics that include an excellent set of business graphics. These special lines and blocks let you create a wide variety of charts and graphs. Here’s a quick lesson in how to set up your screen using these graphics: Hold down the To get this symbol...
Page 94
MIO$, LEFT$, RIGHT$, and INSTR Three useful functions which are seldom explained in user’s guides are the STRING FUNCTIONS. These functions let you define a string of characters, letters, numbers or graphic symbols inside QUOTATION MARKS, and then work with any part of the information contained in that string. The best way to describe how these functions work is to give you an example: 10 SCNCLR 20 C $ = “HELLOGOODBYE”...
Page 95
A MORE COMPLEX PROGRAM (GOSUB, LEFT$) Here’s a different construction of the program we just ran. Pay close attention to this example because it may have applications to your own programs: 10 PRINT” ENTER YES OR NO AND PRESS RETURN":VOL 7 20 INPUTA$ 30 IF LEFT$(A$,1)=“Y”THEN GOSUB 1000 40 IF LEFT$(A$,1)= “N”THEN GOSUB 2000...
Page 96
CREATING A MENU One of fhe most common beginnings for programs is a menu. A menu is ju§t a list of options that you choose from. Here is a simple program that prints a menu on the screen and then prompts you for your choice. 10 SCNCLR:PRINTSPC(lB) "MENU"...
Page 97
CATCHING ERRORS This program demonstrates a very powerful tool that is built into the C-264. This tool is called ERROR TRAPPING.This means that if an error occurs in a program you can keep the program from crashing. Type the following program into your computer: 20 INPUT “TYPE ANY NUMBER";A 30 PRINT “32/A = "32/A...
Page 98
COMMODORE FUNCTION KEYS The COMMODORE FUNCTION KEYS at the top of your COMMODORE 264 keyboard are among the most useful features of your computer. Here are just a few of the ways the COMMODORE FUNCTION KEYS can be used: • Software developers use these keys to define special functions that make their software easier to use.
APPENDIX A: ERROR MESSAGES These error messages are printed by BASIC. You can also PRINT the messages through the use of the ERR$() function. ERROR NAME ERROR # :There is a lirnit of 10 files OPEN at one time. TOO MANY FILES :An attempt was made to open a file using the FILE OPEN :number of an already open file.
Page 101
:Division by zero Is mathematically not allowed. DIVISION BY ZERO :INPUT or GET statements are only allowed within ILLEGAL DIRECT :a program. :This occurs when a number is used in place of TYPE MISMATCH :a string or vice-versa. :A siting can contain up to 255 characters. STRING TOO LONG :Bad data was read from a tape file.
Page 102
DESCRIPTION OF DOS ERROR MESSAGES These error messages are returned through the DS and DS$ reserved variables. NOTE: Error message numbers less than 20 should be Ignored with the exception of 01, which gives information about the number of files scratched with the SCRATCH command. READ ERROR (block header not found) The disk controller is unable to locate the header of the requested data block.
Page 103
SYNTAX ERROR (invalid command) The command sent is longer than 58 characters. SYNTAX ERROR (invalid file name) Pattern matching is invalidly used In the OPEN or SAVE command. SYNTAX ERROR (no file given) The file name was left out of a command or the OOS does not recognize it as such. Typically, a colon (:) has been left out of the command.
Page 104
DIRECTORY ERROR The BAM does not rnatch the internal count. There is a problem in the BAM allocation or the BAM has been overwritten in DOS memory. To correct this problem reinitialize the diskette to restore the BAM in memory Some active files may be terminated by the corrective action.
APPENDIX B: BASIC 3.5 COMMANDS, STATEMENTS, AND FUNCTIONS This manual has given you an introduction to the BASIC language, to give you a leel for computer programming and some of the vocabulary involved. This appendix gives a complete list of the rules (SYNTAX) of the BASIC 3.5 language, along with a concise description of each. You are encouraged to experiment with these commands, remembering that you canTdo any permanent damage to the C264 just by typing in programs, and that the best way to learn computing is by doing.
Page 106
VARIABLE NAMES Variable names may consist of a single letter, a letter followed by a number, or two letters. Variable names may be longer than 2 characters, but only the first two are significant. An integer variable is specified by using the percent (% ) sign after the variable name. String variables have the dollar sign ($) after their names.
Page 107
CONVENTIONS IN FORMATS The following conventions are used in the formats of the BASIC commands and statements: • KEYWORDS, also called RESERVED WORDS, appear in uppercase letters. YOU MUST ENTER THESE KEYWORDS EXACTLY AS THEY APPEAR. However, many keywords have abbreviations that you can also use (see Appendix C).
Page 108
BASIC OPERATORS The arithmetic operators include the following signs: + addition - subtraction * multiplication division t raising to a power (exponentiation) On a line containing more than one operator, there is a set order in which operations always occur. If several operators are used together, the computer assigns priorities as follows: First, exponentiation.
Page 109
GRAPHIC STATEMENT INFORMATION There are a few concepts ihat apply to all of the blt map graphics statements. First is the concept of the Pixel Cursor (PC). The PC is similar to^the cursor in text mode: it is the position where the next dot will be drawn.
Page 110
CONT (Continue) This command is used to re-start the execution of a program that has been stopped by either using the STOP key, a STOP statement, or an END statement within the program. The program wilt resume execution where it teft off. CONT will not work if you have changed or added lines of the program (or even just moved the cursor to a program line and hit RETURN without changing anything), if the program stopped due to an error, or if you caused an error before trying to re...
Page 111
DSAVE DSAVE "filename" [,Ddrive#[,Uunit#]) This command stores a program on disk. (Use SAVE to store programs on tape.) You must supply a program name. EXAMPLES: DSAVE "BANKRECS” SAVEs the program BANKRECS to disk. DSAVE (A$) SAVEs to disk a program whose name is in the variable A$. DSAVE "PROG 3",DO,U9 Saves the program PROG 3 to the disk drive with a unit number (Serial bus address) of 9.
Page 112
LIST LIST (1st line] (|last line]] The LIST command lets you look at lines of a BASIC program that have been typed or LOADed info the C-264's memory. When used alone without any numbers following it, you will see a complete listing of the program on your screen (which may be slowed down by holding down the jC*j key, paused by CTRL —...
Page 113
This command erases the entire program in memory and clears out any variables that may have been used. Unless the program was stored somewhere, it is lost until you type it in again. BE CAREFUL when you use this command! The NEW command can also be used as a statement in a BASIC program When the C*264 gets to this line, the program is erased and everything stops.
Page 114
SAVE SAVE"filename"l,device#(,EOT FlagJ) This command will store a program currently in memory on a cassette tape or disk. If you just type the word SAVE and hit RETURN, the C264 will attempt to store the program on cassette tape. It has no way of checking if there is already a program at that spot, so be careful with your tapes.
Page 115
BASIC STATEMENTS BOX(cs,J a1,b1 , a2,b2 [, angle] [,paint) c s ..........Color source (0*3)(default is 1, foreground) a1,b1 ......Corner coordinate (scaled) a 2 ,b 2 ........Corner opposite a1,b1 (scaled) (default is the PC) a n g le ........
Page 116
cm ciE CIRCLE {cs)[,a,b,],xr(,[yr)I,|sall,leal[,Iangle][,jncl)lI) c s ..........Color source (0 3)(default Is 1) a , b .........Center coordinate (scaled) (defaults to the Pixel Cursor PC) x r ..........X radius (scaled) y r ..........Y radius (default is xr) s a ..........
Page 117
COLLECT COLLECT (Ddrive#)[,U unit#/ Use this command to free up space allocated to improperly closed files and delete refeiences to these files from the directory. EXAMPLE: COLLECT DO COLOR COLOR source#, color# ,luminance# Assigns a color to one of the 5 color sources: Number Source background...
Page 118
DEF FN (Define Function) DEF FN name (variable) = expression This command allows you to define a complex calculation as a function. In the case of a long formula that is used several times within a program, this can save a lot of space. The name you give the function will be the letters FN and any legal numeric variable name.
Page 119
DO/tOOP/WHILE/UNTIUEXIT DO |UNTIL boolean argument | WHILE boolean argument) [Statements) [EXIT1 LOOP [UNTIL boolean argument | WHILE boolean argument) Performs the statements between the DO statement and the LOOP statement. If no UNTtL or WHILE modifies either the DO or the LOOP statement, execution of the intervening statements continues indefinitely.
Page 120
F O R . . . TO . . . STEP FOR variable = start value TO end value [STEP Increment) This statement works with the NEXT statement to set up a section of the program that repeats for a set number of times. The loop variable is a variable which will be added to or subtracted from during the program.
Page 121
GETKEY GETKEY variable list The GETKEY statement is very similar to the GET statement. Unlike the GET statement, GETKEY waits for the user to type a character on the keyboard. This command can only be executed within a program. EXAMPLE: 10 GETKEY A$ This line waits for a key to be struck.
Page 122
GRAPHIC GRAPHIC <mode {,clear optionJ j CLR> This statement puts the C 264 in one of its 5 graphic modes: mode description normal text highresolution graphics high-resolution graphics, split screen multicolor graphics multicolor graphics, split screen When executed, GRAPHIC 1 4 allocates a 10K bit-mapped area, and the start of the BASIC text area is moved above the HI RES area.
Page 123
INPUT# INPUT# filenumber, variable list This works like INPUT, but takes the data from a previously OPENed file or device. No prompt string is allowed. This command can only be used in program mode. [LET| variable = expression The word LET itself is hardly ever used in programs, since it is optional. The variable name which is to get the value or the result of a calculation is on the left side of the equal sign, and the number or formula is on the right side.
Page 124
ON expression <GOTO|GOSUB> line numbers This command can make the GOTO and GOSUB commands into special versions of the IF statement. The word ON is followed by an arithmetic expression, which is evaluated into a number. The word GOTO or GOSUB is followed by a list of line numbers separated by commas. If the result of the calculation is 1, the first line in the list is executed.
Page 125
PAINT PAINT |color source) |,|a,b] ),mode)) (0-3) (defaull is 1, foreground) Color source starting coordinate, scaled (default is at PC) a , b ....0 = paint an area defined by the color source selected m o d e ... 1 = paint an area defined by any non-background source The PAINT command lets you fill an area with color.
Page 126
PRINT# PRINT# filenumber, print list There are a few differences between this statement and PRINT. First of all, PRINT# is followed by a number, which refers to the device or data file previously OPENed. The nurnber is followed by a comma, and a list of things to be PRINTed.
Page 127
A decimal point (.) symbol designates the position of the decimal point in the number. You can only have one decimal point in any format field. If you don’t specify a decimal point in your format field, the value is rounded to the nearest integer and printed without any decimal places. When you specify a decimal point, the number of digits preceding the decimal point (including the minus sign, if the value is negative) must not exceed the number of # before the decimal point.
Page 128
PUDEF PUDEF 1 through 4 characters PUDEF lets you redefine up to 4 symbols in the PRINT USING statement. You can change blanks, commas, decimals points, and dollar signs into some other character by placing the new character in the correct position in the PUDEF control string. Position 1 is the filler character.
Page 129
RESUME RESUME [line-number | NEXT) V ^ / ' V o u >- ^ ,. Used to return to execution after TRAPping an error. With no arguments, RESUME will attempt to re-execute the statement in which the error occurred. RESUME NEXT will resume execution on the line following the statement on which the error occurred, the RESUME line-number will GOTO the !ine number and begin execution there.
Page 130
SSHAPE/ GSHAPE SSHAPE ancl GSHAPE are used to save and restore rectangular areas of multicolor or high resolution screens using BASIC string variables. The command to save an area is: SSHAPE strvar, at,b1 |,a2,b2] strvar.........String name to save data in a 1 ,b 1 ........
Page 131
TRON TRON TRON is used in program debugging. This statement begins trace rnode. When you aie in trace mode, as each statement executes, the line number of that statement is printed. TROFF TROFF This statement turns trace mode off. VOL volume level Sets the current volume level.
Page 132
INSTR (string 1, string 2 [,startingpositionJ) Returns position of string 2 in string 1 at or after starting-position. Starting-position defaults to the beginning of string 1. If no match is found, a value of 0 is returned. INT(X) (integer) Returns the truncated value of X, that is, with all decimal places to the right of the decimal point removed.
Page 133
RND (X) (random number) This function will return a random (or nearly so) number between 0 and 1. This is useful in games, to simulate dice rolls and other elements of chance, and is also used in some statistical applications. The first random number should be generated by the formula R N D (-T I), to start things off differently every time.
Page 134
b. STRING FUNCTIONS A s q x $ ) This function will return the ASCII code of the first character of X$. CHR$(X) This is the opposite of ASC, and returns a string character whose ASCII code is X. ERR$ (N) Returns string describing error condition N (see TRAP).
Page 135
c. OTHER FUNCTIONS FRE(X) This function returns the number of unused bytes available in memory. X is a dummy argument. POS(X) This function returns the number of the column (0-39) which the next PRINT statement will begin on the screen. X is a dummy argument. SPC(X) This is used In the PRINT statement to skip over X spaces.
APPENDIX C: BASIC 3.5 ABBREVIATIONS TYPE ABBREVIATION KEYWORD function— numerIc pfliflf function— numeric GflD function— numeric command AUTO command BACKUP ■ ■ statement 5 H ih statement CHAR fun ctio n-string CHR$ GOD I statement CIRCLE statement CLOSE statement statement command COLLECT statement...
Page 138
tMi^ statement RETURN fiffili function— numeric fun ctio n-string i M l RIGHT$ r GSSI function— numeric RLUM funtion— numeric K fflH l r E 3 command tnna command SAVE C B M statement SCALE H!I!II statement SCNCLR «m command SCRATCH g fflH l function—...
APPENDIX D: TEDMON INTRODUCTION TEDMON is a built-in machine language program which lets you easily write machine language programs. TEDMON includes a machine language monitor, a mini assembler, and a disassembler. Machine language programs written using TEDMON can run by themselves, or be used as very fast ‘subroutines’...
Page 140
A RETURN is used lo indicate the end of the assembly line. If there are any errors on the line, a question mark is displayed to indicate an error, and the cursor moves to the next line. The screen editor can be used to correct any errors on the line. After a line of code is successfully assembled, the assembler will print a prompt containing the next legal memory location for an instruction, so A and the line number do not have to be typed more than once when typing assembly language programs Into the TED.
Page 141
COMMAND: F (FILL) PURPOSE: Fill a range of locations with a specified byte. SYNTAX: F <address 1> <address 2> <byte> <address 1> The first location to fill with the <byte> <address 2> The last location to fill with the <byte> <byte value>...
Page 142
The Load command causes a file to be loaded into memory. The starting address is contained in the first two bytes of the file (a PGM file). In other words, the Monitor Load command always loads a file into the same place it was saved from. This is very important in machine language work, since few programs are completely relocatable.
Page 143
SYNTAX: R Note that the stack pointer is displayed without its implied 8th bit. Since the 8th bit of the stack pointer has been mentioned, it is appropriate to point out a bu&in the 6502. When a PHP instruction is executed, the stack 8th bit of the stack pointer is OR’ed into the status byte and is stored on the stack with bit 4 (the break flag!) always set.
Page 144
COMMAND: V (VERIFY) PURPOSE: Verify a file on casse!te or disk with lhe memory contents. SYNTAX: V “<filename>", <device> <filename> is any legal C-264 filename. <device> is a hex number indicating the device the file is on. The Verify command compares a file to memory contents. If the file does not match memory, ERROR is printed.
Page 145
APPENDIX E: CONVERTING STANDARD BASIC PROGRAMS TO COMMODORE BASIC 3.5 If you have programs written in a BASIC other than Commodore BASIC, some minor adjustments may be necessary before running them on the Commodore 264. We’ve included some hints to make the conversion easier.
APPENDIX F C-264 MEMORY REGISTER MAP : DB4 : DB0 ; OB6 : DB5 : DB3 : DB2 : DQt __________ TIMER #J RELOAD VALUE, BITS 0 7 ( L O W ) __________________: $FF00 TIMER# 1 niLO AD V A L U irB IfS B ^ H T o \ ^ $FF01 ________________ TIMER # 2 RELOAD VALUE.
APPENDIX H: ASCII AND CHR$ CODES This appendix shows you what characters will appear if you PRINT CHR$<X), for all possible values of X. It will also show the values obtained by typing PRINT ASCCX"), where X is any character you can type. This is useful in evaluating the character received in a GET statement, converting upper/lower case, and printing character based commands (like switch to upper/lower case) that could not be enclosed in quotes.
Page 150
CHRS PRINTS CHRS PRINTS C H R | PRINTS C H R | PRINTS f f i f l l ■ □ F L A S H l : . g g . i 1 160 S P A C E ■...
Page 151
C H R | CHRS CNRS CHR$ PRINTS PRINTS PRINTS PRINTS T § “ ~ t T □ £ ] » CODES 192-223 SAME AS 96-127 COOES 224-254 SAME AS 160-190 CODE SAME AS...
Page 152
APPENDIX I: SCREEN DISPLAY CODES The following chart lists all of the characters built into the Commodore character sets. It shows which numbers should be POKEd into screen memory (locations t024 2023) to get a desired character. Also shown is which character corresponds to a number PEEKed from the screen. Two character sets are available, but only one set at a time.
Page 153
SET 2 SET 1 SET 2 SET 1 SET 2 POKE 8ET 1 POKE POKE < □ > f f l f f l □ f f l f f l f f l □ □ tflS □ □ £ 3 S P A C E □...
APPENDIX J: SCREEN AND COLOR MEMORY MAPS The following charts list which memory locations control placing characters on the screen, and the locations used to change individual character colors, as well as showing character color codes. SCREEN MEMORY MAP COLUMN 3111 4095...
Page 155
COLOR MEMORY MAP COLUMN 2082 The actual values to change a character’s color are: 1 BLACK ORANGE 2 WHITE 10 BROWN 3 RED 11 YELLOW-GREEN 4 CYAN 12 PINK 5 PURPLE 13 BLUE-GREEN 6 GREEN 14 Light BLUE 7 BLUE 16 DARK BLUE 8 YELLOW 16 Light GREEN...
APPENDIX K: DERIVING MATHEMATICAL FUNCTIONS Functions that are not intrinsic to BASIC 3.5 may be calculated as follows: BASK: EQUIVALENT FUNCTION S E C ( X ) = |/C O S ( X ) S E C A N T cosecANr C S C ( X ) = l /S I N ( X ) C O T ( X ) = l/T A N ( X )
APPENDIX L: PROGRAMS TO TRY 5 GRAPHIC 3, 1: GRAPHIC 0, 1 10 INPUT "SHOULD I CLEAN UP MY MESS"; A$ 2G INPUT "SHOULD I ROTATE"; B$ 30 INPUT "SHOULD I VARY MOTION"; C$ 40 INPUT "SHOULD I PICK THE START";D$ 50 IF A$="Y"...
Page 159
Zap Beam 10 VOL7 20 FORM=l TO 30 F O R L = 9 0 0 T 0 8 5 0 S T E P - 1 0 40 S O U N D l , L , l 50 NEXT 60 F O R L = 8 5 0 T 0 9 0 0 S T E P 1 0 70 S O U N D l , L , l 80 NEXT...
APPENDIX M: BOOK LIST BOOKS FOR COMMODORE PRODUCTS Commodore Bookware VIC 20 Programmer’s Reference Guide Commodore 64 Programmer’s Reference Guide Mastering Your VIC 20 Four VIC 20 Computer Books: VIC Revealed, Nick Hampshire VIC Games, Nick Hampshire VIC Graphics, Nick Hampshire Stimulating Simulations for the VIC, C.
Page 161
Hayden Book Co. The 6502 Software Gourmet Guide & Cookbook, Robert Findley I Speak BASIC to My VIC, Aubrey B. Jones, Jr. Reston Publishing Company, I n c . VIC BASIC: A User-Friendly Guide, Ramon Zamora, Don Inman, Bob Albrecht, Dymax 25 Advanced Games for the PET/CBM, Larry Hatch Sybex Computer Books Your First VIC 20 Program, Rodney Zaks...
Page 162
fNDEX CLR command 110, 116 Abbreviations for BASIC statements 42,130*132 CMD command 110 Animation 52*54 Color Arrays 100,112 areas 54 Assigning data background 54, 83 DATA ... READ statements 111,122 border 54, 83 INPUT 43-45, 86, 116 changing 11-12, 27, 48, 54-55, 83 GET 114 COLOR command 17, 55,111 LET 117...
Need help?
Do you have a question about the 264 Series and is the answer not in the manual?
Questions and answers