Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN
HANELLOGIC AND COMPARE INSTRUCTIONSCompare Instruction(cont’)
Notice in the
CJNE
instruction that any
Rn register can be compared with an immediate value¾There is no need for register A to be involved
CJNE R5,#80,NOT_EQUAL ;check R5 for 80...
;R5 = 80NOT_EQUAL:JNC NEXT ;jump if R5 > 80...;R5 < 80NEXT: ...CompareCarry Flagdestination≥sourceCY = 0destination < sourceCY = 1CY flag is always checked for cases of greater or less than, but only after it is determined that they are not equal