Rizin
unix-like reverse engineering framework and cli tools
asm_i8080.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2012-2018 Alexander <alexander@demin.ws>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <rz_types.h>
5 #include <rz_util.h>
6 #include <rz_lib.h>
7 #include <rz_asm.h>
8 #include "../arch/i8080/i8080dis.c"
9 
10 static int do_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len) {
11  int dlen = i8080_disasm(buf, rz_strbuf_get(&op->buf_asm), len);
12  return op->size = RZ_MAX(0, dlen);
13 }
14 
16  .name = "i8080",
17  .desc = "Intel 8080 CPU",
18  .arch = "i8080",
19  .license = "BSD",
20  .bits = 8,
21  .endian = RZ_SYS_ENDIAN_NONE,
22  .disassemble = &do_disassemble
23 };
24 
25 #ifndef RZ_PLUGIN_INCORE
28  .data = &rz_asm_plugin_i8080,
30 };
31 #endif
size_t len
Definition: 6502dis.c:15
RzAsmPlugin rz_asm_plugin_i8080
Definition: asm_i8080.c:15
RZ_API RzLibStruct rizin_plugin
Definition: asm_i8080.c:26
static int do_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_i8080.c:10
#define RZ_API
int i8080_disasm(unsigned char const *const code, char *text, int text_sz)
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
@ RZ_LIB_TYPE_ASM
Definition: rz_lib.h:72
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
Definition: strbuf.c:321
#define RZ_SYS_ENDIAN_NONE
Definition: rz_types.h:525
#define RZ_MAX(x, y)
#define RZ_VERSION
Definition: rz_version.h:8
#define a(i)
Definition: sha256.c:41
const char * name
Definition: rz_asm.h:130
const char * version
Definition: rz_asm.h:133
Definition: dis.c:32