You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
765 B
JavaScript

Prism.languages.nasm = {
'comment': /;.*$/m,
'string': /("|'|`)(\\?.)*?\1/gm,
'label': {
pattern: /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m,
alias: 'function'
},
'keyword': [
/\[?BITS (16|32|64)\]?/m,
/^\s*section\s*[a-zA-Z\.]+:?/im,
/(?:extern|global)[^;]*/im,
/(?:CPU|FLOAT|DEFAULT).*$/m
],
'register': {
pattern: /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(bp|sp|si|di)|[cdefgs]s)\b/gi,
alias: 'variable'
},
'number': /(\b|-|(?=\$))(0[hx][\da-f]*\.?[\da-f]+(p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(\.?e[+-]?\d+)?[dt]?)\b/i,
'operator': /[\[\]\*+\-\/%<>=&|\$!]/gm
};