This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

如何在C++类中调用汇编程序

如何在CPP工程中调用汇编语言一直是我最近比较头疼的问题。

e2e.ti.com/.../146770有一些介绍,但是在extern "C" int testadd_sa(int a ,int b);处直接提示“linkage specification is not allowed”。

我使用的环境是C6000,汇编代码是

testadd.sa:
 .global testadd_sa

testadd_sa:

 ADD b4,a4,b4
 MV b4,a4
 B b3

声明是在类的.h文件的public下:extern "C" int testadd_sa(int a ,int b);

调用函数为类的一个成员函数下:

int i=0;

  i=testadd_sa(m_iPOCLastDisplay,m_iSkipFrame);

我查了很多材料,一直没有找到正确的答案,请问该怎么做才可以呢?

要是能有一个demo程序,我更加感激不尽。

谢谢!