00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
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
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
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
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
00086