Commodore_Power-Play_1984_Issue_09_V3_N02_Jun_Jul

Page 116

A Few Reminders Unless working with an assem bler, you will not be able to write the commands you just learned as words. Instead, you'll have to

POKE the programs in place. But, even if you don't have an assembler, take heart. Keep reading, and in the end, I'll show you how to convert the

word commands to POKE statements. Just read about how to make pro grams, and instead of typing them in, just write them on paper. When you

get to the end, convert them to POKE statements and you're on your way. But, I do suggest that you buy the VIC 20 Programmer's Refer

ence Guide. Also, in the VIC 20 Programmer's

Color Test for the Commodore 64

by Ross Cherednik

gives all the locations in memory, and tells what they do.

How To Build Programs Machine language programs are

built logically. For example, to store a

to continue. Surprising combina tions turn out to work quite well with each other and can create exciting

visual effects. To run only border and background pairs and omit the print, simply de lete lines 40, 70, 80, 90, and 100.

Reference Guide, a memory map is on pages 170-177. A "memory map"

Typing CONT allows the program

A little often goes a long way, as is the case with the program at hand.

Explanation of Program

The twelve-line program displays on

Line 10 clears the screen.

the screen al! 4,096 possible combi

Lines 20-40 prepare the 16 colors

nations of border, background and

for use.

print colors. With a running time just

Line 50 is the border color.

under two hours, each combination

Line 60 is the background color.

OF in 1E00 (the first location in screen

is on the screen about a second and

Lines 70 and 80 spell "COLOR

memory, 7680 in decimal), you first

a half. This gives enough time to

TEST".

look over the commands. So you must do something like LDX #$0F,

then STX $1EOO. LDX loads the X register, STX stores the value of X

quickly assess the clarity and aes

Line 90 colors the print.

thetic effects of a combination.

Line 100 changes print color.

Pressing RUN/STOP will freeze a

Line 110 changes background color.

particular combination on the screen.

Line 120 changes border color,

somewhere. Now, let's try to subtract 50 from

80. Look over the commands. Write a short program to do the subtraction. Do it on your assembler.

Here is mine—1C00 LDA #580

1CO2SBC#S5O 1C04 BRK Run it from 1C00. The answer is in the accumulator now. Here is how it worked, LDA puts a number in A

5 REM ** PROGRRM BV ROSS CHEREDNIK *# 10 PRINT11:]" 20 FOR fl=0 TO 15 30 FOR B=8 TO 15

40 FOR O0 TO 15 50 POKE 53230, Fl 60 POKE 53231, B 70 POKE 1394,3:POKE POKE

SBC subtracts a number from A. BRK stops the program. Try doing the same program using the command

ADC instead of SBC. Experiment Type in short pro grams like the one above, but use different commands and see what

Next time, we will build more complex programs. Between now and then, practice. Experiment. Dis cover. Try new things Don't worry, you can't huit the computer from the keyboard (short of using a hammer to type)!

80 POKE

C

John Karcher, ago 15, is a home-schooled student who lives in Coimai, Pennsylvania

£■ ■ P|~|L'"C"

1396,12=

1398 1 IS

1400,20:POKE 1401 1 5:POKE 1402,13: POKE 1493,20 90 FOR J=0 TO 9:POKE <55666+J>,C: NEXT J 100 FOR X-l TO 1000: NEXT X :NEXT C 110 FOR X=l TO 1000: NEXT X :NEXT B 120

happens. It's really fun!

1397,15:POKE

1395, 1

FOR X=l

TO

1000: NEXT X =NEXT R

c


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.