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]";
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)) {
111 .author =
"pancake, nibble",
115 .bits = 16 | 32 | 64,
122 #ifndef RZ_PLUGIN_INCORE
RZ_API RzLibStruct rizin_plugin
static bool _write_asm(RzAsmOp *op, int value, int n)
RzAsmPlugin rz_asm_plugin_bf
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
static int assemble(RzAsm *a, RzAsmOp *op, const char *buf)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
void * malloc(size_t size)
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
RZ_API bool rz_strbuf_setbin(RzStrBuf *sb, const ut8 *s, size_t len)
#define RZ_SYS_ENDIAN_NONE