diff --git a/Flazzy/ABC/AVM2/Instructions/ASInstruction.cs b/Flazzy/ABC/AVM2/Instructions/ASInstruction.cs index 0d349a8..5afe2f1 100644 --- a/Flazzy/ABC/AVM2/Instructions/ASInstruction.cs +++ b/Flazzy/ABC/AVM2/Instructions/ASInstruction.cs @@ -29,7 +29,7 @@ protected virtual void WriteValuesTo(ref SpanFlashWriter output) { } public int GetSize() => sizeof(OPCode) + GetBodySize(); - public void WriteTo(ref SpanFlashWriter output) + public void WriteTo(ref SpanFlashWriter output) { output.Write((byte)OP); WriteValuesTo(ref output); @@ -40,10 +40,10 @@ public void WriteTo(ref SpanFlashWriter output) public override void WriteTo(FlashWriter output) { Span buffer = stackalloc byte[64].Slice(0, GetSize()); - + var outputWriter = new SpanFlashWriter(buffer); WriteTo(ref outputWriter); - + output.Write(buffer); } @@ -101,7 +101,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input) OPCode.StrictEquals => new StrictEqualsIns(), OPCode.Subtract_i => new SubtractIIns(), OPCode.Subtract => new SubtractIns(), - + // Bit manipulation OPCode.BitAnd => new BitAndIns(), OPCode.BitNot => new BitNotIns(), @@ -110,7 +110,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input) OPCode.LShift => new LShiftIns(), OPCode.RShift => new RShiftIns(), OPCode.URShift => new URShiftIns(), - + // Control transfer OPCode.IfEq => new IfEqualIns(ref input), OPCode.IfGe => new IfGreaterEqualIns(ref input), @@ -130,7 +130,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input) OPCode.Label => new LabelIns(), OPCode.LookUpSwitch => new LookUpSwitchIns(ref input), - + // Register management OPCode.DecLocal_i => new DecLocalIIns(ref input), OPCode.DecLocal => new DecLocalIns(ref input), @@ -169,7 +169,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input) OPCode.PopScope => new PopScopeIns(), OPCode.PushWith => new PushWithIns(), OPCode.PushScope => new PushScopeIns(), - + // Type conversion OPCode.Coerce_a => new CoerceAIns(), OPCode.Coerce => new CoerceIns(abc, ref input), @@ -245,7 +245,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input) OPCode.SetSuper => new SetSuperIns(abc, ref input), OPCode.Throw => new ThrowIns(), OPCode.TypeOf => new TypeOfIns(), - + _ => throw new Exception("Unhandled OPCode: " + op) }; } diff --git a/Flazzy/IO/SpanFlashReader.cs b/Flazzy/IO/SpanFlashReader.cs index 4c07d1f..7bc247d 100644 --- a/Flazzy/IO/SpanFlashReader.cs +++ b/Flazzy/IO/SpanFlashReader.cs @@ -1,6 +1,6 @@ -using System.Text; -using System.Buffers.Binary; +using System.Buffers.Binary; using System.Runtime.CompilerServices; +using System.Text; namespace Flazzy.IO; @@ -123,4 +123,4 @@ public string ReadNullString() Position += length + 1; return value; } -} +} \ No newline at end of file