A programmer has written a program in assembly language.
Describe why it is necessary to translate the program into machine code before it can be run.
Mark scheme
Award up to two marks for a linked description such as:
- The processor/CPU can only execute machine code/binary instructions (1) so the assembly instructions must be converted into machine code before the program can run (1)
- Each assembly instruction/mnemonic matches/corresponds to one machine code instruction (1) so each line must be replaced with the machine code the processor executes (1)
- The program is written using mnemonics (1) that must be translated into machine code for the processor to carry out the instructions (1)
- The hardware/processor does not understand assembly language directly (1) so it must be translated into machine code that the processor can execute (1)
Do not accept 'assembly language is a low-level language'.
Do not accept 'it is hard to understand' or 'it is not English'.
Do not accept benefits, such as 'machine code runs faster' or 'the program will run more quickly'.
Do not accept 'an assembler/a translator converts it' on its own, with no reference to the processor only being able to execute machine code/binary.
Do not accept responses about high-level languages or about compilers/interpreters.
Example answers and how they were marked
The processor can only execute machine code, so the assembly instructions must be converted into machine code before the program can run.
Why: States what the processor can execute (1) and links it to converting the program's instructions into machine code (1).
Each assembly instruction matches one machine code instruction.
Why: Correct point about the one-to-one match (1) but no development saying that this is because the processor only executes machine code.
Because an assembler translates assembly language into machine code.
Why: Names the translator but gives no reason tied to the processor only being able to execute machine code, so no mark; this is in the 'Do not accept' guidance.