The instruction sets can be differentiated by
The type of internal storage in the CPU is the most basic differentiation. The major choices areOperand storage in the CPU
Number of explicit operands per instruction
Operand location
Operations
Type and size of operands
a stack (the operands are implicitly on top of the stack)
an accumulator (one operand is implicitly the accumulator)
a set of registers (all operands are explicit either registers or memory locations)
| Stack | Accumulator | Register |
| PUSH A | Load A | Load R1,A |
| PUSH B | ADD B | ADD R1,B |
| ADD | Store C | Store C,R1 |
| POP C |
While most early machines used stack or accumulator-style architectures, all machines designed in the past ten years use a general purpose architecture. The reason is the registers are:
faster then memory
easier for a compiler to use
can be used more effectively
| Machine Type | Advantages | Disadvantages |
| Stack | Simple model of expression evaluation. Good code density. | A stack can't be randomly accessed. It makes it difficult to generate efficient code. |
| Accumulator | Minimizes internal state of machine. Short instructions | Since accumulator is only temporary storage, memory traffic is highest. |
| Register | Most general model for code generation | All operands must be named, leading to longer instructions. |
whether an ALU instruction has two or three operands
ADD R3, R1, R2
R3 <-R1 + R2or ADD R1, R2
R1 <- R1 + R2
how many of the operands may be memory addressed in ALU instruction
Register- Register (Load/Store)
ADD R3, R1, R2 (R3 <- R1 + R2)Register - Memory
ADD R1, A (R1 <- R1 + A)Memory - Memory
ADD C, A, B (C <- A + B)