Program Description
In the above program any two numbers can be stored in register A and B ( by replacing XX and YY).
Contents of B are compared with A. If B CY = 0 (reset) and if Z < B CY= 1 (set)
JNC SKIP instruction will check CY flag if CY is not it will jump to location 2009H otherwise execution will come to next location 2008H.
I e MOV A, B instruction will be executed only when CY is set which is the case when B is greater than A this instruction will copy the contents of B into A when B is greater.
OUT 01 instruction always send the contents of A to the specified output port. In the above program A will always hold the greater number before coming to this statement. Hence greater number will be displayed at port address 01H.