edu.ustc.cs.compile.arch
类 Instruct.Operand

java.lang.Object
  继承者 edu.ustc.cs.compile.arch.Instruct.Operand
正在封闭类:
Instruct

public static class Instruct.Operand
extends java.lang.Object

Provides a representation of the operand of the instruct in the assembly language codes.
An operand could be a register, a register variable, an immediate number, a register plus an offset, a register variable plus an offset, or a label.


字段摘要
private  Label label
           
private  java.lang.Integer number
           
private  java.lang.Integer offset
           
private  Register reg
           
private  RegisterVariable regVar
           
private  X86Integer x86number
           
 
构造函数摘要
Instruct.Operand(java.lang.Integer n)
          Constructs an operand which is an immediate number.
Instruct.Operand(Label label)
          Constructs an operand which is a label.
Instruct.Operand(Register reg)
          Constructs an operand which is a register.
Instruct.Operand(Register reg, java.lang.Integer offset)
          Constructs an operand which is a register plus an offset.
Instruct.Operand(RegisterVariable regVar)
          Constructs an operand which is a register variable.
Instruct.Operand(RegisterVariable regVar, java.lang.Integer offset)
          Constructs an operand which is a register variable plus an offset.
Instruct.Operand(X86Integer n)
          Constructs an X86 operand which is an immediate number.
 
方法摘要
 boolean hasOffset()
          Indicates whether this operand consists of an offset.
 boolean isLabel()
          Indicates whether this operand is a label.
 boolean isNumber()
          Indicates whether this operand is an immediate number.
 boolean isRegister()
          Indicates whether this operand consists of a register.
 boolean isRegisterVariable()
          Indicates whether this operand consists of a register variable.
 boolean isX86Number()
          Indicates whether this operand is an X86 immediate number.
 Label label()
          Gets the operand as a label.
 java.lang.Integer number()
          Gets the operand as an immediate number.
 java.lang.Integer offset()
          Gets the offset in this operand.
 Register register()
          Gets the the register in the operand.
 RegisterVariable registerVariable()
          Gets the register variable in the operand.
 java.lang.String toString()
          Returns a string representation of this operand.
 X86Integer x86Number()
          Gets the x86 operand as an immediate number.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

reg

private Register reg

regVar

private RegisterVariable regVar

label

private Label label

number

private java.lang.Integer number

offset

private java.lang.Integer offset

x86number

private X86Integer x86number
构造函数详细信息

Instruct.Operand

public Instruct.Operand(Register reg)
Constructs an operand which is a register.

参数:
reg - the register.

Instruct.Operand

public Instruct.Operand(Register reg,
                        java.lang.Integer offset)
Constructs an operand which is a register plus an offset.

参数:
reg - the register.
offset - the offset.

Instruct.Operand

public Instruct.Operand(RegisterVariable regVar)
Constructs an operand which is a register variable.

参数:
regVar - the register variable.

Instruct.Operand

public Instruct.Operand(RegisterVariable regVar,
                        java.lang.Integer offset)
Constructs an operand which is a register variable plus an offset.

参数:
regVar - the register variable.
offset - the offset.

Instruct.Operand

public Instruct.Operand(java.lang.Integer n)
Constructs an operand which is an immediate number.

参数:
n - the immediate number.

Instruct.Operand

public Instruct.Operand(X86Integer n)
Constructs an X86 operand which is an immediate number.

参数:
n - the immediate number.

Instruct.Operand

public Instruct.Operand(Label label)
Constructs an operand which is a label.

参数:
label - the label.
方法详细信息

register

public Register register()
Gets the the register in the operand.

返回:
the register, or null if this operand does not consist of a register.

registerVariable

public RegisterVariable registerVariable()
Gets the register variable in the operand.

返回:
the register variable, or null if this operand does not consist of a register variable.

number

public java.lang.Integer number()
Gets the operand as an immediate number.

返回:
the immediate number, or null if this operand is not an immediate number.

x86Number

public X86Integer x86Number()
Gets the x86 operand as an immediate number.

返回:
the immediate number, or null if this operand is not an immediate number.

label

public Label label()
Gets the operand as a label.

返回:
the label, or null if this operand is not a label.

offset

public java.lang.Integer offset()
Gets the offset in this operand.

返回:
the offset, or null if this operand does not consist of an offset.

isRegister

public boolean isRegister()
Indicates whether this operand consists of a register.

返回:
true if this operand consists of a register.

isRegisterVariable

public boolean isRegisterVariable()
Indicates whether this operand consists of a register variable.

返回:
true if this operand consists of a register variable.

isNumber

public boolean isNumber()
Indicates whether this operand is an immediate number.

返回:
true if this operand is an immediate number.

isX86Number

public boolean isX86Number()
Indicates whether this operand is an X86 immediate number.

返回:
true if this operand is an immediate number.

isLabel

public boolean isLabel()
Indicates whether this operand is a label.

返回:
true if this operand is a label.

hasOffset

public boolean hasOffset()
Indicates whether this operand consists of an offset.

返回:
true if this operand consists of an offset.

toString

public java.lang.String toString()
Returns a string representation of this operand.

覆盖:
java.lang.Object 中的 toString
返回:
the string representation of this operand.