Condition codes are used in branch instructions Bcc and DBcc.
Replace the cc with any of the code you see in the list.
Example
If you like to branch/goto another place in the code if a signed number is greater or equal to 8 use:
CMP.B #8,D0
BGE ItsGreaterOrEqual
ItsGreaterOrEqual:
Signed/unsigned
Unsigned numbers can only be positive, while in signed numbers the highest bit is used to tell if the number is negative. As assembler programmer it's up to you to conciously choose the correct condition code for signed/unsigned numbers.
|
|
cc | mathematical | meaning | bitcode | signed | comment |
NE | b<>a | Not equal | 0110 | |
EQ | b==a | Equal | 0111 | |
HI | b>a | HIgher | 0010 | unsigned |
LO | b<a | LOwer | | unsigned |
HS | b>=a | Higher or Same | | unsigned |
LS | b<=a | Lower or same | 0011 | unsigned |
GT | b>a | Greater Then | 1110 | signed |
LT | b<a | Less Then | 1101 | signed |
GE | b>=a | Greater then or Equal | 1100 | signed |
LE | b<=a | Less then or Equal | 1111 | signed |
MI | b<0 | Minus | 1011 | |
PL | b>0 | Plus | 1010 | |
CC | | Carry clear | 0100 | |
CS | | Carry set | 0101 | |
VC | | No overflow | 1000 | |
VS | | Overflow | 1001 | |
(the next 2 are not known by all assemblers, because they aren't really usefull)
(Seka does know them) |
T | | True | 0000 | | allways branch, same as bra |
F | | False | 0001 | | never branch |
|