There were days when binary values were actually represented in bits
within a byte or word. This is still true when interfacing to some boxes
such as PLCs.
Likewise, some operations - eg calculating a CRC - are very awkward to
implement without bitwise operations.

It would be really nice to have this functionality. Anyone who has ever
programmed in Assembler propably knows what I mean.

The following would be a fairly complete set, I think:

BitAnd( a AS Expression, b AS Expression) AS Expression
BitOr( a AS Expression, b AS Expression) AS Expression
BitXOr( a AS Expression, b AS Expression) AS Expression
BitNot( a AS Expression) AS Expression

BitShift( a AS Expression, count as Byte) AS Expression
BitRotate( a AS Expression, count as Byte) AS Expression

where Expression boils down to one of the following:
Byte
Short
Integer
Long

If expressions a and b are not the same size the shorter one needs to be
expanded with zeroes (MSB side) to match.

Regards
Werner



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to