SLIDE 1
CSZone.co.uk
Click to advance · Arrow keys also work
AQA 8525 · Section 3.4 · 3.4.5b

Assemblers
& Bytecode

Low-level Languages · Assembly · Assemblers · Bytecode · Virtual Machines

CSZoneAQA GCSE Computer Science 8525
Levels of Language

From High to Low

High-level language — Python, Java, C++. Abstract, portable, easier to write. Translated by compiler/interpreter.
Assembly language — uses mnemonics (LDA, STA, ADD). One-to-one with machine code. CPU-specific. Translated by assembler.
Machine code — binary (0s and 1s). Only language the CPU understands. Extremely difficult to write directly.
Assembly example:
LDA #5 ; load value 5 into accumulator
ADD #3 ; add 3
STA 200 ; store result at address 200
Assemblers

Converting Assembly to Machine Code

An assembler translates assembly language mnemonics directly into machine code binary. Each mnemonic maps to exactly one machine code instruction. The process is called assembly.
Assembly is faster than high-level languages — closer to hardware, minimal abstraction
But: harder to write, not portable (tied to one CPU architecture)
Used in: device drivers, embedded systems, performance-critical code
Bytecode and Virtual Machines

Java's Middle Ground

Java source code compiles to bytecode — an intermediate, platform-independent format. The Java Virtual Machine (JVM) on each device interprets the bytecode. This means one compiled program runs on any OS with a JVM installed.
"Write once, run anywhere" — Java's motto
Trade-off: slightly slower than native compiled code (JVM overhead)
Exam Practice

Have a go at this question

AQA-style question
Describe the purpose of an assembler.
2 marks
An assembler translates assembly language code (mnemonics) [1] into machine code (binary) that the CPU can execute [1].
Key Takeaways

What to Remember

Language levels: High-level → Assembly → Machine code
Assembler converts assembly mnemonics → machine code (1-to-1 mapping)
Bytecode (Java) = intermediate code run by a Virtual Machine — platform independent
Assembly: fast and low-level but CPU-specific and hard to write