|
Message
From: Balaji V. Iyer<bviyer@n...>
Date: Wed May 4 01:04:43 CEST 2005
Subject: [openrisc] Starting Stack Value and arguments passing
Hello Everyone, I have a couple questions about stack and register values initialization. I am also "cut and pasting" a copy of the _start from the object dump of a simple file. My question is, what is the stack register (r1) initialized as? Also, when we have a main function like this: int main(int argc, char *argv[]), How are the argc and argv passed into the function. In the below code, r3 is used, so what value does it originally contain?
Any Help is Appreciated.
Yours Sincerely,
Balaji V. Iyer.
Here is the objdump:
0100016c <_start>: 100016c: 9c 21 ff f8 l.addi r1,r1,0xfffffff8 1000170: d4 01 48 00 l.sw 0x0(r1),r9 1000174: d4 01 10 04 l.sw 0x4(r1),r2 1000178: 9c 41 00 08 l.addi r2,r1,0x8 100017c: a8 a3 00 00 l.ori r5,r3,0x0 1000180: 84 63 ff fc l.lwz r3,0xfffffffc(r3) 1000184: a8 85 00 00 l.ori r4,r5,0x0 1000188: b9 83 00 02 l.slli r12,r3,0x2 100018c: e0 a5 60 00 l.add r5,r5,r12 1000190: 04 00 00 15 l.jal 10001e4 <___uClibc_main> 1000194: 9c a5 00 04 l.addi r5,r5,0x4 1000198: 84 41 00 04 l.lwz r2,0x4(r1) 100019c: 85 21 00 00 l.lwz r9,0x0(r1) 10001a0: 44 00 48 00 l.jr r9 10001a4: 9c 21 00 08 l.addi r1,r1,0x8
|
 |