Update Capstone and add M68k ColdFire support (#6399)

* Update Capstone and add m68k ColdFire support
* Fix test 'core regs linux m68k'
* Add M68K ColdFire integration coverage
* Update Capstone v6 to version 6.0.0-Alpha9
* Refactor CPU mode detection to use case-insensitive string comparison
* Update Capstone next revision to 3df6ff0
This commit is contained in:
billow 2026-05-31 16:15:56 +08:00 committed by GitHub
parent af5ddda795
commit 9e7cc02fcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 4264 additions and 57 deletions

View file

@ -4,25 +4,42 @@
#ifndef RZ_M68K_CS_H
#define RZ_M68K_CS_H
#include <string.h>
#include <rz_util/rz_str.h>
#include <capstone/capstone.h>
#define M68K_LONGEST_INSTRUCTION 22
#ifdef RZ_CAPSTONE_HAS_M68K_CPU32
#define M68K_CPUS "68000,68010,68020,68030,68040,68060,cpu32"
#else
#define M68K_CPUS "68000,68010,68020,68030,68040,68060"
#endif
static inline cs_mode rz_m68k_cs_mode(const char *cpu) {
if (!cpu) {
return CS_MODE_M68K_040;
}
#ifdef RZ_CAPSTONE_HAS_M68K_CPU32
if (strstr(cpu, "cpu32") || strstr(cpu, "CPU32")) {
if (rz_str_casestr(cpu, "cpu32")) {
return CS_MODE_M68K_CPU32;
}
#endif
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
if (rz_str_casestr(cpu, "cfv1")) {
return CS_MODE_M68K_CFV1;
}
if (rz_str_casestr(cpu, "cfv2")) {
return CS_MODE_M68K_CFV2;
}
if (rz_str_casestr(cpu, "cfv3")) {
return CS_MODE_M68K_CFV3;
}
if (rz_str_casestr(cpu, "cfv4e")) {
return CS_MODE_M68K_CFV4E;
}
if (rz_str_casestr(cpu, "cfv4")) {
return CS_MODE_M68K_CFV4;
}
if (rz_str_casestr(cpu, "cfv5")) {
return CS_MODE_M68K_CFV5;
}
if (rz_str_casestr(cpu, "coldfire")) {
return CS_MODE_M68K_COLDFIRE;
}
#endif
if (strstr(cpu, "68000")) {
return CS_MODE_M68K_000;

View file

@ -32,6 +32,36 @@ static inline ut64 make_64bits_address(ut64 address) {
return UT32_MAX & address;
}
static inline ut64 m68k_mem_operand_absolute_address(const cs_m68k_op *operand) {
if (!operand || operand->type != M68K_OP_MEM) {
return 0;
}
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
return operand->mem.address;
#else
if (operand->imm) {
return operand->imm;
}
return (ut64)(st64)(operand->mem.disp + operand->mem.in_disp + operand->mem.out_disp);
#endif
}
static inline bool m68k_mem_operand_is_absolute(const cs_m68k_op *operand) {
if (!operand || operand->type != M68K_OP_MEM) {
return false;
}
switch (operand->address_mode) {
case M68K_AM_ABSOLUTE_DATA_SHORT:
case M68K_AM_ABSOLUTE_DATA_LONG:
return true;
default:
break;
}
return operand->mem.base_reg == M68K_REG_INVALID &&
operand->mem.index_reg == M68K_REG_INVALID &&
operand->mem.in_base_reg == M68K_REG_INVALID;
}
static inline void handle_branch_instruction(RzAnalysisOp *op, ut64 addr, cs_m68k *m68k, ut32 type, int index) {
if (m68k->operands[index].type == M68K_OP_BR_DISP) {
op->type = type;
@ -42,13 +72,24 @@ static inline void handle_branch_instruction(RzAnalysisOp *op, ut64 addr, cs_m68
}
static inline void handle_jump_instruction(RzAnalysisOp *op, ut64 addr, cs_m68k *m68k, ut32 type) {
op->type = type;
if (!m68k || m68k->op_count < 1) {
op->type = type;
return;
}
const cs_m68k_op *operand = &m68k->operands[0];
// Handle PC relative mode jump
if (m68k->operands[0].address_mode == M68K_AM_PCI_DISP) {
op->jump = make_64bits_address(addr + m68k->operands[0].mem.disp + 2);
if (operand->address_mode == M68K_AM_PCI_DISP) {
op->type = type;
op->jump = make_64bits_address(addr + operand->mem.disp + 2);
} else if (operand->type == M68K_OP_IMM) {
op->type = type;
op->jump = make_64bits_address(operand->imm);
} else if (m68k_mem_operand_is_absolute(operand)) {
op->type = type;
op->jump = make_64bits_address(m68k_mem_operand_absolute_address(operand));
} else {
op->jump = make_64bits_address(m68k->operands[0].imm);
op->type = (type == RZ_ANALYSIS_OP_TYPE_CALL) ? RZ_ANALYSIS_OP_TYPE_ICALL : RZ_ANALYSIS_OP_TYPE_IJMP;
}
op->fail = make_64bits_address(addr + op->size);
@ -75,20 +116,58 @@ static RzStructuredData *mk68_opex(csh handle, cs_insn *insn) {
for (st32 i = 0; i < x->op_count; i++) {
cs_m68k_op *op = &x->operands[i];
RzStructuredData *operand = rz_structured_data_array_add_map(operands);
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
if (op->flags != M68K_OP_FLAG_NONE) {
rz_structured_data_map_add_unsigned(operand, "flags", op->flags, false);
}
#endif
switch (op->type) {
case M68K_OP_REG:
rz_structured_data_map_add_string(operand, "type", "reg");
rz_structured_data_map_add_string(operand, "value", cs_reg_name(handle, op->reg));
break;
case M68K_OP_REG_PAIR:
rz_structured_data_map_add_string(operand, "type", "reg_pair");
rz_structured_data_map_add_string(operand, "reg_0", cs_reg_name(handle, op->reg_pair.reg_0));
rz_structured_data_map_add_string(operand, "reg_1", cs_reg_name(handle, op->reg_pair.reg_1));
break;
case M68K_OP_IMM:
rz_structured_data_map_add_string(operand, "type", "imm");
rz_structured_data_map_add_signed(operand, "value", (st64)op->imm);
break;
case M68K_OP_FP_SINGLE:
rz_structured_data_map_add_string(operand, "type", "fp_single");
rz_structured_data_map_add_double(operand, "value", op->simm);
break;
case M68K_OP_FP_DOUBLE:
rz_structured_data_map_add_string(operand, "type", "fp_double");
rz_structured_data_map_add_double(operand, "value", op->dimm);
break;
case M68K_OP_REG_BITS:
rz_structured_data_map_add_string(operand, "type", "reg_bits");
rz_structured_data_map_add_unsigned(operand, "value", op->register_bits, true);
break;
case M68K_OP_BR_DISP:
rz_structured_data_map_add_string(operand, "type", "br_disp");
rz_structured_data_map_add_signed(operand, "disp", op->br_disp.disp);
rz_structured_data_map_add_unsigned(operand, "disp_size", op->br_disp.disp_size, false);
break;
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
case M68K_OP_SHIFT:
rz_structured_data_map_add_string(operand, "type", "shift");
break;
#endif
case M68K_OP_MEM:
rz_structured_data_map_add_string(operand, "type", "mem");
rz_structured_data_map_add_unsigned(operand, "address_mode", op->address_mode, false);
if (op->mem.base_reg != M68K_REG_INVALID) {
rz_structured_data_map_add_string(operand, "base_reg", cs_reg_name(handle, op->mem.base_reg));
}
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
if (m68k_mem_operand_is_absolute(op)) {
rz_structured_data_map_add_unsigned(operand, "address", op->mem.address, false);
}
#endif
if (op->mem.index_reg != M68K_REG_INVALID) {
rz_structured_data_map_add_string(operand, "index_reg", cs_reg_name(handle, op->mem.index_reg));
}
@ -103,6 +182,11 @@ static RzStructuredData *mk68_opex(csh handle, cs_insn *insn) {
rz_structured_data_map_add_signed(operand, "width", op->mem.width);
rz_structured_data_map_add_signed(operand, "offset", op->mem.offset);
rz_structured_data_map_add_signed(operand, "index_size", op->mem.index_size);
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
rz_structured_data_map_add_signed(operand, "in_disp_size", op->mem.in_disp_size);
rz_structured_data_map_add_signed(operand, "out_disp_size", op->mem.out_disp_size);
rz_structured_data_map_add_signed(operand, "disp_size", op->mem.disp_size);
#endif
break;
default:
rz_structured_data_map_add_string(operand, "type", "invalid");
@ -113,27 +197,486 @@ static RzStructuredData *mk68_opex(csh handle, cs_insn *insn) {
return root;
}
static int parse_reg_name(RzRegItem *reg, csh handle, cs_insn *insn, int reg_num) {
if (!reg) {
return -1;
static inline int m68k_op_memref(const cs_m68k *m68k) {
if (!m68k) {
return 0;
}
switch (OPERAND(reg_num).type) {
switch (m68k->op_size.type) {
case M68K_SIZE_TYPE_CPU:
switch (m68k->op_size.cpu_size) {
case M68K_CPU_SIZE_BYTE:
return 1;
case M68K_CPU_SIZE_WORD:
return 2;
case M68K_CPU_SIZE_LONG:
return 4;
default:
return 0;
}
case M68K_SIZE_TYPE_FPU:
switch (m68k->op_size.fpu_size) {
case M68K_FPU_SIZE_SINGLE:
return 4;
case M68K_FPU_SIZE_DOUBLE:
return 8;
case M68K_FPU_SIZE_EXTENDED:
return 12;
default:
return 0;
}
default:
return 0;
}
}
static inline RzRegItem *m68k_reg_get(RzAnalysis *a, csh handle, m68k_reg reg) {
if (!a || reg == M68K_REG_INVALID) {
return NULL;
}
const char *name = cs_reg_name(handle, reg);
return RZ_STR_ISNOTEMPTY(name) ? rz_reg_get(a->reg, name, RZ_REG_TYPE_ANY) : NULL;
}
static RzAnalysisValue *m68k_value_from_operand(RzAnalysis *a, csh handle, const cs_m68k_op *operand, int memref, RzAnalysisValueAccess access) {
if (!operand) {
return NULL;
}
RzAnalysisValue *value = rz_analysis_value_new();
if (!value) {
return NULL;
}
value->access = access;
switch (operand->type) {
case M68K_OP_REG:
reg->name = (char *)cs_reg_name(handle, OPERAND(reg_num).reg);
value->type = RZ_ANALYSIS_VAL_REG;
value->reg = m68k_reg_get(a, handle, operand->reg);
if (!value->reg) {
rz_analysis_value_free(value);
return NULL;
}
break;
case M68K_OP_IMM:
value->type = RZ_ANALYSIS_VAL_IMM;
value->imm = (st64)operand->imm;
break;
case M68K_OP_BR_DISP:
value->type = RZ_ANALYSIS_VAL_IMM;
value->imm = operand->br_disp.disp;
break;
case M68K_OP_MEM:
if (OPERAND(reg_num).mem.base_reg != M68K_REG_INVALID) {
reg->name = (char *)cs_reg_name(handle, OPERAND(reg_num).mem.base_reg);
value->type = RZ_ANALYSIS_VAL_MEM;
value->memref = memref;
value->reg = m68k_reg_get(a, handle, operand->mem.base_reg);
if (!value->reg) {
value->reg = m68k_reg_get(a, handle, operand->mem.in_base_reg);
}
value->regdelta = m68k_reg_get(a, handle, operand->mem.index_reg);
value->mul = operand->mem.scale;
value->delta = operand->mem.disp + operand->mem.in_disp + operand->mem.out_disp;
if (m68k_mem_operand_is_absolute(operand)) {
value->absolute = true;
value->base = m68k_mem_operand_absolute_address(operand);
value->delta = 0;
} else if (!value->reg && !value->regdelta && value->delta) {
value->absolute = true;
value->base = (ut64)value->delta;
value->delta = 0;
}
break;
case M68K_OP_REG_PAIR:
value->type = RZ_ANALYSIS_VAL_REG;
value->reg = m68k_reg_get(a, handle, operand->reg_pair.reg_0);
if (!value->reg) {
rz_analysis_value_free(value);
return NULL;
}
break;
default:
rz_analysis_value_free(value);
return NULL;
}
return value;
}
static inline void m68k_note_memref(RzAnalysisOp *op, RzAnalysisValue *value) {
if (value && value->type == RZ_ANALYSIS_VAL_MEM && value->memref > 0) {
op->refptr = value->memref;
}
}
static bool m68k_add_src_value(RzAnalysisOp *op, RzAnalysisValue *value) {
if (!value) {
return false;
}
for (size_t i = 0; i < RZ_ARRAY_SIZE(op->src); i++) {
if (!op->src[i]) {
op->src[i] = value;
m68k_note_memref(op, value);
return true;
}
}
rz_analysis_value_free(value);
return false;
}
static void m68k_set_dst_value(RzAnalysisOp *op, RzAnalysisValue *value) {
if (!value) {
return;
}
if (op->dst) {
rz_analysis_value_free(op->dst);
}
op->dst = value;
m68k_note_memref(op, value);
}
static void m68k_add_src_operand(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k, int operand_index) {
if (!m68k || operand_index < 0 || operand_index >= m68k->op_count) {
return;
}
RzAnalysisValue *value = m68k_value_from_operand(a, handle, &m68k->operands[operand_index], m68k_op_memref(m68k), RZ_ANALYSIS_ACC_R);
m68k_add_src_value(op, value);
}
static void m68k_set_dst_operand(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k, int operand_index, RzAnalysisValueAccess access) {
if (!m68k || operand_index < 0 || operand_index >= m68k->op_count) {
return;
}
RzAnalysisValue *value = m68k_value_from_operand(a, handle, &m68k->operands[operand_index], m68k_op_memref(m68k), access);
m68k_set_dst_value(op, value);
}
static void m68k_fill_srcs_before_dst(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k, bool dst_is_read) {
if (!m68k || m68k->op_count < 1) {
return;
}
int dst_index = m68k->op_count - 1;
for (int i = 0; i < dst_index; i++) {
m68k_add_src_operand(a, op, handle, m68k, i);
}
m68k_set_dst_operand(a, op, handle, m68k, dst_index, dst_is_read ? (RZ_ANALYSIS_ACC_R | RZ_ANALYSIS_ACC_W) : RZ_ANALYSIS_ACC_W);
}
static void m68k_fill_all_srcs(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k) {
if (!m68k) {
return;
}
for (int i = 0; i < m68k->op_count; i++) {
m68k_add_src_operand(a, op, handle, m68k, i);
}
}
static void m68k_fill_unary_rw(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k) {
if (!m68k || m68k->op_count < 1) {
return;
}
m68k_set_dst_operand(a, op, handle, m68k, 0, RZ_ANALYSIS_ACC_R | RZ_ANALYSIS_ACC_W);
if (op->dst) {
RzAnalysisValue *src = rz_analysis_value_copy(op->dst);
if (src) {
src->access = RZ_ANALYSIS_ACC_R;
m68k_add_src_value(op, src);
}
}
}
static void m68k_fill_clear(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k) {
if (!m68k || m68k->op_count < 1) {
return;
}
m68k_set_dst_operand(a, op, handle, m68k, 0, RZ_ANALYSIS_ACC_W);
RzAnalysisValue *src = rz_analysis_value_new();
if (src) {
src->type = RZ_ANALYSIS_VAL_IMM;
src->access = RZ_ANALYSIS_ACC_R;
src->imm = 0;
m68k_add_src_value(op, src);
}
}
static void m68k_fill_indirect_target(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k) {
if (!m68k || m68k->op_count < 1) {
return;
}
m68k_add_src_operand(a, op, handle, m68k, 0);
}
static void m68k_fill_fpu_unknown(RzAnalysis *a, RzAnalysisOp *op, csh handle, const cs_m68k *m68k) {
if (!m68k || m68k->op_count < 1) {
return;
}
if (m68k->op_count == 1) {
m68k_fill_unary_rw(a, op, handle, m68k);
} else {
m68k_fill_srcs_before_dst(a, op, handle, m68k, false);
}
}
static void m68k_set_move_type(RzAnalysisOp *op, const cs_m68k *m68k) {
if (!m68k || m68k->op_count < 2) {
op->type = RZ_ANALYSIS_OP_TYPE_MOV;
return;
}
const cs_m68k_op *src = &m68k->operands[0];
const cs_m68k_op *dst = &m68k->operands[m68k->op_count - 1];
if (dst->type == M68K_OP_MEM) {
op->type = RZ_ANALYSIS_OP_TYPE_STORE;
} else if (src->type == M68K_OP_MEM) {
op->type = RZ_ANALYSIS_OP_TYPE_LOAD;
} else {
op->type = RZ_ANALYSIS_OP_TYPE_MOV;
}
}
static RZ_UNUSED void m68k_set_cast_type(RzAnalysisOp *op, const cs_m68k *m68k) {
if (!m68k || m68k->op_count < 2) {
op->type = RZ_ANALYSIS_OP_TYPE_CAST;
return;
}
const cs_m68k_op *src = &m68k->operands[0];
const cs_m68k_op *dst = &m68k->operands[m68k->op_count - 1];
if (dst->type == M68K_OP_MEM) {
op->type = RZ_ANALYSIS_OP_TYPE_STORE;
} else if (src->type == M68K_OP_MEM) {
op->type = RZ_ANALYSIS_OP_TYPE_LOAD;
} else {
op->type = RZ_ANALYSIS_OP_TYPE_CAST;
}
}
static void m68k_set_opdir(RzAnalysisOp *op) {
switch (op->type & RZ_ANALYSIS_OP_TYPE_MASK) {
case RZ_ANALYSIS_OP_TYPE_LOAD:
op->direction = RZ_ANALYSIS_OP_DIR_READ;
break;
case RZ_ANALYSIS_OP_TYPE_STORE:
op->direction = RZ_ANALYSIS_OP_DIR_WRITE;
break;
case RZ_ANALYSIS_OP_TYPE_LEA:
op->direction = RZ_ANALYSIS_OP_DIR_REF;
break;
case RZ_ANALYSIS_OP_TYPE_JMP:
case RZ_ANALYSIS_OP_TYPE_CJMP:
case RZ_ANALYSIS_OP_TYPE_UJMP:
case RZ_ANALYSIS_OP_TYPE_CALL:
case RZ_ANALYSIS_OP_TYPE_UCALL:
op->direction = RZ_ANALYSIS_OP_DIR_EXEC;
break;
default:
break;
}
return 0;
}
static void m68k_handle_fpu_instruction(RzAnalysisOp *op, ut64 addr, cs_m68k *m68k, unsigned int insn_id) {
op->family = RZ_ANALYSIS_OP_FAMILY_FPU;
switch (insn_id) {
case M68K_INS_FMOVE:
case M68K_INS_FSMOVE:
case M68K_INS_FDMOVE:
case M68K_INS_FMOVECR:
case M68K_INS_FMOVEM:
m68k_set_move_type(op, m68k);
break;
case M68K_INS_FADD:
case M68K_INS_FSADD:
case M68K_INS_FDADD:
op->type = RZ_ANALYSIS_OP_TYPE_ADD;
break;
case M68K_INS_FSUB:
case M68K_INS_FSSUB:
case M68K_INS_FDSUB:
op->type = RZ_ANALYSIS_OP_TYPE_SUB;
break;
case M68K_INS_FMUL:
case M68K_INS_FSMUL:
case M68K_INS_FDMUL:
case M68K_INS_FSGLMUL:
op->type = RZ_ANALYSIS_OP_TYPE_MUL;
break;
case M68K_INS_FDIV:
case M68K_INS_FSDIV:
case M68K_INS_FDDIV:
case M68K_INS_FSGLDIV:
op->type = RZ_ANALYSIS_OP_TYPE_DIV;
break;
case M68K_INS_FMOD:
case M68K_INS_FREM:
op->type = RZ_ANALYSIS_OP_TYPE_MOD;
break;
case M68K_INS_FCMP:
case M68K_INS_FTST:
op->type = RZ_ANALYSIS_OP_TYPE_CMP;
break;
case M68K_INS_FABS:
case M68K_INS_FSABS:
case M68K_INS_FDABS:
op->type = RZ_ANALYSIS_OP_TYPE_ABS;
break;
case M68K_INS_FNEG:
case M68K_INS_FSNEG:
case M68K_INS_FDNEG:
op->type = RZ_ANALYSIS_OP_TYPE_SUB;
break;
case M68K_INS_FINT:
case M68K_INS_FINTRZ:
op->type = RZ_ANALYSIS_OP_TYPE_CAST;
break;
case M68K_INS_FNOP:
op->type = RZ_ANALYSIS_OP_TYPE_NOP;
break;
case M68K_INS_FSAVE:
op->type = RZ_ANALYSIS_OP_TYPE_STORE;
break;
case M68K_INS_FRESTORE:
op->type = RZ_ANALYSIS_OP_TYPE_LOAD;
break;
case M68K_INS_FSF:
case M68K_INS_FSBEQ:
case M68K_INS_FSOGT:
case M68K_INS_FSOGE:
case M68K_INS_FSOLT:
case M68K_INS_FSOLE:
case M68K_INS_FSOGL:
case M68K_INS_FSOR:
case M68K_INS_FSUN:
case M68K_INS_FSUEQ:
case M68K_INS_FSUGT:
case M68K_INS_FSUGE:
case M68K_INS_FSULT:
case M68K_INS_FSULE:
case M68K_INS_FSNE:
case M68K_INS_FST:
case M68K_INS_FSSF:
case M68K_INS_FSSEQ:
case M68K_INS_FSGT:
case M68K_INS_FSGE:
case M68K_INS_FSLT:
case M68K_INS_FSLE:
case M68K_INS_FSGL:
case M68K_INS_FSGLE:
case M68K_INS_FSNGLE:
case M68K_INS_FSNGL:
case M68K_INS_FSNLE:
case M68K_INS_FSNLT:
case M68K_INS_FSNGE:
case M68K_INS_FSNGT:
case M68K_INS_FSSNE:
case M68K_INS_FSST:
op->type = RZ_ANALYSIS_OP_TYPE_MOV;
break;
case M68K_INS_FTRAPF:
case M68K_INS_FTRAPEQ:
case M68K_INS_FTRAPOGT:
case M68K_INS_FTRAPOGE:
case M68K_INS_FTRAPOLT:
case M68K_INS_FTRAPOLE:
case M68K_INS_FTRAPOGL:
case M68K_INS_FTRAPOR:
case M68K_INS_FTRAPUN:
case M68K_INS_FTRAPUEQ:
case M68K_INS_FTRAPUGT:
case M68K_INS_FTRAPUGE:
case M68K_INS_FTRAPULT:
case M68K_INS_FTRAPULE:
case M68K_INS_FTRAPNE:
case M68K_INS_FTRAPT:
case M68K_INS_FTRAPSF:
case M68K_INS_FTRAPSEQ:
case M68K_INS_FTRAPGT:
case M68K_INS_FTRAPGE:
case M68K_INS_FTRAPLT:
case M68K_INS_FTRAPLE:
case M68K_INS_FTRAPGL:
case M68K_INS_FTRAPGLE:
case M68K_INS_FTRAPNGLE:
case M68K_INS_FTRAPNGL:
case M68K_INS_FTRAPNLE:
case M68K_INS_FTRAPNLT:
case M68K_INS_FTRAPNGE:
case M68K_INS_FTRAPNGT:
case M68K_INS_FTRAPSNE:
case M68K_INS_FTRAPST:
op->type = RZ_ANALYSIS_OP_TYPE_TRAP;
break;
case M68K_INS_FBF:
case M68K_INS_FBEQ:
case M68K_INS_FBOGT:
case M68K_INS_FBOGE:
case M68K_INS_FBOLT:
case M68K_INS_FBOLE:
case M68K_INS_FBOGL:
case M68K_INS_FBOR:
case M68K_INS_FBUN:
case M68K_INS_FBUEQ:
case M68K_INS_FBUGT:
case M68K_INS_FBUGE:
case M68K_INS_FBULT:
case M68K_INS_FBULE:
case M68K_INS_FBNE:
case M68K_INS_FBT:
case M68K_INS_FBSF:
case M68K_INS_FBSEQ:
case M68K_INS_FBGT:
case M68K_INS_FBGE:
case M68K_INS_FBLT:
case M68K_INS_FBLE:
case M68K_INS_FBGL:
case M68K_INS_FBGLE:
case M68K_INS_FBNGLE:
case M68K_INS_FBNGL:
case M68K_INS_FBNLE:
case M68K_INS_FBNLT:
case M68K_INS_FBNGE:
case M68K_INS_FBNGT:
case M68K_INS_FBSNE:
case M68K_INS_FBST:
handle_branch_instruction(op, addr, m68k, RZ_ANALYSIS_OP_TYPE_CJMP, 0);
break;
case M68K_INS_FDBF:
case M68K_INS_FDBEQ:
case M68K_INS_FDBOGT:
case M68K_INS_FDBOGE:
case M68K_INS_FDBOLT:
case M68K_INS_FDBOLE:
case M68K_INS_FDBOGL:
case M68K_INS_FDBOR:
case M68K_INS_FDBUN:
case M68K_INS_FDBUEQ:
case M68K_INS_FDBUGT:
case M68K_INS_FDBUGE:
case M68K_INS_FDBULT:
case M68K_INS_FDBULE:
case M68K_INS_FDBNE:
case M68K_INS_FDBT:
case M68K_INS_FDBSF:
case M68K_INS_FDBSEQ:
case M68K_INS_FDBGT:
case M68K_INS_FDBGE:
case M68K_INS_FDBLT:
case M68K_INS_FDBLE:
case M68K_INS_FDBGL:
case M68K_INS_FDBGLE:
case M68K_INS_FDBNGLE:
case M68K_INS_FDBNGL:
case M68K_INS_FDBNLE:
case M68K_INS_FDBNLT:
case M68K_INS_FDBNGE:
case M68K_INS_FDBNGT:
case M68K_INS_FDBSNE:
case M68K_INS_FDBST:
handle_branch_instruction(op, addr, m68k, RZ_ANALYSIS_OP_TYPE_CJMP, 1);
break;
default:
op->type = RZ_ANALYSIS_OP_TYPE_UNK;
break;
}
}
typedef struct {
RzRegItem reg;
csh handle;
int omode;
int obits;
@ -150,32 +693,77 @@ static bool m68k_init(void **user) {
}
static void op_fillval(RzAnalysis *a, RzAnalysisOp *op, csh handle, cs_insn *insn) {
M68KContext *ctx = (M68KContext *)a->plugin_data;
cs_m68k *m68k = &insn->detail->m68k;
switch (insn->id) {
case M68K_INS_CLR:
m68k_fill_clear(a, op, handle, m68k);
return;
case M68K_INS_NEG:
case M68K_INS_NEGX:
case M68K_INS_NOT:
case M68K_INS_SWAP:
case M68K_INS_EXT:
case M68K_INS_EXTB:
m68k_fill_unary_rw(a, op, handle, m68k);
return;
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
case M68K_INS_BITREV:
case M68K_INS_BYTEREV:
case M68K_INS_FF1:
case M68K_INS_SATS:
m68k_fill_unary_rw(a, op, handle, m68k);
return;
#endif
default:
break;
}
switch (op->type & RZ_ANALYSIS_OP_TYPE_MASK) {
case RZ_ANALYSIS_OP_TYPE_LOAD:
case RZ_ANALYSIS_OP_TYPE_MOV:
ZERO_FILL(ctx->reg);
if (OPERAND(1).type == M68K_OP_MEM) {
op->src[0] = rz_analysis_value_new();
op->src[0]->type = RZ_ANALYSIS_VAL_MEM;
op->src[0]->reg = &ctx->reg;
parse_reg_name(op->src[0]->reg, handle, insn, 1);
op->src[0]->delta = OPERAND(0).mem.disp;
} else if (OPERAND(0).type == M68K_OP_MEM) {
op->dst = rz_analysis_value_new();
op->dst->type = RZ_ANALYSIS_VAL_MEM;
op->dst->reg = &ctx->reg;
parse_reg_name(op->dst->reg, handle, insn, 0);
op->dst->delta = OPERAND(1).mem.disp;
}
case RZ_ANALYSIS_OP_TYPE_STORE:
case RZ_ANALYSIS_OP_TYPE_CAST:
m68k_fill_srcs_before_dst(a, op, handle, m68k, false);
break;
case RZ_ANALYSIS_OP_TYPE_LEA:
ZERO_FILL(ctx->reg);
if (OPERAND(1).type == M68K_OP_MEM) {
op->dst = rz_analysis_value_new();
op->dst->type = RZ_ANALYSIS_VAL_MEM;
op->dst->reg = &ctx->reg;
parse_reg_name(op->dst->reg, handle, insn, 1);
op->dst->delta = OPERAND(1).mem.disp;
if (m68k->op_count > 1) {
m68k_add_src_operand(a, op, handle, m68k, 0);
m68k_set_dst_operand(a, op, handle, m68k, m68k->op_count - 1, RZ_ANALYSIS_ACC_W);
} else {
m68k_fill_all_srcs(a, op, handle, m68k);
}
break;
case RZ_ANALYSIS_OP_TYPE_ADD:
case RZ_ANALYSIS_OP_TYPE_SUB:
case RZ_ANALYSIS_OP_TYPE_MUL:
case RZ_ANALYSIS_OP_TYPE_DIV:
case RZ_ANALYSIS_OP_TYPE_MOD:
case RZ_ANALYSIS_OP_TYPE_SHL:
case RZ_ANALYSIS_OP_TYPE_SHR:
case RZ_ANALYSIS_OP_TYPE_SAR:
case RZ_ANALYSIS_OP_TYPE_SAL:
case RZ_ANALYSIS_OP_TYPE_OR:
case RZ_ANALYSIS_OP_TYPE_AND:
case RZ_ANALYSIS_OP_TYPE_XOR:
case RZ_ANALYSIS_OP_TYPE_XCHG:
case RZ_ANALYSIS_OP_TYPE_ROR:
case RZ_ANALYSIS_OP_TYPE_ROL:
case RZ_ANALYSIS_OP_TYPE_ABS:
case RZ_ANALYSIS_OP_TYPE_BCNT:
case RZ_ANALYSIS_OP_TYPE_REV:
m68k_fill_srcs_before_dst(a, op, handle, m68k, true);
break;
case RZ_ANALYSIS_OP_TYPE_CMP:
m68k_fill_all_srcs(a, op, handle, m68k);
break;
case RZ_ANALYSIS_OP_TYPE_UJMP:
case RZ_ANALYSIS_OP_TYPE_UCALL:
m68k_fill_indirect_target(a, op, handle, m68k);
break;
default:
if (op->family == RZ_ANALYSIS_OP_FAMILY_FPU &&
(op->type & RZ_ANALYSIS_OP_TYPE_MASK) == RZ_ANALYSIS_OP_TYPE_UNK) {
m68k_fill_fpu_unknown(a, op, handle, m68k);
}
break;
}
@ -290,9 +878,11 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
case M68K_INS_CAS2:
case M68K_INS_CHK:
case M68K_INS_CHK2:
case M68K_INS_CLR:
// TODO:
break;
case M68K_INS_CLR:
op->type = RZ_ANALYSIS_OP_TYPE_MOV;
break;
case M68K_INS_CMP:
case M68K_INS_CMPA:
case M68K_INS_CMPI:
@ -308,6 +898,7 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
case M68K_INS_CPUSHL:
case M68K_INS_CPUSHP:
case M68K_INS_CPUSHA:
op->type = RZ_ANALYSIS_OP_TYPE_SYNC;
break;
case M68K_INS_DBT:
case M68K_INS_DBF:
@ -339,10 +930,11 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
op->type = RZ_ANALYSIS_OP_TYPE_XOR;
break;
case M68K_INS_EXG:
op->type = RZ_ANALYSIS_OP_TYPE_MOV;
op->type = RZ_ANALYSIS_OP_TYPE_XCHG;
break;
case M68K_INS_EXT:
case M68K_INS_EXTB:
op->type = RZ_ANALYSIS_OP_TYPE_CAST;
break;
case M68K_INS_FABS:
case M68K_INS_FSABS:
@ -531,8 +1123,7 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
case M68K_INS_FTRAPST:
case M68K_INS_FTST:
case M68K_INS_FTWOTOX:
op->type = RZ_ANALYSIS_OP_TYPE_UNK;
op->family = RZ_ANALYSIS_OP_FAMILY_FPU;
m68k_handle_fpu_instruction(op, addr, m68k, insn->id);
break;
case M68K_INS_HALT:
op->type = RZ_ANALYSIS_OP_TYPE_NOP;
@ -572,8 +1163,70 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
case M68K_INS_MOVEQ:
case M68K_INS_MOVES:
case M68K_INS_MOVE16:
m68k_set_move_type(op, m68k);
break;
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
case M68K_INS_MOV3Q:
case M68K_INS_MOVCLR:
m68k_set_move_type(op, m68k);
break;
case M68K_INS_MVS:
op->sign = true;
m68k_set_cast_type(op, m68k);
break;
case M68K_INS_MVZ:
op->sign = false;
m68k_set_cast_type(op, m68k);
break;
case M68K_INS_MAC:
case M68K_INS_MSAC:
op->type = RZ_ANALYSIS_OP_TYPE_MUL;
break;
case M68K_INS_SATS:
op->type = RZ_ANALYSIS_OP_TYPE_CAST;
break;
case M68K_INS_BITREV:
case M68K_INS_BYTEREV:
op->type = RZ_ANALYSIS_OP_TYPE_REV;
break;
case M68K_INS_FF1:
op->type = RZ_ANALYSIS_OP_TYPE_BCNT;
break;
case M68K_INS_INTOUCH:
op->type = RZ_ANALYSIS_OP_TYPE_SYNC;
break;
case M68K_INS_STRLDSR:
case M68K_INS_WDDATA:
case M68K_INS_WDEBUG:
op->type = RZ_ANALYSIS_OP_TYPE_MOV;
break;
case M68K_INS_TBLS:
case M68K_INS_TBLU:
case M68K_INS_TBLSN:
case M68K_INS_TBLUN:
m68k_set_move_type(op, m68k);
break;
case M68K_INS_BGND:
case M68K_INS_TPF:
op->type = RZ_ANALYSIS_OP_TYPE_TRAP;
break;
case M68K_INS_CP0BCBUSY:
case M68K_INS_CP1BCBUSY:
handle_branch_instruction(op, addr, m68k, RZ_ANALYSIS_OP_TYPE_CJMP, 0);
break;
case M68K_INS_CP0LD:
case M68K_INS_CP1LD:
op->type = RZ_ANALYSIS_OP_TYPE_LOAD;
break;
case M68K_INS_CP0ST:
case M68K_INS_CP1ST:
op->type = RZ_ANALYSIS_OP_TYPE_STORE;
break;
case M68K_INS_CP0NOP:
case M68K_INS_CP1NOP:
op->type = RZ_ANALYSIS_OP_TYPE_NOP;
break;
#endif
case M68K_INS_MULS:
case M68K_INS_MULU:
op->type = RZ_ANALYSIS_OP_TYPE_MUL;
@ -581,6 +1234,7 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
case M68K_INS_NBCD:
case M68K_INS_NEG:
case M68K_INS_NEGX:
op->type = RZ_ANALYSIS_OP_TYPE_SUB;
break;
case M68K_INS_NOP:
op->type = RZ_ANALYSIS_OP_TYPE_NOP;
@ -606,9 +1260,11 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
case M68K_INS_PTESTR:
case M68K_INS_PTESTW:
case M68K_INS_PULSE:
case M68K_INS_RESET:
break;
case M68K_INS_REMS:
case M68K_INS_REMU:
case M68K_INS_RESET:
op->type = RZ_ANALYSIS_OP_TYPE_MOD;
break;
case M68K_INS_ROL:
op->type = RZ_ANALYSIS_OP_TYPE_ROL;
@ -694,6 +1350,7 @@ static int m68k_analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8
op->stackptr = 0;
break;
}
m68k_set_opdir(op);
if (mask & RZ_ANALYSIS_OP_MASK_VAL) {
op_fillval(a, op, ctx->handle, insn);
}
@ -761,7 +1418,19 @@ static char *m68k_get_reg_profile(RzAnalysis *analysis) {
"gpr dtt1 .32 168 0\n" // in 68EC040 this is DACR1
"gpr mmusr .32 172 0\n"
"gpr urp .32 176 0\n"
"gpr srp .32 180 0\n";
"gpr srp .32 180 0\n"
"gpr tt0 .32 184 0\n"
"gpr tt1 .32 188 0\n"
"gpr crp .32 192 0\n"
"gpr acc .32 196 0\n"
"gpr acc0 .32 200 0\n"
"gpr acc1 .32 204 0\n"
"gpr acc2 .32 208 0\n"
"gpr acc3 .32 212 0\n"
"gpr accext01 .32 216 0\n"
"gpr accext23 .32 220 0\n"
"gpr macsr .32 224 0\n"
"gpr mask .32 228 0\n";
return rz_str_dup(p);
}

View file

@ -93,6 +93,15 @@ static char **m68k_cpu_descriptions() {
"68060", "Motorola 68060: 32-bit microprocessor, highest performer in m68k series",
#ifdef RZ_CAPSTONE_HAS_M68K_CPU32
"cpu32", "Motorola CPU32: 32-bit embedded-controller CPU core based on the 68020",
#endif
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
"coldfire", "Motorola ColdFire: 32-bit embedded-controller family based on the 68000 ISA",
"cfv1", "Motorola ColdFire V1 core",
"cfv2", "Motorola ColdFire V2 core",
"cfv3", "Motorola ColdFire V3 core",
"cfv4", "Motorola ColdFire V4 core",
"cfv4e", "Motorola ColdFire V4e core with enhanced MAC and FPU features",
"cfv5", "Motorola ColdFire V5 core",
#endif
NULL
};
@ -102,7 +111,14 @@ static char **m68k_cpu_descriptions() {
RzAsmPlugin rz_asm_plugin_m68k_cs = {
.name = "m68k",
.desc = "Motorola 68K Capstone-based disassembler",
.cpus = M68K_CPUS,
.cpus = "68000,68010,68020,68030,68040,68060"
#ifdef RZ_CAPSTONE_HAS_M68K_CPU32
",cpu32"
#endif
#ifdef RZ_CAPSTONE_HAS_M68K_COLDFIRE
",coldfire,cfv1,cfv2,cfv3,cfv4,cfv4e,cfv5"
#endif
,
.license = "BSD",
.arch = "m68k",
.bits = 32,

View file

@ -230,6 +230,21 @@ if has_capstone_m68k_cpu32
add_project_arguments(['-DRZ_CAPSTONE_HAS_M68K_CPU32'], language: 'c')
endif
has_capstone_m68k_coldfire = cc.compiles('''
#include <capstone/capstone.h>
int main(void) {
cs_mode mode = CS_MODE_M68K_COLDFIRE | CS_MODE_M68K_CFV1 | CS_MODE_M68K_CFV2 | CS_MODE_M68K_CFV3 | CS_MODE_M68K_CFV4 | CS_MODE_M68K_CFV4E | CS_MODE_M68K_CFV5;
return mode == 0;
}
''',
dependencies: capstone_check_deps,
include_directories: capstone_check_includes,
name: 'Capstone has M68K ColdFire modes'
)
if has_capstone_m68k_coldfire
add_project_arguments(['-DRZ_CAPSTONE_HAS_M68K_COLDFIRE'], language: 'c')
endif
has_capstone_m680x_hcs12x = cc.compiles('''
#include <capstone/capstone.h>
int main(void) {

View file

@ -1,6 +1,6 @@
[wrap-git]
url = https://github.com/capstone-engine/capstone.git
revision = 808aee0d225fd75af9162b0e37c8e7982a77b3b5
revision = 3df6ff015fb6afd81307e325fdd9c82dbf184b28
directory = capstone-next
patch_directory = capstone-next
depth = 1

View file

@ -1,6 +1,6 @@
[wrap-file]
source_url = https://github.com/capstone-engine/capstone/releases/download/6.0.0-Alpha7/capstone-6.0.0-Alpha7.tar.xz
source_filename = capstone-6.0.0-Alpha7.tar.xz
source_hash = 6864bf6cff06f2698fd30854cc2097b6d41cd10b5454be67e8b56ad0cfc686ec
directory = capstone-6.0.0-Alpha7
patch_directory = capstone-6.0.0-alpha7
source_url = https://github.com/capstone-engine/capstone/releases/download/6.0.0-Alpha9/capstone-6.0.0-Alpha9.tar.xz
source_filename = capstone-6.0.0-Alpha9.tar.xz
source_hash = 4c8e4f98827236d43be41b91f3faa7cc70f2f0699b97356a60b6a9d492540ed7
directory = capstone-6.0.0-Alpha9
patch_directory = capstone-6.0.0-alpha9

File diff suppressed because it is too large Load diff

View file

@ -1,2 +1,4 @@
d "btst.b 0xe8, 0x1aa8(pc)" 083a00e80a54 0x1050
d "btst.b 0x38, 0x343d(pc, d0.w)" 083b00380039 0x3400
d "move.l 0x12345678.l, d0" 203912345678
d "jsr 0x12345678.l" 4eb912345678

105
test/db/asm/m68k_cfv1_32 Normal file
View file

@ -0,0 +1,105 @@
d "mov3q.l 0x2, (a4)" a554
d "mvs.b d0, d0" 7100
d "mvs.w d0, d0" 7140
d "mvz.b d0, d0" 7180
d "mvz.w d0, d0" 71c0
d "mvs.b d0, d1" 7300
d "mov3q.l 0xffffffff, d0" a140
d "mvs.b (a0), d1" 7310
d "mvz.w (a0), d1" 73d0
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "bra.l 0x12" 60ff00000010
d "bsr.l 0x12" 61ff00000010
d "bne.l 0x12" 66ff00000010
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "sats.l d0" 4c80
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bitrev d0" 00c0
d "byterev d1" 02c1
d "ff1 d2" 04c2
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "halt" 4ac8
d "strldsr.w 0x4d2" 40e746fc04d2
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "move usp, a0" 4e68
d "move a0, usp" 4e60
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "intouch (a0)" f428
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

90
test/db/asm/m68k_cfv2_32 Normal file
View file

@ -0,0 +1,90 @@
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "divs.l d0, d2" 4c402802
d "divu.l d0, d1:d2" 4c402401
d "divs.l d0, d1:d2" 4c402c01
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "remu.l d0, d1:d2" 4c402001
d "rems.l d0, d1:d2" 4c402801
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "halt" 4ac8
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

90
test/db/asm/m68k_cfv3_32 Normal file
View file

@ -0,0 +1,90 @@
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "divs.l d0, d2" 4c402802
d "divu.l d0, d1:d2" 4c402401
d "divs.l d0, d1:d2" 4c402c01
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "remu.l d0, d1:d2" 4c402001
d "rems.l d0, d1:d2" 4c402801
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "halt" 4ac8
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

108
test/db/asm/m68k_cfv4_32 Normal file
View file

@ -0,0 +1,108 @@
d "mov3q.l 0x2, (a4)" a554
d "mvs.b d0, d0" 7100
d "mvs.w d0, d0" 7140
d "mvz.b d0, d0" 7180
d "mvz.w d0, d0" 71c0
d "mvs.b d0, d1" 7300
d "mov3q.l 0xffffffff, d0" a140
d "mvs.b (a0), d1" 7310
d "mvz.w (a0), d1" 73d0
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "bra.l 0x12" 60ff00000010
d "bsr.l 0x12" 61ff00000010
d "bne.l 0x12" 66ff00000010
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "sats.l d0" 4c80
d "divs.l d0, d2" 4c402802
d "divu.l d0, d1:d2" 4c402401
d "divs.l d0, d1:d2" 4c402c01
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "remu.l d0, d1:d2" 4c402001
d "rems.l d0, d1:d2" 4c402801
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bitrev d0" 00c0
d "byterev d1" 02c1
d "ff1 d2" 04c2
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "halt" 4ac8
d "strldsr.w 0x4d2" 40e746fc04d2
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "intouch (a0)" f428
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

214
test/db/asm/m68k_cfv4e_32 Normal file
View file

@ -0,0 +1,214 @@
d "mov3q.l 0x2, (a4)" a554
d "mvs.b d0, d0" 7100
d "mvs.w d0, d0" 7140
d "mvz.b d0, d0" 7180
d "mvz.w d0, d0" 71c0
d "mvs.b d0, d1" 7300
d "fsmove fp1, fp2" f2000540
d "fdmove fp1, fp2" f2000544
d "mov3q.l 0xffffffff, d0" a140
d "mvs.b (a0), d1" 7310
d "mvz.w (a0), d1" 73d0
d "move.l d0, acc0" a100
d "move.l acc0, d0" a180
d "move.l 0x12345678, acc0" a13c12345678
d "move.l d0, macsr" a900
d "move.l macsr, d0" a980
d "move.l 0x7, macsr" a93c00000007
d "move.l d0, mask" ad00
d "move.l mask, d0" ad80
d "move.l 0x7, mask" ad3c00000007
d "movclr.l acc0, d0" a1c0
d "move.l d0, accext01" ab00
d "move.l accext01, d0" ab80
d "move.l 0x7, accext01" ab3c00000007
d "move.l d0, accext23" af00
d "fmove.l d0, fp0" f2004000
d "fmove.l fp0, d0" f2006000
d "fmove.s 1.000000, fp1" f23c44803f800000
d "fmove.d 3.141593, fp1" f23c5480400921fb54442d18
d "fmove.w (a0), fp0" f2105000
d "fmove.s fp0, (a0)" f2106400
d "fmovecr 0xf, fp6" f2005f0f
d "fmove.l d0, fpcr" f2009000
d "fmove.l fpcr, d0" f200b000
d "fmove.l d0, fpsr" f2008800
d "fmove.l fpiar, d0" f200a400
d "fmovem (a0), fp0-fp1" f210c003
d "fmovem fp0-fp1, (a0)" f210e003
d "fmovem (a0)+, fp6-fp7" f218d003
d "fmovem fp0-fp1, -(a0)" f220e003
d "fmovem (a0), d1" f210c810
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "bra.l 0x12" 60ff00000010
d "bsr.l 0x12" 61ff00000010
d "bne.l 0x12" 66ff00000010
d "fnop" f2800000
d "fbf.w 0x12" f2800010
d "fbf.l 0x12" f2c000000010
d "fdbf d0, 0x14" f24800000010
d "fsf.b (a0)" f2500000
d "ftrapf" f27c0000
d "ftrapf.w 0x1234" f27a00001234
d "ftrapf.w 0x12345678" f27b000012345678
d "ftst fp1, fp2" f200053a
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "sats.l d0" 4c80
d "mac.w d1l, d0l, acc0" a0010000
d "mac.w d1l, d0u, <<, acc0" a0010280
d "mac.l d2, d3, acc0" a6020800
d "mac.w a1l, a2u, (a3), d1, acc0" a293a089
d "mac.w a1l, a2u, (a3)&, d1, acc0" a293a0a9
d "mac.w a1l, a2u, <<, (a3), d1, acc0" a293a289
d "divs.l d0, d2" 4c402802
d "mac.l d2, d3, acc1" a6820800
d "divu.l d0, d1:d2" 4c402401
d "divs.l d0, d1:d2" 4c402c01
d "msac.w d1l, d0l, acc0" a0010100
d "msac.l d2, d3, acc0" a6020900
d "mac.w d2l, d0l, >>, acc0" a0020600
d "msac.w a1l, a2u, <<, (a3), d1, acc0" a293a389
d "mac.w a1l, a2u, >>, (a3), d1, acc0" a293a489
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "remu.l d0, d1:d2" 4c402001
d "rems.l d0, d1:d2" 4c402801
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "fsub fp2, fp4" f2000a28
d "fsadd fp1, fp2" f2000562
d "fdadd fp1, fp2" f2000566
d "fssub fp1, fp2" f2000568
d "fdsub fp1, fp2" f200056c
d "fsmul fp1, fp2" f2000563
d "fdmul fp1, fp2" f2000567
d "fsdiv fp1, fp2" f2000560
d "fddiv fp1, fp2" f2000564
d "fsneg fp1, fp2" f200055a
d "fdneg fp1, fp2" f200055e
d "fsabs fp1, fp2" f2000558
d "fdabs fp1, fp2" f200055c
d "fssqrt fp1, fp2" f2000541
d "fdsqrt fp1, fp2" f2000545
d "fint fp1, fp2" f2000501
d "fsinh fp1, fp2" f2000502
d "fintrz fp1, fp2" f2000503
d "fsqrt fp1, fp2" f2000504
d "flognp1 fp1, fp2" f2000506
d "fetoxm1 fp1, fp2" f2000508
d "fatanh fp1, fp2" f2000509
d "fatan fp1, fp2" f200050a
d "fasin fp1, fp2" f200050c
d "fsin fp1, fp2" f200050e
d "ftan fp1, fp2" f200050f
d "fetox fp1, fp2" f2000510
d "ftwotox fp1, fp2" f2000511
d "ftentox fp1, fp2" f2000512
d "flogn fp1, fp2" f2000514
d "flog10 fp1, fp2" f2000515
d "flog2 fp1, fp2" f2000516
d "fcosh fp1, fp2" f2000519
d "facos fp1, fp2" f200051c
d "fcos fp1, fp2" f200051d
d "fgetexp fp1, fp2" f200051e
d "fgetman fp1, fp2" f200051f
d "fdiv fp1, fp2" f2000520
d "fmod fp1, fp2" f2000521
d "fadd fp1, fp2" f2000522
d "fmul fp1, fp2" f2000523
d "fsgldiv fp1, fp2" f2000524
d "frem fp1, fp2" f2000525
d "fscale fp1, fp2" f2000526
d "fsglmul fp1, fp2" f2000527
d "fcmp fp1, fp2" f2000538
d "fabs fp1, fp2" f2000518
d "fneg fp1, fp2" f200051a
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bitrev d0" 00c0
d "byterev d1" 02c1
d "ff1 d2" 04c2
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "move.l macsr, ccr" a9c0
d "halt" 4ac8
d "strldsr.w 0x4d2" 40e746fc04d2
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "move usp, a0" 4e68
d "move a0, usp" 4e60
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "fsave (a0)" f310
d "frestore (a0)" f350
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "intouch (a0)" f428
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

137
test/db/asm/m68k_cfv5_32 Normal file
View file

@ -0,0 +1,137 @@
d "mov3q.l 0x2, (a4)" a554
d "mvs.b d0, d0" 7100
d "mvs.w d0, d0" 7140
d "mvz.b d0, d0" 7180
d "mvz.w d0, d0" 71c0
d "mvs.b d0, d1" 7300
d "mov3q.l 0xffffffff, d0" a140
d "mvs.b (a0), d1" 7310
d "mvz.w (a0), d1" 73d0
d "move.l d0, acc0" a100
d "move.l acc0, d0" a180
d "move.l 0x12345678, acc0" a13c12345678
d "move.l d0, macsr" a900
d "move.l macsr, d0" a980
d "move.l 0x7, macsr" a93c00000007
d "move.l d0, mask" ad00
d "move.l mask, d0" ad80
d "move.l 0x7, mask" ad3c00000007
d "movclr.l acc0, d0" a1c0
d "move.l d0, accext01" ab00
d "move.l accext01, d0" ab80
d "move.l 0x7, accext01" ab3c00000007
d "move.l d0, accext23" af00
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "bra.l 0x12" 60ff00000010
d "bsr.l 0x12" 61ff00000010
d "bne.l 0x12" 66ff00000010
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "sats.l d0" 4c80
d "mac.w d1l, d0l, acc0" a0010000
d "mac.w d1l, d0u, <<, acc0" a0010280
d "mac.l d2, d3, acc0" a6020800
d "mac.w a1l, a2u, (a3), d1, acc0" a293a089
d "mac.w a1l, a2u, (a3)&, d1, acc0" a293a0a9
d "mac.w a1l, a2u, <<, (a3), d1, acc0" a293a289
d "divs.l d0, d2" 4c402802
d "mac.l d2, d3, acc1" a6820800
d "divu.l d0, d1:d2" 4c402401
d "divs.l d0, d1:d2" 4c402c01
d "msac.w d1l, d0l, acc0" a0010100
d "msac.l d2, d3, acc0" a6020900
d "mac.w d2l, d0l, >>, acc0" a0020600
d "msac.w a1l, a2u, <<, (a3), d1, acc0" a293a389
d "mac.w a1l, a2u, >>, (a3), d1, acc0" a293a489
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "remu.l d0, d1:d2" 4c402001
d "rems.l d0, d1:d2" 4c402801
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bitrev d0" 00c0
d "byterev d1" 02c1
d "ff1 d2" 04c2
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "move.l macsr, ccr" a9c0
d "halt" 4ac8
d "strldsr.w 0x4d2" 40e746fc04d2
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "move usp, a0" 4e68
d "move a0, usp" 4e60
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "intouch (a0)" f428
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

View file

@ -0,0 +1,214 @@
d "mov3q.l 0x2, (a4)" a554
d "mvs.b d0, d0" 7100
d "mvs.w d0, d0" 7140
d "mvz.b d0, d0" 7180
d "mvz.w d0, d0" 71c0
d "mvs.b d0, d1" 7300
d "fsmove fp1, fp2" f2000540
d "fdmove fp1, fp2" f2000544
d "mov3q.l 0xffffffff, d0" a140
d "mvs.b (a0), d1" 7310
d "mvz.w (a0), d1" 73d0
d "move.l d0, acc0" a100
d "move.l acc0, d0" a180
d "move.l 0x12345678, acc0" a13c12345678
d "move.l d0, macsr" a900
d "move.l macsr, d0" a980
d "move.l 0x7, macsr" a93c00000007
d "move.l d0, mask" ad00
d "move.l mask, d0" ad80
d "move.l 0x7, mask" ad3c00000007
d "movclr.l acc0, d0" a1c0
d "move.l d0, accext01" ab00
d "move.l accext01, d0" ab80
d "move.l 0x7, accext01" ab3c00000007
d "move.l d0, accext23" af00
d "fmove.l d0, fp0" f2004000
d "fmove.l fp0, d0" f2006000
d "fmove.s 1.000000, fp1" f23c44803f800000
d "fmove.d 3.141593, fp1" f23c5480400921fb54442d18
d "fmove.w (a0), fp0" f2105000
d "fmove.s fp0, (a0)" f2106400
d "fmovecr 0xf, fp6" f2005f0f
d "fmove.l d0, fpcr" f2009000
d "fmove.l fpcr, d0" f200b000
d "fmove.l d0, fpsr" f2008800
d "fmove.l fpiar, d0" f200a400
d "fmovem (a0), fp0-fp1" f210c003
d "fmovem fp0-fp1, (a0)" f210e003
d "fmovem (a0)+, fp6-fp7" f218d003
d "fmovem fp0-fp1, -(a0)" f220e003
d "fmovem (a0), d1" f210c810
d "move.l d0, d0" 2000
d "movea.l d0, a0" 2040
d "moveq 0x1, d0" 7001
d "movem.l d0-d1, (a0)" 48d00003
d "lea.l (a0), a0" 41d0
d "link.w a0, 0x4" 4e500004
d "pea.l (a0)" 4850
d "unlk a0" 4e58
d "tpf" 51fc
d "tpf.w 0x1234" 51fa1234
d "tpf.l 0x12345678" 51fb12345678
d "bra.l 0x12" 60ff00000010
d "bsr.l 0x12" 61ff00000010
d "bne.l 0x12" 66ff00000010
d "fnop" f2800000
d "fbf.w 0x12" f2800010
d "fbf.l 0x12" f2c000000010
d "fdbf d0, 0x14" f24800000010
d "fsf.b (a0)" f2500000
d "ftrapf" f27c0000
d "ftrapf.w 0x1234" f27a00001234
d "ftrapf.w 0x12345678" f27b000012345678
d "ftst fp1, fp2" f200053a
d "st.b d0" 50c0
d "jmp (a0)" 4ed0
d "jsr (a0)" 4e90
d "nop" 4e71
d "rts" 4e75
d "tas.b d0" 4ac0
d "tst.l d0" 4a80
d "sats.l d0" 4c80
d "mac.w d1l, d0l, acc0" a0010000
d "mac.w d1l, d0u, <<, acc0" a0010280
d "mac.l d2, d3, acc0" a6020800
d "mac.w a1l, a2u, (a3), d1, acc0" a293a089
d "mac.w a1l, a2u, (a3)&, d1, acc0" a293a0a9
d "mac.w a1l, a2u, <<, (a3), d1, acc0" a293a289
d "divs.l d0, d2" 4c402802
d "mac.l d2, d3, acc1" a6820800
d "divu.l d0, d1:d2" 4c402401
d "divs.l d0, d1:d2" 4c402c01
d "msac.w d1l, d0l, acc0" a0010100
d "msac.l d2, d3, acc0" a6020900
d "mac.w d2l, d0l, >>, acc0" a0020600
d "msac.w a1l, a2u, <<, (a3), d1, acc0" a293a389
d "mac.w a1l, a2u, >>, (a3), d1, acc0" a293a489
d "add.l d0, d0" d080
d "adda.l d0, a0" d1c0
d "addi.l 0x1, d0" 068000000001
d "addq.l 0x1, d0" 5280
d "addx.l d0, d0" d180
d "clr.l d0" 4280
d "cmp.l d0, d0" b080
d "cmpa.l d0, a0" b1c0
d "cmpi.l 0x1, d0" 0c8000000001
d "ext.l d0" 48c0
d "extb.l d0" 49c0
d "muls.w d0, d0" c1c0
d "mulu.w d0, d0" c0c0
d "neg.l d0" 4480
d "negx.l d0" 4080
d "remu.l d0, d1:d2" 4c402001
d "rems.l d0, d1:d2" 4c402801
d "sub.l d0, d0" 9080
d "suba.l d0, a0" 91c0
d "subi.l 0x1, d0" 048000000001
d "subq.l 0x1, d0" 5380
d "subx.l d0, d0" 9180
d "fsub fp2, fp4" f2000a28
d "fsadd fp1, fp2" f2000562
d "fdadd fp1, fp2" f2000566
d "fssub fp1, fp2" f2000568
d "fdsub fp1, fp2" f200056c
d "fsmul fp1, fp2" f2000563
d "fdmul fp1, fp2" f2000567
d "fsdiv fp1, fp2" f2000560
d "fddiv fp1, fp2" f2000564
d "fsneg fp1, fp2" f200055a
d "fdneg fp1, fp2" f200055e
d "fsabs fp1, fp2" f2000558
d "fdabs fp1, fp2" f200055c
d "fssqrt fp1, fp2" f2000541
d "fdsqrt fp1, fp2" f2000545
d "fint fp1, fp2" f2000501
d "fsinh fp1, fp2" f2000502
d "fintrz fp1, fp2" f2000503
d "fsqrt fp1, fp2" f2000504
d "flognp1 fp1, fp2" f2000506
d "fetoxm1 fp1, fp2" f2000508
d "fatanh fp1, fp2" f2000509
d "fatan fp1, fp2" f200050a
d "fasin fp1, fp2" f200050c
d "fsin fp1, fp2" f200050e
d "ftan fp1, fp2" f200050f
d "fetox fp1, fp2" f2000510
d "ftwotox fp1, fp2" f2000511
d "ftentox fp1, fp2" f2000512
d "flogn fp1, fp2" f2000514
d "flog10 fp1, fp2" f2000515
d "flog2 fp1, fp2" f2000516
d "fcosh fp1, fp2" f2000519
d "facos fp1, fp2" f200051c
d "fcos fp1, fp2" f200051d
d "fgetexp fp1, fp2" f200051e
d "fgetman fp1, fp2" f200051f
d "fdiv fp1, fp2" f2000520
d "fmod fp1, fp2" f2000521
d "fadd fp1, fp2" f2000522
d "fmul fp1, fp2" f2000523
d "fsgldiv fp1, fp2" f2000524
d "frem fp1, fp2" f2000525
d "fscale fp1, fp2" f2000526
d "fsglmul fp1, fp2" f2000527
d "fcmp fp1, fp2" f2000538
d "fabs fp1, fp2" f2000518
d "fneg fp1, fp2" f200051a
d "and.l d0, d0" c080
d "andi.l 0x1, d0" 028000000001
d "eor.l d0, d0" b180
d "eori.l 0x1, d0" 0a8000000001
d "not.l d0" 4680
d "or.l d0, d0" 8080
d "ori.l 0x1, d0" 008000000001
d "asl.l 0x8, d0" e180
d "asr.l 0x8, d0" e080
d "lsl.l 0x8, d0" e188
d "lsr.l 0x8, d0" e088
d "swap d0" 4840
d "bitrev d0" 00c0
d "byterev d1" 02c1
d "ff1 d2" 04c2
d "bchg.b d0, d0" 0140
d "bclr.b d0, d0" 0180
d "bset.b d0, d0" 01c0
d "btst.b d0, d0" 0100
d "move.l macsr, ccr" a9c0
d "halt" 4ac8
d "strldsr.w 0x4d2" 40e746fc04d2
d "wddata.b (a0)" fb10
d "wdebug.l (a0)" fbd00003
d "move.w ccr, d3" 42c3
d "move usp, a0" 4e68
d "move a0, usp" 4e60
d "pulse" 4acc
d "movec d0, cacr" 4e7b0002
d "movec cacr, d1" 4e7a1002
d "wddata.w (a0)" fb50
d "wddata.l (a0)" fb90
d "fsave (a0)" f310
d "frestore (a0)" f350
d "move.w d0, ccr" 44c0
d "move.w sr, d0" 40c0
d "move.w d0, sr" 46c0
d "illegal 0x4afc" 4afc
d "rte" 4e73
d "stop 0x2700" 4e722700
d "trap 0x0" 4e40
d "intouch (a0)" f428
d "cpushl bc, (a0)" f4e8
d "cp0bcbusy 0x52" fcc00050
d "cp0ld.l d0, d2, 0x1, 0x123" fc802123
d "cp0ld.w (a0), a2, 0x3, 0x1" fc50a401
d "cp0ld.b (a0)+, a2, 0x6, 0x1" fc18aa01
d "cp0ld.l 0x10(a0), a2, 0x8, 0x1" fca8ae010010
d "cp0st.l d2, d0, 0x1, 0x123" fd802123
d "cp0st.w a2, (a0), 0x3, 0x1" fd50a401
d "cp0nop 0x8" fc000e00
d "cp0nop 0x3" fc800400
d "cp0ld.l d0, d1, 0x3, 0x0" fc801400
d "cp1bcbusy 0x52" fec00050
d "cp1ld.l d0, d2, 0x1, 0x123" fe802123
d "cp1st.l d2, d0, 0x1, 0x123" ff802123
d "cp1nop 0x8" fe000e00

View file

@ -165,6 +165,13 @@ HCS12X Freescale HCS12X: 16-bit microcontroller (upwards compatible wit
68040 Motorola 68040: High-performance 32-bit microprocessor with integrated FPU
68060 Motorola 68060: 32-bit microprocessor, highest performer in m68k series
cpu32 Motorola CPU32: 32-bit embedded-controller CPU core based on the 68020
coldfire Motorola ColdFire: 32-bit embedded-controller family based on the 68000 ISA
cfv1 Motorola ColdFire V1 core
cfv2 Motorola ColdFire V2 core
cfv3 Motorola ColdFire V3 core
cfv4 Motorola ColdFire V4 core
cfv4e Motorola ColdFire V4e core with enhanced MAC and FPU features
cfv5 Motorola ColdFire V5 core
baseline Baseline 12-bit instruction set microcontrollers: PIC10Fxxx, PIC12Fxxx, and PIC16Fxxx
midrange Mid-Range 14-bit instruction set microcontrollers: PIC10Fxxx, PIC12Fxxx, and PIC16Fxxx
highend High-End 16-bit instruction set microcontrollers: PIC18Fxxxx, PIC18FxxJxx, and PIC18FxxKxx
@ -181,4 +188,3 @@ c64x Texas Instruments TMS320C64x DSP family
tricore Generic TriCore CPU family by Infineon
EOF
RUN

View file

@ -1164,6 +1164,18 @@ dtt1 = 0x00000000
mmusr = 0x00000000
urp = 0x00000000
srp = 0x00000000
tt0 = 0x00000000
tt1 = 0x00000000
crp = 0x00000000
acc = 0x00000000
acc0 = 0x00000000
acc1 = 0x00000000
acc2 = 0x00000000
acc3 = 0x00000000
accext01 = 0x00000000
accext23 = 0x00000000
macsr = 0x00000000
mask = 0x00000000
ccr = 0x00
EOF
RUN

View file

@ -617,6 +617,13 @@ EXPECT=<<EOF
68040 Motorola 68040: High-performance 32-bit microprocessor with integrated FPU
68060 Motorola 68060: 32-bit microprocessor, highest performer in m68k series
cpu32 Motorola CPU32: 32-bit embedded-controller CPU core based on the 68020
coldfire Motorola ColdFire: 32-bit embedded-controller family based on the 68000 ISA
cfv1 Motorola ColdFire V1 core
cfv2 Motorola ColdFire V2 core
cfv3 Motorola ColdFire V3 core
cfv4 Motorola ColdFire V4 core
cfv4e Motorola ColdFire V4e core with enhanced MAC and FPU features
cfv5 Motorola ColdFire V5 core
EOF
RUN