Rizin
unix-like reverse engineering framework and cli tools
asm_amd29k.c File Reference
#include <stdio.h>
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include "../arch/amd29k/amd29k.h"

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

Function Documentation

◆ disassemble()

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

Definition at line 11 of file asm_amd29k.c.

11  {
12  if (!a || !op || !buf || len < 4) {
13  return -1;
14  }
15  char buf_asm[64];
16  ut64 offset = a->pc;
18  op->size = 4;
19  if (amd29k_instr_decode(buf, len, &instruction, a->cpu)) {
20  amd29k_instr_print(buf_asm, sizeof(buf_asm), offset, &instruction);
21  rz_asm_op_set_asm(op, buf_asm);
22  return 4;
23  }
24  rz_asm_op_set_asm(op, "invalid");
25  return -1;
26 }
size_t len
Definition: 6502dis.c:15
bool amd29k_instr_decode(const ut8 *buffer, const ut32 buffer_size, amd29k_instr_t *instruction, const char *cpu)
Definition: amd29k.c:435
void amd29k_instr_print(char *string, int string_size, ut64 address, amd29k_instr_t *instruction)
Definition: amd29k.c:501
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
Definition: aop.c:53
voidpf uLong offset
Definition: ioapi.h:144
voidpf void * buf
Definition: ioapi.h:138
#define a(i)
Definition: sha256.c:41
Definition: dis.c:32
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References a, amd29k_instr_decode(), amd29k_instr_print(), len, rz_asm_op_set_asm(), and ut64().

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_amd29k
Definition: asm_amd29k.c:28
@ 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 41 of file asm_amd29k.c.

◆ rz_asm_plugin_amd29k

RzAsmPlugin rz_asm_plugin_amd29k
Initial value:
= {
.name = "amd29k",
.license = "LGPL3",
.desc = "AMD 29k RISC CPU",
.author = "deroad",
.arch = CPU_29000 "," CPU_29050,
.cpus = "amd29k",
.bits = 32,
.disassemble = &disassemble,
}
#define CPU_29050
Definition: amd29k.h:14
#define CPU_29000
Definition: amd29k.h:13
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_amd29k.c:11
#define RZ_SYS_ENDIAN_LITTLE
Definition: rz_types.h:526

Definition at line 28 of file asm_amd29k.c.