public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Farmer <news02@lavabit.com>
To: gcc-help@gcc.gnu.org
Subject: Register Usage
Date: Tue, 28 Apr 2009 16:06:00 -0000	[thread overview]
Message-ID: <23279910.post@talk.nabble.com> (raw)


Hi,

I am trying to understand how the general purpose registers are used by the
GCC compiler. Most I have been able to work out but have these questions.

Register R12 is initialised in my startup code to the same value as the SP
(R13) but it never appears to be used for anything. Whats the purpose of
this register?

I have looked at the ARM and THUMB procedure call standard (briefly) and it
looks as though R7 is the Thumb-state Work register or variable register.
However, looking at the assembly code produced for functions it is clearly
being used as the frame pointer. Why is there a difference?

Is there a defining text somewhere that details GCC register usage when
compiling for a Cortex-M3 chip?

I am using GCC V4.1.1 and a STM32F103RB (Cortex-M3) microcontroller.

Regards


-- 
View this message in context: http://www.nabble.com/Register-Usage-tp23279910p23279910.html
Sent from the gcc - Help mailing list archive at Nabble.com.

             reply	other threads:[~2009-04-28 16:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 16:06 John Farmer [this message]
2009-04-28 16:50 ` Ian Lance Taylor
2009-04-28 22:06   ` John Farmer
2009-04-29  0:27     ` Ian Lance Taylor
2009-04-29  7:57       ` John Farmer
2009-04-29  9:27     ` Richard Earnshaw
2009-04-29 10:18       ` John Farmer
2009-04-29 10:38         ` Richard Earnshaw
2009-04-29 12:14           ` John Farmer
2009-04-29 13:34             ` Richard Earnshaw
  -- strict thread matches above, loose matches on Subject: below --
2006-07-12  1:27 gcc binary format output Victor Roman Archidona
2006-07-12  4:39 ` Ian Lance Taylor
2006-07-12  5:35   ` Victor Roman Archidona
2006-07-12  5:57     ` Ian Lance Taylor
2006-07-12  8:58       ` register usage Petar Bajic
2006-07-12 12:48         ` Andrew Haley
2006-07-13 12:33           ` Petar Bajic
2006-07-13 12:45             ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23279910.post@talk.nabble.com \
    --to=news02@lavabit.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).