OpCode32.cs 614 B

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