コード例 #1
0
        private void AddInstr(OptimizationToken tkn)
        {
            switch (tkn.SubType)
            {
            case OptimizationInstructionSubType.None:
            {
                if ((tkn.ParameterRegisters[0] & AssemRegisters.Const) != 0)
                {
                    Emitter.AddConst(tkn.Parameters[0].Value, tkn.ParameterRegisters[1], tkn.ResultRegisters[0]);
                }
                else
                {
                    if (tkn.Parameters[0].ParameterLocation == OptimizationParameterLocation.Const)
                    {
                        Emitter.MovConstantToRegister(tkn.Parameters[0].Value, tkn.ParameterRegisters[0]);
                    }
                    Emitter.Add(tkn.ParameterRegisters[0], tkn.Parameters[0].Size, tkn.ParameterRegisters[1], tkn.Parameters[1].Size, tkn.ResultRegisters[0], tkn.Results[0].Size, true);
                }
            }
            break;

            default:
                throw new NotImplementedException();
            }
        }