Package mars.mips.dump
Class HexTextDumpFormat
java.lang.Object
mars.mips.dump.AbstractDumpFormat
mars.mips.dump.HexTextDumpFormat
- All Implemented Interfaces:
DumpFormat
Class that represents the "hexadecimal text" memory dump format. The output
is a text file with one word of MIPS memory per line. The word is formatted
using hexadecimal characters, e.g. 3F205A39.
- Version:
- December 2007
- Author:
- Pete Sanderson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dumpMemoryRange
(File file, int firstAddress, int lastAddress) Write MIPS memory contents in hexadecimal text format.Methods inherited from class mars.mips.dump.AbstractDumpFormat
getCommandDescriptor, getDescription, getFileExtension, toString
-
Constructor Details
-
HexTextDumpFormat
public HexTextDumpFormat()Constructor. There is no standard file extension for this format.
-
-
Method Details
-
dumpMemoryRange
public void dumpMemoryRange(File file, int firstAddress, int lastAddress) throws AddressErrorException, IOException Write MIPS memory contents in hexadecimal text format. Each line of text contains one memory word written in hexadecimal characters. Written using PrintStream's println() method. Adapted by Pete Sanderson from code written by Greg Gibeling.- Specified by:
dumpMemoryRange
in interfaceDumpFormat
- Specified by:
dumpMemoryRange
in classAbstractDumpFormat
- Parameters:
file
- File in which to store MIPS memory contents.firstAddress
- first (lowest) memory address to dump. In bytes but must be on word boundary.lastAddress
- last (highest) memory address to dump. In bytes but must be on word boundary. Will dump the word that starts at this address.- Throws:
AddressErrorException
- if firstAddress is invalid or not on a word boundary.IOException
- if error occurs during file output.
-