" Vim syntax file
" Language:	Hitachi H-8300h specific syntax for GNU Assembler
" Maintainer:	Kevin Dahlhausen <ap096@po.cwru.edu>
" Last change:	1997 April 20

" Remove any old syntax stuff hanging around
syntax clear

syntax case ignore

syntax match asmDirective "\.h8300[h]*"

"h8300[h] registers
syntax match asmReg	"e\=r[0-7][lh]\="

"h8300[h] opcodes - order is important!
syntax match asmOpcode "add\.[lbw]"
syntax match asmOpcode "add[sx :]"
syntax match asmOpcode "and\.[lbw]"
syntax match asmOpcode "andc"
syntax match asmOpcode "band"
syntax match asmOpcode "bcc"
syntax match asmOpcode "bclr"
syntax match asmOpcode "bcs"
syntax match asmOpcode "beq"
syntax match asmOpcode "bf"
syntax match asmOpcode "bge"
syntax match asmOpcode "bgt"
syntax match asmOpcode "bhi"
syntax match asmOpcode "bhs"
syntax match asmOpcode "biand"
syntax match asmOpcode "bild"
syntax match asmOpcode "bior"
syntax match asmOpcode "bist"
syntax match asmOpcode "bixor"
syntax match asmOpcode "bl[deots]"
syntax match asmOpcode "bmi"
syntax match asmOpcode "bne"
syntax match asmOpcode "bnot"
syntax match asmOpcode "bnp"
syntax match asmOpcode "bor"
syntax match asmOpcode "bpl"
syntax match asmOpcode "bpt"
syntax match asmOpcode "bra"
syntax match asmOpcode "brn"
syntax match asmOpcode "bset"
syntax match asmOpcode "bsr"
syntax match asmOpcode "btst"
syntax match asmOpcode "bst"
syntax match asmOpcode "bt"
syntax match asmOpcode "bvc"
syntax match asmOpcode "bvs"
syntax match asmOpcode "bxor"
syntax match asmOpcode "cmp\.[lbw]"
syntax match asmOpcode "cmp"
syntax match asmOpcode "daa"
syntax match asmOpcode "das"
syntax match asmOpcode "dec\.[lbw]"
syntax match asmOpcode "divx[us].[bw]"
syntax match asmOpcode "eepmovw\="
syntax match asmOpcode "ext[su]\.[lw]"
syntax match asmOpcode "inc\.[lw]"
syntax match asmOpcode "inc"
syntax match asmOpcode "jmp"
syntax match asmOpcode "jsr"
syntax match asmOpcode "ldc"
syntax match asmOpcode "mov[ft]pe"
syntax match asmOpcode "mov\.[lbw]"
syntax match asmOpcode "mov"
syntax match asmOpcode "mulx[su]\.[bw]"
syntax match asmOpcode "neg\.[lbw]"
syntax match asmOpcode "nop"
syntax match asmOpcode "not\.[lbw]"
syntax match asmOpcode "or\.[lbw]"
syntax match asmOpcode "orc"
syntax match asmOpcode "pop\.[wl]"
syntax match asmOpcode "push\.[wl]"
syntax match asmOpcode "rotx\=[lr]\.[lbw]"
syntax match asmOpcode "rt[es]"
syntax match asmOpcode "sha[lr]\.[lbw]"
syntax match asmOpcode "shl[lr]\.[lbw]"
syntax match asmOpcode "sleep"
syntax match asmOpcode "stc"
syntax match asmOpcode "sub\.[lbw]"
syntax match asmOpcode "sub"
syntax match asmOpcode "trapa"
syntax match asmOpcode "xor\.[lbw]"
syntax match asmOpcode "xorc"


syntax case match


" Read the general asm syntax
source <sfile>:p:h/asm.vim


if !exists("did_hitachi_syntax_inits")
  let did_hitachi_syntax_inits = 1

  highlight link asmOpcode  Statement 
  highlight link asmRegister  Identifier

  " My default-color overrides:
  highlight asmOpcode ctermfg=yellow
  highlight asmReg	ctermfg=lightmagenta

endif
