Case 2 ( A>B)
Suppose XX = 05H ( stored in A ) And YY = 02H ( stored in B). Then carry flag will reset by CMP instruction, since A> B in this case JNC will transfer the execution to location 2009H. Since carry flag is reset. Now program execution will come to 2009H and MOV A,B instruction is skipped OUT 01H will display the contents of A ( i e 05H). In this way again the greater number is displayed.