com.cmpware.fastmodel
Class Field

java.lang.Object
  extended by com.cmpware.fastmodel.Field

public class Field
extends java.lang.Object

This class defines an instruction field used in the FastModel.

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

Author:
SAG

Field Summary
protected  int bits
          The number of bits in the field
static java.lang.String copyright
          Copyright string
protected  int startBit
          The start bit fo the field
 
Constructor Summary
Field(int bits, int startBit)
          Constructor
Field(int bits, int startBit, Symbol[] symbols)
          Constructor
 
Method Summary
static long append(Field a, Field b, long instr)
          This static method appends two fields.
 long get(java.math.BigInteger instr)
          This method extracts the field data from an instruction.
static long get(java.math.BigInteger a, int bits, int startBit)
          This static method extracts a field from a big integer.
 long get(long instr)
          This method extracts the field data from an instruction.
 java.lang.Long symbolLookup(java.lang.String s)
          This method performs a lookup of a symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

bits

protected int bits
The number of bits in the field


startBit

protected int startBit
The start bit fo the field

Constructor Detail

Field

public Field(int bits,
             int startBit)
Constructor

Parameters:
bits - The number of bits in the field
startBit - The start bit of the field

Field

public Field(int bits,
             int startBit,
             Symbol[] symbols)
Constructor

Parameters:
bits - The number of bits in the field
startBit - The start bit of the field
symbols - a symbol table associated with this field.
Method Detail

get

public long get(long instr)
This method extracts the field data from an instruction.

Parameters:
instr - The instruction containing the field.
Returns:
This method returns the field data extracted from an instruction.

get

public long get(java.math.BigInteger instr)
This method extracts the field data from an instruction.

Parameters:
instr - The instruction containing the field.
Returns:
This method returns the field data extracted from an instruction.

symbolLookup

public java.lang.Long symbolLookup(java.lang.String s)
This method performs a lookup of a symbol.

Parameters:
s - the symbol string.
Returns:
the Long value associated with this symbol is returned. If there is no associated value, a null is returned.

append

public static long append(Field a,
                          Field b,
                          long instr)
This static method appends two fields. This is useful for non-contiguous fields sometimes found in instructions.

Parameters:
a - the fields containing the high bits.
b - the Field containing the low bits.
instr - The instruction containing the field.
Returns:
the appended fields are returned.

get

public static long get(java.math.BigInteger a,
                       int bits,
                       int startBit)
This static method extracts a field from a big integer.

Parameters:
a - the big integer containing the field
bits - The number of bits in the field
startBit - The start bit of the field
Returns:
the extracted field is returned.