Package mars.util
Class MemoryDump
java.lang.Object
mars.util.MemoryDump
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
Get the MIPS memory base address(es) of the specified segment name(s).static int[]
Get the MIPS memory limit address(es) of the specified segment name(s).static Integer[]
getSegmentBounds
(String segment) Return array with segment address bounds for specified segment.static String[]
Get the names of segments available for memory dump.
-
Constructor Details
-
MemoryDump
public MemoryDump()
-
-
Method Details
-
getSegmentBounds
Return array with segment address bounds for specified segment.- Parameters:
segment
- String with segment name (initially ".text" and ".data")- Returns:
- array of two Integer, the base and limit address for that segment. Null if parameter name does not match a known segment name.
-
getSegmentNames
Get the names of segments available for memory dump.- Returns:
- array of Strings, each string is segment name (e.g. ".text", ".data")
-
getBaseAddresses
public static int[] getBaseAddresses()Get the MIPS memory base address(es) of the specified segment name(s). If invalid segment name is provided, will throw NullPointerException, so I recommend getting segment names from getSegmentNames().- Returns:
- Array of int containing corresponding base addresses.
-
getLimitAddresses
public static int[] getLimitAddresses()Get the MIPS memory limit address(es) of the specified segment name(s). If invalid segment name is provided, will throw NullPointerException, so I recommend getting segment names from getSegmentNames().- Returns:
- Array of int containing corresponding limit addresses.
-