Operands may be defined explicitly or implicitly:
- In a stack architecture, all arguments are defined implicitly.
- In an accumulator architecture, one argument is implicitly the accumulator, and the other is explicit.
- General-purpose register architectures use only explicitly defined arguments.
Classifying Instruction Set Architectures
Info
In the following examples,
a,bandcrefer to memory locations.Rn() refers to a register
Stack-Based ISA
Instructions do not take any explicit arguments, or specify a destination. Instead, arguments will be popped from the stack, and the result will be pushed to the stack. For example:
PUSH a
PUSH b
ADD
POP cAccumulator-Based ISA
Instructions take one argument, typically a memory location, and apply the operation between this value and the value in the accumulator. The result will then be stored in the accumulator. For example:
LDA a
ADD b
STA cRegister-Memory ISA
Instructions take a destination register, and two operands - one is a register and the other a memory location. For example:
LDR R1, a
ADD R3, R1, b
STR R3, cAdvantages:
- Data can be accessed without a separate load instruction.
- Simple instruction encoding.
- Quite high instruction density.
Disadvantages:
- Number of clock cycles required varies by operand location.
Register-Register (Load-Store) ISA
The destination and all operands are specified as registers. For example:
LDR R1, a
LDR R2, b
ADD R3, R1, R2
STR R3, cAdvantages:
- Simple instruction encoding.
- Instructions are of similar complexity.
Disadvantages:
- Requires more instructions.
CISC vs RISC
Reduced Instruction Set Computer (RISC) architecture uses only a small number of simple, fast instructions:
- Requires more work from the compiler to translate high-level code.
- Requires more instructions, and therefore more storage space/memory.
- Requires only a single clock cycle to execute each instruction.
- Instructions are of a fixed size.
Complex Instruction Set Computer (CISC) architecture has more instructions, and the ability to execute complex operations using a single instruction:
- Requires more complex hardware.
- Complex instructions may require many clock cycles to complete.
- Instructions do not have a fixed size.
- Requires comparatively little memory due to fewer instructions required.