From: snarflemike@yahoo.com (Mike Silva)
Subject: Re: Is there a better (Ada) way?
Date: 23 Oct 2003 18:42:00 -0700
Date: 2003-10-23T18:42:00-07:00 [thread overview]
Message-ID: <20619edc.0310231742.3677c91f@posting.google.com> (raw)
In-Reply-To: 3F984AF5.6030703@comcast.net
"Robert I. Eachus" <rieachus@comcast.net> wrote in message news:<3F984AF5.6030703@comcast.net>...
> Mike Silva wrote:
> > "Robert I. Eachus" <rieachus@comcast.net> 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
<good stuff snipped>
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
next prev parent reply other threads:[~2003-10-24 1:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-22 18:56 Is there a better (Ada) way? Mike Silva
2003-10-22 19:33 ` sk
2003-10-23 18:33 ` Mike Silva
2003-10-22 20:50 ` Robert I. Eachus
2003-10-23 16:57 ` Mike Silva
2003-10-23 21:42 ` Robert I. Eachus
2003-10-24 1:42 ` Mike Silva [this message]
2003-10-23 3:12 ` Steve
2003-10-23 18:30 ` Mike Silva
2003-10-24 22:20 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox