Search code examples
compilationinterpretertranslators

Compiler but not Interpreter


Total := 60 + 10;

LD #60
ADD #10
ST Total

00101000 00111100
00111000 00001010
01100000 00101001

Going from the HLL code to the binary uses a translator, a question in A levels is asking what translator has been used. But the answer does not allow interpreter, only compiler is the correct answer, why is it so? There isn't any other information.


Solution

  • Well, you haven't given the full wording of the question so I don't know why you think that, unless it is multiple choice or something.

    But that data suggests they want 'compiler' as the answer because the first translation is from high level language to some sort of assembly, and then from assembly to binary code.

    So only translation has been done; the code has not been executed yet, and therefore can't have been interpreted.

    An interpreter may possibly include such a translation as a first pass (but more usually as one step), and that process may be called compilation. For example, high-level language to byte-code.