The control structure that is best suited for this scenario is BGT
.
BGT
(Branch on greater than) will branch when the second operand is greater than the first operand. This makes sense when you look at what is going on behind the scenes.
CMP.W D1,D0 ;Performs D0-D1, sets the CCR, discards the result
It sets the CCR (Condition Code Register) because the branch is taken only when (N=1 and V=1 and Z=0) or (N=0 and V=0 and Z=0).
Now to transform:
if (D0 > D1) {
//do_some_stuff
} else {
//do_some_other_stuff
}
Into 68k assembly language:
CMP.W D1,D0 ;compare the contents of D0 and D1
BGT IF
// do_some_other_stuff
BRA EXIT
IF
// do_some_stuff
EXIT ...