Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP


Discussion Groups

Discussion Groups | Analog Devices DSPs | linking error while trying to link c and asm file.

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

linking error while trying to link c and asm file. - canbruce_contact - Jun 7 8:39:51 2007



 AIM :To access and print the value of _asm_x in assembly file in c.
Help required :Linking c with asm
                             Assembly file:
.section/dm seg_dmda;
.var _asm_x;
.global _asm_x;
.section/pm seg_pmco;
 start:
    r3=12;
    dm(_asm_x)=r3;
 start.end:
                          C language file:
#include<stdio.h>
void start();
extern int asm_x;
void main()
{
	int cx;
	cx=asm_x;
	printf("\n got  from asm  %d",cx);

}
Error I came across:
 [Error li1113]  The symbol '_asm_x' referenced in 
file '.\Debug\teting.doj' in the project 'P0' could not be resolved.
 I check out li113 but of no use as I am totally as perLi113. 
 Each files successfully builds itself .I could not 
identify the problem please help. 
                        Another program with same kind of error 

                             Assembly file
#include<asm_sprt.h>
.section/dm seg_dmda;

.section/pm seg_pmco;
.var _avar=0;
.global _avar;
.global _afunc;
.extern _cfunc;
.extern _cvar;
_afunc:
    entry;
    r8=dm(_cvar);
    dm(_avar)=r8
    ccall(_cfunc);
    exit;
                                                      C language 
file:

extern void afunc(void);
void cfunc(void);
int cvar=10;
extern int avar;
void main()
{
	afunc;
}
void cfunc(void)
{
	if (cvar!=avar)
	    exit(1);
	else
	   exit(0);
	
}



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )