|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921 |
- # Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
- # Released under the terms of the MIT License. See LICENSE for details.
-
- # *** ASM Instruction Description File ***
-
- # This file is used to generate 'instructions.inc.c'.
-
- # `make` should trigger a rebuild when this file is modified; if not, use:
- # `python scripts/update_asm_instructions.py`.
-
- ---
-
- adc:
- args: yes
- cases:
- - type: [register, register]
- cases:
- - cond: [a, a]
- return: [0x8F]
- - cond: [a, b|c|d|e]
- return: [step(0x88)]
- - cond: [a, h|ih]
- return: [0x8C]
- - cond: [a, l|il]
- return: [0x8D]
- - cond: [hl, bc|de|hl|sp]
- return: [0xED, step(0x4A 0x10)]
- - type: [register, immediate]
- cases:
- - cond: [a, u8]
- return: [0xCE, u8]
- - type: [register, indirect_hl_or_indexed]
- cases:
- - cond: [a, _]
- return: [0x8E]
-
- add:
- args: yes
- cases:
- - type: [register, register]
- cases:
- - cond: [a, a]
- return: [0x87]
- - cond: [a, b|c|d|e]
- return: [step(0x80)]
- - cond: [a, h|ih]
- return: [0x84]
- - cond: [a, l|il]
- return: [0x85]
- - cond: [hl|i, bc]
- return: [0x09]
- - cond: [hl|i, de]
- return: [0x19]
- - cond: [hl|i, hl|i]
- return: [0x29]
- - cond: [hl|i, sp]
- return: [0x39]
- - type: [register, immediate]
- cases:
- - cond: [a, u8]
- return: [0xC6, u8]
- - type: [register, indirect_hl_or_indexed]
- cases:
- - cond: [a, _]
- return: [0x86]
-
- and:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xA7]
- - cond: [b|c|d|e]
- return: [step(0xA0)]
- - cond: [h|ih]
- return: [0xA4]
- - cond: [l|il]
- return: [0xA5]
- - type: [immediate]
- cases:
- - cond: [u8]
- return: [0xE6, u8]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xA6]
-
- bit:
- args: yes
- cases:
- - type: [immediate, register]
- cases:
- - cond: [bit, a]
- return: [0xCB, bit(0x47)]
- - cond: [bit, b|c|d|e|h|l]
- return: [0xCB, bit(step(0x40))]
- - type: [immediate, indirect_hl_or_indexed]
- cases:
- - cond: [bit, _]
- return: [0xCB, bit(0x46)]
-
- call:
- args: yes
- cases:
- - type: [immediate]
- cases:
- - cond: [u16]
- return: [0xCD, u16]
- - type: [condition, immediate]
- cases:
- - cond: [nz|z|nc|c|po|pe|p|m, u16]
- return: [step(0xC4 0x08), u16]
-
- ccf:
- args: no
- return: [0x3F]
-
- cp:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xBF]
- - cond: [b|c|d|e]
- return: [step(0xB8)]
- - cond: [h|ih]
- return: [0xBC]
- - cond: [l|il]
- return: [0xBD]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xBE]
- - type: [immediate]
- cases:
- - cond: [u8]
- return: [0xFE, u8]
-
- cpd:
- args: no
- return: [0xED, 0xA9]
-
- cpdr:
- args: no
- return: [0xED, 0xB9]
-
- cpi:
- args: no
- return: [0xED, 0xA1]
-
- cpir:
- args: no
- return: [0xED, 0xB1]
-
- cpl:
- args: no
- return: [0x2F]
-
- daa:
- args: no
- return: [0x27]
-
- dec:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0x3D]
- - cond: [b|c|d|e]
- return: [step(0x05 0x08)]
- - cond: [h|ih]
- return: [0x25]
- - cond: [l|il]
- return: [0x2D]
- - cond: [bc]
- return: [0x0B]
- - cond: [de]
- return: [0x1B]
- - cond: [hl|i]
- return: [0x2B]
- - cond: [sp]
- return: [0x3B]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0x35]
-
- di:
- args: no
- return: [0xF3]
-
- djnz:
- args: yes
- cases:
- - type: [immediate]
- cases:
- - cond: [rel]
- return: [0x10, rel]
-
- ei:
- args: no
- return: [0xFB]
-
- ex:
- args: yes
- cases:
- - type: [register, register]
- cases:
- - cond: [af, af_]
- return: [0x08]
- - cond: [de, hl]
- return: [0xEB]
- - type: [indirect, register]
- cases:
- - cond: [reg.sp, hl|i]
- return: [0xE3]
-
- exx:
- args: no
- return: [0xD9]
-
- halt:
- args: no
- return: [0x76]
-
- im:
- args: yes
- cases:
- - type: [immediate]
- cases:
- - cond: [im.0]
- return: [0xED, 0x46]
- - cond: [im.1]
- return: [0xED, 0x56]
- - cond: [im.2]
- return: [0xED, 0x5E]
-
- in:
- args: yes
- cases:
- - type: [register, port]
- cases:
- - cond: [a, imm]
- return: [0xDB, u8]
- - cond: [a, reg.c]
- return: [0xED, 0x78]
- - cond: [b|c|d|e|h|l, reg.c]
- return: [0xED, step(0x40 0x08)]
- - type: [port]
- cases:
- - cond: [reg.c]
- return: [0xED, 0x70]
-
- inc:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0x3C]
- - cond: [b|c|d|e]
- return: [step(0x04 0x08)]
- - cond: [h|ih]
- return: [0x24]
- - cond: [l|il]
- return: [0x2C]
- - cond: [bc]
- return: [0x03]
- - cond: [de]
- return: [0x13]
- - cond: [hl|i]
- return: [0x23]
- - cond: [sp]
- return: [0x33]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0x34]
-
- ind:
- args: no
- return: [0xED, 0xAA]
-
- indr:
- args: no
- return: [0xED, 0xBA]
-
- ini:
- args: no
- return: [0xED, 0xA2]
-
- inir:
- args: no
- return: [0xED, 0xB2]
-
- jp:
- args: yes
- cases:
- - type: [immediate]
- cases:
- - cond: [u16]
- return: [0xC3, u16]
- - type: [condition, immediate]
- cases:
- - cond: [nz|z|nc|c|po|pe|p|m, u16]
- return: [step(0xC2 0x08), u16]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xE9]
-
- jr:
- args: yes
- cases:
- - type: [immediate]
- cases:
- - cond: [rel]
- return: [0x18, rel]
- - type: [condition, immediate]
- cases:
- - cond: [nz|z|nc|c, rel]
- return: [step(0x20 0x08), rel]
-
- ld:
- args: yes
- cases:
- - type: [register, register]
- cases:
- - cond: [a, a]
- return: [0x7F]
- - cond: [a, b|c|d|e]
- return: [step(0x78)]
- - cond: [a, h|ih]
- return: [0x7C]
- - cond: [a, l|il]
- return: [0x7D]
- - cond: [b, a]
- return: [0x47]
- - cond: [b, b|c|d|e]
- return: [step(0x40)]
- - cond: [b, h|ih]
- return: [0x44]
- - cond: [b, l|il]
- return: [0x45]
- - cond: [c, a]
- return: [0x4F]
- - cond: [c, b|c|d|e]
- return: [step(0x48)]
- - cond: [c, h|ih]
- return: [0x4C]
- - cond: [c, l|il]
- return: [0x4D]
- - cond: [d, a]
- return: [0x57]
- - cond: [d, b|c|d|e]
- return: [step(0x50)]
- - cond: [d, h|ih]
- return: [0x54]
- - cond: [d, l|il]
- return: [0x55]
- - cond: [e, a]
- return: [0x5F]
- - cond: [e, b|c|d|e]
- return: [step(0x58)]
- - cond: [e, h|ih]
- return: [0x5C]
- - cond: [e, l|il]
- return: [0x5D]
- - cond: [h|ih, a]
- return: [0x67]
- - cond: [h|ih, b]
- return: [0x60]
- - cond: [h|ih, c]
- return: [0x61]
- - cond: [h|ih, d]
- return: [0x62]
- - cond: [h|ih, e]
- return: [0x63]
- - cond: [h|ih, h|ih]
- return: [0x64]
- - cond: [h|ih, l|il]
- return: [0x65]
- - cond: [l|il, a]
- return: [0x6F]
- - cond: [l|il, b]
- return: [0x68]
- - cond: [l|il, c]
- return: [0x69]
- - cond: [l|il, d]
- return: [0x6A]
- - cond: [l|il, e]
- return: [0x6B]
- - cond: [l|il, h|ih]
- return: [0x6C]
- - cond: [l|il, l|il]
- return: [0x6D]
- - cond: [a, i]
- return: [0xED, 0x57]
- - cond: [i, a]
- return: [0xED, 0x47]
- - cond: [a, r]
- return: [0xED, 0x5F]
- - cond: [r, a]
- return: [0xED, 0x4F]
- - cond: [sp, hl|i]
- return: [0xF9]
- - type: [register, immediate]
- cases:
- - cond: [a, u8]
- return: [0x3E, u8]
- - cond: [b|c|d|e, u8]
- return: [step(0x06 0x08), u8]
- - cond: [h|ih, u8]
- return: [0x26, u8]
- - cond: [l|il, u8]
- return: [0x2E, u8]
- - cond: [bc, u16]
- return: [0x01, u16]
- - cond: [de, u16]
- return: [0x11, u16]
- - cond: [hl|i, u16]
- return: [0x21, u16]
- - cond: [sp, u16]
- return: [0x31, u16]
- - type: [register, indirect_hl_or_indexed]
- cases:
- - cond: [a, _]
- return: [0x7E]
- - cond: [b|c|d|e|h|l, _]
- return: [step(0x46 0x08)]
- - type: [register, indirect]
- cases:
- - cond: [a, reg.bc]
- return: [0x0A]
- - cond: [a, reg.de]
- return: [0x1A]
- - cond: [hl|i, imm]
- return: [0x2A, u16]
- - cond: [a, imm]
- return: [0x3A, u16]
- - cond: [bc, imm]
- return: [0xED, 0x4B, u16]
- - cond: [de, imm]
- return: [0xED, 0x5B, u16]
- - cond: [sp, imm]
- return: [0xED, 0x7B, u16]
- - type: [indirect_hl_or_indexed, register]
- cases:
- - cond: [_, a]
- return: [0x77]
- - cond: [_, b|c|d|e|h|l]
- return: [step(0x70)]
- - type: [indirect_hl_or_indexed, immediate]
- cases:
- - cond: [_, u8]
- return: [0x36, u8]
- - type: [indirect, register]
- cases:
- - cond: [reg.bc, a]
- return: [0x02]
- - cond: [reg.de, a]
- return: [0x12]
- - cond: [imm, hl|i]
- return: [0x22, u16]
- - cond: [imm, a]
- return: [0x32, u16]
- - cond: [imm, bc]
- return: [0xED, 0x43, u16]
- - cond: [imm, de]
- return: [0xED, 0x53, u16]
- - cond: [imm, sp]
- return: [0xED, 0x73, u16]
-
- ldd:
- args: no
- return: [0xED, 0xA8]
-
- lddr:
- args: no
- return: [0xED, 0xB8]
-
- ldi:
- args: no
- return: [0xED, 0xA0]
-
- ldir:
- args: no
- return: [0xED, 0xB0]
-
- neg:
- args: no
- return: [0xED, 0x44]
-
- nop:
- args: no
- return: [0x00]
-
- or:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xB7]
- - cond: [b|c|d|e]
- return: [step(0xB0)]
- - cond: [h|ih]
- return: [0xB4]
- - cond: [l|il]
- return: [0xB5]
- - type: [immediate]
- cases:
- - cond: [u8]
- return: [0xF6, u8]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xB6]
-
- otdr:
- args: no
- return: [0xED, 0xBB]
-
- otir:
- args: no
- return: [0xED, 0xB3]
-
- out:
- args: yes
- cases:
- - type: [port, register]
- cases:
- - cond: [imm, a]
- return: [0xD3, u8]
- - cond: [reg.c, a]
- return: [0xED, 0x79]
- - cond: [reg.c, b|c|d|e|h|l]
- return: [0xED, step(0x41 0x08)]
- - type: [port, immediate]
- cases:
- - cond: [reg.c, u8.0]
- return: [0xED, 0x71]
-
- outd:
- args: no
- return: [0xED, 0xAB]
-
- outi:
- args: no
- return: [0xED, 0xA3]
-
- pop:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [bc]
- return: [0xC1]
- - cond: [de]
- return: [0xD1]
- - cond: [hl|i]
- return: [0xE1]
- - cond: [af]
- return: [0xF1]
-
- push:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [bc]
- return: [0xC5]
- - cond: [de]
- return: [0xD5]
- - cond: [hl|i]
- return: [0xE5]
- - cond: [af]
- return: [0xF5]
-
- res:
- args: yes
- cases:
- - type: [immediate, register]
- cases:
- - cond: [bit, a]
- return: [0xCB, bit(0x87)]
- - cond: [bit, b|c|d|e|h|l]
- return: [0xCB, bit(step(0x80))]
- - type: [immediate, indirect_hl_or_indexed]
- cases:
- - cond: [bit, _]
- return: [0xCB, bit(0x86)]
- - type: [immediate, indexed, register]
- cases:
- - cond: [bit, _, a]
- return: [0xCB, bit(0x87)]
- - cond: [bit, _, b|c|d|e|h|l]
- return: [0xCB, bit(step(0x80))]
-
- ret:
- args: yes
- cases:
- - type: []
- return: [0xC9]
- - type: [condition]
- cases:
- - cond: [nz|z|nc|c|po|pe|p|m]
- return: [step(0xC0 0x08)]
-
- reti:
- args: no
- return: [0xED, 0x4D]
-
- retn:
- args: no
- return: [0xED, 0x45]
-
- rl:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x17]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x10)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x16]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x17]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x10)]
-
- rla:
- args: no
- return: [0x17]
-
- rlc:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x07]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x00)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x06]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x07]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x00)]
-
- rlca:
- args: no
- return: [0x07]
-
- rld:
- args: no
- return: [0xED, 0x6F]
-
- rr:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x1F]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x18)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x1E]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x1F]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x18)]
-
- rra:
- args: no
- return: [0x1F]
-
- rrc:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x0F]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x08)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x0E]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x0F]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x08)]
-
- rrca:
- args: no
- return: [0x0F]
-
- rrd:
- args: no
- return: [0xED, 0x67]
-
- rst:
- args: yes
- cases:
- - type: [immediate]
- cases:
- - cond: [rst.0x00]
- return: [0xC7]
- - cond: [rst.0x08]
- return: [0xCF]
- - cond: [rst.0x10]
- return: [0xD7]
- - cond: [rst.0x18]
- return: [0xDF]
- - cond: [rst.0x20]
- return: [0xE7]
- - cond: [rst.0x28]
- return: [0xEF]
- - cond: [rst.0x30]
- return: [0xF7]
- - cond: [rst.0x38]
- return: [0xFF]
-
- sbc:
- args: yes
- cases:
- - type: [register, register]
- cases:
- - cond: [a, a]
- return: [0x9F]
- - cond: [a, b|c|d|e]
- return: [step(0x98)]
- - cond: [a, h|ih]
- return: [0x9C]
- - cond: [a, l|il]
- return: [0x9D]
- - cond: [hl, bc|de|hl|sp]
- return: [0xED, step(0x42 0x10)]
- - type: [register, immediate]
- cases:
- - cond: [a, u8]
- return: [0xDE, u8]
- - type: [register, indirect_hl_or_indexed]
- cases:
- - cond: [a, _]
- return: [0x9E]
-
- scf:
- args: no
- return: [0x37]
-
- set:
- args: yes
- cases:
- - type: [immediate, register]
- cases:
- - cond: [bit, a]
- return: [0xCB, bit(0xC7)]
- - cond: [bit, b|c|d|e|h|l]
- return: [0xCB, bit(step(0xC0))]
- - type: [immediate, indirect_hl_or_indexed]
- cases:
- - cond: [bit, _]
- return: [0xCB, bit(0xC6)]
- - type: [immediate, indexed, register]
- cases:
- - cond: [bit, _, a]
- return: [0xCB, bit(0xC7)]
- - cond: [bit, _, b|c|d|e|h|l]
- return: [0xCB, bit(step(0xC0))]
-
- sl1: &sl1
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x37]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x30)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x36]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x37]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x30)]
-
- sla:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x27]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x20)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x26]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x27]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x20)]
-
- sll: *sl1
-
- sls: *sl1
-
- sra:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x2F]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x28)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x2E]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x2F]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x28)]
-
- srl:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xCB, 0x3F]
- - cond: [b|c|d|e|h|l]
- return: [0xCB, step(0x38)]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xCB, 0x3E]
- - type: [indexed, register]
- cases:
- - cond: [_, a]
- return: [0xCB, 0x3F]
- - cond: [_, b|c|d|e|h|l]
- return: [0xCB, step(0x38)]
-
- sub:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0x97]
- - cond: [b|c|d|e]
- return: [step(0x90)]
- - cond: [h|ih]
- return: [0x94]
- - cond: [l|il]
- return: [0x95]
- - type: [immediate]
- cases:
- - cond: [u8]
- return: [0xD6, u8]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0x96]
-
- xor:
- args: yes
- cases:
- - type: [register]
- cases:
- - cond: [a]
- return: [0xAF]
- - cond: [b|c|d|e]
- return: [step(0xA8)]
- - cond: [h|ih]
- return: [0xAC]
- - cond: [l|il]
- return: [0xAD]
- - type: [immediate]
- cases:
- - cond: [u8]
- return: [0xEE, u8]
- - type: [indirect_hl_or_indexed]
- cases:
- - cond: [_]
- return: [0xAE]
|