NASM在组装时将JNZ更改为JNE?为什么? [英] NASM changes JNZ to JNE while assembling? Why?

查看:117
本文介绍了NASM在组装时将JNZ更改为JNE?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一段使用JNZ的代码。当我汇编并链接二进制文件时,我看到我的JNZ被JNE取代。我知道他们从根本上是相同的。但是,为什么NA​​SM会改变它?

I have a piece of code which uses JNZ. When I assemble and link the binary, I see my JNZ is replaces with a JNE. I understand that both of them fundamentally are the same. But then why does NASM change it?

此外,是否有任何配置选项可用来阻止在组装时发生此更改?

Also, is there any config option available to stop this change from happening while assembling?

推荐答案


我了解它们在根本上是相同的

I understand that both of them fundamentally are the same

JNE JNZ 具有相同的操作码(对于短跳转, 0x75 ,对于近跳转, 0x0f 0x85 ),因此,汇编程序

JNE and JNZ have the same opcodes (0x75 for short jumps and 0x0f 0x85 for near jumps), so the assembler will create the same machine code for both of them.

反汇编时,反汇编器将不再知道源代码中使用了哪个机器代码,并且

When disassembling, the disassembler does not known anymore which one was used in the source and it has to take one of them.


此外,是否有任何配置选项可阻止这种更改在组装时发生?

Also, is there any config option available to stop this change from happening while assembling?

否,因为它不是真正的替换- JNE JNZ 只是相同的不同助记符操作码。

No, because it is not a real "replacement" - JNE and JNZ are simply different mnemonics for the same opcodes.

这篇关于NASM在组装时将JNZ更改为JNE?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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