home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!yale.edu!yale!gumby!destroyer!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcomsv!terapin!paulk
- From: paulk@terapin.com (Paul Kienitz)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Registers from C
- Message-ID: <paulk.0xau@terapin.com>
- Date: 28 Jul 92 02:09:54 GMT
- References: <14q2h5INNoee@darkstar.UCSC.EDU>
- Organization: BBS
- Lines: 30
-
- > To quote the 2.0 RKM:Includes & Autodocs page 647 NP_Arguments entry:
- >
- > "cstring of arguments - passed with str in a0, length in d0."
- >
- > Ok. So, assuming the function is CreateNewProc()-ing correctly, how
- > do I pull these arguments out of the registers from C. I realize this
- > is a probably a very simple thing to do, but I would really appreciate
- > help from anyone with some experience.
-
- Depends on your particular C compiler. SAS, Aztec, and DICE all do
- this in different ways. If you are using CreateNewProc to start a
- process where the entry point is a function like this:
-
- long Sub_process_main(char *argline, long arglen)
-
- Then in Aztec you would put
-
- #pragma regcall(Sub_process_main(a0, d0))
-
- before the function. Or you can use #pragma intfunc with the same
- syntax and it will set up the small-data A4 register for you.
-
- In SAS it's something vaguely like:
-
- long Sub_process_main(register __a0 char *argline,
- register __d0 long arglen)
-
- but don't quote me on that because I don't use it.
-
- As for DICE, I dunno.
-