5.48 · exercise

Quiz: Arrays and Structures - Intermediate

Address arithmetic for one- and two-dimensional arrays, scaled register offsets, and the constant offsets that reach struct fields.

0 of 8 correct

Knowledge Check

An array list is declared with n rows and m columns and stored in row-major order. For zero-based indices i and j, and an element size of E_size bytes, what is the byte offset of list[i][j] from the base of the array?

Knowledge Check

An array of words has its base address in x22 and a signed element index in w19. Which extension completes ldr w20, [x22, w19, ___ 2]?

Knowledge Check

What is the total number of bytes to reserve for an n-dimensional array?

Knowledge Check

A struct field is itself a struct. How is a subfield of that inner struct reached from the outer struct's base address?

Knowledge Check

Which language stores two-dimensional arrays in column-major order?

Knowledge Check

An array of doublewords has its base in x22 and an index in x19. Which load scales that index by eight without a separate mul?

Knowledge Check

Struct field offsets are written as a sum of named constants, such as employee_start + date_month. When does that sum become a number?

Knowledge Check

A struct field holds a signed one-byte value. Which load brings it into w20 with the sign copied through the upper bits?