dump (Copy part of a file to stdout)

The dump tool is used in the scripts that initialize the instruction and data memories for the mMIPS processors such as ./c_prog/gossip/dolcc. dump echoes a portion of the file filename to stdout. The sources are in c_prog/dump.

Syntax: dump filename [options] [first_byte_pos [last_byte_pos [fill_char]]]

Table 1: Arguments of dump and their meanings.

Argument Description
filename The file to process.
options Can be -ch32 to change the byte order from little endian to big endian on a 4 byte basis.
first_byte_pos Postition of the first byte. The first byte of a file has position 0. The last byte in the file has index SizeOfFileInBytes(filename)-1. If first_byte_pos exceeds this value dump outputs last_byte_pos-first_byte_pos+1 characters fill_char.
last_byte_pos file_size_in_bytes-1 if absent.
fill_char The character that should fill the gap between last_byte_pos and file_size_in_bytes-1. A backslash followed by a number denotes a character code.