Programmers can write in languages that read almost like English, or in codes that match the processor's own instructions one for one. Learn what high-level and low-level languages are, where assembly language fits, and the advantages and disadvantages of each.
A high-level language (such as Python, Java or Visual Basic) uses English-like statements, so it is easy to read, write and debug and is machine independent: the same program can run on different types of processor once translated. A low-level language is close to the processor's own instructions: machine code (binary) and assembly language, which uses short mnemonics such as LDD and ADD. Low-level code is hard to read and debug and is machine dependent, but allows direct manipulation of the hardware. Assembly language needs an assembler to translate it into machine code.
Fig. 1: the same calculation as high-level code, assembly language and machine code (illustrative opcodes)
Section 01
High-level languages.
High-level languages are designed for people. One statement can stand for many machine code instructions.
DECLARE Price : REAL
DECLARE Tax : REAL
DECLARE Total : REAL
INPUT Price
Tax ← Price * 0.2
Total ← Price + Tax
IF Total > 100
THEN
OUTPUT "Free delivery"
ENDIF
Easy to read and write: uses English-like keywords and meaningful identifiers such as Total.
Easier to debug: errors are easier to find, and the translator can report them in readable terms.
Machine independent (portable): the same source code can be translated to run on different processors.
But: it cannot directly manipulate hardware, and the translated code may be less efficient (larger, slower) than well-written low-level code.
Examiner trap
"High-level is easier" is too vague for a mark. Say why: it uses English-like statements, so it is easier to read, write and debug.
Section 02
Low-level: machine code and assembly.
The processor only executes machine code: binary instructions, each made of an opcode and an operand. Assembly language writes each machine code instruction as a short mnemonic instead.
Assembly (mnemonic)
Meaning
LDD 200
load the value stored at address 200 into the accumulator
ADD 201
add the value stored at address 201 to the accumulator
STO 202
store the accumulator's value at address 202
Mnemonics: short memorable codes (LDD, ADD, STO) that are easier to remember than binary opcodes.
Assembler: assembly language must be translated into machine code by an assembler before it can run. Usually one assembly instruction becomes one machine code instruction.
Machine code: needs no translation, but it is very hard for people to read, write or debug.
Examiner trap
Assembly language is low-level, even though it uses letters. It still matches the processor's instructions one for one, and it still needs an assembler.
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
Which is an advantage of a high-level language?
Quick check+10 XP
What is a mnemonic in assembly language?
Quick check+10 XP
What translates assembly language into machine code?
Quick check+10 XP
Which language does the processor execute directly?
Section 03
Which level, and why?
Exam questions give a scenario and ask which type of language to use. Match the scenario to the advantages.
High-level
Low-level
Ease of reading and writing code
easy: English-like
hard: mnemonics or binary
Ease of debugging
easier
harder
Machine independence
yes: portable to different processors
no: written for one type of processor
Direct manipulation of hardware
no
yes: e.g. specific registers and memory addresses
Translator needed
compiler or interpreter
assembler (assembly); none (machine code)
Worked example Choose a language
A programmer is writing a driver that must control a new graphics card's registers as fast as possible. Another is writing a school timetable app that must run on Windows and macOS. Which type of language should each use?
The driver needs direct manipulation of the hardware and efficient code: a low-level language (assembly).
The app must run on different machines and be easy to maintain: a high-level language, which is machine independent and easier to write and debug.