annotate runtime/syntax/mix.vim @ 24769:b373619355a3

Added tag v8.2.2922 for changeset 7334bf9335102cbb665376e4eca60dc1ef77f547
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Jun 2021 13:30:06 +0200
parents 656ab57d1ddc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5487
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: MIX (Donald Knuth's assembly language used in TAOCP)
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Wu Yongwei <wuyongwei@gmail.com>
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Filenames: *.mixal *.mix
13100
656ab57d1ddc update a few runtime files
Christian Brabandt <cb@256bit.org>
parents: 5487
diff changeset
5 " Last Change: 2017-11-26 15:21:36 +0800
5487
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " Quit when a syntax file was already loaded
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 if exists("b:current_syntax")
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 finish
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 endif
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 let s:cpo_save = &cpo
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 set cpo&vim
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 syn case ignore
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 " Special processing of ALF directive: implementations vary whether quotation
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 " marks are needed
13100
656ab57d1ddc update a few runtime files
Christian Brabandt <cb@256bit.org>
parents: 5487
diff changeset
19 syn match mixAlfParam #\s\{1,2\}"\?[^"]\{,5\}"\?# contains=mixString nextgroup=mixEndComment contained
5487
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 " Region for parameters
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 syn match mixParam #[-+*/:=0-9a-z,()"]\+# contains=mixIdentifier,mixSpecial,mixNumber,mixString,mixLabel nextgroup=mixEndComment contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 " Comment at the line end
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 syn match mixEndComment ".*" contains=mixRegister contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 " Identifier; must go before literals
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 syn match mixIdentifier "[a-z0-9_]\+" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 " Literals
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 syn match mixSpecial "[-+*/:=]" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 syn match mixNumber "[0-9]\+\>" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 syn region mixString start=+"+ skip=+\\"+ end=+"+ contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 " Labels
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 syn match mixLabel "^[a-z0-9_]\{,10\}\s\+" nextgroup=mixAlfSpecial,mixOpcode,mixDirective
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 syn match mixLabel "[0-9][BF]" contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 " Comments
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 syn match mixComment "^\*.*" contains=mixRegister
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 " Directives
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 syn keyword mixDirective ORIG EQU CON END nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 syn keyword mixDirective ALF nextgroup=mixAlfParam contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 " Opcodes
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 syn keyword mixOpcode NOP HLT NUM CHAR FLOT FIX nextgroup=mixEndComment contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 syn keyword mixOpcode FADD FSUB FMUL FDIV FCMP MOVE ADD SUB MUL DIV IOC IN OUT JRED JBUS JMP JSJ JOV JNOV JL JE JG JLE JNE JGE SLA SRA SLAX SRAX SLC SRC nextgroup=mixParam contained skipwhite
13100
656ab57d1ddc update a few runtime files
Christian Brabandt <cb@256bit.org>
parents: 5487
diff changeset
49 syn keyword mixOpcode SLB SRB JAE JAO JXE JXO nextgroup=mixParam contained skipwhite
5487
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 syn match mixOpcode "LD[AX1-6]N\?\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 syn match mixOpcode "ST[AX1-6JZ]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 syn match mixOpcode "EN[TN][AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 syn match mixOpcode "INC[AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 syn match mixOpcode "DEC[AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 syn match mixOpcode "CMP[AX1-6]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 syn match mixOpcode "J[AX1-6]N\?[NZP]\>" nextgroup=mixParam contained skipwhite
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 " Switch back to being case sensitive
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 syn case match
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61
13100
656ab57d1ddc update a few runtime files
Christian Brabandt <cb@256bit.org>
parents: 5487
diff changeset
62 " Registers (only to be used in comments now)
5487
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 syn keyword mixRegister rA rX rI1 rI2 rI3 rI4 rI5 rI6 rJ contained
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 " The default highlighting
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 hi def link mixRegister Special
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 hi def link mixLabel Define
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 hi def link mixComment Comment
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 hi def link mixEndComment Comment
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 hi def link mixDirective Keyword
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 hi def link mixOpcode Keyword
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 hi def link mixSpecial Special
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 hi def link mixNumber Number
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 hi def link mixString String
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 hi def link mixAlfParam String
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 hi def link mixIdentifier Identifier
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 let b:current_syntax = "mix"
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 let &cpo = s:cpo_save
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 unlet s:cpo_save
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83
0c37f66b4f3b Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 " vim: ts=8