Op 27 Jun 2008 11:57:42 GMT schreef John B:
> On 26/06/2008 Coos Haak wrote:
>
>> Op Thu, 26 Jun 2008 01:10:21 -0500 schreef Mohan kumar:
>>
>>> Hi thanks for your reply,
>>>
>>> the puzzling question that rocks my mind is why should they
>>> terminate the stack by subtracting 64 with the stack pointer(r1)
>>>
>>> addi r1,r11,__stackstart_pt@[EMAIL PROTECTED]
>>> addi r1,r11,__stackstart_pt@[EMAIL PROTECTED]
>>> addi r0,r0,0
>>> stwu r0,-64(r1)
>>>
>>> 1. first two lines of code have defined the stack pointer(r1)
>>> 2. third lines has cleared register r0.
>>> 3. r1 is the stack pointer(sp) and sp is already initialised by
>>> first two lines. and in the fourth line, they carry out this
>>> operation on stack pointer "stwu r0,-64(r1)" Instruction does
>>> the following. => Effective address(EA) r1-64
>>> => EA is stored in stack pointer(r1)
>> Wrong. EA is nowhere stored
>
> Yes, it is; the calculated value of EA is loaded into r1. See here:
>
> http://pds.twi.tudelft.nl/vakken/in1200/labcourse/instruction-set/stwu.h
> tml
>
>>> => value at the effective address is cleared to zero.
>>>
>>> Why should the stack pointer will now hold the address given by EA.?
>>>
>>> Any guess?
>
>> No guess, EA is only used to determine the address where the value of
>> r0 is to be stored.
>
> Wrong. See link above.
I didn't know the instruction set of the Power PC, obviously.
Some time ago I searched for it, but to no avail.
Now I know that u stands for update.
Thank you!
--
Coos


|