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,28db79a4b238c104 X-Google-Attributes: gid103376,public From: Samuel Mize Subject: Re: What's wrong with this simple Ada w/ assembly code? Date: 1999/03/04 Message-ID: <7bmjrm$kjt@news1.newsguy.com>#1/1 X-Deja-AN: 451264518 References: <36ddb9aa.0@silver.truman.edu> <7bm0kb$8uj$1@nnrp1.dejanews.com> <7bmb69$1bh$1@its.hooked.net> Organization: ImagiNet Communications, Ltd. User-Agent: tin/pre-1.4-981002 ("Phobia") (UNIX) (AIX/3-2) Newsgroups: comp.lang.ada Date: 1999-03-04T00:00:00+00:00 List-Id: Mike Silva wrote: > > robert_dewar@my-dejanews.com wrote in message > <7bm0kb$8uj$1@nnrp1.dejanews.com>... >> >>GNAT simply follows the standard ABI, so if you follow >>this you should have no trouble. If you don't know the >>ABI, you are indeed wandering in the dark. > > > What exactly is ABI? I've haven't found the term in the ARM or Rationale or > any of my books. Application Binary Interface, if I recall correctly. It's a standard that defines how systems utilities are called, at the assembler level. All the system routines will follow a consistent set of rules about how they are to be called. These define, for instance, what order parameters should be on the stack, whether the caller has shifted the stack pointer before making the call, and so on. You *have* to follow these rules to make system calls from assembler (and your compiler has to follow them to make those system calls for you). You can make up your own rules for your own assembler subroutines, but you'd be stupid to do so (in most cases). The smartest thing is to find out how your operating system expects subroutine calls to be coded, and code your assembly that way. If you do so, you're also coding it the way the compiler expects things to be done. So, an assembly routine that's coded in accordance with the ABI can be called by other assembly routines, or by routines coded in any language, if you have a half-decent compiler (or better). Best, Sam Mize -- Samuel Mize -- smize@imagin.net (home email) -- Team Ada Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam