|
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.DataTransfer |
|
26 { |
|
27 public abstract class Thumb_LoadOrStoreMultiple : Thumb_LoadOrStore |
|
28 { |
|
29 #region Constructors |
|
30 protected Thumb_LoadOrStoreMultiple() |
|
31 { |
|
32 } |
|
33 #endregion |
|
34 |
|
35 #region From ArmBaseInstruction |
|
36 protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) |
|
37 { |
|
38 TArmDataTransferType type = this.DataTransferType; |
|
39 // |
|
40 bool ret = base.DoQueryInvolvementAsSource( aRegister ); |
|
41 if ( ret == false && type == TArmDataTransferType.EStore ) |
|
42 { |
|
43 // PUSH {r4, r5, r14} |
|
44 // r13 = dest, r4, r5, r14 are source registers |
|
45 List<TArmRegisterType> regs = this.RegistersAsList; |
|
46 ret = regs.Contains( aRegister ); |
|
47 } |
|
48 // |
|
49 return ret; |
|
50 } |
|
51 |
|
52 protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) |
|
53 { |
|
54 TArmDataTransferType type = this.DataTransferType; |
|
55 // |
|
56 bool ret = base.DoQueryInvolvementAsDestination( aRegister ); |
|
57 if ( ret == false && type == TArmDataTransferType.ELoad ) |
|
58 { |
|
59 // POP {r4, r5, r15} |
|
60 // r13 = source, r4, r5, r14 are destination registers |
|
61 List<TArmRegisterType> regs = this.RegistersAsList; |
|
62 ret = regs.Contains( aRegister ); |
|
63 } |
|
64 // |
|
65 return ret; |
|
66 } |
|
67 #endregion |
|
68 |
|
69 #region Framework API |
|
70 protected abstract List<TArmRegisterType> RegistersAsList |
|
71 { |
|
72 get; |
|
73 } |
|
74 #endregion |
|
75 |
|
76 #region Properties |
|
77 public TArmRegisterType[] Registers |
|
78 { |
|
79 get { return RegistersAsList.ToArray(); } |
|
80 } |
|
81 #endregion |
|
82 |
|
83 #region Internal methods |
|
84 #endregion |
|
85 |
|
86 #region Data members |
|
87 #endregion |
|
88 } |
|
89 } |
|
90 |