Added sublime syntax
This commit is contained in:
parent
7ba9782459
commit
9c78222802
|
@ -26,11 +26,12 @@ cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn
|
||||||
- `( comment )`
|
- `( comment )`
|
||||||
|
|
||||||
```
|
```
|
||||||
;value ( alloc zero-page variable )
|
;value ( alloc a zero-page variable )
|
||||||
|
|
||||||
@0010 ( start at page 1 )
|
@0010 ( start at page 1 )
|
||||||
|
|
||||||
,there [ ,0a ,05 GTH ] JMC
|
,03 ,02 ADD ,05 EQU
|
||||||
|
,there ROT JMC
|
||||||
|
|
||||||
:here
|
:here
|
||||||
( when not equal )
|
( when not equal )
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
|
|
||||||
;var1
|
;var1
|
||||||
;var2
|
;var2
|
||||||
;var3
|
|
||||||
|
@0100
|
||||||
|
|
||||||
|
:RESET ( --- )
|
||||||
|
|
||||||
,22 ,var1 STR ( store 0x22 in var1 )
|
,22 ,var1 STR ( store 0x22 in var1 )
|
||||||
,var1 LDR ( load var2, put value on stack )
|
,var1 LDR ( load var2, put value on stack )
|
||||||
|
|
||||||
@0100 ( store program reset after zero-page )
|
BRK
|
||||||
|
|
||||||
:RESET ( --- )
|
|
||||||
BRK
|
|
||||||
|
|
||||||
@c000 ( much further.. )
|
@c000 ( much further.. )
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
# See http://www.sublimetext.com/docs/3/syntax.html
|
||||||
|
name: Uxn Assembly
|
||||||
|
scopeName: usm.
|
||||||
|
fileTypes: [usm]
|
||||||
|
file_extensions:
|
||||||
|
- usm
|
||||||
|
scope: source.usm
|
||||||
|
|
||||||
|
contexts:
|
||||||
|
prototype:
|
||||||
|
- include: comments
|
||||||
|
|
||||||
|
main:
|
||||||
|
- include: keywords
|
||||||
|
- include: numbers
|
||||||
|
- include: strings
|
||||||
|
|
||||||
|
numbers:
|
||||||
|
- match: '\@(\S+)\s?'
|
||||||
|
scope: punctuation.definition
|
||||||
|
pop: true
|
||||||
|
|
||||||
|
strings:
|
||||||
|
- match: '\:(\S+)\s?'
|
||||||
|
scope: string.control
|
||||||
|
pop: true
|
||||||
|
- match: '\;(\S+)\s?'
|
||||||
|
scope: string.control
|
||||||
|
pop: true
|
||||||
|
- match: '\,(\S+)\s?'
|
||||||
|
scope: keyword.control
|
||||||
|
pop: true
|
||||||
|
- match: '\.(\S+)\s?'
|
||||||
|
scope: keyword.control
|
||||||
|
pop: true
|
||||||
|
|
||||||
|
comments:
|
||||||
|
- match: '\('
|
||||||
|
scope: punctuation.definition.comment.tome
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.line.double-slash.tome
|
||||||
|
- match: '\)'
|
||||||
|
pop: true
|
Loading…
Reference in New Issue