OpCode32.cs 666 B

123456789101112131415161718192021222324
  1. using ChocolArm64.Instructions;
  2. using ChocolArm64.State;
  3. namespace ChocolArm64.Decoders
  4. {
  5. class OpCode32 : OpCode64
  6. {
  7. public Condition Cond { get; protected set; }
  8. public OpCode32(Inst inst, long position, int opCode) : base(inst, position, opCode)
  9. {
  10. RegisterSize = RegisterSize.Int32;
  11. Cond = (Condition)((uint)opCode >> 28);
  12. }
  13. public uint GetPc()
  14. {
  15. // Due to backwards compatibility and legacy behavior of ARMv4 CPUs pipeline,
  16. // the PC actually points 2 instructions ahead.
  17. return (uint)Position + (uint)OpCodeSizeInBytes * 2;
  18. }
  19. }
  20. }