15 fprintf(stderr,
"Invalid instruction TC2 or TC1 (%d)\n", ins_bits);
53 fprintf(stderr,
"Invalid transaction instruction 0x%x\n", ins_bits);
59 ut32 op = (ins_bits >> 4) & 7;
60 char *res = (
char *)
calloc(1, 50);
66 sprintf(res,
"*ar-%ld", (
long int)ins_bits & 0xF);
69 sprintf(res,
"*ar+%ld", (
long int)ins_bits & 0xF);
72 sprintf(res,
"*ar%ld(t0)", (
long int)ins_bits & 0xF);
75 sprintf(res,
"*ar%ld", (
long int)ins_bits & 0xF);
78 sprintf(res,
"*(ar%ld-t0)", (
long int)ins_bits & 0xF);
81 sprintf(res,
"*(ar%ld-t1)", (
long int)ins_bits & 0xF);
84 sprintf(res,
"*(ar%ld+t0)", (
long int)ins_bits & 0xF);
87 sprintf(res,
"*(ar%ld+t1)", (
long int)ins_bits & 0xF);
99 reg_num = (ins_bits >> 2) & 0xF;
110 sprintf(res,
"*ar%ld(short(#0x%lx))",
111 (
long int)reg_num, (
long int)
idx *
op);
113 sprintf(res,
"*ar%ld", (
long int)reg_num);
116 type = (
op >> 3 | 2 * op2);
118 sprintf(res,
"@#0x%lx", (
long int)
idx * (reg_num | 16 * (
op & 7)));
119 }
else if (
type == 7) {
120 sprintf(res,
"*sp(#0x%lx)", (
long int)
idx * (reg_num | 16 * (
op & 7)));
125 sprintf(res,
"*ar%ld-", (
long int)reg_num);
128 sprintf(res,
"*ar%ld+", (
long int)reg_num);
131 sprintf(res,
"*ar%ld(t0)", (
long int)reg_num);
134 sprintf(res,
"*ar%ld(t1)", (
long int)reg_num);
137 sprintf(res,
"*(ar%ld-t0)", (
long int)reg_num);
140 sprintf(res,
"*(ar%ld-t1)", (
long int)reg_num);
143 sprintf(res,
"*(ar%ld+t0)", (
long int)reg_num);
146 sprintf(res,
"*(ar%ld+t1)", (
long int)reg_num);
149 sprintf(res,
"*-ar%ld", (
long int)reg_num);
152 sprintf(res,
"*+ar%ld", (
long int)reg_num);
155 sprintf(res,
"*ar%ld(t2)", (
long int)reg_num);
158 sprintf(res,
"*ar%ld(t3)", (
long int)reg_num);
161 sprintf(res,
"*(ar%ld-t2)", (
long int)reg_num);
164 sprintf(res,
"*(ar%ld-t3)", (
long int)reg_num);
167 sprintf(res,
"*(ar%ld+t2)", (
long int)reg_num);
170 sprintf(res,
"*(ar%ld+t3)", (
long int)reg_num);
173 sprintf(res,
"*(ar%ld-t0b)", (
long int)reg_num);
176 sprintf(res,
"*(ar%ld+t0b)", (
long int)reg_num);
179 sprintf(res,
"*ar%ld(t0<<#1)", (
long int)reg_num);
182 sprintf(res,
"*ar%ld(t1<<#1)", (
long int)reg_num);
185 sprintf(res,
"*ar%ld(xar15)", (
long int)reg_num);
198 sprintf(res,
"*ar%ld(#%ld)", (
long int)reg_num, (
long int)
op *
idx);
201 sprintf(res,
"*+ar%ld(#%ld)", (
long int)reg_num, (
long int)
op *
idx);
204 sprintf(res,
"*abs16(#0x%lx)", (
long int)
idx);
220 sprintf(res,
"*ar%ld(#0x%lx)", (
long int)reg_num, (
long int)
idx *
op);
223 sprintf(res,
"*+ar%ld(#0x%lx)", (
long int)reg_num, (
long int)
idx *
op);
242 case 1: res =
"ac0, ac2";
break;
243 case 2: res =
"ac1, ac3";
break;
244 case 3: res =
"pair(ac0), pair(ac2)";
break;
245 case 4: res =
"ar0, ar1";
break;
246 case 5: res =
"ar0, ar2";
break;
247 case 6: res =
"ar1, ar3";
break;
248 case 7: res =
"pair(ar0), pair(ar2)";
break;
249 case 9: res =
"t0, t2";
break;
250 case 10: res =
"t1, t3";
break;
251 case 11: res =
"pair(t0), pair(t2)";
break;
252 case 21: res =
"ar4, t0";
break;
253 case 22: res =
"ar5, t1";
break;
254 case 23: res =
"pair(ar4), pair(t0)";
break;
255 case 25: res =
"ar6, t2";
break;
256 case 26: res =
"ar7, t3";
break;
257 case 27: res =
"pair(ar6), pair(t2)";
break;
258 case 31: res =
"block(ar4), block(t0)";
break;
273 case 0: res =
"ac0";
break;
274 case 1: res =
"ac1";
break;
275 case 2: res =
"ac2";
break;
276 case 3: res =
"ac3";
break;
277 case 4: res =
"ac4";
break;
278 case 5: res =
"ac5";
break;
279 case 6: res =
"ac6";
break;
280 case 7: res =
"ac7";
break;
281 case 8: res =
"ac8";
break;
282 case 9: res =
"ac9";
break;
283 case 10: res =
"ac10";
break;
284 case 11: res =
"ac11";
break;
285 case 12: res =
"ac12";
break;
286 case 13: res =
"ac13";
break;
287 case 14: res =
"ac14";
break;
288 case 15: res =
"ac15";
break;
289 case 16: res =
"ac16";
break;
290 case 17: res =
"ac17";
break;
291 case 18: res =
"ac18";
break;
292 case 19: res =
"ac19";
break;
293 case 20: res =
"ac20";
break;
294 case 21: res =
"ac21";
break;
295 case 22: res =
"ac22";
break;
296 case 23: res =
"ac23";
break;
297 case 24: res =
"ac24";
break;
298 case 25: res =
"ac25";
break;
299 case 26: res =
"ac26";
break;
300 case 27: res =
"ac27";
break;
301 case 28: res =
"ac28";
break;
302 case 29: res =
"ac29";
break;
303 case 30: res =
"ac30";
break;
304 case 31: res =
"ac31";
break;
305 case 32: res =
"xar0";
break;
306 case 33: res =
"xar1";
break;
307 case 34: res =
"xar2";
break;
308 case 35: res =
"xar3";
break;
309 case 36: res =
"xar4";
break;
310 case 37: res =
"xar5";
break;
311 case 38: res =
"xar6";
break;
312 case 39: res =
"xar7";
break;
313 case 40: res =
"xar8";
break;
314 case 41: res =
"xar9";
break;
315 case 42: res =
"xar10";
break;
316 case 43: res =
"xar11";
break;
317 case 44: res =
"xar12";
break;
318 case 45: res =
"xar13";
break;
319 case 46: res =
"xar14";
break;
320 case 47: res =
"xar15";
break;
321 case 52: res =
"xssp";
break;
322 case 53: res =
"xsp";
break;
323 case 54: res =
"xdp";
break;
337 case 0: res =
"ar0";
break;
338 case 1: res =
"ar1";
break;
339 case 2: res =
"ar2";
break;
340 case 3: res =
"ar3";
break;
341 case 4: res =
"ar4";
break;
342 case 5: res =
"ar5";
break;
343 case 6: res =
"ar6";
break;
344 case 7: res =
"ar7";
break;
345 case 8: res =
"ar8";
break;
346 case 9: res =
"ar9";
break;
347 case 10: res =
"ar10";
break;
348 case 11: res =
"ar11";
break;
349 case 12: res =
"ar12";
break;
350 case 13: res =
"ar13";
break;
351 case 14: res =
"ar14";
break;
352 case 15: res =
"ar15";
break;
353 case 16: res =
"t0";
break;
354 case 17: res =
"t1";
break;
355 case 18: res =
"t2";
break;
356 case 19: res =
"t3";
break;
357 case 20: res =
"ssp";
break;
358 case 21: res =
"sp";
break;
359 case 22: res =
"dp";
break;
360 case 32: res =
"xar0";
break;
361 case 33: res =
"xar1";
break;
362 case 34: res =
"xar2";
break;
363 case 35: res =
"xar3";
break;
364 case 36: res =
"xar4";
break;
365 case 37: res =
"xar5";
break;
366 case 38: res =
"xar6";
break;
367 case 39: res =
"xar7";
break;
368 case 40: res =
"xar8";
break;
369 case 41: res =
"xar9";
break;
370 case 42: res =
"xar10";
break;
371 case 43: res =
"xar11";
break;
372 case 44: res =
"xar12";
break;
373 case 45: res =
"xar13";
break;
374 case 46: res =
"xar14";
break;
375 case 47: res =
"xar15";
break;
376 case 52: res =
"xssp";
break;
377 case 53: res =
"xsp";
break;
378 case 54: res =
"xdp";
break;
393 case 0: res =
"ac0";
break;
394 case 1: res =
"ac1";
break;
395 case 2: res =
"ac2";
break;
396 case 3: res =
"ac3";
break;
397 case 4: res =
"ac4";
break;
398 case 5: res =
"ac5";
break;
399 case 6: res =
"ac6";
break;
400 case 7: res =
"ac7";
break;
401 case 8: res =
"ac8";
break;
402 case 9: res =
"ac9";
break;
403 case 10: res =
"ac10";
break;
404 case 11: res =
"ac11";
break;
405 case 12: res =
"ac12";
break;
406 case 13: res =
"ac13";
break;
407 case 14: res =
"ac14";
break;
408 case 15: res =
"ac15";
break;
409 case 16: res =
"ac16";
break;
410 case 17: res =
"ac17";
break;
411 case 18: res =
"ac18";
break;
412 case 19: res =
"ac19";
break;
413 case 20: res =
"ac20";
break;
414 case 21: res =
"ac21";
break;
415 case 22: res =
"ac22";
break;
416 case 23: res =
"ac23";
break;
417 case 24: res =
"ac24";
break;
418 case 25: res =
"ac25";
break;
419 case 26: res =
"ac26";
break;
420 case 27: res =
"ac27";
break;
421 case 28: res =
"ac28";
break;
422 case 29: res =
"ac29";
break;
423 case 30: res =
"ac30";
break;
424 case 31: res =
"ac31";
break;
425 case 32: res =
"ar0";
break;
426 case 33: res =
"ar1";
break;
427 case 34: res =
"ar2";
break;
428 case 35: res =
"ar3";
break;
429 case 36: res =
"ar4";
break;
430 case 37: res =
"ar5";
break;
431 case 38: res =
"ar6";
break;
432 case 39: res =
"ar7";
break;
433 case 40: res =
"ar8";
break;
434 case 41: res =
"ar9";
break;
435 case 42: res =
"ar10";
break;
436 case 43: res =
"ar11";
break;
437 case 44: res =
"ar12";
break;
438 case 45: res =
"ar13";
break;
439 case 46: res =
"ar14";
break;
440 case 47: res =
"ar15";
break;
441 case 48: res =
"t0";
break;
442 case 49: res =
"t1";
break;
443 case 50: res =
"t2";
break;
444 case 51: res =
"t3";
break;
445 case 52: res =
"ssp";
break;
446 case 53: res =
"sp";
break;
447 case 54: res =
"dp";
break;
448 case 56: res =
"csr";
break;
449 case 57: res =
"rptc";
break;
450 case 58: res =
"brc0";
break;
451 case 59: res =
"brc1";
break;
452 case 62: res =
"config";
break;
453 case 63: res =
"cpurev";
break;
454 case 64: res =
"ac0.h";
break;
455 case 65: res =
"ac1.h";
break;
456 case 66: res =
"ac2.h";
break;
457 case 67: res =
"ac3.h";
break;
458 case 68: res =
"ac4.h";
break;
459 case 69: res =
"ac5.h";
break;
460 case 70: res =
"ac6.h";
break;
461 case 71: res =
"ac7.h";
break;
462 case 72: res =
"ac8.h";
break;
463 case 73: res =
"ac9.h";
break;
464 case 74: res =
"ac10.h";
break;
465 case 75: res =
"ac11.h";
break;
466 case 76: res =
"ac12.h";
break;
467 case 77: res =
"ac13.h";
break;
468 case 78: res =
"ac14.h";
break;
469 case 79: res =
"ac15.h";
break;
470 case 80: res =
"ac16.h";
break;
471 case 81: res =
"ac17.h";
break;
472 case 82: res =
"ac18.h";
break;
473 case 83: res =
"ac19.h";
break;
474 case 84: res =
"ac20.h";
break;
475 case 85: res =
"ac21.h";
break;
476 case 86: res =
"ac22.h";
break;
477 case 87: res =
"ac23.h";
break;
478 case 88: res =
"ac24.h";
break;
479 case 89: res =
"ac25.h";
break;
480 case 90: res =
"ac26.h";
break;
481 case 91: res =
"ac27.h";
break;
482 case 92: res =
"ac28.h";
break;
483 case 93: res =
"ac29.h";
break;
484 case 94: res =
"ac30.h";
break;
485 case 95: res =
"ac31.h";
break;
486 case 96: res =
"ac0.l";
break;
487 case 97: res =
"ac1.l";
break;
488 case 98: res =
"ac2.l";
break;
489 case 99: res =
"ac3.l";
break;
490 case 100: res =
"ac4.l";
break;
491 case 101: res =
"ac5.l";
break;
492 case 102: res =
"ac6.l";
break;
493 case 103: res =
"ac7.l";
break;
494 case 104: res =
"ac8.l";
break;
495 case 105: res =
"ac9.l";
break;
496 case 106: res =
"ac10.l";
break;
497 case 107: res =
"ac11.l";
break;
498 case 108: res =
"ac12.l";
break;
499 case 109: res =
"ac13.l";
break;
500 case 110: res =
"ac14.l";
break;
501 case 111: res =
"ac15.l";
break;
502 case 112: res =
"ac16.l";
break;
503 case 113: res =
"ac17.l";
break;
504 case 114: res =
"ac18.l";
break;
505 case 115: res =
"ac19.l";
break;
506 case 116: res =
"ac20.l";
break;
507 case 117: res =
"ac21.l";
break;
508 case 118: res =
"ac22.l";
break;
509 case 119: res =
"ac23.l";
break;
510 case 120: res =
"ac24.l";
break;
511 case 121: res =
"ac25.l";
break;
512 case 122: res =
"ac26.l";
break;
513 case 123: res =
"ac27.l";
break;
514 case 124: res =
"ac28.l";
break;
515 case 125: res =
"ac29.l";
break;
516 case 126: res =
"ac30.l";
break;
517 case 127: res =
"ac31.l";
break;
518 case 128: res =
"xar0";
break;
519 case 129: res =
"xar1";
break;
520 case 130: res =
"xar2";
break;
521 case 131: res =
"xar3";
break;
522 case 132: res =
"xar4";
break;
523 case 133: res =
"xar5";
break;
524 case 134: res =
"xar6";
break;
525 case 135: res =
"xar7";
break;
526 case 136: res =
"xar8";
break;
527 case 137: res =
"xar9";
break;
528 case 138: res =
"xar10";
break;
529 case 139: res =
"xar11";
break;
530 case 140: res =
"xar12";
break;
531 case 141: res =
"xar13";
break;
532 case 142: res =
"xar14";
break;
533 case 143: res =
"xar15";
break;
534 case 148: res =
"xssp";
break;
535 case 149: res =
"xsp";
break;
536 case 150: res =
"xdp";
break;
537 case 152: res =
"rsa0";
break;
538 case 153: res =
"rsa1";
break;
539 case 154: res =
"rea0";
break;
540 case 155: res =
"rea1";
break;
541 case 156: res =
"dbgpaddr";
break;
542 case 157: res =
"dbgpdata";
break;
543 case 159: res =
"reta";
break;
544 case 160: res =
"xar0.h";
break;
545 case 161: res =
"xar1.h";
break;
546 case 162: res =
"xar2.h";
break;
547 case 163: res =
"xar3.h";
break;
548 case 164: res =
"xar4.h";
break;
549 case 165: res =
"xar5.h";
break;
550 case 166: res =
"xar6.h";
break;
551 case 167: res =
"xar7.h";
break;
552 case 168: res =
"xar8.h";
break;
553 case 169: res =
"xar9.h";
break;
554 case 170: res =
"xar10.h";
break;
555 case 171: res =
"xar11.h";
break;
556 case 172: res =
"xar12.h";
break;
557 case 173: res =
"xar13.h";
break;
558 case 174: res =
"xar14.h";
break;
559 case 175: res =
"xar15.h";
break;
560 case 180: res =
"xssp.h";
break;
561 case 181: res =
"xsp.h";
break;
562 case 182: res =
"xdp.h";
break;
563 case 183: res =
"pdp";
break;
564 case 184: res =
"bsa01";
break;
565 case 185: res =
"bsa23";
break;
566 case 186: res =
"bsa45";
break;
567 case 187: res =
"bsa67";
break;
568 case 188: res =
"bsac";
break;
572 case 190: res =
"bk03";
break;
573 case 191: res =
"bk47";
break;
574 case 192: res =
"ac0.g";
break;
575 case 193: res =
"ac1.g";
break;
576 case 194: res =
"ac2.g";
break;
577 case 195: res =
"ac3.g";
break;
578 case 196: res =
"ac4.g";
break;
579 case 197: res =
"ac5.g";
break;
580 case 198: res =
"ac6.g";
break;
581 case 199: res =
"ac7.g";
break;
582 case 200: res =
"ac8.g";
break;
583 case 201: res =
"ac9.g";
break;
584 case 202: res =
"ac10.g";
break;
585 case 203: res =
"ac11.g";
break;
586 case 204: res =
"ac12.g";
break;
587 case 205: res =
"ac13.g";
break;
588 case 206: res =
"ac14.g";
break;
589 case 207: res =
"ac15.g";
break;
590 case 208: res =
"ac16.g";
break;
591 case 209: res =
"ac17.g";
break;
592 case 210: res =
"ac18.g";
break;
593 case 211: res =
"ac19.g";
break;
594 case 212: res =
"ac20.g";
break;
595 case 213: res =
"ac21.g";
break;
596 case 214: res =
"ac22.g";
break;
597 case 215: res =
"ac23.g";
break;
598 case 216: res =
"ac24.g";
break;
599 case 217: res =
"ac25.g";
break;
600 case 218: res =
"ac26.g";
break;
601 case 219: res =
"ac27.g";
break;
602 case 220: res =
"ac28.g";
break;
603 case 221: res =
"ac29.g";
break;
604 case 222: res =
"ac30.g";
break;
605 case 223: res =
"ac31.g";
break;
606 case 224: res =
"st0";
break;
607 case 225: res =
"st1";
break;
608 case 226: res =
"st2";
break;
609 case 227: res =
"st3";
break;
610 case 228: res =
"st0_55";
break;
611 case 229: res =
"st1_55";
break;
612 case 231: res =
"st3_55";
break;
613 case 232: res =
"ier0";
break;
614 case 233: res =
"ier1";
break;
615 case 234: res =
"ifr0";
break;
616 case 235: res =
"ifr1";
break;
617 case 236: res =
"dbier0";
break;
618 case 237: res =
"dbier1";
break;
619 case 238: res =
"ivpd";
break;
620 case 239: res =
"ivph";
break;
621 case 240: res =
"rsa0.h";
break;
622 case 241: res =
"rsa1.h";
break;
623 case 242: res =
"rea0.h";
break;
624 case 243: res =
"rea1.h";
break;
625 case 244: res =
"bios";
break;
626 case 245: res =
"brs1";
break;
627 case 246: res =
"iir";
break;
628 case 247: res =
"ber";
break;
629 case 248: res =
"rsa0.l";
break;
630 case 249: res =
"rsa1.l";
break;
631 case 250: res =
"rea0.l";
break;
632 case 251: res =
"rea1.l";
break;
633 case 252: res =
"tsdr";
break;
646 if (!strncmp(reg_arg,
"ST0", 3)) {
697 }
else if (!strncmp(reg_arg,
"ST1", 3)) {
748 }
else if (!strncmp(reg_arg,
"ST2", 3)) {
799 }
else if (!strncmp(reg_arg,
"ST3", 3)) {
954 return strdup(
"overflow(ac0)");
956 return strdup(
"overflow(ac1)");
958 return strdup(
"overflow(ac2)");
960 return strdup(
"overflow(ac3)");
968 return strdup(
"overflow(govf)");
970 return strdup(
"tc1 & tc2");
972 return strdup(
"tc1 & !tc2");
974 return strdup(
"!tc1 & tc2");
976 return strdup(
"!tc1 & !tc2");
978 return strdup(
"word_mode");
980 return strdup(
"byte_mode");
982 return strdup(
"!overflow(ac0)");
984 return strdup(
"!overflow(ac1)");
986 return strdup(
"!overflow(ac2)");
988 return strdup(
"!overflow(ac3)");
996 return strdup(
"!overflow(govf)");
998 return strdup(
"tc1 | tc2");
1000 return strdup(
"tc1 | !tc2");
1002 return strdup(
"!tc1 | tc2");
1004 return strdup(
"!tc1 | !tc2");
1006 return strdup(
"tc1 ^ tc2");
1008 return strdup(
"tc1 ^ !tc2");
1010 return strdup(
"!tc1 ^ tc2");
1012 return strdup(
"!tc1 ^ !tc2");
1014 ut8 oper_type = oper_byte >> 5;
1015 if (oper_type != 6) {
1017 switch (oper_type) {
1036 oper_type = (oper_byte >> 4) - 12;
1038 if (oper_type != 1) {
1053 const char *res =
NULL;
1055 case 0: res =
"==";
break;
1056 case 1: res =
"!=";
break;
1057 case 2: res =
"<";
break;
1058 case 3: res =
">=";
break;
1067 code = ins_bits & 3;
1070 if (reg_arg && strchr(reg_arg,
'w')) {
1082 aux = (
char *)
calloc(1, 50);
1091 res =
strdup(
"<reserved>");
char * get_opers(ut8 oper_byte)
char * get_reg_name_2(ut32 idx)
char * get_AR_regs_class1(ut32 ins_bits)
char * get_sim_reg(char *reg_arg, ut32 ins_bits)
char * get_cmp_op(ut32 idx)
char * get_tc2_tc1(ut32 ins_bits)
char * get_trans_reg(ut32 ins_bits)
char * get_reg_pair(ut32 idx)
char * get_status_regs_and_bits(char *reg_arg, int reg_bit)
char * get_reg_name_4(ut32 idx)
char * get_AR_regs_class2(ut32 ins_bits, ut32 *ret_len, ut32 ins_pos, ut32 idx)
char * get_reg_name_1(ut32 idx)
char * get_reg_name_3(ut32 idx)
RZ_API void Ht_() free(HtName_(Ht) *ht)
ut32 get_ins_part(ut32 pos, ut32 len)
char * strcat_dup(char *s1, char *s2, st32 n_free)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")