First page Back Continue Last page Overview Graphics
A variation of indexed addressing exists that automatically increments or decrements the index register as part of the instruction.
The index register can be modified either before or after it is referenced.
The index register can be adjusted by either 1, 2, 4 or 8.
ldaa 2,X+ ;reference then add 2
ldaa 4,-X ;subtract 4 then reference
ldaa 4,+X ;add 4 then reference
These instructions have a format similar to the indexed addressing instructions discussed on the previous slide, but the constant has a different meaning. When the index register is auto-adjusted, the constant indicates the amount to add or subtract from the index register.
The first instruction above loads register A with the value pointed to by the contents of the X register and then increments the value in register X by two. The next instruction subtracts 4 from index register X and then loads into register A the value pointed to by the contents of the X register.