1 / 48
文档名称:

Lecture4DataTransfer,Addressing,andArithmetic.ppt

格式:ppt   大小:222KB   页数:48页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Lecture4DataTransfer,Addressing,andArithmetic.ppt

上传人:1387230**** 2020/8/10 文件大小:222 KB

下载得到文件列表

Lecture4DataTransfer,Addressing,andArithmetic.ppt

相关文档

文档介绍

文档介绍:Lecture4:DataTransfer,Addressing,andArithmeticAssemblyLanguageforIntel-puters,-relatedOperatorsandDirectivesIndirectAddressingJMPandLOOPInstructionsDataTransferInstructionsOperandTypesImmediateoperands(imm):ThedataisaconstantRegisteroperands(reg):Thedataitemisinaregister ---(mem):Thedataitemisinmemory----99fordetailsDataTransferInstructionsMOVInstructionCopiesdataGeneralformatMOVdestination,sourceFormats-legaloperands MOVreg,reg MOVreg,mem MOVmem,reg MOVreg,immed MOVmem,immedimmedmeansaconstantSourceanddestinationmusthavethesamesize"reg"canbeanyregisterexceptDoesnotchangeflagNote:MemorytomemorymovesarenotallowedDataTransferInstructionsMOVInstructionRulesIPSegmentregistersusespecialrules -tobeusedonlywhentheprogramrunsinrealmode -CScannotbeatargetoperand - bValdb20 wValdw0AAAAh dValDWORD0FEDCBA09h .code … movAL,10 movEAX,10 movBX,wVal movdVal,ECX;.386required movCX,bVal movDH,1234;illegal;illegalImmediateoperandsdonothavealengthattributeDataTransferInstructionsZero/SignExtensionofIntegersMOVZXInstructionMOVSXInstructionCopiesthecontentsofasourceoperandintoadestinationoperandandzero-extendsthevaluetoeither16or32bitsOnlyusedwithunsignedintegersCopiesthecontentsofasourceoperandintoadestinationoperandandsign-extendsthevaluetoeither16or32bitsOnlyusedwithsignedintegersDataTransferInstructionsZero/ bValdb20 wValSWORD8AAAh dValDWORD0FEDCBA09h .code … movAL,bVal movBX,wVal movzxECX,AL movSXEDX,wVal movSX,EAX,1234ECX=?EDX=?Anythingwrong?DataTransferInstructionsXCHGInstructionXCHGexchangesthecontentsofsourceanddestingationFormat xchgreg,reg xchgreg,mem xchgmem,regExamples:xchgAX,BX xchgAH,bData xchgwData,CXmov'srulesapply,doesnotchangeflagsDataTransferInstructionsLAHFandSAHFInstructionsLAHFSAHFCopiesthelowbyteoftheEFLAGSregisterintoAHExample