OpCode32.cs 743 B

1234567891011121314151617181920212223
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32 : OpCode
  4. {
  5. public Condition Cond { get; protected set; }
  6. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32(inst, address, opCode);
  7. public OpCode32(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  8. {
  9. RegisterSize = RegisterSize.Int32;
  10. Cond = (Condition)((uint)opCode >> 28);
  11. }
  12. public uint GetPc()
  13. {
  14. // Due to backwards compatibility and legacy behavior of ARMv4 CPUs pipeline,
  15. // the PC actually points 2 instructions ahead.
  16. return (uint)Address + (uint)OpCodeSizeInBytes * 2;
  17. }
  18. }
  19. }