I have a a C bifield to port:
My C book tells me that C compiles bitfields into a contiguous stream of bits
regardless of the member type declaration, so the port to PB would seem to be:
I presume that I port C code like:
over to PB as:
Look right?
Thanks!
------------------
Mark Newman
[This message has been edited by Mark Newman (edited May 01, 2001).]
Code:
typedef struct BIT_FIELD_STRUCT { ULONG b1 : 4; // bits[3:0] ULONG b2 : 4; ULONG b3 : 4; ULONG b4 : 4; ULONG b5 : 4; ULONG b6 : 4; ULONG b7 : 4; ULONG b8 : 4; // bits[31:28] } BIT_FIELD;
regardless of the member type declaration, so the port to PB would seem to be:
Code:
TYPE BIT_FIELD BitField as DWORD END TYPE
Code:
ABitField.b1 = 0x09
Code:
ABitField.BitField = ABitField.BitField AND &HFFFFFFF0 ' Clear the lowest 4 bits ABitField.BitField = ABitField.BitField OR &H09 ' Set the lower 4 bits to the new value
Thanks!
------------------
Mark Newman
[This message has been edited by Mark Newman (edited May 01, 2001).]
Comment