|
@@ -7,7 +7,7 @@ |
|
|
`make` should trigger a rebuild when it is modified; if not, use: |
|
|
`make` should trigger a rebuild when it is modified; if not, use: |
|
|
`python scripts/update_asm_instructions.py`. |
|
|
`python scripts/update_asm_instructions.py`. |
|
|
|
|
|
|
|
|
@AUTOGEN_DATE Sun May 17 03:37:44 2015 UTC |
|
|
|
|
|
|
|
|
@AUTOGEN_DATE Mon May 18 04:41:13 2015 UTC |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
/* @AUTOGEN_INST_BLOCK_START */ |
|
|
/* @AUTOGEN_INST_BLOCK_START */ |
|
@@ -16,7 +16,7 @@ INST_FUNC(adc) |
|
|
{ |
|
|
{ |
|
|
INST_TAKES_ARGS( |
|
|
INST_TAKES_ARGS( |
|
|
AT_REGISTER, |
|
|
AT_REGISTER, |
|
|
AT_IMMEDIATE|AT_INDIRECT|AT_INDEXED|AT_REGISTER, |
|
|
|
|
|
|
|
|
AT_IMMEDIATE|AT_INDEXED|AT_INDIRECT|AT_REGISTER, |
|
|
AT_NONE |
|
|
AT_NONE |
|
|
) |
|
|
) |
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_REGISTER) { |
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_REGISTER) { |
|
@@ -36,12 +36,12 @@ INST_FUNC(adc) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x8C) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x8C) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYH) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYH) |
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x8C) |
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x8C) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x8D) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_L) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_L) |
|
|
INST_RETURN(1, 0x8D) |
|
|
INST_RETURN(1, 0x8D) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IXL) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IXL) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x8D) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x8D) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x8D) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_BC) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_BC) |
|
|
INST_RETURN(2, 0xED, 0x4A) |
|
|
INST_RETURN(2, 0xED, 0x4A) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_DE) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_DE) |
|
@@ -74,7 +74,7 @@ INST_FUNC(add) |
|
|
{ |
|
|
{ |
|
|
INST_TAKES_ARGS( |
|
|
INST_TAKES_ARGS( |
|
|
AT_REGISTER, |
|
|
AT_REGISTER, |
|
|
AT_IMMEDIATE|AT_INDIRECT|AT_INDEXED|AT_REGISTER, |
|
|
|
|
|
|
|
|
AT_IMMEDIATE|AT_INDEXED|AT_INDIRECT|AT_REGISTER, |
|
|
AT_NONE |
|
|
AT_NONE |
|
|
) |
|
|
) |
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_REGISTER) { |
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_REGISTER) { |
|
@@ -94,36 +94,36 @@ INST_FUNC(add) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x84) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x84) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYH) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYH) |
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x84) |
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x84) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x85) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_L) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_L) |
|
|
INST_RETURN(1, 0x85) |
|
|
INST_RETURN(1, 0x85) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IXL) |
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IXL) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x85) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x85) |
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_BC) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x09) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_BC) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x09) |
|
|
|
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x85) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_BC) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_BC) |
|
|
INST_RETURN(1, 0x09) |
|
|
INST_RETURN(1, 0x09) |
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_DE) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x19) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_DE) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x19) |
|
|
|
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_BC) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x09) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_BC) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x09) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_DE) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_DE) |
|
|
INST_RETURN(1, 0x19) |
|
|
INST_RETURN(1, 0x19) |
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_HL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x29) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_HL) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x29) |
|
|
|
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_DE) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x19) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_DE) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x19) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_HL) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_HL) |
|
|
INST_RETURN(1, 0x29) |
|
|
INST_RETURN(1, 0x29) |
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_SP) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x39) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_SP) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x39) |
|
|
|
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_IX) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x29) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_IY) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x29) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_SP) |
|
|
if (INST_REG(0) == REG_HL && INST_REG(1) == REG_SP) |
|
|
INST_RETURN(1, 0x39) |
|
|
INST_RETURN(1, 0x39) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_SP) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x39) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_SP) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x39) |
|
|
INST_ERROR(ARG_VALUE) |
|
|
INST_ERROR(ARG_VALUE) |
|
|
} |
|
|
} |
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_IMMEDIATE) { |
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_IMMEDIATE) { |
|
@@ -234,22 +234,22 @@ INST_FUNC(inc) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x24) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x24) |
|
|
if (INST_REG(0) == REG_IYH) |
|
|
if (INST_REG(0) == REG_IYH) |
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x24) |
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x24) |
|
|
if (INST_REG(0) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x2C) |
|
|
|
|
|
if (INST_REG(0) == REG_L) |
|
|
if (INST_REG(0) == REG_L) |
|
|
INST_RETURN(1, 0x2C) |
|
|
INST_RETURN(1, 0x2C) |
|
|
if (INST_REG(0) == REG_IXL) |
|
|
if (INST_REG(0) == REG_IXL) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x2C) |
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x2C) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x2C) |
|
|
if (INST_REG(0) == REG_BC) |
|
|
if (INST_REG(0) == REG_BC) |
|
|
INST_RETURN(1, 0x03) |
|
|
INST_RETURN(1, 0x03) |
|
|
if (INST_REG(0) == REG_DE) |
|
|
if (INST_REG(0) == REG_DE) |
|
|
INST_RETURN(1, 0x13) |
|
|
INST_RETURN(1, 0x13) |
|
|
if (INST_REG(0) == REG_IY) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x23) |
|
|
|
|
|
if (INST_REG(0) == REG_IX) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x23) |
|
|
|
|
|
if (INST_REG(0) == REG_HL) |
|
|
if (INST_REG(0) == REG_HL) |
|
|
INST_RETURN(1, 0x23) |
|
|
INST_RETURN(1, 0x23) |
|
|
|
|
|
if (INST_REG(0) == REG_IX) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x23) |
|
|
|
|
|
if (INST_REG(0) == REG_IY) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x23) |
|
|
if (INST_REG(0) == REG_SP) |
|
|
if (INST_REG(0) == REG_SP) |
|
|
INST_RETURN(1, 0x33) |
|
|
INST_RETURN(1, 0x33) |
|
|
INST_ERROR(ARG_VALUE) |
|
|
INST_ERROR(ARG_VALUE) |
|
@@ -291,6 +291,388 @@ INST_FUNC(inir) |
|
|
INST_RETURN(2, 0xED, 0xB2) |
|
|
INST_RETURN(2, 0xED, 0xB2) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
INST_FUNC(ld) |
|
|
|
|
|
{ |
|
|
|
|
|
INST_TAKES_ARGS( |
|
|
|
|
|
AT_INDEXED|AT_INDIRECT|AT_REGISTER, |
|
|
|
|
|
AT_IMMEDIATE|AT_INDEXED|AT_INDIRECT|AT_REGISTER, |
|
|
|
|
|
AT_NONE |
|
|
|
|
|
) |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_REGISTER) { |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x7F) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x78) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x79) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x7A) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x7B) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x7C) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x7C) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x7C) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x7D) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x7D) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x7D) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x47) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x40) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x41) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x42) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x43) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x44) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x44) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x44) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x45) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x45) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x45) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x4F) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x48) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x49) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x4A) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x4B) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x4C) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x4C) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x4C) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x4D) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x4D) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x4D) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x57) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x50) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x51) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x52) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x53) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x54) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x54) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x54) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x55) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x55) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x55) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x5F) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x58) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x59) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x5A) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x5B) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x5C) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x5C) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x5C) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x5D) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x5D) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x5D) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x67) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x67) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x67) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x60) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x60) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x60) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x61) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x61) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x61) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x62) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x62) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x62) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x63) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x63) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x63) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x64) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x64) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x64) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x65) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x65) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x65) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x6F) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x6F) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x6F) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x68) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x68) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x68) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x69) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x69) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x69) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x6A) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x6A) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x6A) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x6B) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0x6B) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0x6B) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x6C) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_IXH) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x6C) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_IYH) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x6C) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x6D) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_IXL) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x6D) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_IYL) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x6D) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IX) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, 0xED, 0x57) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IY) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, 0xED, 0x57) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, 0xED, 0x47) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, 0xED, 0x47) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_REG(1) == REG_R) |
|
|
|
|
|
INST_RETURN(2, 0xED, 0x5F) |
|
|
|
|
|
if (INST_REG(0) == REG_R && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(2, 0xED, 0x4F) |
|
|
|
|
|
if (INST_REG(0) == REG_SP && INST_REG(1) == REG_HL) |
|
|
|
|
|
INST_RETURN(1, 0xF9) |
|
|
|
|
|
if (INST_REG(0) == REG_SP && INST_REG(1) == REG_IX) |
|
|
|
|
|
INST_RETURN(2, INST_IX_PREFIX, 0xF9) |
|
|
|
|
|
if (INST_REG(0) == REG_SP && INST_REG(1) == REG_IY) |
|
|
|
|
|
INST_RETURN(2, INST_IY_PREFIX, 0xF9) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_IMMEDIATE) { |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x3E, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_B && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x06, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_C && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x0E, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_D && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x16, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_E && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x1E, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_H && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x26, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_IXH && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, 0x26, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_IYH && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, 0x26, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_L && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x2E, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_IXL && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(3, INST_IX_PREFIX, 0x2E, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_IYL && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(3, INST_IY_PREFIX, 0x2E, INST_IMM(1).uval) |
|
|
|
|
|
if (INST_REG(0) == REG_BC && INST_IMM(1).mask & IMM_U16) |
|
|
|
|
|
INST_RETURN(3, 0x01, INST_IMM_U16_B1(INST_IMM(1)), INST_IMM_U16_B2(INST_IMM(1))) |
|
|
|
|
|
if (INST_REG(0) == REG_DE && INST_IMM(1).mask & IMM_U16) |
|
|
|
|
|
INST_RETURN(3, 0x11, INST_IMM_U16_B1(INST_IMM(1)), INST_IMM_U16_B2(INST_IMM(1))) |
|
|
|
|
|
if (INST_REG(0) == REG_HL && INST_IMM(1).mask & IMM_U16) |
|
|
|
|
|
INST_RETURN(3, 0x21, INST_IMM_U16_B1(INST_IMM(1)), INST_IMM_U16_B2(INST_IMM(1))) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_IMM(1).mask & IMM_U16) |
|
|
|
|
|
INST_RETURN(4, INST_IX_PREFIX, 0x21, INST_IMM_U16_B1(INST_IMM(1)), INST_IMM_U16_B2(INST_IMM(1))) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_IMM(1).mask & IMM_U16) |
|
|
|
|
|
INST_RETURN(4, INST_IY_PREFIX, 0x21, INST_IMM_U16_B1(INST_IMM(1)), INST_IMM_U16_B2(INST_IMM(1))) |
|
|
|
|
|
if (INST_REG(0) == REG_SP && INST_IMM(1).mask & IMM_U16) |
|
|
|
|
|
INST_RETURN(3, 0x31, INST_IMM_U16_B1(INST_IMM(1)), INST_IMM_U16_B2(INST_IMM(1))) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_INDIRECT) { |
|
|
|
|
|
if (INST_REG(0) == REG_A && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x7E) |
|
|
|
|
|
if (INST_REG(0) == REG_B && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x46) |
|
|
|
|
|
if (INST_REG(0) == REG_C && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x4E) |
|
|
|
|
|
if (INST_REG(0) == REG_D && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x56) |
|
|
|
|
|
if (INST_REG(0) == REG_E && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x5E) |
|
|
|
|
|
if (INST_REG(0) == REG_H && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x66) |
|
|
|
|
|
if (INST_REG(0) == REG_L && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_HL)) |
|
|
|
|
|
INST_RETURN(1, 0x6E) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_INDEXED) { |
|
|
|
|
|
if (INST_REG(0) == REG_A) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x7E, INST_INDEX(1).offset) |
|
|
|
|
|
if (INST_REG(0) == REG_B) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x46, INST_INDEX(1).offset) |
|
|
|
|
|
if (INST_REG(0) == REG_C) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x4E, INST_INDEX(1).offset) |
|
|
|
|
|
if (INST_REG(0) == REG_D) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x56, INST_INDEX(1).offset) |
|
|
|
|
|
if (INST_REG(0) == REG_E) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x5E, INST_INDEX(1).offset) |
|
|
|
|
|
if (INST_REG(0) == REG_H) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x66, INST_INDEX(1).offset) |
|
|
|
|
|
if (INST_REG(0) == REG_L) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(1), 0x6E, INST_INDEX(1).offset) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_REGISTER && INST_TYPE(1) == AT_INDIRECT) { |
|
|
|
|
|
if (INST_REG(0) == REG_A && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_BC)) |
|
|
|
|
|
INST_RETURN(1, 0x0A) |
|
|
|
|
|
if (INST_REG(0) == REG_A && (INST_INDIRECT(1).type == AT_REGISTER && INST_INDIRECT(1).addr.reg == REG_DE)) |
|
|
|
|
|
INST_RETURN(1, 0x1A) |
|
|
|
|
|
if (INST_REG(0) == REG_HL && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(3, 0x2A, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
if (INST_REG(0) == REG_IX && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(4, INST_IX_PREFIX, 0x2A, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
if (INST_REG(0) == REG_IY && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(4, INST_IY_PREFIX, 0x2A, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
if (INST_REG(0) == REG_A && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(3, 0x3A, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
if (INST_REG(0) == REG_BC && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(4, 0xED, 0x4B, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
if (INST_REG(0) == REG_DE && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(4, 0xED, 0x5B, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
if (INST_REG(0) == REG_SP && INST_INDIRECT(1).type == AT_IMMEDIATE) |
|
|
|
|
|
INST_RETURN(4, 0xED, 0x7B, INST_IMM_U16_B1(INST_INDIRECT(1).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(1).addr.imm)) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_INDIRECT && INST_TYPE(1) == AT_REGISTER) { |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x77) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(1, 0x70) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(1, 0x71) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(1, 0x72) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(1, 0x73) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(1, 0x74) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(1, 0x75) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_INDEXED && INST_TYPE(1) == AT_REGISTER) { |
|
|
|
|
|
if (INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x77, INST_INDEX(0).offset) |
|
|
|
|
|
if (INST_REG(1) == REG_B) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x70, INST_INDEX(0).offset) |
|
|
|
|
|
if (INST_REG(1) == REG_C) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x71, INST_INDEX(0).offset) |
|
|
|
|
|
if (INST_REG(1) == REG_D) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x72, INST_INDEX(0).offset) |
|
|
|
|
|
if (INST_REG(1) == REG_E) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x73, INST_INDEX(0).offset) |
|
|
|
|
|
if (INST_REG(1) == REG_H) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x74, INST_INDEX(0).offset) |
|
|
|
|
|
if (INST_REG(1) == REG_L) |
|
|
|
|
|
INST_RETURN(3, INST_INDEX_PREFIX(0), 0x75, INST_INDEX(0).offset) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_INDIRECT && INST_TYPE(1) == AT_IMMEDIATE) { |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_HL) && INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(2, 0x36, INST_IMM(1).uval) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_INDEXED && INST_TYPE(1) == AT_IMMEDIATE) { |
|
|
|
|
|
if (INST_IMM(1).mask & IMM_U8) |
|
|
|
|
|
INST_RETURN(4, INST_INDEX_PREFIX(0), 0x36, INST_IMM(1).uval, INST_INDEX(0).offset) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
if (INST_NARGS == 2 && INST_TYPE(0) == AT_INDIRECT && INST_TYPE(1) == AT_REGISTER) { |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_BC) && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x02) |
|
|
|
|
|
if ((INST_INDIRECT(0).type == AT_REGISTER && INST_INDIRECT(0).addr.reg == REG_DE) && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(1, 0x12) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_HL) |
|
|
|
|
|
INST_RETURN(3, 0x22, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_IX) |
|
|
|
|
|
INST_RETURN(4, INST_IX_PREFIX, 0x22, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_IY) |
|
|
|
|
|
INST_RETURN(4, INST_IY_PREFIX, 0x22, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_A) |
|
|
|
|
|
INST_RETURN(3, 0x32, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_BC) |
|
|
|
|
|
INST_RETURN(4, 0xED, 0x43, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_DE) |
|
|
|
|
|
INST_RETURN(4, 0xED, 0x53, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
if (INST_INDIRECT(0).type == AT_IMMEDIATE && INST_REG(1) == REG_SP) |
|
|
|
|
|
INST_RETURN(4, 0xED, 0x73, INST_IMM_U16_B1(INST_INDIRECT(0).addr.imm), INST_IMM_U16_B2(INST_INDIRECT(0).addr.imm)) |
|
|
|
|
|
INST_ERROR(ARG_VALUE) |
|
|
|
|
|
} |
|
|
|
|
|
INST_ERROR(ARG_TYPE) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
INST_FUNC(ldd) |
|
|
INST_FUNC(ldd) |
|
|
{ |
|
|
{ |
|
|
INST_TAKES_NO_ARGS |
|
|
INST_TAKES_NO_ARGS |
|
@@ -425,6 +807,7 @@ static ASMInstParser lookup_parser(uint32_t key) |
|
|
HANDLE(indr) |
|
|
HANDLE(indr) |
|
|
HANDLE(ini) |
|
|
HANDLE(ini) |
|
|
HANDLE(inir) |
|
|
HANDLE(inir) |
|
|
|
|
|
HANDLE(ld) |
|
|
HANDLE(ldd) |
|
|
HANDLE(ldd) |
|
|
HANDLE(lddr) |
|
|
HANDLE(lddr) |
|
|
HANDLE(ldi) |
|
|
HANDLE(ldi) |
|
|