OpCode32AluImm.cs 668 B

1234567891011121314151617181920212223
  1. using ARMeilleure.Common;
  2. namespace ARMeilleure.Decoders
  3. {
  4. class OpCode32AluImm : OpCode32Alu, IOpCode32AluImm
  5. {
  6. public int Immediate { get; }
  7. public bool IsRotated { get; }
  8. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32AluImm(inst, address, opCode);
  9. public OpCode32AluImm(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  10. {
  11. int value = (opCode >> 0) & 0xff;
  12. int shift = (opCode >> 8) & 0xf;
  13. Immediate = BitUtils.RotateRight(value, shift * 2, 32);
  14. IsRotated = shift != 0;
  15. }
  16. }
  17. }