Package mars.mips.dump
Interface DumpFormat
- All Known Implementing Classes:
AbstractDumpFormat,AsciiTextDumpFormat,BinaryDumpFormat,BinaryTextDumpFormat,HexTextDumpFormat,IntelHexDumpFormat,SegmentWindowDumpFormat
public interface DumpFormat
Interface for memory dump file formats. All MARS needs to be able
to do is save an assembled program or data in the specified manner for
a given format. Formats are specified through classes
that implement this interface.
- Version:
- December 2007
- Author:
- Pete Sanderson
-
Method Summary
Modifier and TypeMethodDescriptionvoiddumpMemoryRange(File file, int firstAddress, int lastAddress) Write MIPS memory contents according to the specification for this format.A short one-word descriptor that will be used by the MARS command line parser (and the MARS command line user) to specify that this format is to be used.Get a short description of the format, suitable for displaying along with the extension, if any, in the file save dialog and also for displaying as a tool tip.Get the file extension associated with this format.toString()Descriptive name for the format.
-
Method Details
-
getFileExtension
String getFileExtension()Get the file extension associated with this format.- Returns:
- String containing file extension -- without the leading "." -- or null if there is no standard extension.
-
getDescription
String getDescription()Get a short description of the format, suitable for displaying along with the extension, if any, in the file save dialog and also for displaying as a tool tip.- Returns:
- String containing short description to go with the extension or as tool tip when mouse hovers over GUI component representing this format.
-
getCommandDescriptor
String getCommandDescriptor()A short one-word descriptor that will be used by the MARS command line parser (and the MARS command line user) to specify that this format is to be used. -
toString
String toString()Descriptive name for the format. -
dumpMemoryRange
void dumpMemoryRange(File file, int firstAddress, int lastAddress) throws AddressErrorException, IOException Write MIPS memory contents according to the specification for this format.- 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.
-