EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Assembly code from KEIL to ROWLEY

Started by Prakash Rajoli October 26, 2010
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 get out of these errors.

An Engineer's Guide to the LPC2100 Series

Go back to Keil

________________________________
From: l... [mailto:l...] On Behalf Of Prakash Rajoli
Sent: Tuesday, October 26, 2010 7:29 AM
To: pc2000
Subject: [lpc2000] Assembly code from KEIL to ROWLEY
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 get out of these errors.
> 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 get out of these errors.

Just off the top of my head...Read the GCC/AS documentation - find
example assembly files to copy - set up your build options for the
mode/cpu you are trying to compile for.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.

>
>
>
>

Am 26.10.2010 18:05, schrieb Michael Frazier:

[top posting fixed]

> ________________________________
> From: l... [mailto:l...] On Behalf
Of Prakash Rajoli
> Sent: Tuesday, October 26, 2010 7:29 AM
> To: pc2000
> Subject: [lpc2000] Assembly code from KEIL to ROWLEY
> Hello,
>
> I am new to the assembly code. The code which I given below is
compile(assembling) fine in KEIL.
>

>> Go back to Keil

Or better: Read both manuals (hint: label syntax, assembler directives).

--
42Bastian
+
| http://www.sciopta.com
| Fastest direct message passing kernel.
| IEC61508 certified.
+
You're absolutely correct..."If all else fails! Read the manual! That is what most people do when they use something that is new to them."

________________________________
From: l... [mailto:l...] On Behalf Of 42Bastian
Sent: Tuesday, October 26, 2010 12:39 PM
To: l...
Subject: Re: [lpc2000] Assembly code from KEIL to ROWLEY

Am 26.10.2010 18:05, schrieb Michael Frazier:

[top posting fixed]

> ________________________________
> From: l... [mailto:l...] On Behalf
Of Prakash Rajoli
> Sent: Tuesday, October 26, 2010 7:29 AM
> To: pc2000
> Subject: [lpc2000] Assembly code from KEIL to ROWLEY
> Hello,
>
> I am new to the assembly code. The code which I given below is
compile(assembling) fine in KEIL.
>

>> Go back to Keil

Or better: Read both manuals (hint: label syntax, assembler directives).

--
42Bastian
+
| http://www.sciopta.com
| Fastest direct message passing kernel.
| IEC61508 certified.
+
Its working fine now, anyway thanks for your suggestion:)

-Prakash

--- On Wed, 10/27/10, Michael Frazier wrote:

From: Michael Frazier
Subject: RE: [lpc2000] Assembly code from KEIL to ROWLEY
To: "'l...'"
Date: Wednesday, October 27, 2010, 7:40 PM

 

You’re absolutely correct…”If all else
fails! Read the manual! That is what most people do when they use something
that is new to them.”

 

From: l...
[mailto:l...] On Behalf Of
42Bastian

Sent: Tuesday, October 26, 2010
12:39 PM

To: l...

Subject: Re: [lpc2000] Assembly
code from KEIL to ROWLEY

 

 

Am
26.10.2010 18:05, schrieb Michael Frazier:

[top posting fixed]

> ________________________________

> From: l...
[mailto:l...]
On Behalf

Of Prakash Rajoli

> Sent: Tuesday, October 26, 2010 7:29 AM

> To: pc2000

> Subject: [lpc2000] Assembly code from KEIL to ROWLEY

>

>

> Hello,

>

> I am new to the assembly code. The code which I given below is

compile(assembling) fine in KEIL.

>

>> Go back to Keil

Or better: Read both manuals (hint: label syntax, assembler directives).

--

42Bastian

+

| http://www.sciopta.com

| Fastest direct message passing kernel.

| IEC61508 certified.

+

The 2024 Embedded Online Conference