cmp je/jg how they work in assembly
问题 I would like to understand how cmp and je/jg work in assembly. I saw few examples on google but I am still little bit confused. Below I have shown a part of assembly code that I am trying to convert to C language and the corresponding C code. Is it implemented in the right way or do I have a wrong understanding of how cmp works? cmp $0x3,%eax je A cmp $0x3,%eax jg B cmp $0x1,%eax je C int func(int x){ if(x == 3) goto A; if (x >3) goto B; if(x == 1) goto C; A: ...... B: ...... C: ...... 回答1: