Package mars.mips.dump
Class AsciiTextDumpFormat
java.lang.Object
mars.mips.dump.AbstractDumpFormat
mars.mips.dump.AsciiTextDumpFormat
- All Implemented Interfaces:
DumpFormat
Class that represents the "ASCII text" memory dump format. Memory contents
are interpreted as ASCII codes. The output is a text file with one word of
MIPS memory per line. The word is formatted to leave three spaces for each
character. Non-printing characters rendered as period (.) as placeholder.
Common escaped characters rendered using backslash and single-character
descriptor, e.g. \t for tab.
- Version:
- December 2010
- Author:
- Pete Sanderson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dumpMemoryRange(File file, int firstAddress, int lastAddress)
Interpret MIPS memory contents as ASCII characters.Methods inherited from class mars.mips.dump.AbstractDumpFormat
getCommandDescriptor, getDescription, getFileExtension, toString
-
Constructor Details
-
AsciiTextDumpFormat
public AsciiTextDumpFormat()Constructor. There is no standard file extension for this format.
-
-
Method Details
-
dumpMemoryRange
public void dumpMemoryRange(File file, int firstAddress, int lastAddress) throws AddressErrorException, IOExceptionInterpret MIPS memory contents as ASCII characters. Each line of text contains one memory word written in ASCII characters. Those corresponding to tab, newline, null, etc are rendered as backslash followed by single-character code, e.g. \t for tab, \0 for null. Non-printing character (control code, values above 127) is rendered as a period (.). 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.
-