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