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

Discussion

Arrange these steps of backpatching a conditional jump.
1. merge the list with others as subexpressions combine
2. emit the jump with its destination field left blank
3. fill in the destination when the label becomes known
4. record the index of that instruction on a list

  • A.3 - 1 - 4 - 2
  • B.4 - 2 - 1 - 3
  • C.2 - 1 - 4 - 3
  • D.2 - 4 - 1 - 3

Answer: D

Correct answer: 2 - 4 - 1 - 3

Backpatching exists because the destination is not yet known when the jump must be emitted. So the jump is emitted with a blank field, its index is recorded on a list, the lists are merged as subexpressions combine, and every entry is filled in at once when the label finally becomes known.

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

Post your comment

Please log in or register to post a comment.