Rizin
unix-like reverse engineering framework and cli tools
asm_gb.c File Reference
#include <rz_types.h>
#include <rz_util.h>
#include <rz_asm.h>
#include <rz_lib.h>
#include "../arch/gb/gbdis.c"
#include "../arch/gb/gbasm.c"

Go to the source code of this file.

Functions

static int disassemble (RzAsm *a, RzAsmOp *rz_op, const ut8 *buf, int len)
 
static int assemble (RzAsm *a, RzAsmOp *rz_op, const char *buf)
 

Variables

RzAsmPlugin rz_asm_plugin_gb
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ assemble()

static int assemble ( RzAsm a,
RzAsmOp rz_op,
const char *  buf 
)
static

Definition at line 19 of file asm_gb.c.

19  {
20  return gbAsm(a, rz_op, buf);
21 }
static int gbAsm(RzAsm *a, RzAsmOp *op, const char *buf)
Definition: gbasm.c:206
voidpf void * buf
Definition: ioapi.h:138
#define a(i)
Definition: sha256.c:41

References a, and gbAsm().

◆ disassemble()

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

Definition at line 14 of file asm_gb.c.

14  {
15  int dlen = gbDisass(rz_op, buf, len);
16  return rz_op->size = RZ_MAX(0, dlen);
17 }
size_t len
Definition: 6502dis.c:15
#define RZ_MAX(x, y)
int size
Definition: rz_asm.h:67

References len, RZ_MAX, and rz_asm_op_t::size.

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
.data = &rz_asm_plugin_gb,
}
RzAsmPlugin rz_asm_plugin_gb
Definition: asm_gb.c:23
@ 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 36 of file asm_gb.c.

◆ rz_asm_plugin_gb

RzAsmPlugin rz_asm_plugin_gb
Initial value:
= {
.name = "gb",
.desc = "GameBoy(TM) (z80-like)",
.arch = "z80",
.author = "condret",
.license = "LGPL3",
.bits = 16,
.disassemble = &disassemble,
.assemble = &assemble,
}
static int assemble(RzAsm *a, RzAsmOp *rz_op, const char *buf)
Definition: asm_gb.c:19
static int disassemble(RzAsm *a, RzAsmOp *rz_op, const ut8 *buf, int len)
Definition: asm_gb.c:14
#define RZ_SYS_ENDIAN_LITTLE
Definition: rz_types.h:526

Definition at line 23 of file asm_gb.c.