NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: Mathi on October 01, 2012, 10:29:57 AM
-
Hi All,
Is there any sane way to implement structure bitfields similar to C. ?
//sizeof(abc) is 4 bytes though it has 3 ints..
struct abc
{
unsigned int a : 4;
unsigned int b : 24;
unsigned int c : 4;
};
I was thinking of defining bit masks for individual members. But wanted to check if there are other elegant ways.
Thanks,
Mathi.
-
That is more of a C language construct to prevent the compiler from treating members as whole values and force the use of masks.