| |||||
Technical Support Support Resources
Product Information | C51: ACCESSING ASSEMBLY VARIABLES FROM CInformation in this article applies to:
QUESTIONI need to create variables in my assembly code and access them from C. How do I do that? ANSWERIt's best to create separate C and assembly modules. Then, you can create an extern variable declaration in the C module for the assembly variable. For example: Assembly CodePUBLIC MY_VAR ?CO?JUNK1 SEGMENT CODE RSEG ?CO?JUNK1 my_var: db "This is a test", 00 END C Code
#include <string.h>
extern char code my_var [];
void main (void)
{
char buf [21];
strcpy (buf, my_var);
while (1);
}
Last Reviewed: Monday, December 18, 2000 | ||||
| |||||