This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:comporg:fall2023:projects:bia0 [2023/10/26 00:23] – [Arrays of Structs in Assembly] walley | notes:comporg:fall2023:projects:bia0 [2023/10/26 00:33] (current) – [Arrays of Structs in Assembly] walley | ||
---|---|---|---|
Line 9: | Line 9: | ||
- Color | - Color | ||
- Health | - Health | ||
- | - Visibility | + | - Visibility |
+ | |||
+ | Accessing an individual array element uses an ID value to get that position' | ||
+ | |||
+ | The first Brick' | ||
+ | < | ||
+ | mov R0, BP | ||
+ | isub R0, 24 | ||
+ | mov R10, R0 | ||
+ | </ | ||
+ | |||
+ | Within our for-loop we use to access all the bricks sequentially, | ||
+ | |||
+ | When moving from one brick to the next, we directly adjust the memory address stored in R10. It's simple in practice: | ||
+ | < | ||
+ | isub R10, 5 | ||
+ | </ | ||
+ | This reference point moves from the current Brick' |