您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > 3_3 C6000指令系统(3)-SOP(前一部分)
第3章汇编语言程序设计主讲:谢秀娟Email:bi041126055@126.comDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20022第一节C6000体系结构第二节C6000指令集第三节实例:乘积和(SOP)LearningObjectives第三节点积(SOP)ImplementationofSumofProducts(SOP)Dr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20024Twobasicoperationsarerequiredforthisalgorithm.(1)Multiplication(2)AdditionThereforetwobasicinstructionsarerequiredSOPisthekeyelementformostDSPalgorithms.Solet’swritethecodeforthisalgorithmandatthesametimelearntheC6000architecture.NnnnxaY1NNxaxaxa2211Dr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20025(1)Multiply----MPYThemultiplicationofa1byx1isdoneinassemblybythefollowinginstruction:MPYa1,x1,prodThisinstructionisperformedbyamultiplierunitthatiscalled“.M”NnnnxaY1NNxaxaxa2211Dr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20026(1)Multiply----.Munit.MThe.MunitperformsmultiplicationsinhardwareMPY.Ma1,x1,prodNote:16-bitby16-bitmultiplierprovidesa32-bitresult.32-bitby32-bitmultiplierprovidesa64-bitresult.401nnnxaYDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20027(2)Addition----.?unit.M.?MPY.Ma1,x1,prodADD.?Y,prod,Y401nnnxaYDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20028(2)Add----.LunitRISCprocessorssuchastheC6000useregisterstoholdtheoperands,soletschangethiscode..M.?MPY.Ma1,x1,prodADD.LY,prod,Y401nnnxaYDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments20029(3)RegisterFile-A.M.LA0A1A2A3A4A15RegisterFileA...a1x1prod32-bitsYLetuscorrectthisbyreplacinga,x,prodandYbytheregistersasshownabove.MPY.Ma1,x1,prodADD.LY,prod,Y401nnnxaYDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200210(3)SpecifyingRegisterNames.M.LA0A1A2A3A4A15RegisterFileA...a1x1prod32-bitsYTheregistersA0,A1,A3andA4containthevaluestobeusedbytheinstructions.MPY.MA0,A1,A3ADD.LA4,A3,A4401nnnxaYDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200211(4)DataloadingQ:Howdoweloadtheoperandsintotheregisters?RegisterFileAcontains16registers(A0-A15)whichare32-bitswide..M.LA0A1A2A3A4A15RegisterFileA...a1x1prod32-bitsYDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200212(4)LoadUnit“.D”A:Theoperandsareloadedintotheregistersbyloadingthemfromthememoryusingthe.Dunit.Q:Howdoweloadtheoperandsintotheregisters?DataMemory.M.LA0A1A2A3A4A15RegisterFileA...a1x1prod32-bitsY.DDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200213(4)LoadUnit“.D”Itisworthnotingatthisstagethattheonlywaytoaccessmemoryisthroughthe.Dunit.DataMemory.M.LA0A1A2A3A4A15RegisterFileA...a1x1prod32-bitsY.DDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200214(5)LoadInstructionQ:Whichinstruction(s)canbeusedforloadingoperandsfromthememorytotheregisters?DataMemory.M.LA0A1A2A3A4A15RegisterFileA...a1x1prod32-bitsY.DA:Theloadinstructions:LDB,LDH,LDW,LDDWDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200215(6)UsingtheLoadInstructionsBeforeusingtheloadunityouhavetobeawarethatthisprocessorisbyteaddressable,whichmeansthateachbyteisrepresentedbyauniqueaddress.0000000000000002000000040000000600000008Data16-bitsaddressFFFFFFFFAlsotheaddressesare32-bitwide.Dr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200216Thesyntaxfortheloadinstructionis:(6)UsingtheLoadInstructionsLD*Rn,Rm0000000000000002000000040000000600000008Data16-bitsaddressFFFFFFFFWhere:RnisaregisterthatcontainstheaddressoftheoperandtobeloadedandRmisthedestinationregister.Dr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200217Thequestionnowishowmanybytesaregoingtobeloadedintothedestinationregister?(6)UsingtheLoadInstructions0000000000000002000000040000000600000008Data16-bitsaddressFFFFFFFFThesyntaxfortheloadinstructionis:LD*Rn,RmDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200218(6)UsingtheLoadInstructionsTheanswer,isthatitdependsontheinstructionyouchoose:•LDB:loadsonebyte(8-bit)•LDH:loadshalfword(16-bit)•LDW:loadsaword(32-bit)•LDDW:loadsadoubleword(64-bit)Thesyntaxfortheloadinstructionis:LD*Rn,RmNote:LDonitsowndoesnotexist.0000000000000002000000040000000600000008Data16-bitsaddressFFFFFFFFDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200219(6)UsingtheLoadInstructionsExample:IfweassumethatA5=0x4then:(1)LDB*A5,A7;givesA7=0x00000001(2)LDH*A5,A7;givesA7=0x00000201(3)LDW*A5,A7;givesA7=0x04030201(4)LDDW*A5,A7:A6;givesA7:A6=0x08070605040302010000000000000002000000040000000600000008Data16-bitsaddressFFFFFFFF0xB0xA0xD0xC0x10x20x30x40x50x60x70x801Thesyntaxfortheloadinstructionis:LD*Rn,RmDr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200220(6)UsingtheLoadInstructionsQuestion:Ifdatacanonlybeaccessedbytheloadinstructionandthe.Dunit,howcanweloadtheregisterpointerRninthefirstplace?Thesyntaxfortheloadinstructionis:LD*Rn,Rm0000000000000002000000040000000600000008Data16-bitsaddressFFFFFFFF0xB0xA0xD0xC0x10x20x30x40x50x60x70x801Dr.NaimDahnoun,BristolUniversity,(c)TexasInstruments200221TheinstructionMVKLwillallowamoveofa16-bitconstantintoaregisterasshownbelow:MVKL.?a,A5(‘a’isaconstantorlabel)Howmanybitsrepresentafulladdress?32bitsSowhydoestheinstructionnotallowa32-bitmove?Allinstructionsare32-bitwide(seeinst
本文标题:3_3 C6000指令系统(3)-SOP(前一部分)
链接地址:https://www.777doc.com/doc-4603042 .html