AnsweredAssumed Answered

Pointer indirect long addressing mode not very useful?

Question asked by Philipp Krause on Sep 3, 2013
Latest reply on Sep 3, 2013 by EtaPhi
Yesterday I had a look at the pointer indirect long addressing mode. It seems this one is useful only when register X is in use for other purposes:

Loading into a:
ldw x, $5000
ld a, (x)
vs
ld a, (($5000)
Both have a code size of 4 bytes, and the former takes 3 cycles while the latter takes 4 cycles.
ldw x, $5000
ldw x, (x)
vs.
ldw x, (($5000))
Both have a code size of 4 bytes,the former takes 4 cycles, the latter takes 5 cycles.
ldw y, $5000
ldw (y), x
vs
ldw (($5000), x
Here the former takes 6 bytes of code size and 4 cycles, while the latter takes 4 bytes of code size and 5 cycles.

Some are completly pointless:
ldw x, $5000
ldw x, (x)
vs.
ldw x, (($5000))
Both take 4 bytes of code size, but the former takes 4 cycles, while the latter takes 5! And here we overwrite x anyway.

It seems to me that pointer indirect long addressing mode is useful only in very specific circumstances, and I wonder why it was included at all.
Am I missing something about this addressing mode?

Philipp

Outcomes