aboutsummaryrefslogtreecommitdiff
path: root/target-m68k/translate.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2015-06-24 02:35:06 +0200
committerLaurent Vivier <laurent@vivier.eu>2016-10-25 20:54:47 +0200
commitd8633620a112296fcf6a6ae9a1cbba614c0ca502 (patch)
tree65573fb2fef41e877214bdcc9a969e71b1c5bcc4 /target-m68k/translate.c
parentf076803bbf6ad1618f493f543faff97f3dd0c970 (diff)
target-m68k: manage scaled index
Scaled index is not supported by 68000, 68008, and 68010. EA = (bd + PC) + Xn.SIZE*SCALE + od Ignore it: M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL 2.4 BRIEF EXTENSION WORD FORMAT COMPATIBILITY "If the MC68000 were to execute an instruction that encoded a scaling factor, the scaling factor would be ignored and would not access the desired memory address. The earlier microprocessors do not recognize the brief extension word formats implemented by newer processors. Although they can detect illegal instructions, they do not decode invalid encodings of the brief extension word formats as exceptions." Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-m68k/translate.c')
-rw-r--r--target-m68k/translate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 3773fb41dc..d73350ce5b 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -315,6 +315,11 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base)
if ((ext & 0x800) == 0 && !m68k_feature(s->env, M68K_FEATURE_WORD_INDEX))
return NULL_QREG;
+ if (m68k_feature(s->env, M68K_FEATURE_M68000) &&
+ !m68k_feature(s->env, M68K_FEATURE_SCALED_INDEX)) {
+ ext &= ~(3 << 9);
+ }
+
if (ext & 0x100) {
/* full extension word format */
if (!m68k_feature(s->env, M68K_FEATURE_EXT_FULL))