nxu/tal.nanorc

53 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-03-04 15:30:26 -05:00
# 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
2024-09-04 14:08:59 -04:00
color green "\B\"\S+"
color green "\<[0-9a-f]{2}{1,2}\>"
color green "\<_\S+"
color green "\B-\S+"
color green "\B=\S+"
2022-03-04 15:30:26 -05:00
# literals
2024-09-04 14:08:59 -04:00
color bold,green "\B#[0-9a-f]{2}{1,2}\>"
2022-03-04 15:30:26 -05:00
2024-09-04 22:28:37 -04:00
# addresses (absolute, relative, zero-page)
2024-09-04 14:08:59 -04:00
color yellow "\B;\S+"
color yellow "\B,\S+"
color yellow "\B\.\S+"
2022-03-04 15:30:26 -05:00
# relative pads
2024-09-04 14:08:59 -04:00
color yellow "\B\$[0-9a-f]{1,4}\>\>"
2022-03-04 15:30:26 -05:00
# instructions
2024-09-04 22:28:37 -04:00
color 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)[2kr]*\>"
2022-03-04 15:30:26 -05:00
# label definitions
color bold,blue "(^|\s)(@|&)\S+"
# macros
2024-09-04 14:08:59 -04:00
color bold,magenta "\B%\S+"
2022-03-04 15:30:26 -05:00
# absolute pads
2024-09-04 14:08:59 -04:00
color yellow "\B\|[0-9a-f]{1,4}\>"
2024-09-04 22:28:37 -04:00
# immediate syntax
2024-09-04 14:08:59 -04:00
color bold,yellow "\?\S+"
color bold,yellow "!\S+"
2024-09-04 22:28:37 -04:00
color bold,yellow "\B\{\B"
color bold,yellow "\B\}\B"
2022-03-04 15:30:26 -05:00
# comments
2024-09-04 14:08:59 -04:00
color red start="\B\(\s" end="\s\)\B"