What is the assembler syntax to determine which of two numbers is greater?
What is the lower level (machine code) for it? Can we go even lower? Once we get to the bi
In TASM (x86 assembly) it can look like this:
cmp BL, BH
je EQUAL ; BL = BH
jg GREATER ; BL > BH
jmp LESS ; BL < BH
in this case it compares two 8bit numbers that we temporarily store in the higher and the lower part of the register B. Alternatively you might also consider using jbe (if BL <= BH) or jge/jae (if BL >= BH).
Hopefully someone finds it helpful :)