markie

Mix C and assembly

Discussion created by markie on Aug 14, 2006
Latest reply on Aug 16, 2006 by markie
My problem is how to define a variable that can be use in multi C files and assembly files at a application.
 
I define a variable in the first C file, for example:
/* file1.c*/
int i;
 
now I want this variable can be used in another C file and a asm file, for example:
/* main.c*/
#include "file1.c"
main()
{
  i=0;
}
 
/*main.asm*/
XREF i;
...
LDD #0
STD i
 
but it can not be link correctly withing CW for HCS12 v3.1.
 
Please help me!
 

Outcomes