Difference between revisions of "General register"

From Computer History Wiki
Jump to: navigation, search
m (right cat)
m (+cat)
Line 6: Line 6:
  
 
{{semi-stub}}
 
{{semi-stub}}
 +
 +
[[Category: Hardware Basics‎‎]]

Revision as of 04:16, 13 December 2018

A general register is a register in a CPU which can be used for any purpose: for use in a calculation; as a pointer, to hold an address; as an index register, etc.

Early computer architectures often had only a single register, the accumulator (because the vacuum tubes from which the logic of those machines were constructed were bulky and expensive); in some cases, it could not even be used as a pointer, and self-modifying code has to be resorted to. After that, additional registers tended to be specialized (e.g. index registers).

It was only later that it became clear that a pool of registers which could be used for any function would be of value, especially for compilers, which often had to chose which variables to keep in registers (as opposed to in main memory, in automatic variables on the stack). Almost all modern machines have many general registers - in some cases, large numbers of them.