Register–memory architecture
In computer engineering, a register–memory architecture is an instruction set architecture that allows operations to be performed on memory, as well as registers. If the architecture allows all operands to be in memory or in registers, or in combinations, it is called a "register plus memory" architecture.
In a register–memory approach one of the operands for operations such as the ADD operation may be in memory, while the other is in a register. This differs from a load–store architecture in which both operands for an ADD operation must be in registers before the ADD.
Example of Load-Store
;Add mem1 to mem2
mov r1, ; Load first value into register
mov r2, ; Load second value into register
add r2, r1, r2 ; r2 = r1 + r2
mov,r2 ; Store result
Example of register-memory
Some register-memory machines cannot write ALU results to memory, only their registers. This is like an accumulator machine with multiple accumulators:
;Add mem1 to mem2, if add-register-to-memory instructions are not supported
mov r1, ; Load first value into register
add r1, ; Add second value into register
mov, r1 ; Store result
Some register-memory machines are able to write ALU results directly to memory, saving an instruction:
;Add mem1 to mem2, if add-register-to-memory instructions are supported
mov r1, ; Load first value into register
add,r1 ; Add it to second value
Example of register plus memory
;Add mem1 to mem2
add, ; Add first to second value
An example of register-memory architecture that can write ALU results to memory is the Intel x86.
Examples of register plus memory architecture are:
- IBM System/360 and its successors, which support memory-to-memory fixed-point decimal arithmetic operations, but not binary integer or floating-point arithmetic operations;
- PDP-11, which supports memory source and destination operands for most two-operand integer operations;
- VAX, which supports memory or source and destination operands for binary integer and floating-point arithmetic;
- Texas Instruments MSP430 is a rare microcontroller that supports memory source and destination operands for all 24 of its two-operand operations.
- Motorola 68000 series can move data memory-to-memory with nearly all addressing modes. All other integer arithmetic/logic operations require at least one parameter to reside in a register, making it primarily a register-memory machine.