💻 Component 2 · 2.5 Languages & IDEs
2.5.1 Programming Languages
OCR J277 · GCSE Computer Science · ~12 min read · Free lesson
Notes
Video
Slides
Worksheet
Quiz

Levels of Programming Languages

All programs are ultimately executed as machine code — sequences of 0s and 1s that the CPU can directly process. However, writing in machine code is extremely difficult for humans. Programming languages exist on a spectrum from low-level (close to machine code) to high-level (close to human language).

Machine Code

Machine code is the lowest-level language — binary instructions directly executed by the CPU. Each instruction is a pattern of 0s and 1s corresponding to specific CPU operations (fetch, decode, execute).

Example: 10110000 01100001 — meaning depends entirely on the specific processor's instruction set.

  • Advantages: Executes fastest (no translation needed); directly controls hardware; most efficient use of memory.
  • Disadvantages: Very hard to write and read; highly processor-specific (not portable); debugging is extremely difficult; no meaningful variable names.

Assembly Language

Assembly language uses mnemonics (short text codes) to represent machine code instructions. It is a low-level language, but slightly more readable than binary machine code.

MOV AX, 5      ; Move value 5 into register AX
ADD AX, 3      ; Add 3 to AX (result = 8)
MOV [result], AX ; Store AX in memory address 'result'
  • Advantages: More readable than machine code; still directly controls hardware; faster than high-level languages.
  • Disadvantages: Still processor-specific (not portable); requires detailed knowledge of hardware; difficult to write complex programs; must be translated using an assembler.

High-Level Languages

High-level languages use English-like syntax and abstract away the hardware details. Examples include Python, Java, C#, JavaScript, Visual Basic — and OCR J277 pseudocode.

# Python — high-level
result = 5 + 3
print(result) # Output: 8
  • Advantages: Easier to write, read, and debug; uses meaningful variable names; portable — can run on different processors after translation; one line of high-level code = many machine code instructions; faster to develop programs.
  • Disadvantages: Cannot directly control hardware; must be translated (compiled or interpreted) before execution — adds processing overhead; translated code may be less efficient than hand-written assembly.

Comparison Table

FeatureMachine CodeAssemblyHigh-Level
ReadabilityVery low (binary)Low (mnemonics)High (English-like)
PortabilityNone (CPU-specific)None (CPU-specific)High (cross-platform)
Execution speedFastestFastSlower (translated)
Hardware controlFullFullLimited/None
Translator neededNoneAssemblerCompiler/Interpreter
Ease of developmentVery hardHardEasy
Examples01001000...MOV, ADD, SUBPython, Java, C#

Why Use Low-Level Languages?

Despite being harder to write, low-level languages are still used for:

  • Device drivers — need direct hardware control
  • Embedded systems (e.g., washing machine controllers, medical devices) — limited memory, need efficiency
  • Operating system kernels — need access to CPU registers and memory
  • Real-time systems — where every microsecond matters

Mnemonics in Assembly

Common assembly mnemonics tested at GCSE level:

MnemonicMeaning
LDDLoad Direct — load value from memory address into accumulator
STOStore — store accumulator value to memory address
ADDAdd — add value to accumulator
SUBSubtract — subtract value from accumulator
ENDEnd — stop program execution
Exam tip: OCR J277 commonly asks: (1) give two advantages of high-level over low-level — always include portability AND ease of writing/reading; (2) give one advantage of low-level over high-level — execution speed or hardware control; (3) identify which language type a snippet belongs to. High-level code has variable names, English-like syntax. Machine code is pure binary. Assembly has mnemonics like MOV, ADD.
⚠️ Common Mistakes
  • Saying high-level languages "run faster" — they run SLOWER due to translation overhead
  • Saying machine code "needs a compiler" — machine code is directly executed; no translator needed
  • Confusing assembly with machine code — assembly uses mnemonics (text); machine code is binary (0/1)
  • Saying assembly is portable — it is NOT; assembly is CPU-specific just like machine code
  • Giving only one advantage when the question asks for two — always re-read the mark allocation
✅ Notes completed!
Video coming soon
Click slide or press arrow keys to navigate

Worksheet — 2.5.1 Programming Languages

8 questions · 20 marks

Q1State two advantages of high-level languages over low-level languages.[2]
✅ Mark scheme
Any two from: Easier to read and write (uses English-like syntax) [1]; Portable — can run on different processors/platforms after translation [1]; Easier to debug (meaningful variable names) [1]; Faster to develop programs [1]; One line produces many machine code instructions [1].
Q2Give two advantages of using machine code or assembly language over high-level languages.[2]
✅ Mark scheme
Any two from: Faster execution (no translation needed at runtime) [1]; Direct control over hardware (registers, memory addresses) [1]; More memory-efficient (no overhead from translation) [1]; Used where performance is critical (e.g. device drivers, embedded systems) [1].
Q3Explain what is meant by a 'mnemonic' in assembly language. Give one example.[2]
✅ Mark scheme
A mnemonic is a short text code (abbreviation) that represents a machine code instruction [1]. It is easier to remember and read than binary. Example: ADD (add), MOV (move value), SUB (subtract), LDD (load from memory), STO (store to memory) — any one valid example [1].
Q4Why is machine code described as 'processor-specific'? What problem does this create?[2]
✅ Mark scheme
Machine code instructions are specific to the CPU's instruction set — different processors use different binary codes for the same operation [1]. Problem: a program written for one processor cannot run on a different type of processor without rewriting it from scratch (not portable) [1].
Q5A programmer is writing software for an embedded system in a pacemaker. Explain why they might choose to use assembly language rather than a high-level language.[3]
✅ Mark scheme
Assembly language executes faster than high-level languages as no translation is needed at runtime [1]. A pacemaker has very limited memory, and assembly produces smaller, more efficient code [1]. Direct hardware control is needed to precisely control timing of electrical pulses — high-level languages cannot access hardware directly [1].
Q6Identify the level of language (machine code / assembly / high-level) for each snippet: (a) 10110000 01100001 (b) MOV AX, 5 (c) result = 5 + 3[3]
✅ Mark scheme
(a) Machine code [1] — binary digits (0s and 1s), directly executed by CPU. (b) Assembly language [1] — uses mnemonics (MOV). (c) High-level language [1] — English-like syntax, meaningful variable name 'result'.
Q7Explain what is meant by 'portability' in the context of programming languages.[2]
✅ Mark scheme
Portability means a program can be run on different types of computers/processors [1] without needing to be rewritten. High-level language programs are portable because the translator (compiler/interpreter) handles the conversion to processor-specific machine code [1].
Q8A student says "high-level languages run faster than assembly because they are easier to write." Identify the error and correct it.[4]
✅ Mark scheme
Error: High-level languages do NOT run faster than assembly [1]. Correction: Assembly (and machine code) runs faster because the CPU executes the code directly without needing to translate it first [1]. High-level languages must be compiled or interpreted into machine code before execution, adding overhead [1]. The student has confused 'ease of writing' with 'execution speed' — these are different things [1].
?
out of 20 — self-mark above
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 9
Click to reveal definition
🎉
Complete!
TermDefinition
🎯

Mini Test — 2.5.1 Programming Languages

10 questions · 17 marks · 10 minutes

← 2.4.1b Logic Circuits 2.5 Languages & IDEs 2.5.2a IDEs →