I need to write simple routine in iphone arm assembly (under xcode 4)
(normal 32 bit not thumb) and have a problems
(standalone asm routine do not link and with
inline i have trouble with args and generall errors)
I need to assembly a function like
void clear_alpha(unsigned char*bits, int width, int height)
{ for(int j=0; j<height; j++)
for(int i=0; i<width; i++)
{
bits[j][i][4] = 0;
}
}
or so, could anyone help, tnx
If this code is slow, why not try rewriting it
Not sure what the optimizer did, but indexing is multiplying. You can replace 3 multiplies in the loop fairly easily
I didn’t run this — check my work to make sure you don’t overrun the end. Now instead of 3 multiplies, you have one add. I am assuming that your third dimension is 5 (edit: fixed based on comment), but you have to fix that if I’m wrong.