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.
 
 
 
 
 

922 lines
22 KiB

  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. - if: [a, a]
  14. return: [0x8F]
  15. - if: [a, b|c|d|e]
  16. return: [reg(0x88)]
  17. - if: [a, h|ih]
  18. return: [0x8C]
  19. - if: [a, l|il]
  20. return: [0x8D]
  21. - if: [hl, bc|de|hl|sp]
  22. return: [0xED, reg(0x4A 0x10)]
  23. - type: [register, immediate]
  24. cases:
  25. - if: [a, u8]
  26. return: [0xCE, u8]
  27. - type: [register, indirect_hl_or_indexed]
  28. cases:
  29. - if: [a, _]
  30. return: [0x8E]
  31. add:
  32. args: yes
  33. cases:
  34. - type: [register, register]
  35. cases:
  36. - if: [a, a]
  37. return: [0x87]
  38. - if: [a, b|c|d|e]
  39. return: [reg(0x80)]
  40. - if: [a, h|ih]
  41. return: [0x84]
  42. - if: [a, l|il]
  43. return: [0x85]
  44. - if: [hl|i, bc]
  45. return: [0x09]
  46. - if: [hl|i, de]
  47. return: [0x19]
  48. - if: [hl|i, hl|i]
  49. return: [0x29]
  50. - if: [hl|i, sp]
  51. return: [0x39]
  52. - type: [register, immediate]
  53. cases:
  54. - if: [a, u8]
  55. return: [0xC6, u8]
  56. - type: [register, indirect_hl_or_indexed]
  57. cases:
  58. - if: [a, _]
  59. return: [0x86]
  60. and:
  61. args: yes
  62. cases:
  63. - type: [register]
  64. cases:
  65. - if: [a]
  66. return: [0xA7]
  67. - if: [b|c|d|e]
  68. return: [reg(0xA0)]
  69. - if: [h|ih]
  70. return: [0xA4]
  71. - if: [l|il]
  72. return: [0xA5]
  73. - type: [immediate]
  74. cases:
  75. - if: [u8]
  76. return: [0xE6, u8]
  77. - type: [indirect_hl_or_indexed]
  78. cases:
  79. - if: [_]
  80. return: [0xA6]
  81. bit:
  82. args: yes
  83. cases:
  84. - type: [immediate, register]
  85. cases:
  86. - if: [bit, a]
  87. return: [0xCB, bit(0x47)]
  88. - if: [bit, b|c|d|e|h|l]
  89. return: [0xCB, bit(reg(0x40))]
  90. - type: [immediate, indirect_hl_or_indexed]
  91. cases:
  92. - if: [bit, _]
  93. return: [0xCB, bit(0x46)]
  94. call:
  95. args: yes
  96. cases:
  97. - type: [immediate]
  98. cases:
  99. - if: [u16]
  100. return: [0xCD, u16]
  101. - type: [condition, immediate]
  102. cases:
  103. - if: [nz|z|nc|c|po|pe|p|m, u16]
  104. return: [cond(0xC4 0x08), u16]
  105. ccf:
  106. args: no
  107. return: [0x3F]
  108. cp:
  109. args: yes
  110. cases:
  111. - type: [register]
  112. cases:
  113. - if: [a]
  114. return: [0xBF]
  115. - if: [b|c|d|e]
  116. return: [reg(0xB8)]
  117. - if: [h|ih]
  118. return: [0xBC]
  119. - if: [l|il]
  120. return: [0xBD]
  121. - type: [indirect_hl_or_indexed]
  122. cases:
  123. - if: [_]
  124. return: [0xBE]
  125. - type: [immediate]
  126. cases:
  127. - if: [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. - if: [a]
  153. return: [0x3D]
  154. - if: [b|c|d|e]
  155. return: [reg(0x05 0x08)]
  156. - if: [h|ih]
  157. return: [0x25]
  158. - if: [l|il]
  159. return: [0x2D]
  160. - if: [bc]
  161. return: [0x0B]
  162. - if: [de]
  163. return: [0x1B]
  164. - if: [hl|i]
  165. return: [0x2B]
  166. - if: [sp]
  167. return: [0x3B]
  168. - type: [indirect_hl_or_indexed]
  169. cases:
  170. - if: [_]
  171. return: [0x35]
  172. di:
  173. args: no
  174. return: [0xF3]
  175. djnz:
  176. args: yes
  177. cases:
  178. - type: [immediate]
  179. cases:
  180. - if: [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. - if: [af, af_]
  191. return: [0x08]
  192. - if: [de, hl]
  193. return: [0xEB]
  194. - type: [indirect, register]
  195. cases:
  196. - if: [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. - if: [im.0]
  210. return: [0xED, 0x46]
  211. - if: [im.1]
  212. return: [0xED, 0x56]
  213. - if: [im.2]
  214. return: [0xED, 0x5E]
  215. in:
  216. args: yes
  217. cases:
  218. - type: [register, port]
  219. cases:
  220. - if: [a, imm]
  221. return: [0xDB, u8]
  222. - if: [a, reg.c]
  223. return: [0xED, 0x78]
  224. - if: [b|c|d|e|h|l, reg.c]
  225. return: [0xED, reg(0x40 0x08)]
  226. - type: [port]
  227. cases:
  228. - if: [reg.c]
  229. return: [0xED, 0x70]
  230. inc:
  231. args: yes
  232. cases:
  233. - type: [register]
  234. cases:
  235. - if: [a]
  236. return: [0x3C]
  237. - if: [b|c|d|e]
  238. return: [reg(0x04 0x08)]
  239. - if: [h|ih]
  240. return: [0x24]
  241. - if: [l|il]
  242. return: [0x2C]
  243. - if: [bc]
  244. return: [0x03]
  245. - if: [de]
  246. return: [0x13]
  247. - if: [hl|i]
  248. return: [0x23]
  249. - if: [sp]
  250. return: [0x33]
  251. - type: [indirect_hl_or_indexed]
  252. cases:
  253. - if: [_]
  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. - if: [u16]
  273. return: [0xC3, u16]
  274. - type: [condition, immediate]
  275. cases:
  276. - if: [nz|z|nc|c|po|pe|p|m, u16]
  277. return: [cond(0xC2 0x08), u16]
  278. - type: [indirect_hl_or_indexed]
  279. cases:
  280. - if: [_]
  281. return: [0xE9]
  282. jr:
  283. args: yes
  284. cases:
  285. - type: [immediate]
  286. cases:
  287. - if: [rel]
  288. return: [0x18, rel]
  289. - type: [condition, immediate]
  290. cases:
  291. - if: [nz|z|nc|c, rel]
  292. return: [cond(0x20 0x08), rel]
  293. ld:
  294. args: yes
  295. cases:
  296. - type: [register, register]
  297. cases:
  298. - if: [a, a]
  299. return: [0x7F]
  300. - if: [a, b|c|d|e]
  301. return: [reg(0x78)]
  302. - if: [a, h|ih]
  303. return: [0x7C]
  304. - if: [a, l|il]
  305. return: [0x7D]
  306. - if: [b, a]
  307. return: [0x47]
  308. - if: [b, b|c|d|e]
  309. return: [reg(0x40)]
  310. - if: [b, h|ih]
  311. return: [0x44]
  312. - if: [b, l|il]
  313. return: [0x45]
  314. - if: [c, a]
  315. return: [0x4F]
  316. - if: [c, b|c|d|e]
  317. return: [reg(0x48)]
  318. - if: [c, h|ih]
  319. return: [0x4C]
  320. - if: [c, l|il]
  321. return: [0x4D]
  322. - if: [d, a]
  323. return: [0x57]
  324. - if: [d, b|c|d|e]
  325. return: [reg(0x50)]
  326. - if: [d, h|ih]
  327. return: [0x54]
  328. - if: [d, l|il]
  329. return: [0x55]
  330. - if: [e, a]
  331. return: [0x5F]
  332. - if: [e, b|c|d|e]
  333. return: [reg(0x58)]
  334. - if: [e, h|ih]
  335. return: [0x5C]
  336. - if: [e, l|il]
  337. return: [0x5D]
  338. - if: [h|ih, a]
  339. return: [0x67]
  340. - if: [h|ih, b]
  341. return: [0x60]
  342. - if: [h|ih, c]
  343. return: [0x61]
  344. - if: [h|ih, d]
  345. return: [0x62]
  346. - if: [h|ih, e]
  347. return: [0x63]
  348. - if: [h|ih, h|ih]
  349. return: [0x64]
  350. - if: [h|ih, l|il]
  351. return: [0x65]
  352. - if: [l|il, a]
  353. return: [0x6F]
  354. - if: [l|il, b]
  355. return: [0x68]
  356. - if: [l|il, c]
  357. return: [0x69]
  358. - if: [l|il, d]
  359. return: [0x6A]
  360. - if: [l|il, e]
  361. return: [0x6B]
  362. - if: [l|il, h|ih]
  363. return: [0x6C]
  364. - if: [l|il, l|il]
  365. return: [0x6D]
  366. - if: [a, i]
  367. return: [0xED, 0x57]
  368. - if: [i, a]
  369. return: [0xED, 0x47]
  370. - if: [a, r]
  371. return: [0xED, 0x5F]
  372. - if: [r, a]
  373. return: [0xED, 0x4F]
  374. - if: [sp, hl|i]
  375. return: [0xF9]
  376. - type: [register, immediate]
  377. cases:
  378. - if: [a, u8]
  379. return: [0x3E, u8]
  380. - if: [b|c|d|e, u8]
  381. return: [reg(0x06 0x08), u8]
  382. - if: [h|ih, u8]
  383. return: [0x26, u8]
  384. - if: [l|il, u8]
  385. return: [0x2E, u8]
  386. - if: [bc, u16]
  387. return: [0x01, u16]
  388. - if: [de, u16]
  389. return: [0x11, u16]
  390. - if: [hl|i, u16]
  391. return: [0x21, u16]
  392. - if: [sp, u16]
  393. return: [0x31, u16]
  394. - type: [register, indirect_hl_or_indexed]
  395. cases:
  396. - if: [a, _]
  397. return: [0x7E]
  398. - if: [b|c|d|e|h|l, _]
  399. return: [reg(0x46 0x08)]
  400. - type: [register, indirect]
  401. cases:
  402. - if: [a, reg.bc]
  403. return: [0x0A]
  404. - if: [a, reg.de]
  405. return: [0x1A]
  406. - if: [hl|i, imm]
  407. return: [0x2A, u16]
  408. - if: [a, imm]
  409. return: [0x3A, u16]
  410. - if: [bc, imm]
  411. return: [0xED, 0x4B, u16]
  412. - if: [de, imm]
  413. return: [0xED, 0x5B, u16]
  414. - if: [sp, imm]
  415. return: [0xED, 0x7B, u16]
  416. - type: [indirect_hl_or_indexed, register]
  417. cases:
  418. - if: [_, a]
  419. return: [0x77]
  420. - if: [_, b|c|d|e|h|l]
  421. return: [reg(0x70)]
  422. - type: [indirect_hl_or_indexed, immediate]
  423. cases:
  424. - if: [_, u8]
  425. return: [0x36, u8]
  426. - type: [indirect, register]
  427. cases:
  428. - if: [reg.bc, a]
  429. return: [0x02]
  430. - if: [reg.de, a]
  431. return: [0x12]
  432. - if: [imm, hl|i]
  433. return: [0x22, u16]
  434. - if: [imm, a]
  435. return: [0x32, u16]
  436. - if: [imm, bc]
  437. return: [0xED, 0x43, u16]
  438. - if: [imm, de]
  439. return: [0xED, 0x53, u16]
  440. - if: [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. - if: [a]
  466. return: [0xB7]
  467. - if: [b|c|d|e]
  468. return: [reg(0xB0)]
  469. - if: [h|ih]
  470. return: [0xB4]
  471. - if: [l|il]
  472. return: [0xB5]
  473. - type: [immediate]
  474. cases:
  475. - if: [u8]
  476. return: [0xF6, u8]
  477. - type: [indirect_hl_or_indexed]
  478. cases:
  479. - if: [_]
  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. - if: [imm, a]
  493. return: [0xD3, u8]
  494. - if: [reg.c, a]
  495. return: [0xED, 0x79]
  496. - if: [reg.c, b|c|d|e|h|l]
  497. return: [0xED, reg(0x41 0x08)]
  498. - type: [port, immediate]
  499. cases:
  500. - if: [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. - if: [bc]
  514. return: [0xC1]
  515. - if: [de]
  516. return: [0xD1]
  517. - if: [hl|i]
  518. return: [0xE1]
  519. - if: [af]
  520. return: [0xF1]
  521. push:
  522. args: yes
  523. cases:
  524. - type: [register]
  525. cases:
  526. - if: [bc]
  527. return: [0xC5]
  528. - if: [de]
  529. return: [0xD5]
  530. - if: [hl|i]
  531. return: [0xE5]
  532. - if: [af]
  533. return: [0xF5]
  534. res:
  535. args: yes
  536. cases:
  537. - type: [immediate, register]
  538. cases:
  539. - if: [bit, a]
  540. return: [0xCB, bit(0x87)]
  541. - if: [bit, b|c|d|e|h|l]
  542. return: [0xCB, bit(reg(0x80))]
  543. - type: [immediate, indirect_hl_or_indexed]
  544. cases:
  545. - if: [bit, _]
  546. return: [0xCB, bit(0x86)]
  547. - type: [immediate, indexed, register]
  548. cases:
  549. - if: [bit, _, a]
  550. return: [0xCB, bit(0x87)]
  551. - if: [bit, _, b|c|d|e|h|l]
  552. return: [0xCB, bit(reg(0x80))]
  553. ret:
  554. args: yes
  555. cases:
  556. - type: []
  557. return: [0xC9]
  558. - type: [condition]
  559. cases:
  560. - if: [nz|z|nc|c|po|pe|p|m]
  561. return: [cond(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. - if: [a]
  574. return: [0xCB, 0x17]
  575. - if: [b|c|d|e|h|l]
  576. return: [0xCB, reg(0x10)]
  577. - type: [indirect_hl_or_indexed]
  578. cases:
  579. - if: [_]
  580. return: [0xCB, 0x16]
  581. - type: [indexed, register]
  582. cases:
  583. - if: [_, a]
  584. return: [0xCB, 0x17]
  585. - if: [_, b|c|d|e|h|l]
  586. return: [0xCB, reg(0x10)]
  587. rla:
  588. args: no
  589. return: [0x17]
  590. rlc:
  591. args: yes
  592. cases:
  593. - type: [register]
  594. cases:
  595. - if: [a]
  596. return: [0xCB, 0x07]
  597. - if: [b|c|d|e|h|l]
  598. return: [0xCB, reg(0x00)]
  599. - type: [indirect_hl_or_indexed]
  600. cases:
  601. - if: [_]
  602. return: [0xCB, 0x06]
  603. - type: [indexed, register]
  604. cases:
  605. - if: [_, a]
  606. return: [0xCB, 0x07]
  607. - if: [_, b|c|d|e|h|l]
  608. return: [0xCB, reg(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. - if: [a]
  621. return: [0xCB, 0x1F]
  622. - if: [b|c|d|e|h|l]
  623. return: [0xCB, reg(0x18)]
  624. - type: [indirect_hl_or_indexed]
  625. cases:
  626. - if: [_]
  627. return: [0xCB, 0x1E]
  628. - type: [indexed, register]
  629. cases:
  630. - if: [_, a]
  631. return: [0xCB, 0x1F]
  632. - if: [_, b|c|d|e|h|l]
  633. return: [0xCB, reg(0x18)]
  634. rra:
  635. args: no
  636. return: [0x1F]
  637. rrc:
  638. args: yes
  639. cases:
  640. - type: [register]
  641. cases:
  642. - if: [a]
  643. return: [0xCB, 0x0F]
  644. - if: [b|c|d|e|h|l]
  645. return: [0xCB, reg(0x08)]
  646. - type: [indirect_hl_or_indexed]
  647. cases:
  648. - if: [_]
  649. return: [0xCB, 0x0E]
  650. - type: [indexed, register]
  651. cases:
  652. - if: [_, a]
  653. return: [0xCB, 0x0F]
  654. - if: [_, b|c|d|e|h|l]
  655. return: [0xCB, reg(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. - if: [rst.0x00]
  668. return: [0xC7]
  669. - if: [rst.0x08]
  670. return: [0xCF]
  671. - if: [rst.0x10]
  672. return: [0xD7]
  673. - if: [rst.0x18]
  674. return: [0xDF]
  675. - if: [rst.0x20]
  676. return: [0xE7]
  677. - if: [rst.0x28]
  678. return: [0xEF]
  679. - if: [rst.0x30]
  680. return: [0xF7]
  681. - if: [rst.0x38]
  682. return: [0xFF]
  683. sbc:
  684. args: yes
  685. cases:
  686. - type: [register, register]
  687. cases:
  688. - if: [a, a]
  689. return: [0x9F]
  690. - if: [a, b|c|d|e]
  691. return: [reg(0x98)]
  692. - if: [a, h|ih]
  693. return: [0x9C]
  694. - if: [a, l|il]
  695. return: [0x9D]
  696. - if: [hl, bc|de|hl|sp]
  697. return: [0xED, reg(0x42 0x10)]
  698. - type: [register, immediate]
  699. cases:
  700. - if: [a, u8]
  701. return: [0xDE, u8]
  702. - type: [register, indirect_hl_or_indexed]
  703. cases:
  704. - if: [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. - if: [bit, a]
  715. return: [0xCB, bit(0xC7)]
  716. - if: [bit, b|c|d|e|h|l]
  717. return: [0xCB, bit(reg(0xC0))]
  718. - type: [immediate, indirect_hl_or_indexed]
  719. cases:
  720. - if: [bit, _]
  721. return: [0xCB, bit(0xC6)]
  722. - type: [immediate, indexed, register]
  723. cases:
  724. - if: [bit, _, a]
  725. return: [0xCB, bit(0xC7)]
  726. - if: [bit, _, b|c|d|e|h|l]
  727. return: [0xCB, bit(reg(0xC0))]
  728. sl1: &sl1
  729. args: yes
  730. cases:
  731. - type: [register]
  732. cases:
  733. - if: [a]
  734. return: [0xCB, 0x37]
  735. - if: [b|c|d|e|h|l]
  736. return: [0xCB, reg(0x30)]
  737. - type: [indirect_hl_or_indexed]
  738. cases:
  739. - if: [_]
  740. return: [0xCB, 0x36]
  741. - type: [indexed, register]
  742. cases:
  743. - if: [_, a]
  744. return: [0xCB, 0x37]
  745. - if: [_, b|c|d|e|h|l]
  746. return: [0xCB, reg(0x30)]
  747. sla:
  748. args: yes
  749. cases:
  750. - type: [register]
  751. cases:
  752. - if: [a]
  753. return: [0xCB, 0x27]
  754. - if: [b|c|d|e|h|l]
  755. return: [0xCB, reg(0x20)]
  756. - type: [indirect_hl_or_indexed]
  757. cases:
  758. - if: [_]
  759. return: [0xCB, 0x26]
  760. - type: [indexed, register]
  761. cases:
  762. - if: [_, a]
  763. return: [0xCB, 0x27]
  764. - if: [_, b|c|d|e|h|l]
  765. return: [0xCB, reg(0x20)]
  766. sll: *sl1
  767. sls: *sl1
  768. sra:
  769. args: yes
  770. cases:
  771. - type: [register]
  772. cases:
  773. - if: [a]
  774. return: [0xCB, 0x2F]
  775. - if: [b|c|d|e|h|l]
  776. return: [0xCB, reg(0x28)]
  777. - type: [indirect_hl_or_indexed]
  778. cases:
  779. - if: [_]
  780. return: [0xCB, 0x2E]
  781. - type: [indexed, register]
  782. cases:
  783. - if: [_, a]
  784. return: [0xCB, 0x2F]
  785. - if: [_, b|c|d|e|h|l]
  786. return: [0xCB, reg(0x28)]
  787. srl:
  788. args: yes
  789. cases:
  790. - type: [register]
  791. cases:
  792. - if: [a]
  793. return: [0xCB, 0x3F]
  794. - if: [b|c|d|e|h|l]
  795. return: [0xCB, reg(0x38)]
  796. - type: [indirect_hl_or_indexed]
  797. cases:
  798. - if: [_]
  799. return: [0xCB, 0x3E]
  800. - type: [indexed, register]
  801. cases:
  802. - if: [_, a]
  803. return: [0xCB, 0x3F]
  804. - if: [_, b|c|d|e|h|l]
  805. return: [0xCB, reg(0x38)]
  806. sub:
  807. args: yes
  808. cases:
  809. - type: [register]
  810. cases:
  811. - if: [a]
  812. return: [0x97]
  813. - if: [b|c|d|e]
  814. return: [reg(0x90)]
  815. - if: [h|ih]
  816. return: [0x94]
  817. - if: [l|il]
  818. return: [0x95]
  819. - type: [immediate]
  820. cases:
  821. - if: [u8]
  822. return: [0xD6, u8]
  823. - type: [indirect_hl_or_indexed]
  824. cases:
  825. - if: [_]
  826. return: [0x96]
  827. xor:
  828. args: yes
  829. cases:
  830. - type: [register]
  831. cases:
  832. - if: [a]
  833. return: [0xAF]
  834. - if: [b|c|d|e]
  835. return: [reg(0xA8)]
  836. - if: [h|ih]
  837. return: [0xAC]
  838. - if: [l|il]
  839. return: [0xAD]
  840. - type: [immediate]
  841. cases:
  842. - if: [u8]
  843. return: [0xEE, u8]
  844. - type: [indirect_hl_or_indexed]
  845. cases:
  846. - if: [_]
  847. return: [0xAE]