Skip to content

Commit 6019c2e

Browse files
committed
Code update
Add save project Add open project Add line highlight Add JMZ command Add HLT command Remove extra commands Fix bugs
1 parent c7c59b4 commit 6019c2e

File tree

12 files changed

+328
-319
lines changed

12 files changed

+328
-319
lines changed

AurelienRibon.Ui.SyntaxHighlightBox/AurelienRibon.Ui.SyntaxHighlightBox.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@
5959
<SubType>Designer</SubType>
6060
</Page>
6161
</ItemGroup>
62-
<ItemGroup>
63-
<Resource Include="resources\VHDL.xml" />
64-
</ItemGroup>
6562
<ItemGroup>
6663
<Resource Include="resources\syntax.xsd" />
6764
</ItemGroup>

AurelienRibon.Ui.SyntaxHighlightBox/resources/ASM.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Syntax name="ASM">
44
<HighlightWordsRule name="Instructions">
55
<Words>
6-
MOV ADD SUB MUL DIV LOD STO JMP BREQ CP HALt
6+
ADD SUB MUL DIV LOD STO JMP JMZ HLT NOP
77
</Words>
88
<IgnoreCase>true</IgnoreCase>
99
<Foreground>#2A0085</Foreground>
@@ -15,7 +15,7 @@
1515
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1616
</Words>
1717
<IgnoreCase>true</IgnoreCase>
18-
<Foreground>#006335</Foreground>
18+
<Foreground>#0D7B40</Foreground>
1919
<FontWeight>Normal</FontWeight>
2020
<FontStyle>Normal</FontStyle>
2121
</HighlightWordsRule>
@@ -26,17 +26,24 @@
2626
<FontWeight>Normal</FontWeight>
2727
<FontStyle>Normal</FontStyle>
2828
</HighlightLineRule>
29-
<AdvancedHighlightRule name="Numbers">
30-
<Expression>\b([0-9]+)\b</Expression>
29+
<AdvancedHighlightRule name="Line Numbers">
30+
<Expression>([0-9]+)</Expression>
3131
<IgnoreCase>false</IgnoreCase>
32-
<Foreground>#F68A1B</Foreground>
32+
<Foreground>#0D7B40</Foreground>
3333
<FontWeight>Normal</FontWeight>
3434
<FontStyle>Normal</FontStyle>
3535
</AdvancedHighlightRule>
36+
<AdvancedHighlightRule name="Numbers">
37+
<Expression>#([0-9]+)</Expression>
38+
<IgnoreCase>false</IgnoreCase>
39+
<Foreground>#AC5A12</Foreground>
40+
<FontWeight>Normal</FontWeight>
41+
<FontStyle>Normal</FontStyle>
42+
</AdvancedHighlightRule>
3643
<AdvancedHighlightRule name="Hex">
3744
<Expression>0[xX][0-9a-fA-F]+</Expression>
3845
<IgnoreCase>false</IgnoreCase>
39-
<Foreground>#006335</Foreground>
46+
<Foreground>#0D7B40</Foreground>
4047
<FontWeight>Normal</FontWeight>
4148
<FontStyle>Normal</FontStyle>
4249
</AdvancedHighlightRule>

AurelienRibon.Ui.SyntaxHighlightBox/resources/VHDL.xml

Lines changed: 0 additions & 80 deletions
This file was deleted.

AurelienRibon.Ui.SyntaxHighlightBox/src/SyntaxHighlightBox.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private void OnScrollChanged(object sender, ScrollChangedEventArgs e) {
103103

104104
private void UpdateTotalLineCount() {
105105
totalLineCount = TextUtilities.GetLineCount(Text);
106-
}
106+
}
107107

108108
private void UpdateBlocks() {
109109
if (blocks.Count == 0)
@@ -262,7 +262,7 @@ public int GetIndexOfFirstVisibleLine() {
262262
public int GetIndexOfLastVisibleLine() {
263263
double height = VerticalOffset + ViewportHeight;
264264
int guessedLine = (int)(height / lineHeight);
265-
return guessedLine > totalLineCount - 1 ? totalLineCount - 1 : guessedLine;
265+
return guessedLine > totalLineCount - 1 ? totalLineCount - 1 : guessedLine;
266266
}
267267

268268
/// <summary>

VNS/MainWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
</ListView>
2929
<SyntaxHighlightBox:SyntaxHighlightBox x:Name="CodeBox" Margin="10,25,0,51" HorizontalAlignment="Left" Width="228" CharacterCasing="Upper" FontFamily="Arial" FontSize="16" TextChanged="CodeBox_TextChanged"/>
3030
<Grid Height="46" VerticalAlignment="Bottom" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}">
31-
<Button x:Name="StartBtn" Content="Iniciar" Margin="10,10,0,10" Height="Auto" Click="StartBtn_Click" HorizontalAlignment="Left" Width="100"/>
32-
<Button x:Name="NextBtn" Content="Avancar" Margin="115,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="NextBtn_Click"/>
33-
<Button x:Name="StopBtn" Content="Parar" Margin="220,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="StopBtn_Click" IsEnabled="{Binding WindowBindings.IsRunning, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
31+
<Button x:Name="StartBtn" Content="Start" Margin="10,10,0,10" Height="Auto" Click="StartBtn_Click" HorizontalAlignment="Left" Width="100"/>
32+
<Button x:Name="NextBtn" Content="Step" Margin="115,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="NextBtn_Click"/>
33+
<Button x:Name="StopBtn" Content="Stop" Margin="220,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="StopBtn_Click" IsEnabled="{Binding WindowBindings.IsRunning, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
3434
<Slider x:Name="DelaySizer" Margin="0,10,65,10" HorizontalAlignment="Right" Width="318" Maximum="5000" Minimum="1" Value="200" mah:SliderHelper.ChangeValueBy="LargeChange" TickFrequency="10" ValueChanged="DelaySizer_ValueChanged" SmallChange="1" LargeChange="10"/>
3535
<Label x:Name="MsLabel" Content="200 ms" Margin="0,10,10,10" HorizontalAlignment="Right" Width="55" Foreground="Black"/>
36-
<Label Content="Intervalo:" Margin="0,10,388,10" HorizontalAlignment="Right" Width="59" Foreground="Black"/>
36+
<Label Content="Delay:" Margin="0,10,388,10" HorizontalAlignment="Right" Width="59" Foreground="Black"/>
3737
</Grid>
3838
<Grid Margin="238,25,192,51">
3939
<Viewbox>

0 commit comments

Comments
 (0)