UMBC | Unsigned Conditional Jumps | Previous | Next |
You may not have used unsigned values much, always choosing the largest container and successfully went with signed values. This wastes memory (not as important as it used to be) but sometimes you do not get to define the size of the containers being used. For instance, you might have to use a data structure to interface to another application or a system call. Then you have to work with what is provided.
The compiler is not here to help you now. As the programmer,you must pay attention to the values that you will be working with! When working with a byte, which is greater, 127 or 128? As an unsigned value, it is 128, however, as an signed value, it is -128. Whenever the most significant bit is on, the different between signed and unsigned is important!
Instruction | Symbolic | Description |
---|---|---|
JA shortlabel | op1 > op2 | jump if above |
JNA shortlabel | !(op1 > op2) | jump if not above |
JAE shortlabel | op1 >= op2 | jump if above or equal |
JNAE shortlabel | !(op1 >= op2) | jump if not above or equal |
JB shortlabel | op1 < op2 | jump if below |
JNB shortlabel | !(op1 < op2) | jump if not belw than |
JBE shortlabel | op1 <= op2 | jump if below or equal |
JNBE shortlabel | !(op1 <= op2) | jump if not below or equal |