Low-level languages
low-level languageAlso known as low level language. This is a computer programming language which closely represents machine language. Low-level languages are more difficult to understand than high-level languages but they execute quicker. sit close to the computer's instruction set Collectively, the set of instructions a processor understands.. An instruction set is the set of instructionA single action that can be performed by a computer processor. that the CPU/processorCentral processing unit - the brain of the computer that processes program instructions. understands.
Two types of low-level language are:
- machine codeA low level language that on the surface makes very little sense.
- assembly languageA low-level programming language closely related to machine language. Also called assembly code.
Machine code
An instruction set relates to a specific processor and is written in machine code. The central processing unit (CPU) understands machine code directly and can act upon the instructions. A programSequences of instructions for a computer. written in machine code consists of 0s and 1s only. Machine code is very difficult to learn, write and debugThe process of finding and correcting programming errors. . Even a very simple program could have thousands of 0s and 1s in it.
Assembly language
Assembly language sits between machine code and high-level languageAlso known as high level language. This is a computer programming language used to write programs. High-level languages need to be translated into machine code through a compiler, interpreter or assembler. in terms of ease of use. While high-level languages use statementThe smallest element of a programming language which expresses an action to be carried out. to form instructions, assembly language uses mnemonicShort text codes used for writing instructions in assembly code. (short abbreviations). Each mnemonic directly corresponds with a single machine code instruction. Here are some examples of mnemonics:
Mnemonic | Action |
LDA | Loads a value from a memory address |
STA | Stores a value in a memory address |
ADD | Adds the value held in a memory address to the value held in the accumulator |
SUB | Subtracts from the accumulator the value held in a memory address |
MOV | Moves the contents of one memory address to another |
Mnemonic | LDA |
---|---|
Action | Loads a value from a memory address |
Mnemonic | STA |
---|---|
Action | Stores a value in a memory address |
Mnemonic | ADD |
---|---|
Action | Adds the value held in a memory address to the value held in the accumulator |
Mnemonic | SUB |
---|---|
Action | Subtracts from the accumulator the value held in a memory address |
Mnemonic | MOV |
---|---|
Action | Moves the contents of one memory address to another |
In assembly language, programmers write programs as a series of mnemonics. Mnemonics are much easier to understand and debug than machine code, giving programmers a simpler way of directly controlling a computer.
Assembly language is still used today, for example, in low-level embedded systems and device drivers. It is faster to run because it doesn鈥檛 need as much translatorProgram translators convert program code into machine code to be executed by the CPU. There are three types of translator: interpreter, compiler and assembler. as a high-level language (see Translator section for more information).
Writing in mnemonics is easier for programmers because these abbreviations are usually brief representations of the actual commands. They are quicker to write than binaryA number system that contains two symbols, 0 and 1. Also known as base 2., and make it easier to spot mistakes.
鈥楲ittle Man Computer鈥 (LMC) is a simulation of a very basic processor using Von Neumann architectureA description of the processing architecture that all CPUs use. John von Neumann invented the processor architecture which stores a program in memory as instructions and executes them sequentially using the ALU, control unit and registers. This is known as the stored program concept.. It uses an example of assembly language that contains a limited set of mnemonic instructions which can be used to program simple assembly programs. 鈥楲ittle Man Computer鈥 is freely available on the internet for students to use.
More guides on this topic
- Decomposition and abstraction - Edexcel
- Algorithms - Edexcel
- Further algorithms - Edexcel
- Truth tables - Edexcel
- Binary and data representation - Edexcel
- Computers - Edexcel
- Networks - Edexcel
- Network security and cybersecurity - Edexcel
- Encryption - Edexcel
- Environmental, ethical and legal concerns - Edexcel