decoder.h File Reference

#include <list>
#include "types.h"
#include "rtl.h"

Go to the source code of this file.

Classes

struct  DecodeResult
class  NJMCDecoder

Defines

#define addressToPC(pc)   pc
#define COND_JUMP(name, size, relocd, cond)
#define DEBUG_DECODER   (Boomerang::get()->debugDecoder)
#define DEBUG_STMTS
#define SETS(name, dest, cond)
#define SHOW_ASM(output)

Enumerations

enum  ICLASS {
  NCT, SD, DD, SCD,
  SCDAN, SCDAT, SU, SKIP,
  NOP, DU, NCTA
}

Functions

Byte getByte (ADDRESS lc)
DWord getDword (ADDRESS lc)
SWord getWord (ADDRESS lc)
bool isFuncPrologue (ADDRESS hostPC)
void not_used (int unwanted)

Variables

char * fp_names []
char * r16_names []
char * r32_names []
char * r8_names []
int scale []
char * sr16_names []


Define Documentation

#define addressToPC pc   )     pc
 

Definition at line 206 of file decoder.h.

Referenced by $c_br_nnull(), $c_br_null(), $c_c_nonneg(), $c_l_addr_none(), $c_s_addr_ma(), $c_s_addr_mb(), $c_s_addr_notm(), $daIndirect(), $daPostInc(), $daPreDec(), $dispA(), $imode(), $indirectA(), $rmode(), InstructionPatterns::bsr(), InstructionPatterns::call_(), and InstructionPatterns::call__().

#define COND_JUMP name,
size,
relocd,
cond   ) 
 

Value:

result.rtl = new RTL(pc, stmts); \
    BranchStatement* jump = new BranchStatement; \
    result.rtl->appendStmt(jump); \
    result.numBytes = size; \
    jump->setDest(relocd-delta); \
    jump->setCondType(cond); \
    SHOW_ASM(name<<" "<<relocd)

Definition at line 211 of file decoder.h.

Referenced by PentiumDecoder::decodeInstruction().

#define DEBUG_DECODER   (Boomerang::get()->debugDecoder)
 

Definition at line 191 of file decoder.h.

Referenced by genBSFR(), and NJMCDecoder::instantiate().

#define DEBUG_STMTS
 

Value:

std::list<Statement*>& lst = result.rtl->getList(); \
    if (DEBUG_DECODER) { \
        std::list<Statement*>::iterator ii; \
        for (ii = lst.begin(); ii != lst.end(); ii++) \
            std::cout << "          " << *ii << "\n"; \
    }

Definition at line 194 of file decoder.h.

Referenced by SparcDecoder::decodeInstruction().

#define SETS name,
dest,
cond   ) 
 

Value:

BoolAssign* bs = new BoolAssign(8); \
    bs->setLeftFromList(stmts); \
    stmts->clear();  \
    result.rtl = new RTL(pc, stmts); \
    result.rtl->appendStmt(bs); \
    bs->setCondType(cond); \
    result.numBytes = 3; \
    SHOW_ASM(name<<" "<<dest)

Definition at line 221 of file decoder.h.

Referenced by PentiumDecoder::decodeInstruction().

#define SHOW_ASM output   ) 
 

Value:

if (DEBUG_DECODER) \
    std::cout << std::hex << pc << std::dec << ": " << output << std::endl;

Definition at line 192 of file decoder.h.

Referenced by NJMCDecoder::computedCall(), NJMCDecoder::computedJump(), SparcDecoder::decodeInstruction(), PPCDecoder::decodeInstruction(), and NJMCDecoder::unconditionalJump().


Enumeration Type Documentation

enum ICLASS
 

Enumerator:
NCT 
SD 
DD 
SCD 
SCDAN 
SCDAT 
SU 
SKIP 
NOP 
DU 
NCTA 

Definition at line 38 of file decoder.h.


Function Documentation

Byte getByte ADDRESS  lc  ) 
 

DWord getDword ADDRESS  lc  ) 
 

Definition at line 37 of file sparc/disassembler.cpp.

Referenced by $c_br_nnull(), $c_br_null(), $c_c_nonneg(), $c_l_addr_none(), $c_s_addr_ma(), $c_s_addr_mb(), $c_s_addr_notm(), $dispA(), $imode(), $indirectA(), $rmode(), InstructionPatterns::c_br_nnull(), InstructionPatterns::c_br_null(), c_c_n(), InstructionPatterns::c_c_nonneg(), InstructionPatterns::c_l_addr_none(), c_null(), InstructionPatterns::c_s_addr_ma(), InstructionPatterns::c_s_addr_mb(), InstructionPatterns::c_s_addr_notm(), c_wcr(), InstructionPatterns::call__(), NJMCDecoder::decodeAssemblyInstruction(), dis_c_c_n(), dis_flt_c3(), InstructionPatterns::dispA(), InstructionPatterns::imode(), InstructionPatterns::indirectA(), is_null(), InstructionPatterns::LDO(), InstructionPatterns::mov_(), InstructionPatterns::restore_(), InstructionPatterns::ret(), InstructionPatterns::retl(), InstructionPatterns::rmode(), InstructionPatterns::sethi(), and InstructionPatterns::UNIMP().

SWord getWord ADDRESS  lc  ) 
 

Referenced by $daIndirect(), $daPostInc(), $daPreDec(), InstructionPatterns::addaw_d16(), InstructionPatterns::Aline(), InstructionPatterns::bsr(), InstructionPatterns::call_(), InstructionPatterns::daIndirect(), InstructionPatterns::daPostInc(), InstructionPatterns::daPreDec(), InstructionPatterns::leaSpSp(), InstructionPatterns::link(), InstructionPatterns::peaPcDisp(), InstructionPatterns::popreg(), InstructionPatterns::pushreg(), InstructionPatterns::rts(), InstructionPatterns::trap(), and InstructionPatterns::unlk().

bool isFuncPrologue ADDRESS  hostPC  ) 
 

Definition at line 1635 of file hppa/decoder.cpp.

References InstructionPatterns::link_save(), InstructionPatterns::link_save1(), NULL, InstructionPatterns::push_lea(), and InstructionPatterns::std_link().

void not_used int  unwanted  ) 
 

Definition at line 43 of file hppa/decoder_low.cpp.


Variable Documentation

char* fp_names[]
 

char* r16_names[]
 

char* r32_names[]
 

char* r8_names[]
 

int scale[]
 

char* sr16_names[]
 


Generated on Tue Sep 19 21:18:37 2006 for Boomerang by  doxygen 1.4.6