org.zmpp.vm
Class PrintLiteralInstruction

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

public class PrintLiteralInstruction
extends AbstractInstruction

This class implements the print and print_ret instructions.

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_PRINT
           
static int OP_PRINT_RET
           
 
Fields inherited from class org.zmpp.vm.AbstractInstruction
FALSE, TRUE
 
Constructor Summary
PrintLiteralInstruction(Machine machineState, int opcode, MemoryReadAccess memaccess, int instrAddress)
          Constructor.
 
Method Summary
 void execute()
          Execute the instruction.
 AbstractInstruction.InstructionForm getInstructionForm()
          Returns the instruction's form.
 int getLength()
          Returns the instruction's length in bytes.
 int getLiteralAddress()
          Returns the address of the literal.
 AbstractInstruction.OperandCount getOperandCount()
          Returns the instruction's operand count type.
 void setLength(int length)
          Sets the instruction's length in bytes.
 
Methods inherited from class org.zmpp.vm.AbstractInstruction
addOperand, branchIfTrue, branchOnTest, getBranchOffset, getMachine, getNumOperands, getOpcode, getOperand, getStoreVariable, getUnsignedValue, getValue, isBranch, nextInstruction, returnFromRoutine, setBranchIfTrue, setBranchOffset, setOpcode, setStoreVariable, storeResult, storesResult, throwInvalidOpcode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_PRINT

public static final int OP_PRINT
See Also:
Constant Field Values

OP_PRINT_RET

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

PrintLiteralInstruction

public PrintLiteralInstruction(Machine machineState,
                               int opcode,
                               MemoryReadAccess memaccess,
                               int instrAddress)
Constructor.

Parameters:
machineState - the machine state reference
opcode - the opcode
memaccess - the memory access object
instrAddress - the instruction address
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

setLength

public void setLength(int length)
Sets the instruction's length in bytes.

Overrides:
setLength in class AbstractInstruction
Parameters:
length - the length in bytes

getLength

public int getLength()
Returns the instruction's length in bytes.

Overrides:
getLength in class AbstractInstruction
Returns:
the instruction length

execute

public void execute()
Execute the instruction.


getLiteralAddress

public int getLiteralAddress()
Returns the address of the literal.

Returns:
the address of the literal


Copyright © 2005 . All Rights Reserved.