1" Vim syntax file
2" Language:	Hitachi H-8300h specific syntax for GNU Assembler
3" Maintainer:	Kevin Dahlhausen <kdahlhaus@yahoo.com>
4" Last Change:	2002 Sep 19
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9  syntax clear
10elseif exists("b:current_syntax")
11  finish
12endif
13
14syn case ignore
15
16syn match asmDirective "\.h8300[h]*"
17
18"h8300[h] registers
19syn match asmReg	"e\=r[0-7][lh]\="
20
21"h8300[h] opcodes - order is important!
22syn match asmOpcode "add\.[lbw]"
23syn match asmOpcode "add[sx :]"
24syn match asmOpcode "and\.[lbw]"
25syn match asmOpcode "bl[deots]"
26syn match asmOpcode "cmp\.[lbw]"
27syn match asmOpcode "dec\.[lbw]"
28syn match asmOpcode "divx[us].[bw]"
29syn match asmOpcode "ext[su]\.[lw]"
30syn match asmOpcode "inc\.[lw]"
31syn match asmOpcode "mov\.[lbw]"
32syn match asmOpcode "mulx[su]\.[bw]"
33syn match asmOpcode "neg\.[lbw]"
34syn match asmOpcode "not\.[lbw]"
35syn match asmOpcode "or\.[lbw]"
36syn match asmOpcode "pop\.[wl]"
37syn match asmOpcode "push\.[wl]"
38syn match asmOpcode "rotx\=[lr]\.[lbw]"
39syn match asmOpcode "sha[lr]\.[lbw]"
40syn match asmOpcode "shl[lr]\.[lbw]"
41syn match asmOpcode "sub\.[lbw]"
42syn match asmOpcode "xor\.[lbw]"
43syn keyword asmOpcode "andc" "band" "bcc" "bclr" "bcs" "beq" "bf" "bge" "bgt"
44syn keyword asmOpcode "bhi" "bhs" "biand" "bild" "bior" "bist" "bixor" "bmi"
45syn keyword asmOpcode "bne" "bnot" "bnp" "bor" "bpl" "bpt" "bra" "brn" "bset"
46syn keyword asmOpcode "bsr" "btst" "bst" "bt" "bvc" "bvs" "bxor" "cmp" "daa"
47syn keyword asmOpcode "das" "eepmov" "eepmovw" "inc" "jmp" "jsr" "ldc" "movfpe"
48syn keyword asmOpcode "movtpe" "mov" "nop" "orc" "rte" "rts" "sleep" "stc"
49syn keyword asmOpcode "sub" "trapa" "xorc"
50
51syn case match
52
53
54" Read the general asm syntax
55if version < 600
56  source <sfile>:p:h/asm.vim
57else
58  runtime! syntax/asm.vim
59endif
60
61
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
65if version >= 508 || !exists("did_hitachi_syntax_inits")
66  if version < 508
67    let did_hitachi_syntax_inits = 1
68    command -nargs=+ HiLink hi link <args>
69  else
70    command -nargs=+ HiLink hi def link <args>
71  endif
72
73  HiLink asmOpcode  Statement
74  HiLink asmRegister  Identifier
75
76  " My default-color overrides:
77  "hi asmOpcode ctermfg=yellow
78  "hi asmReg	ctermfg=lightmagenta
79
80  delcommand HiLink
81endif
82
83let b:current_syntax = "asmh8300"
84
85" vim: ts=8
86