aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Decoders/OpCodeT32MemImm12.cs
blob: 7838604b24c8e50bd5c17acec211e8bb0c26e694 (plain) (blame)
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
namespace ARMeilleure.Decoders
{
    class OpCodeT32MemImm12 : OpCodeT32, IOpCode32Mem
    {
        public int Rt { get; }
        public int Rn { get; }
        public bool WBack => false;
        public bool IsLoad { get; }
        public bool Index => true;
        public bool Add => true;
        public int Immediate { get; }

        public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCodeT32MemImm12(inst, address, opCode);

        public OpCodeT32MemImm12(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
        {
            Rt = (opCode >> 12) & 0xf;
            Rn = (opCode >> 16) & 0xf;

            Immediate = opCode & 0xfff;

            IsLoad = ((opCode >> 20) & 1) != 0;
        }
    }
}