Section 7.1 Diving into Assembly: Basics
Checkpoint 7.1.2. Relationship Between C Code and Assembly Code.
- One line of C code always translates into exactly one assembly instruction.
- Incorrect.
- One line of C code often translates into one or more assembly instructions.
- Correct!
- One line of C code always translates into two or more assembly instructions.
- close, but incorrect!
- There is no relationship between C code and assembly code.
- Incorrect.
Which of the following statements is true about the relationship between a single line of C code and assembly code?
Checkpoint 7.1.3. General-Purpose Registers.
%rax- Correct!
%rsi- Correct!
%rip- Incorrect.
%ripis the instruction pointer. It cannot be directly written to. %r8- Correct!
Which of the following x86-64 registers are general purpose?
Checkpoint 7.1.4. Special Use Cases for Registers.
Answer.
Did you know? Register x0 is also used to hold the return value of a function!
Checkpoint 7.1.5. Registers - Capacity.
Order the following registers from smallest to largest capacity.
Checkpoint 7.1.6. Identifying Operand Types.
For each of the following operands, label it as a (C)onstant, (R)egister, or (M)emory operand.
%rax(%rax)(%rax, %rbx, 4)$0x50x5$8
Hint.
Just enter the letter as your answer (one of C, R, or M)
Checkpoint 7.1.7. Identifying Operand Types.
The following tables provide the contents of several registers and memory locations.
| Address | Value |
|---|---|
| 0xFA00 | 0x5F |
| 0xFA08 | 0x16 |
| 0xFA10 | 0x42 |
| 0xFA18 | 0x9C |
| Register | Value |
|---|---|
| %rax | 0xFA08 |
| %rdx | 0x2 |
For each of the following operands, determine the associated value in hex.
%rax%rdx(%rax)(%rax, %rdx, 4)-0x8(%rax)(%rax, %rdx, 8)
Hint.
Remember to include the 0x prefix in your answers.

