1. Computer Architecture
IGCSE Computer Science (0478)
  • Chapter 6: Automated & Emerging Technologies
  • Data Representation
    • Introduction
    • Why computers use binary (how binary represents data)
    • Number system
      • Introduction
      • Number Conversions
      • Addition of Binary Numbers
      • Logical binary shifts (positive 8-bit integers)
      • Two’s Complement (Signed: Positive and Negative Numbers)
      • Use of the Hexadecimal System
    • Text, Sound and Image
      • Text, Sound and Images
      • File Types
    • Data storage and File compression
      • Measurement of the Size of Computer Memories
      • Lossless and Lossy File Compression
  • Hardware
    • Computer Architecture
      • The CPU & Microprocessors
      • Von Neumann Architecture
      • Fetch-Decode-Execute Cycle (FDE)
      • Characteristics of the CPU
      • CPU Instruction Sets
      • Embedded Systems
    • Input/output devices
      • Input devices
      • Output devices
      • Sensors
    • Data Storage
      • What is Primary Storage?
      • What is Secondary Storage?
      • What is Virtual Memory?
      • What is cloud storage?
    • Network hardware
      • What is a Network Interface Card(NIC)?
      • MAC Addresses & IP Addresses
      • What is a Router?
  1. Computer Architecture

CPU Instruction Sets

CPU Instruction Sets#


1. What is an Instruction Set?#

An instruction set (also called an Instruction Set Architecture / ISA) is the complete collection of machine code instructions that a CPU is designed to understand and execute.
Every CPU has its own instruction set built into its hardware.
Programs must be translated into the CPU's specific instruction set before they can run.
Different processors (e.g., Intel x86, ARM) have different instruction sets.

2. Machine Code & Assembly Language#

Machine Code#

The only language a CPU can directly execute.
Consists entirely of binary digits (0s and 1s).
Extremely difficult for humans to read or write.

Assembly Language#

A low-level language that uses mnemonics (short text codes) to represent machine code instructions.
Each mnemonic maps directly to one machine code instruction.
Converted to machine code by a program called an Assembler.
Assembly MnemonicMeaning
LDDLoad (direct addressing)
STOStore a value in memory
ADDAdd a value
SUBSubtract a value
INCIncrement (add 1)
DECDecrement (subtract 1)
JMPJump to an address (unconditional)
JPEJump if equal
JPNJump if not equal
CMICompare (immediate)
ENDEnd of program

3. Structure of an Instruction#

Each instruction in an instruction set is made up of two parts:
[ OPCODE ] [ OPERAND ]
PartDescription
OpcodeTells the CPU what operation to perform (e.g., ADD, LOAD, JUMP)
OperandTells the CPU what data or address to use

Example:#

ADD 005
Opcode → ADD (perform addition)
Operand → 005 (the memory address or value to add)

4. Types of Instructions#

An instruction set typically includes instructions from these categories:

🔵 Data Transfer#

Move data between memory and registers.
LDD 050 — Load the value at memory address 050 into the Accumulator
STO 050 — Store the Accumulator's value into memory address 050

🔵 Arithmetic Operations#

Perform mathematical calculations.
ADD 010 — Add the value at address 010 to the Accumulator
SUB 010 — Subtract the value at address 010 from the Accumulator
INC ACC — Increase the Accumulator by 1
DEC ACC — Decrease the Accumulator by 1

🔵 Comparison & Branching (Jump Instructions)#

Control the flow of a program.
CMI 5 — Compare the Accumulator with the immediate value 5
JMP 020 — Jump unconditionally to address 020
JPE 030 — Jump to address 030 if the comparison result was equal
JPN 040 — Jump to address 040 if the comparison result was not equal

🔵 I/O Instructions#

Handle input and output.
IN — Input a value (store in Accumulator)
OUT — Output the value in the Accumulator

🔵 Stop#

END — Terminates the program

5. Addressing Modes#

Direct Addressing#

The operand is the memory address where the data is stored.
LDD 050 → Load the value stored AT address 050

Immediate Addressing#

The operand is the actual data value (not an address).
LDM #25 → Load the actual value 25 into the Accumulator
Tip: A # symbol before the operand usually indicates immediate addressing.

6. The Accumulator (ACC)#

A special register inside the CPU used to hold the result of arithmetic/logic operations.
Most instructions in the CIE instruction set read from or write to the Accumulator.

7. Worked Example — Simple Assembly Program#

Task: Add two numbers stored in memory and save the result.
AddressInstructionComment
000LDD 050Load value at address 050 into ACC
001ADD 051Add value at address 051 to ACC
002STO 052Store result into address 052
003ENDEnd the program
Memory:
AddressValue
05012
0518
052(result = 20)

8. Key Vocabulary#

TermDefinition
Instruction SetThe full set of binary instructions a CPU can execute
Machine CodeBinary instructions directly executed by the CPU
Assembly LanguageLow-level language using mnemonics; converted by an Assembler
AssemblerA program that translates assembly language into machine code
OpcodeThe part of an instruction specifying the operation to perform
OperandThe data or address the opcode acts upon
Accumulator (ACC)A CPU register used to store results of operations
MnemonicA short, memorable code representing a machine code instruction

9. Exam Tips ✅#

Know the difference between opcode and operand.
Be able to trace a short assembly program and state the value in the Accumulator at each step.
Remember that each CPU has its own unique instruction set — programs must be compiled/assembled for the target CPU.
# before a number = immediate (the number itself); no # = direct (a memory address).
Machine code is in binary; assembly uses mnemonics — do not confuse them.
Modified at 2026-04-03 09:46:55
Previous
Characteristics of the CPU
Next
Embedded Systems
Built with