This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28027: Same function C code but assembly code is different

Part Number: TMS320F28027


Hi Champs,

I found out I wrote two piece of code in order to jump to Flash. Both of code can jump to Flash if using assembly step in. But when I check assembly code, I found out there is a difference between 2 code. Could you please tell me why ? thanks!

#define Boot_load_add ((void(*)(void))0x3F7000)
typedef void (*phfv)(void);
phfv shfv  = 0x3F0000;//ggg;

  • This one ...

        Boot_load_add();

    ... uses an absolute constant address.  That constant is loaded into XAR7.  Then the branch.

    This one ...

        shfv();

    ... uses a pointer value in a global memory location named shfv.  The upper bits of the address of shfv are loaded into the DP.  Then the value at the memory location shfv is loaded into XAR7.  Then the branch.

    Thanks and regards,

    -George