OpCodeAluRs.cs 810 B

1234567891011121314151617181920212223242526272829
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCodeAluRs : OpCodeAlu, IOpCodeAluRs
  4. {
  5. public int Shift { get; }
  6. public int Rm { get; }
  7. public ShiftType ShiftType { get; }
  8. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCodeAluRs(inst, address, opCode);
  9. public OpCodeAluRs(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  10. {
  11. int shift = (opCode >> 10) & 0x3f;
  12. if (shift >= GetBitsCount())
  13. {
  14. Instruction = InstDescriptor.Undefined;
  15. return;
  16. }
  17. Shift = shift;
  18. Rm = (opCode >> 16) & 0x1f;
  19. ShiftType = (ShiftType)((opCode >> 22) & 0x3);
  20. }
  21. }
  22. }