org.zmpp.vm
Class VariableInstruction

java.lang.Object
  extended by org.zmpp.vm.AbstractInstruction
      extended by org.zmpp.vm.VariableInstruction
All Implemented Interfaces:
Instruction

public class VariableInstruction
extends AbstractInstruction

This class represents instructions of type VARIABLE.

Version:
1.0
Author:
Wei-ju Wu

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zmpp.vm.AbstractInstruction
AbstractInstruction.InstructionForm, AbstractInstruction.OperandCount
 
Field Summary
static int OP_CALL
          List of opcodes.
static int OP_INPUTSTREAM
           
static int OP_OUTPUTSTREAM
           
static int OP_PRINT_CHAR
           
static int OP_PRINT_NUM
           
static int OP_PULL
           
static int OP_PUSH
           
static int OP_PUT_PROP
           
static int OP_RANDOM
           
static int OP_SET_WINDOW
           
static int OP_SOUND_EFFECT
           
static int OP_SPLIT_WINDOW
           
static int OP_SREAD
           
static int OP_STOREB
           
static int OP_STOREW
           
 
Fields inherited from class org.zmpp.vm.AbstractInstruction
FALSE, TRUE
 
Constructor Summary
VariableInstruction(Machine machineState, AbstractInstruction.OperandCount operandCount, int opcode)
          Constructor.
 
Method Summary
 void execute()
          Execute the instruction.
 AbstractInstruction.InstructionForm getInstructionForm()
          Returns the instruction's form.
 AbstractInstruction.OperandCount getOperandCount()
          Returns the instruction's operand count type.
 boolean storesResult()
          Returns true, if this instruction stores a result, false, otherwise.
 
Methods inherited from class org.zmpp.vm.AbstractInstruction
addOperand, branchIfTrue, branchOnTest, getBranchOffset, getLength, getMachine, getNumOperands, getOpcode, getOperand, getStoreVariable, getUnsignedValue, getValue, isBranch, nextInstruction, returnFromRoutine, setBranchIfTrue, setBranchOffset, setLength, setOpcode, setStoreVariable, storeResult, throwInvalidOpcode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_CALL

public static final int OP_CALL
List of opcodes. See Z-Machine Standards document 1.0 for explanations.

See Also:
Constant Field Values

OP_STOREW

public static final int OP_STOREW
See Also:
Constant Field Values

OP_STOREB

public static final int OP_STOREB
See Also:
Constant Field Values

OP_PUT_PROP

public static final int OP_PUT_PROP
See Also:
Constant Field Values

OP_SREAD

public static final int OP_SREAD
See Also:
Constant Field Values

OP_PRINT_CHAR

public static final int OP_PRINT_CHAR
See Also:
Constant Field Values

OP_PRINT_NUM

public static final int OP_PRINT_NUM
See Also:
Constant Field Values

OP_RANDOM

public static final int OP_RANDOM
See Also:
Constant Field Values

OP_PUSH

public static final int OP_PUSH
See Also:
Constant Field Values

OP_PULL

public static final int OP_PULL
See Also:
Constant Field Values

OP_SPLIT_WINDOW

public static final int OP_SPLIT_WINDOW
See Also:
Constant Field Values

OP_SET_WINDOW

public static final int OP_SET_WINDOW
See Also:
Constant Field Values

OP_OUTPUTSTREAM

public static final int OP_OUTPUTSTREAM
See Also:
Constant Field Values

OP_INPUTSTREAM

public static final int OP_INPUTSTREAM
See Also:
Constant Field Values

OP_SOUND_EFFECT

public static final int OP_SOUND_EFFECT
See Also:
Constant Field Values
Constructor Detail

VariableInstruction

public VariableInstruction(Machine machineState,
                           AbstractInstruction.OperandCount operandCount,
                           int opcode)
Constructor.

Parameters:
machineState - a reference to a MachineState object
operandCount - the operand count
opcode - the instruction's opcode
Method Detail

getInstructionForm

public AbstractInstruction.InstructionForm getInstructionForm()
Returns the instruction's form.

Specified by:
getInstructionForm in class AbstractInstruction
Returns:
the instruction form

getOperandCount

public AbstractInstruction.OperandCount getOperandCount()
Returns the instruction's operand count type.

Specified by:
getOperandCount in class AbstractInstruction
Returns:
the operand count type

storesResult

public boolean storesResult()
Returns true, if this instruction stores a result, false, otherwise.

Overrides:
storesResult in class AbstractInstruction
Returns:
true if a result is stored, false otherwise

execute

public void execute()
Execute the instruction.



Copyright © 2005 . All Rights Reserved.