Re: LF: programming command


[Prev][Next][Index][Thread]

Re: LF: programming command



Josh wrote:
> > Can someone tell me what the dbra command means?

> I'm sure you'll get a number of answers to this, but DBRA stands for
> decrement and branch always.  Let's take an example: DBRA D0,LOOP. That
> would decrement register D0 and jump to the label LOOP until D0 reached
> -1.  DBcc is similar to Bcc (the "cc"s represent a number of different
> branch instructions), in that you can also check the same conditions
> that you can with bcc. I.E. if there is an instruction BNE (branch if
> not equal), there is also an instruction DCNE (decrement and branch if
> not equal). Hope that helps (I think you were asking this because it
> appeared in the program I just submitted to the list).

Well, sort of.  I've been meaning to ask, and that reminded me.  So,
anyway,  this program:

<some commands here>
move #10,D0
DBRA D0,LOOP
<even more commands here>

LOOP
   <some more commands>

would execute the 'some commands', put 10 into D0, jump to LOOP, and
execute 'some more commands', decrement d0 by 1, and repeat, for a total
of 11 times, and then execute 'even more commands'?

If I am missing anything in the lines of syntax (I'm new to this),
especially in the loop part, please tell me.
-- 
Jake Robb


Follow-Ups: References: