Hello,
I am new to the assembly code. The code which I given below is compile(assembling) fine in KEIL.
AREA |.text|, CODE, READONLY EXPORT vF_dspl_pid vF_dspl_pid push {r4-r7} ldrsh Kp,[pS_StateCoeff] ldrsh Ki,[pS_StateCoeff,#2] ldrsh Kd,[pS_StateCoeff,#4] ldrsh IntegratedError,[pS_StateCoeff,#6] mla Acc,Ki,si_Error,IntegratedError //update integrated error strh Acc,[pS_StateCoeff,#6] //store to state ldrsh LastError,[pS_StateCoeff,#8] strh si_Error,[pS_StateCoeff,#8] mla Acc,Kp,si_Error,Acc //add in proportional part sub Temp,si_Error,LastError mla Acc,Kd,Temp,Acc //add in the difference part mov Acc,Acc,ASR#16 //scale down to short int pop {r4-r7} bx lr END
But when I switch from KEIL to ROWLEY CROSS WORKS. The foolowing errors are getting during assembling.
Error: bad instruction 'area |.text|,CODE,READONLY'
Error: bad instruction 'export vF_dspl_pid'
Error: bad instruction 'vf_dspl_pid'
Error: Thumb does not support this addressing mode -- 'ldrsh r3,[r1]'
Error: Thumb does not support this addressing mode -- 'ldrsh r4,[r1,#2]'
Error: Thumb does not support this addressing mode -- 'ldrsh r5,[r1,#4]'
Error: Thumb does not support this addressing mode -- 'ldrsh r6,[r1,#6]'
Error: Thumb does not support this addressing mode -- 'ldrsh r6,[r1,#8]'
Error: shifts in CMP/MOV instructions are only supported in unified syntax -- 'mov r7,r7,ASR#16'
Error: bad instruction 'end' Build failed
Kindly give me suggession to come out of these errors.
-Prakash
This is a Keil forum.
So a forum suitable for getting support about Keil products.
Do you think "ROWLEY CROSS WORKS" is a Keil product?
Do you think that maybe there, somewhere in this world, exists a better place to find information regarding your "ROWLEY CROSS WORKS" product? Where did you find it? Didn't you find any manual at the same place? Maybe a forum? Maybe a support number? Some sample code?
You need to read the Rowley manuals and, if that doesn't help, refer to Rowley for support with their product!
Remember: Even with 'C', there are implementation-specific details, so that you must never assume that code written for compiler 'A' will "just work" on compiler 'B' - and that's with a language intended to be "portable" (sic).
Assembler does not even claim to be portable!
Sorry for asking such question in this forum.
To avoid future embarrasment, always check the "terms of use" and scope of any internet forum before making a post!
eg, http://www.keil.com/forum/ clearly says: "The Keil Discussion Forum is an open forum where you may post questions and comments about Keil products."
Apart from the instructions themselves, the assembler syntax between different tools can be very dissimilar as is the case here. Rowley is based on GCC, so you'd have to look at both, the gas manual as well as the Keil documentation for an answer.
Regards Marcus http://www.doulos.com/arm/