0 votes 0 votes Compiler Design compiler-design + – Gupta731 asked Oct 18, 2018 Gupta731 361 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply arya_stark commented Oct 19, 2018 reply Follow Share What is ans ? is it 2 or 4 ?? 0 votes 0 votes sandygate commented Nov 21, 2018 reply Follow Share t1=10; t1=2; t2=3; t2=t1+t2; t1=t2+t3; t3=t2+t1; hence we need oly 3 regi..... 0 votes 0 votes garimanand commented Nov 21, 2018 reply Follow Share without spilling means don't need to save it in memory back so t1 = b t2 = c t1 =t1+ t2 t2=t1+t2 t3 =d t2= t1 +t3 so i think 3 should be the answer @Gupta731 what is the answer given??? 0 votes 0 votes Gupta731 commented Nov 21, 2018 reply Follow Share 2 is given as the answer. Check the solution. Please Explain. 0 votes 0 votes sandygate commented Nov 21, 2018 reply Follow Share ohh...2 is also possible.....the explanation seems right to me 0 votes 0 votes arya_stark commented Nov 21, 2018 reply Follow Share yeah !! here we go, don't by hard at it i just explain this according to me WE need minimum no of register that will perform same operation and give us output same as d. R1= c and R2 = b R1 = R2 + R1 (means we add c and d and store in R1) now R1 is consider as "a" R2 = R1 + R2 (R1 is already "a" and store "d" in R2 , add "a" and "d") match this to question then result R2 is "b" so consider R2 as "b" finally R1 = R1 + R2 (means a+b ) and return R2. I know i am not good at explaination but i did my best ... Correct me if i wrong. 0 votes 0 votes Please log in or register to add a comment.