04 IN

Updated 4 Oct 2026

IN

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

Instruction Syntax

IN Rd, A
  • Rd: The destination register where the value from the I/O register A will be stored.
    • Can be any of the 32 general-purpose registers: R0–R31.
  • A: The I/O register address or name where the value is located.
    • Must be within the range:
      • Hexadecimal: $00 - $3F
      • (Values outside this range will result in an error.)

Examples

Valid Instruction:
IN R19, 0x10
  • R19: R19 is valid since it is within the register range R0–R31.
  • A: 0x10 is within the valid I/O address range $00–$3F.
  • Effect: Load the value from I/O address 0x10 into R19.
Valid Instruction:
IN R19, PIND
  • R19: R19 is valid since it is within the register range R0–R31.
  • A: PIND is the I/O address name corresponding to the I/O address 0x10, which is within the valid range $00–$3F.
  • Effect: Load the value from I/O register PIND (I/O address 0x10) into R19.