hello while using MUL(Thumb)instruction in the keil i am getting the error: A1477W: This register combination results in UNPREDICTABLE behaviour,the code written is given below
area th,code entry THUMB mov r0,#0x12 mov r1,#0x02 mul r1,r0 loop b loop end
So can anybody give me the reason and solution how to recover from this error...
According to ARM Architecture Reference Manual:
Syntax: MUL <Rd>, <Rm>
Restriction: Prior to ARMv6, specifying the same register for <Rd> and <Rm> has UNPREDICTABLE results.
Solution: store your result in different register
If you don't know it, then look for architecture version of your ARM in en.wikipedia.org/.../ARM_architecture
Thank you very much for your valuable suggestion,as per your suggestion i have done the changes in my program given below but still i am getting the same error(This register combination results in UNPREDICTABLE behaviour) area thu,code entry THUMB mov r1,#0x02 mov r2,#0x02 mul r1,r2 mov r3,r1;store result in other register loop b loop end
so i kindly request you to do the correction in my program above...
Have you looked up the MUL instruction in the Assembler Manual
http://www.keil.com/support/man/docs/armasm/armasm_cihihggj.htm
Note that there is a restriction stated there on which registers may be used in the Thumb instruction...
Have you looked at the ARM Architecture Reference materials? infocenter.arm.com/.../index.jsp
View all questions in Keil forum