1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include "dis-asm.h"
21#include "tcg/tcg.h"
22
23
24int print_insn_tci(bfd_vma addr, disassemble_info *info)
25{
26 int length;
27 uint8_t byte;
28 int status;
29 TCGOpcode op;
30
31 status = info->read_memory_func(addr, &byte, 1, info);
32 if (status != 0) {
33 info->memory_error_func(status, addr, info);
34 return -1;
35 }
36 op = byte;
37
38 addr++;
39 status = info->read_memory_func(addr, &byte, 1, info);
40 if (status != 0) {
41 info->memory_error_func(status, addr, info);
42 return -1;
43 }
44 length = byte;
45
46 if (op >= tcg_op_defs_max) {
47 info->fprintf_func(info->stream, "illegal opcode %d", op);
48 } else {
49 const TCGOpDef *def = &tcg_op_defs[op];
50 int nb_oargs = def->nb_oargs;
51 int nb_iargs = def->nb_iargs;
52 int nb_cargs = def->nb_cargs;
53
54 info->fprintf_func(info->stream, "%s\to=%d i=%d c=%d",
55 def->name, nb_oargs, nb_iargs, nb_cargs);
56 }
57
58 return length;
59}
60