80x86课程英文版的课件Chapter 8 Bit Manipulation.ppt

80x86课程英文版的课件Chapter 8 Bit Manipulation.ppt

  1. 1、本文档共45页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Chapter 8 Bit Manipulation Contents: Logical Operations Shift and Rotate Instructions 8.1 Logical Operations AND destination , source TEST destination , source The same as AND instruction but not change destination NOT destination OR destination , source inclusive XOR destination , source exclusive True table flags Logical operation except for NOT will affect flag register. CF=0 OF=0 AF: undefined PF, SF, ZF: set by the value of result. Clear selected bits (marking) Clear all but the last four bits in EAX AND eax , 0000000fh Set selected bits Set all but the last four bits in EAX OR eax , fffffff0h negate selected bits negate all but the last four bits in EAX XOR eax , fffffff0h Xor eax, eax ;AND指令可用于复位某些位(同0相与),不影响其他位:将BL中D3和D0位清0,其他位不变 and bl ;OR指令可用于置位某些位(同1相或),不影响其他位:将BL中D3和D0位置1,其他位不变 or bl, ;XOR指令可用于求反某些位(同1相异或),不影响其他位:将BL中D3和D0位求反,其他不变 xor bl, Perform certain arithmetic operation Manipulate ASCII codes Convert ASCII code to integer Sub eax , And eax, 0000000fh Convert integer to ASCII Or bl, 30h Change the case of ASCII code Xor cl , Application of TEST Examine a particular bit is “1” or “0” Test dx, 2000h Get information about a value Test cx , cx The following instruction usually is “jcc” test al,01h ;测试AL的最低位D0 jnz there ;标志ZF=0,即D0=1 ;则程序转移到there ... ;否则ZF=1,即D0=0,顺序执行 there: ... Shift and Rotate Shift and rotate instructions manipulate binary numbers at the binary bit level, as did the AND, OR, Exclusive-OR, and NOT instructions. Shifts and rotates find their most common applications in low-level software used to control I/O devices. The microprocessor contains a complete set of shift and rotate instructions that are used to shift or rotate any memory data or register. Shift instructions Shift instructions position or move numbers to the left or right within a register or memory location. Logical shift Arithmetic shift Logical shifts multiply or divide unsigned data, and arithmetic shifts

文档评论(0)

bm5044 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档