AOpCode.cs 1017 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 int RawOpCode { get; private set; }
  10. public AInstEmitter Emitter { get; protected set; }
  11. public ARegisterSize RegisterSize { get; protected set; }
  12. public AOpCode(AInst Inst, long Position, int OpCode)
  13. {
  14. this.Position = Position;
  15. this.RawOpCode = OpCode;
  16. RegisterSize = ARegisterSize.Int64;
  17. Emitter = Inst.Emitter;
  18. }
  19. public int GetBitsCount()
  20. {
  21. switch (RegisterSize)
  22. {
  23. case ARegisterSize.Int32: return 32;
  24. case ARegisterSize.Int64: return 64;
  25. case ARegisterSize.SIMD64: return 64;
  26. case ARegisterSize.SIMD128: return 128;
  27. }
  28. throw new InvalidOperationException();
  29. }
  30. }
  31. }