2010-03-19 00:51:16 +01:00
|
|
|
/* radare - LGPL - Copyright 2010 pancake <@nopcode.org> */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <r_types.h>
|
|
|
|
#include <r_util.h>
|
|
|
|
#include <r_lib.h>
|
|
|
|
#include <r_asm.h>
|
|
|
|
|
|
|
|
#include "../arch/avr/disasm.c"
|
|
|
|
|
2011-02-24 16:50:29 +01:00
|
|
|
static int disassemble(RAsm *a, RAsmOp *op, ut8 *buf, ut64 len) {
|
|
|
|
return op->inst_len = avrdis (op->buf_asm, a->pc, buf, len);
|
2010-03-19 00:51:16 +01:00
|
|
|
}
|
|
|
|
|
2010-05-26 01:42:22 +02:00
|
|
|
RAsmPlugin r_asm_plugin_avr = {
|
2010-03-19 00:51:16 +01:00
|
|
|
.name = "avr",
|
|
|
|
.arch = "avr",
|
|
|
|
.bits = (int[]){ 16, 32, 0 },
|
|
|
|
.desc = "AVR Atmel disassembler",
|
|
|
|
.init = NULL,
|
|
|
|
.fini = NULL,
|
|
|
|
.disassemble = &disassemble,
|
|
|
|
.assemble = NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef CORELIB
|
|
|
|
struct r_lib_struct_t radare_plugin = {
|
|
|
|
.type = R_LIB_TYPE_ASM,
|
|
|
|
.data = &r_asm_plugin_avr
|
|
|
|
};
|
|
|
|
#endif
|