You are currently viewing Atari 65xe Basic Locate

Atari 65xe Basic Locate

The first part of the Atari 65xe Basic Locate program sets Graphics mode 3.

Then three variables for X, Y, and C are setup. The X and Y variables manage the positions of the pixel on the screen and the C controls the color.

Atari Basic Locate

Next we begin to draw the screen. This creates a line at the center and a square to the right of it.

Now we begin to call the joystick by reading the data values at register 632 which manages the joystick port data.

The next line begins to place our moveable pixel on the screen at position X, Y. 

After this we define a new variable called X1 and store the contents of X into it, and we define a variable called Y1 and store the contents of Y into it. These are later used to recall an earlier position of our controllable pixel when it bumps up against a wall.

Locate command for Atari Basic

Then we begin checking all the joystick values to move our pixel around using the X and Y variables.

The lines after these are conditions that check to be sure that our pixel doesn’t leave the screen boundaries.

With these lines we are checking if the joystick is idle (=15) or moving (if greater or less than 15) in order to turn off the color of the pixel controlled with the joystick.

Finally we use imitate the Atari 65xe Basic Locate command  and save the collision data in variable COL. If the color of 3 is found (green) then we collided into a wall so prevent the pixel from passing through.

However, if the green color is found then we sound a bell, clear the screen, and write “NICE JOB” and then end the program.

The last line continues back to line 30, which keeps the program constantly running.

Please follow and like us:


Steve has always had a passion for computers even before I owned one. His first personal computer was an Atari 65xe purchased at Children's Palace around 1986. In later years he attended DeVry University and received a Computer Science degree, works as a Front End Web Developer and is a born again Christian. Although this is a tech site, I am never shy to admit that I am a sinner saved by the blood of Jesus Christ. If you ever want to talk about salvation, I'm game.