Difference between revisions of "General register"
(An OK start) |
m (→See also: +1) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
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 [[compiler]]s, which often had to chose which variables to keep in registers (as opposed to in [[main memory]], in [[automatic variable]]s on the [[stack]]). Almost all modern machines have many general registers - in some cases, large numbers of them. | 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 [[compiler]]s, which often had to chose which variables to keep in registers (as opposed to in [[main memory]], in [[automatic variable]]s on the [[stack]]). Almost all modern machines have many general registers - in some cases, large numbers of them. | ||
− | {{stub}} | + | {{semi-stub}} |
+ | |||
+ | ==See also== | ||
+ | |||
+ | * [[Register renaming]] | ||
+ | |||
+ | [[Category: CPU Basics]] |
Latest revision as of 20:27, 8 April 2021
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.