Skip to content

Commit

Permalink
case bugfix and MASM keywords added
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Feb 22, 2016
1 parent 42bf0eb commit 7c5e470
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 25 deletions.
119 changes: 97 additions & 22 deletions C#/AsmDudeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,93 @@
</info>

<miscs>
<misc name="ptr"/>
<misc name="byte"/>
<misc name="word"/>
<misc name="dword"/>
<misc name="qword"/>
<misc name="zword"/>
<misc name="oword"/>
<misc name="equ"/>
<misc name="strict"/>
<misc name="db">
<misc name="PTR"/>
<misc name="BYTE"/>
<misc name="WORD"/>
<misc name="DWORD"/>
<misc name="QWORD"/>
<misc name="ZWORD"/>
<misc name="OWORD"/>
<misc name="EQU"/>
<misc name="STRICT"/>
<misc name="DB">
<description>Byte (1 byte)</description>
</misc>
<misc name="dw">
<misc name="DW">
<description>Word, Half Precision (2 bytes)</description>
</misc>
<misc name="dd">
<misc name="DD">
<description>Double Word, Single Precision (4 bytes)</description>
</misc>
<misc name="dq">
<misc name="DQ">
<description>quad word, Double Precision (8 bytes)</description>
</misc>
<misc name="dt">
<misc name="DT">
<description>Extended (Double) Precision (10 bytes)</description>
</misc>
<misc name="do">
<misc name="DO">
<description>IEEE 754-2008 Quad Precision (16 bytes)</description>
</misc>
</miscs>

<directives>
<directive name=".intel_syntax"/>
<directive name=".text"/>
<directive name=".global"/>
<directive name=".align"/>
<directive name=".att_syntax"/>
<directive name=".186"/>
<directive name=".286"/>
<directive name=".286c"/>
<directive name=".286p"/>
<directive name=".287"/>
<directive name=".386"/>
<directive name=".386p"/>
<directive name=".486c"/>
<directive name=".486p"/>
<directive name=".586"/>
<directive name=".586p"/>
<directive name=".686"/>
<directive name=".686p"/>
<directive name=".8086"/>
<directive name=".8087"/>
<directive name=".ALPHA"/>
<directive name=".CODE"/>
<directive name=".CONST"/>
<directive name=".CREF"/>
<directive name=".NOCREF"/>
<directive name=".DATA"/>
<directive name=".ERR"/>
<directive name=".ERR1"/>
<directive name=".ERR2"/>
<directive name=".ERRB"/>
<directive name=".ERRDEF"/>
<directive name=".ERRDIF"/>
<directive name=".ERRE"/>
<directive name=".FARDATA"/>
<directive name=".K3D"/>
<directive name=".LALL"/>
<directive name=".LFCOND"/>
<directive name=".LIST"/>
<directive name=".MODEL"/>
<directive name=".MMX"/>
<directive name=".MSFLOAT"/>
<directive name=".NOLIST"/>
<directive name=".NOLISTMACRO"/>
<directive name=".RADIX"/>
<directive name=".SALL"/>
<directive name=".SEQ"/>
<directive name=".SFCOND"/>
<directive name=".STACK"/>
<directive name=".TYPE"/>
<directive name=".XALL"/>
<directive name=".XCREF"/>
<directive name=".XLIST"/>
<directive name=".XMM"/>

<directive name=".INTEL_SYNTAX"/>
<directive name=".TEXT"/>
<directive name=".GLOBAL"/>
<directive name=".ALIGN"/>
<directive name=".ATT_SYNTAX"/>
</directives>

<mnemonics>
<mnemonics>
<mnemonic name='AAA'>
<description>ASCII Adjust After Addition</description>
<ref>./html/AAA.html</ref>
Expand Down Expand Up @@ -3275,7 +3324,33 @@
<description>8-bit general purpose register</description>
</register>

<register name='XMM0' bits='128'>
<register name='MM0' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM1' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM2' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM3' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM4' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM5' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM6' bits='64'>
<description>64-bit mmx register</description>
</register>
<register name='MM7' bits='64'>
<description>64-bit mmx register</description>
</register>


<register name='XMM0' bits='128'>
<description>128-bit sse register</description>
</register>
<register name='XMM1' bits='128'>
Expand Down
18 changes: 17 additions & 1 deletion C#/Intellisense/AsmQuickInfoSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qui

switch (curTag.Tag.type) {
case AsmTokenTypes.Misc: {
string description = getDescriptionDirective(tagString);
string description = getDescriptionKeyword(tagString);
if (description.Length > 0) {
quickInfoContent.Add("Keyword " + tagString + ": " + description);
} else {
Expand Down Expand Up @@ -220,6 +220,22 @@ private string getDescriptionDirective(string directive)
//Debug.WriteLine("INFO: getDescriptionDirective: directive \"" + directive + "\" has description \"" + description + "\"");
return description;
}

private string getDescriptionKeyword(string keyword) {
XmlNode node1 = this._xmlDoc.SelectSingleNode("//misc[@name='" + keyword + "']");
if (node1 == null) {
Debug.WriteLine("WARNING: getDescriptionKeyword: no misc element for keyword " + keyword);
return "";
}
XmlNode node2 = node1.SelectSingleNode("./description");
if (node2 == null) {
Debug.WriteLine("WARNING: getDescriptionKeyword: no description element for misc " + keyword);
return "";
}
string description = node2.InnerText.Trim();
//Debug.WriteLine("INFO: getDescriptionKeyword: misc \"" + keyword + "\" has description \"" + description + "\"");
return description;
}
}
}

2 changes: 1 addition & 1 deletion C#/Intellisense/CompletionSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio

var applicableTo = snapshot.CreateTrackingSpan(new SnapshotSpan(start, triggerPoint), SpanTrackingMode.EdgeInclusive);

completionSets.Add(new CompletionSet("All", "All", applicableTo, completions, Enumerable.Empty<Completion>()));
//completionSets.Add(new CompletionSet("All", "All", applicableTo, completions, Enumerable.Empty<Completion>()));
}

public void Dispose() {
Expand Down
2 changes: 1 addition & 1 deletion C#/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
<Metadata>
<Identity Id="c729d6b2-f412-49ed-893d-a8f61f25db98" Version="1.0" Language="en-US" Publisher="H.J. Lebbink" />
<Identity Id="c729d6b2-f412-49ed-893d-a8f61f25db98" Version="1.1" Language="en-US" Publisher="H.J. Lebbink" />
<DisplayName>AsmDude</DisplayName>
<Description xml:space="preserve">Syntax highlighting for assembly source code</Description>
<MoreInfo>https://github.com/HJLebbink/asm-dude</MoreInfo>
Expand Down

0 comments on commit 7c5e470

Please sign in to comment.