Conditional Branching

From CPUDev Wiki
Jump to: navigation, search

There are various ways to design conditional branching. Here are some ways described.

Feel free to add more conditional branching designs.

Use of Flags

Here the branching instruction checks if a flag from the Flags Register is set or not. Then the branch is taken or not taken accordingly.

Example architectures using this way include x86.

Explicit Comparison Between Two Operands

Here the branching instruction contains two operand fields whose values are compared. Then the branch is taken or not taken accordingly.

Example architectures using this way include MIPS and RISC-V.

Explicit Comparison Between Operand and Zero

Here the branching instruction contains an operand field whose value is compared to zero. Then the branch is taken or not taken accordingly.

Example architectures using this way include Glauxosdever's Attempt-1.