00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "sysdep.h"
00036 #include <stdio.h>
00037 #include "ansidecl.h"
00038 #include "dis-asm.h"
00039 #include "bfd.h"
00040 #include "symcat.h"
00041 #include "libiberty.h"
00042 #include "ip2k-desc.h"
00043 #include "ip2k-opc.h"
00044 #include "opintl.h"
00045
00046
00047 #define UNKNOWN_INSN_MSG _("*unknown*")
00048
00049 static void print_normal
00050 (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
00051 static void print_address
00052 (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED;
00053 static void print_keyword
00054 (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED;
00055 static void print_insn_normal
00056 (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
00057 static int print_insn
00058 (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned);
00059 static int default_print_insn
00060 (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED;
00061 static int read_insn
00062 (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *,
00063 unsigned long *);
00064
00065
00066
00067
00068
00069 #define PRINT_FUNC_DECL(name) \
00070 static void name PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int))
00071
00072 PRINT_FUNC_DECL (print_fr);
00073 PRINT_FUNC_DECL (print_dollarhex);
00074 PRINT_FUNC_DECL (print_dollarhex8);
00075 PRINT_FUNC_DECL (print_dollarhex_addr16h);
00076 PRINT_FUNC_DECL (print_dollarhex_addr16l);
00077 PRINT_FUNC_DECL (print_dollarhex_p);
00078 PRINT_FUNC_DECL (print_dollarhex_cj);
00079 PRINT_FUNC_DECL (print_decimal);
00080
00081 static void
00082 print_fr (cd, dis_info, value, attrs, pc, length)
00083 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00084 PTR dis_info;
00085 long value;
00086 unsigned int attrs ATTRIBUTE_UNUSED;
00087 bfd_vma pc ATTRIBUTE_UNUSED;
00088 int length ATTRIBUTE_UNUSED;
00089 {
00090 disassemble_info *info = (disassemble_info *) dis_info;
00091 const CGEN_KEYWORD_ENTRY *ke;
00092 extern CGEN_KEYWORD ip2k_cgen_opval_register_names;
00093 long offsettest;
00094 long offsetvalue;
00095
00096 if ( value == 0 )
00097 {
00098 (*info->fprintf_func) (info->stream, "%s", "(IP)");
00099 return;
00100 }
00101
00102 offsettest = value >> 7;
00103 offsetvalue = value & 0x7F;
00104
00105
00106 if ( offsettest == 2 )
00107 {
00108 if ( offsetvalue == 0 )
00109 (*info->fprintf_func) (info->stream, "%s","(DP)");
00110 else
00111 (*info->fprintf_func) (info->stream, "$%x%s",offsetvalue, "(DP)");
00112 return;
00113 }
00114
00115
00116 if ( offsettest == 3 )
00117 {
00118 if ( offsetvalue == 0 )
00119 (*info->fprintf_func) (info->stream, "%s", "(SP)");
00120 else
00121 (*info->fprintf_func) (info->stream, "$%x%s", offsetvalue,"(SP)");
00122 return;
00123 }
00124
00125
00126 ke = cgen_keyword_lookup_value (& ip2k_cgen_opval_register_names, value);
00127 if (ke != NULL)
00128 {
00129 (*info->fprintf_func) (info->stream, "%s", ke->name);
00130 return;
00131 }
00132
00133
00134 (*info->fprintf_func) (info->stream, "$%02x", value);
00135 }
00136
00137 static void
00138 print_dollarhex (cd, dis_info, value, attrs, pc, length)
00139 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00140 PTR dis_info;
00141 long value;
00142 unsigned int attrs ATTRIBUTE_UNUSED;
00143 bfd_vma pc ATTRIBUTE_UNUSED;
00144 int length ATTRIBUTE_UNUSED;
00145 {
00146 disassemble_info *info = (disassemble_info *) dis_info;
00147
00148 (*info->fprintf_func) (info->stream, "$%x", value);
00149 }
00150
00151 static void
00152 print_dollarhex8 (cd, dis_info, value, attrs, pc, length)
00153 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00154 PTR dis_info;
00155 long value;
00156 unsigned int attrs ATTRIBUTE_UNUSED;
00157 bfd_vma pc ATTRIBUTE_UNUSED;
00158 int length ATTRIBUTE_UNUSED;
00159 {
00160 disassemble_info *info = (disassemble_info *) dis_info;
00161
00162 (*info->fprintf_func) (info->stream, "$%02x", value);
00163 }
00164
00165 static void
00166 print_dollarhex_addr16h (cd, dis_info, value, attrs, pc, length)
00167 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00168 PTR dis_info;
00169 long value;
00170 unsigned int attrs ATTRIBUTE_UNUSED;
00171 bfd_vma pc ATTRIBUTE_UNUSED;
00172 int length ATTRIBUTE_UNUSED;
00173 {
00174 disassemble_info *info = (disassemble_info *) dis_info;
00175
00176
00177
00178 value = ((value << 8) & 0xFF00);
00179
00180 (*info->fprintf_func) (info->stream, "$%04x", value);
00181 }
00182
00183 static void
00184 print_dollarhex_addr16l (cd, dis_info, value, attrs, pc, length)
00185 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00186 PTR dis_info;
00187 long value;
00188 unsigned int attrs ATTRIBUTE_UNUSED;
00189 bfd_vma pc ATTRIBUTE_UNUSED;
00190 int length ATTRIBUTE_UNUSED;
00191 {
00192 disassemble_info *info = (disassemble_info *) dis_info;
00193
00194 (*info->fprintf_func) (info->stream, "$%04x", value);
00195 }
00196
00197 static void
00198 print_dollarhex_p (cd, dis_info, value, attrs, pc, length)
00199 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00200 PTR dis_info;
00201 long value;
00202 unsigned int attrs ATTRIBUTE_UNUSED;
00203 bfd_vma pc ATTRIBUTE_UNUSED;
00204 int length ATTRIBUTE_UNUSED;
00205 {
00206 disassemble_info *info = (disassemble_info *) dis_info;
00207
00208 value = ((value << 14) & 0x1C000);
00209 ;value = (value & 0x1FFFF);
00210 (*info->fprintf_func) (info->stream, "$%05x", value);
00211 }
00212
00213 static void
00214 print_dollarhex_cj (cd, dis_info, value, attrs, pc, length)
00215 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00216 PTR dis_info;
00217 long value;
00218 unsigned int attrs ATTRIBUTE_UNUSED;
00219 bfd_vma pc ATTRIBUTE_UNUSED;
00220 int length ATTRIBUTE_UNUSED;
00221 {
00222 disassemble_info *info = (disassemble_info *) dis_info;
00223
00224 value = ((value << 1) & 0x1FFFF);
00225 (*info->fprintf_func) (info->stream, "$%05x", value);
00226 }
00227
00228
00229 static void
00230 print_decimal (cd, dis_info, value, attrs, pc, length)
00231 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
00232 PTR dis_info;
00233 long value;
00234 unsigned int attrs ATTRIBUTE_UNUSED;
00235 bfd_vma pc ATTRIBUTE_UNUSED;
00236 int length ATTRIBUTE_UNUSED;
00237 {
00238 disassemble_info *info = (disassemble_info *) dis_info;
00239
00240 (*info->fprintf_func) (info->stream, "%d", value);
00241 }
00242
00243
00244
00245
00246
00247 void ip2k_cgen_print_operand
00248 PARAMS ((CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *,
00249 void const *, bfd_vma, int));
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 void
00267 ip2k_cgen_print_operand (cd, opindex, xinfo, fields, attrs, pc, length)
00268 CGEN_CPU_DESC cd;
00269 int opindex;
00270 PTR xinfo;
00271 CGEN_FIELDS *fields;
00272 void const *attrs ATTRIBUTE_UNUSED;
00273 bfd_vma pc;
00274 int length;
00275 {
00276 disassemble_info *info = (disassemble_info *) xinfo;
00277
00278 switch (opindex)
00279 {
00280 case IP2K_OPERAND_ADDR16CJP :
00281 print_dollarhex_cj (cd, info, fields->f_addr16cjp, 0|(1<<CGEN_OPERAND_ABS_ADDR), pc, length);
00282 break;
00283 case IP2K_OPERAND_ADDR16H :
00284 print_dollarhex_addr16h (cd, info, fields->f_imm8, 0, pc, length);
00285 break;
00286 case IP2K_OPERAND_ADDR16L :
00287 print_dollarhex_addr16l (cd, info, fields->f_imm8, 0, pc, length);
00288 break;
00289 case IP2K_OPERAND_ADDR16P :
00290 print_dollarhex_p (cd, info, fields->f_page3, 0, pc, length);
00291 break;
00292 case IP2K_OPERAND_BITNO :
00293 print_decimal (cd, info, fields->f_bitno, 0, pc, length);
00294 break;
00295 case IP2K_OPERAND_CBIT :
00296 print_normal (cd, info, 0, 0, pc, length);
00297 break;
00298 case IP2K_OPERAND_DCBIT :
00299 print_normal (cd, info, 0, 0, pc, length);
00300 break;
00301 case IP2K_OPERAND_FR :
00302 print_fr (cd, info, fields->f_reg, 0|(1<<CGEN_OPERAND_ABS_ADDR), pc, length);
00303 break;
00304 case IP2K_OPERAND_LIT8 :
00305 print_dollarhex8 (cd, info, fields->f_imm8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
00306 break;
00307 case IP2K_OPERAND_PABITS :
00308 print_normal (cd, info, 0, 0, pc, length);
00309 break;
00310 case IP2K_OPERAND_RETI3 :
00311 print_dollarhex (cd, info, fields->f_reti3, 0, pc, length);
00312 break;
00313 case IP2K_OPERAND_ZBIT :
00314 print_normal (cd, info, 0, 0, pc, length);
00315 break;
00316
00317 default :
00318
00319 fprintf (stderr, _("Unrecognized field %d while printing insn.\n"),
00320 opindex);
00321 abort ();
00322 }
00323 }
00324
00325 cgen_print_fn * const ip2k_cgen_print_handlers[] =
00326 {
00327 print_insn_normal,
00328 };
00329
00330
00331 void
00332 ip2k_cgen_init_dis (cd)
00333 CGEN_CPU_DESC cd;
00334 {
00335 ip2k_cgen_init_opcode_table (cd);
00336 ip2k_cgen_init_ibld_table (cd);
00337 cd->print_handlers = & ip2k_cgen_print_handlers[0];
00338 cd->print_operand = ip2k_cgen_print_operand;
00339 }
00340
00341
00342
00343
00344 static void
00345 print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
00346 void *dis_info,
00347 long value,
00348 unsigned int attrs,
00349 bfd_vma pc ATTRIBUTE_UNUSED,
00350 int length ATTRIBUTE_UNUSED)
00351 {
00352 disassemble_info *info = (disassemble_info *) dis_info;
00353
00354 #ifdef CGEN_PRINT_NORMAL
00355 CGEN_PRINT_NORMAL (cd, info, value, attrs, pc, length);
00356 #endif
00357
00358
00359 if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
00360 ;
00361 else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED))
00362 (*info->fprintf_func) (info->stream, "%ld", value);
00363 else
00364 (*info->fprintf_func) (info->stream, "0x%lx", value);
00365 }
00366
00367
00368
00369 static void
00370 print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
00371 void *dis_info,
00372 bfd_vma value,
00373 unsigned int attrs,
00374 bfd_vma pc ATTRIBUTE_UNUSED,
00375 int length ATTRIBUTE_UNUSED)
00376 {
00377 disassemble_info *info = (disassemble_info *) dis_info;
00378
00379 #ifdef CGEN_PRINT_ADDRESS
00380 CGEN_PRINT_ADDRESS (cd, info, value, attrs, pc, length);
00381 #endif
00382
00383
00384 if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
00385 ;
00386 else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR))
00387 (*info->print_address_func) (value, info);
00388 else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR))
00389 (*info->print_address_func) (value, info);
00390 else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED))
00391 (*info->fprintf_func) (info->stream, "%ld", (long) value);
00392 else
00393 (*info->fprintf_func) (info->stream, "0x%lx", (long) value);
00394 }
00395
00396
00397
00398 static void
00399 print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
00400 void *dis_info,
00401 CGEN_KEYWORD *keyword_table,
00402 long value,
00403 unsigned int attrs ATTRIBUTE_UNUSED)
00404 {
00405 disassemble_info *info = (disassemble_info *) dis_info;
00406 const CGEN_KEYWORD_ENTRY *ke;
00407
00408 ke = cgen_keyword_lookup_value (keyword_table, value);
00409 if (ke != NULL)
00410 (*info->fprintf_func) (info->stream, "%s", ke->name);
00411 else
00412 (*info->fprintf_func) (info->stream, "???");
00413 }
00414
00415
00416
00417
00418
00419
00420 static void
00421 print_insn_normal (CGEN_CPU_DESC cd,
00422 void *dis_info,
00423 const CGEN_INSN *insn,
00424 CGEN_FIELDS *fields,
00425 bfd_vma pc,
00426 int length)
00427 {
00428 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
00429 disassemble_info *info = (disassemble_info *) dis_info;
00430 const CGEN_SYNTAX_CHAR_TYPE *syn;
00431
00432 CGEN_INIT_PRINT (cd);
00433
00434 for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
00435 {
00436 if (CGEN_SYNTAX_MNEMONIC_P (*syn))
00437 {
00438 (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn));
00439 continue;
00440 }
00441 if (CGEN_SYNTAX_CHAR_P (*syn))
00442 {
00443 (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn));
00444 continue;
00445 }
00446
00447
00448 ip2k_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info,
00449 fields, CGEN_INSN_ATTRS (insn), pc, length);
00450 }
00451 }
00452
00453
00454
00455
00456
00457 static int
00458 read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
00459 bfd_vma pc,
00460 disassemble_info *info,
00461 bfd_byte *buf,
00462 int buflen,
00463 CGEN_EXTRACT_INFO *ex_info,
00464 unsigned long *insn_value)
00465 {
00466 int status = (*info->read_memory_func) (pc, buf, buflen, info);
00467 if (status != 0)
00468 {
00469 (*info->memory_error_func) (status, pc, info);
00470 return -1;
00471 }
00472
00473 ex_info->dis_info = info;
00474 ex_info->valid = (1 << buflen) - 1;
00475 ex_info->insn_bytes = buf;
00476
00477 *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG);
00478 return 0;
00479 }
00480
00481
00482
00483
00484
00485
00486
00487 static int
00488 print_insn (CGEN_CPU_DESC cd,
00489 bfd_vma pc,
00490 disassemble_info *info,
00491 bfd_byte *buf,
00492 unsigned int buflen)
00493 {
00494 CGEN_INSN_INT insn_value;
00495 const CGEN_INSN_LIST *insn_list;
00496 CGEN_EXTRACT_INFO ex_info;
00497 int basesize;
00498
00499
00500 basesize = cd->base_insn_bitsize < buflen * 8 ?
00501 cd->base_insn_bitsize : buflen * 8;
00502 insn_value = cgen_get_insn_value (cd, buf, basesize);
00503
00504
00505
00506
00507
00508 ex_info.valid = (1 << buflen) - 1;
00509 ex_info.dis_info = info;
00510 ex_info.insn_bytes = buf;
00511
00512
00513
00514
00515 insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value);
00516 while (insn_list != NULL)
00517 {
00518 const CGEN_INSN *insn = insn_list->insn;
00519 CGEN_FIELDS fields;
00520 int length;
00521 unsigned long insn_value_cropped;
00522
00523 #ifdef CGEN_VALIDATE_INSN_SUPPORTED
00524
00525
00526 if (! ip2k_cgen_insn_supported (cd, insn))
00527 {
00528 insn_list = CGEN_DIS_NEXT_INSN (insn_list);
00529 continue;
00530 }
00531 #endif
00532
00533
00534
00535
00536
00537
00538
00539 if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen &&
00540 (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long))
00541 insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn),
00542 info->endian == BFD_ENDIAN_BIG);
00543 else
00544 insn_value_cropped = insn_value;
00545
00546 if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn))
00547 == CGEN_INSN_BASE_VALUE (insn))
00548 {
00549
00550
00551
00552
00553
00554
00555 if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) &&
00556 (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long))
00557 {
00558 unsigned long full_insn_value;
00559 int rc = read_insn (cd, pc, info, buf,
00560 CGEN_INSN_BITSIZE (insn) / 8,
00561 & ex_info, & full_insn_value);
00562 if (rc != 0)
00563 return rc;
00564 length = CGEN_EXTRACT_FN (cd, insn)
00565 (cd, insn, &ex_info, full_insn_value, &fields, pc);
00566 }
00567 else
00568 length = CGEN_EXTRACT_FN (cd, insn)
00569 (cd, insn, &ex_info, insn_value_cropped, &fields, pc);
00570
00571
00572 if (length < 0)
00573 return length;
00574 if (length > 0)
00575 {
00576 CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length);
00577
00578 return length / 8;
00579 }
00580 }
00581
00582 insn_list = CGEN_DIS_NEXT_INSN (insn_list);
00583 }
00584
00585 return 0;
00586 }
00587
00588
00589
00590
00591
00592 #ifndef CGEN_PRINT_INSN
00593 #define CGEN_PRINT_INSN default_print_insn
00594 #endif
00595
00596 static int
00597 default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
00598 {
00599 bfd_byte buf[CGEN_MAX_INSN_SIZE];
00600 int buflen;
00601 int status;
00602
00603
00604 buflen = cd->base_insn_bitsize / 8;
00605 status = (*info->read_memory_func) (pc, buf, buflen, info);
00606
00607
00608 if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize))
00609 {
00610 buflen = cd->min_insn_bitsize / 8;
00611 status = (*info->read_memory_func) (pc, buf, buflen, info);
00612 }
00613
00614 if (status != 0)
00615 {
00616 (*info->memory_error_func) (status, pc, info);
00617 return -1;
00618 }
00619
00620 return print_insn (cd, pc, info, buf, buflen);
00621 }
00622
00623
00624
00625
00626
00627 typedef struct cpu_desc_list {
00628 struct cpu_desc_list *next;
00629 int isa;
00630 int mach;
00631 int endian;
00632 CGEN_CPU_DESC cd;
00633 } cpu_desc_list;
00634
00635 int
00636 print_insn_ip2k (bfd_vma pc, disassemble_info *info)
00637 {
00638 static cpu_desc_list *cd_list = 0;
00639 cpu_desc_list *cl = 0;
00640 static CGEN_CPU_DESC cd = 0;
00641 static int prev_isa;
00642 static int prev_mach;
00643 static int prev_endian;
00644 int length;
00645 int isa,mach;
00646 int endian = (info->endian == BFD_ENDIAN_BIG
00647 ? CGEN_ENDIAN_BIG
00648 : CGEN_ENDIAN_LITTLE);
00649 enum bfd_architecture arch;
00650
00651
00652 #ifndef CGEN_BFD_ARCH
00653 #define CGEN_BFD_ARCH bfd_arch_ip2k
00654 #endif
00655 arch = info->arch;
00656 if (arch == bfd_arch_unknown)
00657 arch = CGEN_BFD_ARCH;
00658
00659
00660
00661 #ifdef CGEN_COMPUTE_MACH
00662 mach = CGEN_COMPUTE_MACH (info);
00663 #else
00664 mach = info->mach;
00665 #endif
00666
00667 #ifdef CGEN_COMPUTE_ISA
00668 isa = CGEN_COMPUTE_ISA (info);
00669 #else
00670 isa = info->insn_sets;
00671 #endif
00672
00673
00674 if (cd
00675 && (isa != prev_isa
00676 || mach != prev_mach
00677 || endian != prev_endian))
00678 {
00679 cd = 0;
00680 for (cl = cd_list; cl; cl = cl->next)
00681 {
00682 if (cl->isa == isa &&
00683 cl->mach == mach &&
00684 cl->endian == endian)
00685 {
00686 cd = cl->cd;
00687 break;
00688 }
00689 }
00690 }
00691
00692
00693 if (! cd)
00694 {
00695 const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach);
00696 const char *mach_name;
00697
00698 if (!arch_type)
00699 abort ();
00700 mach_name = arch_type->printable_name;
00701
00702 prev_isa = isa;
00703 prev_mach = mach;
00704 prev_endian = endian;
00705 cd = ip2k_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa,
00706 CGEN_CPU_OPEN_BFDMACH, mach_name,
00707 CGEN_CPU_OPEN_ENDIAN, prev_endian,
00708 CGEN_CPU_OPEN_END);
00709 if (!cd)
00710 abort ();
00711
00712
00713 cl = xmalloc (sizeof (struct cpu_desc_list));
00714 cl->cd = cd;
00715 cl->isa = isa;
00716 cl->mach = mach;
00717 cl->endian = endian;
00718 cl->next = cd_list;
00719 cd_list = cl;
00720
00721 ip2k_cgen_init_dis (cd);
00722 }
00723
00724
00725
00726
00727
00728
00729 length = CGEN_PRINT_INSN (cd, pc, info);
00730 if (length > 0)
00731 return length;
00732 if (length < 0)
00733 return -1;
00734
00735 (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG);
00736 return cd->default_insn_bitsize / 8;
00737 }