外文翻译computerprogram英文.docx

上传人:b****4 文档编号:4672804 上传时间:2023-05-07 格式:DOCX 页数:7 大小:19.38KB
下载 相关 举报
外文翻译computerprogram英文.docx_第1页
第1页 / 共7页
外文翻译computerprogram英文.docx_第2页
第2页 / 共7页
外文翻译computerprogram英文.docx_第3页
第3页 / 共7页
外文翻译computerprogram英文.docx_第4页
第4页 / 共7页
外文翻译computerprogram英文.docx_第5页
第5页 / 共7页
外文翻译computerprogram英文.docx_第6页
第6页 / 共7页
外文翻译computerprogram英文.docx_第7页
第7页 / 共7页
亲,该文档总共7页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

外文翻译computerprogram英文.docx

《外文翻译computerprogram英文.docx》由会员分享,可在线阅读,更多相关《外文翻译computerprogram英文.docx(7页珍藏版)》请在冰点文库上搜索。

外文翻译computerprogram英文.docx

外文翻译computerprogram英文

ComputerProgram

1Introduction

ComputerProgram,setofinstructionsthatdirectsacomputertoperformsomeprocessingfunctionorcombinationoffunctions.Fortheinstructionstobecarriedout,acomputermustexecuteaprogram,thatis,thecomputerreadstheprogram,andthenfollowthestepsencodedintheprograminapreciseorderuntilcompletion.Aprogramcanbeexecutedmanydifferenttimes,witheachexecutionyieldingapotentiallydifferentresultdependingupontheoptionsanddatathattheusergivesthecomputer.

Programsfallintotwomajorclasses:

applicationprogramsandoperatingsystems.Anapplicationprogramisonethatcarriesoutsomefunctiondirectlyforauser,suchaswordprocessingorgame-playing.Anoperatingsystemisaprogramthatmanagesthecomputerandthevariousresourcesanddevicesconnectedtoit,suchasRAM,harddrives,monitors,keyboards,printers,andmodems,sothattheymaybeusedbyotherprograms.ExamplesofoperatingsystemsareDOS,Windows95,OS\2,andUNIX.

2ProgramDevelopment

Softwaredesignerscreatenewprogramsbyusingspecialapplicationsprograms,oftencalledutilityprogramsordevelopmentprograms.Aprogrammerusesanothertypeofprogramcalledatexteditortowritethenewprograminaspecialnotationcalledaprogramminglanguage.Withthetexteditor,theprogrammercreatesatextfile,whichisanorderedlistofinstructions,alsocalledtheprogramsourcefile.Theindividualinstructionsthatmakeuptheprogramsourcefilearecalledsourcecode.Atthispoint,aspecialapplicationsprogramtranslatesthesourcecodeintomachinelanguage,orobjectcode—aformatthattheoperatingsystemwillrecognizeasaproperprogramandbeabletoexecute.

Threetypesofapplicationsprogramstranslatefromsourcecodetoobjectcode:

compilers,interpreters,andassemblers.Thethreeoperatedifferentlyandondifferenttypesofprogramminglanguages,buttheyservethesamepurposeoftranslatingfromaprogramminglanguageintomachinelanguage.

Acompilertranslatestextfileswritteninahigh-levelprogramminglanguage--suchasFORTRAN,C,orPascal—fromthesourcecodetotheobjectcodeallatonce.ThisdiffersfromtheapproachtakenbyinterpretedlanguagessuchasBASIC,APLandLISP,inwhichaprogramistranslatedintoobjectcodestatementbystatementaseachinstructionisexecuted.Theadvantagetointerpretedlanguagesisthattheycanbeginexecutingtheprogramimmediatelyinsteadofhavingtowaitforallofthesourcecodetobecompiled.Changescanalsobemadetotheprogramfairlyquicklywithouthavingtowaitforittobecompiledagain.Thedisadvantageofinterpretedlanguagesisthattheyareslowtoexecute,sincetheentireprogrammustbetranslatedoneinstructionatatime,eachtimetheprogramisrun.Ontheotherhand,compiledlanguagesarecompiledonlyonceandthuscanbeexecutedbythecomputermuchmorequicklythaninterpretedlanguages.Forthisreason,compiledlanguagesaremorecommonandarealmostalwaysusedinprofessionalandscientificapplications.

Anothertypeoftranslatoristheassembler,whichisusedforprogramsorpartsofprogramswritteninassemblylanguage.Assemblylanguageisanotherprogramminglanguage,butitismuchmoresimilartomachinelanguagethanothertypesofhigh-levellanguages.Inassemblylanguage,asinglestatementcanusuallybetranslatedintoasingleinstructionofmachinelanguage.Today,assemblylanguageisrarelyusedtowriteanentireprogram,butisinsteadmostoftenusedwhentheprogrammerneedstodirectlycontrolsomeaspectofthecomputer’sfunction.

Programsareoftenwrittenasasetofsmallerpieces,witheachpiecerepresentingsomeaspectoftheoverallapplicationprogram.Aftereachpiecehasbeencompiledseparately,aprogramcalledalinkercombinesallofthetranslatedpiecesintoasingleexecutableprogram.

Programsseldomworkcorrectlythefirsttime,soaprogramcalledadebuggerisoftenusedtohelpfindproblemscalledbugs.Debuggingprogramsusuallydetectaneventintheexecutingprogramandpointtheprogrammerbacktotheoriginoftheeventintheprogramcode.

Recentprogrammingsystems,suchasJava,useacombinationofapproachestocreateandexecuteprograms.AcompilertakesaJavasourceprogramandtranslatesitintoanintermediateform.SuchintermediateprogramsarethentransferredovertheInternetintocomputerswhereaninterpreterprogramthenexecutestheintermediateformasanapplicationprogram.

3ProgramElements

Mostprogramsarebuiltfromjustafewkindsofstepsthatarerepeatedmanytimesindifferentcontextsandindifferentcombinationsthroughouttheprogram.Themostcommonstepperformssomecomputation,andthenproceedstothenextstepintheprogram,intheorderspecifiedbytheprogrammer.

Programsoftenneedtorepeatashortseriesofstepsmanytimes,forinstanceinlookingthroughalistofgamescoresandfindingthehighestscore.Suchrepetitivesequencesofcodearecalledloops.

Oneofthecapabilitiesthatmakescomputersousefulistheirabilitytomakeconditionaldecisionsandperformdifferentinstructionsbasedonthevaluesofdatabeingprocessed.If-then-elsestatementsimplementthisfunctionbytestingsomepieceofdataandthenselectingoneoftwosequencesofinstructionsonthebasisoftheresult.Oneoftheinstructionsinthesealternativesmaybeagotostatementthatdirectsthecomputertoselectitsnextinstructionfromadifferentpartoftheprogram.Forexample,aprogrammightcomparetwonumbersandbranchtoadifferentpartoftheprogramdependingontheresultofthecomparison:

Ifxisgreaterthany

Then

Gotoinstruction#10

Elsecontinue

Programoftenuseaspecificsequenceofstepsmorethanonce.Suchasequenceofstepscanbegroupedtogetherintoasubroutine,whichcanthenbecalled,oraccessed,asneededindifferentpartsofthemainprogram.Eachtimeasubroutineiscalled,thecomputerrememberswhereitwasintheprogramwhenthecallwasmade,sothatitcanreturnthereuponcompletionofthesubroutine,allowingaverygeneralpieceofcodetobewrittenonceandusedinmultipleways.

Mostprogramsuseseveralvarietiesofsubroutines.Themostcommonofthesearefunctions,procedures,libraryroutines,systemroutines,anddevicedrivers.Functionsareshortsubroutinesthatcomputesomevalue,suchascomputationsofangles,whichthecomputercannotcomputewithasinglebasicinstruction.Proceduresperformamorecomplexfunction,suchassortingasetofnames.Libraryroutinesaresubroutinesthatarewrittenforusebymanydifferentprograms.Systemroutinesaresimilartolibraryroutinesbutareactuallyfoundintheoperatingsystem.Theyprovidesomeservicefortheapplicationprograms,suchasprintingalineoftext.Devicedriversaresystemroutinesthatareaddedtoanoperatingsystemtoallowthecomputertocommunicatewithanewdevice,suchasascanner,modem,orprinter.Devicedriversoftenhavefeaturesthatcanbeexecuteddirectlyasapplicationsprograms.Thisallowstheusertodirectlycontrolthedevice,whichisusefulif,forinstance,acolorprinterneedstoberealignedtoattainthebestprintingqualityafterchanginganinkcartridge.

4ProgramFunction

Moderncomputersusuallystoreprogramsonsomeformofmagneticstoragemediathatcanbeaccessedrandomlybythecomputer,suchastheharddrivediskpermanentlylocatedinthecomputer,oraportablefloppydisk.Additionalinformationonsuchdisks,calleddirectories,indicatethenamesofthevariousprogrambeginsonthediskmedia.Whenauserdirectsthecomputertoexecuteaparticularapplicationprogram,theoperatingsystemlooksthroughthesedirectories,locatestheprogram,andreadsacopyintoRAM.TheoperatingsystemthendirectstheCPUtostartexecutingtheinstructionsatthebeginningoftheprogram.InstructionsatthebeginningoftheprogrampreparethecomputertoprocessinformationbylocatingfreememorylocationsinRAMtoholdworkingdata,retrievingcopiesofthestandardoptionsanddefaultstheuserhasindicatedfromadisk,anddrawinginitialdisplaysonthemonitor.

Theapplicationprogramrequestscopyofanyinformationtheuserentersbymakingacalltoasystemroutine.Theoperatingsystemconvertsanydatasoenteredintoastandardinternalform.Theapplicationthenusesthisinformationtodecidewhattodonext---forexample,performsomedesiredprocessingfunctionsuchasreformattingapageoftext,orobtainsomeadditionalinformationfromanotherfileonadisk.Ineithercase,callstoothersystemroutinesareusedtoactuallycarryoutthedisplayoftheresultsortheaccessingofthefilefromthedisk.

Whentheapplicationreachescompletionorispromptedtoquit,itmakesfurthersystemcallstomakesurethatalldatathatneedstobesavedhasbeenwrittenbacktodisk.Itthenmakesafinalsystemcalltotheoperatingsystemindicatingthatitisfinished.TheoperatingsystemthenfreesuptheRAMandanydevicethattheapplicationwasusingandawaitsacommandfromtheusertostartanotherprogram.

5History

Peoplehavebeenstoringsequencesofinstructionsintheformofaprogramforseveralcenturies.Musicboxesofthe18thcenturyandplayerpianosofthelate19thandearly20thcenturiesplayedmusicalprogramsstoredasseriesifmetalpins,orholesinpaper,witheachlinerepresentingwhenanotewastobeplayed,andthepinorholeindicatingwhatnotewastobeplayedatthattime.Moreelaboratecontrolofphysicaldevicesbecamecommonintheearly1800swithFrenchinventorJosephMarieJacquard’sinventionofthepunch-cardcontrolledweaving

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2