Difference between revisions of "Index register"

From Computer History Wiki
Jump to: navigation, search
m (typo)
m (better)
 
Line 5: Line 5:
 
In early computers with index registers (such as the [[IBM 704]] and descendants), they were special registers dedicated to this function; in modern computers, generally any of the machine's [[general register]]s can be used as an index register.
 
In early computers with index registers (such as the [[IBM 704]] and descendants), they were special registers dedicated to this function; in modern computers, generally any of the machine's [[general register]]s can be used as an index register.
  
[[Category: Hardware Basics‎‎]]
+
[[Category: CPU Basics‎‎]]

Latest revision as of 15:16, 15 December 2018

An index register is a register in a CPU which, duing the execution of an instruction, can be added to something else (perhaps a constant in the instruction, or sometimes another register) to produce the address of an operand in main memory.

They are useful for walking along an array, applying some operation to all the elements in it. In early computers, such addresses had to be computed 'manually'; in some very earliest computers, which could not use register contents as an address, it was necessary to use self-modifying code to process an array.

In early computers with index registers (such as the IBM 704 and descendants), they were special registers dedicated to this function; in modern computers, generally any of the machine's general registers can be used as an index register.