#include #define printf ((int (*)(const char *,...))0x00002b52) #define scanf ((int (*)(const char *,...))0x00002ba4) #pragma section VECTBL void PowerON_Reset(); void irq0_handler(); // 割り込みハンドラのプロトタイプ宣言 // (これが無いとコンパイルエラーになる) typedef void (*fp)(void); const fp VectorTable[] = // ベクタテーブルの定義 { (fp)PowerON_Reset, // vector 0 Reset (fp)0L, // vector 1 Reserved (fp)0L, // vector 2 Reserved (fp)0L, // vector 3 Reserved (fp)0L, // vector 4 Reserved (fp)0L, // vector 5 Reserved (fp)0L, // vector 6 Reserved (fp)0L, // vector 7 NMI (fp)0L, // vector 8 TRAP (fp)0L, // vector 9 TRAP (fp)0L, // vector 10 TRAP (fp)0L, // vector 11 TRAP (fp)0L, // vector 12 IRQ0 IRQ0割り込みを処理する割り込みハンドラを登録 (fp)0L, // vector 13 IRQ1 (fp)0L, // vector 14 IRQ2 (fp)0L, // vector 15 IRQ3 (fp)0L, // vector 16 IRQ4 (fp)0L, // vector 17 IRQ5 (fp)0L, // vector 18 [reserved] (fp)0L, // vector 19 [reserved] (fp)0L, // vector 20 Watch Dog Timer (fp)0L, // vector 21 Refresh (fp)0L, // vector 22 [reserved] (fp)0L, // vector 23 [reserved] (fp)0L, // vector 24 ITU0 IMIA0 (fp)0L, // vector 25 ITU0 IMIB0 (fp)0L, // vector 26 ITU0 OVI0 (fp)0L, // vector 27 [reserved] (fp)0L, // vector 28 ITU1 IMIA1 (fp)0L, // vector 29 ITU1 IMIB1 (fp)0L, // vector 30 ITU1 OVI1 (fp)0L, // vector 31 [reserved] (fp)0L, // vector 32 ITU2 IMIA2 (fp)0L, // vector 33 ITU2 IMIB2 (fp)0L, // vector 34 ITU2 OVI2 (fp)0L, // vector 35 [reserved] (fp)0L, // vector 36 ITU3 IMIA3 (fp)0L, // vector 37 ITU3 IMIB3 (fp)0L, // vector 38 ITU3 OVI3 (fp)0L, // vector 39 [reserved] (fp)0L, // vector 40 ITU4 IMIA4 (fp)0L, // vector 41 ITU4 IMIB4 (fp)0L, // vector 42 ITU4 OVI4 (fp)0L, // vector 43 [reserved] (fp)0L, // vector 44 DMAC DEND0A (fp)0L, // vector 45 DMAC DEND0B (fp)0L, // vector 46 DMAC DEND1A (fp)0L, // vector 47 DMAC DEND1B (fp)0L, // vector 48 [reserved] (fp)0L, // vector 49 [reserved] (fp)0L, // vector 50 [reserved] (fp)0L, // vector 51 [reserved] (fp)0L, // vector 52 SCI0 ERI0 (fp)0L, // vector 53 SCI0 RXI0 (fp)0L, // vector 54 SCI0 TXI0 (fp)0L, // vector 55 SCI0 TEI0 (fp)0L, // vector 56 SCI1 ERI1 (fp)0L, // vector 57 SCI1 RXI1 (fp)0L, // vector 58 SCI1 TXI1 (fp)0L, // vector 59 SCI1 TEI1 (fp)0L // vector 60 ADI }; #pragma section /* セクション名を省略すると、プログラム領域はP、定数領域はC、初期化データ領域はR,D、未初期化データ領域はBとなる。 */ int main(void); __entry void PowerON_Reset(void) { main(); //スタートルーチンを呼び出し printf("program ended. push reset"); sleep(); }