Alex Rivera | Logout

Assembly JLE jmp instruction example

Asked 2010-12-29T19:46:24.310
19

How do you use the jump family of instructions?

This is what they've got:

JL label
"It" jumps if it is less than or if it is not larger than or equal to.

My question is what is it in this sentence? Say I have a variable in ebx and I want to jump to label there: if ebx is <= 10.

Specifically I'm interested in using the x86 jump family of instructions

Edit
Report

1 Answer

4

The x86 assembly uses a system of bit-flags that represent the result of comparisons. The conditional jump instructions use these flags when deciding whether to perform the jump or not.

In your case you'd use the following two instructions:

cmp ebx, 10     ; compare EBX and 10
jle label       ; jump if EBX is "less than or equal" to 10
…
label:
…
answered 2010-12-29T19:52:31.433

Your Answer