aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Decoder/AOpCodeAluRs.cs
blob: 9c215be3831ff0940837591f6969b9c26e70d43c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using ChocolArm64.Instruction;

namespace ChocolArm64.Decoder
{
    class AOpCodeAluRs : AOpCodeAlu, IAOpCodeAluRs
    {
        public int Shift { get; private set; }
        public int Rm    { get; private set; }

        public AShiftType ShiftType { get; private set; }

        public AOpCodeAluRs(AInst Inst, long Position, int OpCode) : base(Inst, Position, OpCode)
        {
            int Shift = (OpCode >> 10) & 0x3f;

            if (Shift >= GetBitsCount())
            {
                Emitter = AInstEmit.Und;

                return;
            }

            this.Shift = Shift;

            Rm        =              (OpCode >> 16) & 0x1f;
            ShiftType = (AShiftType)((OpCode >> 22) & 0x3);
        }
    }
}