网站大量收购独家精品文档,联系QQ:2885784924

华南理工大学汇编原理课件04.ppt

  1. 1、本文档共114页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
INC – increment (增量指令) Examples INC reg/mem ;reg/mem←reg/mem+1 inc bx inc [DI] ; (X) assembler don’t know byte, ; word or d-word. inc byte ptr [bx] Table 13-4 INC instruction DEC – decrement (增量指令) Format: Operation: (DST) ← (DST) - 1 DEC instruction clear or set the OF, SF, and ZF flags, but not effect CF flag bit. DEC不影响进位CF标志,按定义设置其他状态标志 DEC DST DEC – decrement (减量指令) Examples DEC reg/mem ;reg/mem←reg/mem-1 DEC cx DEC word ptr [bx] INC DEC Useful for incrementing and decrementing counters. Take fewer bytes of code and execute in fewer clock cycles than corresponding addition or subtraction instructions. INC指令和DEC指令都是单操作数指令 主要用于对计数器和地址指针的调整 NEG – negate (取补指令) Format: Function: reverses the sign of a binary value, from positive to negative and vice versa. NEG reg/mem ;reg/mem←0 - reg/mem NEG – negate (取补指令) Format: Operation: NEG reverses the bits, and then adds 1 for proper 2’s complement notation. (DST) ← 0 - (DST) NEG instruction affect AF, CF, OF, PF, SF and ZF NEG reg/mem ;reg/mem←0 - reg/mem NEG mov ax,0ff64h neg al sub al,9dh neg ax dec al neg ax Questions Show the result in the destination operand. NEG mov ax,0ff64h neg al ;ax=ff9ch,OF=0、SF=1、ZF=0、PF=1、CF=1 sub al,9dh ;ax=ffffh,OF=0、SF=1、ZF=0、PF=1、CF=1 neg ax ;ax=0001h,OF=0、SF=0、ZF=0、PF=0、CF=1 dec al ;ax=0000h,OF=0、SF=0、ZF=1、PF=1、CF=1 neg ax ;ax=0000h,OF=0、SF=0、ZF=1、PF=1、CF=0 Answers CMP – compare (比较指令) Format: Function: Compares the binary contents of two data fields. CMP DST, SRC ; (DST) - (SRC) CMP – compare (比较指令) Format: Operation: CMP internally subtracts operand 2 from operand 1 and sets/clears flags, but not store the result. Both operands are byte, word, or doubleword. (DST) - (SRC) CMP DST, SRC ; (DST) - (SRC) CMP – compare (比较指令) affect AF, CF, OF, PF, SF and ZF CF SF ZF Operand 1 Operand 2 1 1 0 Operand 1 = Operand 2 0 0 1 Operand 1 Operand 2 0 0 0 CMP DST, SRC ; (DST) - (SRC) CMP – compare (比较指令) CMP may compare register, memory, or imme

文档评论(0)

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

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

1亿VIP精品文档

相关文档