Problem: I need to get a block of data (a structure) from PC->SPARC
over a serial line. The actual data transfer using read() is no problem,
but this structure contains bitfields. The byte reordering for multi-byte
values is no problem, but bitfields are NOT handled the same at all.
Has anyone done anything similar to this before, and have some easier
way out than pure manual twiddling?
The problem: the bits themselves have to be reversed. Also, I'm not sure
yet whether the SPARC allocates the whole 16 bits for an unsigned short:5,
or whether it only allocates those 5 bits! I believe the PC allocates
the whole amount, and the rest is just wasted, but at least it's easy to
manipulate code-wise. I need some kind of "converter" to reassemble the
structure on the SPARC side from the data sent by the PC.
I'm using Watcom C 9.5 and SUN SPARCCompiler C 3.0
Steve Sanderson | In God we trust;