- 1、本文档共45页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
- 03 程序设计.ppt
- 03-布尔表达式和选择结构.ppt
- 02数据描述与基本操作.ppt
- 04 选择结构程序设计.ppt
- 09第9章 语义分析和代码生成.ppt
- 1-瑞萨启动代码简介.doc
- 08-09-1学期C程序设计(第三版)教材PPT-第5章-讲稿.ppt
- 06过程步使用实例.ppt
- 101223第六章.ppt
- 1.7 静电现象的应用.ppt
- 浙江衢州市卫生健康委员会衢州市直公立医院高层次紧缺人才招聘11人笔试模拟试题参考答案详解.docx
- 浙江温州泰顺县退役军人事务局招聘编外工作人员笔试备考题库及参考答案详解一套.docx
- 江苏靖江市数据局公开招聘编外工作人员笔试模拟试题及参考答案详解.docx
- 广东茂名市公安局电白分局招聘警务辅助人员40人笔试模拟试题带答案详解.docx
- 江苏盐城市大丰区住房和城乡建设局招聘劳务派遣工作人员4人笔试模拟试题带答案详解.docx
- 浙江舟山岱山县东沙镇人民政府招聘笔试模拟试题及参考答案详解1套.docx
- 最高人民检察院直属事业单位2025年度公开招聘工作人员笔试模拟试题含答案详解.docx
- 浙江金华市委宣传部、中共金华市委网信办所属事业单位选调工作人员笔试备考题库及答案详解1套.docx
- 广东深圳市党建组织员招聘40人笔试模拟试题及答案详解1套.docx
- 江苏南京水利科学研究院招聘非在编工作人员4人笔试模拟试题及参考答案详解.docx
文档评论(0)