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

复旦大学软件学院计算机系统课件 Machine-Level Representation of Programs II.ppt

复旦大学软件学院计算机系统课件 Machine-Level Representation of Programs II.ppt

  1. 1、本文档共40页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * * * * * * * * * * * * * * * Condition codes EFLAGS ZF: Zero Flag The most recent operation yielded zero SF: Sign Flag The most recent operation yielded a negative value * Setting Conditional Codes Implicit Setting By Arithmetic Operations addl Src,Dest C analog: t = a+b CF set if carry out from most significant bit Used to detect unsigned overflow ZF set if t == 0 SF set if t 0 OF set if two’s complement overflow (a0 b0 t0) || (a0 b0 t=0) * Conditional Code lea instruction has no effect on condition codes Xorl instruction The carry and overflow flags are set to 0 Shift instruction carry flag is set to the last bit shifted out Overflow flag is set to 0 * Setting Conditional Codes Explicit Setting by Compare Instruction cmpl Src2,Src1 cmpl b,a like computing a-b without setting destination CF set if carry out from most significant bit Used for unsigned comparisons ZF set if a == b SF set if (a-b) 0 OF set if two’s complement overflow (a0 b0 (a-b)0) || (a0 b0 (a-b)0) * Setting Conditional Codes Explicit Setting by Test instruction testl Src2,Src1 Sets condition codes based on value of Src1 Src2 Useful to have one of the operands be a mask testl b,a like computing ab without setting destination ZF set when ab == 0 SF set when ab 0 * Accessing Conditional Codes The condition codes cannot be read directly One of the most common methods of accessing them is setting an integer register based on some combination of condition codes Set commands * Accessing Conditional Codes After each set command is executed A single byte to 0 or to 1 is obtained The descriptions of the different set commands apply to the case where a comparison instruction has been executed * Accessing Conditional Codes Instruction Synonym Effect Set Condition Sete Setz ZF Equal/zero Setne Setnz ~ZF Not equal/not zero Sets SF Negative Setns ~SF Nonnegative Setl Setnge SF^OF Less Setle Setng (SF^OF)|ZF Less or Equal Setg Setnle ~(SF^OF)~ZF Greater Setge Setnl ~(SF^OF) Greater or Eq

文档评论(0)

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

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

1亿VIP精品文档

相关文档