diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/m68k/translate.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/target/m68k/translate.c b/target/m68k/translate.c index cf5d8dd..9f60fbc 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -725,7 +725,12 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, } reg = get_areg(s, reg0); tmp = tcg_temp_new(); - tcg_gen_subi_i32(tmp, reg, opsize_bytes(opsize)); + if (reg0 == 7 && opsize == OS_BYTE && + m68k_feature(s->env, M68K_FEATURE_M68000)) { + tcg_gen_subi_i32(tmp, reg, 2); + } else { + tcg_gen_subi_i32(tmp, reg, opsize_bytes(opsize)); + } return tmp; case 5: /* Indirect displacement. */ reg = get_areg(s, reg0); @@ -801,7 +806,12 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext *s, int mode, int reg0, result = gen_ldst(s, opsize, reg, val, what); if (what == EA_STORE || !addrp) { TCGv tmp = tcg_temp_new(); - tcg_gen_addi_i32(tmp, reg, opsize_bytes(opsize)); + if (reg0 == 7 && opsize == OS_BYTE && + m68k_feature(s->env, M68K_FEATURE_M68000)) { + tcg_gen_addi_i32(tmp, reg, 2); + } else { + tcg_gen_addi_i32(tmp, reg, opsize_bytes(opsize)); + } delay_set_areg(s, reg0, tmp, true); } return result; |