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

htdisasm.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      htdisasm.h
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.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 __HTDISASM_H__
00022 #define __HTDISASM_H__
00023 
00024 #include "asm.h"
00025 #include "htobj.h"
00026 #include "htformat.h"
00027 
00028 #define DESC_DISASM "disasm/x86"
00029 
00030 extern format_viewer_if htdisasm_if;
00031 
00032 void dialog_assemble(ht_format_viewer *f, viewer_pos vaddr, CPU_ADDR cpuaddr, Assembler *a, Disassembler *disasm, const char *default_str, UINT want_length);
00033 
00034 /*
00035  *      CLASS ht_disasm_viewer
00036  */
00037 
00038 class ht_disasm_sub;
00039 
00040 class ht_disasm_viewer: public ht_uformat_viewer {
00041 protected:
00042         Assembler *assem;
00043         Disassembler *disasm;
00044         int op1632;
00045 
00046 /* new */
00047         virtual ht_disasm_sub *get_disasm_sub();
00048 public:
00049                         void init(bounds *b, char *desc, int caps, ht_streamfile *file, ht_format_group *format_group, Assembler *a, Disassembler *d, int t);
00050         virtual         void done();
00051 /* overwritten */
00052         virtual char *func(UINT i, bool execute);
00053         virtual void get_pindicator_str(char *buf);
00054         virtual bool get_vscrollbar_pos(int *pstart, int *psize);
00055         virtual void handlemsg(htmsg *msg);
00056         virtual bool offset_to_pos(FILEOFS ofs, viewer_pos *addr);
00057         virtual bool pos_to_offset(viewer_pos addr, FILEOFS *ofs);
00058         virtual bool qword_to_pos(qword q, viewer_pos *pos);
00059         virtual int ref_sel(LINE_ID *id);
00060         virtual int symbol_handler(eval_scalar *result, char *name);
00061 };
00062 
00063 /*
00064  *      CLASS ht_disasm_sub
00065  */
00066 
00067 class ht_disasm_sub: public ht_linear_sub {
00068 private:
00069         Disassembler *disasm;
00070         bool own_disasm;
00071         int display_style;
00072 public:
00073                         void init(ht_streamfile *file, FILEOFS ofs, int size, Disassembler *disasm, bool own_disasm, int display_style);
00074         virtual         void done();
00075 /* overwritten */
00076         virtual bool convert_ofs_to_id(const FILEOFS offset, LINE_ID *line_id);
00077         virtual bool convert_id_to_ofs(const LINE_ID line_id, FILEOFS *offset);
00078         virtual void first_line_id(LINE_ID *line_id);
00079         virtual bool getline(char *line, const LINE_ID line_id);
00080         virtual void last_line_id(LINE_ID *line_id);
00081         virtual int next_line_id(LINE_ID *line_id, int n);
00082         virtual int prev_line_id(LINE_ID *line_id, int n);
00083 };
00084 
00085 #endif /* !__HTDISASM_H__ */
00086 

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