Skip to content

Commit 60b7b9d

Browse files
committed
Full syntax support
0 parents  commit 60b7b9d

File tree

6 files changed

+190
-0
lines changed

6 files changed

+190
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode
2+

LICENSE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c) 2016 Kirill V. Lyadvinsky
2+
http://www.codeatcpp.com
3+
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
3. Neither the name of the copyright holder nor the names of its contributors
15+
may be used to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Zeus Z80 Assembly for Visual Studio Code
2+
This extension adds support for the Zeus Z80 for Spectrum 48k to Visual Studio Code. It works with sources that were generated from the original Zeus Z80 files with help of [ZX Tools](https://github.com/codeatcpp/zxtools).
3+
4+
# Installation
5+
6+
Press `F1` in VSCode, type `ext install` and then look for `Asm (Zeus Z80)`.
7+
8+
# Usage
9+
10+
## Colorization
11+
12+
Full syntax highlight for Zeus Z80 Assembly.

package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "zeus-z80-asm",
3+
"displayName": "Zeus Z80 Assembly",
4+
"description": "Zeus Z80 for ZX Spectrum 48k support for Visual Studio Code",
5+
"version": "0.0.1",
6+
"publisher": "jia3ep",
7+
"engines": {
8+
"vscode": "^1.0.0"
9+
},
10+
"categories": [
11+
"Languages"
12+
],
13+
"keywords": [
14+
"zeus",
15+
"z80",
16+
"sinclair",
17+
"spectrum",
18+
"48k"
19+
],
20+
"license": "SEE LICENSE IN LICENSE.md",
21+
"homepage": "http://www.codeatcpp.com",
22+
"repository": {
23+
"type": "git",
24+
"url": "https://github.com/codeatcpp/vscode-language-z80-asm.git"
25+
},
26+
"bugs": {
27+
"url": "https://github.com/codeatcpp/vscode-language-z80-asm/issues"
28+
},
29+
"contributes": {
30+
"languages": [{
31+
"id": "zeus-asm",
32+
"aliases": ["Asm (Zeus Z80)", "zeus-asm"],
33+
"extensions": [".asm",".$C"],
34+
"configuration": "./zeus-asm.configuration.json"
35+
}],
36+
"grammars": [{
37+
"language": "zeus-asm",
38+
"scopeName": "source.asm.z80",
39+
"path": "./syntaxes/zeus-asm.tmLanguage"
40+
}]
41+
}
42+
}

syntaxes/zeus-asm.tmLanguage

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>fileTypes</key>
6+
<array>
7+
<string>asm</string>
8+
<string>$C</string>
9+
</array>
10+
<key>name</key>
11+
<string>Zeus Z80 Assembly</string>
12+
<key>patterns</key>
13+
<array>
14+
<dict>
15+
<key>match</key>
16+
<string>;.*$</string>
17+
<key>name</key>
18+
<string>comment.line</string>
19+
</dict>
20+
<dict>
21+
<key>match</key>
22+
<string>\b(DEFM|DEFB|DEFS|DEFW|ORG|EQU|ENT|DISP|M|P|PE|PO)\b</string>
23+
<key>name</key>
24+
<string>support.type.asm</string>
25+
</dict>
26+
<dict>
27+
<key>begin</key>
28+
<string>"</string>
29+
<key>beginCaptures</key>
30+
<dict>
31+
<key>0</key>
32+
<dict>
33+
<key>name</key>
34+
<string>punctuation.definition.string.begin.asm.z80</string>
35+
</dict>
36+
</dict>
37+
<key>end</key>
38+
<string>"</string>
39+
<key>endCaptures</key>
40+
<dict>
41+
<key>0</key>
42+
<dict>
43+
<key>name</key>
44+
<string>punctuation.definition.string.end.asm.z80</string>
45+
</dict>
46+
</dict>
47+
<key>name</key>
48+
<string>string.quoted.double.include.asm.z80</string>
49+
</dict>
50+
<dict>
51+
<key>match</key>
52+
<string>\b(ADC|ADD|AND|BIT|CALL|CCF|CP|CPD|CPDR|CPI|CPIR|CPL|DAA|DEC|DI|DJNZ|EI|EX|EXX|HALT|IM|IN|INC|IND|INDR|INI|INIR|JP|JR|LD|LDD|LDDR|LDI|LDIR|M|NC|NEG|NOP|NV|NZ|OR|OTDR|OTIR|OUT|OUTD|OUTI|POP|PUSH|RES|RET|RETI|RETN|RL|RLA|RLC|RLCA|RLD|RR|RRA|RRC|RRCA|RRD|RST|SBC|SCF|SET|SLA|SRA|SRL|SUB|XOR)\b</string>
53+
<key>name</key>
54+
<string>keyword.mnemonic.asm.z80</string>
55+
</dict>
56+
<dict>
57+
<key>match</key>
58+
<string>^\d{5}</string>
59+
<key>name</key>
60+
<string>invalid</string>
61+
</dict>
62+
<dict>
63+
<key>match</key>
64+
<string>\b[0-9]+\b</string>
65+
<key>name</key>
66+
<string>constant.numeric.dec</string>
67+
</dict>
68+
<dict>
69+
<key>match</key>
70+
<string>#[0-9a-fA-F]+\b</string>
71+
<key>name</key>
72+
<string>constant.numeric.hex</string>
73+
</dict>
74+
<dict>
75+
<key>match</key>
76+
<string>\b(A|B|C|D|E|F|H|L|I|R|IX|IY|AF|BC|DE|HL|PC|SP|AF'|Z)\b</string>
77+
<key>name</key>
78+
<string>storage.type.asm.z80</string>
79+
</dict>
80+
</array>
81+
<key>scopeName</key>
82+
<string>source.asm.z80</string>
83+
<key>uuid</key>
84+
<string>84DDB367-0875-4FF3-8047-D3FF2988B3C9</string>
85+
</dict>
86+
</plist>

zeus-asm.configuration.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"comments": {
3+
// symbol used for single line comment. Remove this entry if your language does not support line comments
4+
"lineComment": ";"
5+
},
6+
// symbols used as brackets
7+
"brackets": [
8+
["(", ")"]
9+
],
10+
// symbols that are auto closed when typing
11+
"autoClosingPairs": [
12+
["(", ")"],
13+
["\"", "\""]
14+
],
15+
// symbols that that can be used to surround a selection
16+
"surroundingPairs": [
17+
["(", ")"],
18+
["\"", "\""]
19+
]
20+
}

0 commit comments

Comments
 (0)