radare2/libr/asm/p/asm_psosvm.c
pancake 535a2aa713 * r_asm_disassemble use _CONST_ut8* buffer now
* Split core/cmd.c into disasm.c and core/visual.c into vmenus.c
* Fix some warnings reported by valgrind
* Chop instructions disassembled by udis86
* Fix visual prompt display in debugger mode
* Added 'pdi' and 'pdf' commands
  - Used to print just instructions or lengths
  - Documented via 'pd?'
* Added initial work on a test suite for r2
  - Spot a crash!
2011-06-04 03:14:04 +02:00

38 lines
865 B
C

/* radare - LGPL - Copyright 2009-2010 nibble<.ds@gmail.com> */
#include <r_types.h>
#include <r_util.h>
#include <r_lib.h>
#include <r_asm.h>
#include <psosvm/vmas/vmas.h>
static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) {
psosvmasm_init();
op->inst_len = psosvm_disasm(buf, op->buf_asm);
return op->inst_len;
}
static int assemble(struct r_asm_t *a, struct r_asm_op_t *op, const char *buf) {
op->inst_len = psosvm_assemble(op->buf, buf);
return op->inst_len;
}
RAsmPlugin r_asm_plugin_psosvm = {
.name = "psosvm",
.desc = "PSOS-VM disassembly plugin",
.arch = "psosvm",
.bits = (int[]){ 8, 16, 0 },
.init = NULL,
.fini = NULL,
.disassemble = &disassemble,
.assemble = &assemble
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_psosvm
};
#endif