Rizin
unix-like reverse engineering framework and cli tools
asm_v850.c File Reference
#include <stdio.h>
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <v850_disas.h>

Go to the source code of this file.

Functions

static int disassemble (RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
 

Variables

RzAsmPlugin rz_asm_plugin_v850
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ disassemble()

static int disassemble ( RzAsm a,
RzAsmOp op,
const ut8 buf,
int  len 
)
static

Definition at line 12 of file asm_v850.c.

12  {
13  struct v850_cmd cmd = {
14  .addr = a->pc,
15  .instr = "",
16  .operands = ""
17  };
18  if (len < 2) {
19  return -1;
20  }
21  int ret = v850_decode_command(buf, len, &cmd);
22  if (ret > 0) {
23  rz_asm_op_set_asm(op, sdb_fmt("%s %s", cmd.instr, cmd.operands));
24  }
25  return op->size = ret;
26 }
size_t len
Definition: 6502dis.c:15
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
Definition: aop.c:53
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
Definition: sflib.h:79
RZ_API char * sdb_fmt(const char *fmt,...)
Definition: fmt.c:26
voidpf void * buf
Definition: ioapi.h:138
#define a(i)
Definition: sha256.c:41
Definition: dis.c:32
int v850_decode_command(const ut8 *instr, int len, struct v850_cmd *cmd)
Definition: v850_disas.c:301

References a, cmd, len, rz_asm_op_set_asm(), sdb_fmt(), and v850_decode_command().

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_v850
Definition: asm_v850.c:28
@ RZ_LIB_TYPE_ASM
Definition: rz_lib.h:72
#define RZ_VERSION
Definition: rz_version.h:8
const char * version
Definition: rz_asm.h:133

Definition at line 39 of file asm_v850.c.

◆ rz_asm_plugin_v850

RzAsmPlugin rz_asm_plugin_v850
Initial value:
= {
.name = "v850",
.license = "LGPL3",
.desc = "v850 disassembly plugin",
.arch = "v850",
.bits = 32,
.disassemble = &disassemble
}
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_v850.c:12
#define RZ_SYS_ENDIAN_LITTLE
Definition: rz_types.h:526

Definition at line 28 of file asm_v850.c.