Computer register
Appearance
The very earliest computers were designed to use a small set of special memory locations, within the CPU, generally known as computer registers.
Those early registers included:
| register name |
use |
|---|---|
| accumulator | the early computers had just one place where arithmetic calculation could take place -- the accumulator. |
| instruction pointer | pointed to the memory location of the instruction currently being executed. Normally this register would be incremented by one, so the next instruction would be executed. |
| stack pointer | computer programs make use of subroutines. Their instruction sets began to contain a CALL instruction, which specified the first instruction in the subroutine that was being called. Each time a subroutine was called the current value of the instruction pointer was popped onto the top of a stack of addresses. When a subroutine got to its last instruction, it would be a RETURN, which would replace the value in the instruction pointer with the value pointed to by the stack pointer, and the stack pointer would be decremented by one. This allowed subroutines to call other subroutines. |
| status registers | the status registers, each just on or off, were each devoted to a single measure, like, was the value of the last arithmetic operation a zero, had an external device signalled an interrupt. |
More complicated computers added multiple accumulators.
More complicated computers allowed programs to push other things on the stack, when subroutines were called, and to reserve space on the stack for the each instance when a subroutine was called to have its own local data space for local variables.
More complicated computers allowed for more status registers, to distinguish between different kinds of hardware interrupts.