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

Discussion

A machine offering a scaled indexed addressing mode allows the code generator to

  • A.fold the array address computation into the access instruction
  • B.dispense with registers for array accesses altogether
  • C.avoid checking the array bounds at run time
  • D.store arrays in a different format from other data

Answer: A

One instruction then performs the multiplication, the addition and the access. Exploiting such modes is a large part of what makes instruction selection worth doing carefully. A generator that ignores them emits three instructions where one would serve.

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

Post your comment

Please log in or register to post a comment.