When you do something like

cmp eax,ebx
ja start;jump if above
start:

Jump if above jumps if eax is greater or if ebx is greater?

Recommended Answers

All 3 Replies

; hi.
; it will jump if eax is greater.
; "jg" is the opposite

can you give example of while loop in assymbly code?

actually jb is the opposite of ja. ja and jg are basically the same, they will both jump if it second operand is > the first opcode... in your example it will jmp to start if eax is above or greater than ebx... ja and jg check differant flags, but do the same thing.

@josephbeluan

How would you write a "while Loop"? you need a counter, and an exit value... you can test the counter at the beginning of the loop or at the end of the loop.... inside the loop, increment your counter and then test where you want to... and jump if the counter is greater than the exit value...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.