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 ... ... }
For interfacing C51 to Assembler, Please read the manual: http://www.keil.com/support/man/docs/c51/c51_ap_ctoasm.htm "When I compile this program it says 'error A45: UNDEFINED SYMBOL (PASS-2)'" It also tells you which symbol is undefined. "How do I solve this problem ?" Provided a definition for the symbol! We can't help you further without that vital piece of information!