I have wriiten a test program for calling asm function from c.
source c file
. . extern anc_asm_func(); . . echo(){ short k=100; . . mk=anc_asm_func(mk); outbuf[i] = 10*inbuf[i]*mk; . .
and anc_asm_func
.global _anc_asm_func
_anc_asm_func :
MV .L1 A4,A1 ; setup loop count in A1
SUB .S1 A1,1,A1 ; decrement loop count A1
NOP
MV .L1 A1,A4 ; result returned in A4
B .S2 B3 ; return addr to calling routine
NOP
.end
while compiling I am getting error
[anc_asm_func.asm] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g -q -eoo67 -fr"./Debug" -i"." -d"CHIP_6713" -mv6710 -@"Debug.lkf" "anc_asm_func.asm"
"anc_asm_func.asm", ERROR! at line 7: [E0002] Illegal mnemonic specified
_anc_asm_func :
I have tried different combination of removing '_' or ':' but same error. Anyone who has worked on mixing code , please share the right way.