a problem to use arm asm

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Try this code

LDRH r3, [r4], #2
STRH r3, [r5], #2
LDR  r3, [r4], #4
STR  r3, [r5], #4

It can build . but cause my mobilphone crash.
how to resolve this problem?
p.s I want use LDRH and LDR in same memory segment!



Re: a problem to use arm asm
Quoted text here. Click to load it


Are you sure that the base registers (r4 and r5) point
to such addresses that both the halfword and the
fullword accesses are on proper address boundaries?

The last two bits of the addresses must be 10 before
your code to make it work (i.e. last hex digit is
2, 6, a or e).

The memory segment will not affect the addressing here.

--

Tauno Voipio
tauno voipio (at) iki fi



Re: a problem to use arm asm
hi Tauno:
I'm a beginner to learn arm asm, :), I just want use LDR to read two
halfword to let my code more effective.but when i have odd halfword , I must
use LDRH to read one halfword.
can I do this?thanks for help^^

??????:c9hie.47$ snipped-for-privacy@read3.inet.fi...
Quoted text here. Click to load it



Re: a problem to use arm asm
Quoted text here. Click to load it

If the data is halfword-aligned, use LDRH/STRH for all the
halfwords.

For longer transfers, you may use fullwords, but then you
need to first test for odd halfwords and transfer them
separately, then move all fullword-aligned halfword pairs
and then maybe the last halfword if there are not even
pairs to transfer.

HTH

--

Tauno Voipio
tauno voipio (at) iki fi



Site Timeline