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,53a810f13e8ba40 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Byte/Bit Twiddling in Ada Date: 1997/02/15 Message-ID: #1/1 X-Deja-AN: 218979989 References: <5dvfnn$olj@neocad.xilinx.com> <33048844.7AEB@elca-matrix.ch> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-02-15T00:00:00+00:00 List-Id: Mats said <> You are making entirely unwarranted assumptions about the mapping of bit positions to high or low order, there is no such guarantee. Even if you know the endianness, you cannot make such assumptions. If you want a right shift, the portable way to write this is to use the predefined right shift operation! Note that in GNAT, the shift operators can be defined for any integer type, including user defined ones, by writing the appropriate pragma Import (Intrinsic) declarations. This however is defintiely NOT required to work by the RM. The only thing the RM guarantees is that the predefined shift operations in interfaces will work.