diff --git a/SuperVM.Assembler/Assembler.cs b/SuperVM.Assembler/Assembler.cs index 7848148..04db48e 100644 --- a/SuperVM.Assembler/Assembler.cs +++ b/SuperVM.Assembler/Assembler.cs @@ -204,6 +204,9 @@ namespace SuperVM.Assembler foreach (var patch in patches) { var target = patch.Value; + if (labels.ContainsKey(target) == false) + throw new InvalidOperationException($"Missing label: {target}"); + var position = labels[target]; code[patch.Key] = (code[patch.Key] & 0xFFFFFFFF) | diff --git a/SuperVM.VisualDebugger/MainWindow.xaml b/SuperVM.VisualDebugger/MainWindow.xaml index 79c350a..7500d78 100644 --- a/SuperVM.VisualDebugger/MainWindow.xaml +++ b/SuperVM.VisualDebugger/MainWindow.xaml @@ -6,7 +6,8 @@ xmlns:local="clr-namespace:SuperVM.VisualDebugger" xmlns:avalon="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit" mc:Ignorable="d" - Title="MainWindow" Height="350" Width="525"> + WindowStartupLocation="CenterScreen" + Title="MainWindow" Height="768" Width="1024"> @@ -125,7 +126,7 @@ AcceptsReturn="True" FontFamily="Consolas" VerticalContentAlignment="Top" - Text="{Binding Path=Output}"/> + Text="{Binding Path=Output, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> @@ -164,6 +165,7 @@ FontFamily="Consolas" Background="#222" Foreground="#DDD" + FontSize="16" Code="{Binding Path=Source, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> diff --git a/SuperVM.VisualDebugger/VirtualMachineModel.cs b/SuperVM.VisualDebugger/VirtualMachineModel.cs index 8993ed2..ad792c6 100644 --- a/SuperVM.VisualDebugger/VirtualMachineModel.cs +++ b/SuperVM.VisualDebugger/VirtualMachineModel.cs @@ -172,7 +172,7 @@ namespace SuperVM.VisualDebugger } public StackItem[] Stack => Enumerable - .Range(0, (int)this.process.StackPointer) + .Range(1, (int)this.process.StackPointer) .Select(i => new StackItem(i, this.process)) .ToArray();