home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11702 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  1.5 KB

  1. 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
  2. From: paulk@terapin.com (Paul Kienitz)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Registers from C
  5. Message-ID: <paulk.0xau@terapin.com>
  6. Date: 28 Jul 92 02:09:54 GMT
  7. References: <14q2h5INNoee@darkstar.UCSC.EDU>
  8. Organization: BBS
  9. Lines: 30
  10.  
  11. > To quote the 2.0 RKM:Includes & Autodocs page 647 NP_Arguments entry:
  12. >       "cstring of arguments - passed with str in a0, length in d0."
  13. > Ok.  So, assuming the function is CreateNewProc()-ing correctly, how
  14. > do I pull these arguments out of the registers from C.  I realize this
  15. > is a probably a very simple thing to do, but I would really appreciate
  16. > help from anyone with some experience.
  17.  
  18. Depends on your particular C compiler.  SAS, Aztec, and DICE all do
  19. this in different ways.  If you are using CreateNewProc to start a
  20. process where the entry point is a function like this:
  21.  
  22.    long Sub_process_main(char *argline, long arglen)
  23.  
  24. Then in Aztec you would put
  25.  
  26.    #pragma regcall(Sub_process_main(a0, d0))
  27.  
  28. before the function.  Or you can use #pragma intfunc with the same
  29. syntax and it will set up the small-data A4 register for you.
  30.  
  31. In SAS it's something vaguely like:
  32.  
  33.    long Sub_process_main(register __a0 char *argline,
  34.                            register __d0 long arglen)
  35.  
  36. but don't quote me on that because I don't use it.
  37.  
  38. As for DICE, I dunno.
  39.