If you want to create if else statements in assembly language and was wondering about how to create conditional programming logic in assembly language then this lecture is for you.
In this lecture we had explained conditional jumps in 8051 assembly language and also explained how PSW or Status register effect carry flag after CJNE or comparison instruction.
As you may already know that the CJNE instruction is used to create if else statements in 8051 architecture and this instruction compare the not equal to form of expressions. But if you want to make the logic to compare the value greater then or less then kind of logic then you need to check the carry flag of the PSW register.
so by combining CJNE and PSW carry flag bit you can make any kind of If, IF-else, or nested if else statements or any kind of comparison conditional jumps.
more explanation can be found here
http://www.fypsolutions.com/assembly-...