assembler.syntax 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. #
  2. # NASM,WASM,TASM,MASM and GAS x86 syntax highlight
  3. # // Mike Gorchak
  4. # // Andres Farfan 2012
  5. #
  6. caseinsensitive
  7. context default lightgray
  8. # NASM directives
  9. keyword whole BITS white
  10. keyword whole SECTION white
  11. keyword whole SEGMENT white
  12. keyword whole ABSOLUTE white
  13. keyword whole EXTERN white
  14. keyword whole GLOBAL white
  15. keyword whole COMMON white
  16. keyword whole CPU white
  17. # NASM, WASM, TASM, MASM and common modifiers
  18. keyword whole ALIGN white
  19. keyword whole ALIGNB white
  20. keyword whole STRUC white
  21. keyword whole ENDSTRUC white
  22. keyword whole ISTRUC white
  23. keyword whole IEND white
  24. keyword whole AT white
  25. keyword whole __FILE__ white
  26. keyword whole __LINE__ white
  27. keyword whole __NASM_VER__ white
  28. keyword whole __NASM_VERSION_ID__ white
  29. keyword whole __NASM_MAJOR__ white
  30. keyword whole __NASM_MINOR__ white
  31. keyword whole __NASM_SUBMINOR__ white
  32. keyword whole __NASM_PATCHLEVEL__ white
  33. keyword whole __SECT__ white
  34. keyword whole STRICT white
  35. keyword whole SEG white
  36. keyword whole WRT white
  37. keyword whole NOSPLIT white
  38. keyword whole BYTE white
  39. keyword whole WORD white
  40. keyword whole DWORD white
  41. keyword whole QWORD white
  42. keyword whole TWORD white
  43. # Pseudo instructions
  44. keyword whole ORG white
  45. keyword whole EQU white
  46. keyword whole DB white
  47. keyword whole DW white
  48. keyword whole DD white
  49. keyword whole DQ white
  50. keyword whole DT white
  51. keyword whole RESB white
  52. keyword whole RESW white
  53. keyword whole RESD white
  54. keyword whole RESQ white
  55. keyword whole REST white
  56. keyword whole INCBIN white
  57. keyword whole TIMES white
  58. # GAS specific
  59. keyword whole .string white
  60. keyword whole .section white
  61. keyword whole .align white
  62. keyword whole .type white
  63. keyword whole .size white
  64. keyword whole .comm white
  65. keyword whole .ident white
  66. keyword whole .globl white
  67. keyword whole .rodata brightblue
  68. keyword whole .data brightblue
  69. keyword whole .text brightblue
  70. keyword whole .bss brightblue
  71. # NASM/TASM Macroses
  72. keyword whole %ifdef brightred
  73. keyword whole %define brightred
  74. keyword whole %else brightred
  75. keyword whole %elif brightred
  76. keyword whole %endif brightred
  77. keyword whole %macro brightred
  78. keyword whole %endmacro brightred
  79. keyword whole %rep brightred
  80. keyword whole %repl brightred
  81. keyword whole %strlen brightred
  82. keyword whole %substr brightred
  83. keyword whole %arg brightred
  84. keyword whole %stacksize brightred
  85. keyword whole %local brightred
  86. keyword whole %push brightred
  87. keyword whole %pop brightred
  88. keyword whole %line brightred
  89. keyword whole %\! brightred
  90. keyword whole %\+ brightred
  91. # Generic 16-bit registers set
  92. keyword whole %al brightmagenta
  93. keyword whole %bl brightmagenta
  94. keyword whole %cl brightmagenta
  95. keyword whole %dl brightmagenta
  96. keyword whole %ah brightmagenta
  97. keyword whole %bh brightmagenta
  98. keyword whole %ch brightmagenta
  99. keyword whole %dh brightmagenta
  100. keyword whole %ax brightmagenta
  101. keyword whole %bx brightmagenta
  102. keyword whole %cx brightmagenta
  103. keyword whole %dx brightmagenta
  104. keyword whole %si brightmagenta
  105. keyword whole %di brightmagenta
  106. keyword whole %bp brightmagenta
  107. keyword whole %sp brightmagenta
  108. keyword whole %es brightmagenta
  109. keyword whole %cs brightmagenta
  110. keyword whole %ds brightmagenta
  111. keyword whole AL brightmagenta
  112. keyword whole BL brightmagenta
  113. keyword whole CL brightmagenta
  114. keyword whole DL brightmagenta
  115. keyword whole AH brightmagenta
  116. keyword whole BH brightmagenta
  117. keyword whole CH brightmagenta
  118. keyword whole DH brightmagenta
  119. keyword whole AX brightmagenta
  120. keyword whole BX brightmagenta
  121. keyword whole CX brightmagenta
  122. keyword whole DX brightmagenta
  123. keyword whole SI brightmagenta
  124. keyword whole DI brightmagenta
  125. keyword whole BP brightmagenta
  126. keyword whole SP brightmagenta
  127. keyword whole ES brightmagenta
  128. keyword whole CS brightmagenta
  129. keyword whole DS brightmagenta
  130. # Generic 32-bit registers set
  131. keyword whole %eax brightmagenta
  132. keyword whole %ebx brightmagenta
  133. keyword whole %ecx brightmagenta
  134. keyword whole %edx brightmagenta
  135. keyword whole %esi brightmagenta
  136. keyword whole %edi brightmagenta
  137. keyword whole %ebp brightmagenta
  138. keyword whole %esp brightmagenta
  139. keyword whole %fs brightmagenta
  140. keyword whole %gs brightmagenta
  141. keyword whole EAX brightmagenta
  142. keyword whole EBX brightmagenta
  143. keyword whole ECX brightmagenta
  144. keyword whole EDX brightmagenta
  145. keyword whole ESI brightmagenta
  146. keyword whole EDI brightmagenta
  147. keyword whole EBP brightmagenta
  148. keyword whole ESP brightmagenta
  149. keyword whole FS brightmagenta
  150. keyword whole GS brightmagenta
  151. keyword whole CR0 magenta
  152. keyword whole CR1 magenta
  153. keyword whole CR2 magenta
  154. keyword whole CR3 magenta
  155. keyword whole DR0 magenta
  156. keyword whole DR1 magenta
  157. keyword whole DR3 magenta
  158. keyword whole DR4 magenta
  159. keyword whole DR5 magenta
  160. keyword whole DR6 magenta
  161. keyword whole DR7 magenta
  162. keyword whole TR0 magenta
  163. keyword whole TR1 magenta
  164. keyword whole TR2 magenta
  165. keyword whole TR3 magenta
  166. keyword whole TR4 magenta
  167. keyword whole TR5 magenta
  168. keyword whole TR6 magenta
  169. keyword whole TR7 magenta
  170. keyword whole TR8 magenta
  171. keyword whole TR9 magenta
  172. keyword whole TR10 magenta
  173. keyword whole TR11 magenta
  174. # Generic AMD64 registers set
  175. keyword whole %rax brightmagenta
  176. keyword whole %rbx brightmagenta
  177. keyword whole %rcx brightmagenta
  178. keyword whole %rdx brightmagenta
  179. keyword whole %rsi brightmagenta
  180. keyword whole %rdi brightmagenta
  181. keyword whole %rbp brightmagenta
  182. keyword whole %rsp brightmagenta
  183. keyword whole %r8 brightmagenta
  184. keyword whole %r9 brightmagenta
  185. keyword whole %r10 brightmagenta
  186. keyword whole %r11 brightmagenta
  187. keyword whole %r12 brightmagenta
  188. keyword whole %r13 brightmagenta
  189. keyword whole %r14 brightmagenta
  190. keyword whole %r15 brightmagenta
  191. keyword whole RAX brightmagenta
  192. keyword whole RBX brightmagenta
  193. keyword whole RCX brightmagenta
  194. keyword whole RDX brightmagenta
  195. keyword whole RSI brightmagenta
  196. keyword whole RDI brightmagenta
  197. keyword whole RBP brightmagenta
  198. keyword whole RSP brightmagenta
  199. keyword whole R8 brightmagenta
  200. keyword whole R9 brightmagenta
  201. keyword whole R10 brightmagenta
  202. keyword whole R11 brightmagenta
  203. keyword whole R12 brightmagenta
  204. keyword whole R13 brightmagenta
  205. keyword whole R14 brightmagenta
  206. keyword whole R15 brightmagenta
  207. #AMD64 32-bit registers. 64-bit mode
  208. keyword whole %r8d brightmagenta
  209. keyword whole %r9d brightmagenta
  210. keyword whole %r10d brightmagenta
  211. keyword whole %r11d brightmagenta
  212. keyword whole %r12d brightmagenta
  213. keyword whole %r13d brightmagenta
  214. keyword whole %r14d brightmagenta
  215. keyword whole %r15d brightmagenta
  216. keyword whole R8D brightmagenta
  217. keyword whole R9D brightmagenta
  218. keyword whole R10D brightmagenta
  219. keyword whole R11D brightmagenta
  220. keyword whole R12D brightmagenta
  221. keyword whole R13D brightmagenta
  222. keyword whole R14D brightmagenta
  223. keyword whole R15D brightmagenta
  224. #AMD64 16-bit registers. 64-bit mode
  225. keyword whole %r8w brightmagenta
  226. keyword whole %r9w brightmagenta
  227. keyword whole %r10w brightmagenta
  228. keyword whole %r11w brightmagenta
  229. keyword whole %r12w brightmagenta
  230. keyword whole %r13w brightmagenta
  231. keyword whole %r14w brightmagenta
  232. keyword whole %r15w brightmagenta
  233. keyword whole R8W brightmagenta
  234. keyword whole R9W brightmagenta
  235. keyword whole R10W brightmagenta
  236. keyword whole R11W brightmagenta
  237. keyword whole R12W brightmagenta
  238. keyword whole R13W brightmagenta
  239. keyword whole R14W brightmagenta
  240. keyword whole R15W brightmagenta
  241. #AMD64 8-bit registers. 64-bit mode
  242. keyword whole %sil brightmagenta
  243. keyword whole %dil brightmagenta
  244. keyword whole %bpl brightmagenta
  245. keyword whole %spl brightmagenta
  246. keyword whole %r8b brightmagenta
  247. keyword whole %r9b brightmagenta
  248. keyword whole %r10b brightmagenta
  249. keyword whole %r11b brightmagenta
  250. keyword whole %r12b brightmagenta
  251. keyword whole %r13b brightmagenta
  252. keyword whole %r14b brightmagenta
  253. keyword whole %r15b brightmagenta
  254. keyword whole SIL brightmagenta
  255. keyword whole DIL brightmagenta
  256. keyword whole BPL brightmagenta
  257. keyword whole SPL brightmagenta
  258. keyword whole R8B brightmagenta
  259. keyword whole R9B brightmagenta
  260. keyword whole R10B brightmagenta
  261. keyword whole R11B brightmagenta
  262. keyword whole R12B brightmagenta
  263. keyword whole R13B brightmagenta
  264. keyword whole R14B brightmagenta
  265. keyword whole R15B brightmagenta
  266. #AMD64 System registers. 64-bit mode
  267. keyword whole CR8 magenta
  268. #AMD64 SSE Registers. 64-bit mode
  269. keyword whole %xmm8 brightcyan
  270. keyword whole %xmm9 brightcyan
  271. keyword whole %xmm10 brightcyan
  272. keyword whole %xmm11 brightcyan
  273. keyword whole %xmm12 brightcyan
  274. keyword whole %xmm13 brightcyan
  275. keyword whole %xmm14 brightcyan
  276. keyword whole %xmm15 brightcyan
  277. keyword whole xmm8 brightcyan
  278. keyword whole xmm9 brightcyan
  279. keyword whole xmm10 brightcyan
  280. keyword whole xmm11 brightcyan
  281. keyword whole xmm12 brightcyan
  282. keyword whole xmm13 brightcyan
  283. keyword whole xmm14 brightcyan
  284. keyword whole xmm15 brightcyan
  285. # FPU registers set
  286. keyword whole st0 brightcyan
  287. keyword whole st1 brightcyan
  288. keyword whole st2 brightcyan
  289. keyword whole st3 brightcyan
  290. keyword whole st4 brightcyan
  291. keyword whole st5 brightcyan
  292. keyword whole st6 brightcyan
  293. keyword whole st7 brightcyan
  294. keyword whole %st0 brightcyan
  295. keyword whole %st1 brightcyan
  296. keyword whole %st2 brightcyan
  297. keyword whole %st3 brightcyan
  298. keyword whole %st4 brightcyan
  299. keyword whole %st5 brightcyan
  300. keyword whole %st6 brightcyan
  301. keyword whole %st7 brightcyan
  302. # MMX/3DNOW registers set
  303. keyword whole mm0 brightcyan
  304. keyword whole mm1 brightcyan
  305. keyword whole mm2 brightcyan
  306. keyword whole mm3 brightcyan
  307. keyword whole mm4 brightcyan
  308. keyword whole mm5 brightcyan
  309. keyword whole mm6 brightcyan
  310. keyword whole mm7 brightcyan
  311. keyword whole %mm0 brightcyan
  312. keyword whole %mm1 brightcyan
  313. keyword whole %mm2 brightcyan
  314. keyword whole %mm3 brightcyan
  315. keyword whole %mm4 brightcyan
  316. keyword whole %mm5 brightcyan
  317. keyword whole %mm6 brightcyan
  318. keyword whole %mm7 brightcyan
  319. # SSE registers set
  320. keyword whole xmm0 brightcyan
  321. keyword whole xmm1 brightcyan
  322. keyword whole xmm2 brightcyan
  323. keyword whole xmm3 brightcyan
  324. keyword whole xmm4 brightcyan
  325. keyword whole xmm5 brightcyan
  326. keyword whole xmm6 brightcyan
  327. keyword whole xmm7 brightcyan
  328. keyword whole %xmm0 brightcyan
  329. keyword whole %xmm1 brightcyan
  330. keyword whole %xmm2 brightcyan
  331. keyword whole %xmm3 brightcyan
  332. keyword whole %xmm4 brightcyan
  333. keyword whole %xmm5 brightcyan
  334. keyword whole %xmm6 brightcyan
  335. keyword whole %xmm7 brightcyan
  336. # Common symbols
  337. keyword ; brown
  338. keyword ! brown
  339. keyword /\* brown
  340. keyword \*/ brown
  341. keyword [ white
  342. keyword ] white
  343. keyword , white
  344. keyword \+ white
  345. keyword - white
  346. keyword . white
  347. keyword ( white
  348. keyword ) white
  349. keyword : white
  350. keyword @ white
  351. keyword >> white
  352. keyword << white
  353. keyword % white
  354. keyword \\ white
  355. keyword / white
  356. keyword // white
  357. keyword ~ white
  358. keyword ^ white
  359. keyword & white
  360. keyword \* white
  361. keyword | white
  362. keyword $ brightgreen
  363. keyword $$ brightgreen
  364. keyword %% cyan
  365. context " " green
  366. context ' ' brightgreen
  367. context exclusive ; \n brown
  368. spellcheck
  369. context exclusive /\* \*/ brown
  370. spellcheck
  371. context exclusive ! \n brown
  372. spellcheck