Languages
Machine code and assembly language are the two low-level languages. Both work at the level of the processor itself, so every instruction in them matches something the hardware can really do.
Machine code is written as binary patterns — strings of 0s and 1s. Each pattern stands for exactly one instruction in that processor's instruction set, which is the fixed list of operations the processor was built to carry out. One pattern, for example, might mean “load the number stored in memory location 6”. Machine code is the only form a processor can execute directly, with no translation at all.
Reading binary patterns is slow and easy to get wrong, so assembly language replaces each pattern with a short word called a mnemonic. The instruction above could be written as LOAD 6. There is one mnemonic for every machine code instruction, so the two languages have a one-to-one correspondence: a single line of assembly becomes a single machine code instruction, never several.
A processor cannot run assembly language, because it only understands binary patterns. Every assembly program therefore needs converting into machine code first, and that conversion is a straight swap of each mnemonic for its pattern. Assembly is therefore just a more human-readable way of writing the same instructions, not a different set of instructions.
Instruction sets differ from one processor design to the next, so a program written in a low-level language works on only one kind of processor. Move it to a different processor and it will not run, because the same patterns mean different things there, or nothing at all — the program has to be rewritten for the new processor. High-level languages are not tied to one processor like this, which is why they are portable.
OCR GCSE Computer Science · Languages