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