Ejemplo n.º 1
0
 /// <summary>
 /// Emits the specified platform instruction.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="emitter">The emitter.</param>
 protected override void Emit(Context context, MachineCodeEmitter emitter)
 {
     if (context.Operand2.IsRegister && context.Operand3.IsShift)
     {
         emitter.EmitDataProcessingInstructionWithRegister(context.ConditionCode, Bits.b0100, context.UpdateStatusFlags, context.Operand1.Register.Index, context.Result.Register.Index, context.Operand2.Register.Index, context.Operand3.ShiftType);
     }
     else if (context.Operand2.IsConstant && context.Operand3.IsConstant)
     {
         emitter.EmitDataProcessingInstructionWithImmediate(context.ConditionCode, Bits.b0100, context.UpdateStatusFlags, context.Operand1.Register.Index, context.Result.Register.Index, (int)context.Operand2.ConstantSignedInteger, (int)context.Operand3.ConstantSignedInteger);
     }
     else
     {
         throw new InvalidCompilerException();
     }
 }