00001 /* 00002 * HT Editor 00003 * alphadis.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 ALPHADIS_H 00022 #define ALPHADIS_H 00023 00024 #include "global.h" 00025 #include "asm.h" 00026 #include "alphaopc.h" 00027 00028 struct alphadis_insn { 00029 bool valid; 00030 int size; /* only useful if invalid (else 4) */ 00031 long data; /* must be signed */ 00032 word code; 00033 byte regA; 00034 byte regB; 00035 byte regC; 00036 alpha_opcode_tab_entry *table; 00037 }; 00038 00039 /* 00040 * CLASS alphadis 00041 */ 00042 00043 class Alphadis: public Disassembler { 00044 protected: 00045 char insnstr[256]; 00046 alphadis_insn insn; 00047 public: 00048 Alphadis(); 00049 virtual ~Alphadis(); 00050 00051 int load(ht_object_stream *f); 00052 virtual dis_insn *decode(byte *code, int maxlen, CPU_ADDR addr); 00053 virtual dis_insn *duplicateInsn(dis_insn *disasm_insn); 00054 virtual void getOpcodeMetrics(int &min_length, int &max_length, int &min_look_ahead, int &avg_look_ahead, int &addr_align); 00055 virtual byte getSize(dis_insn *disasm_insn); 00056 virtual char *getName(); 00057 virtual void store(ht_object_stream *f); 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 00065