IndexRegister (IX)

Inputs

PinTypeDescription
Databus8Input value to load (8 bits)
ClockbitClock signal
WEbitWrite Enable: 1 = load Data into IX
IncbitIncrement: 1 = add 1 to current value

Outputs

PinTypeDescription
Qbus8Current value stored in the index register

How It Works

On the rising edge of Clock (0→1), the IndexRegister performs one of two actions:

  1. If Inc = 1: the stored value is incremented by 1 (Q = Q + 1).
  2. Else if WE = 1: the Data input is loaded into the register (Q = Data).

Priority: Inc takes precedence over WE. If both are 1 on the same clock edge, IX increments rather than loading new data.

Corresponding assembler instructions:

Usage

Used in levels 21–29 for indirect addressing. The IndexRegister holds a memory address. LDAX and STAX instructions use IX as a pointer into RAM, enabling array iteration and data structure access without hardcoded addresses.

Example: to iterate through an array at addresses 16–25, load IX with 16 (LDX), process RAM[IX] (LDAX), increment IX (INX), and repeat until IX reaches 26.