Assembler error in LPCXpresso v7.3.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assembler error in LPCXpresso v7.3.0

653 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tom Barrett on Mon Sep 29 14:48:33 MST 2014
When attempting to assemble the following two assembler instructions:

   asm ("SUBS R0, R0, #0x1C");  and

   asm ("SUBS R0, R0, #4");


LPXCpresso produces the following error message:

Error: instruction not supported in Thumb16 mode -- `subs R0,R0,#0x1C'
Error: instruction not supported in Thumb16 mode -- `subs R0,R0,#4'

I believe this to be an error in LPCXpresso because I have used this code previously on an LPC1227 with IAR EWARM tools successfully. Moreover, the Cortex-M0 reference manual, UM10441, page 392 clearly states that SUBS is indeed supported for CM0.

Has someone else encountered this same issue before? If so, and you know of a fix for this, I would appreciate hearing from you.

Thanks.
0 Kudos
5 Replies

526 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tom Barrett on Wed Oct 01 12:15:19 MST 2014
Thanks for the Forum references. Apparently, the assembly language instructions need to be bounded as:

asm (".syntax unified");

asm (...);   // asm instructions here

asm )".syntax divided");

When I did this, the errors went away and I was able to build the project. Now I will get to see if it actually works.

Thanks for the help.

Regards,

Tom
0 Kudos

526 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Oct 01 01:28:25 MST 2014
I suggest that search the forum for previous posts (e.g. seach for ".syntax unified"), for example

http://www.lpcware.com/content/forum/m0-inline-assembly-subs-r0-32-not-supported#comment-1101766
http://www.lpcware.com/content/forum/lpc111x-muls-instruction-error#comment-1100106

If you need further assistance, then post an example project that shows up your problems:

http://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects

Regards,
LPCXpresso Support
0 Kudos

526 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tom Barrett on Tue Sep 30 14:03:49 MST 2014
I guess I am unclear as to where to add the recommended line. Can you be more specific as to where to add the line?

I have tried putting it in different spots in the file and the assembler still gives me an error although it is now a different error:

Error: lo register required -- `add r2,r3,#1'.

That instruction is not even in my assembly code.

Thanks for your help.

Regards,

Tom
0 Kudos

526 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tom Barrett on Tue Sep 30 12:32:06 MST 2014
Thank you for the reply. I'll give it a go.

Regards,

Tom
0 Kudos

526 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Sep 30 00:42:42 MST 2014
You almost certainly need to specify that you want the assembler to use "unified assembler language" rather than "true Thumb instructions". Unified Assembler Language (UAL) is a common syntax for ARM and Thumb instructions that has caused much confusion over the years!

Basically just add:

asm(".syntax unified");


Regards,
LPCXpresso Support
0 Kudos