Skip to content

MikhailArkhipov/vscode-arm

Repository files navigation

ARM Assembly Language support for Visual Studio Code

A Visual Studio Code extension provides support for the ARM Assembly language when using GAS (GCC Assembler).

ARM Assembly editor

Features

Features include semantic coloring, tooltips/hover, completions, code formatting, basic syntax checking. Assembly syntax is GAS/GCC

Colorizer

Adds new colorable items:

  • directive
  • instruction,
  • register

and the following modifiers:

  • definition (symbols defined via .set or similar)
  • declaration (data declarations such as .asciz).
  • include (.include directive)
  • condition (.if/.endif/... directives)
  • macro (.macro directive)
  • macroName (name of the macro)
  • macroParameter, (macro parameter reference via \\)
  • unrecognized (unrecognized instruction)

To customize colors combine item with modifiers, like directive.include.

Hover

ARM Assembly editor

Completions

ARM Assembly editor

Instruction documentation in browser

ARM Assembly editor

Formatting

Formatter by default automatically derives instruction set (architecture) as well as indentation and casing settings from the document. Options can be set to non-auto values in settings.

Limitations

  • ARM Assembler syntax is not supported.
  • Syntax check is basic, the feature is far from complete and is diagnostics is off by default.
  • Formatting does not support using tabs. Tabs are converted to spaces.

Acknowledgements

  • Documentation on ARM instructions comes from ARM Documentation site.
  • The code is partially based on my work when at Microsoft: R Tools for VS Code, which, in turn, was forked off Microsoft RTVS. Mostly tokenizer and parser, translated from C# to TypeScript, simplified and adapted for assembly language syntax.
  • Some original C# code was already translated to TypeScript in Pyright, hence small amount was taken from there (fragments primarily related to the tokenization and supporting classes).
  • Documentation on instruction was extracted from ARM doc archives downloaded from here. All documentation belongs to Arm Limited.
  • Documentation on directives in hover tooltips is fetched online directly from the GAS Web site.

Bugs and feedback

Feel free to file bugs and suggestions at vscode-arm repo.