com.tapina.robe.runtime
Class MemoryMap

java.lang.Object
  extended bycom.tapina.robe.runtime.BinaryDataSource
      extended bycom.tapina.robe.runtime.MemoryMap

public final class MemoryMap
extends BinaryDataSource

This class represents the memory map of a running application. Some of the memory map is shared between applications and is therefore represented as static fields.


Constructor Summary
MemoryMap(int loadAddress, byte[] image)
           
 
Method Summary
 CodeBlock addEntryPoint(CodeBlock codeBlock)
           
 CodeBlock addEntryPoint(int address)
           
 DataBlock claimRmaBlock(int length)
           
 RawDataBlock createDataBlock(int address, int length)
           
 DynamicArea createDynamicArea(int initialSize, int maximumSize, int handlerRoutine, int handlerWorkspace, java.lang.String name, int privileges, int flags)
          Create a new dynamic area.
 RawDataBlock createErrorBlock(int size)
           
 RawDataBlock createSystemDataBlock(int length)
           
 RawDataBlock createSystemDataBlock(java.lang.String str)
          Create a system data block large enough to hold a null-terminated string and fill it with the string.
 Instruction fetchAndDecode(int address)
           
 DynamicArea findDynamicArea(int areaNumber)
          Find a previously-created dyanmic area, given its number.
 long get5ByteValue(int address)
           
 byte getByte(int address)
           
 ByteArray getByteArray(int address, int count, boolean create)
          Get an object which allows direct access to the underlying data block for the specified byte range.
 byte[] getBytes(int address, int count)
          Take a copy of a set of bytes from the memory map.
 DataBlock getDataBlock(int address)
           
 int getImageSize()
           
 int getLoadAddress()
           
 java.awt.Point getPoint(int address)
           
 java.awt.Rectangle getRectangle(int address)
           
 int getWord(int address)
           
 int[] getWords(int address, int count)
           
 void releaseRmaBlock(int address)
           
 void removeSystemDataBlock(DataBlock block)
           
 void replaceDataBlock(DataBlock oldDataBlock, DataBlock newDataBlock)
           
 void resizeSystemDataBlock(DataBlock oldBlock, int newSize)
           
 void setImageSize(int size)
           
 void store5ByteValue(int address, long value)
           
 void storeByte(int address, byte aByte)
           
 void storeBytes(int address, byte[] bytes, int offset, int length)
           
 void storePoint(int address, java.awt.Point p)
           
 void storeRectangle(int address, java.awt.Rectangle r)
           
 void storeString0(int address, java.lang.String s)
           
 void storeStringCR(int address, java.lang.String s)
           
 void storeWord(int address, int word)
           
 void storeWords(int address, int[] words)
           
 
Methods inherited from class com.tapina.robe.runtime.BinaryDataSource
getString0_10_13, getString0, getStringControlTerminated, getStringControlTerminated, getStringN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryMap

public MemoryMap(int loadAddress,
                 byte[] image)
Method Detail

getImageSize

public final int getImageSize()

setImageSize

public final void setImageSize(int size)

getLoadAddress

public final int getLoadAddress()

addEntryPoint

public final CodeBlock addEntryPoint(int address)

addEntryPoint

public final CodeBlock addEntryPoint(CodeBlock codeBlock)

fetchAndDecode

public final Instruction fetchAndDecode(int address)
                                 throws DecoderException
Throws:
DecoderException

getDataBlock

public final DataBlock getDataBlock(int address)

createDataBlock

public final RawDataBlock createDataBlock(int address,
                                          int length)

createSystemDataBlock

public final RawDataBlock createSystemDataBlock(java.lang.String str)
Create a system data block large enough to hold a null-terminated string and fill it with the string.

Parameters:
str - string to populate block with
Returns:
populated data block

createSystemDataBlock

public final RawDataBlock createSystemDataBlock(int length)

resizeSystemDataBlock

public void resizeSystemDataBlock(DataBlock oldBlock,
                                  int newSize)

claimRmaBlock

public final DataBlock claimRmaBlock(int length)

releaseRmaBlock

public final void releaseRmaBlock(int address)

createDynamicArea

public final DynamicArea createDynamicArea(int initialSize,
                                           int maximumSize,
                                           int handlerRoutine,
                                           int handlerWorkspace,
                                           java.lang.String name,
                                           int privileges,
                                           int flags)
Create a new dynamic area. Area numbers allocated are greater than or equal to 256.

Parameters:
initialSize - initial size of area in bytes
maximumSize - maximum size of area in bytes (-1 for unlimited [deprecated])
handlerRoutine - address of handler routine
handlerWorkspace - pointer to workspace for handler (-1 for base of area)
name - name of area
privileges - access privileges to be given to area
flags - settings for area
Returns:
newly created dynamic area

findDynamicArea

public DynamicArea findDynamicArea(int areaNumber)
Find a previously-created dyanmic area, given its number.

Parameters:
areaNumber - dynamic area unique number
Returns:
dynamic area representation, or null if not found

removeSystemDataBlock

public final void removeSystemDataBlock(DataBlock block)

replaceDataBlock

public final void replaceDataBlock(DataBlock oldDataBlock,
                                   DataBlock newDataBlock)

getByte

public final byte getByte(int address)

getByteArray

public final ByteArray getByteArray(int address,
                                    int count,
                                    boolean create)
Description copied from class: BinaryDataSource
Get an object which allows direct access to the underlying data block for the specified byte range.

Specified by:
getByteArray in class BinaryDataSource
Parameters:
address - address for which to find bytes
count - size of byte block to allow access to
create -
Returns:
ByteArray which reads/writes through to underlying data block.

getBytes

public final byte[] getBytes(int address,
                             int count)
Description copied from class: BinaryDataSource
Take a copy of a set of bytes from the memory map. Use BinaryDataSource.getByteArray(int,int,boolean) instead for efficiency.

Specified by:
getBytes in class BinaryDataSource
Parameters:
address - address at which to load bytes
count - number of bytes to load
Returns:
array containing bytes loaded from specified address

getWord

public final int getWord(int address)

get5ByteValue

public final long get5ByteValue(int address)
Specified by:
get5ByteValue in class BinaryDataSource

getWords

public final int[] getWords(int address,
                            int count)
Specified by:
getWords in class BinaryDataSource

storeByte

public final void storeByte(int address,
                            byte aByte)

storeBytes

public final void storeBytes(int address,
                             byte[] bytes,
                             int offset,
                             int length)

storeWord

public final void storeWord(int address,
                            int word)

store5ByteValue

public final void store5ByteValue(int address,
                                  long value)

storeWords

public final void storeWords(int address,
                             int[] words)

createErrorBlock

public final RawDataBlock createErrorBlock(int size)

storeString0

public final void storeString0(int address,
                               java.lang.String s)

storeStringCR

public final void storeStringCR(int address,
                                java.lang.String s)

getRectangle

public java.awt.Rectangle getRectangle(int address)

getPoint

public java.awt.Point getPoint(int address)

storePoint

public void storePoint(int address,
                       java.awt.Point p)

storeRectangle

public void storeRectangle(int address,
                           java.awt.Rectangle r)


Copyright © 2003-2005 . All Rights Reserved.