AVR assembly: Syntax Highlighting in nano under Linux

lubel's picture
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Type: 

 

## Syntaxhighlighting for AVR Assembly (Atmel instruction set)
## (c) by Lutz Bellmann, 2017

## Place in /usr/share/nano ; replace asm.nanorc; make backup of original asm.nanorc

syntax "asm" "\.(S|s|asm)$"
magic "[Aa]ssembl(y|er)"

# Befehle
icolor green "^(clr|ser|ldi|mov|lds|ld|ldd|in|pop|lpm|sts|st|std|out|push|inc|add|adiw|dec|sub|subi|sbc|sbci|sbiw|lsl|lsr|rol|ror|asr|swap|and|andi|or|ori|eor|com|neg|sbr|cbr|bst|bld|sbi|cbi|sez|sec|sen|sev|seh|ses|set|sei|clz|clc|cln|clt|cli|cp|cpc|cpi|tst|rjmp|ijmp|rcall|ret|reti|brbs||brbc|breq|brne|brcs|brcc|brsh|brlo|brmi|brpl|brge|brlt|brhs|brhc|brts|brtc|brvs|brvc|brie|brid|sbrc|sbrs|sbic|sbis|cpse|nop|sleep|wdr)*"

# Sprungpunkte und Rountinen
color brightred "^*"

# Strings.
icolor brightyellow "<[^=     ]*>" ""(\\.|[^"])*""

# Comments.
color cyan ";.*"

# Trailing whitespace.
# color ,green "+$"