DBcc Instruction



DBcc is an instruction that quits loops. The instruction is very similar to Bcc (same conditions are used, see above for the different conditions) except that the first operand is a data register that will be decreased with one until is reached -1, then the loop stops. The loop can also quit if the flags are set correctly (specified with the condition). You often use DBRA, which will quit the loop when the data register has reached -1. If you want the loop the be looped 10 times, you should set a data register to 9 (since it ends at -1, not 0).

ADDRESS METHODS: No real address method.

DATA LENGTH: Word

FLAGS: Unaffected

SYNTAX: DBcc Dn,<label>

EXAMPLE CODE:

   DBRA    D0,branch    subtracts 1 from D0, will skip line if D0 = -1