summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--68kinst.c8
-rw-r--r--68kinst.h6
-rw-r--r--m68k_core.c17
3 files changed, 25 insertions, 6 deletions
diff --git a/68kinst.c b/68kinst.c
index b1a2f37..1e15e80 100644
--- a/68kinst.c
+++ b/68kinst.c
@@ -1221,7 +1221,8 @@ uint16_t * m68k_decode(uint16_t * istream, m68kinst * decoded, uint32_t address)
}
}
break;
- case RESERVED:
+ case A_LINE:
+ decoded->op = M68K_A_LINE_TRAP;
break;
case CMP_XOR:
size = (*istream >> 6) & 0x3;
@@ -1540,8 +1541,9 @@ uint16_t * m68k_decode(uint16_t * istream, m68kinst * decoded, uint32_t address)
#endif
}
break;
- case COPROC:
- //TODO: Implement me
+ case F_LINE:
+ //TODO: Decode FPU instructions for members of the 68K family with an FPU
+ decoded->op = M68K_F_LINE_TRAP;
break;
}
if (decoded->op == M68K_INVALID) {
diff --git a/68kinst.h b/68kinst.h
index cab2574..d5f5365 100644
--- a/68kinst.h
+++ b/68kinst.h
@@ -26,12 +26,12 @@ typedef enum {
MOVEQ,
OR_DIV_SBCD,
SUB_SUBX,
- RESERVED,
+ A_LINE,
CMP_XOR,
AND_MUL_ABCD_EXG,
ADD_ADDX,
SHIFT_ROTATE,
- COPROC
+ F_LINE
} m68k_optypes;
typedef enum {
@@ -105,6 +105,8 @@ typedef enum {
M68K_TST,
M68K_UNLK,
M68K_INVALID,
+ M68K_A_LINE_TRAP,
+ M68K_F_LINE_TRAP,
#ifdef M68010
M68K_BKPT,
M68K_MOVE_FROM_CCR,
diff --git a/m68k_core.c b/m68k_core.c
index 16614a7..799102e 100644
--- a/m68k_core.c
+++ b/m68k_core.c
@@ -334,7 +334,20 @@ void translate_m68k_rtr(m68k_options *opts, m68kinst * inst)
void translate_m68k_trap(m68k_options *opts, m68kinst *inst)
{
code_info *code = &opts->gen.code;
- ldi_native(opts, inst->src.params.immed + VECTOR_TRAP_0, opts->gen.scratch2);
+ uint32_t vector;
+ switch (inst->op)
+ {
+ case M68K_TRAP:
+ vector = inst->src.params.immed + VECTOR_TRAP_0;
+ break;
+ case M68K_A_LINE_TRAP:
+ vector = VECTOR_LINE_1010;
+ break;
+ case M68K_F_LINE_TRAP:
+ vector = VECTOR_LINE_1111;
+ break;
+ }
+ ldi_native(opts, vector, opts->gen.scratch2);
ldi_native(opts, inst->address+2, opts->gen.scratch1);
jmp(code, opts->trap);
}
@@ -818,6 +831,8 @@ impl_info m68k_impls[] = {
//traps
OP_IMPL(M68K_CHK, translate_m68k_chk),
RAW_IMPL(M68K_TRAP, translate_m68k_trap),
+ RAW_IMPL(M68K_A_LINE_TRAP, translate_m68k_trap),
+ RAW_IMPL(M68K_F_LINE_TRAP, translate_m68k_trap),
RAW_IMPL(M68K_TRAPV, translate_m68k_trapv),
RAW_IMPL(M68K_ILLEGAL, translate_m68k_illegal),
RAW_IMPL(M68K_INVALID, translate_m68k_illegal),