Shaun Case

Unable to get assembly inline with C++ to compile

Discussion created by Shaun Case on Feb 14, 2007
Latest reply on Feb 21, 2007 by Pascal Irrle
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.

Outcomes