Cambridge O Level Computer Science · Syllabus 2210 · Software
Assembler
What is Assembler?
An assembler is a translator that converts an assembly language program into machine code, replacing each mnemonic with the binary instruction from the processor's instruction set that it stands for.
This definition is part of the Software chapter in Cambridge O Level Computer Science.
Assembler in context
A computer is built in layers, and each layer only works because the layer beneath it is already running. Hardware executes machine instructions and nothing else. Firmware, held in non-volatile memory, starts the hardware and its bootloader loads the operating system. The operating system then manages files, memory, peripherals, users and security, and provides the platform on which application software runs. While all of that is happening, interrupts let an urgent event — a key press, a division by zero — reach the CPU without it having to keep asking. And because a CPU can only execute machine code, every program a person writes must first be put through a translator: an assembler, a compiler or an interpreter.
Assembly language is a form of low-level language that replaces the binary patterns of machine code with mnemonics — short, memorable words such as LOAD, ADD and STORE. Each assembly instruction corresponds closely to one machine operation, and registers and memory locations are referred to explicitly. Assembly language remains processor-specific, and because a CPU cannot execute a mnemonic, an assembler is needed to translate an assembly language program into machine code.
Common mistakes with Assembler
- 7. Treating assembly language as machine code. Why it fails Assembly language uses mnemonics such as LOAD and ADD. A CPU cannot execute a mnemonic. An assembler is needed to translate assembly language into machine code. Fix "Assembly language is written for people to read; machine code is what the processor executes." See section 4.2 D.
- "Assembly language is machine code." Correct model They are different. Machine code is binary and is executed directly. Assembly language uses mnemonics and must be translated by an assembler first. They are closely related — roughly one instruction each — but they are not the same thing. Exam-safe sentence "Assembly language uses mnemonics and must be translated into machine code by an assembler."
- "An assembler translates a high-level language." Correct model An assembler translates assembly language into machine code. High-level languages are translated by a compiler or an interpreter. Exam-safe sentence "An assembler is needed to translate an assembly language program into machine code."
- M12. "High-level code is directly executed by the CPU." Why it fails If it were true there would be no reason for compilers, interpreters or assemblers to exist — and the whole of 4.2 would be unexplainable. Corrected model A CPU executes machine code and nothing else. High-level source must be translated into machine code by a compiler or an interpreter first. Exam-safe sentence "High-level language must be translated into machine code before the CPU can execute it." Show the retrieval checkHide the check Check: What is the only kind of code a CPU can execute?Answer: Machine code — binary instructions from its own instruction set.
- M14. "Assembly language is machine code." Why it fails They are closely related but not the same. A CPU cannot execute the word LOAD; something must replace it with binary first. Corrected model Assembly language uses mnemonics and must be translated by an assembler. Machine code is the binary the CPU executes directly. The correspondence between them is close to one-to-one, which is why they are easy to confuse. Exam-safe sentence "Assembly language uses mnemonics rather than binary, and an assembler is needed to translate it into machine code." Show the retrieval checkHide the check Check: What is the one thing that has to happen to an assembly language program before it can run?Answer: It must be translated into machine code by an assembler.
- M15. "An assembler translates high-level code." Why it fails It names the wrong translator, which is a direct loss of a mark in any question that asks which translator is needed. Corrected model An assembler translates assembly language into machine code. A compiler or an interpreter translates a high-level language. Exam-safe sentence "An assembler is needed to translate an assembly language program into machine code; high-level languages are translated by a compiler or an interpreter." Show the retrieval checkHide the check Check: Match each translator to what it translates: assembler, compiler, interpreter.Answer: Assembler → assembly language. Compiler → a whole high-level program. Interpreter → a high-level program, line by line.
Examiner tips on Assembler
- The one-line test. If a question mentions mnemonics, the answer is an assembler. If it mentions an executable file or distribution, the answer is a compiler. If it mentions testing while writing or stopping at an error, the answer is an interpreter.

