Looks like a problem with the docs. I'm seeing the same behavior on similar code. It appears that the SP is modified before the destination is evaluated.

Albert wrote:

Heiko Panther:

Folks,

it turns out that this should be a bug in the compiler as well as in the gdb sim target. Since CALL decrements the stack pointer to save the return address, a register indexed call using the stack pointer must account for this. The SP is decremented before the address of the target operand is calculated; thus, for a SP indexed call, the index must be incremented by 2.

According slau049d  not.  (page 3-29)
"
Syntax               CALL            dst
Operation dst -> tmp dst is evaluated and stored // BEFORE SP modify !
                           SP-2   ->     SP
"
If you want to call a function whose address is located at SP+2, the opcode should be "call 4(r1)".


I check it soon in real part, and if so its TI fault ;-);

Albert


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to