3 " Maintainer: Dirk Hüsken, <huesken@informatik.uni-tuebingen.de>
4 " Last Change: Wed Apr 24 01:18:52 CEST 2002
6 " URL: http://homepages.uni-tuebingen.de/student/dirk.huesken/vim/syntax/mmix.vim
8 " Limitations: Comments must start with either % or //
9 " (preferrably %, Knuth-Style)
13 elseif exists("b:current_syntax")
20 syn keyword mmixType byte wyde tetra octa
22 " different literals...
23 syn match decNumber "[0-9]*"
24 syn match octNumber "0[0-7][0-7]\+"
25 syn match hexNumber "#[0-9a-fA-F]\+"
26 syn region mmixString start=+"+ skip=+\\"+ end=+"+
27 syn match mmixChar "'.'"
29 " ...and more special MMIX stuff
31 syn keyword mmixSegments Data_Segment Pool_Segment Stack_Segment
33 syn match mmixIdentifier "[a-z_][a-z0-9_]*"
35 " labels (for branches etc)
36 syn match mmixLabel "^[a-z0-9_:][a-z0-9_]*"
37 syn match mmixLabel "[0-9][HBF]"
40 syn keyword mmixPseudo is loc greg
43 syn match mmixComment "%.*"
44 syn match mmixComment "//.*"
45 syn match mmixComment "^\*.*"
48 syn keyword mmixOpcode trap fcmp fun feql fadd fix fsub fixu
49 syn keyword mmixOpcode fmul fcmpe fune feqle fdiv fsqrt frem fint
51 syn keyword mmixOpcode floti flotui sfloti sflotui i
52 syn keyword mmixOpcode muli mului divi divui
53 syn keyword mmixOpcode addi addui subi subui
54 syn keyword mmixOpcode 2addui 4addui 8addui 16addui
55 syn keyword mmixOpcode cmpi cmpui negi negui
56 syn keyword mmixOpcode sli slui sri srui
57 syn keyword mmixOpcode bnb bzb bpb bodb
58 syn keyword mmixOpcode bnnb bnzb bnpb bevb
59 syn keyword mmixOpcode pbnb pbzb pbpb pbodb
60 syn keyword mmixOpcode pbnnb pbnzb pbnpb pbevb
61 syn keyword mmixOpcode csni cszi cspi csodi
62 syn keyword mmixOpcode csnni csnzi csnpi csevi
63 syn keyword mmixOpcode zsni zszi zspi zsodi
64 syn keyword mmixOpcode zsnni zsnzi zsnpi zsevi
65 syn keyword mmixOpcode ldbi ldbui ldwi ldwui
66 syn keyword mmixOpcode ldti ldtui ldoi ldoui
67 syn keyword mmixOpcode ldsfi ldhti cswapi ldunci
68 syn keyword mmixOpcode ldvtsi preldi pregoi goi
69 syn keyword mmixOpcode stbi stbui stwi stwui
70 syn keyword mmixOpcode stti sttui stoi stoui
71 syn keyword mmixOpcode stsfi sthti stcoi stunci
72 syn keyword mmixOpcode syncdi presti syncidi pushgoi
73 syn keyword mmixOpcode ori orni nori xori
74 syn keyword mmixOpcode andi andni nandi nxori
75 syn keyword mmixOpcode bdifi wdifi tdifi odifi
76 syn keyword mmixOpcode muxi saddi mori mxori
77 syn keyword mmixOpcode muli mului divi divui
79 syn keyword mmixOpcode flot flotu sflot sflotu
80 syn keyword mmixOpcode mul mulu div divu
81 syn keyword mmixOpcode add addu sub subu
82 syn keyword mmixOpcode 2addu 4addu 8addu 16addu
83 syn keyword mmixOpcode cmp cmpu neg negu
84 syn keyword mmixOpcode sl slu sr sru
85 syn keyword mmixOpcode bn bz bp bod
86 syn keyword mmixOpcode bnn bnz bnp bev
87 syn keyword mmixOpcode pbn pbz pbp pbod
88 syn keyword mmixOpcode pbnn pbnz pbnp pbev
89 syn keyword mmixOpcode csn csz csp csod
90 syn keyword mmixOpcode csnn csnz csnp csev
91 syn keyword mmixOpcode zsn zsz zsp zsod
92 syn keyword mmixOpcode zsnn zsnz zsnp zsev
93 syn keyword mmixOpcode ldb ldbu ldw ldwu
94 syn keyword mmixOpcode ldt ldtu ldo ldou
95 syn keyword mmixOpcode ldsf ldht cswap ldunc
96 syn keyword mmixOpcode ldvts preld prego go
97 syn keyword mmixOpcode stb stbu stw stwu
98 syn keyword mmixOpcode stt sttu sto stou
99 syn keyword mmixOpcode stsf stht stco stunc
100 syn keyword mmixOpcode syncd prest syncid pushgo
101 syn keyword mmixOpcode or orn nor xor
102 syn keyword mmixOpcode and andn nand nxor
103 syn keyword mmixOpcode bdif wdif tdif odif
104 syn keyword mmixOpcode mux sadd mor mxor
106 syn keyword mmixOpcode seth setmh setml setl inch incmh incml incl
107 syn keyword mmixOpcode orh ormh orml orl andh andmh andml andnl
108 syn keyword mmixOpcode jmp pushj geta put
109 syn keyword mmixOpcode pop resume save unsave sync swym get trip
110 syn keyword mmixOpcode set lda
112 " switch back to being case sensitive
115 " general-purpose and special-purpose registers
116 syn match mmixRegister "$[0-9]*"
117 syn match mmixRegister "r[A-Z]"
118 syn keyword mmixRegister rBB rTT rWW rXX rYY rZZ
120 " Define the default highlighting.
121 " For version 5.7 and earlier: only when not done already
122 " For version 5.8 and later: only when an item doesn't have highlighting yet
123 if version >= 508 || !exists("did_mmix_syntax_inits")
125 let did_mmix_syntax_inits = 1
126 command -nargs=+ HiLink hi link <args>
128 command -nargs=+ HiLink hi def link <args>
131 " The default methods for highlighting. Can be overridden later
133 HiLink mmixPseudo Type
134 HiLink mmixRegister Special
135 HiLink mmixSegments Type
137 HiLink mmixLabel Special
138 HiLink mmixComment Comment
139 HiLink mmixOpcode Keyword
141 HiLink hexNumber Number
142 HiLink decNumber Number
143 HiLink octNumber Number
145 HiLink mmixString String
146 HiLink mmixChar String
149 HiLink mmixIdentifier Normal
150 HiLink mmixSpecialComment Comment
152 " My default color overrides:
153 " hi mmixSpecialComment ctermfg=red
154 "hi mmixLabel ctermfg=lightcyan
155 " hi mmixType ctermbg=black ctermfg=brown
160 let b:current_syntax = "mmix"