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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e615e5c9d121e052 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.82.202 with SMTP id k10mr1382718pay.0.1358196771606; Mon, 14 Jan 2013 12:52:51 -0800 (PST) Received: by 10.50.220.231 with SMTP id pz7mr2505167igc.8.1358196769765; Mon, 14 Jan 2013 12:52:49 -0800 (PST) Path: s9ni106366pbb.0!nntp.google.com!f6no13178269pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 14 Jan 2013 12:52:49 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: From 16 bit to 32 From: Adam Beneschan Injection-Date: Mon, 14 Jan 2013 20:52:51 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-01-14T12:52:49-08:00 List-Id: On Monday, January 14, 2013 12:21:38 PM UTC-8, Scott Loyd wrote: > Hi all,=20 >=20 > This is probably a silly question but I have to ask. I have a large legac= y application written primarily in Ada with some machine code for interfaci= ng with an old 16 bit 1750A processor. I would like to take this code and e= xecute it on 32 bit linux. I know that the machine code must be replaced. M= y question is for references to address types in the Ada code, is there a w= ay to get around manually fixing all the record layout specifications and t= he like using a compiler configuration or pragma or (other)? Can I save a l= ittle work or do I need to brute force recode everything? >=20 >=20 >=20 > type A is record > Address : System.Address; > end record; >=20 > for type A use record > -- Change this??? > --Address at 0 range 0..15; > Address at 0 range 0..31 > end record; I don't think you'll be able to get around changing everything. If you giv= e a representation clause for a record component that isn't big enough to h= old the component, the program won't compile. Maybe there's an Ada compile= r with an option to ignore representation clauses, but I don't know of any. The question I think you should ask, though, is: why do you need a represen= tation clause? Representation clauses are useful if the type will be commu= nicated with the "outside" world--e.g. if it will be passed to a library ro= utine not written in Ada, or perhaps written to a file where the format of = the file is dictated by some other specification. But if your program is d= oing that, then changing from a 16- to a 32-bit address type will cause oth= er problems, since you'll be violating the specifications or the expectatio= ns of other programs or libraries that look at that record. If those other= programs or libraries, or outside specifications, have also changed, then = it shouldn't be surprising that you'd need to change all the representation= clauses. On the other hand, if there aren't any "outside" programs or libraries or s= pecifications dictating the format of the record, then maybe there's no goo= d reason to have a representation clause, and you should consider just dele= ting them instead of changing them. I really don't know. I'd have to know= more about the application, and I could have missed some reasons why a rep= resentation clause might be needed. -- Adam=20