3 ms·
Also conditional branches because you can conceivably do the comparison, branch, and fall-through in several different ways. Consider the initial case cmp ax
by schoen 6y ago
Also conditional branches because you can conceivably do the comparison, branch, and fall-through in several different ways. Consider the initial case
cmp ax,bx
jge foo
bar:
; code that gets run if ax < bx
foo:
; code that gets run if ax >= bx
You could change this to cmp bx,ax and then change the jge to jl, or you could change either one alone and reverse the order of the bar and foo code blocks, or you could change both and not reverse the order of the bar and foo code blocks. (You have fewer choices if you are doing the comparison as the exit condition for a loop, except sometimes compilers will put the loop continue condition as an unconditional jump after bar or foo, in which case you have even more choices, like whether to do that or not!)