Zykluszeit im ByteCode

This commit is contained in:
2025-10-13 13:30:00 +02:00
parent 74f256efb2
commit 5a002806a9
46 changed files with 19 additions and 14 deletions

View File

@ -5,7 +5,8 @@ using System.Collections.Generic;
public static class Bytecode {
public const string Magic = "STBC";
public const ushort Version = 2;
public const ushort DefaultCycleTime = 100; // in milliseconds
public static class OpCodes {
public const byte NOP = 0x00;
public const byte PUSH_CONST = 0x01; // integer/long

View File

@ -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+3cb63739152cd26ec43993953c7b93d4ab9bcce7")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+74f256efb2d90ae0bc878111d497ee146327bb51")]
[assembly: System.Reflection.AssemblyProductAttribute("STCompiler.Common")]
[assembly: System.Reflection.AssemblyTitleAttribute("STCompiler.Common")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -1 +1 @@
72a5aa37f3f499d7234a1ea9f8597714d83c5061f8d255b5e45126805bf484a2
4f685d6f74184ca56c8bdd109d64fc681695ed4155cb24ff44ab2c139f8eee14

View File

@ -365,6 +365,7 @@ public class BytecodeEmitter {
// Header
w.Write(Encoding.ASCII.GetBytes(Bytecode.Magic));
w.Write(Bytecode.Version);
w.Write(Bytecode.DefaultCycleTime);
// Konstanten
w.Write((ushort)consts.Count);

View File

@ -13,10 +13,10 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("STCompiler.Compiler")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3cb63739152cd26ec43993953c7b93d4ab9bcce7")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+74f256efb2d90ae0bc878111d497ee146327bb51")]
[assembly: System.Reflection.AssemblyProductAttribute("STCompiler.Compiler")]
[assembly: System.Reflection.AssemblyTitleAttribute("STCompiler.Compiler")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -1 +1 @@
cc701f58f98db810dc498092a84a16f3679a63cf316500de1b157491a545da80
9e103a7c6db7d257367fcb8e4dc976fb31f0875136636fa357927991b9ce9ddc

Binary file not shown.

View File

@ -25,6 +25,8 @@ class Program {
Console.WriteLine($"Magic: {magic}");
ushort ver = r.ReadUInt16();
Console.WriteLine($"Version: {ver}");
ushort cycletime = r.ReadUInt16();
Console.WriteLine($"Cycle: {cycletime} ms");
ushort nConsts = r.ReadUInt16();
Console.WriteLine($"Consts: {nConsts}");
var consts = new List<object>();

View File

@ -13,10 +13,10 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("STCompiler.Disassembler")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3cb63739152cd26ec43993953c7b93d4ab9bcce7")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+74f256efb2d90ae0bc878111d497ee146327bb51")]
[assembly: System.Reflection.AssemblyProductAttribute("STCompiler.Disassembler")]
[assembly: System.Reflection.AssemblyTitleAttribute("STCompiler.Disassembler")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -1 +1 @@
2175f71304910ca37c6a64a54785d953c58ecd76944c17fb6fe56c6a95a4d3e4
3d4adf0bd5b0dc0665a784bf64e53bbaf5e4ba59d3c539d15229580b865800e1

View File

@ -25,7 +25,8 @@ class Program {
ushort ver = r.ReadUInt16();
Console.WriteLine($"Version: {ver}");
bool oldFormat = ver < Bytecode.Version;
ushort cycletime = r.ReadUInt16();
Console.WriteLine($"Cycle: {cycletime} ms");
ushort nConsts = r.ReadUInt16();
Console.WriteLine($"Consts: {nConsts}");
var consts = new List<object>();

View File

@ -13,10 +13,10 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("STCompiler.Simulator")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3cb63739152cd26ec43993953c7b93d4ab9bcce7")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+74f256efb2d90ae0bc878111d497ee146327bb51")]
[assembly: System.Reflection.AssemblyProductAttribute("STCompiler.Simulator")]
[assembly: System.Reflection.AssemblyTitleAttribute("STCompiler.Simulator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -1 +1 @@
b05e088189133b131132a72fa879b53ae0f21051a8f25a2e49266f0f500e3142
504856d607c12c0216f0b660a4485f4825b01e58f9f0bf1be4eb0f07ce5141ce