CSC 382 · Computer Architecture 1
Our notes
2 min readKinds of instructions
- Data transfer: LOAD, STORE, MOVE, PUSH, POP, IN, OUT.
- Arithmetic: ADD, SUB, MUL, DIV, INC, DEC, NEG.
- Logic and bit: AND, OR, XOR, NOT, shifts and rotates, bit test.
- Control (program flow): unconditional JUMP, conditional branches (on zero, carry, negative), CALL and RETURN, skip.
- System: HALT, interrupt enable and disable, input/output control, no operation (NOP).
Conditional branches and flags
After an operation the ALU sets flags. A branch tests them: "branch if zero" after subtracting two numbers jumps when they are equal. This is how if statements and loops are compiled.
Subroutine calls
CALL saves the return address (on a stack, or in a register or memory word) and jumps to the subroutine; RETURN reloads it. A stack allows calls inside calls and recursion.
Example: SP = 1000, CALL at address 200 (one word long) pushes 201 at 999 (SP becomes 999) and jumps; RETURN pops 201 into PC and SP goes back to 1000.
CISC
Complex instruction set computers (VAX, x86): many instructions (hundreds), many addressing modes, variable instruction lengths, instructions that work directly on memory, microprogrammed control. Aim: short programs and simpler compilers when memory was expensive.
RISC
Reduced instruction set computers (from the early 1980s: Berkeley RISC, Stanford MIPS; today ARM and RISC-V): few simple instructions of fixed length, only LOAD and STORE touch memory, many registers, hard-wired control, designed for pipelining so most instructions finish in one cycle.
Comparison
| CISC | RISC | |
|---|---|---|
| Instructions | many, complex | few, simple |
| Length | variable | fixed |
| Memory operands | in many instructions | only load/store |
| Registers | fewer | many (often 32) |
| Control | often microprogrammed | hard-wired |
| Code size | smaller | larger |
Today the line is blurred: x86 chips translate their instructions into RISC-like micro-operations inside, and ARM (in almost every phone in Nigeria) is RISC.
Exams usually ask
- Classify machine instructions with examples.
- Explain how subroutine calls use a stack.
- Compare CISC and RISC.
Common mistake
Thinking RISC means "fewer abilities". RISC machines run the same programs; they use more, simpler instructions that are faster to execute.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
No reading links here yet
Our team adds free books, videos and practice for each topic, and opens every link before it goes up.