mars.mips.instructions
Class InstructionSet

java.lang.Object
  |
  +--mars.mips.instructions.InstructionSet

public class InstructionSet
extends java.lang.Object

The list of Instruction objects, each of which represents a MIPS instruction. The instruction may either be basic (translates into binary machine code) or extended (translates into sequence of one or more basic instructions).


Constructor Summary
InstructionSet()
          Creates a new InstructionSet object.
 
Method Summary
 java.util.ArrayList getInstructionList()
          Retrieve the current instruction set.
 java.util.ArrayList matchOperator(java.lang.String name)
          Given an operator mnemonic, will return the corresponding Instruction object(s) from the instruction set.
 void populate()
          Adds all instructions to the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstructionSet

public InstructionSet()
Creates a new InstructionSet object.

Method Detail

getInstructionList

public java.util.ArrayList getInstructionList()
Retrieve the current instruction set.


populate

public void populate()
Adds all instructions to the set. A given extended instruction may have more than one Instruction object, depending on how many formats it can have.

See Also:
Instruction, BasicInstruction, ExtendedInstruction

matchOperator

public java.util.ArrayList matchOperator(java.lang.String name)
Given an operator mnemonic, will return the corresponding Instruction object(s) from the instruction set. Uses straight linear search technique.

Parameters:
name - operator mnemonic (e.g. addi, sw,...)
Returns:
list of corresponding Instruction object(s), or null if not found.