One mistake: the compiler reports internal warning error: Invalid char '['ning inning operand 2' [% eax]'

Source: Internet
Author: User

Because of a negligence that caused me to find bugs for a few hours, I cannot search online. Now I am writing this article. I am willing to be able to get rid of this small probability event as soon as possible...

GPRS. C: assembler messages:
GPRS. C: 329: Error: Invalid char '['ning inning operand 2' [% eax]'
GPRS. C: 329: Error: Invalid char '['ning inning operand 2' [% eax]'
GPRS. C: 329: Error: Invalid char '['ning inning operand 2' [% EDI]'
GPRS. C: 329: Error: Invalid char '['ning inning operand 2' [% EBX]'
GPRS. C: 329: Error: Invalid char '['ning inning operand 2' [% EDI]'

Programming for an embedded device, the compiler reports an error as above,Source codeAs follows:

Static inline void _ outl (unsigned long ADDR, unsigned long dat ){
ASM volatile (
"Str % 1, [% 0] \ n"
:
: "R" (ADDR), "R" (DAT)
: "Memory"
);
}

Puzzling, and later found the cause:

Debug on the computer some time ago in makefileProgramAdd a line to makefile:

Cc = arm-None-Linux-gnueabi-gcc
Cc: = GCC <-------------- this behavior is newly added, meaning that the CC variable is assigned a value of 'gcc 'again, that is, it is changed to cross-compilation for direct compilation.

Comment out the line and compile it.

Cause:

This is an example of C language embedded assembly.CodeIs the compilation of the target ARM core processor. Of course, the corresponding cross compiler must be used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.