dspl.backend.x86.operands
Class X86Operand

java.lang.Object
  extended by dspl.backend.x86.operands.X86Operand
Direct Known Subclasses:
X86ImmediateOperand, X86IndexMemoryOperand, X86MemoryOperand, X86Register

public abstract class X86Operand
extends java.lang.Object

Base Class representing an operand to an X86 instruction
See IA32 Manual 1: 3.7 Operand Addressing

Author:
David

Field Summary
static int OPERAND_CLASS_ANY
           
static int OPERAND_CLASS_LVALUE
          Class of operands that can be on the destination end of an operation (so called lvalue becuase they can appear on the left of a "dest = arg" expressioN)
static int OPERAND_TYPE_IMMEDIATE
           
static int OPERAND_TYPE_INDEXED_MEMORY
           
static int OPERAND_TYPE_MEMORY
           
static int OPERAND_TYPE_REGISTER
           
 
Constructor Summary
X86Operand()
           
 
Method Summary
abstract  void freeOperand()
          Frees any resources (registers) that have been allocated for the operand
abstract  int getOperandSize()
          Returns the operand's byte size, should be either 1, 2, or 4
abstract  int getOperandType()
          Returns the X86Operand type, must be one of X86Operand.OPERAND_TYPE_xxx
 boolean isMemoryType()
          Returns whether the Operand contains a memory-based type (either OPERAND_TYPE_MEMORY or OPERAND_TYPE_INDEXED_MEMORY)
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERAND_TYPE_IMMEDIATE

public static final int OPERAND_TYPE_IMMEDIATE
See Also:
Constant Field Values

OPERAND_TYPE_MEMORY

public static final int OPERAND_TYPE_MEMORY
See Also:
Constant Field Values

OPERAND_TYPE_INDEXED_MEMORY

public static final int OPERAND_TYPE_INDEXED_MEMORY
See Also:
Constant Field Values

OPERAND_TYPE_REGISTER

public static final int OPERAND_TYPE_REGISTER
See Also:
Constant Field Values

OPERAND_CLASS_LVALUE

public static final int OPERAND_CLASS_LVALUE
Class of operands that can be on the destination end of an operation (so called lvalue becuase they can appear on the left of a "dest = arg" expressioN)

See Also:
Constant Field Values

OPERAND_CLASS_ANY

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

X86Operand

public X86Operand()
Method Detail

isMemoryType

public boolean isMemoryType()
Returns whether the Operand contains a memory-based type (either OPERAND_TYPE_MEMORY or OPERAND_TYPE_INDEXED_MEMORY)

Returns:
true if operand is a memory-based operand

freeOperand

public abstract void freeOperand()
Frees any resources (registers) that have been allocated for the operand


getOperandType

public abstract int getOperandType()
Returns the X86Operand type, must be one of X86Operand.OPERAND_TYPE_xxx

Returns:

getOperandSize

public abstract int getOperandSize()
Returns the operand's byte size, should be either 1, 2, or 4

Returns:

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
gnu assembler-friendly representation of the operand