资源描述:
《DSP28335教程附录2寻址ppt课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、AddressingModesCopyright©2009TexasInstruments.Allrightsreserved.TechnicalTrainingOrganizationTTOAppendixBTMS320C28x™MCUWorkshopLearningObjectivesExplain.sectand.usectassemblydirectivesExplainassemblyaddressingmodesUnderstandinstructionformatsDescribeoptionsforea
2、chaddressingmode.defstartcount.set9;createanarrayxof10wordsx.usect“mydata”,10.sect“code”start:C28OBJ;operateinC28xmodeMOVACC,#1next:MOVLXAR1,#xMOVAR2,#countloop:MOV*XAR1++,ALBANZloop,AR2--bump:ADDACC,#1SBnext,UNC.refstart.sect“vectors”;makeresetvectoraddress'sta
3、rt'reset:.longstartLabelsandMnemonicsMnemonicsLinesofinstructionsUseupperorlowercaseBecomecomponentsofprogrammemoryLabelsOptionalforallassemblyinstructionsandmostassemblerdirectivesMustbeginincolumn1The“:”isnottreatedaspartofthelabelnameUsedaspointerstomemoryori
4、nstructions.defstartcount.set9;createanarrayxof10wordsx.usect“mydata”,10.sect“code”start:C28OBJ;operateinC28xmodeMOVACC,#1next:MOVLXAR1,#xMOVAR2,#countloop:MOV*XAR1++,ALBANZloop,AR2--bump:ADDACC,#1SBnext,UNCAssemblyDirectives.refstart.sect“vectors”;makeresetvect
5、oraddress'start'reset:.longstartDirectivesallowyouto:DefinealabelasglobalReservespaceinmemoryforun-initializedvariablesInitializedmemoryBeginwithaperiod(.)andarelowercaseUsedbythelinkertolocatecodeanddataintospecifiedsectionsinitializedsection.sect“name”usedforc
6、odeorconstantsuninitializedsectionlabel.usect“name”,5usedforvariablesDirectivesAddressingModesModeSymbolPurposeRegisterOperatebetweenRegistersImmediate#ConstantsandInitializationDirect@General-purposeaccesstodataIndirect*Supportforpointers–accessarrays,lists,tab
7、les(register)(constant)(paged)(pointer)InstructionFormatsWhatisa“REG”?16-bitAccess=AR0throughAR7,AH,AL,PH,PL,TandSP32-bitAccess=XAR0throughXAR7,ACC,P,XTWhatisan“#imm”?animmediateconstantstoredintheinstructionWhatisa“mem”?Adirectlyorindirectlyaddressedoperandfrom
8、datamemoryOr,oneoftheregistersfrom“REG”!loc16orloc32(for16-bitor32-bitdataaccess)INSTRREGNEGALINSTRREG,#immMOVACC,#1INSTRREG,memADDAL,@xINSTRmem,REGSUBAL,@AR0INSTRmem