欢迎来到天天文库
浏览记录
ID:57149793
大小:509.00 KB
页数:57页
时间:2020-08-01
《黄英_《单片机原理及应用》讲义课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Chapter3:InstructionsystemMicrocontrollerPrincipleandApplication主讲教师:黄英1Contents:3.1InstructionformatandAddressingModes3.2InstructionIntroductionChapter3Instructionsystem2•AssembleLanguage:symboliclanguage•Assembler:Acomputerprogramusedtoassemble•SourceProgramAssemblerObjectprogram(Sourcec
2、odes)(Machinecodes)•InstructionSet:cannottransplantdirectlyChapter3Instructionsystem3.1InstructionformatandAddressingModes33.1InstructionformatandAddressingModes3.1.1Instructionformat•Instruction=opcodeoperand=opcodedestinationoperand,sourceoperand•Instructiontypes:1-byteInstruction:includes
3、opcodeandoperand2-byteInstruction:1thbyteisopcode2thbyteisoperand3-byteInstruction:1thbyteisopcode2th,3thbyteareoperands43.1InstructionformatandAddressingModes•Addressing:howtogetthelocationof(source)operand.•AddressingModes:7types1.RegisterAddressing2.DirectAddressing3.RegisterIndirectAddre
4、ssing4.ImmediateConstantsAddressing5.IndexedAddressing6.BooleanAddressing3.1.2AddressingModes7.RelativeAddressing(getthejumpingdestinationaddressofPC)53.1.2AddressingModes1.RegisterAddressing•Operand:denotedbyregister.Forexample:MOVA,R0•AddressingRange:①Generalregister:4banks×8(R0~R7)=32regi
5、sters②SomeSFRs:A,AB,DPTR,etc.63.1.2AddressingModes•Operand:denoteddirectlyby8-bitaddress.Forexample:MOVA,3AH•AddressingRange:①Lower128bytesofinternalRAM②SFRs2.DirectAddressing73.1.2AddressingModes•Operand:specifiesaregistertocontainoperandaddresswiththeprefix“@”.•AddressingRange:①Lower128byt
6、esofinternalRAM(8-bitaddress)②64KBofexternalRAM(16-bitaddress)3.RegisterIndirectAddressing•addressregisterof8-bitaddress:Ri(i=0,1)SP(PUSH,POP)addressregisterof16-bitaddress:DPTRForexample:MOVA,@R0MOVXA,@DPTR83.1.2AddressingModes•Operand:specifiesthevalueofa8-bitor16-bitconstantwiththeprefix“
7、#”.Forexample:MOVA,#3AHMOVDPTR,#0200H4.ImmediateConstantsAddressing93.1.2AddressingModes•Onlythreeinstruction:MOVCA,@A+DPTRMOVCA,@A+PCJMP@A+DPTR•AddressingRange:ProgramMemory(ROM)5.IndexedAddressing•ProgramMemorycanonlybeaccessedviathismode.•Design
此文档下载收益归作者所有