Indicative content
Control of the hardware
- Low-level languages can read and write the contents of registers and memory addresses directly, so the firmware can take the values from the distance sensors without calling a library routine.
- Assembly language instructions can read from and write to specific input/output ports on the vacuum cleaner's processor, so the motors can be switched on and off directly.
- The programmer decides exactly which processor operations are carried out and in which order, which matters when the vacuum must reverse away from a step or an obstacle.
- A low-level language puts nothing between the program and the hardware, so the programmer can control the hardware of the vacuum cleaner precisely.
Efficiency of the code
- Assembly language code can be hand-optimised instruction by instruction, so the code that checks a sensor is as short as possible.
- The programmer can choose which registers hold values that are used again and again, which cuts down the number of memory accesses the firmware needs.
- A hand-written low-level program can be made compact, so it is more likely to fit in the small amount of memory the vacuum cleaner has.
- Because each instruction does one defined job, the time taken to react to a sensor reading is predictable, which suits firmware that must not overrun.
Link between the language and the processor
- Low-level languages are processor-specific, so the instructions used are those of the exact processor in the vacuum cleaner rather than general statements that need translating.
- Each assembly language instruction maps to one machine code instruction, so the programmer knows precisely which processor operation will be carried out by each line of code.
- An assembler turns each mnemonic into its machine code equivalent, so the machine code running on the vacuum cleaner's processor is exactly what the programmer wrote.
- Code written for a different processor would have to be rewritten, which is acceptable here because the vacuum cleaner always uses the same processor.
Levels
- Level 0 (0 marks): No rewardable content.
- Level 1 (1–2 marks): Basic, independent points are made, showing elements of understanding of key concepts/principles of computer science. (AO1) The discussion will contain basic information with little linkage between points made or application to the context. (AO2)
- Level 2 (3–4 marks): Demonstrates adequate understanding of key concepts/principles of computer science. (AO1) The discussion shows some linkages and lines of reasoning with some structure and application to the context. (AO2)
- Level 3 (5–6 marks): Demonstrates comprehensive understanding of key concepts/principles of computer science to support the discussion being presented. (AO1) The discussion is well developed, with sustained lines of reasoning that are coherent and logically structured, and which clearly apply to the context. (AO2)
Within Level 1, award 1 mark for a single basic point and 2 marks for two or more independent basic points; Level 2 requires the points to be linked to the vacuum cleaner; Level 3 requires both control of the hardware and efficiency of the code, and a few concise, linked sentences can reach Level 3, so extra length is not required.
Accept registers, memory addresses, input/output ports, machine code and mnemonics as ways of describing access to the hardware, and accept 'a low-level language is faster' as a basic point on its own. Do not award 'binary is a low-level language' (machine code is written in binary, but binary is not a language), or characteristics of high-level languages such as being easy to read or portable, as characteristics of a low-level language.