OpCode32MsrReg.cs 909 B

1234567891011121314151617181920212223242526272829
  1. using ARMeilleure.State;
  2. namespace ARMeilleure.Decoders
  3. {
  4. class OpCode32MsrReg : OpCode32
  5. {
  6. public bool R { get; }
  7. public int Mask { get; }
  8. public int Rd { get; }
  9. public bool Banked { get; }
  10. public int Rn { get; }
  11. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32MsrReg(inst, address, opCode);
  12. public OpCode32MsrReg(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  13. {
  14. R = ((opCode >> 22) & 1) != 0;
  15. Mask = (opCode >> 16) & 0xf;
  16. Rd = (opCode >> 12) & 0xf;
  17. Banked = ((opCode >> 9) & 1) != 0;
  18. Rn = (opCode >> 0) & 0xf;
  19. if (Rn == RegisterAlias.Aarch32Pc || Mask == 0)
  20. {
  21. Instruction = InstDescriptor.Undefined;
  22. }
  23. }
  24. }
  25. }