Go to the source code of this file.
◆ _write_asm()
Definition at line 48 of file asm_bf.c.
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
void * malloc(size_t size)
RZ_API bool rz_strbuf_setbin(RzStrBuf *sb, const ut8 *s, size_t len)
References free(), malloc(), memset(), n, NULL, rz_strbuf_setbin(), and value.
Referenced by assemble().
◆ assemble()
Definition at line 59 of file asm_bf.c.
61 if (
buf[0] &&
buf[1] ==
' ') {
64 const char *
arg = strchr(
buf,
',');
65 const char *ref = strchr(
buf,
'[');
66 bool write_err =
false;
72 if (!strncmp(
buf,
"trap", 4)) {
74 }
else if (!strncmp(
buf,
"nop", 3)) {
76 }
else if (!strncmp(
buf,
"inc", 3)) {
77 char ch = ref ?
'+' :
'>';
80 }
else if (!strncmp(
buf,
"dec", 3)) {
81 char ch = ref ?
'-' :
'<';
84 }
else if (!strncmp(
buf,
"sub", 3)) {
85 char ch = ref ?
'-' :
'<';
87 }
else if (!strncmp(
buf,
"add", 3)) {
88 char ch = ref ?
'+' :
'>';
90 }
else if (!strncmp(
buf,
"while", 5)) {
93 }
else if (!strncmp(
buf,
"loop", 4)) {
96 }
else if (!strncmp(
buf,
"in", 2)) {
98 }
else if (!strncmp(
buf,
"out", 3)) {
static bool _write_asm(RzAsmOp *op, int value, int n)
References _write_asm(), and n.
◆ disassemble()
Definition at line 7 of file asm_bf.c.
8 const char *buf_asm =
"invalid";
11 buf_asm =
"while [ptr]";
23 buf_asm =
"inc [ptr]";
26 buf_asm =
"dec [ptr]";
32 buf_asm =
"out [ptr]";
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
References rz_strbuf_set().
◆ rizin_plugin
Initial value:= {
}
RzAsmPlugin rz_asm_plugin_bf
Definition at line 123 of file asm_bf.c.
◆ rz_asm_plugin_bf
Initial value:= {
.name = "bf",
.author = "pancake, nibble",
.version = "4.0.0",
.arch = "bf",
.license = "LGPL3",
.bits = 16 | 32 | 64,
.desc = "Brainfuck",
}
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
static int assemble(RzAsm *a, RzAsmOp *op, const char *buf)
#define RZ_SYS_ENDIAN_NONE
Definition at line 109 of file asm_bf.c.