crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Bases/Thumb_AddOrSubtract_2Regs.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using SymbianUtils.BasicTypes;
       
    21 using SymbianStructuresLib.Arm.Registers;
       
    22 using SymbianStructuresLib.Arm.Instructions;
       
    23 using SymbianInstructionLib.Arm.Instructions.Common;
       
    24 
       
    25 namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing
       
    26 {
       
    27     public abstract class Thumb_AddOrSubtract_2Regs : Thumb_AddOrSubtract
       
    28     {
       
    29         #region Constructors
       
    30         protected Thumb_AddOrSubtract_2Regs()
       
    31         {
       
    32         }
       
    33         #endregion
       
    34 
       
    35         #region From Thumb_AddOrSubtract
       
    36         public override TArmDataProcessingType OperationType
       
    37         {
       
    38             get
       
    39             {
       
    40                 TArmDataProcessingType ret = TArmDataProcessingType.ADD;
       
    41                 //
       
    42                 if ( base.AIRawValue[ 9 ] == SymBit.ESet )
       
    43                 {
       
    44                     ret = TArmDataProcessingType.SUB;
       
    45                 }
       
    46                 //
       
    47                 return ret;
       
    48             }
       
    49         }
       
    50         #endregion
       
    51 
       
    52         #region From ArmBaseInstruction
       
    53         protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister )
       
    54         {
       
    55             TArmRegisterType reg = this.Rn;
       
    56             return ( aRegister == reg );
       
    57         }
       
    58         #endregion
       
    59 
       
    60         #region Properties
       
    61         public TArmRegisterType Rn
       
    62         {
       
    63             get
       
    64             {
       
    65                 TArmRegisterType ret = (TArmRegisterType) RnByte;
       
    66                 return ret;
       
    67             }
       
    68         }
       
    69 
       
    70         public override TArmRegisterType Rd
       
    71         {
       
    72             get
       
    73             {
       
    74                 TArmRegisterType ret = (TArmRegisterType) RdByte;
       
    75                 return ret;
       
    76             }
       
    77         }
       
    78         #endregion
       
    79 
       
    80         #region Internal methods
       
    81         protected byte RnByte
       
    82         {
       
    83             get
       
    84             {
       
    85                 byte ret = (byte) KMaskRn.Apply( base.AIRawValue );
       
    86                 return ret;
       
    87             }
       
    88         }
       
    89 
       
    90         protected byte RdByte
       
    91         {
       
    92             get
       
    93             {
       
    94                 byte ret = (byte) KMaskRd.Apply( base.AIRawValue );
       
    95                 return ret;
       
    96             }
       
    97         }
       
    98         #endregion
       
    99 
       
   100         #region Data members
       
   101         private static readonly SymMask KMaskRn = new SymMask( 0x38, SymMask.TShiftDirection.ERight, 3 );
       
   102         private static readonly SymMask KMaskRd = new SymMask( 0x7 );
       
   103         #endregion
       
   104     }
       
   105 }
       
   106