Mail Archives: djgpp/1997/03/13/13:41:36
I assume that you need to know the value of the high nibble of a byte. Try:
a = 0x1234;
b = a >> 4 & 0xFF; /* The '& 0xFF' is to mask any sign extension which is
not necessary if a is type 'unsigned char' but is if
a is type char since char is signed by default. */
Art S. Kagel, kagel AT ts1 DOT bloomberg DOT com
On 13 Mar 1997, Dave Smith wrote:
> Heya peoples,
>
> I have a simple question (I hope) for some of you out there :)
> How in C (esp. GCC) do I find the high order of a byte, in Turbo
> pascal I would do this... a := Hi($1234) which would return ($12),
> how can I do this in DJGPP?
>
> Thanks heaps
> Dave
>
>
- Raw text -