This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/asm
2021-03-25 22:59:32 -04:00
..
img asm: clean up and tweaks 2016-01-11 22:58:57 -05:00
config.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
funcs.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
packages.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
README.org Switch to the new layers generator 2019-05-15 21:08:21 +03:00

asm layer

/TakeV/spacemacs/media/commit/af193f769f52edd611b6cd805630bd4bd025fb0f/layers/+lang/asm/img/asm.png

Description

This layer adds support for Assembly code. The built-in major mode for editing assembly code in Emacs is asm-mode.

The layer also adds nasm-mode for NASM-specific syntax. Although nasm-mode is intended for NASM, it actually works well with other variants of Assembly in general, and provides Imenu integration so you can jump around with SPC s j.

Features:

  • Improved syntax highlighting.
  • Automatic indentation.
  • Auto-completion for symbol in opened buffers.
  • Look up documentation for current instruction at cursor.
  • Imenu integration.

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add asm to the existing dotspacemacs-configuration-layers list in this file.

PDFs

To look up the x86 instructions, two things are required:

Then, set x86-lookup-pdf to the location of your PDF document (Tip: If you use Helm as your completion of choice, you can use SPC f f to navigate to the file, and press C-c i to insert the path). For example, something like this:

  (setq x86-lookup-pdf "~/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf")

The first time you launch the command, it can take a while for indexing, this is a one time operation and the result is cached for later use.

Key bindings

Key binding Description
SPC m h h Look up the documentation for instruction at point
; Insert a comment

Note: Quoted from the docstring of asm-comment, the command bound to ;:

  Convert an empty comment to a `larger' kind, or start a new one.
  These are the known comment classes:

     1 -- comment to the right of the code (at the comment-column)
     2 -- comment on its own line, indented like code
     3 -- comment on its own line, beginning at the left-most column.

  Suggested usage:  while writing your code, trigger asm-comment
  repeatedly until you are satisfied with the kind of comment.