
Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).
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);
}