资源描述:
《AND指令可用于复位某些位(同0相与)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Chapter8BitManipulationContents:LogicalOperationsShiftandRotateInstructions8.1LogicalOperationsANDdestination,sourceTESTdestination,sourceThesameasANDinstructionbutnotchangedestinationNOTdestinationORdestination,sourceinclusiveXORdestination,sourceexclusiveTruetabl
2、eABT000010100111ANDsrcregmemimmreg√√√mem√√destABT000011101110ABT000011101111AT0110flagsLogicaloperationexceptforNOTwillaffectflagregister.CF=0OF=0AF:undefinedPF,SF,ZF:setbythevalueofresult.Clearselectedbits(marking)ClearallbutthelastfourbitsinEAXANDeax,0000000fhSet
3、selectedbitsSetallbutthelastfourbitsinEAXOReax,fffffff0hnegateselectedbitsnegateallbutthelastfourbitsinEAXXOReax,fffffff0hXoreax,eax;AND指令可用于复位某些位(同0相与),不影响其他位:将BL中D3和D0位清0,其他位不变andbl,11110110B;OR指令可用于置位某些位(同1相或),不影响其他位:将BL中D3和D0位置1,其他位不变orbl,00001001B;XOR指令可用于求反某些
4、位(同1相异或),不影响其他位:将BL中D3和D0位求反,其他不变xorbl,00001001BPerformcertainarithmeticoperationmovedx,0movebx,32divebxmovedx,eaxandedx,0000001fhManipulateASCIIcodesConvertASCIIcodetointegerSubeax,00000030hAndeax,0000000fhConvertintegertoASCIIOrbl,30hChangethecaseofASCIIcodeXorcl
5、,00100000bApplicationofTESTExamineaparticularbitis“1”or“0”Testdx,2000hGetinformationaboutavalueTestcx,cxThefollowinginstructionusuallyis“jcc”testal,01h;测试AL的最低位D0jnzthere;标志ZF=0,即D0=1;则程序转移到there...;否则ZF=1,即D0=0,顺序执行there:...TEST指令通常用于检测一些条件是否满足,但又不希望改变原操作数的情况TESTS
6、hiftandRotateShiftandrotateinstructionsmanipulatebinarynumbersatthebinarybitlevel,asdidtheAND,OR,Exclusive-OR,andNOTinstructions.Shiftsandrotatesfindtheirmostcommonapplicationsinlow-levelsoftwareusedtocontrolI/Odevices.Themicroprocessorcontainsacompletesetofshiftan
7、drotateinstructionsthatareusedtoshiftorrotateanymemorydataorregister.ShiftinstructionsShiftinstructionspositionormovenumberstotheleftorrightwithinaregisterormemorylocation.LogicalshiftArithmeticshiftLogicalshiftsmultiplyordivideunsigneddata,andarithmeticshiftsmulti
8、plyordividesigneddata.Ashiftleftmultipliesby2foreachbitpositionshiftedashiftrightdividesby2foreachbitpositionshiftedShiftinstructionsSHLdest,coun