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.

Calling conventionStack parameters and layoutStack parameters are stored in the main memory starting at the location pointed to bythe stack pointer. Below the stack pointer (towards low memory) there is free space thatthe called function can use. The first stack parameter is stored at the location pointed toby the stack pointer. The next one is stored at the next even location on the stack. It isthe responsibility of the caller to remove the parameters from the stack by restoring thestack pointer.Figure 4: Stack image after the function callNote: The number of bytes reserved for the return address depends on the --coreoption, see Calling functions, page 97.FUNCTION EXITA function can return a value to the function or program that called it, or it can have thereturn type void.The return value of a function, if any, can be scalar (such as integers and pointers),floating-point, or a structure.Note: An interrupt function must have the return type void.A function returns by performing any of the following instructions:●●●RET instruction, when compiling for the <strong>MSP430</strong> architectureRETA, when compiling for the <strong>MSP430</strong>X architectureRETI, for interrupt functions regardless of which architecture is being used.94<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!