How do you work out the alignment of an address by just looking at it?
On a 32bit system, an address of 0x12345670 means it’s 16 byte aligned (because of the 0 on the end) right?
So what about:
0x12345671
0x12345672
0x12345673
etc?
Cheers,
Jon
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An address A is n-aligned if A mod n is 0. So 0x12345671 and 0x12345673 are 1 aligned, and 0x12345672 is 2-aligned. 0x12345670 is, simultaneously, 1-aligned, 2-aligned, 4-aligned, 8-aligned, and 16-aligned. You only mention the highest power of two (as the lower powers are implied).