mars.mips.dump
Class BinaryTextDumpFormat

java.lang.Object
  extended by mars.mips.dump.AbstractDumpFormat
      extended by mars.mips.dump.BinaryTextDumpFormat
All Implemented Interfaces:
DumpFormat

public class BinaryTextDumpFormat
extends AbstractDumpFormat

Class that represents the "binary text" memory dump format. The output is a text file with one word of MIPS memory per line. The word is formatted using '0' and '1' characters, e.g. 01110101110000011111110101010011.

Author:
Pete Sanderson

Constructor Summary
BinaryTextDumpFormat()
          Constructor.
 
Method Summary
 void dumpMemoryRange(File file, int firstAddress, int lastAddress)
          Write MIPS memory contents in binary text format.
 
Methods inherited from class mars.mips.dump.AbstractDumpFormat
getCommandDescriptor, getDescription, getFileExtension, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryTextDumpFormat

public BinaryTextDumpFormat()
Constructor. There is no standard file extension for this format.

Method Detail

dumpMemoryRange

public void dumpMemoryRange(File file,
                            int firstAddress,
                            int lastAddress)
                     throws AddressErrorException,
                            IOException
Write MIPS memory contents in binary text format. Each line of text contains one memory word written as 32 '0' and '1' characters. Written using PrintStream's println() 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.