prism-nasm.js 761 B

1234567891011121314151617181920
  1. Prism.languages.nasm = {
  2. 'comment': /;.*$/m,
  3. 'string': /("|'|`)(\\?.)*?\1/m,
  4. 'label': {
  5. pattern: /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m,
  6. alias: 'function'
  7. },
  8. 'keyword': [
  9. /\[?BITS (16|32|64)\]?/m,
  10. /^\s*section\s*[a-zA-Z\.]+:?/im,
  11. /(?:extern|global)[^;]*/im,
  12. /(?:CPU|FLOAT|DEFAULT).*$/m
  13. ],
  14. 'register': {
  15. 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/i,
  16. alias: 'variable'
  17. },
  18. '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,
  19. 'operator': /[\[\]\*+\-\/%<>=&|\$!]/m
  20. };