A branch (or jump on some computer architectures, such as the PDP-8 and Intel x86) is a point in a computer program where the flow of control is altered. The term branch is usually used when referring to a program written in machine code or assembly language; in a high-level programming language, branches usually take the form of conditional statements, subroutine calls or GOTO statements. An instruction that causes a branch, a branch instruction, can be taken or not taken: if a branch is not taken, the flow of control is unchanged and the next instruction to be executed is the instruction immediately following the current instruction in memory; if taken, the next instruction to be executed is an instruction at some other place in memory. There are two usual forms of branch instruction: a conditional branch that can be either taken or not taken, depending on a condition such as a CPU flag, and an unconditional branch which is always taken.
As instruções utilizadas pela maioria das arquiteturas de computadores:
- Aritmético e Lógico: aritmética de inteiros e operações lógicas: ADD, SUB, AND, OR;
- Transferência de dados: transferência de dados entre memória e registradores: Load, Store;
- Controle: branchs, jumps, chamada e retorno de procedimento, traps;
- Sistema: chamadas do sistema operacional, instruções de gerenciamento da memória virtual;