In simple terms
A friendly intro before the formal notes — no formulas yet.
From Human to Hardware
Assembly language acts as a bridge between human-readable instructions and the raw binary code a CPU understands. An assembler translates these simple commands, called mnemonics, directly into machine code for the processor to execute.
Imagine you're instructing a robot chef. A high-level language is like saying, 'Bake a cake.' Assembly language is the detailed, step-by-step recipe: 'Pick up egg. Crack egg into bowl. Pick up whisk. Whisk for 30 seconds.' Each command corresponds to one specific, basic action the robot can perform.
- 1
Assembly uses mnemonics readable by humans (LDR, ADD, STR).
- 2
An assembler translates each mnemonic to a machine code opcode (1:1).
- 3
Special registers like the Accumulator (ACC), Index Register (IX), and Program Counter (PC) manage data and program flow.
- 4
The Fetch-Decode-Execute cycle runs each instruction, directly controlling the CPU.
Explore the concept
Use the live diagram and synced steps — play it or tap a step card to walk through.
Key formulas
Tap any symbol to reveal exactly what it means and its units.
$Effective\ Address_{Indexed} = Base\ Address + [IX]$
Full topic notes
Formal explanation with the rigour you need for the exam.
What is Assembly Language?
Assembly language is a low-level programming language specific to a particular computer architecture. Unlike machine code, which consists of binary or hexadecimal digits, assembly language uses human-readable abbreviations called mnemonics to represent fundamental CPU operations. For example, instead of remembering the binary code 01101011, a programmer can write ADD.
The key characteristic of assembly language is its one-to-one correspondence with machine code. Each assembly instruction translates directly into a single machine code instruction. This provides direct control over the hardware, including the CPU registers and memory locations, but makes the code less portable than high-level languages.
The Assembler: From Mnemonic to Machine Code
An assembler is a utility program that translates assembly language source code into executable machine code, known as object code. This process is much simpler than the compilation of a high-level language because of the one-to-one mapping. The assembler's main job is to substitute mnemonics with their corresponding opcodes and resolve symbolic addresses (labels) into actual memory addresses.
Many assemblers perform a 'two-pass' process. In the first pass, the assembler reads the source code to build a symbol table, which lists all the labels and their corresponding memory addresses. In the second pass, it uses this table to translate the instructions and operands into machine code, generating the final object file.
Translates mnemonic opcodes into their machine code equivalents.
Translates symbolic addresses (labels) into absolute memory addresses.
Converts data constants into their internal machine representation.
Writes the resulting object code and an assembly listing.
The Cambridge A-Level Instruction Set
For your exam, you need to be familiar with a specific set of assembly instructions. These can be grouped by their function:
Data Transfer: Move data between registers and memory. (LDR, LDM, LDI, LDX, STO)
Arithmetic Operations: Perform calculations. (ADD, INC)
Comparison: Compare the value in the Accumulator with an operand. (CMP) This sets flags for conditional jumps.
Conditional Jumps: Jump to a different part of the program if a condition is met. (JPE, JPN, JMP)
Input/Output: Read data from an input device or write data to an output device. (IN, OUT)
You are not expected to memorise the binary opcodes for instructions. The exam will always provide the necessary instruction set. Your task is to understand what each instruction does and be able to trace the execution of a program step-by-step, tracking the contents of registers (ACC, IX) and memory.
Addressing Modes: Finding the Data
An addressing mode specifies how the operand of an instruction is interpreted. The Cambridge syllabus focuses on three main types:
Effective\ Address_{Indexed} = Base\ Address + [IX]
Immediate Addressing (#): The operand is the actual value. ADD #15 means 'add the number 15 to the Accumulator'.
Direct Addressing: The operand is a memory address. ADD 15 means 'go to memory address 15, get the value stored there, and add that value to the Accumulator'.
Indexed Addressing (,X): The effective address is found by adding the contents of the Index Register (IX) to a base address. LDR 200,X means 'load the value from memory address (200 + value in IX)'. This is extremely useful for processing arrays.
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
Trace the following assembly program. Assume memory is initially all zeros. What is the final value stored in memory location 502?
- 1
LDM #10: Immediate addressing. The value 10 is loaded directly into the Accumulator (ACC). ACC is now 10.
A program needs to find the largest number in a list of three numbers stored at memory addresses 200, 201, and 202. The values are: M[200]=7, M[201]=12, M[202]=5. Trace the program and state the final value in the Accumulator.
- 1
// Program Code LDX #0 // Initialise Index Register to 0 LDR 200,X // Load first number into ACC LOOP: INC X // Increment Index Register CMP 200,X // Compare ACC with next number JPE ENDLOOP // If equal, no change needed JPN ENDLOOP // If ACC is greater, no change LDR 200,X // If new number is greater, load it ENDLOOP: CMP X,#2 // Have we checked all numbers? JPN LOOP // If IX < 2, loop again END
How it all connects
The big idea sits in the middle — tap a linked idea to explore the link.
Tap a linked idea to see how it connects back to the main topic — that connection is what examiners reward.
Glossary
Try to recall each definition before you reveal it.
Quick check
Answer in your head first — then tap to check. No pressure.
Revision flashcards
Flip the card. Test yourself before the exam.
Mnemonic
A short, memorable abbreviation for an assembly language instruction, representing a machine operation. For example, LDR for 'Load Register'.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
Translates mnemonic opcodes into their machine code equivalents.
- ✓
Translates symbolic addresses (labels) into absolute memory addresses.
- ✓
Converts data constants into their internal machine representation.
- ✓
Writes the resulting object code and an assembly listing.
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Test Your Knowledge on Assembly Language
Test Your Knowledge on Assembly Language
Extra simulations & links
PhET, GeoGebra and other curated tools — open in a new tab.
Frequently asked
Checkpoint
One marked question is worth ten re-reads — close the loop before you move on.
Reading it isn’t knowing it — prove it.
Before you move on: do Test Your Knowledge on Assembly Language on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.