dsp 2835 教程 附录3 dsp汇编语言.ppt

上传人:bao****ty 文档编号:131112996 上传时间:2020-05-04 格式:PPT 页数:29 大小:233KB
返回 下载 相关 举报
dsp 2835 教程 附录3 dsp汇编语言.ppt_第1页
第1页 / 共29页
dsp 2835 教程 附录3 dsp汇编语言.ppt_第2页
第2页 / 共29页
dsp 2835 教程 附录3 dsp汇编语言.ppt_第3页
第3页 / 共29页
dsp 2835 教程 附录3 dsp汇编语言.ppt_第4页
第4页 / 共29页
dsp 2835 教程 附录3 dsp汇编语言.ppt_第5页
第5页 / 共29页
点击查看更多>>
资源描述

《dsp 2835 教程 附录3 dsp汇编语言.ppt》由会员分享,可在线阅读,更多相关《dsp 2835 教程 附录3 dsp汇编语言.ppt(29页珍藏版)》请在金锄头文库上搜索。

1、AssemblyProgramming Copyright 2009TexasInstruments Allrightsreserved AppendixCTMS320C28x MCUWorkshop LearningObjectives PerformsimpleprogramcontrolusingbranchandconditionalcodesWriteC28xcodetoperformbasicarithmeticUsethemultipliertoimplementsum of productsequationsUsetheRPTinstruction repeat tooptim

2、izeloopsUseMACforlongsum of productsEfficientlytransferthecontentsofoneareaofmemorytoanotherExamineread modify writeoperations ProgramControlALU MultiplyOperationsDataMoveLogicalOperationsSpecialInstructions BranchTypesandRange PC ProgramMemory 0 x000000 0 x3FFFFF 3BranchTypes ProgramControl Branche

3、s Function ShortBranchSB8bit cond7 41FastShortBranchSBF8bit EQ NEQ TC NTC4 41FastRelativeBranchB16bit cond7 42FastBranchBF16bit cond4 42AbsoluteBranchLB22bit42DynamicBranchLB XAR741BranchonARBANZ16bit ARn 4 22BranchoncompareBAR16bit ARn ARn EQ NEQ4 22 TheassemblerwilloptimizeBtoSBifpossible NEQEQGTG

4、EQ LTLEQHIHIS C LO NC LOSNOVOV NTCTCUNCNBIO ConditionCode Instruction CyclesT F Size ConditionflagsaresetontheprioruseoftheALU ProgramControl Call Return BANZLoopControlExample AuxiliaryregisterusedasloopcounterBranchifAuxiliaryRegisternotzeroTestperformedonlower16 bitsofXARxonly ProgramControlALU M

5、ultiplyOperationsDataMoveLogicalOperationsSpecialInstructions ALUandAccumulator 16 32datamem 16 32bitregisters Product 32 MUX Accumulator BasicMathInstructions MOVAx loc16ADDAx loc16SUBAx loc16 ANDAx loc16ORAx loc16XORAx loc16 ANDAx loc16 16bNOTAxNEGAxMOVloc16 Ax Ax AHorALOperations xxx instruction

6、MOV ADD SUB Ax AH orALAssemblerwillautomaticallyconvertto1wordinstruction TwowordinstructionswithshiftoptionOnewordinstruction noshift ADDACC 01234h 4ADDBAL 34h ACCOperations MOVACC loc16 shiftADDSUB frommemory leftshiftoptional MOVloc16 ACC shift ALMOVHloc16 ACC shift AH Format Ex Variation Shiftth

7、eAccumulator ShiftfullACC LSLACC shift LSLACC T ACC 31 0 SFR ACC 31 0 LSL 0 C C SXM ShiftALorAH LSLAX T LSLAX shift Ax 15 0 ASR Ax 15 0 LSL 0 C C SXM Ax 15 0 LSR C 0 1 16 0 15 32BitShiftOperations ACC ACC 31 0 0 C Examples LSLLACC TLSRLACC TASRLACC T ACC 31 0 C 0or1 ACC 31 0 C 0 Note T 4 0 areused o

8、therbitsareignored basedonSXM LogicalShiftLeft Long LSLL LogicalShiftRight Long LSRL ArithmeticShiftRight Long ASRL MultiplyUnit MultiplierInstructions InstructionExecutionPurpose MOVT loc16T loc16Getfirstoperand MPYACC T loc16ACC T loc16ForsingleorfirstproductMPYP T loc16P T loc16Fornthproduct MPYB

9、ACC T 8buACC T 8buUsing8 bitunsignedconstMPYBP T 8buP T 8buUsing8 bitunsignedconst MOVACC PACC PMove1stproduct PMtoACCADDACC PACC PAddnthproduct PMtoACCSUBACC PACC PSubnthproduct PMfr ACC Sum of Products ZAPA ACC P OVC 0MOVT X1 T X1MPYP T A P A X1MOVAT X2 T X2 ACC A X1MPYP T B P B X2MOVAT X3 T X3 AC

10、C A X1 B X2MPYP T C P C X3MOVAT X4 T X4 ACC A X1 B X2 C X3MPYP T D P D X4ADDLACC P PM ACC YMOVL y ACC Y A X1 B X2 C X3 D X4 32x32LongMultiplication IMPYALP XT loc32P u XT u loc32 QMPYALACC XT loc32ACC XT loc32 X Y X XO Y0 Z1Z0 IMACLP loc32 XAR7ACC P P u loc32 u loc32 QMACLP loc32 XAR7ACC P P loc32 l

11、oc32 Integerlongmultiplicationu long u long u long Fractionlongmultiplication long long long long 64 long 32 long 32 Y1 X1 Z3Z2 AccumulatorP register RepeatNext RPT Features NextinstructioniteratedN 1timesSavescodespace 1wordLowoverhead 1cycleEasytouseNon interruptibleRequiresuseof beforenextlineMay

12、benestedwithinBANZloops Options RPT 8bitupto256iterationsRPTloc16location loc16 holdscountvalue RefertoUserGuideformorerepeatableinstructions Sum of Products RPT MAC XAR1 X0 X1 X19 MOVT loc16ADDACC P MPYP T loc16 MOVAT loc16 MAC XAR7 A0 A1 A19 SecondoperandmustuseXAR7 ProgramControlALU MultiplyOpera

13、tionsDataMoveLogicalOperationsSpecialInstructions DataMoveInstructions DATA DATA 4G 64K DATA PGM 4G 4M 32 bitaddressmemorylocation 16 bitaddressconcatenatedwith16leadingzeros ConditionalMoves IfA B ThenB A MOVWDP AMOVAL ACMPAL B A usect var 2 1B setA 1 sect code MOV B AL LT Before After InstructionE

14、xecution ifCONDismet MOVLloc32 ACC COND loc32 AX ByteOperations Byte 1 Lowbyteforregisteraddressing2 Lowbytefordirectaddressing3 Selectedbyteforoffsetindirectaddressing ByteAddressing MOVLXAR2 MemA MOVB XAR2 1 AL LSB MOVB XAR2 2 AL MSB MOVB XAR2 5 AH LSB MOVB XAR2 6 AH MSB AH MSBAH LSBAL MSBAL LSB 1

15、6bitmemory 12345678 MOVLXAR2 MemA MOVBAL LSB XAR2 1 MOVBAL MSB XAR2 2 MOVBAH LSB XAR2 4 MOVBAH MSB XAR2 7 ExampleofBytePacking ExampleofByteUn Packing TestandChangeMemory InstructionExecutionAffectsTBITloc16 0 15 ST0 TC loc16 bit no TCTSETloc16 0 15 Test loc16 bit thensetbitTCTCLRloc16 0 15 Test loc

16、16 bit thenclrbitTCCMPBAX 8bitTest AX 8bitunsigned C N ZCMPAX loc16Test AX loc16 C N ZCMPloc16 16bTest loc16 16bitsigned C N ZCMPLACC PTest ACC P PM C N Z MIN MAXOperations MOVLACC 0MOVLXAR1 tableRPT table length 1 MAXLACC XAR1 Findthemaximum32 bitnumberinatable Read Modify WriteInstructions ANDloc16 16bORloc16 16bXORloc16 16b ADDloc16 16bSUBRloc16 16b ANDloc16 AXORloc16 AXXORloc16 AX ADDloc16 AXSUBloc16 AXSUBRloc16 AX INCloc16DECloc16 TSETloc16 bitTCLRloc16 bit AH AL 16 bitconstant Workdirectly

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号