I have a very simple program: void main(void) { #pragma asm inc a #pragma endasm } If I compile it as it is I get: error C272: 'asm/endasm' requires src-control to be active. So to fix it, I add: #pragma src to the top of the file. However, this introduces a new error: C51 FATAL-ERROR - ACTION: PARSING INVOKE-/#PRAGMA-LINE LINE: #pragma SRC ERROR: RESPECIFIED OR CONFLICTING CONTROL I've tried adjusting the options for the source file to generate assembler SRC file and assemble SRC file but to no avail. Can anyone tell me what I'm doing wrong? Al.
Is SRC actually allowed in a #pragma? I've only ever used it as a command-line control, specified via uVision: Select both 'Generate assembler SRC File' and 'Assemble SRC File' in the 'Properties' tab of the Options for the file in question (right-click the file, and choose 'Options for File xxx').
TKS!
Is SRC actually allowed in a #pragma? I've only ever used it as a command-line control, specified via uVision: Yes. It is allowed in a #pragma line. However, if you specify it in the #pragma line AND if you tell uVision2 to use it, then you will get the compiler error mentioned. Jon
I'm glad I came upon this post as I was doing inline assembly quite differently due to a my misunderstanding of statements in the C51 hardcopy documentation.