[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Kyan Pascal question



Hello,

I want to test individual bits into an integer, for example, bit 3 in A 
with:
var
  A,B:integer;

begin
B:=A and 8;
...

And I expect, if A=12 to get B=8 and if A=7, to get B=0.

But, this doesn't work. Are those operators (OR, AND, NOT) reserved for 
boolean values?

So I have to do it in ASM... It's not a problem, but I just wanted to know 
if I get it right or if I'm missing something.

Other question (for another solution), if I declare:

A : ARRAY [1..16] of boolean;

will this be packed into a 2 byte integer or into a 16 bytes array? (a 
question of memory usage)

Thanks a lot!

Guillaume.