computer-architecture

Definition

Branch Instruction

A branch instruction is an instruction that implements a branch.

It changes control flow by selecting between the next sequential instruction address and a branch target address, usually depending on some condition.

Typical branch instructions compare register values or test status conditions and then decide whether the branch is taken.

Example

beq

The instruction

beq s1, s2, L1

branches to label L1 if the values in s1 and s2 are equal. Otherwise execution continues with the next sequential instruction.