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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4ac8a7e7d3e637dc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-23 18:42:00 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: snarflemike@yahoo.com (Mike Silva) Newsgroups: comp.lang.ada Subject: Re: Is there a better (Ada) way? Date: 23 Oct 2003 18:42:00 -0700 Organization: http://groups.google.com Message-ID: <20619edc.0310231742.3677c91f@posting.google.com> References: <20619edc.0310221056.4c92d10c@posting.google.com> <3F96ED50.2040009@comcast.net> <20619edc.0310230857.5da5446f@posting.google.com> <3F984AF5.6030703@comcast.net> NNTP-Posting-Host: 165.247.222.44 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1066959720 8459 127.0.0.1 (24 Oct 2003 01:42:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 24 Oct 2003 01:42:00 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:1569 Date: 2003-10-23T18:42:00-07:00 List-Id: "Robert I. Eachus" wrote in message news:<3F984AF5.6030703@comcast.net>... > Mike Silva wrote: > > "Robert I. Eachus" wrote in message news:<3F96ED50.2040009@comcast.net>... > > > >>> R16 := R16 + Reg16_t( Integer( PB.offset5 ) mod Reg16_t'Modulus ); > >>>-- the above line works, but is it good Ada, or C-in-Ada? > >> > >> R16 := R16 + Reg16_t(PB.offset5); > >> > >>Should do exactly the same thing--but it doesn't. > > > > > > Do you mean that the language should have been defined so that the > > conversion in the 2nd line acts like the 1st, with negative numbers? > > Or ??? > > > > Mike > > Yes. I believe that this will be "fixed" in the next version of the > standard, but for now you will find compilers that raise Robert, thanks a bunch for your insights. Although I'm doing this mostly for my own amusement/edification, I also want to do this cleanly enough that it "shows off" Ada to those who would never imagine looking at Ada for bit-twiddling. BTW, the processor I'm simulating is my favorite 8-bitter, the ill-fated 6809. Thanks again. Mike