public override Register GenCode() { var targetRegister = RegisterAllocator.GetNextRegister(); Console.WriteLine("mov r{0}, {1}", targetRegister.GetIndex(), _val); return(targetRegister); }
public override Register GenCode() { var firstRegister = _left.GenCode(); var secondRegister = _right.GenCode(); var targetRegister = RegisterAllocator.GetNextRegister(); Console.WriteLine("add r{0}, r{1}, r{2}", targetRegister.GetIndex(), firstRegister.GetIndex(), secondRegister.GetIndex()); return(targetRegister); }