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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e723b158fb4ad12e X-Google-Attributes: gid103376,public From: Kevin Wells Subject: A little more data Date: 1998/05/05 Message-ID: <6iosig$3mp@bgtnsc01.worldnet.att.net>#1/1 X-Deja-AN: 350675281 Content-Transfer-Encoding: 7bit References: <6iosc2$3mp@bgtnsc01.worldnet.att.net> Content-Type: text/plain; charset=us-ascii Organization: AT&T WorldNet Services Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-05-05T00:00:00+00:00 List-Id: BTW - I'm using the EDS Ada compiler targeted for a 1750A processor hosted on a DEC Alpha platform. If anyone needs any code snippets to help me out, let me know... Thanks again, Kevin Wells Kevin Wells wrote: > When specifying data in an Ada package that is pre-initialized such as > ---------------------------------------- > package Generate_Matrix is > Scale_Factor : float := 10.903; > . > end Generate_Matrix; -- spec > ---------------------------------------- > > 1. Is it normal for the compiler to generate code that sets the value in > memory > (that gets executed when the runtime system is initialized)? > 2. Is there a way to get around this? > > I am trying to create pre-initialized data arrays in memory such as > ---------------------------------------- > type Array_Type is array (1 .. 5) of integer; > Small_Array : Array_Type := (1, 10, 5, 9, -50); > ---------------------------------------- > but the compiler generates a bunch of code to set those 5 memory > locations. > (The actual code generated is about 3 to 5 times the size of the data > area > of the array). This really isn't a problem, except we only have a 64K > machine > with about 48K of it being used already. To make matters worse, a > reserve > of about 25% must be maintained for future changes. (That leaves me with > > about 0 words of memory to add things :) ) I have about 3100 words of > data that is initialized at compile time. > > I have been coding for about 7-1/2 years now. The first 5-1/2 developing > C > and assembly applications..only the last 2 have been in Ada. I feel I > know Ada > pretty good (and I really appreciate the 'control' it gives me in > developing > safe and tolerant code over other langauges). However, I'm not too sure > about how to handle this - In C, a seperate 'pre-initialized data > segment was > kept separately (along with other segments). > > Does anyone have any ideas or suggestions about doing this that fits > within > Ada's elegant realm of development (No external overlays) and allows the > > actual preinitialized data (without the code) to be saved in the final > executable? > > Thanks much, > Kevin Wells, Software Engineer, Boeing > wellsk@netcom.com