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,c30642befcd7bf85 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Addresses of Subprograms (was: New GNAT ports) Date: 1997/01/13 Message-ID: <1997Jan13.102240.1@eisner>#1/1 X-Deja-AN: 209561808 x-nntp-posting-host: eisner.decus.org references: <5asvku$jtu$1@goanna.cs.rmit.edu.au> <32D2B847.6A7@lmtas.lmco.com> <5avfqo$it9$1@goanna.cs.rmit.edu.au> <1997Jan11.152602.1@eisner> x-nntp-posting-user: KILGALLEN x-trace: 853168969/20720 organization: LJK Software newsgroups: comp.lang.ada Date: 1997-01-13T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) writes: > Richard said > > "The only reason that I bothered about the placement of code at all > was that the 8051 book I was studying included a memory test program > that did this. According to the Ada 83 LRM I had handy, you _couldn't_ > supply address clauses for code." > > That is wrong, Ada 83 did allow you to specify the address of a subprogram, > and in fact using this in conjunction with pragma Interface was a well > known way of fooling a compiler into providing a mechanism equiavlent to > an indirect call: These two uses for specifying the address of code (memory test vs. indirect call) would seem to conflict in the case of Alpha VMS where the "procedure value" commonly passed as the "address" of a subprogram is quite different from the address of the first instruction of the subprogram executable code. I am curious regarding the approach ACT is taking in this regard. The need for fooling the compiler goes away in Ada95, and the use of a different mechanism in DEC Ada means code migrating from there would not depend on that trick for indirect calls. Macintosh 68K images depend heavily on a "jump table" where once again the "address" of a routine is quite a different thing from the location of its code (and, in fact, the location of the code might not be resolved until call time). Do other operating systems have this separation, and which is the "true" meaning for specifying the address of a subprogram from an Ada perspective ? Larry Kilgallen