Question: Q 5 . ( a ) Draw the Expression Tree for ( A * * ( B C ) ) + ( D - (

Q 5.(a) Draw the Expression Tree for (A**(BC))+(D-(E+F)).
(b) Label the nodes of the tree to generate the optimal target code.
(c) Generate the optimal machine codes for the expression where the available registers set is {R0,R1}. The available instructions are as follows:
STMi,Rj,??Mi=Rj
LDRi,Rj,??Ri=Rj
LDRi,Mj,??Ri=Mj
ADDRi,Ri,Rj,??Ri=Ri+Rj
SUBRi,Ri,Rj,??Ri=Ri-Rj?M
ULRi,Ri,Rj,??Ri=Ri**Mj
DIVRi,Ri,Rj,??Ri=RiRj
LDRi,Rj,??Ri=Rj
ADDRi,Ri,Mj,??Ri=Ri+Mj
SUBRi,Ri,Mj,??Ri=Ri-Mj?M
ULRi,Ri,Mj,??Ri=Ri**Mj
DIVRi,Ri,Mj,??Ri=RiMj
SOLVE IF YOU KNOW DONT GIVE AI RESULT 99
Q 5 . ( a ) Draw the Expression Tree for ( A * *

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!