02 LDS

Updated 4 Oct 2026

LDS

  • The LDS (Load Direct from Data Space) instruction is used to load (copy) a value from a specific data-memory address (K) into a General Purpose Register (Rd).

Instruction Syntax

LDS Rd, K
  • Rd: The destination register where the value from data-memory address K will be stored.
    • Can be any of the 32 general-purpose registers: R0–R31.
  • K: The data-memory address to load the value from.
    • Must be within the range:
      • Hexadecimal: $0000 - $08FF
      • (Values outside this range will result in an error.)

Examples

Valid Instruction:
LDS R20, 0x200
  • R20: R20 is valid since it is within the register range R0–R31.
  • K: 0x200 is within the valid data-memory address range $0000–$08FF.
  • Effect: Load the value in data address 0x200 into R20.
Valid Instruction:
LDS R5, 0x5A5
  • R5: R5 is valid since it is within the register range R0–R31.
  • K: 0x5A5 is within the valid data-memory address range $0000–$08FF.
  • Effect: Load the value in data address 0x5A5 into R5.