com.cmpware.tools
Class AutoModel.Field

java.lang.Object
  extended by com.cmpware.tools.AutoModel.Field
Enclosing class:
AutoModel

public static final class AutoModel.Field
extends java.lang.Object

This class defines an instruction field. The field is given the number of bits and the start of the field. It also may contain a list of symbols which may map to the values of the bits in this field.


Field Summary
 boolean asmDasmIgnore
          Completely ignore this field in the assembler / disassembler
 int bits
          The number of bits in the field
 int dataType
          The data type of the field (currently UNSIGNED_INT or SIGNED_INT)
static int HEX_INT
          The hexadecimal integer field data type
 boolean isDecode
          The decode field (used to ignore decode fields)
static int SIGNED_INT
          The signed integer field data type
 int start
          The start bit fo the field
 java.util.Hashtable symbolNameLookup
          This looks up symbols by name
 java.util.Hashtable symbolValueLookup
          This looks up symbols by value
static int UNSIGNED_INT
          The unsigned integer field data type
 int val
          A temporary place to store the value of the field
 
Constructor Summary
AutoModel.Field(int bits, int start)
          Constructor
AutoModel.Field(int bits, int start, AutoModel.Symbol[] symbols)
          Constructor
AutoModel.Field(int bits, int start, boolean isDecode)
          Constructor
AutoModel.Field(int bits, int start, boolean isDecode, boolean asmDasmIgnore)
          Constructor
AutoModel.Field(int bits, int start, int dataType)
          Constructor
 
Method Summary
 int get(long instr)
          This method extracts the field data from an instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGNED_INT

public static final int SIGNED_INT
The signed integer field data type

See Also:
Constant Field Values

UNSIGNED_INT

public static final int UNSIGNED_INT
The unsigned integer field data type

See Also:
Constant Field Values

HEX_INT

public static final int HEX_INT
The hexadecimal integer field data type

See Also:
Constant Field Values

bits

public int bits
The number of bits in the field


start

public int start
The start bit fo the field


isDecode

public boolean isDecode
The decode field (used to ignore decode fields)


asmDasmIgnore

public boolean asmDasmIgnore
Completely ignore this field in the assembler / disassembler


dataType

public int dataType
The data type of the field (currently UNSIGNED_INT or SIGNED_INT)


val

public int val
A temporary place to store the value of the field


symbolNameLookup

public java.util.Hashtable symbolNameLookup
This looks up symbols by name


symbolValueLookup

public java.util.Hashtable symbolValueLookup
This looks up symbols by value

Constructor Detail

AutoModel.Field

public AutoModel.Field(int bits,
                       int start,
                       AutoModel.Symbol[] symbols)
Constructor

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

AutoModel.Field

public AutoModel.Field(int bits,
                       int start)
Constructor

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

AutoModel.Field

public AutoModel.Field(int bits,
                       int start,
                       boolean isDecode)
Constructor

Parameters:
bits - The number of bits in the field
start - The start bit of the field
isDecode - True if this is a decode field. This is used by the assembler and disassembler to ignore the decode fields. This could also be used to tag any fields which the assembler and disassembler should ignore.

AutoModel.Field

public AutoModel.Field(int bits,
                       int start,
                       boolean isDecode,
                       boolean asmDasmIgnore)
Constructor

Parameters:
bits - The number of bits in the field
start - The start bit of the field
isDecode - True if this is a decode field. This is used by the assembler and disassembler to ignore the decode fields.
asmDasmIgnore - True if this field should be ignored by the assembler / disassembler. This is rarely necessary, and is most commonly used in fields that are disjoint. While these fields must be manually merged, at least one half should be completely by the assembler and disassembler. Note that this is somewhat similar to the way the tools ignore decode fields, but this also indicates that this field does not participate in the decode, either.

AutoModel.Field

public AutoModel.Field(int bits,
                       int start,
                       int dataType)
Constructor

Parameters:
bits - The number of bits in the field
start - The start bit of the field
dataType - this data typr of this field. Currently SIGNED_INT, UNSIGNED_INT and HEX_INT are supported.
Method Detail

get

public int 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.