本文整理汇总了C++中Memory::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ Memory::Get方法的具体用法?C++ Memory::Get怎么用?C++ Memory::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memory
的用法示例。
在下文中一共展示了Memory::Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get
CString Disassembler::Get(USHORT &address)
{
Memory *mem = Memory::instance();
BYTE b = mem->Get(address);
const Instruction *pInstr = instructions[b];
return FormatInstruction(pInstr, b, address);
}
示例2: GetLine
CString StackView::GetLine(USHORT i)
{
static const TCHAR line[] = _T("$1%.2hX: %.2hX");
TCHAR buf[10];
Memory* mem = Memory::instance();
_stprintf(buf, line, 0xff - i, mem->Get(0x1ff - i));
return buf;
}
示例3: FormatInstruction
CString Disassembler::FormatInstruction(const Instruction *pInstr,
USHORT &address)
{
Memory *mem = Memory::instance();
BYTE b1, b2;
CString output;
switch (pInstr->mode) {
case IMMEDIATE:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s #$%.2hX"),
b1, pInstr->mnemonic, b1);
break;
case _ABSOLUTE:
address++;
b1 = mem->Get(address++);
b2 = mem->Get(address++);
output.Format(_T("%.2hX %.2hX %s $%.4hX"),
b1, b2, pInstr->mnemonic, MAKEWORD(b1, b2));
break;
case ZPAGE:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s $%.2hX"),
b1, pInstr->mnemonic, b1);
break;
case ACCUM:
address++;
output.Format(_T(" %s"), pInstr->mnemonic);
break;
case IMPLIED:
address++;
output.Format(_T(" %s"), pInstr->mnemonic);
break;
case INDX:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s ($%.2hX, X)"),
b1, pInstr->mnemonic, b1);
break;
case INDY:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s ($%.2hX), Y"),
b1, pInstr->mnemonic, b1);
break;
case ZPAGEX:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s $%.2hX, X"),
b1, pInstr->mnemonic, b1);
break;
case ABSX:
address++;
b1 = mem->Get(address++);
b2 = mem->Get(address++);
output.Format(_T("%.2hX %.2hX %s $%.4hX, X"),
b1, b2, pInstr->mnemonic, MAKEWORD(b1, b2));
break;
case ABSY:
address++;
b1 = mem->Get(address++);
b2 = mem->Get(address++);
output.Format(_T("%.2hX %.2hX %s $%.4hX, Y"),
b1, b2, pInstr->mnemonic, MAKEWORD(b1, b2));
break;
case IND:
address++;
b1 = mem->Get(address++);
b2 = mem->Get(address++);
output.Format(_T("%.2hX %.2hX %s ($%.4hX)"),
b1, b2, pInstr->mnemonic, MAKEWORD(b1, b2));
break;
case ZPAGEY:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s $%.2hX, Y"),
b1, pInstr->mnemonic, b1);
break;
case _RELATIVE:
address++;
b1 = mem->Get(address++);
output.Format(_T("%.2hX %s $%.2hX"),
b1, pInstr->mnemonic, b1);
break;
};
return output;
}