Rizin
unix-like reverse engineering framework and cli tools
asm_8051.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <rz_types.h>
#include <rz_util.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <8051_ass.h>
#include "../arch/8051/8051_disas.c"

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_8051
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ disassemble()

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

Definition at line 16 of file asm_8051.c.

16  {
17  int dlen = 0;
18  char *s = rz_8051_disas(a->pc, buf, len, &dlen);
19  if (dlen < 0) {
20  dlen = 0;
21  }
22  if (s) {
23  rz_strbuf_set(&op->buf_asm, s);
24  free(s);
25  }
26  op->size = dlen;
27  return dlen;
28 }
size_t len
Definition: 6502dis.c:15
static char * rz_8051_disas(ut64 pc, const ut8 *buf, int len, int *olen)
Definition: 8051_disas.c:69
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void * buf
Definition: ioapi.h:138
static RzSocket * s
Definition: rtr.c:28
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
Definition: strbuf.c:153
#define a(i)
Definition: sha256.c:41
Definition: dis.c:32

References a, free(), len, rz_8051_disas(), rz_strbuf_set(), and s.

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_8051
Definition: asm_8051.c:30
@ 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 45 of file asm_8051.c.

◆ rz_asm_plugin_8051

RzAsmPlugin rz_asm_plugin_8051
Initial value:
= {
.name = "8051",
.arch = "8051",
.bits = 8,
.endian = RZ_SYS_ENDIAN_NONE,
.desc = "8051 Intel CPU",
.disassemble = &disassemble,
.assemble = &assemble_8051,
.license = "PD",
.cpus =
"8051-generic,"
"8051-shared-code-xdata"
}
int assemble_8051(RzAsm *a, RzAsmOp *op, char const *user_asm)
Definition: 8051_ass.c:1183
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_8051.c:16
#define RZ_SYS_ENDIAN_NONE
Definition: rz_types.h:525

Definition at line 30 of file asm_8051.c.