From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 12 Jan 93 22:12:18 GMT From: visicom!rlk@nosc.mil (Bob Kitzberger) Subject: Re: Basic embedded concepts and Ada Message-ID: <262@visicom.com> List-Id: 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