Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between jmp and ja?

Tags:

x86

assembly

From my understanding jmp does an unconditional jump, whereas ja jumps if the value is unsigned. Am I getting this right?

An example would be greatly appreciated.

like image 652
Michael Smith Avatar asked Dec 09 '22 11:12

Michael Smith


1 Answers

You're correct that jmp does an unconditional jump.

Your description of ja is incorrect, though. It does a conditional jump, based on the result of the most recent cmp operation. It jumps if the first operand was greater than the second operand, using unsigned comparison rather than signed comparison. jg would use signed comparison.

like image 67
Barmar Avatar answered Jan 17 '23 22:01

Barmar