comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <eachus@mitre.org>
Subject: Re: Bit Manipulations
Date: 1999/12/21
Date: 1999-12-21T23:25:40+00:00	[thread overview]
Message-ID: <38600E15.FF9657BA@mitre.org> (raw)
In-Reply-To: B9063F55105FD21189FE0000F8103B5B0216503E@emss35m04.owg.fs.lmco.com

"Simon, Jb" wrote:

> For instance, I get a byte from a hardware port and want to mast off the
> parity bit ( 16#07F#).
> 
> I want to do...
> 
> char_data := char_data AND 16#07F#

   If char_data is declared as:

   type char is array(0..7) of Boolean; -- or 1..8 or whatever.
   char_data: char;

   then just write:

   char_data := char_data and char_data'(false, others => true);

   In Ada 95 you can use modular types to allow your version to work.

-- 

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  parent reply	other threads:[~1999-12-21  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-20  0:00 Bit Manipulations Simon, Jb
1999-12-21  0:00 ` Ted Dennison
1999-12-21  0:00 ` Mats Weber
1999-12-21  0:00 ` Robert I. Eachus [this message]
1999-12-21  0:00 ` tmoran
1999-12-21  0:00   ` Matthew Heaney
     [not found] <B9063F55105FD21189FE0000F8103B5B0216503E@emss35m04.owg.fs.lmco .com>
1999-12-21  0:00 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox