You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

A-level题目:为何从HLL代码转二进制仅认定Compiler为正确翻译器?

Why is the Translator for Total := 60 + 10; a Compiler (Not an Interpreter) in A-level Questions?

Great question—this is a classic point of confusion in A-level computing, so let’s break down the reasoning clearly based on how these translators are defined in exam contexts:

First, let’s recap the core differences between compilers and interpreters as taught in A-level courses:

  • Compiler: Translates an entire (or complete section of) high-level language (HLL) program into fully formed assembly or machine code in one batch process. The resulting target code is a standalone output that can be stored and executed later without needing the original HLL code or the translator itself.
  • Interpreter: Executes HLL code line-by-line, translating each instruction just before it runs. It doesn’t generate a persistent, complete set of assembly or machine code as a separate product—there’s no reusable output file, just immediate execution.

Now look at the example given:
We have a full, corresponding set of assembly code (LD #60 ADD #10 ST Total) and binary machine code (00101000 00111100 00111000 00001010 01100000 00101001) for the HLL line Total := 60 + 10;. This is a clear sign that the translator produced a complete, static target code output—not just executing the instruction on the fly.

An interpreter would never generate these full assembly/binary code blocks. Instead, it would read the line, calculate 60 + 10, store the result in Total, and move on—no permanent assembly or machine code would be created as part of the process.

In A-level assessments, this distinction is strict: if a translator produces a complete, reusable target code (like the assembly/binary here), it’s categorized as a compiler. Interpreters only handle execution without generating such outputs, so they don’t fit this scenario.

内容的提问来源于stack exchange,提问作者user9156598

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:53:15