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

Reply via email to