AOpCode.cs 914 B

123456789101112131415161718192021222324252627282930313233343536
  1. using ChocolArm64.Instruction;
  2. using ChocolArm64.State;
  3. using System;
  4. namespace ChocolArm64.Decoder
  5. {
  6. class AOpCode : IAOpCode
  7. {
  8. public long Position { get; private set; }
  9. public AInstEmitter Emitter { get; protected set; }
  10. public ARegisterSize RegisterSize { get; protected set; }
  11. public AOpCode(AInst Inst, long Position)
  12. {
  13. this.Position = Position;
  14. RegisterSize = ARegisterSize.Int64;
  15. Emitter = Inst.Emitter;
  16. }
  17. public int GetBitsCount()
  18. {
  19. switch (RegisterSize)
  20. {
  21. case ARegisterSize.Int32: return 32;
  22. case ARegisterSize.Int64: return 64;
  23. case ARegisterSize.SIMD64: return 64;
  24. case ARegisterSize.SIMD128: return 128;
  25. }
  26. throw new InvalidOperationException();
  27. }
  28. }
  29. }