Loading…
Loading…
Loading…
AQA GCSE Computer Science · 8525
AQA 8525 Check the specification (PDF) (opens in a new tab)
A processor carries out instructions to perform a program’s tasks. Machine code and assembly language are both low-level languages: they are closely related to the instructions and hardware of the processor, rather than hiding those details from the programmer.
The main difference is how the instructions are represented. Machine code uses binary, while assembly language uses short, readable names for instructions. Assembly makes the instructions easier for a person to work with, but the processor still executes machine code.
Machine code consists of instructions represented using 0s and 1s. The processor can execute these instructions directly, without first translating them from another programming language.
Writing and checking a program as long sequences of binary digits is difficult for people. It is hard to recognise what an instruction does, and a small change to the digits can change its meaning.
A processor’s instruction set is the complete set of machine code instructions it can execute. Each type of processor has its own specific instruction set. A binary instruction only has meaning according to that instruction set; it is not a universal command understood by every processor.
This makes machine code processor-specific. Code written for one processor type cannot be assumed to run on another type with a different instruction set. Processors within a compatible family may share an instruction set.
Assembly language represents instructions using mnemonics: short names that help people remember what an instruction does. For example, ADD represents addition. Other examples include LDA for load and STA for store. The available mnemonics depend on the processor’s instruction set.
Recognising a command such as ADD is easier than remembering its binary representation. However, assembly language remains low-level: the programmer is still working with individual processor instructions and needs to understand the relevant hardware.
The processor does not execute the mnemonic itself. An assembler translates assembly language into machine code, which the processor then executes.
Assembly language has a 1:1 correspondence with machine code: one assembly language instruction corresponds to one machine code instruction.
For example, an assembly instruction to add a value translates into the corresponding machine code instruction for that addition. It is a more readable representation of the same instruction, not a way of replacing an entire task with one command. A task requiring several processor instructions still needs several assembly instructions.
Because these instructions match a particular processor’s machine code, assembly language is also processor-specific. Moving an assembly program to a processor with a different instruction set may require rewriting it.
| Feature | Machine code | Assembly language |
|---|---|---|
| Representation | Binary instructions | Readable mnemonics |
| Execution | Executed directly by the processor | Translated into machine code before execution |
| Ease of reading | Very difficult for humans to read | Easier to recognise and understand |
| Processor dependence | Uses a specific instruction set | Corresponds to a specific instruction set |
An embedded system is a computer built into a larger device to perform a dedicated function. For example, a controller inside an appliance handles that appliance’s operation rather than acting as a general-purpose computer.
Programmers often choose assembly language for embedded systems and for code that controls particular hardware components directly. It allows programmers to work directly with hardware details such as memory and processor registers—the small storage locations inside the processor. This control can help them produce efficient code where memory use or execution speed matters.
Another use is a device driver, software that controls a hardware component such as a graphics card. Assembly can be useful for the parts that require close control of the hardware.
The trade-off is difficulty: programmers need detailed knowledge of the target hardware, and the code is harder to write and maintain. Assembly is therefore useful for particular hardware-focused tasks, rather than being the best choice for every program.
ADD, translated into machine code by an assembler.Each processor type has its own specific machine code instruction set. Code for one instruction set cannot be assumed to work on a different one.
When comparing the languages, give paired differences: machine code uses binary and is executed directly; assembly uses mnemonics and must be translated.
State the correspondence precisely: one assembly language instruction corresponds to one machine code instruction, not necessarily one line of a whole program.
Link assembly language’s uses to direct hardware control. Do not claim that all embedded-system software must be written in assembly.
Processor-specific means tied to a compatible instruction set, not to one individual computer.
It can see this note and what your specification asks for.
Answers are free with an account.
1 free note left this week
Get more free notesYour answer sets when this note comes back for review, or marks it complete.
Was this note helpful?
Log in to tell us whether it helped, or to report a problem.
Last updated
Low-level language
A programming language closely related to a processor’s instructions and hardware. Machine code and assembly language are low-level languages.
Machine code
Binary instructions that a processor can execute directly.
Assembly language
A low-level programming language that represents machine code instructions using short, readable commands called mnemonics.
Mnemonic
A short, memorable name for an instruction, such as ADD for addition.
Instruction set
The complete set of machine code instructions that a particular type of processor can execute.
Assembler
A program that translates assembly language into machine code.
Embedded system
A computer built into a larger device to perform a dedicated function.
Put your knowledge into practice — try past paper questions for Computer Science
Low-level language
A programming language closely related to a processor’s instructions and hardware. Machine code and assembly language are low-level languages.
Machine code
Binary instructions that a processor can execute directly.
Assembly language
A low-level programming language that represents machine code instructions using short, readable commands called mnemonics.
Mnemonic
A short, memorable name for an instruction, such as ADD for addition.
Instruction set
The complete set of machine code instructions that a particular type of processor can execute.
Assembler
A program that translates assembly language into machine code.
Embedded system
A computer built into a larger device to perform a dedicated function.