Low and High Level Languages
An instruction set is the collection of instructions that a particular processor can execute. Each instruction does one tiny job, such as adding two values, comparing two values or jumping to a different part of a program. The processor can carry out nothing that is not in its own set, so the set is the limit of what the hardware can do. A small processor inside a car park barrier might have an instruction set of a few dozen entries, while the processor in a laptop has hundreds.
Processors from different manufacturers often have different instruction sets, so a low-level program is written for one particular processor. Languages are classified by how close their instructions sit to that set.
Low-level languages are close to the hardware, because their instructions relate almost one for one to the instructions the processor already knows. Machine code is made of binary instructions from that set, and assembly language gives each instruction a short name (a mnemonic) so a person can read it. Writing in a low-level language means choosing from the instruction set yourself, which is why you need to understand how the processor works.
High-level languages are further from the processor. A statement written in one of these languages says what you want to happen rather than which instructions to use, so it usually has to be broken down into several instructions from the set before it can run. For example, a single high-level line that adds ten points to a player's score does three low-level jobs: read the score from memory, add ten to it, and write the new value back.
| Language level | Distance from the instruction set | Typical unit of code |
|---|---|---|
| Machine code | Uses instructions from the set directly | One binary instruction |
| Assembly language | One step away: one short name per instruction | One mnemonic, with or without operands |
| High-level language | Far away: each statement usually becomes several instructions | One statement, such as an assignment |
Edexcel GCSE Computer Science · Low and High Level Languages