资源描述:
《电脑的灵魂---软体》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、電腦的靈魂---軟體OperatingSystem&Shell(CommandInterpreter)交大資工系蔡文能AgendaHardwareReviewThecentralprocessingunit.Instructions&Thestored-programconcept.Programexecution.OperatingSystem.OverviewUnix,GNU,FreeBSD,Linux,…Shells(CommandInterpreter)Q&A2電腦硬體五大單元計算2+3=?單晶片微電腦=CPU+MemoryALU+CU合稱CPU人會如何做?
2、電腦如何做?ALU又稱DataPath3CPUandmainmemoryconnectedviaabusReaddatabysupplyingmemorycelladdressWritedatabysupplyingmemorycelladdressMainMemory4MachineInstrugctions(1/3)DatatransferMovementofdatafromonelocationtoanotherLOADfillaregisterwithcontentsofamemorycellLOADIfillaregisterwithconstantint
3、heinstructionImmediatelySTOREtransfercontentsofaregistertoamemorycellMovetransfercpntentsofaregistertoanotherregisterArithmetic/LogicArithmeticoperationsADD,FADDLogicoperationsOR,AND,XORROTATEControldirectexecutionofprogramJUMPdirectcontrolunittoexecuteaninstructionotherthanthenextoneU
4、nconditionalSkiptostep5ConditionalIfresultingvalueis0,thenskiptostep5電腦有左邊這些指令就夠用了5MachineInstructions(2/3)ExampleforaconditionalJUMPDivision1-LOADaregisterR1withavaluefrommemory2-LOADregisterR2withanothervaluefrommemory3-IfcontentsofR2iszero,JUMPtostep64-DividecontentsofR1bycontentsof
5、R2,resultstoredinR35-STOREthecontentofR3intomemory6-STOP6MachineInstructions(3/3)TheInstructionsofasamplemachineOp-CodeOperandAssemblyLanguage1RXYLOADR,XY;LoadtheRegisterRwithdatainmemoryXY2RXYLOADIR,XY;LoadtheconstantXYintoRegisterR3RXYSTORER,XY;StorethedatainRegisterRintomemoryXY40RS
6、MOVER,S;copyRtoS5RSTADDR,S,T;R=S+T6RSTFADDR,S,T;floatingAdd7RSTORR,S,T;R=SorT8RSTANDR,S,T;R=SandT9RSTXORR,S,T;R=SxorTAR0XROTRR,X;RotatetheRegisterRtotheRightXtimesBRXYJUMPR,XY;gotoXYif[RegisterR]==[R0]C000HALTHowtodoaSubtraction?7Stored-ProgramConceptInearlycomputing,theprogramisbuilti
7、ntothecontrolunitasapartofthemachine.Theuserrewiresthecontrolunittoadaptdifferentprograms.Program(instructions)storedinmemoryinsteadofbeingbuiltintothecontrolunitaspartofthemachineAcomputer’sprogramcanbechangedmerelybychangingthecontentsofthecomputer’smemoryinsteadofrewiringthecontro