comp.lang.ada
 help / color / mirror / Atom feed
From: visicom!rlk@nosc.mil  (Bob Kitzberger)
Subject: Re: Basic embedded concepts and Ada
Date: 12 Jan 93 22:12:18 GMT	[thread overview]
Message-ID: <262@visicom.com> (raw)

hawkinsg@saifr00.cfsat.honeywell.com (Glenn Hawkins) writes:

> Although our compiler is 
> pretty efficient with word and byte level accesses, it pretty much chokes on 
bit 
> level accesses, so representing the different registers as records of bits 
> (appropriately rep spec'ed, of course) doesn't seem practical.

Too bad; that's the preferred approach.

>I think that to set bits in these registers it would be easiest for
>me to define the objects representing the registers as 32-bit integers, allowi
ng
>me to simply add constants (1, 2, 4, 8, etc.) representing the different bits
>I want to set. Just like I would in JOVIAL, C, etc.

Don't forget that unsigned 32-bit integers are rarely supported in Ada
on 32-bit CPUs, so it's not as easy as you might wish to set the MSB.

>Seeing if a bit has been set seems more difficult.  [...] I would like to
avoid machine code insertions if possible.  Any ideas?

Since bit-level rep specs appear to be broken in your compiler, I'd use
machine code insertions to implement ANDs, ORs, etc.  I know you want
to avoid them (for portability reasons?), but if they're documented
as a workaround you can mitigate risk.

Then, call your Ada compiler vendor and ask them to fix rep specs.

	.Bob.
----------------
Bob Kitzberger          VisiCom Laboratories, Inc.
rlk@visicom.com         10052 Mesa Ridge Court, San Diego CA 92121 USA
                        +1 619 457 2111    FAX +1 619 457 0888

             reply	other threads:[~1993-01-12 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-01-12 22:12 Bob Kitzberger [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-01-06 18:15 Basic embedded concepts and Ada Mark A Biggar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox