GenCode
29/43
• GenCode generate an optimal code for command a:=b+c
GenCode:
begin
•Ask GetReg for a register R for b
•if b is not in R then generate load R,b
•if c is in reg. S then generate add  R,S
  else  generate add  R,c
 {= c is in memory}
•Update RAT & AT to indicate that current value of a is in R
•if c is in S and c is dead and has no next use then mark S as free in RAT
end;