Board logo

标题: 错在哪里? [打印本页]

作者: vincent2046    时间: 2005-5-13 10:57     标题: 错在哪里?

另外,胡乱写了一个中断程序,出现这个连接错误,什么原因? initializing of vector IT_routine failed beacuse of over- or underflow vector value code: ==================== #include /* common defines and macros */ #include /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" #pragma TRAP_PROC void IT_Routine(void) { PTH=0xFF; } void main(void) { /* put your own code here */ EnableInterrupts; DDRH=0; for(;;) {} /* wait forever */ } VECTOR 6 IT_Routine VECTOR 0 _Startup /* reset vector: this is the default entry point for a C/C++ application. */ //VECTOR 0 Entry /* reset vector: this is the default entry point for a Assembly application. */ //INIT Entry /* for assembly applications: that this is as well the initialisation entry point */ ==========================
作者: strongchen    时间: 2005-5-13 14:13

加一句即可: #include /* common defines and macros */ #include /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" #pragma CODE_SEG __NEAR_SEG NON_BANKED #pragma TRAP_PROC void IT_Routine(void) { PTH=0xFF; } void main(void) { /* put your own code here */ EnableInterrupts; for(;;) {} /* wait forever */ }
作者: vincent2046    时间: 2005-5-13 14:18

OK了! 非常感谢 strongchen.  请问加这句是什么意思? #pragma 命令是怎么个用法?
作者: strongchen    时间: 2005-5-13 14:25

加这一句是告诉编译器将程序放在什么地方。

具体的用法请参见S12编译器的使用手册。可以到MetroWerks的网站上下载。我已经在很多帖子里给出了其链接地址。




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0