AsmHighlight extension for Visual Studio

Started by Alex.B, November 23, 2007, 01:56:24 AM

Previous topic - Next topic

Alex.B

AsmHighlight is an extension for Visual Studio .NET, .NET 2003, 2005 and 2008 that provides highlighting for inline assembly in C and C++ source files and for assembly code in the Disassembly window of Visual Studio.

Download Installer ( 68Kb ) v1.0

Important:
-Visual Studio .NET & .NET 2003 will reset all it's toolbars & customization options after installation.
-Syntax highlighting will not function properly on the first run. After installation, you must open a c++ file and the disassembly window then restart the environment to get correct syntax highlighting.
-Syntax highlighting colors & fonts can be customized in the Tools->Options dialog only for Visual Studio .NET & .NET 2003.

Please report any problems you have during installation / usage.

Your comments & suggestions are welcomed.

Some screenshots:




Jupiter

Thank you for this great addin!
Customization dialog is not supported in VS 2008 ?
EnJoy!

Shantanu Gadgil

I assume this will NOT work for the Express Editions (like before) ? I am using the Express Edition  2008.
I think the Express Editions don't allow extensions etc.

I installed but the "Integrate AsmHighlight into" showed all the types disabled!  :(

Regards,
Shantanu
To ret is human, to jmp divine!

Alex.B

Jupiter:
Yes, you can't customize highlighting colors under Visual Studio 2008 through the Tools->Options-Font and Colors dialog. For Visual Studio 2008 & 2005 you can specify highlighting color & font styles by manually modifying the two .ini files in the installation directory. They are called DisassemblyKeyWords.ini and InlineAsmKeyWords.ini. You can specify one of 30 predefined color values to use for highlighting. More info in the ini file, you should have no problems figuring it out.

Shantanu:
You are right, the express editions do not allow extensions to be installed.

Jupiter

Hi, Alex.B.
There is another solution to configure colours: add external tool and call it from IDE. This tool will change colours in .ini files.
Anyway there is no any problem to edit .ini files manually ;)
EnJoy!

xanatose

Thank you for the addin.

Would it be possible to add syntax hightlighting for the .asm and .inc files also?

Alex.B

Hi xanatose.

You can make it highlight asm and in files, but in a very hackish way.
Here is how for Visual Studio 2005 ( 8.0 ):

1. Open AsmHighlight.dll in a hex editor and search for 'hxx'. Replace hxx with 'inc' and 'cxx' with 'asm'.
2. Now you have to create a new registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions\.asm
with the default value {B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}
To do so open a reg file with the following content: http://pastebin.ca/1262334
Note the "8.0" in the key name. The key name will be different for another version of VS.

Now you have highlighting inside asm and inc files.
but you will also want keywords that appear in asm files but not in cpp files to be highlighted, like .386, proc, etc.
Open InlineAsmKeyWords.ini and add a new group: http://pastebin.ca/1262365

However, you will still not get complete syntax highlighting for asm files.


xanatose

Quote from: Alex.B on November 20, 2008, 09:29:31 AM
However, you will still not get complete syntax highlighting for asm files.
Thank you again.

I see what you mean. The asm stile comments are not highlighted.
However an (ugly) workaround is to use ;// instead of  just ; to start a comment. for single line and ;/* ;*/ for multi-line

aiv

Hi; Alex.B!,

great job, thanx a lot - it's nearby exactly that, what I've expected to have!!!

I've followed your instruction in Reply #6 on: November 20, 2008, 09:29:31 am, but this my section wasn't proceeded (and similar others):

...
[Group6]
GroupName = Masm Specific Keywords
DefaultColorIndex = 6
DefaultBkColorIndex = 1
DefaultFontFlags = 1
AreInstructions = 1
KeyWords = $ ? @@ @B @F @data @WordSize CARRY? %OUT .586 .BREAK .CONTINUE .ELSE .ELSEIF .ENDIF .ENDW .IF .REPEAT .UNTIL .UNTILCXZ .WHILE INVOKE USES
...

What is wrong?, it's like you advises to do!?

Secondly, have you figured out the case with asm's comments: ; (semicolon)?

How about the numbers (dec and hex)? It's possible to highlight them too?

Please, H E L P !

Thanks in advance.

Regards
aiv

PS in spite of my questions - You've done great job. Thanx again.



 

Alex.B

Hello. Thanks for your words.
1.The problems with the keywords is that they contain characters outside [a-zA-Z_]. This breaks word recognition.
Inline assembly keywords ( In c++ ) don't contain such characters.

2.No, comments still aren't colorized after ;.

3.You can Make VS highlight them using the Fonts->Options dialog. Change the font color for "Number".