home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim54rt.sit / runtime / syntax / z8a.vim < prev    next >
Encoding:
Text File  |  1999-08-14  |  2.8 KB  |  101 lines  |  [TEXT/ALFA]

  1. " Vim syntax file
  2. " Language:    Z80 assembler asz80
  3. " Maintainer:    Milan Pikula <www@fornax.elf.stuba.sk>
  4. " Last change:    1999 January 7
  5.  
  6. " Remove any old syntax
  7. syn clear
  8. syn case ignore
  9.  
  10. " Common Z80 Assembly instructions
  11. syn keyword z8aInstruction adc add and bit ccf cp cpd cpdr cpi cpir cpl
  12. syn keyword z8aInstruction daa di djnz ei exx halt im in
  13. syn keyword z8aInstruction ind ini indr inir jp jr ld ldd lddr ldi ldir
  14. syn keyword z8aInstruction neg nop or otdr otir out outd outi
  15. syn keyword z8aInstruction res rl rla rlc rlca rld
  16. syn keyword z8aInstruction rr rra rrc rrca rrd sbc scf set sla sra
  17. syn keyword z8aInstruction srl sub xor
  18. " syn keyword z8aInstruction push pop call ret reti retn inc dec ex rst
  19.  
  20. " Any other stuff
  21. syn match z8aIdentifier        "[a-z_][a-z0-9_]*"
  22.  
  23. " Instructions changing stack
  24. syn keyword z8aSpecInst push pop call ret reti retn rst
  25. syn match z8aInstruction "\<inc\>"
  26. syn match z8aInstruction "\<dec\>"
  27. syn match z8aInstruction "\<ex\>"
  28. syn match z8aSpecInst "\<inc\s\+sp\>"me=s+3
  29. syn match z8aSpecInst "\<dec\s\+sp\>"me=s+3
  30. syn match z8aSpecInst "\<ex\s\+(\s*sp\s*)\s*,\s*hl\>"me=s+2
  31.  
  32. "Labels
  33. syn match z8aLabel        "[a-z_][a-z0-9_]*:"
  34. syn match z8aSpecialLabel    "[a-z_][a-z0-9_]*::"
  35.  
  36. " PreProcessor commands
  37. syn match z8aPreProc    "\.org"
  38. syn match z8aPreProc    "\.globl"
  39. syn match z8aPreProc    "\.db"
  40. syn match z8aPreProc    "\.dw"
  41. syn match z8aPreProc    "\.ds"
  42. syn match z8aPreProc    "\.byte"
  43. syn match z8aPreProc    "\.word"
  44. syn match z8aPreProc    "\.blkb"
  45. syn match z8aPreProc    "\.blkw"
  46. syn match z8aPreProc    "\.ascii"
  47. syn match z8aPreProc    "\.asciz"
  48. syn match z8aPreProc    "\.module"
  49. syn match z8aPreProc    "\.title"
  50. syn match z8aPreProc    "\.sbttl"
  51. syn match z8aPreProc    "\.even"
  52. syn match z8aPreProc    "\.odd"
  53. syn match z8aPreProc    "\.area"
  54. syn match z8aPreProc    "\.page"
  55. syn match z8aPreProc    "\.setdp"
  56. syn match z8aPreProc    "\.radix"
  57. syn match z8aInclude    "\.include"
  58. syn match z8aPreCondit    "\.if"
  59. syn match z8aPreCondit    "\.else"
  60. syn match z8aPreCondit    "\.endif"
  61.  
  62. " Common strings
  63. syn match z8aString        "\".*\""
  64. syn match z8aString        "\'.*\'"
  65.  
  66. " Numbers
  67. syn match z8aNumber             "[0-9]\+"
  68. syn match z8aNumber             "0[xXhH][0-9a-fA-F]\+"
  69. syn match z8aNumber             "0[bB][0-1]*"
  70. syn match z8aNumber             "0[oO\@qQ][0-7]\+"
  71. syn match z8aNumber             "0[dD][0-9]\+"
  72.  
  73. " Character constant
  74. syn match z8aString             "\#\'."hs=s+1
  75.  
  76. " Comments
  77. syn match z8aComment        ";.*"
  78.  
  79. syn case match
  80.  
  81. if !exists("did_z8a_syntax_inits")
  82.   let did_z8a_syntax_inits = 1
  83.  
  84.   " The default methods for highlighting
  85.   hi link z8aSection        Special
  86.   hi link z8aLabel        Label
  87.   hi link z8aSpecialLabel    Label
  88.   hi link z8aComment        Comment
  89.   hi link z8aInstruction    Statement
  90.   hi link z8aSpecInst        Statement
  91.   hi link z8aInclude        Include
  92.   hi link z8aPreCondit        PreCondit
  93.   hi link z8aPreProc        PreProc
  94.   hi link z8aNumber        Number
  95.   hi link z8aString        String
  96.  
  97. endif
  98.  
  99. let b:current_syntax = "z8a"
  100. " vim: ts=8
  101.