A Level Computer Science OCR Practice Exam 2025 – Complete Study Resource

Image Description

Question: 1 / 400

When does the "BRZ" instruction in LMC branch to a given address?

When the accumulator is positive

When the accumulator is zero

The "BRZ" instruction in the Little Man Computer (LMC) is specifically designed to branch to a given address when the accumulator holds a value of zero. This instruction is useful for control flow in programs, especially for implementing loops or condition checks.

In the context of LMC, the accumulator is a register that stores temporary results of calculations. If a program requires checking whether a computation has resulted in zero (for example, after a subtraction operation), the "BRZ" instruction allows the program to jump to a different part of the code if that condition is met. Therefore, it facilitates decision-making based on the state of the accumulator.

The other options do not accurately describe the functionality of the "BRZ" instruction:

- The first option mentions branching when the accumulator is positive, which is not the case for "BRZ."

- The third option discussing a negative value relates to a different branching instruction, "BRN," which is used for negative conditions.

- The fourth option mentions non-zero, which again does not apply to "BRZ" since it specifically checks for zero.

This specificity makes the "BRZ" instruction crucial for implementing proper logic based on the accumulator's zero state.

Get further explanation with Examzify DeepDiveBeta

When the accumulator is negative

When the accumulator is non-zero

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy