X86-64 Assembly Language Flashcards
Which of the following about argument registers is false?
A. A function can use any of the arguments registers as temporal variables.
B. After calling a function, the register arguments will not be modified.
C. If you need these registers after the function returns, save them in the stack before calling a function and restore them after it returns.
B.
After calling a function like printf, the register arguments may be modified.
If a function uses any of the callee saved, it means that their values do not need to be preserved when the function returns.
True/False
False
Their values need to be preserved when the function returns.
Addressing modes: movq $0x501208, %rdi A. Direct memory reference B. Indirect through a register C. Direct register reference D. Immediate Value
D
Addressing modes: movq %rsi, (%rdi) A. Direct memory reference B. Indirect through a register C. Direct register reference D. Immediate Value
B.
Addressing modes: movq %rax, %rdi A. Direct memory reference B. Indirect through a register C. Direct register reference D. Immediate Value
C
Addressing modes: movq 0x501208, %rdi A. Direct memory reference B. Indirect through a register C. Direct register reference D. Immediate Value
A
The stack is used to:- store \_\_\_ store \_\_\_ save \_\_\_ when running out of them pass \_\_\_ when they don't fit in the register
return address; local variable; registers; arguments
To create space for a global variable in assembly langauge, use:-
. ___
. comm ___, ___, [___]
data; var_name; data_size; alignment (optional)
The size of the registers are ___ bytes long.
8
The ___ byte of every register in the x86-64 can be used as a byte register.
lowest