コード例 #1
0
void PowerON_Reset_PC(void)
{ 
	set_vbr((void *)((_UBYTE *)&INT_Vectors - INT_OFFSET));

	_INITSCT();

	_CALL_INIT();					// Remove the comment when you use global class object

//	_INIT_IOLIB();					// Enable I/O in the application(both SIM I/O and hardware I/O)

//	errno=0;						// Remove the comment when you use errno
//	srand((_UINT)1);					// Remove the comment when you use rand()
//	_s1ptr=NULL;					// Remove the comment when you use strtok()

//	HardwareSetup();				// Use Hardware Setup

	set_cr(SR_Init);

	main();

//	_CLOSEALL();					// Close I/O in the application(both SIM I/O and hardware I/O)

	_CALL_END();					// Remove the comment when you use global class object

	sleep();
}
コード例 #2
0
void PowerON_Reset_PC(void)
{ 
#ifdef __RXV2
	set_extb(__sectop("EXCEPTVECT"));
#endif
    set_intb(__sectop("C$VECT"));

#ifdef __ROZ                    // Initialize FPSW
#define _ROUND 0x00000001            // Let FPSW RMbits=01 (round to zero)
#else
#define _ROUND 0x00000000            // Let FPSW RMbits=00 (round to nearest)
#endif
#ifdef __DOFF
#define _DENOM 0x00000100            // Let FPSW DNbit=1 (denormal as zero)
#else
#define _DENOM 0x00000000            // Let FPSW DNbit=0 (denormal as is)
#endif

    set_fpsw(FPSW_init | _ROUND | _DENOM);

    _INITSCT();

//    _INIT_IOLIB();                    // Use SIM I/O

//    errno=0;                        // Remove the comment when you use errno
//    srand((_UINT)1);                    // Remove the comment when you use rand()
//    _s1ptr=NULL;                    // Remove the comment when you use strtok()
        
//    HardwareSetup();                // Use Hardware Setup
    nop();

    _CALL_INIT();                    // Use global class object

    set_psw(PSW_init);                // Set Ubit & Ibit for PSW
//    chg_pmusr();                    // Remove the comment when you need to change PSW PMbit (SuperVisor->User)

    main();

//    _CLOSEALL();                    // Use SIM I/O
    
    _CALL_END();                    // Use global class object

    brk();
}