「8.3.2  初期設定」で説明した、PowerON_Reset_PC関数のコーディング例を示します。
なお、統合開発環境で生成される実際の初期設定ルーチンは、「8.4  コーディング例」を参照ください。
| #include         <machine.h> #include         <_h_c_lib.h> #include         "typedefine.h" #include         "stacksct.h"   #ifdef __cplusplus extern "C" {#endif void PowerON_Reset_PC(void); void main(void); #ifdef __cplusplus } #endif   #ifdef __cplusplus                       // Use SIM I/O extern "C" {#endif extern void _INITLIB(void); #ifdef __cplusplus } #endif   #define PSW_init  0x00010000 #define FPSW_DPSW_init 0x00000100   #pragma section ResetPRG #pragma entry PowerON_Reset_PC void PowerON_Reset_PC(void) {#if (__RX_ISA_VERSION__ >= 2) || defined(__RXV2)     set_extb(__sectop("EXCEPTVECT"));#endif     set_intb(__sectop("C$VECT"));#ifdef __FPU     set_fpsw(FPSW_DPSW_init); #ifdef __DPFPU     __set_dpsw(FPSW_DPSW_init); #endif #endif #if __TFU == 1     __init_tfu(); #endif       _INITSCT();     _INITLIB();     set_psw(PSW_init);     main();     brk(); } |