| ||||||||
Technical Support Support Resources Product Information | C51: COMMENTS IN ASSEMBLY BLOCKSInformation in this article applies to:
SYMPTOMWhen I try to place a comment in an assembly block or inside a C source file, such as:
#pragma asm
mov R1, A ; save function's return value
#pragma endasm
The compiler generates an error, thinking the apostrophe is a single quote. CAUSEInline assembly code is parsed by the C compiler (which does not recognize the semicolon as the beginning of a comment). RESOLUTIONComments in ASM blocks should use C comment syntax. The example above compiles if changed to the following:
#pragma asm
mov R1, A // save function's return value
#pragma endasm
SEE ALSO
Last Reviewed: Tuesday, May 24, 2005 | |||||||
| ||||||||