This site is no longer active and is available for archival purposes only. Registration and login is disabled.

How to process multiple data in ARM assembly


How to process multiple data in ARM assembly

Postby momomo » Dec 1, 2003 @ 11:02am

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
momomo
pm Member
 
Posts: 3
Joined: Dec 1, 2003 @ 10:25am


Postby refractor » Dec 1, 2003 @ 11:04am

Check you're loading from a 4-byte aligned address.
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby momomo » Dec 2, 2003 @ 3:23am

momomo
pm Member
 
Posts: 3
Joined: Dec 1, 2003 @ 10:25am


Postby Dan East » Dec 2, 2003 @ 5:45am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby momomo » Dec 2, 2003 @ 7:51am

momomo
pm Member
 
Posts: 3
Joined: Dec 1, 2003 @ 10:25am


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron