home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / nasm.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  4.7 KB  |  111 lines

  1. " Vim syntax file
  2. " Language:    NASM: The Netwide Assembler (v0.97)
  3. " Maintainer:    C. Laurence Gonsalves <clgonsal@kami.com>
  4. " Last change:    1998 July 12
  5. " URL:        http://www.cryogen.com/clgonsal/vim/syntax/nasm.vim
  6. " NASM's home:    http://www.cryogen.com/Nasm
  7.  
  8. " Remove any old syntax stuff hanging around
  9. syn clear
  10. syn case ignore
  11.  
  12. syn match nasmPreProc        "^[     ]*%[^;]*"
  13.  
  14. syn keyword nasmOperator    SEG WRT INCBIN EQU TIMES FAR SHORT
  15. syn keyword nasmOperator    BYTE WORD DWORD NOSPLIT
  16.  
  17. syn keyword nasmDirective    BITS SECTION SEGMENT ABSOLUTE ORG EXTERN 
  18. syn keyword nasmDirective    STRUC ENDSTRUC COMMON GLOBAL GROUP
  19.  
  20. syn keyword nasmStorage        DB DW DD DQ DT RESB RESW RESD RESQ REST
  21.  
  22. syn match nasmLabel        "[?.a-z_][a-z0-9_$?.@#~]*"
  23.  
  24. syn match nasmRegister        "\<[ABCD][LH]\>"
  25. syn match nasmRegister        "\<E\=\([ABCD]X\|[SD]I\|[BS]P\)\>"
  26. syn match nasmRegister        "\<[C-GS]S\>"
  27.  
  28. syn match nasmDecNumber        "[0-9]\+"
  29. syn match nasmOctNumber        "[0-7]\+Q"
  30. syn match nasmBinNumber        "[0-1]\+B"
  31. syn match nasmHexNumber        "[0-9][0-9a-fA-F]\+H"
  32. syn match nasmHexNumber        "0[xX][0-9a-fA-F]\+"
  33. syn match nasmHexNumber        "\$[0-9][0-9a-fA-F]*"
  34.  
  35. syn match nasmComment        ";.*$"
  36.  
  37. syn match nasmString        "'[^']\+'"
  38.  
  39.  
  40. " instructions that take cc's
  41. syn match nasmInstruction "\<\(CMOV\|FCMOV\|J\|PMVZB\|SET\)\(A\|AE\|B\|BE\|E\|G\|GE\|L\|LE\|NA\|NAE\|NB\|NBE\|NE\|NG\|NGE\|NL\|NLE\|NO\|NP\|NS\|NZ\|O\|P\|PE\|PO\|S\|Z\)\>"
  42.  
  43. " other instructions
  44. syn keyword nasmInstruction AAA AAD AAM AAS ADC ADD AND ARPL BOUND BSF BSR
  45. syn keyword nasmInstruction BSWAP BT BTC BTR BTS CALL CBW CDQ CLC CLD CLI
  46. syn keyword nasmInstruction CLTS CMC CMP CMPSB CMPSD CMPSW CMPXCHG
  47. syn keyword nasmInstruction CMPXCHG486 CMPXCHG8B CPUID CWD CWDE DAA DAS DEC
  48. syn keyword nasmInstruction DIV EMMS ENTER F2XM1 FABS FADD FADDP FBLD FBSTP
  49. syn keyword nasmInstruction FCHS FCLEX FCOM FCOMI FCOMIP FCOMP FCOMPP FCOS
  50. syn keyword nasmInstruction FDECSTP FDISI FDIV FDIVP FDIVR FDIVRP FENI
  51. syn keyword nasmInstruction FFREE FIADD FICOM FICOMP FIDIV FIDIVR FILD
  52. syn keyword nasmInstruction FIMUL FINCSTP FINIT FIST FISTP FISUB FLD FLD1
  53. syn keyword nasmInstruction FLDCW FLDENV FLDL2E FLDL2T FLDLG2 FLDLN2 FLDPI
  54. syn keyword nasmInstruction FLDZ FMUL FMULP FNCLEX FNDISI FNENI FNINIT FNOP
  55. syn keyword nasmInstruction FPATAN FPREM FPREM1 FPTAN FRNDINT FRSTOR FSAVE
  56. syn keyword nasmInstruction FSCALE FSETPM FSIN FSINCOS FSQRT FST FSTCW
  57. syn keyword nasmInstruction FSTENV FSTP FSTSW FSUB FSUBP FSUBR FSUBRP FTST
  58. syn keyword nasmInstruction FUCOM FUCOMI FUCOMIP FUCOMP FUCOMPP FXAM FXCH
  59. syn keyword nasmInstruction FXTRACT FYL2X FYL2XP1 HLT IBTS ICEBP IDIV IMUL
  60. syn keyword nasmInstruction IN INC INSB INSD INSW INT INT01 INT1 INT3 INTO
  61. syn keyword nasmInstruction INVD INVLPG IRET IRETD IRETW JCXZ JECXZ JMP
  62. syn keyword nasmInstruction LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT
  63. syn keyword nasmInstruction LLDT LMSW LOADALL LOADALL286 LODSB LODSD LODSW
  64. syn keyword nasmInstruction LOOP LOOPE LOOPNE LOOPNZ LOOPZ LSL LSS LTR MOV
  65. syn keyword nasmInstruction MOVD MOVQ MOVSB MOVSD MOVSW MOVSX MOVZX MUL NEG
  66. syn keyword nasmInstruction NOP NOT OR OUT OUTSB OUTSD OUTSW PACKSSDW
  67. syn keyword nasmInstruction PACKSSWB PACKUSWB PADDB PADDD PADDSB PADDSIW
  68. syn keyword nasmInstruction PADDSW PADDUSB PADDUSW PADDW PAND PANDN PAVEB
  69. syn keyword nasmInstruction PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD PCMPGTW
  70. syn keyword nasmInstruction PDISTIB PMACHRIW PMADDWD PMAGW PMULHRIW PMULHRW
  71. syn keyword nasmInstruction PMULHW PMULLW POP POPA POPAD POPAW POPF POPFD
  72. syn keyword nasmInstruction POPFW POR PSLLD PSLLQ PSLLW PSRAD PSRAW PSRLD
  73. syn keyword nasmInstruction PSRLQ PSRLW PSUBB PSUBD PSUBSB PSUBSIW PSUBSW
  74. syn keyword nasmInstruction PSUBUSB PSUBUSW PSUBW PUNPCKHBW PUNPCKHDQ
  75. syn keyword nasmInstruction PUNPCKHWD PUNPCKLBW PUNPCKLDQ PUNPCKLWD PUSH
  76. syn keyword nasmInstruction PUSHA PUSHAD PUSHAW PUSHF PUSHFD PUSHFW PXOR
  77. syn keyword nasmInstruction RCL RCR RDMSR RDPMC RDTSC RET RETF RETN ROL ROR
  78. syn keyword nasmInstruction RSM SAHF SAL SALC SAR SBB SCASB SCASD SCASW
  79. syn keyword nasmInstruction SGDT SHL SHLD SHR SHRD SIDT SLDT SMI SMSW STC
  80. syn keyword nasmInstruction STD STI STOSB STOSD STOSW STR SUB TEST UMOV
  81. syn keyword nasmInstruction VERR VERW WAIT WBINVD WRMSR XADD XBTS XCHG
  82. syn keyword nasmInstruction XLATB XOR
  83.  
  84. if !exists("did_nasm_syntax_inits")
  85.     let did_nasm_syntax_inits = 1
  86.  
  87.     hi link nasmLabel        Label
  88.     hi link nasmComment        Comment
  89.     hi link nasmInstruction    Statement
  90.     hi link nasmDirective    Operator
  91.     hi link nasmOperator    Operator
  92.  
  93.     hi link nasmString        String
  94.  
  95.     hi link nasmRegister    Function
  96.  
  97.     hi link nasmInclude        Include
  98.     hi link nasmCond        PreCondit
  99.     hi link nasmMacro        Macro
  100.  
  101.     hi link nasmHexNumber    Number
  102.     hi link nasmDecNumber    Number
  103.     hi link nasmOctNumber    Number
  104.     hi link nasmBinNumber    Number
  105.  
  106.     hi link nasmPreProc        PreProc
  107. endif
  108.  
  109. let b:current_syntax = "nasm"
  110.  
  111.