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.

6502tasm.php 6.9KB

11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php
  2. /*************************************************************************************
  3. * 6502tasm.php
  4. * -------
  5. * Author: Warren Willmey
  6. * Copyright: (c) 2010 Warren Willmey.
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2010/06/02
  9. *
  10. * MOS 6502 (6510) TASM/64TASS (64TASS being the super set of TASM) 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) TASM/64TASS 1.46 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. */
  63. 3 => array(
  64. '.al', '.align', '.as', '.assert', '.binary', '.byte', '.cerror', '.char',
  65. '.comment', '.cpu', '.cwarn', '.databank', '.dpage', '.else', '.elsif',
  66. '.enc', '.endc', '.endif', '.endm', '.endp', '.error', '.fi', '.fill',
  67. '.for', '.here', '.if', '.ifeq', '.ifmi', '.ifne', '.ifpl',
  68. '.include', '.int', '.logical', '.long', '.macro', '.next', '.null', '.offs',
  69. '.page', '.pend', '.proc', '.rept', '.rta', '.shift', '.text', '.warn', '.word',
  70. '.xl', '.xs',
  71. // , '*=' // Not a valid keyword (uses both * and = signs) moved to symbols instead.
  72. ),
  73. /* 6502/6510 undocumented opcodes (often referred to as illegal instructions).
  74. * These are present in the 6502/6510 but NOT in the newer CMOS revisions of the 65C02 or 65816.
  75. * As they are undocumented instructions there are no "official" names for them, these are the names
  76. * used by 64TASS V1.46.
  77. */
  78. 4 => array(
  79. 'ahx', 'alr', 'anc', 'ane', 'arr', 'asr', 'axs', 'dcm',
  80. 'dcp', 'ins', 'isb', 'isc', 'jam', 'lae', 'las', 'lax',
  81. 'lds', 'lxa', 'rla', 'rra', 'sax', 'sbx', 'sha', 'shs',
  82. 'shx', 'shy', 'slo', 'sre', 'tas', 'xaa',
  83. ),
  84. /* 65c02 instructions, MOS added a few (much needed) instructions in the
  85. * CMOS version of the 6502, but stupidly removed the undocumented/illegal opcodes. */
  86. 5 => array(
  87. 'bra', 'dea', 'gra', 'ina', 'phx', 'phy', 'plx', 'ply',
  88. 'stz', 'trb', 'tsb',
  89. ),
  90. /* 65816 instructions. */
  91. 6 => array(
  92. 'brl', 'cop', 'jml', 'jsl', 'mvn', 'mvp', 'pea', 'pei',
  93. 'per', 'phb', 'phd', 'phk', 'plb', 'pld', 'rep', 'rtl',
  94. 'sep', 'stp', 'swa', 'tad', 'tcd', 'tcs', 'tda',
  95. 'tdc', 'tsa', 'tsc', 'txy', 'tyx', 'wai', 'xba', 'xce',
  96. ),
  97. /* Deprecated directives (or yet to be implemented). */
  98. 7 => array(
  99. '.global', '.check'
  100. ),
  101. ),
  102. 'SYMBOLS' => array(
  103. // '[', ']', '(', ')', '{', '}', // These are already defined by GeSHi as BRACKETS.
  104. '*=', '#', '<', '>', '`', '=', '<', '>',
  105. '!=', '>=', '<=', '+', '-', '*', '/', '//', '|',
  106. '^', '&', '<<', '>>', '-', '~', '!',
  107. ),
  108. 'CASE_SENSITIVE' => array(
  109. GESHI_COMMENTS => false,
  110. 1 => false,
  111. 2 => false,
  112. 3 => false,
  113. 4 => false,
  114. 5 => false,
  115. 6 => false,
  116. 7 => false,
  117. ),
  118. 'STYLES' => array(
  119. 'KEYWORDS' => array(
  120. 1 => 'color: #00f; font-weight:bold;',
  121. 2 => 'color: #00f; font-weight:bold;',
  122. 3 => 'color: #080; font-weight:bold;',
  123. 4 => 'color: #f00; font-weight:bold;',
  124. 5 => 'color: #80f; font-weight:bold;',
  125. 6 => 'color: #f08; font-weight:bold;',
  126. 7 => 'color: #a04; font-weight:bold; font-style: italic;',
  127. ),
  128. 'COMMENTS' => array(
  129. 1 => 'color: #999; font-style: italic;',
  130. ),
  131. 'ESCAPE_CHAR' => array(
  132. 0 => 'color: #009; font-weight: bold;'
  133. ),
  134. 'BRACKETS' => array(
  135. 0 => 'color: #000;'
  136. ),
  137. 'STRINGS' => array(
  138. 0 => 'color: #080;'
  139. ),
  140. 'NUMBERS' => array(
  141. GESHI_NUMBER_INT_BASIC => 'color: #f00;',
  142. GESHI_NUMBER_HEX_PREFIX_DOLLAR => 'color: #f00;',
  143. GESHI_NUMBER_BIN_PREFIX_PERCENT => 'color: #f00;',
  144. ),
  145. 'METHODS' => array(
  146. ),
  147. 'SYMBOLS' => array(
  148. 0 => 'color: #080;'
  149. ),
  150. 'REGEXPS' => array(
  151. ),
  152. 'SCRIPT' => array(
  153. )
  154. ),
  155. 'URLS' => array(
  156. 1 => '',
  157. 2 => '',
  158. 3 => '',
  159. 4 => '',
  160. 5 => '',
  161. 6 => '',
  162. 7 => '',
  163. ),
  164. 'OOLANG' => false,
  165. 'OBJECT_SPLITTERS' => array(
  166. ),
  167. 'NUMBERS' =>
  168. GESHI_NUMBER_INT_BASIC |
  169. GESHI_NUMBER_HEX_PREFIX_DOLLAR |
  170. GESHI_NUMBER_BIN_PREFIX_PERCENT,
  171. // AMCE Octal format not support and gets picked up as Decimal unfortunately.
  172. 'REGEXPS' => array(
  173. ),
  174. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  175. 'SCRIPT_DELIMITERS' => array(
  176. ),
  177. 'HIGHLIGHT_STRICT_BLOCK' => array(
  178. ),
  179. 'TAB_WIDTH' => 8,
  180. 'PARSER_CONTROL' => array(
  181. 'NUMBERS' => array(
  182. 'PRECHECK_RX' => '/[\da-fA-F\.\$\%]/'
  183. )
  184. )
  185. );
  186. ?>