資源描述:
《嵌入式系統(tǒng)架構軟體設計》由會員上傳分享,免費在線閱讀,更多相關內容在教育資源-天天文庫。
1、嵌入式系統(tǒng)架構軟體設計嵌入式系統(tǒng)架構軟體設計---usingARMDay#3,#4,#5ModulesOutline課程介紹Day#3SimpleRISCAssemblyLanguageARMAssemblyLanguageARMDevelopmentSuite使用練習Day#4ArmInstructionsetImportantASMProgrammingSkillsARM/THUMB/CInterworkingDay#5ARMExceptionHandlerBuildARMROMImageUseNET-Start!ucLinuxBSP嵌入式系統(tǒng)產品設計流
2、程概觀ARMsystem-on-chipArchitecture,2nded.ARMarchitecturereferencemanual,2nded.ARMDevelopmentSuite-GettingStartedARMDevelopmentSuite-DeveloperGuideARMDevelopmentSuite-AssemblerGuidehttp://www.uclinux.org/2002嵌入式系統(tǒng)開發(fā)經驗BuildingpowerfulplatformwithWindowsCESoftwareEngineering,Apractition
3、er’sApproach3rded.ProfessionalSymbianProgramming嵌入式系統(tǒng)架構軟體設計---usingARMModule#3-1:SimpleRISCAssemblyConceptRISC精簡指令集vs.CISC復雜指令集HardwareinstructiondecodelogicPipelineexecutionSingleexecutionLargemicrocodeROMstodecodeinstructionAllowlittlepipelineManycyclestocompleterasingleinstructi
4、onAsmallerdiesizeAshorterdevelopmenttimeAhigherperformancePoorcodedensityMUO一個簡單的處理器MUO指令集與資料路徑指令Opcode功能LDAS0000ACC=mem[S]STOS0001mem[S]=ACCADDS0010ACC=ACC+mem[S]SUBS0011ACC=ACC-mem[S]JMPS0100PC=SJGES0101IfACC>=PC=SJNES0110IfACC!=0PC=SSTP0111stop指令規(guī)則指令執(zhí)行范例ADD0x16AACC:=ACC+mem[0x16
5、A]運算范例Cfunction:Main(){C=A+B;}MUO機器指令LDA0x100ADD0x104STO0x108指令Opcode功能LDAS0000ACC=mem[S]STOS0001mem[S]=ACCADDS0010ACC=ACC+mem[S]SUBS0011ACC=ACC-mem[S]JMPS0100PC=SJGES0101IfACC>=PC=SJNES0110IfACC!=0PC=SSTP0111stop練習:MUO微處理器的運算0x100LDA0x1000x002SUB0x1040x004STO0x1000x006JNE0x0000x00
6、8STP請描述此段程式的動作,暫存器值的變化、與資料流。請用C語言來寫出這段程式碼。指令Opcode功能LDAS0000ACC=mem[S]STOS0001mem[S]=ACCADDS0010ACC=ACC+mem[S]SUBS0011ACC=ACC-mem[S]JMPS0100PC=SJGES0101IfACC>=PC=SJNES0110IfACC!=0PC=SSTP0111stop嵌入式系統(tǒng)架構軟體設計---usingARMModule#3-2:ARMAssemblyLanguageARM7TDMI資料流e.g.r3:=r4+(r4,,2)ADDr3,r
7、4,r4,LSL#2AbusBbusARM的暫存器30general-purpose,32bitsregisters1ProgramCounter(PC)1CurrentProgramStatusRegister(CPSR)5SavedProgramStatusRegisters(SPSR)UsermodeFIQmodeirqmodeSVCmodeabortmodeundefinedmodeProgramStatusRegisterCPSR:CurrrentProgramStatusRegiterSPSR:SavedProgramStatusRegister
8、Conditioncodeflags-N:Negat