Data Structures and Structures Flashcards
What is the address of a element i in a 1D array?
base addy + (i x element size)
Where is an array located? Local variables are also located here.
In the function’s stack frame
What is a stack frame?
A structure on the call stack that is created each time a function is called.
How can accessing of an array element be optimized?
By doing LSL in the STR instruction
What must you want to access an element of an array but the index is in a w register?
Sign extend
What are the 2 ways to traverse a 2D array? Which is the most common when sorting arrays in RAM?
Row-major order
Column-major order
Row-major (first all elements of r0 then r1)
What is the block size for an n-dimensional array?
Check notes