当前位置: 首页>>代码示例>>C++>>正文


C++ Memory::Get方法代码示例

本文整理汇总了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);
}
开发者ID:trieck,项目名称:source,代码行数:9,代码来源:disassem.cpp

示例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;
}
开发者ID:trieck,项目名称:source,代码行数:11,代码来源:StackView.cpp

示例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;
}
开发者ID:trieck,项目名称:source,代码行数:91,代码来源:disassem.cpp


注:本文中的Memory::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。