Ekey wrote: ↑Wed Sep 08, 2021 7:25 pm
I'm confused by this cycle, no ideas what in SomeIntArray
45 is a size or offset.
5121 (0b1010000000001) -> 6144 (0b1100000000000)
6143 (0b1011111111111) -> 6144 (0b1100000000000)
6145 (0b1100000000001) -> 7168 (0b1110000000000)
which means you need to multiply offset by 1024 to get the actual offset from data start.
it's fast alignment math, it aligns SomeIntArray[45] to 1024. assembly doesn't have modulo so this is what compilers tend to do. Actual code is probably
Code: Select all
if(result % 1024 > 0) {
result += 1024 - (result % 1024)
}
Index 46 and 47 point to the same thing just at the start and end.