An emulator, assembler, and disassembler for the Sega Game Gear
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.

instructions.yml 22 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. # Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. # Released under the terms of the MIT License. See LICENSE for details.
  3. # *** ASM Instruction Description File ***
  4. # This file is used to generate 'instructions.inc.c'.
  5. # `make` should trigger a rebuild when this file is modified; if not, use:
  6. # `python scripts/update_asm_instructions.py`.
  7. ---
  8. adc:
  9. args: yes
  10. cases:
  11. - type: [register, register]
  12. cases:
  13. - cond: [a, a]
  14. return: [0x8F]
  15. - cond: [a, b|c|d|e]
  16. return: [step(0x88)]
  17. - cond: [a, h|ih]
  18. return: [0x8C]
  19. - cond: [a, l|il]
  20. return: [0x8D]
  21. - cond: [hl, bc|de|hl|sp]
  22. return: [0xED, step(0x4A 0x10)]
  23. - type: [register, immediate]
  24. cases:
  25. - cond: [a, u8]
  26. return: [0xCE, u8]
  27. - type: [register, indirect_hl_or_indexed]
  28. cases:
  29. - cond: [a, _]
  30. return: [0x8E]
  31. add:
  32. args: yes
  33. cases:
  34. - type: [register, register]
  35. cases:
  36. - cond: [a, a]
  37. return: [0x87]
  38. - cond: [a, b|c|d|e]
  39. return: [step(0x80)]
  40. - cond: [a, h|ih]
  41. return: [0x84]
  42. - cond: [a, l|il]
  43. return: [0x85]
  44. - cond: [hl|i, bc]
  45. return: [0x09]
  46. - cond: [hl|i, de]
  47. return: [0x19]
  48. - cond: [hl|i, hl|i]
  49. return: [0x29]
  50. - cond: [hl|i, sp]
  51. return: [0x39]
  52. - type: [register, immediate]
  53. cases:
  54. - cond: [a, u8]
  55. return: [0xC6, u8]
  56. - type: [register, indirect_hl_or_indexed]
  57. cases:
  58. - cond: [a, _]
  59. return: [0x86]
  60. and:
  61. args: yes
  62. cases:
  63. - type: [register]
  64. cases:
  65. - cond: [a]
  66. return: [0xA7]
  67. - cond: [b|c|d|e]
  68. return: [step(0xA0)]
  69. - cond: [h|ih]
  70. return: [0xA4]
  71. - cond: [l|il]
  72. return: [0xA5]
  73. - type: [immediate]
  74. cases:
  75. - cond: [u8]
  76. return: [0xE6, u8]
  77. - type: [indirect_hl_or_indexed]
  78. cases:
  79. - cond: [_]
  80. return: [0xA6]
  81. bit:
  82. args: yes
  83. cases:
  84. - type: [immediate, register]
  85. cases:
  86. - cond: [bit, a]
  87. return: [0xCB, bit(0x47)]
  88. - cond: [bit, b|c|d|e|h|l]
  89. return: [0xCB, bit(step(0x40))]
  90. - type: [immediate, indirect_hl_or_indexed]
  91. cases:
  92. - cond: [bit, _]
  93. return: [0xCB, bit(0x46)]
  94. call:
  95. args: yes
  96. cases:
  97. - type: [immediate]
  98. cases:
  99. - cond: [u16]
  100. return: [0xCD, u16]
  101. - type: [condition, immediate]
  102. cases:
  103. - cond: [nz|z|nc|c|po|pe|p|m, u16]
  104. return: [step(0xC4 0x08), u16]
  105. ccf:
  106. args: no
  107. return: [0x3F]
  108. cp:
  109. args: yes
  110. cases:
  111. - type: [register]
  112. cases:
  113. - cond: [a]
  114. return: [0xBF]
  115. - cond: [b|c|d|e]
  116. return: [step(0xB8)]
  117. - cond: [h|ih]
  118. return: [0xBC]
  119. - cond: [l|il]
  120. return: [0xBD]
  121. - type: [indirect_hl_or_indexed]
  122. cases:
  123. - cond: [_]
  124. return: [0xBE]
  125. - type: [immediate]
  126. cases:
  127. - cond: [u8]
  128. return: [0xFE, u8]
  129. cpd:
  130. args: no
  131. return: [0xED, 0xA9]
  132. cpdr:
  133. args: no
  134. return: [0xED, 0xB9]
  135. cpi:
  136. args: no
  137. return: [0xED, 0xA1]
  138. cpir:
  139. args: no
  140. return: [0xED, 0xB1]
  141. cpl:
  142. args: no
  143. return: [0x2F]
  144. daa:
  145. args: no
  146. return: [0x27]
  147. dec:
  148. args: yes
  149. cases:
  150. - type: [register]
  151. cases:
  152. - cond: [a]
  153. return: [0x3D]
  154. - cond: [b|c|d|e]
  155. return: [step(0x05 0x08)]
  156. - cond: [h|ih]
  157. return: [0x25]
  158. - cond: [l|il]
  159. return: [0x2D]
  160. - cond: [bc]
  161. return: [0x0B]
  162. - cond: [de]
  163. return: [0x1B]
  164. - cond: [hl|i]
  165. return: [0x2B]
  166. - cond: [sp]
  167. return: [0x3B]
  168. - type: [indirect_hl_or_indexed]
  169. cases:
  170. - cond: [_]
  171. return: [0x35]
  172. di:
  173. args: no
  174. return: [0xF3]
  175. djnz:
  176. args: yes
  177. cases:
  178. - type: [immediate]
  179. cases:
  180. - cond: [rel]
  181. return: [0x10, rel]
  182. ei:
  183. args: no
  184. return: [0xFB]
  185. ex:
  186. args: yes
  187. cases:
  188. - type: [register, register]
  189. cases:
  190. - cond: [af, af_]
  191. return: [0x08]
  192. - cond: [de, hl]
  193. return: [0xEB]
  194. - type: [indirect, register]
  195. cases:
  196. - cond: [reg.sp, hl|i]
  197. return: [0xE3]
  198. exx:
  199. args: no
  200. return: [0xD9]
  201. halt:
  202. args: no
  203. return: [0x76]
  204. im:
  205. args: yes
  206. cases:
  207. - type: [immediate]
  208. cases:
  209. - cond: [im.0]
  210. return: [0xED, 0x46]
  211. - cond: [im.1]
  212. return: [0xED, 0x56]
  213. - cond: [im.2]
  214. return: [0xED, 0x5E]
  215. in:
  216. args: yes
  217. cases:
  218. - type: [register, port]
  219. cases:
  220. - cond: [a, imm]
  221. return: [0xDB, u8]
  222. - cond: [a, reg.c]
  223. return: [0xED, 0x78]
  224. - cond: [b|c|d|e|h|l, reg.c]
  225. return: [0xED, step(0x40 0x08)]
  226. - type: [port]
  227. cases:
  228. - cond: [reg.c]
  229. return: [0xED, 0x70]
  230. inc:
  231. args: yes
  232. cases:
  233. - type: [register]
  234. cases:
  235. - cond: [a]
  236. return: [0x3C]
  237. - cond: [b|c|d|e]
  238. return: [step(0x04 0x08)]
  239. - cond: [h|ih]
  240. return: [0x24]
  241. - cond: [l|il]
  242. return: [0x2C]
  243. - cond: [bc]
  244. return: [0x03]
  245. - cond: [de]
  246. return: [0x13]
  247. - cond: [hl|i]
  248. return: [0x23]
  249. - cond: [sp]
  250. return: [0x33]
  251. - type: [indirect_hl_or_indexed]
  252. cases:
  253. - cond: [_]
  254. return: [0x34]
  255. ind:
  256. args: no
  257. return: [0xED, 0xAA]
  258. indr:
  259. args: no
  260. return: [0xED, 0xBA]
  261. ini:
  262. args: no
  263. return: [0xED, 0xA2]
  264. inir:
  265. args: no
  266. return: [0xED, 0xB2]
  267. jp:
  268. args: yes
  269. cases:
  270. - type: [immediate]
  271. cases:
  272. - cond: [u16]
  273. return: [0xC3, u16]
  274. - type: [condition, immediate]
  275. cases:
  276. - cond: [nz|z|nc|c|po|pe|p|m, u16]
  277. return: [step(0xC2 0x08), u16]
  278. - type: [indirect_hl_or_indexed]
  279. cases:
  280. - cond: [_]
  281. return: [0xE9]
  282. jr:
  283. args: yes
  284. cases:
  285. - type: [immediate]
  286. cases:
  287. - cond: [rel]
  288. return: [0x18, rel]
  289. - type: [condition, immediate]
  290. cases:
  291. - cond: [nz|z|nc|c, rel]
  292. return: [step(0x20 0x08), rel]
  293. ld:
  294. args: yes
  295. cases:
  296. - type: [register, register]
  297. cases:
  298. - cond: [a, a]
  299. return: [0x7F]
  300. - cond: [a, b|c|d|e]
  301. return: [step(0x78)]
  302. - cond: [a, h|ih]
  303. return: [0x7C]
  304. - cond: [a, l|il]
  305. return: [0x7D]
  306. - cond: [b, a]
  307. return: [0x47]
  308. - cond: [b, b|c|d|e]
  309. return: [step(0x40)]
  310. - cond: [b, h|ih]
  311. return: [0x44]
  312. - cond: [b, l|il]
  313. return: [0x45]
  314. - cond: [c, a]
  315. return: [0x4F]
  316. - cond: [c, b|c|d|e]
  317. return: [step(0x48)]
  318. - cond: [c, h|ih]
  319. return: [0x4C]
  320. - cond: [c, l|il]
  321. return: [0x4D]
  322. - cond: [d, a]
  323. return: [0x57]
  324. - cond: [d, b|c|d|e]
  325. return: [step(0x50)]
  326. - cond: [d, h|ih]
  327. return: [0x54]
  328. - cond: [d, l|il]
  329. return: [0x55]
  330. - cond: [e, a]
  331. return: [0x5F]
  332. - cond: [e, b|c|d|e]
  333. return: [step(0x58)]
  334. - cond: [e, h|ih]
  335. return: [0x5C]
  336. - cond: [e, l|il]
  337. return: [0x5D]
  338. - cond: [h|ih, a]
  339. return: [0x67]
  340. - cond: [h|ih, b]
  341. return: [0x60]
  342. - cond: [h|ih, c]
  343. return: [0x61]
  344. - cond: [h|ih, d]
  345. return: [0x62]
  346. - cond: [h|ih, e]
  347. return: [0x63]
  348. - cond: [h|ih, h|ih]
  349. return: [0x64]
  350. - cond: [h|ih, l|il]
  351. return: [0x65]
  352. - cond: [l|il, a]
  353. return: [0x6F]
  354. - cond: [l|il, b]
  355. return: [0x68]
  356. - cond: [l|il, c]
  357. return: [0x69]
  358. - cond: [l|il, d]
  359. return: [0x6A]
  360. - cond: [l|il, e]
  361. return: [0x6B]
  362. - cond: [l|il, h|ih]
  363. return: [0x6C]
  364. - cond: [l|il, l|il]
  365. return: [0x6D]
  366. - cond: [a, i]
  367. return: [0xED, 0x57]
  368. - cond: [i, a]
  369. return: [0xED, 0x47]
  370. - cond: [a, r]
  371. return: [0xED, 0x5F]
  372. - cond: [r, a]
  373. return: [0xED, 0x4F]
  374. - cond: [sp, hl|i]
  375. return: [0xF9]
  376. - type: [register, immediate]
  377. cases:
  378. - cond: [a, u8]
  379. return: [0x3E, u8]
  380. - cond: [b|c|d|e, u8]
  381. return: [step(0x06 0x08), u8]
  382. - cond: [h|ih, u8]
  383. return: [0x26, u8]
  384. - cond: [l|il, u8]
  385. return: [0x2E, u8]
  386. - cond: [bc, u16]
  387. return: [0x01, u16]
  388. - cond: [de, u16]
  389. return: [0x11, u16]
  390. - cond: [hl|i, u16]
  391. return: [0x21, u16]
  392. - cond: [sp, u16]
  393. return: [0x31, u16]
  394. - type: [register, indirect_hl_or_indexed]
  395. cases:
  396. - cond: [a, _]
  397. return: [0x7E]
  398. - cond: [b|c|d|e|h|l, _]
  399. return: [step(0x46 0x08)]
  400. - type: [register, indirect]
  401. cases:
  402. - cond: [a, reg.bc]
  403. return: [0x0A]
  404. - cond: [a, reg.de]
  405. return: [0x1A]
  406. - cond: [hl|i, imm]
  407. return: [0x2A, u16]
  408. - cond: [a, imm]
  409. return: [0x3A, u16]
  410. - cond: [bc, imm]
  411. return: [0xED, 0x4B, u16]
  412. - cond: [de, imm]
  413. return: [0xED, 0x5B, u16]
  414. - cond: [sp, imm]
  415. return: [0xED, 0x7B, u16]
  416. - type: [indirect_hl_or_indexed, register]
  417. cases:
  418. - cond: [_, a]
  419. return: [0x77]
  420. - cond: [_, b|c|d|e|h|l]
  421. return: [step(0x70)]
  422. - type: [indirect_hl_or_indexed, immediate]
  423. cases:
  424. - cond: [_, u8]
  425. return: [0x36, u8]
  426. - type: [indirect, register]
  427. cases:
  428. - cond: [reg.bc, a]
  429. return: [0x02]
  430. - cond: [reg.de, a]
  431. return: [0x12]
  432. - cond: [imm, hl|i]
  433. return: [0x22, u16]
  434. - cond: [imm, a]
  435. return: [0x32, u16]
  436. - cond: [imm, bc]
  437. return: [0xED, 0x43, u16]
  438. - cond: [imm, de]
  439. return: [0xED, 0x53, u16]
  440. - cond: [imm, sp]
  441. return: [0xED, 0x73, u16]
  442. ldd:
  443. args: no
  444. return: [0xED, 0xA8]
  445. lddr:
  446. args: no
  447. return: [0xED, 0xB8]
  448. ldi:
  449. args: no
  450. return: [0xED, 0xA0]
  451. ldir:
  452. args: no
  453. return: [0xED, 0xB0]
  454. neg:
  455. args: no
  456. return: [0xED, 0x44]
  457. nop:
  458. args: no
  459. return: [0x00]
  460. or:
  461. args: yes
  462. cases:
  463. - type: [register]
  464. cases:
  465. - cond: [a]
  466. return: [0xB7]
  467. - cond: [b|c|d|e]
  468. return: [step(0xB0)]
  469. - cond: [h|ih]
  470. return: [0xB4]
  471. - cond: [l|il]
  472. return: [0xB5]
  473. - type: [immediate]
  474. cases:
  475. - cond: [u8]
  476. return: [0xF6, u8]
  477. - type: [indirect_hl_or_indexed]
  478. cases:
  479. - cond: [_]
  480. return: [0xB6]
  481. otdr:
  482. args: no
  483. return: [0xED, 0xBB]
  484. otir:
  485. args: no
  486. return: [0xED, 0xB3]
  487. out:
  488. args: yes
  489. cases:
  490. - type: [port, register]
  491. cases:
  492. - cond: [imm, a]
  493. return: [0xD3, u8]
  494. - cond: [reg.c, a]
  495. return: [0xED, 0x79]
  496. - cond: [reg.c, b|c|d|e|h|l]
  497. return: [0xED, step(0x41 0x08)]
  498. - type: [port, immediate]
  499. cases:
  500. - cond: [reg.c, u8.0]
  501. return: [0xED, 0x71]
  502. outd:
  503. args: no
  504. return: [0xED, 0xAB]
  505. outi:
  506. args: no
  507. return: [0xED, 0xA3]
  508. pop:
  509. args: yes
  510. cases:
  511. - type: [register]
  512. cases:
  513. - cond: [bc]
  514. return: [0xC1]
  515. - cond: [de]
  516. return: [0xD1]
  517. - cond: [hl|i]
  518. return: [0xE1]
  519. - cond: [af]
  520. return: [0xF1]
  521. push:
  522. args: yes
  523. cases:
  524. - type: [register]
  525. cases:
  526. - cond: [bc]
  527. return: [0xC5]
  528. - cond: [de]
  529. return: [0xD5]
  530. - cond: [hl|i]
  531. return: [0xE5]
  532. - cond: [af]
  533. return: [0xF5]
  534. res:
  535. args: yes
  536. cases:
  537. - type: [immediate, register]
  538. cases:
  539. - cond: [bit, a]
  540. return: [0xCB, bit(0x87)]
  541. - cond: [bit, b|c|d|e|h|l]
  542. return: [0xCB, bit(step(0x80))]
  543. - type: [immediate, indirect_hl_or_indexed]
  544. cases:
  545. - cond: [bit, _]
  546. return: [0xCB, bit(0x86)]
  547. - type: [immediate, indexed, register]
  548. cases:
  549. - cond: [bit, _, a]
  550. return: [0xCB, bit(0x87)]
  551. - cond: [bit, _, b|c|d|e|h|l]
  552. return: [0xCB, bit(step(0x80))]
  553. ret:
  554. args: yes
  555. cases:
  556. - type: []
  557. return: [0xC9]
  558. - type: [condition]
  559. cases:
  560. - cond: [nz|z|nc|c|po|pe|p|m]
  561. return: [step(0xC0 0x08)]
  562. reti:
  563. args: no
  564. return: [0xED, 0x4D]
  565. retn:
  566. args: no
  567. return: [0xED, 0x45]
  568. rl:
  569. args: yes
  570. cases:
  571. - type: [register]
  572. cases:
  573. - cond: [a]
  574. return: [0xCB, 0x17]
  575. - cond: [b|c|d|e|h|l]
  576. return: [0xCB, step(0x10)]
  577. - type: [indirect_hl_or_indexed]
  578. cases:
  579. - cond: [_]
  580. return: [0xCB, 0x16]
  581. - type: [indexed, register]
  582. cases:
  583. - cond: [_, a]
  584. return: [0xCB, 0x17]
  585. - cond: [_, b|c|d|e|h|l]
  586. return: [0xCB, step(0x10)]
  587. rla:
  588. args: no
  589. return: [0x17]
  590. rlc:
  591. args: yes
  592. cases:
  593. - type: [register]
  594. cases:
  595. - cond: [a]
  596. return: [0xCB, 0x07]
  597. - cond: [b|c|d|e|h|l]
  598. return: [0xCB, step(0x00)]
  599. - type: [indirect_hl_or_indexed]
  600. cases:
  601. - cond: [_]
  602. return: [0xCB, 0x06]
  603. - type: [indexed, register]
  604. cases:
  605. - cond: [_, a]
  606. return: [0xCB, 0x07]
  607. - cond: [_, b|c|d|e|h|l]
  608. return: [0xCB, step(0x00)]
  609. rlca:
  610. args: no
  611. return: [0x07]
  612. rld:
  613. args: no
  614. return: [0xED, 0x6F]
  615. rr:
  616. args: yes
  617. cases:
  618. - type: [register]
  619. cases:
  620. - cond: [a]
  621. return: [0xCB, 0x1F]
  622. - cond: [b|c|d|e|h|l]
  623. return: [0xCB, step(0x18)]
  624. - type: [indirect_hl_or_indexed]
  625. cases:
  626. - cond: [_]
  627. return: [0xCB, 0x1E]
  628. - type: [indexed, register]
  629. cases:
  630. - cond: [_, a]
  631. return: [0xCB, 0x1F]
  632. - cond: [_, b|c|d|e|h|l]
  633. return: [0xCB, step(0x18)]
  634. rra:
  635. args: no
  636. return: [0x1F]
  637. rrc:
  638. args: yes
  639. cases:
  640. - type: [register]
  641. cases:
  642. - cond: [a]
  643. return: [0xCB, 0x0F]
  644. - cond: [b|c|d|e|h|l]
  645. return: [0xCB, step(0x08)]
  646. - type: [indirect_hl_or_indexed]
  647. cases:
  648. - cond: [_]
  649. return: [0xCB, 0x0E]
  650. - type: [indexed, register]
  651. cases:
  652. - cond: [_, a]
  653. return: [0xCB, 0x0F]
  654. - cond: [_, b|c|d|e|h|l]
  655. return: [0xCB, step(0x08)]
  656. rrca:
  657. args: no
  658. return: [0x0F]
  659. rrd:
  660. args: no
  661. return: [0xED, 0x67]
  662. rst:
  663. args: yes
  664. cases:
  665. - type: [immediate]
  666. cases:
  667. - cond: [rst.0x00]
  668. return: [0xC7]
  669. - cond: [rst.0x08]
  670. return: [0xCF]
  671. - cond: [rst.0x10]
  672. return: [0xD7]
  673. - cond: [rst.0x18]
  674. return: [0xDF]
  675. - cond: [rst.0x20]
  676. return: [0xE7]
  677. - cond: [rst.0x28]
  678. return: [0xEF]
  679. - cond: [rst.0x30]
  680. return: [0xF7]
  681. - cond: [rst.0x38]
  682. return: [0xFF]
  683. sbc:
  684. args: yes
  685. cases:
  686. - type: [register, register]
  687. cases:
  688. - cond: [a, a]
  689. return: [0x9F]
  690. - cond: [a, b|c|d|e]
  691. return: [step(0x98)]
  692. - cond: [a, h|ih]
  693. return: [0x9C]
  694. - cond: [a, l|il]
  695. return: [0x9D]
  696. - cond: [hl, bc|de|hl|sp]
  697. return: [0xED, step(0x42 0x10)]
  698. - type: [register, immediate]
  699. cases:
  700. - cond: [a, u8]
  701. return: [0xDE, u8]
  702. - type: [register, indirect_hl_or_indexed]
  703. cases:
  704. - cond: [a, _]
  705. return: [0x9E]
  706. scf:
  707. args: no
  708. return: [0x37]
  709. set:
  710. args: yes
  711. cases:
  712. - type: [immediate, register]
  713. cases:
  714. - cond: [bit, a]
  715. return: [0xCB, bit(0xC7)]
  716. - cond: [bit, b|c|d|e|h|l]
  717. return: [0xCB, bit(step(0xC0))]
  718. - type: [immediate, indirect_hl_or_indexed]
  719. cases:
  720. - cond: [bit, _]
  721. return: [0xCB, bit(0xC6)]
  722. - type: [immediate, indexed, register]
  723. cases:
  724. - cond: [bit, _, a]
  725. return: [0xCB, bit(0xC7)]
  726. - cond: [bit, _, b|c|d|e|h|l]
  727. return: [0xCB, bit(step(0xC0))]
  728. sl1: &sl1
  729. args: yes
  730. cases:
  731. - type: [register]
  732. cases:
  733. - cond: [a]
  734. return: [0xCB, 0x37]
  735. - cond: [b|c|d|e|h|l]
  736. return: [0xCB, step(0x30)]
  737. - type: [indirect_hl_or_indexed]
  738. cases:
  739. - cond: [_]
  740. return: [0xCB, 0x36]
  741. - type: [indexed, register]
  742. cases:
  743. - cond: [_, a]
  744. return: [0xCB, 0x37]
  745. - cond: [_, b|c|d|e|h|l]
  746. return: [0xCB, step(0x30)]
  747. sla:
  748. args: yes
  749. cases:
  750. - type: [register]
  751. cases:
  752. - cond: [a]
  753. return: [0xCB, 0x27]
  754. - cond: [b|c|d|e|h|l]
  755. return: [0xCB, step(0x20)]
  756. - type: [indirect_hl_or_indexed]
  757. cases:
  758. - cond: [_]
  759. return: [0xCB, 0x26]
  760. - type: [indexed, register]
  761. cases:
  762. - cond: [_, a]
  763. return: [0xCB, 0x27]
  764. - cond: [_, b|c|d|e|h|l]
  765. return: [0xCB, step(0x20)]
  766. sll: *sl1
  767. sls: *sl1
  768. sra:
  769. args: yes
  770. cases:
  771. - type: [register]
  772. cases:
  773. - cond: [a]
  774. return: [0xCB, 0x2F]
  775. - cond: [b|c|d|e|h|l]
  776. return: [0xCB, step(0x28)]
  777. - type: [indirect_hl_or_indexed]
  778. cases:
  779. - cond: [_]
  780. return: [0xCB, 0x2E]
  781. - type: [indexed, register]
  782. cases:
  783. - cond: [_, a]
  784. return: [0xCB, 0x2F]
  785. - cond: [_, b|c|d|e|h|l]
  786. return: [0xCB, step(0x28)]
  787. srl:
  788. args: yes
  789. cases:
  790. - type: [register]
  791. cases:
  792. - cond: [a]
  793. return: [0xCB, 0x3F]
  794. - cond: [b|c|d|e|h|l]
  795. return: [0xCB, step(0x38)]
  796. - type: [indirect_hl_or_indexed]
  797. cases:
  798. - cond: [_]
  799. return: [0xCB, 0x3E]
  800. - type: [indexed, register]
  801. cases:
  802. - cond: [_, a]
  803. return: [0xCB, 0x3F]
  804. - cond: [_, b|c|d|e|h|l]
  805. return: [0xCB, step(0x38)]
  806. sub:
  807. args: yes
  808. cases:
  809. - type: [register]
  810. cases:
  811. - cond: [a]
  812. return: [0x97]
  813. - cond: [b|c|d|e]
  814. return: [step(0x90)]
  815. - cond: [h|ih]
  816. return: [0x94]
  817. - cond: [l|il]
  818. return: [0x95]
  819. - type: [immediate]
  820. cases:
  821. - cond: [u8]
  822. return: [0xD6, u8]
  823. - type: [indirect_hl_or_indexed]
  824. cases:
  825. - cond: [_]
  826. return: [0x96]
  827. xor:
  828. args: yes
  829. cases:
  830. - type: [register]
  831. cases:
  832. - cond: [a]
  833. return: [0xAF]
  834. - cond: [b|c|d|e]
  835. return: [step(0xA8)]
  836. - cond: [h|ih]
  837. return: [0xAC]
  838. - cond: [l|il]
  839. return: [0xAD]
  840. - type: [immediate]
  841. cases:
  842. - cond: [u8]
  843. return: [0xEE, u8]
  844. - type: [indirect_hl_or_indexed]
  845. cases:
  846. - cond: [_]
  847. return: [0xAE]