Date: Thu, 13 Mar 1997 13:23:34 -0500 (EST) From: "art s. kagel IFMX x2697" To: Dave Smith Cc: djgpp AT delorie DOT com Subject: Re: Simple Question In-Reply-To: <5g8poh$q7u@Chaos.es.co.nz> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 > >