Abstract
- A set of Instruction which contains Opcode & parameters that tells CPU what to do. You can check the ISA of a machine using
uname -mp
Portability
The exact hardware implementation of different CPU can vary but app written for X86 ISA can be run on all the CPU that implements the X86. The ISA functions like a standard that different hardware implementations need to follow, so software has a common interface to work with different CPUs.
RISC
- Stands for Reduced Instruction Set Computer
- Simplified Instruction that can complete in one Clock Cycle
- Fewer possible Instruction
- Doesn’t perform any Operation directly on Main Memory
Easier to Decode
Each Instruction is fixed-sized.
Power-Efficient
Needs fewer Transistors (晶体管) to perform simple Operation.
Tedious
Complex Computation requires more Instructions to achieve.
Common RISC
aarch64 / arm64
- Modern, 64-bit ARM processors
arm / armv5l
- Older 32-bit ARMv5 processors. Less common in modern devices
armv7l
- Targets 32-bit ARMv7 processors
RISCV
- A standard that is competing with arm
MIPS
- Refer to MIPS, usually used for educational purposes
CISC
- Stands for Complex Instruction Set Computer
- Very Complex set of Instruction
- Can take multiple Clock Cycle to execute
Simpler to use
Has many Instruction, complex Computation can be performed with just one Instruction.
Requires more transistors
The design of CPU needs to be complex to achieve complex computation with fewer Instruction, so less Transistors (晶体管) can be used improve overall computing performance. Thus, more power-hungry, and more wasted power when performing simple instruction.
Harder to decode
Each Instruction is Variable-length.
Common CISC
X86
- Developed by Intel
x86-64
- The 64bits version of X86
AMD64
- 64-bit extension of the x86, created by AMD
i486
- A 32-bit x86 processor released by Intel in 1989, very outdated and mostly found in retro computing or embedded systems with minimal requirements.
i686
- Intel’s 6th generation x86 processor introduced in 1995. It designates a baseline of features present in most modern x86 processors (both Intel and AMD)
Accumulator ISA
load A
: Load value from Main Memory into accumulatoradd B
: Add value from Main Memory and value in the accumulator. The sum is stored back to the accumulatorstore C
: Store value in accumulator into Main Memory
Load-Store ISA
- Also known as Register-Register ISA
- The data is decoupled from the Register to Main Memory
Data Loading
Can only load data at Word boundaries.
Memory-Memory ISA
Stack ISA
push A
,push B
: We load values from Main Memory onto the Stackadd
: Remove the top 2 values in the Stack, add them, and load the sum onto top of Stackpop C
: Transfer value at top of Stack to Main Memory