[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/52] target-m68k: manage scaled index
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PATCH 04/52] target-m68k: manage scaled index |
Date: |
Wed, 4 May 2016 22:11:44 +0200 |
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 <address@hidden>
---
target-m68k/translate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index c08f35d..a8830a8 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -313,6 +313,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))
--
2.5.5
- [Qemu-devel] [PATCH 00/52] 680x0 instructions emulation, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 01/52] target-m68k: fix DEBUG_DISPATCH, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 02/52] target-m68k: Build the opcode table only once to avoid multithreading issues, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 03/52] target-m68k: define m680x0 CPUs and features, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 04/52] target-m68k: manage scaled index,
Laurent Vivier <=
- [Qemu-devel] [PATCH 05/52] target-m68k: introduce read_imXX() functions, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 06/52] target-m68k: set disassembler mode to 680x0 or coldfire, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 07/52] target-m68k: add bkpt instruction, Laurent Vivier, 2016/05/04
- [Qemu-devel] [PATCH 08/52] target-m68k: define operand sizes, Laurent Vivier, 2016/05/04