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.

230 lines
8.0KB

  1. <?php
  2. /*************************************************************************************
  3. * 6502acme.php
  4. * -------
  5. * Author: Warren Willmey
  6. * Copyright: (c) 2010 Warren Willmey.
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2010/05/26
  9. *
  10. * MOS 6502 (more specifically 6510) ACME Cross Assembler 0.93 by Marco Baye 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) ACME Cross 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. */
  48. 1 => array(
  49. 'adc', 'and', 'asl', 'bcc', 'bcs', 'beq', 'bit', 'bmi',
  50. 'bne', 'bpl', 'brk', 'bvc', 'bvs', 'clc', 'cld', 'cli',
  51. 'clv', 'cmp', 'cpx', 'cpy', 'dec', 'dex', 'dey', 'eor',
  52. 'inc', 'inx', 'iny', 'jmp', 'jsr', 'lda', 'ldx', 'ldy',
  53. 'lsr', 'nop', 'ora', 'pha', 'php', 'pla', 'plp', 'rol',
  54. 'ror', 'rti', 'rts', 'sbc', 'sec', 'sed', 'sei', 'sta',
  55. 'stx', 'sty', 'tax', 'tay', 'tsx', 'txa', 'txs', 'tya',
  56. ),
  57. /* Index Registers, yes the 6502 has other registers by they are only
  58. * accessable by specific opcodes. The 65816 also has access to the stack pointer S. */
  59. 2 => array(
  60. 'x', 'y', 's'
  61. ),
  62. /* Directives or "pseudo opcodes" as defined by ACME 0.93 file AllPOs.txt. */
  63. 3 => array(
  64. '!8', '!08', '!by', '!byte',
  65. '!16', '!wo', '!word',
  66. '!24', '!32',
  67. '!fi', '!fill',
  68. '!align',
  69. '!ct', '!convtab',
  70. '!tx', '!text',
  71. '!pet',
  72. '!raw',
  73. '!scrxor',
  74. '!to',
  75. '!source',
  76. '!bin', '!binary',
  77. '!zn', '!zone',
  78. '!sl',
  79. '!svl',
  80. '!sal',
  81. '!if', '!ifdef',
  82. '!for',
  83. '!set',
  84. '!do', 'while', 'until',
  85. '!eof', '!endoffile',
  86. '!warn', '!error', '!serious',
  87. '!macro',
  88. // , '*=' // Not a valid keyword (uses both * and = signs) moved to symbols instead.
  89. '!initmem',
  90. '!pseudopc',
  91. '!cpu',
  92. '!al', '!as', '!rl', '!rs',
  93. ),
  94. /* 6502/6510 undocumented opcodes (often referred to as illegal instructions).
  95. * These are present in the 6502/6510 but NOT in the newer CMOS revisions of the 65C02 or 65816.
  96. * As they are undocumented instructions there are no "official" names for them, there are also
  97. * several more that mainly perform various forms of crash and are not supported by ACME 0.93.
  98. */
  99. 4 => array(
  100. 'anc', 'arr', 'asr', 'dcp', 'dop', 'isc', 'jam', 'lax',
  101. 'rla', 'rra', 'sax', 'sbx', 'slo', 'sre', 'top',
  102. ),
  103. /* 65c02 instructions, MOS added a few (much needed) instructions in the CMOS version of the 6502, but stupidly removed the undocumented/illegal opcodes.
  104. * ACME 0.93 does not support the rmb0-7 and smb0-7 instructions (they are currently rem'ed out). */
  105. 5 => array(
  106. 'bra', 'phx', 'phy', 'plx', 'ply', 'stz', 'trb', 'tsb'
  107. ),
  108. /* 65816 instructions. */
  109. 6 => array(
  110. 'brl', 'cop', 'jml', 'jsl', 'mvn', 'mvp', 'pea', 'pei',
  111. 'per', 'phb', 'phd', 'phk', 'plb', 'pld', 'rep', 'rtl',
  112. 'sep', 'tcd', 'tcs', 'tdc', 'tsc', 'txy', 'tyx', 'wdm',
  113. 'xba', 'xce',
  114. ),
  115. /* Deprecated directives or "pseudo opcodes" as defined by ACME 0.93 file AllPOs.txt. */
  116. 7 => array(
  117. '!cbm',
  118. '!sz', '!subzone',
  119. '!realpc',
  120. ),
  121. /* Math functions, some are aliases for the symbols. */
  122. 8 => array(
  123. 'not', 'div', 'mod', 'xor', 'or', 'sin', 'cos', 'tan',
  124. 'arcsin', 'arccos', 'arctan', 'int', 'float',
  125. ),
  126. ),
  127. 'SYMBOLS' => array(
  128. // '[', ']', '(', ')', '{', '}', // These are already defined by GeSHi as BRACKETS.
  129. '*=', '#', '!', '^', '-', '*', '/',
  130. '%', '+', '-', '<<', '>>', '>>>',
  131. '<', '>', '^', '<=', '<', '>=', '>', '!=',
  132. '=', '&', '|', '<>',
  133. ),
  134. 'CASE_SENSITIVE' => array(
  135. GESHI_COMMENTS => false,
  136. 1 => false,
  137. 2 => false,
  138. 3 => false,
  139. 4 => false,
  140. 5 => false,
  141. 6 => false,
  142. 7 => false,
  143. 8 => false,
  144. ),
  145. 'STYLES' => array(
  146. 'KEYWORDS' => array(
  147. 1 => 'color: #00f; font-weight:bold;',
  148. 2 => 'color: #00f; font-weight:bold;',
  149. 3 => 'color: #080; font-weight:bold;',
  150. 4 => 'color: #f00; font-weight:bold;',
  151. 5 => 'color: #80f; font-weight:bold;',
  152. 6 => 'color: #f08; font-weight:bold;',
  153. 7 => 'color: #a04; font-weight:bold; font-style: italic;',
  154. 8 => 'color: #000;',
  155. ),
  156. 'COMMENTS' => array(
  157. 1 => 'color: #999; font-style: italic;',
  158. ),
  159. 'ESCAPE_CHAR' => array(
  160. 0 => 'color: #009; font-weight: bold;'
  161. ),
  162. 'BRACKETS' => array(
  163. 0 => 'color: #000;'
  164. ),
  165. 'STRINGS' => array(
  166. 0 => 'color: #080;'
  167. ),
  168. 'NUMBERS' => array(
  169. GESHI_NUMBER_INT_BASIC => 'color: #f00;',
  170. GESHI_NUMBER_HEX_PREFIX_DOLLAR => 'color: #f00;',
  171. GESHI_NUMBER_HEX_PREFIX => 'color: #f00;',
  172. GESHI_NUMBER_BIN_PREFIX_PERCENT => 'color: #f00;',
  173. GESHI_NUMBER_FLT_NONSCI => 'color: #f00;',
  174. ),
  175. 'METHODS' => array(
  176. ),
  177. 'SYMBOLS' => array(
  178. 0 => 'color: #080;'
  179. ),
  180. 'REGEXPS' => array(
  181. 0 => 'color: #f00;'
  182. , 1 => 'color: #933;'
  183. ),
  184. 'SCRIPT' => array(
  185. )
  186. ),
  187. 'URLS' => array(
  188. 1 => '',
  189. 2 => '',
  190. 3 => '',
  191. 4 => '',
  192. 5 => '',
  193. 6 => '',
  194. 7 => '',
  195. 8 => '',
  196. ),
  197. 'OOLANG' => false,
  198. 'OBJECT_SPLITTERS' => array(
  199. ),
  200. 'NUMBERS' =>
  201. GESHI_NUMBER_INT_BASIC |
  202. GESHI_NUMBER_FLT_NONSCI |
  203. GESHI_NUMBER_HEX_PREFIX_DOLLAR |
  204. GESHI_NUMBER_HEX_PREFIX |
  205. GESHI_NUMBER_BIN_PREFIX_PERCENT,
  206. // AMCE Octal format not support and gets picked up as Decimal unfortunately.
  207. 'REGEXPS' => array(
  208. //ACME .# Binary number format. e.g. %..##..##..##
  209. 0 => '\%[\.\#]{1,64}',
  210. //ACME Local Labels
  211. 1 => '\.[_a-zA-Z][_a-zA-Z0-9]*',
  212. ),
  213. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  214. 'SCRIPT_DELIMITERS' => array(
  215. ),
  216. 'HIGHLIGHT_STRICT_BLOCK' => array(
  217. ),
  218. 'TAB_WIDTH' => 8,
  219. 'PARSER_CONTROL' => array(
  220. 'NUMBERS' => array(
  221. 'PRECHECK_RX' => '/[\da-fA-F\.\$\%]/'
  222. )
  223. )
  224. );
  225. ?>