You can download processor books but my favorite reference is the 32/64-bit 80x86 Assembly Language Architecture Book.
Your mathematical operation and/or compares will set conditional flags.
You then branch based upon those flags.
For math there is a signed result and an unsigned result.
That book pg. 292
Signed Unsigned Signed Unsigned
op1 > op2 OF=SF, ZF=0 ZF=0,CF=0 Greater Above
OP1>=op2 OF=SF CF=0 GreaterEqual AboveEqual
op1=op2 ZF=1 ZF=1 Equal Equal
op1<=op2 OF<>SF, ZF=1 ZF=1,CF=1 LessEqual BelowEqual
op1<op2 OF<>SF CF=1 Less Below
Unsigned
JA,JNBE > <= JBE,JNA
JAE,JNB >= < JB,JNAE
Signed
JG,JNLE > <= JLE,JNG
JGE,JNL >= < JL,JNGE
the others are specific
JO Jump if Overflow JNO
JP,JPE Jump if Parity JNP,JPO
JS Jump if sign JNS
JC Jump if carry JNC
JZ,JE Jump if zero JNZ,JNE
Last edited by wildgoose; Oct 28th, 2009 at 10:20 pm.
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
Offline 891 posts
since Jun 2009