05 OUT

Updated 4 Oct 2026

OUT

  • The OUT (Store to I/O Space) instruction is used to load the value from a General Purpose Register (Rr) into an I/O register (A).

Instruction Syntax

OUT A, Rr
  • Rr: The source register containing the value to be stored.
    • Must be one of the 32 general-purpose registers: R0–R31.
  • A: The I/O register address or name where the value will be stored.
    • Must be within the range:
      • Hexadecimal: $00 - $3F
      • (Values outside this range will result in an error.)

Examples

Valid Instruction:
OUT SPL, R20
  • R20: R20 is valid since it is within the register range R0–R31.
  • A: SPL is the I/O address name for an I/O register within the valid range $00–$3F.
  • Effect: Load the value from R20 into the I/O register SPL.
Valid Instruction:
OUT PORTB, R10
  • R10: R10 is valid since it is within the register range R0–R31.
  • A: PORTB is the I/O address name corresponding to an I/O register within the valid range $00–$3F.
  • Effect: Load the value from R10 into the I/O register PORTB.