Расширение VS Code для подсветки синтаксиса ассемблера x86/x64, ARM и КВС
Find a file
kapitche 43fb2d4a78 Add configurable comment characters for assembly
Introduces new settings for customizing line and block comment characters via VS Code configuration. Updates the extension to dynamically apply these settings and documents the feature in the README. Also bumps the minimum VS Code engine version and extension version.
2025-07-02 14:44:53 -04:00
.vscode init 2024-10-12 18:55:24 -04:00
images universal now 2024-10-12 23:55:03 -04:00
src Add configurable comment characters for assembly 2025-07-02 14:44:53 -04:00
syntaxes better 2024-10-13 00:34:06 -04:00
.gitattributes init 2024-10-12 18:55:24 -04:00
.gitignore init 2024-10-12 18:55:24 -04:00
.vscodeignore init 2024-10-12 18:55:24 -04:00
language-configuration.json d 2024-10-12 22:50:58 -04:00
LICENSE Create LICENSE 2024-10-12 19:07:25 -04:00
package-lock.json changed version 2024-10-24 19:31:21 -04:00
package.json Add configurable comment characters for assembly 2025-07-02 14:44:53 -04:00
README.md Add configurable comment characters for assembly 2025-07-02 14:44:53 -04:00

Overview 🛠️

This Visual Studio Code extension provides comprehensive syntax highlighting for x86, x64 and ARM assembly language using Intel syntax. It's designed to improve readability and understanding of assembly code, including compiler-generated output.

Features

  • Syntax highlighting for x86, x64 and ARM assembly instructions 💻
  • Support for Intel syntax 🧠
  • Highlighting of registers, memory operands, and numeric constants 🔍
  • Recognition of common assembler directives ⚙️
  • Proper highlighting of labels and function names 🏷️
  • Support for compiler-generated assembly features (e.g., CFI directives) 🛡️

Installation 🚀

  1. Open Visual Studio Code
  2. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS)
  3. Search for "Universal Assembly Syntax Highlighting"
  4. Click Install

Usage 💡

Once installed, the extension will automatically provide syntax highlighting for files with the following extensions:

  • .asm
  • .s
  • .S
  • .nasm
  • .asmx
  • .inc

If you're working with a file that has a different extension but contains x86/x64 assembly code, you can manually set the language mode:

  1. Click on the language indicator in the bottom-right corner of VS Code
  2. Select "x86/x64 Assembly" from the list of languages

Highlighted Elements 🎨

This extension provides syntax highlighting for:

  • Instructions (e.g., mov, push, call) 📝
  • Registers (e.g., eax, rbp, r15) 📟
  • Memory operands (e.g., DWORD PTR, QWORD PTR) 📋
  • Numeric constants (decimal and hexadecimal) 🔢
  • Labels and function names 🏷️
  • Assembler directives (e.g., .section, .globl) 🧭
  • CFI directives (e.g., .cfi_startproc, .cfi_endproc) 🛡️
  • Comments (lines starting with ;) 💬

Customization 🎨

Syntax Highlighting Colors

You can customize the colors used for syntax highlighting by modifying your VS Code color theme. Add or modify entries in your settings.json file under "editor.tokenColorCustomizations".

For example:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "keyword.control.instruction.x86asm",
            "settings": {
                "foreground": "#C678DD"
            }
        },
        {
            "scope": "variable.language.register.x86asm",
            "settings": {
                "foreground": "#E06C75"
            }
        }
    ]
}

Comment Characters

You can configure which characters are used for comments to match your assembler. Add these settings to your VS Code settings.json:

{
  "assembly.comments.lineComment": "#",
  "assembly.comments.blockComment": ["/*", "*/"]
}

Common configurations:

  • GNU Assembler (as): Use # for line comments
  • NASM/MASM: Use ; for line comments (default)
  • Custom assemblers: Set to any character or string you prefer

The extension will automatically update comment behavior when you change these settings.

Contributing 🤝

If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License 📄

This extension is released under the MIT License. See the LICENSE file for details.

Acknowledgements 🙌

Thanks to all contributors and users who have provided feedback and suggestions to improve this extension.