00001 /* 00002 * Copyright (C) 2005, Mike Van Emmerik 00003 * 00004 * See the file "LICENSE.TERMS" for information on usage and 00005 * redistribution of this file, and for a DISCLAIMER OF ALL 00006 * WARRANTIES. 00007 * 00008 */ 00009 00010 /*============================================================================== 00011 * FILE: st20decoder.h 00012 * OVERVIEW: The definition of the instruction decoder for ST20. 00013 *============================================================================*/ 00014 00015 /* 00016 * $Revision: 1.1 $ 00017 * 10/Mar/05 MVE and Dr Aus: Created. 00018 */ 00019 00020 #ifndef ST20DECODER 00021 #define ST20DECODER 00022 00023 class Prog; 00024 class NJMCDecoder; 00025 struct DecodeResult; 00026 00027 class ST20Decoder : public NJMCDecoder 00028 { 00029 public: 00030 /* Default constructor 00031 */ 00032 ST20Decoder(); 00033 00034 /** 00035 * Decodes the machine instruction at pc and returns an RTL instance for 00036 * the instruction. 00037 */ 00038 virtual DecodeResult& decodeInstruction (ADDRESS pc, int delta); 00039 00040 /* 00041 * Disassembles the machine instruction at pc and returns the number of 00042 * bytes disassembled. Assembler output goes to global _assembly 00043 */ 00044 virtual int decodeAssemblyInstruction (ADDRESS pc, int delta); 00045 00046 00047 private: 00048 /* 00049 * Various functions to decode the operands of an instruction into 00050 * a SemStr representation. 00051 */ 00052 //Exp* dis_Eaddr(ADDRESS pc, int size = 0); 00053 //Exp* dis_RegImm(ADDRESS pc); 00054 //Exp* dis_Reg(unsigned r); 00055 //Exp* dis_RAmbz(unsigned r); // Special for rA of certain instructions 00056 00057 void unused(int x); 00058 RTL* createBranchRtl(ADDRESS pc, std::list<Statement*>* stmts, 00059 const char* name); 00060 bool isFuncPrologue(ADDRESS hostPC); 00061 DWord getDword(ADDRESS lc); 00062 SWord getWord(ADDRESS lc); 00063 Byte getByte(ADDRESS lc); 00064 00065 }; 00066 00067 #endif