org.zmpp.vm
Class LongInstruction

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

public class LongInstruction
extends AbstractInstruction

This class represents instructions of type LONG, 2OP.

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_ADD
           
static int OP_AND
           
static int OP_CLEAR_ATTR
           
static int OP_DEC_CHK
           
static int OP_DIV
           
static int OP_GET_NEXT_PROP
           
static int OP_GET_PROP
           
static int OP_GET_PROP_ADDR
           
static int OP_INC_CHK
           
static int OP_INSERT_OBJ
           
static int OP_JE
          List of opcodes.
static int OP_JG
           
static int OP_JIN
           
static int OP_JL
           
static int OP_LOADB
           
static int OP_LOADW
           
static int OP_MOD
           
static int OP_MUL
           
static int OP_OR
           
static int OP_SET_ATTR
           
static int OP_STORE
           
static int OP_SUB
           
static int OP_TEST
           
static int OP_TEST_ATTR
           
 
Fields inherited from class org.zmpp.vm.AbstractInstruction
FALSE, TRUE
 
Constructor Summary
LongInstruction(Machine machineState, AbstractInstruction.OperandCount operandCount, int opcode)
          Constructor.
LongInstruction(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_JE

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

See Also:
Constant Field Values

OP_JL

public static final int OP_JL
See Also:
Constant Field Values

OP_JG

public static final int OP_JG
See Also:
Constant Field Values

OP_DEC_CHK

public static final int OP_DEC_CHK
See Also:
Constant Field Values

OP_INC_CHK

public static final int OP_INC_CHK
See Also:
Constant Field Values

OP_JIN

public static final int OP_JIN
See Also:
Constant Field Values

OP_TEST

public static final int OP_TEST
See Also:
Constant Field Values

OP_OR

public static final int OP_OR
See Also:
Constant Field Values

OP_AND

public static final int OP_AND
See Also:
Constant Field Values

OP_TEST_ATTR

public static final int OP_TEST_ATTR
See Also:
Constant Field Values

OP_SET_ATTR

public static final int OP_SET_ATTR
See Also:
Constant Field Values

OP_CLEAR_ATTR

public static final int OP_CLEAR_ATTR
See Also:
Constant Field Values

OP_STORE

public static final int OP_STORE
See Also:
Constant Field Values

OP_INSERT_OBJ

public static final int OP_INSERT_OBJ
See Also:
Constant Field Values

OP_LOADW

public static final int OP_LOADW
See Also:
Constant Field Values

OP_LOADB

public static final int OP_LOADB
See Also:
Constant Field Values

OP_GET_PROP

public static final int OP_GET_PROP
See Also:
Constant Field Values

OP_GET_PROP_ADDR

public static final int OP_GET_PROP_ADDR
See Also:
Constant Field Values

OP_GET_NEXT_PROP

public static final int OP_GET_NEXT_PROP
See Also:
Constant Field Values

OP_ADD

public static final int OP_ADD
See Also:
Constant Field Values

OP_SUB

public static final int OP_SUB
See Also:
Constant Field Values

OP_MUL

public static final int OP_MUL
See Also:
Constant Field Values

OP_DIV

public static final int OP_DIV
See Also:
Constant Field Values

OP_MOD

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

LongInstruction

public LongInstruction(Machine machineState,
                       int opcode)
Constructor.

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

LongInstruction

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

Parameters:
machineState - the machine state
operandCount - the operand count
opcode - the 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.