We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Indirect Addressing: Difference between revisions

From SnesLab
Jump to: navigation, search
(added ADC, SBC, CMP)
(clarify description)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Indirect Addressing''' is supported by some one-byte [[SPC700]] instructions when the [[accumulator]] is one of the operands, such as:
'''Indirect Addressing''' is used by some one-byte [[SPC700]] instructions.  Usually, the [[accumulator]] appears as the first operand in the assembler source, with the other operand being the [[X index register]], which is interpreted as a pointer.  These eight opcodes use indirect addressing:


* [[MOV]]
* [[MOV]] (opcodes E6 and C6)
* [[AND]]
* [[AND]] (opcode 26)
* [[OR]]
* [[OR]] (opcode 06)
* [[EOR]]
* [[EOR]] (opcode 46)
* [[ADC]]
* [[ADC]] (opcode 86)
* [[SBC]]
* [[SBC]] (opcode A6)
* [[CMP]]
* [[CMP]] (opcode 66)


Some of the above mnemonics have an opcode where both operands utilize indirect addressing.
In the above list, MOV is the only mnemonic that can take the accumulator as the second operand.
 
Some of the above mnemonics have an opcode where both operands utilize indirect addressing, in which case the whole instruction is considered to use [[Indirect Page to I.P. Addressing]].


==== Symbol ====
==== Symbol ====
Line 25: Line 27:


=== References ===
=== References ===
* Figure 3-8-3 on [https://archive.org/details/SNESDevManual/book1/page/n187 page 3-8-9 of Book I] of the official Super Nintendo development manual
* Figure 3-8-3 Memory Access Addressing Effective Address on [https://archive.org/details/SNESDevManual/book1/page/n187 page 3-8-9 of Book I] of the official Super Nintendo development manual
* [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/37 page 37]
* [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/37 page 37]



Latest revision as of 05:43, 5 January 2025

Indirect Addressing is used by some one-byte SPC700 instructions. Usually, the accumulator appears as the first operand in the assembler source, with the other operand being the X index register, which is interpreted as a pointer. These eight opcodes use indirect addressing:

  • MOV (opcodes E6 and C6)
  • AND (opcode 26)
  • OR (opcode 06)
  • EOR (opcode 46)
  • ADC (opcode 86)
  • SBC (opcode A6)
  • CMP (opcode 66)

In the above list, MOV is the only mnemonic that can take the accumulator as the second operand.

Some of the above mnemonics have an opcode where both operands utilize indirect addressing, in which case the whole instruction is considered to use Indirect Page to I.P. Addressing.

Symbol

(X)

See Also

References