Programming control flow: which instruction below represents a conditional branch (i.e., it changes flow only if a condition is satisfied)?

Difficulty: Easy

Correct Answer: BGT LOOPS

Explanation:

Introduction / Context:Processors and languages provide instructions that alter control flow. A conditional branch transfers execution to a target only when a specified relation holds (e.g., greater-than). Unconditional jumps transfer control regardless of conditions.

Given Data / Assumptions:

  • The mnemonics are illustrative: BGT = branch if greater than, GOTO/JMP = unconditional jump, assignment is data operation, CALL invokes a subroutine.
  • We focus on conditional versus unconditional behavior.

Concept / Approach:Conditional branches depend on status flags or evaluated conditions (>, <=, ==). After arithmetic or comparison, a conditional branch checks flags and may redirect the instruction pointer; otherwise, execution falls through to the next instruction.

Step-by-Step Solution:1) Classify each option: conditional, unconditional, or non-branch.2) BGT LOOPS changes flow only if “greater than” is true.3) GOTO/JMP always jump; assignment does not branch; CALL changes flow but is not conditional.4) Therefore, the conditional branch is “BGT LOOPS.”

Verification / Alternative check:Assembly families (e.g., BGT, BEQ, BLT) share this pattern; high-level if/else compiles to such conditional branches.

Why Other Options Are Wrong:GOTO/JMP: unconditional. X = 5 + Y: arithmetic only. CALL: subroutine call, not conditional by itself.

Common Pitfalls:Confusing CALL with conditional branching; unless preceded by a condition, a call executes unconditionally.

Final Answer:BGT LOOPS is a conditional branch.

More Questions from Automation System

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion