Assembler tools: which type of computer program translates mnemonic assembly instructions into executable machine code for a target microprocessor?
-
Adebug
-
Bassembler
-
CC++
-
DFortran
Answer
Correct Answer: assembler
Explanation
Introduction / Context:Microprocessors execute binary op-codes. Humans prefer readable mnemonics (e.g., MOV, ADD, JMP). The bridge between these worlds is a translation tool that maps symbolic instructions and labels into machine code and addresses.
Given Data / Assumptions:
- Input: assembly source with mnemonics and directives.
- Output: object code or executable with resolved op-codes and addresses.
- Target: specific instruction set (e.g., 8085A, 8086).
Concept / Approach:An assembler performs lexical analysis, parsing, symbol resolution (labels), and code generation. It may also produce listing files, symbol tables, and relocation records for linkers.
Step-by-Step Solution:
Provide assembly as input to the assembler.Assembler converts mnemonics to binary op-codes and computes addresses.Linker/loader may combine modules and place code in memory.Processor executes the resulting machine code.Verification / Alternative check:Compile an example (e.g., MVI A,00H). The listing shows hex bytes corresponding to the mnemonic, confirming the translation step.
Why Other Options Are Wrong:
- Debug: diagnostic tool, not a translator.
- C++/Fortran: high-level languages; their compilers output machine code but not from assembly mnemonics.
Common Pitfalls:Confusing assemblers and compilers. Compilers translate high-level constructs; assemblers map one-to-one mnemonics to op-codes.
Final Answer:assembler