I have this code:
CMP.B #3,R6L
BLO konec
which compare if content of R6L is bigger than 3, but I need opposite of it (find out if R6L is smaller than 3). I tried change #3 and R6L to CMP.B R6L,#3 but it doesn't work. I know that it's beginners question, but I really can't solve it.
The compare instruction produces enough information to determine all the ordering information—less than, equal to, or greater than. The branch instruction chooses which conditions to branch on. Change BLO
to BHI
.
Note: You did not specify the architecture or assembly language, so I am partially guessing about BHI
. You should check the documentation. Various architectures and assembly languages have variants for slightly different kinds of branches. For example, BHI
may be for branching if the comparison shows one unsigned value is higher than another unsigned value, while BGT
may be for branch if the comparison shows one signed value is greater than than another signed value.