Beispiel #1
0
uint64 Pdb::GetCpuRegister(const Context& ctx, int sym)
{
	int q = GetRegisterList().Find(sym);
	if(q < 0)
		return 0;
	const CpuRegister& r = GetRegisterList()[q];
#ifdef CPU_64
	uint64 val = win64 ? GetRegister64(ctx, sym) : GetRegister32(ctx, sym);
#else
	uint64 val = GetRegister32(ctx, sym);
#endif
	switch(r.kind) {
	case REG_L:
		return LOBYTE(val);
	case REG_H:
		return HIBYTE(val);
	case REG_X:
		return LOWORD(val);
	case REG_E:
		return LODWORD(val);
	}
	return val;
}
std::string Thumb::LoadStoreMultipleInstruction::ToString() const
{
    std::stringstream stream;
    stream << Thumb::ToString(GetOpcode()) << " R" << GetRegister() << "!, {" ;

    std::bitset<8> registersBits(GetRegisterList());
    while (registersBits.count() > 0)
    {
        uint8_t bitIndex = 0;
        for (; bitIndex < 8 && !registersBits.test(bitIndex); ++bitIndex);

        stream << "R" << +bitIndex;
        registersBits[bitIndex] = false;
        if (registersBits.count() != 0)
            stream << ", ";
    }
    stream << "}";
    return stream.str();
}