KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

asm.php 11KB

11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?php
  2. /*************************************************************************************
  3. * asm.php
  4. * -------
  5. * Author: Tux (tux@inmail.cz)
  6. * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.10
  8. * Date Started: 2004/07/27
  9. *
  10. * x86 Assembler language file for GeSHi.
  11. * Words are from SciTe configuration file (based on NASM syntax)
  12. *
  13. * CHANGES
  14. * -------
  15. * 2008/05/23 (1.0.7.22)
  16. * - Added description of extra language features (SF#1970248)
  17. * 2004/11/27 (1.0.2)
  18. * - Added support for multiple object splitters
  19. * 2004/10/27 (1.0.1)
  20. * - Added support for URLs
  21. * - Added binary and hexadecimal regexps
  22. * 2004/08/05 (1.0.0)
  23. * - First Release
  24. *
  25. * TODO (updated 2004/11/27)
  26. * -------------------------
  27. *
  28. *************************************************************************************
  29. *
  30. * This file is part of GeSHi.
  31. *
  32. * GeSHi is free software; you can redistribute it and/or modify
  33. * it under the terms of the GNU General Public License as published by
  34. * the Free Software Foundation; either version 2 of the License, or
  35. * (at your option) any later version.
  36. *
  37. * GeSHi is distributed in the hope that it will be useful,
  38. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40. * GNU General Public License for more details.
  41. *
  42. * You should have received a copy of the GNU General Public License
  43. * along with GeSHi; if not, write to the Free Software
  44. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  45. *
  46. ************************************************************************************/
  47. $language_data = array (
  48. 'LANG_NAME' => 'ASM',
  49. 'COMMENT_SINGLE' => array(1 => ';'),
  50. 'COMMENT_MULTI' => array(),
  51. //Line address prefix suppression
  52. 'COMMENT_REGEXP' => array(2 => "/^(?:[0-9a-f]{0,4}:)?[0-9a-f]{4}(?:[0-9a-f]{4})?/mi"),
  53. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  54. 'QUOTEMARKS' => array("'", '"'),
  55. 'ESCAPE_CHAR' => '',
  56. 'KEYWORDS' => array(
  57. /*CPU*/
  58. 1 => array(
  59. 'aaa','aad','aam','aas','adc','add','and','call','cbw','clc','cld','cli','cmc','cmp',
  60. 'cmps','cmpsb','cmpsw','cwd','daa','das','dec','div','esc','hlt','idiv','imul','in','inc',
  61. 'int','into','iret','ja','jae','jb','jbe','jc','jcxz','je','jg','jge','jl','jle','jmp',
  62. 'jna','jnae','jnb','jnbe','jnc','jne','jng','jnge','jnl','jnle','jno','jnp','jns','jnz',
  63. 'jo','jp','jpe','jpo','js','jz','lahf','lds','lea','les','lods','lodsb','lodsw','loop',
  64. 'loope','loopew','loopne','loopnew','loopnz','loopnzw','loopw','loopz','loopzw','mov',
  65. 'movs','movsb','movsw','mul','neg','nop','not','or','out','pop','popf','push','pushf',
  66. 'rcl','rcr','ret','retf','retn','rol','ror','sahf','sal','sar','sbb','scas','scasb','scasw',
  67. 'shl','shr','stc','std','sti','stos','stosb','stosw','sub','test','wait','xchg','xlat',
  68. 'xlatb','xor','bound','enter','ins','insb','insw','leave','outs','outsb','outsw','popa','pusha','pushw',
  69. 'arpl','lar','lsl','sgdt','sidt','sldt','smsw','str','verr','verw','clts','lgdt','lidt','lldt','lmsw','ltr',
  70. 'bsf','bsr','bt','btc','btr','bts','cdq','cmpsd','cwde','insd','iretd','iretdf','iretf',
  71. 'jecxz','lfs','lgs','lodsd','loopd','looped','loopned','loopnzd','loopzd','lss','movsd',
  72. 'movsx','movzx','outsd','popad','popfd','pushad','pushd','pushfd','scasd','seta','setae',
  73. 'setb','setbe','setc','sete','setg','setge','setl','setle','setna','setnae','setnb','setnbe',
  74. 'setnc','setne','setng','setnge','setnl','setnle','setno','setnp','setns','setnz','seto','setp',
  75. 'setpe','setpo','sets','setz','shld','shrd','stosd','bswap','cmpxchg','invd','invlpg','wbinvd','xadd','lock',
  76. 'rep','repe','repne','repnz','repz'
  77. ),
  78. /*FPU*/
  79. 2 => array(
  80. 'f2xm1','fabs','fadd','faddp','fbld','fbstp','fchs','fclex','fcom','fcomp','fcompp','fdecstp',
  81. 'fdisi','fdiv','fdivp','fdivr','fdivrp','feni','ffree','fiadd','ficom','ficomp','fidiv',
  82. 'fidivr','fild','fimul','fincstp','finit','fist','fistp','fisub','fisubr','fld','fld1',
  83. 'fldcw','fldenv','fldenvw','fldl2e','fldl2t','fldlg2','fldln2','fldpi','fldz','fmul',
  84. 'fmulp','fnclex','fndisi','fneni','fninit','fnop','fnsave','fnsavew','fnstcw','fnstenv',
  85. 'fnstenvw','fnstsw','fpatan','fprem','fptan','frndint','frstor','frstorw','fsave',
  86. 'fsavew','fscale','fsqrt','fst','fstcw','fstenv','fstenvw','fstp','fstsw','fsub','fsubp',
  87. 'fsubr','fsubrp','ftst','fwait','fxam','fxch','fxtract','fyl2x','fyl2xp1',
  88. 'fsetpm','fcos','fldenvd','fnsaved','fnstenvd','fprem1','frstord','fsaved','fsin','fsincos',
  89. 'fstenvd','fucom','fucomp','fucompp'
  90. ),
  91. /*registers*/
  92. 3 => array(
  93. 'ah','al','ax','bh','bl','bp','bx','ch','cl','cr0','cr2','cr3','cs','cx','dh','di','dl',
  94. 'dr0','dr1','dr2','dr3','dr6','dr7','ds','dx','eax','ebp','ebx','ecx','edi','edx',
  95. 'es','esi','esp','fs','gs','si','sp','ss','st','tr3','tr4','tr5','tr6','tr7'
  96. ),
  97. /*Directive*/
  98. 4 => array(
  99. '186','286','286c','286p','287','386','386c','386p','387','486','486p',
  100. '8086','8087','alpha','break','code','const','continue','cref','data','data?',
  101. 'dosseg','else','elseif','endif','endw','equ','err','err1','err2','errb',
  102. 'errdef','errdif','errdifi','erre','erridn','erridni','errnb','errndef',
  103. 'errnz','exit','fardata','fardata?','global','if','lall','lfcond','list','listall',
  104. 'listif','listmacro','listmacroall',' model','no87','nocref','nolist',
  105. 'nolistif','nolistmacro','radix','repeat','sall','seq','sfcond','stack',
  106. 'startup','tfcond','type','until','untilcxz','while','xall','xcref',
  107. 'xlist','alias','align','assume','catstr','comm','comment','db','dd','df','dq',
  108. 'dt','dup','dw','echo','elseif1','elseif2','elseifb','elseifdef','elseifdif',
  109. 'elseifdifi','elseife','elseifidn','elseifidni','elseifnb','elseifndef','end',
  110. 'endm','endp','ends','eq',' equ','even','exitm','extern','externdef','extrn','for',
  111. 'forc','ge','goto','group','high','highword','if1','if2','ifb','ifdef','ifdif',
  112. 'ifdifi','ife',' ifidn','ifidni','ifnb','ifndef','include','includelib','instr','invoke',
  113. 'irp','irpc','label','le','length','lengthof','local','low','lowword','lroffset',
  114. 'macro','mask','mod','msfloat','name','ne','offset','opattr','option','org','%out',
  115. 'page','popcontext','private','proc','proto','ptr','public','purge','pushcontext','record',
  116. 'resb','resd','resw','rept','section','seg','segment','short','size','sizeof','sizestr','struc','struct',
  117. 'substr','subtitle','subttl','textequ','this','title','typedef','union','width',
  118. '.model', '.stack', '.code', '.data'
  119. ),
  120. /*Operands*/
  121. 5 => array(
  122. '@b','@f','addr','basic','byte','c','carry?','dword',
  123. 'far','far16','fortran','fword','near','near16','overflow?','parity?','pascal','qword',
  124. 'real4',' real8','real10','sbyte','sdword','sign?','stdcall','sword','syscall','tbyte',
  125. 'vararg','word','zero?','flat','near32','far32',
  126. 'abs','all','assumes','at','casemap','common','compact',
  127. 'cpu','dotname','emulator','epilogue','error','export','expr16','expr32','farstack',
  128. 'forceframe','huge','language','large','listing','ljmp','loadds','m510','medium','memory',
  129. 'nearstack','nodotname','noemulator','nokeyword','noljmp','nom510','none','nonunique',
  130. 'nooldmacros','nooldstructs','noreadonly','noscoped','nosignextend','nothing',
  131. 'notpublic','oldmacros','oldstructs','os_dos','para','prologue',
  132. 'readonly','req','scoped','setif2','smallstack','tiny','use16','use32','uses'
  133. )
  134. ),
  135. 'SYMBOLS' => array(
  136. '[', ']', '(', ')',
  137. '+', '-', '*', '/', '%',
  138. '.', ',', ';', ':'
  139. ),
  140. 'CASE_SENSITIVE' => array(
  141. GESHI_COMMENTS => false,
  142. 1 => false,
  143. 2 => false,
  144. 3 => false,
  145. 4 => false,
  146. 5 => false
  147. ),
  148. 'STYLES' => array(
  149. 'KEYWORDS' => array(
  150. 1 => 'color: #00007f; font-weight: bold;',
  151. 2 => 'color: #0000ff; font-weight: bold;',
  152. 3 => 'color: #00007f;',
  153. 4 => 'color: #000000; font-weight: bold;',
  154. 5 => 'color: #000000; font-weight: bold;'
  155. ),
  156. 'COMMENTS' => array(
  157. 1 => 'color: #666666; font-style: italic;',
  158. 2 => 'color: #adadad; font-style: italic;',
  159. ),
  160. 'ESCAPE_CHAR' => array(
  161. 0 => 'color: #000099; font-weight: bold;'
  162. ),
  163. 'BRACKETS' => array(
  164. 0 => 'color: #009900; font-weight: bold;'
  165. ),
  166. 'STRINGS' => array(
  167. 0 => 'color: #7f007f;'
  168. ),
  169. 'NUMBERS' => array(
  170. 0 => 'color: #0000ff;'
  171. ),
  172. 'METHODS' => array(
  173. ),
  174. 'SYMBOLS' => array(
  175. 0 => 'color: #339933;'
  176. ),
  177. 'REGEXPS' => array(
  178. // 0 => 'color: #0000ff;',
  179. // 1 => 'color: #0000ff;'
  180. ),
  181. 'SCRIPT' => array(
  182. )
  183. ),
  184. 'URLS' => array(
  185. 1 => '',
  186. 2 => '',
  187. 3 => '',
  188. 4 => '',
  189. 5 => ''
  190. ),
  191. 'NUMBERS' =>
  192. GESHI_NUMBER_BIN_PREFIX_PERCENT |
  193. GESHI_NUMBER_BIN_SUFFIX |
  194. GESHI_NUMBER_HEX_PREFIX |
  195. GESHI_NUMBER_HEX_SUFFIX |
  196. GESHI_NUMBER_OCT_SUFFIX |
  197. GESHI_NUMBER_INT_BASIC |
  198. GESHI_NUMBER_FLT_NONSCI |
  199. GESHI_NUMBER_FLT_NONSCI_F |
  200. GESHI_NUMBER_FLT_SCI_ZERO,
  201. 'OOLANG' => false,
  202. 'OBJECT_SPLITTERS' => array(
  203. ),
  204. 'REGEXPS' => array(
  205. //Hex numbers
  206. // 0 => /* */ "(?<=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))(?:[0-9][0-9a-fA-F]{0,31}[hH]|0x[0-9a-fA-F]{1,32})(?=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))",
  207. //Binary numbers
  208. // 1 => "(?<=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))[01]{1,64}[bB](?=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))"
  209. ),
  210. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  211. 'SCRIPT_DELIMITERS' => array(
  212. ),
  213. 'HIGHLIGHT_STRICT_BLOCK' => array(
  214. ),
  215. 'TAB_WIDTH' => 8,
  216. 'PARSER_CONTROL' => array(
  217. 'KEYWORDS' => array(
  218. 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
  219. 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_<\|%])"
  220. )
  221. )
  222. );
  223. ?>