c语言汇编混合编译不了,IAR汇编与C语言混合编程的问题(内附源程序)

本帖最后由 freebird 于 2012-4-12 11:56 编辑

程序之前在 Keil 里面编译成功了,这次换做IAR5.20,编译报错,不知道为什么。

请问有人知道吗?

报错信息如下:

Building configuration: IAR_PWM - Debug

Updating build tree...

stm32f10x_it.c

Error[Pe125]: expected a "("                                     D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 88

Error[Pe194]: expected an asm string                         D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 88

Error[Pe065]: expected a ";"                                     D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 89

Error[Pe010]: "#" not expected here                         D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 91

Error[Pe010]: "#" not expected here                         D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 94

Error[Pe010]: "#" not expected here                         D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 96

Warning[Pe012]: parsing restarts here after previous syntax error         D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 98

Error while running C/C++ Compiler

Total number of errors: 6

Total number of warnings: 1

源程序如下:

88   __asm void HardFault_Handler(void)

89   {

90   //#ifdef DEBUG

91       TST LR, #0x4              // EXC_RETURN.2=0?

92       ITTEE EQ                  // 如是为零,则

93       MRSEQ R0, MSP             //把MSP加载入R0中

94       LDREQ R0,[R0,#0x24]         //从MSP中获取入栈的PC

95       MRSNE R0, PSP             //否则, 就把PSP加载入R0中

96       LDRNE R0,[R0,#0x24]         //从PSP中获取入栈的PC

97   //#endif

98   };

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值