资源描述:
《dsp 2835 教程 附录3 dsp汇编语言》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、AssemblyProgrammingCopyright©2009TexasInstruments.Allrightsreserved.TechnicalTrainingOrganizationTTOAppendixCTMS320C28x™MCUWorkshopLearningObjectivesPerformsimpleprogramcontrolusingbranchandconditionalcodesWriteC28xcodetoperformbasicarithmeticUsethemultipliertoimplementsum-of-
2、productsequationsUsetheRPTinstruction(repeat)tooptimizeloopsUseMACforlongsum-of-productsEfficientlytransferthecontentsofoneareaofmemorytoanotherExamineread-modify-writeoperationsProgramControlALU/MultiplyOperationsDataMoveLogicalOperationsSpecialInstructionsBranchTypesandRange
3、Branchoffset+/-32K2-wordinstructionLongBranchabsolute4M2-wordinstructionPCShortBranchoffset+127/-1281-wordinstructionProgramMemory0x0000000x3FFFFF3BranchTypesProgramControl-BranchesFunctionShortBranchSB8bit,cond7/41FastShortBranchSBF8bit,EQ
4、NEQ
5、TC
6、NTC4/41FastRelativeBranch
7、B16bit,cond7/42FastBranchBF16bit,cond4/42AbsoluteBranchLB22bit42DynamicBranchLB*XAR741BranchonARBANZ16bit,ARn--4/22BranchoncompareBAR16bit,ARn,ARn,EQ
8、NEQ4/22TheassemblerwilloptimizeBtoSBifpossibleNEQEQGTGEQLTLEQHIHIS(C)LO(NC)LOSNOVOVNTCTCUNCNBIOConditionCodeInstructionCyclesT/
9、FSizeConditionflagsaresetontheprioruseoftheALUProgramControl-Call/ReturnFunctionCallCodeCallLCR22bit4LRETR4DynamicCallLCR*XARn4LRETR4InterruptReturnIRET8CyclesReturncodeCyclesMoreCallvariationsintheuserguideareforcodebackwardcompatibilityStackLocalVarRPCOldRPCPCFuncLCRFuncLRET
10、RRPC22-bitoldRetAddrRetAddrNewRPCBANZLoopControlExamplelen.set5x.usect“samp”,6y.set(x+len).sect“code”MOVLXAR2,#xMOVAR3,#len-2MOVAL,*XAR2++sum:ADDAL,*XAR2++BANZsum,AR3--MOV*(0:y),ALAR3COUNTDatax0x1x2x3x4xyXAR2AuxiliaryregisterusedasloopcounterBranchifAuxiliaryRegisternotzeroTes
11、tperformedonlower16-bitsofXARxonlyProgramControlALU/MultiplyOperationsDataMoveLogicalOperationsSpecialInstructionsALUandAccumulatorALUandBarrelShifterACCAH(31-16)AL(15-0)AH.MSBAH.LSBAL.MSBAL.LSB16/32datamem,16/32bitregistersProduct(32)MUXST0,ST18/16ImmAccumulator-BasicMathInst
12、ructionsMOVAx,loc16ADDAx,loc16SUBAx,loc16ANDAx,loc16ORAx,loc1