Assembly Part 9: Structures And Byte Alignment Flashcards
Structure represented as ______ of _____
Block, memory
The C compiler inserts ____ in structure to ensure correct alignment of fields
Gaps
Each structure has an alignment requirement of K where K is the _______ alignment of any element
Largest
How to save space in memory
Put larger data types first in structure
How to allocate space for block scope declaration
Isn’t time_array[24]
Subq $96, %rsp
How to allocate space for block scope declaration of struct time_array where sizeif(struct time) is 64 bytes
Subq $1536, %rsp
File scope declaration: int time_array[24]
.align 4
Time_array:
.skip 96, 0 #24 4 bytes elects = 96 bytes
File scope declaration of struct time stime_array[24]
.align 8
Stime_array:
Skip 1536, 0