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.