【发布时间】:2011-01-03 18:52:09
【问题描述】:
我发布了this Q to TI's 28xx DSP forum,但没有收到回复,我想这里可能有人知道。
我知道如何在汇编中编写函数,以便它们可以被 C 调用;如果 C 可调用名称为 foo(),则汇编函数名为 _foo()。
如果我想使用 C++ 并在汇编中优化类方法怎么办?我怎么做?我认为唯一的主要问题是:
- 命名
- 访问“this”指针
- 通过某种方式知道偏移量来访问类成员
如果我不想担心最后两个,那么也许我会编写一个静态成员函数并这样做:
class MyClass
{
int x;
static int _doSomething(int u); // implement this in assembly
public:
inline void doSomething() { x = _doSomething(x); }
// lightweight C++ wrapper to handle the class member / "this" pointer stuff
};
【问题讨论】:
标签: c++ assembly embedded ti-dsp