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.

241 lines
9.8KB

  1. <?php
  2. /*************************************************************************************
  3. * 6502kickass.php
  4. * -------
  5. * Author: Warren Willmey
  6. * Copyright: (c) 2010 Warren Willmey.
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2010/06/07
  9. *
  10. * MOS 6502 (6510) Kick Assembler 3.13 language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2010/07/22
  15. * - First Release
  16. *
  17. * TODO (updated 2010/07/22)
  18. * -------------------------
  19. *
  20. *************************************************************************************
  21. *
  22. * This file is part of GeSHi.
  23. *
  24. * GeSHi is free software; you can redistribute it and/or modify
  25. * it under the terms of the GNU General Public License as published by
  26. * the Free Software Foundation; either version 2 of the License, or
  27. * (at your option) any later version.
  28. *
  29. * GeSHi is distributed in the hope that it will be useful,
  30. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. * GNU General Public License for more details.
  33. *
  34. * You should have received a copy of the GNU General Public License
  35. * along with GeSHi; if not, write to the Free Software
  36. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  37. *
  38. ************************************************************************************/
  39. $language_data = array (
  40. 'LANG_NAME' => 'MOS 6502 (6510) Kick Assembler format',
  41. 'COMMENT_SINGLE' => array(1 => '//'),
  42. 'COMMENT_MULTI' => array('/*' => '*/'),
  43. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  44. 'QUOTEMARKS' => array("'", '"'),
  45. 'ESCAPE_CHAR' => '',
  46. 'KEYWORDS' => array(
  47. /* 6502/6510 Opcodes including undocumented opcodes as Kick Assembler 3.13 does not make a distinction - they are ALL valid. */
  48. 1 => array(
  49. 'adc', 'ahx', 'alr', 'anc', 'anc2', 'and', 'arr', 'asl',
  50. 'axs', 'bcc', 'bcs', 'beq', 'bit', 'bmi', 'bne', 'bpl',
  51. 'brk', 'bvc', 'bvs', 'clc', 'cld', 'cli', 'clv', 'cmp',
  52. 'cpx', 'cpy', 'dcp', 'dec', 'dex', 'dey', 'eor', 'inc',
  53. 'inx', 'iny', 'isc', 'jmp', 'jsr', 'las', 'lax', 'lda',
  54. 'ldx', 'ldy', 'lsr', 'nop', 'ora', 'pha', 'php', 'pla',
  55. 'plp', 'rla', 'rol', 'ror', 'rra', 'rti', 'rts', 'sax',
  56. 'sbc', 'sbc2', 'sec', 'sed', 'sei', 'shx', 'shy', 'slo',
  57. 'sre', 'sta', 'stx', 'sty', 'tas', 'tax', 'tay', 'tsx',
  58. 'txa', 'txs', 'tya', 'xaa',
  59. ),
  60. /* DTV additional Opcodes. */
  61. 2 => array(
  62. 'bra', 'sac', 'sir'
  63. ),
  64. /* Index Registers, yes the 6502 has other registers by they are only
  65. * accessable by specific opcodes. */
  66. 3 => array(
  67. 'x', 'y'
  68. ),
  69. /* Directives. */
  70. 4 => array(
  71. '.pc', '.pseudopc', 'virtual', '.align', '.byte', '.word', '.text', '.fill',
  72. '.import source', '.import binary', '.import c64', '.import text', '.import', '.print', '.printnow',
  73. '.error', '.var', '.eval', '.const', '.eval const', '.enum', '.label', '.define', '.struct',
  74. 'if', '.for', '.macro', '.function', '.return', '.pseudocommand', '.namespace', '.filenamespace',
  75. '.assert', '.asserterror',
  76. ),
  77. /* Kick Assembler 3.13 Functions/Operators. */
  78. 5 => array(
  79. 'size', 'charAt', 'substring', 'asNumber', 'asBoolean', 'toIntString', 'toBinaryString', 'toOctalString',
  80. 'toHexString', 'lock', // String functions/operators.
  81. 'get', 'set', 'add', 'remove', 'shuffle', // List functions.
  82. 'put', 'keys', // Hashtable functions.
  83. 'getType', 'getValue', 'CmdArgument', // Pseudo Commands functions.
  84. 'asmCommandSize', // Opcode Constants functions.
  85. 'LoadBinary', 'getSize',
  86. 'LoadSid', 'getData',
  87. 'LoadPicture', 'width', 'height', 'getPixel', 'getSinglecolorByte', 'getMulticolorByte',
  88. 'createFile', 'writeln',
  89. 'cmdLineVars',
  90. 'getX', 'getY', 'getZ', // Vector functions.
  91. 'RotationMatrix', 'ScaleMatrix', 'MoveMatrix', 'PerspectiveMatrix', // Matrix functions.
  92. ),
  93. /* Kick Assembler 3.13 Math Functions. */
  94. 6 => array(
  95. 'abs', 'acos', 'asin', 'atan', 'atan2', 'cbrt', 'ceil', 'cos', 'cosh',
  96. 'exp', 'expm1', 'floor', 'hypot', 'IEEEremainder', 'log', 'log10',
  97. 'log1p', 'max', 'min', 'pow', 'mod', 'random', 'round', 'signum',
  98. 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'toDegrees', 'toRadians',
  99. ),
  100. /* Kick Assembler 3.13 Objects/Data Types. */
  101. 7 => array(
  102. 'List', // List() Object.
  103. 'Hashtable', // Hashtable() Object.
  104. 'Vector', // Vector() Object.
  105. 'Matrix', // Matrix() Object.
  106. ),
  107. /* Kick Assembler 3.13 Constants. */
  108. 8 => array(
  109. 'PI', 'E', // Math Constants.
  110. 'AT_ABSOLUTE' , 'AT_ABSOLUTEX' , 'AT_ABSOLUTEY' , 'AT_IMMEDIATE', // Pseudo Commands Constants.
  111. 'AT_INDIRECT' , 'AT_IZEROPAGEX' , 'AT_IZEROPAGEY' , 'AT_NONE',
  112. 'BLACK', 'WHITE', 'RED', 'CYAN', 'PURPLE', 'GREEN', 'BLUE', // Colour Constants.
  113. 'YELLOW', 'ORANGE', 'BROWN', 'LIGHT_RED', 'DARK_GRAY', 'GRAY',
  114. 'LIGHT_GREEN', 'LIGHT_BLUE', 'LIGHT_GRAY',
  115. 'C64FILE', // Template Tag names.
  116. 'BF_C64FILE', 'BF_BITMAP_SINGLECOLOR', 'BF_KOALA' , 'BF_FLI', // Binary format constant
  117. ),
  118. ),
  119. 'SYMBOLS' => array(
  120. // '[', ']', '(', ')', '{', '}', // These are already defined by GeSHi as BRACKETS.
  121. '-', '+', '-', '*', '/', '>', '<', '<<', '>>', '&', '|', '^', '=', '==',
  122. '!=', '>=', '<=', '!', '&&', '||', '#',
  123. ),
  124. 'CASE_SENSITIVE' => array(
  125. GESHI_COMMENTS => false,
  126. 1 => false,
  127. 2 => false,
  128. 3 => false,
  129. 4 => true,
  130. 5 => true,
  131. 6 => true,
  132. 7 => true,
  133. 8 => true,
  134. ),
  135. 'STYLES' => array(
  136. 'KEYWORDS' => array(
  137. 1 => 'color: #00f; font-weight:bold;',
  138. 2 => 'color: #00f; font-weight:bold;',
  139. 3 => 'color: #00f; font-weight:bold;',
  140. 4 => 'color: #080; font-weight:bold;',
  141. 5 => 'color: #80f; font-weight:bold;',
  142. 6 => 'color: #f08; font-weight:bold;',
  143. 7 => 'color: #a04; font-weight:bold; font-style: italic;',
  144. 8 => 'color: #f08; font-weight:bold;',
  145. ),
  146. 'COMMENTS' => array(
  147. 1 => 'color: #999; font-style: italic;',
  148. ),
  149. 'ESCAPE_CHAR' => array(
  150. 0 => 'color: #009; font-weight: bold;'
  151. ),
  152. 'BRACKETS' => array(
  153. 0 => 'color: #000;'
  154. ),
  155. 'STRINGS' => array(
  156. 0 => 'color: #080;'
  157. ),
  158. 'NUMBERS' => array(
  159. GESHI_NUMBER_INT_BASIC => 'color: #f00;',
  160. GESHI_NUMBER_HEX_PREFIX_DOLLAR => 'color: #f00;',
  161. GESHI_NUMBER_BIN_PREFIX_PERCENT => 'color: #f00;',
  162. GESHI_NUMBER_FLT_NONSCI => 'color: #f00;',
  163. ),
  164. 'METHODS' => array(
  165. ),
  166. 'SYMBOLS' => array(
  167. 0 => 'color: #080;'
  168. ),
  169. 'REGEXPS' => array(
  170. 0 => 'color: #933;',
  171. 1 => 'color: #933;',
  172. 2 => 'color: #933;',
  173. 3 => 'color: #00f; font-weight:bold;',
  174. ),
  175. 'SCRIPT' => array(
  176. )
  177. ),
  178. 'URLS' => array(
  179. 1 => '',
  180. 2 => '',
  181. 3 => '',
  182. 4 => '',
  183. 5 => '',
  184. 6 => '',
  185. 7 => '',
  186. 8 => '',
  187. ),
  188. 'OOLANG' => false,
  189. 'OBJECT_SPLITTERS' => array(
  190. ),
  191. 'NUMBERS' =>
  192. GESHI_NUMBER_INT_BASIC |
  193. GESHI_NUMBER_FLT_NONSCI |
  194. GESHI_NUMBER_HEX_PREFIX_DOLLAR |
  195. GESHI_NUMBER_BIN_PREFIX_PERCENT,
  196. // AMCE Octal format not support and gets picked up as Decimal unfortunately.
  197. 'REGEXPS' => array(
  198. //Labels end with a collon.
  199. 0 => '[!]{0,1}[_a-zA-Z][_a-zA-Z0-9]*\:',
  200. //Multi Labels (local labels) references start with ! and end with + or - for forward/backward reference.
  201. 1 => '![_a-zA-Z][_a-zA-Z0-9]*[+-]',
  202. //Macros start with a colon :Macro.
  203. 2 => ':[_a-zA-Z][_a-zA-Z0-9]*',
  204. // Opcode Constants, such as LDA_IMM, STA_IZPY are basically all 6502 opcodes
  205. // in UPPER case followed by _underscore_ and the ADDRESS MODE.
  206. // As you might imagine that is rather a lot ( 78 supported Opcodes * 12 Addressing modes = 936 variations)
  207. // So I thought it better and easier to maintain as a regular expression.
  208. // NOTE: The order of the Address Modes must be maintained or it wont work properly (eg. place ZP first and find out!)
  209. 3 => '[A-Z]{3}[2]?_(?:IMM|IND|IZPX|IZPY|ZPX|ZPY|ABSX|ABSY|REL|ABS|ZP)',
  210. ),
  211. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  212. 'SCRIPT_DELIMITERS' => array(
  213. ),
  214. 'HIGHLIGHT_STRICT_BLOCK' => array(
  215. ),
  216. 'TAB_WIDTH' => 8,
  217. 'PARSER_CONTROL' => array(
  218. 'NUMBERS' => array(
  219. 'PRECHECK_RX' => '/[\da-fA-F\.\$\%]/'
  220. ),
  221. 'KEYWORDS' => array(
  222. 5 => array (
  223. 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\;>|^&'\"])"
  224. ),
  225. 6 => array (
  226. 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\;>|^&'\"])"
  227. ),
  228. 8 => array (
  229. 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\;>|^&'\"])"
  230. )
  231. )
  232. ),
  233. );
  234. ?>