Case 1 (B>A)
Suppose XX = 01H ( stored in a) and YY = 03H (stored in B).then carry flag will set by CMP instruction since B>A in this case JNC will not transfer the execution to location 2009H. As it will jump only when carry instruction will be executed. Contents of B i e 03 are copied into A. OUT 01 H will display the contents of A ( now 03H) . in this way the greater number is displayed.