Discussion
Arrange the steps a simple code generator takes for the instruction x = y + z.
1. generate the add instruction with z as the second operand
2. find a location for the result, preferring a register
3. update the register and address descriptors for x
4. ensure that y is available in a register
Answer: A
Correct answer: 2 - 4 - 1 - 3
A location for the result is chosen first, since it may determine which register the addition targets. The first operand is then brought into a register, the add is emitted with the second operand wherever it lies, and the descriptors are updated last so that they record where x now is.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development