5519|4

70

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

iar 内嵌汇编问题 [复制链接]

由gcc的内嵌汇编程序个跟iar内嵌汇编语言差别好大啊,怎么修改才能从gcc的语法到iar的语法啊,iar是for msp430的
在 gcc 中的 __asm volatile ("eint");再 iar中编译不通,貌似不能直接asm与volatile搭配,该如何改啊?
还有,gcc中的语法__asm("in %0, %1" : "=r" (value) : "I" (PORTD) : );有还几个冒号隔开的语法在iar 中也编译不过啊???请各位大侠帮忙。。。小弟不胜感激!!!

最新回复

bool flag; void foo() {     while (!flag)     {         asm("MOV.B &P1IN,&flag");     } } 复制代码  详情 回复 发表于 2009-8-13 13:05
点赞 关注

回复
举报

66

帖子

0

TA的资源

一粒金砂(中级)

沙发
 
没人顶啊,
自己顶一下
 
 

回复

81

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
给LZ找找,

你先看看,英文的

The MSP430 IAR C/C++ Compiler provides several ways to mix C or C++ and
assembler:
● Modules written entirely in assembler
● Intrinsic functions (the C alternative)
● Inline assembler.
 
 
 

回复

77

帖子

0

TA的资源

宇宙尘埃

4
 
When an application is written partly in assembler language and partly in C or C++, you
are faced with a number of questions:
● How should the assembler code be written so that it can be called from C?
● Where does the assembler code find its parameters, and how is the return value
passed back to the caller?
● How should assembler code call functions written in C?
● How are global C variables accessed from code written in assembler language?
● Why does not the debugger display the call stack when assembler code is being
debugged?
 
 
 

回复

70

帖子

0

TA的资源

一粒金砂(初级)

5
 

  1. bool flag;
  2. void foo()
  3. {
  4.     while (!flag)
  5.     {
  6.         asm("MOV.B &P1IN,&flag");
  7.     }
  8. }


复制代码
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表