JA rel8 -- Jump short if above (CF=0 and ZF=0). JAE rel8 -- Jump short if above or equal(CF=0). JB rel8 -- Jump short if below (CF=1). JBE rel8 -- Jump short if below or equal(CF=1 or ZF=1).As you can see, there's no check for sign flag in the instructions above. Therefore, they are all unsigned comparison. Now, let's have a look to the other family, the "greater" and "less". Again, let's see a copy of the instructions explanation from Intel x86/x64 manual:
JG rel8 -- Jump short if greater (ZF=0 and SF=OF). JGE rel8 -- Jump short if greater or equal (SF=OF). JL rel8 -- Jump short if less (SF‚ OF). JLE rel8 A -- Jump short if less or equal (ZF=1 or SF‚ OF).As you can see, all of the "greater" and "less" comparison checks against the sign flag (SF). Therefore, they're all signed integer comparison. The difference between the two "families" of instruction could be easily overlooked by those new to x86/x64 assembly language. I hope this post clarify that.
Post a Comment
1 comment:
Thanks! It's really helpful
Post a Comment