Low level languages - assembly language
assembly languageA low-level programming language closely related to machine code. sits between machine codeAlso called object-code, this is low-level code that represents how computer hardware and CPUs understand instructions. It is represented by either binary or hexadecimal numbers. 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.. While high level languages use statementThe smallest element of a programming language which expresses an action to be carried out. to form instructionA single action that can be performed by a computer processor., assembly language uses mnemonicShort text codes used for writing instructions in assembly code. (short abbreviations). Each mnemonic directly corresponds with a machine code instruction. As a result, assembly language is known as a one-to-one language. 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 debugThe process of finding and correcting programming errors. than machine code, giving programmers a simpler way of directly controlling a computer.
Writing in mnemonics is easier for programmers because they 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. or hexadecimalA number system using 16 symbols from 0-9 and A-F, also known as base 16 and hex., and it is easier to spot mistakes.
Little 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 simple assembly language that contains a limited set of mnemonic instructions which can be used to program simple assembly programs. LMC is freely available on the internet for students to use.