" Vim syntax file " Language: TPU, Motorola TPU (Time Processing Unit) microcode " Maintainer: JB Maillet (busy.lab@free.fr) " Last change: 18 sep 2003 " Install in ~/.vim/syntax " load with :set syntax=tpu " Feel free to contribute. " " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded syntax clear if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syn case ignore syn match tpuLabel "^[a-zA-Z0-9_\\] *:" syn keyword tpuKeyword function syn keyword tpuKeyword name syn keyword tpuKeyword start_address syn keyword tpuKeyword enable_match syn keyword tpuKeyword disable_match syn keyword tpuKeyword cond syn keyword tpuKeyword bank syn match tpuKeyword "tpu[12]" syn keyword tpuKeyword ccl syn keyword tpuKeyword shift syn keyword tpuKeyword read_mer syn keyword tpuKeyword max syn keyword tpuKeyword flush syn keyword tpuKeyword no_flush syn keyword tpuKeyword write_mer syn keyword tpuKeyword neg_TDL syn keyword tpuKeyword neg_MRL syn keyword tpuKeyword neg_LSL syn keyword tpuKeyword cir syn keyword tpuKeyword config syn keyword tpuKeyword enable_mtsr syn keyword tpuKeyword disable_mtsr syn keyword tpuKeyword match_gte syn keyword tpuKeyword match_equal syn keyword tpuKeyword set clear syn match tpuKeyword "flag[0-2]" syn keyword tpuKeyword high low pac syn keyword tpuKeyword no_change toggle low_high high_low no_detect any_trans syn keyword tpuKeyword tbs syn match tpuKeyword "in_m[12]_c[12]" syn match tpuKeyword "out_m[12]_c[12]" syn keyword tpuKeyword less_than low_same tdl mrl lsr psl syn match tpuKeyword "hsq[01]" syn keyword tpuKeyword V N C Z TRUE FALSE syn match tpuDirective "%entry" syn match tpuDirective "%include" syn match tpuDirective "%macro" " macro definition syn match tpuDirective "%org" syn match tpuDirective "%page" syn match tpuDirective "%type" syn match tpuMacro "@[A-Za-z][A-Za-z0-9_\\]*" " macro use syn keyword tpuRegsr hsr0 hsr1 lsr pin flag0 p diob syn keyword tpuRegsr a sr ert p_high p_low link chan_reg syn keyword tpuRegsr dec chan_dec tcr1 tcr2 nil syn match tpuRegsr "m/tsr" syn match tpuRegsr "prm[0-7]" syn keyword tpuInstruction au call chan dec_return end if then goto nop ram syn keyword tpuInstruction repeat return " Special items for comments syn keyword tpuTodo contained TODO syn match tpuComment "(\*.*\*)" contains=tpuTodo syn match tpuComment "{.*}" contains=tpuTodo " Immediate data: syn match tpuHex "#\$[0-9A-Fa-f]*" syn match tpuDec "#[0-9]*" syn match tpuBin "#%[01]*" syn match tpuBin "[^a-zA-Z_0-9][01]" " TODO: foo =0, bar=1 does not match??? " Numeric addresses: syn match tpuHex "\$[0-9A-Fa-f]*" syn match tpuDec "#[0-9]*" syn match tpuPathStr "'.*'" " string, as in a path for include " Operators syn match tpuOperator "[+-]" syn match tpuOperator ":=" " assigment syn match tpuOperator ":=>>" " assignment and shift right syn match tpuOperator ":=<<" " assignment and shift left syn match tpuOperator ":=R>" " assignment and rotate right syn match tpuOperator "!" syn match tpuOperator "->" syn match tpuOperator "<-" syn match tpuOperator "=" " TODO: not really an operator " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_tpu_syntax_inits") if version < 508 let did_tpu_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink tpuLabel Label HiLink tpuKeyword Keyword HiLink tpuDirective PreProc HiLink tpuMacro Macro HiLink tpuRegsr Identifier HiLink tpuInstruction Keyword HiLink tpuTodo Todo HiLink tpuComment Comment HiLink tpuHex Number HiLink tpuDec Number HiLink tpuBin Number HiLink tpuPathStr String HiLink tpuOperator Identifier delcommand HiLink endif let b:curret_syntax = "tpu"