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

compiling C & Assembler

When i compile the following code with SRC Directive of this source file, the error occurs. Can anyone help me to deal with it?

unsigned char function(char buffer)
{
	#pragma asm

		MOV A, R7
		MOV R1, A
	#pragma endasm
	return 1;
}

TRANSCEIVE.C(15): error C272: 'asm/endasm' requires src-control to be active

TRANSCEIVE.C(63): error C272: 'asm/endasm' requires src-control to be active

Parents
  • Yet again, just read the error message literally:

    'asm/endasm' - you know what they are, as you've written them in your code!

    requires - means something is needed; as this is an error message you should take this as a hint that you have omitted something that is needed.

    src-control to be active - follows requires, so this is the thing that is required!
    Look up the SRC control in the Manual

Reply
  • Yet again, just read the error message literally:

    'asm/endasm' - you know what they are, as you've written them in your code!

    requires - means something is needed; as this is an error message you should take this as a hint that you have omitted something that is needed.

    src-control to be active - follows requires, so this is the thing that is required!
    Look up the SRC control in the Manual

Children
No data