Jonas Maebe wrote:
On 04 Jan 2006, at 17: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.
Will the statements (the conditions)
if (dword(pBoxtemplate) and 1)=1 then pBoxtemplate:=nil;
I can only think of one way to interpret this.
if (dword(pBoxtemplate) and 2)=2 then inc(pBoxtemplate);
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)??
Hans Mårtensson
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal