home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19660 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.2 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!att!cbnewsc!cbfsb!cbnewsg.cb.att.com!nh
  3. From: nh@cbnewsg.cb.att.com (nicholas.hounsome)
  4. Subject: Re: How does one use 68000 subroutines with C++ ???
  5. Message-ID: <1993Jan21.101439.16841@cbfsb.cb.att.com>
  6. Sender: news@cbfsb.cb.att.com
  7. Organization: AT&T
  8. References: <C1640F.54y@cs.uiuc.edu>
  9. Date: Thu, 21 Jan 1993 10:14:39 GMT
  10. Lines: 24
  11.  
  12. From article <C1640F.54y@cs.uiuc.edu>, by ctaylor@cs.uiuc.edu (Conrad Taylor):
  13. >          I was wondering , is there anyway to use assembly language
  14. > routines with C++?  I'm using SunOS operating system with AT&T 2.1
  15. > CC compiler (cfront).  Thanks in advance to all that reply to this     
  16. > post.
  17. > -Con(rad)
  18. > ps: Please e-mail me at ctaylor@silver.lcs.mit.edu or
  19. >     taylor1@wse.eecs.uic.edu.
  20.  
  21. The easiest way is to declare them as extern "C" and write them as 
  22. you would for C.
  23.  
  24. Usualy this means A6 is the frame pointer, A0,A1 & D0,D1 are scratch
  25. registers and the arguments are pushed onto the stack in reverse order
  26. by the caller who removes them after the call. results are usualy
  27. returned in D0. 
  28.  
  29. Almost everyone does it this way except gnu.
  30.  
  31. Nick Hounsome AT&T Network Systems UK Ltd
  32.