High-level languages, low-level languages and assembly language
Practise 26 exam-style questions on High-level languages, low-level languages and assembly language for Cambridge IGCSE Computer Science (Paper 1). Write your answer as you would in the exam and get it marked in seconds against the mark scheme, point by point, with an AI tutor on hand if you get stuck.
26 questions
1–6 marks each
Instant marking
No sign-up needed
20 questions, marked as you go
Sample questions with model answers
Here are 4 of the questions in this topic, each with a model answer, an explanation of why it earns the marks and the mark scheme an examiner would use.
Question 1
1 mark
State the name of the only type of language that a processor can execute directly, without any translation.
Model answer
Machine code.
Explanation
The processor only understands machine code: instructions in binary. Every other language, including assembly language, must be translated into machine code before it can be executed.
Mark scheme
1 mark
Machine code
accept machine language / binary instructions; do not accept assembly language or low-level language on its own
Question 2
2 marks
Give two advantages of writing a program in a high-level language rather than a low-level language.
Model answer
A high-level language is easier to read and write because it uses English-like statements. It is also machine independent, so the program can run on different types of processor.
Explanation
The syllabus comparison points are ease of reading and writing, ease of debugging, machine independence and direct manipulation of hardware. The first three favour high-level languages; only the last favours low-level languages.
Mark scheme
1 mark
It is easier to read and write / understand (English-like)
max 2
1 mark
It is easier to debug
1 mark
It is machine independent / portable
1 mark
It is quicker to write / needs fewer lines of code
1 mark
The programmer does not need to know about the processor / hardware
1 mark
It is easier to maintain / update
do not accept 'easier' on its own
Question 3
3 marks
Explain why a program written in assembly language for one type of processor may not run on a different type of processor.
Model answer
Assembly language is machine dependent. Each type of processor has its own set of instructions, so the machine code produced from the program will not be understood by a different processor. The program would have to be rewritten for the new processor.
Explanation
Because each assembly instruction maps to one machine code instruction of a particular processor, the program is tied to that processor's instruction set. High-level programs avoid this because they can be translated separately for each processor.
Mark scheme
1 mark
Assembly language is machine dependent / specific to one type of processor
max 3
1 mark
Each type of processor has its own instruction set
1 mark
The machine code produced will not be understood by the other processor
1 mark
The program would have to be rewritten (and assembled again) for the other processor
Question 4
4 marks
The program is written in assembly language.
LDA 40
SUB 41
STO 42
Describe how this program is translated so that the processor can execute it.
Model answer
The program is translated by an assembler. The assembler converts each mnemonic, such as LDA, into its binary machine code, and converts the memory addresses 40, 41 and 42 into binary. Each of the three assembly instructions becomes exactly one machine code instruction, producing a machine code program that the processor can execute.
Explanation
Assembly language translation is simple compared with compiling: there is a one-to-one match between assembly instructions and machine code instructions, so the assembler essentially swaps each mnemonic and address for its binary equivalent.
Mark scheme
1 mark
An assembler is used
max 4
1 mark
Each mnemonic (LDA, SUB, STO) is converted into its binary machine code (opcode)
1 mark
The memory addresses (40, 41, 42) are converted into binary
1 mark
Each assembly instruction becomes one machine code instruction
accept 'one-to-one'
1 mark
The result is a machine code program that the processor can execute
1 mark
The assembler reports errors, e.g. an invalid mnemonic
Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.
Ctrl + Enter to check
AI TutorHints first, answers after you try
Hi! Stuck? Ask me for a hint and I’ll help you work it out. Once you’ve checked your answer I can explain exactly where the marks are.