Beispiel #1
0
CString Disassembler::Get(USHORT &address)
{
    Memory *mem = Memory::instance();
    BYTE b = mem->Get(address);

    const Instruction *pInstr = instructions[b];

    return FormatInstruction(pInstr, b, address);
}
Beispiel #2
0
void CArmInstruction::writeTempData(TempData& tempData)
{
	char OpcodeName[32];
	char str[256];

	FormatOpcode(OpcodeName,Opcode.name);
	int pos = sprintf(str,"   %s",OpcodeName);
	while (pos < 11) str[pos++] = ' ';
	str[pos] = 0;
	FormatInstruction(Opcode.mask,&str[pos]);

	tempData.writeLine(RamPos,convertUtf8ToWString(str));
}
Beispiel #3
0
CString Disassembler::FormatInstruction(const Instruction *pInstr,
                                        BYTE b, USHORT &address)
{
    CString output;
    USHORT save = address;

    if (pInstr == NULL) {
        output.Format(_T("$%.4hX: %.2hX ???"), address++, b);
    } else {
        output.Format(_T("$%.4hX: %.2hX %s"), save, b,
                      FormatInstruction(pInstr, address));
    }

    return output;
}
Beispiel #4
0
MEDUSA_NAMESPACE_BEGIN

  bool Architecture::FormatCell(
  Document      const& rDoc,
  BinaryStream  const& rBinStrm,
  Address       const& rAddr,
  Cell          const& rCell,
  std::string        & rStrCell,
  Cell::Mark::List   & rMarks) const
{
  switch (rCell.GetType())
  {
  case Cell::InstructionType: return FormatInstruction(rDoc, rBinStrm, rAddr, static_cast<Instruction const&>(rCell), rStrCell, rMarks);
  case Cell::ValueType:       return FormatValue      (rDoc, rBinStrm, rAddr, static_cast<Value       const&>(rCell), rStrCell, rMarks);
  case Cell::CharacterType:   return FormatCharacter  (rDoc, rBinStrm, rAddr, static_cast<Character   const&>(rCell), rStrCell, rMarks);
  case Cell::StringType:      return FormatString     (rDoc, rBinStrm, rAddr, static_cast<String      const&>(rCell), rStrCell, rMarks);
  default:                    return false;
  }
}
Beispiel #5
0
bool Architecture::FormatCell(
    Document      const& rDoc,
    Address       const& rAddr,
    Cell          const& rCell,
    PrintData          & rPrintData) const
{
    switch (rCell.GetType())
    {
    case Cell::InstructionType:
        return FormatInstruction(rDoc, rAddr, static_cast<Instruction const&>(rCell), rPrintData);
    case Cell::ValueType:
        return FormatValue      (rDoc, rAddr, static_cast<Value       const&>(rCell), rPrintData);
    case Cell::CharacterType:
        return FormatCharacter  (rDoc, rAddr, static_cast<Character   const&>(rCell), rPrintData);
    case Cell::StringType:
        return FormatString     (rDoc, rAddr, static_cast<String      const&>(rCell), rPrintData);
    default:
        return false;
    }
}