Block.cs 719 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. namespace ChocolArm64.Decoders
  3. {
  4. class Block
  5. {
  6. public long Position { get; set; }
  7. public long EndPosition { get; set; }
  8. public Block Next { get; set; }
  9. public Block Branch { get; set; }
  10. public List<OpCode64> OpCodes { get; private set; }
  11. public Block()
  12. {
  13. OpCodes = new List<OpCode64>();
  14. }
  15. public Block(long position) : this()
  16. {
  17. Position = position;
  18. }
  19. public OpCode64 GetLastOp()
  20. {
  21. if (OpCodes.Count > 0)
  22. {
  23. return OpCodes[OpCodes.Count - 1];
  24. }
  25. return null;
  26. }
  27. }
  28. }