Memory-align the first variable when Structure Align is used
Posted: Fri Oct 07, 2016 1:36 pm
Tonight i needed an aligned variable but there doesnt seem to be any direct way. I was able to come up with a workaround using pointers and CopyMemory but its not pretty.
At the moment you might have something like this:
and Byte2 will be 16 bytes after Byte1, BUT the address for Byte1 won't necessarily be a 16-aligned address... but that's what's often needed now with a lot of these new x64 instructions as i keep finding out!
basically my problem would been solved if the "Align n" parameter of the Structure command also ensured that the first element is aligned. It'd be great to be able to align all variables, like "Protected myvar.i Align 16" as well, but at least if Structures have that ability with the first element i guess it would be sufficient?
Thankyou very much for your consideration
At the moment you might have something like this:
Code: Select all
Structure Bytes Align 16
Byte1.a
Byte2.a
EndStructure
basically my problem would been solved if the "Align n" parameter of the Structure command also ensured that the first element is aligned. It'd be great to be able to align all variables, like "Protected myvar.i Align 16" as well, but at least if Structures have that ability with the first element i guess it would be sufficient?
Thankyou very much for your consideration