dspl.backend.x86.operands
Class X86IndexMemoryOperand
java.lang.Object
dspl.backend.x86.operands.X86Operand
dspl.backend.x86.operands.X86IndexMemoryOperand
public class X86IndexMemoryOperand
- extends X86Operand
X86IndexedMemoryOperand is an operand of the form: variable(base, index, size)
- variable: an 8, 16, or 32 bit value (from parent variable: either array or complex)
- base: (register) or can be null
- index: an index into the variable specified by displacement
- size: the size of the type of the variable (must be either 2, 4, or 8)
Example:
movl $5, %edx
movl $10, a(,%edx,4)
The above is equivalent to a[5] = 10; //assuming a is an int_array (data type of size 4)
- Author:
- David
|
Method Summary |
void |
freeOperand()
Frees any resources (registers) that have been allocated
for the operand |
int |
getOperandSize()
Returns the operand's byte size, should be either 1, 2, or 4 |
int |
getOperandType()
Returns the X86Operand type, must be one of X86Operand.OPERAND_TYPE_xxx |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
varStr
private java.lang.String varStr
baseRegister
private X86Register baseRegister
indexRegister
private X86Register indexRegister
size
private int size
X86IndexMemoryOperand
public X86IndexMemoryOperand(java.lang.String var,
X86Register baseRegister,
X86Register indexRegister,
int size)
- Used when one wants to explicitly create an IndexMemoryOperand like (%eax, %ecx, 4), which might not have a variable
- Parameters:
var - baseRegister - indexRegister - size -
X86IndexMemoryOperand
public X86IndexMemoryOperand(Variable var,
X86Register baseRegister,
X86Register indexRegister,
int size)
freeOperand
public void freeOperand()
- Description copied from class:
X86Operand
- Frees any resources (registers) that have been allocated
for the operand
- Specified by:
freeOperand in class X86Operand
getOperandType
public int getOperandType()
- Description copied from class:
X86Operand
- Returns the X86Operand type, must be one of X86Operand.OPERAND_TYPE_xxx
- Specified by:
getOperandType in class X86Operand
- Returns:
toString
public java.lang.String toString()
- Specified by:
toString in class X86Operand
- Returns:
- gnu assembler-friendly representation of the operand
getOperandSize
public int getOperandSize()
- Description copied from class:
X86Operand
- Returns the operand's byte size, should be either 1, 2, or 4
- Specified by:
getOperandSize in class X86Operand
- Returns: