Migration to the new server completed.

Please add any new defect you notice here!


Die Migration auf den neuen Server ist abgeschlossen.

Bitte neue Defekte hier vermerken!

LDY

From C64-Wiki
Jump to: navigation, search

LDY (short for "LoaD Y") is the mnemonic for a machine language instruction which retrieves a copy from the specified RAM or I/O address, and stores it in the Y index register. The contents of the memory address is not affected by the opration.

[edit] Addressing modes

Opcode Addressing
mode
Assembler
format
Length
in bytes
Number of
cycles
Dec Hex
160 A0 Immediate LDY #nn 2 2
172 AC Absolute LDY nnnn 3 4
188 BC Absolute,X LDY nnnn,X 3 4*
164 A4 Zeropage LDY nn 2 3
180 B4 Zeropage,X LDY nn,X 2 4

LDY supports the five addressing modes shown in the table at right. In the assembler formats listed, nn represents a single-byte (8-bit) figure, and nnnn is a two-byte (16-bit) address.
With some addressing forms (marked with an asterisk, *, in the "Number of cycles" column) the execution time for LDY depends on the circumstances: In cases where the indexing requires the CPU to "reach across" a page boundary from the base address, the execution time is 1 cycle longer than listed here.

[edit] CPU flags

LDY affects 2 of the CPU's status flags:

  • The negative status flag is set if the result is negative, i.e. has it's most significant bit set.
  • The zero flag is set if the result is zero, or cleared if it is non-zero.
Personal tools
Help and Feedback