Skip to content

mborik/z80-macroasm-vscode

Repository files navigation

Support for Z80 macro-assemblers in Visual Studio Code

The Z80 Macro-Assembler extension for Visual Studio Code provides the following features inside VS Code:

⚙️ Settings

These few options allows you to configure extension's behavior but primarily your code-formatting preferences and code completion:

  • z80-macroasm.files.exclude - Choose files or directories to exclude (e.g '**/*.{lst}').
  • z80-macroasm.files.include - Files to include and work with. If you, or your macro-assembler using a different conventions of source file extensions then change it here.

    default: "**/*.{a80,asm,inc,s}"

  • z80-macroasm.seekSymbolsThroughWorkspace - If true, extension will crawl through all your workspace files to document all symbols. Otherwise, only includes are taken into account.

    default: false

Formatter:

  • z80-macroasm.format.enabled - Turn on the experimental feature of format on-type or on-save.

    default: false

  • z80-macroasm.format.baseIndent - How many tabstops you prefer before the instructions or keywords.

    default: 2

  • z80-macroasm.format.controlIndent - How many tabstops you prefer before the control structure keywords, selections, modules, or blocks.

    default: 1

  • z80-macroasm.format.whitespaceAfterInstruction - Which type of whitespace you want to put after the instruction - "tab", "single-space" or "auto" which autodetect file's tabstop type and width.

    default: "auto"

  • z80-macroasm.format.spaceAfterArgument - If you want to put a single space character after comma (instruction's argument).

    default: false

  • z80-macroasm.format.spaceAfterInstruction - If you want to put a single space character after instruction (before colon separator).

    default: true

  • z80-macroasm.format.spacesAroundOperators - If you want to wrap an operators with spaces.

    default: false

  • z80-macroasm.format.uppercaseKeywords - If true, uppercase all keywords, instructions and registers. False means all lowercased and "auto" tries to auto-detect your code-style while typing.

    default: "auto"

  • z80-macroasm.format.bracketType - Define which type of brackets around the instruction's arguments (pointers) you prefer: (round) or [square].

    default: "no-change"

  • z80-macroasm.format.colonAfterLabels - Put colon after each label or symbol (true or false, "no-change" keeps it untouched).
  • z80-macroasm.format.hexaNumberStyle - Define which hexadecimal number format you prefer to reformat:
    • "no-change" - no reformat happen (default)
    • "hash": #1fff | #B45D
    • "motorola": $1fff | $B45D
    • "intel": 1fffh | 0B45Dh
    • "intel-uppercase": 1fffH | 0B45DH
    • "c-style": 0x1fff | 0xB45D
  • z80-macroasm.format.hexaNumberCase - When reformatting of hexadecimal numbers was enabled, whether it's to be additional case processing applied when true means uppercased, false lowercased.

    default: "no-change"

  • z80-macroasm.format.suggestOnInstructions - Extension will suggest also basic instruction mnemonics for the auto-completion, not only instruction arguments.

    default: false

  • z80-macroasm.format.splitInstructionsByColon - Split colon separated instructions to lines.

    default: true

These keys/values can be used in your workspace or global settings.json. See example »»

🚨 Problem matchers

There are some predefined problem matchers to handle reported errors from compilation output:

  • errmatcher-as for Macroassembler AS
  • errmatcher-sjasmplus for SjASMPlus
  • errmatcher-sjasm for SjASM
  • errmatcher-pasmo for Pasmo
  • errmatcher-rasm for rasm
  • errmatcher-tniasm and errmatcher-tniasm-preprocessor for tniASM

These values can be used in .vscode/tasks.json of your project's build task. See example »»

💡 IntelliSense showcase

Symbol suggestions:

  • provide symbols or labels
    • in current file in "Go to Symbol in File..." [Ctrl+Shift+O, Cmd+Shift+O]
    • in all includes in "Go to Symbol in Workspace..." [Ctrl+T, Cmd+T]
    • in Outline side-bar

Definitions:

Definitions

  • Generated map of every symbol defined considers also modules or temporal labels:

Peek Definition demo

  • Show symbol's value or specific definiton on hover:

Hover over symbol demo

Completion:

Completion

  • Inteligent completion of directives, pseudo-instructions, Z80 instructions, registers, labels or symbols:

Completion demo

Renaming:

  • Allow to rename labels, local labels, module names or macro indetifiers in InteliSense meaning.

Renaming demo

⌨️ Credits

Martin Bórik is leading the development of this extension with some inspirations from these VS Code extensions:

Contributors:

📋 License

The Z80 Assembly extension is subject to these license terms.

The source code to this extension is available on github and licensed under the MIT license.