GS 3: VARIABLES & INDEXES Files |
|
VARIABLES, ADDRESSES and INDEXES The Variables file documents all of the variables needed for the System Monitor, the user applications and the utilities. To monitor some variables within OshonSoft's 6502 Simulator, we assigned them to Page 0 addresses and included them in the SIM's Watch Variables window. We'll try to document each variable or address to include which application is dependent upon it/them.
In some instances the code uses Indirect Indexed Addressing with Y and in other instances it does not. See pages 158 through 160 of Programming the 65816. To keep track of these indexed addresses, another file called Indexes.asm is used. It lists the Variables again but they have been commented out. Instead the variable names are preloaded with the addresses. Example: Cnv4HiLo is composed of Cnv4Hi at address $0005 and Cnv4Lo at address $0004 and they are combined to form Cnv4HiLo also at address $0004. (The lower address of the two addresses is used for referencing a location when used with Indexed Addressing with Y.) In this location the value $0208 is stuffed. When an instruction references Cnv4HiLo with the contained value of $0208, then that indexed location with its Y pointer is used to get the data. The command "lda (Cnv4HiLo),Y" means load the data at location $0218 if Cnv4HiLo contains $0208 and register Y contains $10: it's a combined address of $0218. We will use this addressing mode whenever possible.
|
VARIABLES INDEXES
|
Updated 2024-01-15