This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

Stack

Stack operations

Table of Contents

1 - Pull

Stack pull operations
Flags Affected
Flags
n-----z-
nSet if most significant bit of the transferred value is set
zSet if value transferred is zero
Instructions
SyntaxOpcode Available on: # of # of Addressing Mode
(hex) 6502 65C02 65816 bytes cycles
PLA 68 x x x 1 32 Implied
PLB AB x 1 4 Implied
PLD 2B x 1 5 Implied
PLP 28 x x x 1 4 Implied
PLX FA x x x 1 43 Implied
PLY 7A x x x 1 43 Implied

Notes:

  1. Add 1 cycle if low byte of Direct Page register is other than zero (DL<>0)
  2. 65816: Add 1 cycle if m=0 (16-bit memory/accumulator)
  3. 65816: Add 1 cycle if x=0 (16-bit registers)

2 - Push

Stack push operations
Instructions
SyntaxOpcode Available on: # of # of Addressing Mode
(hex) 6502 65C02 65816 bytes cycles
PEA addrF4 x 3 5 Stack Absolute
PEI (dp)D4 x 2 61 Stack Direct Page Indirect
PER label62 x 3 6 Stack PC Relative Long
PHA 48 x x x 1 32 Implied
PHB 8B x 1 3 Implied
PHD 0B x 1 4 Implied
PHK 4B x 1 3 Implied
PHP 08 x x x 1 3 Implied
PHX DA x x x 1 33 Implied
PHY 5A x x x 1 33 Implied

Notes:

  1. Add 1 cycle if low byte of Direct Page register is other than zero (DL<>0)
  2. 65816: Add 1 cycle if m=0 (16-bit memory/accumulator)
  3. 65816: Add 1 cycle if x=0 (16-bit registers)