crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Large.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     [ArmRef( "A7.1.4 ADD (2)",  "ADD <Rd>, #<immed_8>" )]
       
    28     [ArmRef( "A7.1.66 SUB (2)", "SUB <Rd>, #<immed_8>" )]
       
    29     public class Thumb_AddOrSubtract_Large : Thumb_AddOrSubtract
       
    30     {
       
    31         #region Constructors
       
    32         public Thumb_AddOrSubtract_Large()
       
    33         {
       
    34             //                     Type    Rd     immed_8
       
    35             base.SetMask( "0011" + "#" + "###" + "########" );
       
    36         }
       
    37         #endregion
       
    38 
       
    39         #region From ArmBaseInstruction
       
    40         protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister )
       
    41         {
       
    42             // Rd acts as source and destination
       
    43             TArmRegisterType reg = this.Rd;
       
    44             return ( aRegister == reg );
       
    45         }
       
    46         #endregion
       
    47 
       
    48         #region From Thumb_AddOrSubtract
       
    49         public override TArmDataProcessingType OperationType
       
    50         {
       
    51             get
       
    52             {
       
    53                 TArmDataProcessingType ret = TArmDataProcessingType.ADD;
       
    54                 //
       
    55                 if ( base.AIRawValue[ 11 ] == SymBit.ESet )
       
    56                 {
       
    57                     ret = TArmDataProcessingType.SUB;
       
    58                 }
       
    59                 //
       
    60                 return ret;
       
    61             }
       
    62         }
       
    63 
       
    64         public override TArmRegisterType Rd
       
    65         {
       
    66             get
       
    67             {
       
    68                 TArmRegisterType ret = (TArmRegisterType) KMaskRd.Apply( base.AIRawValue );
       
    69                 return ret;
       
    70             }
       
    71         }
       
    72 
       
    73         public override uint Immediate
       
    74         {
       
    75             get
       
    76             {
       
    77                 uint ret = ( base.AIRawValue & 0xFF );
       
    78                 return ret;
       
    79             }
       
    80         }
       
    81 
       
    82         public override bool SuppliesImmediate
       
    83         {
       
    84             get { return true; }
       
    85         }
       
    86         #endregion
       
    87 
       
    88         #region Properties
       
    89         #endregion
       
    90 
       
    91         #region Internal methods
       
    92         #endregion
       
    93 
       
    94         #region Data members
       
    95         private static readonly SymMask KMaskRd = new SymMask( 0x700, SymMask.TShiftDirection.ERight, 8 );
       
    96         #endregion
       
    97     }
       
    98 }
       
    99