A true statement about assemblers
Which statement about an assembler is correct?
A It translates a high-level language program into machine code.
B It usually translates each assembly language instruction into one machine code instruction.
C It translates and runs a program one line at a time without producing machine code.
D The same assembler can translate a program for any type of processor.
[1]
- 1
Rule out the others. A describes a compiler (an assembler translates assembly language, a low-level language). C describes an interpreter. D is false because assembly language is written for one processor's instruction set, so each processor type needs its own assembler.
- 2
Option B is correct: each mnemonic such as LDD or ADD (with its operand) corresponds to one machine code instruction, so the translation is (mostly) one-to-one. Answer B (1).
Answer
B
Examiner tip
Examiner tip: 'one-to-one' is the phrase that separates an assembler from a compiler, where one high-level statement usually becomes several machine code instructions.
Common mistake: choosing A because an assembler does produce machine code. The input is the giveaway: it translates assembly language, not a high-level language.