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

ARM optimization question


ARM optimization question

Postby kornalius » Feb 23, 2004 @ 8:15pm

I have to little piece of code, where I call an internal C routine and the address is stored into an memory location relative to my pc register.

ldr r11, [pc, #10]
mov lr, pc
mov pc, r11

I am trying to optimize it like this:

mov lr, pc
ldr pc, [pc, #10]

It calls the routine without problems, but doesn't return properly. Can anybody tell me what is wrong with the second code?

Regards,
Kornalius.

** Don't worry about the relative address location [pc, #10], it is a dummy location, it's just to get the idea! :) **

PS: If you can find a way to optimize it even more, please let me know.
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby refractor » Feb 24, 2004 @ 11:48am

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


Postby kornalius » Feb 24, 2004 @ 4:46pm

User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


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