AnsweredAssumed Answered

FP register use by compiler

Question asked by Bobperet on Oct 10, 2013
Latest reply on Oct 14, 2013 by Bobperet

I am trying to better understand how the FP, and SP registers are used by the LINK / UNLINK assembler commands, and how the crosscore compiler generates code for C++ function calls.

I have read:

  • Function Call and Return section in the "C/C++ Compiler and Library Manual for Blackfin Processors"
  • Stack Variables and Parameter Passing in the "Blackfin Processor Programming Reference"


My specific question is:

  • In the following disassembled code, Why is R0 being stored outside of the current frame (and stack)?


int Button::getButtonMap()
   16d18:    00 e8 00 00     LINK 0x0;        /* (0) */
   16d1c:    b8 b0           [FP + 0x8] = R0;


I do understand that the LINK N command saves RETS, and FP on the stack, then moves FP to point at the saved FP, and SP to point at FP + N.

Any help would be greatly appreciated.