OpCodeMov.cs 892 B

123456789101112131415161718192021222324252627282930313233343536
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCodeMov : OpCode
  4. {
  5. public int Rd { get; private set; }
  6. public long Immediate { get; private set; }
  7. public int Bit { get; private set; }
  8. public OpCodeMov(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  9. {
  10. int p1 = (opCode >> 22) & 1;
  11. int sf = (opCode >> 31) & 1;
  12. if (sf == 0 && p1 != 0)
  13. {
  14. Instruction = InstDescriptor.Undefined;
  15. return;
  16. }
  17. Rd = (opCode >> 0) & 0x1f;
  18. Immediate = (opCode >> 5) & 0xffff;
  19. Bit = (opCode >> 21) & 0x3;
  20. Bit <<= 4;
  21. Immediate <<= Bit;
  22. RegisterSize = (opCode >> 31) != 0
  23. ? RegisterSize.Int64
  24. : RegisterSize.Int32;
  25. }
  26. }
  27. }