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