I was just writing ARM assembly in these few days.
And I want to implement a bilinear filter like
void Interpolate(uchar *src,uchar *dest, int width)
{
int i;
for(i=0;i<width;i++)
*(dest) = (*(src) + *(src+1) +1) >> 1;
}
And I want to use LDR to load 4 bytes instead of using LDRB 4 times, but the program seems crashed when I ran it on my PDA,can anyone tell me why?
the ASM is like :
Interpolate_ASM
stmdb sp!, {r4-r8, r10, r11, lr}
ldr r4,[r0] ;I added this useless
;code and r4 will never be
;used ,but the program
;crashed anyway
;start original code
.
.
.
;end of original code
ldmia sp!, {r4-r8, r10, r11, pc} ; ldmfd
ENDP