Machine Programming Data

References

Outline

Array Allocation

Array Access

Array Example

Array Example

Array Loop Example

Array Loop Example

Multidimensional (Nested) Arrays

\[ \begin{bmatrix} \texttt{A[0][0]} & \dots & \texttt{A[0][C-1]}\\ \vdots & \ddots & \vdots\\ \texttt{A[R-1][0]} & \dots & \texttt{A[R-1][C-1]}\\ \end{bmatrix} \]

Nested Array Example

Nested Array Row Access

Nested Array Row Access Code

Nested Array Element Access Code

Multi-Level Array Example

Element Access in Multi-Level Array

N \(\times\) N Matrix Code

N \(\times\) N Matrix Code

N \(\times\) N Matrix Code

16 \(\times\) 16 Fixed Matrix Access

n \(\times\) n Variable Matrix Access

Structure Representation

Generating Pointer to Structure Member

Following Linked List Example

Following Linked List Example 2

Structures and Alignment

Structures and Alignment

Alignment Principles

Specific Cases of Alignment (x86-64)

Satisfying Alignment with Structures

Meeting Overall Alignment Requirement

Arrays of Structures

Accessing Array Elements

Saving Space in Structures

Summary