2018-08-19 03:24:10 +02:00
|
|
|
/* radare - LGPL - Copyright 2012-2018 - pancake */
|
2012-02-02 01:06:22 +01:00
|
|
|
|
|
|
|
#include <r_types.h>
|
|
|
|
#include <r_util.h>
|
|
|
|
#include <r_lib.h>
|
|
|
|
#include <r_asm.h>
|
|
|
|
|
2012-02-04 03:51:22 +01:00
|
|
|
#include "../arch/z80/z80.c"
|
2016-10-24 13:21:36 +01:00
|
|
|
#include "../arch/z80/z80asm.c"
|
2016-10-08 01:35:27 +02:00
|
|
|
|
|
|
|
static int do_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
|
|
|
return op->size = z80Disass (op, buf, len);
|
|
|
|
}
|
|
|
|
|
2016-10-24 13:21:36 +01:00
|
|
|
static int do_assemble(RAsm *a, RAsmOp *op, const char *buf) {
|
2018-08-19 03:24:10 +02:00
|
|
|
return op->size = z80asm ((ut8*)r_strbuf_get (&op->buf), buf);
|
2012-02-02 01:06:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
RAsmPlugin r_asm_plugin_z80 = {
|
|
|
|
.name = "z80",
|
2014-02-25 17:03:12 +01:00
|
|
|
.desc = "Zilog Z80",
|
2016-10-08 01:35:27 +02:00
|
|
|
.license = "GPL",
|
2018-08-19 03:24:10 +02:00
|
|
|
.author = "condret",
|
2012-02-02 01:06:22 +01:00
|
|
|
.arch = "z80",
|
2013-12-05 18:41:13 +01:00
|
|
|
.bits = 8,
|
2016-04-26 19:09:15 +10:00
|
|
|
.endian = R_SYS_ENDIAN_NONE,
|
|
|
|
.disassemble = &do_disassemble,
|
|
|
|
.assemble = &do_assemble,
|
2012-02-02 01:06:22 +01: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 = {
|
2012-02-02 01:06:22 +01:00
|
|
|
.type = R_LIB_TYPE_ASM,
|
2015-07-12 16:04:10 +02:00
|
|
|
.data = &r_asm_plugin_z80,
|
|
|
|
.version = R2_VERSION
|
2012-02-02 01:06:22 +01:00
|
|
|
};
|
2016-11-09 16:35:47 +00:00
|
|
|
#endif
|