Rizin
unix-like reverse engineering framework and cli tools
asm_6502.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2012-2018 pancake <pancake@nopcode.org>
2 // SPDX-FileCopyrightText: 2012-2018 condret <condr3t@protonmail.com>
3 // SPDX-License-Identifier: LGPL-3.0-only
4 
5 // copypasta from asm_gb.c
6 #include <rz_types.h>
7 #include <rz_util.h>
8 #include <rz_asm.h>
9 #include <rz_lib.h>
10 #include "../arch/6502/6502dis.c"
11 
12 static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len) {
13  int dlen = _6502Disass(a->pc, op, buf, len);
14  return op->size = RZ_MAX(dlen, 0);
15 }
16 
18  .name = "6502",
19  .desc = "6502/NES/C64/Tamagotchi/T-1000 CPU",
20  .arch = "6502",
21  .bits = 8 | 16,
22  .endian = RZ_SYS_ENDIAN_LITTLE,
23  .license = "LGPL3",
24  .disassemble = &disassemble,
25 };
26 
27 #ifndef RZ_PLUGIN_INCORE
30  .data = &rz_asm_plugin_6502,
32 };
33 #endif
size_t len
Definition: 6502dis.c:15
static int _6502Disass(ut64 pc, RzAsmOp *op, const ut8 *buf, ut64 len)
Definition: 6502dis.c:142
RZ_API RzLibStruct rizin_plugin
Definition: asm_6502.c:28
RzAsmPlugin rz_asm_plugin_6502
Definition: asm_6502.c:17
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_6502.c:12
#define RZ_API
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
@ RZ_LIB_TYPE_ASM
Definition: rz_lib.h:72
#define RZ_SYS_ENDIAN_LITTLE
Definition: rz_types.h:526
#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