AInstEmitException.cs 869 B

123456789101112131415161718192021222324252627282930313233
  1. using ChocolArm64.Decoder;
  2. using ChocolArm64.State;
  3. using ChocolArm64.Translation;
  4. using System;
  5. namespace ChocolArm64.Instruction
  6. {
  7. static partial class AInstEmit
  8. {
  9. public static void Svc(AILEmitterCtx Context)
  10. {
  11. AOpCodeException Op = (AOpCodeException)Context.CurrOp;
  12. Context.EmitStoreState();
  13. Context.EmitLdarg(ATranslatedSub.RegistersArgIdx);
  14. Context.EmitLdc_I4(Op.Id);
  15. Context.EmitCall(typeof(ARegisters), nameof(ARegisters.OnSvcCall));
  16. if (Context.CurrBlock.Next != null)
  17. {
  18. Context.EmitLoadState(Context.CurrBlock.Next);
  19. }
  20. }
  21. public static void Und(AILEmitterCtx Context)
  22. {
  23. throw new NotImplementedException($"Undefined instruction at {Context.CurrOp.Position:x16}");
  24. }
  25. }
  26. }