mbigras
mbigras

Reputation: 8055

How to enable NASM syntax highlighting in emacs?

I'm using the nasm assembler and writing code in intel syntax and want to turn on syntax highlighting permanently. How can I do this?

I'm using OSX 10.8.5 and emacs 23.9.

I've tried following this tutorial and added the following to my ~/.emacs file:

(autoload 'nasm-mode "~/.emacs.d/nasm-mode.el" "" t)
(add-to-list 'auto-mode-alist '("\\.\\(asm\\|s\\)$" . nasm-mode))

But I'm still not able to get syntax highlighting.

Upvotes: 1

Views: 1558

Answers (1)

juanleon
juanleon

Reputation: 9390

Since the extension you are using is .nasm, you need to add this line also:

(add-to-list 'auto-mode-alist '("\\.nasm\\'" . nasm-mode))

The tutorial does not work for you because it assumes the extensions ".s" and ".asm". With the line above, the extension ".nasm" is also considered.

Upvotes: 3

Related Questions