diff --git a/src/memcpy.s b/src/memcpy.s index 0b4fccb..4d501f0 100644 --- a/src/memcpy.s +++ b/src/memcpy.s @@ -117,7 +117,7 @@ add r1, r2 sub r0, #1 sub r1, #1 // r12 = num residual bytes -and r12, r2, #3 +and r12, r2, #2 .Lrbyte_copy: subs r12, #1 ldrcsb r3, [r1], #-1 @@ -125,6 +125,7 @@ and r12, r2, #3 bhi .Lrbyte_copy // r12 = num residual words lsr r12, r2, #2 +and r12, #3 // Move to the beginning of the current word sub r0, #3 sub r1, #3