11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Call frame informationA full description about the calling convention may require extensive call frameinformation. In many cases, a more limited approach will suffice.When describing the call frame information, the following three components must bepresent:●●A names block describing the available resources to be trackedA common block corresponding to the calling convention● A data block describing the changes that are performed on the call frame. Thistypically includes information about when the stack pointer is changed, and whenpermanent registers are stored or restored on the stack.The following table lists all the resources defined in the names block used by thecompiler:ResourceCFAR4–R15R4L–R15LR4H–R15HSPSRPCExampleThe following is an example of an assembler routine that stores a permanent register aswell as the return register to the stack when compiling for the <strong>MSP430</strong> architecture:#include "cfi.m43"DescriptionThe call frames of the stackNormal registersLower 16 bits, when compiling for the <strong>MSP430</strong>X architectureHigher 4 bits, when compiling for the <strong>MSP430</strong>X architectureThe stack pointerThe processor state registerThe program counterTable 25: Call frame information resources defined in a names blockXCFI_NAMES myNamesXCFI_COMMON myCommon, myNamesMODULE cfiexamplePUBLIC cfiexampleRSEGCFICFICODE:CODE:NOROOT(1)Block myBlock Using myCommonFunction 'cfiexample'// The common block does not declare the scratch// registers as undefined.CFI R12 Undefined98<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!