1 / 3

Decrement and Branch Instruction

Decrement and Branch Instruction. 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

gray-burks
Download Presentation

Decrement and Branch Instruction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Decrement and Branch Instruction It is used for implementing Loop control dbccdn, 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 • If condition specified by cc is satisfied, then the next instruction is executed • If condition not satisfied, then •  • If , next instruction is executed • If , branch is made to LABEL

  2. Decrement and Branch Instruction cont. To branch Address LABEL T CC • there add.w d1,d2 • ….. • ….. • ….. • dbeq d3, there • here sub d1,d2 • If Z bit is 1, CC is True • here is executed • If Z bit is 0, CC is False • d3 = d3 -1 • If d3 = -1, here is executed • else there is executed F dn[0:15]  dn[0:15] - 1 T dn[0:15] = -1 F Take branch Next instruction

  3. Decrement and Branch Instruction cont. dbra(decrement and branch always) • Loop is executed a predetermined number of times moveq #31,d2 Loop add …. sub …. dbra d2, Loop When a loop is to be executed n times, the number (n-1) is loaded into dn register, and dbradn, loop Is executed dbcc d3, LOOP next instruction Is equivalent to the sequence bcc NEXT subq #1, d3 bge LOOP NEXT next instruction

More Related