home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / amiga / programm / 19291 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.9 KB  |  46 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!ukma!gatech!concert!sas!mozart.unx.sas.com!wonka.unx.sas.com!sassek
  3. From: sassek@wonka.unx.sas.com (Steve Krueger)
  4. Subject: Re: 680x0 register usage on Amiga?
  5. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  6. Message-ID: <C1KHpx.2rG@unx.sas.com>
  7. Date: Thu, 28 Jan 1993 14:03:32 GMT
  8. References: <1993Jan27.214002.23569@fcom.cc.utah.edu>
  9. Nntp-Posting-Host: wonka.unx.sas.com
  10. Organization: SAS Institute Inc.
  11. Lines: 33
  12.  
  13. In article <1993Jan27.214002.23569@fcom.cc.utah.edu> val@news.ccutah.edu (Val Kartchner) writes:
  14. >
  15. >I usually program the Amiga in C.  When I want to get the maximum speed in
  16. >a core routine, I go to assembly language.  However, I'm not sure which
  17. >CPU registers are allocated and which are free for me to use when programming.
  18. >Here is the list as I understand it:
  19. >
  20. >        D0     Integer return value
  21. >        D1     Scratch register (need not be restored)
  22. >        D2-D7  Static registers (restore to values at entry)
  23. >        A0     Address return value
  24. >        A1     Scratch register
  25. >        A2-A3  Static registers
  26. >        A4     Base pointer (Points to base of global data)
  27. >        A5     Frame pointer (Contains old stack pointer)
  28. >        A6     Library base pointer (MUST be set to base of library
  29. >               when calling library routines)
  30. >        A7     Stack pointer
  31. >        CCR    Scratch register (Condition Code Register is not restored)
  32. >
  33. >Is this correct?  Please correct any terminology misusages that I may have
  34. >made.
  35. >
  36. Pretty close, but A2-A6 must be restored to the value that they were
  37. at entry just like d2-d7. Also note that A5 is used as a frame pointer
  38. only in some C compilers. In SAS/C 6.x, it is not used as a frame pointer,
  39. since we generate code that doesn't need a frame pointer.
  40.  
  41. Also, FP0-FP1 are scratch, FP2-FP7 must be restored.
  42.  
  43. >            Thanks in advance,
  44. >                -=:[ VAL ]:=-
  45.  
  46.