Machine-translated by Google. Questions are authored in English.
Top

Discussion

Generating code for a conditional statement usually produces

  • A.a single instruction that evaluates the whole statement
  • B.a jump table indexed by the value of the condition
  • C.no instructions at all when the condition is a variable
  • D.a comparison, a conditional jump and one or two labels

Answer: D

The comparison sets condition codes or produces a boolean, and the jump acts on it. Which form is used depends on how the target machine expresses comparisons. Some machines produce a boolean in a register instead of setting flags.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.