In a load-store architecture, all operands for arithmetic and logical instructions must be in registers. These instructions require coding for each register operand. Most load-store architectures use three operands for arithmetic and logical intructions: two source operands and a destination operand.
In a load-store architecture, load instructions move data from memory to a register and store instructions move data from a register to memory. These instructions require coding for one register operand and one memory operand.
A = B*(C + D)
| Instruction | Code Size | Data | |
|---|---|---|---|
| load | R1, C | 4 (1 + 1/2 + 2) | 4 |
| load | R2, D | 4 (1 + 1/2 + 2) | 4 |
| add | R1, R1, R2 | 3 (1 + 1/2 + 1/2 + 1/2) | 0 |
| load | R2, B | 4 (1 + 1/2 + 2) | 4 |
| mul | R1, R1, R2 | 3 (1 + 1/2 + 1/2 + 1/2) | 0 |
| store | R1, A | 4 (1 + 1/2 + 2) | 4 |
| Total | 22 | 16 | |