Related articles |
---|
Setting up alpha stack frames tim.jones@mail.com (2003-05-06) |
Re: Setting up alpha stack frames Len.Lattanzi@Migration.com (2003-05-14) |
Re: Setting up alpha stack frames firefly@diku.dk (Peter \Firefly\Lund) (2003-05-14) |
Re: Setting up alpha stack frames anton@mips.complang.tuwien.ac.at (2003-05-14) |
From: | Len.Lattanzi@Migration.com (Len) |
Newsgroups: | comp.compilers,comp.arch |
Date: | 14 May 2003 00:43:45 -0400 |
Organization: | The Internet MainStreet, Inc. |
References: | 03-05-046 |
Keywords: | architecture |
Posted-Date: | 14 May 2003 00:43:45 EDT |
On 6 May 2003 19:18:05 -0400, Timothy Jones <tim.jones@mail.com> wrote:
>Hi all,
>
>I'm having some trouble adding an instruction (even if it's a nop) to
>the start of a procedure before the stack frame is initialised. I want
>to put it here because I want it to go before any other instruction is
>executed in each basic block.
>
>The first problem I had was with alignment. I started with the
>following code, where hello is the name of a simple procedure which
>prints "Hello World!". I added the nop at the start and get this
>error:
>
>hello:
> nop
> ldgp $gp,0($27)
$27 has the address of hello in it per Alpha calling convention.
ldgp loads $gp based on this address and some PC relative operation.
See what's going to happen? $gp will be off by 4. Two nops should
"hide" the alignment problem but still leave you with an invalid $gp
now off by 8. This is from memory so don't quote me. I suggest you
single step with and without the no-op to verify this.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.