This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ldm/stm with not aligned 4byte

Hi experts!

I want to use ldr/str or ldm/stm to copy memory not aligned 4bytes.

I know their input address should be aligned by 4 bytes.

but is there any solution to use ldr/str or ldm/stm though src or dst isn't aliged 4byte by modifing following code?

void wordcopy(unsigned char *dst, unsigned char *src, int num) {
loop:
   LDR r3,[r1];
   STR r3,[r0];
   SUBS r2,r2,#1;
   BNE loop;
   BX lr;
}

Parents Reply Children
No data