GCSE · Computer Science · AQA · Spec 8525
Assembler
Your processor can't read LDA or ADD, only binary. So how does a program written in words ever run? Meet the simplest translator, and keep count.
Computer Science · Translators
Watch an assembler work
Here's the deal. A processor can only run machine code: instructions written in binary. Assembly language is the same kind of instructions written as short readable names called mnemonics, like LDA and ADD. The assembler is the translator that swaps one for the other.
Before you press Next: this program has 4 assembly lines. How many machine code instructions will the assembler hand to the processor? Commit to a number.
1 LDA 62 ADD 73 STO 84 HLT
Variables
Output
0001 0110
Step 1: LDA 6 means 'load the value at address 6'. LDA is the mnemonic; 6 is the operand, the address it works on. The assembler swaps this one line for one instruction: 0001 is the code for LDA on this made-up processor, and 0110 is 6 in binary.
Press Next. The chips count lines read and instructions written, and the Output box is the machine code program growing, one instruction per line.
Predict, then check
You've just watched an assembler handle one line at a time. Now put two very different lines through translation.
ADD 7 is one line of assembly language. total = a + b is one statement of high-level code. Both get translated into machine code. How many machine code instructions does each one become?
Assembly and the processor
Reason it through
Why will a program written in assembly language generally only run on one type of processor?
First link · your turn
Every assembly instruction stands for one machine code instruction. Whose machine code instructions, though?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
The simplest translator of all, and why high-level code needs a different one.
What you need to know
- A processor can only run machine code: binary instructions it executes directly.
- Code in any other language has to be translated into machine code before the processor can run it.
- Assembly language is low-level: each instruction is a short mnemonic, like LDA, ADD or STO, plus an operand.
- Mnemonics are much easier for a person to read and write than rows of binary.
Have a goYour friend insists: 'LDA 6 is basically binary already, so the processor can just run it.' Put them right in one line.
LDA is letters, not binary, so it has to be translated into machine code first.
A mnemonic is a readable name that makes life easier for people; the processor only runs binary instructions, so looking close to machine code isn't the same as being it.
- An assembler is the translator that turns an assembly language program into equivalent machine code.
- Each assembly instruction becomes exactly one machine code instruction, so lines in equals instructions out.
Have a goAsha's assembly program has 7 instructions. She reckons the assembler will hand the processor 7 machine code instructions. Right or wrong?
Right: 7 in, 7 out.
An assembler swaps each instruction for exactly one machine code instruction; it never merges lines together or expands one line into several.
- One high-level statement usually becomes several machine code instructions, so high-level code needs a compiler or interpreter instead.
- Assembly is written for one processor's instruction set, so its machine code generally only runs on that type of processor.
Have a goA program is assembled for one type of processor. Predict: will the same machine code generally run on a processor of a different type?
Generally not.
The machine code is made from the first processor's instruction set; the other type has a different one. It's not about mnemonics, which the processor never sees.
- Assembler, compiler and interpreter are the three kinds of translator; only the assembler works on assembly code.
The big picture
An assembler translates assembly language into machine code, swapping each assembly instruction for exactly one machine code instruction for one type of processor. Compilers and interpreters translate high-level code instead, where one statement becomes several machine code instructions.
Key points
Worked example
Problem
A made-up processor uses these 4-bit codes: LDA = 0001, STO = 0011, HLT = 1111. An address is written as 4-bit binary, and HLT has no address so its address half is 0000. Assemble this program, then say how many lines go in and how many machine code instructions come out. LDA 5 STO 9 HLT
⚠ Watch out
Treating assembly language as machine code, or the assembler as just another compiler. Tempting, as assembly looks so close. But assembly is the readable form; machine code is the binary the processor runs. An assembler swaps one line for one instruction; a compiler or interpreter turns one high-level statement into several.
Memory hook
ONE in, ONE out. An assembler is like a phrasebook that swaps each word for exactly one word. (The picture breaks at one point: an assembler swaps into binary, for one type of processor.)
Check yourself
No peeking: what goes into an assembler, what comes out, and why won't it generally run on another type of processor? (Assembly in, machine code out; different instruction set.)
Flashcards
(11)What is the only kind of code a processor can run?
What is a mnemonic?
What is assembly language?
What does an assembler do?
How many machine code instructions does one assembly instruction become?
What does a compiler or interpreter do with one high-level statement?
Name the three kinds of translator.
Which translator takes assembly language as its input?
In LDA 6, which part is the operand?
What is an instruction set?
Why does assembly generally run on only one type of processor?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 29 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.