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