Project Description

AsmHighlighter is an extension to Visual Studio 2008 that provides syntax highlighting for x86 ASM language. MASM and NASM syntaxes are supported. .

News

Features

How to install

Screenshots

Screenshot.png

Instruction Size Feature

The AsmHighlighter 1.1 version is adding a new useful features when ones want to quickly visualize the instruction size for each instructions.
You just have to format your code, Menu Edit/Advanced/Format Document (Ctrl+k, Ctrl+d) or Format Selection or current line (Ctrl+k, Ctrl+f), and an evaluation of the instruction's size will be inserted in the comment next to the instruction* as you can see below :

FormatCodeWithInstructionSize.png

For example, if you have the following code :
;!MYVAR=esi

mov dword [eax],0               ; First instruction
fld1                            ; FPU instruction
mov dword [MYVAR + eax], ebx    ; Test with defined
ret                             ; End of test

Pressing Ctrl+K,Ctrl+D will add the instruction size at the beginning of the instruction's comment :

;!MYVAR=esi

mov dword [eax],0               ;#6 First instruction
fld1                            ;#2 FPU instruction
mov dword [MYVAR + eax], ebx    ;#3 Test with defined
ret                             ;#1 End of test

This features only works if there is already a comment start (";") right to the instruction. A simple heuristic is used to determine if an identifier is a label or an offset. If you have an instruction like this mov eax, dword [MYLABEL + eax*2], MYLABEL will be interpreted as an address but if you have mov eax, dword [eax + ebx*2 + MYOFFSET], MYOFFSET will be interpreted as a short offset. The rules is when there are brackets, the first label before any registers is considered as a label address, otherwise it is considered as an offset.

Because the size evaluation is done at the line level, the system doesn't evaluate labels or defines. In order to be close to a real evaluation you need to:
Also, every time you perform a formating of the code, all instruction sizes are updated in the comments.

Keep in mind that this system is a fast evaluation and cannot be 100% exact compare to a whole file compilation, but could be useful in some situations.

Requirements

Limitations

Future Plans

You are welcome to contribute to this project.

Credits

FASM Managed from Shynd was used to provide instruction size. This is a cool library! Thanks Shynd!

Contact

Go to AsmHighlighter to have more information. Leave a message in the discussion tab.

Contact author: alexandre_mutel <at> yahoo <dot> fr
Blog : Code4k