Rizin
unix-like reverse engineering framework and cli tools
asm_z80.c File Reference
#include <rz_types.h>
#include <rz_util.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include "../arch/z80/z80.c"
#include "../arch/z80/z80asm.c"

Go to the source code of this file.

Functions

static int do_disassemble (RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
 
static int do_assemble (RzAsm *a, RzAsmOp *op, const char *buf)
 

Variables

RzAsmPlugin rz_asm_plugin_z80
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ do_assemble()

static int do_assemble ( RzAsm a,
RzAsmOp op,
const char *  buf 
)
static

Definition at line 16 of file asm_z80.c.

16  {
17  return op->size = z80asm((ut8 *)rz_strbuf_get(&op->buf), buf);
18 }
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
Definition: strbuf.c:321
Definition: dis.c:32
RZ_API_I int z80asm(unsigned char *outbuf, const char *s)
Definition: z80asm.c:1526

References rz_strbuf_get(), and z80asm().

◆ do_disassemble()

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

Definition at line 12 of file asm_z80.c.

12  {
13  return op->size = z80Disass(op, buf, len);
14 }
size_t len
Definition: 6502dis.c:15
static FUNC_ATTR_USED int z80Disass(RzAsmOp *op, const ut8 *buf, int len)
Definition: z80.c:71

References len, and z80Disass().

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_z80
Definition: asm_z80.c:20
@ 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 33 of file asm_z80.c.

◆ rz_asm_plugin_z80

RzAsmPlugin rz_asm_plugin_z80
Initial value:
= {
.name = "z80",
.desc = "Zilog Z80",
.license = "GPL3",
.author = "condret",
.arch = "z80",
.bits = 8,
.endian = RZ_SYS_ENDIAN_NONE,
.disassemble = &do_disassemble,
.assemble = &do_assemble,
}
static int do_assemble(RzAsm *a, RzAsmOp *op, const char *buf)
Definition: asm_z80.c:16
static int do_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_z80.c:12
#define RZ_SYS_ENDIAN_NONE
Definition: rz_types.h:525

Definition at line 20 of file asm_z80.c.