
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.

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.

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.
