question archive Describe the branch instructions associated with CCR bits

Describe the branch instructions associated with CCR bits

Subject:Computer SciencePrice:3.86 Bought12

Describe the branch instructions associated with CCR bits. 

 

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

In CCR, branch instructions cause program flow to change when specific condition is met.

Branches are helpful for:

  • Infinite execution of a program
  • Conditional operations
  • Loops
  • and to add time delays

 

A program branch can be taken when a specific bit in the CCR register is in a specific state (0 or 1). We use:

  • Unsigned branches : When a comparison of unsigned quantities result in a specific combination of CCR bits
  • Signed branches : When comparison of signed quantities result in a specific combination of CCR bits

 

Some branch based commands:

  • BCC : Branch if carry clear (C flag=0)
  • BCS: Branch if carry set (C flag=1)
  • BMI: Branch if minus (N flag =1)
  • BVS: Branch if overflow set (V flag=1)

 

Example: Assume X contains $50 and Y contains $100

Loop:

Ldaa 1,x+

Ldab 1,y+

Aba

Bcs Loop1 ; Branch if the carry bit is 1

--

--

Bra Loop

Loop1:

Staa $100