I need to do a multiplication in the keil and the following mistake goes out for me. It does not leave me to use MLU and MUL. Why?
error: A1477W: This register combination results in UNPREDICTABLE behaviour
i need to do the next c function in asm
No, you don't. You may believe you need that, but you don't. You just need to compile it. That's what you have a compiler for.
Now, some highly skilled people might be able to improve over what the compiler generates for this function. But you're rather obviously not anywhere near that skill level, yet.
the poor man only wants to write a little assembly - let's help him a little!
are you using thumb mode, not ARM? if so, that might limit your access to SP. what happens if you compile this code in ARM mode? also, are you sure that you have copy-pasted the exact code you are using?
"You may believe you need that, but you don't."
Actually, he might "need" it in that his homework assignment is, "create an assembler function that performs the equivalent of the standard atoi library function".
;-)
Other than that, I agree!
have you tried to compare your implementation with the code generated via compiler optimization level 0?
No, he actually specifically said that he "needs" (sic) to convert that particular piece of 'C' source into assembler - which is almost certainly not a real "need" (other than to satisfy a school assignment).
If he really "only wants to write a little assembly", then there would be far better places to start; eg, http://www.keil.com/books/armbooks.asp