Git Product home page Git Product logo

hjlebbink / asm-dude Goto Github PK

View Code? Open in Web Editor NEW
4.1K 731.0 94.0 82.15 MB

Visual Studio extension for assembly syntax highlighting and code completion in assembly files and the disassembly window

License: MIT License

C# 56.01% Assembly 6.34% C++ 0.04% Python 37.52% Shell 0.05% Batchfile 0.01% Go 0.03%
visual-studio assembly-language-programming syntax-highlighting avx512 avx2 code-completion assembly visual-studio-extension assembler x86-64

asm-dude's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asm-dude's Issues

VS2015 Crashed due to System.Runtime.InteropServices.COMException

Upgraded to 1.4.2 and open a c# project makes VS2015 crashed.

Visual Studio 2015 Update2 CTP
With Resharper & Code for Roslyn installed.

Exception info:
Unhandled exception:
System.Runtime.InteropServices.COMException
The application called an interface That was marshalled for a different thread. (Exception from HRESULT:0x8001010E (RPC_E_WRONG_THREAD))
在 Microsoft.VisualStudio.Shell.Interop.IVsThreadedWaitDialog3.StartWaitDialogWithCallback(String szWaitCaption, String szWaitMessage, String szProgressText, Object varStatusBmpAnim, String szStatusBarText, Boolean fIsCancelable, Int32 iDelayToShowDialog, Boolean fShowProgress, Int32 iTotalSteps, Int32 iCurrentStep, IVsThreadedWaitDialogCallback pCallback)
在 Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitContext.CreateDialog(IVsThreadedWaitDialogFactory dialogFactory)
在 Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitContext..ctor(IGlobalOperationNotificationService notificationService, IVsThreadedWaitDialogFactory dialogFactory, String title, String message, Boolean allowCancel)
在 Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitIndicator.StartWait(String title, String message, Boolean allowCancel)
在 Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitIndicator.Wait(String title, String message, Boolean allowCancel, Action`1 action)
在 Microsoft.CodeAnalysis.Editor.Implementation.TextStructureNavigation.AbstractTextStructureNavigatorProvider.TextStructureNavigator.GetExtentOfWord(SnapshotPoint currentPosition)
在 AsmDude.HighlightWord.HighlightWordTagger.UpdateWordAdornments(Object threadContext)
在 System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
在 System.Threading.ThreadPoolWorkQueue.Dispatch()
在 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Full log was too long to paste here, so I attached it as an attachment.

fulllog.txt

Small highlighting issues

  1. Comment is not highlighted if it appears in line after any numeric constant:
    1

  2. Only first numeric constant in line is highlighted:
    2

I am using last version of plugin builded from source

`call` instructions get reported as an undefined label

Visual Studio 2015 Update 2
AsmDude version 1.5.0.1

Here's a small asm file:

segment_name SEGMENT USE64
    call proc_name
    hlt

proc_name PROC
    xor rax, rax
    ret
proc_name ENDP
segment_name ENDS

Open this file in Visual Studio and AsmDude will report call proc_name as having an "Undefined Label".

Files are not included with INCLUDE

I was told this was supposed to be working and start a new issue here.

INCLUDE Irvine32.inc
TERMMSG EQU < "(Press ENTER to Terminate)">
.data
; Prompts
prompt_Welcome BYTE WELCOMEMSG , 0
.code
main PROC
; Press Enter to Terminate
mov edx, OFFSET prompt_goodBy
call WriteString ; <-- Irvine Library Call
call ReadInt ; <-- Irvine Library Call
call CrLf; <-- Irvine Library Call
exit

main ENDP

image

You can see there is a red squiggly line under WriteString, ReadInt, and CrLf

Please add green (or yellow or blue) squiggle adornments for register information.

I like to add green squiggles (similar to the red ones for errors) to indicate that the value of a register has been determined by my assembly simulator, which I'm planning for AsmDude 2.0. Sadly I don't know how to make those bloody squiggles... thus I asked some questions on SO and MSDN, see here. Sadly, still no solutions...

I don't have much reputation on SO, thus, if some of you have a bit of reputation to invest in my questions, in return I will make nicely colored squiggles with register contents.

Regards HJ!

Adjusting Syntax Highlighting Requires Multiple Restarts VS2015

Steps to reproduce:

  1. From Tools>Options>AsmDude>Syntax Highlighting make a change to one of the colors.
  2. Click on OK to confirm the changes.
  3. Restart VS2015 to effect the change.
  4. Open an ASM project and note that the updated syntax highlighting has not taken effect.

Typical workaround involves disabling the plugin, restarting VS2015, enabling the plugin, and finally restarting VS2015, version 14.0.25421.03 Update 3.

Other than that I'm absolutely loving this plug-in. Thank you for taking the time to develop it!

Tooltips use wrong colors

The tooltips always use the default colors (e.g. orange), not the colors from Visual Studio's Fonts and Colors option menu (e.g. green):

tooltip

Syntax Highlighting

JUMP:
This option stays at a dark blue color no matter what I set it to. The others seem to be working.

MISC:
Doesn't seem to pick up signed data types like. SDWORD, SWORD, etc

Overall really cool project and look forward to seeing how it progresses. Thanks.

Bug- Code Folding

When I try to use the #region keyword and the #endregion the code folds properly, when building it won't build producing an invalid character build-fail error at the line of #region.

Note:
_It was working fine but suddenly it stopped, I tried enabling and disabling the code folding but it didn't solve the issue_

Thank You

Adding custom file extensions to be opened with AsmDude

It would be really nice to allow custom file extensions (e.g. "*.iasm") to be opened with AsmDude.

The Visual Studio Way of doing that usually is going to Tools -> Options -> Text Editor -> File Extension, then typing in the extension and which editor to open it with. However, I have no clue how much effort it is to make Visual Studio recognize AsmDude as an "editor".

Warnings get duplicated in the Error List when closing/reopening files.

Steps to reproduce:

  • Add a file to your solution that causes an "Undefined Label" warning.
  • Close and reopen the file multiple times.

Visual Studio's Error List will continuously add the same warning. The only way I can find for clearing the Error List is closing and reopening Visual Studio, which feels like a subpar solution.

Same thing happens with the "Is the Tools>Options>AsmDude options pane not visible?" message. Continuously gets duplicated in the Error List until you close Visual Studio.

Feature request: Add "Font Color" option under "Keyword Highlighting"

Currently there is only an option to customize the background color for keyword highlighting. Due to the inability to customize the font color for highlighted keywords, this can make it difficult to read highlighted keywords when using certain color schemes (as seen in the picture below).

image

I'm requesting the addition of a "Font Color" customizer in the "Keyword Highlighting" section of the AsmDude plugin options, as seen in the following picture (and marked with a red arrow):

image

To make the feature extra convenient, I think it would be best to also include an "Inherit color" option for the highlighted keyword font color. This (default?) option would leave the font color of highlighted keywords unchanged from the normal font color used by the current color scheme.

Options Menu Disappears After Restarting VS

The options menu (Tools > Options > AsmDude) disappears after restarting Visual Studio Community 2015 on Windows 10. Does not appear to be related to changing or using different themes.

100% repeatable

Workaround: Disable AsmDude, restart, enable AsmDude, restart. This workaround is rather inconvenient since VS must be restarted to apply changes to some options.

The dollar sign is considered an undefined label

It's common for us to write "breakpoints" in using jump instructions to $. Example file:

segment_name SEGMENT USE64
    jmp $
segment_name ENDS

This shows up in the error list as an undefined label.

#region / #endregion directives not recognized

I'm pretty sure this is an asm-dude glitch... I hunted all over the internet for these preprocessor directives and it looks like it's linked to the type of editor (i.e. c# or C++) so when no editor base is chosen then it doesn't recognize the caracter... (i.e. I don't think they are stripped out prior to compiling)

image

No Highlighting on VS2015 (v1.8.1.1 BROKEN; v1.8.0.0 OK)

For some reason my highlighting is gone... I have fiddled around with opening / closing VS with different settings. I cannot find a file extension that asm is associated with.. so I don't think that is the issue.

I see there was an update a couple days ago.. Is it related? Next step is to uninstall / re-install the plugin.

AsmDude does not work (when .asm extension is associated to an editor)

I've installed AsmDude through the Visual Studio marketplace. I restarted my computer and tried editing a .asm file, but the syntax highlighting is not showing.

image

I've gone to Tools -> Options -> AsmDude and it says that sytax highlighting is enabled.

image

Why can't I get the syntax highlighting working?

Workaround for labels defined in "parent" include file?

Similar to #15 but inversed:

a.asm

include "a.inc"

segment_name SEGMENT USE64
    on_fail:
    hlt
segment_name ENDS

a.inc

inc_segment_name SEGMENT USE64
    jmp on_fail
inc_segment_name ENDS

I'm guessing the change you made for #15 was just to recurse down include directives when you saw them. This seems a lot trickier as there's no clues where "a.inc" was included into.

Keywords inside of strings are not ignored

Example file:

segment_name SEGMENT USE64
    db "This string contains the word jmp inside of it",0
segment_name ENDS

Having syntax coloring inside of these strings is not a huge problem. The bigger issue is that the word "inside" shows up in Visual Studio's error list as "Undefined Label"

Changing highlight colors

Is it possible to change highlight colors? I'm using dark visual studio theme and current colors don't look nice with this theme.
asm

Autocomplete should select names that are shorter if multiple matches exist

When I attempt to type something like inc, where there are other potential matches which start with the same letters, the auto-completion logic in ASM Dude seems to favor the longer options over the shorter ones. This makes it difficult to type things like inc, because when I hit Space it autocompletes to include. I think it should choose the shortest match instead.

Demo

Comments are always italic

As we all know, Visual Studio does not support setting any syntax highlighting explicitly to italic or non-italic.

As this extension sets all comments to italic, I kindly request the option to let the user decide whether he wants his comments to be displayed in italics or not:

comment

Autocomplete should select names that are shorter if multiple matches exist

When I attempt to type something like inc, where there are other potential matches which start with the same letters, the auto-completion logic in ASM Dude seems to favor the longer options over the shorter ones. This makes it difficult to type things like inc, because when I hit Space it autocompletes to include. I think it should choose the shortest match instead.

Demo

labels not behaving properly in 1.7.5.1

Hi..
As explained, the labels are getting marked as missing. Am attaching a zip of a small sample project that reflects this label issue.
Platform = VS2017 on Windows 10 pro 14393.1066 running on i7 4770K
ASMDude version = 1.7.5.1
Details in the image attached.

asm_prob

error MSB3325 (build error @asm-tools-lib)

error MSB3325: Cannot import the following key file: AsmToolsListKeyFile.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_ABEED75BFE1F832A
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2884,5): error MSB3321: Importing key file "AsmToolsListKeyFile.pfx" was canceled.

I am tried
sn.exe -i C:\Users\Lee\Source\Repos\asm-dude\VS\CSHARP\asm-tools-lib\AsmToolsListKeyFile.pfx VS_KEY_ABEED75BFE1F832A and this doesn't work.

Any help?

Highlight colors are not saved in VS2015

See the attached image. I changed a few highlight colors, but the Asm Dude plugin ignores them and uses the predefined colors instead. Restarting VS doesn't help.
(I have v1.7.3.2 on VS2015.)
highlight

Allow configuration or override for disabling label warnings.

In cases where "undefined label" or "label clash" warnings occur where it's too complex to fix or to modify AsmDude to support that usage.

I'm thinking either or both:

  • A Tools -> Options -> AsmDude setting for disabling the label checking solution-wide.
  • Some sort of #pragma-like syntax.

Possible syntax:

 ; pragma AsmDude warning disable
 jmp undefined_label
 ; pragma AsmDude warning restore

included files are not scanned

capture1

why is there a warning regarding openInputfile and such ?
the extension was working perfectly but suddenly it acted like this!
even thought the code runs successfully

P.s. : when i disable the extension the warning is gone

Location of Grey Suggestion popups-and other comments

  1. The little pop ups as you hang a cursor over them are great. But they are in the way too often. Consider putting the offset of the label above the current line of code. I suspect everyone is looking downward in the document anyway. I think that is consistent with other MS Popups.

  2. Constants such as 'COURSE EQU <"CS 271 Winter 2017 Section 400 ">' which occur before the .data segment have 'LABEL' listed as their type in the suggestion popup. This incorrect as these are precompiler directives

  3. If there is no documentation site consider just adding a folder to the GitHub where we can add documentation. I'm really quite new to this github repository but have some familiarity with CVS and have read the gitbook. So maybe my suggestion is not the best location but I think you should understand the intent.

  4. It would nice if user-defined types were highlighted.

  5. The keyword highlighting kinda grabbed single characters, this was annoying because single quotes and double quotes were being grabbed. I think it would be better if keyword highlighting was limited to words that matched keyword requirements of assembly. I just turned it off.

  6. Of course the universe of features in infinite. Still if I may suggest one small feature, If included library can be scanned for available procedures that would be nice to have those highlighted not marked as invalid, and perhaps a hover tooltip made to show where the source of the highlighting comes from.
    For Example: INCLUDE Irvine32.inc has procedure WriteString. ASM-Dude currently marks it as invalid (because it doesn't know about objects from the linking). Maybe as a simple work around the Irvine32.lib procedures could just be added to list of words and an option put in the settings.

  7. I'm in my first assembly class so I hope that my comments are appropriate.

Add some new features

Add support for segment registers, extern, nasm macros ,addressing modes and more syntax highlighting

seprate assemblers and there keywords

there should be an option in the option menu which will specifies the assembler.
MASM keywords should not be in autocomplete menu if the assembler is NASM and they should not be highlighted.

Workaround for labels defined in other files?

I have a hunch this will be difficult to get working properly, but let's say you have these files:

a.asm

include "a.inc"
segment_name SEGMENT USE64
    jmp mylabel
segment_name ENDS

a.inc

inc_segment_name SEGMENT USE64
    mylabel:
    hlt
inc_segment_name ENDS

"mylabel" is considered an undefined label, even though it will be defined once "a.inc" is included into the file.

We use this a lot and it results in AsmDude writing many "Undefined Label" warnings in Visual Studio's Error List.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.