Pursuing Tom Ram

Game available in Itch.io.

Soruce code in Github.

Programming adventures in VIC-20.


How I use page 0

Pursuing Tom Ram uses almost all bytes form the 3,5 KB from RAM. So no need to use page 0. However, I use some positions of page 0 for two main reasons.

First, you cannot use indirect addressing without using page 0. If you do not what I am talking about, do not worry. I will introduce this technical jargon in a future section.

Second, I wanted to experiment with page 0.

In the Student Version of the code I only use three positions in page 0 (for temporal purposes) and these positions are empty so there is no conflict using them.

  
; Memory addresses
INPUT_BUFFER = $200
P0_TMP_A = $fb
P0_TMP_B = $fc
P0_TMP_BYTE = $fd



  

If you the code, there is a constant called INPUT_BUFFER with a value of $200 (this is the beginning of memory page 3). This is the beginning of page 2 and it is where BASIC stores a buffer. Computer reserves memory from $200 to $258 for BASIC lines of code. So, it is an empty position that I use to store the inputs of the player.