This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

#pragma SRC: respecified or conflicting control

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.

Parents
  • 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

Reply
  • 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

Children
No data