[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

EXAMPLE:

Let us suppose that location $02 contains $45, and location $03 contains $1E. If the instruction to load the accumulator in the indirect indexed mode is executed and the specified zero page address is $02, then the actual address will be:

   Low order = contents of $02
   High order = contents of $03
   Y register = $00

Thus the actual address = $1E45 + Y = $1E45.

The title of this mode does in fact imply an indirect principle, although this may be difficult to grasp at first sight. Let's look at it another way:

"I am going to deliver this letter to the post office at address $02, MEMORY ST., and the address on the letter is $05 houses past $1600, MEMORY street." This is equivalent to the code:

   LDA #$00      - load low order actual base address
   STA $02       - set the low byte of the indirect address
   LDA #$16      - load high order indirect address
   STA $03       - set the high byte of the indirect address
   LDY #$05      - set the indirect index (Y)
   LDA ($02),Y   - load indirectly indexed by Y

INDEXED INDIRECT

Indexed indirect only allows usage of the X register as the index. This is the some as indirect indexed, except it is the zero page address of the pointer that is indexed, rather than the actual base address. Therefore, the actual base address IS the actual address because the index has already been used for the indirect. Index indirect would also be used if a table of indirect pointers were located in zero page memory, and the X register could then specify which indirect pointer to use.


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated December 09, 2002.