John Mavrick's Garden

Search IconIcon to open search

Last updated Unknown

Status: Tags: #cards/cmpt295/assembly Links: x86-64 Assembly - Arrays


x86-64 Assembly Arrays

Principles

1D Arrays

? Remember differences of array cells differ by size of data, not just 1!

Accessing memory address ?

Accessing a value ?

Allow for quick indexing with memory address indexing via movq (%array start, index, char size), %register you want to save to

How to only let loop iterate while i<n ?

1
2
3
# i in %ecx, N in %esi
cmpl %ecx, %esi # N - i
jle jmp endloop # N <= i

Adding all elements of a char array (version 1):

Jump to end, have condition at the end to jump back if not end of array Image from Gyazo

2D Arrays

Access row i of a 2d array ? A + (R * C * L)

Access row i col j of a 2d array ?


References:

Created:: 2022-03-19 04:01


Interactive Graph