/
Decrement and Branch Instruction Decrement and Branch Instruction

Decrement and Branch Instruction - PowerPoint Presentation

marina-yarberry
marina-yarberry . @marina-yarberry
Follow
390 views
Uploaded On 2017-10-02

Decrement and Branch Instruction - PPT Presentation

It is used for implementing Loop control dbcc dn LABEL Example dbgt decrement and branch unless greater than The branch instruction used in these instructions is opposite to the way it is used in other branch instructions ID: 592278

instruction branch executed loop branch instruction loop executed decrement dbra condition label executedif satisfied bit number cont times dbcc add

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Decrement and Branch Instruction" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Decrement and Branch Instruction

It is used for implementing Loop control dbcc dn, LABELExample: dbgt (decrement and branch unless greater than)The branch instruction used in these instructions is opposite to the way it is used in other branch instructionsIf condition specified by cc is satisfied, then the next instruction is executedIf condition not satisfied, then  If , next instruction is executedIf , branch is made to LABEL

 Slide2

Decrement and Branch Instruction cont.

CCdn[0:15]  dn[0:15] - 1dn[0:15] = -1Take branchNext instruction

T

T

F

F

To branch Address LABEL

there

add.w

d1,d2

…..

…..

…..

dbeq

d3, there

here sub d1,d2

If Z bit is 1, CC is True

h

ere is executed

If Z bit is 0, CC is False

d

3 = d3 -1

If d3 = -1, here is executed

else there is executedSlide3

Decrement and Branch Instruction cont.

dbcc d3, LOOP next instructionIs equivalent to the sequence bcc NEXT subq #1, d3 bge LOOPNEXT next instruction

dbra

(decrement and branch always)

Loop is executed a predetermined number of times

moveq

#31,d2

Loop add ….

sub ….

dbra

d2, LoopWhen a loop is to be executed

n times, the number (n-1) is loaded into dn register, and

dbra dn, loop Is executed