# Copyright (C) 2014-2015 Ben Kurtovic # 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] return: [0x88] - cond: [a, c] return: [0x89] - cond: [a, d] return: [0x8A] - cond: [a, e] return: [0x8B] - cond: [a, h|ih] return: [0x8C] - cond: [a, l|il] return: [0x8D] - cond: [hl, bc] return: [0xED, 0x4A] - cond: [hl, de] return: [0xED, 0x5A] - cond: [hl, hl] return: [0xED, 0x6A] - cond: [hl, sp] return: [0xED, 0x7A] - 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] return: [0x80] - cond: [a, c] return: [0x81] - cond: [a, d] return: [0x82] - cond: [a, e] return: [0x83] - 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] return: [0xA0] - cond: [c] return: [0xA1] - cond: [d] return: [0xA2] - cond: [e] return: [0xA3] - 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 # return: TODO # call: # args: yes # return: TODO ccf: args: no return: [0x3F] # cp: # args: yes # return: TODO 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 # return: TODO di: args: no return: [0xF3] # djnz: # args: yes # return: TODO ei: args: no return: [0xFB] # ex: # args: yes # return: TODO exx: args: no return: [0xD9] halt: args: no return: [0x76] # im: # args: yes # return: TODO # in: # args: yes # return: TODO inc: args: yes cases: - type: [register] cases: - cond: [a] return: [0x3C] - cond: [b] return: [0x04] - cond: [c] return: [0x0C] - cond: [d] return: [0x14] - cond: [e] return: [0x1C] - 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 # return: TODO # jr: # args: yes # return: TODO ld: args: yes cases: - type: [register, register] cases: - cond: [a, a] return: [0x7F] - cond: [a, b] return: [0x78] - cond: [a, c] return: [0x79] - cond: [a, d] return: [0x7A] - cond: [a, e] return: [0x7B] - cond: [a, h|ih] return: [0x7C] - cond: [a, l|il] return: [0x7D] - cond: [b, a] return: [0x47] - cond: [b, b] return: [0x40] - cond: [b, c] return: [0x41] - cond: [b, d] return: [0x42] - cond: [b, e] return: [0x43] - cond: [b, h|ih] return: [0x44] - cond: [b, l|il] return: [0x45] - cond: [c, a] return: [0x4F] - cond: [c, b] return: [0x48] - cond: [c, c] return: [0x49] - cond: [c, d] return: [0x4A] - cond: [c, e] return: [0x4B] - cond: [c, h|ih] return: [0x4C] - cond: [c, l|il] return: [0x4D] - cond: [d, a] return: [0x57] - cond: [d, b] return: [0x50] - cond: [d, c] return: [0x51] - cond: [d, d] return: [0x52] - cond: [d, e] return: [0x53] - cond: [d, h|ih] return: [0x54] - cond: [d, l|il] return: [0x55] - cond: [e, a] return: [0x5F] - cond: [e, b] return: [0x58] - cond: [e, c] return: [0x59] - cond: [e, d] return: [0x5A] - cond: [e, e] return: [0x5B] - 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, u8] return: [0x06, u8] - cond: [c, u8] return: [0x0E, u8] - cond: [d, u8] return: [0x16, u8] - cond: [e, u8] return: [0x1E, 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, _] return: [0x46] - cond: [c, _] return: [0x4E] - cond: [d, _] return: [0x56] - cond: [e, _] return: [0x5E] - cond: [h, _] return: [0x66] - cond: [l, _] return: [0x6E] - 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] return: [0x70] - cond: [_, c] return: [0x71] - cond: [_, d] return: [0x72] - cond: [_, e] return: [0x73] - cond: [_, h] return: [0x74] - cond: [_, l] return: [0x75] - 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 # return: TODO otdr: args: no return: [0xED, 0xBB] otir: args: no return: [0xED, 0xB3] # out: # args: yes # return: TODO outd: args: no return: [0xED, 0xAB] outi: args: no return: [0xED, 0xA3] # pop: # args: yes # return: TODO # push: # args: yes # return: TODO # res: # args: yes # return: TODO # ret: # args: yes # return: TODO reti: args: no return: [0xED, 0x4D] retn: args: no return: [0xED, 0x45] # rl: # args: yes # return: TODO rla: args: no return: [0x17] # rlc: # args: yes # return: TODO rlca: args: no return: [0x07] rld: args: no return: [0xED, 0x6F] # rr: # args: yes # return: TODO rra: args: no return: [0x1F] # rrc: # args: yes # return: TODO rrca: args: no return: [0x0F] # rrd: # args: yes # return: TODO # rst: # args: yes # return: TODO # sbc: # args: yes # return: TODO scf: args: no return: [0x37] # set: # args: yes # return: TODO # sl1: # args: yes # return: TODO # sla: # args: yes # return: TODO # sll: # args: yes # return: TODO # sls: # args: yes # return: TODO # sra: # args: yes # return: TODO # srl: # args: yes # return: TODO # sub: # args: yes # return: TODO # xor: # args: yes # return: TODO