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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a84a01d2859560a0 X-Google-Attributes: gid103376,public From: "Vincent P. Amiot" Subject: Re: bit operations on integers Date: 1999/05/04 Message-ID: <01be95c3$cae26ab0$3503af88@alesia>#1/1 X-Deja-AN: 473712292 Sender: news@sd.aonix.com (USENET News Admin @flash) X-Nntp-Posting-Host: dhcp-3.53 References: <7gkhr7$5kr$1@nnrp1.dejanews.com> Organization: Aonix Newsgroups: comp.lang.ada Date: 1999-05-04T00:00:00+00:00 List-Id: On Aonix/Alsys compilers there is a package 'Unsigned' that defines "and" and "or" for 8 and 16 bit integers: -- test Bit4 if (X and 2#0001_0000#) > 0 then you can always resort to unchecked-convert to packed arrays of booleans of the right size and implement your own. A side note: To represent 32 bit int in Ada83 when BIT31 is set (most of the Ada83 compiler do no accept: type X is range 0 .. 2**32-1; -- this would theoretically require the availability of a 33 bit integer base type... Bias : constant := 2**32; K : constant := 16#AAAA_BBBB# - BIAS; same bit pattern but negative! Have fun! Vincent Amiot Principal Consultant / Aonix -- phadreus@iname.com wrote in article <7gkhr7$5kr$1@nnrp1.dejanews.com>... > > > How do I test, set, and clear individual bits in an integer > in Ada 83? > > Thank you. > > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own >