|
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 System.ComponentModel; |
|
21 using SymbianUtils.BasicTypes; |
|
22 using SymbianStructuresLib.Arm.Registers; |
|
23 using SymbianInstructionLib.Arm.Instructions.Common; |
|
24 |
|
25 namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing |
|
26 { |
|
27 public class Arm_DataProcessing_32BitImmediate : Arm_DataProcessing |
|
28 { |
|
29 #region Constructors |
|
30 public Arm_DataProcessing_32BitImmediate() |
|
31 : base( TEncoding.EEncoding32BitImmediate ) |
|
32 { |
|
33 // Cond Op. S Rn Rd rotate_imm imm_8 |
|
34 base.SetMask( "####" + "001" + "####" + "#" + "####" + "####" + "####" + "########" ); |
|
35 } |
|
36 #endregion |
|
37 |
|
38 #region From Arm_DataProcessing |
|
39 public override uint Immediate |
|
40 { |
|
41 get |
|
42 { |
|
43 byte rotate = this.RotateImm; |
|
44 SymUInt8 immediate = this.Immediate8; |
|
45 // |
|
46 int rotateAmount = (int) ( rotate * 2 ); |
|
47 SymUInt32 ret = immediate.RotateRight( rotateAmount ); |
|
48 return ret; |
|
49 } |
|
50 } |
|
51 |
|
52 public override bool SuppliesImmediate |
|
53 { |
|
54 get { return true; } |
|
55 } |
|
56 #endregion |
|
57 |
|
58 #region Properties |
|
59 public byte RotateImm |
|
60 { |
|
61 get |
|
62 { |
|
63 byte rotate_imm = (byte) KMaskRotate.Apply( base.AIRawValue ); |
|
64 return rotate_imm; |
|
65 } |
|
66 } |
|
67 |
|
68 public byte Immediate8 |
|
69 { |
|
70 get |
|
71 { |
|
72 byte immediate_8 = (byte) ( base.AIRawValue & 0xFF ); |
|
73 return immediate_8; |
|
74 } |
|
75 } |
|
76 #endregion |
|
77 |
|
78 #region Internal methods |
|
79 #endregion |
|
80 |
|
81 #region Data members |
|
82 private static readonly SymMask KMaskRotate = new SymMask( 0xF00, SymMask.TShiftDirection.ERight, 8 ); |
|
83 #endregion |
|
84 } |
|
85 } |
|
86 |