Disammbler und Simulator angepasst. Arrays begonnen (defunct)
This commit is contained in:
@ -40,6 +40,9 @@ public static class Bytecode {
|
||||
public const byte JZ = 0x70;
|
||||
public const byte JMP = 0x71;
|
||||
|
||||
// Array operations
|
||||
public const byte ARRAY_BOUNDS_CHECK = 0xE0;
|
||||
|
||||
public const byte HALT = 0xF0;
|
||||
}
|
||||
|
||||
@ -63,6 +66,7 @@ public static class Bytecode {
|
||||
{ OpCodes.LT_U, "LT_U" }, { OpCodes.GT_U, "GT_U" }, { OpCodes.LE_U, "LE_U" }, { OpCodes.GE_U, "GE_U" }, { OpCodes.EQ_U, "EQ_U" }, { OpCodes.NEQ_U, "NEQ_U" },
|
||||
{ OpCodes.LT_F, "LT_F" }, { OpCodes.GT_F, "GT_F" }, { OpCodes.LE_F, "LE_F" }, { OpCodes.GE_F, "GE_F" }, { OpCodes.EQ_F, "EQ_F" }, { OpCodes.NEQ_F, "NEQ_F" },
|
||||
{ OpCodes.JZ, "JZ" }, { OpCodes.JMP, "JMP" },
|
||||
{ OpCodes.ARRAY_BOUNDS_CHECK, "ARRAY_BOUNDS_CHECK" },
|
||||
{ OpCodes.HALT, "HALT" }
|
||||
};
|
||||
|
||||
|
||||
@ -18,5 +18,24 @@ public enum VarType {
|
||||
TIME_OF_DAY = 18, // Tageszeit (TOD) -> TimeSpan / DateTime
|
||||
TOD = TIME_OF_DAY,
|
||||
DATE_AND_TIME = 19,// Datum + Uhrzeit (DT) -> DateTime
|
||||
DT = DATE_AND_TIME
|
||||
DT = DATE_AND_TIME,
|
||||
// Array marker - actual array types use ArrayType class
|
||||
ARRAY = 20
|
||||
}
|
||||
|
||||
// Represents an array type in structured text
|
||||
public class ArrayType {
|
||||
public VarType ElementType { get; set; } // Type of array elements
|
||||
public int Start { get; set; } // Start index
|
||||
public int End { get; set; } // End index
|
||||
public int Length => End - Start + 1; // Number of elements
|
||||
|
||||
public ArrayType(VarType elementType, int start, int end) {
|
||||
ElementType = elementType;
|
||||
Start = start;
|
||||
End = end;
|
||||
if (end < start) throw new System.ArgumentException("Array end index must be greater than or equal to start index");
|
||||
}
|
||||
|
||||
public override string ToString() => $"ARRAY [{Start}..{End}] OF {ElementType}";
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -13,10 +13,10 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("STCompiler.Common")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ec4d7dc26ee2fd96db003ab3a6c1af70e02894b9")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3cb63739152cd26ec43993953c7b93d4ab9bcce7")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("STCompiler.Common")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("STCompiler.Common")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
8cfdc237030ec5222d5f9b3cae794a2e89120fd57c83b878660304653c51962d
|
||||
72a5aa37f3f499d7234a1ea9f8597714d83c5061f8d255b5e45126805bf484a2
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user