Assembly Part 3 Flashcards

1
Q

We must use the ____ _____ ______ used by x86-64 in a C programming environment

A

Register save conventions

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

%rax is used for ______ _____

A

Return values

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

%rsp must be _____ when control is returned to caller function

A

Restoed

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

If the ____ function wishes to use following register (rax,rbp, r12, r15), the ____ must save/then restore their original values before returning control to caller

A

Callee

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

Callee saved registers

A

Rbp, rbp, r12, r15

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

All other registers must be saved by the ____ if the ____ wishes to preserve their values

A

Caller

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

Caller saved registers

A

If register contains data needed by Caller after Calle function returns, caller function must reserve them by pushing them on the sack prior to calling the callee function

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

Callee saved registers

A

If the Callee function wishes to use these registers, the callee function must push them to the stack prior to using them. Callee must assume the data is these registers is important to the caller function. Calle function must pop these registers back prior to returning to caller. Caller then pops them from stack AFTER callee returns

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

The first 6 parameters are passed form Caller to Callee in register _____, ____, ___, ___, ___, ___

A

Rdi, rsi, rdx, rcx, r8, r9

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

For parameter passing
Caller must assume that Calle function will ____ values in those registers period to return
If caller needs any of the parameters after the call, must push register to stack prior to call and ____ after call

A

Trash, pop

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

If the ____ function returns a value to ____, it is returned to register _____

A

Callee, caller, %rax

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

____ functions make no calls to any other function

A

Leaf

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

If we want to make calls to other functions, we must save and restore and of the parameter registers as well as %r10, %r11 __________ each call if we still want to use the values they contained prior to the call

A

Before and after

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

If we use %rbx, %rbp, %r12-%r15 for out funrction’s work, we only save them one at a time (_______) and restore them one at a time (______) of our function

A

At the beginning, at the end

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

When a function taking variable arguments is called, %rax must be set to the total number of _____ _______ passed to the function in vector register

A

Floating-point parameters

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