Return to course page

Quiz on third week's material.

The following ask about details of the assembly syntax we will use for this course (AT&T syntax assembly). This is not because the topic is important in and of itself, but because knowing it will be important to learn what will follow.

Question 1: (see above) The instruction addq %rax, %rbx changes what?

  1. The contents of memory at an address found in the rax register

  2. The contents of memory at an address found in the rbx register

  3. The contents of the rax register

  4. The contents of the rbx register

  5. none of the above

Question 2: (see above) What is the difference between 15 and $15?

  1. 15 is an address, $15 is a value

  2. 15 is a value, $15 is an address

  3. 15 is legal in assembly, $15 is not

  4. $15 is legal in assembly, 15 is not

  5. there is no difference

Question 3: There are no labels in an executable binary program, but there are labels in assembly; for example, in the following foo: is a label definition and baz is a label use

foo:
    jmp baz

The assembler and linker remove the labels from assembly to create a binary executable by

  1. removing both definitions and uses altogether

  2. replacing both definitions and uses with immediate-value addresses

  3. replacing definitions with immediate-value addresses and removing uses altogether

  4. replacing uses with immediate-value addresses and removing definitions altogether

  5. none of the above

Question 4: When we say that the PC and Condition Codes are not program registers, we mean that

  1. they are not registers

  2. user code cannot change their values

  3. user code behavior does not depend on their values

  4. user code can manipulate them but shouldn't do so

  5. none of the above

Consider the assembly operation popq %r11.

Question 5: (see above) How many program registers need to be read to complete this instruction? In other words, how many program registers' values can impact the result of this popq?

  1. %r11

  2. %r11 and one other program register

  3. %r11 and two or more other program registers

  4. none

  5. one program register (but not %r11)

  6. two or more other program registers (but not %r11)

Question 6: (see above) How many program registers are written by this instruction? In other words, how many program registers' values change as a consequence of executing this popq?

  1. %r11

  2. %r11 and one other program register

  3. %r11 and two or more other program registers

  4. none

  5. one program register (but not %r11)

  6. two or more other program registers (but not %r11)

Question 7: An ISA specifies
Select all that apply

  1. The set of instructions that exist

  2. The semantic meaning of each instruction

  3. The set of program registers that exist

  4. The time taken to run each instruction

  5. The microcode implementation of each instruction

Question 8: RISC processors are typically described as
Select all that apply

  1. having fewer instructions than CISC processors

  2. having fewer addressing modes than CISC processors

  3. allowing any operand in any operation (i.e., if 14(%rax) is legal in a move, it is also legal in an add)

  4. being faster than CISC processors

  5. being slower than CISC processors

Question 9: Y86-64 lacks which of the following instructions?
Select all that apply

  1. move from memory to memory

  2. add immediate to register

  3. multiply register by register

  4. move between registers only after checking condition codes

Question 10: The Y86-64 assembly

irmovq   $3, %rax
andq   %rax, %rax
je     whee
  1. will jump to whee

  2. will not jump to whee

  3. whether it jumps or not cannot be determined from the given assembly

Return to main page
Return to course page