General register

From Computer History Wiki
Revision as of 15:13, 18 October 2018 by Jnc (talk | contribs) (right cat)
Jump to: navigation, search

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.