org.zmpp.vm
Class Short1Instruction

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

public class Short1Instruction
extends AbstractInstruction

This class represents instructions of type SHORT, 1OP.

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_DEC
           
static int OP_GET_CHILD
           
static int OP_GET_PARENT
           
static int OP_GET_PROP_LEN
           
static int OP_GET_SIBLING
           
static int OP_INC
           
static int OP_JUMP
           
static int OP_JZ
          List of opcodes.
static int OP_LOAD
           
static int OP_NOT
           
static int OP_PRINT_ADDR
           
static int OP_PRINT_OBJ
           
static int OP_PRINT_PADDR
           
static int OP_REMOVE_OBJ
           
static int OP_RET
           
 
Fields inherited from class org.zmpp.vm.AbstractInstruction
FALSE, TRUE
 
Constructor Summary
Short1Instruction(Machine machineState, 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 isBranch()
          Returns true, if this instruction is a branch, false, otherwise.
 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, 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_JZ

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

See Also:
Constant Field Values

OP_GET_SIBLING

public static final int OP_GET_SIBLING
See Also:
Constant Field Values

OP_GET_CHILD

public static final int OP_GET_CHILD
See Also:
Constant Field Values

OP_GET_PARENT

public static final int OP_GET_PARENT
See Also:
Constant Field Values

OP_GET_PROP_LEN

public static final int OP_GET_PROP_LEN
See Also:
Constant Field Values

OP_INC

public static final int OP_INC
See Also:
Constant Field Values

OP_DEC

public static final int OP_DEC
See Also:
Constant Field Values

OP_PRINT_ADDR

public static final int OP_PRINT_ADDR
See Also:
Constant Field Values

OP_REMOVE_OBJ

public static final int OP_REMOVE_OBJ
See Also:
Constant Field Values

OP_PRINT_OBJ

public static final int OP_PRINT_OBJ
See Also:
Constant Field Values

OP_RET

public static final int OP_RET
See Also:
Constant Field Values

OP_JUMP

public static final int OP_JUMP
See Also:
Constant Field Values

OP_PRINT_PADDR

public static final int OP_PRINT_PADDR
See Also:
Constant Field Values

OP_LOAD

public static final int OP_LOAD
See Also:
Constant Field Values

OP_NOT

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

Short1Instruction

public Short1Instruction(Machine machineState,
                         int opcode)
Constructor.

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

execute

public void execute()
Execute the instruction.


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

isBranch

public boolean isBranch()
Returns true, if this instruction is a branch, false, otherwise.

Overrides:
isBranch in class AbstractInstruction
Returns:
true if branch, false otherwise


Copyright © 2005 . All Rights Reserved.