a problem to use arm asm

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!

Reply to
Slash
Loading thread data ...

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
Reply to
Tauno Voipio

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^^

"Tauno Voipio" ??????:c9hie.47$ snipped-for-privacy@read3.>> Try this code

Reply to
Slash

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
Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.