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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbd507df3efa824b,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-22 03:30:10 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: r_c_chapman@my-deja.com Newsgroups: comp.lang.ada Subject: Help with Atomic_Components and whole array assignment Date: Mon, 22 Jan 2001 11:22:42 GMT Organization: Deja.com Message-ID: <94h55t$9a1$1@nnrp1.deja.com> NNTP-Posting-Host: 193.114.91.187 X-Article-Creation-Date: Mon Jan 22 11:22:42 2001 GMT X-Http-User-Agent: Mozilla/4.73 [en] (WinNT; U) X-Http-Proxy: 1.0 PROXY, 1.0 x59.deja.com:80 (Squid/1.1.22) for client 193.114.91.187 X-MyDeja-Info: XMYDJUIDr_c_chapman Xref: supernews.google.com comp.lang.ada:4296 Date: 2001-01-22T11:22:42+00:00 List-Id: Having a slight confusion over the use of array aggregate assignments with Atomic_Components. We have a device which _has_ to be accessed use byte-wide load and store instructions only (it's an autostore NOVRAM...), so we have an array of bytes declared, thus: type Byte is range 0 .. 255; for Byte'Size use 8; for Byte'Alignment use 1; type Index is range 0 .. 4; -- for argument's sake! type Byte_Array is array (Index) of Byte; pragma Volatile (Byte_Array); pragma Atomic_Components (Byte_Array); A : Byte_Array; for A'Address use ... all fine so far. When we initialise this array, thus: A := Byte_Array'(others => 0); compiler A generates 1 Word-sized store and 1 Byte-sized store. (Target is PowerPC by the way.) Compiler B (or should that be "G" :-) ) generates similar code on IA32. Can anyone confirm this is indeed acceptable behaviour? PS...Yes I know the Byte should probably be modular, but this is SPARK, and we haven't got them implemented (yet... :-) ) Thanks, Rod Sent via Deja.com http://www.deja.com/