views:

1898

answers:

3
+5  A: 
Andy
:set ft=nasm wouldn't work,same is true for masm,tasm etc.So does the script from official vim site.but thanks anyway.
yfel
Are there any messages or reasons why it isn't working.I've used your code above with nasm, tasm etc and they do change the colour highlighting. I'll attach screenshots shortly.Can you provide any more information?
Andy
i've post my screenshots after changing filetypes,as you see,it's messed up.I'm using ArchLinux,Terminator terminal,running dwm window manager,with the latest vim(7.2).
yfel
Ahh, I think I get what you're after now. Try the above.
Andy
thanks almost done!only a little draw back though, movl,addl not highlighted, mov,add got highlighted.
yfel
I've updated the pastebin script and added addl and movl. Check lines 23 and 63 respectively.
Andy
thanks!!works!!
yfel
You're most welcome.Have a little look at the vimscript in vim as well - you'll see how easy it is to add new keywords and things.
Andy
A: 

Thanks so much for the gasm syntax file! Just came across this myself.

No problem. Feel free to expand on it on pastebin and post a comment and I can update the link in the post above to keep it up to date.
Andy
A: 

Hi,
I know this question is answered already but I'm posting this here so other people may find it.
Reading your questions (and the answers to it) left me with a so-so working highlighting.
Since this did not satisfy me I started to write a complete GNU as syntax from scratch.

The syntax file is available from vim.org: 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)
  • AMD SSE4A
  • 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:

alt text

Happy coding ;)

Shirkrin