Last active
July 1, 2016 17:55
-
-
Save ekaitz-zarraga/80483b48817a877ea18f9a55ebb1061f to your computer and use it in GitHub Desktop.
Vim highlighting for PIC18FXXXX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" PIC18FXXXX ASSEMBLY HIGHLIGHTING FOR VIM | |
" TODO: | |
" * CHECK THE FILETYPE search line and get the type | |
" => PROCESSOR 18FXXXX | |
" => LIST p=?? | |
if exists("b:current_syntax") | |
finish | |
endif | |
" MPASM doesnt care about case | |
syntax case ignore | |
" LABELS | |
" ============================================================================== | |
syntax match Pic18Flabel "^\S*:" | |
" COMMANDS | |
" ============================================================================== | |
" Byte oriented File register operations | |
syntax keyword Pic18Fcommand ADDWF | |
syntax keyword Pic18Fcommand ADDWFC | |
syntax keyword Pic18Fcommand ANDWF | |
syntax keyword Pic18Fcommand CLRF | |
syntax keyword Pic18Fcommand COMF | |
syntax keyword Pic18Fcommand CPFSEQ | |
syntax keyword Pic18Fcommand CPFSGT | |
syntax keyword Pic18Fcommand CPFSLT | |
syntax keyword Pic18Fcommand DECF | |
syntax keyword Pic18Fcommand DECFSZ | |
syntax keyword Pic18Fcommand DCFSNZ | |
syntax keyword Pic18Fcommand INCF | |
syntax keyword Pic18Fcommand INCFSZ | |
syntax keyword Pic18Fcommand INFSNZ | |
syntax keyword Pic18Fcommand IORWF | |
syntax keyword Pic18Fcommand MOVF | |
syntax keyword Pic18Fcommand MOVFF | |
syntax keyword Pic18Fcommand MOVWF | |
syntax keyword Pic18Fcommand MULWF | |
syntax keyword Pic18Fcommand NEGF | |
syntax keyword Pic18Fcommand RLCF | |
syntax keyword Pic18Fcommand RLNCF | |
syntax keyword Pic18Fcommand RRCF | |
syntax keyword Pic18Fcommand RRNCF | |
syntax keyword Pic18Fcommand SETF | |
syntax keyword Pic18Fcommand SUBFWB | |
syntax keyword Pic18Fcommand SUBWF | |
syntax keyword Pic18Fcommand SUBWFB | |
syntax keyword Pic18Fcommand SWAPF | |
syntax keyword Pic18Fcommand TSTFSZ | |
syntax keyword Pic18Fcommand XORWF | |
" Bit oriented File register operations | |
syntax keyword Pic18Fcommand BCF | |
syntax keyword Pic18Fcommand BSF | |
syntax keyword Pic18Fcommand BTFSC | |
syntax keyword Pic18Fcommand BTFSS | |
syntax keyword Pic18Fcommand BTG | |
" Control operations | |
syntax keyword Pic18Fcommand BC | |
syntax keyword Pic18Fcommand BN | |
syntax keyword Pic18Fcommand BNC | |
syntax keyword Pic18Fcommand BNN | |
syntax keyword Pic18Fcommand BNOV | |
syntax keyword Pic18Fcommand BNZ | |
syntax keyword Pic18Fcommand BOV | |
syntax keyword Pic18Fcommand BRA | |
syntax keyword Pic18Fcommand BZ | |
syntax keyword Pic18Fcommand CALL | |
syntax keyword Pic18Fcommand CLRWDT | |
syntax keyword Pic18Fcommand DAW | |
syntax keyword Pic18Fcommand GOTO | |
syntax keyword Pic18Fcommand NOP | |
syntax keyword Pic18Fcommand POP | |
syntax keyword Pic18Fcommand PUSH | |
syntax keyword Pic18Fcommand RCALL | |
syntax keyword Pic18Fcommand RESET | |
syntax keyword Pic18Fcommand RETFIE | |
syntax keyword Pic18Fcommand RETLW | |
syntax keyword Pic18Fcommand RETURN | |
syntax keyword Pic18Fcommand SLEEP | |
" Literal operations | |
syntax keyword Pic18Fcommand ADDLW | |
syntax keyword Pic18Fcommand ANDLW | |
syntax keyword Pic18Fcommand IORLW | |
syntax keyword Pic18Fcommand LFSR | |
syntax keyword Pic18Fcommand MOVLB | |
syntax keyword Pic18Fcommand MOVLW | |
syntax keyword Pic18Fcommand MULLW | |
syntax keyword Pic18Fcommand RETLW | |
syntax keyword Pic18Fcommand SUBLW | |
syntax keyword Pic18Fcommand XORLW | |
" Data memory and program memory operations | |
syntax keyword Pic18Fcommand TBLRD | |
syntax keyword Pic18Fcommand TBLWT | |
" TODOs | |
" ============================================================================== | |
syntax keyword Pic18Ftodo TODO FIXME NOTE contained | |
" DIRECTIVES | |
" ============================================================================== | |
syntax keyword Pic18Fdirective CBANK | |
syntax keyword Pic18Fdirective CBLOCK | |
syntax keyword Pic18Fdirective CONSTANT | |
syntax keyword Pic18Fdirective DATA | |
syntax keyword Pic18Fdirective DB | |
syntax keyword Pic18Fdirective #DEFINE | |
syntax keyword Pic18Fdirective DW | |
syntax keyword Pic18Fdirective ELSE | |
syntax keyword Pic18Fdirective END | |
syntax keyword Pic18Fdirective ENDC | |
syntax keyword Pic18Fdirective ENDIF | |
syntax keyword Pic18Fdirective ENDM | |
syntax keyword Pic18Fdirective ENDW | |
syntax keyword Pic18Fdirective EQU | |
syntax keyword Pic18Fdirective ERROR | |
syntax keyword Pic18Fdirective EXITM | |
syntax keyword Pic18Fdirective EXPAND | |
syntax keyword Pic18Fdirective FILL | |
syntax keyword Pic18Fdirective IF | |
syntax keyword Pic18Fdirective IFDEF | |
syntax keyword Pic18Fdirective IFNDEF | |
syntax keyword Pic18Fdirective INCLUDE | |
syntax keyword Pic18Fdirective LIST | |
syntax keyword Pic18Fdirective LOCAL | |
syntax keyword Pic18Fdirective MACRO | |
syntax keyword Pic18Fdirective MESSG | |
syntax keyword Pic18Fdirective NOEXPAND | |
syntax keyword Pic18Fdirective NOLIST | |
syntax keyword Pic18Fdirective ORG | |
syntax keyword Pic18Fdirective PAGE | |
syntax keyword Pic18Fdirective PROCESSOR | |
syntax keyword Pic18Fdirective RADIX | |
syntax keyword Pic18Fdirective RES | |
syntax keyword Pic18Fdirective SET | |
syntax keyword Pic18Fdirective SPACE | |
syntax keyword Pic18Fdirective SUBTITLE | |
syntax keyword Pic18Fdirective TITLE | |
syntax keyword Pic18Fdirective #UNDEFINE | |
syntax keyword Pic18Fdirective VARIABLE | |
syntax keyword Pic18Fdirective WHILE | |
" LITERALS | |
" ============================================================================== | |
syntax match Pic18Fliteral "B'[0-1]*'" | |
syntax match Pic18Fliteral "O'[0-7]*'" | |
syntax match Pic18Fliteral "D'[0-9]*'" | |
syntax match Pic18Fliteral "H'[0-F]*'" | |
syntax match Pic18Fliteral "0x[0-F]*" | |
" COMMENTS | |
" ============================================================================== | |
syntax region Pic18Fcomment start=";" end="$" contains=Pic18Ftodo | |
" MATCH HIGHLIGHTING | |
" ============================================================================== | |
highlight link Pic18Fcommand Function | |
highlight link Pic18Fcomment Comment | |
highlight link Pic18Ftodo Todo | |
highlight link Pic18Fdirective Keyword | |
highlight link Pic18Flabel Special | |
highlight link Pic18Fliteral Constant | |
let b:current_syntax = "pic18fXXXX" | |
" Comments | |
set commentstring=;\ %s | |
setlocal fo+=cro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment