Drill 1

  1. Which of the following most closely matches the type of an interpreter for Python?

    • python_program -> value
    • python_program -> python_program
    • python_program -> low_level_code
  2. Which of the following most closely matches the type of a compiler for Python?

    • python_program -> value
    • python_program -> python_program
    • python_program -> low_level_code
  3. We can view the computer's CPU as an interpreter for:

    • C language code
    • x86_64 assembly language code
    • x86_64 machine code

    We can use an assembler to easily convert assembly code into machine code. This is a very mechanical change -- the assembler won't change the structure or flow of the code at all -- but ultimately the CPU wants machine code.

  4. In x86-64 assembly, which register conventionally holds the return value of a function?

    • rbp
    • rax
    • rsp
  5. What is the purpose of the runtime in our compiler system?

    • To translate source code to assembly
    • To optimize the generated code
    • To provide necessary support functions (such as printing output)