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

ildis.h

Go to the documentation of this file.
00001 /*
00002  *      HT Editor
00003  *      ildis.h
00004  *
00005  *      Copyright (C) 1999-2002 Sebastian Biallas (sb@web-productions.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef ILDIS_H
00022 #define ILDIS_H
00023 
00024 #include "asm.h"
00025 #include "global.h"
00026 #include "ilopc.h"
00027 
00028 struct ILDisInsn {
00029         bool                            valid;
00030         int                             size;
00031         byte                op;
00032         dword                   data;
00033         dword                   data2;
00034         ILOpcodeTabEntry        *prefix;
00035         ILOpcodeTabEntry        *opcode;
00036 };
00037 
00038 /*
00039  *      CLASS alphadis
00040  */
00041 
00042 class ILDisassembler: public Disassembler {
00043 protected:
00044         char insnstr[256];
00045         ILDisInsn       insn;
00046         void *context;
00047         char* (*string_func)(dword string_ofs, void *context);
00048         char* (*token_func)(dword token, void *context);
00049 public:
00050                 ILDisassembler(char* (*string_func)(dword string_ofs, void *context), char* (*token_func)(dword token, void *context), void *context);
00051         virtual ~ILDisassembler();
00052 
00053         virtual dis_insn        *decode(byte *code, int maxlen, CPU_ADDR addr);
00054         virtual dis_insn        *duplicateInsn(dis_insn *disasm_insn);
00055         virtual void            getOpcodeMetrics(int &min_length, int &max_length, int &min_look_ahead, int &avg_look_ahead, int &addr_align);
00056         virtual byte            getSize(dis_insn *disasm_insn);
00057         virtual char            *getName();
00058         virtual char            *str(dis_insn *disasm_insn, int style);
00059         virtual char            *strf(dis_insn *disasm_insn, int style, char *format);
00060         virtual OBJECT_ID object_id() const;
00061         virtual bool            validInsn(dis_insn *disasm_insn);
00062 };
00063                                                                 
00064 #endif 

Generated on Fri May 7 21:15:40 2004 by doxygen 1.3.5