Professional Documents
Culture Documents
Addressing
Memory can be visualised as a series of pigeon-holes into which instructions and data can be stored. Each block of memory has a unique address. Data can be written to or read from each address. Addressing modes are the different ways in which the addresses can be accessed. For example, you may want to load the accumulator with a particular value. Depending on how and where the value is stored this will require the use of different addressing modes.
Indirect addressing
Indirect addressing tells the CPU an address that contains another address where the data is stored. For example, LDAI 132: points to memory address 132 there will be another address at this location the accumulator is loaded with the data at this address. This method makes it easier to alter the actions of a program, as the data can be altered without having to adjust the original program.
Index addressing
The address to be accessed is modified by the addition of a number held in an index register. For example, LDX R1 32: LDX means load the accumulator (using indexed addressing) R1 is the register that contains the start number for the address 32 is the number to be added to the number at R1 to locate the address where the data is stored. This increases the amount of addressable memory. This particular method is used for addressing data stored in an array, as it will be stored in consecutive memory locations.