I want to share one aspect that using CMP mnemonic source mem8 with imm8 data
followed by logical jump(jg or jl) doesnt give the expected result if most significant bit of data is one(act as signed integer).
example mov memdata1, 15h
cmp memdata1,0B0h
jl result1
.....
.....
result1:
jmp to result1 will NOT occur.
When using CMP source reg8 with imm8 data the logical jump is efective. I believe that both
combination are valid
that's because the JL branch is used for signed comparisons - and the high bit is the sign bit
JB would be the unsigned counterpart
look around for a good description of "two's compliment", then use these tables
****************************************************************
Equality Branches (Used for Signed or Unsigned Comparisons)
----------------------------------------------------------------
Instruction Description Condition Aliases
----------------------------------------------------------------
JZ Jump if equal ZF=1 JE
JNZ Jump if not equal ZF=0 JNE
****************************************************************
****************************************************************
Unsigned Branches
----------------------------------------------------------------
Instruction Description Condition Aliases
----------------------------------------------------------------
JA Jump if above CF=0 and ZF=0 JNBE
JAE Jump if above or equal CF=0 JNC JNB
JB Jump if below CF=1 JC JNAE
JBE Jump if below or equal CF=1 or ZF=1 JNA
****************************************************************
****************************************************************
Signed Branches
----------------------------------------------------------------
Instruction Description Condition Aliases
----------------------------------------------------------------
JG Jump if greater SF=OF or ZF=0 JNLE
JGE Jump if greater or equal SF=OF JNL
JL Jump if less SF<>OF JNGE
JLE Jump if less or equal SF<>OF or ZF=1 JNG
JO Jump if overflow OF=1
JNO Jump if no overflow OF=0
JS Jump if sign SF=1
JNS Jump if no sign SF=1
****************************************************************
Thank you. I agree and use this correctly.
With regards