w65-opc.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. /* Instruction opcode header for WDC 65816
  2. (generated by the program sim/w65/gencode -a)
  3. Copyright (C) 2001-2015 Free Software Foundation, Inc.
  4. This file is part of the GNU opcodes library.
  5. This library is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. It is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this file; see the file COPYING. If not, write to the
  15. Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #define ADDR_IMMTOA 1 /* #a */
  18. #define ADDR_IMMCOP 2 /* #c */
  19. #define ADDR_IMMTOI 3 /* #i */
  20. #define ADDR_ACC 4 /* A */
  21. #define ADDR_PC_REL 5 /* r */
  22. #define ADDR_PC_REL_LONG 6 /* rl */
  23. #define ADDR_IMPLIED 7 /* i */
  24. #define ADDR_STACK 8 /* s */
  25. #define ADDR_DIR 9 /* d */
  26. #define ADDR_DIR_IDX_X 10 /* d,x */
  27. #define ADDR_DIR_IDX_Y 11 /* d,y */
  28. #define ADDR_DIR_IND 12 /* (d) */
  29. #define ADDR_DIR_IDX_IND_X 13 /* (d,x) */
  30. #define ADDR_DIR_IND_IDX_Y 14 /* (d),y */
  31. #define ADDR_DIR_IND_LONG 15 /* [d] */
  32. #define ADDR_DIR_IND_IDX_Y_LONG 16 /* [d],y */
  33. #define ADDR_ABS 17 /* a */
  34. #define ADDR_ABS_IDX_X 18 /* a,x */
  35. #define ADDR_ABS_IDX_Y 19 /* a,y */
  36. #define ADDR_ABS_LONG 20 /* al */
  37. #define ADDR_ABS_IND_LONG 21 /* [a] */
  38. #define ADDR_ABS_LONG_IDX_X 22 /* al,x */
  39. #define ADDR_STACK_REL 23 /* d,s */
  40. #define ADDR_STACK_REL_INDX_IDX 24 /* (d,s),y */
  41. #define ADDR_ABS_IND 25 /* (a) */
  42. #define ADDR_ABS_IND_IDX 26 /* (a,x) */
  43. #define ADDR_BLOCK_MOVE 27 /* xyz */
  44. struct opinfo {
  45. int val;
  46. int code;
  47. char *name;
  48. int amode;
  49. };
  50. const struct opinfo optable[257]={
  51. #define O_adc 1
  52. #define O_and 2
  53. #define O_asl 3
  54. #define O_bcc 4
  55. #define O_bcs 5
  56. #define O_beq 6
  57. #define O_bit 7
  58. #define O_bmi 8
  59. #define O_bne 9
  60. #define O_bpl 10
  61. #define O_bra 11
  62. #define O_brk 12
  63. #define O_brl 13
  64. #define O_bvc 14
  65. #define O_bvs 15
  66. #define O_clc 16
  67. #define O_cld 17
  68. #define O_cli 18
  69. #define O_clv 19
  70. #define O_cmp 20
  71. #define O_cop 21
  72. #define O_cpx 22
  73. #define O_cpy 23
  74. #define O_dec 24
  75. #define O_dex 25
  76. #define O_dey 26
  77. #define O_eor 27
  78. #define O_inc 28
  79. #define O_inx 29
  80. #define O_iny 30
  81. #define O_jmp 31
  82. #define O_jsr 32
  83. #define O_lda 33
  84. #define O_ldx 34
  85. #define O_ldy 35
  86. #define O_lsr 36
  87. #define O_mvn 37
  88. #define O_mvp 38
  89. #define O_nop 39
  90. #define O_ora 40
  91. #define O_pea 41
  92. #define O_pei 42
  93. #define O_per 43
  94. #define O_pha 44
  95. #define O_phb 45
  96. #define O_phd 46
  97. #define O_phk 47
  98. #define O_php 48
  99. #define O_phx 49
  100. #define O_phy 50
  101. #define O_pla 51
  102. #define O_plb 52
  103. #define O_pld 53
  104. #define O_plp 54
  105. #define O_plx 55
  106. #define O_ply 56
  107. #define O_rep 57
  108. #define O_rol 58
  109. #define O_ror 59
  110. #define O_rti 60
  111. #define O_rtl 61
  112. #define O_rts 62
  113. #define O_sbc 63
  114. #define O_sec 64
  115. #define O_sed 65
  116. #define O_sei 66
  117. #define O_sep 67
  118. #define O_sta 68
  119. #define O_stp 69
  120. #define O_stx 70
  121. #define O_sty 71
  122. #define O_stz 72
  123. #define O_tax 73
  124. #define O_tay 74
  125. #define O_tcd 75
  126. #define O_tcs 76
  127. #define O_tdc 77
  128. #define O_trb 78
  129. #define O_tsb 79
  130. #define O_tsc 80
  131. #define O_tsx 81
  132. #define O_txa 82
  133. #define O_txs 83
  134. #define O_txy 84
  135. #define O_tya 85
  136. #define O_tyx 86
  137. #define O_wai 87
  138. #define O_wdm 88
  139. #define O_xba 89
  140. #define O_xce 90
  141. #ifdef DEFINE_TABLE
  142. {0x69, O_adc, "adc", ADDR_IMMTOA},
  143. {0x72, O_adc, "adc", ADDR_DIR_IND},
  144. {0x71, O_adc, "adc", ADDR_DIR_IND_IDX_Y},
  145. {0x73, O_adc, "adc", ADDR_STACK_REL_INDX_IDX},
  146. {0x61, O_adc, "adc", ADDR_DIR_IDX_IND_X},
  147. {0x67, O_adc, "adc", ADDR_DIR_IND_LONG},
  148. {0x77, O_adc, "adc", ADDR_DIR_IND_IDX_Y_LONG},
  149. {0x6D, O_adc, "adc", ADDR_ABS},
  150. {0x7D, O_adc, "adc", ADDR_ABS_IDX_X},
  151. {0x79, O_adc, "adc", ADDR_ABS_IDX_Y},
  152. {0x6F, O_adc, "adc", ADDR_ABS_LONG},
  153. {0x7F, O_adc, "adc", ADDR_ABS_LONG_IDX_X},
  154. {0x65, O_adc, "adc", ADDR_DIR},
  155. {0x63, O_adc, "adc", ADDR_STACK_REL},
  156. {0x75, O_adc, "adc", ADDR_DIR_IDX_X},
  157. {0x29, O_and, "and", ADDR_IMMTOA},
  158. {0x32, O_and, "and", ADDR_DIR_IND},
  159. {0x31, O_and, "and", ADDR_DIR_IND_IDX_Y},
  160. {0x33, O_and, "and", ADDR_STACK_REL_INDX_IDX},
  161. {0x21, O_and, "and", ADDR_DIR_IDX_IND_X},
  162. {0x27, O_and, "and", ADDR_DIR_IND_LONG},
  163. {0x37, O_and, "and", ADDR_DIR_IND_IDX_Y_LONG},
  164. {0x2D, O_and, "and", ADDR_ABS},
  165. {0x3D, O_and, "and", ADDR_ABS_IDX_X},
  166. {0x39, O_and, "and", ADDR_ABS_IDX_Y},
  167. {0x2F, O_and, "and", ADDR_ABS_LONG},
  168. {0x3F, O_and, "and", ADDR_ABS_LONG_IDX_X},
  169. {0x25, O_and, "and", ADDR_DIR},
  170. {0x23, O_and, "and", ADDR_STACK_REL},
  171. {0x35, O_and, "and", ADDR_DIR_IDX_X},
  172. {0x0A, O_asl, "asl", ADDR_ACC},
  173. {0x0E, O_asl, "asl", ADDR_ABS},
  174. {0x1E, O_asl, "asl", ADDR_ABS_IDX_X},
  175. {0x06, O_asl, "asl", ADDR_DIR},
  176. {0x16, O_asl, "asl", ADDR_DIR_IDX_X},
  177. {0x90, O_bcc, "bcc", ADDR_PC_REL},
  178. {0xB0, O_bcs, "bcs", ADDR_PC_REL},
  179. {0xF0, O_beq, "beq", ADDR_PC_REL},
  180. {0x89, O_bit, "bit", ADDR_IMMTOA},
  181. {0x24, O_bit, "bit", ADDR_DIR_IND},
  182. {0x34, O_bit, "bit", ADDR_DIR_IDX_IND_X},
  183. {0x2C, O_bit, "bit", ADDR_ABS},
  184. {0x3C, O_bit, "bit", ADDR_ABS_IDX_X},
  185. {0x30, O_bmi, "bmi", ADDR_PC_REL},
  186. {0xD0, O_bne, "bne", ADDR_PC_REL},
  187. {0x10, O_bpl, "bpl", ADDR_PC_REL},
  188. {0x80, O_bra, "bra", ADDR_PC_REL},
  189. {0x00, O_brk, "brk", ADDR_STACK},
  190. {0x82, O_brl, "brl", ADDR_PC_REL_LONG},
  191. {0x50, O_bvc, "bvc", ADDR_PC_REL},
  192. {0x70, O_bvs, "bvs", ADDR_PC_REL},
  193. {0x18, O_clc, "clc", ADDR_IMPLIED},
  194. {0xD8, O_cld, "cld", ADDR_IMPLIED},
  195. {0x58, O_cli, "cli", ADDR_IMPLIED},
  196. {0xB8, O_clv, "clv", ADDR_IMPLIED},
  197. {0xC9, O_cmp, "cmp", ADDR_IMMTOA},
  198. {0xD2, O_cmp, "cmp", ADDR_DIR_IND},
  199. {0xD1, O_cmp, "cmp", ADDR_DIR_IND_IDX_Y},
  200. {0xD3, O_cmp, "cmp", ADDR_STACK_REL_INDX_IDX},
  201. {0xC1, O_cmp, "cmp", ADDR_DIR_IDX_IND_X},
  202. {0xC7, O_cmp, "cmp", ADDR_DIR_IND_LONG},
  203. {0xD7, O_cmp, "cmp", ADDR_DIR_IND_IDX_Y_LONG},
  204. {0xCD, O_cmp, "cmp", ADDR_ABS},
  205. {0xDD, O_cmp, "cmp", ADDR_ABS_IDX_X},
  206. {0xD9, O_cmp, "cmp", ADDR_ABS_IDX_Y},
  207. {0xCF, O_cmp, "cmp", ADDR_ABS_LONG},
  208. {0xDF, O_cmp, "cmp", ADDR_ABS_LONG_IDX_X},
  209. {0xC5, O_cmp, "cmp", ADDR_DIR},
  210. {0xC3, O_cmp, "cmp", ADDR_STACK_REL},
  211. {0xD5, O_cmp, "cmp", ADDR_DIR_IDX_X},
  212. {0x02, O_cop, "cop", ADDR_IMMCOP},
  213. {0xE0, O_cpx, "cpx", ADDR_IMMTOI},
  214. {0xEC, O_cpx, "cpx", ADDR_ABS},
  215. {0xE4, O_cpx, "cpx", ADDR_DIR},
  216. {0xC0, O_cpy, "cpy", ADDR_IMMTOI},
  217. {0xCC, O_cpy, "cpy", ADDR_ABS},
  218. {0xC4, O_cpy, "cpy", ADDR_DIR},
  219. {0x3A, O_dec, "dec", ADDR_ACC},
  220. {0xCE, O_dec, "dec", ADDR_ABS},
  221. {0xDE, O_dec, "dec", ADDR_ABS_IDX_X},
  222. {0xC6, O_dec, "dec", ADDR_DIR},
  223. {0xD6, O_dec, "dec", ADDR_DIR_IDX_X},
  224. {0xCA, O_dex, "dex", ADDR_IMPLIED},
  225. {0x88, O_dey, "dey", ADDR_IMPLIED},
  226. {0x49, O_eor, "eor", ADDR_IMMTOA},
  227. {0x52, O_eor, "eor", ADDR_DIR_IND},
  228. {0x51, O_eor, "eor", ADDR_DIR_IND_IDX_Y},
  229. {0x53, O_eor, "eor", ADDR_STACK_REL_INDX_IDX},
  230. {0x41, O_eor, "eor", ADDR_DIR_IDX_IND_X},
  231. {0x47, O_eor, "eor", ADDR_DIR_IND_LONG},
  232. {0x57, O_eor, "eor", ADDR_DIR_IND_IDX_Y_LONG},
  233. {0x4D, O_eor, "eor", ADDR_ABS},
  234. {0x5D, O_eor, "eor", ADDR_ABS_IDX_X},
  235. {0x59, O_eor, "eor", ADDR_ABS_IDX_Y},
  236. {0x4F, O_eor, "eor", ADDR_ABS_LONG},
  237. {0x5F, O_eor, "eor", ADDR_ABS_LONG_IDX_X},
  238. {0x45, O_eor, "eor", ADDR_DIR},
  239. {0x43, O_eor, "eor", ADDR_STACK_REL},
  240. {0x55, O_eor, "eor", ADDR_DIR_IDX_X},
  241. {0x1A, O_inc, "inc", ADDR_ACC},
  242. {0xEE, O_inc, "inc", ADDR_ABS},
  243. {0xFE, O_inc, "inc", ADDR_ABS_IDX_X},
  244. {0xE6, O_inc, "inc", ADDR_DIR},
  245. {0xF6, O_inc, "inc", ADDR_DIR_IDX_X},
  246. {0xE8, O_inx, "inx", ADDR_IMPLIED},
  247. {0xC8, O_iny, "iny", ADDR_IMPLIED},
  248. {0x6C, O_jmp, "jmp", ADDR_ABS_IND},
  249. {0x7C, O_jmp, "jmp", ADDR_ABS_IND_IDX},
  250. {0xDC, O_jmp, "jmp", ADDR_ABS_IND_LONG},
  251. {0x4C, O_jmp, "jmp", ADDR_ABS},
  252. {0x5C, O_jmp, "jmp", ADDR_ABS_LONG},
  253. {0xFC, O_jsr, "jsr", ADDR_ABS_IND_IDX},
  254. {0x20, O_jsr, "jsr", ADDR_ABS},
  255. {0x22, O_jsr, "jsr", ADDR_ABS_LONG},
  256. {0xA9, O_lda, "lda", ADDR_IMMTOA},
  257. {0xB2, O_lda, "lda", ADDR_DIR_IND},
  258. {0xB1, O_lda, "lda", ADDR_DIR_IND_IDX_Y},
  259. {0xB3, O_lda, "lda", ADDR_STACK_REL_INDX_IDX},
  260. {0xA1, O_lda, "lda", ADDR_DIR_IDX_IND_X},
  261. {0xA7, O_lda, "lda", ADDR_DIR_IND_LONG},
  262. {0xB7, O_lda, "lda", ADDR_DIR_IND_IDX_Y_LONG},
  263. {0xAD, O_lda, "lda", ADDR_ABS},
  264. {0xBD, O_lda, "lda", ADDR_ABS_IDX_X},
  265. {0xB9, O_lda, "lda", ADDR_ABS_IDX_Y},
  266. {0xAF, O_lda, "lda", ADDR_ABS_LONG},
  267. {0xBF, O_lda, "lda", ADDR_ABS_LONG_IDX_X},
  268. {0xA5, O_lda, "lda", ADDR_DIR},
  269. {0xA3, O_lda, "lda", ADDR_STACK_REL},
  270. {0xB5, O_lda, "lda", ADDR_DIR_IDX_X},
  271. {0xA2, O_ldx, "ldx", ADDR_IMMTOI},
  272. {0xAE, O_ldx, "ldx", ADDR_ABS},
  273. {0xBE, O_ldx, "ldx", ADDR_ABS_IDX_Y},
  274. {0xA6, O_ldx, "ldx", ADDR_DIR},
  275. {0xB6, O_ldx, "ldx", ADDR_DIR_IDX_Y},
  276. {0xA0, O_ldy, "ldy", ADDR_IMMTOI},
  277. {0xAC, O_ldy, "ldy", ADDR_ABS},
  278. {0xBC, O_ldy, "ldy", ADDR_ABS_IDX_X},
  279. {0xA4, O_ldy, "ldy", ADDR_DIR},
  280. {0xB4, O_ldy, "ldy", ADDR_DIR_IDX_X},
  281. {0x4A, O_lsr, "lsr", ADDR_ACC},
  282. {0x4E, O_lsr, "lsr", ADDR_ABS},
  283. {0x5E, O_lsr, "lsr", ADDR_ABS_IDX_X},
  284. {0x46, O_lsr, "lsr", ADDR_DIR},
  285. {0x56, O_lsr, "lsr", ADDR_DIR_IDX_X},
  286. {0x54, O_mvn, "mvn", ADDR_BLOCK_MOVE},
  287. {0x44, O_mvp, "mvp", ADDR_BLOCK_MOVE},
  288. {0xEA, O_nop, "nop", ADDR_IMPLIED},
  289. {0x09, O_ora, "ora", ADDR_IMMTOA},
  290. {0x12, O_ora, "ora", ADDR_DIR_IND},
  291. {0x11, O_ora, "ora", ADDR_DIR_IND_IDX_Y},
  292. {0x13, O_ora, "ora", ADDR_STACK_REL_INDX_IDX},
  293. {0x01, O_ora, "ora", ADDR_DIR_IDX_IND_X},
  294. {0x07, O_ora, "ora", ADDR_DIR_IND_LONG},
  295. {0x17, O_ora, "ora", ADDR_DIR_IND_IDX_Y_LONG},
  296. {0x0D, O_ora, "ora", ADDR_ABS},
  297. {0x1D, O_ora, "ora", ADDR_ABS_IDX_X},
  298. {0x19, O_ora, "ora", ADDR_ABS_IDX_Y},
  299. {0x0F, O_ora, "ora", ADDR_ABS_LONG},
  300. {0x1F, O_ora, "ora", ADDR_ABS_LONG_IDX_X},
  301. {0x05, O_ora, "ora", ADDR_DIR},
  302. {0x03, O_ora, "ora", ADDR_STACK_REL},
  303. {0x15, O_ora, "ora", ADDR_DIR_IDX_X},
  304. {0xF4, O_pea, "pea", ADDR_ABS},
  305. {0xD4, O_pei, "pei", ADDR_DIR},
  306. {0x62, O_per, "per", ADDR_PC_REL_LONG},
  307. {0x48, O_pha, "pha", ADDR_STACK},
  308. {0x8B, O_phb, "phb", ADDR_STACK},
  309. {0x0B, O_phd, "phd", ADDR_STACK},
  310. {0x4B, O_phk, "phk", ADDR_STACK},
  311. {0x08, O_php, "php", ADDR_STACK},
  312. {0xDA, O_phx, "phx", ADDR_STACK},
  313. {0x5A, O_phy, "phy", ADDR_STACK},
  314. {0x68, O_pla, "pla", ADDR_STACK},
  315. {0xAB, O_plb, "plb", ADDR_STACK},
  316. {0x2B, O_pld, "pld", ADDR_STACK},
  317. {0x28, O_plp, "plp", ADDR_STACK},
  318. {0xFA, O_plx, "plx", ADDR_STACK},
  319. {0x7A, O_ply, "ply", ADDR_STACK},
  320. {0xC2, O_rep, "rep", ADDR_IMMCOP},
  321. {0x2A, O_rol, "rol", ADDR_ACC},
  322. {0x2E, O_rol, "rol", ADDR_ABS},
  323. {0x3E, O_rol, "rol", ADDR_ABS_IDX_X},
  324. {0x26, O_rol, "rol", ADDR_DIR},
  325. {0x36, O_rol, "rol", ADDR_DIR_IDX_X},
  326. {0x6A, O_ror, "ror", ADDR_ACC},
  327. {0x6E, O_ror, "ror", ADDR_ABS},
  328. {0x7E, O_ror, "ror", ADDR_ABS_IDX_X},
  329. {0x66, O_ror, "ror", ADDR_DIR},
  330. {0x76, O_ror, "ror", ADDR_DIR_IDX_X},
  331. {0x40, O_rti, "rti", ADDR_STACK},
  332. {0x6B, O_rtl, "rtl", ADDR_STACK},
  333. {0x60, O_rts, "rts", ADDR_STACK},
  334. {0xE9, O_sbc, "sbc", ADDR_IMMTOA},
  335. {0xF2, O_sbc, "sbc", ADDR_DIR_IND},
  336. {0xF1, O_sbc, "sbc", ADDR_DIR_IND_IDX_Y},
  337. {0xF3, O_sbc, "sbc", ADDR_STACK_REL_INDX_IDX},
  338. {0xE1, O_sbc, "sbc", ADDR_DIR_IDX_IND_X},
  339. {0xE7, O_sbc, "sbc", ADDR_DIR_IND_LONG},
  340. {0xF7, O_sbc, "sbc", ADDR_DIR_IND_IDX_Y_LONG},
  341. {0xED, O_sbc, "sbc", ADDR_ABS},
  342. {0xFD, O_sbc, "sbc", ADDR_ABS_IDX_X},
  343. {0xF9, O_sbc, "sbc", ADDR_ABS_IDX_Y},
  344. {0xEF, O_sbc, "sbc", ADDR_ABS_LONG},
  345. {0xFF, O_sbc, "sbc", ADDR_ABS_LONG_IDX_X},
  346. {0xE5, O_sbc, "sbc", ADDR_DIR},
  347. {0xE3, O_sbc, "sbc", ADDR_STACK_REL},
  348. {0xF5, O_sbc, "sbc", ADDR_DIR_IDX_X},
  349. {0x38, O_sec, "sec", ADDR_IMPLIED},
  350. {0xF8, O_sed, "sed", ADDR_IMPLIED},
  351. {0x78, O_sei, "sei", ADDR_IMPLIED},
  352. {0xE2, O_sep, "sep", ADDR_IMMCOP},
  353. {0x92, O_sta, "sta", ADDR_DIR_IND},
  354. {0x91, O_sta, "sta", ADDR_DIR_IND_IDX_Y},
  355. {0x93, O_sta, "sta", ADDR_STACK_REL_INDX_IDX},
  356. {0x81, O_sta, "sta", ADDR_DIR_IDX_IND_X},
  357. {0x87, O_sta, "sta", ADDR_DIR_IND_LONG},
  358. {0x97, O_sta, "sta", ADDR_DIR_IND_IDX_Y_LONG},
  359. {0x8D, O_sta, "sta", ADDR_ABS},
  360. {0x9D, O_sta, "sta", ADDR_ABS_IDX_X},
  361. {0x99, O_sta, "sta", ADDR_ABS_IDX_Y},
  362. {0x8F, O_sta, "sta", ADDR_ABS_LONG},
  363. {0x9F, O_sta, "sta", ADDR_ABS_LONG_IDX_X},
  364. {0x85, O_sta, "sta", ADDR_DIR},
  365. {0x83, O_sta, "sta", ADDR_STACK_REL},
  366. {0x95, O_sta, "sta", ADDR_DIR_IDX_X},
  367. {0xDB, O_stp, "stp", ADDR_IMPLIED},
  368. {0x8E, O_stx, "stx", ADDR_ABS},
  369. {0x86, O_stx, "stx", ADDR_DIR},
  370. {0x96, O_stx, "stx", ADDR_DIR_IDX_X},
  371. {0x8C, O_sty, "sty", ADDR_ABS},
  372. {0x84, O_sty, "sty", ADDR_DIR},
  373. {0x94, O_sty, "sty", ADDR_DIR_IDX_X},
  374. {0x9C, O_stz, "stz", ADDR_ABS},
  375. {0x9E, O_stz, "stz", ADDR_ABS_IDX_X},
  376. {0x64, O_stz, "stz", ADDR_DIR},
  377. {0x74, O_stz, "stz", ADDR_DIR_IDX_X},
  378. {0xAA, O_tax, "tax", ADDR_IMPLIED},
  379. {0xA8, O_tay, "tay", ADDR_IMPLIED},
  380. {0x5B, O_tcd, "tcd", ADDR_IMPLIED},
  381. {0x1B, O_tcs, "tcs", ADDR_IMPLIED},
  382. {0x7B, O_tdc, "tdc", ADDR_IMPLIED},
  383. {0x1C, O_trb, "trb", ADDR_ABS},
  384. {0x14, O_trb, "trb", ADDR_DIR},
  385. {0x0C, O_tsb, "tsb", ADDR_ABS},
  386. {0x04, O_tsb, "tsb", ADDR_DIR},
  387. {0x3B, O_tsc, "tsc", ADDR_IMPLIED},
  388. {0xBA, O_tsx, "tsx", ADDR_IMPLIED},
  389. {0x8A, O_txa, "txa", ADDR_IMPLIED},
  390. {0x9A, O_txs, "txs", ADDR_IMPLIED},
  391. {0x9B, O_txy, "txy", ADDR_IMPLIED},
  392. {0x98, O_tya, "tya", ADDR_IMPLIED},
  393. {0xBB, O_tyx, "tyx", ADDR_IMPLIED},
  394. {0xCB, O_wai, "wai", ADDR_IMPLIED},
  395. {0x42, O_wdm, "wdm", ADDR_IMPLIED},
  396. {0xEB, O_xba, "xba", ADDR_IMPLIED},
  397. {0xFB, O_xce, "xce", ADDR_IMPLIED},
  398. { 0, 0, NULL, 0 }
  399. };
  400. #endif
  401. #define DISASM()\
  402. case ADDR_IMMTOA:\
  403. args[0] = M==0 ? asR_W65_ABS16 : asR_W65_ABS8;\
  404. print_operand (0, " #$0", args);\
  405. size += M==0 ? 2:1;\
  406. break;\
  407. case ADDR_IMMCOP:\
  408. args[0] = asR_W65_ABS8;\
  409. print_operand (0, " #$0", args);\
  410. size += 1;\
  411. break;\
  412. case ADDR_IMMTOI:\
  413. args[0] = X==0 ? asR_W65_ABS16 : asR_W65_ABS8;\
  414. print_operand (0, " #$0", args);\
  415. size += X==0 ? 2:1;\
  416. break;\
  417. case ADDR_ACC:\
  418. print_operand (0, " a", 0);\
  419. size += 0;\
  420. break;\
  421. case ADDR_PC_REL:\
  422. args[0] = asR_W65_PCR8;\
  423. print_operand (0, " $0", args);\
  424. size += 1;\
  425. break;\
  426. case ADDR_PC_REL_LONG:\
  427. args[0] = asR_W65_PCR16;\
  428. print_operand (0, " $0", args);\
  429. size += 2;\
  430. break;\
  431. case ADDR_IMPLIED:\
  432. size += 0;\
  433. break;\
  434. case ADDR_STACK:\
  435. size += 0;\
  436. break;\
  437. case ADDR_DIR:\
  438. args[0] = asR_W65_ABS8;\
  439. print_operand (1, " <$0", args);\
  440. size += 1;\
  441. break;\
  442. case ADDR_DIR_IDX_X:\
  443. args[0] = asR_W65_ABS8;\
  444. print_operand (1, " <$0,x", args);\
  445. size += 1;\
  446. break;\
  447. case ADDR_DIR_IDX_Y:\
  448. args[0] = asR_W65_ABS8;\
  449. print_operand (1, " <$0,y", args);\
  450. size += 1;\
  451. break;\
  452. case ADDR_DIR_IND:\
  453. args[0] = asR_W65_ABS8;\
  454. print_operand (1, " (<$0)", args);\
  455. size += 1;\
  456. break;\
  457. case ADDR_DIR_IDX_IND_X:\
  458. args[0] = asR_W65_ABS8;\
  459. print_operand (1, " (<$0,x)", args);\
  460. size += 1;\
  461. break;\
  462. case ADDR_DIR_IND_IDX_Y:\
  463. args[0] = asR_W65_ABS8;\
  464. print_operand (1, " (<$0),y", args);\
  465. size += 1;\
  466. break;\
  467. case ADDR_DIR_IND_LONG:\
  468. args[0] = asR_W65_ABS8;\
  469. print_operand (1, " [$0]", args);\
  470. size += 1;\
  471. break;\
  472. case ADDR_DIR_IND_IDX_Y_LONG:\
  473. args[0] = asR_W65_ABS8;\
  474. print_operand (1, " [$0],y", args);\
  475. size += 1;\
  476. break;\
  477. case ADDR_ABS:\
  478. args[0] = asR_W65_ABS16;\
  479. print_operand (1, " !$0", args);\
  480. size += 2;\
  481. break;\
  482. case ADDR_ABS_IDX_X:\
  483. args[0] = asR_W65_ABS16;\
  484. print_operand (1, " !$0,x", args);\
  485. size += 2;\
  486. break;\
  487. case ADDR_ABS_IDX_Y:\
  488. args[0] = asR_W65_ABS16;\
  489. print_operand (1, " !$0,y", args);\
  490. size += 2;\
  491. break;\
  492. case ADDR_ABS_LONG:\
  493. args[0] = asR_W65_ABS24;\
  494. print_operand (1, " >$0", args);\
  495. size += 3;\
  496. break;\
  497. case ADDR_ABS_IND_LONG:\
  498. args[0] = asR_W65_ABS16;\
  499. print_operand (1, " [>$0]", args);\
  500. size += 2;\
  501. break;\
  502. case ADDR_ABS_LONG_IDX_X:\
  503. args[0] = asR_W65_ABS24;\
  504. print_operand (1, " >$0,x", args);\
  505. size += 3;\
  506. break;\
  507. case ADDR_STACK_REL:\
  508. args[0] = asR_W65_ABS8;\
  509. print_operand (0, " $0,s", args);\
  510. size += 1;\
  511. break;\
  512. case ADDR_STACK_REL_INDX_IDX:\
  513. args[0] = asR_W65_ABS8;\
  514. print_operand (0, " ($0,s),y", args);\
  515. size += 1;\
  516. break;\
  517. case ADDR_ABS_IND:\
  518. args[0] = asR_W65_ABS16;\
  519. print_operand (1, " ($0)", args);\
  520. size += 2;\
  521. break;\
  522. case ADDR_ABS_IND_IDX:\
  523. args[0] = asR_W65_ABS16;\
  524. print_operand (1, " ($0,x)", args);\
  525. size += 2;\
  526. break;\
  527. case ADDR_BLOCK_MOVE:\
  528. args[0] = (asR_W65_ABS16 >>8) &0xff;\
  529. args[1] = ( asR_W65_ABS16 & 0xff);\
  530. print_operand (0," $0,$1",args);\
  531. size += 2;\
  532. break;\
  533. #define GETINFO(size,type,pcrel)\
  534. case ADDR_IMMTOA: size = M==0 ? 2:1;type=M==0 ? R_W65_ABS16 : R_W65_ABS8;pcrel=0;break;\
  535. case ADDR_IMMCOP: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  536. case ADDR_IMMTOI: size = X==0 ? 2:1;type=X==0 ? R_W65_ABS16 : R_W65_ABS8;pcrel=0;break;\
  537. case ADDR_ACC: size = 0;type=-1;pcrel=0;break;\
  538. case ADDR_PC_REL: size = 1;type=R_W65_PCR8;pcrel=0;break;\
  539. case ADDR_PC_REL_LONG: size = 2;type=R_W65_PCR16;pcrel=0;break;\
  540. case ADDR_IMPLIED: size = 0;type=-1;pcrel=0;break;\
  541. case ADDR_STACK: size = 0;type=-1;pcrel=0;break;\
  542. case ADDR_DIR: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  543. case ADDR_DIR_IDX_X: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  544. case ADDR_DIR_IDX_Y: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  545. case ADDR_DIR_IND: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  546. case ADDR_DIR_IDX_IND_X: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  547. case ADDR_DIR_IND_IDX_Y: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  548. case ADDR_DIR_IND_LONG: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  549. case ADDR_DIR_IND_IDX_Y_LONG: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  550. case ADDR_ABS: size = 2;type=R_W65_ABS16;pcrel=0;break;\
  551. case ADDR_ABS_IDX_X: size = 2;type=R_W65_ABS16;pcrel=0;break;\
  552. case ADDR_ABS_IDX_Y: size = 2;type=R_W65_ABS16;pcrel=0;break;\
  553. case ADDR_ABS_LONG: size = 3;type=R_W65_ABS24;pcrel=0;break;\
  554. case ADDR_ABS_IND_LONG: size = 2;type=R_W65_ABS16;pcrel=0;break;\
  555. case ADDR_ABS_LONG_IDX_X: size = 3;type=R_W65_ABS24;pcrel=0;break;\
  556. case ADDR_STACK_REL: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  557. case ADDR_STACK_REL_INDX_IDX: size = 1;type=R_W65_ABS8;pcrel=0;break;\
  558. case ADDR_ABS_IND: size = 2;type=R_W65_ABS16;pcrel=0;break;\
  559. case ADDR_ABS_IND_IDX: size = 2;type=R_W65_ABS16;pcrel=0;break;\
  560. case ADDR_BLOCK_MOVE: size = 2;type=-1;pcrel=0;break;\