Hi!
I have a problem with compile *.c files comprising CoMOV and other Co asm instructions...
Compiler control string
MODV2 HCOMPACT BROWSE UNSIGNED_CHAR INCDIR(.\inc\;.\inc\uc_GUI\) DEBUG PRINT(.\lst\*.lst) TABS (2) PREPRINT(.\lst\*.i)
ERROR
src\DSP\Fir_16.c(71): error C195: inline-asm: invalid expression token
When I add
#pragma MAC
directive in top of file nothing changes, also in C166 Misc control string. When I add
#pragma EXTMAC
ERROR: RESPECIFIED OR CONFLICTING CONTROL
PLEASE HELP ME! Listing of *.c file
#include "DspLib_Keil.h" DataS Fir_16(DataS* H, DataS* IN, DataS N_h, DataS* D_buffer) { __asm { ;MAC registers initialization MOV MCW,#0600h ; MP=1, MS=1 SUB N_h,#2h ; N_h-2 MOV MRW,N_h ;(MRW)=N_h-2, repeat count ;ESFR register initialization ADD N_h,#1 ;(R14)=N_h-1 SHL N_h,#1 ;(R14)=2*(N_h-1) EXTR #3 ; Next 3 instructions use ESFR space MOV IDX0,D_buffer ;(IDX0)=DPRAM_add MOV QX0,N_h ;(QX0)=2*(N_h-1) MOV QR0,N_h ;Read the new input sample and move it ;at x(n-1) address overwriting x(n-1) CoMOV [IDX0],[IN] ;x(n-1) <- IN CoNOP [IDX0+QX0],[H+QR0] ;return the pointers to beginning ;FIR: first multiplication, h(N_h-1)*x((n-N_h+1) CoMUL [IDX0-],[H-] ;(ACC)=h(N_h-1)*x(n-N_h+1)<<1 ;(IDX0)=(IDX0)-2 ;(R12)=(R12)-2 ;FIR loop: repeat N_h-1 times the same MAC instruction loop1: ;i=(N_h-2):(-1):0 -USR1 CoMACM [IDX0-],[H-] ;(ACC)=(ACC)+h(i)*x(n-i)<<1 ;x(n-i-1) <- x(n-i) ;(IDX0)=(IDX0)-2 ;(R12)=(R12)-2 JMPA cc_nusr1,loop1 ;return the pointers CoNOP [IDX0+],[H+] ;Rounding CoRND ;wirte the 16-bit filter output y(n) into registers R4 CoSTORE R4,MAH ;(R4)=(MAH) } }