QB Unit - V1
QB Unit - V1
QUESTION BANK
UNIT - V
1. What are the various algorithms for code generation from DAG?
2. Consider the following code sequence
MOV B, R0
ADD C, R0
MOV R0,A Calculate the cost of above instructions.
3. What is the cost of the following set of instructions
mov *R1, * R0 add *R2,*R0
4. Generate a code for following statements
a =b+c; d=a+e;
5. Consider the following code sequence
MOV B, A
ADD C, A
Calculate the cost of above instructions.
6. What are the characteristics of peephole optimization?
7. Calculate the cost of following set of instructions?
MOV a,R0 ADD b,R0 MOV R0,c
8. Give two examples of machine idioms?
9. Give two examples for Algebraic simplification?
10. Give two examples for redundant instruction elimination?