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
8 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded
12 elseif exists("b:current_syntax")
17 syn keyword picTodo NOTE TODO XXX contained
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
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*'"
35 syn match picComment ";.*" contains=picTodo
37 syn region picString start=+"+ end=+"+
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
47 syn keyword picRegisterPart IRP RP1 RP0 TO PD Z DC C
50 syn keyword picRegisterPart T0CKI
51 syn match picRegisterPart "RA[0-4]"
54 syn keyword picRegisterPart INT
55 syn match picRegisterPart "RB[0-7]"
58 syn keyword picRegisterPart GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
61 syn keyword picRegisterPart RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
64 syn keyword picRegisterPart EEIF WRERR WREN WR RD
67 syn keyword picRegisterPart GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
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
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"
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")
98 let did_pic16f84_syntax_inits = 1
99 command -nargs=+ HiLink hi link <args>
101 command -nargs=+ HiLink hi def link <args>
105 HiLink picComment Comment
106 HiLink picDirective Statement
107 HiLink picLabel Label
108 HiLink picString String
110 "HiLink picOpcode Keyword
111 "HiLink picRegister Structure
112 "HiLink picRegisterPart Special
114 HiLink picASCII String
115 HiLink picBinary Number
116 HiLink picDecimal Number
117 HiLink picHexadecimal Number
118 HiLink picOctal Number
120 HiLink picIdentifier Identifier
125 let b:current_syntax = "pic"