## mars.mips.dump
Class SegmentWindowDumpFormat

    java.lang.Object
      mars.mips.dump.AbstractDumpFormat
          mars.mips.dump.SegmentWindowDumpFormat

All Implemented Interfaces:
  DumpFormat

    public class SegmentWindowDumpFormat

extends AbstractDumpFormat

Dump MIPS memory contents in Segment Window format. Each line of text output resembles the Text Segment Window or Data Segment Window depending on which segment is selected for the dump. Written using PrintStream's println() method. Each line of Text Segment Window represents one word of text segment memory. The line includes (1) address, (2) machine code in hex, (3) basic instruction, (4) source line. Each line of Data Segment Window represents 8 words of data segment memory. The line includes address of first word for that line followed by 8 32-bit values. In either case, addresses and values are displayed in decimal or hexadecimal representation according to the corresponding settings.

Author:
  Pete Sanderson

Constructor Summary
`SegmentWindowDumpFormat()` Constructor.

Method Summary
`void` `dumpMemoryRange(File file, int firstAddress, int lastAddress)` Write MIPS memory contents in Segment Window 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

### SegmentWindowDumpFormat

    public SegmentWindowDumpFormat()

  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 Segment Window format. Each line of text output resembles the Text Segment Window or Data Segment Window depending on which segment is selected for the dump. Written using PrintStream's println() method.

  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.