WMobile
(1)
Crean
(1)
MISALIGNMENT
(1)
Misalignemnt
(1)
Multiples
(1)
Assembler
(1)
Bytewise
(1)
Wordwise
(1)

data misalignemnt exception during run time

Asked By satis
16-Sep-07 03:46 AM
Hi all,
I am able to compile the C  & ARM11 code using VS2005(with windows
mobile 6.0 professional SDk) for WM6.0 platform.

During run time on WMobile device, ARM assembly code compiled by "armasm"
compiler is throwing DATA MISALIGNMENT exception, when i access memory(int
value) by using a BYTE pointer and the BYTE pointer value is an odd number.

FIXES for the above problem, for Windowsce4.2 & 5.0 Platform
builder are available as given below:

For winsce4.2 -- http://support.microsoft.com/kb/909973
For winsce5.0 -- http://support.microsoft.com/kb/909476

Questions:
1) Does the above fixes are applicable to Pocket PC Phone Edition?
2) As i am compiling the code using VS2005(with WM6.0 SDK),
In this case "Is there any FIX for this data misalignemnt
exception
problem?"


Pls help me in fixing this issue.
Thanks In Advance,
satish

The fixes described are for platform builder, I'm asumming by the fact you are

Asked By GaryCrea
26-Sep-07 02:28 PM
The fixes described are for platform builder, I'm asumming by the fact you
are using VS2005 your not using Platform Builder. There is no fix for Data
Misalignment on ARM processor's. I'd be interested to look at the code. I may
be able to help.

Hi Satish,I can help you, I'm on the CE Compiler team.

Asked By James Hayhurst
26-Sep-07 03:46 PM
Hi Satish,

I can help you, I'm on the CE Compiler team.  When loading a 32 bit value
from memory, it needs to be 4-byte aligned otherwise the CPU will throw a
data abort.  If it's not 4-byte aligned then you'll need to load it in
smaller chunks.  You said that you're using the ARM assembler (armasm),
which would seem to indicate it's an error in the source assembly file.  Can
you clarify how you're building?

Hi Hayhurst & Crean, Thanku very much for ur replies.

Asked By satis
01-Oct-07 05:05 AM
Hi Hayhurst & Crean,

Thanku very much for ur replies.
I had fixed the problem by doing load/store operations bytewise instead of
wordwise when the address is not in multiples of 4.

Thanks & Regards,
satish
Post Question To EggHeadCafe