edu.ustc.cs.compile.arch
类 Instruct

java.lang.Object
  继承者 edu.ustc.cs.compile.arch.AssemblyElement
      继承者 edu.ustc.cs.compile.arch.Instruct

public class Instruct
extends AssemblyElement

Provides a representation of the instruct in the assembly language codes.

An instruct consists of an opcode, which is followed by a list of operands( or no operands for some opcodes).
For example,
add $s0,$s1,$s2
where, "add" is an opcode, "$s0", "$s1" and "$s2" are the operands.
The examples of representing the instructs of x86 assembly language and mips assembly language can be respectively found in the descriptions of X86Opcode and MIPSOpcode.


嵌套类摘要
static class Instruct.Operand
          Provides a representation of the operand of the instruct in the assembly language codes.
 
字段摘要
private  Opcode opcode
           
private  java.util.List<Instruct.Operand> operands
           
 
构造函数摘要
Instruct(Opcode opcode, java.util.List<Instruct.Operand> operands)
          Constructs an object to represent an instruct.
 
方法摘要
 Opcode opcode()
          Gets the opcode of this instruct.
 java.util.List<Instruct.Operand> operands()
          Gets the operands of this instruct.
 java.lang.String toString()
          Returns a string representation of the instruct.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

opcode

private Opcode opcode

operands

private java.util.List<Instruct.Operand> operands
构造函数详细信息

Instruct

public Instruct(Opcode opcode,
                java.util.List<Instruct.Operand> operands)
Constructs an object to represent an instruct.

参数:
opcode - the opcode of this instruct
operands - a list of the operands of this instruct. It should be null, if the operands has no operands. The member of this list is of type Operand.
方法详细信息

opcode

public Opcode opcode()
Gets the opcode of this instruct.

返回:
the opcode of this instruct.

operands

public java.util.List<Instruct.Operand> operands()
Gets the operands of this instruct.

返回:
a list of the operands ,or null if this instruct has no operand. The member of this list is of type Operand.

toString

public java.lang.String toString()
Returns a string representation of the instruct. The representation consists of the string representation of the opcode, which is followed by the string representations of the operands seperated by the comma.

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