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) } }
Thanks Nikolay!
Really, my code was succesfully compiled by 6.06 version of C166 compiler.
IDE-Version: µVision3 V3.50 Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2007 Tool Version Numbers: EC++ Compiler: EC166.Exe V1.09b C Compiler: C166.Exe V6.06 Assembler: A166.Exe V5.21 Linker/Locator: L166.Exe V5.22 Librarian: LIB166.Exe V4.26 Hex Converter: OH166.Exe V4.7a CPU DLL: S166.DLL V2.52 Dialog DLL: D167.DLL V2.48 Target DLL: BIN\UL2OCDS.DLL V1.12 Dialog DLL: T167.DLL V2.48
But C166 4.27 doesn't compile same code :)
Hello Nikolay!
I have still problem. I compile & link my main program in old Keil version with C166 v.4.27. (license ver.) But this version of compiler does not support inline asm with MAC. I attempted to make library in 6.06 restricted demo version... but when I attempt link this library in 4.27 version...
*** FATAL ERROR L251: RESTRICTED MODUL IN LIBRARY NOT SUPPORTED
Can you make library in full version of C166 upwards of 5.00 for me? mailto:legotron@mail.ru
C166 Version 5.00 Release [MAC Programming: Example Code for Signal Processing] The DSP Library from Infineon (using in-line assembly for MAC programming) is now available.
Thanks!