本文整理汇总了C++中VirtualMachine::IsValidMem方法的典型用法代码示例。如果您正苦于以下问题:C++ VirtualMachine::IsValidMem方法的具体用法?C++ VirtualMachine::IsValidMem怎么用?C++ VirtualMachine::IsValidMem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtualMachine
的用法示例。
在下文中一共展示了VirtualMachine::IsValidMem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateContent
void ProgramMonitor::UpdateContent(const VirtualMachine &vm)
{
_addrToRowMap.clear();
_rowToAddrMap.clear();
DeleteAllItems();
int iRow = 0;
for (unsigned char addr = 0x00; vm.IsValidMem(addr) &&
addr < VirtualMachine::ADDR_REGISTER; ) {
const Operator *pOperator = vm.GetOperatorMap().Find(vm.GetMem(addr));
if (pOperator == NULL) break;
_addrToRowMap[addr] = iRow;
_rowToAddrMap[iRow] = addr;
InsertItem(iRow, wxT(""));
SetItem(iRow, COL_Address, wxString::Format(wxT("%02X"), addr));
SetItem(iRow, COL_Symbol, pOperator->GetSymbol(_upperCaseFlag));
SetItem(iRow, COL_Code, wxString::Format(wxT("%X"), pOperator->GetCode()));
iRow++;
if (pOperator->GetType() == Operator::TYPE_NoOperand) {
// nothing to do
} else if (pOperator->GetType() == Operator::TYPE_NibbleOperand) {
unsigned char value = pOperator->FetchOperand(vm, addr);
_addrToRowMap[addr + 1] = iRow;
_rowToAddrMap[iRow] = addr + 1;
InsertItem(iRow, wxT(""));
SetItem(iRow, COL_Address, wxString::Format(wxT("%02X"), addr + 1));
SetItem(iRow, COL_Symbol, wxString::Format(wxT("<%X>"), value));
SetItem(iRow, COL_Code, wxString::Format(wxT("%X"), value));
iRow++;
} else if (pOperator->GetType() == Operator::TYPE_JUMP) {
unsigned char addrDest = pOperator->FetchOperand(vm, addr);
_addrToRowMap[addr + 1] = iRow;
_rowToAddrMap[iRow] = addr + 1;
InsertItem(iRow, wxT(""));
SetItem(iRow, COL_Address, wxString::Format(wxT("%02X"), addr + 1));
SetItem(iRow, COL_Symbol, wxString::Format(wxT("<%X>"), addrDest >> 4));
SetItem(iRow, COL_Code, wxString::Format(wxT("%X"), addrDest >> 4));
iRow++;
_addrToRowMap[addr + 2] = iRow;
_rowToAddrMap[iRow] = addr + 2;
InsertItem(iRow, wxT(""));
SetItem(iRow, COL_Address, wxString::Format(wxT("%02X"), addr + 2));
SetItem(iRow, COL_Symbol, wxString::Format(wxT("<%X>"), addrDest & 0xf));
SetItem(iRow, COL_Code, wxString::Format(wxT("%X"), addrDest & 0xf));
iRow++;
} else if (pOperator->GetType() == Operator::TYPE_CAL) {