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

Discussion

Generating code for an expression mixing integer and floating point operands requires

  • A.a conversion instruction inserted where the semantic analyser required
  • B.that the two operand types simply be treated as though identical
  • C.that the whole expression be evaluated in software instead
  • D.that the programmer rewrite the whole expression by hand

Answer: A

Correct answer: a conversion instruction inserted where the semantic analyser required

The semantic analyser has already decided where a conversion is needed and recorded it in the tree; the generator’s task is to emit the machine’s conversion instruction at that point. Treating the two representations as interchangeable would produce nonsense, since their bit patterns mean quite different things.

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

Post your comment

Please log in or register to post a comment.