[fpc-pascal] Bit manipulation helpers

Michael Van Canneyt michael at freepascal.org
Mon Feb 21 13:01:42 CET 2022



On Mon, 21 Feb 2022, Ryan Joseph via fpc-pascal wrote:

> I tried to use the bit helpers like
> https://www.freepascal.org/docs-html/rtl/sysutils/twordhelper.testbit.html
> but the bit to test is  0..15.

There are only 16 bits in a word, so that is correct.

> I expected this to work like
> https://wiki.freepascal.org/Bit_manipulation but that doesn't seem to be
> the case.
>
> Does there exist bit helpers like GetBit (from the last link) in the RTL?

Yes, this is testbit.

Why do you say it does not work ?

Michael.


More information about the fpc-pascal mailing list