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

How to access global variables of C into Assembly

Hi Forum Members,
I am using Keil uVision2 for P89C51RD2HBP.
I want to access the "global variables defined in C" in assembly routine. The format of my program is as below:

#include <stdio.h>

unsigned char Var1;

void Func1 (void)
{
...
...
#pragma asm
  mov  a,Var1
#pragma endasm
...
...
}
When I compile this program it says
"error A45: UNDEFINED SYMBOL (PASS-2)"

How do I solve this problem ?

Thanking you in advance,
Mr. Kiran V. Sutar

0