public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: ework0 <ework0@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: sparc stack analysis
Date: Fri, 28 Oct 2005 00:55:00 -0000	[thread overview]
Message-ID: <43616EB2.9030909@gmail.com> (raw)

Hello,

I have strong interest in sparc architecture, assuming this small program:
-bash-3.00$ cat foo.c
#include<stdio.h>

void func1(char *);
void func2(char *);

main(int argc, char *argv[])
{
        char foo[256];
        strcpy(foo,argv[1]);
        func1(foo);
        exit(1);
}
void
func2(char *foo){
        char hello[128];
        strcpy(hello,foo);
        printf("%s\n",foo);
}

void
func1(char *foo){
        func2(foo);
        }

1. Would anyone mind to detailed describe how a function main() calls 
func1() and func2() as well. I have interested in, where is stored the 
return address from main()? how does it work the save/ret schema?

2. What are the components of a typical sparc stack? What are the most 
important registers to know?

I know this is a bit off-topic but I am sure many users of this lists,  
specially  those with interest on Sparc architecture, would find this 
very useful.

Thanks for any help,  diagram, link, document,

ework0

             reply	other threads:[~2005-10-28  0:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-28  0:55 ework0 [this message]
2005-10-28 11:03 ` John Love-Jensen

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=43616EB2.9030909@gmail.com \
    --to=ework0@gmail.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).