On 04 Jan 2006, at 21:51, Hans Mårtensson wrote:

Does PPC 2.0.2 handle alignment of data the same way as former versions?

The statements below have nothing to do with alignment.

The type of pBoxtemplate is ^word.
Is it not true that
 (dword(pBoxtemplate) and 1)=1
evaluates to TRUE, if and only if pBoxtemplate is NOT aligned to a word boundary (16 bit boundary)?

And then, assuming pBoxtemplate is aligned to word boundary, is it not true, that
 if (dword(pBoxtemplate) and 2)=2
evaluates to TRUE, if pBoxtemplate is NOT aligned to a dword boundary (32 bit boudary), causing the statement
 if (dword(pBoxtemplate) and 2)=2 then inc(pBoxtemplate);
to make the pBoxtemplate align to a dword boundary (by eventually adding 2 to pBoxtemplate (because sizeof(word)=2)??

Yes, but this is independent of how the compiler handles alignment of data.


Jonas

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to