76 static size_t displayedCount = 1;
77 static size_t lastDisplayedAddress = 0;
78 static size_t MAUsToDisplay = 1;
80 const int argumentCount = arguments.size() - 1;
89 bool illegalArguments =
false;
90 size_t newDisplayedCount = displayedCount;
91 size_t newMAUCount = MAUsToDisplay;
92 size_t newDisplayedAddress = lastDisplayedAddress + MAUsToDisplay;
93 std::string addressSpaceName =
"";
94 std::string fileName =
"";
95 for (
size_t i = 1; i < arguments.size(); ++i) {
97 if (i == arguments.size() - 1 ||
99 illegalArguments =
true;
103 static_cast<size_t>(arguments.at(i + 1).integerValue());
106 if (i == arguments.size() - 1) {
107 illegalArguments =
true;
110 const std::string size = arguments.at(i + 1).stringValue();
118 illegalArguments =
true;
123 if (i == arguments.size() - 1) {
124 illegalArguments =
true;
127 addressSpaceName = arguments.at(i + 1).stringValue();
130 if (i == arguments.size() - 1) {
131 illegalArguments =
true;
134 fileName = arguments.at(i + 1).stringValue();
136 }
else if (i == arguments.size() - 1) {
137 const std::string addressString = arguments.at(i).stringValue();
139 addressString, addressSpaceName, newDisplayedAddress)) {
143 illegalArguments =
true;
148 if (illegalArguments) {
156 displayedCount = newDisplayedCount;
157 lastDisplayedAddress = newDisplayedAddress;
170 addressSpace(addressSpaceName).width();
175 (boost::format(
"Maximum printable integer size %d.") %
181 std::ofstream* out = NULL;
182 const bool dumpToFile = fileName !=
"";
184 if (MAUSize !=
sizeof(
char)*8) {
187 "Can only dump 8 bit memories to files. The given "
188 "address space is %d.") % MAUSize).str());
193 out =
new std::ofstream(fileName.c_str(), std::ios::binary);
196 MAUsToDisplay = newMAUCount;
199 while (newDisplayedCount > 0) {
203 memory->read(newDisplayedAddress, MAUsToDisplay, data);
214 newDisplayedAddress += MAUsToDisplay;
217 const int HEX_DIGITS = MAUSize*newMAUCount/4;
222 if (newDisplayedCount > 0) {