2 " Language: PIC16F84 Assembler (Microchip's microcontroller)
3 " Maintainer: Aleksandar Veselinovic <alexa@cliffhanger.com>
4 " Last Change: 2001 May 10
5 " URL: http://SOLAIR.EUnet.yu/~aleksav/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
22 syn match picIdentifier "[a-z_$][a-z0-9_$]*"
23 syn match picLabel "^[A-Z_$][A-Z0-9_$]*"
24 syn match picLabel "^[A-Z_$][A-Z0-9_$]*:"me=e-1
26 syn match picASCII "A\='.'"
27 syn match picBinary "B'[0-1]\+'"
28 syn match picDecimal "D'\d\+'"
29 syn match picDecimal "\d\+"
30 syn match picHexadecimal "0x\x\+"
31 syn match picHexadecimal "H'\x\+'"
32 syn match picHexadecimal "[0-9]\x*h"
33 syn match picOctal "O'[0-7]\o*'"
36 syn match picComment ";.*" contains=picTodo
38 syn region picString start=+"+ end=+"+
40 syn keyword picRegister INDF TMR0 PCL STATUS FSR PORTA PORTB
41 syn keyword picRegister EEDATA EEADR PCLATH INTCON INDF OPTION_REG PCL
42 syn keyword picRegister FSR TRISA TRISB EECON1 EECON2 INTCON OPTION
48 syn keyword picRegisterPart IRP RP1 RP0 TO PD Z DC C
51 syn keyword picRegisterPart T0CKI
52 syn match picRegisterPart "RA[0-4]"
55 syn keyword picRegisterPart INT
56 syn match picRegisterPart "RB[0-7]"
59 syn keyword picRegisterPart GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
62 syn keyword picRegisterPart RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
65 syn keyword picRegisterPart EEIF WRERR WREN WR RD
68 syn keyword picRegisterPart GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
72 syn keyword picOpcode ADDWF ANDWF CLRF CLRW COMF DECF DECFSZ INCF INCFSZ
73 syn keyword picOpcode IORWF MOVF MOVWF NOP RLF RRF SUBWF SWAPF XORWF
74 syn keyword picOpcode BCF BSF BTFSC BTFSS
75 syn keyword picOpcode ADDLW ANDLW CALL CLRWDT GOTO IORLW MOVLW RETFIE
76 syn keyword picOpcode RETLW RETURN SLEEP SUBLW XORLW
77 syn keyword picOpcode GOTO
81 syn keyword picDirective __BADRAM BANKISEL BANKSEL CBLOCK CODE __CONFIG
82 syn keyword picDirective CONSTANT DATA DB DE DT DW ELSE END ENDC
83 syn keyword picDirective ENDIF ENDM ENDW EQU ERROR ERRORLEVEL EXITM EXPAND
84 syn keyword picDirective EXTERN FILL GLOBAL IDATA __IDLOCS IF IFDEF IFNDEF
85 syn keyword picDirective INCLUDE LIST LOCAL MACRO __MAXRAM MESSG NOEXPAND
86 syn keyword picDirective NOLIST ORG PAGE PAGESEL PROCESSOR RADIX RES SET
87 syn keyword picDirective SPACE SUBTITLE TITLE UDATA UDATA_OVR UDATA_SHR
88 syn keyword picDirective VARIABLE WHILE INCLUDE
89 syn match picDirective "#\=UNDEFINE"
90 syn match picDirective "#\=INCLUDE"
91 syn match picDirective "#\=DEFINE"
95 " Define the default highlighting.
96 " For version 5.7 and earlier: only when not done already
97 " For version 5.8 and later: only when an item doesn't have highlighting yet
98 if version >= 508 || !exists("did_pic16f84_syntax_inits")
100 let did_pic16f84_syntax_inits = 1
101 command -nargs=+ HiLink hi link <args>
103 command -nargs=+ HiLink hi def link <args>
107 HiLink picComment Comment
108 HiLink picDirective Statement
109 HiLink picLabel Label
110 HiLink picString String
112 "HiLink picOpcode Keyword
113 "HiLink picRegister Structure
114 "HiLink picRegisterPart Special
116 HiLink picASCII String
117 HiLink picBinary Number
118 HiLink picDecimal Number
119 HiLink picHexadecimal Number
120 HiLink picOctal Number
122 HiLink picIdentifier Identifier
127 let b:current_syntax = "pic"