Rizin
unix-like reverse engineering framework and cli tools
asm_ppc_as.c File Reference
#include <rz_lib.h>
#include "../binutils_as.h"

Go to the source code of this file.

Macros

#define ASSEMBLER   "RZ_PPC_AS"
 

Functions

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

Variables

RzAsmPlugin rz_asm_plugin_ppc_as
 
RZ_API RzLibStruct rizin_plugin
 

Macro Definition Documentation

◆ ASSEMBLER

#define ASSEMBLER   "RZ_PPC_AS"

Definition at line 7 of file asm_ppc_as.c.

Function Documentation

◆ assemble()

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

Definition at line 9 of file asm_ppc_as.c.

9  {
10 #if __powerpc__
11  char *as = "as";
12 #else
13  char *as = "";
14 #endif
15  char cmd_opt[4096];
16  snprintf(cmd_opt, sizeof(cmd_opt), "-mregnames -a%d %s",
17  a->bits, a->big_endian ? "-be" : "-le");
18  return binutils_assemble(a, op, buf,
19  as, ASSEMBLER, "", cmd_opt);
20 }
#define ASSEMBLER
Definition: asm_ppc_as.c:7
int binutils_assemble(RzAsm *a, RzAsmOp *op, const char *buf, const char *as, const char *env, const char *header, const char *cmd_opt)
Definition: binutils_as.c:7
voidpf void * buf
Definition: ioapi.h:138
snprintf
Definition: kernel.h:364
#define a(i)
Definition: sha256.c:41
Definition: dis.c:32

References a, ASSEMBLER, binutils_assemble(), and snprintf.

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_ppc_as
Definition: asm_ppc_as.c:22
@ 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 34 of file asm_ppc_as.c.

◆ rz_asm_plugin_ppc_as

RzAsmPlugin rz_asm_plugin_ppc_as
Initial value:
= {
.name = "ppc.as",
.desc = "as PPC Assembler (use " ASSEMBLER " environment)",
.arch = "ppc",
.author = "eagleoflqj",
.license = "LGPL3",
.bits = 32 | 64,
.assemble = &assemble,
}
static int assemble(RzAsm *a, RzAsmOp *op, const char *buf)
Definition: asm_ppc_as.c:9
#define RZ_SYS_ENDIAN_BIG
Definition: rz_types.h:527
#define RZ_SYS_ENDIAN_LITTLE
Definition: rz_types.h:526

Definition at line 22 of file asm_ppc_as.c.