Browse Source

Fix duplicate prefixes.

master
Ben Kurtovic 9 years ago
parent
commit
eba6350f4e
2 changed files with 15 additions and 15 deletions
  1. +4
    -4
      scripts/update_asm_instructions.py
  2. +11
    -11
      src/assembler/instructions.inc.c

+ 4
- 4
scripts/update_asm_instructions.py View File

@@ -244,10 +244,10 @@ class Instruction(object):
raise RuntimeError(msg.format(byte)) raise RuntimeError(msg.format(byte))


for i, cond in enumerate(conds): for i, cond in enumerate(conds):
if types[i] == "register" and cond.startswith("ix"):
ret.insert(0, "INST_IX_PREFIX")
elif types[i] == "register" and cond.startswith("iy"):
ret.insert(0, "INST_IY_PREFIX")
if types[i] == "register" and cond[0] == "i":
prefix = "INST_I{0}_PREFIX".format(cond[1].upper())
if ret[0] != prefix:
ret.insert(0, prefix)
elif types[i] == "indexed": elif types[i] == "indexed":
ret.insert(0, "INST_INDEX_PREFIX({0})".format(i)) ret.insert(0, "INST_INDEX_PREFIX({0})".format(i))
ret.append("INST_INDEX({0}).offset".format(i)) ret.append("INST_INDEX({0}).offset".format(i))


+ 11
- 11
src/assembler/instructions.inc.c View File

@@ -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 Mon May 18 04:41:13 2015 UTC
@AUTOGEN_DATE Mon May 18 05:16:08 2015 UTC
*/ */


/* @AUTOGEN_INST_BLOCK_START */ /* @AUTOGEN_INST_BLOCK_START */
@@ -115,9 +115,9 @@ INST_FUNC(add)
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_IX && INST_REG(1) == REG_IX) if (INST_REG(0) == REG_IX && INST_REG(1) == REG_IX)
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x29)
INST_RETURN(2, INST_IX_PREFIX, 0x29)
if (INST_REG(0) == REG_IY && INST_REG(1) == REG_IY) if (INST_REG(0) == REG_IY && INST_REG(1) == REG_IY)
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x29)
INST_RETURN(2, 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) if (INST_REG(0) == REG_IX && INST_REG(1) == REG_SP)
@@ -442,15 +442,15 @@ INST_FUNC(ld)
if (INST_REG(0) == REG_H && INST_REG(1) == REG_H) if (INST_REG(0) == REG_H && INST_REG(1) == REG_H)
INST_RETURN(1, 0x64) INST_RETURN(1, 0x64)
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_IXH) if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_IXH)
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x64)
INST_RETURN(2, INST_IX_PREFIX, 0x64)
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_IYH) if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_IYH)
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x64)
INST_RETURN(2, INST_IY_PREFIX, 0x64)
if (INST_REG(0) == REG_H && INST_REG(1) == REG_L) if (INST_REG(0) == REG_H && INST_REG(1) == REG_L)
INST_RETURN(1, 0x65) INST_RETURN(1, 0x65)
if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_IXL) if (INST_REG(0) == REG_IXH && INST_REG(1) == REG_IXL)
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x65)
INST_RETURN(2, INST_IX_PREFIX, 0x65)
if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_IYL) if (INST_REG(0) == REG_IYH && INST_REG(1) == REG_IYL)
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x65)
INST_RETURN(2, INST_IY_PREFIX, 0x65)
if (INST_REG(0) == REG_L && INST_REG(1) == REG_A) if (INST_REG(0) == REG_L && INST_REG(1) == REG_A)
INST_RETURN(1, 0x6F) INST_RETURN(1, 0x6F)
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_A) if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_A)
@@ -484,15 +484,15 @@ INST_FUNC(ld)
if (INST_REG(0) == REG_L && INST_REG(1) == REG_H) if (INST_REG(0) == REG_L && INST_REG(1) == REG_H)
INST_RETURN(1, 0x6C) INST_RETURN(1, 0x6C)
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_IXH) if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_IXH)
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x6C)
INST_RETURN(2, INST_IX_PREFIX, 0x6C)
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_IYH) if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_IYH)
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x6C)
INST_RETURN(2, INST_IY_PREFIX, 0x6C)
if (INST_REG(0) == REG_L && INST_REG(1) == REG_L) if (INST_REG(0) == REG_L && INST_REG(1) == REG_L)
INST_RETURN(1, 0x6D) INST_RETURN(1, 0x6D)
if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_IXL) if (INST_REG(0) == REG_IXL && INST_REG(1) == REG_IXL)
INST_RETURN(3, INST_IX_PREFIX, INST_IX_PREFIX, 0x6D)
INST_RETURN(2, INST_IX_PREFIX, 0x6D)
if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_IYL) if (INST_REG(0) == REG_IYL && INST_REG(1) == REG_IYL)
INST_RETURN(3, INST_IY_PREFIX, INST_IY_PREFIX, 0x6D)
INST_RETURN(2, INST_IY_PREFIX, 0x6D)
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IX) if (INST_REG(0) == REG_A && INST_REG(1) == REG_IX)
INST_RETURN(3, INST_IX_PREFIX, 0xED, 0x57) INST_RETURN(3, INST_IX_PREFIX, 0xED, 0x57)
if (INST_REG(0) == REG_A && INST_REG(1) == REG_IY) if (INST_REG(0) == REG_A && INST_REG(1) == REG_IY)


Loading…
Cancel
Save