我正在研究内联装配.我想在Xcode 4 LLVM 3.0 Compiler下用iPhone编写一个简单的例程.我成功编写了基本的内联汇编代码.
例如:
int sub(int a, int b)
{
int c;
asm ("sub %0, %1, %2" : "=r" (c) : "r" (a), "r" (b));
return c;
}
Run Code Online (Sandbox Code Playgroud)
我在stackoverflow.com找到它并且它工作得很好.但是,我不知道如何编写有关LOOP的代码.
我需要汇编代码
void brighten(unsigned char* src, unsigned char* dst, int numPixels, int intensity)
{
for(int i=0; i<numPixels; i++)
{
dst[i] = src[i] + intensity;
}
}
Run Code Online (Sandbox Code Playgroud)