nxu/tal.nanorc

45 lines
1023 B
Plaintext

# basic syntax for the uxntal assembly language
#
# mostly sticks to ANSI colors with a few exceptions
#
# comments are known to not handle nesting correctly.
# it's not possible to express nested comments using
# just start and end regexes.
# use this syntax for .tal files
syntax tal ".*\.tal"
# characters to insert when comments requested
comment "( | )"
# raw values
color pink "\"[^ ]+"
color pink "'[^ ]"
color pink "\<[0-9a-f]{2}{1,2}\>"
# literals
color bold,green "#[0-9a-f]{2}{1,2}\>"
# absolute addresses
color bold,yellow "(;&?|\.)\S+"
color bold,orange ",&?\S+"
color bold,orange "/\S+"
# relative pads
color yellow "\$[0-9a-f]{1,4}\>"
# instructions
color bold,cyan "\<(BRK|LIT|INC|POP|DUP|NIP|SWP|OVR|ROT|EQU|NEQ|GTH|LTH|JMP|JCN|JSR|STH|LDZ|STZ|LDR|STR|LDA|STA|DEI|DEO|ADD|SUB|MUL|DIV|AND|ORA|EOR|SFT)2?k?r?\>"
# label definitions
color bold,blue "(^|\s)(@|&)\S+"
# macros
color bold,magenta "%\S+"
# absolute pads
color yellow "\|[0-9a-f]{2}{1,2}\>"
# comments
color red start="\(\s" end="\s\)"