org.zmpp.vm
Class RoutineContext

java.lang.Object
  extended by org.zmpp.vm.RoutineContext

public class RoutineContext
extends Object

This class holds information about a subroutine.

Version:
1.0
Author:
Wei-ju Wu

Constructor Summary
RoutineContext(int startAddress, int numLocalVariables)
          Constructor.
 
Method Summary
 int getInvocationStackPointer()
          Returns the stack pointer at invocation time.
 short getLocalVariable(int localNum)
          Retrieves the value of the specified local variable.
 int getNumArguments()
          Returns the number of arguments.
 int getNumLocalVariables()
          Returns the number of local variables.
 int getReturnAddress()
          Returns the routine's return address.
 int getReturnVariable()
          Returns the routine's return variable number.
 int getStartAddress()
          Returns this routine's start address.
 void setInvocationStackPointer(int stackpointer)
          Sets the stack pointer at invocation time.
 void setLocalVariable(int localNum, short value)
          Sets a value to the specified local variable.
 void setNumArguments(int numArgs)
          Sets the number of arguments.
 void setReturnAddress(int address)
          Sets the return address.
 void setReturnVariable(int varnum)
          Sets the routine's return variable number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoutineContext

public RoutineContext(int startAddress,
                      int numLocalVariables)
Constructor.

Parameters:
startAddress - the routine's start address
numLocalVariables - the number of local variables
Method Detail

setNumArguments

public void setNumArguments(int numArgs)
Sets the number of arguments.

Parameters:
numArgs - the number of arguments

getNumArguments

public int getNumArguments()
Returns the number of arguments.

Returns:
the number of arguments

getNumLocalVariables

public int getNumLocalVariables()
Returns the number of local variables.

Returns:
the number of local variables

setLocalVariable

public void setLocalVariable(int localNum,
                             short value)
Sets a value to the specified local variable.

Parameters:
localNum - the local variable number, starting with 0
value - the value

getLocalVariable

public short getLocalVariable(int localNum)
Retrieves the value of the specified local variable.

Parameters:
localNum - the local variable number, starting at 0
Returns:
the value of the specified variable

getStartAddress

public int getStartAddress()
Returns this routine's start address.

Returns:
the start address

getReturnAddress

public int getReturnAddress()
Returns the routine's return address.

Returns:
the routine's return address

setReturnAddress

public void setReturnAddress(int address)
Sets the return address.

Parameters:
address - the return address

getReturnVariable

public int getReturnVariable()
Returns the routine's return variable number.

Returns:
the return variable number

setReturnVariable

public void setReturnVariable(int varnum)
Sets the routine's return variable number.

Parameters:
varnum - the return variable number

getInvocationStackPointer

public int getInvocationStackPointer()
Returns the stack pointer at invocation time.

Returns:
the stack pointer at invocation time

setInvocationStackPointer

public void setInvocationStackPointer(int stackpointer)
Sets the stack pointer at invocation time.

Parameters:
stackpointer - the stack pointer at invocation time.


Copyright © 2005 . All Rights Reserved.