com.cmpware.tools
Class Instruction

java.lang.Object
  extended by com.cmpware.tools.Instruction

public class Instruction
extends java.lang.Object

This class describes an instruction for the FastModel. Typically a group of similar instructions will be defined first, then this group definition will be further specialized via inheritance and overloading to produce complete instruction descriptions.

Copyright (c) 2008 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
protected  long address
          The instruction address
protected  Decode decode
          The instruction decoder
protected  int execCount
          The number of times this instruction has been executed
protected  java.lang.String name
          The instruction name
protected  int size
          The instruction size (in bits)
 
Constructor Summary
Instruction(java.lang.String name, Decode decode, int size)
          Constructor
 
Method Summary
 long getAddress()
          This method returns the address of this instruction.
 void getOperands(long instr)
          This method extracts the operands from the instruction fields for use later during instruction execution.
 void setAddress(long address)
          This method sets the address of this instruction.
 java.lang.String toString()
          This method returns a string representation of the instruction typically as a line of disassembled code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The instruction name


size

protected int size
The instruction size (in bits)


decode

protected Decode decode
The instruction decoder


execCount

protected int execCount
The number of times this instruction has been executed


address

protected long address
The instruction address

Constructor Detail

Instruction

public Instruction(java.lang.String name,
                   Decode decode,
                   int size)
Constructor

Parameters:
name - the instruction name.
decode - the instruction decoder.
size - the instruction size, in bits.
Method Detail

toString

public java.lang.String toString()
This method returns a string representation of the instruction typically as a line of disassembled code. This method will most often use local variables set by the getOperands() method.

Overrides:
toString in class java.lang.Object
Returns:
This method returns a string representation of the instruction.

getOperands

public void getOperands(long instr)
This method extracts the operands from the instruction fields for use later during instruction execution. These values should be saved as values local to the Instruction class. Any necessary manipulation of the operand such as sign extension should also be done in this method.

Parameters:
instr - the instruction word.

getAddress

public long getAddress()
This method returns the address of this instruction.

Returns:
This method returns the address of this instruction.

setAddress

public void setAddress(long address)
This method sets the address of this instruction.

Parameters:
address - the address of this instruction.