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.

Overriding default library modules● The custom function __low_level_init is called if you have defined it, givingthe application a chance to perform early initializations● Static variables are initialized; this includes clearing zero-initialized memory andcopying the ROM image of the RAM memory of the remaining initialized variables● The main function is called, which starts the application.Note that the system startup code contains code for more steps than described here. Theother steps are applicable to the DLIB runtime environment.SYSTEM TERMINATIONAn application can terminate normally in two different ways:●Return from the main function● Call the exit function.Because the ISO/ANSI C standard states that the two methods should be equivalent, thecstartup code calls the exit function if main returns. The parameter passed to theexit function is the return value of main. The default exit function is written inassembler.When the application is built in debug mode, C-SPY stops when it reaches the specialcode label ?C_EXIT.An application can also exit by calling the abort function. The default function justcalls __exit in order to halt the system, without performing any type of cleanup.Overriding default library modulesThe <strong>IAR</strong> CLIB Library contains modules which you probably need to override withyour own customized modules, for example for character-based I/O, without rebuildingthe entire library. For information about how to override default library modules, seeOverriding library modules, page 53, in the chapter The DLIB runtime environment.Customizing system initializationFor information about how to customize system initialization, see Customizing systeminitialization, page 59.C-SPY runtime interfaceThe low-level debugger interface is used for communication between the applicationbeing debugged and the debugger itself. The interface is simple: C-SPY will place80<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!