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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Descriptions of extended keywordsThis may be necessary if the function is called from assembler routines that use theupper 4 bits of the 20-bit registers.Note: The __save_reg20 keyword has only effect when compiling for the <strong>MSP430</strong>Xarchitecture.Example__save_reg20 void myFunction(void);See also Interrupt functions for the <strong>MSP430</strong>X architecture, page 26__taskSyntaxDescriptionExampleFollows the generic syntax rules for type attributes that can be used on functions, seeType attributes, page 189.This keyword allows functions to exit without restoring registers and it is typically usedfor the main function.By default, functions save the contents of used non-scratch registers (permanentregisters) on the stack upon entry, and restore them at exit. Functions declared __taskdo not save any registers, and therefore require less stack space. Such functions shouldonly be called from assembler routines.The function main may be declared __task, unless it is explicitly called from theapplication. In real-time applications with more than one task, the root function of eachtask may be declared __task.__task void my_handler(void);198<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!