2018-08-19 03:24:10 +02:00
|
|
|
/* radare - LGPL - Copyright 2014-2018 - fedor.sakharov */
|
|
|
|
|
2014-02-21 21:00:28 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <r_types.h>
|
|
|
|
#include <r_lib.h>
|
|
|
|
#include <r_asm.h>
|
|
|
|
#include <h8300_disas.h>
|
|
|
|
|
2018-08-19 03:24:10 +02:00
|
|
|
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
2014-02-21 21:00:28 +04:00
|
|
|
struct h8300_cmd cmd;
|
2018-08-19 03:24:10 +02:00
|
|
|
int ret = h8300_decode_command(buf, &cmd);
|
|
|
|
r_strbuf_set (&op->buf_asm, sdb_fmt ("%s %s", cmd.instr, cmd.operands));
|
|
|
|
return op->size = ret;
|
2014-02-21 21:00:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
RAsmPlugin r_asm_plugin_h8300 = {
|
|
|
|
.name = "h8300",
|
|
|
|
.license = "LGPL3",
|
|
|
|
.desc = "H8/300 disassembly plugin",
|
|
|
|
.arch = "h8300",
|
|
|
|
.bits = 16,
|
2016-04-26 19:09:15 +10:00
|
|
|
.endian = R_SYS_ENDIAN_BIG,
|
|
|
|
.disassemble = &disassemble
|
2014-02-21 21:00:28 +04:00
|
|
|
};
|
|
|
|
|
2019-06-13 19:12:51 +02:00
|
|
|
#ifndef R2_PLUGIN_INCORE
|
2018-09-15 23:52:12 +03:00
|
|
|
R_API RLibStruct radare_plugin = {
|
2014-02-21 21:00:28 +04:00
|
|
|
.type = R_LIB_TYPE_ASM,
|
2015-07-12 16:04:10 +02:00
|
|
|
.data = &r_asm_plugin_h8300,
|
|
|
|
.version = R2_VERSION
|
2014-02-21 21:00:28 +04:00
|
|
|
};
|
|
|
|
#endif
|