Unable to get assembly inline with C++ to compile

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

Unable to get assembly inline with C++ to compile

1,330 Views
SCase
Contributor I
I am having an issue getting CodeWarrior accept inline assembly in C++ files.

In a header file, the first line containing asm fails with a parse error:

asm int _getSP(void);

Gives "parse error before `int'

Similarly, in a .cpp file, code like the following:

asm int _getLR(void)
{
mflr r3
blr
}

... also results in "parse error before `int'"

I am targeting the MPC852T processor with CodeWarrior 5.7.0, build 1917, hosted on RedHat Linux 9 using the 2.95 toolchain and C++ building a Linux application. This is part of CodeWarrior Development Studio for PowerPC ISA, Linux Application and Platform Editions.

This code compiles without issue when targeting the MPC852T processor with CodeWarrior 5.7.0 build 1962 hosted on Windows for a bareboard application.

I have compared the setups and found nothing that indicates what the problem is, although I noticed that the Windows version of 5.7.0 has many, many more options than the Linux hosted version.

Assistance would be very much appreciated.
Labels (1)
0 Kudos
Reply
1 Reply

538 Views
trytohelp
NXP Employee
NXP Employee
Dear Customer,
 
If you will not receive feedback on the forum I suggest you to contact the CodeWarrior Support Team.
You can log your request via the web.
 - Go to following URL:
http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=054670&tid=FSH
  - Click on Submit a Service Request. You will come to a login page.
 - If you are already registered with Freescale (using the Forum, subscribed to newsletter, ...)  use your Freescale login and password.
   Otherwise, Click on "Register Now" to get registered.
 - You can submit your request through the web from there.
 
Regards
Pascal
0 Kudos
Reply