成人快手

Programming languages - EdexcelLow-level languages

Programming languages are classified as high-level or low-level languages. Translators are needed to translate programs into the machine code that a computer understands. Different languages are more suitable for different tasks.

Part of Computer SciencePrinciples of computer science

Low-level languages

sit close to the computer's . An instruction set is the set of that the understands.

Two types of low-level language are:

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 written in machine code consists of 0s and 1s only. Machine code is very difficult to learn, write and . Even a very simple program could have thousands of 0s and 1s in it.

Assembly language

Assembly language sits between machine code and in terms of ease of use. While high-level languages use to form instructions, assembly language uses (short abbreviations). Each mnemonic directly corresponds with a single machine code instruction. Here are some examples of mnemonics:

MnemonicAction
LDALoads a value from a memory address
STAStores a value in a memory address
ADDAdds the value held in a memory address to the value held in the accumulator
SUBSubtracts from the accumulator the value held in a memory address
MOVMoves the contents of one memory address to another
MnemonicLDA
ActionLoads a value from a memory address
MnemonicSTA
ActionStores a value in a memory address
MnemonicADD
ActionAdds the value held in a memory address to the value held in the accumulator
MnemonicSUB
ActionSubtracts from the accumulator the value held in a memory address
MnemonicMOV
ActionMoves 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 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 , and make it easier to spot mistakes.

鈥楲ittle Man Computer鈥 (LMC) is a simulation of a very basic processor using . 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.