cexit.s43

来自「德州仪器(TI) 的超低功耗16 位RISC 混合信号处理器的MSP430 平台」· S43 代码 · 共 102 行

S43
102
字号
/**************************************************
 *
 * System termination code for the MSP430 IAR Systems C/EC++ Compiler.
 *
 * Copyright 2002-2003 IAR Systems. All rights reserved.
 *
 * $Revision: 1.1 $
 *
 **************************************************/

#include "macros.m43"
#include "cfi.m43"

#define XRSEGCSTART RSEG CSTART:CODE:NOROOT(1)

        XCFI_NAMES libNames
        XCFI_COMMON libCommon, libNames

// ---------------------------------------------------------
// The exit system
//
// The default exit function, written in C, calls _exit provided
// below.  This function performs system cleanup and calls __exit that
// halts the system.
//


// -----------------------------------------------
// _exit -- Perform system cleanup and jump to __exit.
//
// The module below contains a number of segment parts that is
// included in the final application only if they are needed.
//

        MODULE  ?_exit
        XRSEGCSTART
        PUBLIC  _exit

_exit:
        EXTERN  __exit
        REQUIRE __exit
        REQUIRE ?exit_br_xxexit


// -------------------------------------
// Segment part included if the argument to exit must be saved and
// later restored.

        XRSEGCSTART
        REQUIRE ?exit_restore

?exit_save:
        PUSH.W  R12


// -------------------------------------
// Segment part included if destructors must be called.

        XRSEGCSTART
        PUBLIC  __cstart_call_dtors
        EXTERN  __call_dtors
        REQUIRE ?exit_save

        // This label is required by "__record_needed_destruction".

__cstart_call_dtors:
        XCALL   #__call_dtors


// -------------------------------------
// Segment part included if DLib standard IO is used.

        XRSEGCSTART


        PUBLIC  __cstart_closeall
        REQUIRE ?exit_save

        // This label is required by DLib.

__cstart_closeall:
        EXTERN  _Close_all
        XCALL   #_Close_all


// -------------------------------------
// Restore the argument previously stored by the "save" section above.

        XRSEGCSTART

?exit_restore:
        POP.W   R12

        XRSEGCSTART
?exit_br_xxexit:
        // Jump to exit.
        XBR     #__exit

        ENDMOD

        END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?