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 / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / syntax / pic.vim < prev    next >
Encoding:
Text File  |  2003-05-11  |  3.6 KB  |  128 lines

  1. " Vim syntax file
  2. " Language:     PIC16F84 Assembler (Microchip's microcontroller)
  3. " Maintainer:   Aleksandar Veselinovic <aleksa@cs.cmu.com>
  4. " Last Change:  2003 May 11
  5. " URL:        http://galeb.etf.bg.ac.yu/~alexa/vim/syntax/pic.vim
  6. " Revision:     1.01
  7.  
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if version < 600
  11.   syntax clear
  12. elseif exists("b:current_syntax")
  13.   finish
  14. endif
  15.  
  16. syn case match
  17. syn keyword picTodo NOTE TODO XXX contained
  18.  
  19. syn case ignore
  20.  
  21. syn match picIdentifier "[a-z_$][a-z0-9_$]*"
  22. syn match picLabel      "^[A-Z_$][A-Z0-9_$]*"
  23. syn match picLabel      "^[A-Z_$][A-Z0-9_$]*:"me=e-1
  24.  
  25. syn match picASCII      "A\='.'"
  26. syn match picBinary     "B'[0-1]\+'"
  27. syn match picDecimal    "D'\d\+'"
  28. syn match picDecimal    "\d\+"
  29. syn match picHexadecimal "0x\x\+"
  30. syn match picHexadecimal "H'\x\+'"
  31. syn match picHexadecimal "[0-9]\x*h"
  32. syn match picOctal      "O'[0-7]\o*'"
  33.  
  34.  
  35. syn match picComment    ";.*" contains=picTodo
  36.  
  37. syn region picString    start=+"+ end=+"+
  38.  
  39. syn keyword picRegister        INDF TMR0 PCL STATUS FSR PORTA PORTB
  40. syn keyword picRegister        EEDATA EEADR PCLATH INTCON INDF OPTION_REG PCL
  41. syn keyword picRegister        FSR TRISA TRISB EECON1 EECON2 INTCON OPTION
  42.  
  43.  
  44. " Register --- bits
  45.  
  46. " STATUS
  47. syn keyword picRegisterPart     IRP RP1 RP0 TO PD Z DC C
  48.  
  49. " PORTA
  50. syn keyword picRegisterPart     T0CKI
  51. syn match   picRegisterPart     "RA[0-4]"
  52.  
  53. " PORTB
  54. syn keyword picRegisterPart     INT
  55. syn match   picRegisterPart     "RB[0-7]"
  56.  
  57. " INTCON
  58. syn keyword picRegisterPart     GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
  59.  
  60. " OPTION
  61. syn keyword picRegisterPart     RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
  62.  
  63. " EECON2
  64. syn keyword picRegisterPart     EEIF WRERR WREN WR RD
  65.  
  66. " INTCON
  67. syn keyword picRegisterPart     GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
  68.  
  69.  
  70. " OpCodes...
  71. syn keyword picOpcode  ADDWF ANDWF CLRF CLRW COMF DECF DECFSZ INCF INCFSZ
  72. syn keyword picOpcode  IORWF MOVF MOVWF NOP RLF RRF SUBWF SWAPF XORWF
  73. syn keyword picOpcode  BCF BSF BTFSC BTFSS
  74. syn keyword picOpcode  ADDLW ANDLW CALL CLRWDT GOTO IORLW MOVLW RETFIE
  75. syn keyword picOpcode  RETLW RETURN SLEEP SUBLW XORLW
  76. syn keyword picOpcode  GOTO
  77.  
  78.  
  79. " Directives
  80. syn keyword picDirective __BADRAM BANKISEL BANKSEL CBLOCK CODE __CONFIG
  81. syn keyword picDirective CONSTANT DATA DB DE DT DW ELSE END ENDC
  82. syn keyword picDirective ENDIF ENDM ENDW EQU ERROR ERRORLEVEL EXITM EXPAND
  83. syn keyword picDirective EXTERN FILL GLOBAL IDATA __IDLOCS IF IFDEF IFNDEF
  84. syn keyword picDirective INCLUDE LIST LOCAL MACRO __MAXRAM MESSG NOEXPAND
  85. syn keyword picDirective NOLIST ORG PAGE PAGESEL PROCESSOR RADIX RES SET
  86. syn keyword picDirective SPACE SUBTITLE TITLE UDATA UDATA_OVR UDATA_SHR
  87. syn keyword picDirective VARIABLE WHILE INCLUDE
  88. syn match picDirective   "#\=UNDEFINE"
  89. syn match picDirective   "#\=INCLUDE"
  90. syn match picDirective   "#\=DEFINE"
  91.  
  92.  
  93. " Define the default highlighting.
  94. " For version 5.7 and earlier: only when not done already
  95. " For version 5.8 and later: only when an item doesn't have highlighting yet
  96. if version >= 508 || !exists("did_pic16f84_syntax_inits")
  97.   if version < 508
  98.     let did_pic16f84_syntax_inits = 1
  99.     command -nargs=+ HiLink hi link <args>
  100.   else
  101.     command -nargs=+ HiLink hi def link <args>
  102.   endif
  103.  
  104.   HiLink picTodo        Todo
  105.   HiLink picComment        Comment
  106.   HiLink picDirective        Statement
  107.   HiLink picLabel        Label
  108.   HiLink picString        String
  109.  
  110.  "HiLink picOpcode        Keyword
  111.  "HiLink picRegister        Structure
  112.  "HiLink picRegisterPart    Special
  113.  
  114.   HiLink picASCII        String
  115.   HiLink picBinary        Number
  116.   HiLink picDecimal        Number
  117.   HiLink picHexadecimal        Number
  118.   HiLink picOctal        Number
  119.  
  120.   HiLink picIdentifier        Identifier
  121.  
  122.   delcommand HiLink
  123. endif
  124.  
  125. let b:current_syntax = "pic"
  126.  
  127. " vim: ts=8
  128.