GCSE · Computer Science · AQA · Spec 8525

Assembler

A processor can't read a word of our programs, only binary. So how do names like LDA and ADD ever run? Watch the simplest translator do it, and count.

Computer Science · Translators

Watch an assembler work

A processor can only run machine code, which is instructions written in binary. Assembly language is the same kind of instructions written as short readable names called mnemonics, such as LDA and ADD. The assembler is the translator that swaps one for the other.

Predict before you press Next: this program has 4 assembly lines. How many machine code instructions will the assembler hand to the processor?

1 LDA 6
2 ADD 7
3 STO 8
4 HLT

Variables

assembly lines read=1machine instructions written=1

Output

0001 0110

Step 1: LDA 6 means 'load the value at address 6'. LDA is the mnemonic and the 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.

1 / 4

Press Next. The chips count lines read and instructions written, and the Output box is the machine code program growing, one instruction per line.

Step 1 of 4: LDA 6 means 'load the value at address 6'. LDA is the mnemonic and the 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..

Watch out: The binary codes here belong to a made-up processor, so they are only for illustration. A real processor has its own codes. What carries over is the count: one assembly line, one machine code instruction.

Predict, then check

You have just seen what an assembler does to one line. 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 are translated into machine code. How many machine code instructions does each one become?

Computer Science · Translators

Three translators, one grid

Tick the cells you think are true for each translator, then check your grid. Read down each column to see what is special.

Assembler
Compiler
Interpreter

Assembly and the processor

?

Reason it through

Why will a program written in assembly language generally only run on one type of processor?

Link 1 of 4

First link · your turn

Every assembly instruction stands for one machine code instruction. Which processor's machine code instructions does it stand for?

2
Locked — reveal the link above first
3
Locked — reveal the link above first
4
Locked — reveal the link above first

Computer Science · Translators

Which idea is closest to yours?

A student has written LDA 6, ADD 7, STO 8, HLT in assembly language and is about to run it on the processor.

Which of these is closest to what you think happens?
How sure are you?

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, which is binary.
  • Assembly language is a readable form of machine code, written with mnemonics such as LDA, ADD and STO.
  • An assembler translates assembly language into machine code, with exactly one machine code instruction for each assembly instruction.
  • A compiler or interpreter translates high-level code, and one high-level statement becomes several machine code instructions.
  • Assembly language is written for one type of processor, so its machine code generally only runs on that type.

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

1The processor runs only machine code, instructions written in binary.
2Assembly language uses mnemonics, which are readable names for machine code instructions.
3An assembler swaps each assembly instruction for exactly one machine code instruction, so lines in equals instructions out.
4A compiler or interpreter turns one high-level statement into several machine code instructions, which is why high-level code needs one of them and not an assembler.
5Assembly language is written for one type of processor's instruction set, so assembled code generally only runs on that type of processor.

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 if it were machine code, or treating the assembler as just another compiler. Assembly is the readable form and machine code is the binary the processor runs. The assembler swaps one line for one instruction, where 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

An assembly program has 9 lines: how many machine code instructions result? Same answer for 9 high-level statements? Answer: 9; no, each statement becomes several.

Flashcards

(11)
What is the only kind of code a processor can run?
Machine code, which is instructions written in binary.
What is a mnemonic?
A short, readable name for a machine code instruction, such as LDA, ADD or STO.
What is assembly language?
A readable form of machine code, written with mnemonics and operands. It has to be translated before the processor can run it.
What does an assembler do?
It translates assembly language into machine code.
How many machine code instructions does one assembly instruction become?
One. Lines in always equals instructions out.
What does a compiler or interpreter do with one high-level statement?
It turns it into several machine code instructions.
Name the three translators from this lesson.
The assembler, the compiler and the interpreter.
Which translator takes assembly language as its input?
The assembler. Compilers and interpreters take high-level code.
In LDA 6, which part is the operand?
The 6, which is the address the instruction works on. LDA is the mnemonic.
What is an instruction set?
The set of machine code instructions that a particular type of processor can run.
Why does assembly generally run on only one type of processor?
It is written for that type's instruction set, and a different type of processor has a different instruction set.

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 posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

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 2 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.