mov r2, #0x58
str r2, [r6]
doesn't really make sense. Store instructions (str Rd, [Rn]
) saves Rd in Rn. You probably want something like this
mov r6, #0x58
str r6, [r5,r4]
You should be also use subs
instead of sub
then cmp
.