aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Decoders/Block.cs
blob: c89ea7c6fb92bb9c2995761f1bb6fab2e8d565e5 (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
26
27
28
29
30
31
32
33
34
35
using System.Collections.Generic;

namespace ChocolArm64.Decoders
{
    class Block
    {
        public long Position    { get; set; }
        public long EndPosition { get; set; }

        public Block Next   { get; set; }
        public Block Branch { get; set; }

        public List<OpCode64> OpCodes { get; private set; }

        public Block()
        {
            OpCodes = new List<OpCode64>();
        }

        public Block(long position) : this()
        {
            Position = position;
        }

        public OpCode64 GetLastOp()
        {
            if (OpCodes.Count > 0)
            {
                return OpCodes[OpCodes.Count - 1];
            }

            return null;
        }
    }
}