1
Jump and Branch Instructions The programme control instructions allow the flow of the programme to change. A change in flow often occurs when decisions are made. Programme control flow is affected by two types of instructions, Unconditional and Conditional. The Unconditional instructions in the 6800 microprocessor are Jump, Jump to Subroutine, Branch Always and Branch to Subroutine. The Conditional instructions in the 6800 microprocessor are all the Branch instructions except the Branch Always instruction. The conditional instructions decision is based on the condition of the flag bit(s) in the Condition Code Register (CCR). If a branch test is 'true' then the branch will occur, otherwise the next instruction is implemented. The Branch instructions have an Offset associated which is a Signed number which is added/subtracted to the Program Counter (PC) to provide a branch range from 128 to +127 steps, from the address of the NEXT instruction to be implemented. Using the Relative address mode the branch instruction allows the programme code to be re locatable. The Jump instruction is not relocatable but can be used to access any address within the 64k ($0000 to $FFFF) memory range. It operates in the Indexed or Extended address modes.

8. Jump and Branch Instructions

Embed Size (px)

DESCRIPTION

Jump and Branch Instruction

Citation preview

Page 1: 8. Jump and Branch Instructions

7/7/2015 Jump and Branch Instructions

http://www.electronics.dit.ie/staff/tscarff/6800/jump_branch/jump_branch.htm 1/1

Jump and Branch InstructionsThe programme control instructions allow the flow of the programme to change. A change inflow often occurs when decisions are made. Programme control flow is affected by two types ofinstructions, Unconditional and Conditional.

The Unconditional instructions in the 6800 microprocessor are Jump, Jump to Subroutine,Branch Always and Branch to Subroutine.

The Conditional instructions in the 6800 microprocessor are all the Branch instructions exceptthe Branch Always instruction. The conditional instructions decision is based on the condition ofthe flag bit(s) in the Condition Code Register (CCR). If a branch test is 'true' then the branch willoccur, otherwise the next instruction is implemented.

The Branch instructions have an Offset associated which is a Signed number which isadded/subtracted to the Program Counter (PC) to provide a branch range from ­128 to +127steps, from the address of the NEXT instruction to be implemented. 

Using the Relative address mode the branch instruction allows the programme code to be re­locatable. 

The Jump instruction is not re­locatable but can be used to access any address within the 64k($0000 to $FFFF) memory range. It operates in the Indexed or Extended address modes.