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,53a810f13e8ba40 X-Google-Attributes: gid103376,public From: "Keith Allan Shillington" Subject: Re: Byte/Bit Twiddling in Ada Date: 1997/02/14 Message-ID: <01bc1ac5$627c15f0$fc00af88@godiva>#1/1 X-Deja-AN: 218860731 Sender: news@thomsoft.com (USENET News Admin @flash) X-Nntp-Posting-Host: leonidas References: <5dvfnn$olj@neocad.xilinx.com> Organization: Aonix, San Diego, CA, USA Newsgroups: comp.lang.ada Date: 1997-02-14T00:00:00+00:00 List-Id: Assumptions( Longword => 32 bits, Ada => Ada95 ); Given that: take this: type Longword is mod 2**32; -- your milage may vary L, M: Longword; begin L := 16#DEADBEEF#; M := L or 16#21727110#; -- M should now be 16#FFFFFFFF# want more? See RM95 3.5.4 Jim Kruse wrote in article <5dvfnn$olj@neocad.xilinx.com>... > I'm relaying a question for a friend without Net access. > > Is there any portable way to do byte and bit manipulation in Ada, on a > long word? I found no mention of this topic in the FAQ. > > He is trying to avoid any non-Ada construct. By this I think he means > architecture-specific features (apparently there is a mechanism on the > DEC Alpha machines, but he's not using an Alpha). > > My friend is trying to write some code that does byte swapping, > presumably to handle conversions to and from IEEE number formats. > > Is there a package or library that handles this problem? > > -- > Jim Kruse > Xilinx, Inc. > PGP Public Key available upon request >