2 " Language: Hitachi H-8300h specific syntax for GNU Assembler
3 " Maintainer: Kevin Dahlhausen <ap096@po.cwru.edu>
4 " Last Change: 2001 May 09
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
16 syn match asmDirective "\.h8300[h]*"
19 syn match asmReg "e\=r[0-7][lh]\="
21 "h8300[h] opcodes - order is important!
22 syn match asmOpcode "add\.[lbw]"
23 syn match asmOpcode "add[sx :]"
24 syn match asmOpcode "and\.[lbw]"
25 syn match asmOpcode "bl[deots]"
26 syn match asmOpcode "cmp\.[lbw]"
27 syn match asmOpcode "dec\.[lbw]"
28 syn match asmOpcode "divx[us].[bw]"
29 syn match asmOpcode "ext[su]\.[lw]"
30 syn match asmOpcode "inc\.[lw]"
31 syn match asmOpcode "mov\.[lbw]"
32 syn match asmOpcode "mulx[su]\.[bw]"
33 syn match asmOpcode "neg\.[lbw]"
34 syn match asmOpcode "not\.[lbw]"
35 syn match asmOpcode "or\.[lbw]"
36 syn match asmOpcode "pop\.[wl]"
37 syn match asmOpcode "push\.[wl]"
38 syn match asmOpcode "rotx\=[lr]\.[lbw]"
39 syn match asmOpcode "sha[lr]\.[lbw]"
40 syn match asmOpcode "shl[lr]\.[lbw]"
41 syn match asmOpcode "sub\.[lbw]"
42 syn match asmOpcode "xor\.[lbw]"
43 syn keyword asmOpcode "andc" "band" "bcc" "bclr" "bcs" "beq" "bf" "bge" "bgt"
44 syn keyword asmOpcode "bhi" "bhs" "biand" "bild" "bior" "bist" "bixor" "bmi"
45 syn keyword asmOpcode "bne" "bnot" "bnp" "bor" "bpl" "bpt" "bra" "brn" "bset"
46 syn keyword asmOpcode "bsr" "btst" "bst" "bt" "bvc" "bvs" "bxor" "cmp" "daa"
47 syn keyword asmOpcode "das" "eepmov" "eepmovw" "inc" "jmp" "jsr" "ldc" "movfpe"
48 syn keyword asmOpcode "movtpe" "mov" "nop" "orc" "rte" "rts" "sleep" "stc"
49 syn keyword asmOpcode "sub" "trapa" "xorc"
54 " Read the general asm syntax
56 source <sfile>:p:h/asm.vim
58 runtime! syntax/asm.vim
62 " Define the default highlighting.
63 " For version 5.7 and earlier: only when not done already
64 " For version 5.8 and later: only when an item doesn't have highlighting yet
65 if version >= 508 || !exists("did_hitachi_syntax_inits")
67 let did_hitachi_syntax_inits = 1
68 command -nargs=+ HiLink hi link <args>
70 command -nargs=+ HiLink hi def link <args>
73 HiLink asmOpcode Statement
74 HiLink asmRegister Identifier
76 " My default-color overrides:
77 "hi asmOpcode ctermfg=yellow
78 "hi asmReg ctermfg=lightmagenta
83 let b:current_syntax = "asmh8300"