Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Assembler Class Reference

#include <asm.h>

Inheritance diagram for Assembler:

Object x86asm List of all members.

Public Member Functions

 Assembler (bool bigendian)
 ~Assembler ()
virtual asm_insnalloc_insn ()
virtual asm_codeencode (asm_insn *asm_insn, int options, CPU_ADDR cur_address)
char * get_error_msg ()
virtual char * get_name ()
virtual int translate_str (asm_insn *asm_insn, const char *s)
void set_error_msg (char *format,...)
void set_imm_eval_proc (int(*imm_eval_proc)(void *context, char **s, dword *v), void *imm_eval_context)
asm_codeshortest (asm_code *codes)

Protected Member Functions

void emitbyte (byte b)
void emitword (word w)
void emitdword (dword d)
void free_asm_codes ()
void deletecode (asm_code *c)
void clearcode ()
void newcode ()
void pushcode ()

Protected Attributes

int(* imm_eval_proc )(void *context, char **s, dword *v)
void * imm_eval_context
asm_codecodes
asm_code code
char error_msg [256]
bool error
int options
bool bigendian

Constructor & Destructor Documentation

Assembler::Assembler bool  bigendian  ) 
 

Definition at line 42 of file asm.cc.

References bigendian, and codes.

Assembler::~Assembler  ) 
 

Definition at line 48 of file asm.cc.


Member Function Documentation

asm_insn * Assembler::alloc_insn  )  [virtual]
 

Reimplemented in x86asm.

Definition at line 52 of file asm.cc.

References asm_insn, and NULL.

Referenced by dialog_assemble().

void Assembler::clearcode  )  [protected]
 

Definition at line 79 of file asm.cc.

References code, and asm_code::size.

Referenced by x86asm::encode_insn().

void Assembler::deletecode asm_code c  )  [protected]
 

Definition at line 57 of file asm.cc.

References codes, and asm_code::next.

Referenced by x86asm::delete_nonsense_insn().

void Assembler::emitbyte byte  b  )  [protected]
 

Definition at line 84 of file asm.cc.

References code, asm_code::data, and asm_code::size.

Referenced by x86asm::encode_insn().

void Assembler::emitdword dword  d  )  [protected]
 

Definition at line 102 of file asm.cc.

References bigendian, byte, code, asm_code::data, and asm_code::size.

Referenced by x86asm::encode_insn().

void Assembler::emitword word  w  )  [protected]
 

Definition at line 90 of file asm.cc.

References bigendian, byte, code, asm_code::data, and asm_code::size.

Referenced by x86asm::encode_insn().

asm_code * Assembler::encode asm_insn asm_insn,
int  options,
CPU_ADDR  cur_address
[virtual]
 

Reimplemented in x86asm.

Definition at line 71 of file asm.cc.

References asm_insn, error, free_asm_codes(), and options.

Referenced by dialog_assemble(), and x86asm::encode().

void Assembler::free_asm_codes  )  [protected]
 

Definition at line 118 of file asm.cc.

References codes, and asm_code::next.

Referenced by x86asm::encode(), and encode().

char * Assembler::get_error_msg  ) 
 

Definition at line 127 of file asm.cc.

References error_msg.

Referenced by dialog_assemble().

char * Assembler::get_name  )  [virtual]
 

Reimplemented in x86asm.

Definition at line 132 of file asm.cc.

Referenced by dialog_assemble().

void Assembler::newcode  )  [protected]
 

Definition at line 137 of file asm.cc.

References code, and asm_code::size.

Referenced by x86asm::encode(), x86asm::match_fopcodes(), and x86asm::match_opcode_final().

void Assembler::pushcode  )  [protected]
 

Definition at line 156 of file asm.cc.

References code, codes, and asm_code::next.

Referenced by x86asm::match_fopcodes(), and x86asm::match_opcode_final().

void Assembler::set_error_msg char *  format,
... 
 

Definition at line 173 of file asm.cc.

References error, and error_msg.

Referenced by x86asm::encode(), and x86asm::translate_str().

void Assembler::set_imm_eval_proc int(*  imm_eval_proc)(void *context, char **s, dword *v),
void *  imm_eval_context
 

Definition at line 182 of file asm.cc.

References imm_eval_context, and imm_eval_proc.

Referenced by ht_disasm_viewer::handlemsg(), and ht_aviewer::handlemsg().

asm_code * Assembler::shortest asm_code codes  ) 
 

Definition at line 142 of file asm.cc.

References dword, asm_code::next, and asm_code::size.

int Assembler::translate_str asm_insn asm_insn,
const char *  s
[virtual]
 

Reimplemented in x86asm.

Definition at line 168 of file asm.cc.

References asm_insn.

Referenced by dialog_assemble().


Member Data Documentation

bool Assembler::bigendian [protected]
 

Definition at line 66 of file asm.h.

Referenced by Assembler(), emitdword(), and emitword().

asm_code Assembler::code [protected]
 

Definition at line 62 of file asm.h.

Referenced by clearcode(), emitbyte(), emitdword(), emitword(), newcode(), and pushcode().

asm_code* Assembler::codes [protected]
 

Definition at line 61 of file asm.h.

Referenced by Assembler(), deletecode(), free_asm_codes(), and pushcode().

bool Assembler::error [protected]
 

Definition at line 64 of file asm.h.

Referenced by encode(), and set_error_msg().

char Assembler::error_msg[256] [protected]
 

Definition at line 63 of file asm.h.

Referenced by get_error_msg(), and set_error_msg().

void* Assembler::imm_eval_context [protected]
 

Definition at line 59 of file asm.h.

Referenced by set_imm_eval_proc().

int(* Assembler::imm_eval_proc)(void *context, char **s, dword *v) [protected]
 

Referenced by x86asm::opmem(), x86asm::opplugimm(), and set_imm_eval_proc().

int Assembler::options [protected]
 

Definition at line 65 of file asm.h.

Referenced by encode().


The documentation for this class was generated from the following files:
Generated on Fri May 7 21:15:54 2004 by doxygen 1.3.5