Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!uunet!cbmvax!carolyn From: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: How are registers assigned to C functions args ? Message-ID: <22409@cbmvax.commodore.com> Date: 13 Jun 91 17:08:31 GMT References: <1991Jun10.080025.27797@eso.org> Reply-To: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Organization: Commodore, West Chester, PA Lines: 29 In article <1991Jun10.080025.27797@eso.org> lzago@eso.org (Lorenzo Zago) writes: >I am trying to write a shared library callable both in AmigaBasic and C. >Because I am very poor in assembler I wish to write all the library >functions in C. >[] >However, when in my library functions there is a call to an Intuition >function, I find that an argument, say a window pointer, is now in a0. >In order to modify correctly the code generated by LibTool and to write >the correct .fd file (also required to get the .bmap file for AmigaBasic) >I need to identify, or better, to define which registers are actually used. Read the Intro in the RKM Libs and Devs All system library functions expect longs. All system library functions, unless specifically documented otherwise in their autodoc, trash a0, a1, and d1, and return their result in d0 (or trash d0 if they have no result). All system library functions expect A6 to contain their library base. -- ========================================================================== Carolyn Scheppner -- Tech. Mgr. CATS - Commodore Amiga Technical Support PHONE 215-431-9180 {uunet,rutgers}!cbmvax!carolyn carolyn@commodore.com Reentrant code - the only way to fly. ==========================================================================