diff --git a/scripts/update_asm_instructions.py b/scripts/update_asm_instructions.py index 7f98e85..e3cecb5 100755 --- a/scripts/update_asm_instructions.py +++ b/scripts/update_asm_instructions.py @@ -324,6 +324,12 @@ class Instruction(object): ret[i] = "0x{0:02X} + 8 * INST_IMM({1}).uval".format( _atoi(base), index) + elif _is_call(byte, "rst"): + index = types.index("immediate") + base = _call_args(byte, "rst") + ret[i] = "0x{0:02X} + INST_IMM({1}).uval".format( + _atoi(base), index) + elif _is_call(byte, "reg"): ret[i] = handle_reg_func(byte) diff --git a/src/assembler/instructions.inc.c b/src/assembler/instructions.inc.c index 3d9f881..451427d 100644 --- a/src/assembler/instructions.inc.c +++ b/src/assembler/instructions.inc.c @@ -7,7 +7,7 @@ `make` should trigger a rebuild when it is modified; if not, use: `python scripts/update_asm_instructions.py`. - @AUTOGEN_DATE Fri May 22 00:55:44 2015 UTC + @AUTOGEN_DATE Fri May 22 00:59:54 2015 UTC */ /* @AUTOGEN_INST_BLOCK_START */ @@ -1594,22 +1594,8 @@ INST_FUNC(rst) AT_NONE ) if (INST_TYPE(0) == AT_IMMEDIATE) { - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 0)) - INST_RETURN(1, 0xC7) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 8)) - INST_RETURN(1, 0xCF) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 16)) - INST_RETURN(1, 0xD7) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 24)) - INST_RETURN(1, 0xDF) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 32)) - INST_RETURN(1, 0xE7) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 40)) - INST_RETURN(1, 0xEF) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 48)) - INST_RETURN(1, 0xF7) - if ((INST_IMM(0).mask & IMM_RST && INST_IMM(0).uval == 56)) - INST_RETURN(1, 0xFF) + if (INST_IMM(0).mask & IMM_RST) + INST_RETURN(1, 0xC7 + INST_IMM(0).uval) INST_ERROR(ARG_VALUE) } INST_ERROR(ARG_TYPE) diff --git a/src/assembler/instructions.yml b/src/assembler/instructions.yml index d49d440..82f5567 100644 --- a/src/assembler/instructions.yml +++ b/src/assembler/instructions.yml @@ -581,22 +581,8 @@ rst: cases: - type: [immediate] cases: - - if: [rst.0x00] - return: [0xC7] - - if: [rst.0x08] - return: [0xCF] - - if: [rst.0x10] - return: [0xD7] - - if: [rst.0x18] - return: [0xDF] - - if: [rst.0x20] - return: [0xE7] - - if: [rst.0x28] - return: [0xEF] - - if: [rst.0x30] - return: [0xF7] - - if: [rst.0x38] - return: [0xFF] + - if: [rst] + return: [rst(0xC7)] sbc: args: yes