hobby! At that time the TRS-80 and Apple were still being explored. Each new program brought about a new concept and ability for the micro. Now there is a dearth of software and hardware for the TRS-80 and Apple. It was only six months ago that I purchased an ATARI. I now search out and read anything I can on the ATARI, as I did with my TRS-80, but it's much more exciting because of ATARI's hidden abilities.

I look forward to your next issue. Please enter my subscription so I don't miss out. My local computer store sold out of A.N.A.L.O.G. almost overnight!

OWEN C. HOGLE
1080 South 15th East
Salt Lake City, Ut. 84105

 

Dear A.N.A.L.O.G.,

I have just received your first issue, and after reading it thoroughly, I decided that it was up to me and other ATARI users to submit information. We need support! My article defines the Peek & Poke statements to confused beginners. Even though I am not an expert myself, I hope when you read through my article that you consider I am only 14 years old and in the 8th grade

What the PEEK and POKE Are You Talking About?
by Robert La Ferla

If you have ever listed a program or have skimmed through a page in the BASIC Reference Manual, you may have come across "Peek" and "Poke". In this article we will take a look at what these do, so you can poke it into your computer.

At first it may seem confusing, but it is really quite simple. Poke can be used in either the direct or deferred mode, Peek can only be used in the deferred mode. That is, Poke can be used only in a statement.

Now look at what each do. Poke is used to insert information (data) into a memory location. It can only be reset or cleared by [SYSTEM RESET] or another Poke statement. Note: System Reset only clears Poke in the direct mode.

EXAMPLES:
Direct Mode
POKE 755,4 - (try this and you'll find yourself upside down)

Deferred Mode
10 POKE 752,1 - (cursor inhibit; the '1' shuts off the cursor block)

How To Use
POKE aexp1, aexp2 (don't forget the comma)
aexp1 =decimal address
aexp2 =data to be poked

Now that you have learned how to POKE, let's see how to PEEK. Peek is used to retrieve the information (data) from a specified memory address; in other words the number in parentheses. Peek can only be used in the deferred mode (in a statement).

EXAMPLE:
IF PEEK(764)=63 THEN SOUND 2,0,10,8

How To Use
10 IF PEEK(aexp1)=aexp2 THEN ...
aexp1=memory address
aexp2=specified number
    OR
10 PRINT PEEK(aexp1)
10 PRINT PEEK(_$)

Here is a program that uses both "PEEK" and "POKE":

10 POKE 764,255: REM CLEARS KEYS PRESSED
20 PRINT CHR$(125) : REM CLEARS SCREEN
30 PRINT "ENTER THE LETTER 'B'"
40 IF PEEK(764)=21 THEN GOTO 50
45 GOTO 30: REM TRAP FOR INVALIDS
50 FOR C=1 TO 100 STEP 2
60 PRINT "THIS IS THE WAY TO PEEK AND POKE"
70 NEXT C
80 END