old-SuperVM/SuperVM.VisualDebugger/MainWindow.xaml

253 lines
27 KiB
Text
Raw Normal View History

<Window x:Class="SuperVM.VisualDebugger.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SuperVM.VisualDebugger"
xmlns:avalon="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
mc:Ignorable="d"
2016-05-28 14:55:25 +00:00
WindowStartupLocation="CenterScreen"
2016-05-28 21:18:45 +00:00
Title="SuperVM Assembler Toolkit" Height="768" Width="1024">
<Window.DataContext>
<local:VirtualMachineModel />
</Window.DataContext>
<Window.Resources>
<BooleanToVisibilityConverter x:Key="btv" />
</Window.Resources>
<Window.InputBindings>
<KeyBinding Key="V" Modifiers="Ctrl+Shift" Command="{Binding Path=LoadFromClipboardCommand}" />
<KeyBinding Key="F5" Command="{Binding Path=StartCommand}" />
<KeyBinding Key="F5" Modifiers="Ctrl" Command="{Binding Path=StartSlowCommand}" />
<KeyBinding Key="F6" Command="{Binding Path=StopCommand}" />
<KeyBinding Key="F10" Command="{Binding Path=StepCommand}" />
<KeyBinding Key="F9" Command="{Binding Path=StopCommand}" />
</Window.InputBindings>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="File">
<MenuItem Header="Open" Command="{Binding Path=LoadFromFileCommand}" />
<Separator />
<MenuItem Header="Quit" Command="Close" />
</MenuItem>
<MenuItem Header="Edit">
<MenuItem Header="Select All" Command="SelectAll" />
<Separator />
<MenuItem Header="Copy" Command="Copy" />
<MenuItem Header="Cut" Command="Cut" />
<Separator />
<MenuItem Header="Paste" Command="Paste" />
<MenuItem Header="Paste Source" Command="{Binding Path=LoadFromClipboardCommand}"/>
<Separator />
</MenuItem>
<MenuItem Header="Options">
<MenuItem
Header="Append Bootstrap"
IsCheckable="True"
IsChecked="{Binding Path=AppendBootstrap}"/>
<MenuItem
Header="Enable Debug Newline"
IsCheckable="True"
IsChecked="{Binding Path=InsertDebugNewlines}" />
</MenuItem>
</Menu>
<ToolBarTray DockPanel.Dock="Top">
<ToolBarTray.Resources>
<Style TargetType="Path">
<Setter Property="Fill" Value="Black" />
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="16" />
<Setter Property="Stretch" Value="Uniform" />
</Style>
</ToolBarTray.Resources>
<ToolBar Header="Load">
<Button ToolTip="From File" Command="{Binding Path=LoadFromFileCommand}">
<Path Data="F1 M 19,50L 28,34L 63,34L 54,50L 19,50 Z M 19,28.0001L 35,28C 36,25 37.4999,24.0001 37.4999,24.0001L 48.75,24C 49.3023,24 50,24.6977 50,25.25L 50,28L 53.9999,28.0001L 53.9999,32L 27,32L 19,46.4L 19,28.0001 Z " />
</Button>
<Button ToolTip="From Clipboard" Command="{Binding Path=LoadFromClipboardCommand}" >
<Path Data="F1 M 34.0001,60C 32.3433,60 31.0001,58.6569 31.0001,57L 31.0001,54.0001L 23,54.0001C 21.3431,54.0001 20,52.6569 20,51.0001L 20,24.0001C 20,22.3432 21.3431,21.0001 23,21.0001L 26.5001,20.9999C 26.5001,20.9999 27.4999,20.8807 27.4999,19.5C 27.4999,18.1193 29.1191,17 30.4999,17L 38.4998,17.0001C 39.8798,17.0001 41.4988,18.6176 41.5,19.9979L 41.4998,19.5024C 41.5009,20.881 42.5,21 42.5,21L 46,21.0001C 47.6569,21.0001 49,22.3432 49,24.0001L 49,31L 56,38L 56.0001,57C 56.0001,58.6569 54.657,60 53.0001,60L 34.0001,60 Z M 33.9999,31.0001L 33.9999,57.0001L 53.0001,57L 53.0001,43L 42.0002,43L 42.0001,31L 33.9999,31.0001 Z M 53,40.0001L 45,32.0001L 45.0001,40L 53,40.0001 Z M 28.5,25L 40.5,25C 40.5,25 39.4998,23.8809 39.4998,22.5002C 39.4998,21.1194 38.3805,20.0002 36.9998,20.0002L 31.9998,20.0002C 30.6191,20.0002 29.4998,21.1194 29.4998,22.5002C 29.4998,23.8809 28.5,25 28.5,25 Z " />
</Button>
<ToggleButton ToolTip="Enable Bootstrap" IsChecked="{Binding Path=AppendBootstrap}">
<Path Data="F1 M 25.7639,28.0031L 20.0866,22.3258C 19.4683,21.7075 19.4683,20.705 20.0866,20.0866C 20.705,19.4683 21.7075,19.4683 22.3258,20.0867L 28.0031,25.7639C 32.3443,22.5092 38.5302,22.856 42.4783,26.8042L 26.8041,42.4784C 22.856,38.5302 22.5092,32.3443 25.7639,28.0031 Z M 49.1958,33.5217C 53.144,37.4699 53.4908,43.6557 50.2361,47.9969L 55.9133,53.6742C 56.5317,54.2925 56.5317,55.295 55.9133,55.9134C 55.295,56.5317 54.2925,56.5317 53.6742,55.9134L 47.9969,50.2361C 43.6557,53.4908 37.4698,53.1441 33.5216,49.1959L 36.8804,45.8371L 34.0814,43.0381C 33.1539,42.1107 33.1539,40.6069 34.0814,39.6794C 35.0089,38.7519 36.5127,38.7519 37.4402,39.6794L 40.2392,42.4784L 42.4783,40.2392L 39.6794,37.4402C 38.7519,36.5127 38.7519,35.009 39.6794,34.0815C 40.6069,33.154 42.1106,33.154 43.0381,34.0815L 45.8371,36.8804L 49.1958,33.5217 Z " />
</ToggleButton>
</ToolBar>
<ToolBar Header="Control">
<Button ToolTip="Assemble and Restart" Command="{Binding Path=RecompileCommand}" >
<Path Data="F1 M 38,22.1667L 58.5832,37.6043L 58.5832,38.7918L 38,53.8333L 38,22.1667 Z M 33.25,22.1667L 33.25,53.8333L 26.9167,53.8333L 26.9167,22.1667L 33.25,22.1667 Z "/>
</Button>
<Separator />
<Button ToolTip="Start" Command="{Binding Path=StartCommand}">
<Path Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z "/>
</Button>
<Button ToolTip="Start Slow" Command="{Binding Path=StartSlowCommand}">
<Path Data="F1 M 44.3333,45.9167L 53.8333,54.625L 44.3333,63.3333L 44.3333,45.9167 Z M 52.25,39.5833C 52.25,42.2298 51.6007,44.7245 50.4528,46.917L 47.3572,44.2084C 47.762,43.2521 48.0451,42.2317 48.187,41.1667L 44.3333,41.1667L 44.3333,38L 48.187,38C 47.4819,32.7082 43.2918,28.5181 38,27.813L 38,31.6667L 34.8333,31.6667L 34.8333,27.813C 29.5415,28.5181 25.3513,32.7082 24.6463,38L 28.5,38.0001L 28.5,41.1667L 24.6463,41.1667C 25.3513,46.4585 29.5415,50.6487 34.8333,51.3537L 34.8333,47.5L 38,47.5L 38,51.3537C 39.1115,51.2056 40.5703,50.9038 41.5625,50.4702L 41.5625,54.6918C 40.063,55.1628 38.0716,55.4167 36.4167,55.4167C 27.6721,55.4167 20.5833,48.3279 20.5833,39.5833C 20.5833,31.3732 26.8322,24.6226 34.8333,23.8282L 34.8333,22.1667L 30.0833,22.1667L 30.0833,17.4167L 42.75,17.4167L 42.75,22.1667L 38,22.1667L 38,23.8282C 41.1844,24.1444 44.0913,25.404 46.4371,27.3237L 47.5796,26.1813L 45.3404,23.9421L 48.6991,20.5833L 55.4167,27.3009L 52.0579,30.6596L 49.8187,28.4204L 48.6763,29.5629C 50.9099,32.2923 52.25,35.7813 52.25,39.5833 Z M 36.4166,36.4167C 38.1655,36.4167 39.5833,37.8345 39.5833,39.5834C 39.5833,41.3323 38.1655,42.75 36.4166,42.75L 30.0833,47.5L 33.2499,39.5834C 33.2499,37.8345 34.6677,36.4167 36.4166,36.4167 Z "/>
</Button>
<Button ToolTip="Stop" Command="{Binding Path=StopCommand}">
<Path Data="F1 M 26.9167,23.75L 33.25,23.75L 33.25,52.25L 26.9167,52.25L 26.9167,23.75 Z M 42.75,23.75L 49.0833,23.75L 49.0833,52.25L 42.75,52.25L 42.75,23.75 Z "/>
</Button>
<Separator />
<Button ToolTip="Reset" Command="{Binding Path=ResetCommand}">
<Path Data="F1 M 52,24L 52,52L 47,52L 47,43C 47,38.0295 42.9706,34 38,34L 37,34L 37,30L 30.25,36.5L 37,43L 37,39L 38,39C 40.2091,39 42,40.7909 42,43L 42,52L 24,52L 24,24L 52,24 Z "/>
</Button>
<Button ToolTip="Single Step" Command="{Binding Path=StepCommand}">
<Path Data="F1 M 33,25L 59,25L 59,30L 33,30L 33,25 Z M 36,33L 59,33L 59,38L 36,38L 36,33 Z M 36,41L 59,41L 59,46L 36,46L 36,41 Z M 33,49L 59,49L 59,54L 33,54L 33,49 Z M 21,37C 21,39.2092 22.7909,41 25,41L 27,41L 27,37.0001L 33.75,43.5L 27,50L 27,46L 25,46C 20.0294,46 16,41.9705 16,37L 16,34C 16,29.0295 20.0294,25 25,25L 27,25L 27,30L 25,30C 22.7909,30 21,31.7909 21,34L 21,37 Z "/>
</Button>
</ToolBar>
<ToolBar Header="Tools" HorizontalAlignment="Right">
<ToggleButton x:Name="cpuVisible" IsChecked="True">
<Path Data="F1 M 19,19L 57,19L 57,22.063C 56.1374,22.285 55.5,23.0681 55.5,24C 55.5,24.9319 56.1374,25.715 57,25.937L 57,57L 19,57L 19,27.937C 19.8626,27.715 20.5,26.9319 20.5,26C 20.5,25.0681 19.8626,24.285 19,24.063L 19,19 Z M 21.9998,22.0005L 21.9998,24.0005L 23.9998,24.0005L 23.9998,22.0005L 21.9998,22.0005 Z M 24.9998,22.0005L 24.9998,24.0005L 26.9998,24.0005L 26.9998,22.0005L 24.9998,22.0005 Z M 27.9998,22.0005L 27.9998,24.0005L 29.9998,24.0005L 29.9998,22.0005L 27.9998,22.0005 Z M 30.9998,22.0005L 30.9998,24.0005L 32.9998,24.0005L 32.9998,22.0005L 30.9998,22.0005 Z M 33.9998,22.0005L 33.9998,24.0005L 35.9998,24.0005L 35.9998,22.0005L 33.9998,22.0005 Z M 36.9998,22.0005L 36.9998,24.0005L 38.9998,24.0005L 38.9998,22.0005L 36.9998,22.0005 Z M 39.9998,22.0005L 39.9998,24.0005L 41.9998,24.0005L 41.9998,22.0005L 39.9998,22.0005 Z M 42.9995,22.0005L 42.9995,24.0005L 44.9995,24.0005L 44.9995,22.0005L 42.9995,22.0005 Z M 45.9995,22.0005L 45.9995,24.0005L 47.9995,24.0005L 47.9995,22.0005L 45.9995,22.0005 Z M 48.9995,22.0004L 48.9995,24.0004L 50.9995,24.0004L 50.9995,22.0004L 48.9995,22.0004 Z M 51.9996,22.0004L 51.9996,24.0004L 53.9996,24.0004L 53.9996,22.0004L 51.9996,22.0004 Z M 21.9998,25.0004L 21.9998,27.0004L 23.9998,27.0004L 23.9998,25.0004L 21.9998,25.0004 Z M 24.9998,25.0004L 24.9998,27.0004L 26.9998,27.0004L 26.9998,25.0004L 24.9998,25.0004 Z M 27.9998,25.0004L 27.9998,27.0004L 29.9998,27.0004L 29.9998,25.0004L 27.9998,25.0004 Z M 30.9998,25.0004L 30.9998,27.0004L 32.9998,27.0004L 32.9998,25.0004L 30.9998,25.0004 Z M 33.9998,25.0004L 33.9998,27.0004L 35.9998,27.0004L 35.9998,25.0004L 33.9998,25.0004 Z M 36.9998,25.0004L 36.9998,27.0004L 38.9998,27.0004L 38.9998,25.0004L 36.9998,25.0004 Z M 39.9998,25.0004L 39.9998,27.0004L 41.9998,27.0004L 41.9998,25.0004L 39.9998,25.0004 Z M 42.9996,25.0004L 42.9996,27.0004L 44.9996,27.0004L 44.9996,25.0004L 42.9996,25.0004 Z M 45.9996,25.0004L 45.9996,27.0004L 47.9996,27.0004L 47.9996,25.0004L 45.9996,25.0004 Z M 48.9996,25.0004L 48.9996,27.0004L 50.9996,27.0004L 50.9996,25.0004L 48.9996,25.0004 Z M 51.9996,25.0004L 51.9996,27.0004L 53.9996,27.0004L 53.9996,25.0004L 51.9996,25.0004 Z M 21.9998,28.0004L 21.9998,30.0004L 23.9998,30.0004L 23.9998,28.0004L 21.9998,28.0004 Z M 24.9998,28.0004L 24.9998,30.0004L 26.9998,30.0004L 26.9998,28.0004L 24.9998,28.0004 Z M 27.9998,28.0004L 27.9998,30.0004L 29.9998,30.0004L 29.9998,28.0004L 27.9998,28.0004 Z M 30.9998,28.0004L 30.9998,30.0004L 32.9998,30.0004L 32.9998,28.0004L 30.9998,28.0004 Z M 33.9998,28.0004L 33.9998,30.0004L 35.9998,30.0004L 35.9998,28.0004L 33.9998,28.0004 Z M 36.9998,28.0004L 36.9998,30.0004L 38.9998,30.0004L 38.9998,28.0004L 36.9998,28.0004 Z M 39.9998,28.0004L 39.9998,30.0004L 41.9998,30.0004L 41.9998,28.0004L 39.9998,28.0004 Z M 42.9996,28.0004L 42.9996,30.0004L 44.9996,30.0004L 44.9996,28.0004L 42.9996,28.0004 Z M 45.9997,28.0004L 45.9997,30.0004L 47.9997,30.0004L 47.9997,28.0004L 45.9997,28.0004 Z M 48.9997,28.0003L 48.9997,30.0003L 50.9997,30.0003L 50.9997,28.0003L 48.9997,28.0003 Z M 51.9997,28.0003L 51.9997,30.0003L 53.9997,30.0003L 53.9997,28.0003L 51.9997,28.0003 Z M 21.9998,31.0003L 21.9998,33.0003L 23.9998,33.0003L 23.9998,31.0003L 21.9998,31.0003 Z M 24.9998,31.0003L 24.9998,33.0003L 26.9998,33.0003L 26.9998,31.0003L 24.9998,31.0003 Z M 27.9998,31.0003L 27.9998,33.0003L 29.9998,33.0003L 29.9998,31.0003L 27.9998,31.0003 Z M 45.9997,31.0003L 45.9997,33.0003L 47.9997,33.0003L 47.9997,31.0003L 45.9997,31.0003 Z M 48.9997,31.0003L 48.9997,33.0003L 50.9997,33.0003L 50.9997,31.0003L 48.9997,31.0003 Z M 51.9997,31.0003L 51.9997,33.0003L 53.9997,33.0003L 53.9997,31.0003L 51.9997,31.0003 Z M 21.9998,34.0001L 21.9998,36.0001L 23.9998,36.0001L 23.9998,34.0001L 21.9998,34.0001 Z M 24.9999,34.0001L 24.9999,36.0001L 26.9999,36.0001L 26.9999,34.0001L 24.9999,34.0001 Z M 27.9999,34.0001L 27.9999,36.0001L 29.9999,36.0001L 29.9999,34.0001L 27.9999,34.0001 Z M 45.9997,34.0001L 45.9997,36.0001L 47.9997,36.0001L 47.9997,34.0001L 45.9997,34.0001 Z M 48.9997,34.0001L 48.9997,36.0001L 50.9997,36.0001L 50.9997,34.0001L 48.9997,3
</ToggleButton>
<ToggleButton x:Name="outputVisible" IsChecked="False">
<Path Data="F1 M 17,20L 59,20L 59,56L 17,56L 17,20 Z M 20,26L 20,53L 56,53L 56,26L 20,26 Z M 23.75,31L 28.5,31L 33.25,37.5L 28.5,44L 23.75,44L 28.5,37.5L 23.75,31 Z "/>
</ToggleButton>
<ToggleButton x:Name="memoryVisible" IsChecked="False">
<Path Data="F1 M 42,21L 48,21L 48,27L 42,27L 42,21 Z M 41.9999,28.0001L 47.9998,28.0001L 47.9998,34.0001L 41.9999,34.0001L 41.9999,28.0001 Z M 48.9998,21.0002L 54.9998,21.0002L 54.9998,27.0001L 48.9998,27.0001L 48.9998,21.0002 Z M 48.9998,28.0001L 54.9998,28.0001L 54.9998,34.0001L 48.9998,34.0001L 48.9998,28.0001 Z M 27.9999,21.0002L 33.9999,21.0002L 33.9999,27.0001L 27.9999,27.0001L 27.9999,21.0002 Z M 27.9999,28.0001L 33.9999,28.0001L 33.9999,34.0001L 27.9999,34.0001L 27.9999,28.0001 Z M 34.9999,21.0001L 40.9999,21.0001L 40.9999,27.0001L 34.9999,27.0001L 34.9999,21.0001 Z M 34.9999,28.0001L 40.9999,28.0001L 40.9999,34L 34.9999,34L 34.9999,28.0001 Z M 41.9999,35.0001L 47.9999,35.0001L 47.9999,41.0001L 41.9999,41.0001L 41.9999,35.0001 Z M 28,35.0001L 34,35.0001L 34,41.0001L 28,41.0001L 28,35.0001 Z M 27.9999,42.0001L 33.9999,42.0001L 33.9999,48.0001L 27.9999,48.0001L 27.9999,42.0001 Z M 28,49.0001L 34,49.0001L 34,55L 28,55L 28,49.0001 Z M 35,35.0001L 40.9999,35.0001L 40.9999,41.0001L 35,41.0001L 35,35.0001 Z M 35,42.0001L 40.9999,42.0001L 40.9999,48.0001L 35,48.0001L 35,42.0001 Z M 21,21.0002L 26.9999,21.0002L 26.9999,27.0001L 21,27.0001L 21,21.0002 Z M 21,28.0001L 26.9999,28.0001L 26.9999,34.0001L 21,34.0001L 21,28.0001 Z M 21,35.0001L 27,35.0001L 27,41.0001L 21,41.0001L 21,35.0001 Z M 21,42.0001L 27,42.0001L 27,48.0001L 21,48.0001L 21,42.0001 Z M 21,49.0001L 27,49.0001L 27,55L 21,55L 21,49.0001 Z M 34.9999,49.0001L 40.9999,49.0001L 40.9999,55L 34.9999,55L 34.9999,49.0001 Z M 35.9999,50.0001L 35.9999,54.0001L 39.9999,54.0001L 39.9999,50.0001L 35.9999,50.0001 Z M 48.9999,35.0001L 54.9999,35.0001L 54.9999,41.0001L 48.9999,41.0001L 48.9999,35.0001 Z M 49.9999,36.0001L 49.9999,40.0001L 53.9999,40.0001L 53.9999,36.0001L 49.9999,36.0001 Z M 41.9999,42.0001L 47.9999,42.0001L 47.9999,48.0001L 41.9999,48.0001L 41.9999,42.0001 Z M 42.9999,43.0001L 42.9999,47.0001L 46.9999,47.0001L 46.9999,43.0001L 42.9999,43.0001 Z M 48.9999,42.0001L 54.9999,42.0001L 54.9999,48.0001L 48.9999,48.0001L 48.9999,42.0001 Z M 49.9999,43.0001L 49.9999,47.0001L 53.9999,47.0001L 53.9999,43.0001L 49.9999,43.0001 Z M 41.9999,49.0001L 47.9999,49.0001L 47.9999,55L 41.9999,55L 41.9999,49.0001 Z M 42.9999,50.0001L 42.9999,54.0001L 46.9999,54.0001L 46.9999,50.0001L 42.9999,50.0001 Z M 48.9999,49.0001L 54.9999,49.0001L 54.9999,55L 48.9999,55L 48.9999,49.0001 Z M 49.9999,50.0001L 49.9999,54.0001L 53.9999,54.0001L 53.9999,50.0001L 49.9999,50.0001 Z M 22,22.0001L 22,26.0001L 26,26.0001L 26,22.0001L 22,22.0001 Z M 36,29.0001L 36,33.0001L 40,33.0001L 40,29.0001L 36,29.0001 Z M 29,29.0001L 29,33.0001L 33,33.0001L 33,29.0001L 29,29.0001 Z M 22,36L 22,40L 26,40L 26,36L 22,36 Z M 22,29.0001L 22,33.0001L 26,33.0001L 26,29.0001L 22,29.0001 Z M 42.9999,29.0001L 42.9999,33.0001L 46.9999,33.0001L 46.9999,29.0001L 42.9999,29.0001 Z M 49.9999,29.0001L 49.9999,33.0001L 53.9999,33.0001L 53.9999,29.0001L 49.9999,29.0001 Z M 29,22.0001L 29,26.0001L 33,26.0001L 33,22.0001L 29,22.0001 Z M 36,22.0001L 36,26.0001L 40,26.0001L 40,22.0001L 36,22.0001 Z M 29,36L 29,40L 33,40L 33,36L 29,36 Z M 22,43L 22,47L 26,47L 26,43L 22,43 Z M 29,43L 29,47L 33,47L 33,43L 29,43 Z M 36,43L 36,47L 40,47L 40,43L 36,43 Z M 22,50L 22,54L 26,54L 26,50L 22,50 Z M 29,50L 29,54L 33,54L 33,50L 29,50 Z M 43,22L 43,26L 47,26L 47,22L 43,22 Z M 50,22L 50,26L 54,26L 54,22L 50,22 Z M 43,36L 43,40L 47,40L 47,36L 43,36 Z M 36,36L 36,40L 40,40L 40,36L 36,36 Z "/>
</ToggleButton>
</ToolBar>
</ToolBarTray>
<DockPanel>
<Border DockPanel.Dock="Right" Width="250"
BorderThickness="1,0,0,0"
BorderBrush="Black"
Visibility="{Binding ElementName=memoryVisible, Path=IsChecked, Converter={StaticResource btv}}">
<DockPanel>
<Label DockPanel.Dock="Top" Content="System Memory"/>
<DataGrid ItemsSource="{Binding Path=Memory}" AutoGenerateColumns="False">
<DataGrid.Resources>
<Style TargetType="DataGridCell">
<Setter Property="FontFamily" Value="Consolas" />
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTemplateColumn Header="" IsReadOnly="True" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0" Foreground="Gray" TextAlignment="Right" Text="{Binding Path=Offset}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="+0" Binding="{Binding Path=D0}" />
<DataGridTextColumn Header="+1" Binding="{Binding Path=D1}" />
<DataGridTextColumn Header="+2" Binding="{Binding Path=D2}" />
<DataGridTextColumn Header="+3" Binding="{Binding Path=D3}" />
<DataGridTextColumn Header="+4" Binding="{Binding Path=D4}" />
<DataGridTextColumn Header="+5" Binding="{Binding Path=D5}" />
<DataGridTextColumn Header="+6" Binding="{Binding Path=D6}" />
<DataGridTextColumn Header="+7" Binding="{Binding Path=D7}" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</Border>
<Border DockPanel.Dock="Right" Width="200"
BorderThickness="1,0,0,0"
BorderBrush="Black"
Visibility="{Binding ElementName=outputVisible, Path=IsChecked, Converter={StaticResource btv}}">
<DockPanel>
<Label DockPanel.Dock="Top" Content="Output"/>
<TextBox
AcceptsTab="True"
AcceptsReturn="True"
FontFamily="Consolas"
VerticalContentAlignment="Top"
Text="{Binding Path=Output, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
</Border>
<Border DockPanel.Dock="Right" Width="200"
BorderThickness="1,0,0,0"
BorderBrush="Black"
Visibility="{Binding ElementName=cpuVisible, Path=IsChecked, Converter={StaticResource btv}}">
<DockPanel>
<Label DockPanel.Dock="Top" Content="CPU State"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.Resources>
<Style TargetType="TextBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style TargetType="CheckBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</Grid.Resources>
<Label Grid.Row="0" Grid.Column="0" Content="Stack Pointer" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=StackPointer, UpdateSourceTrigger=PropertyChanged}"/>
<Label Grid.Row="1" Grid.Column="0" Content="Base Pointer" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=BasePointer, UpdateSourceTrigger=PropertyChanged}"/>
<Label Grid.Row="2" Grid.Column="0" Content="Code Pointer" />
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=CodePointer, UpdateSourceTrigger=PropertyChanged}"/>
<Label Grid.Row="3" Grid.Column="0" Content="Flags" />
<Grid Grid.Row="3" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" IsChecked="{Binding Path=FlagZ}" Content="Z"/>
<CheckBox Grid.Column="1" IsChecked="{Binding Path=FlagN}" Content="N"/>
</Grid>
<Label Grid.Row="4" Grid.Column="0" Content="Stack:" />
<ScrollViewer Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2">
<ItemsControl Grid.IsSharedSizeScope="True" ItemsSource="{Binding Path=Stack}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
<Style TargetType="TextBlock" >
<Setter Property="Margin" Value="4,2" />
</Style>
</DataTemplate.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="A" />
<ColumnDefinition Width="1" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=Index}" />
<Border Grid.Column="1" Background="Black" />
<TextBox Grid.Column="2" HorizontalContentAlignment="Right" Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</DockPanel>
</Border>
<TabControl>
<TabItem Header="Assembler">
<local:CodeEditor
x:Name="codeEditor"
ShowLineNumbers="True"
FontFamily="Consolas"
2016-05-28 11:10:21 +00:00
Background="#222"
Foreground="#DDD"
2016-05-28 14:55:25 +00:00
FontSize="16"
Code="{Binding Path=Source, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</TabItem>
<TabItem Header="Code">
</TabItem>
</TabControl>
</DockPanel>
</DockPanel>
</Window>