RoboJDETM v2.0

com.ridgesoft.vm
Class VM

java.lang.Object
  extended by com.ridgesoft.vm.VM

public class VM
extends Object

Virtual Machine support class.


Field Summary
static boolean mTraceBreak
          Controls whether a breakpoint should be executed when an exception occurs.
 
Method Summary
static void breakpoint()
          Executes a breakpoint to stop execution of the application.
static void clearBit(int address, int bit)
          Clears a bit in the byte at the specified address.
static OutputStream getDebugOutputStream()
          Gets the output stream for the debug output display.
static boolean isSet(int address, int bit)
          Tests to see if the bit in the byte at the specified address is set.
static byte readByte(int address)
          Reads one byte directly from memory.
static int readInt(int address)
          Reads an int value directly from memory.
static byte readProgramByte(int address)
          Reads one byte directly from program memory.
static short readShort(int address)
          Reads a short value directly from memory.
static boolean sendMessage(byte[] message)
          Send a message to the host PC.
static void setBit(int address, int bit)
          Sets a bit in the byte at the specified address.
static void setDebug(boolean debug)
          Enables or disables virtual machine debug checks.
static void setStackSize(Thread thread, int stackSize)
          Sets the stack size for the specified thread.
static void setTraceBreak(boolean traceBreak)
          Sets the trace break flag.
static void setWatch(int address)
          Sets the debug watch point to the specified address.
static void setWatch(Object object)
          Sets the debug watch point to the specified object.
static void writeByte(int address, byte value)
          Writes one byte directly to memory.
static void writeInt(int address, int value)
          Writes an int value directly to memory.
static void writeShort(int address, short value)
          Writes a short value directly to memory.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Field Detail

mTraceBreak

public static boolean mTraceBreak
Controls whether a breakpoint should be executed when an exception occurs.

Use the setTraceBreak method to set this variable rather than referencing it directly.

See Also:
setTraceBreak(boolean)
Method Detail

breakpoint

public static void breakpoint()
Executes a breakpoint to stop execution of the application.


clearBit

public static void clearBit(int address,
                            int bit)
Clears a bit in the byte at the specified address.

Note: Extreme care should be taken to avoid corrupting memory used by the virtual machine or the application when using this method.

Parameters:
address - address of byte to modify
bit - number of bit to clear (0-7, 0 = least significant)

getDebugOutputStream

public static OutputStream getDebugOutputStream()
Gets the output stream for the debug output display.

Returns:
the LcdOutputStream object

isSet

public static boolean isSet(int address,
                            int bit)
Tests to see if the bit in the byte at the specified address is set.

Parameters:
address - address of byte to test
bit - number of bit to test (0-7, 0 = least significant)
Returns:
true if the bit is set

readByte

public static byte readByte(int address)
Reads one byte directly from memory.

Parameters:
address - address to read
Returns:
value read

readInt

public static int readInt(int address)
Reads an int value directly from memory.

Parameters:
address - address to read
Returns:
value read

readProgramByte

public static byte readProgramByte(int address)
Reads one byte directly from program memory.

Parameters:
address - address to read
Returns:
value read

readShort

public static short readShort(int address)
Reads a short value directly from memory.

Parameters:
address - address to read
Returns:
value read

sendMessage

public static boolean sendMessage(byte[] message)
Send a message to the host PC.

This method is for internal use only. End users should not attempt to use this method.

Parameters:
message - message to send

setBit

public static void setBit(int address,
                          int bit)
Sets a bit in the byte at the specified address.

Note: Extreme care should be taken to avoid corrupting memory used by the virtual machine or the application when using this method.

Parameters:
address - address of byte to modify
bit - number of bit to set (0-7, 0 = least significant)

setDebug

public static void setDebug(boolean debug)
Enables or disables virtual machine debug checks.

Enabling debug slows execution but may be useful in isolating problems with the virtual machine.

Parameters:
debug - true to enable debug checks, false to disable debug checks

setStackSize

public static void setStackSize(Thread thread,
                                int stackSize)
Sets the stack size for the specified thread.

This method can be used to reduce or enlarge the size of the stack allocated for a particular thread. This method is only effective if invoked before invoking the thread's start method.

Parameters:
thread - thread
stackSize - size of the stack in bytes

setTraceBreak

public static void setTraceBreak(boolean traceBreak)
Sets the trace break flag.

When set to true, calls to printStackTrace will result in a virtual machine breakpoint before and after the stack trace is printed. This is intended to help debugging by providing a means to view the an exception message before it scrolls off of a small display.

Parameters:
traceBreak - true to enable breakpoints in printStackTrace, false to disable

setWatch

public static void setWatch(int address)
Sets the debug watch point to the specified address.

Parameters:
address - address to watch

setWatch

public static void setWatch(Object object)
Sets the debug watch point to the specified object.

Parameters:
object - object to watch.

writeByte

public static void writeByte(int address,
                             byte value)
Writes one byte directly to memory.

Note: Extreme care should be taken to avoid corrupting memory used by the virtual machine or the application when using this method.

Parameters:
address - address to write to
value - value to write

writeInt

public static void writeInt(int address,
                            int value)
Writes an int value directly to memory.

Note: Extreme care should be taken to avoid corrupting memory used by the virtual machine or the application when using this method.

Parameters:
address - address to write to
value - value to write

writeShort

public static void writeShort(int address,
                              short value)
Writes a short value directly to memory.

Note: Extreme care should be taken to avoid corrupting memory used by the virtual machine or the application when using this method.

Parameters:
address - address to write to
value - value to write

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com