Assembly Part 9: Structures And Byte Alignment Flashcards

1
Q

Structure represented as ______ of _____

A

Block, memory

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

The C compiler inserts ____ in structure to ensure correct alignment of fields

A

Gaps

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

Each structure has an alignment requirement of K where K is the _______ alignment of any element

A

Largest

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

How to save space in memory

A

Put larger data types first in structure

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

How to allocate space for block scope declaration
Isn’t time_array[24]

A

Subq $96, %rsp

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

How to allocate space for block scope declaration of struct time_array where sizeif(struct time) is 64 bytes

A

Subq $1536, %rsp

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

File scope declaration: int time_array[24]

A

.align 4
Time_array:
.skip 96, 0 #24 4 bytes elects = 96 bytes

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

File scope declaration of struct time stime_array[24]

A

.align 8
Stime_array:
Skip 1536, 0

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