关闭

关闭

关闭

封号提示

内容

首页 professional assembly language.pdf

professional assembly language.pdf

professional assembly language.…

上传者: 何建亮_freedom 2012-05-14 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《professional assembly languagepdf》,可适用于高等教育领域,主题内容包含ProfessionalAssemblyLanguageRichardBlumffirsqxd:AMPageiiiffirsqxd:AMPageii符等。

ProfessionalAssemblyLanguageRichardBlumffirsqxd:AMPageiiiffirsqxd:AMPageiiProfessionalAssemblyLanguageffirsqxd:AMPageiffirsqxd:AMPageiiProfessionalAssemblyLanguageRichardBlumffirsqxd:AMPageiiiProfessionalAssemblyLanguagePublishedbyWileyPublishing,IncCrosspointBoulevardIndianapolis,INwwwwileycomCopyrightbyWileyPublishing,Inc,Indianapolis,IndianaAllrightsreservedPublishedsimultaneouslyinCanadaISBN:ManufacturedintheUnitedStatesofAmericaMASWQRQVINNopartofthispublicationmaybereproduced,storedinaretrievalsystemortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recording,scanningorotherwise,exceptaspermittedunderSectionsoroftheUnitedStatesCopyrightAct,withouteitherthepriorwrittenpermissionofthePublisher,orauthorizationthroughpaymentoftheappropriatepercopyfeetotheCopyrightClearanceCenter,RosewoodDrive,Danvers,MA,(),fax()RequeststothePublisherforpermissionshouldbeaddressedtotheLegalDepartment,WileyPublishing,Inc,CrosspointBlvd,Indianapolis,IN,(),fax(),email:brandreviewwileycomLIMITOFLIABILITYDISCLAIMEROFWARRANTY:THEPUBLISHERANDTHEAUTHORMAKENOREPRESENTATIONSORWARRANTIESWITHRESPECTTOTHEACCURACYORCOMPLETENESSOFTHECONTENTSOFTHISWORKANDSPECIFICALLYDISCLAIMALLWARRANTIES,INCLUDINGWITHOUTLIMITATIONWARRANTIESOFFITNESSFORAPARTICULARPURPOSENOWARRANTYMAYBECREATEDOREXTENDEDBYSALESORPROMOTIONALMATERIALSTHEADVICEANDSTRATEGIESCONTAINEDHEREINMAYNOTBESUITABLEFOREVERYSITUATIONTHISWORKISSOLDWITHTHEUNDERSTANDINGTHATTHEPUBLISHERISNOTENGAGEDINRENDERINGLEGAL,ACCOUNTING,OROTHERPROFESSIONALSERVICESIFPROFESSIONALASSISTANCEISREQUIRED,THESERVICESOFACOMPETENTPROFESSIONALPERSONSHOULDBESOUGHTNEITHERTHEPUBLISHERNORTHEAUTHORSHALLBELIABLEFORDAMAGESARISINGHEREFROMTHEFACTTHATANORGANIZATIONORWEBSITEISREFERREDTOINTHISWORKASACITATIONANDORAPOTENTIALSOURCEOFFURTHERINFORMATIONDOESNOTMEANTHATTHEAUTHORORTHEPUBLISHERENDORSESTHEINFORMATIONTHEORGANIZATIONORWEBSITEMAYPROVIDEORRECOMMENDATIONSITMAYMAKEFURTHER,READERSSHOULDBEAWARETHATINTERNETWEBSITESLISTEDINTHISWORKMAYHAVECHANGEDORDISAPPEAREDBETWEENWHENTHISWORKWASWRITTENANDWHENITISREADForgeneralinformationonourotherproductsandservicesortoobtaintechnicalsupport,pleasecontactourCustomerCareDepartmentwithintheUSat(),outsidetheUSat()orfax()WileyalsopublishesitsbooksinavarietyofelectronicformatsSomecontentthatappearsinprintmaynotbeavailableinelectronicbooksBlum,RichardProfessionalassemblylanguageRichardBlumpcmIncludesindexISBN(paperwebsite)Assemblylanguage(Computerprogramlanguage)TitleQAAB'dcTrademarks:Wiley,theWileyPublishinglogo,Wrox,theWroxlogo,ProgrammertoProgrammerandrelatedtradedressaretrademarksorregisteredtrademarksofJohnWileySons,Incandoritsaffiliates,intheUnitedStatesandothercountries,andmaynotbeusedwithoutwrittenpermissionAllothertrademarksarethepropertyoftheirrespectiveownersWileyPublishing,Inc,isnotassociatedwithanyproductorvendormentionedinthisbookffirsqxd:AMPageivAbouttheAuthorRichardBlumhasworkedforalargeUSgovernmentorganizationformorethanyearsDuringthattime,hehashadtheopportunitytoprogramutilitiesinvariousprogramminglanguages:C,C,Java,andMicrosoftVBNETandC#Withthisexperience,RichhasoftenfoundthebenefitofreviewingassemblylanguagecodegeneratedbycompilersandutilizingassemblylanguageroutinestospeeduphigherlevellanguageprogramsRichhasabachelorofsciencedegreeinelectricalengineeringfromPurdueUniversity,whereheworkedonmanyassemblylanguageprojects(Ofcourse,thiswasbackintheeightbitprocessordays)HealsohasamasterofsciencedegreeinmanagementfromPurdueUniversity,specializinginManagementInformationSystemsWhenRichisnotbeingacomputernerd,heiseitherplayingelectricbassforthechurchworshipbandorspendingtimewithhiswife,Barbara,andtwodaughters,KatieJaneandJessicaffirsqxd:AMPagevffirsqxd:AMPageviCreditsExecutiveEditorChrisWebbDevelopmentEditorAdaobiObiTultonProductionEditorWilliamABartonTechnicalEditorPaulCarterCopyEditorLuannRouffEditorialManagerKathrynMalmBourgoineVicePresidentExecutiveGroupPublisherRichardSwadleyVicePresidentandPublisherJosephBWikertProjectCoordinatorErinSmithGraphicsandProductionSpecialistsJonelleBurnsAmandaCarterCarrieAFosterLaurenGoddardDennyHagerJoyceHaugheyQualityControlTechniciansDavidFaustSusanMoritzCarlWilliamPierceMediaDevelopmentSpecialistAngieDennyProofreadingTECHBOOKSProductionServicesIndexingRichardTEvansffirsqxd:AMPageviiffirsqxd:AMPageviiiThisbookisdedicatedtomywife,Barbara,andmydaughters,KatieJaneandJessica“TrustintheLordwithallyourheartandleannotonyourownunderstandinginallwaysacknowledgehim,andhewillmakeyourpathsstraight”Pr:(NIV)ffirsqxd:AMPageixffirsqxd:AMPagexAcknowledgmentsFirst,allhonor,glory,andpraisegotoGod,whothroughHisSonmakesallthingspossibleandgivesusthegiftofeternallifeManythanksgotothegreatteamofpeopleatJohnWileySonsPublishingThankstoChrisWebb,theacquisitionseditor,forofferingmetheopportunitytowritethisbookIamforeverindebtedtoAdaobiObiTulton,thedevelopmenteditor,forherworkinmakingthisbookpresentableandheroverallguidancethroughthebookwritingprocessAlso,manythanksgotoPaulCarter,thetechnicaleditorofthebookPaul’scommentsthroughoutthebookwereinvaluableinpresentingthetopicinthebestwayandforpointingoutmygoofsandblundersIwouldalsoliketothankCaroleMcClendonatWatersideProductions,Inc,forarrangingthisopportunityforme,andforhelpingoutinmywritingcareerFinally,Iwouldliketothankmyparents,MikeandJoyceBlum,fortheirdedicationandsupportwhileraisingme,andtomywife,Barbara,anddaughters,KatieJaneandJessica,fortheirlove,patience,andunderstanding,especiallywhileIwaswritingthisbookffirsqxd:AMPagexiffirsqxd:AMPagexiiContentsAcknowledgmentsxiContentsxiiiIntroductionxxiiiChapter:WhatIsAssemblyLanguageProcessorInstructionsInstructioncodehandlingInstructioncodeformatHighLevelLanguagesTypesofhighlevellanguagesHighlevellanguagefeaturesAssemblyLanguageOpcodemnemonicsDefiningdataDirectivesSummaryChapter:TheIAPlatformCorePartsofanIAProcessorControlunitExecutionunitRegistersFlagsAdvancedIAFeaturesThexfloatingpointunitMultimediaextensions(MMX)StreamingSIMDextensions(SSE)HyperthreadingTheIAProcessorFamilyIntelprocessorsNonIntelprocessorsSummaryftocqxd:AMPagexiiixivContentsChapter:TheToolsoftheTradeTheDevelopmentToolsTheAssemblerTheLinkerTheDebuggerTheCompilerTheobjectcodedisassemblerTheProfilerTheGNUAssemblerInstallingtheassemblerUsingtheassemblerAwordaboutopcodesyntaxTheGNULinkerTheGNUCompilerDownloadingandinstallinggccUsinggccTheGNUDebuggerProgramDownloadingandinstallinggdbUsinggdbTheKDEDebuggerDownloadingandinstallingkdbgUsingkdbgTheGNUObjdumpProgramUsingobjdumpAnobjdumpexampleTheGNUProfilerProgramUsingtheprofilerAprofileexampleACompleteAssemblyDevelopmentSystemThebasicsofLinuxDownloadingandrunningMEPISYournewdevelopmentsystemSummaryChapter:ASampleAssemblyLanguageProgramThePartsofaProgramDefiningsectionsDefiningthestartingpointCreatingaSimpleProgramTheCPUIDinstructionThesampleprogramftocqxd:AMPagexivxvContentsBuildingtheexecutableRunningtheexecutableAssemblingusingacompilerDebuggingtheProgramUsinggdbUsingCLibraryFunctionsinAssemblyUsingprintfLinkingwithClibraryfunctionsSummaryChapter:MovingDataDefiningDataElementsThedatasectionDefiningstaticsymbolsThebsssectionMovingDataElementsTheMOVinstructionformatsMovingimmediatedatatoregistersandmemoryMovingdatabetweenregistersMovingdatabetweenmemoryandregistersConditionalMoveInstructionsTheCMOVinstructionsUsingCMOVinstructionsExchangingDataThedataexchangeinstructionsUsingthedataexchangeinstructionTheStackHowthestackworksPUSHingandPOPingdataPUSHingandPOPingalltheregistersManuallyusingtheESPandEBPregistersOptimizingMemoryAccessSummaryChapter:ControllingExecutionFlowTheInstructionPointerUnconditionalBranchesJumpsCallsInterruptsftocqxd:AMPagexvxviContentsConditionalBranchesConditionaljumpinstructionsThecompareinstructionExamplesofusingtheflagbitsLoopsTheloopinstructionsAloopexamplePreventingLOOPcatastrophesDuplicatingHighLevelConditionalBranchesifstatementsforloopsOptimizingBranchInstructionsBranchpredictionOptimizingtipsSummaryChapter:UsingNumbersNumericDataTypesIntegersStandardintegersizesUnsignedintegersSignedintegersUsingsignedintegersExtendingintegersDefiningintegersinGASSIMDIntegersMMXintegersMovingMMXintegersSSEintegersMovingSSEintegersBinaryCodedDecimalWhatisBCDFPUBCDvaluesMovingBCDvaluesFloatingPointNumbersWhatarefloatingpointnumbersStandardfloatingpointdatatypesIAfloatingpointvaluesDefiningfloatingpointvaluesinGASMovingfloatingpointvaluesUsingpresetfloatingpointvaluesftocqxd:AMPagexvixviiContentsSSEfloatingpointdatatypesMovingSSEfloatingpointvaluesConversionsConversioninstructionsAconversionexampleSummaryChapter:BasicMathFunctionsIntegerArithmeticAdditionSubtractionIncrementinganddecrementingMultiplicationDivisionShiftInstructionsMultiplybyshiftingDividingbyshiftingRotatingbitsDecimalArithmeticUnpackedBCDarithmeticPackedBCDarithmeticLogicalOperationsBooleanlogicBittestingSummaryChapter:AdvancedMathFunctionsTheFPUEnvironmentTheFPUregisterstackTheFPUstatus,control,andtagregistersUsingtheFPUstackBasicFloatingPointMathAdvancedFloatingPointMathFloatingpointfunctionsPartialremaindersTrigonometricfunctionsLogarithmicfunctionsFloatingPointConditionalBranchesTheFCOMinstructionfamilyTheFCOMIinstructionfamilyTheFCMOVinstructionfamilyftocqxd:AMPagexviixviiiContentsSavingandRestoringtheFPUStateSavingandrestoringtheFPUenvironmentSavingandrestoringtheFPUstateWaitingversusNonwaitingInstructionsOptimizingFloatingPointCalculationsSummaryChapter:WorkingwithStringsMovingStringsTheMOVSinstructionTheREPprefixOtherREPinstructionsStoringandLoadingStringsTheLODSinstructionTheSTOSinstructionBuildingyourownstringfunctionsComparingStringsTheCMPSinstructionUsingREPwithCMPSStringinequalityScanningStringsTheSCASinstructionScanningformultiplecharactersFindingastringlengthSummaryChapter:UsingFunctionsDefiningFunctionsAssemblyFunctionsWritingfunctionsAccessingfunctionsFunctionplacementUsingregistersUsingglobaldataPassingDataValuesinCStyleRevisitingthestackPassingfunctionparametersonthestackFunctionprologueandepilogueDefininglocalfunctiondataftocqxd:AMPagexviiixixContentsCleaningoutthestackAnexampleWatchingthestackinactionUsingSeparateFunctionFilesCreatingaseparatefunctionfileCreatingtheexecutablefileDebuggingseparatefunctionfilesUsingCommandLineParametersTheanatomyofaprogramAnalyzingthestackViewingcommandlineparametersViewingenvironmentvariablesAnexampleusingcommandlineparametersSummaryChapter:UsingLinuxSystemCallsTheLinuxKernelPartsofthekernelLinuxkernelversionSystemCallsFindingsystemcallsFindingsystemcalldefinitionsCommonsystemcallsUsingSystemCallsThesystemcallformatAdvancedSystemCallReturnValuesThesysinfosystemcallUsingthereturnstructureViewingtheresultsTracingSystemCallsThestraceprogramAdvancedstraceparametersWatchingprogramsystemcallsAttachingtoarunningprogramSystemCallsversusCLibrariesTheClibrariesTracingCfunctionsComparingsystemcallsandClibrariesSummaryftocqxd:AMPagexixxxContentsChapter:UsingInlineAssemblyWhatIsInlineAssemblyBasicInlineAssemblyCodeTheasmformatUsingglobalCvariablesUsingthevolatilemodifierUsinganalternatekeywordExtendedASMExtendedASMformatSpecifyinginputandoutputvaluesUsingregistersUsingplaceholdersReferencingplaceholdersAlternativeplaceholdersChangedregisterslistUsingmemorylocationsUsingfloatingpointvaluesHandlingjumpsUsingInlineAssemblyCodeWhataremacrosCmacrofunctionsCreatinginlineassemblymacrofunctionsSummaryChapter:CallingAssemblyLibrariesCreatingAssemblyFunctionsCompilingtheCandAssemblyProgramsCompilingassemblysourcecodefilesUsingassemblyobjectcodefilesTheexecutablefileUsingAssemblyFunctionsinCProgramsUsingintegerreturnvaluesUsingstringreturnvaluesUsingfloatingpointreturnvaluesUsingmultipleinputvaluesUsingmixeddatatypeinputvaluesUsingAssemblyFunctionsinCProgramsCreatingStaticLibrariesWhatisastaticlibraryThearcommandftocqxd:AMPagexxxxiContentsCreatingastaticlibraryfileCompilingwithstaticlibrariesUsingSharedLibrariesWhataresharedlibrariesCreatingasharedlibraryCompilingwithasharedlibraryRunningprogramsthatusesharedlibrariesDebuggingAssemblyFunctionsDebuggingCprogramsDebuggingassemblyfunctionsSummaryChapter:OptimizingRoutinesOptimizedCompilerCodeCompileroptimizationlevelCompileroptimizationlevelCompileroptimizationlevelCreatingOptimizedCodeGeneratingtheassemblylanguagecodeViewingoptimizedcodeRecompilingtheoptimizedcodeOptimizationTricksOptimizingcalculationsOptimizingvariablesOptimizingloopsOptimizingconditionalbranchesCommonsubexpressioneliminationSummaryChapter:UsingFilesTheFileHandlingSequenceOpeningandClosingFilesAccesstypesUNIXpermissionsOpenfilecodeOpenerrorreturncodesClosingfilesWritingtoFilesAsimplewriteexampleChangingfileaccessmodesHandlingfileerrorsftocqxd:AMPagexxixxiiContentsReadingFilesAsimplereadexampleAmorecomplicatedreadexampleReading,Processing,andWritingDataMemoryMappedFilesWhatarememorymappedfilesThemmapsystemcallmmapassemblylanguageformatAnmmapexampleSummaryChapter:UsingAdvancedIAFeaturesABriefReviewofSIMDMMXSSESSEDetectingSupportedSIMDOperationsDetectingsupportSIMDfeatureprogramUsingMMXInstructionsLoadingandretrievingpackedintegervaluesPerformingMMXoperationsUsingSSEInstructionsMovingdataProcessingdataUsingSSEInstructionsMovingdataProcessingdataSSEInstructionsSummaryIndexftocqxd:AMPagexxiiIntroductionAssemblylanguageisoneofthemostmisunderstoodprogramminglanguagesinuseWhenthetermassemblylanguageisused,itofteninvokestheideaoflowlevelbitshufflingandporingoverthousandpageinstructionmanualslookingfortheproperinstructionformatWiththeproliferationoffancyhighlevellanguagedevelopmenttools,itisnotuncommontoseethephrase“assemblylanguageprogrammingisdead”popupamongvariousprogrammingnewsgroupsHowever,assemblylanguageprogrammingisfarfromdeadEveryhighlevellanguageprogrammustbecompiledintoassemblylanguagebeforeitcanbelinkedintoanexecutableprogramForthehighlevellanguageprogrammer,understandinghowthecompilergeneratestheassemblylanguagecodecanbeagreatbenefit,bothfordirectlywritingroutinesinassemblylanguageandforunderstandinghowthehighlevellanguageroutinesareconvertedtoassemblylanguagebythecompilerWhoThisBookIsForTheprimarypurposeofthisbookistoteachhighlevellanguageprogrammershowtheirprogramsareconvertedtoassemblylanguage,andhowthegeneratedassemblylanguagecodecanbetweakedThatsaid,themainaudienceforthisbookisprogrammersalreadyfamiliarwithahighlevellanguage,suchasC,C,orevenJavaThisbookdoesnotspendmuchtimeteachingbasicprogrammingprinciplesItassumesthatyouarealreadyfamiliarwiththebasicsofcomputerprogramming,andareinterestedinlearningassemblylanguagetounderstandwhatishappeningunderneaththehoodHowever,ifyouarenewtoprogrammingandarelookingatassemblylanguageprogrammingasaplacetostart,thisbookdoesnottotallyignoreyouItispossibletofollowalonginthechaptersfromthestarttothefinishandobtainabasicknowledgeofhowassemblylanguageprogramming(andprogrammingingeneral)worksEachofthetopicspresentedincludesexamplecodethatdemonstrateshowtheassemblylanguageinstructionsworkIfyouarecompletelynewtoprogramming,Ire

职业精品

用户评论

0/200
    暂无评论

精彩专题

上传我的资料

热门资料

资料评价:

/49
禁止下载

意见
反馈

返回
顶部

Q