我拿什么比?JNE 之前的汇编代码中没有 CMP 指令 [英] What am I comparing to? No CMP instruction in assembly code before JNE

查看:33
本文介绍了我拿什么比?JNE 之前的汇编代码中没有 CMP 指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 JNE 语句之前没有 CMP 指令是什么意思?

What does it mean when there's no CMP instruction before before a JNE statement?

 0x0000000000401114 <+64>:  add    %eax,%ecx
   0x0000000000401116 <+66>:    cltq   
   0x0000000000401118 <+68>:    mov    0x4026e0(,%rax,4),%eax
   0x000000000040111f <+75>:    sub    $0x1,%edx
   0x0000000000401122 <+78>:    jne    0x401114 <phase_5+64>

我在和什么比较?

推荐答案

cmp edx, 1 更改标志与 sub edx, 1 完全一样,只是它没有更新 edx.这意味着无需在循环中执行cmpsub,而只需执行sub

cmp edx, 1 changes the flags exactly like sub edx, 1, only it doesn't update edx. This means that instead of doing a cmp and sub in a loop, you only need to do sub

这篇关于我拿什么比?JNE 之前的汇编代码中没有 CMP 指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆