The jump itself checks the flags in the EFL register. These are usually set with TEST or CMP(or as a side effect of many other instructions).
CMP ebx,10 JLE there
As a sidenote: You should get the Intel reference manuals. In particular the two part "Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 2: Instruction Set Reference" which describes all x86 instructions.
answered Dec 29, 2010 at 19:50 CodesInChaos CodesInChaos 108k 26 26 gold badges 221 221 silver badges 264 264 bronze badgesIn this example, does JLE jump when 10 is less than or equal to ebx, or does it jump when ebx is less than or equal to 10?
Commented Feb 20, 2013 at 18:04 @AndersonGreen It jumps when the ebx's contents are <= 10. Commented Mar 18, 2013 at 21:06 Commented Jan 25, 2021 at 16:37I don't think test is "Typically used for equality checks." The only typical cases I know are to test specific bits or masks, or to do test with the same register twice to check it for zero or check its sign bit. "Equality checks" sounds much more like a case for cmp .
Commented May 14, 2022 at 19:48JLE instruction conducts two tests:
If Zero flags is 1 and Signed Flag and Overflow Flag are not equal, then the short relative jump will be executed.
Maybe just a word how CMP instruction works. CMP instruction is like SUB (subtract), but the destination register will not be updated after exsecution. So the following code will perform the same result like CMP ebx, 10. CMP and SUB instruction affect to flags: Carry, Parity, Auxiliary, Zero, Sign and Overflow flags.
push ebx //store ebx value to stack sub ebx, 10 pop ebx //restore ebx value from stack