Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!mcsun!unido!eso!lzago From: lzago@eso.org (Lorenzo Zago) Newsgroups: comp.sys.amiga.programmer Subject: How are registers assigned to C functions args ? Message-ID: <1991Jun10.080025.27797@eso.org> Date: 10 Jun 91 08:00:25 GMT Article-I.D.: eso.1991Jun10.080025.27797 Sender: news@eso.org Organization: ESO - European Southern Observatory, Garching by Munich Lines: 26 Originator: lzago@pj1 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. I am using LibTool from Jeff Glatt and I modify the generated library assembler code to push the arguments so that they can be "seen" also when calling from AmigaBasic. Everything is fine as long as the arguments of all my library functions are "long"s and the function just does simple aritmetics. In these cases it appears that my arguments are found in registers d0,d1,d2,etc. 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. Can anyone help ? Thanks in advance. Lorenzo Zago Uucp: lzago@eso.uucp or eso!lzago ESO - European Southern Observatory Earn: lzago@dgaeso51 Karl Schwarzschild Str. 2 Span: esom1::lza D-8046 Garching bei Muenchen Internet: user%eso.uucp@EU.net Germany (West) Internet: user@eso.org (not sure yet) Tel: +49 89 320 06 0 Fax: +49 89 320 23 62 --------------------------------------------------------------------------