The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => Topic started by: sluggy on September 06, 2005, 11:40:34 AM

Title: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 06, 2005, 11:40:34 AM
WinCC has referred to this in the past, and he released a version for VS.Net2002.
Since then, i am happy to say that i have taken his project, chewed it up, spat it out, chopped it into little pieces, and then rewrote it from the beginning (because i screwed it up :green ). I now have the first beta release for download, you can find it here (http://xdev.co.nz/vsip2003/). If you think the licence is strict, it isn't, it is just to protect my ass against any potential morons out there  :8)

What is this package?
It is an addin for VS.Net 2003, it is automatically loaded when you start up the IDE. It integrates into the IDE, and gives you extra power, flexibility and capability when editing asm files. Now you can experience some of the cool benefits of the VS IDE while editing your assembly projects.

What features does it include?
Currently, it only has two features:
- syntax colouring. This gives you a huge increase in productivity because it makes your source a lot easier to read. Currently the colours cannot be changed, but they will be fully configurable in an upcoming release.
- block commenting. You can highlight a block of code, and comment the whole block using the CTRL+K CTRL+C key chord. You can also uncomment a block of highlighted text by using the CTRL+K CTRL+U chord.
This might seem like a limited feature list so far, but they are the two features that i personally appreciate the most. I have also put in place a lot of plumbing code in preparation for future features. And if i waited till all features were complete then it would never get released.

What is the scope of the syntax colouring?
All x86, FPU, MMX, SSE/II/III keywords up to and including the P6, Xeon and Pentium M processors, privileged and non privileged. I went through the latest Intel instruction reference that i have and included all the keywords it had. Including ones i have never seen before and probably will never use. All up there are around 530 keywords. Plus a bunch of MASM directives and native macros. Also included are 1665 Win32 structs (these were originally done by WinCC).

Ok, i'm sold. Where do i get it, how do i install it?
To download it, visit this link (http://xdev.co.nz/vsip2003/). It is packaged as an msi file, which means all you have to do is double click on the file, and you get a nice Windows installer wizard. You lucky lucky people, i am so nice to you. The install automatically detects whether you have VS.Net 2003 installed, where it is, and installs into the appropriate VS folder, and sets up the appropriate registry keys. NOTE: because registry keys need to be installed, you should run the install as Administrator.

What if i have a problem? Where do i report bugs?
What do you mean? There are NO bugs!!! It works perfectly on my machine!!!  :bdg :dance: :cheekygreen: Should you find a bug, report it in this forum. Make sure it has a short but descriptive title. Be concise and correct in your report, that helps me fix the problem a lot faster. Remember: i am a professional developer, i eat testers for breakfast  :bdg

What if i have a feature request?
You can post those in this forum too. I have a list of planned features, but i will not tell you what they are yet, i would rather get a list from you without influencing it.

Did you write this addin in asm?? Did ya? Did ya?
Umm, no..... It is written in a mixture of managed and unmanaged C++. The guts of the VS IDE is still COM based, you don't wanna be doing that in asm..... and i wanted to interface to the framework, so i needed to use a managed language.


Before you finish reading, i want to give a big "thank you" to WinCC - this was something i had wanted to do for a long time, and he got me started down the right path  :U
Okay, that about covers it. Get downloading!!


Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 06, 2005, 02:11:27 PM
oooh, sounds good.

here's a rather stupid question, how does one go about using the addin?  I downloaded, installed, opened an asm file in VS and not much has changed.  I looked in the addin manager and toolbox and found no references to MASM.

also for critique:
my only gripe about it so far other than the thing not working is that it resets my layout.  as in, all my custom toolbars and positionings were reset back to default after the install.  you might want to find a way to not do that.  :)
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: manhattan on September 06, 2005, 04:47:04 PM
You should try the VS2005 SDK (http://msdn.microsoft.com/vstudio/extend/SDKDownload/)

I think you can implement a lot of features of the C editor : member completion, tool tip window, "Go to definition...", etc.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: GregL on September 06, 2005, 06:11:54 PM
sluggy,

I had about the same experience as Jeff. I don't see any difference, no Intellisense, and it trashed all my customizations, bummer. This would be great, but it seems to have problems. I would be glad to help improve it.

Now to redo all my customizations.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 06, 2005, 07:49:13 PM
Thanks for your reports guys, i will look at that tonight when i get home from work.

As you can probably guess, i didn't experience this in my test installs, but something is always bound to go wrong  :red.

One question: have you guys got VS installed for "all users", or "just me"? Also, what are the extensions on your asm files? The syntax colouring is only set up to operate on files with the extensions .asm, .api and .inc.

Cheers
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: GregL on September 06, 2005, 08:05:58 PM
sluggy,

I am using Visual C/C++ .NET 2003 Standard Edition, does it require the full Visual Studio package?. Looks like I installed it for 'All Users'. My MASM files have the .asm or .inc extension.

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 06, 2005, 08:27:08 PM
as for me, I have Visual Studio .NET 2003 Academic.  IIRC, its the full studio with extras.  it was a full install for all users.  all my source and includes have the .asm and .inc extensions respectively.  i use the ide to code and debug while using external tools to assemble and whatnot.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 07, 2005, 10:39:09 AM
Hi guys,

Greg: I haven't tested this on the "standard" version of VS, but it should still work, "standard" just means that you are missing some of the exotic tools and extras that come with something like the "enterprise" level.

Jeff: yours should also not be a problem. With MS products, "academic" is usually the standard or professional level product, but with the upgrade capability crippled, so that when the next upgrade comes out you have to buy the full version, not use the cheaper upgrade.

It seems the problem is that i missed a couple of registry keys in the install, which means the dlls are installed, they are just not properly hooked up yet. Notice that for one of the registry entries, you will have to replace the value i have there with the path to the folder the masm32.dll is installed in (don't put a slash on the end). Also ensure you use double slashes in the path, when the values are in the registry you will see that they have become single slahes.
Here is the solution that should work for you. Just copy and paste the following text into a text file (use Notepad), rename the file so that it has a .reg extension, then double click on it so that they get entered into the registry.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Services\{AB5D0853-8D94-4F17-80BE-5E4EBC1C0A8F}]
@="{221F0EB7-30F7-45FF-AE73-5968B167CF09}"
"Name"="MASM32"


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AddIns\MASM]
"SatelliteDllName"="Masm32.dll"
"SatelliteDllPath"="<path to folder where dll installed, with no slash on the end> i.e.: C:\\Program Files\\Visual Studio 2003\\Common\\bin"
"FriendlyName"="MASM Addin"
"LoadBehavior"=dword:00000000



Note that i will be uploading a new install about 24 hours from now, so at that point in time this solution will become redundant.


Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 07, 2005, 04:39:19 PM
Just to let you know, I tried your solution and nothing seemed to happen still.  I think that's because I was missing a whole buch of keys.  No worries tho, i'll just wait for your update.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: GregL on September 07, 2005, 06:31:35 PM
sluggy,

I added the registry entries. It then shows up in the Add-in Manager but I get an error when trying to enable it.

Quote from: Microsoft Development Environment
The Add-in 'MASM Addin' failed to load or caused an exception.
Would you like to remove this Add-in?
If you choose yes, you will need to reinstall the Add-in to use it again.

Error message: Class not registered

Error number: 80040154

I chose no. I then registered the MASM32.DLL with regsvr32, that succeeded. I went back into Visual Studio and got the same error. I'll try the new install when you post it.

I appreciate your effort here sluggy.  :thumbu







Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: GregL on September 07, 2005, 06:46:32 PM
sluggy,

I loaded a MASM program into Visual Studio, and it's working. Both the syntax coloring and the commenting.  Despite the error in the Add-in manager.  :U

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 07, 2005, 07:37:33 PM
just to let you know, that addin manager error i get too.  i just thought that it was a common error because i also have another addin (that came with the academic) which gives the same error when trying to enable.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: GregL on September 07, 2005, 08:51:52 PM
Jeff,

I take it it's still not working for you. Try registering the DLL with regsvr32. Also, the path to MASM32.DLL in the registry ("SatelliteDllPath") must end with a slash.


sluggy,

I see I can change the colors in Tools, Options, Environment, Fonts and Colors. Is there a list of keywords that I can edit? Some words are colored when lowercase but not when uppercase. Some are not colored at all etc.

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 08, 2005, 12:34:31 AM
registering the dll works.  but i think i would rather wait for sluggy to finish the fix.

tho it seems the highlighting is very limited and with problems ("sorry parsing could not recover").  but thats probably because it isnt completely fixed yet.  so far only "MOV" and "inc" are blue while numbers and comments are gray.

the commenting worked out good.  would it be possible to adjust it so an undo uncomments everything? (right now i would have to undo each line individually).  i cant say much more on this yet so i'll have to wait a bit.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Citric on September 08, 2005, 05:58:51 AM
Hi Sluggy

Has the install been update?

Cheers Adam
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 08, 2005, 06:32:50 AM
well he did say "24 hours from now" 20 hours ago so we have to wait another 4 hours.  :D
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 08, 2005, 08:59:01 AM
Quote from: Jeff on September 08, 2005, 06:32:50 AM
well he did say "24 hours from now" 20 hours ago so we have to wait another 4 hours.  :D
Heh, almost, my little smurfs  :green

I tested out the new install i made last night, it works with the exception of the MASM32.dll is not being registered, so i will fix that tonight, and probably release in the morning. I will put an announcement in this thread once it is done. Did i ever say that VS really sucks the big one when it comes to making installs??!!

Thanks for your patience :)

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 09, 2005, 12:13:25 AM
Ok guys, the new version is up. I have tested it on a clean version of VS, it still has one small problem, you have to manually register the MASM32.dll. I have decided to go with this version so that you don't have to wait any longer.  I am going to convert it to using Wise to build the msi, i will have way more power and way less problems that way, plus i know Wise inside out.

When you install it, make sure you:

- uninstall through the add/remove programs applet, or by rerunning the msi and choosing "uninstall"
- rerun any reg files you ran, but with the "/u" switch to take them out of the registry
- make sure you select "Everyone" when it asks who you want to install for

I notice that the first keyword on the page gets the red squiggly line and the message "parser could not recover", i am not sure why this is happening (i haven't noticed it until you guys mentioned it), but it is of low impact (ie has no effect on the rest of the page or on assembling).

I also haven't been able to replicate the issue where custom settings get messed up, but if it still happens then let me know.

Cheers

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 09, 2005, 03:40:13 AM
well i reinstalled and reregistered.  not much difference from the last but i understand you were just trying to correct the installer.  fortunately my toolbars were spared (might have something to do with VS being open when i installed and registered).

(http://members.cox.net/appl_jax/Temp/vsmasm.png)
now im not sure if this is how you intended it but this is what i see.  not much coloring as you can see.  case sensitive?  well, just a heads up.

and just in case if you missed my suggestion:
Quote from: Jeffthe commenting worked out good.  would it be possible to adjust it so an undo uncomments everything? (right now i would have to undo each line individually).  i cant say much more on this yet so i'll have to wait a bit.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 09, 2005, 11:52:28 AM
Hi Jeff,
no, it is misbehaving because you are doing something with Java in the same IDE at the same time  :bdg :bdg

Actually, you are totally correct, it is currently mostly case sensitive. All the keywords are matched if you do them in lower case, but only a few are currently matched in upper or mixed case. Some of them (like the MASM directives/macros) are currently only uppercase. It is actually a fair amount of tedious work to get them all case insensitive, there is a regex for every keyword to match, and to modify between 500 and 600 of those takes a while  :P Here is an example of the same version you are running with one of my source files:
(http://www.xdev.co.nz/vsip2003/temp/images/code.gif)

Like i said earlier, it is currently oriented to my coding preferences  :dance: :bg But seriously, i will be changing it soon to make the keywords case insensitive. And the more comments or ideas you guys come up with, the better, because i can't guess every particular way that people code, they have to tell me.

Regarding the commenting: i didn't miss your comment. It works fine for me, select the lines of code, hit CTRL+K CTRL+C to comment it, highlight the lines again and hit CTRL+K CTRL+U to uncomment it.

Cheers

BTW, have you seen my instructions for setting up asm projects in VS, so that you can use all the standard build and debug features? (so you can press F5 and your project builds and runs, etc)
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Jeff on September 09, 2005, 02:58:54 PM
sluggy,
i havent seen your instructions on setting up projects.  could you provide a link or explain about it here?

as for the commenting, i didnt know about the uncomment part.  or at least, i dont remember seeing that in your initial post.  :P  but i thought that it might be a good idea to make the whole action be completely undo-/redo-able for the sake of completedness.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: GregL on September 09, 2005, 07:41:25 PM
sluggy,

I un-installed the older one and installed the new one. The install worked. The functionality is the same as before. It set my toolbars to the default again, no big deal, I'm getting fast at putting them back how I like them. :bg  This is an useful Add-in. I hope you continue to improve it.

Some things I would like to see:


I haven't seen your instructions on setting up MASM projects either. I know how to use makefile projects, is that what you are doing?.

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on September 09, 2005, 11:42:20 PM
Quote from: Jeff
i havent seen your instructions on setting up projects.  could you provide a link or explain about it here?
Quote from: GregI haven't seen your instructions on setting up MASM projects either. I know how to use makefile projects, is that what you are doing?.

Heh, it's in the old forum, which is why you wouldn't have seen it. Check it out here (http://www.old.masmforum.com/viewtopic.php?t=2504) :U

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: a_h on October 10, 2005, 10:37:05 AM
Hi sluggy!

Great addon! I hope you haven't stopped yet the development! Looking forward to your next version - would be great if it could register the dll itself. By the way, a .686 brings the parser out of step (could not recover...).

Thanks for your work! Hannes
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on October 17, 2005, 11:44:38 AM
Hi guys,
the new version is up. The main changes are:

- fully case insensitive with the asm keywords. This is very easy to do by telling Flex to compile case insensitive, but that was too easy, i did it the hard way of modifying the regex for every single keyword. There may still be one or two MASM specific keywords i haven't done yet, i'll check on those for next release.

- i fixed the installer. Well, actually i dumped the install written with VS2003, and wrote it using Wise. Seems VS has a bug where it will not set up dlls correctly, and as you don't have access to the underlying tables in the msi it makes it kinda hard to fix. This install was tested on a *clean* fully patched WinXP Prof system. Make sure you correctly uninstall the old version before installing this one.

Now, did i mention how much MS's Virtual PC sucks??? (compared to VMWare). It is slow, bloated, prone to corruption, yadda yadda yadda  :green

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on October 17, 2005, 11:51:30 AM
Hi Hannes,
thanks  :P VS is one of the greatest editors out there, i am glad to be able to give it some asm capability. Once i get this version of the addin reasonably mature, i will port it to VS2005, that editor has even nicer features.
Quote from: a_h on October 10, 2005, 10:37:05 AM
By the way, a .686 brings the parser out of step (could not recover...).
That bug had been reported, i haven't traced what is causing it yet, but it isn't major as everything still works normally after that little parser trip up. I have just released another version, i will see if i can fix that bug by the end of the month, but no promises as it is almost impossible to debug this sort of thing at the source level.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: Polizei on January 02, 2006, 07:14:22 PM
Yo, sluggy, does this goodie works with the MacroSoft Visual Studio .NET 2oo5 (Enterprise) ??
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on January 03, 2006, 02:13:36 AM
Yes and no - it will work on VS2005, but it doesn't get loaded by it because certain registry keys need to be installed, and currently those keys are only installed for VS2003.
I am at an interesting stage with this tool - do i continue developing it for VS2003, or do i port it to VS2005 and finish it for that IDE? There is a bit more doco for language services in VS2005, but not a lot more, and most of it applies to VS2003 as well. And there is a lot of stuff that isn't documented, which makes development that much harder  :eek

And i better mention that i have fixed the bug that caused the parser to crash - i will post the fix for it when i get back from holiday.

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: thomas_remkus on April 04, 2006, 04:29:00 PM
This sounds like a really helpful tool but we are all just using VS2005 right now in my office. Please let us know when you have the VS2005 working because I'd love to install.
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on April 06, 2006, 12:30:55 PM
Quote from: thomas_remkus on April 04, 2006, 04:29:00 PM
This sounds like a really helpful tool but we are all just using VS2005 right now in my office. Please let us know when you have the VS2005 working because I'd love to install.
Hi thomas,
i'm glad you like the plug in :)
Yes, it does build in VS2005 (at least it did last time i tried, i don't think i've broken it since....). I haven't worked on it in a while, i have a couple of other projects on at the moment, and as usual i'm rather busy with my real job. Because you have expressed some interest, i'll see if i can get a VS2005 release out in the next 4 weeks or so.

With this addin, what i have been concentrating on the most lately is the grammar rules, some of the features in MASM are tough to code rules for. I am also quickly coming to a roadblock with this version of the plugin - it uses the Babel style language implementation, and with this style it is impossible to implement some of the cooler features of the IDE, like collapsible sections and intellisense etc. If it isn't impossible then it might as well be as there is no doco for it anywhere. So, i am (almost) at the point where i retire that version of the plugin, and start writing a new one based on the MPF language service that was introduced with VS2005, with this it is possible to get full integration with the IDE, but it does mean a rewrite from the ground up  :eek

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: db on August 27, 2006, 09:28:22 AM
Hi sluggy,

Googling for MASM intellisense/syntax highlighting for Visual Studio I have just found your add-in. But unfortunately it does not work with VS2005 (at least it does not install). You told some time ago that you were porting it to VS2005 - is there any progress since then?
Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: sluggy on August 31, 2006, 08:35:09 PM
Hi db,
yes, i have it working on VS2005 at home, all that is required is to set up a different bunch of registry entries so that VS2005 knows about it.

I will put together a virtual machine in the next couple of days to test it. My only real concern is that while it gives you syntax colouring, i have been totally messing with the syntax checking, so you get a lot of red squigglies on perfectly legitimate code. I have the BNF rules for the syntax, if someone was a pro at translating those to yacc then i would be happy.

As mentioned previously, things change drastically in VS2005 for language plugins, and while i have done a bit of research i still haven't determined whether i can reuse any of the work done so far in a managed package framework plugin, or whether i have to write it from scratch.

Title: Re: VS.Net 2003 Intellisense addin for MASM
Post by: db on September 01, 2006, 05:04:06 AM
Quote from: sluggy on August 31, 2006, 08:35:09 PM
Hi db,
yes, i have it working on VS2005 at home, all that is required is to set up a different bunch of registry entries so that VS2005 knows about it.

Which registry entries? Can you provide any details?

Quote from: sluggy
I will put together a virtual machine in the next couple of days to test it. My only real concern is that while it gives you syntax colouring, i have been totally messing with the syntax checking, so you get a lot of red squigglies on perfectly legitimate code. I have the BNF rules for the syntax, if someone was a pro at translating those to yacc then i would be happy.

Well, yacc (or bison) grammar is in fact just a set of BNF rules. Send me that rules and I'll try to make the yacc file.

Quote from: sluggy
As mentioned previously, things change drastically in VS2005 for language plugins, and while i have done a bit of research i still haven't determined whether i can reuse any of the work done so far in a managed package framework plugin, or whether i have to write it from scratch.

It's a pity, I thought you had almost catched the target.