aboutsummaryrefslogtreecommitdiff
path: root/src/ARMeilleure/Decoders/OpCodeT16BImm8.cs
blob: 5f68429833f2c254fdad6222f09654c5f75e5bf5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace ARMeilleure.Decoders
{
    class OpCodeT16BImm8 : OpCodeT16, IOpCode32BImm
    {
        public long Immediate { get; }

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

        public OpCodeT16BImm8(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
        {
            Cond = (Condition)((opCode >> 8) & 0xf);

            int imm = (opCode << 24) >> 23; 
            Immediate = GetPc() + imm;
        }
    }
}