Visual Assist X – what a tool!

This is my break off work, since yet again I found myself amazed by how the Visual Assist X (VAX) is… no, there is no strong enough superlative to describe it! I just wanted to share this jewel with those people that might not know what VAX is.

VAX is Visual Studio plug-in (all popular versions – VS6, VS2002, VS2003, VS2005 and newly also VS2008 – supported) that saves you nerves, time, and also saves you from quite a few bugs along the way. See more at the official site.

Are you tired of the pointless or totally wrong hints IntelliSense gives you (yes, it got better in VS2005 and VS2008, but still…)? Are you tired of switching between files, trying to find the prototype you need, definition of class, or even just where you were moment ago?

VAX is a program of (almost) infinite possibilities. Except of being “the really intelligent IntelliSense”, it provides many refactoring facilities, for any variable provides you with info about its type, in VAX panel shows you member of variables, provides you with definitions of macros (and knows how to work with them, unlike IntelliSense), speeds up typing (e.g. if you type in MFC dialog class gdi, it right away provides you with GetDlgItem as hint), go to definition and declaration (no need to generate the useless Browse Info anymore!) and much MUCH more…

One thing that might seem totally pointless, but that really made me happy when I found out it’s in VAX – the “go back” function (just like in your web-browser) to get back to where you were before you e.g. skipped to declaration of a function. It sure saves a lot of time and nerves, to fast find where you were moment ago.

Of course, VAX is only a program, and as such has also its little “problems”; for me, main problem (and the only I so far faced!) is its confusion while working with templates; esp. while working on template metaprogram, it’s easier to switch it off. Yet of course, even the best and newest compilers get often confused around templates, not to mention humans… 😉

What more to say? Just go to the official site and check out the trial version!
One warning – price of full version, for individuals, is set at $99; if you don’t want to, or can’t afford to, spend 100 bucks on piece of software, do NOT download the trial! Once you go VAX, there’s no going back… For real, no kidding.

One link to end off the praise – example of refactoring abilities of VAX.

Using NASM in Visual Studio 6 and 2003.NET

Once you’ve obtained the Win32 archive for NASM, nasmw-inst-xxx.exe (where xxx denotes the version number of NASM contained in the archive), install the NASM into its own directory (for example “C:\Program Files\NASM”).

The archive will contain two executable files: the NASM executable files nasmw.exe, and the NDISASM executable files ndisasm.exe and ndisasmw.exe. In each case, the file whose name ends in w is a Win32 executable, designed to run under Windows 95 or Windows NT Intel.

Since 0.95.36, NASM is fully officially compatible with Microsoft Visual Studio 6/2003.NET.

Integration within Microsoft Visual Studio 6

  • In Tools/Options/Directories , select “Show directories for:” into “Executable files”. Add a new path “C:\Program Files\NASM” (or where you have installed NASM).
  • In your project workspace, create a new folder “Assembler Files”.
  • On this folder, right click and select “Settings”.
  • In General, enable “Always use custom build step”.
  • In Custom Build, change the following settings:

Commands:
nasmw.exe -f win32 -Xvc -o "$(IntDir)$\(InputName).obj" $(InputDir)\$(InputName).asm

Outputs:
"$(IntDir)$\(InputName).obj"

Integration within Microsoft Visual 2003.NET

  • In Tools/Options/Projects, Select “VC++ Directories” and “Show directories for:” “Executable files” – should be the default. Press Ctrl+Insert or press the “New Line” icon. Select the path “C:\Program Files\NASM” (or where you have installed NASM).
  • In your project workspace, create a new folder “Assembler Files”.
  • On this folder, right click and select “Settings”.
  • In General, enable “Always use custom build step”.
  • In Custom Build, change the following settings:

Commands:
nasmw.exe -f win32 -Xvc -o "$(IntDir)\$(InputName).obj" $(InputDir)\$(InputName).asm

Outputs:
"$(IntDir)\$(InputName).obj"

Using Inline Assembler in C/C++ Code

.asm file:

[bits 32]
[section .bss align=16]
[section .data align=16]
[section .text align=16]
[global _myFunction]
_myFunction:
push ebp
mov ebp,esp
mov eax, [ebp + 8] ; your code goes here, instead of this line...
pop ebp
ret
END

in .c/.cpp file call the function:

under MSVS:

int cdecl myFunction(int parameter);

under GCC you’d call the function with ‘_’ prefix:

int _myFunction(int parameter);

For more information see NASM Documentation, chapter 8.