UNIHIVE

Study Hub UNIPORT CSC 382

CSC 382 · Computer Architecture 1

Machine instruction sets: types, CISC and RISC

The kinds of instructions every machine has, how branches and calls work, and the CISC against RISC debate.

Our notes

2 min read

Kinds of instructions

  1. Data transfer: LOAD, STORE, MOVE, PUSH, POP, IN, OUT.
  2. Arithmetic: ADD, SUB, MUL, DIV, INC, DEC, NEG.
  3. Logic and bit: AND, OR, XOR, NOT, shifts and rotates, bit test.
  4. Control (program flow): unconditional JUMP, conditional branches (on zero, carry, negative), CALL and RETURN, skip.
  5. 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

CISCRISC
Instructionsmany, complexfew, simple
Lengthvariablefixed
Memory operandsin many instructionsonly load/store
Registersfewermany (often 32)
Controloften microprogrammedhard-wired
Code sizesmallerlarger

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.

All CSC 382 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.