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

Stack Addressing: Difference between revisions

From SnesLab
Jump to: navigation, search
(added some opcodes)
(→‎References: hid archive URL for E&L)
 
(35 intermediate revisions by the same user not shown)
Line 3: Line 3:
Absolute:
Absolute:


* [[PEA]]
* [[PEA]] (opcode F4)


Direct Page Indirect:
Direct Page Indirect:


* [[PEI]]
* [[PEI]] (opcode D4)


Interrupt:
Interrupt:


* [[BRK]]
* [[BRK]] (opcode 00)
* [[COP]]
* [[COP]] (opcode 02)


Program Counter Relative Long:
Program Counter Relative Long:


* [[PER]]
* [[PER]] (opcode 62)


Pull:
Pull:


* [[PLA]]
* [[PLA]] (opcode 68)
* [[PLB]]
* [[PLB]] (opcode AB)
* [[PLD]]
* [[PLD]] (opcode 2B)
* [[PLP]]
* [[PLP]] (opcode 28)
* [[PLX]]
* [[PLX]] (opcode FA)
* [[PLY]]
* [[PLY]] (opcode 7A)


Push:
Push:


* [[PHA]]
* [[PHA]] (opcode 48)
* [[PHB]]
* [[PHB]] (opcode 8B)
* [[PHD]]
* [[PHD]] (opcode 0B)
* [[PHK]]
* [[PHK]] (opcode 4B)
* [[PHP]]
* [[PHP]] (opcode 08)
* [[PHX]]
* [[PHX]] (opcode DA)
* [[PHY]]
* [[PHY]] (opcode 5A)


RTI:
RTI:


* [[RTI]] (opcode 40)
* [[RTI]] (opcode 40)
* [[RETI]]


RTL:
RTL:
Line 48: Line 49:


* [[RTS]] (opcode 60)
* [[RTS]] (opcode 60)
* [[RET]]


Relative:
Relative:


* [[ADC]]
* [[ADC]] (opcode 63)
* [[AND]]
* [[AND]] (opcode 23)
* [[CMP]]
* [[CMP]] (opcode C3)
* [[EOR]]
* [[EOR]] (opcode 43)
* [[LDA]]
* [[LDA]] (opcode A3)
* [[ORA]]
* [[ORA]] (opcode 03)
* [[SBC]]
* [[SBC]] (opcode E3)
* [[STA]]
* [[STA]] (opcode 83)


Relative Indirect Indexed, Y
Relative Indirect Indexed, Y


* [[ADC]]
* [[ADC]] (opcode 73)
* [[AND]]
* [[AND]] (opcode 33)
* [[CMP]]
* [[CMP]] (opcode D3)
* [[EOR]]
* [[EOR]] (opcode 53)
* [[LDA]]
* [[LDA]] (opcode B3)
* [[ORA]]
* [[ORA]] (opcode 13)
* [[SBC]]
* [[SBC]] (opcode F3)
* [[STA]]
* [[STA]] (opcode 93)
 
The effective addresses generated by stack addressing will always be in [[bank]] 0.<sup>[3]</sup>
 
==== Syntax ====
<pre>
PEA addr
PEA const
PEI dp
PER label
</pre>
 
=== See Also ===
* [[Stack Relative Addressing]]
* [[Stack Relative Indirect Indexed, Y Addressing]]


[[Category:ASM]]
[[Category:ASM]]
[[Category:Addressing Modes]]
[[Category:Addressing Modes]]
[[Category:Simple Admodes]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]


=== Reference ===
=== References ===
* [[Eyes & Lichty]] page 401 https://archive.org/details/0893037893ProgrammingThe65816/page/n427
# [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/401 page 401]
# section 3.5.22 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf
# lbid, section 3.2

Latest revision as of 19:41, 8 August 2024

There are several types of Stack Addressing:

Absolute:

  • PEA (opcode F4)

Direct Page Indirect:

  • PEI (opcode D4)

Interrupt:

  • BRK (opcode 00)
  • COP (opcode 02)

Program Counter Relative Long:

  • PER (opcode 62)

Pull:

  • PLA (opcode 68)
  • PLB (opcode AB)
  • PLD (opcode 2B)
  • PLP (opcode 28)
  • PLX (opcode FA)
  • PLY (opcode 7A)

Push:

  • PHA (opcode 48)
  • PHB (opcode 8B)
  • PHD (opcode 0B)
  • PHK (opcode 4B)
  • PHP (opcode 08)
  • PHX (opcode DA)
  • PHY (opcode 5A)

RTI:

RTL:

  • RTL (opcode 6B)

RTS:

Relative:

  • ADC (opcode 63)
  • AND (opcode 23)
  • CMP (opcode C3)
  • EOR (opcode 43)
  • LDA (opcode A3)
  • ORA (opcode 03)
  • SBC (opcode E3)
  • STA (opcode 83)

Relative Indirect Indexed, Y

  • ADC (opcode 73)
  • AND (opcode 33)
  • CMP (opcode D3)
  • EOR (opcode 53)
  • LDA (opcode B3)
  • ORA (opcode 13)
  • SBC (opcode F3)
  • STA (opcode 93)

The effective addresses generated by stack addressing will always be in bank 0.[3]

Syntax

PEA addr
PEA const
PEI dp
PER label

See Also

References

  1. Eyes & Lichty, page 401
  2. section 3.5.22 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf
  3. lbid, section 3.2