資源描述:
《嵌入式系統(tǒng)架構(gòu)軟體設(shè)計-德霖技術(shù)學(xué)院資訊工程系》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、嵌入式系統(tǒng)架構(gòu)軟體設(shè)計嵌入式系統(tǒng)架構(gòu)軟體設(shè)計---usingARMDay#3,#4,#5ModulesOutline課程介紹Day#3SimpleRISCAssemblyLanguageARMAssemblyLanguageARMDevelopmentSuite使用練習(xí)Day#4ArmInstructionsetImportantASMProgrammingSkillsARM/THUMB/CInterworkingDay#5ARMExceptionHandlerBuildARMROMImageUseNET-Start!ucLinuxBSP嵌入式系統(tǒng)產(chǎn)品設(shè)計流程概觀SteveFu
2、rber,ARMsystem-on-chipArchitecture,2nded.Seal,ARMarchitecturereferencemanual,2nded.ARMDevelopmentSuite-GettingStartedARMDevelopmentSuite-DeveloperGuideARMDevelopmentSuite-AssemblerGuidehttp://www.uclinux.org/2002嵌入式系統(tǒng)開發(fā)經(jīng)驗BuildingpowerfulplatformwithWindowsCESoftwareEngineering,Apractitioner’
3、sApproach3rded.ProfessionalSymbianProgramming嵌入式系統(tǒng)架構(gòu)軟體設(shè)計---usingARMModule#3-1:SimpleRISCAssemblyConceptRISC精簡指令集vs.CISC復(fù)雜指令集HardwareinstructiondecodelogicPipelineexecutionSingle-cycleexecutionLargemicrocodeROMstodecodeinstructionAllowlittlepipelineManycyclestocompleterasingleinstructionAsmal
4、lerdiesizeAshorterdevelopmenttimeAhigherperformancePoorcodedensityMUO一個簡單的處理器硬體單元功能PCProgramCounterACCAccumulatorALUArithmeticlogicunitIRInstructionregisterMUO指令集與資料路徑指令Opcode功能LDAS0000ACC=mem[S]STOS0001mem[S]=ACCADDS0010ACC=ACC+mem[S]SUBS0011ACC=ACC-mem[S]JMPS0100PC=SJGES0101IfACC>=PC=SJNES
5、0110IfACC!=0PC=SSTP0111stop指令規(guī)則指令執(zhí)行範(fàn)例ADD0x16AACC:=ACC+mem[0x16A]運算範(fàn)例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練習(xí):MUO微處理器的運算0x00
6、0LDA0x1000x002SUB0x1040x004STO0x1000x006JNE0x0000x008STP請描述此段程式的動作,暫存器值的變化、與資料流。請用C語言來寫出這段程式碼。指令Opcode功能LDAS0000ACC=mem[S]STOS0001mem[S]=ACCADDS0010ACC=ACC+mem[S]SUBS0011ACC=ACC-mem[S]JMPS0100PC=SJGES0101IfACC>=PC=SJNES0110IfACC!=0PC=SSTP0111stop嵌入式系統(tǒng)架構(gòu)軟體設(shè)計---usingARMModule#3-2:ARMAssemblyLa
7、nguageARM7TDMI資料流e.g.r3:=r4+(r4,,2)ADDr3,r4,r4,LSL#2AbusBbusARM的暫存器30general-purpose,32bitsregisters1ProgramCounter(PC)1CurrentProgramStatusRegister(CPSR)5SavedProgramStatusRegisters(SPSR)UsermodeFIQmodeirqmodeSVCmodeabortmodeundefinedmoder0r1r2r3r