OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [zip.vim] - Blame information for rev 166

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 69 dgisselq
" Vim syntax file
2
" Language:     Zip CPU Assembly Language
3
" Maintainer:   Dan Gisselquist
4
" Last Change:  2015 Dec 20
5
"
6
" This is a ZipCPU syntax highlight definition file for use with VIM.
7
 
8
" Run this wih :set syntax=zip
9
"       Look up new-filetype for autodetection
10
 
11
if exists("b:current_syntax")
12
  finish
13
endif
14
 
15
"ignore case for assembly
16
syn case ignore
17
 
18
"  Identifier Keyword characters (defines \k)
19
if version >= 600
20
        setlocal iskeyword=@,48-57,#,$,:,?,@-@,_,~
21
endif
22
 
23
syn sync minlines=5
24
 
25
syn region zipComment start=";" end="$" contains=zipTodo,@Spell
26
syn region zipComment start="//" end="$" contains=zipTodo,@Spell
27
syn region zipComment start="/\*" end="\*/" contains=zipTodo,@Spell
28
" syn match zipComment ";.*" contains=zipTodo
29
 
30
syn match zipIdentifier "[a-zA-Z_$][a-zA-Z0-9_$]*"
31
" syn match zipDirective                "\.[a-zA-Z_$][a-zA-Z_$.]\+"
32
syn match zipLabel              "[a-zA-Z_$.][a-zA-Z0-9_$.]*\s\=:\>"he=e-1
33
syn region zipstring            start=+"+ skip=+\\\\\|\\"+ end=+"+
34
syn region zipcharstr           start=+'+ skip=+\\\\\|\\'+ end=+'+
35
syn match zipOctal              "\$\=0[0-7_]*\>"
36
syn match zipBinary             "\$\=0[bB][01_]*\>"
37
syn match zipHex                "\$\=0[xX][0-9a-fA-F_]*\>"
38
syn match zipDecimal            "\$\=[1-9_][0-9_]*\>"
39
" syn match zipFloat            "\$\=[0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*\)\=\>"
40
 
41
"simple instructions
42
syn keyword zipopcode sub and add or xor lsr lsl asr lhi llo ldihi ldilo
43
syn keyword zipopcode mpyu mpys divu divs
44
syn keyword zipopcode brev popc rol mov cmp tst lod sto ldi
45
syn keyword zipopcode noop break brk lock
46
syn keyword zipopcode fpadd fpsub fpmul fpdiv dpcvt fpint
47
syn keyword zipopcode bz beq bnz bc brc brv bv bra blt bgt bge
48
syn keyword zipopcode clr halt wait clrf jmp ljmp not trap busy neg rtu
49
 
50
"delimiters
51
 
52
"operators
53
syn match zipoperators "[()#,]"
54
" syn match zipoperators "\(+\|\*\|-\|/\|\\\|^\|&\|\|=\)"
55
 
56
"TODO
57
syn match zipTodo      "\(TODO\|XXX\|FIXME\|NOTE\)"
58
 
59
syn keyword zipCondition z ne nz ge gt lt n c v
60
 
61
"The regex for different zip registers are given below
62
syn match zipregisters "[us]\=R\([0-9]\|1[0-5]\)\>"
63
syn keyword zipregisters gbl sp cc pc usp ucc upc
64
"floating point classes
65
 
66
"Data allocation syntax
67
syn match zipdata "word\s*\>"
68
syn match zipdata "fill\s*\>"
69
syn match zipdata "stringz\=\(\(\(\.ua\)\=\(\.msb\|\.lsb\)\=\)\|\(\(\.msb\|\.lsb\)\=\(\.ua\)\=\)\)\=\>"
70
 
71
" Define the default highlighting.
72
" For version 5.8 and later: only when an item doesn't have highlighting yet
73
if version >= 508 || !exists("did_zip_syn_inits")
74
        command -nargs=+ HiLink hi def link 
75
 
76
        "zip specific stuff
77
        HiLink zipLabel         Define
78
        HiLink zipComment       Comment
79
        HiLink zipDirective     Type
80
        HiLink zipopcode        Statement
81
        HiLink zipCondition     Statement
82
        HiLink zipregisters     Operator
83
        HiLink zipstring        String
84
        HiLink zipcharstr       Character
85
        HiLink zipDecimal       Number
86
        HiLink zipHex           Number
87
        HiLink zipBinary        Number
88
        HiLink zipOctal Number
89
        HiLink zipIdentifier    Identifier
90
        HiLink zipdata          Type
91
        HiLink zipdelimiter     Delimiter
92
        HiLink zipoperator      Operator
93
        HiLink zipTodo          Todo
94
 
95
        " HiLink ia64Float      Float
96
        delcommand HiLink
97
endif
98
 
99
let b:current_syntax = "zip"
100
 
101
" vim: ts=8 sw=2

powered by: WebSVN 2.1.0

© copyright 1999-2022 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.