I was going to comment that the 'bitmask example doesn't work, which it didn’t, but looks like its been recently fixed by adding the needed QWord cast on the '1's. http://wiki.freepascal.org/Bit_manipulation Qwords are certainly trickier to use the Dwords.