Article View: borland.public.jbuilder.java.api
Article #1268Re: A nibble here...
From: R.F. Pels
Date: Tue, 19 Mar 2002 21:14
Date: Tue, 19 Mar 2002 21:14
17 lines
1341 bytes
1341 bytes
Dave wrote:
> I've got a binary file I'm reading in that has command codes in it. One
> set of commands has a hex code B0 - BF which means "change color to" with
> the color being the low order nibble of the byte. How can I pull off the
> nibbles from the bytes?
Subtract B0 hex?
And the command code with 0x0F is probably the fastest:
int color = commandcode & 0xf0;
--
Ruurd
Technical Details
Message-ID:
<3c97aa38_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!cyclone2.usenetserver.com!usenetserver.com!news.maxwell.syr.edu!news1.optus.net.au!optus!intgwlon.nntp.telstra.net!news.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3c9766f6$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,bb1597c09fe1bc82 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-03-19 13:23:38 PST Message-ID: <3c97aa38_2@dnews> From: "R.F. Pels" <ruurd@acklin.nl> Subject: Re: A nibble here... Newsgroups: borland.public.jbuilder.java.api Date: Tue, 19 Mar 2002 22:14:19 +0100 References: <3c9766f6$1_1@dnews> Lines: 17 Organization: Acklin B.V. User-Agent: KNode/0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit NNTP-Posting-Host: 213.51.58.136 X-Trace: dnews 1016572472 213.51.58.136 (19 Mar 2002 13:14:32 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!cyclone2.usenetserver.com!usenetserver.com!news.maxwell.syr.edu!news1.optus.net.au!optus!intgwlon.nntp.telstra.net!news.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews