欢迎来到天天文库
浏览记录
ID:38515008
大小:796.50 KB
页数:42页
时间:2019-06-14
《Chapter 7 DSP的C语言编程》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、SoftwaredevelopmentflowusingC/C++TheshadedportionofthefigurehighlightsthemostcommonpathofsoftwaredevelopmentforC/C++languageprograms.8/18/20211C/C++ComplierOverviewANSIStandardTheC54xC/C++compilerisafull-featuredoptimizingcompilerthattranslatesstandardANSIC/C++programsintoC54
2、xassemblylanguagesource.Thefollowingsubsectionsdescribethekeyfeaturesofthecompiler.ANSI-standardCThecompilerfullyconformstoANSICStandard.C++ThecompileralsosupportsC++.ANSI-standardruntimesupportAllruntimelibraryfunctionsconformtoANSI-standard.8/18/20212OutputFilesAssemblysour
3、ceoutputGeneratesassemblylanguagesourcefilesthatyoucaninspecteasily,enablingyoutoseethecodegeneratedfromtheC/C++sourcefiles.COFFobjectfilesCommonObjectFileFormat,allowstheusertodefinethesystem’smemorymapatlinktime.CodetoinitializedataintoROMEnablestheusertolinkallcodeandiniti
4、alizationdataintoROM,allowingC/C++codetorunfromreset.8/18/20213CompileroperationIntegratedPreprocessorTheC/C++preprocessorisintegratedwiththeparser,allowingfastercompilation.Standalonepreprocessororpreprocessorlistingisalsoavailable.OptimizationUsesasophisticatedoptimizationp
5、assthatemploysseveraladvancedtechniquesforgeneratingefficient,compactcodefromC/C++source.GeneralOptimizationforanyC/C++codeandC54xspecificoptimizationsforC54xarchitecture.8/18/20214CCS的C语言简介由DSP厂商及第三方为DSP提供C编译器;使得采用高级语言开发DSP软件成为可能;TI公司的CCS又提供了优化的C编译器;优化后的C编译器得到的代码效率只比汇编语言低10%
6、~20%;DSP的C编译器还在不断优化;DSP的C编译器符合ANSIC标准;ANSIC标准会受处理器、运行环境或主机环境的影响。8/18/20215DSP的C语言特性标识符和常数(IdentifierandConstant)标识符大小写敏感,且前100个字符有效;主机和目标字符集为ASCII吗,不存在多字节字符多字符常数按最后一个字符编码。数据类型(DataTypes)与普通C语言类似,不同的是C54x的一个字节为16bits,而并非8bits;表数范围也相应有所变化;size_t的类型为unsignedint,也就是sizeof运算符的结果;p
7、rtdiff_t的类型为int—指针相减的结果。8/18/202168/18/20217DataConversion()Float-to-intconversionstruncatetoward0.Pointersandintegerscanbefreelyconverted,aslongastheresulttypeislargeenoughtoholdtheoriginalvalue.ExpressionsWhentwosignedintegersaredividedandeitherisnegative,thequotientisnegat
8、ive,andthesignoftheremainderisthesameasthesignofthenumerator.Theslas
此文档下载收益归作者所有