I am struggling trying to come up with a clean way to redefine some register bitfields to be usable on a chip I am working with.
For example, this is what one ...
In this question, assume all integers are unsigned for simplicity.
Suppose I would like to write 2 functions, pack and unpack, which let you pack integers of smaller width into, say, a ...
I wanted to replace bit/bits(more than 1) in a 32/64 bit data field without affecting other bits.Say for example:
I have a 64 bit register where bits 5&6 can take values 0,1,2,3.
I've been doing some reading about bitfields in C, how the C standard doesn't enforce any particular ordering of the fields in a machine word, and so on.
I hope this question ...