Class BinaryDumpFormat

java.lang.Object
mars.mips.dump.AbstractDumpFormat
mars.mips.dump.BinaryDumpFormat
All Implemented Interfaces:
DumpFormat

public class BinaryDumpFormat extends AbstractDumpFormat
Class that represents the "binary" memory dump format. The output is a binary file containing the memory words as a byte stream. Output is produced using PrintStream's write() method.
Version:
December 2007
Author:
Pete Sanderson
  • Constructor Details

    • BinaryDumpFormat

      public BinaryDumpFormat()
      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 pure binary format. One byte at a time using PrintStream's write() method. Adapted by Pete Sanderson from code written by Greg Gibeling.
      Specified by:
      dumpMemoryRange in interface DumpFormat
      Specified by:
      dumpMemoryRange in class AbstractDumpFormat
      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.