简体   繁体   English

如何解释 x86-64 xor 后跟 jle?

[英]how to interpret x86-64 xor followed by jle?

If part of the assembly code is as following:如果部分汇编代码如下:

xor %ebp,%ebx
jle some address

does this jle means that it will jump when (%ebx ^ %ebp == 0) because that would set ZF to 1?这个 jle 是否意味着它会在 (%ebx ^ %ebp == 0) 时跳转,因为这会将 ZF 设置为 1?

That's one of the ways JLE can be true.这是 JLE 成为现实的方式之一。 The other is SF≠ OF , as per the manual: https://www.felixcloutier.com/x86/jcc另一个是SF≠ OF ,根据手册: https : //www.felixcloutier.com/x86/jcc

Since XOR always clears OF, SF != OF reduces to just SF.由于 XOR 总是清除 OF, SF != OF简化为 SF。

jle after a boolean op will be taken if SF | ZF如果SF | ZF将采用布尔运算后的jle SF | ZF , ie if the result is <= 0 . SF | ZF ,即如果结果<= 0

Interesting optimization to avoid test %ebx,%ebx to compare the result against zero ( AND or TEST same,same sets FLAGS identically to cmp reg,0 ).有趣的优化,以避免test %ebx,%ebx将结果与零进行比较( AND 或 TEST same,same 将 FLAGS 设置为与cmp reg,0相同)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM