From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aac6281ad4fb7480 X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: Bit Manipulations Date: 1999/12/21 Message-ID: <38600E15.FF9657BA@mitre.org>#1/1 X-Deja-AN: 563590382 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.mitre.org X-Trace: top.mitre.org 945818740 20839 129.83.41.77 (21 Dec 1999 23:25:40 GMT) Organization: The MITRE Corporation Mime-Version: 1.0 NNTP-Posting-Date: 21 Dec 1999 23:25:40 GMT Newsgroups: comp.lang.ada Date: 1999-12-21T23:25:40+00:00 List-Id: "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...