com.cmpware.fastmodel
Class Function

java.lang.Object
  extended by com.cmpware.fastmodel.Function
Direct Known Subclasses:
Breakpoint, FastSimple.Branch, FastSimple.BranchImm, FastSimple.Immediate, FastSimple.LoadStore, FastSimple.RegToReg, FastSimple.Unary, IllegalOpcode, NullFunction

public abstract class Function
extends java.lang.Object

This class defines the function of an instruction. There is typically one of these classes defined per instruction type, defining the fields. This is then typically sub-classed for each indivudual instruction in which exec() is defines.

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

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
 
Constructor Summary
Function()
           
 
Method Summary
abstract  void exec(long addr)
          This abstract method implements the instruction execution.
abstract  void extractFields(java.math.BigInteger instr)
          This abstract method is used to copy the field values into local variables where thay are used by the instruction exec() routine.
abstract  Field[] getFormat()
          This method returns an array of fields describing the instruction format.
abstract  int getSize()
          This abstract method returns the size of the instruction in bits.
abstract  java.lang.String toString()
          This method is used to display a string of the Function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values
Constructor Detail

Function

public Function()
Method Detail

getFormat

public abstract Field[] getFormat()
This method returns an array of fields describing the instruction format.

Returns:
this method returns an array of fields describing the instruction format.

getSize

public abstract int getSize()
This abstract method returns the size of the instruction in bits.

Returns:
this abstract method returns the size of the instruction in bits.

extractFields

public abstract void extractFields(java.math.BigInteger instr)
This abstract method is used to copy the field values into local variables where thay are used by the instruction exec() routine.

Parameters:
instr - the instruction word.

toString

public abstract java.lang.String toString()
This method is used to display a string of the Function. This should be a list of the fields as displayed in a typical disassembly. This method is used by the disassembler (along with the instruction name) to produce a disassemble string of the instruction.

Overrides:
toString in class java.lang.Object

exec

public abstract void exec(long addr)
                   throws MemoryAccessException,
                          IllegalRegisterException,
                          IllegalOpcodeException,
                          BreakpointException
This abstract method implements the instruction execution.

Parameters:
addr - the address of this instruction.
Throws:
MemoryAccessException - if an illegal memory access is attempted.
IllegalRegisterException - if an illegal register access is attempted.
IllegalOpcodeException - if an illegal opcode access is attempted.
BreakpointException - if a breakpoint is encountered.