assembly vim syntax highlighting

The default assembly syntax file didn't work well and searching the web about gas assembly I found nothing about a gas (AT&T) syntax file for vim. Has anyone found this? I can't write my own syntax file. ft=nasm ft=asm(default) ft=tasm


This may get you started. Is that more like what you're looking for?

Just had a quick search - it looks like there are a few different sorts of assembly syntax highlighting built in. Which one are you using?

Copy-pasted from :help syntax

Currently these syntax
files are included:
    asm     GNU assembly (the default)
    asm68k      Motorola 680x0 assembly
    asmh8300    Hitachi H-8300 version of GNU assembly
    ia64        Intel Itanium 64
 fasm Flat assemlby
    masm        Microsoft assembly (probably works for any 80x86)
    nasm        Netwide assembly
    tasm        Turbo Assembly (with opcodes 80x86 up to Pentium, and
    pic     PIC assembly (currently for PIC16F84)

The most flexible is to add a line in your assembly file containing:
Replace "nasm" with the name of the real assembly syntax.  This line must be
one of the first five lines in the file.

This additional syntax script is from

It looks like your screenshot is using the default asm filetype. Try

:set ft=nasm

and you should get some colour changes as per these screenshots.

From your screenshots above I've made a couple of quick modifications to the fasm vim syntax and called it gasm. It can be found here on pastebin.

Copy and paste that into your personal .vim/syntax or vimfiles/syntax directory and call it gasm.vim Then in your assembly file :set ft=gasm

This vim script relies on comments being of the form % comment with the space included. You can see this (or change it if you wish) on line 116 of the script.

Please note: Don't copy the line numbers.

I started to write a complete GNU as syntax from scratch.

The syntax file is available from GNU as syntax for X86 As well as directly on GitHub: GNU as syntax for X86

In addition to the basic instructions it will recognize the following extended Intel / AMD instructions:

  • X86 common instruction set (8086 - 686)
  • Katmai Streaming SIMD instructions (SSE -- a.k.a. KNI, XMM, MMX2)
  • Introduced in Deschutes but necessary for SSE support
  • XSAVE group (AVX and extended state)
  • Generic memory operations
  • New MMX instructions introduced in Katmai
  • AMD Enhanced 3DNow! (Athlon) instructions
  • Willamette SSE2 Cacheability Instructions
  • Willamette MMX instructions (SSE2 SIMD Integer Instructions)
  • Willamette Streaming SIMD instructions (SSE2)
  • Prescott New Instructions (SSE3)
  • VMX Instructions
  • Extended Page Tables VMX instructions
  • Tejas New Instructions (SSSE3)
  • New instructions in Barcelona
  • Penryn New Instructions (SSE4.1)
  • Nehalem New Instructions (SSE4.2)
  • AMD SSE5 instructions
  • Intel SMX
  • Geode (Cyrix) 3DNow! additions
  • Intel AES instructions
  • Intel AVX AES instructions
  • Intel AVX instructions
  • Intel Carry-Less Multiplication instructions (CLMUL)
  • Intel AVX Carry-Less Multiplication instructions (CLMUL)
  • Intel Fused Multiply-Add instructions (FMA)
  • VIA (Centaur) security instructions
  • AMD XOP, FMA4 and CVT16 instructions (SSE5)
  • Systematic names for the hinting nop instructions

Here is how it looks like:

Need Your Help

Which function is called when iPhone app is terminated?

iphone xcode ios5

I'm working on a project in Xcode version 4.2.1 and in iOS 5.0. I'm wondering which function will be called when you completely terminate an application, which means even the time when an users for...

How does music fingerprinting work (for sites such as Shazam and

classification categorization fingerprinting

My large (120gb) music collection contains many duplicate songs, and I've been trying to fingerprint tracks in the hopes of detecting duplicates. And since I'm a CS Major I'm very curious as to wha...