An emulator, assembler, and disassembler for the Sega Game Gear
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

z80_tables.inc.c 43 KiB

hace 8 años
hace 8 años
hace 8 años
hace 8 años
hace 8 años
hace 8 años
hace 8 años
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297
  1. /* Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. static DispatchTable instruction_table = {
  4. [0x00] = z80_inst_nop,
  5. [0x01] = z80_inst_ld_dd_nn,
  6. [0x02] = z80_inst_ld_bcde_a,
  7. [0x03] = z80_inst_inc_ss,
  8. [0x04] = z80_inst_inc_r,
  9. [0x05] = z80_inst_dec_r,
  10. [0x06] = z80_inst_ld_r_n,
  11. [0x07] = z80_inst_rlca,
  12. [0x08] = z80_inst_ex_af_af,
  13. [0x09] = z80_inst_add_hl_ss,
  14. [0x0A] = z80_inst_ld_a_bcde,
  15. [0x0B] = z80_inst_dec_ss,
  16. [0x0C] = z80_inst_inc_r,
  17. [0x0D] = z80_inst_dec_r,
  18. [0x0E] = z80_inst_ld_r_n,
  19. [0x0F] = z80_inst_rrca,
  20. [0x10] = z80_inst_djnz_e,
  21. [0x11] = z80_inst_ld_dd_nn,
  22. [0x12] = z80_inst_ld_bcde_a,
  23. [0x13] = z80_inst_inc_ss,
  24. [0x14] = z80_inst_inc_r,
  25. [0x15] = z80_inst_dec_r,
  26. [0x16] = z80_inst_ld_r_n,
  27. [0x17] = z80_inst_rla,
  28. [0x18] = z80_inst_jr_e,
  29. [0x19] = z80_inst_add_hl_ss,
  30. [0x1A] = z80_inst_ld_a_bcde,
  31. [0x1B] = z80_inst_dec_ss,
  32. [0x1C] = z80_inst_inc_r,
  33. [0x1D] = z80_inst_dec_r,
  34. [0x1E] = z80_inst_ld_r_n,
  35. [0x1F] = z80_inst_rra,
  36. [0x20] = z80_inst_jr_cc_e,
  37. [0x21] = z80_inst_ld_dd_nn,
  38. [0x22] = z80_inst_ld_inn_hl,
  39. [0x23] = z80_inst_inc_ss,
  40. [0x24] = z80_inst_inc_r,
  41. [0x25] = z80_inst_dec_r,
  42. [0x26] = z80_inst_ld_r_n,
  43. [0x27] = z80_inst_unimplemented, // TODO
  44. [0x28] = z80_inst_jr_cc_e,
  45. [0x29] = z80_inst_add_hl_ss,
  46. [0x2A] = z80_inst_ld_hl_inn,
  47. [0x2B] = z80_inst_dec_ss,
  48. [0x2C] = z80_inst_inc_r,
  49. [0x2D] = z80_inst_dec_r,
  50. [0x2E] = z80_inst_ld_r_n,
  51. [0x2F] = z80_inst_unimplemented, // TODO
  52. [0x30] = z80_inst_jr_cc_e,
  53. [0x31] = z80_inst_ld_dd_nn,
  54. [0x32] = z80_inst_ld_nn_a,
  55. [0x33] = z80_inst_inc_ss,
  56. [0x34] = z80_inst_inc_hl,
  57. [0x35] = z80_inst_dec_hl,
  58. [0x36] = z80_inst_ld_hl_n,
  59. [0x37] = z80_inst_unimplemented, // TODO
  60. [0x38] = z80_inst_jr_cc_e,
  61. [0x39] = z80_inst_add_hl_ss,
  62. [0x3A] = z80_inst_ld_a_nn,
  63. [0x3B] = z80_inst_dec_ss,
  64. [0x3C] = z80_inst_inc_r,
  65. [0x3D] = z80_inst_dec_r,
  66. [0x3E] = z80_inst_ld_r_n,
  67. [0x3F] = z80_inst_unimplemented, // TODO
  68. [0x40] = z80_inst_ld_r_r,
  69. [0x41] = z80_inst_ld_r_r,
  70. [0x42] = z80_inst_ld_r_r,
  71. [0x43] = z80_inst_ld_r_r,
  72. [0x44] = z80_inst_ld_r_r,
  73. [0x45] = z80_inst_ld_r_r,
  74. [0x46] = z80_inst_ld_r_hl,
  75. [0x47] = z80_inst_ld_r_r,
  76. [0x48] = z80_inst_ld_r_r,
  77. [0x49] = z80_inst_ld_r_r,
  78. [0x4A] = z80_inst_ld_r_r,
  79. [0x4B] = z80_inst_ld_r_r,
  80. [0x4C] = z80_inst_ld_r_r,
  81. [0x4D] = z80_inst_ld_r_r,
  82. [0x4E] = z80_inst_ld_r_hl,
  83. [0x4F] = z80_inst_ld_r_r,
  84. [0x50] = z80_inst_ld_r_r,
  85. [0x51] = z80_inst_ld_r_r,
  86. [0x52] = z80_inst_ld_r_r,
  87. [0x53] = z80_inst_ld_r_r,
  88. [0x54] = z80_inst_ld_r_r,
  89. [0x55] = z80_inst_ld_r_r,
  90. [0x56] = z80_inst_ld_r_hl,
  91. [0x57] = z80_inst_ld_r_r,
  92. [0x58] = z80_inst_ld_r_r,
  93. [0x59] = z80_inst_ld_r_r,
  94. [0x5A] = z80_inst_ld_r_r,
  95. [0x5B] = z80_inst_ld_r_r,
  96. [0x5C] = z80_inst_ld_r_r,
  97. [0x5D] = z80_inst_ld_r_r,
  98. [0x5E] = z80_inst_ld_r_hl,
  99. [0x5F] = z80_inst_ld_r_r,
  100. [0x60] = z80_inst_ld_r_r,
  101. [0x61] = z80_inst_ld_r_r,
  102. [0x62] = z80_inst_ld_r_r,
  103. [0x63] = z80_inst_ld_r_r,
  104. [0x64] = z80_inst_ld_r_r,
  105. [0x65] = z80_inst_ld_r_r,
  106. [0x66] = z80_inst_ld_r_hl,
  107. [0x67] = z80_inst_ld_r_r,
  108. [0x68] = z80_inst_ld_r_r,
  109. [0x69] = z80_inst_ld_r_r,
  110. [0x6A] = z80_inst_ld_r_r,
  111. [0x6B] = z80_inst_ld_r_r,
  112. [0x6C] = z80_inst_ld_r_r,
  113. [0x6D] = z80_inst_ld_r_r,
  114. [0x6E] = z80_inst_ld_r_hl,
  115. [0x6F] = z80_inst_ld_r_r,
  116. [0x70] = z80_inst_ld_hl_r,
  117. [0x71] = z80_inst_ld_hl_r,
  118. [0x72] = z80_inst_ld_hl_r,
  119. [0x73] = z80_inst_ld_hl_r,
  120. [0x74] = z80_inst_ld_hl_r,
  121. [0x75] = z80_inst_ld_hl_r,
  122. [0x76] = z80_inst_halt,
  123. [0x77] = z80_inst_ld_hl_r,
  124. [0x78] = z80_inst_ld_r_r,
  125. [0x79] = z80_inst_ld_r_r,
  126. [0x7A] = z80_inst_ld_r_r,
  127. [0x7B] = z80_inst_ld_r_r,
  128. [0x7C] = z80_inst_ld_r_r,
  129. [0x7D] = z80_inst_ld_r_r,
  130. [0x7E] = z80_inst_ld_r_hl,
  131. [0x7F] = z80_inst_ld_r_r,
  132. [0x80] = z80_inst_add_a_r,
  133. [0x81] = z80_inst_add_a_r,
  134. [0x82] = z80_inst_add_a_r,
  135. [0x83] = z80_inst_add_a_r,
  136. [0x84] = z80_inst_add_a_r,
  137. [0x85] = z80_inst_add_a_r,
  138. [0x86] = z80_inst_add_a_hl,
  139. [0x87] = z80_inst_add_a_r,
  140. [0x88] = z80_inst_adc_a_r,
  141. [0x89] = z80_inst_adc_a_r,
  142. [0x8A] = z80_inst_adc_a_r,
  143. [0x8B] = z80_inst_adc_a_r,
  144. [0x8C] = z80_inst_adc_a_r,
  145. [0x8D] = z80_inst_adc_a_r,
  146. [0x8E] = z80_inst_adc_a_hl,
  147. [0x8F] = z80_inst_adc_a_r,
  148. [0x90] = z80_inst_sub_r,
  149. [0x91] = z80_inst_sub_r,
  150. [0x92] = z80_inst_sub_r,
  151. [0x93] = z80_inst_sub_r,
  152. [0x94] = z80_inst_sub_r,
  153. [0x95] = z80_inst_sub_r,
  154. [0x96] = z80_inst_sub_hl,
  155. [0x97] = z80_inst_sub_r,
  156. [0x98] = z80_inst_sbc_a_r,
  157. [0x99] = z80_inst_sbc_a_r,
  158. [0x9A] = z80_inst_sbc_a_r,
  159. [0x9B] = z80_inst_sbc_a_r,
  160. [0x9C] = z80_inst_sbc_a_r,
  161. [0x9D] = z80_inst_sbc_a_r,
  162. [0x9E] = z80_inst_sbc_a_hl,
  163. [0x9F] = z80_inst_sbc_a_r,
  164. [0xA0] = z80_inst_and_r,
  165. [0xA1] = z80_inst_and_r,
  166. [0xA2] = z80_inst_and_r,
  167. [0xA3] = z80_inst_and_r,
  168. [0xA4] = z80_inst_and_r,
  169. [0xA5] = z80_inst_and_r,
  170. [0xA6] = z80_inst_and_hl,
  171. [0xA7] = z80_inst_and_r,
  172. [0xA8] = z80_inst_xor_r,
  173. [0xA9] = z80_inst_xor_r,
  174. [0xAA] = z80_inst_xor_r,
  175. [0xAB] = z80_inst_xor_r,
  176. [0xAC] = z80_inst_xor_r,
  177. [0xAD] = z80_inst_xor_r,
  178. [0xAE] = z80_inst_xor_hl,
  179. [0xAF] = z80_inst_xor_r,
  180. [0xB0] = z80_inst_or_r,
  181. [0xB1] = z80_inst_or_r,
  182. [0xB2] = z80_inst_or_r,
  183. [0xB3] = z80_inst_or_r,
  184. [0xB4] = z80_inst_or_r,
  185. [0xB5] = z80_inst_or_r,
  186. [0xB6] = z80_inst_or_hl,
  187. [0xB7] = z80_inst_or_r,
  188. [0xB8] = z80_inst_cp_r,
  189. [0xB9] = z80_inst_cp_r,
  190. [0xBA] = z80_inst_cp_r,
  191. [0xBB] = z80_inst_cp_r,
  192. [0xBC] = z80_inst_cp_r,
  193. [0xBD] = z80_inst_cp_r,
  194. [0xBE] = z80_inst_cp_hl,
  195. [0xBF] = z80_inst_cp_r,
  196. [0xC0] = z80_inst_ret_cc,
  197. [0xC1] = z80_inst_pop_qq,
  198. [0xC2] = z80_inst_jp_cc_nn,
  199. [0xC3] = z80_inst_jp_nn,
  200. [0xC4] = z80_inst_call_cc_nn,
  201. [0xC5] = z80_inst_push_qq,
  202. [0xC6] = z80_inst_add_a_n,
  203. [0xC7] = z80_inst_rst_p,
  204. [0xC8] = z80_inst_ret_cc,
  205. [0xC9] = z80_inst_ret,
  206. [0xCA] = z80_inst_jp_cc_nn,
  207. [0xCB] = z80_prefix_bits,
  208. [0xCC] = z80_inst_call_cc_nn,
  209. [0xCD] = z80_inst_call_nn,
  210. [0xCE] = z80_inst_adc_a_n,
  211. [0xCF] = z80_inst_rst_p,
  212. [0xD0] = z80_inst_ret_cc,
  213. [0xD1] = z80_inst_pop_qq,
  214. [0xD2] = z80_inst_jp_cc_nn,
  215. [0xD3] = z80_inst_out_n_a,
  216. [0xD4] = z80_inst_call_cc_nn,
  217. [0xD5] = z80_inst_push_qq,
  218. [0xD6] = z80_inst_sub_n,
  219. [0xD7] = z80_inst_rst_p,
  220. [0xD8] = z80_inst_ret_cc,
  221. [0xD9] = z80_inst_exx,
  222. [0xDA] = z80_inst_jp_cc_nn,
  223. [0xDB] = z80_inst_in_a_n,
  224. [0xDC] = z80_inst_call_cc_nn,
  225. [0xDD] = z80_prefix_index,
  226. [0xDE] = z80_inst_sbc_a_n,
  227. [0xDF] = z80_inst_rst_p,
  228. [0xE0] = z80_inst_ret_cc,
  229. [0xE1] = z80_inst_pop_qq,
  230. [0xE2] = z80_inst_jp_cc_nn,
  231. [0xE3] = z80_inst_ex_sp_hl,
  232. [0xE4] = z80_inst_call_cc_nn,
  233. [0xE5] = z80_inst_push_qq,
  234. [0xE6] = z80_inst_and_n,
  235. [0xE7] = z80_inst_rst_p,
  236. [0xE8] = z80_inst_ret_cc,
  237. [0xE9] = z80_inst_jp_hl,
  238. [0xEA] = z80_inst_jp_cc_nn,
  239. [0xEB] = z80_inst_ex_de_hl,
  240. [0xEC] = z80_inst_call_cc_nn,
  241. [0xED] = z80_prefix_extended,
  242. [0xEE] = z80_inst_xor_n,
  243. [0xEF] = z80_inst_rst_p,
  244. [0xF0] = z80_inst_ret_cc,
  245. [0xF1] = z80_inst_pop_qq,
  246. [0xF2] = z80_inst_jp_cc_nn,
  247. [0xF3] = z80_inst_di,
  248. [0xF4] = z80_inst_call_cc_nn,
  249. [0xF5] = z80_inst_push_qq,
  250. [0xF6] = z80_inst_or_n,
  251. [0xF7] = z80_inst_rst_p,
  252. [0xF8] = z80_inst_ret_cc,
  253. [0xF9] = z80_inst_ld_sp_hl,
  254. [0xFA] = z80_inst_jp_cc_nn,
  255. [0xFB] = z80_inst_ei,
  256. [0xFC] = z80_inst_call_cc_nn,
  257. [0xFD] = z80_prefix_index,
  258. [0xFE] = z80_inst_cp_n,
  259. [0xFF] = z80_inst_rst_p
  260. };
  261. static DispatchTable instruction_table_extended = {
  262. [0x00] = z80_inst_nop2,
  263. [0x01] = z80_inst_nop2,
  264. [0x02] = z80_inst_nop2,
  265. [0x03] = z80_inst_nop2,
  266. [0x04] = z80_inst_nop2,
  267. [0x05] = z80_inst_nop2,
  268. [0x06] = z80_inst_nop2,
  269. [0x07] = z80_inst_nop2,
  270. [0x08] = z80_inst_nop2,
  271. [0x09] = z80_inst_nop2,
  272. [0x0A] = z80_inst_nop2,
  273. [0x0B] = z80_inst_nop2,
  274. [0x0C] = z80_inst_nop2,
  275. [0x0D] = z80_inst_nop2,
  276. [0x0E] = z80_inst_nop2,
  277. [0x0F] = z80_inst_nop2,
  278. [0x10] = z80_inst_nop2,
  279. [0x11] = z80_inst_nop2,
  280. [0x12] = z80_inst_nop2,
  281. [0x13] = z80_inst_nop2,
  282. [0x14] = z80_inst_nop2,
  283. [0x15] = z80_inst_nop2,
  284. [0x16] = z80_inst_nop2,
  285. [0x17] = z80_inst_nop2,
  286. [0x18] = z80_inst_nop2,
  287. [0x19] = z80_inst_nop2,
  288. [0x1A] = z80_inst_nop2,
  289. [0x1B] = z80_inst_nop2,
  290. [0x1C] = z80_inst_nop2,
  291. [0x1D] = z80_inst_nop2,
  292. [0x1E] = z80_inst_nop2,
  293. [0x1F] = z80_inst_nop2,
  294. [0x20] = z80_inst_nop2,
  295. [0x21] = z80_inst_nop2,
  296. [0x22] = z80_inst_nop2,
  297. [0x23] = z80_inst_nop2,
  298. [0x24] = z80_inst_nop2,
  299. [0x25] = z80_inst_nop2,
  300. [0x26] = z80_inst_nop2,
  301. [0x27] = z80_inst_nop2,
  302. [0x28] = z80_inst_nop2,
  303. [0x29] = z80_inst_nop2,
  304. [0x2A] = z80_inst_nop2,
  305. [0x2B] = z80_inst_nop2,
  306. [0x2C] = z80_inst_nop2,
  307. [0x2D] = z80_inst_nop2,
  308. [0x2E] = z80_inst_nop2,
  309. [0x2F] = z80_inst_nop2,
  310. [0x30] = z80_inst_nop2,
  311. [0x31] = z80_inst_nop2,
  312. [0x32] = z80_inst_nop2,
  313. [0x33] = z80_inst_nop2,
  314. [0x34] = z80_inst_nop2,
  315. [0x35] = z80_inst_nop2,
  316. [0x36] = z80_inst_nop2,
  317. [0x37] = z80_inst_nop2,
  318. [0x38] = z80_inst_nop2,
  319. [0x39] = z80_inst_nop2,
  320. [0x3A] = z80_inst_nop2,
  321. [0x3B] = z80_inst_nop2,
  322. [0x3C] = z80_inst_nop2,
  323. [0x3D] = z80_inst_nop2,
  324. [0x3E] = z80_inst_nop2,
  325. [0x3F] = z80_inst_nop2,
  326. [0x40] = z80_inst_in_r_c,
  327. [0x41] = z80_inst_out_c_r,
  328. [0x42] = z80_inst_sbc_hl_ss,
  329. [0x43] = z80_inst_ld_inn_dd,
  330. [0x44] = z80_inst_unimplemented, // TODO
  331. [0x45] = z80_inst_retn,
  332. [0x46] = z80_inst_im,
  333. [0x47] = z80_inst_ld_i_a,
  334. [0x48] = z80_inst_in_r_c,
  335. [0x49] = z80_inst_out_c_r,
  336. [0x4A] = z80_inst_adc_hl_ss,
  337. [0x4B] = z80_inst_ld_dd_inn,
  338. [0x4C] = z80_inst_unimplemented, // TODO
  339. [0x4D] = z80_inst_reti,
  340. [0x4E] = z80_inst_im,
  341. [0x4F] = z80_inst_ld_r_a,
  342. [0x50] = z80_inst_in_r_c,
  343. [0x51] = z80_inst_out_c_r,
  344. [0x52] = z80_inst_sbc_hl_ss,
  345. [0x53] = z80_inst_ld_inn_dd,
  346. [0x54] = z80_inst_unimplemented, // TODO
  347. [0x55] = z80_inst_retn,
  348. [0x56] = z80_inst_im,
  349. [0x57] = z80_inst_unimplemented, // TODO
  350. [0x58] = z80_inst_in_r_c,
  351. [0x59] = z80_inst_out_c_r,
  352. [0x5A] = z80_inst_adc_hl_ss,
  353. [0x5B] = z80_inst_ld_dd_inn,
  354. [0x5C] = z80_inst_unimplemented, // TODO
  355. [0x5D] = z80_inst_retn,
  356. [0x5E] = z80_inst_im,
  357. [0x5F] = z80_inst_unimplemented, // TODO
  358. [0x60] = z80_inst_in_r_c,
  359. [0x61] = z80_inst_out_c_r,
  360. [0x62] = z80_inst_sbc_hl_ss,
  361. [0x63] = z80_inst_ld_inn_dd,
  362. [0x64] = z80_inst_unimplemented, // TODO
  363. [0x65] = z80_inst_retn,
  364. [0x66] = z80_inst_im,
  365. [0x67] = z80_inst_unimplemented, // TODO
  366. [0x68] = z80_inst_in_r_c,
  367. [0x69] = z80_inst_out_c_r,
  368. [0x6A] = z80_inst_adc_hl_ss,
  369. [0x6B] = z80_inst_ld_dd_inn,
  370. [0x6C] = z80_inst_unimplemented, // TODO
  371. [0x6D] = z80_inst_retn,
  372. [0x6E] = z80_inst_im,
  373. [0x6F] = z80_inst_unimplemented, // TODO
  374. [0x70] = z80_inst_in_r_c,
  375. [0x71] = z80_inst_out_c_r,
  376. [0x72] = z80_inst_sbc_hl_ss,
  377. [0x73] = z80_inst_ld_inn_dd,
  378. [0x74] = z80_inst_unimplemented, // TODO
  379. [0x75] = z80_inst_retn,
  380. [0x76] = z80_inst_im,
  381. [0x77] = z80_inst_nop2,
  382. [0x78] = z80_inst_in_r_c,
  383. [0x79] = z80_inst_out_c_r,
  384. [0x7A] = z80_inst_adc_hl_ss,
  385. [0x7B] = z80_inst_ld_dd_inn,
  386. [0x7C] = z80_inst_unimplemented, // TODO
  387. [0x7D] = z80_inst_retn,
  388. [0x7E] = z80_inst_im,
  389. [0x7F] = z80_inst_nop2,
  390. [0x80] = z80_inst_nop2,
  391. [0x81] = z80_inst_nop2,
  392. [0x82] = z80_inst_nop2,
  393. [0x83] = z80_inst_nop2,
  394. [0x84] = z80_inst_nop2,
  395. [0x85] = z80_inst_nop2,
  396. [0x86] = z80_inst_nop2,
  397. [0x87] = z80_inst_nop2,
  398. [0x88] = z80_inst_nop2,
  399. [0x89] = z80_inst_nop2,
  400. [0x8A] = z80_inst_nop2,
  401. [0x8B] = z80_inst_nop2,
  402. [0x8C] = z80_inst_nop2,
  403. [0x8D] = z80_inst_nop2,
  404. [0x8E] = z80_inst_nop2,
  405. [0x8F] = z80_inst_nop2,
  406. [0x90] = z80_inst_nop2,
  407. [0x91] = z80_inst_nop2,
  408. [0x92] = z80_inst_nop2,
  409. [0x93] = z80_inst_nop2,
  410. [0x94] = z80_inst_nop2,
  411. [0x95] = z80_inst_nop2,
  412. [0x96] = z80_inst_nop2,
  413. [0x97] = z80_inst_nop2,
  414. [0x98] = z80_inst_nop2,
  415. [0x99] = z80_inst_nop2,
  416. [0x9A] = z80_inst_nop2,
  417. [0x9B] = z80_inst_nop2,
  418. [0x9C] = z80_inst_nop2,
  419. [0x9D] = z80_inst_nop2,
  420. [0x9E] = z80_inst_nop2,
  421. [0x9F] = z80_inst_nop2,
  422. [0xA0] = z80_inst_ldi,
  423. [0xA1] = z80_inst_unimplemented, // TODO
  424. [0xA2] = z80_inst_ini,
  425. [0xA3] = z80_inst_outi,
  426. [0xA4] = z80_inst_nop2,
  427. [0xA5] = z80_inst_nop2,
  428. [0xA6] = z80_inst_nop2,
  429. [0xA7] = z80_inst_nop2,
  430. [0xA8] = z80_inst_ldd,
  431. [0xA9] = z80_inst_unimplemented, // TODO
  432. [0xAA] = z80_inst_ind,
  433. [0xAB] = z80_inst_outd,
  434. [0xAC] = z80_inst_nop2,
  435. [0xAD] = z80_inst_nop2,
  436. [0xAE] = z80_inst_nop2,
  437. [0xAF] = z80_inst_nop2,
  438. [0xB0] = z80_inst_ldir,
  439. [0xB1] = z80_inst_unimplemented, // TODO
  440. [0xB2] = z80_inst_inir,
  441. [0xB3] = z80_inst_otir,
  442. [0xB4] = z80_inst_nop2,
  443. [0xB5] = z80_inst_nop2,
  444. [0xB6] = z80_inst_nop2,
  445. [0xB7] = z80_inst_nop2,
  446. [0xB8] = z80_inst_lddr,
  447. [0xB9] = z80_inst_unimplemented, // TODO
  448. [0xBA] = z80_inst_indr,
  449. [0xBB] = z80_inst_otdr,
  450. [0xBC] = z80_inst_nop2,
  451. [0xBD] = z80_inst_nop2,
  452. [0xBE] = z80_inst_nop2,
  453. [0xBF] = z80_inst_nop2,
  454. [0xC0] = z80_inst_nop2,
  455. [0xC1] = z80_inst_nop2,
  456. [0xC2] = z80_inst_nop2,
  457. [0xC3] = z80_inst_nop2,
  458. [0xC4] = z80_inst_nop2,
  459. [0xC5] = z80_inst_nop2,
  460. [0xC6] = z80_inst_nop2,
  461. [0xC7] = z80_inst_nop2,
  462. [0xC8] = z80_inst_nop2,
  463. [0xC9] = z80_inst_nop2,
  464. [0xCA] = z80_inst_nop2,
  465. [0xCB] = z80_inst_nop2,
  466. [0xCC] = z80_inst_nop2,
  467. [0xCD] = z80_inst_nop2,
  468. [0xCE] = z80_inst_nop2,
  469. [0xCF] = z80_inst_nop2,
  470. [0xD0] = z80_inst_nop2,
  471. [0xD1] = z80_inst_nop2,
  472. [0xD2] = z80_inst_nop2,
  473. [0xD3] = z80_inst_nop2,
  474. [0xD4] = z80_inst_nop2,
  475. [0xD5] = z80_inst_nop2,
  476. [0xD6] = z80_inst_nop2,
  477. [0xD7] = z80_inst_nop2,
  478. [0xD8] = z80_inst_nop2,
  479. [0xD9] = z80_inst_nop2,
  480. [0xDA] = z80_inst_nop2,
  481. [0xDB] = z80_inst_nop2,
  482. [0xDC] = z80_inst_nop2,
  483. [0xDD] = z80_inst_nop2,
  484. [0xDE] = z80_inst_nop2,
  485. [0xDF] = z80_inst_nop2,
  486. [0xE0] = z80_inst_nop2,
  487. [0xE1] = z80_inst_nop2,
  488. [0xE2] = z80_inst_nop2,
  489. [0xE3] = z80_inst_nop2,
  490. [0xE4] = z80_inst_nop2,
  491. [0xE5] = z80_inst_nop2,
  492. [0xE6] = z80_inst_nop2,
  493. [0xE7] = z80_inst_nop2,
  494. [0xE8] = z80_inst_nop2,
  495. [0xE9] = z80_inst_nop2,
  496. [0xEA] = z80_inst_nop2,
  497. [0xEB] = z80_inst_nop2,
  498. [0xEC] = z80_inst_nop2,
  499. [0xED] = z80_inst_nop2,
  500. [0xEE] = z80_inst_nop2,
  501. [0xEF] = z80_inst_nop2,
  502. [0xF0] = z80_inst_nop2,
  503. [0xF1] = z80_inst_nop2,
  504. [0xF2] = z80_inst_nop2,
  505. [0xF3] = z80_inst_nop2,
  506. [0xF4] = z80_inst_nop2,
  507. [0xF5] = z80_inst_nop2,
  508. [0xF6] = z80_inst_nop2,
  509. [0xF7] = z80_inst_nop2,
  510. [0xF8] = z80_inst_nop2,
  511. [0xF9] = z80_inst_nop2,
  512. [0xFA] = z80_inst_nop2,
  513. [0xFB] = z80_inst_nop2,
  514. [0xFC] = z80_inst_nop2,
  515. [0xFD] = z80_inst_nop2,
  516. [0xFE] = z80_inst_nop2,
  517. [0xFF] = z80_inst_nop2
  518. };
  519. static DispatchTable instruction_table_bits = {
  520. [0x00] = z80_inst_rlc_r,
  521. [0x01] = z80_inst_rlc_r,
  522. [0x02] = z80_inst_rlc_r,
  523. [0x03] = z80_inst_rlc_r,
  524. [0x04] = z80_inst_rlc_r,
  525. [0x05] = z80_inst_rlc_r,
  526. [0x06] = z80_inst_rlc_hl,
  527. [0x07] = z80_inst_rlc_r,
  528. [0x08] = z80_inst_rrc_r,
  529. [0x09] = z80_inst_rrc_r,
  530. [0x0A] = z80_inst_rrc_r,
  531. [0x0B] = z80_inst_rrc_r,
  532. [0x0C] = z80_inst_rrc_r,
  533. [0x0D] = z80_inst_rrc_r,
  534. [0x0E] = z80_inst_rrc_hl,
  535. [0x0F] = z80_inst_rrc_r,
  536. [0x10] = z80_inst_rl_r,
  537. [0x11] = z80_inst_rl_r,
  538. [0x12] = z80_inst_rl_r,
  539. [0x13] = z80_inst_rl_r,
  540. [0x14] = z80_inst_rl_r,
  541. [0x15] = z80_inst_rl_r,
  542. [0x16] = z80_inst_rl_hl,
  543. [0x17] = z80_inst_rl_r,
  544. [0x18] = z80_inst_rr_r,
  545. [0x19] = z80_inst_rr_r,
  546. [0x1A] = z80_inst_rr_r,
  547. [0x1B] = z80_inst_rr_r,
  548. [0x1C] = z80_inst_rr_r,
  549. [0x1D] = z80_inst_rr_r,
  550. [0x1E] = z80_inst_rr_hl,
  551. [0x1F] = z80_inst_rr_r,
  552. [0x20] = z80_inst_sla_r,
  553. [0x21] = z80_inst_sla_r,
  554. [0x22] = z80_inst_sla_r,
  555. [0x23] = z80_inst_sla_r,
  556. [0x24] = z80_inst_sla_r,
  557. [0x25] = z80_inst_sla_r,
  558. [0x26] = z80_inst_sla_hl,
  559. [0x27] = z80_inst_sla_r,
  560. [0x28] = z80_inst_sra_r,
  561. [0x29] = z80_inst_sra_r,
  562. [0x2A] = z80_inst_sra_r,
  563. [0x2B] = z80_inst_sra_r,
  564. [0x2C] = z80_inst_sra_r,
  565. [0x2D] = z80_inst_sra_r,
  566. [0x2E] = z80_inst_sra_hl,
  567. [0x2F] = z80_inst_sra_r,
  568. [0x30] = z80_inst_sl1_r,
  569. [0x31] = z80_inst_sl1_r,
  570. [0x32] = z80_inst_sl1_r,
  571. [0x33] = z80_inst_sl1_r,
  572. [0x34] = z80_inst_sl1_r,
  573. [0x35] = z80_inst_sl1_r,
  574. [0x36] = z80_inst_sl1_hl,
  575. [0x37] = z80_inst_sl1_r,
  576. [0x38] = z80_inst_srl_r,
  577. [0x39] = z80_inst_srl_r,
  578. [0x3A] = z80_inst_srl_r,
  579. [0x3B] = z80_inst_srl_r,
  580. [0x3C] = z80_inst_srl_r,
  581. [0x3D] = z80_inst_srl_r,
  582. [0x3E] = z80_inst_srl_hl,
  583. [0x3F] = z80_inst_srl_r,
  584. [0x40] = z80_inst_bit_b_r,
  585. [0x41] = z80_inst_bit_b_r,
  586. [0x42] = z80_inst_bit_b_r,
  587. [0x43] = z80_inst_bit_b_r,
  588. [0x44] = z80_inst_bit_b_r,
  589. [0x45] = z80_inst_bit_b_r,
  590. [0x46] = z80_inst_bit_b_hl,
  591. [0x47] = z80_inst_bit_b_r,
  592. [0x48] = z80_inst_bit_b_r,
  593. [0x49] = z80_inst_bit_b_r,
  594. [0x4A] = z80_inst_bit_b_r,
  595. [0x4B] = z80_inst_bit_b_r,
  596. [0x4C] = z80_inst_bit_b_r,
  597. [0x4D] = z80_inst_bit_b_r,
  598. [0x4E] = z80_inst_bit_b_hl,
  599. [0x4F] = z80_inst_bit_b_r,
  600. [0x50] = z80_inst_bit_b_r,
  601. [0x51] = z80_inst_bit_b_r,
  602. [0x52] = z80_inst_bit_b_r,
  603. [0x53] = z80_inst_bit_b_r,
  604. [0x54] = z80_inst_bit_b_r,
  605. [0x55] = z80_inst_bit_b_r,
  606. [0x56] = z80_inst_bit_b_hl,
  607. [0x57] = z80_inst_bit_b_r,
  608. [0x58] = z80_inst_bit_b_r,
  609. [0x59] = z80_inst_bit_b_r,
  610. [0x5A] = z80_inst_bit_b_r,
  611. [0x5B] = z80_inst_bit_b_r,
  612. [0x5C] = z80_inst_bit_b_r,
  613. [0x5D] = z80_inst_bit_b_r,
  614. [0x5E] = z80_inst_bit_b_hl,
  615. [0x5F] = z80_inst_bit_b_r,
  616. [0x60] = z80_inst_bit_b_r,
  617. [0x61] = z80_inst_bit_b_r,
  618. [0x62] = z80_inst_bit_b_r,
  619. [0x63] = z80_inst_bit_b_r,
  620. [0x64] = z80_inst_bit_b_r,
  621. [0x65] = z80_inst_bit_b_r,
  622. [0x66] = z80_inst_bit_b_hl,
  623. [0x67] = z80_inst_bit_b_r,
  624. [0x68] = z80_inst_bit_b_r,
  625. [0x69] = z80_inst_bit_b_r,
  626. [0x6A] = z80_inst_bit_b_r,
  627. [0x6B] = z80_inst_bit_b_r,
  628. [0x6C] = z80_inst_bit_b_r,
  629. [0x6D] = z80_inst_bit_b_r,
  630. [0x6E] = z80_inst_bit_b_hl,
  631. [0x6F] = z80_inst_bit_b_r,
  632. [0x70] = z80_inst_bit_b_r,
  633. [0x71] = z80_inst_bit_b_r,
  634. [0x72] = z80_inst_bit_b_r,
  635. [0x73] = z80_inst_bit_b_r,
  636. [0x74] = z80_inst_bit_b_r,
  637. [0x75] = z80_inst_bit_b_r,
  638. [0x76] = z80_inst_bit_b_hl,
  639. [0x77] = z80_inst_bit_b_r,
  640. [0x78] = z80_inst_bit_b_r,
  641. [0x79] = z80_inst_bit_b_r,
  642. [0x7A] = z80_inst_bit_b_r,
  643. [0x7B] = z80_inst_bit_b_r,
  644. [0x7C] = z80_inst_bit_b_r,
  645. [0x7D] = z80_inst_bit_b_r,
  646. [0x7E] = z80_inst_bit_b_hl,
  647. [0x7F] = z80_inst_bit_b_r,
  648. [0x80] = z80_inst_unimplemented, // TODO
  649. [0x81] = z80_inst_unimplemented, // TODO
  650. [0x82] = z80_inst_unimplemented, // TODO
  651. [0x83] = z80_inst_unimplemented, // TODO
  652. [0x84] = z80_inst_unimplemented, // TODO
  653. [0x85] = z80_inst_unimplemented, // TODO
  654. [0x86] = z80_inst_res_b_hl,
  655. [0x87] = z80_inst_unimplemented, // TODO
  656. [0x88] = z80_inst_unimplemented, // TODO
  657. [0x89] = z80_inst_unimplemented, // TODO
  658. [0x8A] = z80_inst_unimplemented, // TODO
  659. [0x8B] = z80_inst_unimplemented, // TODO
  660. [0x8C] = z80_inst_unimplemented, // TODO
  661. [0x8D] = z80_inst_unimplemented, // TODO
  662. [0x8E] = z80_inst_res_b_hl,
  663. [0x8F] = z80_inst_unimplemented, // TODO
  664. [0x90] = z80_inst_unimplemented, // TODO
  665. [0x91] = z80_inst_unimplemented, // TODO
  666. [0x92] = z80_inst_unimplemented, // TODO
  667. [0x93] = z80_inst_unimplemented, // TODO
  668. [0x94] = z80_inst_unimplemented, // TODO
  669. [0x95] = z80_inst_unimplemented, // TODO
  670. [0x96] = z80_inst_res_b_hl,
  671. [0x97] = z80_inst_unimplemented, // TODO
  672. [0x98] = z80_inst_unimplemented, // TODO
  673. [0x99] = z80_inst_unimplemented, // TODO
  674. [0x9A] = z80_inst_unimplemented, // TODO
  675. [0x9B] = z80_inst_unimplemented, // TODO
  676. [0x9C] = z80_inst_unimplemented, // TODO
  677. [0x9D] = z80_inst_unimplemented, // TODO
  678. [0x9E] = z80_inst_res_b_hl,
  679. [0x9F] = z80_inst_unimplemented, // TODO
  680. [0xA0] = z80_inst_unimplemented, // TODO
  681. [0xA1] = z80_inst_unimplemented, // TODO
  682. [0xA2] = z80_inst_unimplemented, // TODO
  683. [0xA3] = z80_inst_unimplemented, // TODO
  684. [0xA4] = z80_inst_unimplemented, // TODO
  685. [0xA5] = z80_inst_unimplemented, // TODO
  686. [0xA6] = z80_inst_res_b_hl,
  687. [0xA7] = z80_inst_unimplemented, // TODO
  688. [0xA8] = z80_inst_unimplemented, // TODO
  689. [0xA9] = z80_inst_unimplemented, // TODO
  690. [0xAA] = z80_inst_unimplemented, // TODO
  691. [0xAB] = z80_inst_unimplemented, // TODO
  692. [0xAC] = z80_inst_unimplemented, // TODO
  693. [0xAD] = z80_inst_unimplemented, // TODO
  694. [0xAE] = z80_inst_res_b_hl,
  695. [0xAF] = z80_inst_unimplemented, // TODO
  696. [0xB0] = z80_inst_unimplemented, // TODO
  697. [0xB1] = z80_inst_unimplemented, // TODO
  698. [0xB2] = z80_inst_unimplemented, // TODO
  699. [0xB3] = z80_inst_unimplemented, // TODO
  700. [0xB4] = z80_inst_unimplemented, // TODO
  701. [0xB5] = z80_inst_unimplemented, // TODO
  702. [0xB6] = z80_inst_res_b_hl,
  703. [0xB7] = z80_inst_unimplemented, // TODO
  704. [0xB8] = z80_inst_unimplemented, // TODO
  705. [0xB9] = z80_inst_unimplemented, // TODO
  706. [0xBA] = z80_inst_unimplemented, // TODO
  707. [0xBB] = z80_inst_unimplemented, // TODO
  708. [0xBC] = z80_inst_unimplemented, // TODO
  709. [0xBD] = z80_inst_unimplemented, // TODO
  710. [0xBE] = z80_inst_res_b_hl,
  711. [0xBF] = z80_inst_unimplemented, // TODO
  712. [0xC0] = z80_inst_unimplemented, // TODO
  713. [0xC1] = z80_inst_unimplemented, // TODO
  714. [0xC2] = z80_inst_unimplemented, // TODO
  715. [0xC3] = z80_inst_unimplemented, // TODO
  716. [0xC4] = z80_inst_unimplemented, // TODO
  717. [0xC5] = z80_inst_unimplemented, // TODO
  718. [0xC6] = z80_inst_unimplemented, // TODO
  719. [0xC7] = z80_inst_unimplemented, // TODO
  720. [0xC8] = z80_inst_unimplemented, // TODO
  721. [0xC9] = z80_inst_unimplemented, // TODO
  722. [0xCA] = z80_inst_unimplemented, // TODO
  723. [0xCB] = z80_inst_unimplemented, // TODO
  724. [0xCC] = z80_inst_unimplemented, // TODO
  725. [0xCD] = z80_inst_unimplemented, // TODO
  726. [0xCE] = z80_inst_unimplemented, // TODO
  727. [0xCF] = z80_inst_unimplemented, // TODO
  728. [0xD0] = z80_inst_unimplemented, // TODO
  729. [0xD1] = z80_inst_unimplemented, // TODO
  730. [0xD2] = z80_inst_unimplemented, // TODO
  731. [0xD3] = z80_inst_unimplemented, // TODO
  732. [0xD4] = z80_inst_unimplemented, // TODO
  733. [0xD5] = z80_inst_unimplemented, // TODO
  734. [0xD6] = z80_inst_unimplemented, // TODO
  735. [0xD7] = z80_inst_unimplemented, // TODO
  736. [0xD8] = z80_inst_unimplemented, // TODO
  737. [0xD9] = z80_inst_unimplemented, // TODO
  738. [0xDA] = z80_inst_unimplemented, // TODO
  739. [0xDB] = z80_inst_unimplemented, // TODO
  740. [0xDC] = z80_inst_unimplemented, // TODO
  741. [0xDD] = z80_inst_unimplemented, // TODO
  742. [0xDE] = z80_inst_unimplemented, // TODO
  743. [0xDF] = z80_inst_unimplemented, // TODO
  744. [0xE0] = z80_inst_unimplemented, // TODO
  745. [0xE1] = z80_inst_unimplemented, // TODO
  746. [0xE2] = z80_inst_unimplemented, // TODO
  747. [0xE3] = z80_inst_unimplemented, // TODO
  748. [0xE4] = z80_inst_unimplemented, // TODO
  749. [0xE5] = z80_inst_unimplemented, // TODO
  750. [0xE6] = z80_inst_unimplemented, // TODO
  751. [0xE7] = z80_inst_unimplemented, // TODO
  752. [0xE8] = z80_inst_unimplemented, // TODO
  753. [0xE9] = z80_inst_unimplemented, // TODO
  754. [0xEA] = z80_inst_unimplemented, // TODO
  755. [0xEB] = z80_inst_unimplemented, // TODO
  756. [0xEC] = z80_inst_unimplemented, // TODO
  757. [0xED] = z80_inst_unimplemented, // TODO
  758. [0xEE] = z80_inst_unimplemented, // TODO
  759. [0xEF] = z80_inst_unimplemented, // TODO
  760. [0xF0] = z80_inst_unimplemented, // TODO
  761. [0xF1] = z80_inst_unimplemented, // TODO
  762. [0xF2] = z80_inst_unimplemented, // TODO
  763. [0xF3] = z80_inst_unimplemented, // TODO
  764. [0xF4] = z80_inst_unimplemented, // TODO
  765. [0xF5] = z80_inst_unimplemented, // TODO
  766. [0xF6] = z80_inst_unimplemented, // TODO
  767. [0xF7] = z80_inst_unimplemented, // TODO
  768. [0xF8] = z80_inst_unimplemented, // TODO
  769. [0xF9] = z80_inst_unimplemented, // TODO
  770. [0xFA] = z80_inst_unimplemented, // TODO
  771. [0xFB] = z80_inst_unimplemented, // TODO
  772. [0xFC] = z80_inst_unimplemented, // TODO
  773. [0xFD] = z80_inst_unimplemented, // TODO
  774. [0xFE] = z80_inst_unimplemented, // TODO
  775. [0xFF] = z80_inst_unimplemented // TODO
  776. };
  777. static DispatchTable instruction_table_index = {
  778. [0x00] = z80_inst_nop2,
  779. [0x01] = z80_inst_nop2,
  780. [0x02] = z80_inst_nop2,
  781. [0x03] = z80_inst_nop2,
  782. [0x04] = z80_inst_nop2,
  783. [0x05] = z80_inst_nop2,
  784. [0x06] = z80_inst_nop2,
  785. [0x07] = z80_inst_nop2,
  786. [0x08] = z80_inst_nop2,
  787. [0x09] = z80_inst_add_ixy_ss,
  788. [0x0A] = z80_inst_nop2,
  789. [0x0B] = z80_inst_nop2,
  790. [0x0C] = z80_inst_nop2,
  791. [0x0D] = z80_inst_nop2,
  792. [0x0E] = z80_inst_nop2,
  793. [0x0F] = z80_inst_nop2,
  794. [0x10] = z80_inst_nop2,
  795. [0x11] = z80_inst_nop2,
  796. [0x12] = z80_inst_nop2,
  797. [0x13] = z80_inst_nop2,
  798. [0x14] = z80_inst_nop2,
  799. [0x15] = z80_inst_nop2,
  800. [0x16] = z80_inst_nop2,
  801. [0x17] = z80_inst_nop2,
  802. [0x18] = z80_inst_nop2,
  803. [0x19] = z80_inst_add_ixy_ss,
  804. [0x1A] = z80_inst_nop2,
  805. [0x1B] = z80_inst_nop2,
  806. [0x1C] = z80_inst_nop2,
  807. [0x1D] = z80_inst_nop2,
  808. [0x1E] = z80_inst_nop2,
  809. [0x1F] = z80_inst_nop2,
  810. [0x20] = z80_inst_nop2,
  811. [0x21] = z80_inst_ld_ixy_nn,
  812. [0x22] = z80_inst_ld_inn_ixy,
  813. [0x23] = z80_inst_inc_xy,
  814. [0x24] = z80_inst_unimplemented, // TODO
  815. [0x25] = z80_inst_unimplemented, // TODO
  816. [0x26] = z80_inst_unimplemented, // TODO
  817. [0x27] = z80_inst_nop2,
  818. [0x28] = z80_inst_nop2,
  819. [0x29] = z80_inst_add_ixy_ss,
  820. [0x2A] = z80_inst_ld_ixy_inn,
  821. [0x2B] = z80_inst_dec_xy,
  822. [0x2C] = z80_inst_unimplemented, // TODO
  823. [0x2D] = z80_inst_unimplemented, // TODO
  824. [0x2E] = z80_inst_unimplemented, // TODO
  825. [0x2F] = z80_inst_nop2,
  826. [0x30] = z80_inst_nop2,
  827. [0x31] = z80_inst_nop2,
  828. [0x32] = z80_inst_nop2,
  829. [0x33] = z80_inst_nop2,
  830. [0x34] = z80_inst_inc_ixy,
  831. [0x35] = z80_inst_dec_ixy,
  832. [0x36] = z80_inst_ld_ixy_n,
  833. [0x37] = z80_inst_nop2,
  834. [0x38] = z80_inst_nop2,
  835. [0x39] = z80_inst_add_ixy_ss,
  836. [0x3A] = z80_inst_nop2,
  837. [0x3B] = z80_inst_nop2,
  838. [0x3C] = z80_inst_nop2,
  839. [0x3D] = z80_inst_nop2,
  840. [0x3E] = z80_inst_nop2,
  841. [0x3F] = z80_inst_nop2,
  842. [0x40] = z80_inst_nop2,
  843. [0x41] = z80_inst_nop2,
  844. [0x42] = z80_inst_nop2,
  845. [0x43] = z80_inst_nop2,
  846. [0x44] = z80_inst_unimplemented, // TODO
  847. [0x45] = z80_inst_unimplemented, // TODO
  848. [0x46] = z80_inst_ld_r_ixy,
  849. [0x47] = z80_inst_nop2,
  850. [0x48] = z80_inst_nop2,
  851. [0x49] = z80_inst_nop2,
  852. [0x4A] = z80_inst_nop2,
  853. [0x4B] = z80_inst_nop2,
  854. [0x4C] = z80_inst_unimplemented, // TODO
  855. [0x4D] = z80_inst_unimplemented, // TODO
  856. [0x4E] = z80_inst_ld_r_ixy,
  857. [0x4F] = z80_inst_nop2,
  858. [0x50] = z80_inst_nop2,
  859. [0x51] = z80_inst_nop2,
  860. [0x52] = z80_inst_nop2,
  861. [0x53] = z80_inst_nop2,
  862. [0x54] = z80_inst_unimplemented, // TODO
  863. [0x55] = z80_inst_unimplemented, // TODO
  864. [0x56] = z80_inst_ld_r_ixy,
  865. [0x57] = z80_inst_nop2,
  866. [0x58] = z80_inst_nop2,
  867. [0x59] = z80_inst_nop2,
  868. [0x5A] = z80_inst_nop2,
  869. [0x5B] = z80_inst_nop2,
  870. [0x5C] = z80_inst_unimplemented, // TODO
  871. [0x5D] = z80_inst_unimplemented, // TODO
  872. [0x5E] = z80_inst_ld_r_ixy,
  873. [0x5F] = z80_inst_nop2,
  874. [0x60] = z80_inst_unimplemented, // TODO
  875. [0x61] = z80_inst_unimplemented, // TODO
  876. [0x62] = z80_inst_unimplemented, // TODO
  877. [0x63] = z80_inst_unimplemented, // TODO
  878. [0x64] = z80_inst_unimplemented, // TODO
  879. [0x65] = z80_inst_unimplemented, // TODO
  880. [0x66] = z80_inst_ld_r_ixy,
  881. [0x67] = z80_inst_unimplemented, // TODO
  882. [0x68] = z80_inst_unimplemented, // TODO
  883. [0x69] = z80_inst_unimplemented, // TODO
  884. [0x6A] = z80_inst_unimplemented, // TODO
  885. [0x6B] = z80_inst_unimplemented, // TODO
  886. [0x6C] = z80_inst_unimplemented, // TODO
  887. [0x6D] = z80_inst_unimplemented, // TODO
  888. [0x6E] = z80_inst_ld_r_ixy,
  889. [0x6F] = z80_inst_unimplemented, // TODO
  890. [0x70] = z80_inst_ld_ixy_r,
  891. [0x71] = z80_inst_ld_ixy_r,
  892. [0x72] = z80_inst_ld_ixy_r,
  893. [0x73] = z80_inst_ld_ixy_r,
  894. [0x74] = z80_inst_ld_ixy_r,
  895. [0x75] = z80_inst_ld_ixy_r,
  896. [0x76] = z80_inst_nop2,
  897. [0x77] = z80_inst_ld_ixy_r,
  898. [0x78] = z80_inst_nop2,
  899. [0x79] = z80_inst_nop2,
  900. [0x7A] = z80_inst_nop2,
  901. [0x7B] = z80_inst_nop2,
  902. [0x7C] = z80_inst_unimplemented, // TODO
  903. [0x7D] = z80_inst_unimplemented, // TODO
  904. [0x7E] = z80_inst_ld_r_ixy,
  905. [0x7F] = z80_inst_nop2,
  906. [0x80] = z80_inst_nop2,
  907. [0x81] = z80_inst_nop2,
  908. [0x82] = z80_inst_nop2,
  909. [0x83] = z80_inst_nop2,
  910. [0x84] = z80_inst_unimplemented, // TODO
  911. [0x85] = z80_inst_unimplemented, // TODO
  912. [0x86] = z80_inst_add_a_ixy,
  913. [0x87] = z80_inst_nop2,
  914. [0x88] = z80_inst_nop2,
  915. [0x89] = z80_inst_nop2,
  916. [0x8A] = z80_inst_nop2,
  917. [0x8B] = z80_inst_nop2,
  918. [0x8C] = z80_inst_unimplemented, // TODO
  919. [0x8D] = z80_inst_unimplemented, // TODO
  920. [0x8E] = z80_inst_adc_a_ixy,
  921. [0x8F] = z80_inst_nop2,
  922. [0x90] = z80_inst_nop2,
  923. [0x91] = z80_inst_nop2,
  924. [0x92] = z80_inst_nop2,
  925. [0x93] = z80_inst_nop2,
  926. [0x94] = z80_inst_unimplemented, // TODO
  927. [0x95] = z80_inst_unimplemented, // TODO
  928. [0x96] = z80_inst_sub_ixy,
  929. [0x97] = z80_inst_nop2,
  930. [0x98] = z80_inst_nop2,
  931. [0x99] = z80_inst_nop2,
  932. [0x9A] = z80_inst_nop2,
  933. [0x9B] = z80_inst_nop2,
  934. [0x9C] = z80_inst_unimplemented, // TODO
  935. [0x9D] = z80_inst_unimplemented, // TODO
  936. [0x9E] = z80_inst_sbc_a_ixy,
  937. [0x9F] = z80_inst_nop2,
  938. [0xA0] = z80_inst_nop2,
  939. [0xA1] = z80_inst_nop2,
  940. [0xA2] = z80_inst_nop2,
  941. [0xA3] = z80_inst_nop2,
  942. [0xA4] = z80_inst_unimplemented, // TODO
  943. [0xA5] = z80_inst_unimplemented, // TODO
  944. [0xA6] = z80_inst_and_ixy,
  945. [0xA7] = z80_inst_nop2,
  946. [0xA8] = z80_inst_nop2,
  947. [0xA9] = z80_inst_nop2,
  948. [0xAA] = z80_inst_nop2,
  949. [0xAB] = z80_inst_nop2,
  950. [0xAC] = z80_inst_unimplemented, // TODO
  951. [0xAD] = z80_inst_unimplemented, // TODO
  952. [0xAE] = z80_inst_xor_ixy,
  953. [0xAF] = z80_inst_nop2,
  954. [0xB0] = z80_inst_nop2,
  955. [0xB1] = z80_inst_nop2,
  956. [0xB2] = z80_inst_nop2,
  957. [0xB3] = z80_inst_nop2,
  958. [0xB4] = z80_inst_unimplemented, // TODO
  959. [0xB5] = z80_inst_unimplemented, // TODO
  960. [0xB6] = z80_inst_or_ixy,
  961. [0xB7] = z80_inst_nop2,
  962. [0xB8] = z80_inst_nop2,
  963. [0xB9] = z80_inst_nop2,
  964. [0xBA] = z80_inst_nop2,
  965. [0xBB] = z80_inst_nop2,
  966. [0xBC] = z80_inst_unimplemented, // TODO
  967. [0xBD] = z80_inst_unimplemented, // TODO
  968. [0xBE] = z80_inst_cp_ixy,
  969. [0xBF] = z80_inst_nop2,
  970. [0xC0] = z80_inst_nop2,
  971. [0xC1] = z80_inst_nop2,
  972. [0xC2] = z80_inst_nop2,
  973. [0xC3] = z80_inst_nop2,
  974. [0xC4] = z80_inst_nop2,
  975. [0xC5] = z80_inst_nop2,
  976. [0xC6] = z80_inst_nop2,
  977. [0xC7] = z80_inst_nop2,
  978. [0xC8] = z80_inst_nop2,
  979. [0xC9] = z80_inst_nop2,
  980. [0xCA] = z80_inst_nop2,
  981. [0xCB] = z80_prefix_index_bits,
  982. [0xCC] = z80_inst_nop2,
  983. [0xCD] = z80_inst_nop2,
  984. [0xCE] = z80_inst_nop2,
  985. [0xCF] = z80_inst_nop2,
  986. [0xD0] = z80_inst_nop2,
  987. [0xD1] = z80_inst_nop2,
  988. [0xD2] = z80_inst_nop2,
  989. [0xD3] = z80_inst_nop2,
  990. [0xD4] = z80_inst_nop2,
  991. [0xD5] = z80_inst_nop2,
  992. [0xD6] = z80_inst_nop2,
  993. [0xD7] = z80_inst_nop2,
  994. [0xD8] = z80_inst_nop2,
  995. [0xD9] = z80_inst_nop2,
  996. [0xDA] = z80_inst_nop2,
  997. [0xDB] = z80_inst_nop2,
  998. [0xDC] = z80_inst_nop2,
  999. [0xDD] = z80_inst_nop2,
  1000. [0xDE] = z80_inst_nop2,
  1001. [0xDF] = z80_inst_nop2,
  1002. [0xE0] = z80_inst_nop2,
  1003. [0xE1] = z80_inst_pop_ixy,
  1004. [0xE2] = z80_inst_nop2,
  1005. [0xE3] = z80_inst_ex_sp_ixy,
  1006. [0xE4] = z80_inst_nop2,
  1007. [0xE5] = z80_inst_push_ixy,
  1008. [0xE6] = z80_inst_nop2,
  1009. [0xE7] = z80_inst_nop2,
  1010. [0xE8] = z80_inst_nop2,
  1011. [0xE9] = z80_inst_jp_ixy,
  1012. [0xEA] = z80_inst_nop2,
  1013. [0xEB] = z80_inst_nop2,
  1014. [0xEC] = z80_inst_nop2,
  1015. [0xED] = z80_inst_nop2,
  1016. [0xEE] = z80_inst_nop2,
  1017. [0xEF] = z80_inst_nop2,
  1018. [0xF0] = z80_inst_nop2,
  1019. [0xF1] = z80_inst_nop2,
  1020. [0xF2] = z80_inst_nop2,
  1021. [0xF3] = z80_inst_nop2,
  1022. [0xF4] = z80_inst_nop2,
  1023. [0xF5] = z80_inst_nop2,
  1024. [0xF6] = z80_inst_nop2,
  1025. [0xF7] = z80_inst_nop2,
  1026. [0xF8] = z80_inst_nop2,
  1027. [0xF9] = z80_inst_ld_sp_ixy,
  1028. [0xFA] = z80_inst_nop2,
  1029. [0xFB] = z80_inst_nop2,
  1030. [0xFC] = z80_inst_nop2,
  1031. [0xFD] = z80_inst_nop2,
  1032. [0xFE] = z80_inst_nop2,
  1033. [0xFF] = z80_inst_nop2
  1034. };
  1035. static DispatchTable instruction_table_index_bits = {
  1036. [0x00] = z80_inst_unimplemented, // TODO
  1037. [0x01] = z80_inst_unimplemented, // TODO
  1038. [0x02] = z80_inst_unimplemented, // TODO
  1039. [0x03] = z80_inst_unimplemented, // TODO
  1040. [0x04] = z80_inst_unimplemented, // TODO
  1041. [0x05] = z80_inst_unimplemented, // TODO
  1042. [0x06] = z80_inst_unimplemented, // TODO
  1043. [0x07] = z80_inst_unimplemented, // TODO
  1044. [0x08] = z80_inst_unimplemented, // TODO
  1045. [0x09] = z80_inst_unimplemented, // TODO
  1046. [0x0A] = z80_inst_unimplemented, // TODO
  1047. [0x0B] = z80_inst_unimplemented, // TODO
  1048. [0x0C] = z80_inst_unimplemented, // TODO
  1049. [0x0D] = z80_inst_unimplemented, // TODO
  1050. [0x0E] = z80_inst_unimplemented, // TODO
  1051. [0x0F] = z80_inst_unimplemented, // TODO
  1052. [0x10] = z80_inst_unimplemented, // TODO
  1053. [0x11] = z80_inst_unimplemented, // TODO
  1054. [0x12] = z80_inst_unimplemented, // TODO
  1055. [0x13] = z80_inst_unimplemented, // TODO
  1056. [0x14] = z80_inst_unimplemented, // TODO
  1057. [0x15] = z80_inst_unimplemented, // TODO
  1058. [0x16] = z80_inst_unimplemented, // TODO
  1059. [0x17] = z80_inst_unimplemented, // TODO
  1060. [0x18] = z80_inst_unimplemented, // TODO
  1061. [0x19] = z80_inst_unimplemented, // TODO
  1062. [0x1A] = z80_inst_unimplemented, // TODO
  1063. [0x1B] = z80_inst_unimplemented, // TODO
  1064. [0x1C] = z80_inst_unimplemented, // TODO
  1065. [0x1D] = z80_inst_unimplemented, // TODO
  1066. [0x1E] = z80_inst_unimplemented, // TODO
  1067. [0x1F] = z80_inst_unimplemented, // TODO
  1068. [0x20] = z80_inst_unimplemented, // TODO
  1069. [0x21] = z80_inst_unimplemented, // TODO
  1070. [0x22] = z80_inst_unimplemented, // TODO
  1071. [0x23] = z80_inst_unimplemented, // TODO
  1072. [0x24] = z80_inst_unimplemented, // TODO
  1073. [0x25] = z80_inst_unimplemented, // TODO
  1074. [0x26] = z80_inst_unimplemented, // TODO
  1075. [0x27] = z80_inst_unimplemented, // TODO
  1076. [0x28] = z80_inst_unimplemented, // TODO
  1077. [0x29] = z80_inst_unimplemented, // TODO
  1078. [0x2A] = z80_inst_unimplemented, // TODO
  1079. [0x2B] = z80_inst_unimplemented, // TODO
  1080. [0x2C] = z80_inst_unimplemented, // TODO
  1081. [0x2D] = z80_inst_unimplemented, // TODO
  1082. [0x2E] = z80_inst_unimplemented, // TODO
  1083. [0x2F] = z80_inst_unimplemented, // TODO
  1084. [0x30] = z80_inst_unimplemented, // TODO
  1085. [0x31] = z80_inst_unimplemented, // TODO
  1086. [0x32] = z80_inst_unimplemented, // TODO
  1087. [0x33] = z80_inst_unimplemented, // TODO
  1088. [0x34] = z80_inst_unimplemented, // TODO
  1089. [0x35] = z80_inst_unimplemented, // TODO
  1090. [0x36] = z80_inst_unimplemented, // TODO
  1091. [0x37] = z80_inst_unimplemented, // TODO
  1092. [0x38] = z80_inst_unimplemented, // TODO
  1093. [0x39] = z80_inst_unimplemented, // TODO
  1094. [0x3A] = z80_inst_unimplemented, // TODO
  1095. [0x3B] = z80_inst_unimplemented, // TODO
  1096. [0x3C] = z80_inst_unimplemented, // TODO
  1097. [0x3D] = z80_inst_unimplemented, // TODO
  1098. [0x3E] = z80_inst_unimplemented, // TODO
  1099. [0x3F] = z80_inst_unimplemented, // TODO
  1100. [0x40] = z80_inst_bit_b_ixy,
  1101. [0x41] = z80_inst_bit_b_ixy,
  1102. [0x42] = z80_inst_bit_b_ixy,
  1103. [0x43] = z80_inst_bit_b_ixy,
  1104. [0x44] = z80_inst_bit_b_ixy,
  1105. [0x45] = z80_inst_bit_b_ixy,
  1106. [0x46] = z80_inst_bit_b_ixy,
  1107. [0x47] = z80_inst_bit_b_ixy,
  1108. [0x48] = z80_inst_bit_b_ixy,
  1109. [0x49] = z80_inst_bit_b_ixy,
  1110. [0x4A] = z80_inst_bit_b_ixy,
  1111. [0x4B] = z80_inst_bit_b_ixy,
  1112. [0x4C] = z80_inst_bit_b_ixy,
  1113. [0x4D] = z80_inst_bit_b_ixy,
  1114. [0x4E] = z80_inst_bit_b_ixy,
  1115. [0x4F] = z80_inst_bit_b_ixy,
  1116. [0x50] = z80_inst_bit_b_ixy,
  1117. [0x51] = z80_inst_bit_b_ixy,
  1118. [0x52] = z80_inst_bit_b_ixy,
  1119. [0x53] = z80_inst_bit_b_ixy,
  1120. [0x54] = z80_inst_bit_b_ixy,
  1121. [0x55] = z80_inst_bit_b_ixy,
  1122. [0x56] = z80_inst_bit_b_ixy,
  1123. [0x57] = z80_inst_bit_b_ixy,
  1124. [0x58] = z80_inst_bit_b_ixy,
  1125. [0x59] = z80_inst_bit_b_ixy,
  1126. [0x5A] = z80_inst_bit_b_ixy,
  1127. [0x5B] = z80_inst_bit_b_ixy,
  1128. [0x5C] = z80_inst_bit_b_ixy,
  1129. [0x5D] = z80_inst_bit_b_ixy,
  1130. [0x5E] = z80_inst_bit_b_ixy,
  1131. [0x5F] = z80_inst_bit_b_ixy,
  1132. [0x60] = z80_inst_bit_b_ixy,
  1133. [0x61] = z80_inst_bit_b_ixy,
  1134. [0x62] = z80_inst_bit_b_ixy,
  1135. [0x63] = z80_inst_bit_b_ixy,
  1136. [0x64] = z80_inst_bit_b_ixy,
  1137. [0x65] = z80_inst_bit_b_ixy,
  1138. [0x66] = z80_inst_bit_b_ixy,
  1139. [0x67] = z80_inst_bit_b_ixy,
  1140. [0x68] = z80_inst_bit_b_ixy,
  1141. [0x69] = z80_inst_bit_b_ixy,
  1142. [0x6A] = z80_inst_bit_b_ixy,
  1143. [0x6B] = z80_inst_bit_b_ixy,
  1144. [0x6C] = z80_inst_bit_b_ixy,
  1145. [0x6D] = z80_inst_bit_b_ixy,
  1146. [0x6E] = z80_inst_bit_b_ixy,
  1147. [0x6F] = z80_inst_bit_b_ixy,
  1148. [0x70] = z80_inst_bit_b_ixy,
  1149. [0x71] = z80_inst_bit_b_ixy,
  1150. [0x72] = z80_inst_bit_b_ixy,
  1151. [0x73] = z80_inst_bit_b_ixy,
  1152. [0x74] = z80_inst_bit_b_ixy,
  1153. [0x75] = z80_inst_bit_b_ixy,
  1154. [0x76] = z80_inst_bit_b_ixy,
  1155. [0x77] = z80_inst_bit_b_ixy,
  1156. [0x78] = z80_inst_bit_b_ixy,
  1157. [0x79] = z80_inst_bit_b_ixy,
  1158. [0x7A] = z80_inst_bit_b_ixy,
  1159. [0x7B] = z80_inst_bit_b_ixy,
  1160. [0x7C] = z80_inst_bit_b_ixy,
  1161. [0x7D] = z80_inst_bit_b_ixy,
  1162. [0x7E] = z80_inst_bit_b_ixy,
  1163. [0x7F] = z80_inst_bit_b_ixy,
  1164. [0x80] = z80_inst_unimplemented, // TODO
  1165. [0x81] = z80_inst_unimplemented, // TODO
  1166. [0x82] = z80_inst_unimplemented, // TODO
  1167. [0x83] = z80_inst_unimplemented, // TODO
  1168. [0x84] = z80_inst_unimplemented, // TODO
  1169. [0x85] = z80_inst_unimplemented, // TODO
  1170. [0x86] = z80_inst_unimplemented, // TODO
  1171. [0x87] = z80_inst_unimplemented, // TODO
  1172. [0x88] = z80_inst_unimplemented, // TODO
  1173. [0x89] = z80_inst_unimplemented, // TODO
  1174. [0x8A] = z80_inst_unimplemented, // TODO
  1175. [0x8B] = z80_inst_unimplemented, // TODO
  1176. [0x8C] = z80_inst_unimplemented, // TODO
  1177. [0x8D] = z80_inst_unimplemented, // TODO
  1178. [0x8E] = z80_inst_unimplemented, // TODO
  1179. [0x8F] = z80_inst_unimplemented, // TODO
  1180. [0x90] = z80_inst_unimplemented, // TODO
  1181. [0x91] = z80_inst_unimplemented, // TODO
  1182. [0x92] = z80_inst_unimplemented, // TODO
  1183. [0x93] = z80_inst_unimplemented, // TODO
  1184. [0x94] = z80_inst_unimplemented, // TODO
  1185. [0x95] = z80_inst_unimplemented, // TODO
  1186. [0x96] = z80_inst_unimplemented, // TODO
  1187. [0x97] = z80_inst_unimplemented, // TODO
  1188. [0x98] = z80_inst_unimplemented, // TODO
  1189. [0x99] = z80_inst_unimplemented, // TODO
  1190. [0x9A] = z80_inst_unimplemented, // TODO
  1191. [0x9B] = z80_inst_unimplemented, // TODO
  1192. [0x9C] = z80_inst_unimplemented, // TODO
  1193. [0x9D] = z80_inst_unimplemented, // TODO
  1194. [0x9E] = z80_inst_unimplemented, // TODO
  1195. [0x9F] = z80_inst_unimplemented, // TODO
  1196. [0xA0] = z80_inst_unimplemented, // TODO
  1197. [0xA1] = z80_inst_unimplemented, // TODO
  1198. [0xA2] = z80_inst_unimplemented, // TODO
  1199. [0xA3] = z80_inst_unimplemented, // TODO
  1200. [0xA4] = z80_inst_unimplemented, // TODO
  1201. [0xA5] = z80_inst_unimplemented, // TODO
  1202. [0xA6] = z80_inst_unimplemented, // TODO
  1203. [0xA7] = z80_inst_unimplemented, // TODO
  1204. [0xA8] = z80_inst_unimplemented, // TODO
  1205. [0xA9] = z80_inst_unimplemented, // TODO
  1206. [0xAA] = z80_inst_unimplemented, // TODO
  1207. [0xAB] = z80_inst_unimplemented, // TODO
  1208. [0xAC] = z80_inst_unimplemented, // TODO
  1209. [0xAD] = z80_inst_unimplemented, // TODO
  1210. [0xAE] = z80_inst_unimplemented, // TODO
  1211. [0xAF] = z80_inst_unimplemented, // TODO
  1212. [0xB0] = z80_inst_unimplemented, // TODO
  1213. [0xB1] = z80_inst_unimplemented, // TODO
  1214. [0xB2] = z80_inst_unimplemented, // TODO
  1215. [0xB3] = z80_inst_unimplemented, // TODO
  1216. [0xB4] = z80_inst_unimplemented, // TODO
  1217. [0xB5] = z80_inst_unimplemented, // TODO
  1218. [0xB6] = z80_inst_unimplemented, // TODO
  1219. [0xB7] = z80_inst_unimplemented, // TODO
  1220. [0xB8] = z80_inst_unimplemented, // TODO
  1221. [0xB9] = z80_inst_unimplemented, // TODO
  1222. [0xBA] = z80_inst_unimplemented, // TODO
  1223. [0xBB] = z80_inst_unimplemented, // TODO
  1224. [0xBC] = z80_inst_unimplemented, // TODO
  1225. [0xBD] = z80_inst_unimplemented, // TODO
  1226. [0xBE] = z80_inst_unimplemented, // TODO
  1227. [0xBF] = z80_inst_unimplemented, // TODO
  1228. [0xC0] = z80_inst_unimplemented, // TODO
  1229. [0xC1] = z80_inst_unimplemented, // TODO
  1230. [0xC2] = z80_inst_unimplemented, // TODO
  1231. [0xC3] = z80_inst_unimplemented, // TODO
  1232. [0xC4] = z80_inst_unimplemented, // TODO
  1233. [0xC5] = z80_inst_unimplemented, // TODO
  1234. [0xC6] = z80_inst_unimplemented, // TODO
  1235. [0xC7] = z80_inst_unimplemented, // TODO
  1236. [0xC8] = z80_inst_unimplemented, // TODO
  1237. [0xC9] = z80_inst_unimplemented, // TODO
  1238. [0xCA] = z80_inst_unimplemented, // TODO
  1239. [0xCB] = z80_inst_unimplemented, // TODO
  1240. [0xCC] = z80_inst_unimplemented, // TODO
  1241. [0xCD] = z80_inst_unimplemented, // TODO
  1242. [0xCE] = z80_inst_unimplemented, // TODO
  1243. [0xCF] = z80_inst_unimplemented, // TODO
  1244. [0xD0] = z80_inst_unimplemented, // TODO
  1245. [0xD1] = z80_inst_unimplemented, // TODO
  1246. [0xD2] = z80_inst_unimplemented, // TODO
  1247. [0xD3] = z80_inst_unimplemented, // TODO
  1248. [0xD4] = z80_inst_unimplemented, // TODO
  1249. [0xD5] = z80_inst_unimplemented, // TODO
  1250. [0xD6] = z80_inst_unimplemented, // TODO
  1251. [0xD7] = z80_inst_unimplemented, // TODO
  1252. [0xD8] = z80_inst_unimplemented, // TODO
  1253. [0xD9] = z80_inst_unimplemented, // TODO
  1254. [0xDA] = z80_inst_unimplemented, // TODO
  1255. [0xDB] = z80_inst_unimplemented, // TODO
  1256. [0xDC] = z80_inst_unimplemented, // TODO
  1257. [0xDD] = z80_inst_unimplemented, // TODO
  1258. [0xDE] = z80_inst_unimplemented, // TODO
  1259. [0xDF] = z80_inst_unimplemented, // TODO
  1260. [0xE0] = z80_inst_unimplemented, // TODO
  1261. [0xE1] = z80_inst_unimplemented, // TODO
  1262. [0xE2] = z80_inst_unimplemented, // TODO
  1263. [0xE3] = z80_inst_unimplemented, // TODO
  1264. [0xE4] = z80_inst_unimplemented, // TODO
  1265. [0xE5] = z80_inst_unimplemented, // TODO
  1266. [0xE6] = z80_inst_unimplemented, // TODO
  1267. [0xE7] = z80_inst_unimplemented, // TODO
  1268. [0xE8] = z80_inst_unimplemented, // TODO
  1269. [0xE9] = z80_inst_unimplemented, // TODO
  1270. [0xEA] = z80_inst_unimplemented, // TODO
  1271. [0xEB] = z80_inst_unimplemented, // TODO
  1272. [0xEC] = z80_inst_unimplemented, // TODO
  1273. [0xED] = z80_inst_unimplemented, // TODO
  1274. [0xEE] = z80_inst_unimplemented, // TODO
  1275. [0xEF] = z80_inst_unimplemented, // TODO
  1276. [0xF0] = z80_inst_unimplemented, // TODO
  1277. [0xF1] = z80_inst_unimplemented, // TODO
  1278. [0xF2] = z80_inst_unimplemented, // TODO
  1279. [0xF3] = z80_inst_unimplemented, // TODO
  1280. [0xF4] = z80_inst_unimplemented, // TODO
  1281. [0xF5] = z80_inst_unimplemented, // TODO
  1282. [0xF6] = z80_inst_unimplemented, // TODO
  1283. [0xF7] = z80_inst_unimplemented, // TODO
  1284. [0xF8] = z80_inst_unimplemented, // TODO
  1285. [0xF9] = z80_inst_unimplemented, // TODO
  1286. [0xFA] = z80_inst_unimplemented, // TODO
  1287. [0xFB] = z80_inst_unimplemented, // TODO
  1288. [0xFC] = z80_inst_unimplemented, // TODO
  1289. [0xFD] = z80_inst_unimplemented, // TODO
  1290. [0xFE] = z80_inst_unimplemented, // TODO
  1291. [0xFF] = z80_inst_unimplemented // TODO
  1292. };