disassemble.c File Reference

#include <stdio.h>
#include <termio.h>
#include <sys/ioctl.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <cmdparser.h>

Include dependency graph for disassemble.c:

Go to the source code of this file.

Data Structures

struct  DISTBL

Defines

#define c0()   strcat(dest,c0reg[(int)RD_(inst)])
#define c0ft()   strcat(dest,c0reg[(int)RT_(inst)])
#define c1()   strcat(dest,c1reg[(int)RD_(inst)])
#define c1ft()   strcat(dest,c1reg[(int)RT_(inst)])
#define c2()   strcat(dest,regs_hw[(int)RD_(inst)])
#define cc1()   strcat(dest,regs_hw[(int)RD_(inst)])
#define cc2()   strcat(dest,regs_hw[(int)RD_(inst)])
#define cn()   strcat(dest,regs_hw[(int)RD_(inst)])
#define cnft()   strcat(dest,regs_hw[(int)RT_(inst)])
#define comma()   strcat(dest,",")
#define fd()   strcat(dest,c1reg[(int)FD_(inst)])
#define FD_(x)   (((x) >> 6) & ((1L << 5) - 1))
#define fs()   strcat(dest,c1reg[(int)FS_(inst)])
#define FS_(x)   (((x) >> 11) & ((1L << 5) - 1))
#define ft()   strcat(dest,c1reg[(int)FT_(inst)])
#define FT_(x)   (((x) >> 16) & ((1L << 5) - 1))
#define IMM_(x)   (((x) >> 0) & ((1L << 16) - 1))
#define rd()   strcat(dest,regname[(int)RD_(inst)])
#define RD_(x)   (((x) >> 11) & ((1L << 5) - 1))
#define REGSZ_32   0
#define REGSZ_64   1
#define rs()   strcat(dest,regname[(int)RS_(inst)]), rsvalue = 0
#define RS_(x)   (((x) >> 21) & ((1L << 5) - 1))
#define rt()   strcat(dest,regname[(int)RT_(inst)]), rtvalue = 0
#define RT_(x)   (((x) >> 16) & ((1L << 5) - 1))
#define SHAMT_(x)   (((x) >> 6) & ((1L << 5) - 1))
#define TARGET_(x)   (((x) >> 0) & ((1L << 26) - 1))

Enumerations

enum  TYPE {
  RD_RS_RT, RT_RS_IMM, OFF, RS_RT_OFF,
  RS_OFF, NONE, RT_RD, COFUN,
  RD_RT, RS_RT, TARGET, JALR,
  RS, RD_RT_SFT, LOAD_STORE, RT_IMM,
  RD, RD_RT_RS, RD_RS, RT_RS_SIMM,
  RS_SIMM, RT_SIMM, JR, RT_C0,
  RT_C1, RT_CN, RT_CC1, LDSTC0,
  LDSTC1, LDSTCN, WORD, RT_C2,
  RT_CC2, BPCODE, CACHE_OP, CP_OFF,
  STORE, STOREC1, STORECN, FT_FS_FD_D,
  FT_FS_FD_S, FS_FD_D, FS_FD_S, FS_FD_W,
  FS_FD_L, FT_FS_D, FT_FS_S, RT_RD_TO,
  RT_CC1_TO, RT_CN_TO, RT_C0_TO, RT_C1_TO
}

Functions

static int dispchist __P ((int, int))
static void mkcomment __P ((char *, char *, long))
static void simm __P ((char *))
static const DISTBL *get_distbl __P ((u_int32_t))
static int cmd_disas (int argc, char **argv)
static const DISTBL * get_distbl (u_int32_t bits)
static void imm (char *dest)
void * md_disasm (char *dest, void *addr, unsigned int instcode)
static void mkcomment (char *p, char *fmt, long v)
 mycmd_init (disas, cmd_disas,"disas [addr] [count]","disas memory")
static void simm (char *dest)
static char * strccat (char *dst, int c)

Variables

static const char *const * c0reg
static const char *const c1reg []
static long cur_loc
static const DISTBL distbl []
static int do_rs
static int do_rt
static long inst
static const char *const * regname
static const char *const regs_c0 []
static const char *const regs_hw []
static const char *const regs_sw []
static int rflag
static int rsvalue
static int rtvalue
static char * searching = "searching.. "


Define Documentation

 
#define c0 (  )     strcat(dest,c0reg[(int)RD_(inst)])

Definition at line 90 of file disassemble.c.

Referenced by md_disasm().

 
#define c0ft (  )     strcat(dest,c0reg[(int)RT_(inst)])

Definition at line 94 of file disassemble.c.

Referenced by md_disasm().

 
#define c1 (  )     strcat(dest,c1reg[(int)RD_(inst)])

Definition at line 91 of file disassemble.c.

Referenced by md_disasm().

 
#define c1ft (  )     strcat(dest,c1reg[(int)RT_(inst)])

Definition at line 95 of file disassemble.c.

Referenced by md_disasm().

 
#define c2 (  )     strcat(dest,regs_hw[(int)RD_(inst)])

Definition at line 92 of file disassemble.c.

Referenced by md_disasm().

 
#define cc1 (  )     strcat(dest,regs_hw[(int)RD_(inst)])

Definition at line 97 of file disassemble.c.

Referenced by md_disasm().

 
#define cc2 (  )     strcat(dest,regs_hw[(int)RD_(inst)])

Definition at line 98 of file disassemble.c.

Referenced by md_disasm().

 
#define cn (  )     strcat(dest,regs_hw[(int)RD_(inst)])

Definition at line 93 of file disassemble.c.

Referenced by md_disasm().

 
#define cnft (  )     strcat(dest,regs_hw[(int)RT_(inst)])

Definition at line 96 of file disassemble.c.

Referenced by md_disasm().

 
#define comma (  )     strcat(dest,",")

Definition at line 83 of file disassemble.c.

Referenced by md_disasm().

 
#define fd (  )     strcat(dest,c1reg[(int)FD_(inst)])

#define FD_ ( x   )     (((x) >> 6) & ((1L << 5) - 1))

Definition at line 74 of file disassemble.c.

 
#define fs (  )     strcat(dest,c1reg[(int)FS_(inst)])

Definition at line 88 of file disassemble.c.

Referenced by md_disasm().

#define FS_ ( x   )     (((x) >> 11) & ((1L << 5) - 1))

Definition at line 72 of file disassemble.c.

 
#define ft (  )     strcat(dest,c1reg[(int)FT_(inst)])

Definition at line 89 of file disassemble.c.

Referenced by md_disasm().

#define FT_ ( x   )     (((x) >> 16) & ((1L << 5) - 1))

Definition at line 73 of file disassemble.c.

#define IMM_ ( x   )     (((x) >> 0) & ((1L << 16) - 1))

Definition at line 78 of file disassemble.c.

Referenced by imm(), md_disasm(), and simm().

 
#define rd (  )     strcat(dest,regname[(int)RD_(inst)])

Definition at line 84 of file disassemble.c.

Referenced by md_disasm().

#define RD_ ( x   )     (((x) >> 11) & ((1L << 5) - 1))

Definition at line 77 of file disassemble.c.

Referenced by md_disasm().

#define REGSZ_32   0

Definition at line 48 of file disassemble.c.

#define REGSZ_64   1

Definition at line 49 of file disassemble.c.

 
#define rs (  )     strcat(dest,regname[(int)RS_(inst)]), rsvalue = 0

Definition at line 85 of file disassemble.c.

Referenced by md_disasm().

#define RS_ ( x   )     (((x) >> 21) & ((1L << 5) - 1))

Definition at line 75 of file disassemble.c.

 
#define rt (  )     strcat(dest,regname[(int)RT_(inst)]), rtvalue = 0

Definition at line 86 of file disassemble.c.

Referenced by md_disasm().

#define RT_ ( x   )     (((x) >> 16) & ((1L << 5) - 1))

Definition at line 76 of file disassemble.c.

Referenced by md_disasm().

#define SHAMT_ ( x   )     (((x) >> 6) & ((1L << 5) - 1))

Definition at line 80 of file disassemble.c.

Referenced by md_disasm().

#define TARGET_ ( x   )     (((x) >> 0) & ((1L << 26) - 1))

Definition at line 79 of file disassemble.c.


Enumeration Type Documentation

enum TYPE

Enumerator:
RD_RS_RT 
RT_RS_IMM 
OFF 
RS_RT_OFF 
RS_OFF 
NONE 
RT_RD 
COFUN 
RD_RT 
RS_RT 
TARGET 
JALR 
RS 
RD_RT_SFT 
LOAD_STORE 
RT_IMM 
RD 
RD_RT_RS 
RD_RS 
RT_RS_SIMM 
RS_SIMM 
RT_SIMM 
JR 
RT_C0 
RT_C1 
RT_CN 
RT_CC1 
LDSTC0 
LDSTC1 
LDSTCN 
WORD 
RT_C2 
RT_CC2 
BPCODE 
CACHE_OP 
CP_OFF 
STORE 
STOREC1 
STORECN 
FT_FS_FD_D 
FT_FS_FD_S 
FS_FD_D 
FS_FD_S 
FS_FD_W 
FS_FD_L 
FT_FS_D 
FT_FS_S 
RT_RD_TO 
RT_CC1_TO 
RT_CN_TO 
RT_C0_TO 
RT_C1_TO 

Definition at line 51 of file disassemble.c.


Function Documentation

static int dispchist __P ( (int, int)   )  [static]

static void mkcomment __P ( (char *, char *, long)   )  [static]

static void imm __P ( (char *)   )  [static]

static const DISTBL* get_distbl __P ( (u_int32_t)   )  [static]

static int cmd_disas ( int  argc,
char **  argv 
) [static]

Definition at line 904 of file disassemble.c.

References jtag_inl(), lastaddr, and md_disasm().

00905 {
00906         static unsigned int lastaddr = 0xbfc00000;
00907         static unsigned int lastcount= 10;
00908         int i;
00909         char buf[256];
00910         if(argc > 1) lastaddr = strtoul(argv[1],0,0);
00911         if(argc > 2) lastcount = strtoul(argv[2],0,0);
00912 
00913         lastaddr &= ~3;
00914         for(i = 0;i< lastcount;i++,lastaddr += 4)
00915         {
00916         md_disasm(buf,lastaddr,jtag_inl(lastaddr));
00917         printf("%s\n",buf);
00918         }
00919 
00920         return 0;
00921 }

Here is the call graph for this function:

static const DISTBL* get_distbl ( u_int32_t  bits  )  [static]

Definition at line 472 of file disassemble.c.

References DISTBL.code, and DISTBL.mask.

Referenced by md_disasm().

00474 {
00475     const DISTBL *pt = distbl;
00476     static const DISTBL *lastpt = 0;
00477     static u_int32_t lastbits;
00478 
00479     /* simple cache for repeated lookups */
00480     if (lastpt && bits == lastbits)
00481       return lastpt;
00482 
00483     while ((bits & pt->mask) != pt->code)
00484         ++pt;
00485     lastpt = pt;
00486     lastbits = bits;
00487     return (pt);
00488 }

static void imm ( char *  dest  )  [static]

Definition at line 873 of file disassemble.c.

References IMM_, and mkcomment().

Referenced by md_disasm().

00875 {
00876     char            tmp[20];
00877     long            v;
00878 
00879     v = IMM_ (inst);
00880     sprintf (tmp, "0x%x", v);
00881     strcat (dest, tmp);
00882     mkcomment (dest, "# %d", v);
00883 }

Here is the call graph for this function:

void* md_disasm ( char *  dest,
void *  addr,
unsigned int  instcode 
)

Definition at line 511 of file disassemble.c.

References BPCODE, c0, c0ft, c1, c1ft, c2, CACHE_OP, cc1, cc2, cn, cnft, COFUN, comma, CP_OFF, fd, fs, FS_FD_D, FS_FD_L, FS_FD_S, FS_FD_W, ft, FT_FS_D, FT_FS_FD_D, FT_FS_FD_S, FT_FS_S, get_distbl(), imm(), IMM_, JALR, JR, LDSTC0, LDSTC1, LDSTCN, LOAD_STORE, mkcomment(), NONE, OFF, RD, rd, RD_, RD_RS, RD_RS_RT, RD_RT, RD_RT_RS, RD_RT_SFT, RS, rs, RS_OFF, RS_RT, RS_RT_OFF, RS_SIMM, rt, RT_, RT_C0, RT_C0_TO, RT_C1, RT_C1_TO, RT_C2, RT_CC1, RT_CC1_TO, RT_CC2, RT_CN, RT_CN_TO, RT_IMM, RT_RD, RT_RD_TO, RT_RS_IMM, RT_RS_SIMM, RT_SIMM, SHAMT_, simm(), STORE, STOREC1, STORECN, DISTBL.str, strccat(), TARGET, DISTBL.type, v1, and WORD.

Referenced by check_ejtag(), cmd_disas(), and fMIPS32_ExecuteDebugModule().

00516 {
00517     const DISTBL   *pt;
00518     char           tmp[40];
00519     long            v, v1, w;
00520     int             i;
00521 
00522         regname = regs_sw;
00523         c0reg = regs_c0;
00524         inst = instcode;
00525 
00526         sprintf (dest, "%08x", addr);
00527     sprintf (tmp, " %08x ", inst);
00528     strcat (dest, tmp);
00529 
00530     pt = get_distbl (inst);
00531     i = strlen (pt->str);
00532     strcat (dest, pt->str);
00533     do_rt = 0;
00534     do_rs = 0;
00535 
00536 
00537     while (i++ < 8)
00538         strcat (dest, " ");
00539     switch (pt->type) {
00540     case FT_FS_FD_D:
00541         fd (); comma (); fs (); comma (); ft ();
00542         break;
00543     case FT_FS_FD_S:
00544         fd (); comma (); fs (); comma (); ft ();
00545         break;
00546     case FS_FD_D:
00547         fd (); comma (); fs ();
00548         break;
00549     case FS_FD_S:
00550         fd (); comma (); fs ();
00551         break;
00552     case FS_FD_W:
00553         fd (); comma (); fs ();
00554         break;
00555     case FS_FD_L:
00556         fd (); comma (); fs ();
00557         break;
00558     case FT_FS_D:
00559         fs (); comma (); ft ();
00560         break;
00561     case FT_FS_S:
00562         fs (); comma (); ft ();
00563         break;
00564     case RT_RS_IMM:
00565         rt (); comma (); rs (); comma (); imm (dest);
00566         if (rflag )
00567         {
00568             sprintf (tmp, " rs=0x%x", rsvalue);
00569             strcat (dest, tmp);
00570         }
00571         break;
00572     case RT_RS_SIMM:
00573         rt (); comma (); rs (); comma (); simm (dest);
00574         if (rflag )
00575         {
00576             sprintf (tmp, " rs=0x%x", rsvalue);
00577             strcat (dest, tmp);
00578         }
00579         break;
00580     case RT_IMM:
00581         rt (); comma (); imm (dest);
00582         break;
00583     case RT_SIMM:
00584         rt (); comma (); simm (dest);
00585         break;
00586     case RS_SIMM:
00587         rs (); comma (); simm (dest);
00588         if (rflag )
00589         {
00590             sprintf (tmp, " rs=0x%x", rsvalue);
00591             strcat (dest, tmp);
00592         }
00593         break;
00594     case RT_RD:
00595         rt (); comma (); rd();
00596         break;
00597     case RT_RD_TO:
00598         rt (); comma (); rd();
00599         if (rflag )
00600             mkcomment( dest, "# rt=0x%x", rtvalue);
00601         break;
00602     case RD:
00603         rd ();
00604         break;
00605     case RD_RS:
00606         rd (); comma (); rs ();
00607         if (rflag )
00608             mkcomment( dest, "# rs=0x%x", rsvalue);
00609         break;
00610     case RT_C0:
00611         rt (); comma (); c0 ();
00612         break;
00613     case RT_C0_TO:
00614         rt (); comma (); c0 ();
00615         if (rflag )
00616             mkcomment( dest, "# rt=0x%x", rtvalue);
00617         break;
00618     case RT_C1:
00619         rt (); comma (); c1 ();
00620         break;
00621     case RT_C1_TO:
00622         rt (); comma (); c1 ();
00623         if (rflag )
00624             mkcomment( dest, "# rt=0x%x", rtvalue);
00625         break;
00626     case RT_C2:
00627         rt (); comma (); c2 ();
00628         break;
00629     case RT_CN:
00630         rt (); comma (); cn ();
00631         break;
00632     case RT_CN_TO:
00633         rt (); comma (); cn ();
00634         if (rflag )
00635             mkcomment( dest, "# rt=0x%x", rtvalue);
00636         break;
00637     case RT_CC1:
00638         rt (); comma (); cc1 ();
00639         break;
00640     case RT_CC1_TO:
00641         rt (); comma (); cc1 ();
00642         if (rflag )
00643             mkcomment( dest, "# rt=0x%x", rtvalue);
00644         break;
00645     case RT_CC2:
00646         rt (); comma (); cc2 ();
00647         break;
00648     case RD_RT_RS:
00649         rd (); comma (); rt (); comma (); rs();
00650         if (rflag )
00651         {
00652             mkcomment( dest, "# rt=0x%x", rtvalue);
00653             sprintf (tmp, " rs=0x%x", rsvalue);
00654             strcat (dest, tmp);
00655         }
00656         break;
00657     case JR:
00658     case RS:
00659         rs ();
00660         if (rflag )
00661             mkcomment( dest, "# rs=0x%x", rsvalue);
00662         break;
00663     case RD_RS_RT:
00664         rd (); comma ();
00665     case RS_RT:
00666         rs (); comma (); rt ();
00667         if (rflag )
00668         {
00669             mkcomment( dest, "# rs=0x%x ", rsvalue);
00670             sprintf (tmp, " rt=0x%x", rtvalue);
00671             strcat (dest, tmp);
00672         }
00673         break;
00674     case RD_RT:
00675         rd (); comma (); rt ();
00676         if (rflag )
00677             mkcomment( dest, "# rt=0x%x", rtvalue);
00678         break;
00679     case RD_RT_SFT:
00680         rd (); comma (); rt (); comma ();
00681         sprintf (tmp, "0x%x", SHAMT_ (inst));
00682         strcat (dest, tmp);
00683         mkcomment (dest, "# %d", SHAMT_ (inst));
00684         if (rflag )
00685         {
00686             sprintf (tmp, " rt=0x%x", rtvalue);
00687             strcat (dest, tmp);
00688         }
00689         break;
00690     case RS_RT_OFF:
00691     case RS_OFF:
00692         rs (); comma ();
00693         do_rs = 1;
00694         if (pt->type == RS_RT_OFF)
00695         {
00696             rt (); comma ();
00697             if (rflag )
00698                 do_rt = 1;
00699         }
00700     case CP_OFF:
00701     case OFF:
00702         v = IMM_ (inst);
00703         if (v & (1L << 15))
00704             v |= 0xffff0000L;
00705         v1 = (long)addr + 4 + (v << 2);
00706             sprintf (tmp, "%x", v1);
00707         strcat (dest, tmp);
00708         mkcomment (dest, "# 0x%08x", v1);
00709         if (rflag && do_rs )
00710         {
00711             sprintf (tmp, " rs=0x%x", rsvalue);
00712             strcat (dest, tmp);
00713             do_rs = 0;
00714         }
00715         if (rflag && do_rt )
00716         {
00717             sprintf (tmp, " rt=0x%x", rtvalue);
00718             strcat (dest, tmp);
00719             do_rt = 0;
00720         }
00721         break;
00722     case BPCODE:
00723         sprintf (tmp, "%d", (inst >> 16) & 0x3ff);
00724         strcat (dest, tmp);
00725         break;
00726     case COFUN:
00727         sprintf (tmp, "0x%x", inst & 0x01ffffffL);
00728         strcat (dest, tmp);
00729         break;
00730     case NONE:
00731         break;
00732     case TARGET:
00733         v = (inst & 0x03ffffff) << 2;
00734         v |= ((int)addr & 0xf0000000);
00735             sprintf (tmp, "%x", v);
00736         strcat (dest, tmp);
00737         mkcomment (dest, "# 0x%08x", v);
00738         break;
00739     case JALR:
00740         if (RD_ (inst) != 31L)
00741             rd (); comma ();
00742         rs ();
00743         if (rflag )
00744             mkcomment( dest, "# rs=0x%x", rsvalue);
00745         break;
00746     case LDSTC0:
00747         v = IMM_ (inst);
00748         if (v & (1L << 15))
00749             v |= 0xffff0000L;
00750         c0ft (); comma ();
00751         sprintf (tmp, "%d", v);
00752         strcat (dest, tmp);
00753         strcat (dest, "(");
00754         rs ();
00755         strcat (dest, ")");
00756         mkcomment (dest, "# 0x%x", v);
00757         if (rflag )
00758         {
00759             /* If wanting register contents, then add this too */
00760             sprintf (tmp, " addr=0x%x", (int)(v + rsvalue));
00761             strcat (dest, tmp);
00762         }
00763         break;
00764     case LDSTC1:
00765     case STOREC1:
00766         v = IMM_ (inst);
00767         if (v & (1L << 15))
00768             v |= 0xffff0000L;
00769         c1ft (); comma ();
00770         sprintf (tmp, "%d", v);
00771         strcat (dest, tmp);
00772         strcat (dest, "(");
00773         rs ();
00774         strcat (dest, ")");
00775         mkcomment (dest, "# 0x%x", v);
00776         if (rflag )
00777         {
00778             /* If wanting register contents, then add this too */
00779             sprintf (tmp, " addr=0x%x", (int)(v + rsvalue));
00780             strcat (dest, tmp);
00781         }
00782         break;
00783     case LDSTCN:
00784     case STORECN:
00785         v = IMM_ (inst);
00786         if (v & (1L << 15))
00787             v |= 0xffff0000L;
00788         cnft (); comma ();
00789         sprintf (tmp, "%d", v);
00790         strcat (dest, tmp);
00791         strcat (dest, "(");
00792         rs ();
00793         strcat (dest, ")");
00794         mkcomment (dest, "# 0x%x", v);
00795         if (rflag )
00796         {
00797             /* If wanting register contents, then add this too */
00798             sprintf (tmp, " addr=0x%x", (int)(v + rsvalue));
00799             strcat (dest, tmp);
00800         }
00801         break;
00802     case LOAD_STORE:
00803     case STORE:
00804         rt (); comma ();
00805     load_store:
00806         v = IMM_ (inst);
00807         if (v & (1L << 15))
00808             v |= 0xffff0000L;
00809         sprintf (tmp, "%d", v);
00810         strcat (dest, tmp);
00811         strcat (dest, "(");
00812         rs ();
00813         strcat (dest, ")");
00814         if (rflag )
00815         {
00816             /* If wanting register contents, then add this too */
00817             mkcomment( dest, "# addr=0x%x", (int)(v + rsvalue));
00818             if (pt->type == STORE )
00819             {
00820                 sprintf (tmp, " rt=0x%x", (int)rtvalue);
00821                 strcat (dest, tmp);
00822             }
00823         }
00824         else
00825         mkcomment (dest, "# 0x%x", v);
00826         break;
00827     case CACHE_OP:
00828         sprintf (tmp, "%d,", RT_(inst));
00829         strcat (dest, tmp);
00830         goto load_store;
00831     case WORD:
00832         sprintf (tmp, "%08x", inst);
00833         strcat (dest, tmp);
00834         strcat (dest, "      # ");
00835         w = (long)addr;
00836         for (i = 0; i < 4; i++) {
00837             v = ((char *)&inst)[i];
00838             w++;
00839             if (isprint (v))
00840                 strccat (dest, v);
00841             else
00842                 strccat (dest, '.');
00843         }
00844         break;
00845     }
00846     return (addr + 4L);
00847 }

Here is the call graph for this function:

static void mkcomment ( char *  p,
char *  fmt,
long  v 
) [static]

Definition at line 890 of file disassemble.c.

Referenced by imm(), md_disasm(), and simm().

00893 {
00894     char            tmp[20];
00895     int             n;
00896 
00897     for (n = 50 - strlen (p); n > 0; n--)
00898         strcat (p, " ");
00899     sprintf (tmp, fmt, v);
00900     strcat (p, tmp);
00901 }

mycmd_init ( disas  ,
cmd_disas  ,
"disas "  [addr][count],
"disas memory"   
)

static void simm ( char *  dest  )  [static]

Definition at line 854 of file disassemble.c.

References IMM_, and mkcomment().

Referenced by md_disasm().

00856 {
00857     char            tmp[20];
00858     long            v;
00859 
00860     v = IMM_ (inst);
00861     sprintf (tmp, "0x%x", v);
00862     strcat (dest, tmp);
00863     if (v & (1L << 15))
00864         v |= 0xffff0000L;
00865     mkcomment (dest, "# %d", v);
00866 }

Here is the call graph for this function:

static char* strccat ( char *  dst,
int  c 
) [static]

Definition at line 491 of file disassemble.c.

Referenced by md_disasm().

00492 {
00493         int len;
00494 
00495         if (!dst)
00496                 return (dst);
00497         len = strlen (dst);
00498         dst[len] = c;
00499         dst[len + 1] = 0;
00500         return (dst);
00501 }


Variable Documentation

const char* const* c0reg [static]

Definition at line 129 of file disassemble.c.

const char* const c1reg[] [static]

Initial value:

{
    "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7",
    "$f8", "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15",
    "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23",
    "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31"
}

Definition at line 142 of file disassemble.c.

long cur_loc [static]

Definition at line 106 of file disassemble.c.

const DISTBL distbl[] [static]

Definition at line 150 of file disassemble.c.

int do_rs [static]

Definition at line 507 of file disassemble.c.

int do_rt [static]

Definition at line 506 of file disassemble.c.

long inst [static]

Definition at line 106 of file disassemble.c.

const char* const* regname [static]

Definition at line 109 of file disassemble.c.

Referenced by cmd_set().

const char* const regs_c0[] [static]

Initial value:

{
    "C0_INX", "C0_RAND", "C0_TLBLO0", "C0_TLBLO1",
    "C0_CTEXT", "C0_PGMASK", "C0_WIRED", "C0_INFO",
    "C0_BADADDR", "C0_COUNT", "C0_TLBHI", "C0_COMPARE",
    "C0_SR", "C0_CAUSE", "C0_EPC", "C0_PRID",
    "C0_CONFIG", "C0_LLADDR", "C0_WATCHLO", "C0_WATCHHI", 
    "C0_XCTEXT", "C0_FRAMEMASK", "C0_DIAG", "C0_DEBUG", "C0_DEPC", "C0_PERF", 
    "C0_ECC", "C0_CACHERR", "C0_TAGLO", "C0_TAGHI", "C0_ERRPC", "C0_DESAVE"
}

Definition at line 131 of file disassemble.c.

const char* const regs_hw[] [static]

Initial value:

{
    "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7",
    "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
    "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",
    "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
}

Definition at line 121 of file disassemble.c.

const char* const regs_sw[] [static]

Initial value:

{
    "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
    "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
    "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
    "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra"
}

Definition at line 112 of file disassemble.c.

int rflag [static]

Definition at line 503 of file disassemble.c.

int rsvalue [static]

Definition at line 504 of file disassemble.c.

int rtvalue [static]

Definition at line 505 of file disassemble.c.

char* searching = "searching.. " [static]

Definition at line 107 of file disassemble.c.


Generated on Fri Nov 5 07:24:47 2010 for ejtag debug tools for loongson 232 cpu by  doxygen 1.5.6