crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_Unconditional.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 SymbianStructuresLib.Arm.Registers;
       
    21 using SymbianStructuresLib.Arm.Instructions;
       
    22 using SymbianInstructionLib.Arm.Instructions.Common;
       
    23 
       
    24 namespace SymbianInstructionLib.Arm.Instructions.Thumb.Branching
       
    25 {
       
    26     public class Thumb_Branch_Unconditional : Thumb_Branch_Immediate
       
    27     {
       
    28         #region Enumerations
       
    29         public enum TType
       
    30         {
       
    31             ETypeMultipartFirstPartOfBranch = -1,
       
    32             ETypeB = 0,
       
    33             ETypeBL,
       
    34             ETypeBLX
       
    35         }
       
    36         #endregion
       
    37 
       
    38         #region Constructors
       
    39         public Thumb_Branch_Unconditional()
       
    40         {
       
    41             //                      H      offset_11
       
    42             base.SetMask( "111" + "##" + "###########" );
       
    43         }
       
    44         #endregion
       
    45 
       
    46         #region API
       
    47         #endregion
       
    48 
       
    49         #region Properties
       
    50         public override int BranchOffset
       
    51         {
       
    52             get
       
    53             {
       
    54                 int ret = ThumbInstructionUtils.SignExtend11BitTo32Bit( base.AIRawValue & 0x7FF );
       
    55                 return ret;
       
    56             }
       
    57         }
       
    58 
       
    59         public TType Type
       
    60         {
       
    61             get
       
    62             {
       
    63                 TType ret = TType.ETypeB;
       
    64                 //
       
    65                 byte val = base.AIRawValue[ 12, 11 ];
       
    66                 if ( val == 1 )
       
    67                 {
       
    68                     ret = TType.ETypeBLX;
       
    69                 }
       
    70                 else if ( val == 3 )
       
    71                 {
       
    72                     ret = TType.ETypeBL;
       
    73                 }
       
    74                 else if ( val == 2 )
       
    75                 {
       
    76                     ret = TType.ETypeMultipartFirstPartOfBranch;
       
    77                 }
       
    78                 //
       
    79                 return ret;
       
    80             }
       
    81         }
       
    82         #endregion
       
    83 
       
    84         #region Internal methods
       
    85         #endregion
       
    86 
       
    87         #region Data members
       
    88         #endregion
       
    89     }
       
    90 }
       
    91