11 if ((
c[0] <=
'Z') && (
c[0] >=
'A')) {
17 const char *rstr =
"bcdehl a";
18 const char *ptr = strchr(rstr,
r);
19 return ptr ? (
int)(
size_t)(ptr - rstr) : -1;
26 if (strlen(buf_asm) < minlen || minlen < 1) {
30 char *ptr_asm = buf_asm + minlen - 1;
40 if (!strncmp(&buf_asm[minlen - 1],
"[hl]", 4)) {
51 if ((
i = strlen(buf_asm)) < minlen) {
57 p = strchr(buf_asm, (
int)
' ');
61 q = strchr(
p, (
int)
',');
66 if (
p[1] ==
'\0' || q[1] ==
'\0') {
81 if (strlen(q + 1) < 4) {
84 if (!strncmp(q + 1,
"[hl]", 4)) {
94 if (strlen(buf_asm) < minlen) {
98 char *ptr_asm = buf_asm + minlen - 1;
106 }
else if (!strncmp(buf_asm + minlen - 1,
"[hl]", 4)) {
120 if (strlen(buf_asm) < minlen) {
124 if (buf_asm[4] ==
',') {
129 buf[0] = (
ut8)(0x40 + (
i * 8));
132 if (strncmp(buf_asm + 5,
"[hl]", 4)) {
140 if (!strncmp(buf_asm + 3,
"[hl],", 5)) {
154 if (strlen(buf_asm) < 6) {
157 if (buf_asm[4] ==
',') {
165 }
else if (!strncmp(buf_asm + 3,
"[hl],", 5)) {
175 if (strlen(buf_asm) < 7) {
178 if (buf_asm[5] !=
',') {
182 const ut16 reg = (buf_asm[3] << 8) | buf_asm[4];
202 buf[2] = (
num & 0xff00) >> 8;
207 int mn_len, j,
len = 1;
214 ut8 opbuf[4] = { 0 };
218 while (strstr(buf_asm,
" ")) {
223 if (mn_len < 2 || mn_len > 4) {
226 for (j = 0; j < mn_len; j++) {
227 mn = (mn << 8) | buf_asm[j];
234 if ((
i = strlen(buf_asm)) < 5) {
240 if (buf_asm[4] ==
'b') {
241 opbuf[0] = (buf_asm[5] ==
'c') ? 3 : 4;
242 }
else if (buf_asm[4] ==
'c') {
244 }
else if (buf_asm[4] ==
'd') {
245 opbuf[0] = (buf_asm[5] ==
'e') ? 0x13 : 0x14;
246 }
else if (buf_asm[4] ==
'e') {
248 }
else if (buf_asm[4] ==
'h') {
249 opbuf[0] = (buf_asm[5] ==
'l') ? 0x23 : 0x24;
250 }
else if (buf_asm[4] ==
'l') {
252 }
else if (buf_asm[4] ==
'a') {
254 }
else if (buf_asm[4] ==
's' && buf_asm[5] ==
'p') {
256 }
else if (!strncmp(buf_asm + 4,
"[hl]", 4)) {
263 if ((
i = strlen(buf_asm)) < 5) {
269 switch (buf_asm[4]) {
271 opbuf[0] = (buf_asm[5] ==
'c') ? 0x0b : 0x05;
277 opbuf[0] = (buf_asm[5] ==
'e') ? 0x1b : 0x15;
283 opbuf[0] = (buf_asm[5] ==
'l') ? 0x2b : 0x25;
292 if (!strncmp(buf_asm + 4,
"sp", 2)) {
294 }
else if (!strncmp(buf_asm,
"[hl]", 4)) {
325 if (strlen(buf_asm) < 5)
327 if (buf_asm[4] ==
's' && buf_asm[5] ==
'p' && buf_asm[6] ==
',' && buf_asm[7] !=
'\0') {
330 opbuf[1] = (
ut8)(
num & 0xff);
332 }
else if (!strcmp(buf_asm,
"hl,bc")) {
334 }
else if (!strcmp(buf_asm + 4,
"hl,de")) {
336 }
else if (!strcmp(buf_asm + 4,
"hl,hl")) {
338 }
else if (!strcmp(buf_asm + 4,
"hl,sp")) {
375 if (strlen(buf_asm) < 5) {
377 }
else if (strlen(buf_asm) < 6) {
380 if (buf_asm[4] ==
'z') {
382 }
else if (buf_asm[4] ==
'c') {
389 if (buf_asm[4] !=
'n') {
393 if (buf_asm[5] ==
'z') {
395 }
else if (buf_asm[5] ==
'c') {
426 if (strlen(buf_asm) < 5) {
430 if ((
num & 7) || ((
num / 8) > 7)) {
433 opbuf[0] = (
ut8)((
num & 0xff) + 0xc7);
436 if (strlen(buf_asm) < 7) {
441 if (buf_asm[5] ==
'b' && buf_asm[6] ==
'c') {
443 }
else if (buf_asm[5] ==
'd' && buf_asm[6] ==
'e') {
445 }
else if (buf_asm[5] ==
'h' && buf_asm[6] ==
'l') {
447 }
else if (buf_asm[5] ==
'a' && buf_asm[6] ==
'f') {
454 if (strlen(buf_asm) < 6)
458 if (buf_asm[4] ==
'b' && buf_asm[5] ==
'c') {
460 }
else if (buf_asm[4] ==
'd' && buf_asm[5] ==
'e') {
462 }
else if (buf_asm[4] ==
'h' && buf_asm[5] ==
'l') {
464 }
else if (buf_asm[4] ==
'a' && buf_asm[5] ==
'f') {
471 if (strlen(buf_asm) < 4) {
475 char *
p = strchr(buf_asm, (
int)
',');
479 if (buf_asm[3] ==
'h' && buf_asm[4] ==
'l')
485 opbuf[1] = (
ut8)(
num & 0xff);
486 opbuf[2] = (
ut8)((
num & 0xff00) >> 8);
491 if (*(
p - 2) ==
'n') {
492 if (*(
p - 1) ==
'z') {
494 }
else if (*(
p - 1) ==
'c') {
499 }
else if (*(
p - 2) ==
' ') {
500 if (*(
p - 1) ==
'z') {
502 }
else if (*(
p - 1) ==
'c') {
511 if (!
p[0] || !
p[1]) {
515 opbuf[1] = (
ut8)(
num & 0xff);
516 opbuf[2] = (
ut8)((
num & 0xff00) >> 8);
522 if (strlen(buf_asm) < 4)
525 char *
p = strchr(buf_asm, (
int)
',');
530 opbuf[1] = (
ut8)(
num & 0xff);
534 if (*(
p - 2) ==
'n') {
537 else if (*(
p - 1) ==
'c')
541 }
else if (*(
p - 2) ==
' ') {
544 else if (*(
p - 1) ==
'c')
556 opbuf[1] = (
ut8)(
num & 0xff);
562 if (strlen(buf_asm) < 6) {
566 char *
p = strchr(buf_asm, (
int)
',');
571 opbuf[1] = (
ut8)(
num & 0xff);
572 opbuf[2] = (
ut8)((
num & 0xff00) >> 8);
576 if (*(
p - 2) ==
'n') {
577 if (*(
p - 1) ==
'z') {
579 }
else if (*(
p - 1) ==
'c') {
584 }
else if (*(
p - 2) ==
' ') {
585 if (*(
p - 1) ==
'z') {
587 }
else if (*(
p - 1) ==
'c') {
600 opbuf[1] = (
ut8)(
num & 0xff);
601 opbuf[2] = (
ut8)((
num & 0xff00) >> 8);
655 return op->size =
len;
static void str_op(char *c)
static int gb_reg_idx(char r)
static int gb_parse_arith1(ut8 *buf, const int minlen, char *buf_asm, ut8 base, ut8 alt)
static bool gb_parse_cb2(ut8 *buf, const int minlen, char *buf_asm, ut8 base)
static bool gb_parse_ld3(ut8 *buf, char *buf_asm)
static bool gb_parse_ld1(ut8 *buf, const int minlen, char *buf_asm)
static bool gb_parse_ld2(ut8 *buf, char *buf_asm)
static bool gb_parse_cb1(ut8 *buf, const int minlen, char *buf_asm, ut8 base)
static int gbAsm(RzAsm *a, RzAsmOp *op, const char *buf)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API char * rz_str_replace_in(char *str, ut32 sz, const char *key, const char *val, int g)
RZ_API int rz_str_do_until_token(str_operation op, char *str, const char tok)
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()