Register–memory architecture
Computer instruction set architecture
In computer engineering, a register–memory architecture is an instruction set architecture that allows operations to be performed on (or from) 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 (used by RISC designs such as MIPS) in which both operands for an ADD operation must be in registers before the ADD.
Example of Load-Store (RISC)
;Add mem1 to mem2 mov r1, [mem1] ; Load first value into register mov r2, [mem2] ; Load second value into register add r2, r1, r2 ; r2 = r1 + r2 mov [mem2],r2 ; Store result
Example of register-memory (CISC)
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, [mem1] ; Load first value into register add r1, [mem2] ; Add second value into register mov [mem2], 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, [mem1] ; Load first value into register add [mem2],r1 ; Add it to second value
An example of register-memory architecture that can write ALU results to memory is the Intel x86.
Example of register plus memory (CISC)
;Add mem1 to mem2 add [mem2],[mem1] ; Add first to second value
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 (or register) source and destination operands for most two-operand integer operations;
- VAX, which supports memory or (or register) source and destination operands for binary integer and floating-point arithmetic;
- Texas Instruments MSP430 is a rare microcontroller that supports memory (or register) 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.
Adapted from the Wikipedia article, CC BY-SA 4.0. Continue on Wikipedia
Go deeper
Ideas this article links to.
- Addressing modeAspect of the instruction set architecture of CPUs
- MicrocontrollerSmall computer on a single integrated circuit
- Computer engineeringEngineering discipline specializing in the design of computer hardware
- TI MSP430Mixed-signal microcontroller family
- Instruction set architectureModel that describes the programmable interface of a computer processor