rax register is used for storing the return value of a subroutine.
True!
%rdx is usually used to store the forth argument and, also, it is commonly used as loop counter.
False!
rdx is storing the third argument, while rcx is storing the forth argument and is commonly used as loop counter.
%rdi, %rsi and %rdx are caller-saved registers.
True!
%ax, %di, %si and %dx store 8 bits.
False!
%ax, %di, %si and %dx store 16 bits.
Any register starting with letter r (e.g. %rax, %rbx, %rdi) indicates that it stores 64 bits.
True!
Registers are the fastest and smallest unit of storage available to the CPU.
True!
Although they are the fastest, they are the most expensive. Because of this the CPU has a limited number or registers, some of which are designed to specific functionality. To review the memory hierarchy, see the Memory section.
Multiple Choice
How many bytes can be stored in %esi?
1 byte
Wrong!
2 bytes
Wrong!
4 bytes
Correct!
8 bytes
Wrong!
Which registers are used to store the first three arguments of a function? ( Specify in order)
rsi, rdi, rdx
Wrong!
%rdi stores the first argument while %rsi stores the second.
rsi, rdx, rcx
Wrong!
%rsi stores the second argument, %rdx the third and %rcx the forth.
rdi, rsi, rdx
Correct!
rdi, rsi, rbx
Wrong!
The third argument is stored in rdx. rbx can optionally be used as base pointer, but not to store the third argument of a function.