X86-64 Assembly Language Flashcards

1
Q

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.

A

B.

After calling a function like printf, the register arguments may be modified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

False

Their values need to be preserved when the function returns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
Addressing modes:
movq $0x501208, %rdi
A. Direct memory reference
B. Indirect through a register
C. Direct register reference
D. Immediate Value
A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
Addressing modes:
movq %rsi, (%rdi)
A. Direct memory reference
B. Indirect through a register
C. Direct register reference
D. Immediate Value
A

B.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
Addressing modes:
movq %rax, %rdi
A. Direct memory reference
B. Indirect through a register
C. Direct register reference
D. Immediate Value
A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
Addressing modes:
movq 0x501208, %rdi
A. Direct memory reference
B. Indirect through a register
C. Direct register reference
D. Immediate Value
A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
The stack is used to:-
store \_\_\_
store \_\_\_
save \_\_\_ when running out of them
pass \_\_\_ when they don't fit in the register
A

return address; local variable; registers; arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

To create space for a global variable in assembly langauge, use:-
. ___
. comm ___, ___, [___]

A

data; var_name; data_size; alignment (optional)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The size of the registers are ___ bytes long.

A

8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The ___ byte of every register in the x86-64 can be used as a byte register.

A

lowest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly