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

Arm Assembly help for IPAQ HELP PLEASE!!


Arm Assembly help for IPAQ HELP PLEASE!!

Postby mcrah » Sep 18, 2003 @ 11:57pm

I am in serious need of some ARM Assembly help for the IPAQ.
I am trying to pass two floating point values from C to asm and add them, but I am obviously missing something.

If I write it in C and look at the generated asm code it loads the values in r0 and r1 then calls a section of the processor returning the result...

ldr r0, [sp, #8]
ldr r1, [sp, #0xC]
ldr r3, [pc, #0x10] ;where is this?
ldr r2, [r3]
mov lr, pc
mov pc, r2 ;call elsewhere. but where?
str r0, [sp, #8]

I really need this to be in assembly since it is an important part of a larger routine that needs speed.

If someone could help I would be very gratefull.
Examples with explanations would be perfect.

thanks
:?
mcrah
pm Member
 
Posts: 3
Joined: Sep 18, 2003 @ 11:55pm


Postby Dan East » Sep 19, 2003 @ 2:35am

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


Postby refractor » Sep 19, 2003 @ 12:41pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Thanks

Postby mcrah » Sep 19, 2003 @ 3:51pm

Thanks guys for the responses.

Actually last night I figured it out.
The compiler stores an unreachable asm instruction near the routine itself, which evaluates to a pointer to what must be the FP table or in-processor fp-emulator.

ldr r3, [pc, #0x10] ;where is this?
ldr r2, [r3]
mov lr, pc
mov pc, r2 ;call elsewhere. but where?

this I understood as a setup for a call, but was unclear where the call was being made to.

now I know it is made to what the unreachable instruction evaluates to.

I can now mimic this in my own asm code, and get correct floating point results.

As for the optimization, the routine is highly optimized in asm and now runs approximately 20 times faster than its C++ counterpart.

The floating point calculation is just a very small(but integral) piece that is performed on pre-calculated values.

Since it is called many thousand times, it had to go to asm.

Thanks again for the comments, I appreciate the help.

McRah :D
mcrah
pm Member
 
Posts: 3
Joined: Sep 18, 2003 @ 11:55pm


Postby simonjacobs » Sep 19, 2003 @ 5:30pm

User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby Kzinti » Sep 19, 2003 @ 6:07pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby StephC » Sep 19, 2003 @ 9:15pm

Stephane Cocquereaumont / Game Developer at <a href=http://int13.net>int13 production</a> (code monkey)
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby Kzinti » Sep 19, 2003 @ 10:09pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


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